|
@@ -83,13 +83,13 @@
|
|
|
<div class="table">
|
|
|
<el-table v-loading="listLoading" :data="deliverList" element-loading-text="Loading" border fit highlight-current-row stripe @selection-change="handleSelectionChange">
|
|
|
<el-table-column align="center" type="selection" width="55"></el-table-column>
|
|
|
- <el-table-column align="center" label="发货申请单" prop="invoiceOrderId" min-width="180" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="发货申请单" prop="invoiceId" min-width="180" show-overflow-tooltip></el-table-column>
|
|
|
<el-table-column align="center" label="单据日期" prop="orderTime" min-width="120" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
{{ scope.row.orderTime | dateToDayFilter }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column align="center" label="销售订单号" prop="retailOrderId" min-width="180" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="销售订单号" prop="mainOrderId" min-width="200" show-overflow-tooltip></el-table-column>
|
|
|
<el-table-column align="center" label="工程编号" prop="enginOrderNo" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
<el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
<el-table-column align="center" label="产品编码" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
|
|
@@ -114,9 +114,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getWarehouseList, getDeliverList, getPickupManList, getPickupCarList, getCompanyList, addPickupBook } from "@/api/supply/pickup";
|
|
|
+import { getWarehouseList, getDeliverList, getPickupManList, getPickupCarList, getCompanyList, addPickupBook, editPickupBook, getDetail } from "@/api/supply/pickup";
|
|
|
import { getDictList } from "@/api/common";
|
|
|
-import { findElem } from "@/utils/util";
|
|
|
|
|
|
export default {
|
|
|
name: 'PickupForm',
|
|
@@ -178,6 +177,9 @@ export default {
|
|
|
this.getPickupManList();
|
|
|
this.getPickupCarList();
|
|
|
this.getCompanyList();
|
|
|
+ if(this.listItem) {
|
|
|
+ this.getDetail();
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
@@ -195,6 +197,23 @@ export default {
|
|
|
this.$emit('backListFormDetail');
|
|
|
},
|
|
|
|
|
|
+ // 获取详情
|
|
|
+ getDetail() {
|
|
|
+ getDetail({id: this.listItem.id}).then(res => {
|
|
|
+ let data = res.data;
|
|
|
+ this.mainForm.warehouse = data.correspondId;
|
|
|
+ this.mainForm.date = data.pickTime.slice(0, 10);
|
|
|
+ this.mainForm.timeSlot = Number(data.pickStatus);
|
|
|
+ this.mainForm.pickupWay = String(data.pickType);
|
|
|
+ this.mainForm.pickupMan = data.takerId;
|
|
|
+ this.mainForm.pickupCar = data.takerCarId;
|
|
|
+ this.mainForm.company = data.pickLogistics;
|
|
|
+ this.mainForm.remark = data.remark;
|
|
|
+
|
|
|
+ this.deliverList = data.invoicePickBeans;
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
// 获取仓库列表
|
|
|
getWarehouseList() {
|
|
|
getWarehouseList({
|
|
@@ -264,19 +283,18 @@ export default {
|
|
|
if(this.tableSelection.length < 1) {
|
|
|
return this.$errorMsg('请选择发货申请单');
|
|
|
}
|
|
|
-
|
|
|
this.formLoading = true;
|
|
|
- let takerName = '';
|
|
|
- if(this.mainForm.pickupMan) {
|
|
|
- let index = findElem(this.pickupManList, 'id', this.mainForm.pickupMan);
|
|
|
- takerName = this.pickupManList[index].takerName;
|
|
|
- }
|
|
|
+
|
|
|
+ let takerName = this.pickupManList.find(o => o.id == this.mainForm.pickupMan).takerName;
|
|
|
+ let correspondName = this.warehouseList.find(o => o.id == this.mainForm.warehouse).name;
|
|
|
+
|
|
|
let orderList = [];
|
|
|
this.tableSelection.forEach(item => {
|
|
|
orderList.push(item.invoiceOrderId);
|
|
|
});
|
|
|
let params = {
|
|
|
- stockName: this.mainForm.warehouse,
|
|
|
+ correspondId: this.mainForm.warehouse,
|
|
|
+ correspondName,
|
|
|
pickTime: this.mainForm.date + ' 00:00:00',
|
|
|
pickStatus: Number(this.mainForm.timeSlot),
|
|
|
pickType: Number(this.mainForm.pickupWay),
|
|
@@ -291,13 +309,24 @@ export default {
|
|
|
if(this.mainForm.pickupWay == '2') {
|
|
|
params.pickLogistics = this.mainForm.company;
|
|
|
}
|
|
|
- addPickupBook(params).then(res => {
|
|
|
- this.$successMsg('提交成功');
|
|
|
- this.goBack();
|
|
|
- this.$parent.getList();
|
|
|
- }).finally(res => {
|
|
|
- this.formLoading = false;
|
|
|
- })
|
|
|
+ if(this.listItem) {
|
|
|
+ params.id = this.listItem.id;
|
|
|
+ editPickupBook(params).then(res => {
|
|
|
+ this.$successMsg('提交成功');
|
|
|
+ this.goBack();
|
|
|
+ this.$parent.getList();
|
|
|
+ }).finally(res => {
|
|
|
+ this.formLoading = false;
|
|
|
+ })
|
|
|
+ }else {
|
|
|
+ addPickupBook(params).then(res => {
|
|
|
+ this.$successMsg('提交成功');
|
|
|
+ this.goBack();
|
|
|
+ this.$parent.getList();
|
|
|
+ }).finally(res => {
|
|
|
+ this.formLoading = false;
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
},
|