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

fengcang
anthonyywj2 3 years ago
parent 6899706ec5
commit 07129bdeff

@ -11,7 +11,7 @@ import {
} from "../../utils/auth";
// import { $NOT_NETWORK } from '../../utils/errorCode'
import {Message} from "element-ui";
import {RECEIVE_ADMIN_EMPLOY_NAME, RECEIVE_LOCINVCODE, RECEIVE_LOCSUBINVCODE} from "../mutation-types";
import {RECEIVE_ADMIN_EMPLOY_NAME} from "../mutation-types";
// initial state
const state = {
@ -23,7 +23,9 @@ const state = {
authRules: [], // 权限列表
routers: constantRouterMap, // 路由列表
locInvCode: "",
locSubInvCode:""
locSubInvCode: "",
locInvName: "",
locSubInvName: ""
};
// getters
@ -37,6 +39,8 @@ const getters = {
routers: state => state.routers,
locInvCode: state => state.locInvCode,
locSubInvCode: state => state.locSubInvCode,
locInvName: state => state.locInvName,
locSubInvName: state => state.locSubInvName,
};
// actions
@ -77,6 +81,7 @@ const actions = {
}
const data = response.data || {};
commit(types.RECEIVE_ADMIN_NAME, data.userName);
commit(types.RECEIVE_ADMIN_EMPLOY_NAME, data.employeeName);
commit(types.RECEIVE_ADMIN_AVATAR, data.avatar);
commit(types.RECEIVE_ADMIN_AUTH_RULES, data.authRules);
@ -97,6 +102,8 @@ const actions = {
commit(types.RECEIVE_ADMIN_AUTH_RULES, []);
commit(types.RECEIVE_LOCINVCODE, "");
commit(types.RECEIVE_LOCSUBINVCODE, "");
commit(types.RECEIVE_LOCINVNAME, "");
commit(types.RECEIVE_LOCSUBINVNAME, "");
resolve();
})
.catch(error => {
@ -113,6 +120,8 @@ const actions = {
commit(types.RECEIVE_ADMIN_AUTH_RULES, []);
commit(types.RECEIVE_LOCINVCODE, "");
commit(types.RECEIVE_LOCSUBINVCODE, "");
commit(types.RECEIVE_LOCINVNAME, "");
commit(types.RECEIVE_LOCSUBINVNAME, "");
resolve();
});
},
@ -151,6 +160,9 @@ const mutations = {
[types.RECEIVE_ADMIN_NAME](state, userName) {
state.userName = userName;
},
[types.RECEIVE_ADMIN_EMPLOY_NAME](state, employeeName) {
state.employeeName = employeeName;
},
[types.RECEIVE_ADMIN_AVATAR](state, avatar) {
state.avatar = avatar;
},
@ -167,6 +179,13 @@ const mutations = {
[types.RECEIVE_LOCSUBINVCODE](state, locSubInvCode) {
state.locSubInvCode = locSubInvCode;
},
[types.RECEIVE_LOCINVNAME](state, locInvName) {
state.locInvName = locInvName;
},
[types.RECEIVE_LOCSUBINVNAME](state, locSubInvName) {
state.locSubInvName = locSubInvName;
},
};
export default {

@ -14,3 +14,5 @@ export const RECEIVE_ADMIN_AUTH_RULES = "RECEIVE_ADMIN_AUTH_RULES"; // 权限列
export const RECEIVE_ROUTERS = "RECEIVE_ROUTERS"; // 初始化路由表
export const RECEIVE_LOCINVCODE = "RECEIVE_LOCINVCODE"; // 当前仓库
export const RECEIVE_LOCSUBINVCODE = "RECEIVE_LOCSUBINVCODE"; // 当前分库
export const RECEIVE_LOCINVNAME = "RECEIVE_LOCINVNAME"; // 当前仓库
export const RECEIVE_LOCSUBINVNAME = "RECEIVE_LOCSUBINVNAME"; // 当前分库

@ -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"
@ -401,6 +400,7 @@ import {getLocalBusType, getLocalJoinBusType, getLocalJoinByUser} from "../../ap
import {filterAll, filterAllByLoc, filterAllByUser} from "@/api/basic/invWarehouse";
import dialogInvProduct from "../inventory/DialogInvProduct"
import {filterSubByInv} from "@/api/basic/invSubWarehouse";
import {isBlank} from "@/utils/strUtil";
export default {
name: "idQuery",
@ -440,6 +440,10 @@ export default {
locStorageCode: [
{required: true, message: "请选择当前仓库", trigger: "blur"}
],
invWarehouseCode: [
{required: true, message: "请选择当前分库", trigger: "blur"}
],
},
codeArray: [],
fromOptions: [],
@ -499,7 +503,6 @@ export default {
this.currentRow = {};
this.selectedIndex = "";
this.iCount = 0;
this.$forceUpdate();
this.$refs["dataForm"].validate(valid => {
if (valid) {
if (this.codeArray.length < 1) {
@ -593,7 +596,7 @@ export default {
filterAllByUser()
.then((response) => {
this.storageList = response.data || [];
this.invChange();
this.findSubInvs();
})
.catch(() => {
});
@ -1160,22 +1163,14 @@ export default {
}
},
actionChange(item) {
// console.log("item = " + item);
// if (item == '') {
// this.formData.locStorageCode == null;
// } else {
this.curAction = this.getActionItem(item);
if (this.curAction.storageCode != null)
this.formData.locStorageCode = this.curAction.storageCode;
this.formData.corpName = '';
this.locInChange();
this.findMethod();
// }
},
locInChange(item) {
console.log(item);
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
@ -1196,7 +1195,9 @@ export default {
})
.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;
@ -1244,6 +1250,13 @@ export default {
margin-top: 10px;
}
/**
解决el-input输入框 type=number时输入中文光标上移问题
*/
.el-input__inner {
line-height: 1px !important;
}
</style>

@ -82,10 +82,10 @@
</el-breadcrumb>
</div>
<div class="header-right">
<span style="margin-right: 10px; margin-top: 2px">{{ employName }}</span>
<!-- <span style="margin-right: 10px; margin-top: 2px">{{ username }}</span>-->
<el-dropdown trigger="click">
<!--<i class="el-icon-setting" style="margin-right: 15px"></i>-->
<span>{{ username }}<i class="el-icon-arrow-down el-icon--right"></i></span>
<span>{{ title }}<i class="el-icon-arrow-down el-icon--right"></i></span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item><span @click="changeInv"></span></el-dropdown-item>
<el-dropdown-item><span @click="handlePassword"></span></el-dropdown-item>
@ -263,7 +263,6 @@ import store from "../../store/index";
import {filterAllByUser} from "@/api/basic/invWarehouse";
import {filterSubByInv} from "@/api/basic/invSubWarehouse";
import {updateInv} from "@/api/auth/authAdmin";
import {RECEIVE_LOCINVCODE} from "@/store/mutation-types";
import * as types from "../../store/mutation-types";
export default {
@ -333,6 +332,7 @@ export default {
selInvVisible: false,
locInvName: "",
locSubInvName: "",
title: "udi管理系统",
};
},
components: {
@ -346,9 +346,9 @@ export default {
return this.$route.path;
},
username() {
let username = this.$store.state.admin.userName;
let rUserName = !username ? this.name : username;
return username + "" + this.locInvName + " " + this.locSubInvName + "";
let username = this.$store.getters.employeeName;
return username + "" + this.$store.getters.locInvName + " " + this.$store.getters.locSubInvName + "";
},
isCollapse() {
return false;
@ -426,7 +426,7 @@ 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.userInfo.locSubInvCode = this.subInvList[0].code;
}
@ -438,6 +438,7 @@ export default {
userInfo()
.then((response) => {
if (response.code == 20000) {
this.userInfo = response.data;
this.locInvName = this.userInfo.locInvName;
this.locSubInvName = this.userInfo.locSubInvName;
@ -446,7 +447,10 @@ export default {
} else {
this.$store.commit(types.RECEIVE_LOCINVCODE, this.userInfo.locInvCode);
this.$store.commit(types.RECEIVE_LOCSUBINVCODE, this.userInfo.locSubInvCode);
this.$store.commit(types.RECEIVE_LOCINVNAME, this.locInvName);
this.$store.commit(types.RECEIVE_LOCSUBINVNAME, this.locInvName);
let username = this.$store.getters.employeeName;
this.title = username + "" + this.$store.getters.locInvName + " " + this.$store.getters.locSubInvName + "";
this.getStorage();
}
}
@ -539,6 +543,7 @@ export default {
},
},
created() {
console.log("监听变化。,,,,,,,,,,,,,,,,,,,,,,,,,,,");
this.getBreadcrumb();
this.getCompanyData();
this.getStorage();
@ -548,8 +553,14 @@ export default {
},
watch: {
$route() {
this.getBreadcrumb();
},
'$store.state.admin.userName'() {
this.getUserInfo();
}
},
};
</script>

@ -661,9 +661,10 @@ export default {
this.formData.produceDate = "";
this.formData.expireDate = "";
this.formData.serialNo = "";
if (event != null) {
event.target.select();
}
this.actionEnable = true;
if (event == null) {
} else event.target.select();
this.$refs.inputRef.select();
if (this.$isBlank(this.formData.action)) {
this.$message.warning("请选择单据类型!");
@ -683,6 +684,14 @@ 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);
@ -792,7 +801,7 @@ export default {
this.curRow = row;
},
storageChange(row) {
console.log(row);
this.formData.fromSubInvCode = "";
this.formData.fromCorpId = row.code;
this.formData.fromCorp = row.name;
this.findSubStorageMethod();
@ -967,7 +976,7 @@ export default {
.then((response) => {
this.subInvList = response.data || [];
if (this.subInvList != null && this.subInvList.length == 1) {
this.formData.invWarehouseCode = this.subInvList[0].code;
// this.formData.invWarehouseCode = this.subInvList[0].code;
}
})
.catch(() => {
@ -1161,10 +1170,15 @@ export default {
this.query = Object.assign(this.query, query);
this.query.limit = parseInt(this.query.limit);
this.query.corpOrderId = query.id;
//
// this.getCodeList();
}
this.formData.invWarehouseCode = this.$store.getters.locSubInvCode;
this.formData.locStorageCode = this.$store.getters.locInvCode;
if (this.$isNotBlank(this.formData.locStorageCode)) {
this.findStorageMethod();
}
}

@ -23,6 +23,7 @@
:remote-method="findMethod"
size="mini"
:loading="loading"
@change="corpChange"
>
<el-option
v-for="item in fromOptions"
@ -63,6 +64,7 @@
</el-form-item>
<el-form-item class="query-form-item">
<el-select v-model="filterQuery.invWarehouseCode" placeholder="请选择当前分库" clearable="true"
:disabled="invWarehouseDisabled"
size="mini">
<el-option
v-for="item in subInvList"
@ -169,12 +171,15 @@ import {getBussinessType} from "../../api/basic/bussinessType";
import {getBasicUnitMaintains} from "@/api/basic/basicUnitMaintain";
import {filterUplLocInv} from "@/api/basic/invWarehouse";
import {filterSubByInv} from "@/api/basic/invSubWarehouse";
import {userInfo} from "@/api/auth/login";
import {isBlank} from "@/utils/strUtil";
export default {
data() {
return {
filterQuery: {
invWarehouseCode: null,
invStorageCode: null,
productsName: null,
nameCode: null,
@ -339,7 +344,10 @@ export default {
invChange() {
this.filterQuery.invWarehouseCode = "";
this.subInvList = [];
if (this.filterQuery.invStorageCode != null && this.filterQuery.invStorageCode != "") {
this.invWarehouseDisabled = false;
let query = {
pcode: this.filterQuery.invStorageCode
};
@ -349,14 +357,22 @@ export default {
})
.catch(() => {
});
} else {
this.invWarehouseDisabled = true;
}
},
intentDetail(row) {
this.idQuery = row;
// this.idQuery.supId = null;
this.idQuery.customerId = null;
this.codeDetailVisible = true;
},
corpChange(value) {
if (isBlank(value)) {
this.findMethod();
}
}
,
getBusType() {
let query = {
enabled: true,
@ -385,25 +401,40 @@ export default {
true: "danger",
};
return statusMap[status];
},
},
}
,
}
,
mounted() {
document.body.ondrop = function (event) {
event.preventDefault();
event.stopPropagation();
};
},
}
,
created() {
this.getStorage();
this.getBusType();
this.findMethod();
let query = this.$route.query;
this.filterQuery = Object.assign(this.filterQuery, query);
this.filterQuery.limit = parseInt(this.filterQuery.limit);
//
//
userInfo().then((res) => {
if (res.code === 20000) {
if (!isBlank(res.data.locInvCode)) {
this.filterQuery.invStorageCode = res.data.locInvCode;
this.invChange();
this.filterQuery.invWarehouseCode = res.data.locSubInvCode;
}
this.getList();
},
};
}
}).catch((error) => {
});
}
,
}
;
</script>
<style type="text/scss" lang="scss">

Loading…
Cancel
Save