Commit eaf17188 by lichengming

修改了委托单登记输入框查询

parent 4fa146cd
......@@ -133,6 +133,8 @@ export default {
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),
projectQueryList: data =>
http.post('res/v1/dict/dict_query', data).then(res => res),
pageSurplusHandleCheckHis: data =>
http
.post('soil/v1/prepare/page_surplus_handle_check_his', data)
......
......@@ -14,7 +14,10 @@
placeholder="请选择委托日期" name="entrustDate"></Date-picker>
</Form-item>
<Form-item label="项目名称" prop="projectName" class="width-48">
<Input v-model="formObj.projectName" name="projectName" placeholder="请输入项目名称"/>
<!-- <Input v-model="formObj.projectName" name="projectName" placeholder="请输入项目名称"/>-->
<AutoComplete ref="autoInput" v-model="formObj.projectName" :down-data="projectData"
@on-result-change="_projectChange" name="projectName" placeholder="请输入或选择项目名称"
></AutoComplete>
</Form-item>
<Form-item label="钻孔名称" prop="boreholeName" class="width-48">
<Input v-model="formObj.boreholeName" name="boreholeName" placeholder="请输入名称"/>
......@@ -149,6 +152,7 @@ export default {
},
showBtn: true,
customerData: [],
projectData: [],
edit: false,
cityData: [],
selectData: [],
......@@ -351,7 +355,30 @@ export default {
this.formObj.client = query
this._getQueryList(query)
},
_projectChange(msg, data) {
if (this.$string(this.id).isEmpty()) {
// 添加的时候选择单位
switch (msg) {
case 'select':
this._projectMatch(data)
break
case 'query':
this._projectQuery(data)
break
}
} else if (this.projectData.indexOf(data) !== -1) {
this._getProjectQueryList(data)
} else {
this._projectQuery(data)
}
},
_projectMatch(data) {
this._getQueryList(data)
},
_projectQuery(query) {
this.formObj.projectName = query
this._getProjectQueryList(query)
},
_btnClick(msg) {
this.$nextTick(function() {
switch (msg) {
......@@ -693,6 +720,7 @@ export default {
this._getList()
this._getTestType()
this._getPackList()
this._getProjectList()
this._getSoil()
this._getUser()
this.showBtn = true
......@@ -783,6 +811,16 @@ export default {
this.customerData = list
}
},
_getProjectList: async function() {
const result = await soilEntrust.testType('项目名称')
const projectlist = []
if (result) {
for (let i = 0; i < result.length; i++) {
projectlist.push(result[i].name)
}
this.projectData = projectlist
}
},
_getQueryList: async function(data) {
const result = await meterEntrust.pageQueryList(data)
const queryList = []
......@@ -794,6 +832,20 @@ export default {
console.log('委托商', result)
}
},
_getProjectQueryList: async function(data) {
const queryData = {}
queryData.type = '项目名称'
queryData.name = data
const result = await soilEntrust.projectQueryList(queryData)
const queryList = []
if (result) {
for (let i = 0; i < result.length; i++) {
queryList.push(result[i].name)
}
this.projectData = queryList
console.log('项目名称', result)
}
},
_save: async function(data) {
const result = await soilEntrust.save(data)
if (result) {
......
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