dam-7 feat 委外入库增加关闭功能 && 更改提交逻辑等

master
hou 3 years ago
parent 8783bd4d08
commit bb4ded8f5a

@ -150,7 +150,7 @@ export default class LoginPage extends BasePage {
console.log('image', this.image);
console.log('Version////', this.Version);
}
Version = '1.0.11';
Version = '1.0.12';
compareVersion(version1: any, version2: any) {
//version1 1 &&& version2 -1
const newVersion1 = `${version1}`.split('.').length < 3 ? `${version1}`.concat('.0') : `${version1}`;

@ -38,3 +38,20 @@ export const headers = [
width: 200,
},
];
export const detailHeader = [
{
label: vm.$t('message.po_MaterielNo'),
key: 'materialCode',
width: 301,
},
{
label: vm.$t('message.CommissionedLocation'),
key: 'wlCode',
width: 186,
},
{
label: vm.$t('message.product_Number'),
key: 'nowAmount',
width: 186,
},
];

@ -59,31 +59,21 @@
<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">
<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-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-col>
<u-col :span="4">
<u-col :span="3">
<u-button type="error" @click="uni.navigateBack({})">{{ $t('message.po_Return') }}</u-button>
</u-col>
</u-row>
@ -96,6 +86,7 @@ import { BasePage } from '@/components/base/page';
import jPicker from '@/components/J-Picker/jPicker.vue';
import { session } from '@/store/modules/session';
import model from './model';
import { detailHeader } from './config';
@Component({
components: {
jPicker,
@ -103,11 +94,13 @@ import model from './model';
})
export default class dnReceiptDom extends BasePage {
model = model;
detailHeader = detailHeader;
form: any = {
documentNo: '',
};
material: any = {};
materialList: any = [];
materialIndex: any = null;
list: any = [];
every: any = '';
value = '';
@ -147,9 +140,9 @@ export default class dnReceiptDom extends BasePage {
this.customToast(this.$t('message.Commission_tips1') as any);
return;
}
this.materialList = [];
let res = await this.model.queryOutsourcing(this.form.documentNo);
this.material = res.data;
this.materialList = [];
this.material.forEach((item: any) => {
let pickerName: any = {};
pickerName.label = item.materialCode;
@ -157,12 +150,31 @@ export default class dnReceiptDom extends BasePage {
this.materialList.push(pickerName);
});
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
async materialChoice(e: any) {
this.material.forEach((item: any) => {
this.material.forEach((item: any, index: any) => {
if (item.materialCode == e.pickerName.value) {
this.every = item;
this.materialIndex = index;
return;
}
});
@ -201,34 +213,66 @@ export default class dnReceiptDom extends BasePage {
this.customToast(this.$t('message.Commission_tips4') as any);
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 = {
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);
this.business();
this.material[this.materialIndex].receiptAmount += parseFloat(this.list[this.list.length - 1].nowAmount);
this.nowAmount = '';
}
deleteItem(index: any) {
this.list.splice(index, 1);
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].receiptAmount -= 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(upload);
empty() {
this.list = [];
this.wlCode = '';
this.nowAmount = '';
this.every = '';
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() {
@ -244,14 +288,6 @@ export default class dnReceiptDom extends BasePage {
await this.model.querydetaildlist(content);
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>
<style lang="scss" scoped>

@ -32,6 +32,7 @@ export class ReturningModule extends VuexModule {
materielList: any[] = [];
locationCodeList: any[] = [];
LoctionList: any[] = [];
closeCode: any = '';
//条码扫描的返回的结果
oneMaterielDetail: any = {};
@ -190,7 +191,16 @@ export class ReturningModule extends VuexModule {
const LoctionList = res;
return { LoctionList };
}
@MutationAction
async documentNoClose(poNo: any) {
const res: any = await http.post('/wmspda/material/outsourcing/into/close', {
loginName: session.loginName,
factoryCode: session.factoryCode,
poNo,
});
const closeCode = res.code;
return { closeCode };
}
@Action
async queryOutsourcing(poNo: any) {
const res = await http.post(url.outbound.stoOutbound.queryOrder, {

@ -119,7 +119,6 @@ export default class dnReceiptDom extends BasePage {
async QueryLoc() {
let content = {
loginName: session.loginName,
//sendSpot: sendSpot,
factoryCode: session.factoryCode,
workArea: session.workareaCode,
};
@ -170,14 +169,13 @@ export default class dnReceiptDom extends BasePage {
//this.wlCode = '';
this.nowAmount = '';
this.every = '';
this.materialList = [];
if (this.form.documentNo == '') {
this.customToast(this.$t('message.Commission_tips1') as any);
return;
}
this.materialList = [];
let res = await this.model.queryOutsourcing(this.form.documentNo);
this.material = res.data;
this.materialList = [];
this.material.forEach((item: any) => {
let pickerName: any = {};
pickerName.label = item.materialCode;
@ -217,11 +215,6 @@ export default class dnReceiptDom extends BasePage {
return;
}
let num: number = parseFloat(this.nowAmount) + parseFloat(this.every.outAmount);
// this.list.forEach((item: any) => {
// if (item.materialCode == this.every.materialCode) {
// num += parseFloat(item.nowAmount);
// }
// });
if (num > parseFloat(this.every.orderAmount)) {
uni.showModal({
title: this.$t('message.Pi_tip') as any,
@ -286,7 +279,7 @@ export default class dnReceiptDom extends BasePage {
this.customToast(this.$t('message.Commission_tips5') as any);
}
await this.model.submitOutsourcing(this.list);
await this.empty();
this.empty();
await this.QueryLoc();
await this.query();
}

@ -212,6 +212,7 @@ export default class RawReceiptDetail extends BasePage {
let arr = {
label: item.materialCode,
value: item.materialCode,
sapSupplyId: item.sapSupplyId,
};
this.materialList.push(arr);
item.wlList = [];
@ -251,7 +252,7 @@ export default class RawReceiptDetail extends BasePage {
}
async materialChoice(e: any) {
this.model.blDetailList.forEach((item: any, index: any) => {
if (item.materialCode == e.pickerName.label) {
if (item.sapSupplyId == e.pickerName.sapSupplyId) {
this.some = item;
this.someIndex = index;
}

Loading…
Cancel
Save