|
|
@ -59,31 +59,21 @@
|
|
|
|
<u-button type="primary" @click="Add">{{ $t('message.product_add') }}</u-button>
|
|
|
|
<u-button type="primary" @click="Add">{{ $t('message.product_add') }}</u-button>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<!-- 表格 -->
|
|
|
|
<!-- 表格 -->
|
|
|
|
<u-table class="library-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>
|
|
|
|
<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>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<!-- 底部按钮 -->
|
|
|
|
<!-- 底部按钮 -->
|
|
|
|
<view class="bottom-bar">
|
|
|
|
<view class="bottom-bar">
|
|
|
|
<u-row class="button-bar">
|
|
|
|
<u-row class="button-bar">
|
|
|
|
<u-col :span="4">
|
|
|
|
<u-col :span="3">
|
|
|
|
<u-button type="primary" @click="bill">{{ $t('message.CommissionedDetails') }}</u-button>
|
|
|
|
<u-button type="primary" @click="bill">{{ $t('message.CommissionedDetails') }}</u-button>
|
|
|
|
</u-col>
|
|
|
|
</u-col>
|
|
|
|
<u-col :span="4">
|
|
|
|
<u-col :span="3">
|
|
|
|
|
|
|
|
<u-button type="primary" @click="close">{{ $t('message.closure') }}</u-button>
|
|
|
|
|
|
|
|
</u-col>
|
|
|
|
|
|
|
|
<u-col :span="3">
|
|
|
|
<u-button type="primary" @click="onSubmit">{{ $t('message.product_Upload') }}</u-button>
|
|
|
|
<u-button type="primary" @click="onSubmit">{{ $t('message.product_Upload') }}</u-button>
|
|
|
|
</u-col>
|
|
|
|
</u-col>
|
|
|
|
<u-col :span="4">
|
|
|
|
<u-col :span="3">
|
|
|
|
<u-button type="error" @click="uni.navigateBack({})">{{ $t('message.po_Return') }}</u-button>
|
|
|
|
<u-button type="error" @click="uni.navigateBack({})">{{ $t('message.po_Return') }}</u-button>
|
|
|
|
</u-col>
|
|
|
|
</u-col>
|
|
|
|
</u-row>
|
|
|
|
</u-row>
|
|
|
@ -96,6 +86,7 @@ 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 model from './model';
|
|
|
|
import model from './model';
|
|
|
|
|
|
|
|
import { detailHeader } from './config';
|
|
|
|
@Component({
|
|
|
|
@Component({
|
|
|
|
components: {
|
|
|
|
components: {
|
|
|
|
jPicker,
|
|
|
|
jPicker,
|
|
|
@ -103,11 +94,13 @@ import model from './model';
|
|
|
|
})
|
|
|
|
})
|
|
|
|
export default class dnReceiptDom extends BasePage {
|
|
|
|
export default class dnReceiptDom extends BasePage {
|
|
|
|
model = model;
|
|
|
|
model = model;
|
|
|
|
|
|
|
|
detailHeader = detailHeader;
|
|
|
|
form: any = {
|
|
|
|
form: any = {
|
|
|
|
documentNo: '',
|
|
|
|
documentNo: '',
|
|
|
|
};
|
|
|
|
};
|
|
|
|
material: any = {};
|
|
|
|
material: any = {};
|
|
|
|
materialList: any = [];
|
|
|
|
materialList: any = [];
|
|
|
|
|
|
|
|
materialIndex: any = null;
|
|
|
|
list: any = [];
|
|
|
|
list: any = [];
|
|
|
|
every: any = '';
|
|
|
|
every: any = '';
|
|
|
|
value = '';
|
|
|
|
value = '';
|
|
|
@ -147,9 +140,9 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
this.customToast(this.$t('message.Commission_tips1') as any);
|
|
|
|
this.customToast(this.$t('message.Commission_tips1') as any);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.materialList = [];
|
|
|
|
|
|
|
|
let res = await this.model.queryOutsourcing(this.form.documentNo);
|
|
|
|
let res = await this.model.queryOutsourcing(this.form.documentNo);
|
|
|
|
this.material = res.data;
|
|
|
|
this.material = res.data;
|
|
|
|
|
|
|
|
this.materialList = [];
|
|
|
|
this.material.forEach((item: any) => {
|
|
|
|
this.material.forEach((item: any) => {
|
|
|
|
let pickerName: any = {};
|
|
|
|
let pickerName: any = {};
|
|
|
|
pickerName.label = item.materialCode;
|
|
|
|
pickerName.label = item.materialCode;
|
|
|
@ -157,12 +150,31 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
this.materialList.push(pickerName);
|
|
|
|
this.materialList.push(pickerName);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
this.every = this.material[0];
|
|
|
|
this.every = this.material[0];
|
|
|
|
|
|
|
|
this.materialIndex = 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//关闭订单号
|
|
|
|
|
|
|
|
async close() {
|
|
|
|
|
|
|
|
if (this.form.documentNo == '') {
|
|
|
|
|
|
|
|
this.customToast(this.$t('message.Commission_tips1') as any);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
await this.model.documentNoClose(this.form.documentNo);
|
|
|
|
|
|
|
|
if (this.model.closeCode == '1') {
|
|
|
|
|
|
|
|
uni.showToast({
|
|
|
|
|
|
|
|
duration: 2000,
|
|
|
|
|
|
|
|
title: this.$t('message.Warehouse_Tip9') as string,
|
|
|
|
|
|
|
|
image: '/static/icons/icon-51.png',
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
this.empty();
|
|
|
|
|
|
|
|
this.form.documentNo = '';
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//选择物料后触发的回调事件 本次数量:receiptAmount 需求数量:requestAmount
|
|
|
|
//选择物料后触发的回调事件 本次数量:receiptAmount 需求数量:requestAmount
|
|
|
|
async materialChoice(e: any) {
|
|
|
|
async materialChoice(e: any) {
|
|
|
|
this.material.forEach((item: any) => {
|
|
|
|
this.material.forEach((item: any, index: any) => {
|
|
|
|
if (item.materialCode == e.pickerName.value) {
|
|
|
|
if (item.materialCode == e.pickerName.value) {
|
|
|
|
this.every = item;
|
|
|
|
this.every = item;
|
|
|
|
|
|
|
|
this.materialIndex = index;
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -201,34 +213,66 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
this.customToast(this.$t('message.Commission_tips4') as any);
|
|
|
|
this.customToast(this.$t('message.Commission_tips4') as any);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
let num: number = parseFloat(this.nowAmount) + parseFloat(this.every.receiptAmount);
|
|
|
|
|
|
|
|
if (num > parseFloat(this.every.poAmount)) {
|
|
|
|
|
|
|
|
this.customToast(this.$t('message.Commission_tips4') as any);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
let arr = {
|
|
|
|
let arr = {
|
|
|
|
|
|
|
|
poNo: this.form.documentNo,
|
|
|
|
|
|
|
|
materialCode: this.every.materialCode,
|
|
|
|
|
|
|
|
loginName: this.session.loginName,
|
|
|
|
|
|
|
|
factoryCode: this.session.factoryCode,
|
|
|
|
wlCode: this.wlCode.label,
|
|
|
|
wlCode: this.wlCode.label,
|
|
|
|
nowAmount: this.nowAmount,
|
|
|
|
nowAmount: this.nowAmount,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
this.list.push(arr);
|
|
|
|
this.list.push(arr);
|
|
|
|
this.business();
|
|
|
|
this.material[this.materialIndex].receiptAmount += parseFloat(this.list[this.list.length - 1].nowAmount);
|
|
|
|
|
|
|
|
this.nowAmount = '';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
deleteItem(index: any) {
|
|
|
|
deleteItem(e: any) {
|
|
|
|
this.list.splice(index, 1);
|
|
|
|
uni.showModal({
|
|
|
|
this.business();
|
|
|
|
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].receiptAmount -= parseFloat(e.lineData.nowAmount);
|
|
|
|
|
|
|
|
} else if (res.cancel) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
async onSubmit() {
|
|
|
|
empty() {
|
|
|
|
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(upload);
|
|
|
|
|
|
|
|
this.list = [];
|
|
|
|
this.list = [];
|
|
|
|
this.wlCode = '';
|
|
|
|
this.wlCode = '';
|
|
|
|
this.nowAmount = '';
|
|
|
|
this.nowAmount = '';
|
|
|
|
this.every = '';
|
|
|
|
this.every = '';
|
|
|
|
this.materialList = [];
|
|
|
|
this.materialList = [];
|
|
|
|
|
|
|
|
this.material = {};
|
|
|
|
|
|
|
|
this.Location = [];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
async onSubmit() {
|
|
|
|
|
|
|
|
if (this.form.documentNo == '') {
|
|
|
|
|
|
|
|
this.customToast(this.$t('message.Commission_tips1') as any);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this.list == null || this.list.length == 0) {
|
|
|
|
|
|
|
|
this.customToast(this.$t('message.Commission_tips5') as any);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
await this.model.submitOutsourcing(this.list);
|
|
|
|
|
|
|
|
this.empty();
|
|
|
|
|
|
|
|
await this.QueryLoc();
|
|
|
|
|
|
|
|
await this.query();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//跳转明细页面
|
|
|
|
//跳转明细页面
|
|
|
|
async bill() {
|
|
|
|
async bill() {
|
|
|
@ -244,14 +288,6 @@ export default class dnReceiptDom extends BasePage {
|
|
|
|
await this.model.querydetaildlist(content);
|
|
|
|
await this.model.querydetaildlist(content);
|
|
|
|
this.toPage(this.page.raw.commission.entrant.detail);
|
|
|
|
this.toPage(this.page.raw.commission.entrant.detail);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//添加和删除操作的时候 计算累计收货数量
|
|
|
|
|
|
|
|
business() {
|
|
|
|
|
|
|
|
let num = 0;
|
|
|
|
|
|
|
|
this.list.forEach((item: any) => {
|
|
|
|
|
|
|
|
num += parseFloat(item.nowAmount);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
this.every.receiptAmount += num;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
<style lang="scss" scoped>
|
|
|
|