|
@@ -55,18 +55,6 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- {
|
|
|
|
- span: 6,
|
|
|
|
- label: '退单编号',
|
|
|
|
- prop: 'chargebackNo',
|
|
|
|
- component: 'by-input',
|
|
|
|
- compConfig: {
|
|
|
|
- attr: {
|
|
|
|
- placeholder: '请输入退单编号',
|
|
|
|
- clearable: true
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
],
|
|
],
|
|
]
|
|
]
|
|
},
|
|
},
|
|
@@ -99,11 +87,6 @@
|
|
title: '单据编号',
|
|
title: '单据编号',
|
|
field: 'orderNumber',
|
|
field: 'orderNumber',
|
|
},
|
|
},
|
|
- {
|
|
|
|
- width: 178,
|
|
|
|
- title: '退单编号',
|
|
|
|
- field: 'chargebackNo',
|
|
|
|
- },
|
|
|
|
{
|
|
{
|
|
width: 90,
|
|
width: 90,
|
|
title: '收货人',
|
|
title: '收货人',
|
|
@@ -281,6 +264,11 @@
|
|
},
|
|
},
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ width: 100,
|
|
|
|
+ title: '优惠金额',
|
|
|
|
+ field: 'prePrice',
|
|
|
|
+ },
|
|
{
|
|
{
|
|
width: 100,
|
|
width: 100,
|
|
title: '合计金额',
|
|
title: '合计金额',
|
|
@@ -343,7 +331,6 @@
|
|
},
|
|
},
|
|
tool: {
|
|
tool: {
|
|
tools: {
|
|
tools: {
|
|
- delete: true,
|
|
|
|
search: true,
|
|
search: true,
|
|
refresh: true
|
|
refresh: true
|
|
}
|
|
}
|
|
@@ -788,6 +775,7 @@
|
|
citationOrder() {
|
|
citationOrder() {
|
|
let data : any = (this as any).$refs.bill.getSourceTableSelectData(0);
|
|
let data : any = (this as any).$refs.bill.getSourceTableSelectData(0);
|
|
console.log(data);
|
|
console.log(data);
|
|
|
|
+ if (data.length <= 0) return this.$message.warning('请选择引单数据');
|
|
data = data.map((item : any) => {
|
|
data = data.map((item : any) => {
|
|
item.receiveAddress = item.address
|
|
item.receiveAddress = item.address
|
|
item.receive = item.consignee
|
|
item.receive = item.consignee
|
|
@@ -795,10 +783,13 @@
|
|
const { ...newData } = item
|
|
const { ...newData } = item
|
|
return newData
|
|
return newData
|
|
})
|
|
})
|
|
- if (data.length <= 0) return this.$message.warning('请选择引单数据');
|
|
|
|
|
|
+ let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
|
|
|
|
+ // billConfig.tool.tools = { save: true, smt: true };
|
|
|
|
+ // this.isAdd = true;
|
|
|
|
+ billConfig.tool.tools = { save: true};
|
|
(this.$refs.bill as any).showTab = 'bill';
|
|
(this.$refs.bill as any).showTab = 'bill';
|
|
- this.isAdd = true;
|
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
|
+ (this.$refs.bill as any).setBillConfig(billConfig);
|
|
(this.$refs.bill as any).setBillFormValue(data[0]); // 设置单据表单数据
|
|
(this.$refs.bill as any).setBillFormValue(data[0]); // 设置单据表单数据
|
|
(this.$refs.bill as any).setBillTableValue(data[0].suborderList, 0);// 设置第1张单据表格数据
|
|
(this.$refs.bill as any).setBillTableValue(data[0].suborderList, 0);// 设置第1张单据表格数据
|
|
}, 0)
|
|
}, 0)
|
|
@@ -809,7 +800,12 @@
|
|
}
|
|
}
|
|
// 监听表格数据变化
|
|
// 监听表格数据变化
|
|
onChangeRow(e : any) {
|
|
onChangeRow(e : any) {
|
|
- e.totalPrice = parseFloat((e.number * e.unitPrice).toFixed(2));
|
|
|
|
|
|
+ this.isChange = true;
|
|
|
|
+ this.isSubmit = false;
|
|
|
|
+ e.prePrice = e.prePrice ? e.prePrice : 0;
|
|
|
|
+ e.realityPrice = parseFloat((e.number * e.unitPrice).toFixed(2));
|
|
|
|
+ e.totalPrice = e.realityPrice - e.prePrice;
|
|
|
|
+
|
|
}
|
|
}
|
|
// 确定商品新增
|
|
// 确定商品新增
|
|
confirmProduct(e : any) {
|
|
confirmProduct(e : any) {
|
|
@@ -872,10 +868,12 @@
|
|
delete query.id;
|
|
delete query.id;
|
|
api.outbound(query, 'supplyOutOrder').then((res : any) => {
|
|
api.outbound(query, 'supplyOutOrder').then((res : any) => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
- this.$message.success(res.msg);
|
|
|
|
|
|
+ // this.isAdd = false;
|
|
|
|
+ // this.isChange = false;
|
|
|
|
+ // this.isSubmit = true;
|
|
this.getDataList();
|
|
this.getDataList();
|
|
|
|
+ this.$message.success('保存成功');
|
|
(this.$refs.bill as any).showTab = 'all';
|
|
(this.$refs.bill as any).showTab = 'all';
|
|
- (this.$refs.bill as any).setBillFormValue({});
|
|
|
|
} else this.$message.error(res.msg);
|
|
} else this.$message.error(res.msg);
|
|
})
|
|
})
|
|
} else if (this.tabType === 'all' || this.tabType === 'draftsBox') {
|
|
} else if (this.tabType === 'all' || this.tabType === 'draftsBox') {
|
|
@@ -883,10 +881,9 @@
|
|
console.log('保存 ==>', query);
|
|
console.log('保存 ==>', query);
|
|
api.updateList(query, 'supplyOutOrder').then((res : any) => {
|
|
api.updateList(query, 'supplyOutOrder').then((res : any) => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
- this.$message.success(res.msg);
|
|
|
|
- this.getDataList();
|
|
|
|
- (this.$refs.bill as any).showTab = 'all';
|
|
|
|
- (this.$refs.bill as any).setBillFormValue({});
|
|
|
|
|
|
+ this.$message.success('保存成功');
|
|
|
|
+ this.isChange = false;
|
|
|
|
+ this.isSubmit = true;
|
|
} else this.$message.error(res.msg);
|
|
} else this.$message.error(res.msg);
|
|
})
|
|
})
|
|
};
|
|
};
|
|
@@ -903,13 +900,16 @@
|
|
console.log('编辑this.tabType ==>', this.tabType);
|
|
console.log('编辑this.tabType ==>', this.tabType);
|
|
console.log('编辑 ==>', e);
|
|
console.log('编辑 ==>', e);
|
|
e = e.row ? e.row : e;
|
|
e = e.row ? e.row : e;
|
|
- api.single({ id: e.id }, 'supplyEntryOrder').then((res : any) => {
|
|
|
|
|
|
+ api.single({ id: e.id }, 'supplyOutOrder').then((res : any) => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
let parentData = res.data ? res.data : e;
|
|
let parentData = res.data ? res.data : e;
|
|
this.baseInfo = parentData;
|
|
this.baseInfo = parentData;
|
|
if (this.tabType === 'all' || this.tabType === 'draftsBox') {
|
|
if (this.tabType === 'all' || this.tabType === 'draftsBox') {
|
|
- if (this.tabType === 'all' && parentData.submitState === 1) return this.setReadonly(parentData);
|
|
|
|
let loading = this.$loading({ target: '.main-container' });
|
|
let loading = this.$loading({ target: '.main-container' });
|
|
|
|
+ if (parentData.submitState === 1) {
|
|
|
|
+ loading.close();
|
|
|
|
+ return this.setReadonly(parentData)
|
|
|
|
+ }
|
|
let data = parentData.suborderList;
|
|
let data = parentData.suborderList;
|
|
let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
|
|
let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
|
|
if (billConfig.tableConfig[0].table.columns.at(-1).title != '操作') {
|
|
if (billConfig.tableConfig[0].table.columns.at(-1).title != '操作') {
|
|
@@ -933,12 +933,13 @@
|
|
billConfig.tool.tools = { save: true, };
|
|
billConfig.tool.tools = { save: true, };
|
|
if (this.tabType === 'draftsBox' || parentData.submitState === 0) billConfig.tool.tools = { save: true, smt: true };
|
|
if (this.tabType === 'draftsBox' || parentData.submitState === 0) billConfig.tool.tools = { save: true, smt: true };
|
|
data.map((v : any, i : any) => {
|
|
data.map((v : any, i : any) => {
|
|
|
|
+ console.log(v.materialSku);
|
|
v.dataIndex = i;
|
|
v.dataIndex = i;
|
|
v.towInOne = v.storehouseName + ',' + v.storingLocationName; // 仓库仓位
|
|
v.towInOne = v.storehouseName + ',' + v.storingLocationName; // 仓库仓位
|
|
// 查库存
|
|
// 查库存
|
|
api.getInventoryByStoridAndSkuid({
|
|
api.getInventoryByStoridAndSkuid({
|
|
storidId: v.storehouseId,
|
|
storidId: v.storehouseId,
|
|
- skuid: v.id,
|
|
|
|
|
|
+ skuid: v.materialSku,
|
|
}).then((res : any) => {
|
|
}).then((res : any) => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
v.inventory = res.data;
|
|
v.inventory = res.data;
|
|
@@ -966,6 +967,9 @@
|
|
let readonly = (this as any).$lodash.cloneDeep(this.config.bill);
|
|
let readonly = (this as any).$lodash.cloneDeep(this.config.bill);
|
|
readonly.form.attr.readonly = true; // 设置只读
|
|
readonly.form.attr.readonly = true; // 设置只读
|
|
readonly.tool.tools = {};
|
|
readonly.tool.tools = {};
|
|
|
|
+ if (this.tabType != 'recycleBin') {
|
|
|
|
+ if (e.submitState === 1) readonly.tool.tools = { returnSmt: true };
|
|
|
|
+ }
|
|
readonly.tableConfig[0].table.columns = readonly.tableConfig[0].table.columns.filter((v : any) => v.title != '操作');
|
|
readonly.tableConfig[0].table.columns = readonly.tableConfig[0].table.columns.filter((v : any) => v.title != '操作');
|
|
let data = e.suborderList;
|
|
let data = e.suborderList;
|
|
data.map((v : any, i : any) => {
|
|
data.map((v : any, i : any) => {
|
|
@@ -973,7 +977,7 @@
|
|
// 查库存
|
|
// 查库存
|
|
api.getInventoryByStoridAndSkuid({
|
|
api.getInventoryByStoridAndSkuid({
|
|
storidId: v.storehouseId,
|
|
storidId: v.storehouseId,
|
|
- skuid: v.id,
|
|
|
|
|
|
+ skuid: v.materialSku,
|
|
}).then((res : any) => {
|
|
}).then((res : any) => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
v.inventory = res.data;
|
|
v.inventory = res.data;
|
|
@@ -1001,7 +1005,7 @@
|
|
type: 'warning',
|
|
type: 'warning',
|
|
center: true
|
|
center: true
|
|
}).then(() => {
|
|
}).then(() => {
|
|
- api.submitTo({ id: selectData[0].id }, 'supplyEntryOrder').then((res : any) => {
|
|
|
|
|
|
+ api.submitTo({ id: selectData[0].id }, 'supplyOutOrder').then((res : any) => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
this.$message.success('提交成功');
|
|
this.$message.success('提交成功');
|
|
this.clickTab('draftsBox');
|
|
this.clickTab('draftsBox');
|
|
@@ -1009,6 +1013,7 @@
|
|
})
|
|
})
|
|
}).catch(() => this.$message.info('已取消提交'));
|
|
}).catch(() => this.$message.info('已取消提交'));
|
|
} else {
|
|
} else {
|
|
|
|
+ // if (this.isAdd) return this.$message.warning('新增数据必须先保存才能提交');
|
|
console.log('isChange ==> ', this.isChange);
|
|
console.log('isChange ==> ', this.isChange);
|
|
console.log('isSubmit ==> ', this.isSubmit);
|
|
console.log('isSubmit ==> ', this.isSubmit);
|
|
if (this.isSubmit) {
|
|
if (this.isSubmit) {
|
|
@@ -1018,7 +1023,7 @@
|
|
type: 'warning',
|
|
type: 'warning',
|
|
center: true
|
|
center: true
|
|
}).then(() => {
|
|
}).then(() => {
|
|
- api.submitTo({ id: this.baseInfo.id }, 'supplyEntryOrder').then((res : any) => {
|
|
|
|
|
|
+ api.submitTo({ id: this.baseInfo.id }, 'supplyOutOrder').then((res : any) => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
this.$message.success('提交成功');
|
|
this.$message.success('提交成功');
|
|
this.clickTab(this.tabType);
|
|
this.clickTab(this.tabType);
|
|
@@ -1054,7 +1059,7 @@
|
|
center: true
|
|
center: true
|
|
}).then(() => {
|
|
}).then(() => {
|
|
// console.log(this.baseInfo.id);
|
|
// console.log(this.baseInfo.id);
|
|
- api.submitTo({ id: this.baseInfo.id }, 'supplyEntryOrder').then((res : any) => {
|
|
|
|
|
|
+ api.submitTo({ id: this.baseInfo.id }, 'supplyOutOrder').then((res : any) => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
this.$message.success('提交成功');
|
|
this.$message.success('提交成功');
|
|
this.clickTab(this.tabType);
|
|
this.clickTab(this.tabType);
|
|
@@ -1076,7 +1081,7 @@
|
|
center: true
|
|
center: true
|
|
}).then(() => {
|
|
}).then(() => {
|
|
if (this.tabType === 'smt') {
|
|
if (this.tabType === 'smt') {
|
|
- api.cancelSubmission({ id: e.id }, 'supplyEntryOrder').then((res : any) => {
|
|
|
|
|
|
+ api.cancelSubmission({ id: e.id }, 'supplyOutOrder').then((res : any) => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
this.$message.success('反提交成功');
|
|
this.$message.success('反提交成功');
|
|
this.clickTab(this.tabType);
|
|
this.clickTab(this.tabType);
|
|
@@ -1095,7 +1100,7 @@
|
|
center: true
|
|
center: true
|
|
}).then(() => {
|
|
}).then(() => {
|
|
if (this.tabType === 'smt') {
|
|
if (this.tabType === 'smt') {
|
|
- api.cancelSubmission({ id: this.baseInfo.id }, 'supplyEntryOrder').then((res : any) => {
|
|
|
|
|
|
+ api.cancelSubmission({ id: this.baseInfo.id }, 'supplyOutOrder').then((res : any) => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
this.$message.success('反提交成功');
|
|
this.$message.success('反提交成功');
|
|
this.clickTab(this.tabType);
|
|
this.clickTab(this.tabType);
|
|
@@ -1109,10 +1114,8 @@
|
|
clickTab(e : any) {
|
|
clickTab(e : any) {
|
|
console.log('切换tab ==> ', e);
|
|
console.log('切换tab ==> ', e);
|
|
this.tabType = e;
|
|
this.tabType = e;
|
|
- this.isAdd = false;
|
|
|
|
// submitState: 提交状态
|
|
// submitState: 提交状态
|
|
if (e === 'source') {
|
|
if (e === 'source') {
|
|
- this.isAdd = true;
|
|
|
|
this.getCitationList({});
|
|
this.getCitationList({});
|
|
}
|
|
}
|
|
if (e === 'all') this.getPageList({}, 'all'); // 草稿箱数据
|
|
if (e === 'all') this.getPageList({}, 'all'); // 草稿箱数据
|