|
|
|
@ -36,11 +36,11 @@
|
|
|
|
|
<view class="number">
|
|
|
|
|
<view class="number-left">
|
|
|
|
|
<view class="number-left-title">{{ $t('message.CommissionedDemandData') }}</view>
|
|
|
|
|
<u-input v-model="every.orderAmount" placeholder=" " :type="type" :border="border" class="input" disabled />
|
|
|
|
|
<u-input v-model="every.orderAmount" placeholder=" " :type="type" :border="border" class="input" disabled style="padding:'0';"/>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="number-right">
|
|
|
|
|
<view class="number-right-title">{{ $t('message.CommissionedCumulativeData') }}</view>
|
|
|
|
|
<u-input :placeholder="$t('message.po_PleaseInput')" v-model="every.outAmount" :type="type" :border="border" class="input" disabled />
|
|
|
|
|
<view class="number-right-title">{{ $t('message.Cumulative') }}</view>
|
|
|
|
|
<u-input placeholder=" " v-model="every.outAmount" :type="type" :border="border" class="input" style="padding:'0';" disabled />
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 库位 -->
|
|
|
|
@ -59,20 +59,7 @@
|
|
|
|
|
<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 list" :key="index">
|
|
|
|
|
<u-td class="u-td">{{ item.wlCode }}</u-td>
|
|
|
|
|
<u-td class="u-td">{{ item.nowAmount }}</u-td>
|
|
|
|
|
<u-td class="u-td">
|
|
|
|
|
<u-button type="error" size="small" class="u-td" style="font-size: 20px" @click="deleteItem(index)">{{ $t('message.product_Delete') }}</u-button>
|
|
|
|
|
</u-td>
|
|
|
|
|
</u-tr>
|
|
|
|
|
</u-table>
|
|
|
|
|
<wyb-table class="table" ref="table" width="100%" show-left-and-right-border :headers="detailHeader" :contents="list" :show-vert-border="false" @onCellClick="deleteItem($event)"></wyb-table>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 底部按钮 -->
|
|
|
|
|
<view class="bottom-bar">
|
|
|
|
@ -95,7 +82,7 @@ import { Component, Ref } 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 { detailHeader } from './config';
|
|
|
|
|
import model from './model';
|
|
|
|
|
@Component({
|
|
|
|
|
components: {
|
|
|
|
@ -104,6 +91,7 @@ import model from './model';
|
|
|
|
|
})
|
|
|
|
|
export default class dnReceiptDom extends BasePage {
|
|
|
|
|
model = model;
|
|
|
|
|
detailHeader = detailHeader
|
|
|
|
|
form: any = {
|
|
|
|
|
documentNo: '',
|
|
|
|
|
};
|
|
|
|
@ -119,6 +107,7 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
|
Location: any = [];
|
|
|
|
|
//所选择的库位
|
|
|
|
|
wlCode: any = '';
|
|
|
|
|
materialIndex:any = null
|
|
|
|
|
//页面初始化
|
|
|
|
|
async onReady() {
|
|
|
|
|
//页面初始化 获取可选库位
|
|
|
|
@ -171,13 +160,15 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
|
this.materialList.push(pickerName);
|
|
|
|
|
});
|
|
|
|
|
this.every = this.material[0];
|
|
|
|
|
console.log('materialList????', this.materialList);
|
|
|
|
|
this.materialIndex = 0
|
|
|
|
|
}
|
|
|
|
|
//选择物料后触发的回调事件 本次数量:receiptAmount 需求数量:requestAmount
|
|
|
|
|
materialChoice(e: any) {
|
|
|
|
|
this.material.forEach((item: any) => {
|
|
|
|
|
this.nowAmount = ''
|
|
|
|
|
this.material.forEach((item: any,index:any) => {
|
|
|
|
|
if (item.materialCode == e.pickerName.value) {
|
|
|
|
|
this.every = item;
|
|
|
|
|
this.materialIndex = index
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
@ -200,9 +191,11 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
|
this.customToast(this.$t('message.Commission_tips3') as any);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
let num: number = parseFloat(this.nowAmount);
|
|
|
|
|
let num: number = parseFloat(this.nowAmount) + parseFloat(this.every.outAmount);
|
|
|
|
|
this.list.forEach((item: any) => {
|
|
|
|
|
num += parseFloat(item.nowAmount);
|
|
|
|
|
if(item.materialCode == this.every.materialCode){
|
|
|
|
|
num += parseFloat(item.nowAmount);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
if (num > parseFloat(this.every.orderAmount)) {
|
|
|
|
|
uni.showModal({
|
|
|
|
@ -221,8 +214,8 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
|
nowAmount: this.nowAmount,
|
|
|
|
|
};
|
|
|
|
|
this.list.push(arr);
|
|
|
|
|
console.log('this.list', this.list);
|
|
|
|
|
this.business();
|
|
|
|
|
this.material[this.materialIndex].outAmount += parseFloat(this.list[this.list.length - 1].nowAmount)
|
|
|
|
|
this.nowAmount = ''
|
|
|
|
|
} else if (res.cancel) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -230,34 +223,43 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
let arr = {
|
|
|
|
|
poNo: this.form.documentNo,
|
|
|
|
|
materialCode: this.every.materialCode,
|
|
|
|
|
loginName: this.session.loginName,
|
|
|
|
|
factoryCode: this.session.factoryCode,
|
|
|
|
|
wlCode: this.wlCode.label,
|
|
|
|
|
nowAmount: this.nowAmount,
|
|
|
|
|
poNo: this.form.documentNo,
|
|
|
|
|
materialCode: this.every.materialCode,
|
|
|
|
|
loginName: this.session.loginName,
|
|
|
|
|
factoryCode: this.session.factoryCode,
|
|
|
|
|
wlCode: this.wlCode.label,
|
|
|
|
|
nowAmount: this.nowAmount,
|
|
|
|
|
};
|
|
|
|
|
this.list.push(arr);
|
|
|
|
|
console.log('this.list', this.list);
|
|
|
|
|
this.business();
|
|
|
|
|
this.material[this.materialIndex].outAmount += parseFloat(this.list[this.list.length - 1].nowAmount)
|
|
|
|
|
this.nowAmount = ''
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
deleteItem(index: any) {
|
|
|
|
|
this.list.splice(index, 1);
|
|
|
|
|
console.log('this.list', this.list);
|
|
|
|
|
this.business();
|
|
|
|
|
deleteItem(e: any) {
|
|
|
|
|
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.list.splice(e.contentIndex,1)
|
|
|
|
|
let i:any
|
|
|
|
|
this.material.forEach((item:any,index:any) =>{
|
|
|
|
|
if(item.materialCode == e.lineData.materialCode){
|
|
|
|
|
i = index
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.material[i].outAmount -= parseFloat(e.lineData.nowAmount)
|
|
|
|
|
}else if(res.cancel){
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
async onSubmit() {
|
|
|
|
|
if (this.list == null || this.list.length == 0) {
|
|
|
|
|
this.customToast(this.$t('message.Commission_tips5') as any);
|
|
|
|
|
}
|
|
|
|
|
// let upload = {
|
|
|
|
|
// poNo: this.form.documentNo,
|
|
|
|
|
// materialCode: this.every.materialCode,
|
|
|
|
|
// loginName: session.loginName,
|
|
|
|
|
// factoryCode: session.factoryCode,
|
|
|
|
|
// list: this.list,
|
|
|
|
|
// };
|
|
|
|
|
await this.model.submitOutsourcing(this.list);
|
|
|
|
|
this.empty();
|
|
|
|
|
}
|
|
|
|
@ -275,14 +277,6 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
|
await this.model.querydetaildlist(content);
|
|
|
|
|
this.redirectTo(this.page.raw.commission.goOut.detail);
|
|
|
|
|
}
|
|
|
|
|
//添加和删除操作的时候 计算累计收货数量
|
|
|
|
|
business() {
|
|
|
|
|
let num = 0;
|
|
|
|
|
this.list.forEach((item: any) => {
|
|
|
|
|
num += parseFloat(item.nowAmount);
|
|
|
|
|
});
|
|
|
|
|
this.every.outAmount += num;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
@ -358,6 +352,9 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
|
width: 100rpx;
|
|
|
|
|
line-height: 100rpx;
|
|
|
|
|
}
|
|
|
|
|
.search{
|
|
|
|
|
padding-left: 19px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.material {
|
|
|
|
@ -410,6 +407,7 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
|
width: 120rpx;
|
|
|
|
|
height: 100%;
|
|
|
|
|
line-height: 100rpx;
|
|
|
|
|
text-align: center;
|
|
|
|
|
}
|
|
|
|
|
.input {
|
|
|
|
|
width: 200rpx;
|
|
|
|
@ -432,7 +430,8 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
|
line-height: 100rpx;
|
|
|
|
|
}
|
|
|
|
|
.search {
|
|
|
|
|
text-align: center;
|
|
|
|
|
padding-left: 19px;
|
|
|
|
|
text-align: left;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.library-right {
|
|
|
|
@ -443,6 +442,7 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
|
width: 120rpx;
|
|
|
|
|
height: 100%;
|
|
|
|
|
line-height: 100rpx;
|
|
|
|
|
text-align: center;
|
|
|
|
|
}
|
|
|
|
|
.input {
|
|
|
|
|
width: 200rpx;
|
|
|
|
|