|
|
|
@ -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 {
|
|
|
|
|
// 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
|
|
|
|
|
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>
|
|
|
|
|