Commit 5adf255d authored by XieZhiXiong's avatar XieZhiXiong

添加修改 生产通知单 相关逻辑

parent d781fc99
......@@ -172,12 +172,9 @@ const BillsForm: React.FC<BillsFormProps> = ({
extraData: {
productName: item.productName,
deliveryType,
id: '', // 加工发货单需要,明细id
processNum: 0, // 加工发货单需要,加工数量
orderNo: item.orderNo, // 订单编号
goodsCount: item.productCount, // 采购数量
price: item.price, // 加工发货、入库单需要,加工单价
totalPrice: 0, // 加工发货、入库单需要,加工总价
id: item.produceNoticeOrderDetailId, // 加工发货单需要,明细id
},
})) : [];
......@@ -1013,7 +1010,50 @@ const BillsForm: React.FC<BillsFormProps> = ({
if (!isEdit) {
return;
}
console.log('value', value)
PublicApi.postWarehouseInvoicesUpdata({
id: +id,
invoicesAbstract: rest.invoicesAbstract,
inventoryId: rest.inventoryId,
inventoryRole: rest.inventoryRole,
transactionTime: newTransactionTime,
invoicesDetailsRequests: newInvoicesDetailsRequests.map(item => {
const {
extraData: {
id,
orderNo,
deliveryType,
goodsCount,
price,
totalPrice,
...extraRest
},
itemName,
amount,
productCount,
...rest
} = item;
return {
...rest,
...extraRest,
goodsName: itemName,
storageCount: productCount,
productCount: goodsCount,
produceNoticeOrderDetailId: id,
};
}),
})
.then(res => {
if (res.code !== 1000) {
return;
}
setUnsaved(false);
setTimeout(() => {
history.goBack();
}, 800);
}).finally(() => {
setSubmitLoading(false);
});
}
break;
}
......@@ -1065,7 +1105,49 @@ const BillsForm: React.FC<BillsFormProps> = ({
if (!isEdit) {
return;
}
PublicApi.postWarehouseInvoicesUpdata({
id: +id,
invoicesAbstract: rest.invoicesAbstract,
inventoryId: rest.inventoryId,
inventoryRole: rest.inventoryRole,
transactionTime: newTransactionTime,
invoicesDetailsRequests: newInvoicesDetailsRequests.map(item => {
const {
extraData: {
id,
orderNo,
deliveryType,
goodsCount,
price,
totalPrice,
...extraRest
},
itemName,
amount,
productCount,
...rest
} = item;
return {
...rest,
...extraRest,
goodsName: itemName,
shipmentQuantity: productCount,
productCount: goodsCount,
produceNoticeOrderDetailId: id,
};
}),
})
.then(res => {
if (res.code !== 1000) {
return;
}
setUnsaved(false);
setTimeout(() => {
history.goBack();
}, 800);
}).finally(() => {
setSubmitLoading(false);
});
}
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment