Commit 038b99e2 by lichengming

修改了试验委托登记页面

parent c2c17d7e
...@@ -81,5 +81,8 @@ export default { ...@@ -81,5 +81,8 @@ export default {
.post('soil/v1/sample/prepare_ok', JSON.stringify(data)) .post('soil/v1/sample/prepare_ok', JSON.stringify(data))
.then(res => res), .then(res => res),
// 试验室按样品分页列表 // 试验室按样品分页列表
pageTake: data => http.post('soil/v1/sample/page_take', data).then(res => res) pageTake: data =>
http.post('soil/v1/sample/page_take', data).then(res => res),
testType: data =>
http.post('res/v1/dict/dict_query?type=' + data).then(res => res)
} }
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</Spin> </Spin>
</div> </div>
<div> <div>
<Button v-if="hideDownloadBtn===undefined" size="large" @click="_download">下载模板</Button> <Button v-if="hideDownloadBtn===undefined" @click="_download" size="large">下载模板</Button>
</div> </div>
<div slot="footer" class="btn-width"> <div slot="footer" class="btn-width">
...@@ -65,7 +65,7 @@ export default { ...@@ -65,7 +65,7 @@ export default {
}, },
errorMessage: '', errorMessage: '',
successMessage: '', successMessage: '',
format: ['xlsx', 'xls'], format: ['xlsx', 'xls', 'doc', 'docx'],
importUrl: '', importUrl: '',
downloadUrl: '', downloadUrl: '',
// 500的提示语 // 500的提示语
...@@ -130,7 +130,9 @@ export default { ...@@ -130,7 +130,9 @@ export default {
title: '文件格式不正确', title: '文件格式不正确',
duration: 10, duration: 10,
desc: desc:
'文件 ' + file.name + ' 格式不正确,请上传格式为 .xlsx、xls 的文件!' '文件 ' +
file.name +
' 格式不正确,请上传格式为 .xlsx、xls、doc、docx 的文件!'
}) })
this.isLoad = false this.isLoad = false
} }
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<Input v-model="formObj.boreholeLocation" name="boreholeLocation" placeholder="请输入名称"/> <Input v-model="formObj.boreholeLocation" name="boreholeLocation" placeholder="请输入名称"/>
</Form-item> </Form-item>
<Form-item label="水深(米)" prop="waterDepth" class="width-48"> <Form-item label="水深(米)" prop="waterDepth" class="width-48">
<Input v-model="formObj.waterDepth" name="waterDepth" placeholder="请输入名称"/> <Input v-model="formObj.waterDepth" name="waterDepth" placeholder="请输入深度"/>
</Form-item> </Form-item>
<Form-item label="制单日期:" prop="tabulateDate" class="width-48"> <Form-item label="制单日期:" prop="tabulateDate" class="width-48">
<Date-picker v-model="formObj.tabulateDate" @on-change="_tabulateChange" name="tabulateDate" type="date" split-panels style="width:100%;" <Date-picker v-model="formObj.tabulateDate" @on-change="_tabulateChange" name="tabulateDate" type="date" split-panels style="width:100%;"
...@@ -29,8 +29,18 @@ ...@@ -29,8 +29,18 @@
<Form-item label="制表人" prop="tabulater" class="width-48"> <Form-item label="制表人" prop="tabulater" class="width-48">
<Input v-model="formObj.tabulater" name="tabulater" placeholder="请输入名称"/> <Input v-model="formObj.tabulater" name="tabulater" placeholder="请输入名称"/>
</Form-item> </Form-item>
<Form-item label="检验类别" prop="testType" class="width-48"> <!-- <Form-item label="检验类别" prop="testType" class="width-48">-->
<Input v-model="formObj.testType" name="testType" placeholder="请输入名称"/> <!-- <Input v-model="formObj.testType" name="testType" placeholder="请输入名称"/>-->
<!-- </Form-item>-->
<Form-item label="检验类别:" prop="testType" class="width-48">
<el-select v-model="formObj.testType" placeholder="请选择" name="testType" style="width: 100%">
<el-option
v-for="(item,index) in typeoptions"
:key="index"
:label="item.name"
:value="item.key"
/>
</el-select>
</Form-item> </Form-item>
</Form> </Form>
</div> </div>
...@@ -124,6 +134,13 @@ export default { ...@@ -124,6 +134,13 @@ export default {
callback() callback()
} }
} }
const validwaterdepth = (rule, value, callback) => {
if (this.formObj.waterDepth === '') {
callback(new Error('水深不能为空'))
} else {
callback()
}
}
const validateRemark = (rule, value, callback) => { const validateRemark = (rule, value, callback) => {
if (this.testedCityData.length === 0) { if (this.testedCityData.length === 0) {
callback(new Error('内容不能为空')) callback(new Error('内容不能为空'))
...@@ -208,6 +225,7 @@ export default { ...@@ -208,6 +225,7 @@ export default {
name: '外观检查' name: '外观检查'
} }
], ],
typeoptions: [],
id: '', id: '',
modalTitle: '', modalTitle: '',
subcontractorId: '', subcontractorId: '',
...@@ -224,6 +242,28 @@ export default { ...@@ -224,6 +242,28 @@ export default {
trigger: ['blur', 'change'] trigger: ['blur', 'change']
} }
], ],
boreholeName: [
{
required: true,
message: '钻孔名称不能为空',
trigger: 'blur'
}
],
boreholeLocation: [
{
required: true,
message: '钻孔位置不能为空',
trigger: 'blur'
}
],
waterDepth: [
{
required: true,
validator: validwaterdepth,
message: '水深不能为空',
trigger: 'blur'
}
],
entrustDate: [ entrustDate: [
{ {
required: true, required: true,
...@@ -686,6 +726,7 @@ export default { ...@@ -686,6 +726,7 @@ export default {
}, },
_open(formObj) { _open(formObj) {
this._getList() this._getList()
this._getTestType()
this.showBtn = true this.showBtn = true
this.showModal = true this.showModal = true
this.$refs.formObj.resetFields() this.$refs.formObj.resetFields()
...@@ -703,7 +744,9 @@ export default { ...@@ -703,7 +744,9 @@ export default {
} }
}, },
_openEdit(formObj) { _openEdit(formObj) {
console.log(formObj)
this._getList() this._getList()
this._getTestType()
this.showBtn = false this.showBtn = false
this.showModal = true this.showModal = true
this.$refs.formObj.resetFields() this.$refs.formObj.resetFields()
...@@ -725,6 +768,14 @@ export default { ...@@ -725,6 +768,14 @@ export default {
// } // }
// } // }
}, },
_getTestType: async function() {
const result = await soilEntrust.testType('检验类别')
console.log(result)
if (result) {
console.log(result)
this.typeoptions = result
}
},
_showTime(formObj) { _showTime(formObj) {
if (this.formObj.entrustDate === undefined) { if (this.formObj.entrustDate === undefined) {
this.formObj.entrustDate = '' this.formObj.entrustDate = ''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment