|
|
@ -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 = '';
|
|
|
|