Commit eaf17188 by lichengming

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

parent 4fa146cd
...@@ -133,6 +133,8 @@ export default { ...@@ -133,6 +133,8 @@ export default {
http.post('soil/v1/sample/page_take', data).then(res => res), http.post('soil/v1/sample/page_take', data).then(res => res),
testType: data => testType: data =>
http.post('res/v1/dict/dict_query?type=' + data).then(res => res), 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 => pageSurplusHandleCheckHis: data =>
http http
.post('soil/v1/prepare/page_surplus_handle_check_his', data) .post('soil/v1/prepare/page_surplus_handle_check_his', data)
......
...@@ -14,7 +14,10 @@ ...@@ -14,7 +14,10 @@
placeholder="请选择委托日期" name="entrustDate"></Date-picker> placeholder="请选择委托日期" name="entrustDate"></Date-picker>
</Form-item> </Form-item>
<Form-item label="项目名称" prop="projectName" class="width-48"> <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>
<Form-item label="钻孔名称" prop="boreholeName" class="width-48"> <Form-item label="钻孔名称" prop="boreholeName" class="width-48">
<Input v-model="formObj.boreholeName" name="boreholeName" placeholder="请输入名称"/> <Input v-model="formObj.boreholeName" name="boreholeName" placeholder="请输入名称"/>
...@@ -149,6 +152,7 @@ export default { ...@@ -149,6 +152,7 @@ export default {
}, },
showBtn: true, showBtn: true,
customerData: [], customerData: [],
projectData: [],
edit: false, edit: false,
cityData: [], cityData: [],
selectData: [], selectData: [],
...@@ -351,7 +355,30 @@ export default { ...@@ -351,7 +355,30 @@ export default {
this.formObj.client = query this.formObj.client = query
this._getQueryList(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) { _btnClick(msg) {
this.$nextTick(function() { this.$nextTick(function() {
switch (msg) { switch (msg) {
...@@ -693,6 +720,7 @@ export default { ...@@ -693,6 +720,7 @@ export default {
this._getList() this._getList()
this._getTestType() this._getTestType()
this._getPackList() this._getPackList()
this._getProjectList()
this._getSoil() this._getSoil()
this._getUser() this._getUser()
this.showBtn = true this.showBtn = true
...@@ -783,6 +811,16 @@ export default { ...@@ -783,6 +811,16 @@ export default {
this.customerData = list 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) { _getQueryList: async function(data) {
const result = await meterEntrust.pageQueryList(data) const result = await meterEntrust.pageQueryList(data)
const queryList = [] const queryList = []
...@@ -794,6 +832,20 @@ export default { ...@@ -794,6 +832,20 @@ export default {
console.log('委托商', result) 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) { _save: async function(data) {
const result = await soilEntrust.save(data) const result = await soilEntrust.save(data)
if (result) { 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