|
|
@@ -130,7 +130,7 @@
|
|
|
ref="inventoryTableDetailsRef"
|
|
|
:isDiscountTotalPrice="true"
|
|
|
:isSelected="true"
|
|
|
- :selectedList="adjustData"
|
|
|
+ :selectedIds="selectIds"
|
|
|
@selection-change="handleSelectionChange"
|
|
|
></inventoryTableDetails>
|
|
|
<headerTitle
|
|
|
@@ -266,14 +266,12 @@
|
|
|
sourceNo: '',
|
|
|
sourceId: '',
|
|
|
adjustAmount: '',
|
|
|
- adjustDiscountAmount: ''
|
|
|
+ adjustDiscountAmount: '',
|
|
|
+ detailList: [],
|
|
|
+ originalList: [],
|
|
|
};
|
|
|
|
|
|
return {
|
|
|
- orderOption: [],
|
|
|
- oldProductList: [],
|
|
|
- detailData: {},
|
|
|
- acceptUnpackoptions,
|
|
|
visible: false,
|
|
|
processSubmitDialogFlag: false,
|
|
|
title: '',
|
|
|
@@ -282,9 +280,6 @@
|
|
|
formDef,
|
|
|
form: copyObj(formDef),
|
|
|
orderForm: {},
|
|
|
- tableBankData: [],
|
|
|
- tableLinkData: [],
|
|
|
- groupData: [],
|
|
|
rules: {
|
|
|
type: [
|
|
|
{ required: true, message: '请选择', trigger: 'change' }
|
|
|
@@ -304,6 +299,7 @@
|
|
|
orderId: '',
|
|
|
productList: [],
|
|
|
adjustData: [],
|
|
|
+ selectIds: [],
|
|
|
};
|
|
|
},
|
|
|
async created() {
|
|
|
@@ -396,20 +392,22 @@
|
|
|
delete existingItemsMap[item.productCode];
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
+ this.form.detailList = this.adjustData;
|
|
|
// 调用putTableValue方法更新表格数据
|
|
|
- this.$refs.inventoryTableRef.putTableValue(this.adjustData);
|
|
|
+ this.$refs.inventoryTableRef.putTableValue(this.form);
|
|
|
}
|
|
|
},
|
|
|
// 计算总金额和优惠总金额
|
|
|
setCountAmount(allPrice, diffPriceTotal) {
|
|
|
- this.form.adjustAmount = this.orderForm.totalAmount + Number(diffPriceTotal);
|
|
|
- this.form.adjustDiscountAmount = this.orderForm.payAmount + Number(diffPriceTotal);
|
|
|
+ console.log('allPrice~~~', allPrice, diffPriceTotal);
|
|
|
+ this.form.adjustAmount = allPrice;
|
|
|
+ this.form.adjustDiscountAmount = allPrice;
|
|
|
this.form.differenceAmount = diffPriceTotal;
|
|
|
},
|
|
|
// 优惠后总金额修改产品折让单价
|
|
|
discountInput() {
|
|
|
- this.$refs.inventoryTableRef.discountInputByOrder(this.form.adjustDiscountAmount, this.form.amount);
|
|
|
+ console.log('this.form.adjustDiscountAmount~~~', this.form.adjustDiscountAmount, this.form.adjustAmount);
|
|
|
+ this.$refs.inventoryTableRef.discountInputByOrder(this.form.adjustDiscountAmount, this.form.adjustAmount);
|
|
|
},
|
|
|
//删除产品
|
|
|
remove(row) {
|
|
|
@@ -429,28 +427,36 @@
|
|
|
|
|
|
//打开新增编辑弹框
|
|
|
async open(type, row) {
|
|
|
+ console.log(type)
|
|
|
this.title = type === 'add' ? '新增' : '修改';
|
|
|
this.isUpdate = type != 'add';
|
|
|
this.row = row;
|
|
|
this.visible = true;
|
|
|
- console.log('row~~~~~~~~~~', row);
|
|
|
+ console.log('row~~~~~~~~~~333', row);
|
|
|
if (row && row?.id && !this.isUpdate) {
|
|
|
+ console.log('add!!!')
|
|
|
await this.getSaleOrderDetail(row?.id);
|
|
|
} else {
|
|
|
+ console.log('update!!!')
|
|
|
const data = await getInfo(row?.id);
|
|
|
if (data) {
|
|
|
- const tempdata = {
|
|
|
- // ...data,
|
|
|
- totalPrice: data.amount,
|
|
|
- discountTotalPrice: data.discountAmount,
|
|
|
- productList: data.originalList
|
|
|
- }
|
|
|
- this.businessId = data.id;
|
|
|
- this.adjustData = data.detailList;
|
|
|
- this.form = data;
|
|
|
- this.$refs.inventoryTableDetailsRef &&
|
|
|
- this.$refs.inventoryTableDetailsRef.putTableValue(tempdata);
|
|
|
- this.$refs.inventoryTableRef && this.$refs.inventoryTableRef.putTableValue(data.detailList);
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ const tempdata = {
|
|
|
+ // ...data,
|
|
|
+ totalPrice: data.amount,
|
|
|
+ discountTotalPrice: data.discountAmount,
|
|
|
+ productList: data.originalList
|
|
|
+ }
|
|
|
+ this.businessId = data.id;
|
|
|
+ this.adjustData = data.detailList;
|
|
|
+ this.selectIds = this.adjustData.map(item => item.sourceDetailId);
|
|
|
+ this.form = data;
|
|
|
+ console.log('tempdata~~~', this.form, data);
|
|
|
+ this.$refs.inventoryTableDetailsRef &&
|
|
|
+ this.$refs.inventoryTableDetailsRef.putTableValue(tempdata);
|
|
|
+ this.$refs.inventoryTableRef && this.$refs.inventoryTableRef.putTableValue(data);
|
|
|
+ // });
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -468,6 +474,8 @@
|
|
|
if (data) {
|
|
|
this.form.sourceNo = data.orderNo;
|
|
|
this.form.sourceId = data.id;
|
|
|
+ // this.form.amount = data.totalAmount;
|
|
|
+ // this.form.discountAmount = data.payAmount;
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.inventoryTableDetailsRef &&
|
|
|
this.$refs.inventoryTableDetailsRef.putTableValue(data);
|