|
@@ -31,6 +31,7 @@
|
|
|
// 右边
|
|
|
supplierInfo : any = {} // 机构信息
|
|
|
tableData : any = []
|
|
|
+ newTableData : any = []
|
|
|
mergeObj : any = []
|
|
|
setStatusData : any = ''
|
|
|
timeNum = 0;
|
|
@@ -906,10 +907,10 @@
|
|
|
console.log('新增tabType ==>', this.tabType);
|
|
|
if (e === 'billTable_0') {
|
|
|
(this.$refs.product as any).setShow(true); // 打开sku弹窗
|
|
|
- let obj = (this.$refs.bill as any).getBillFormValue();
|
|
|
- if (!this.tableData) this.tableData = obj.suborderList;
|
|
|
- console.log('this.tableData ==> ', this.tableData);
|
|
|
- (this.$refs.bill as any).setBillTableValue(this.tableData, 0);// 设置第1张单据表格数据
|
|
|
+ // let obj = (this.$refs.bill as any).getBillFormValue();
|
|
|
+ // if (!this.tableData) this.tableData = obj.suborderList;
|
|
|
+ // console.log('this.tableData ==> ', this.tableData);
|
|
|
+ // (this.$refs.bill as any).setBillTableValue(this.tableData, 0);// 设置第1张单据表格数据
|
|
|
} else {
|
|
|
let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
|
|
|
billConfig.form.attr.readonly = false; // 设置只读
|
|
@@ -1135,34 +1136,6 @@
|
|
|
e.realityPrice = parseFloat((e.number * e.unitPrice).toFixed(2));
|
|
|
e.totalPrice = e.realityPrice - e.prePrice;
|
|
|
}
|
|
|
- // 确定商品新增
|
|
|
- confirmProduct(e : any) {
|
|
|
- let contents : any = [], goodsData = e, newArr : any = [], obj : any = {};
|
|
|
- goodsData = goodsData.map((item : any) => {
|
|
|
- item.materialName = item.skuTitle
|
|
|
- item.prePrice = 0
|
|
|
- item.unitPrice = item.price
|
|
|
- item.materialSku = item.id
|
|
|
- const { id, ...newData } = item
|
|
|
- return newData
|
|
|
- })
|
|
|
- this.tableData = this.tableData.concat(goodsData);
|
|
|
- newArr = this.tableData.reduce((prev : any, current : any) => {
|
|
|
- obj[current.materialSku] ? contents.push(current.materialName) : (obj[current.materialSku] = true && prev.push(current))
|
|
|
- return prev
|
|
|
- }, []);
|
|
|
- this.tableData = newArr;
|
|
|
- this.tableData.map((v : any, i : any) => {
|
|
|
- v.dataIndex = i;
|
|
|
- if (!v.prePrice) v.prePrice = '0';
|
|
|
- });
|
|
|
- if (contents.length > 0) {
|
|
|
- this.$alert('商品 “' + contents + '” 已存在!', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- });
|
|
|
- };
|
|
|
- (this.$refs.bill as any).setBillTableValue(this.tableData, 0);// 设置第1张单据表格数据
|
|
|
- }
|
|
|
// 派单
|
|
|
onDispatch(e : any) {
|
|
|
console.log('派单 ==>', e);
|
|
@@ -1292,6 +1265,36 @@
|
|
|
if (data === 'smt') this.getPageList({ submitState: 1 }, 'smt'); // 已提交数据
|
|
|
if (data === 'recycleBin') this.getSelectDeleteList({}) // 回收站数据
|
|
|
}
|
|
|
+ // 确定商品新增
|
|
|
+ confirmProduct(e : any) {
|
|
|
+ let contents : any = [], goodsData = e, newArr : any = [], obj : any = {};
|
|
|
+ goodsData = goodsData.map((item : any) => {
|
|
|
+ item.materialName = item.skuTitle
|
|
|
+ item.prePrice = 0
|
|
|
+ item.unitPrice = item.price
|
|
|
+ item.materialSku = item.id
|
|
|
+ const { id, ...newData } = item
|
|
|
+ return newData
|
|
|
+ })
|
|
|
+ console.log('newTableData ==> ', this.newTableData);
|
|
|
+ this.tableData = this.newTableData.concat(goodsData);
|
|
|
+ console.log('tableData ==> ', this.tableData);
|
|
|
+ newArr = this.tableData.reduce((prev : any, current : any) => {
|
|
|
+ obj[current.materialSku] ? contents.push(current.materialName) : (obj[current.materialSku] = true && prev.push(current))
|
|
|
+ return prev
|
|
|
+ }, []);
|
|
|
+ this.tableData = newArr;
|
|
|
+ this.tableData.map((v : any, i : any) => {
|
|
|
+ v.dataIndex = i;
|
|
|
+ if (!v.prePrice) v.prePrice = '0';
|
|
|
+ });
|
|
|
+ if (contents.length > 0) {
|
|
|
+ this.$alert('商品 “' + contents + '” 已存在!', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ });
|
|
|
+ };
|
|
|
+ (this.$refs.bill as any).setBillTableValue(this.tableData, 0);// 设置第1张单据表格数据
|
|
|
+ }
|
|
|
// 单据表格删除
|
|
|
changeTable(item : any) {
|
|
|
this.$confirm('确定删除吗!', '注意', {
|
|
@@ -1301,10 +1304,10 @@
|
|
|
center: true
|
|
|
}).then(() => {
|
|
|
this.tableData[item.dataIndex].isDeleted = 1;
|
|
|
- let newData = this.tableData.filter((res : any) => res.isDeleted === 0);
|
|
|
+ this.newTableData = this.tableData.filter((res : any) => res.isDeleted === 0);
|
|
|
console.log('原表格数据 ==> ', this.tableData);
|
|
|
- console.log('新表格数据 ==> ', newData);
|
|
|
- (this.$refs.bill as any).setBillTableValue(newData, 0);// 设置第1张单据表格数据
|
|
|
+ console.log('新表格数据 ==> ', this.newTableData);
|
|
|
+ (this.$refs.bill as any).setBillTableValue(this.newTableData, 0);// 设置第1张单据表格数据
|
|
|
this.$message.success('删除成功');
|
|
|
}).catch(() => this.$message.info('已取消删除'));
|
|
|
}
|