Commit faec3af0 by 刘泽志

自动预测框框

parent 476e5fd5
......@@ -458,7 +458,14 @@
<el-input v-model="orgListDialog.data.MAILING_ADDRESS" autosize size="small" type="textarea"/>
</el-form-item>
<el-form-item label="行政区划代码" prop="AREA_NUMBER_CODE">
<el-input v-model="orgListDialog.data.AREA_NUMBER_CODE" size="small"/>
<!-- <el-input v-model="orgListDialog.data.AREA_NUMBER_CODE" size="small"/>-->
<el-autocomplete v-model="orgListDialog.data.AREA_NUMBER_CODE"
:fetch-suggestions="areaSearch"
size="small">
<template slot-scope="{ item }">
{{item.suggestion}}
</template>
</el-autocomplete>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
......@@ -1400,7 +1407,12 @@ export default {
this.orgDictDialog.loading = true
// 查询机构字典
DictData.queryDict('area').then(res => {
this.orgDictDialog.areaDict = res.data
this.orgDictDialog.areaDict = res.data.map(item=>{
return {
...item,
suggestion: StringUtil.mergeStr(item.label,item.value)
}
})
ExcelData.queryArea(this.queryForm.orgName, this.queryForm.year).then(res => {
if (res.code === 200) {
this.orgDictDialog.orgList = res.data.map(item => {
......@@ -1538,6 +1550,21 @@ export default {
handleSelectionChange(val){
this.syncFieldDialog.checked = val
},
areaSearch(qs, callback) {
if (!this.orgDictDialog.areaDict) {
callback([])
return
}
if (qs) {
//
let result = this.orgDictDialog.areaDict.filter(item => {
return item.suggestion.includes(qs)
})
callback(result)
} else {
callback(this.orgDictDialog.areaDict)
}
},
}
}
</script>
......
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