|
@@ -80,30 +80,34 @@
|
|
|
<el-button type="primary" class="btn" @click="onclick">
|
|
|
<i class="el-icon-search"></i>
|
|
|
</el-button>
|
|
|
+ <el-button type="primary" class="btn" @click="batchOperate"
|
|
|
+ >批量保存</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-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-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
|
|
|
- v-for="item in sendStationList"
|
|
|
- :key="item.sendStationId"
|
|
|
- :label="item.sendStation"
|
|
|
- :value="item.sendStationId"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
@@ -119,12 +123,12 @@
|
|
|
:cell-style="{ fontWeight: '700' }"
|
|
|
class="table"
|
|
|
:span-method="objectSpanMethod"
|
|
|
- @selection-change="handleSelectionChange();handleMulSendChange()"
|
|
|
+ @selection-change="
|
|
|
+ handleSelectionChange();
|
|
|
+ handleMulSendChange();
|
|
|
+ "
|
|
|
>
|
|
|
- <el-table-column
|
|
|
- type="selection"
|
|
|
- width="55">
|
|
|
- </el-table-column>
|
|
|
+ <el-table-column type="selection" width="55"> </el-table-column>
|
|
|
<el-table-column
|
|
|
prop="index"
|
|
|
width="50"
|
|
@@ -338,7 +342,7 @@ export default {
|
|
|
//收货客户列表
|
|
|
consigneeList: [],
|
|
|
receiveName: null,
|
|
|
- sendStationId: null,
|
|
|
+ sendStationId: null
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -348,30 +352,42 @@ export default {
|
|
|
this.information();
|
|
|
},
|
|
|
methods: {
|
|
|
- handleSelectionChange(){
|
|
|
+ batchOperate() {
|
|
|
+ console.log(this.$refs.tableRef.data);
|
|
|
+ this.axios
|
|
|
+ .post(
|
|
|
+ "/api/v1/ams/batchUpdateInwardConsignee",
|
|
|
+ this.$refs.tableRef.data
|
|
|
+ )
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.code == "200") {
|
|
|
+ this.$message.success("批量保存成功");
|
|
|
+ this.getRequestUrl();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleSelectionChange() {
|
|
|
//批量绑定收货客户
|
|
|
- let selection=this.$refs.tableRef.selection;
|
|
|
- console.log("selection:",selection);
|
|
|
- if(!selection)
|
|
|
- return;
|
|
|
+ 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;
|
|
|
+ selection.forEach(row => {
|
|
|
+ row.receiveName = e.consigneeCompanyName;
|
|
|
+ row.consigneeId = e.consigneeId;
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- handleMulSendChange(){
|
|
|
+ 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);
|
|
|
+ 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) {
|
|
@@ -401,16 +417,14 @@ 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);
|
|
|
- }
|
|
|
+ } 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);
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
},
|