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

fengcang
anthonyywj2 3 years ago
parent 6899706ec5
commit 07129bdeff

@ -1,6 +1,6 @@
import { userInfo, loginName, logout } from "../../api/auth/login"; import {userInfo, loginName, logout} from "../../api/auth/login";
import * as types from "../mutation-types"; import * as types from "../mutation-types";
import { constantRouterMap } from "../../router"; import {constantRouterMap} from "../../router";
import { import {
getToken, getToken,
setToken, setToken,
@ -10,20 +10,22 @@ import {
removeAdminId removeAdminId
} 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 = {
adminId: getAdminId(), // id adminId: getAdminId(), // id
userName: "", // 昵称 userName: "", // 昵称
employeeName:null, employeeName: null,
avatar: "", // 头像 avatar: "", // 头像
token: getToken(), // 登录token token: getToken(), // 登录token
authRules: [], // 权限列表 authRules: [], // 权限列表
routers: constantRouterMap, // 路由列表 routers: constantRouterMap, // 路由列表
locInvCode:"", locInvCode: "",
locSubInvCode:"" locSubInvCode: "",
locInvName: "",
locSubInvName: ""
}; };
// getters // getters
@ -35,21 +37,23 @@ const getters = {
token: state => state.token, token: state => state.token,
authRules: state => state.authRules, authRules: state => state.authRules,
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
const actions = { const actions = {
// 用户名登录 // 用户名登录
loginName({ commit }, userInfo) { loginName({commit}, userInfo) {
const userName = userInfo.userName ? userInfo.userName.trim() : ""; const userName = userInfo.userName ? userInfo.userName.trim() : "";
const pwd = userInfo.pwd ? userInfo.pwd : ""; const pwd = userInfo.pwd ? userInfo.pwd : "";
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
loginName(userName, pwd) loginName(userName, pwd)
.then(response => { .then(response => {
console.log(response); console.log(response);
if (response.code!=20000) { if (response.code != 20000) {
Message({ Message({
message: response.message, message: response.message,
type: "error", type: "error",
@ -68,7 +72,7 @@ const actions = {
}); });
}); });
}, },
userInfo({ commit }) { userInfo({commit}) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
userInfo() userInfo()
.then(response => { .then(response => {
@ -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);
@ -88,7 +93,7 @@ const actions = {
}); });
}, },
// 登出 // 登出
loginOut({ commit }) { loginOut({commit}) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
logout() logout()
.then(() => { .then(() => {
@ -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 => {
@ -106,13 +113,15 @@ const actions = {
}, },
// 前端 登出 // 前端 登出
fedLogout({ commit }) { fedLogout({commit}) {
return new Promise(resolve => { return new Promise(resolve => {
commit(types.RECEIVE_ADMIN_ID, ""); commit(types.RECEIVE_ADMIN_ID, "");
commit(types.RECEIVE_ADMIN_TOKEN, ""); commit(types.RECEIVE_ADMIN_TOKEN, "");
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();
}); });
}, },
@ -122,8 +131,8 @@ const actions = {
* @param data * @param data
* @returns {Promise} * @returns {Promise}
*/ */
filterRouter({ commit }, data) { filterRouter({commit}, data) {
const { accessedRouters } = data; const {accessedRouters} = data;
if (accessedRouters && accessedRouters.length > 0) { if (accessedRouters && accessedRouters.length > 0) {
commit(types.RECEIVE_ROUTERS, accessedRouters); commit(types.RECEIVE_ROUTERS, accessedRouters);
} }
@ -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();
}
} }

@ -1,166 +1,168 @@
<template> <template>
<div> <div>
<el-card> <el-card>
<el-form :inline="true" :model="filterQuery" size="mini"> <el-form :inline="true" :model="filterQuery" size="mini">
<el-row style="width: 100%"> <el-row style="width: 100%">
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-input v-model="filterQuery.nameCode" placeholder="产品标识DI" clearable></el-input> <el-input v-model="filterQuery.nameCode" placeholder="产品标识DI" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-input v-model="filterQuery.productsName" placeholder="产品名称" clearable></el-input> <el-input v-model="filterQuery.productsName" placeholder="产品名称" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-input v-model="filterQuery.batchNo" placeholder="批次号" clearable></el-input> <el-input v-model="filterQuery.batchNo" placeholder="批次号" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-select <el-select
v-model="filterQuery.supId" v-model="filterQuery.supId"
filterable filterable
remote remote
clearable="true" clearable="true"
reserve-keyword reserve-keyword
placeholder="请输入供应商名称" placeholder="请输入供应商名称"
:remote-method="findMethod" :remote-method="findMethod"
size="mini" size="mini"
:loading="loading" :loading="loading"
> @change="corpChange"
<el-option >
v-for="item in fromOptions" <el-option
:key="item.name" v-for="item in fromOptions"
:label="item.name" :key="item.name"
:value="item.erpId" :label="item.name"
> :value="item.erpId"
<span style="float: left">{{ item.name }}</span> >
</el-option> <span style="float: left">{{ item.name }}</span>
</el-select> </el-option>
</el-form-item> </el-select>
</el-form-item>
</el-row> </el-row>
<el-row style="width: 100%"> <el-row style="width: 100%">
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-input v-model="filterQuery.ggxh" placeholder="规格型号" clearable></el-input> <el-input v-model="filterQuery.ggxh" placeholder="规格型号" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-input v-model="filterQuery.zczbhhzbapzbh" placeholder="批准文号" clearable></el-input> <el-input v-model="filterQuery.zczbhhzbapzbh" placeholder="批准文号" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-input v-model="filterQuery.ylqxzcrbarmc" placeholder="生产厂家" clearable></el-input> <el-input v-model="filterQuery.ylqxzcrbarmc" placeholder="生产厂家" clearable></el-input>
</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.invStorageCode" placeholder="请选择当前仓库" clearable="true" <el-select v-model="filterQuery.invStorageCode" placeholder="请选择当前仓库" clearable="true"
@change="invChange" @change="invChange"
size="mini"> size="mini">
<el-option <el-option
v-for="item in storageList" v-for="item in storageList"
:key="item.name" :key="item.name"
:label="item.name" :label="item.name"
:value="item.code"> :value="item.code">
<span style="float: left">{{ item.name }}</span> <span style="float: left">{{ item.name }}</span>
</el-option> </el-option>
</el-select> </el-select>
</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"
size="mini"> :disabled="invWarehouseDisabled"
<el-option size="mini">
v-for="item in subInvList" <el-option
:key="item.name" v-for="item in subInvList"
:label="item.name" :key="item.name"
:value="item.code"> :label="item.name"
<span style="float: left">{{ item.name }}</span> :value="item.code">
</el-option> <span style="float: left">{{ item.name }}</span>
</el-select> </el-option>
</el-form-item> </el-select>
<el-form-item> </el-form-item>
<el-button-group> <el-form-item>
<el-button <el-button-group>
type="primary" <el-button
icon="el-icon-refresh" type="primary"
@click="onReset" icon="el-icon-refresh"
></el-button> @click="onReset"
<el-button type="primary" icon="search" @click="onSubmit" ></el-button>
>查询 <el-button type="primary" icon="search" @click="onSubmit"
</el-button >查询
> </el-button
</el-button-group> >
</el-form-item> </el-button-group>
</el-row> </el-form-item>
</el-form> </el-row>
<el-table v-loading="loading" :data="list" style="width: 100%"> </el-form>
<el-table-column label="序号" type="index"></el-table-column> <el-table v-loading="loading" :data="list" style="width: 100%">
<el-table-column label="产品标识" prop="nameCode" width="120"></el-table-column> <el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="产品名称" prop="cpmctymc" width="180"> <el-table-column label="产品标识" prop="nameCode" width="120"></el-table-column>
</el-table-column> <el-table-column label="产品名称" prop="cpmctymc" width="180">
<el-table-column label="规格型号" prop="ggxh" width="180" show-overflow-tooltip> </el-table-column>
</el-table-column> <el-table-column label="规格型号" prop="ggxh" width="180" show-overflow-tooltip>
<el-table-column label="批次号" prop="batchNo" width="120"></el-table-column> </el-table-column>
<el-table-column label="生产日期" prop="productionDate" width="120"></el-table-column> <el-table-column label="批次号" prop="batchNo" width="120"></el-table-column>
<el-table-column label="失效日期" prop="expireDate" width="120"></el-table-column> <el-table-column label="生产日期" prop="productionDate" width="120"></el-table-column>
<el-table-column label="入库数量" prop="inCount" width="120"></el-table-column> <el-table-column label="失效日期" prop="expireDate" width="120"></el-table-column>
<el-table-column label="出库数量" prop="outCount" width="120"></el-table-column> <el-table-column label="入库数量" prop="inCount" width="120"></el-table-column>
<el-table-column label="出库数量" prop="outCount" width="120"></el-table-column>
<el-table-column label="结余数量" prop="reCount" width="120"> <el-table-column label="结余数量" prop="reCount" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
{{ (scope.row.inCount - scope.row.outCount) }} {{ (scope.row.inCount - scope.row.outCount) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="生产厂家" prop="ylqxzcrbarmc" v-if="showSup" show-overflow-tooltip <el-table-column label="生产厂家" prop="ylqxzcrbarmc" v-if="showSup" show-overflow-tooltip
width="120"></el-table-column> width="120"></el-table-column>
<el-table-column label="供应商" prop="companyName" v-if="showSup" show-overflow-tooltip <el-table-column label="供应商" prop="companyName" v-if="showSup" show-overflow-tooltip
width="120"></el-table-column> width="120"></el-table-column>
<el-table-column label="仓库" prop="invStorageName" v-if="showSup" <el-table-column label="仓库" prop="invStorageName" v-if="showSup"
show-overflow-tooltip width="120"></el-table-column> show-overflow-tooltip width="120"></el-table-column>
<el-table-column label="分库" prop="invSubStorageName" v-if="showSup" <el-table-column label="分库" prop="invSubStorageName" v-if="showSup"
show-overflow-tooltip width="120"></el-table-column> show-overflow-tooltip width="120"></el-table-column>
<el-table-column label="操作" width="120" fixed="right"> <el-table-column label="操作" width="120" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
type="text" type="text"
size="small" size="small"
@click.native.stop="intentDetail(scope.row)" @click.native.stop="intentDetail(scope.row)"
>详情 >详情
</el-button </el-button
> >
<el-button <el-button
type="text" type="text"
size="small" size="small"
@click.native.stop="deleteDialog(scope.row.id)" @click.native.stop="deleteDialog(scope.row.id)"
>删除 >删除
</el-button </el-button
> >
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-card> </el-card>
<el-dialog <el-dialog
title="库存详情" title="库存详情"
:visible.sync="codeDetailVisible" :visible.sync="codeDetailVisible"
width="85%" width="85%"
v-if="codeDetailVisible" v-if="codeDetailVisible"
> >
<codeDetail <codeDetail
:idQuery="idQuery" :idQuery="idQuery"
v-on:closeDetailDialog="closeDetailDialog" v-on:closeDetailDialog="closeDetailDialog"
></codeDetail> ></codeDetail>
</el-dialog> </el-dialog>
<el-pagination <el-pagination
:page-size="filterQuery.limit" :page-size="filterQuery.limit"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
layout="prev, pager, next" layout="prev, pager, next"
:total="total" :total="total"
></el-pagination> ></el-pagination>
</div> </div>
</template> </template>
<script> <script>
import { import {
filterProducts, filterProducts,
deleteProducts, deleteProducts,
} from "../../api/inventory/InvProducts"; } from "../../api/inventory/InvProducts";
import draggable from "vuedraggable"; import draggable from "vuedraggable";
import codeDetail from "./InvProductsDetail"; import codeDetail from "./InvProductsDetail";
@ -169,241 +171,270 @@ 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: {
invStorageCode: null, invWarehouseCode: null,
productsName: null, invStorageCode: null,
nameCode: null, productsName: null,
relIdFk: null, nameCode: null,
batchNo: null, relIdFk: null,
page: 1, batchNo: null,
limit: 20, page: 1,
customerId: null, limit: 20,
supId: null, customerId: null,
unitFk: null, supId: null,
}, unitFk: null,
detailQuery: { },
code: null, detailQuery: {
productIdFk: null, code: null,
page: 1, productIdFk: null,
limit: 20, page: 1,
}, limit: 20,
list: [], },
storageList: [], list: [],
subInvList: [], storageList: [],
codeDetailVisible: false, subInvList: [],
total: 0, codeDetailVisible: false,
loading: true, total: 0,
index: null, loading: true,
dialogTableVisible: false, index: null,
invWarehouseDisabled: true, dialogTableVisible: false,
formLoading: false, invWarehouseDisabled: true,
dialogVisible: false, formLoading: false,
deleteLoading: false, dialogVisible: false,
busTypes: [], deleteLoading: false,
idQuery: null, busTypes: [],
showSup: false, idQuery: null,
fromOptions: [], showSup: false,
}; fromOptions: [],
};
},
components: {
draggable,
codeDetail,
},
methods: {
onReset() {
this.$router.push({
path: "",
});
this.filterQuery = {
productsName: null,
nameCode: null,
relIdFk: null,
batchNo: null,
customerId: null,
unitFk: null,
supId: null,
invWarehouseCode: null,
invStorageCode: null,
page: 1,
limit: 20,
};
this.invChange();
this.getList();
}, },
components: { onSubmit() {
draggable, this.loading = true;
codeDetail, this.getList();
},
handleSizeChange(val) {
this.filterQuery.limit = val;
this.getList();
},
handleCurrentChange(val) {
this.filterQuery.page = val;
this.getList();
},
handleUnitClick(row) {
this.curIndex = row.id;
this.dialogTableVisible = true;
},
closeDetailDialog(val) {
this.codeDetailVisible = false;
}, },
methods: {
onReset() {
this.$router.push({
path: "",
});
this.filterQuery = {
productsName: null,
nameCode: null,
relIdFk: null,
batchNo: null,
customerId: null,
unitFk: null,
supId: null,
invWarehouseCode: null,
invStorageCode: null,
page: 1,
limit: 20,
};
this.invChange();
this.getList();
},
onSubmit() {
this.loading = true;
this.getList();
},
handleSizeChange(val) {
this.filterQuery.limit = val;
this.getList();
},
handleCurrentChange(val) {
this.filterQuery.page = val;
this.getList();
},
handleUnitClick(row) {
this.curIndex = row.id;
this.dialogTableVisible = true;
},
closeDetailDialog(val) {
this.codeDetailVisible = false;
},
closeDialog() { closeDialog() {
this.getList(); this.getList();
}, },
getList() { getList() {
this.loading = true; this.loading = true;
this.filterQuery.customerId = store.getters.customerId; this.filterQuery.customerId = store.getters.customerId;
filterProducts(this.filterQuery) filterProducts(this.filterQuery)
.then((response) => { .then((response) => {
this.showSup = response.data.showSup; this.showSup = response.data.showSup;
this.loading = false; this.loading = false;
this.list = response.data.list || []; this.list = response.data.list || [];
this.total = response.data.total || 0; this.total = response.data.total || 0;
}) })
.catch(() => { .catch(() => {
this.loading = false; this.loading = false;
this.list = []; this.list = [];
this.total = 0; this.total = 0;
}); });
}, },
deleteOrders(data) { deleteOrders(data) {
this.loading = true; this.loading = true;
let query = { let query = {
id: data, id: data,
}
deleteProducts(query)
.then((response) => {
if (response.code == 20000) {
this.getList();
this.$message({
type: "success",
message: "删除成功!",
});
} else {
this.$message.error(response.message);
} }
deleteProducts(query)
.then((response) => {
if (response.code == 20000) {
this.getList();
this.$message({
type: "success",
message: "删除成功!",
});
} else {
this.$message.error(response.message);
}
}) })
.catch(() => { .catch(() => {
}); });
}, },
deleteDialog(rowId) { deleteDialog(rowId) {
this.$confirm("此操作将永久删除该订单, 是否继续?", "提示", { this.$confirm("此操作将永久删除该订单, 是否继续?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",
}) })
.then(() => { .then(() => {
this.deleteOrders(rowId); this.deleteOrders(rowId);
}) })
.catch(() => { .catch(() => {
}); });
}, },
findMethod(query) { findMethod(query) {
this.fromOptions = []; this.fromOptions = [];
let cQuery = { let cQuery = {
key: query, key: query,
customerName: query, customerName: query,
page: 1, page: 1,
limit: 20 limit: 20
}; };
getBasicUnitMaintains(cQuery) getBasicUnitMaintains(cQuery)
.then((response) => { .then((response) => {
this.loading = false; this.loading = false;
this.fromOptions = response.data.page.list || []; this.fromOptions = response.data.page.list || [];
}) })
.catch(() => { .catch(() => {
this.loading = false; this.loading = false;
}); });
}, },
getStorage() { getStorage() {
this.storageList = []; this.storageList = [];
filterUplLocInv() filterUplLocInv()
.then((response) => { .then((response) => {
this.storageList = response.data || []; this.storageList = response.data || [];
}) })
.catch(() => { .catch(() => {
}); });
}, },
invChange() { invChange() {
this.subInvList = []; this.filterQuery.invWarehouseCode = "";
let query = { this.subInvList = [];
pcode: this.filterQuery.invStorageCode if (this.filterQuery.invStorageCode != null && this.filterQuery.invStorageCode != "") {
}; this.invWarehouseDisabled = false;
filterSubByInv(query) let query = {
.then((response) => { pcode: this.filterQuery.invStorageCode
this.subInvList = response.data || []; };
}) filterSubByInv(query)
.catch(() => { .then((response) => {
}); this.subInvList = response.data || [];
}, })
intentDetail(row) { .catch(() => {
});
} else {
this.invWarehouseDisabled = true;
}
},
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;
},
getBusType() {
let query = {
enabled: true,
};
getBussinessType(query)
.then((response) => {
this.busTypes = response.data.list || [];
this.filterQuery.billAction = this.busTypes[0].action;
// this.getList();
})
.catch(() => {
});
},
getActionName(action) {
for (let i = 0; i < this.busTypes.length; i++) {
if (this.busTypes[i].action === action) {
return this.busTypes[i].name;
}
}
},
}, },
filters: { corpChange(value) {
statusFilterType(status) { if (isBlank(value)) {
const statusMap = { this.findMethod();
false: "success", }
true: "danger", }
}; ,
return statusMap[status]; getBusType() {
}, let query = {
enabled: true,
};
getBussinessType(query)
.then((response) => {
this.busTypes = response.data.list || [];
this.filterQuery.billAction = this.busTypes[0].action;
// this.getList();
})
.catch(() => {
});
}, },
mounted() { getActionName(action) {
document.body.ondrop = function (event) { for (let i = 0; i < this.busTypes.length; i++) {
event.preventDefault(); if (this.busTypes[i].action === action) {
event.stopPropagation(); return this.busTypes[i].name;
}; }
}
}, },
created() { },
this.getStorage(); filters: {
this.getBusType(); statusFilterType(status) {
this.findMethod(); const statusMap = {
let query = this.$route.query; false: "success",
this.filterQuery = Object.assign(this.filterQuery, query); true: "danger",
this.filterQuery.limit = parseInt(this.filterQuery.limit); };
// return statusMap[status];
}
,
}
,
mounted() {
document.body.ondrop = function (event) {
event.preventDefault();
event.stopPropagation();
};
}
,
created() {
this.getStorage();
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(); this.getList();
}, }
}; }).catch((error) => {
});
}
,
}
;
</script> </script>
<style type="text/scss" lang="scss"> <style type="text/scss" lang="scss">

Loading…
Cancel
Save