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

master
hou 3 years ago
parent 91ac9e6e8a
commit c39ff84d88

@ -15,6 +15,9 @@
</u-form-item>
<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" />
<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-select-->
<!-- v-model="returningTypeSelect"-->
@ -142,8 +145,6 @@ export default class finishProductOfflineDom extends BasePage {
// onReadyonLoad
async onReady() {
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;
this.selectMaterielList.push(item);
});
console.log('this.selectMaterielList', this.selectMaterielList);
}
back() {
this.form.barCode = '';
@ -211,20 +213,11 @@ export default class finishProductOfflineDom extends BasePage {
} else {
this.$form.validate(async (valid: boolean) => {
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) => {
item.factoryCode = session.factoryCode; //
item.warehouseCode = session.warehouseCode; //
item.regionCode = session.regionCode; //
item.areaCode = session.regionCode; //
// item.locCode = this.form.dockName; //
// item.locCode = this.form.aimWl.value; //
item.operator = session.loginName; //
item.loginName = session.loginName; //
});
@ -242,11 +235,31 @@ export default class finishProductOfflineDom extends BasePage {
this.$table.onEmpty();
}
}
getBarcode() {
if (this.form.aimWl.value == undefined) {
this.customToast(this.$t('message.product_Tip3') as string);
add() {
if (!this.form.barCode) {
this.customToast(this.$t('message.barcode') as string);
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) {
this.customToast(this.$t('message.barCodeLength') as string);
return;
@ -255,40 +268,11 @@ export default class finishProductOfflineDom extends BasePage {
this.customToast(this.$t('message.standard') as string);
return;
}
console.log('this.form', this.form);
if (this.materielList.length == 0) {
this.model.queryOrderInInfo(this.form).then(async () => {
await this.materielList.push(this.model.materielList[0]);
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);
}
await this.model.queryOrderInInfo(this.form);
if (this.model.searchCode == '1') {
await this.model.queryTypeList(this.form.barCode);
this.form.aimWl = model.firstLocation;
}
const item = {
...this.form,
barCode: String(''),
};
this.firstFocus = false;
setTimeout(() => {
this.form = item;
this.firstFocus = true;
}, 0);
}
}
</script>

@ -24,6 +24,7 @@ export class PickingModule extends VuexModule {
*/
returningTypeList: any[] = [];
firstLocation: any = {};
searchCode: any = '';
/**
*
*/
@ -59,6 +60,22 @@ export class PickingModule extends VuexModule {
// firstLocation.value = firstLocation.locationCode + '(' + firstLocation.sendSpot + ')';
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
@ -82,10 +99,11 @@ export class PickingModule extends VuexModule {
//uni.showToast({ icon: "none", title: msg });
vm.customToast(msg);
}
const searchCode = code;
const materielList2 = [];
materielList2.push(data);
const materielList = materielList2;
return { materielList };
return { searchCode, materielList };
}
/**
*

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

Loading…
Cancel
Save