Commit 9ad7d864 by fukai

更新admin

parent c47e213b
...@@ -213,7 +213,7 @@ ...@@ -213,7 +213,7 @@
</c-col> </c-col>
<c-col :span="20"> <c-col :span="20">
<el-form-item :label="$t('statics.所属全辖机构')" :label-width="formLabelWidth" prop="qxbranch"> <el-form-item :label="$t('statics.所属全辖机构')" :label-width="formLabelWidth" prop="qxbranch" :rules="[{required: dataForm.branch != dataForm.upbranch, message: this.$t('components.必输项') }]">
<c-input v-model="dataForm.qxbranch" autocomplete="off" placeholder="" > <c-input v-model="dataForm.qxbranch" autocomplete="off" placeholder="" >
</c-input> </c-input>
</el-form-item> </el-form-item>
......
...@@ -177,7 +177,7 @@ export const Pattern = { ...@@ -177,7 +177,7 @@ export const Pattern = {
{ "max": 62, "message": "最大长度62个字符", "trigger": "blur" } { "max": 62, "message": "最大长度62个字符", "trigger": "blur" }
], ],
"qxbranch": [ "qxbranch": [
{ "required": true, "message": "必输项", "type": "string", "trigger": "blur" }, { "type": "string", "trigger": "blur" },
{ "max": 4, "message": "最大长度4个字符", "trigger": "blur" } { "max": 4, "message": "最大长度4个字符", "trigger": "blur" }
], ],
......
...@@ -140,6 +140,13 @@ ...@@ -140,6 +140,13 @@
</c-input> </c-input>
</el-form-item> </el-form-item>
</c-col> </c-col>
<c-col :span="20">
<el-form-item :label="$t('statics.备注')">
<c-input :value="$t('statics.已启用此行')">
</c-input>
</el-form-item>
</c-col>
</c-col> </c-col>
<c-col :span="12" style="padding-right: 20px;"> <c-col :span="12" style="padding-right: 20px;">
...@@ -215,7 +222,7 @@ ...@@ -215,7 +222,7 @@
</c-col> </c-col>
<c-col :span="20"> <c-col :span="20">
<el-form-item :label="$t('statics.所属全辖机构')" prop="qxbranch"> <el-form-item :label="$t('statics.所属全辖机构')" prop="qxbranch" :rules="[{required: bchInfo.branch != bchInfo.upbranch, message: this.$t('components.必输项') }]">
<c-input v-model="bchInfo.qxbranch" autocomplete="off" > <c-input v-model="bchInfo.qxbranch" autocomplete="off" >
</c-input> </c-input>
</el-form-item> </el-form-item>
...@@ -291,7 +298,7 @@ export default { ...@@ -291,7 +298,7 @@ export default {
orgTree: [], orgTree: [],
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'bchname' label: this.$i18n.locale === 'zh' ? 'bchname':'namen',
}, },
bchInfo: new BchModel().data.bchInfo, bchInfo: new BchModel().data.bchInfo,
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<span class="top"> <span class="top">
<!-- <el-tooltip effect="light" content="" placement="bottom"> --> <!-- <el-tooltip effect="light" content="" placement="bottom"> -->
<span class="el-tree-node__label"> <span class="el-tree-node__label">
{{ node.label }} {{ $t('menu.'+node.label )}}
</span> </span>
<!-- </el-tooltip> --> <!-- </el-tooltip> -->
<span> <span>
...@@ -74,7 +74,8 @@ ...@@ -74,7 +74,8 @@
<c-col :span="24"> <c-col :span="24">
<el-form-item :label="$t('statics.菜单名称')" prop="name"> <el-form-item :label="$t('statics.菜单名称')" prop="name">
<c-input v-model="menuInfo.name"> </c-input> <c-input v-model="menuInfo.name" v-if="$i18n.locale == 'zh'"></c-input>
<c-input v-if="$i18n.locale == 'en'" :value="$t('menu.'+this.menuInfo.name)"></c-input>
</el-form-item> </el-form-item>
</c-col> </c-col>
......
...@@ -30,8 +30,34 @@ ...@@ -30,8 +30,34 @@
</c-col> </c-col>
<c-col :span="24"> <c-col :span="24">
<c-paging-table :data="roleData" :columns="roleColumns" :pageNumber="model.pageNum" :pageSize="model.pageSize" <c-paging-table :data="roleData" :pageNumber="model.pageNum" :pageSize="model.pageSize"
:total="model.total" v-on:queryFunc="queryFunc" :border="true" @sort-change="sortChange" sortable="custom"> :total="model.total" v-on:queryFunc="queryFunc" :border="true" @sort-change="sortChange" sortable="custom">
<el-table-column prop="cod" :label="$t('statics.角色代码')" width="auto">
</el-table-column>
<el-table-column v-if="$i18n.locale == 'zh'" prop="name" :label="$t('statics.角色名称')" width="auto">
<template slot-scope="scope">
{{scope.row.name}}
</template>
</el-table-column>
<el-table-column v-else-if="$i18n.locale == 'en'" prop="extfield1" :label="$t('statics.角色名称')" width="auto">
<template slot-scope="scope">
{{ scope.row.extfield1}}
</template>
</el-table-column>
<el-table-column v-if="$i18n.locale == 'zh'" prop="description" :label="$t('statics.角色描述')" width="auto">
<template slot-scope="scope">
{{ scope.row.description }}
</template>
</el-table-column>
<el-table-column v-else-if="$i18n.locale == 'en'" prop="extfield2" :label="$t('statics.角色描述')" width="auto">
<template slot-scope="scope">
{{ scope.row.extfield2}}
</template>
</el-table-column>
<el-table-column prop="bchlev" :label="$t('statics.适用范围')" width="auto">
</el-table-column>
<el-table-column prop="state" :label="$t('statics.角色状态')" width="auto">
</el-table-column>
<c-table-column fixed="right" prop="op" :label="$t('statics.操作')" width="280px"> <c-table-column fixed="right" prop="op" :label="$t('statics.操作')" width="280px">
<template slot-scope="{ scope }"> <template slot-scope="{ scope }">
<c-button style="margin-left: 5px" size="small" type="" ref="roleDisplayBtn" @click="roleInfo(scope.row)"> <c-button style="margin-left: 5px" size="small" type="" ref="roleDisplayBtn" @click="roleInfo(scope.row)">
...@@ -81,7 +107,7 @@ ...@@ -81,7 +107,7 @@
<c-col :span="20"> <c-col :span="20">
<el-form-item :label="$t('statics.扩展信息2')" :label-width="formLabelWidth" prop="extfield2"> <el-form-item :label="$t('statics.角色描述EN')" :label-width="formLabelWidth" prop="extfield2">
<c-input v-model="dataForm.extfield2" autocomplete="off"> <c-input v-model="dataForm.extfield2" autocomplete="off">
</c-input> </c-input>
</el-form-item> </el-form-item>
...@@ -113,7 +139,7 @@ ...@@ -113,7 +139,7 @@
<c-col :span="20"> <c-col :span="20">
<el-form-item :label="$t('statics.扩展信息1')" :label-width="formLabelWidth" prop="extfield2"> <el-form-item :label="$t('statics.角色名称EN')" :label-width="formLabelWidth" prop="extfield2">
<c-input v-model="dataForm.extfield1" autocomplete="off"> <c-input v-model="dataForm.extfield1" autocomplete="off">
</c-input> </c-input>
</el-form-item> </el-form-item>
...@@ -150,7 +176,11 @@ ...@@ -150,7 +176,11 @@
<c-col :span="24"> <c-col :span="24">
<el-form-item :label="$t('statics.角色名称')" :label-width="formLabelWidth" prop="name"> <el-form-item :label="$t('statics.角色名称')" :label-width="formLabelWidth" prop="name">
<c-input v-model="menuForm.name" autocomplete="off" :disabled="true"> <c-input v-if="$i18n.locale == 'zh'" v-model="menuForm.name" autocomplete="off" :disabled="true">
{{$t('statics.'+name)}}
</c-input>
<c-input v-if="$i18n.locale == 'en'" v-model="menuForm.extfield1" autocomplete="off" :disabled="true">
{{extfield1}}
</c-input> </c-input>
</el-form-item> </el-form-item>
</c-col> </c-col>
...@@ -179,8 +209,11 @@ ...@@ -179,8 +209,11 @@
:props="treeData.defaultProps" :props="treeData.defaultProps"
:filter-node-method="filterNode" :filter-node-method="filterNode"
@check-change="handleCheckChange" @check-change="handleCheckChange"
/> >
<span slot-scope="{ node }">
{{ $t('menu.'+node.label )}}
</span>
</el-tree>
</div> </div>
</c-row> </c-row>
...@@ -217,33 +250,33 @@ ...@@ -217,33 +250,33 @@
model: new Role().data, model: new Role().data,
roleData: [], roleData: [],
roleColumns: [{ // roleColumns: [{
label: '角色代码', // label: '角色代码',
prop: 'cod', // prop: 'cod',
width: 'auto' // width: 'auto'
}, // },
{ // {
label: '角色名称', // label: '角色名称',
prop: 'name', // prop: 'name',
width: 'auto' // width: 'auto'
}, // },
{ // {
label: '角色描述', // label: '角色描述',
prop: 'description', // prop: 'description',
width: 'auto' // width: 'auto'
}, // },
{ // {
label: '适用范围', // label: '适用范围',
prop: 'bchlev', // prop: 'bchlev',
width: 'auto' // width: 'auto'
}, // },
{ // {
label: '角色状态', // label: '角色状态',
prop: 'state', // prop: 'state',
width: 'auto' // width: 'auto'
}, // },
], // ],
dataForm: new Role().data, dataForm: new Role().data,
menuForm: new Role().data, menuForm: new Role().data,
......
...@@ -286,17 +286,17 @@ ...@@ -286,17 +286,17 @@
Api.post('/webapi/admin/sysparam/addSysparm',this.dataForm) Api.post('/webapi/admin/sysparam/addSysparm',this.dataForm)
.then((res) => { .then((res) => {
if (res.respCode == "AAAAAA" || res.respCode == "AAAAAA") { if (res.respCode == "AAAAAA" || res.respCode == "AAAAAA") {
this.$notify.success("添加成功!"); this.$notify.success(this.$t('statics.添加成功!'));
this.dialogFlg = false; this.dialogFlg = false;
this.onDblparamSearch(); this.onDblparamSearch();
} else { } else {
this.$notify.error("添加失败!"); this.$notify.error(this.$t('statics.添加失败!'));
} }
}) })
.catch((err) => { .catch((err) => {
this.$notify.error("添加失败!"); this.$notify.error(this.$t('statics.添加失败!'));
}); });
} else { } else {
this.$notify.error({ this.$notify.error({
......
<template> <template>
<div style="height:100%;padding:3px 8px;overflow: auto;"> <div style="height:100%;padding:3px 8px;overflow: auto;">
<!--通讯,1-->
<div id="userData"> <div id="userData">
</div> </div>
<!--通讯,1-->
<!--通讯,2-->
<div id="delUser"> <div id="delUser">
</div> </div>
<!--通讯,2-->
<!--通讯,3-->
<div id="status"> <div id="status">
</div> </div>
<!--通讯,3--> <div v-show="hideChild" style="height: 100%;">
<div v-show="hideChild">
<!--卡片,1-->
<el-card shadow="always"> <el-card shadow="always">
<!--表单,1-->
<el-form ref="userSearch" tokenKey="userSearch" label-width="200px"> <el-form ref="userSearch" tokenKey="userSearch" label-width="200px">
<!--布局,1-->
<el-row ref="a1"> <el-row ref="a1">
<!--col,1-->
<el-col :span="11" :xs="10" :sm="10" :md="11" :lg="11" :xl="11"> <el-col :span="11" :xs="10" :sm="10" :md="11" :lg="11" :xl="11">
<!--表单行,1-->
<el-form-item :label="$t('statics.姓名:')" prop="name"> <el-form-item :label="$t('statics.姓名:')" prop="name">
<!--输入框,1-->
<el-input event-render="loadText" v-model.trim="name" type="text" :disabled="false"> <el-input event-render="loadText" v-model.trim="name" type="text" :disabled="false">
</el-input> </el-input>
<!--输入框,1-->
</el-form-item> </el-form-item>
<!--表单行,1-->
</el-col> </el-col>
<!--col,1-->
<!--col,2-->
<el-col :span="11" :xs="10" :sm="10" :md="11" :lg="11" :xl="11"> <el-col :span="11" :xs="10" :sm="10" :md="11" :lg="11" :xl="11">
<!--表单行,2-->
<el-form-item :label="$t('statics.登录名:')" prop="logname"> <el-form-item :label="$t('statics.登录名:')" prop="logname">
<!--输入框,2-->
<el-input event-render="loadText" v-model.trim="logname" type="text" <el-input event-render="loadText" v-model.trim="logname" type="text"
:disabled="false"> :disabled="false">
</el-input> </el-input>
<!--输入框,2-->
</el-form-item> </el-form-item>
<!--表单行,2-->
</el-col> </el-col>
<!--col,2-->
</el-row> </el-row>
<!--布局,1-->
<!--布局,2-->
<c-row ref="a2"> <c-row ref="a2">
<!--col,3-->
<c-col :span="24"> <c-col :span="24">
<span style="float: left"> <span style="float: left">
<el-button size="small" :loading="false" ref="addUser" type="primary" v-if="btnA" <el-button size="small" :loading="false" ref="addUser" type="primary" v-if="btnA"
...@@ -63,53 +38,39 @@ ...@@ -63,53 +38,39 @@
</el-button> </el-button>
</span> </span>
</c-col> </c-col>
<!--col,4-->
</c-row> </c-row>
<!--布局,2-->
</el-form> </el-form>
<!--表单,1-->
</el-card> </el-card>
<!--卡片,1--> <div style="height: 100%;">
<!--卡片,2--> <el-table
<el-card shadow="always"> ref="userTable"
:border="true"
:data="userdata"
style="width:100%;"
size="small"
height="calc(100% - 52px)"
:highlight-current-row="true"
@selection-change="handleSelectionChange"
>
<!--分页表格,1--> <!--分页表格,1-->
<c-paging-table event-render="pagingTable" ref="userTable" :data="userdata" stripe border :pagination="true" <!-- <c-paging-table event-render="pagingTable" ref="userTable" :data="userdata" stripe border :pagination="true"
paging-side="server" :limit-default="10" :pager-count="7" :page-sizes="[10, 20, 30, 40, 50, 100]" :background="true" paging-side="server" :limit-default="10" :pager-count="7" :page-sizes="[10, 20, 30, 40, 50, 100]" :background="true"
highlight-current-row :need-loading="false"> highlight-current-row :need-loading="false" :total="Number(pagination.total)"
<!--分页表格列,1--> :page-size="pagination.pageSize"
:current-page="pagination.pageNum"> -->
<el-table-column :filter-multiple="true" type="index" align="center"> <el-table-column :filter-multiple="true" type="index" align="center">
</el-table-column> </el-table-column>
<!--分页表格列,1-->
<!--分页表格列,2-->
<el-table-column :filter-multiple="true" label="ID" prop="id" align="center"> <el-table-column :filter-multiple="true" label="ID" prop="id" align="center">
</el-table-column> </el-table-column>
<!--分页表格列,2-->
<!--分页表格列,3-->
<el-table-column :filter-multiple="true" :label="$t('statics.姓名')" prop="nam" align="center"> <el-table-column :filter-multiple="true" :label="$t('statics.姓名')" prop="nam" align="center">
</el-table-column> </el-table-column>
<!--分页表格列,3-->
<!--分页表格列,4-->
<el-table-column :filter-multiple="true" :label="$t('statics.登录名称')" prop="extkey" align="center"> <el-table-column :filter-multiple="true" :label="$t('statics.登录名称')" prop="extkey" align="center">
</el-table-column> </el-table-column>
<!--分页表格列,4-->
<!--分页表格列,5-->
<!-- <el-table-column :filter-multiple="true" :label="$t('statics.性别')" prop="sex" :formatter="sexformatter"--> <!-- <el-table-column :filter-multiple="true" :label="$t('statics.性别')" prop="sex" :formatter="sexformatter"-->
<!-- align="center">--> <!-- align="center">-->
<!-- </el-table-column>--> <!-- </el-table-column>-->
<!--分页表格列,5-->
<!--分页表格列,6-->
<el-table-column :filter-multiple="true" :label="$t('statics.状态')" prop="secsta" :formatter="stateformatter" align="center"> <el-table-column :filter-multiple="true" :label="$t('statics.状态')" prop="secsta" :formatter="stateformatter" align="center">
</el-table-column> </el-table-column>
<!--分页表格列,6-->
<!--分页表格列,7-->
<el-table-column :filter-multiple="true" prop="state" align="center" :label="$t('buttons.操作')"> <el-table-column :filter-multiple="true" prop="state" align="center" :label="$t('buttons.操作')">
<template slot-scope="scope"> <template slot-scope="scope">
<c-button style="margin-left: 5px" size="small" type="" @click="handleInfo(scope.row)">{{ $t('buttons.详情') <c-button style="margin-left: 5px" size="small" type="" @click="handleInfo(scope.row)">{{ $t('buttons.详情')
...@@ -122,11 +83,18 @@ ...@@ -122,11 +83,18 @@
@click="handleDelete(scope.row)">{{ $t('buttons.删除') }}</c-button> @click="handleDelete(scope.row)">{{ $t('buttons.删除') }}</c-button>
</template> </template>
</el-table-column> </el-table-column>
<!--分页表格列,7--> <!-- </c-paging-table> -->
</c-paging-table> </el-table>
<!--分页表格,1--> <el-pagination
</el-card> layout="total, sizes, prev, pager, next, jumper"
<!--卡片,2--> :page-sizes="[5, 10, 20, 50, 100]"
:total="Number(pagination.total)"
:page-size="pagination.pageSize"
:current-page="pagination.pageNum"
@size-change="handleSizeChange"
@current-change="handleCurrentChange" >
</el-pagination>
</div>
</div> </div>
<!--routerView,1--> <!--routerView,1-->
<router-view v-if="$store.state.common.refreshRoute"> <router-view v-if="$store.state.common.refreshRoute">
...@@ -141,7 +109,7 @@ import commonFunctions from "@/mixin/commonFunctions.js"; ...@@ -141,7 +109,7 @@ import commonFunctions from "@/mixin/commonFunctions.js";
import Api from "@/service/Api"; import Api from "@/service/Api";
import { userData } from "@/service/tempdata/userData"; import { userData } from "@/service/tempdata/userData";
export default { export default {
name: "userSearch", name: "userManage",
computed: { computed: {
userData() { userData() {
return userData return userData
...@@ -157,6 +125,12 @@ export default { ...@@ -157,6 +125,12 @@ export default {
btnA: true, btnA: true,
btnB: true, btnB: true,
hideChild: true, hideChild: true,
mulSelected: [],
pagination: {
pageNum: 1,
pageSize: 10,
total: 0
},
} }
}, },
components: { components: {
...@@ -177,6 +151,10 @@ export default { ...@@ -177,6 +151,10 @@ export default {
// this.getHiddenButtonVue(); // this.getHiddenButtonVue();
// } // }
}, },
activated() {
this.$refs.userTable.clearSelection();
this.searchUser();
},
methods: { methods: {
getHiddenButtonVue() { getHiddenButtonVue() {
const loading = this.loading(); const loading = this.loading();
...@@ -238,19 +216,30 @@ export default { ...@@ -238,19 +216,30 @@ export default {
let params = { let params = {
extkey: this.logname, extkey: this.logname,
nam: this.name, nam: this.name,
pageNum: this.pagination.pageNum,
pageSize: this.pagination.pageSize
}; };
const loading = this.loading(); const loading = this.loading();
let res = await Api.post('/webapi/admin/usr/listusr', params); let res = await Api.post('/webapi/admin/usr/listusr', params);
if (res.respCode == SUCCESS) { if (res.respCode == SUCCESS) {
loading.close(); loading.close();
this.userdata = res.data; this.userdata = res.data.list || [];
this.pagination = {
pageNum: res.data.pageNum || 1,
pageSize: res.data.pageSize || 10,
total: res.data.total ? Number(res.data.total) : 0
};
} }
}, },
handleAddBtn() { handleAddBtn() {
this.$router.push({ name: 'userAdd' }); this.$router.push({ name: 'userAdd' });
}, },
handleEdit(row) { handleEdit(row) {
this.$router.push({ name: 'userAdd', query: { id: row.id } }); //this.$router.push({ name: 'userAdd', query: { id: row.id } });
this.routerPush({
path:"/iscOrganization/userManage/userAdd",
query: { id: row.id }
})
}, },
handleInfo(row) { handleInfo(row) {
this.$router.push({ name: 'userInfo', query: { id: row.id, btnType: "info" } }); this.$router.push({ name: 'userInfo', query: { id: row.id, btnType: "info" } });
...@@ -275,6 +264,19 @@ export default { ...@@ -275,6 +264,19 @@ export default {
restUser() { restUser() {
this.logname = ""; this.logname = "";
this.name = ""; this.name = "";
},
handleSelectionChange(val) {
this.mulSelected = val
},
// pageSize改变
handleSizeChange(val) {
this.pagination.pageNum = 1;
this.pagination.pageSize = val;
this.searchUser();
},
handleCurrentChange(val){
this.pagination.pageNum = val
this.searchUser()
} }
} }
} }
......
...@@ -102,10 +102,11 @@ ...@@ -102,10 +102,11 @@
<el-option <el-option
v-for="item in branchlist" v-for="item in branchlist"
:key="item.branch" :key="item.branch"
:label="item.branch+'-'+item.bchname" :label="$i18n.locale == 'zh' ? item.branch +' - '+ item.bchname : item.branch +' - '+ item.namen"
:value="item.branch" :value="item.branch"
> >
<span >{{ item.branch +' - ' + item.bchname }}</span> <span style="float: left" v-if="$i18n.locale === 'zh'">{{ item.branch }} - {{ item.bchname }}</span>
<span style="float: left" v-if="$i18n.locale === 'en'">{{ item.branch }} - {{ item.namen }}</span>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -241,15 +242,17 @@ ...@@ -241,15 +242,17 @@
<!--col,71--> <!--col,71-->
<el-col :span="11"> <el-col :span="11">
<!--表单行,69--> <!--表单行,69-->
<el-form-item :label="$t('statics.关联机构:')" prop="associationrinstitution"> <el-form-item :label="$t('statics.关联机构:')" prop="branchcode">
<el-select v-model="user.branchcode" multiple> <el-select v-model="user.branchcode" multiple>
<el-option <el-option
v-for="item in branchlist" v-for="item in branchlist"
:key="item.branch" :key="item.branch"
:label="item.branch+'-'+item.bchname" :label="$i18n.locale == 'zh' ? item.branch +' - '+ item.bchname : item.branch +' - '+ item.namen"
:value="item.branch" :value="item.branch"
> >
<span >{{ item.branch +' - ' + item.bchname }}</span> <span style="float: left" v-if="$i18n.locale === 'zh'">{{ item.branch }} - {{ item.bchname }}</span>
<span style="float: left" v-if="$i18n.locale === 'en'">{{ item.branch }} - {{ item.namen }}</span>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -258,16 +261,17 @@ ...@@ -258,16 +261,17 @@
<!--col,71--> <!--col,71-->
<el-col :span="11"> <el-col :span="11">
<!--表单行,68--> <!--表单行,68-->
<el-form-item :label="$t('statics.关联角色:')" prop="associatedroles"> <el-form-item :label="$t('statics.关联角色:')" prop="rolecode">
<!--输入框,53--> <!--输入框,53-->
<el-select v-model="user.rolecode" multiple> <el-select v-model="user.rolecode" multiple>
<el-option <el-option
v-for="item in rolelist" v-for="item in rolelist"
:key="item.id" :key="item.id"
:label="item.id+'-'+item.name" :label="$i18n.locale == 'zh' ? item.id +' - '+ item.name : item.id +' - '+ item.extfield1"
:value="item.id" :value="item.id"
> >
<span >{{ item.id +' - ' + item.name }}</span> <span style="float: left" v-if="$i18n.locale === 'zh'">{{ item.id }} - {{ item.name }}</span>
<span style="float: left" v-if="$i18n.locale === 'en'">{{ item.id }} - {{ item.extfield1 }}</span>
</el-option> </el-option>
</el-select> </el-select>
<!--输入框,53--> <!--输入框,53-->
...@@ -353,7 +357,7 @@ ...@@ -353,7 +357,7 @@
</el-form> </el-form>
<el-row> <el-row>
<el-col :span="24" class="text-center subBtn"> <el-col :span="24" class="text-center subBtn">
<el-button type="primary" ref="userSubmitBtn" v-if="isShowSubmit" :loading="false" icon="el-icon-circle-check" @click="saveUser()"> <el-button type="primary" ref="userSubmitBtn" v-if="isShowSubmit" :loading="false" icon="el-icon-circle-check" @click="saveUser('addUser')">
{{ $t('statics.提交') }} {{ $t('statics.提交') }}
</el-button> </el-button>
<el-button type="primary" :loading="false" icon="el-icon-refresh-left" native-type="reset" :disabled="false" @click="goBack()"> <el-button type="primary" :loading="false" icon="el-icon-refresh-left" native-type="reset" :disabled="false" @click="goBack()">
...@@ -378,6 +382,7 @@ import { IscPagingTable} from '@/components/isc' ...@@ -378,6 +382,7 @@ import { IscPagingTable} from '@/components/isc'
import RelatedOrgChild from '@/page/Statics/Usr/RelatedOrg.vue'; import RelatedOrgChild from '@/page/Statics/Usr/RelatedOrg.vue';
import Api from "@/service/Api"; import Api from "@/service/Api";
export default { export default {
name: "userAdd",
data () { data () {
return { return {
branchlist:[], branchlist:[],
...@@ -482,6 +487,8 @@ export default { ...@@ -482,6 +487,8 @@ export default {
logPass: [{ required: true, message: this.$t('statics.请输入密码'), trigger: 'blur' }, { max: 15, message: this.$t('statics.密码长度不能超过15位'), trigger: 'blur' }], logPass: [{ required: true, message: this.$t('statics.请输入密码'), trigger: 'blur' }, { max: 15, message: this.$t('statics.密码长度不能超过15位'), trigger: 'blur' }],
confirmPass: [{validator: this.validatePass2, trigger: 'blur'}], confirmPass: [{validator: this.validatePass2, trigger: 'blur'}],
relgrp:[{ required: true, message: this.$t('statics.请选择授权权限'),trigger: 'blur'},], relgrp:[{ required: true, message: this.$t('statics.请选择授权权限'),trigger: 'blur'},],
branchcode:[{ required: true, message: this.$t('statics.请选择关联机构'),trigger: 'blur'},],
rolecode:[{ required: true, message: this.$t('statics.请选择关联角色'),trigger: 'blur'},],
}, },
user:{ user:{
rolecode:{ rolecode:{
...@@ -524,7 +531,7 @@ export default { ...@@ -524,7 +531,7 @@ export default {
isFieldDisabled: true isFieldDisabled: true
} }
}, },
components: { components: {
'isc-paging-table':IscPagingTable, 'isc-paging-table':IscPagingTable,
'el-radio-group':RadioGroup, 'el-radio-group':RadioGroup,
'el-form':Form, 'el-form':Form,
...@@ -546,8 +553,8 @@ components: { ...@@ -546,8 +553,8 @@ components: {
'el-tree':Tree, 'el-tree':Tree,
'el-tab-pane':TabPane, 'el-tab-pane':TabPane,
'el-related-org-child':RelatedOrgChild 'el-related-org-child':RelatedOrgChild
}, },
mounted (){ mounted (){
this.$parent.hideChild = false; this.$parent.hideChild = false;
this.userID = this.$route.query.id; this.userID = this.$route.query.id;
this.isDisabled = false; this.isDisabled = false;
...@@ -592,12 +599,12 @@ mounted (){ ...@@ -592,12 +599,12 @@ mounted (){
let bchList=responseData.data.branchList; let bchList=responseData.data.branchList;
let tmpList=[] let tmpList=[]
bchList.forEach((item) => { bchList.forEach((item) => {
tmpList.push(item.branch); tmpList.push(item.BRANCH);
}); });
let roleList=responseData.data.roleList; let roleList=responseData.data.roleList;
let tmpList2=[] let tmpList2=[]
roleList.forEach((item2) => { roleList.forEach((item2) => {
tmpList2.push(item2.roleid); tmpList2.push(item2.ROLEID);
}); });
$this.user.rolecode=tmpList2; $this.user.rolecode=tmpList2;
$this.user.branchcode=tmpList; $this.user.branchcode=tmpList;
...@@ -635,8 +642,8 @@ mounted (){ ...@@ -635,8 +642,8 @@ mounted (){
'requestFields':{'offset':'#offset','limit':'#limit'}}, 'requestFields':{'offset':'#offset','limit':'#limit'}},
'afterGetUserRelations', 'afterGetUserRelations',
'beforGetUserRelations'); 'beforGetUserRelations');
}, },
methods : { methods : {
bch_init(){ bch_init(){
Api.post('/webapi/admin/bch/getBchListForUsr',{}).then(res=>{ Api.post('/webapi/admin/bch/getBchListForUsr',{}).then(res=>{
this.branchlist = res.data; this.branchlist = res.data;
...@@ -653,9 +660,11 @@ methods : { ...@@ -653,9 +660,11 @@ methods : {
messageKey.vue = this; messageKey.vue = this;
iscMessage.messageManage(messageKey,callback,execBefore); iscMessage.messageManage(messageKey,callback,execBefore);
}, },
async saveUser() { async saveUser(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
if(this.userID == null){ if(this.userID == null){
this.$confirm(this.$t('statics.你是否确定添加用户?'), this.$t('statics.提示'), { this.$confirm(this.$t('statics.是否确定添加用户?'), this.$t('statics.提示'), {
confirmButtonText: this.$t('statics.确认'), confirmButtonText: this.$t('statics.确认'),
cancelButtonText: this.$t('statics.取消'), cancelButtonText: this.$t('statics.取消'),
type: "warning", type: "warning",
...@@ -676,7 +685,23 @@ methods : { ...@@ -676,7 +685,23 @@ methods : {
role:this.user.rolecode, role:this.user.rolecode,
workorg:this.user.workorg, workorg:this.user.workorg,
}; };
await Api.post('/webapi/admin/usr/addusr', params); await Api.post('/webapi/admin/usr/addusr', params)
.then((res) => {
if (res.respCode == "AAAAAA" || res.respCode == "AAAAAA") {
this.$notify({
title: this.$t('components.成功'),
message: this.$t('components.校验成功'),
type: "success",
});
} else {
this.$notify({
title: this.$t('components.失败'),
message: this.$t('components.校验失败'),
type: 'error',
});
}
});
//this.$router.push({name:'userSearch'}); //this.$router.push({name:'userSearch'});
this.routerPush({ this.routerPush({
path: '/iscOrganization/userManage' path: '/iscOrganization/userManage'
...@@ -684,7 +709,7 @@ methods : { ...@@ -684,7 +709,7 @@ methods : {
this.$parent.$refs.userTable.refresh(); this.$parent.$refs.userTable.refresh();
}); });
}else{ }else{
this.$confirm(this.$t('statics.你是否确定修改该用户?'), this.$t('statics.提示'), { this.$confirm(this.$t('statics.是否确定修改该用户?'), this.$t('statics.提示'), {
confirmButtonText: this.$t('statics.确认'), confirmButtonText: this.$t('statics.确认'),
cancelButtonText: this.$t('statics.取消'), cancelButtonText: this.$t('statics.取消'),
type: "warning", type: "warning",
...@@ -704,13 +729,38 @@ methods : { ...@@ -704,13 +729,38 @@ methods : {
role:this.user.rolecode, role:this.user.rolecode,
workorg:this.user.workorg, workorg:this.user.workorg,
}; };
await Api.post('/webapi/admin/usr/updateusr', params); await Api.post('/webapi/admin/usr/updateusr', params).then((res) => {
if (res.respCode == "AAAAAA" || res.respCode == "AAAAAA") {
this.$notify({
title: this.$t('components.成功'),
message: this.$t('components.校验成功'),
type: "success",
});
} else {
this.$notify({
title: this.$t('components.失败'),
message: this.$t('components.校验失败'),
type: 'error',
});
}
});;
this.routerPush({ this.routerPush({
path: '/iscOrganization/userManage' path: '/iscOrganization/userManage'
}) })
this.$parent.$refs.userTable.refresh(); this.$parent.$refs.userTable.refresh();
}); });
} }
}
// else {
// this.$notify({
// title: this.$t('components.失败'),
// message: this.$t('components.校验失败'),
// type: 'error',
// });
// }
});
}, },
beforGetUserRelations(messageObj){ beforGetUserRelations(messageObj){
//根据用户查询所属机构,部门,工作组,岗位,角色表 //根据用户查询所属机构,部门,工作组,岗位,角色表
...@@ -1618,10 +1668,10 @@ methods : { ...@@ -1618,10 +1668,10 @@ methods : {
editColumn(index, row) { editColumn(index, row) {
this.editPriority = row.priority; this.editPriority = row.priority;
} }
}, },
beforeDestroy() { beforeDestroy() {
this.$parent.hideChild = true; this.$parent.hideChild = true;
} }
} }
</script> </script>
<style type="text/css" lang="less"> <style type="text/css" lang="less">
......
...@@ -71,10 +71,11 @@ ...@@ -71,10 +71,11 @@
<el-option <el-option
v-for="item in branchlist" v-for="item in branchlist"
:key="item.branch" :key="item.branch"
:label="item.branch+'-'+item.bchname" :label="$i18n.locale === 'zh' ? item.branch +' - '+ item.bchname : item.branch +' - '+ item.namen"
:value="item.branch" :value="item.branch"
> >
<span >{{ item.branch +' - ' + item.bchname }}</span> <span style="float: left" v-if="$i18n.locale === 'zh'">{{ item.branch }} - {{ item.bchname }}</span>
<span style="float: left" v-if="$i18n.locale === 'en'">{{ item.branch }} - {{ item.namen }}</span>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -239,9 +240,10 @@ ...@@ -239,9 +240,10 @@
<el-option <el-option
v-for="item in branchlist" v-for="item in branchlist"
:key="item.branch" :key="item.branch"
:label="item.branch+'-'+item.bchname" :label="$i18n.locale == 'zh' ? item.branch +' - '+ item.bchname : item.branch +' - '+ item.namen"
:value="item.branch"> :value="item.branch">
<span >{{ item.branch +' - ' + item.bchname }}</span> <span style="float: left" v-if="$i18n.locale === 'zh'">{{ item.branch }} - {{ item.bchname }}</span>
<span style="float: left" v-if="$i18n.locale === 'en'">{{ item.branch }} - {{ item.namen }}</span>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -254,10 +256,11 @@ ...@@ -254,10 +256,11 @@
<el-option <el-option
v-for="item2 in rolelist" v-for="item2 in rolelist"
:key="item2.id" :key="item2.id"
:label="item2.id+'-'+item2.name" :label="$i18n.locale == 'zh' ? item2.id +' - '+ item2.name : item2.id +' - '+ item2.extfield1"
:value="item2.id" :value="item2.id"
> >
<span >{{ item2.id +' - ' + item2.name }}</span> <span style="float: left" v-if="$i18n.locale === 'zh'">{{ item2.id }} - {{ item2.name }}</span>
<span style="float: left" v-if="$i18n.locale === 'en'">{{ item2.id }} - {{ item2.extfield1 }}</span>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -565,14 +568,14 @@ this.role_init(); ...@@ -565,14 +568,14 @@ this.role_init();
let bchList=responseData.data.branchList; let bchList=responseData.data.branchList;
let tmpList=[] let tmpList=[]
bchList.forEach((item) => { bchList.forEach((item) => {
tmpList.push(item.branch); tmpList.push(item.BRANCH);
}); });
$this.user.branchcode=tmpList; $this.user.branchcode=tmpList;
let roleList=responseData.data.roleList; let roleList=responseData.data.roleList;
let tmpList2=[] let tmpList2=[]
roleList.forEach((item2) => { roleList.forEach((item2) => {
tmpList2.push(item2.roleid); tmpList2.push(item2.ROLEID);
}); });
$this.user.rolecode=tmpList2; $this.user.rolecode=tmpList2;
$this.user.id= responseData.data.id; $this.user.id= responseData.data.id;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment