1.修复部分问题,调整添加管理用户的页面

master
x_z 3 years ago
parent d4f89399ee
commit 8e1d868aab

@ -33,6 +33,7 @@ Object.keys(filters).forEach(key => {
Vue.use(allTools); Vue.use(allTools);
Vue.use(ElementUI); Vue.use(ElementUI);
Vue.use(VueClipboard) Vue.use(VueClipboard)
Vue.config.silent = true;
Vue.config.productionTip = false; Vue.config.productionTip = false;
Vue.prototype.selectDictLabel = selectDictLabel; Vue.prototype.selectDictLabel = selectDictLabel;
let getUrl = ""; let getUrl = "";

@ -49,7 +49,7 @@
<div class="itemTag"> <div class="itemTag">
<span>往来信息类型&nbsp;</span> <span>往来信息类型&nbsp;</span>
</div> </div>
<el-select v-model="inputQuery.corpType" placeholder="往来信息" @change="corpTypeChange"> <el-select v-model="inputQuery.corpType" placeholder="往来类型" @change="corpTypeChange">
<el-option <el-option
v-for="item in options" v-for="item in options"
:key="item.value" :key="item.value"
@ -85,14 +85,17 @@
<el-col :span="10" class="el-col"> <el-col :span="10" class="el-col">
<div class="text item"> <div class="text item">
<div class="itemTag"> <div class="itemTag">
<span>特殊单据往来&nbsp;</span> <span>特殊往来&nbsp;</span>
</div> </div>
<el-input <el-select v-model="inputQuery.defaultUnit" :disabled="inputQuery.corpType != '3'"
style="width: 40%" placeholder="请选择">
size="small" <el-option
v-model="inputQuery.defaultUnit" v-for="item in defaultUnitList"
:disabled="inputQuery.corpType != '3'" :key="item.unitId"
></el-input> :label="item.name"
:value="item.unitId">
</el-option>
</el-select>
</div> </div>
</el-col> </el-col>
@ -132,9 +135,9 @@
<el-col :span="12" class="el-col"> <el-col :span="12" class="el-col">
<div class="text item" style="margin-top: 6px"> <div class="text item" style="margin-top: 6px">
<el-checkbox v-model="inputQuery.enable"></el-checkbox> <el-checkbox v-model="inputQuery.enable"></el-checkbox>
<el-checkbox v-model="inputQuery.genUnit" :disabled="inputQuery.corpType !='2'"> <el-checkbox v-model="inputQuery.genUnit" :disabled="inputQuery.corpType !='2'">
</el-checkbox> </el-checkbox>
<el-checkbox v-model="inputQuery.secCheckEnable"></el-checkbox> <el-checkbox v-model="inputQuery.secCheckEnable"></el-checkbox>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
@ -146,6 +149,7 @@
import {filterAll} from "@/api/basic/invWarehouse"; import {filterAll} from "@/api/basic/invWarehouse";
import {getCandidateBussinessType} from "../../api/receipts/bussinessType"; import {getCandidateBussinessType} from "../../api/receipts/bussinessType";
import {getUnitMaintain} from "@/api/receipts/unitMaintain";
export default { export default {
name: "inputQuery", name: "inputQuery",
@ -182,8 +186,8 @@ export default {
label: "特殊往来" label: "特殊往来"
}], }],
twoCheck: false, twoCheck: false,
editDefaultUnit: true editDefaultUnit: true,
defaultUnitList: []
}; };
}, },
methods: { methods: {
@ -207,6 +211,11 @@ export default {
if (type != 2) { if (type != 2) {
this.inputQuery.genUnit = false; this.inputQuery.genUnit = false;
} }
if (type === '3') {
this.getDefaultUnitList();
} else {
this.inputQuery.defaultUnit = null;
}
}, },
// //
getOrderType() { getOrderType() {
@ -221,7 +230,18 @@ export default {
}).catch(() => { }).catch(() => {
}); });
} },
//
getDefaultUnitList() {
let query = {
corpType: 4,
page: 1,
limit: 10000
};
getUnitMaintain(query).then((res) => {
this.defaultUnitList = res.data.list;
})
},
}, },
computed: { computed: {
corpType() { corpType() {
@ -244,6 +264,7 @@ export default {
this.getOrderType(); this.getOrderType();
} }
this.getStorage(); this.getStorage();
this.getDefaultUnitList();
} }
}; };

@ -114,7 +114,7 @@
style="width: 100%"> style="width: 100%">
<el-table-column label="序号" type="index"></el-table-column> <el-table-column label="序号" type="index"></el-table-column>
<el-table-column <el-table-column
prop="employeeName" prop="username"
label="用户名" label="用户名"
min-width="30%"> min-width="30%">
</el-table-column> </el-table-column>

@ -267,7 +267,7 @@ export default {
corpTypeList: [ corpTypeList: [
{ {
value: 1, value: 1,
label: "医院客户" label: "客户"
}, },
{ {
value: 2, value: 2,

@ -5,6 +5,16 @@
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-input v-model="query.userName" placeholder="用户账号"></el-input> <el-input v-model="query.userName" placeholder="用户账号"></el-input>
</el-form-item> </el-form-item>
<el-form-item class="query-form-item">
<el-select v-model="query.customerId" placeholder="请选择">
<el-option
v-for="item in customers"
:key="item.customerId"
:label="item.companyName"
:value="item.customerId">
</el-option>
</el-select>
</el-form-item>
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-select v-model="query.userFlag" placeholder="状态"> <el-select v-model="query.userFlag" placeholder="状态">
<el-option label="全部" value=""></el-option> <el-option label="全部" value=""></el-option>
@ -202,8 +212,8 @@ import {
authAdminDelete, authAdminDelete,
getAdminRoles getAdminRoles
} from "../../../api/auth/authAdmin"; } from "../../../api/auth/authAdmin";
import {getCustomers} from "@/api/auth/customer";
import store from "../../../store/index";
import {isBlank} from "@/utils/strUtil"; import {isBlank} from "@/utils/strUtil";
const formJson = { const formJson = {
@ -242,7 +252,7 @@ export default {
page: 1, page: 1,
limit: 20, limit: 20,
roleId: "", roleId: "",
customerId: store.getters.customerId customerId: null
}, },
list: [], list: [],
total: 0, total: 0,
@ -286,7 +296,8 @@ export default {
{required: true, message: "请选择状态", trigger: "change"} {required: true, message: "请选择状态", trigger: "change"}
] ]
}, },
deleteLoading: false deleteLoading: false,
customers: []
}; };
}, },
methods: { methods: {
@ -300,7 +311,7 @@ export default {
page: 1, page: 1,
limit: 20, limit: 20,
roleId: "", roleId: "",
customerId: store.getters.customerId customerId: null
}; };
this.getList(); this.getList();
}, },
@ -340,6 +351,14 @@ export default {
this.roles = res.data.list || []; this.roles = res.data.list || [];
}); });
}, },
getCustomers() {
let query = {page: 1, limit: 10000};
getCustomers(query).then((res) => {
this.customers = res.data.list;
}).catch((error) => {
this.$message.error("查询客户列表异常");
});
},
// //
resetForm() { resetForm() {
this.$nextTick(() => { this.$nextTick(() => {
@ -499,6 +518,7 @@ export default {
// //
this.getList(); this.getList();
this.getRoles(); this.getRoles();
this.getCustomers();
} }
}; };
</script> </script>

@ -46,7 +46,7 @@
:close-on-press-escape="false" :close-on-press-escape="false"
:visible.sync="formVisible" :visible.sync="formVisible"
:before-close="hideForm" :before-close="hideForm"
width="85%" width="75%"
top="5vh" top="5vh"
> >
<el-form :model="formData" :rules="formRules" ref="dataForm"> <el-form :model="formData" :rules="formRules" ref="dataForm">
@ -87,13 +87,13 @@
<!-- <el-form-item label="额外的规则表达式"> <!-- <el-form-item label="额外的规则表达式">
<el-input type="textarea" v-model="formData.condition"></el-input> <el-input type="textarea" v-model="formData.condition"></el-input>
</el-form-item> --> </el-form-item> -->
<el-form-item label="排序" prop="listorder"> <!--<el-form-item label="排序" prop="listorder">
<el-input <el-input
type="" type=""
v-model="formData.listorder" v-model="formData.listorder"
auto-complete="off" auto-complete="off"
></el-input> ></el-input>
</el-form-item> </el-form-item>-->
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click.native="hideForm">取消</el-button> <el-button @click.native="hideForm">取消</el-button>

@ -39,11 +39,10 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table v-loading="loading" :data="list" style="width: 100%"> <el-table v-loading="loading" :data="list" style="width: 100%">
<el-table-column type="index" width="50"></el-table-column> <el-table-column type="index" width="50" label="序号"></el-table-column>
<el-table-column label="用户账号" prop="userName" fixed></el-table-column> <el-table-column label="用户账号" prop="userName"></el-table-column>
<el-table-column label="用户名称" prop="employeeName" fixed> <el-table-column label="用户名称" prop="employeeName"></el-table-column>
</el-table-column> <el-table-column label="状态">
<el-table-column label="状态" fixed="">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag :type="scope.row.userFlag | statusFilterType">{{ <el-tag :type="scope.row.userFlag | statusFilterType">{{
scope.row.userFlag | statusFilterName scope.row.userFlag | statusFilterName
@ -122,7 +121,7 @@
type="password" type="password"
size="small" size="small"
v-model="formData.passWord" v-model="formData.passWord"
:disabled="true" :disabled="formName === 'add'"
></el-input> ></el-input>
</el-form-item> </el-form-item>
</div> </div>
@ -135,13 +134,15 @@
type="password" type="password"
size="small" size="small"
v-model="formData.checkPassword" v-model="formData.checkPassword"
:disabled="true" :disabled="formName === 'add'"
></el-input> ></el-input>
</el-form-item> </el-form-item>
</div> </div>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<span v-if="formName === 'add'"
style="font-size: 14px; color: red;">新增用户默认密码为 123456登录后请及时修改</span>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click.native="hideForm" size="small">取消</el-button> <el-button @click.native="hideForm" size="small">取消</el-button>
@ -184,22 +185,6 @@ export default {
currentCustomer: "" currentCustomer: ""
}, },
data() { data() {
let validatePass = (rule, value, callback) => {
if (value === "") {
callback(new Error("请输入密码"));
} else {
callback();
}
};
let validatePass2 = (rule, value, callback) => {
if (value === "") {
callback(new Error("请再次输入密码"));
} else if (value !== this.formData.passWord) {
callback(new Error("两次输入密码不一致!"));
} else {
callback();
}
};
return { return {
roles: [], roles: [],
query: { query: {
@ -232,21 +217,6 @@ export default {
formRules: {}, formRules: {},
addRules: { addRules: {
userName: [{required: true, message: "请输入姓名", trigger: "blur"}], userName: [{required: true, message: "请输入姓名", trigger: "blur"}],
passWord: [
{required: true, message: "请输入密码", trigger: "blur"},
{validator: validatePass, trigger: "blur"}
],
checkPassword: [
{
required: true,
message: "请再次输入密码",
trigger: "blur"
},
{validator: validatePass2, trigger: "blur"}
],
userFlag: [
{required: true, message: "请选择状态", trigger: "change"}
]
}, },
editRules: { editRules: {
userName: [{required: true, message: "请输入姓名", trigger: "blur"}], userName: [{required: true, message: "请输入姓名", trigger: "blur"}],
@ -359,44 +329,51 @@ export default {
} }
}, },
formSubmit() { formSubmit() {
this.$refs["dataForm"].validate((valid) => { if (this.formName === 'add') {
if (valid) { this.formData.passWord = '123456';
this.formLoading = true; this.formData.checkPassword = this.formData.passWord;
} else {
if (this.formData.passWord != this.formData.checkPassword) {
this.$message.error("两次输入的密码不同!");
return
}
}
this.formLoading = true;
this.formData.userFlag = 1; this.formData.userFlag = 1;
this.formData.roles = this.userInfo.roles; this.formData.roles = this.userInfo.roles;
this.formData.customerId = this.currentCustomer; this.formData.customerId = this.currentCustomer;
let data = Object.assign({}, this.formData); let data = Object.assign({}, this.formData);
let savequery = { let savequery = {
id: this.formData.id, id: this.formData.id,
userFlag: 1, userFlag: 1,
roles: this.userInfo.roles, roles: this.userInfo.roles,
customerId: this.currentCustomer, customerId: this.currentCustomer,
passWord: this.formData.passWord, passWord: this.formData.passWord,
userName: this.formData.userName, userName: this.formData.userName,
employeeName: this.formData.employeeName employeeName: this.formData.employeeName,
}; checkPassword: this.formData.checkPassword
authAdminSave(savequery, this.formName).then((response) => { };
this.formLoading = false;
if (response.code !== 20000) { authAdminSave(savequery, this.formName).then((response) => {
this.$message.error(response.message); this.formLoading = false;
return false; if (response.code !== 20000) {
} this.$message.error(response.message);
this.$message.success("操作成功"); return false;
this.formVisible = false;
if (this.formName === "add") {
//
if (response.data && response.data.id) {
data.id = response.data.id;
this.list.unshift(data);
}
} else {
this.list.splice(this.index, 1, data);
}
//
this.resetForm();
});
} }
this.$message.success("操作成功");
this.formVisible = false;
if (this.formName === "add") {
//
if (response.data && response.data.id) {
data.id = response.data.id;
this.list.unshift(data);
}
} else {
this.list.splice(this.index, 1, data);
}
//
this.resetForm();
}); });
}, },
// //
@ -459,7 +436,7 @@ export default {
this.query.customerId = this.currentCustomer; this.query.customerId = this.currentCustomer;
this.getList(); this.getList();
if (this.$store.getters.customerId == 110) { if (this.$store.getters.customerId == 110) {
this.addEnable = false; this.addEnable = true;
} }
}, },

@ -54,6 +54,7 @@
</el-table-column> </el-table-column>
<el-table-column label="更新时间" prop="update_time" width="180"></el-table-column> <el-table-column label="更新时间" prop="update_time" width="180"></el-table-column>
<el-table-column label="所属客户" prop="customerName" width="240"></el-table-column> <el-table-column label="所属客户" prop="customerName" width="240"></el-table-column>
<el-table-column label="单据类型" prop="bussinessTypeName" width="240"></el-table-column>
<el-table-column label="备注" prop="remark"></el-table-column> <el-table-column label="备注" prop="remark"></el-table-column>
<el-table-column label="操作" fixed="right" width="250"> <el-table-column label="操作" fixed="right" width="250">
<template slot-scope="scope"> <template slot-scope="scope">
@ -117,7 +118,7 @@
<span>模板名称</span> <span>模板名称</span>
</div> </div>
</el-col> </el-col>
<el-col :span="5"> <el-col :span="6">
<el-form-item prop="name"> <el-form-item prop="name">
<el-input v-model="formData.name" auto-complete="off" :disabled="false"></el-input> <el-input v-model="formData.name" auto-complete="off" :disabled="false"></el-input>
</el-form-item> </el-form-item>
@ -134,6 +135,7 @@
filterable filterable
clearable clearable
remote remote
@change="changeCustomer"
reserve-keyword reserve-keyword
placeholder="请输入关键词" placeholder="请输入关键词"
:remote-method="getCustomerList" :remote-method="getCustomerList"
@ -147,19 +149,42 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="2"> <el-col :span="2">
<div class="ao-text"> <div class="ao-text">
<span>备注</span> <span>模板类型</span>
</div> </div>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="6">
<el-form-item prop="module"> <el-form-item prop="module">
<el-select v-model="formData.module" placeholder="模板类型"> <el-select v-model="formData.module" placeholder="模板类型">
<el-option label="单据" value="2"></el-option> <el-option label="单据" value="2"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="2">
<div class="ao-text">
<span>单据类型</span>
</div>
</el-col>
<el-col :span="6">
<el-form-item prop="module">
<el-select v-model="formData.action" :disabled="enableAction" placeholder="单据类型">
<el-option
v-for="item in actions"
:key="item.action"
:label="item.name"
:value="item.action"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="2"> <el-col :span="2">
<div class="ao-text"> <div class="ao-text">
@ -195,7 +220,8 @@
> >
<el-button slot="trigger" size="small" type="primary" :disabled="uploadDisabled">选取文件 <el-button slot="trigger" size="small" type="primary" :disabled="uploadDisabled">选取文件
</el-button> </el-button>
<div slot="tip" class="el-upload__tip" v-if="formData.path==''"> jasper 2 <div slot="tip" class="el-upload__tip" v-if="formData.path==''"> jasper
2
MB MB
</div> </div>
<div slot="tip" class="el-upload__tip">{{ formData.path }}</div> <div slot="tip" class="el-upload__tip">{{ formData.path }}</div>
@ -320,12 +346,14 @@ import {saveAs} from 'file-saver';
import {demoPrint} from "@/api/itextpdf/itextpdf"; import {demoPrint} from "@/api/itextpdf/itextpdf";
import {isBlank} from "@/utils/strUtil"; import {isBlank} from "@/utils/strUtil";
import {getCompanyList} from "@/api/warehouse/company"; import {getCompanyList} from "@/api/warehouse/company";
import {getBussinessType} from "@/api/basic/bussinessType";
const formJson = { const formJson = {
id: "", id: "",
name: "", name: "",
type: "2", type: "2",
module: null, module: null,
action: null,
param: "", param: "",
path: "", path: "",
jrxmlPath: null, jrxmlPath: null,
@ -407,7 +435,9 @@ export default {
uploadDisabled: false, uploadDisabled: false,
moduleLoading: false, moduleLoading: false,
moduleNameMap: {0: "标签", 1: "报表", 2: "单据"}, moduleNameMap: {0: "标签", 1: "报表", 2: "单据"},
customerList: [] customerList: [],
actions: [],
enableAction: true
}; };
}, },
methods: { methods: {
@ -441,12 +471,12 @@ export default {
this.loading = false; this.loading = false;
this.list = response.data.list || []; this.list = response.data.list || [];
if (this.list.length > 0) { if (this.list.length > 0) {
this.list.forEach(item =>{ this.list.forEach(item => {
if (isBlank(item.customerId)) { if (isBlank(item.customerId)) {
item.customerName = '公共模板'; item.customerName = '公共模板';
} else { } else {
this.customerList.forEach(customer => { this.customerList.forEach(customer => {
if (item.customerId === customer.customerId){ if (item.customerId === customer.customerId) {
item.customerName = customer.companyName; item.customerName = customer.companyName;
} }
}); });
@ -592,6 +622,14 @@ export default {
this.formData = Object.assign({}, row); this.formData = Object.assign({}, row);
this.formData.module = row.module + ""; this.formData.module = row.module + "";
} }
if (!isBlank(row.customerId)) {
this.enableAction = false;
this.getActions(row.customerId);
} else {
this.enableAction = true;
this.actions = [];
}
this.index = index; this.index = index;
this.formName = "update"; this.formName = "update";
this.uploadDisabled = true; this.uploadDisabled = true;
@ -806,6 +844,25 @@ export default {
} }
}); });
}, },
getActions(customerId) {
let query = {
customerId: customerId === null ? this.formData.customerId : customerId,
page: 1,
limit: 10000
}
getBussinessType(query).then((res) => {
this.actions = res.data.list;
});
},
changeCustomer() {
if (!isBlank(this.formData.customerId)) {
this.formData.action = null;
this.getActions();
this.enableAction = false;
} else {
this.enableAction = true;
}
},
}, },
filters: { filters: {
paramStatusFilterType(paramStatus) { paramStatusFilterType(paramStatus) {
@ -830,6 +887,7 @@ export default {
this.getPDFModuleNameList(); this.getPDFModuleNameList();
this.getModuleList(); this.getModuleList();
this.getCustomerList(); this.getCustomerList();
this.getActions();
this.uploadUrl = BASE_URL + "/udiwms/upload/pdf/template/jasper"; this.uploadUrl = BASE_URL + "/udiwms/upload/pdf/template/jasper";
this.uploadJrxmlUrl = BASE_URL + "/udiwms/upload/pdf/template/jrxml"; this.uploadJrxmlUrl = BASE_URL + "/udiwms/upload/pdf/template/jrxml";
this.headers = { this.headers = {

@ -541,7 +541,7 @@ export default {
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
this.loading = true; this.loading = true;
if (this.fileList.length === 0) { if (this.inputQuery.licenseUrl === null) {
this.$message.error("请上传营业执照电子档案!") this.$message.error("请上传营业执照电子档案!")
return; return;
} }
@ -619,6 +619,10 @@ export default {
}, 1000); }, 1000);
}, },
handleChange(value) { handleChange(value) {
if (value[0] === "" || value[1] === "" || value[2] === "") {
this.$message.error("请选择所属地区");
return;
}
this.inputQuery.area = CodeToText[value[0]]; this.inputQuery.area = CodeToText[value[0]];
if (CodeToText[value[1]] != null && CodeToText[value[1]] != "" if (CodeToText[value[1]] != null && CodeToText[value[1]] != ""
&& CodeToText[value[1]] != "undefined") { && CodeToText[value[1]] != "undefined") {

@ -359,6 +359,7 @@ export default {
resetUnitQuery() { resetUnitQuery() {
this.unitlist = []; this.unitlist = [];
this.unitquery = {key: "", page: 1, limit: 20}; this.unitquery = {key: "", page: 1, limit: 20};
this.getUnitList();
}, },
getUnitList(page) { getUnitList(page) {
this.loading = true; this.loading = true;

Loading…
Cancel
Save