|
|
@ -3,7 +3,7 @@
|
|
|
|
<!-- 头部 -->
|
|
|
|
<!-- 头部 -->
|
|
|
|
<view class="header" :style="{ backgroundColor: `rgba(23, 83, 234, ${scrollTop / 100})` }">
|
|
|
|
<view class="header" :style="{ backgroundColor: `rgba(23, 83, 234, ${scrollTop / 100})` }">
|
|
|
|
<view class="left">
|
|
|
|
<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>
|
|
|
|
<view class="title">{{ $t('message.dn_ReceivingGoods') }}</view>
|
|
|
|
<view class="title">{{ $t('message.dn_ReceivingGoods') }}</view>
|
|
|
|
<view class="right"></view>
|
|
|
|
<view class="right"></view>
|
|
|
@ -23,7 +23,7 @@
|
|
|
|
<view class="Purchase-title">
|
|
|
|
<view class="Purchase-title">
|
|
|
|
<view class="Purchase">
|
|
|
|
<view class="Purchase">
|
|
|
|
<view>{{ $t('message.Purchase') }}</view>
|
|
|
|
<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>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<!-- 物料 -->
|
|
|
|
<!-- 物料 -->
|
|
|
@ -74,9 +74,7 @@
|
|
|
|
<u-td class="u-td">{{ item.wlCode }}</u-td>
|
|
|
|
<u-td class="u-td">{{ item.wlCode }}</u-td>
|
|
|
|
<u-td class="u-td">{{ item.receiptAmount }}</u-td>
|
|
|
|
<u-td class="u-td">{{ item.receiptAmount }}</u-td>
|
|
|
|
<u-td class="u-td">
|
|
|
|
<u-td class="u-td">
|
|
|
|
<div class="u-td" @click="deleteItem(index)">
|
|
|
|
<div class="u-td" @click="deleteItem(index)">{{ $t('message.product_Delete') }}</div>
|
|
|
|
{{ $t('message.product_Delete') }}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</u-td>
|
|
|
|
</u-td>
|
|
|
|
</u-tr>
|
|
|
|
</u-tr>
|
|
|
|
</u-table>
|
|
|
|
</u-table>
|
|
|
@ -98,11 +96,10 @@
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
|
|
<script lang="ts">
|
|
|
|
import { Component, Ref } from 'vue-property-decorator';
|
|
|
|
import { Component } from 'vue-property-decorator';
|
|
|
|
import { BasePage } from '@/components/base/page';
|
|
|
|
import { BasePage } from '@/components/base/page';
|
|
|
|
import jPicker from '@/components/J-Picker/jPicker.vue';
|
|
|
|
import jPicker from '@/components/J-Picker/jPicker.vue';
|
|
|
|
import { session } from '@/store/modules/session';
|
|
|
|
import { session } from '@/store/modules/session';
|
|
|
|
import { VForm, VFormRules } from 'vue/types/form';
|
|
|
|
|
|
|
|
import model from './model';
|
|
|
|
import model from './model';
|
|
|
|
@Component({
|
|
|
|
@Component({
|
|
|
|
components: {
|
|
|
|
components: {
|
|
|
@ -133,6 +130,8 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
LocationList: any = [];
|
|
|
|
LocationList: any = [];
|
|
|
|
//所选择的库位
|
|
|
|
//所选择的库位
|
|
|
|
wlCode: any = '';
|
|
|
|
wlCode: any = '';
|
|
|
|
|
|
|
|
//所选择的采购单号
|
|
|
|
|
|
|
|
poNo: any = '';
|
|
|
|
//上传
|
|
|
|
//上传
|
|
|
|
upload: any = [];
|
|
|
|
upload: any = [];
|
|
|
|
//页面初始化
|
|
|
|
//页面初始化
|
|
|
@ -171,40 +170,41 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
let list: any = localStorage.getItem('list');
|
|
|
|
let list: any = localStorage.getItem('list');
|
|
|
|
localStorage.removeItem('list');
|
|
|
|
localStorage.removeItem('list');
|
|
|
|
this.material = JSON.parse(list);
|
|
|
|
this.material = JSON.parse(list);
|
|
|
|
this.poList = [...this.material];
|
|
|
|
this.poList = [...this.material]; //结构
|
|
|
|
let temp = {};
|
|
|
|
let arr = this.removeDuplicates(this.poList);
|
|
|
|
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);
|
|
|
|
|
|
|
|
arr.forEach((item: any) => {
|
|
|
|
arr.forEach((item: any) => {
|
|
|
|
item.label = item.poNo;
|
|
|
|
item.label = item.poNo;
|
|
|
|
item.value = item.poNo;
|
|
|
|
item.value = item.poNo;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
this.poList = arr;
|
|
|
|
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) {
|
|
|
|
poListChoice(e: any) {
|
|
|
|
console.log('选择采购单后触发的回调事件::', 'poListChoice:::', e);
|
|
|
|
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) {
|
|
|
|
if (item.poNo == e.pickerName.value) {
|
|
|
|
let pickerName: any = {};
|
|
|
|
item.label = item.materialCode;
|
|
|
|
pickerName.label = item.materialCode;
|
|
|
|
item.value = item.materialCode;
|
|
|
|
pickerName.value = item.materialCode;
|
|
|
|
|
|
|
|
this.materialList.push(pickerName);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//选择物料后触发的回调事件 本次数量:receiptAmount 需求数量:requestAmount
|
|
|
|
//选择物料后触发的回调事件 本次数量:receiptAmount 需求数量:requestAmount
|
|
|
|
materialChoice(e: any) {
|
|
|
|
materialChoice(e: any) {
|
|
|
|
this.material.forEach((item: any) => {
|
|
|
|
this.every = e.pickerName;
|
|
|
|
if (item.materialCode == e.pickerName.value) {
|
|
|
|
|
|
|
|
this.every = item;
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//选择库位后触发的回调事件
|
|
|
|
//选择库位后触发的回调事件
|
|
|
|
LocationChoice(e: any) {
|
|
|
|
LocationChoice(e: any) {
|
|
|
@ -234,7 +234,7 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
let isTrue: boolean = true;
|
|
|
|
let isTrue = true;
|
|
|
|
if (this.sendSpotList.length != 0) {
|
|
|
|
if (this.sendSpotList.length != 0) {
|
|
|
|
this.sendSpotList.forEach((item: any) => {
|
|
|
|
this.sendSpotList.forEach((item: any) => {
|
|
|
|
if (this.wlCode.sendSpot != item) {
|
|
|
|
if (this.wlCode.sendSpot != item) {
|
|
|
@ -306,7 +306,7 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//添加和删除操作的时候 计算累计收货数量
|
|
|
|
//添加和删除操作的时候 计算累计收货数量
|
|
|
|
business() {
|
|
|
|
business() {
|
|
|
|
let num: number = 0;
|
|
|
|
let num = 0;
|
|
|
|
this.LocationList.forEach((item: any) => {
|
|
|
|
this.LocationList.forEach((item: any) => {
|
|
|
|
num += parseFloat(item.receiptAmount);
|
|
|
|
num += parseFloat(item.receiptAmount);
|
|
|
|
});
|
|
|
|
});
|
|
|
|