|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
<template>
|
|
|
|
|
<view class="page-picking-order">
|
|
|
|
|
<view class="top"></view>
|
|
|
|
|
<view class="header">
|
|
|
|
|
<view class="left">
|
|
|
|
|
<u-icon class="icon" name="arrow-left" @click="uni.navigateBack()" />
|
|
|
|
@ -25,11 +26,11 @@
|
|
|
|
|
<!-- 添加库位 -->
|
|
|
|
|
<view class="library">
|
|
|
|
|
<view class="library-left">
|
|
|
|
|
<view>{{ $t('message.CommissionedLocation') }}</view>
|
|
|
|
|
<jPicker sureColor="#ff0000" style="width: 230rpx" @bindpicker="LocationChoice" showKey="value" valKey="value" :val="wlCode" class="search" :options="Location" />
|
|
|
|
|
<view>{{ $t('message.CommissionedLocation') }}:</view>
|
|
|
|
|
<jPicker sureColor="#ff0000" style="width: 230rpx" @bindpicker="LocationChoice" showKey="value" valKey="value" :val="wlCode.value" class="search" :options="Location" />
|
|
|
|
|
</view>
|
|
|
|
|
<view class="library-right">
|
|
|
|
|
<view class="library-right-title">{{ $t('message.CommissionedThisNumber') }}</view>
|
|
|
|
|
<view class="library-right-title">{{ $t('message.CommissionedThisNumber') }}:</view>
|
|
|
|
|
<u-input v-model="qty" :type="type" :border="border" class="input" :placeholder="$t('message.Summary_PleaseInputNumber')" />
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
@ -37,23 +38,7 @@
|
|
|
|
|
<view class="add">
|
|
|
|
|
<u-button type="primary" @click="Add">{{ $t('message.product_add') }}</u-button>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 表格 -->
|
|
|
|
|
<u-table class="library-table">
|
|
|
|
|
<u-tr class="u-tr">
|
|
|
|
|
<u-th class="u-th">{{ $t('message.product_Location') }}</u-th>
|
|
|
|
|
<u-th class="u-th">{{ $t('message.product_Number') }}</u-th>
|
|
|
|
|
<u-th class="u-th">{{ $t('message.operation') }}</u-th>
|
|
|
|
|
</u-tr>
|
|
|
|
|
<u-tr class="u-tr" v-for="(item, index) in LocationList" :key="index">
|
|
|
|
|
<u-td class="u-td">{{ item.wlCode }}</u-td>
|
|
|
|
|
<u-td class="u-td">{{ item.qty }}</u-td>
|
|
|
|
|
<u-td class="u-td">
|
|
|
|
|
<div class="u-td" @click="deleteItem(index)">
|
|
|
|
|
{{ $t('message.product_Delete') }}
|
|
|
|
|
</div>
|
|
|
|
|
</u-td>
|
|
|
|
|
</u-tr>
|
|
|
|
|
</u-table>
|
|
|
|
|
<wyb-table class="table" ref="table" width="100%" show-left-and-right-border :headers="detailHeader" :contents="LocationList" :show-vert-border="false" @onCellClick="deleteItem($event)"></wyb-table>
|
|
|
|
|
<view class="bottom-bar">
|
|
|
|
|
<div class="extra">
|
|
|
|
|
<u-form ref="form" :model="form" :error-type="['toast']">
|
|
|
|
@ -102,7 +87,7 @@ import model from './model';
|
|
|
|
|
import { session } from '@/store/modules/session';
|
|
|
|
|
import { VForm, VFormRules } from 'vue/types/form';
|
|
|
|
|
import jPicker from '@/components/J-Picker/jPicker.vue';
|
|
|
|
|
import { headers } from './config';
|
|
|
|
|
import { headers, detailHeader } from './config';
|
|
|
|
|
import { auth } from '@/store/modules/auth';
|
|
|
|
|
@Component({
|
|
|
|
|
components: {
|
|
|
|
@ -131,6 +116,7 @@ export default class RawReceiptDetail extends BasePage {
|
|
|
|
|
operatorName = '';
|
|
|
|
|
//添加库位和数量的列表
|
|
|
|
|
LocationList: any = [];
|
|
|
|
|
gather: any = [];
|
|
|
|
|
//库位
|
|
|
|
|
Location: any = [];
|
|
|
|
|
someIndex: number = 0;
|
|
|
|
@ -162,6 +148,7 @@ export default class RawReceiptDetail extends BasePage {
|
|
|
|
|
* 表头
|
|
|
|
|
*/
|
|
|
|
|
headers = headers;
|
|
|
|
|
detailHeader = detailHeader;
|
|
|
|
|
LocationChoice(e: any) {
|
|
|
|
|
this.wlCode = e.pickerName;
|
|
|
|
|
}
|
|
|
|
@ -177,8 +164,10 @@ export default class RawReceiptDetail extends BasePage {
|
|
|
|
|
}
|
|
|
|
|
handleRow({ data }: any) {
|
|
|
|
|
this.someIndex = data[0].index;
|
|
|
|
|
this.some = data[0].lineData;
|
|
|
|
|
this.model.blDetailList[this.someIndex].wlList = [];
|
|
|
|
|
this.some = this.model.blDetailList[this.someIndex];
|
|
|
|
|
this.qty = '';
|
|
|
|
|
console.log('this.some', this.some);
|
|
|
|
|
}
|
|
|
|
|
Add() {
|
|
|
|
|
if (this.qty == '' || this.wlCode == '') {
|
|
|
|
@ -203,7 +192,7 @@ export default class RawReceiptDetail extends BasePage {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
let num = parseFloat(this.qty);
|
|
|
|
|
this.LocationList.forEach((item: any) => {
|
|
|
|
|
this.model.blDetailList[this.someIndex].wlList.forEach((item: any) => {
|
|
|
|
|
num += parseFloat(item.qty);
|
|
|
|
|
});
|
|
|
|
|
if (num > this.model.blDetailList[this.someIndex].amount) {
|
|
|
|
@ -215,7 +204,7 @@ export default class RawReceiptDetail extends BasePage {
|
|
|
|
|
}
|
|
|
|
|
let isTrue: boolean = true;
|
|
|
|
|
if (this.LocationList.length != 0) {
|
|
|
|
|
this.LocationList.forEach((item: any) => {
|
|
|
|
|
this.model.blDetailList[this.someIndex].wlList.forEach((item: any) => {
|
|
|
|
|
if (this.wlCode.sendSpot != item.Code) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: 'none',
|
|
|
|
@ -232,36 +221,60 @@ export default class RawReceiptDetail extends BasePage {
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if ((isTrue = true)) {
|
|
|
|
|
if (isTrue == true) {
|
|
|
|
|
let arr = {
|
|
|
|
|
wlCode: this.wlCode.label,
|
|
|
|
|
qty: this.qty,
|
|
|
|
|
Code: this.wlCode.sendSpot,
|
|
|
|
|
...this.some,
|
|
|
|
|
};
|
|
|
|
|
this.LocationList.push(arr);
|
|
|
|
|
let objString = JSON.stringify(this.some);
|
|
|
|
|
let TEM = JSON.parse(objString);
|
|
|
|
|
TEM.wlList = null;
|
|
|
|
|
TEM.wlCode = this.wlCode.label;
|
|
|
|
|
TEM.qty = this.qty;
|
|
|
|
|
this.model.blDetailList[this.someIndex].wlList.push(TEM);
|
|
|
|
|
this.model.blDetailList[this.someIndex].wlList.push(arr);
|
|
|
|
|
this.qty = '';
|
|
|
|
|
this.business();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
deleteItem(index: any) {
|
|
|
|
|
this.LocationList.splice(index, 1);
|
|
|
|
|
this.model.blDetailList[this.someIndex].wlList.splice(index, 1);
|
|
|
|
|
this.business();
|
|
|
|
|
deleteItem(e: any) {
|
|
|
|
|
uni.showModal({
|
|
|
|
|
content: this.$t('message.product_Delete') as string,
|
|
|
|
|
cancelText: this.$t('message.Cancel') as string,
|
|
|
|
|
confirmText: this.$t('message.workArea_Confirm') as string,
|
|
|
|
|
success: (res) => {
|
|
|
|
|
if (res.confirm) {
|
|
|
|
|
let lineData = e.lineData;
|
|
|
|
|
let i: any;
|
|
|
|
|
this.model.blDetailList.forEach((item: any, index: any) => {
|
|
|
|
|
if (item.materialCode == lineData.materialCode && item.sendSpot == lineData.sendSpot) {
|
|
|
|
|
i = index;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
let NextIndex: any;
|
|
|
|
|
this.model.blDetailList[i].wlList.forEach((item: any, index: any) => {
|
|
|
|
|
if (item.wlCode == lineData.wlCode && item.qty == lineData.qty) {
|
|
|
|
|
NextIndex = index;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
this.model.blDetailList[i].wlList.splice(NextIndex, 1);
|
|
|
|
|
this.LocationList.splice(e.contentIndex, 1);
|
|
|
|
|
let num: any = 0;
|
|
|
|
|
this.model.blDetailList[i].wlList.forEach((item: any) => {
|
|
|
|
|
num += parseFloat(item.qty);
|
|
|
|
|
});
|
|
|
|
|
this.model.blDetailList[i].fillAmount = num;
|
|
|
|
|
} else if (res.cancel) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
business() {
|
|
|
|
|
let num: number = 0;
|
|
|
|
|
this.LocationList.forEach((item: any) => {
|
|
|
|
|
this.model.blDetailList[this.someIndex].wlList.forEach((item: any) => {
|
|
|
|
|
num += parseFloat(item.qty);
|
|
|
|
|
});
|
|
|
|
|
this.model.blDetailList[this.someIndex].fillAmount = num;
|
|
|
|
|
}
|
|
|
|
|
async onShow() {
|
|
|
|
|
async onReady() {
|
|
|
|
|
let means: any = JSON.parse(localStorage.getItem('__GWMS_APP_STATE_DATA__') as any);
|
|
|
|
|
let sendSpot = JSON.parse(localStorage.getItem('sendSpot') as any);
|
|
|
|
|
let content = {
|
|
|
|
@ -304,6 +317,8 @@ export default class RawReceiptDetail extends BasePage {
|
|
|
|
|
const params = {
|
|
|
|
|
dataList,
|
|
|
|
|
...this.form2,
|
|
|
|
|
factoryCode: this.session.factoryCode,
|
|
|
|
|
loginName: this.session.loginName,
|
|
|
|
|
};
|
|
|
|
|
await this.model.saveBlDetailUpload(params).then(() => {
|
|
|
|
|
this.toPage(this.page.raw.handover.feeding.Location);
|
|
|
|
@ -314,13 +329,21 @@ export default class RawReceiptDetail extends BasePage {
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.page-picking-order {
|
|
|
|
|
background: #f2f2f2 linear-gradient(0deg, #311818 0%, #4a78ea 51%, #1753ea 100%) no-repeat;
|
|
|
|
|
// background: #f2f2f2 linear-gradient(0deg, #311818 0%, #4a78ea 51%, #1753ea 100%) no-repeat;
|
|
|
|
|
background-size: 100% 600rpx;
|
|
|
|
|
padding: 30rpx;
|
|
|
|
|
padding-left: 0;
|
|
|
|
|
min-height: 100%;
|
|
|
|
|
padding-top: 118rpx;
|
|
|
|
|
padding-bottom: 222rpx;
|
|
|
|
|
|
|
|
|
|
.top {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 20px;
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 0;
|
|
|
|
|
left: 0;
|
|
|
|
|
background: #4a78ea;
|
|
|
|
|
}
|
|
|
|
|
.header {
|
|
|
|
|
position: fixed;
|
|
|
|
|
top: 36rpx;
|
|
|
|
@ -333,6 +356,7 @@ export default class RawReceiptDetail extends BasePage {
|
|
|
|
|
font-size: 34rpx;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
text-align: center;
|
|
|
|
|
background: #4a78ea;
|
|
|
|
|
.title {
|
|
|
|
|
flex: 3;
|
|
|
|
|
}
|
|
|
|
|