|
|
@@ -45,19 +45,30 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row :gutter="12">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="退货单">
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ :disabled="!!saleOrderData.id"
|
|
|
+ v-model="form.sourceNo"
|
|
|
+ @click.native="handleReturnGoodsBtn"
|
|
|
+ placeholder="请输入"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="客户名称" prop="contactName">
|
|
|
<el-input v-model="form.contactName" disabled></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="12">
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="客户联系人" prop="linkName">
|
|
|
<el-input clearable v-model="form.linkName" placeholder="请输入" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- </el-row>
|
|
|
-
|
|
|
- <el-row :gutter="12">
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="客户电话" prop="linkPhone">
|
|
|
<el-input clearable v-model="form.linkPhone" placeholder="请输入" />
|
|
|
@@ -84,6 +95,9 @@
|
|
|
style="width: 100%"
|
|
|
clearable
|
|
|
multiple
|
|
|
+ filterable
|
|
|
+ allow-create
|
|
|
+ default-first-option
|
|
|
>
|
|
|
<el-option
|
|
|
:label="item.trakNumber"
|
|
|
@@ -104,17 +118,56 @@
|
|
|
<el-input clearable v-model="form.printNo" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col :span="12" style="height: 40px;">
|
|
|
+ <el-form-item label="送货方式" prop="deliveryTypeId">
|
|
|
+ <DictSelection
|
|
|
+ dictName="送货方式"
|
|
|
+ clearable
|
|
|
+ v-model="form.deliveryTypeId"
|
|
|
+ filterable
|
|
|
+ allow-create
|
|
|
+ default-first-option
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ </DictSelection>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="回执要求" prop="receiptRequirementTypeId">
|
|
|
+ <el-radio-group v-model="form.receiptRequirementTypeId">
|
|
|
+ <el-radio v-for="item in receiptRequirementTypeOption" :key="item.value" :label="item.value">{{item.label}}</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item prop="sendFiles" label="发货附件">
|
|
|
<fileMain v-model="form.sendFiles"></fileMain>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+
|
|
|
<el-col :span="12">
|
|
|
<el-form-item prop="repliedFiles" label="回执附件">
|
|
|
<fileMain v-model="form.repliedFiles"></fileMain>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item prop="makerName" label="制单人" v-if="form.makerName">
|
|
|
+ <el-input disabled v-model="form.makerName" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <!-- <el-form-item prop="productionRequirements" label="生产要求">
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ v-model="form.productionRequirements"
|
|
|
+ placeholder=""
|
|
|
+ type="textarea"
|
|
|
+ disabled
|
|
|
+ />
|
|
|
+ </el-form-item> -->
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
<el-tabs v-model="activeName" style="margin-top: 15px" type="border-card">
|
|
|
@@ -129,6 +182,8 @@
|
|
|
:needProduce="saleOrderValue.needProduce"
|
|
|
:typeIds="saleOrderValue.typedetailIds"
|
|
|
:isTotalCount="isTotalCount"
|
|
|
+ :oldProductList="oldProductList"
|
|
|
+ :sourceType="form.sourceType"
|
|
|
></inventoryTable>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="托盘清单" name="second">
|
|
|
@@ -187,27 +242,32 @@
|
|
|
ref="processSubmitDialogRef"
|
|
|
@reload="reload"
|
|
|
></process-submit-dialog>
|
|
|
+ <!-- 退货单 -->
|
|
|
+ <return-order-dialog
|
|
|
+ :returnOrderDialogFlag.sync="returnOrderDialogFlag"
|
|
|
+ v-if="returnOrderDialogFlag"
|
|
|
+ returnSourceType=""
|
|
|
+ hasHandleReceipt=""
|
|
|
+ types=""
|
|
|
+ @changeParent="getSReturnOrderInfo"
|
|
|
+ ref="returnOrderDialogRef"
|
|
|
+ >
|
|
|
+ </return-order-dialog>
|
|
|
</ele-modal>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import { treeClassifyCodeEnum } from '@/enum/dict';
|
|
|
import fileUpload from '@/components/upload/fileUpload';
|
|
|
import dictMixins from '@/mixins/dictMixins';
|
|
|
import parentList from '@/views/saleManage/contact/components/parentList.vue';
|
|
|
- import {
|
|
|
- getSaleOrderDetail,
|
|
|
- getSaleOrderDetails
|
|
|
- } from '@/api/saleManage/saleorder';
|
|
|
+ import { getSaleOrderDetails } from '@/api/saleManage/saleorder';
|
|
|
import taskInfoTable from './taskInfoTable.vue';
|
|
|
import {
|
|
|
addSendInformation,
|
|
|
UpdateSendInformation,
|
|
|
- getSendSaleOrderrecordDetailSplit,
|
|
|
- submit
|
|
|
+ getSendSaleOrderrecordDetailSplit
|
|
|
} from '@/api/saleManage/saleordersendrecord';
|
|
|
import { getPSaleEntrustedReceiveDetailAPI } from '@/api/saleManage/entrustedReceive';
|
|
|
- import { getcontactlink } from '@/api/saleManage/businessFollow';
|
|
|
import inventoryTable from './inventoryTable.vue';
|
|
|
import replaceTable from './replaceTable.vue';
|
|
|
import stowageTable from './stowageTable.vue';
|
|
|
@@ -222,6 +282,11 @@
|
|
|
import { carBookPageListAPI } from '@/api/transportManager/carBook';
|
|
|
import { projectsGetByIdAPI } from '@/api/pro';
|
|
|
import { parameterGetByCode } from '@/api/main/index.js';
|
|
|
+ import { getWarehouseListByIds } from '@/api/purchasingManage/returnGoods';
|
|
|
+ import returnOrderDialog from '@/views/saleManage/saleOrder/customerReturnOrder/returnOrderDialog.vue';
|
|
|
+import {
|
|
|
+ getReturnSaleOrderrecordDetail,
|
|
|
+ } from '@/api/saleManage/returnGoods';
|
|
|
|
|
|
export default {
|
|
|
mixins: [dictMixins],
|
|
|
@@ -237,7 +302,8 @@
|
|
|
parentList,
|
|
|
entrustedReceiveDialog,
|
|
|
stowageTable,
|
|
|
- replaceTable
|
|
|
+ replaceTable,
|
|
|
+ returnOrderDialog
|
|
|
},
|
|
|
|
|
|
//客户管理数据
|
|
|
@@ -253,7 +319,12 @@
|
|
|
default: () => {
|
|
|
return {};
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+ // 是否是退货单创建发货单
|
|
|
+ isReturnGoodsCreate: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ },
|
|
|
},
|
|
|
data() {
|
|
|
let formDef = {
|
|
|
@@ -277,7 +348,12 @@
|
|
|
orderId: '',
|
|
|
replied: 0,
|
|
|
trayNum: '',
|
|
|
- replaceList: []
|
|
|
+ replaceList: [],
|
|
|
+ deliveryTypeId: '',
|
|
|
+ receiptRequirementTypeId: 2,
|
|
|
+ sourceType: '', // 1 销售订单 2 受托收货单 3 退货单
|
|
|
+ sourceId: '',
|
|
|
+ sourceNo: ''
|
|
|
};
|
|
|
|
|
|
return {
|
|
|
@@ -287,6 +363,7 @@
|
|
|
payWayOptions: [],
|
|
|
delDetailIds: [],
|
|
|
carList: [],
|
|
|
+ oldProductList: [],
|
|
|
visible: false,
|
|
|
entrustedReceiveDialogFlag: false,
|
|
|
processSubmitDialogFlag: false,
|
|
|
@@ -294,35 +371,50 @@
|
|
|
activeName: 'first',
|
|
|
formDef,
|
|
|
form: copyObj(formDef),
|
|
|
-
|
|
|
- rules: {
|
|
|
- partaName: [
|
|
|
- { required: true, message: '请选择客户名称', trigger: 'change' }
|
|
|
- ],
|
|
|
- linkName: [
|
|
|
- { required: true, message: '请输入', trigger: ['blur', 'change'] }
|
|
|
- ],
|
|
|
- orderNo: [{ required: true, message: '请选择', trigger: 'change' }],
|
|
|
- receiveAddress: [
|
|
|
- { required: true, message: '请输入', trigger: 'change' }
|
|
|
- ],
|
|
|
- deviceName: [
|
|
|
- { required: true, message: '前选择车辆', trigger: 'change' }
|
|
|
- ]
|
|
|
- },
|
|
|
+ returnOrderDialogFlag: false,
|
|
|
|
|
|
// 提交状态
|
|
|
loading: false,
|
|
|
// 是否是修改
|
|
|
isUpdate: false,
|
|
|
businessId: '',
|
|
|
- isTotalCount: 0
|
|
|
+ isTotalCount: 0,
|
|
|
+ receiptRequirementTypeOption: [{
|
|
|
+ label: '签回单',
|
|
|
+ value: 1
|
|
|
+ }, {
|
|
|
+ label: '不签回单',
|
|
|
+ value: 2
|
|
|
+ }, {
|
|
|
+ label: '带签收单',
|
|
|
+ value: 3
|
|
|
+ }],
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
allcountAmount() {
|
|
|
return this.$store.state.order.allcountAmount;
|
|
|
- }
|
|
|
+ },
|
|
|
+ rules() {
|
|
|
+ return {
|
|
|
+ partaName: [
|
|
|
+ { required: true, message: '请选择客户名称', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ linkName: [
|
|
|
+ { required: this.form.needProduce != 2 ? true : false, message: '请输入', trigger: ['blur', 'change'] }
|
|
|
+ ],
|
|
|
+ linkPhone: [
|
|
|
+ { required: this.form.needProduce != 2 ? true : false, message: '请输入', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ orderNo: [{ required: true, message: '请选择', trigger: 'change' }],
|
|
|
+ receiveAddress: [
|
|
|
+ { required: this.form.needProduce != 2 ? true : false, message: '请输入', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ deviceName: [
|
|
|
+ { required: true, message: '前选择车辆', trigger: 'change' }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
@@ -338,20 +430,29 @@
|
|
|
//选择订单回调
|
|
|
changeOrder(obj) {
|
|
|
this.form = Object.assign({}, this.form, {
|
|
|
+ productionRequirements: obj.map((item) => item.productionRequirements).toString(),
|
|
|
orderIds: obj.map((item) => item.id).toString(),
|
|
|
- orderNo: obj.map((item) => item.orderNo).toString()
|
|
|
+ orderNo: obj.map((item) => item.orderNo).toString(),
|
|
|
+ // needProduce: obj.map((item) => item.needProduce),
|
|
|
+ sourceType: 1,
|
|
|
});
|
|
|
this.getSaleOrderDetails(obj.map((item) => item.id));
|
|
|
},
|
|
|
|
|
|
- setData(res, type) {
|
|
|
+ async setData(res, type) {
|
|
|
+ let eom_saleOrder_addInvoice = await parameterGetByCode({
|
|
|
+ code: 'eom_saleOrder_addInvoice'
|
|
|
+ });
|
|
|
+
|
|
|
+ console.log('eom_saleOrder_addInvoice', res)
|
|
|
+
|
|
|
let data = {
|
|
|
...res[0],
|
|
|
orderIds: res.map((item) => item.id).toString(),
|
|
|
orderNo: res.map((item) => item.orderNo).toString(),
|
|
|
productList: res.map((item) => item.productList).flat(),
|
|
|
typedetailIds: res.map((item) => item.typedetailIds).flat(),
|
|
|
-
|
|
|
+ // needProduce: res.map((item) => item.needProduce),
|
|
|
totalAmount: res.reduce(
|
|
|
(sum, obj) =>
|
|
|
sum + ((obj.totalAmount && Number(obj.totalAmount)) || 0),
|
|
|
@@ -376,7 +477,8 @@
|
|
|
};
|
|
|
|
|
|
this.loading = false;
|
|
|
- this.saleOrderValue = data;
|
|
|
+ this.saleOrderValue = JSON.parse(JSON.stringify(data));
|
|
|
+ this.oldProductList = JSON.parse(JSON.stringify(data.productList));
|
|
|
this.partbAddress = data.partbAddress;
|
|
|
if (type == 'sendInit') {
|
|
|
return;
|
|
|
@@ -399,7 +501,9 @@
|
|
|
projectId,
|
|
|
projectCode,
|
|
|
totalPrice,
|
|
|
- receiveAddress
|
|
|
+ receiveAddress,
|
|
|
+ productionRequirements,
|
|
|
+ needProduce
|
|
|
} = data;
|
|
|
if (productList && productList.length > 0) {
|
|
|
productList.forEach((v) => {
|
|
|
@@ -423,14 +527,28 @@
|
|
|
payAmount,
|
|
|
projectName,
|
|
|
projectId,
|
|
|
- projectSn: projectCode
|
|
|
+ projectSn: projectCode,
|
|
|
+ productionRequirements,
|
|
|
+ needProduce
|
|
|
});
|
|
|
+ console.log('form~~~~~~~~~~', this.form)
|
|
|
productList.forEach((item, index) => {
|
|
|
item['tempId'] = index;
|
|
|
item.id = '';
|
|
|
});
|
|
|
- this.$refs.inventoryTableref &&
|
|
|
- this.$refs.inventoryTableref.putTableValue(productList);
|
|
|
+ // this.$refs.inventoryTableref &&
|
|
|
+ // this.$refs.inventoryTableref.putTableValue(productList);
|
|
|
+ this.oldProductList = JSON.parse(JSON.stringify(productList));
|
|
|
+ if (eom_saleOrder_addInvoice?.value == 1) {
|
|
|
+ this.$refs.inventoryTableref &&
|
|
|
+ this.$refs.inventoryTableref.putTableValue(productList, true);
|
|
|
+ } else {
|
|
|
+ this.$refs.inventoryTableref &&
|
|
|
+ this.$refs.inventoryTableref.$refs.productListRef.open(
|
|
|
+ productList
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
this.$refs.taskInfoTableRef &&
|
|
|
this.$refs.taskInfoTableRef.putTableValue(trakNoteList);
|
|
|
this.setAddress();
|
|
|
@@ -453,6 +571,7 @@
|
|
|
async getSaleOrderDetails(ids) {
|
|
|
this.loading = true;
|
|
|
let res = await getSaleOrderDetails(ids);
|
|
|
+ console.log('res~~~~', res)
|
|
|
if (res?.length) {
|
|
|
this.setData(res);
|
|
|
}
|
|
|
@@ -491,17 +610,22 @@
|
|
|
} else if (data.saleOrder) {
|
|
|
this.setData([data.saleOrder], 'sendInit');
|
|
|
}
|
|
|
-
|
|
|
+ console.log('data~~~~', data)
|
|
|
this.loading = false;
|
|
|
if (data) {
|
|
|
this.$nextTick(() => {
|
|
|
- data.productList.forEach((item) => {
|
|
|
+ data.productList?.forEach((item) => {
|
|
|
item['tempId'] = item.id;
|
|
|
});
|
|
|
data.carNo = data.carNo ? data.carNo.split(',') : [];
|
|
|
this.form = data;
|
|
|
+ this.form.needProduce = data?.saleOrderList[0]?.needProduce;
|
|
|
+ this.form.deliveryTypeId = data.deliveryTypeId+'';
|
|
|
this.$refs.inventoryTableref &&
|
|
|
- this.$refs.inventoryTableref.putTableValue(data.productList);
|
|
|
+ this.$refs.inventoryTableref.putTableValue(
|
|
|
+ data.productList,
|
|
|
+ true
|
|
|
+ );
|
|
|
this.$refs.stowageTableRef &&
|
|
|
this.$refs.stowageTableRef.putTableValue(data.carList);
|
|
|
this.$refs.taskInfoTableRef &&
|
|
|
@@ -515,6 +639,132 @@
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
+ // 选择退货单
|
|
|
+ handleReturnGoodsBtn(e) {
|
|
|
+ if (e.target.nodeName == 'I') {
|
|
|
+ this.form = Object.assign({}, this.form, {
|
|
|
+ carNo: [],
|
|
|
+ deviceName: '',
|
|
|
+ deviceId: '',
|
|
|
+ linkName: '',
|
|
|
+ linkPhone: '',
|
|
|
+ orderNo: '',
|
|
|
+ productList: [],
|
|
|
+ orderId: '',
|
|
|
+ contactId: '',
|
|
|
+ contactName: '',
|
|
|
+ entrustedCode: '',
|
|
|
+ entrustedId: '',
|
|
|
+ sendNoteNo: '',
|
|
|
+ pricingWay: '',
|
|
|
+ sourceNo: '',
|
|
|
+ sourceId: '',
|
|
|
+ sourceType: '',
|
|
|
+ });
|
|
|
+ this.$refs.inventoryTableref &&
|
|
|
+ this.$refs.inventoryTableref.putTableValue([], true);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.returnOrderDialogFlag = true;
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ // this.$refs.returnOrderDialogRef.init();
|
|
|
+ // });
|
|
|
+ },
|
|
|
+ // 获取退货单数据
|
|
|
+ async getSReturnOrderInfo(row) {
|
|
|
+ console.log('row~~~~', row)
|
|
|
+ // this.form = Object.assign({}, this.form, {
|
|
|
+ // sourceId: row.id,
|
|
|
+ // sourceNo: row.returnNo,
|
|
|
+ // });
|
|
|
+ const data = await getReturnSaleOrderrecordDetail(row.id);
|
|
|
+ if (data) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ let {
|
|
|
+ carNo,
|
|
|
+ returnNo,
|
|
|
+ id,
|
|
|
+ linkName,
|
|
|
+ linkPhone,
|
|
|
+ orderIds,
|
|
|
+ orderNo,
|
|
|
+ contactId,
|
|
|
+ contactName,
|
|
|
+ pricingWay = data?.saleOrder?.pricingWay,
|
|
|
+ partaId,
|
|
|
+ partaName,
|
|
|
+ partaTel,
|
|
|
+ partaLinkName,
|
|
|
+ partaAddress,
|
|
|
+ productList,
|
|
|
+ trayList,
|
|
|
+ trakNoteList,
|
|
|
+ totalAmount,
|
|
|
+ payAmount,
|
|
|
+ projectName,
|
|
|
+ projectId,
|
|
|
+ projectCode,
|
|
|
+ totalPrice,
|
|
|
+ redressProductList,
|
|
|
+ receiveAddress
|
|
|
+ } = data;
|
|
|
+
|
|
|
+ if (redressProductList && redressProductList.length > 0) {
|
|
|
+ productList.push(...redressProductList);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (productList && productList.length > 0) {
|
|
|
+ productList.forEach((v) => {
|
|
|
+ v.orderTotalCount = v.totalCount;
|
|
|
+ v.extField = {};
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ this.form = Object.assign({}, this.form, {
|
|
|
+ // contactId,
|
|
|
+ // contactName,
|
|
|
+ // linkName,
|
|
|
+ // linkPhone,
|
|
|
+ // orderNo,
|
|
|
+ // orderIds: orderIds,
|
|
|
+ carNo: carNo ? carNo.split(',') : [],
|
|
|
+ pricingWay,
|
|
|
+ sourceType: 3,
|
|
|
+ sourceNo: returnNo,
|
|
|
+ sourceId: id,
|
|
|
+ contactId,
|
|
|
+ contactName,
|
|
|
+ // linkName: partaLinkName,
|
|
|
+ // linkPhone: partaTel,
|
|
|
+ orderNo,
|
|
|
+ orderIds,
|
|
|
+ // receiveAddress: receiveAddress || partaAddress,
|
|
|
+ productList,
|
|
|
+ trakNoteList,
|
|
|
+ trayList,
|
|
|
+ totalAmount,
|
|
|
+ totalPrice,
|
|
|
+ payAmount,
|
|
|
+ projectName,
|
|
|
+ projectId,
|
|
|
+ projectSn: projectCode
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ productList.forEach((item, index) => {
|
|
|
+ item['tempId'] = index;
|
|
|
+ item.id = '';
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ this.oldProductList = JSON.parse(JSON.stringify(productList));
|
|
|
+
|
|
|
+ this.$refs.inventoryTableref &&
|
|
|
+ this.$refs.inventoryTableref.putTableValue(productList, true);
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
//选择受托收货单弹框
|
|
|
handleEntrustedReceive(e) {
|
|
|
if (e.target.nodeName == 'I') {
|
|
|
@@ -525,16 +775,20 @@
|
|
|
linkName: '',
|
|
|
linkPhone: '',
|
|
|
orderNo: '',
|
|
|
+ productList: [],
|
|
|
orderId: '',
|
|
|
contactId: '',
|
|
|
contactName: '',
|
|
|
entrustedCode: '',
|
|
|
entrustedId: '',
|
|
|
sendNoteNo: '',
|
|
|
- pricingWay: ''
|
|
|
+ pricingWay: '',
|
|
|
+ sourceNo: '',
|
|
|
+ sourceId: '',
|
|
|
+ sourceType: '',
|
|
|
});
|
|
|
this.$refs.inventoryTableref &&
|
|
|
- this.$refs.inventoryTableref.putTableValue([]);
|
|
|
+ this.$refs.inventoryTableref.putTableValue([], true);
|
|
|
return;
|
|
|
}
|
|
|
this.searchParams = {
|
|
|
@@ -557,17 +811,17 @@
|
|
|
linkPhone,
|
|
|
orderId,
|
|
|
orderNo,
|
|
|
- productList,
|
|
|
+ // productList,
|
|
|
contactId,
|
|
|
contactName,
|
|
|
pricingWay = data?.saleOrder?.pricingWay
|
|
|
} = data;
|
|
|
- if (productList && productList.length > 0) {
|
|
|
- productList.forEach((v) => {
|
|
|
- v.orderTotalCount = v.orderTotalCount || v.totalCount;
|
|
|
- v.extField = {};
|
|
|
- });
|
|
|
- }
|
|
|
+ // if (productList && productList.length > 0) {
|
|
|
+ // productList.forEach((v) => {
|
|
|
+ // v.orderTotalCount = v.orderTotalCount || v.totalCount;
|
|
|
+ // v.extField = {};
|
|
|
+ // });
|
|
|
+ // }
|
|
|
this.form = Object.assign({}, this.form, {
|
|
|
contactId,
|
|
|
contactName,
|
|
|
@@ -575,18 +829,20 @@
|
|
|
linkPhone,
|
|
|
orderNo,
|
|
|
orderIds: orderId,
|
|
|
- productList,
|
|
|
+ // productList,
|
|
|
carNo: carNo ? carNo.split(',') : [],
|
|
|
pricingWay,
|
|
|
entrustedCode: code,
|
|
|
- entrustedId: id
|
|
|
+ entrustedId: id,
|
|
|
+ sourceType: 2,
|
|
|
});
|
|
|
- productList.forEach((item, index) => {
|
|
|
- item.id = '';
|
|
|
- item['tempId'] = index;
|
|
|
- });
|
|
|
- this.$refs.inventoryTableref &&
|
|
|
- this.$refs.inventoryTableref.putTableValue(productList, code);
|
|
|
+ this.getSaleOrderDetails([orderId]);
|
|
|
+ // productList.forEach((item, index) => {
|
|
|
+ // item.id = '';
|
|
|
+ // item['tempId'] = index;
|
|
|
+ // });
|
|
|
+ // this.$refs.inventoryTableref &&
|
|
|
+ // this.$refs.inventoryTableref.putTableValue(productList, code);
|
|
|
});
|
|
|
},
|
|
|
//替代料
|
|
|
@@ -609,7 +865,11 @@
|
|
|
orderId: '',
|
|
|
pricingWay: '',
|
|
|
entrustedCode: '',
|
|
|
- entrustedId: ''
|
|
|
+ entrustedId: '',
|
|
|
+ productionRequirements: '',
|
|
|
+ sourceType: '',
|
|
|
+ sourceNo: '',
|
|
|
+ sourceId: '',
|
|
|
});
|
|
|
this.$refs.inventoryTableref &&
|
|
|
this.$refs.inventoryTableref.putTableValue([]);
|
|
|
@@ -638,6 +898,10 @@
|
|
|
await this.getSendSaleOrderDetail(row?.id);
|
|
|
}
|
|
|
|
|
|
+ if(this.isReturnGoodsCreate && type == 'add') {
|
|
|
+ this.getSReturnOrderInfo(row)
|
|
|
+ }
|
|
|
+
|
|
|
if (type == 'add') {
|
|
|
this.isUpdate = false;
|
|
|
} else {
|
|
|
@@ -666,7 +930,7 @@
|
|
|
});
|
|
|
}),
|
|
|
new Promise((resolve, reject) => {
|
|
|
- this.$refs.inventoryTableref.validateForm((valid) => {
|
|
|
+ this.$refs.inventoryTableref.validateFormOptimized((valid) => {
|
|
|
if (!valid) {
|
|
|
reject(false);
|
|
|
} else {
|
|
|
@@ -718,6 +982,13 @@
|
|
|
) {
|
|
|
item['isReplace'] = 1;
|
|
|
}
|
|
|
+
|
|
|
+ if(item.isSuspend == 1) {
|
|
|
+ item.offsetDetail[0]['reverseQuantity'] = item.saleCount;
|
|
|
+ item['reverseQuantity'] = item.saleCount;
|
|
|
+ } else {
|
|
|
+ item['reverseQuantity'] = 0;
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
let commitData = Object.assign({}, this.form, {
|
|
|
@@ -765,14 +1036,25 @@
|
|
|
}
|
|
|
},
|
|
|
async sendSubmit(res) {
|
|
|
+ console.log('res~~~~~~', res, this.businessId);
|
|
|
+ let paramsId = this.isReturnGoodsCreate ? res : this.businessId || res;
|
|
|
+ console.log('paramsId~~~', paramsId)
|
|
|
const data = await getSendSaleOrderrecordDetailSplit(
|
|
|
- this.businessId || res
|
|
|
+ paramsId
|
|
|
);
|
|
|
+ let storemanIds = '';
|
|
|
+ console.log('data~~~~~~', data);
|
|
|
+ let ids = data.productList.map((item) => item.warehouseId);
|
|
|
+ if (ids?.length) {
|
|
|
+ let warehouseList = await getWarehouseListByIds(ids || []);
|
|
|
+ storemanIds = warehouseList.map((item) => item.ownerId);
|
|
|
+ }
|
|
|
+
|
|
|
this.processSubmitDialogFlag = true;
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
let params = {
|
|
|
- businessId: this.businessId || res,
|
|
|
+ businessId: paramsId,
|
|
|
businessKey:
|
|
|
data.saleTypeName.indexOf('技改') != '-1'
|
|
|
? 'sele_order_send_correction'
|
|
|
@@ -787,7 +1069,8 @@
|
|
|
variables: {
|
|
|
businessCode: data.docNo,
|
|
|
businessName: data.contactName,
|
|
|
- businessType: '销售发货单'
|
|
|
+ storemanIds: storemanIds.toString(),
|
|
|
+ businessType: data.sourceType == 3 ? '退货发货单' : '销售发货单'
|
|
|
}
|
|
|
};
|
|
|
|