虚拟单交接修改

master
guoshuang 3 years ago
parent 8e719271dd
commit 78c01c72d7

@ -182,6 +182,7 @@ export default {
Pi_tip16: '只能选择一个DN单', Pi_tip16: '只能选择一个DN单',
Pi_tip17: '请选择一条DN单', Pi_tip17: '请选择一条DN单',
Pi_tip18: '请选中要移库的数据', Pi_tip18: '请选中要移库的数据',
Pi_tip19: '只能选择一条修改数量',
//汇总交接 //汇总交接
Summary_Query: '汇总查询', Summary_Query: '汇总查询',
Summary_Contain: '包含', Summary_Contain: '包含',

@ -32,6 +32,7 @@ export default {
Pi_tip16: 'You can only select one DN list', Pi_tip16: 'You can only select one DN list',
Pi_tip17: 'Please select a dn list', Pi_tip17: 'Please select a dn list',
Pi_tip18: 'Please select the data to be moved', Pi_tip18: 'Please select the data to be moved',
Pi_tip19: 'Only one item can be selected to modify the quantity',
//版本更新 //版本更新
updatePrompt: 'Update tips', updatePrompt: 'Update tips',
Tip1: 'New version detected, update?', Tip1: 'New version detected, update?',

@ -160,7 +160,7 @@ export default class productCheckReceipt extends BasePage {
}; };
await this.model.queryScrapList(param); await this.model.queryScrapList(param);
if (this.model.code == '1') { if (this.model.code == '1') {
this.customToast(this.$t('message.product_Tip8') as string); //this.customToast(this.$t('message.product_Tip8') as string);
this.model.recordsList.forEach((item: any) => { this.model.recordsList.forEach((item: any) => {
item.fileNo = ' '; item.fileNo = ' ';
}); });

@ -58,13 +58,13 @@ export default class AggregatingResult extends BasePage {
* 汇总 * 汇总
*/ */
async onVirtual() { async onVirtual() {
const orderOutIdList = this.model.proOrderResultList.map((_: any) => _.orderOutId); // const orderOutIdList = this.model.proOrderResultList.map((_: any) => _.orderOutId);
const params = { // const params = {
factoryCode: session.factoryCode, // factoryCode: session.factoryCode,
loginName: session.loginName, // loginName: session.loginName,
orderOutIdList, // orderOutIdList,
}; // };
await this.model.querySummaryList(params); // await this.model.querySummaryList(params);
this.toPage(this.page.raw.handover.virtual.summary); this.toPage(this.page.raw.handover.virtual.summary);
} }
} }

@ -8,7 +8,7 @@
<view class="right"></view> <view class="right"></view>
</view> </view>
<view class="table-wrapper"> <view class="table-wrapper">
<wyb-table class="table" ref="table" width="100%" show-left-and-right-border enable-check="multiple" :headers="headers" :contents="model.summaryList" :show-vert-border="false"></wyb-table> <wyb-table class="table" ref="table" width="100%" show-left-and-right-border enable-check="multiple" :headers="headers" :contents="model.proOrderResultList" :show-vert-border="false"></wyb-table>
</view> </view>
<view class="bottom-bar"> <view class="bottom-bar">
<view class="extra"> <view class="extra">
@ -19,8 +19,8 @@
<u-input v-model="amountForm.oriSendSpot" /> <u-input v-model="amountForm.oriSendSpot" />
</u-form-item> </u-form-item>
</u-col> --> </u-col> -->
<u-col :span="6"> <u-col :span="12">
<u-form-item prop="amount" :label="$t('message.Pi_HandoverQuantity')" label-width="120rpx"> <u-form-item prop="amount" :label="$t('message.Pi_HandoverQuantity')" label-width="240rpx">
<u-input type="number" v-model="amountForm.amount" :placeholder="$t('message.po_PleaseInput')" /> <u-input type="number" v-model="amountForm.amount" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item> </u-form-item>
</u-col> </u-col>
@ -143,7 +143,7 @@ export default class VirtualSummary extends BasePage {
} }
beforeDestroy() { beforeDestroy() {
if (model.summaryList.length > 0 && !this.isBusinessFinished) { if (model.proOrderResultList.length > 0 && !this.isBusinessFinished) {
this.unlock(); this.unlock();
} }
} }
@ -174,12 +174,13 @@ export default class VirtualSummary extends BasePage {
this.$amountForm.validate(async (valid) => { this.$amountForm.validate(async (valid) => {
if (!valid) return; if (!valid) return;
// //
const firstRecord = model.summaryList[0]; const firstRecord = model.proOrderResultList[0];
if (firstRecord === undefined) { if (firstRecord === undefined) {
this.customToast(this.$t('message.LBWK') as string); this.customToast(this.$t('message.LBWK') as string);
return; return;
} }
console.log('firstRecord', firstRecord); console.log('firstRecord', firstRecord);
///
await model.checkAmount({ await model.checkAmount({
sapFactoryCode: model.sapFactoryCode, sapFactoryCode: model.sapFactoryCode,
loginName: session.loginName as string, loginName: session.loginName as string,
@ -191,49 +192,55 @@ export default class VirtualSummary extends BasePage {
amount: this.amountForm.amount, amount: this.amountForm.amount,
}); });
// //
const firstSelection = this.model.summaryList.find((_: any) => _.checked); const firstSelection = this.model.proOrderResultList.filter((_: any) => _.checked);
console.log('.......????', firstSelection.length);
if (firstSelection === undefined) { if (firstSelection === undefined) {
this.customToast(this.$t('message.Pi_tip7') as string); this.customToast(this.$t('message.Pi_tip7') as string);
} else { } else {
const inputAmount = parseFloat(this.amountForm.amount); // if (firstSelection.length > 1) {
const totalHvAmount = firstSelection.totalHvAmount; this.customToast(this.$t('message.Pi_tip19') as string);
const demand = firstSelection.amount; //
const totalMoAmount = firstSelection.totalMoAmount; //
console.log('2222', 2222222222222222222);
if (inputAmount + totalMoAmount > demand) {
this.customToast(this.$t('message.Pi_tip14') as string);
return; return;
}
console.log(1);
// if (inputAmount + totalHvAmount - totalMoAmount > 0.000001) {
// uni.showToast({
// icon: 'none',
// title: this.$t('message.Pi_tip8') as string,
// });
// }
if (
inputAmount <= 0
// inputAmount.toString().split(".")[1].length > 3
) {
this.customToast(this.$t('message.Pi_tip2') as string);
} else { } else {
// model.updateSummaryItem({ const inputAmount = parseFloat(this.amountForm.amount); //
// index: this.model.summaryList.findIndex((_: any) => _.checked), const totalHvAmount = firstSelection[0].totalHvAmount;
// newItem: { const demand = firstSelection[0].amount; //
// ...firstSelection, const totalMoAmount = firstSelection[0].totalMoAmount; //
// // oriSendSpot: this.amountForm.oriSendSpot, console.log('2222', 2222222222222222222);
// hvAmount: inputAmount, if (inputAmount + totalMoAmount > demand) {
// }, this.customToast(this.$t('message.Pi_tip14') as string);
// }); return;
this.model.summaryList.forEach((item: any) => { }
if (item.checked) { console.log(1);
item.hvAmount = this.amountForm.amount; // if (inputAmount + totalHvAmount - totalMoAmount > 0.000001) {
} // uni.showToast({
}); // icon: 'none',
uni.showToast({ // title: this.$t('message.Pi_tip8') as string,
icon: 'success', // });
title: this.$t('message.success') as string, // }
}); if (
inputAmount <= 0
// inputAmount.toString().split(".")[1].length > 3
) {
this.customToast(this.$t('message.Pi_tip2') as string);
} else {
// model.updateSummaryItem({
// index: this.model.summaryList.findIndex((_: any) => _.checked),
// newItem: {
// ...firstSelection,
// // oriSendSpot: this.amountForm.oriSendSpot,
// hvAmount: inputAmount,
// },
// });
this.model.proOrderResultList.forEach((item: any) => {
if (item.checked) {
item.hvAmount = this.amountForm.amount;
}
});
uni.showToast({
icon: 'success',
title: this.$t('message.success') as string,
});
}
} }
} }
}); });
@ -247,12 +254,12 @@ export default class VirtualSummary extends BasePage {
if (valid) { if (valid) {
let qtyStase = false; let qtyStase = false;
let selectsta = true; let selectsta = true;
console.log('qqq', model.summaryList); console.log('qqq', model.proOrderResultList);
if (model.summaryList.length === 0) { if (model.proOrderResultList.length === 0) {
this.customToast(this.$t('message.Pi_tip4') as string); this.customToast(this.$t('message.Pi_tip4') as string);
return; return;
} else { } else {
model.summaryList.map((item) => { model.proOrderResultList.map((item) => {
if (!item.checked) { if (!item.checked) {
return; return;
} else if (item.hvAmount == 0 || item.hvAmount == null) { } else if (item.hvAmount == 0 || item.hvAmount == null) {
@ -269,7 +276,6 @@ export default class VirtualSummary extends BasePage {
} }
if (qtyStase) { if (qtyStase) {
this.customToast(this.$t('message.Summary_PleaseInputNumber') as string); this.customToast(this.$t('message.Summary_PleaseInputNumber') as string);
return;
} }
let res = await auth.checkPassword({ let res = await auth.checkPassword({
rfPwd: this.submitForm.password, rfPwd: this.submitForm.password,
@ -279,31 +285,40 @@ export default class VirtualSummary extends BasePage {
if (res.code != 1) { if (res.code != 1) {
return; return;
} }
let list = [];
console.log('选择是否有标志', model.proOrderResultList);
model.proOrderResultList.forEach((item) => {
if (item.checked) {
list.push(item);
}
});
console.log("数据。。。",list);
await model.uploadSummaryList({ await model.uploadSummaryList({
operatorPass: this.submitForm.receiver, operatorPass: this.submitForm.receiver,
factoryCode: session.factoryCode as string, factoryCode: session.factoryCode as string,
loginName: session.loginName as string, loginName: session.loginName as string,
sapFactoryCode: model.sapFactoryCode, sapFactoryCode: model.sapFactoryCode,
dataList: model.summaryList.map((item) => ({ // dataList: list.map((item) => ({
...pick( // ...pick(
[ // [
'materialCode', // 'materialCode',
'materialDesc', // 'materialDesc',
'unit', // 'unit',
'wkposCode', // 'wkposCode',
'prdMaterialDesc', // 'prdMaterialDesc',
'sendSpot', // 'sendSpot',
// 'oriSendSpot', // // 'oriSendSpot',
'mrpCode', // 'mrpCode',
], // ],
item, // item,
), // ),
amount: String(item.amount), // amount: String(item.amount),
hvAmount: String(item.hvAmount), // hvAmount: String(item.hvAmount),
totalMoAmount: String(item.totalMoAmount), // totalMoAmount: String(item.totalMoAmount),
totalHvAmount: String(item.totalHvAmount), // totalHvAmount: String(item.totalHvAmount),
factoryCode: model.sapFactoryCode, // factoryCode: model.sapFactoryCode,
})), // })),
dataList: list,
includeOrderOutIdList: model.proOrderResultList.map((item: any) => item.orderOutId), includeOrderOutIdList: model.proOrderResultList.map((item: any) => item.orderOutId),
}); });
this.submitForm.receiverName = ''; this.submitForm.receiverName = '';

Loading…
Cancel
Save