DN发货 委外出库

master
hou 4 years ago
parent 345268e288
commit a6f447835a

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

@ -332,6 +332,7 @@ export default {
product_item4: 'SFG Door Body Online',
product_item5: 'SFG Box Body Online',
fileNumber: 'Please enter the file number',
Posting: 'Posting',
//成品下线
product_Location: 'Loc',
@ -413,5 +414,6 @@ export default {
AppendMateriel3: 'Cannot be greater than the required quantity, please re-enter',
AppendMateriel4: 'Please select the correct location',
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 :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 :label="$t('message.product_FGCode')">
@ -66,7 +66,7 @@
</u-col> -->
<!-- Guoshuang 出库要改入参 -->
<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 :span="3">-->
<!-- <u-button type="success" @click="uni.navigateBack()"></u-button>-->
@ -146,16 +146,14 @@ export default class stoOutboundDom extends BasePage {
async onReady() {
this.$form.setRules(this.rules);
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() {
this.form.barCode = '';
this.model.orderInInfo.stoAmount = 0;
@ -251,88 +249,89 @@ export default class stoOutboundDom extends BasePage {
* 条码回车
*/
//
onSubmit() {
this.$form.validate(async (valid: boolean) => {
// if (this.form.productCode.slice(0, 9) != this.form.barCode.slice(0, 9)) {
// onSubmit() {
// this.$form.validate(async (valid: boolean) => {
// // 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({
// icon: "none",
// title: this.$t("message.product_Tip5") as string,
// icon: 'none',
// title: this.$t('message.product_Tip6') as string,
// });
// return;
// }
if (parseInt(this.form.orderAmount) <= this.form.scanAmount) {
uni.showToast({
icon: 'none',
title: this.$t('message.product_Tip6') as string,
});
return;
}
// let list = [
// {
// order3: this.form.orderNo,
// // let list = [
// // {
// // order3: this.form.orderNo,
// // productCode: this.form.productCode,
// // productDescZh: this.form.productDescZh,
// // barCode: this.form.barCode,
// // dockCode: this.form.dockCode,
// // dockName: this.form.dockName,
// // // orderType: 3,
// // orderType: 4,
// // type: 0,
// // keepBy: session.loginName as string,
// // loginName: session.loginName as string,
// // },
// // ];
// if (valid) {
// let list: any = {
// productCode: this.form.productCode,
// productDescZh: this.form.productDescZh,
// barCode: this.form.barCode,
// dockCode: this.form.dockCode,
// dockName: this.form.dockName,
// // orderType: 3,
// orderType: 4,
// type: 0,
// keepBy: session.loginName as string,
// loginName: session.loginName as string,
// },
// ];
if (valid) {
let list: any = {
productCode: this.form.productCode,
barcode: this.form.barCode,
loginName: session.loginName,
factoryCode: session.factoryCode,
};
const res = await this.model.getMaterialByCode(list);
console.log('fanhui', res);
// if (res.barcode) {
// // this.materialList.push(res);
// this.form.scanAmount = res.scanAmount;
// barcode: this.form.barCode,
// loginName: session.loginName,
// factoryCode: session.factoryCode,
// };
// const res = await this.model.getMaterialByCode(list);
// console.log('fanhui', res);
// // if (res.barcode) {
// // // this.materialList.push(res);
// // this.form.scanAmount = res.scanAmount;
// // }
// //guoshuang
// if (this.materialList.length == 0) {
// await this.materialList.push(res);
// this.form.scanAmount += 1;
// this.$table.onCheckAllTap();
// } else {
// let flag = 0;
// for (let i = 0; i < this.materialList.length; i++) {
// console.log('11111', this.materialList[i]);
// if (this.form.barCode == this.materialList[i].barcode) {
// flag = 1;
// break;
// }
//guoshuang
if (this.materialList.length == 0) {
await this.materialList.push(res);
this.form.scanAmount += 1;
this.$table.onCheckAllTap();
} else {
let flag = 0;
for (let i = 0; i < this.materialList.length; i++) {
console.log('11111', this.materialList[i]);
if (this.form.barCode == this.materialList[i].barcode) {
flag = 1;
break;
}
}
if (flag == 0) {
await this.$table.onCheckAllTap();
await this.materialList.push(res);
this.form.scanAmount += 1;
this.$table.onCheckAllTap();
} else {
uni.showToast({
icon: 'none',
title: this.$t('message.product_Tip7') as string,
});
}
}
}
});
const item = {
...this.form,
barCode: String(''),
};
this.firstFocus = false;
setTimeout(() => {
this.form = item;
this.firstFocus = true;
}, 0);
}
// }
// if (flag == 0) {
// await this.$table.onCheckAllTap();
// await this.materialList.push(res);
// this.form.scanAmount += 1;
// this.$table.onCheckAllTap();
// } else {
// uni.showToast({
// icon: 'none',
// title: this.$t('message.product_Tip7') as string,
// });
// }
// }
// }
// });
// const item = {
// ...this.form,
// barCode: String(''),
// };
// this.firstFocus = false;
// setTimeout(() => {
// this.form = item;
// this.firstFocus = true;
// }, 0);
// }
Posting() {}
onOk() {
// if (this.selectMaterielList.length == 0) {
// 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' });
}
});
this.form.orderNo = '';
// this.form.orderNo = '';
this.form.barCode = '';
this.form.productCode = '';
model.orderInInfo.stoAmount = 0;

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

Loading…
Cancel
Save