Commit 4d7ea4bf authored by wanglianghe's avatar wanglianghe

网点绑定负责人

parent 9e0742c7
...@@ -40,6 +40,28 @@ Vue.prototype.getDictDataLabel = getDictDataLabel ...@@ -40,6 +40,28 @@ Vue.prototype.getDictDataLabel = getDictDataLabel
Vue.prototype.DICT_TYPE = DICT_TYPE Vue.prototype.DICT_TYPE = DICT_TYPE
Vue.prototype.handleTree = handleTree Vue.prototype.handleTree = handleTree
Date.prototype.format = function(format) {
var date = {
"M+": this.getMonth() + 1,
"d+": this.getDate(),
"h+": this.getHours(),
"m+": this.getMinutes(),
"s+": this.getSeconds(),
"q+": Math.floor((this.getMonth() + 3) / 3),
"S+": this.getMilliseconds()
};
if (/(y+)/i.test(format)) {
format = format.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length));
}
for (var k in date) {
if (new RegExp("(" + k + ")").test(format)) {
format = format.replace(RegExp.$1, RegExp.$1.length == 1
? date[k] : ("00" + date[k]).substr(("" + date[k]).length));
}
}
return format;
}
// 全局组件挂载 // 全局组件挂载
Vue.component('DictTag', DictTag) Vue.component('DictTag', DictTag)
Vue.component('DocAlert', DocAlert) Vue.component('DocAlert', DocAlert)
......
...@@ -55,7 +55,8 @@ ...@@ -55,7 +55,8 @@
<!-- 列表 --> <!-- 列表 -->
<el-table v-loading="loading" :data="list"> <el-table v-loading="loading" :data="list">
<el-table-column label="主键" align="center" prop="id" /> <el-table-column label="序号" type="index" width="50" />
<el-table-column label="中文名称" align="center" prop="titleZh" /> <el-table-column label="中文名称" align="center" prop="titleZh" />
<el-table-column label="英文名称" align="center" prop="titleEn" /> <el-table-column label="英文名称" align="center" prop="titleEn" />
<el-table-column label="国家" align="center" prop="countryZh" /> <el-table-column label="国家" align="center" prop="countryZh" />
......
...@@ -35,7 +35,17 @@ ...@@ -35,7 +35,17 @@
<el-table-column label="网点编号" align="center" prop="number" /> <el-table-column label="网点编号" align="center" prop="number" />
<el-table-column label="网点名称" align="center" prop="titleZh" /> <el-table-column label="网点名称" align="center" prop="titleZh" />
<el-table-column label="网点地址" align="center" prop="addressZh" /> <el-table-column label="网点地址" align="center" prop="addressZh" />
<el-table-column label="负责人的用户id" align="center" prop="adminId" />
<el-table-column prop="adminId" label="负责人" align="center">
<template slot-scope="scope">
<div>
<span>{{ scope.row.adminId ? scope.row.adminName : '未设置' }}</span>
<br>
<el-button v-if="!scope.row.adminId" type="text" size="mini" @click="setAdminClick(scope.row)">设置主管</el-button>
</div>
</template>
</el-table-column>
<el-table-column prop="status" label="状态" width="100"> <el-table-column prop="status" label="状态" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -57,6 +67,35 @@ ...@@ -57,6 +67,35 @@
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/> @pagination="getList"/>
<!-- 设置主管对话框 -->
<el-dialog title="设置主管" :visible.sync="setAdminOpen" width="900px" append-to-body>
<el-table :data="userList">
<el-table-column label="序号" type="index" width="50" />
<el-table-column label="用户名" align="center" prop="username" />
<el-table-column label="姓名" align="center" prop="nickname" />
<el-table-column label="手机号" align="center" prop="mobile" />
<el-table-column prop="loginDate" label="最近操作" align="center">
<template slot-scope="scope">
<span>{{ new Date(scope.row.loginDate).format('yyyy-MM-dd hh:mm:ss')}}</span>
<br>
<span>{{scope.row.loginIp}}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="setAdmin(scope.row)"
>设为主管</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="userTotal > 0" :total="userTotal" :page.sync="userQueryParams.pageNo" :limit.sync="userQueryParams.pageSize"
@pagination="getUserList"/>
</el-dialog>
<!-- 对话框(添加 / 修改) --> <!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="900px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px"> <el-form ref="form" :model="form" :rules="rules" label-width="100px">
...@@ -163,6 +202,7 @@ import { createNode, updateNode, deleteNode, getNode, getNodePage, exportNodeExc ...@@ -163,6 +202,7 @@ import { createNode, updateNode, deleteNode, getNode, getNodePage, exportNodeExc
import { getListTree } from "@/api/ecw/region"; import { getListTree } from "@/api/ecw/region";
import { getDictDatas, DICT_TYPE } from '@/utils/dict'; import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import {CommonStatusEnum} from '@/utils/constants' import {CommonStatusEnum} from '@/utils/constants'
import {listUser} from "@/api/system/user";
export default { export default {
name: "Node", name: "Node",
...@@ -205,6 +245,17 @@ export default { ...@@ -205,6 +245,17 @@ export default {
title: "", title: "",
// 是否显示弹出层 // 是否显示弹出层
open: false, open: false,
//社否显示设置主管
updateRow:null,
userList:[],
userTotal: 0,
setAdminOpen: false,
userQueryParams: {
pageNo: 1,
pageSize: 10
},
dateRangeCreateTime: [], dateRangeCreateTime: [],
// 查询参数 // 查询参数
queryParams: { queryParams: {
...@@ -286,6 +337,33 @@ export default { ...@@ -286,6 +337,33 @@ export default {
this.loading = false; this.loading = false;
}); });
}, },
//获取用户列表
getUserList() {
listUser(this.userQueryParams).then(response => {
this.userList = response.data.list;
this.userTotal = response.data.total;
});
},
//设置主管
setAdminClick(row) {
this.updateRow = row;
this.setAdminOpen = true;
this.getUserList();
},
setAdmin(user) {
this.updateRow.adminId = user.id;
updateNode(this.updateRow).then(() => {
this.$set(this.updateRow, 'adminName', user.nickname);
this.$modal.msgSuccess("设置成功");
this.setAdminOpen = false;
}).catch(function() {
this.$modal.msgSuccess("设置失败");
});
},
getContinentsList() { getContinentsList() {
this.queryParams.treeType = 0; this.queryParams.treeType = 0;
getListTree(this.queryParams).then(response => { getListTree(this.queryParams).then(response => {
......
...@@ -38,11 +38,11 @@ ...@@ -38,11 +38,11 @@
</el-row> </el-row>
<!-- 列表 --> <!-- 列表 -->
<el-table v-loading="loading" :data="list"> <el-table v-loading="loading" :data="list" @sort-change="sortChange">
<el-table-column type="index" width="50" /> <el-table-column label="序号" type="index" width="50" />
<el-table-column label="提货点名称" align="center" prop="titleZh" /> <el-table-column label="提货点名称" align="center" prop="titleZh" />
<el-table-column label="排序" align="center" prop="sort" /> <el-table-column label="排序" sortable="custom" align="center" prop="sort" />
<el-table-column label="地区" align="center" prop="countryId"> <el-table-column label="地区" align="center" prop="countryId">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -179,6 +179,9 @@ export default { ...@@ -179,6 +179,9 @@ export default {
CommonStatusEnum: CommonStatusEnum, CommonStatusEnum: CommonStatusEnum,
// 数据字典 // 数据字典
statusDictDatas: getDictDatas(DICT_TYPE.COMMON_STATUS), statusDictDatas: getDictDatas(DICT_TYPE.COMMON_STATUS),
sortProp: null,
sortType: null,
}; };
}, },
created() { created() {
...@@ -191,6 +194,8 @@ export default { ...@@ -191,6 +194,8 @@ export default {
this.loading = true; this.loading = true;
// 处理查询参数 // 处理查询参数
let params = {...this.queryParams}; let params = {...this.queryParams};
params.sortProp = this.sortProp;
params.sortType = this.sortType;
this.addBeginAndEndTime(params, this.dateRangeWorkTime, 'workTime'); this.addBeginAndEndTime(params, this.dateRangeWorkTime, 'workTime');
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime'); this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// 执行查询 // 执行查询
...@@ -201,6 +206,13 @@ export default { ...@@ -201,6 +206,13 @@ export default {
}); });
}, },
sortChange(obj) {
this.sortProp = obj.prop; //排序字段名称
this.sortType = obj.order; //排序方式
this.queryParams.pageNo = 1;
this.getList();
},
getCountryList() { getCountryList() {
this.queryParams.treeType = 1; this.queryParams.treeType = 1;
getListTree(this.queryParams).then(response => { getListTree(this.queryParams).then(response => {
...@@ -210,7 +222,6 @@ export default { ...@@ -210,7 +222,6 @@ export default {
getCountryName(countryId) { getCountryName(countryId) {
for(let index in this.countryList) { for(let index in this.countryList) {
console.log(index);
let country = this.countryList[index]; let country = this.countryList[index];
if(country.id == countryId) return country.titleZh; if(country.id == countryId) return country.titleZh;
} }
......
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