fix:DN修复提交时携带的参数

master
zhoulei 4 years ago
parent 3ca4594c0d
commit 27c00ecf13

@ -139,6 +139,7 @@ export default {
} }
}, },
selChange(e) { selChange(e) {
console.log('触发机制。。');
this.nSel = e.detail.value[0]; this.nSel = e.detail.value[0];
}, },
filterOp(e) { filterOp(e) {

@ -45,14 +45,14 @@
</view> </view>
<view class="number-right"> <view class="number-right">
<view class="number-right-title">{{ $t('message.Cumulative') }}</view> <view class="number-right-title">{{ $t('message.Cumulative') }}</view>
<u-input v-model="Cumulative" :type="type" :border="border" class="input" disabled /> <u-input v-model="every.receiptAmount" :type="type" :border="border" class="input" disabled />
</view> </view>
</view> </view>
<!-- 库位 --> <!-- 库位 -->
<view class="library"> <view class="library">
<view class="library-left"> <view class="library-left">
<view>{{ $t('message.CommissionedLocation') }}</view> <view>{{ $t('message.CommissionedLocation') }}</view>
<jPicker sureColor="#ff0000" style="width: 230rpx" @bindpicker="LocationChoice" showKey="value" valKey="value" :val="wlCode" class="search" :options="Location" /> <jPicker sureColor="#ff0000" style="width: 230rpx" @bindpicker="LocationChoice" showKey="value" valKey="value" :val="wl.value" class="search" :options="Location" />
</view> </view>
<view class="library-right"> <view class="library-right">
<view class="library-right-title">{{ $t('message.CommissionedThisNumber') }}</view> <view class="library-right-title">{{ $t('message.CommissionedThisNumber') }}</view>
@ -111,31 +111,29 @@ export default class dnReceiptDom extends BasePage {
form: any = { form: any = {
documentNo: '', documentNo: '',
}; };
material: any = {}; //
material: any = [];
poList: any = []; poList: any = [];
materialList: any = []; materialList: any = [];
every: any = ''; //
every: any = {};
value = ''; value = '';
type = 'text'; type = 'text';
border = true; border = true;
//
Cumulative: any = 0;
//
sendSpotList: any = [];
// //
receiptAmount: any = ''; receiptAmount: any = '';
// //
Location: any = []; Location: any = [];
// //
LocationList: any = []; LocationList: any = [];
// //
wlCode: any = ''; wl: any = {
value: null,
};
// //
poNo: any = ''; poNo: any = null;
// //
requestAmount = null; requestAmount: number = null;
//
upload: any = [];
// //
async onReady() { async onReady() {
// //
@ -165,9 +163,6 @@ export default class dnReceiptDom extends BasePage {
}); });
return; return;
} }
// 1.
// 2.poNo
// 3.poNo
await this.model.queryOrderInInfo(this.form.documentNo); await this.model.queryOrderInInfo(this.form.documentNo);
let list: any = localStorage.getItem('list'); let list: any = localStorage.getItem('list');
localStorage.removeItem('list'); localStorage.removeItem('list');
@ -214,16 +209,16 @@ export default class dnReceiptDom extends BasePage {
// receiptAmount requestAmount // receiptAmount requestAmount
materialChoice(e: any) { materialChoice(e: any) {
// //
this.every = e.pickerName; this.every = { ...e.pickerName };
} }
// //
LocationChoice(e: any) { LocationChoice(e: any) {
this.wlCode = e.pickerName.value; this.wl = e.pickerName;
} }
// //
Add() { Add() {
const count = this.totalLocation(this.LocationList); const count = this.totalLocation(this.LocationList);
if (this.receiptAmount == '' || this.wlCode == '') { if (this.receiptAmount == '' || this.wl.value == '') {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: this.$t('message.Commission_tips2') as any, title: this.$t('message.Commission_tips2') as any,
@ -245,7 +240,7 @@ export default class dnReceiptDom extends BasePage {
return; return;
} }
// return // return
let isTrue = this.LocationList.some((item) => item.wlCode !== this.wlCode); let isTrue = this.LocationList.some((item) => item.wlCode !== this.wl.label);
if (isTrue) { if (isTrue) {
uni.showToast({ uni.showToast({
@ -254,39 +249,48 @@ export default class dnReceiptDom extends BasePage {
}); });
return; return;
} }
const loc = this.Location.find((item) => item.value === this.wlCode);
this.LocationList.push({ this.LocationList.push({
...loc, ...this.every,
wlCode: this.wl.label,
receiptAmount: this.receiptAmount, receiptAmount: this.receiptAmount,
wlCode: this.wlCode,
}); });
this.every.wllist = this.LocationList;
this.receiptAmount = ''; this.receiptAmount = '';
isTrue = true; isTrue = true;
this.business(); this.business();
} }
deleteItem(index: any) { deleteItem(index: any) {
this.LocationList.splice(index, 1); this.LocationList.splice(index, 1);
this.every.wllist.splice(index, 1);
console.log('表格数据', this.LocationList);
console.log('要上传的数据', this.every);
this.business(); this.business();
} }
//
resetForm() {
// add table
this.LocationList = [];
this.poNo = '';
//
this.wl = {
value: null,
};
//
this.every = {};
//
this.materialList = [];
//
this.receiptAmount = null;
}
async onSubmit() { async onSubmit() {
if (this.every.wllist == null || this.every.wllist.length == 0) { this.resetForm();
return;
if (this.LocationList.length === 0) {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: this.$t('message.Commission_tips5') as any, title: this.$t('message.Commission_tips5') as any,
}); });
} }
this.upload.push(this.every); this.every.wllist = this.LocationList;
await this.model.submitOrderInEnter(this.upload); console.log('new this.every :::: ', this.every);
this.LocationList = []; // await this.model.submitOrderInEnter([this.every]);
this.wlCode = '';
this.receiptAmount = '';
this.Cumulative = 0;
this.every = '';
this.materialList = [];
} }
async bill() { async bill() {
if (this.form.documentNo == '') { if (this.form.documentNo == '') {
@ -306,12 +310,7 @@ export default class dnReceiptDom extends BasePage {
} }
// //
business() { business() {
let num = 0; this.every.receiptAmount = this.totalLocation(this.LocationList);
this.LocationList.forEach((item: any) => {
num += parseFloat(item.receiptAmount);
});
this.Cumulative = num;
this.every.receiptAmount = num;
} }
} }
</script> </script>

Loading…
Cancel
Save