{{ $t("message.product_Delete") }}
@@ -106,17 +101,17 @@
-
+
{{
- $t('message.CommissionedEntrantDetails')
+ $t('message.CommissionedGoOutDetails')
}}
- {{ $t('message.product_Upload') }}
+ {{ $t('message.product_Upload') }}
- {{ $t('message.po_Return') }}
+ {{ $t('message.po_Return') }}
@@ -143,7 +138,8 @@ export default class stoOutboundDom extends BasePage {
* 表格引用
*/
@Ref('table') readonly $table: any;
-LocationList: any = [];
+
+ LocationList: any = [];
/**
* 页面Module
*/
@@ -161,13 +157,26 @@ LocationList: any = [];
* 表单数据
*/
form = {
+ // poNo
+ poNo:null,
+ // 物料号
+ materialCode:null,
+ // 物料描述
+ materialDesc:null,
+ poLine:null,
+ unit:null,
+ // 累计出库数量
+ receiptAmount:null,
+ // 需求数量
+ poAmount: '',
+ locationCode:null,//库位
dockCode: null, // 月台类型code
dockName: null, // 月台类型name
orderNo: null,
qty: 0,
- orderAmount: '',
- productCode: 'test', // 物料类型name
- productDescZh: 'test',
+
+ productCode: '', // 物料类型name
+ productDescZh: '',
scanAmount: '',
barCode: '',
};
@@ -184,30 +193,30 @@ LocationList: any = [];
returningTypeSelect = false;
// 物料类型选择
materialCodeSelect = false;
+ locationCodeSelect = false;
/**
* 表单验证规则
*/
rules: VFormRules = {
orderNo: [{ required: true, message: this.$t('message.product_Tip4') as string }],
};
- confirm() {
- // if (this.wlCode == "" || this.number == "") {
- // uni.showToast({
- // icon: "none",
- // title: "请输入正确的库位和数量",
- // });
- // return;
- // }
- this.LocationList.push(this.form)
- }
- deleteItem(index: any) {
- this.LocationList.splice(index, 1);
- }
// 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
async onReady() {
this.$form.setRules(this.rules);
- model.queryReturningTypeList();
+ model.queryByFactoryCodeAndWorkAreaCode();
+ }
+ gooutInfo(){
+ if(this.form.poNo){
+ this.toPage(`${this.page.raw.commission.entrant.detail}?poNo=${this.form.poNo}`)
+ }else{
+ let tip = this.$t('message.borrow_Tip')
+ uni.showToast({
+ icon: "none",
+ title: tip as string,
+ });
+ }
+
}
onCheck(e: any) {
console.log('e.data', e.data);
@@ -218,11 +227,15 @@ LocationList: any = [];
});
}
back() {
- this.form.barCode = '';
- this.model.orderInInfo.stoAmount = 0;
- this.selectMaterielList = [];
uni.navigateBack({ delta: 1 });
- this.$table.onEmpty();
+ }
+
+// 单号查询
+ async queryOrder(poNo:string){
+ const {orderInInfo} = await model.queryOrder(poNo)
+ Object.assign(this.form,{
+ orderInInfo
+ })
}
materialConfirm(v: any) {
console.log('v[0].value', v[0]);
@@ -231,12 +244,24 @@ LocationList: any = [];
if (v[0].value == item.stoItem) {
this.form.productCode = item.materialCode;
this.form.productDescZh = item.materialDesc;
- this.form.orderAmount = item.orderAmount;
+ this.form.poAmount = item.poAmount;
this.form.scanAmount = item.scanAmount;
}
});
console.log('this.form', this.form);
}
+ locationCodeConfirm(v: any) {
+ console.log('v[0].value', v[0]);
+ // this.form.productCode = v[0].value;
+ this.model.locationCodeList.forEach((item: any) => {
+ console.log('item',item)
+ if (v[0].value == item.value) {
+ this.form.locationCode = item.value;
+ }
+ });
+ console.log('this.form', this.form);
+ }
+
/**
* 清空
*/
@@ -246,68 +271,81 @@ LocationList: any = [];
this.model.materielList.forEach((item: any) => {
if (this.form.productCode == item.label) {
this.form.productDescZh = item.materialDesc;
- this.form.orderAmount = item.orderAmount;
+ this.form.poAmount = item.poAmount;
this.form.scanAmount = item.scanAmount;
}
});
}
+
+ confirm() {
+ // if (this.wlCode == "" || this.number == "") {
+ // uni.showToast({
+ // icon: "none",
+ // title: "请输入正确的库位和数量",
+ // });
+ // return;
+ // }
+ console.log('123')
+ this.LocationList.push(this.form)
+ }
+
+ deleteItem(index: any) {
+ this.LocationList.splice(index, 1);
+ }
+
+
/**
- * 条码回车
+ * 提交
*/
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) <= parseInt(this.form.scanAmount)) {
- uni.showToast({ icon: 'none', title: this.$t('message.product_Tip6') as string });
- return;
- }
- 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,
- type: 0,
- keepBy: session.loginName as string,
- loginName: session.loginName as string,
- },
- ];
+ // 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.poAmount) <= parseInt(this.form.scanAmount)) {
+ // uni.showToast({ icon: 'none', title: this.$t('message.product_Tip6') as string });
+ // return;
+ // }
+ const list = this.LocationList.map( (item:any) =>({
+ wlCode:item.locationCode,
+ nowAmount:item.scanAmount,
+ }))
+
if (valid) {
- const res = await this.model.tluSubmit(list);
+ const res = await this.model.materialComplete({
+ poNo:this.form.poNo,
+ materialCode:this.form.materialCode,
+ list
+ });
console.log('fanhui ', res);
// if (res.barcode) {
// // this.materialList.push(res);
// this.form.scanAmount = res.scanAmount;
// }
- 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 });
- }
- }
+ // 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 = {
@@ -361,7 +399,7 @@ LocationList: any = [];
this.form.productCode = '';
// this.form.orderNo = null;
this.form.scanAmount = '';
- this.form.orderAmount = '';
+ this.form.poAmount = '';
this.form.productDescZh = '';
this.selectMaterielList = [];
this.$table.onEmpty();
diff --git a/src/pages/raw/commission/entrant/model.ts b/src/pages/raw/commission/entrant/model.ts
index f8d0098..ddb1f6e 100644
--- a/src/pages/raw/commission/entrant/model.ts
+++ b/src/pages/raw/commission/entrant/model.ts
@@ -24,10 +24,12 @@ export class ReturningModule extends VuexModule {
* 月台列表
*/
returningTypeList: any[] = [];
- /**
+
+ /**
* 物料列表
*/
- materielList: any[] = [];
+ materielList: any[] = [];
+ locationCodeList: any[] =[];
//条码扫描的返回的结果
oneMaterielDetail: any = {};
@@ -37,6 +39,69 @@ export class ReturningModule extends VuexModule {
orderInInfo: OrderInInfo = new OrderInInfo();
//记账按钮的code码
code = '';
+ /**
+ * 委外出库单号查询
+ * @param orderNo
+ */
+ @Action
+ async queryOrder(form:any) {
+ const result = await http.post(url.material.commission.entrant.queryOrder, {
+ ...form,
+ loginName: session.loginName,
+ factoryCode:session.factoryCode
+ });
+ const orderInInfo = result.data.records[0] || {};
+ return { orderInInfo };
+ }
+
+ /**
+ * 库位
+ */
+ @MutationAction
+ async queryByFactoryCodeAndWorkAreaCode() {
+ const list: [] = await http.post(url.material.commission.goOut.queryByFactoryCodeAndWorkAreaCode, {
+ factoryCode: session.factoryCode,
+ whCode: session.warehouseCode,
+ loginName: session.loginName,
+ });
+ const locationCodeList = list.map((item: any) => ({
+ label: item.locationCode,
+ value: item.locationCode,
+ }));
+ return { locationCodeList };
+ }
+
+ /**
+ * 提交
+ */
+ @Action
+ async materialComplete(form:any) {
+ const res = await http.post(url.material.commission.goOut.materialComplete, {
+ factoryCode: session.factoryCode,
+ loginName: session.loginName,
+ ...form
+ });
+ console.log(res,'>>>>>res')
+ }
+ /**
+ * 获取物料
+ *
+ * @returns
+ * @memberof ReturningModule
+ */
+ @MutationAction
+ async info(poNo:string) {
+ const list: [] = await http.post(url.material.commission.entrant.info, {
+ factoryCode: session.factoryCode,
+ poNo: poNo,
+ loginName: session.loginName,
+ });
+ const locationCodeList = list.map((item: any) => ({
+ label: item.locationCode,
+ value: item.locationCode,
+ }));
+ return { locationCodeList };
+ }
/**
* 查询月台列表
*/
@@ -54,6 +119,7 @@ export class ReturningModule extends VuexModule {
return { returningTypeList };
}
+
/**
* 查询订单号
* @param orderNo
diff --git a/src/pages/raw/commission/goOut/config.ts b/src/pages/raw/commission/goOut/config.ts
index bf291c6..7e6a1b2 100644
--- a/src/pages/raw/commission/goOut/config.ts
+++ b/src/pages/raw/commission/goOut/config.ts
@@ -1,7 +1,7 @@
/*
* @Author: zhou lei
* @Date: 2021-11-11 11:09:57
- * @LastEditTime: 2021-11-22 10:06:58
+ * @LastEditTime: 2021-11-22 15:16:21
* @LastEditors: zhou lei
* @Description:
* @FilePath: /wms_haiwai_app/src/pages/raw/commission/goOut/config.ts
@@ -13,18 +13,28 @@
import vm from '@/main';
export const headers = [
{
- label: vm.$t('message.CommissionedLocation'),
- key: 'locationCode',
+ label: vm.$t('message.CommissionedSingleNumber'),
+ key: 'poNo',
+ width: 200,
+ },
+ {
+ label: vm.$t('message.po_MaterielNo'),
+ key: 'materialCode',
+ width: 300,
+ },
+ {
+ label: vm.$t('message.CommissionedMaterielDesc'),
+ key: 'materialDesc',
width: 300,
},
{
label: vm.$t('message.CommissionedGoOutNumber'),
- key: 'scanAmount',
- width: 300,
+ key: 'outAmount',
+ width: 200,
},
{
- label: vm.$t('message.operation'),
- key: 'materialDesc',
- width: 300,
- },
+ label: vm.$t('message.CommissionedLocation'),
+ key: 'wlCode',
+ width: 200,
+ }
];
diff --git a/src/pages/raw/commission/goOut/detail.vue b/src/pages/raw/commission/goOut/detail.vue
index f1b6367..abdc38b 100644
--- a/src/pages/raw/commission/goOut/detail.vue
+++ b/src/pages/raw/commission/goOut/detail.vue
@@ -26,41 +26,8 @@
>{{ $t('message.po_Total') }} {{ model.materielList.length }}
{{ $t('message.po_Records') }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-