|
|
|
@ -8,11 +8,11 @@
|
|
|
|
|
<view class="right"></view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="table-wrapper">
|
|
|
|
|
<wyb-table class="table" ref="table" width="100%" show-left-and-right-border enable-check="single" :headers="headers" @onCheck="clickIndex" :contents="model.aggregateList" :show-vert-border="false"></wyb-table>
|
|
|
|
|
<wyb-table class="table" ref="table" width="100%" show-left-and-right-border enable-check="multiple" :headers="headers" @onCheck="clickIndex" :contents="model.aggregateList" :show-vert-border="false"></wyb-table>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="bottom-bar">
|
|
|
|
|
<view class="extra">
|
|
|
|
|
<u-form ref="amountForm" :model="amountForm" :error-type="['toast']">
|
|
|
|
|
<!-- <u-form ref="amountForm" :model="amountForm" :error-type="['toast']">
|
|
|
|
|
<u-row class="bottom-info">
|
|
|
|
|
<u-col :span="12">
|
|
|
|
|
<u-form-item prop="amount" :label="$t('message.Summary_Number')" label-width="120rpx">
|
|
|
|
@ -20,7 +20,7 @@
|
|
|
|
|
</u-form-item>
|
|
|
|
|
</u-col>
|
|
|
|
|
</u-row>
|
|
|
|
|
</u-form>
|
|
|
|
|
</u-form> -->
|
|
|
|
|
<u-form ref="submitForm" :model="submitForm" :error-type="['toast']">
|
|
|
|
|
<u-row class="bottom-info">
|
|
|
|
|
<u-col :span="6">
|
|
|
|
@ -38,17 +38,17 @@
|
|
|
|
|
</view>
|
|
|
|
|
<view class="container">
|
|
|
|
|
<u-row>
|
|
|
|
|
<u-col :span="4">
|
|
|
|
|
<u-col :span="6">
|
|
|
|
|
<u-button type="warning" @click="onSelectAll">
|
|
|
|
|
{{ $t('message.po_SelectAll') }}
|
|
|
|
|
</u-button>
|
|
|
|
|
</u-col>
|
|
|
|
|
<u-col :span="4">
|
|
|
|
|
<!-- <u-col :span="4">
|
|
|
|
|
<u-button type="primary" @click="onOk">
|
|
|
|
|
{{ $t('message.dn_Confirm') }}
|
|
|
|
|
</u-button>
|
|
|
|
|
</u-col>
|
|
|
|
|
<u-col :span="4">
|
|
|
|
|
</u-col> -->
|
|
|
|
|
<u-col :span="6">
|
|
|
|
|
<u-button type="success" @click="onSubmit">
|
|
|
|
|
{{ $t('message.po_Submit') }}
|
|
|
|
|
</u-button>
|
|
|
|
@ -137,12 +137,33 @@ export default class AggregatingSummary extends BasePage {
|
|
|
|
|
|
|
|
|
|
// 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
|
|
|
|
|
onReady() {
|
|
|
|
|
this.$amountForm.setRules(this.amountFormRules);
|
|
|
|
|
/**this.$amountForm.setRules(this.amountFormRules);**/
|
|
|
|
|
this.$submitForm.setRules(this.submitFormRules);
|
|
|
|
|
this.isBusinessFinished = false;
|
|
|
|
|
}
|
|
|
|
|
clickIndex(e: any) {
|
|
|
|
|
this.spliceItem = e.data[0].lineData.materialCode;
|
|
|
|
|
console.log('ccccc', e);
|
|
|
|
|
//this.spliceItem = e.data[0].lineData.materialCode;
|
|
|
|
|
//修改本次交接数量
|
|
|
|
|
// model.setAggregateListItemHvAmount({
|
|
|
|
|
// index: this.model.aggregateList.findIndex((_) => _.checked),
|
|
|
|
|
// hvAmount: 0,
|
|
|
|
|
// });
|
|
|
|
|
e.data.forEach((item, index) => {
|
|
|
|
|
//debugger;
|
|
|
|
|
console.log('xuanzedeindex', e.data);
|
|
|
|
|
console.log('hvmount', item.lineData.totalMoAmount - item.lineData.totalHvAmount);
|
|
|
|
|
model.setAggregateListItemHvAmount({
|
|
|
|
|
index: e.data[index].index,
|
|
|
|
|
hvAmount: item.lineData.totalMoAmount - item.lineData.totalHvAmount,
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
this.model.aggregateList.forEach((item) => {
|
|
|
|
|
if (item.checked == false) {
|
|
|
|
|
item.hvAmount = 0;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
console.log('/////////', this.model.aggregateList);
|
|
|
|
|
}
|
|
|
|
|
beforeDestroy() {
|
|
|
|
|
if (model.aggregateList.length > 0 && !this.isBusinessFinished) {
|
|
|
|
@ -171,30 +192,33 @@ export default class AggregatingSummary extends BasePage {
|
|
|
|
|
/**
|
|
|
|
|
* 确认
|
|
|
|
|
*/
|
|
|
|
|
onOk() {
|
|
|
|
|
this.$amountForm.validate((valid) => {
|
|
|
|
|
if (!valid) return;
|
|
|
|
|
const firstSelection = this.model.aggregateList.find((_) => _.checked);
|
|
|
|
|
if (firstSelection === undefined) {
|
|
|
|
|
this.customToast(this.$t('message.Pi_tip7') as string);
|
|
|
|
|
} else {
|
|
|
|
|
// 本次交接数量
|
|
|
|
|
const currentPickNum = parseFloat(this.amountForm.amount);
|
|
|
|
|
// 已交接数量
|
|
|
|
|
const totalHvAmount = parseFloat(firstSelection.totalHvAmount);
|
|
|
|
|
// 拣配数量
|
|
|
|
|
const totalMoAmount = parseFloat(firstSelection.totalMoAmount);
|
|
|
|
|
if (currentPickNum != totalMoAmount) {
|
|
|
|
|
this.customToast(this.$t('message.Pi_tip12') as string);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
model.setAggregateListItemHvAmount({
|
|
|
|
|
index: this.model.aggregateList.findIndex((_) => _.checked),
|
|
|
|
|
hvAmount: currentPickNum,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
// onOk() {
|
|
|
|
|
// this.$amountForm.validate((valid) => {
|
|
|
|
|
// if (!valid) return;
|
|
|
|
|
// const firstSelection = this.model.aggregateList.find((_) => _.checked);
|
|
|
|
|
// if (firstSelection === undefined) {
|
|
|
|
|
// this.customToast(this.$t('message.Pi_tip7') as string);
|
|
|
|
|
// } else {
|
|
|
|
|
// // 本次交接数量
|
|
|
|
|
// const currentPickNum = parseFloat(this.amountForm.amount);
|
|
|
|
|
// // 已交接数量
|
|
|
|
|
// const totalHvAmount = parseFloat(firstSelection.totalHvAmount);
|
|
|
|
|
// // 拣配数量
|
|
|
|
|
// const totalMoAmount = parseFloat(firstSelection.totalMoAmount);
|
|
|
|
|
// //点击确定时有校验输入的交接数量必须=累计拣配数量???
|
|
|
|
|
// // if (currentPickNum != totalMoAmount) {
|
|
|
|
|
// // this.customToast(this.$t('message.Pi_tip12') as string);
|
|
|
|
|
// // return;
|
|
|
|
|
// // }
|
|
|
|
|
// //修改表格信息的
|
|
|
|
|
// model.setAggregateListItemHvAmount({
|
|
|
|
|
// index: this.model.aggregateList.findIndex((_) => _.checked),
|
|
|
|
|
// //hvAmount: currentPickNum,
|
|
|
|
|
// hvAmount: totalMoAmount - totalHvAmount,
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 上传
|
|
|
|
@ -241,6 +265,8 @@ export default class AggregatingSummary extends BasePage {
|
|
|
|
|
this.customToast(this.$t('message.Pi_tip13') as string);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
//此处校验了请确保交接数量等于需求数量
|
|
|
|
|
//totalMoAmount:累计拣配数量 totalHvAmount:交接数量 hvAmount:本次交接数量
|
|
|
|
|
List.forEach((item: any) => {
|
|
|
|
|
if (parseFloat(item.totalMoAmount) - parseFloat(item.totalHvAmount) != parseFloat(item.hvAmount)) {
|
|
|
|
|
isTrue = false;
|
|
|
|
@ -274,7 +300,7 @@ export default class AggregatingSummary extends BasePage {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
async onAggregate() {
|
|
|
|
|
this.amountForm.amount = '';
|
|
|
|
|
/**this.amountForm.amount = '';**/
|
|
|
|
|
this.submitForm.receiver = '';
|
|
|
|
|
this.submitForm.receiverName = '';
|
|
|
|
|
this.submitForm.password = '';
|
|
|
|
@ -292,7 +318,7 @@ export default class AggregatingSummary extends BasePage {
|
|
|
|
|
// model.proOrderResultList.splice(index, 1);
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
this.$amountForm.setRules(this.amountFormRules);
|
|
|
|
|
/**this.$amountForm.setRules(this.amountFormRules);**/
|
|
|
|
|
this.$submitForm.setRules(this.submitFormRules);
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|