|
@@ -123,11 +123,11 @@
|
|
save: true,
|
|
save: true,
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- log:{
|
|
|
|
- request:{
|
|
|
|
- url:'/supply/supplyOutOrderOperateLog/page',
|
|
|
|
- method:'GET'
|
|
|
|
- }
|
|
|
|
|
|
+ log: {
|
|
|
|
+ request: {
|
|
|
|
+ url: '/supply/supplyOutOrderOperateLog/page',
|
|
|
|
+ method: 'GET'
|
|
|
|
+ }
|
|
},
|
|
},
|
|
form: {
|
|
form: {
|
|
attr: {
|
|
attr: {
|
|
@@ -212,8 +212,8 @@
|
|
attr: {
|
|
attr: {
|
|
size: 'mini',
|
|
size: 'mini',
|
|
height: 500,
|
|
height: 500,
|
|
- align: 'center',
|
|
|
|
- readonly: true
|
|
|
|
|
|
+ align: 'left',
|
|
|
|
+ readonly: true,
|
|
},
|
|
},
|
|
columns:
|
|
columns:
|
|
[{
|
|
[{
|
|
@@ -254,10 +254,15 @@
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- width: 110,
|
|
|
|
- title: '已交付数量',
|
|
|
|
|
|
+ width: 100,
|
|
|
|
+ title: '应出数量',
|
|
field: 'deliveryNumber',
|
|
field: 'deliveryNumber',
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ width: 110,
|
|
|
|
+ title: '出库数量',
|
|
|
|
+ field: 'outNumber',
|
|
|
|
+ },
|
|
{
|
|
{
|
|
width: 100,
|
|
width: 100,
|
|
title: '单价',
|
|
title: '单价',
|
|
@@ -779,10 +784,11 @@
|
|
}
|
|
}
|
|
// 引单
|
|
// 引单
|
|
citationOrder() {
|
|
citationOrder() {
|
|
- let data : any = (this as any).$refs.bill.getSourceTableSelectData(0);
|
|
|
|
- console.log(data);
|
|
|
|
- if (data.length <= 0) return this.$message.warning('请选择引单数据');
|
|
|
|
- data = data.map((item : any) => {
|
|
|
|
|
|
+ let parentData : any = (this as any).$refs.bill.getSourceTableSelectData(0);
|
|
|
|
+ console.log(parentData);
|
|
|
|
+ if (parentData.length <= 0) return this.$message.warning('请选择引单数据');
|
|
|
|
+ parentData = parentData.map((item : any, i : any) => {
|
|
|
|
+ item.dataIndex = i;
|
|
item.receiveAddress = item.address
|
|
item.receiveAddress = item.address
|
|
item.receive = item.consignee
|
|
item.receive = item.consignee
|
|
item.receivePhone = item.phone
|
|
item.receivePhone = item.phone
|
|
@@ -790,14 +796,19 @@
|
|
return newData
|
|
return newData
|
|
})
|
|
})
|
|
let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
|
|
let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
|
|
- // billConfig.tool.tools = { save: true, smt: true };
|
|
|
|
- // this.isAdd = true;
|
|
|
|
|
|
+ parentData[0].suborderList.map((v : any) => {
|
|
|
|
+ // v.outNumber = v.outNumber ? v.outNumber : 0;
|
|
|
|
+ v.deliveryNumber = v.number - v.outNumber;
|
|
|
|
+ });
|
|
|
|
+ this.isAdd = true;
|
|
|
|
+ this.tableData = parentData[0];
|
|
|
|
+ console.log('this.tableData ==> ', this.tableData);
|
|
billConfig.tool.tools = { save: true };
|
|
billConfig.tool.tools = { save: true };
|
|
(this.$refs.bill as any).showTab = 'bill';
|
|
(this.$refs.bill as any).showTab = 'bill';
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
(this.$refs.bill as any).setBillConfig(billConfig);
|
|
(this.$refs.bill as any).setBillConfig(billConfig);
|
|
- (this.$refs.bill as any).setBillFormValue(data[0]); // 设置单据表单数据
|
|
|
|
- (this.$refs.bill as any).setBillTableValue(data[0].suborderList, 0);// 设置第1张单据表格数据
|
|
|
|
|
|
+ (this.$refs.bill as any).setBillFormValue(parentData[0]); // 设置单据表单数据
|
|
|
|
+ (this.$refs.bill as any).setBillTableValue(parentData[0].suborderList, 0);// 设置第1张单据表格数据
|
|
}, 0)
|
|
}, 0)
|
|
}
|
|
}
|
|
// 获取机构数据
|
|
// 获取机构数据
|
|
@@ -852,8 +863,8 @@
|
|
query.suborderList = (this.$refs.bill as any).getBillTableData(0);
|
|
query.suborderList = (this.$refs.bill as any).getBillTableData(0);
|
|
if (query.suborderList.length > 0) {
|
|
if (query.suborderList.length > 0) {
|
|
for (let v of query.suborderList) {
|
|
for (let v of query.suborderList) {
|
|
- // if (!v.number || v.number <= 0) return this.$message.warning('请输入正确物料数量');
|
|
|
|
if (!v.unitPrice || v.unitPrice <= 0) return this.$message.warning('请输入正确物料单价');
|
|
if (!v.unitPrice || v.unitPrice <= 0) return this.$message.warning('请输入正确物料单价');
|
|
|
|
+ if (v.deliveryNumber < v.number) return this.$message.warning('数量不能大于应出数量');
|
|
if (v.number > v.inventory) return this.$message.warning('出库数据不能大于库存数量');
|
|
if (v.number > v.inventory) return this.$message.warning('出库数据不能大于库存数量');
|
|
v.taskOrderId = query.id;
|
|
v.taskOrderId = query.id;
|
|
v.purchaseSuborderId = v.id;
|
|
v.purchaseSuborderId = v.id;
|
|
@@ -916,7 +927,6 @@
|
|
loading.close();
|
|
loading.close();
|
|
return this.setReadonly(parentData)
|
|
return this.setReadonly(parentData)
|
|
}
|
|
}
|
|
- 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 != '操作') {
|
|
billConfig.tableConfig[0].table.columns.push({
|
|
billConfig.tableConfig[0].table.columns.push({
|
|
@@ -938,29 +948,36 @@
|
|
billConfig.form.attr.readonly = false; // 设置只读
|
|
billConfig.form.attr.readonly = false; // 设置只读
|
|
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 };
|
|
|
|
+ let data : any = parentData.suborderList;
|
|
|
|
+ let array : any = [];
|
|
data.map((v : any, i : any) => {
|
|
data.map((v : any, i : any) => {
|
|
- console.log(v.materialSku);
|
|
|
|
|
|
+ console.log(this.tabType);
|
|
v.dataIndex = i;
|
|
v.dataIndex = i;
|
|
v.towInOne = v.storehouseName + ',' + v.storingLocationName; // 仓库仓位
|
|
v.towInOne = v.storehouseName + ',' + v.storingLocationName; // 仓库仓位
|
|
- // 查库存
|
|
|
|
- api.getInventoryByStoridAndSkuid({
|
|
|
|
|
|
+ array.push({
|
|
storidId: v.storehouseId,
|
|
storidId: v.storehouseId,
|
|
skuid: v.materialSku,
|
|
skuid: v.materialSku,
|
|
- }).then((res : any) => {
|
|
|
|
- if (res.code === 200) {
|
|
|
|
- v.inventory = res.data;
|
|
|
|
- if (data.length === (i + 1)) {
|
|
|
|
- this.tableData = data;
|
|
|
|
- (this.$refs.bill as any).setBillConfig(billConfig);
|
|
|
|
- (this.$refs.bill as any).setBillFormValue(parentData);// 设置单据表单数据
|
|
|
|
- (this.$refs.bill as any).setBillTableValue(data, 0);// 设置第1张单据表格数据
|
|
|
|
- this.isAdd = false;
|
|
|
|
- (this.$refs.bill as any).showTab = 'bill';
|
|
|
|
- loading.close();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
})
|
|
})
|
|
});
|
|
});
|
|
|
|
+ console.log('data', data);
|
|
|
|
+ // 查库存
|
|
|
|
+ api.getInventoryByStoridsAndSkuids(array).then((res : any) => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ console.log(res);
|
|
|
|
+ let newData : any = [];
|
|
|
|
+ res.data.map((v : any, i : any) => {
|
|
|
|
+ newData.push(Object.assign(data[i], v))
|
|
|
|
+ })
|
|
|
|
+ console.log('newData', newData);
|
|
|
|
+ this.tableData = newData;
|
|
|
|
+ (this.$refs.bill as any).setBillConfig(billConfig);
|
|
|
|
+ (this.$refs.bill as any).setBillFormValue(parentData);// 设置单据表单数据
|
|
|
|
+ (this.$refs.bill as any).setBillTableValue(newData, 0);// 设置第1张单据表格数据
|
|
|
|
+ this.isAdd = false;
|
|
|
|
+ (this.$refs.bill as any).showTab = 'bill';
|
|
|
|
+ loading.close();
|
|
|
|
+ }
|
|
|
|
+ })
|
|
} else {
|
|
} else {
|
|
this.setReadonly(parentData);
|
|
this.setReadonly(parentData);
|
|
};
|
|
};
|
|
@@ -978,26 +995,32 @@
|
|
}
|
|
}
|
|
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) => {
|
|
|
|
|
|
+ let array : any = [];
|
|
|
|
+ data.map((v : any) => {
|
|
v.towInOne = v.storehouseName + ',' + v.storingLocationName; // 仓库仓位
|
|
v.towInOne = v.storehouseName + ',' + v.storingLocationName; // 仓库仓位
|
|
- // 查库存
|
|
|
|
- api.getInventoryByStoridAndSkuid({
|
|
|
|
|
|
+ array.push({
|
|
storidId: v.storehouseId,
|
|
storidId: v.storehouseId,
|
|
skuid: v.materialSku,
|
|
skuid: v.materialSku,
|
|
- }).then((res : any) => {
|
|
|
|
- if (res.code === 200) {
|
|
|
|
- v.inventory = res.data;
|
|
|
|
- if (data.length === (i + 1)) {
|
|
|
|
- (this.$refs.bill as any).setBillConfig(readonly);
|
|
|
|
- (this.$refs.bill as any).setBillFormValue(e);// 设置单据表单数据
|
|
|
|
- (this.$refs.bill as any).setBillTableValue(data, 0);// 设置第1张单据表格数据
|
|
|
|
- this.isAdd = false;
|
|
|
|
- (this.$refs.bill as any).showTab = 'bill';
|
|
|
|
- loading.close();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
})
|
|
})
|
|
});
|
|
});
|
|
|
|
+ console.log('array', array);
|
|
|
|
+ // 查库存
|
|
|
|
+ api.getInventoryByStoridsAndSkuids(array).then((res : any) => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ let newData : any = []
|
|
|
|
+ res.data.map((v : any, i : any) => {
|
|
|
|
+ newData.push(Object.assign(data[i], v))
|
|
|
|
+ })
|
|
|
|
+ console.log('newData', newData);
|
|
|
|
+ this.tableData = newData;
|
|
|
|
+ (this.$refs.bill as any).setBillConfig(readonly);
|
|
|
|
+ (this.$refs.bill as any).setBillFormValue(e);// 设置单据表单数据
|
|
|
|
+ (this.$refs.bill as any).setBillTableValue(newData, 0);// 设置第1张单据表格数据
|
|
|
|
+ this.isAdd = false;
|
|
|
|
+ (this.$refs.bill as any).showTab = 'bill';
|
|
|
|
+ loading.close();
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
// 工具栏提交
|
|
// 工具栏提交
|
|
onSmt(e : any) {
|
|
onSmt(e : any) {
|