DN发货 委外出库

master
hou 4 years ago
parent 345268e288
commit a6f447835a

@ -393,6 +393,7 @@ export default {
Warehouse_Tip8: '请输入成本中心', Warehouse_Tip8: '请输入成本中心',
Warehouse_Tip9: '操作成功', Warehouse_Tip9: '操作成功',
DocumentNumber: '文件号', DocumentNumber: '文件号',
Posting: '过账',
fileNumber: '请输入文件号', fileNumber: '请输入文件号',
Warehouse_Tip10: '请选择sap库存地点', Warehouse_Tip10: '请选择sap库存地点',
Warehouse_Tip11: '该单号不存在或已经操作完成', Warehouse_Tip11: '该单号不存在或已经操作完成',
@ -410,5 +411,6 @@ export default {
AppendMateriel3: '不能大于需求数量,请重新输入', AppendMateriel3: '不能大于需求数量,请重新输入',
AppendMateriel4: '请选择正确的库位', AppendMateriel4: '请选择正确的库位',
AppendMateriel5: '请先选择一个物料', AppendMateriel5: '请先选择一个物料',
demandQuantity: '总数量大于需求数量',
}, },
}; };

@ -332,6 +332,7 @@ export default {
product_item4: 'SFG Door Body Online', product_item4: 'SFG Door Body Online',
product_item5: 'SFG Box Body Online', product_item5: 'SFG Box Body Online',
fileNumber: 'Please enter the file number', fileNumber: 'Please enter the file number',
Posting: 'Posting',
//成品下线 //成品下线
product_Location: 'Loc', product_Location: 'Loc',
@ -413,5 +414,6 @@ export default {
AppendMateriel3: 'Cannot be greater than the required quantity, please re-enter', AppendMateriel3: 'Cannot be greater than the required quantity, please re-enter',
AppendMateriel4: 'Please select the correct location', AppendMateriel4: 'Please select the correct location',
AppendMateriel5: 'Please select a material first', AppendMateriel5: 'Please select a material first',
demandQuantity: 'The total quantity is greater than the demand quantity',
}, },
}; };

@ -23,7 +23,7 @@
</u-form-item> </u-form-item>
<!-- 成品描述 --> <!-- 成品描述 -->
<u-form-item :label="$t('message.product_FGDes')"> <u-form-item :label="$t('message.product_FGDes')">
<u-input :disabled="true" v-model="form.productDescZh" placeholder="" style="overflow: hidden;"/> <u-input :disabled="true" v-model="form.productDescZh" placeholder="" style="overflow: hidden" />
</u-form-item> </u-form-item>
<!-- 成品编码 --> <!-- 成品编码 -->
<u-form-item :label="$t('message.product_FGCode')"> <u-form-item :label="$t('message.product_FGCode')">
@ -66,7 +66,7 @@
</u-col> --> </u-col> -->
<!-- Guoshuang 出库要改入参 --> <!-- Guoshuang 出库要改入参 -->
<u-col :span="4"> <u-col :span="4">
<u-button type="primary" @click="onOk">{{ $t('message.po_Deliver') }}</u-button> <u-button type="primary" @click="Posting">{{ $t('message.Posting') }}</u-button>
</u-col> </u-col>
<!-- <u-col :span="3">--> <!-- <u-col :span="3">-->
<!-- <u-button type="success" @click="uni.navigateBack()"></u-button>--> <!-- <u-button type="success" @click="uni.navigateBack()"></u-button>-->
@ -146,16 +146,14 @@ export default class stoOutboundDom extends BasePage {
async onReady() { async onReady() {
this.$form.setRules(this.rules); this.$form.setRules(this.rules);
model.queryReturningTypeList(); model.queryReturningTypeList();
this.form.orderNo = JSON.parse(sessionStorage.getItem('SweepCode'));
sessionStorage.removeItem('SweepCode');
if (!this.form.orderNo) {
return;
} else {
this.query();
}
} }
//onCheck
// onCheck(e: any) {
// console.log('e.data', e.data);
// this.selectMaterielList = [];
// e.data.forEach((line: any) => {
// const { lineData: item } = line;
// this.selectMaterielList.push(item);
// });
// }
back() { back() {
this.form.barCode = ''; this.form.barCode = '';
this.model.orderInInfo.stoAmount = 0; this.model.orderInInfo.stoAmount = 0;
@ -251,88 +249,89 @@ export default class stoOutboundDom extends BasePage {
* 条码回车 * 条码回车
*/ */
// //
onSubmit() { // onSubmit() {
this.$form.validate(async (valid: boolean) => { // this.$form.validate(async (valid: boolean) => {
// if (this.form.productCode.slice(0, 9) != this.form.barCode.slice(0, 9)) { // // if (this.form.productCode.slice(0, 9) != this.form.barCode.slice(0, 9)) {
// // uni.showToast({
// // icon: "none",
// // title: this.$t("message.product_Tip5") as string,
// // });
// // return;
// // }
// if (parseInt(this.form.orderAmount) <= this.form.scanAmount) {
// uni.showToast({ // uni.showToast({
// icon: "none", // icon: 'none',
// title: this.$t("message.product_Tip5") as string, // title: this.$t('message.product_Tip6') as string,
// }); // });
// return; // return;
// } // }
if (parseInt(this.form.orderAmount) <= this.form.scanAmount) { // // let list = [
uni.showToast({ // // {
icon: 'none', // // order3: this.form.orderNo,
title: this.$t('message.product_Tip6') as string, // // productCode: this.form.productCode,
}); // // productDescZh: this.form.productDescZh,
return; // // barCode: this.form.barCode,
} // // dockCode: this.form.dockCode,
// let list = [ // // dockName: this.form.dockName,
// { // // // orderType: 3,
// order3: this.form.orderNo, // // orderType: 4,
// // type: 0,
// // keepBy: session.loginName as string,
// // loginName: session.loginName as string,
// // },
// // ];
// if (valid) {
// let list: any = {
// productCode: this.form.productCode, // productCode: this.form.productCode,
// productDescZh: this.form.productDescZh, // barcode: this.form.barCode,
// barCode: this.form.barCode, // loginName: session.loginName,
// dockCode: this.form.dockCode, // factoryCode: session.factoryCode,
// dockName: this.form.dockName, // };
// // orderType: 3, // const res = await this.model.getMaterialByCode(list);
// orderType: 4, // console.log('fanhui', res);
// type: 0, // // if (res.barcode) {
// keepBy: session.loginName as string, // // // this.materialList.push(res);
// loginName: session.loginName as string, // // this.form.scanAmount = res.scanAmount;
// }, // // }
// ]; // //guoshuang
if (valid) { // if (this.materialList.length == 0) {
let list: any = { // await this.materialList.push(res);
productCode: this.form.productCode, // this.form.scanAmount += 1;
barcode: this.form.barCode, // this.$table.onCheckAllTap();
loginName: session.loginName, // } else {
factoryCode: session.factoryCode, // let flag = 0;
}; // for (let i = 0; i < this.materialList.length; i++) {
const res = await this.model.getMaterialByCode(list); // console.log('11111', this.materialList[i]);
console.log('fanhui', res); // if (this.form.barCode == this.materialList[i].barcode) {
// if (res.barcode) { // flag = 1;
// // this.materialList.push(res); // break;
// this.form.scanAmount = res.scanAmount;
// } // }
//guoshuang // }
if (this.materialList.length == 0) { // if (flag == 0) {
await this.materialList.push(res); // await this.$table.onCheckAllTap();
this.form.scanAmount += 1; // await this.materialList.push(res);
this.$table.onCheckAllTap(); // this.form.scanAmount += 1;
} else { // this.$table.onCheckAllTap();
let flag = 0; // } else {
for (let i = 0; i < this.materialList.length; i++) { // uni.showToast({
console.log('11111', this.materialList[i]); // icon: 'none',
if (this.form.barCode == this.materialList[i].barcode) { // title: this.$t('message.product_Tip7') as string,
flag = 1; // });
break; // }
} // }
} // }
if (flag == 0) { // });
await this.$table.onCheckAllTap(); // const item = {
await this.materialList.push(res); // ...this.form,
this.form.scanAmount += 1; // barCode: String(''),
this.$table.onCheckAllTap(); // };
} else { // this.firstFocus = false;
uni.showToast({ // setTimeout(() => {
icon: 'none', // this.form = item;
title: this.$t('message.product_Tip7') as string, // this.firstFocus = true;
}); // }, 0);
} // }
} Posting() {}
}
});
const item = {
...this.form,
barCode: String(''),
};
this.firstFocus = false;
setTimeout(() => {
this.form = item;
this.firstFocus = true;
}, 0);
}
onOk() { onOk() {
// if (this.selectMaterielList.length == 0) { // if (this.selectMaterielList.length == 0) {
// uni.showToast({ icon: 'none', title: this.$t('message.product_Tip2') as string }); // uni.showToast({ icon: 'none', title: this.$t('message.product_Tip2') as string });
@ -391,7 +390,7 @@ export default class stoOutboundDom extends BasePage {
uni.showToast({ icon: 'success', title: 'success' }); uni.showToast({ icon: 'success', title: 'success' });
} }
}); });
this.form.orderNo = ''; // this.form.orderNo = '';
this.form.barCode = ''; this.form.barCode = '';
this.form.productCode = ''; this.form.productCode = '';
model.orderInInfo.stoAmount = 0; model.orderInInfo.stoAmount = 0;

@ -192,19 +192,37 @@ export default class dnReceiptDom extends BasePage {
}); });
return; return;
} }
if (parseFloat(this.nowAmount) > this.every.orderAmount) { let num: number = parseFloat(this.nowAmount);
uni.showToast({ this.list.forEach((item: any) => {
icon: 'none', num += parseFloat(item.nowAmount);
title: this.$t('message.Commission_tips4') as any,
}); });
return; if (num > parseFloat(this.every.orderAmount)) {
} uni.showModal({
title: this.$t('message.Pi_tip') as any,
content: this.$t('message.demandQuantity') as any,
cancelText: this.$t('message.Cancel') as any,
confirmText: this.$t('message.workArea_Confirm') as any,
success: (res) => {
if (res.confirm) {
let arr = { let arr = {
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.business();
} else if (res.cancel) {
return;
}
},
});
} else {
let arr = {
wlCode: this.wlCode.label,
nowAmount: this.nowAmount,
};
this.list.push(arr);
this.business();
}
} }
deleteItem(index: any) { deleteItem(index: any) {
this.list.splice(index, 1); this.list.splice(index, 1);

Loading…
Cancel
Save