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

fencang
anthonywj 3 years ago
parent 0842528611
commit 1d83f5e1fa

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

@ -68,10 +68,9 @@
</div> </div>
</el-col> </el-col>
<el-col :span="7"> <el-col :span="7">
<!-- @change="actionChange"-->
<el-form-item prop="billType"> <el-form-item prop="billType">
<el-select v-model="formData.billType" placeholder="请选择业务类型" <el-select v-model="formData.billType" placeholder="请选择业务类型"
@change="actionChange" clearable> @change="actionChange">
<el-option <el-option
v-for="item in busTypes" v-for="item in busTypes"
:key="item.localAction" :key="item.localAction"
@ -597,7 +596,7 @@ export default {
filterAllByUser() filterAllByUser()
.then((response) => { .then((response) => {
this.storageList = response.data || []; this.storageList = response.data || [];
this.invChange(); this.findSubInvs();
}) })
.catch(() => { .catch(() => {
}); });
@ -1165,17 +1164,13 @@ export default {
}, },
actionChange(item) { actionChange(item) {
this.curAction = this.getActionItem(item); this.curAction = this.getActionItem(item);
this.formData.locStorageCode = this.curAction.storageCode; this.formData.corpName = '';
this.locInChange(this.formData.locStorageCode); this.locInChange();
this.findMethod(); this.findMethod();
}, },
locInChange(item) { locInChange() {
if (isBlank(item)) {
this.formData.invWarehouseCode = null;
}
this.formData.locStorageCode = item;
this.$forceUpdate(); this.$forceUpdate();
this.getBusType(item); this.getBusType();
this.invChange(); this.invChange();
this.findStorageMethod(); this.findStorageMethod();
}, },
@ -1183,6 +1178,10 @@ export default {
if (this.$isNotBlank(this.formData.invWarehouseCode)) if (this.$isNotBlank(this.formData.invWarehouseCode))
this.formData.invWarehouseCode = null; this.formData.invWarehouseCode = null;
this.findSubInvs();
},
findSubInvs() {
this.subInvList = []; this.subInvList = [];
let query = { let query = {
pcode: this.formData.locStorageCode pcode: this.formData.locStorageCode
@ -1196,7 +1195,9 @@ export default {
}) })
.catch(() => { .catch(() => {
}); });
}, }
}, },
filters: {}, filters: {},
mounted() { mounted() {
@ -1208,7 +1209,6 @@ export default {
created() { created() {
this.getBusType("NOCODE"); this.getBusType("NOCODE");
this.getStorage(); this.getStorage();
this.formData = {noInvOut: false, locStorageCode: null, invWarehouseCode: null};
this.codeArray = []; this.codeArray = [];
this.closeConfirmFunction(false); this.closeConfirmFunction(false);
if (this.$isNotBlank(this.idQuery.id)) { if (this.$isNotBlank(this.idQuery.id)) {
@ -1220,10 +1220,16 @@ export default {
this.getStockOrderDetailList(); this.getStockOrderDetailList();
} else { } else {
this.formData = { this.formData = {
billNo: null,
billdate: "", billdate: "",
customerId: store.getters.customerId, customerId: store.getters.customerId,
billType: "", billType: "",
type: "2", type: "2",
corpName: "",
corpId: "",
noInvOut: "",
locStorageCode: store.getters.locInvCode,
invWarehouseCode: store.getters.locSubInvCode,
}; };
this.iCount = 0; this.iCount = 0;
this.orderEditor = false; this.orderEditor = false;

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

Loading…
Cancel
Save