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

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

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

Loading…
Cancel
Save