|
@@ -76,8 +76,17 @@
|
|
|
</div>
|
|
|
<div style="width: 394px;">
|
|
|
<el-form-item label="供应商全称:" prop="supplierName" label-width="160px">
|
|
|
- <el-input placeholder="供应商全称" v-model="DecreasePaymentsData.supplierName">
|
|
|
- </el-input>
|
|
|
+ <!-- <el-input placeholder="供应商全称" v-model="DecreasePaymentsData.supplierName">
|
|
|
+ </el-input> -->
|
|
|
+
|
|
|
+ <el-autocomplete
|
|
|
+ style="width: 100%;"
|
|
|
+ v-model="DecreasePaymentsData.supplierName"
|
|
|
+ :fetch-suggestions="querySearchAsync"
|
|
|
+ placeholder="供应商全称"
|
|
|
+ @select="handleSelect"
|
|
|
+ ></el-autocomplete>
|
|
|
+
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
<div v-if="eventspd" style="width: 394px;">
|
|
@@ -312,6 +321,7 @@ export default {
|
|
|
supplierRegion:[],
|
|
|
eventspd:true,
|
|
|
fullscreenLoading:false,
|
|
|
+ queryArr : [],
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -653,6 +663,56 @@ export default {
|
|
|
})
|
|
|
|
|
|
|
|
|
+ },
|
|
|
+ handleSelect(item){
|
|
|
+ //console.log('handleSelect',item);
|
|
|
+ var id = item.id;
|
|
|
+ var that = this;
|
|
|
+
|
|
|
+ try {
|
|
|
+ this.queryArr.forEach((item)=>{
|
|
|
+ if(item.id==id){
|
|
|
+ that.DecreasePaymentsData.supplierAddress = item.supplierAddress;
|
|
|
+ that.DecreasePaymentsData.supplierArea = item.supplierArea;
|
|
|
+ that.DecreasePaymentsData.supplierContact = item.supplierContact;
|
|
|
+ that.DecreasePaymentsData.supplierContactNumber = item.supplierContactNumber;
|
|
|
+ that.DecreasePaymentsData.supplierEmail = item.supplierEmail;
|
|
|
+ that.DecreasePaymentsData.supplierName = item.supplierName;
|
|
|
+ that.DecreasePaymentsData.supplierSocialAccount = item.supplierSocialAccount;
|
|
|
+ that.DecreasePaymentsData.supplierTypeId = item.supplierTypeId;
|
|
|
+ throw new Error('stop');
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } catch (error) {
|
|
|
+ if(error.message == 'stop'){
|
|
|
+ return;
|
|
|
+ }else{
|
|
|
+ console.error(error.message);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ querySearchAsync(queryString, cb) {
|
|
|
+ var url = "/api/Groups/QueryAssociateSupplier"
|
|
|
+ var that = this
|
|
|
+ this.$axios({
|
|
|
+ method: 'post',
|
|
|
+ url: url,
|
|
|
+ headers: {
|
|
|
+ Authorization: 'Bearer ' + that.token
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ "param": queryString
|
|
|
+ }
|
|
|
+ }).then(function (res) {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ cb(res.data.data.map(x=>{return{
|
|
|
+ value: x.supplierName,
|
|
|
+ id: x.id
|
|
|
+ }}));
|
|
|
+ that.queryArr = res.data.data;
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
},
|