|
|
|
@ -35,7 +35,7 @@
|
|
|
|
|
<!-- 应退数量 -->
|
|
|
|
|
<view class="material">
|
|
|
|
|
<view class="material-right">
|
|
|
|
|
<view class="material-right-title" style="width: 260rpx">{{ $t('message.returneds') }}:</view>
|
|
|
|
|
<view class="material-right-title" style="width: 88px">{{ $t('message.returneds') }}:</view>
|
|
|
|
|
<view class="material-right-code" style="overflow: hidden">{{ some.poAmount }}</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
@ -79,6 +79,13 @@
|
|
|
|
|
<u-input :placeholder="$t('message.po_PleaseInput')" v-model="qty" type="number" :border="border" class="input" />
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 容器编码 -->
|
|
|
|
|
<view class="single">
|
|
|
|
|
<view class="single-left">
|
|
|
|
|
<view>{{ $t('message.Container') }}:</view>
|
|
|
|
|
<u-search :placeholder="$t('message.PleaseScan')" style="z-index: 10000" v-model="Barcode" @search="searchBarcode" :show-action="false"></u-search>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 添加 -->
|
|
|
|
|
<view class="add">
|
|
|
|
|
<u-button type="primary" @click="Add">{{ $t('message.product_add') }}</u-button>
|
|
|
|
@ -120,7 +127,6 @@
|
|
|
|
|
import { Component, Ref } from 'vue-property-decorator';
|
|
|
|
|
import { BasePage } from '@/components/base/page';
|
|
|
|
|
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';
|
|
|
|
@ -140,60 +146,68 @@ export default class RawReceiptDetail extends BasePage {
|
|
|
|
|
receiverName: '',
|
|
|
|
|
password: '',
|
|
|
|
|
};
|
|
|
|
|
/**
|
|
|
|
|
* 页面Module
|
|
|
|
|
*/
|
|
|
|
|
Barcode: any = '';
|
|
|
|
|
model = model;
|
|
|
|
|
materialList: any = [];
|
|
|
|
|
type = 'text';
|
|
|
|
|
wlCode: any = '';
|
|
|
|
|
wl: any = {};
|
|
|
|
|
border = true;
|
|
|
|
|
//添加库位和数量的列表
|
|
|
|
|
LocationList: any = [];
|
|
|
|
|
//库位
|
|
|
|
|
Location: any = [];
|
|
|
|
|
some: any = {};
|
|
|
|
|
someIndex: any = 0;
|
|
|
|
|
qty: any = '';
|
|
|
|
|
/**
|
|
|
|
|
* 表单数据
|
|
|
|
|
*/
|
|
|
|
|
form: any = {
|
|
|
|
|
// locationCode: null,
|
|
|
|
|
amount: null,
|
|
|
|
|
};
|
|
|
|
|
Container: any = {};
|
|
|
|
|
rules: VFormRules<any> = {
|
|
|
|
|
amount: [{ required: true, message: this.$t('message.Pi_tip1') as string }],
|
|
|
|
|
};
|
|
|
|
|
locationCodeSelect = false;
|
|
|
|
|
headers = headers;
|
|
|
|
|
//页面初始化
|
|
|
|
|
async onReady() {
|
|
|
|
|
await this.GetLocation();
|
|
|
|
|
this.wlCode = this.Location[0];
|
|
|
|
|
}
|
|
|
|
|
//获取库位
|
|
|
|
|
async GetLocation() {
|
|
|
|
|
let content = {
|
|
|
|
|
loginName: session.loginName,
|
|
|
|
|
factoryCode: session.factoryCode,
|
|
|
|
|
workArea: session.workareaCode,
|
|
|
|
|
};
|
|
|
|
|
let res: any = await this.model.queryByFactory(content);
|
|
|
|
|
res.forEach((item: any) => {
|
|
|
|
|
let pickerName: any = {};
|
|
|
|
|
pickerName.label = item.locationCode;
|
|
|
|
|
pickerName.value = item.locationCode + '(' + item.sendSpot + ')';
|
|
|
|
|
pickerName.sendSpot = item.sendSpot;
|
|
|
|
|
this.Location.push(pickerName);
|
|
|
|
|
});
|
|
|
|
|
this.wlCode = this.Location[0];
|
|
|
|
|
}
|
|
|
|
|
//返回
|
|
|
|
|
onUpload() {
|
|
|
|
|
uni.navigateBack({ delta: 1 });
|
|
|
|
|
}
|
|
|
|
|
async searchBarcode() {
|
|
|
|
|
if (this.Barcode == '') {
|
|
|
|
|
this.customToast(this.$t('message.barcode') as string);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (this.materialList.length == 0) {
|
|
|
|
|
this.customToast(this.$t('message.AppendMateriel5') as string);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
let params = {
|
|
|
|
|
productCode: this.some.materialCode,
|
|
|
|
|
barcode: this.Barcode,
|
|
|
|
|
};
|
|
|
|
|
await this.model.searchBarcode(params);
|
|
|
|
|
this.Container = this.model.ContainerCode;
|
|
|
|
|
let arr = {
|
|
|
|
|
label: this.Container.locCode,
|
|
|
|
|
value: this.Container.locCode + '(' + this.Container.sendSpot + ')',
|
|
|
|
|
sendSpot: this.Container.sendSpot,
|
|
|
|
|
};
|
|
|
|
|
this.Location.push(arr);
|
|
|
|
|
this.wlCode = this.Location[0];
|
|
|
|
|
let num = 0;
|
|
|
|
|
if (this.LocationList.length != 0) {
|
|
|
|
|
this.LocationList.forEach((item: any) => {
|
|
|
|
|
if (item.barcode == this.Container.barcode) {
|
|
|
|
|
num += parseFloat(item.qty);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if (this.Container.cpRef4 == null) {
|
|
|
|
|
this.qty = parseFloat(this.Container.qty) - num;
|
|
|
|
|
} else {
|
|
|
|
|
this.qty = parseFloat(this.Container.qty) - parseFloat(this.Container.cpRef4) - num;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//单号查询
|
|
|
|
|
async query() {
|
|
|
|
|
if (!this.form.documentNo) {
|
|
|
|
@ -213,23 +227,18 @@ export default class RawReceiptDetail extends BasePage {
|
|
|
|
|
});
|
|
|
|
|
this.wl = this.materialList[0];
|
|
|
|
|
this.some = this.model.dnReturnList[0];
|
|
|
|
|
this.qty = this.model.dnReturnList[0].poAmount;
|
|
|
|
|
console.log('this.some', this.some);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
//选择物料
|
|
|
|
|
materialChoice(e: any) {
|
|
|
|
|
console.log('e', e);
|
|
|
|
|
this.model.dnReturnList.forEach((item: any, index: any) => {
|
|
|
|
|
if (item.poLine == e.pickerName.Line && item.materialCode == e.pickerName.label && item.poNo == e.pickerName.poNo) {
|
|
|
|
|
this.some = item;
|
|
|
|
|
this.someIndex = index;
|
|
|
|
|
console.log(item);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
this.qty = this.some.poAmount;
|
|
|
|
|
console.log('this.some', this.some);
|
|
|
|
|
console.log('this.someIndex', this.someIndex);
|
|
|
|
|
}
|
|
|
|
|
//选择库位触发事件
|
|
|
|
|
LocationChoice(e: any) {
|
|
|
|
@ -241,6 +250,10 @@ export default class RawReceiptDetail extends BasePage {
|
|
|
|
|
this.customToast(this.$t('message.Commission_tips2') as any);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (this.Barcode == '' || !this.Container.barcode) {
|
|
|
|
|
this.customToast(this.$t('message.scanningContainer') as any);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (parseFloat(this.qty) <= 0) {
|
|
|
|
|
this.customToast(this.$t('message.Commission_tips3') as any);
|
|
|
|
|
return;
|
|
|
|
@ -258,6 +271,25 @@ export default class RawReceiptDetail extends BasePage {
|
|
|
|
|
this.customToast(this.$t('message.dn_Tip2') as any);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
let codenum = 0;
|
|
|
|
|
if (this.LocationList.length != 0) {
|
|
|
|
|
this.LocationList.forEach((item: any) => {
|
|
|
|
|
if (item.barcode == this.Container.barcode) {
|
|
|
|
|
codenum += parseFloat(item.nowAmount);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if (this.Container.cpRef4 == null) {
|
|
|
|
|
if (this.qty > this.Container.qty - codenum) {
|
|
|
|
|
this.customToast(this.$t('message.AppendMateriel3') as any);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (this.qty > this.Container.qty - codenum - parseFloat(this.Container.cpRef4)) {
|
|
|
|
|
this.customToast(this.$t('message.AppendMateriel3') as any);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
let arr = {
|
|
|
|
|
poNo: this.some.poNo,
|
|
|
|
|
poLine: this.some.poLine,
|
|
|
|
@ -266,9 +298,9 @@ export default class RawReceiptDetail extends BasePage {
|
|
|
|
|
factoryCode: this.session.factoryCode,
|
|
|
|
|
wlCode: this.wlCode.label,
|
|
|
|
|
nowAmount: this.qty,
|
|
|
|
|
barcode: this.Container.barcode,
|
|
|
|
|
};
|
|
|
|
|
this.model.dnReturnList[this.someIndex].receiptAmount += parseFloat(this.qty);
|
|
|
|
|
console.log('this.model.dnReturnList', this.model.dnReturnList);
|
|
|
|
|
this.LocationList.push(arr);
|
|
|
|
|
this.qty = '';
|
|
|
|
|
}
|
|
|
|
@ -296,19 +328,11 @@ export default class RawReceiptDetail extends BasePage {
|
|
|
|
|
}
|
|
|
|
|
//查询明细
|
|
|
|
|
appoint() {
|
|
|
|
|
this.toPage(this.page.raw.ingoods.dnReturnGoods.Local);
|
|
|
|
|
this.toPage(this.page.raw.ingoods.RUSdnReturnGoods.Local);
|
|
|
|
|
}
|
|
|
|
|
//提交
|
|
|
|
|
async onSubmit() {
|
|
|
|
|
let isTrue = true;
|
|
|
|
|
// this.model.dnReturnList.forEach((item: any) => {
|
|
|
|
|
// if (item.receiptAmount != null || item.receiptAmount != 0) {
|
|
|
|
|
// if (item.receiptAmount != item.poAmount) {
|
|
|
|
|
// this.customToast(this.$t('message.materials') as any);
|
|
|
|
|
// return (isTrue = false);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
if (isTrue) {
|
|
|
|
|
await this.model.submit(this.LocationList).then(() => {
|
|
|
|
|
if (this.model.code == '1') {
|
|
|
|
@ -320,8 +344,9 @@ export default class RawReceiptDetail extends BasePage {
|
|
|
|
|
this.Location = [];
|
|
|
|
|
this.wl = {};
|
|
|
|
|
this.wlCode = '';
|
|
|
|
|
this.Barcode = '';
|
|
|
|
|
this.Container = {};
|
|
|
|
|
this.query();
|
|
|
|
|
this.GetLocation();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
@ -416,7 +441,7 @@ export default class RawReceiptDetail extends BasePage {
|
|
|
|
|
height: 100%;
|
|
|
|
|
display: flex;
|
|
|
|
|
.material-right-title {
|
|
|
|
|
width: 160rpx;
|
|
|
|
|
width: 88px;
|
|
|
|
|
height: 100%;
|
|
|
|
|
line-height: 100rpx;
|
|
|
|
|
}
|
|
|
|
@ -506,11 +531,13 @@ export default class RawReceiptDetail extends BasePage {
|
|
|
|
|
.add {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100rpx;
|
|
|
|
|
position: relative;
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 514px;
|
|
|
|
|
left: 0;
|
|
|
|
|
button {
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 10rpx;
|
|
|
|
|
right: 20rpx;
|
|
|
|
|
top: 3rpx;
|
|
|
|
|
right: 35rpx;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|