|
|
|
@ -2,7 +2,7 @@
|
|
|
|
|
<view class="page-picking-order">
|
|
|
|
|
<view class="header">
|
|
|
|
|
<view class="left">
|
|
|
|
|
<u-icon class="icon" name="arrow-left" @click="uni.navigateBack({delta:1})" />
|
|
|
|
|
<u-icon class="icon" name="arrow-left" @click="uni.navigateBack({ delta: 1 })" />
|
|
|
|
|
</view>
|
|
|
|
|
<view class="title">{{ $t('message.rawMenu_ReturnGoods') }}</view>
|
|
|
|
|
<view class="right"></view>
|
|
|
|
@ -58,19 +58,19 @@
|
|
|
|
|
<!-- 库存地点 -->
|
|
|
|
|
<view class="number-left">
|
|
|
|
|
<view class="number-left-title">{{ $t('message.po_Location') }}:</view>
|
|
|
|
|
<u-input v-model="some.wlCode" placeholder=" " :type="type" :border="border" class="input" disabled style="padding:'0';"/>
|
|
|
|
|
<u-input v-model="some.wlCode" placeholder=" " :type="type" :border="border" class="input" disabled style="padding: '0'" />
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 累计 -->
|
|
|
|
|
<view class="number-right">
|
|
|
|
|
<view class="number-right-title">{{ $t('message.total') }}:</view>
|
|
|
|
|
<u-input placeholder=" " v-model="some.receiptAmount" :type="type" :border="border" class="input" style="padding:'0';" disabled />
|
|
|
|
|
<u-input placeholder=" " v-model="some.receiptAmount" :type="type" :border="border" class="input" style="padding: '0'" disabled />
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 库位 -->
|
|
|
|
|
<view class="library">
|
|
|
|
|
<!-- 库位 -->
|
|
|
|
|
<view class="library-left">
|
|
|
|
|
<view style="text-align:left">{{ $t('message.CommissionedLocation') }}:</view>
|
|
|
|
|
<view style="text-align: left">{{ $t('message.CommissionedLocation') }}:</view>
|
|
|
|
|
<jPicker sureColor="#ff0000" style="width: 230rpx" @bindpicker="LocationChoice" showKey="value" valKey="value" :val="wlCode.value" class="search" :options="Location" />
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 本次 -->
|
|
|
|
@ -144,17 +144,17 @@ export default class RawReceiptDetail extends BasePage {
|
|
|
|
|
* 页面Module
|
|
|
|
|
*/
|
|
|
|
|
model = model;
|
|
|
|
|
materialList:any = []
|
|
|
|
|
materialList: any = [];
|
|
|
|
|
type = 'text';
|
|
|
|
|
wlCode: any = '';
|
|
|
|
|
wl:any = {}
|
|
|
|
|
wl: any = {};
|
|
|
|
|
border = true;
|
|
|
|
|
//添加库位和数量的列表
|
|
|
|
|
LocationList: any = [];
|
|
|
|
|
//库位
|
|
|
|
|
Location: any = [];
|
|
|
|
|
some: any = {};
|
|
|
|
|
someIndex:any = 0
|
|
|
|
|
someIndex: any = 0;
|
|
|
|
|
qty: any = '';
|
|
|
|
|
/**
|
|
|
|
|
* 表单数据
|
|
|
|
@ -164,17 +164,16 @@ export default class RawReceiptDetail extends BasePage {
|
|
|
|
|
amount: null,
|
|
|
|
|
};
|
|
|
|
|
rules: VFormRules<any> = {
|
|
|
|
|
amount: [
|
|
|
|
|
{ required: true, message: this.$t('message.Pi_tip1') as string },
|
|
|
|
|
],
|
|
|
|
|
amount: [{ required: true, message: this.$t('message.Pi_tip1') as string }],
|
|
|
|
|
};
|
|
|
|
|
locationCodeSelect = false;
|
|
|
|
|
headers = headers;
|
|
|
|
|
//页面初始化
|
|
|
|
|
async onReady() {
|
|
|
|
|
await this.GetLocation()
|
|
|
|
|
await this.GetLocation();
|
|
|
|
|
this.wlCode = this.Location[0];
|
|
|
|
|
}
|
|
|
|
|
async GetLocation(){
|
|
|
|
|
async GetLocation() {
|
|
|
|
|
let content = {
|
|
|
|
|
loginName: session.loginName,
|
|
|
|
|
factoryCode: session.factoryCode,
|
|
|
|
@ -190,41 +189,41 @@ export default class RawReceiptDetail extends BasePage {
|
|
|
|
|
});
|
|
|
|
|
this.wlCode = this.Location[0]
|
|
|
|
|
}
|
|
|
|
|
onUpload(){
|
|
|
|
|
uni.navigateBack({delta:1})
|
|
|
|
|
onUpload() {
|
|
|
|
|
uni.navigateBack({ delta: 1 });
|
|
|
|
|
}
|
|
|
|
|
async query(){
|
|
|
|
|
if(!this.form.documentNo){
|
|
|
|
|
async query() {
|
|
|
|
|
if (!this.form.documentNo) {
|
|
|
|
|
this.customToast(this.$t('message.Commission_tips1') as any);
|
|
|
|
|
return
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
await this.model.queryOrder(this.form.documentNo).then(() =>{
|
|
|
|
|
if(this.model.code == '1'){
|
|
|
|
|
this.model.dnReturnList.forEach((item:any) =>{
|
|
|
|
|
await this.model.queryOrder(this.form.documentNo).then(() => {
|
|
|
|
|
if (this.model.code == '1') {
|
|
|
|
|
this.model.dnReturnList.forEach((item: any) => {
|
|
|
|
|
let arr = {
|
|
|
|
|
label:item.materialCode,
|
|
|
|
|
value:item.materialCode + '(' + item.poLine + ')',
|
|
|
|
|
Line:item.poLine,
|
|
|
|
|
poNo:item.poNo,
|
|
|
|
|
label: item.materialCode,
|
|
|
|
|
value: item.materialCode + '(' + item.poLine + ')',
|
|
|
|
|
Line: item.poLine,
|
|
|
|
|
poNo: item.poNo,
|
|
|
|
|
};
|
|
|
|
|
this.materialList.push(arr);
|
|
|
|
|
});
|
|
|
|
|
this.wl = this.materialList[0];
|
|
|
|
|
this.some = this.model.dnReturnList[0];
|
|
|
|
|
console.log('this.some', this.some);
|
|
|
|
|
}
|
|
|
|
|
this.materialList.push(arr)
|
|
|
|
|
})
|
|
|
|
|
this.wl = this.materialList[0]
|
|
|
|
|
this.some = this.model.dnReturnList[0]
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
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('this.some',this.some)
|
|
|
|
|
console.log('this.someIndex',this.someIndex)
|
|
|
|
|
});
|
|
|
|
|
console.log('this.some', this.some);
|
|
|
|
|
console.log('this.someIndex', this.someIndex);
|
|
|
|
|
}
|
|
|
|
|
//选择库位触发事件
|
|
|
|
|
LocationChoice(e: any) {
|
|
|
|
@ -248,75 +247,75 @@ export default class RawReceiptDetail extends BasePage {
|
|
|
|
|
this.customToast(this.$t('message.Commission_tips6') as any);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
let num: number = parseFloat(this.qty) + parseFloat(this.some.receiptAmount)
|
|
|
|
|
let num: number = parseFloat(this.qty) + parseFloat(this.some.receiptAmount);
|
|
|
|
|
if (num > parseFloat(this.some.poAmount)) {
|
|
|
|
|
this.customToast(this.$t('message.dn_Tip2') as any);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
let arr = {
|
|
|
|
|
poNo:this.some.poNo,
|
|
|
|
|
poLine:this.some.poLine,
|
|
|
|
|
materialCode:this.some.materialCode,
|
|
|
|
|
loginName:this.session.loginName,
|
|
|
|
|
factoryCode:this.session.factoryCode,
|
|
|
|
|
wlCode:this.wlCode.label,
|
|
|
|
|
nowAmount:this.qty,
|
|
|
|
|
poNo: this.some.poNo,
|
|
|
|
|
poLine: this.some.poLine,
|
|
|
|
|
materialCode: this.some.materialCode,
|
|
|
|
|
loginName: this.session.loginName,
|
|
|
|
|
factoryCode: this.session.factoryCode,
|
|
|
|
|
wlCode: this.wlCode.label,
|
|
|
|
|
nowAmount: this.qty,
|
|
|
|
|
};
|
|
|
|
|
this.model.dnReturnList[this.someIndex].receiptAmount += parseFloat(this.qty)
|
|
|
|
|
console.log('this.model.dnReturnList',this.model.dnReturnList)
|
|
|
|
|
this.model.dnReturnList[this.someIndex].receiptAmount += parseFloat(this.qty);
|
|
|
|
|
console.log('this.model.dnReturnList', this.model.dnReturnList);
|
|
|
|
|
this.LocationList.push(arr);
|
|
|
|
|
this.qty = '';
|
|
|
|
|
}
|
|
|
|
|
//删除某一项 触发事件
|
|
|
|
|
deleteItem(e: any) {
|
|
|
|
|
console.log('e',e.contentIndex)
|
|
|
|
|
console.log('eeeee',e)
|
|
|
|
|
console.log('e', e.contentIndex);
|
|
|
|
|
console.log('eeeee', e);
|
|
|
|
|
uni.showModal({
|
|
|
|
|
content:this.$t('message.product_Delete') as any,
|
|
|
|
|
cancelText:this.$t('message.Cancel') as any,
|
|
|
|
|
confirmText:this.$t('message.workArea_Confirm') as any,
|
|
|
|
|
success:(res) =>{
|
|
|
|
|
if(res.confirm){
|
|
|
|
|
this.LocationList.splice(e.contentIndex,1)
|
|
|
|
|
this.model.dnReturnList.forEach((item:any) =>{
|
|
|
|
|
if(item.materialCode == e.lineData.materialCode && item.poLine == e.lineData.poLine && item.poNo == e.lineData.poNo){
|
|
|
|
|
item.receiptAmount -= parseFloat(e.lineData.nowAmount)
|
|
|
|
|
content: this.$t('message.product_Delete') as any,
|
|
|
|
|
cancelText: this.$t('message.Cancel') as any,
|
|
|
|
|
confirmText: this.$t('message.workArea_Confirm') as any,
|
|
|
|
|
success: (res) => {
|
|
|
|
|
if (res.confirm) {
|
|
|
|
|
this.LocationList.splice(e.contentIndex, 1);
|
|
|
|
|
this.model.dnReturnList.forEach((item: any) => {
|
|
|
|
|
if (item.materialCode == e.lineData.materialCode && item.poLine == e.lineData.poLine && item.poNo == e.lineData.poNo) {
|
|
|
|
|
item.receiptAmount -= parseFloat(e.lineData.nowAmount);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
} else if(res.cancel){
|
|
|
|
|
return
|
|
|
|
|
});
|
|
|
|
|
} else if (res.cancel) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
appoint() {
|
|
|
|
|
this.toPage(this.page.raw.ingoods.dnReturnGoods.Local);
|
|
|
|
|
}
|
|
|
|
|
async onSubmit() {
|
|
|
|
|
let isTrue = true
|
|
|
|
|
this.model.dnReturnList.forEach((item:any) =>{
|
|
|
|
|
if(item.receiptAmount != null || item.receiptAmount != 0){
|
|
|
|
|
if(item.receiptAmount != item.poAmount){
|
|
|
|
|
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
|
|
|
|
|
return (isTrue = false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
if(isTrue){
|
|
|
|
|
await this.model.submit(this.LocationList).then(() =>{
|
|
|
|
|
if(this.model.code == '1'){
|
|
|
|
|
this.materialList = []
|
|
|
|
|
this.some = {}
|
|
|
|
|
this.someIndex = 0
|
|
|
|
|
this.LocationList = []
|
|
|
|
|
this.qty = ''
|
|
|
|
|
this.Location = []
|
|
|
|
|
this.wl = {}
|
|
|
|
|
this.wlCode = ''
|
|
|
|
|
this.query()
|
|
|
|
|
this.GetLocation()
|
|
|
|
|
});
|
|
|
|
|
if (isTrue) {
|
|
|
|
|
await this.model.submit(this.LocationList).then(() => {
|
|
|
|
|
if (this.model.code == '1') {
|
|
|
|
|
this.materialList = [];
|
|
|
|
|
this.some = {};
|
|
|
|
|
this.someIndex = 0;
|
|
|
|
|
this.LocationList = [];
|
|
|
|
|
this.qty = '';
|
|
|
|
|
this.Location = [];
|
|
|
|
|
this.wl = {};
|
|
|
|
|
this.wlCode = '';
|
|
|
|
|
this.query();
|
|
|
|
|
this.GetLocation();
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -395,7 +394,7 @@ export default class RawReceiptDetail extends BasePage {
|
|
|
|
|
width: 145rpx;
|
|
|
|
|
line-height: 100rpx;
|
|
|
|
|
}
|
|
|
|
|
.search{
|
|
|
|
|
.search {
|
|
|
|
|
padding-left: 19px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|