DN单号去除逻辑重写

master
zhoulei 4 years ago
parent 9886807e5b
commit 64a2f1bf24

@ -3,7 +3,7 @@
<!-- 头部 -->
<view class="header" :style="{ backgroundColor: `rgba(23, 83, 234, ${scrollTop / 100})` }">
<view class="left">
<u-icon class="icon" name="arrow-left" @click="uni.navigateBack()" />
<u-icon class="icon" name="arrow-left" @click="uni.navigateBack({})" />
</view>
<view class="title">{{ $t('message.dn_ReceivingGoods') }}</view>
<view class="right"></view>
@ -23,7 +23,7 @@
<view class="Purchase-title">
<view class="Purchase">
<view>{{ $t('message.Purchase') }}</view>
<jPicker sureColor="#ff0000" style="width: 260rpx" @bindpicker="poListChoice" showKey="value" valKey="value" :val="wlCode" class="search" :options="poList" />
<jPicker sureColor="#ff0000" style="width: 260rpx" @bindpicker="poListChoice" showKey="value" valKey="value" :val="poNo" class="search" :options="poList" />
</view>
</view>
<!-- 物料 -->
@ -74,9 +74,7 @@
<u-td class="u-td">{{ item.wlCode }}</u-td>
<u-td class="u-td">{{ item.receiptAmount }}</u-td>
<u-td class="u-td">
<div class="u-td" @click="deleteItem(index)">
{{ $t('message.product_Delete') }}
</div>
<div class="u-td" @click="deleteItem(index)">{{ $t('message.product_Delete') }}</div>
</u-td>
</u-tr>
</u-table>
@ -98,11 +96,10 @@
</view>
</template>
<script lang="ts">
import { Component, Ref } from 'vue-property-decorator';
import { Component } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import jPicker from '@/components/J-Picker/jPicker.vue';
import { session } from '@/store/modules/session';
import { VForm, VFormRules } from 'vue/types/form';
import model from './model';
@Component({
components: {
@ -133,6 +130,8 @@ export default class dnReceiptDom extends BasePage {
LocationList: any = [];
//
wlCode: any = '';
//
poNo: any = '';
//
upload: any = [];
//
@ -171,40 +170,41 @@ export default class dnReceiptDom extends BasePage {
let list: any = localStorage.getItem('list');
localStorage.removeItem('list');
this.material = JSON.parse(list);
this.poList = [...this.material];
let temp = {};
let arr = [];
arr = this.poList.reduce(function (item, next) {
temp[next.poNo] ? '' : (temp[next.poNo] = true && item.push(next));
return item;
}, []);
console.log('arr>>>', arr);
this.poList = [...this.material]; //
let arr = this.removeDuplicates(this.poList);
//
arr.forEach((item: any) => {
item.label = item.poNo;
item.value = item.poNo;
});
this.poList = arr;
}
//
removeDuplicates(list) {
let temp = {};
let arr = [];
arr = list.reduce(function (item, next) {
temp[next.poNo] ? '' : (temp[next.poNo] = true && item.push(next));
return item;
}, []);
return arr;
}
//
poListChoice(e: any) {
console.log('选择采购单后触发的回调事件::', 'poListChoice:::', e);
this.material.forEach((item: any) => {
//
this.poNo = e.pickerName.value;
this.materialList = this.removeDuplicates(this.material);
this.materialList.forEach((item: any) => {
if (item.poNo == e.pickerName.value) {
let pickerName: any = {};
pickerName.label = item.materialCode;
pickerName.value = item.materialCode;
this.materialList.push(pickerName);
item.label = item.materialCode;
item.value = item.materialCode;
}
});
}
// receiptAmount requestAmount
materialChoice(e: any) {
this.material.forEach((item: any) => {
if (item.materialCode == e.pickerName.value) {
this.every = item;
return;
}
});
this.every = e.pickerName;
}
//
LocationChoice(e: any) {
@ -234,7 +234,7 @@ export default class dnReceiptDom extends BasePage {
});
return;
}
let isTrue: boolean = true;
let isTrue = true;
if (this.sendSpotList.length != 0) {
this.sendSpotList.forEach((item: any) => {
if (this.wlCode.sendSpot != item) {
@ -306,7 +306,7 @@ export default class dnReceiptDom extends BasePage {
}
//
business() {
let num: number = 0;
let num = 0;
this.LocationList.forEach((item: any) => {
num += parseFloat(item.receiptAmount);
});

Loading…
Cancel
Save