dam-7 feat 成品下线新增推荐库位

master
hou 3 years ago
parent 91ac9e6e8a
commit c39ff84d88

@ -15,6 +15,9 @@
</u-form-item> </u-form-item>
<u-form-item :required="true" :label="$t('message.product_Location')" prop="dockName"> <u-form-item :required="true" :label="$t('message.product_Location')" prop="dockName">
<jPicker sureColor="#ff0000" @bindpicker="bookTypeChange" showKey="value" valKey="value" :val="form.aimWl.value" :options="model.returningTypeList" :focus="true" /> <jPicker sureColor="#ff0000" @bindpicker="bookTypeChange" showKey="value" valKey="value" :val="form.aimWl.value" :options="model.returningTypeList" :focus="true" />
<u-col :span="3">
<u-button type="success" @click="add">{{ $t('message.product_add') }}</u-button>
</u-col>
<!-- <u-input v-model="form.dockName" type="select" @click="returningTypeSelect = true" />--> <!-- <u-input v-model="form.dockName" type="select" @click="returningTypeSelect = true" />-->
<!-- <u-select--> <!-- <u-select-->
<!-- v-model="returningTypeSelect"--> <!-- v-model="returningTypeSelect"-->
@ -142,8 +145,6 @@ export default class finishProductOfflineDom extends BasePage {
// onReadyonLoad // onReadyonLoad
async onReady() { async onReady() {
this.$form.setRules(this.rules); this.$form.setRules(this.rules);
await model.queryReturningTypeList();
this.form.aimWl = model.firstLocation;
} }
/** /**
* 处理选择行 选中一条执行一次 * 处理选择行 选中一条执行一次
@ -155,6 +156,7 @@ export default class finishProductOfflineDom extends BasePage {
const { lineData: item } = line; const { lineData: item } = line;
this.selectMaterielList.push(item); this.selectMaterielList.push(item);
}); });
console.log('this.selectMaterielList', this.selectMaterielList);
} }
back() { back() {
this.form.barCode = ''; this.form.barCode = '';
@ -211,20 +213,11 @@ export default class finishProductOfflineDom extends BasePage {
} else { } else {
this.$form.validate(async (valid: boolean) => { this.$form.validate(async (valid: boolean) => {
if (!valid) return; if (!valid) return;
// if (!this.form.aimWl.value) {
// uni.showToast({
// icon: 'none',
// title: this.$t('message.product_Tip3') as string,
// });
// return;
// }
this.selectMaterielList.forEach((item: any) => { this.selectMaterielList.forEach((item: any) => {
item.factoryCode = session.factoryCode; // item.factoryCode = session.factoryCode; //
item.warehouseCode = session.warehouseCode; // item.warehouseCode = session.warehouseCode; //
item.regionCode = session.regionCode; // item.regionCode = session.regionCode; //
item.areaCode = session.regionCode; // item.areaCode = session.regionCode; //
// item.locCode = this.form.dockName; //
// item.locCode = this.form.aimWl.value; //
item.operator = session.loginName; // item.operator = session.loginName; //
item.loginName = session.loginName; // item.loginName = session.loginName; //
}); });
@ -242,11 +235,31 @@ export default class finishProductOfflineDom extends BasePage {
this.$table.onEmpty(); this.$table.onEmpty();
} }
} }
getBarcode() { add() {
if (this.form.aimWl.value == undefined) { if (!this.form.barCode) {
this.customToast(this.$t('message.product_Tip3') as string); this.customToast(this.$t('message.barcode') as string);
return; return;
} }
if (this.materielList.length == 0) {
this.materielList.push(this.model.materielList[0]);
this.materielList[this.materielList.length - 1].locCode = this.form.aimWl.label;
} else {
let flag = 0;
for (let i = 0; i < this.materielList.length; i++) {
if (this.form.barCode == this.materielList[i].barcode) {
flag = 1;
break;
}
}
if (flag == 0) {
this.materielList.push(this.model.materielList[0]);
this.materielList[this.materielList.length - 1].locCode = this.form.aimWl.label;
} else {
this.customToast(this.$t('message.product_Tip7') as string);
}
}
}
async getBarcode() {
if (this.form.barCode.length < 20) { if (this.form.barCode.length < 20) {
this.customToast(this.$t('message.barCodeLength') as string); this.customToast(this.$t('message.barCodeLength') as string);
return; return;
@ -255,40 +268,11 @@ export default class finishProductOfflineDom extends BasePage {
this.customToast(this.$t('message.standard') as string); this.customToast(this.$t('message.standard') as string);
return; return;
} }
console.log('this.form', this.form); await this.model.queryOrderInInfo(this.form);
if (this.materielList.length == 0) { if (this.model.searchCode == '1') {
this.model.queryOrderInInfo(this.form).then(async () => { await this.model.queryTypeList(this.form.barCode);
await this.materielList.push(this.model.materielList[0]); this.form.aimWl = model.firstLocation;
this.$table.onCheckAllTap();
});
} else {
let flag = 0;
for (let i = 0; i < this.materielList.length; i++) {
console.log('11111', this.materielList[i]);
if (this.form.barCode == this.materielList[i].barcode) {
flag = 1;
break;
}
}
if (flag == 0) {
this.model.queryOrderInInfo(this.form).then(async () => {
await this.$table.onCheckAllTap();
await this.materielList.push(this.model.materielList[0]);
this.$table.onCheckAllTap();
});
} else {
this.customToast(this.$t('message.product_Tip7') as string);
}
} }
const item = {
...this.form,
barCode: String(''),
};
this.firstFocus = false;
setTimeout(() => {
this.form = item;
this.firstFocus = true;
}, 0);
} }
} }
</script> </script>

@ -24,6 +24,7 @@ export class PickingModule extends VuexModule {
*/ */
returningTypeList: any[] = []; returningTypeList: any[] = [];
firstLocation: any = {}; firstLocation: any = {};
searchCode: any = '';
/** /**
* *
*/ */
@ -59,6 +60,22 @@ export class PickingModule extends VuexModule {
// firstLocation.value = firstLocation.locationCode + '(' + firstLocation.sendSpot + ')'; // firstLocation.value = firstLocation.locationCode + '(' + firstLocation.sendSpot + ')';
return { returningTypeList, firstLocation }; return { returningTypeList, firstLocation };
} }
//根据扫描的条码推荐库位
@MutationAction
async queryTypeList(prodCode: any) {
const res: any = await http.post(url.inbound.finishProductOffline.SearchKuwei, {
factoryCode: session.factoryCode,
loginName: session.loginName,
prodCode: prodCode,
});
console.log('data', res.data);
const returningTypeList = res.data.map((item: any) => ({
label: item.locationCode,
value: item.locationCode + '(' + item.sendSpot + ')',
}));
const firstLocation = returningTypeList[0];
return { returningTypeList, firstLocation };
}
/** /**
* *
* @param orderNo * @param orderNo
@ -82,10 +99,11 @@ export class PickingModule extends VuexModule {
//uni.showToast({ icon: "none", title: msg }); //uni.showToast({ icon: "none", title: msg });
vm.customToast(msg); vm.customToast(msg);
} }
const searchCode = code;
const materielList2 = []; const materielList2 = [];
materielList2.push(data); materielList2.push(data);
const materielList = materielList2; const materielList = materielList2;
return { materielList }; return { searchCode, materielList };
} }
/** /**
* *

@ -143,6 +143,7 @@ export const url = {
inbound: { inbound: {
finishProductOffline: { finishProductOffline: {
kuwei: '/wmspda/fg/getMdLocation', kuwei: '/wmspda/fg/getMdLocation',
SearchKuwei: '/wmspda/fg/getMdLocationProd',
barcode: '/wmspda/product/finished/show-info', barcode: '/wmspda/product/finished/show-info',
confirm: '/wmspda/product/finished/batch-offline', confirm: '/wmspda/product/finished/batch-offline',
}, },

Loading…
Cancel
Save