|
@@ -81,6 +81,30 @@
|
|
|
<i class="el-icon-search"></i>
|
|
|
</el-button>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-autocomplete
|
|
|
+ class="inline-input"
|
|
|
+ v-model="receiveName"
|
|
|
+ :fetch-suggestions="querySearchConsignee"
|
|
|
+ placeholder="请输入收货单位名称"
|
|
|
+ @select="handleSelectionChange()">
|
|
|
+ </el-autocomplete>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-select
|
|
|
+ size="mini"
|
|
|
+ v-model="sendStationId"
|
|
|
+ @change="handleMulSendChange()"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in sendStationList"
|
|
|
+ :key="item.sendStationId"
|
|
|
+ :label="item.sendStation"
|
|
|
+ :value="item.sendStationId"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
<div class="main">
|
|
@@ -95,7 +119,12 @@
|
|
|
:cell-style="{ fontWeight: '700' }"
|
|
|
class="table"
|
|
|
:span-method="objectSpanMethod"
|
|
|
+ @selection-change="handleSelectionChange();handleMulSendChange()"
|
|
|
>
|
|
|
+ <el-table-column
|
|
|
+ type="selection"
|
|
|
+ width="55">
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
prop="index"
|
|
|
width="50"
|
|
@@ -140,7 +169,6 @@
|
|
|
v-model="scope.row.receiveName"
|
|
|
:fetch-suggestions="querySearchConsignee"
|
|
|
placeholder="请输入收货单位名称"
|
|
|
- :trigger-on-focus="false"
|
|
|
@select="handleSelectConsignee(scope.row, scope.$index)"
|
|
|
>
|
|
|
<template slot-scope="{ item }">
|
|
@@ -308,7 +336,9 @@ export default {
|
|
|
pos: null,
|
|
|
sendStationList: [],
|
|
|
//收货客户列表
|
|
|
- consigneeList: []
|
|
|
+ consigneeList: [],
|
|
|
+ receiveName: null,
|
|
|
+ sendStationId: null,
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -318,6 +348,32 @@ export default {
|
|
|
this.information();
|
|
|
},
|
|
|
methods: {
|
|
|
+ handleSelectionChange(){
|
|
|
+ //批量绑定收货客户
|
|
|
+ let selection=this.$refs.tableRef.selection;
|
|
|
+ console.log("selection:",selection);
|
|
|
+ if(!selection)
|
|
|
+ return;
|
|
|
+ this.consigneeList.forEach(e => {
|
|
|
+ if (e.consigneeCompanyName == this.receiveName) {
|
|
|
+ selection.forEach((row)=>{
|
|
|
+ row.receiveName = e.consigneeCompanyName;
|
|
|
+ row.consigneeId = e.consigneeId;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleMulSendChange(){
|
|
|
+ //批量绑定发站
|
|
|
+ let selection=this.$refs.tableRef.selection;
|
|
|
+ console.log("selection:",selection);
|
|
|
+ if(!selection || !this.sendStationId)
|
|
|
+ return;
|
|
|
+ selection.forEach((row)=>{
|
|
|
+ row.sendStationId = this.sendStationId;
|
|
|
+ this.changesendStation(row);
|
|
|
+ });
|
|
|
+ },
|
|
|
handleSelectConsignee(row, index, item) {
|
|
|
console.log(row);
|
|
|
this.consigneeList.forEach(e => {
|
|
@@ -328,7 +384,7 @@ export default {
|
|
|
},
|
|
|
//以下是收货单位边输边查搜索
|
|
|
querySearchConsignee(queryString, cb) {
|
|
|
- if (queryString.length > 3) {
|
|
|
+ if (queryString && queryString.length > 3) {
|
|
|
this.axios
|
|
|
.post("/api/v1/uc/getConsigneeByLike?index=" + queryString)
|
|
|
.then(res => {
|
|
@@ -345,6 +401,17 @@ export default {
|
|
|
cb(results);
|
|
|
}
|
|
|
});
|
|
|
+ }else{
|
|
|
+ //历史收货客户
|
|
|
+ this.axios
|
|
|
+ .post("/api/v1/uc/getConsigneeHistory")
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.code == "200") {
|
|
|
+ console.log(res);
|
|
|
+ this.consigneeList = res.data.data;
|
|
|
+ cb(this.consigneeList);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
createFilterConsignee(queryString) {
|