虚拟单交接修改

master
guoshuang 3 years ago
parent 8e719271dd
commit 78c01c72d7

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

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

@ -160,7 +160,7 @@ export default class productCheckReceipt extends BasePage {
};
await this.model.queryScrapList(param);
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) => {
item.fileNo = ' ';
});

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

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

Loading…
Cancel
Save