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(ElementUI);
Vue.use(VueClipboard)
Vue.config.silent = true;
Vue.config.productionTip = false;
Vue.prototype.selectDictLabel = selectDictLabel;
let getUrl = "";

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save