diff --git a/src/pages/login/login/index.vue b/src/pages/login/login/index.vue
index 50795a9..781eff0 100644
--- a/src/pages/login/login/index.vue
+++ b/src/pages/login/login/index.vue
@@ -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}`;
diff --git a/src/pages/raw/commission/entrant/config.ts b/src/pages/raw/commission/entrant/config.ts
index 57d096e..7db4e27 100644
--- a/src/pages/raw/commission/entrant/config.ts
+++ b/src/pages/raw/commission/entrant/config.ts
@@ -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,
+ },
+];
diff --git a/src/pages/raw/commission/entrant/index.vue b/src/pages/raw/commission/entrant/index.vue
index ad87239..34b6598 100644
--- a/src/pages/raw/commission/entrant/index.vue
+++ b/src/pages/raw/commission/entrant/index.vue
@@ -59,31 +59,21 @@
{{ $t('message.product_add') }}
-
-
- {{ $t('message.product_Location') }}
- {{ $t('message.product_Number') }}
- {{ $t('message.operation') }}
-
-
- {{ item.wlCode }}
- {{ item.nowAmount }}
-
- {{ $t('message.product_Delete') }}
-
-
-
+
-
+
{{ $t('message.CommissionedDetails') }}
-
+
+ {{ $t('message.closure') }}
+
+
{{ $t('message.product_Upload') }}
-
+
{{ $t('message.po_Return') }}
@@ -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;
- }
}