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

fengcang
anthonyywj2 3 years ago
parent 6899706ec5
commit 07129bdeff

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

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

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

@ -661,9 +661,10 @@ export default {
this.formData.produceDate = ""; this.formData.produceDate = "";
this.formData.expireDate = ""; this.formData.expireDate = "";
this.formData.serialNo = ""; this.formData.serialNo = "";
if (event != null) {
event.target.select();
}
this.actionEnable = true; this.actionEnable = true;
if (event == null) {
} else event.target.select();
this.$refs.inputRef.select(); this.$refs.inputRef.select();
if (this.$isBlank(this.formData.action)) { if (this.$isBlank(this.formData.action)) {
this.$message.warning("请选择单据类型!"); this.$message.warning("请选择单据类型!");
@ -683,6 +684,14 @@ 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);
@ -792,7 +801,7 @@ export default {
this.curRow = row; this.curRow = row;
}, },
storageChange(row) { storageChange(row) {
console.log(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();
@ -967,7 +976,7 @@ export default {
.then((response) => { .then((response) => {
this.subInvList = response.data || []; 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; // this.formData.invWarehouseCode = this.subInvList[0].code;
} }
}) })
.catch(() => { .catch(() => {
@ -1161,10 +1170,15 @@ export default {
this.query = Object.assign(this.query, query); this.query = Object.assign(this.query, query);
this.query.limit = parseInt(this.query.limit); this.query.limit = parseInt(this.query.limit);
this.query.corpOrderId = query.id; this.query.corpOrderId = query.id;
// //
// this.getCodeList(); // 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" :remote-method="findMethod"
size="mini" size="mini"
:loading="loading" :loading="loading"
@change="corpChange"
> >
<el-option <el-option
v-for="item in fromOptions" v-for="item in fromOptions"
@ -63,6 +64,7 @@
</el-form-item> </el-form-item>
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-select v-model="filterQuery.invWarehouseCode" placeholder="请选择当前分库" clearable="true" <el-select v-model="filterQuery.invWarehouseCode" placeholder="请选择当前分库" clearable="true"
:disabled="invWarehouseDisabled"
size="mini"> size="mini">
<el-option <el-option
v-for="item in subInvList" v-for="item in subInvList"
@ -169,12 +171,15 @@ import {getBussinessType} from "../../api/basic/bussinessType";
import {getBasicUnitMaintains} from "@/api/basic/basicUnitMaintain"; import {getBasicUnitMaintains} from "@/api/basic/basicUnitMaintain";
import {filterUplLocInv} from "@/api/basic/invWarehouse"; import {filterUplLocInv} from "@/api/basic/invWarehouse";
import {filterSubByInv} from "@/api/basic/invSubWarehouse"; import {filterSubByInv} from "@/api/basic/invSubWarehouse";
import {userInfo} from "@/api/auth/login";
import {isBlank} from "@/utils/strUtil";
export default { export default {
data() { data() {
return { return {
filterQuery: { filterQuery: {
invWarehouseCode: null,
invStorageCode: null, invStorageCode: null,
productsName: null, productsName: null,
nameCode: null, nameCode: null,
@ -339,7 +344,10 @@ export default {
invChange() { invChange() {
this.filterQuery.invWarehouseCode = "";
this.subInvList = []; this.subInvList = [];
if (this.filterQuery.invStorageCode != null && this.filterQuery.invStorageCode != "") {
this.invWarehouseDisabled = false;
let query = { let query = {
pcode: this.filterQuery.invStorageCode pcode: this.filterQuery.invStorageCode
}; };
@ -349,14 +357,22 @@ export default {
}) })
.catch(() => { .catch(() => {
}); });
} else {
this.invWarehouseDisabled = true;
}
}, },
intentDetail(row) { intentDetail(row) {
this.idQuery = row; this.idQuery = row;
// this.idQuery.supId = null;
this.idQuery.customerId = null; this.idQuery.customerId = null;
this.codeDetailVisible = true; this.codeDetailVisible = true;
}, },
corpChange(value) {
if (isBlank(value)) {
this.findMethod();
}
}
,
getBusType() { getBusType() {
let query = { let query = {
enabled: true, enabled: true,
@ -385,25 +401,40 @@ export default {
true: "danger", true: "danger",
}; };
return statusMap[status]; return statusMap[status];
}, }
}, ,
}
,
mounted() { mounted() {
document.body.ondrop = function (event) { document.body.ondrop = function (event) {
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
}; };
}, }
,
created() { created() {
this.getStorage(); this.getStorage();
this.getBusType();
this.findMethod(); this.findMethod();
let query = this.$route.query; let query = this.$route.query;
this.filterQuery = Object.assign(this.filterQuery, query); this.filterQuery = Object.assign(this.filterQuery, query);
this.filterQuery.limit = parseInt(this.filterQuery.limit); 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(); this.getList();
}, }
}; }).catch((error) => {
});
}
,
}
;
</script> </script>
<style type="text/scss" lang="scss"> <style type="text/scss" lang="scss">

Loading…
Cancel
Save