新增扫码单据默认选择,切换后无法选择问题

fencang
anthonywj 3 years ago
parent 0842528611
commit 1d83f5e1fa

@ -680,6 +680,13 @@ export default {
this.$message.error('当前往来单位不能为空');
return;
}
if(this.curAction.corpType ==1){
if (this.$isBlank(this.formData.fromSubInvCode)) {
this.$message.error('当前往来分库不能为空');
return;
}
}
if (this.$isBlank(this.formData.corpOrderId)) {
let date = new Date();
this.formData.corpOrderId = parseTime(date, '{y}{m}{d}{h}{i}{s}') + Math.ceil(Math.random() * 89 + 10);
@ -787,6 +794,7 @@ export default {
this.curRow = row;
},
storageChange(row) {
this.formData.fromSubInvCode = "";
this.formData.fromCorpId = row.code;
this.formData.fromCorp = row.name;
this.findSubStorageMethod();

@ -68,10 +68,9 @@
</div>
</el-col>
<el-col :span="7">
<!-- @change="actionChange"-->
<el-form-item prop="billType">
<el-select v-model="formData.billType" placeholder="请选择业务类型"
@change="actionChange" clearable>
@change="actionChange">
<el-option
v-for="item in busTypes"
:key="item.localAction"
@ -597,7 +596,7 @@ export default {
filterAllByUser()
.then((response) => {
this.storageList = response.data || [];
this.invChange();
this.findSubInvs();
})
.catch(() => {
});
@ -1165,17 +1164,13 @@ export default {
},
actionChange(item) {
this.curAction = this.getActionItem(item);
this.formData.locStorageCode = this.curAction.storageCode;
this.locInChange(this.formData.locStorageCode);
this.formData.corpName = '';
this.locInChange();
this.findMethod();
},
locInChange(item) {
if (isBlank(item)) {
this.formData.invWarehouseCode = null;
}
this.formData.locStorageCode = item;
locInChange() {
this.$forceUpdate();
this.getBusType(item);
this.getBusType();
this.invChange();
this.findStorageMethod();
},
@ -1183,6 +1178,10 @@ export default {
if (this.$isNotBlank(this.formData.invWarehouseCode))
this.formData.invWarehouseCode = null;
this.findSubInvs();
},
findSubInvs() {
this.subInvList = [];
let query = {
pcode: this.formData.locStorageCode
@ -1190,13 +1189,15 @@ export default {
filterSubByInv(query)
.then((response) => {
this.subInvList = response.data || [];
if(this.subInvList!=null && this.subInvList.length==1){
if (this.subInvList != null && this.subInvList.length == 1) {
this.formData.invWarehouseCode = this.subInvList[0].code;
}
})
.catch(() => {
});
},
}
},
filters: {},
mounted() {
@ -1208,7 +1209,6 @@ export default {
created() {
this.getBusType("NOCODE");
this.getStorage();
this.formData = {noInvOut: false, locStorageCode: null, invWarehouseCode: null};
this.codeArray = [];
this.closeConfirmFunction(false);
if (this.$isNotBlank(this.idQuery.id)) {
@ -1220,10 +1220,16 @@ export default {
this.getStockOrderDetailList();
} else {
this.formData = {
billNo: null,
billdate: "",
customerId: store.getters.customerId,
billType: "",
type: "2",
corpName: "",
corpId: "",
noInvOut: "",
locStorageCode: store.getters.locInvCode,
invWarehouseCode: store.getters.locSubInvCode,
};
this.iCount = 0;
this.orderEditor = false;
@ -1247,7 +1253,7 @@ export default {
/**
解决el-input输入框 type=number时输入中文光标上移问题
*/
.el-input__inner{
.el-input__inner {
line-height: 1px !important;
}

@ -110,7 +110,7 @@
<el-col :span="7">
<el-form-item prop="locStorageCode">
<el-select v-model="formData.locStorageCode" placeholder="当前仓库信息" clearable
@change="locInChange">
@change="invChange">
<el-option
v-for="item in storageList"
:key="item.name"
@ -1074,12 +1074,6 @@ export default {
this.$router.go(-1);
},
locInChange(item) {
this.formData.locStorageCode = item;
// this.getBusType();
this.invChange();
},
getBusType() {
let query = {
enabled: true,
@ -1123,7 +1117,11 @@ export default {
},
invChange() {
if (this.$isNotBlank(this.formData.invWarehouseCode))
this.formData.invWarehouseCode = null;
this.formData.invWarehouseCode = '';
this.findSubInvs();
},
findSubInvs() {
this.subInvList = [];
let query = {
pcode: this.formData.locStorageCode
@ -1131,13 +1129,10 @@ export default {
filterSubByInv(query)
.then((response) => {
this.subInvList = response.data || [];
if(this.subInvList!=null && this.subInvList.length==1){
this.formData.invWarehouseCode = this.subInvList[0].code;
}
})
.catch(() => {
});
},
}
},
filters: {},
mounted() {
@ -1167,12 +1162,14 @@ export default {
// billType: "deliveryNote",
billType: "",
type: "2",
locStorageCode: store.getters.locInvCode,
invWarehouseCode: store.getters.locSubInvCode,
// type: "",
};
this.iCount = 0;
this.orderEditor = false;
this.formData.billdate = new Date();
// this.generateBillNo();
this.findSubInvs();
}
},
};

Loading…
Cancel
Save