jinhui.wang

密码机页面增加,接口增加,方法名称修改

1 +import request from '@/utils/request'
2 +
3 +// 查询密码机数据
4 +/**
5 + * @param cipherMachineNumber 密码机编号
6 + * @param endCreationTime 结束创建时间
7 + * @param startCreationTime 开始创建时间
8 + * @param pageNum *
9 + * @param pageSize *
10 + */
11 +export function getCipherMachineList(data) {
12 + return request({
13 + url: '/bus-customer/cipherMachine/getCipherMachineList',
14 + method: 'post',
15 + data: data
16 + })
17 +}
18 +
19 +// 新增密码机
20 +/**
21 + * @param cipherMachineNumber * 密码机编号
22 + * @param availableUserCount * 密码机可使用用户数量
23 + * @param ipAddress * 密码机IP地址
24 + */
25 +export function addCipherMachineData(data) {
26 + return request({
27 + url: '/bus-customer/cipherMachine/addCipherMachine',
28 + method: 'post',
29 + data: data
30 + })
31 +}
32 +
33 +// 修改密码机
34 +/**
35 + * @param cipherMachineNumber * 密码机编号
36 + * @param availableUserCount * 密码机可使用用户数量
37 + * @param ipAddress * 密码机IP地址
38 + * @param id *
39 + */
40 +export function updateCipherMachineData(data) {
41 + return request({
42 + url: '/bus-customer/cipherMachine/updateCipherMachine',
43 + method: 'put',
44 + data: data
45 + })
46 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import request from '@/utils/request'
2 +
3 +// 获取用户详细信息
4 +/**
5 + * @param dxpid DXPID
6 + * @param portCode 口岸代码
7 + * @param pageNum *
8 + * @param pageSize *
9 + */
10 +export function getPortList(data) {
11 + return request({
12 + url: '/bus-customer/portInfo/getPortList',
13 + method: 'post',
14 + data: data
15 + })
16 +}
...\ No newline at end of file ...\ No newline at end of file
...@@ -47,7 +47,7 @@ export function updateRoleData(data) { ...@@ -47,7 +47,7 @@ export function updateRoleData(data) {
47 }) 47 })
48 } 48 }
49 49
50 -// 更新角色 50 +// 更新角色权限
51 /** 51 /**
52 * @param menuId * 权限菜单 52 * @param menuId * 权限菜单
53 * @param roleId * 角色id 53 * @param roleId * 角色id
...@@ -77,6 +77,18 @@ export function getUserData(data) { ...@@ -77,6 +77,18 @@ export function getUserData(data) {
77 }) 77 })
78 } 78 }
79 79
80 +// 用户信息详情查询
81 +/**
82 + * @param id 用户id *
83 + */
84 +export function getUserDetailData(data) {
85 + return request({
86 + url: '/bus-customer/user/getUserById',
87 + method: 'get',
88 + params: data
89 + })
90 +}
91 +
80 // 用户更新 92 // 用户更新
81 /** 93 /**
82 * @param employeeNumber 员工编号 94 * @param employeeNumber 员工编号
...@@ -123,4 +135,28 @@ export function getPortList(data) { ...@@ -123,4 +135,28 @@ export function getPortList(data) {
123 method: 'get', 135 method: 'get',
124 params: data 136 params: data
125 }) 137 })
138 +}
139 +
140 +// 获取角色字典
141 +/**
142 + * @param
143 + */
144 +export function getRoleDict(data) {
145 + return request({
146 + url: '/bus-customer/user/getRoleIdsList',
147 + method: 'get',
148 + params: data
149 + })
150 +}
151 +
152 +// 获取用户角色分配状态
153 +/**
154 + * @param userId * 用户id
155 + */
156 +export function getUserRoleType(data) {
157 + return request({
158 + url: '/bus-customer/user/assignedAndUnassignedRoles',
159 + method: 'get',
160 + params: data
161 + })
126 } 162 }
...\ No newline at end of file ...\ No newline at end of file
......
1 +<template>
2 + <el-dialog
3 + class="entryDialog classCUploadDialog"
4 + :title="title"
5 + :visible.sync="outerVisible"
6 + :show-close="false"
7 + width="40%"
8 + :close-on-click-modal="false"
9 + v-loading="loadings.dialogLoading"
10 + @close="close"
11 + >
12 + <div class="modelItem">
13 + <el-form
14 + class="fedexFormStyle"
15 + ref="formData"
16 + :model="formData"
17 + :rules="type == 'roleChange' ? {} : rules"
18 + label-position="top"
19 + :disabled="type == 'roleChange'"
20 + size="small"
21 + >
22 + <el-row :gutter="5">
23 + <!-- 密码机编号 -->
24 + <el-col :span="8">
25 + <Formitem label="密码机编号" prop="cipherMachineNumber" type="edit">
26 + <el-input
27 + type="text"
28 + class="inputShadow"
29 + id="inputInner-edit-cipherMachineNumber"
30 + resize="none"
31 + v-model="formData.cipherMachineNumber"
32 + clearable
33 + placeholder=""
34 + ></el-input>
35 + </Formitem>
36 + </el-col>
37 + <!-- 密码机IP地址 -->
38 + <el-col :span="8">
39 + <Formitem label="密码机IP地址" prop="ipAddress" type="edit">
40 + <el-input
41 + type="text"
42 + class="inputShadow"
43 + id="inputInner-edit-ipAddress"
44 + resize="none"
45 + v-model="formData.ipAddress"
46 + clearable
47 + placeholder=""
48 + ></el-input>
49 + </Formitem>
50 + </el-col>
51 + <!-- 密码机可使用用户数量 -->
52 + <el-col :span="8">
53 + <Formitem
54 + label="密码机可使用用户数量"
55 + prop="availableUserCount"
56 + type="edit"
57 + >
58 + <el-input
59 + type="text"
60 + class="inputShadow"
61 + id="inputInner-edit-availableUserCount"
62 + resize="none"
63 + v-model="formData.availableUserCount"
64 + clearable
65 + oninput="value=value.replace(/[^0-9]/g,'')"
66 + placeholder=""
67 + ></el-input>
68 + </Formitem>
69 + </el-col>
70 + </el-row>
71 + </el-form>
72 + </div>
73 + <div class="dialogOption entrySave">
74 + <el-button
75 + class="entrySaveButton"
76 + :disabled="loadings.submitLoading"
77 + @click="submit"
78 + >确 定</el-button
79 + >
80 + <el-button
81 + class="entrySaveButton"
82 + :disabled="loadings.uploadLoading"
83 + @click="close"
84 + >关 闭</el-button
85 + >
86 + </div>
87 + </el-dialog>
88 +</template>
89 +
90 +<script>
91 +import {
92 + addCipherMachineData,
93 + updateCipherMachineData,
94 +} from "@/api/system/cipherMachine-api.js";
95 +export default {
96 + props: {
97 + outerVisible: {
98 + type: Boolean,
99 + default: false,
100 + },
101 + title: {
102 + type: String,
103 + default: "新增密码机",
104 + },
105 + type: {
106 + type: String,
107 + default: "",
108 + },
109 + active: {
110 + type: Object,
111 + default: null,
112 + },
113 + },
114 + data() {
115 + return {
116 + formData: {
117 + availableUserCount: "",
118 + cipherMachineNumber: "",
119 + ipAddress: "",
120 + },
121 + customData: [],
122 + rules: {
123 + ipAddress: [
124 + {
125 + required: true,
126 + trigger: "blur",
127 + message: "密码机IP地址不能为空!",
128 + },
129 + ],
130 + cipherMachineNumber: [
131 + {
132 + required: true,
133 + trigger: "blur",
134 + message: "密码机编号不能为空!",
135 + },
136 + ],
137 + availableUserCount: [
138 + {
139 + required: true,
140 + trigger: "blur",
141 + message: "密码机可使用用户数量不能为空!",
142 + },
143 + ],
144 + },
145 + loadings: {
146 + dialogLoading: false,
147 + uploadLoading: false,
148 + submitLoading: false,
149 + },
150 + loadingText: "",
151 + };
152 + },
153 + watch: {
154 + outerVisible(val) {
155 + if (val) {
156 + this.loadings.dialogLoading = false;
157 + if (this.type == "update") {
158 + this.formData = this.active;
159 + }
160 + }
161 + },
162 + },
163 + methods: {
164 + //查询用户信息详情
165 + searchUserData(id) {
166 + this.loadings.dialogLoading = true;
167 + getUserDetailData({ id: id })
168 + .then((res) => {
169 + if (res.code === "200") {
170 + this.formData = res.data;
171 + } else {
172 + this.alertWarningMsg(res.message);
173 + }
174 + this.loadings.dialogLoading = false;
175 + })
176 + .catch((err) => {
177 + console.log(err);
178 + this.loadings.dialogLoading = false;
179 + });
180 + },
181 + //数据保存
182 + submit() {
183 + this.loadings.dialogLoading = true;
184 + let obj = {};
185 + if (this.type == "add") {
186 + this.$refs.formData.validate((valid) => {
187 + if (valid) {
188 + obj = this.formData;
189 + this.addApi(obj);
190 + } else {
191 + this.loadings.dialogLoading = false;
192 + }
193 + });
194 + } else if (this.type == "update") {
195 + this.$refs.formData.validate((valid) => {
196 + if (valid) {
197 + obj.availableUserCount = this.formData.availableUserCount;
198 + obj.cipherMachineNumber = this.formData.cipherMachineNumber;
199 + obj.ipAddress = this.formData.ipAddress;
200 + obj.id = this.formData.id;
201 + this.updateapi(obj);
202 + } else {
203 + this.loadings.dialogLoading = false;
204 + }
205 + });
206 + }
207 + },
208 + //新增
209 + addApi(val) {
210 + addCipherMachineData(val)
211 + .then((res) => {
212 + if (res.code === "200") {
213 + this.msgSuccess(res.message);
214 + this.close();
215 + } else {
216 + this.alertWarningMsg(res.message);
217 + this.loadings.dialogLoading = false;
218 + }
219 + })
220 + .catch((err) => {
221 + console.log(err);
222 + this.loadings.dialogLoading = false;
223 + });
224 + },
225 + //修改
226 + updateapi(val) {
227 + updateCipherMachineData(val)
228 + .then((res) => {
229 + if (res.code === "200") {
230 + this.msgSuccess(res.message);
231 + this.close();
232 + } else {
233 + this.alertWarningMsg(res.message);
234 + this.loadings.dialogLoading = false;
235 + }
236 + })
237 + .catch((err) => {
238 + console.log(err);
239 + this.loadings.dialogLoading = false;
240 + });
241 + },
242 + close() {
243 + this.formData = {
244 + availableUserCount: "",
245 + cipherMachineNumber: "",
246 + ipAddress: "",
247 + };
248 + this.$emit("close");
249 + },
250 + },
251 +};
252 +</script>
253 +
254 +<style lang="scss" scoped>
255 +@import "@/assets/styles/variables.scss";
256 +</style>
1 +<template>
2 + <div class="entrySreach">
3 + <el-form
4 + class="fedexFormStyle fedexformSreach fedexformSreachBottomBorder"
5 + ref="sreachForm"
6 + :model="sreachFormData"
7 + label-position="top"
8 + size="small"
9 + >
10 + <el-row class="row-border">
11 + <!-- 角色名称 -->
12 + <el-col :span="5">
13 + <Formitem label="密码机编号" prop="cipherMachineNumber">
14 + <el-input
15 + type="text"
16 + class="inputShadow"
17 + id="inputInner--cipherMachineNumber"
18 + resize="none"
19 + v-model="sreachFormData.cipherMachineNumber"
20 + clearable
21 + placeholder=""
22 + ></el-input>
23 + </Formitem>
24 + </el-col>
25 + <el-col :span="5">
26 + <Formitem label="创建日期" prop="creationTime" :activeType="true">
27 + <el-date-picker
28 + class="inputInner--creationTime"
29 + id="inputInner--creationTime"
30 + v-model="sreachFormData.creationTime"
31 + type="daterange"
32 + format="yyyy-MM-dd"
33 + prefix-icon="none"
34 + value-format="yyyy-MM-dd"
35 + range-separator="至"
36 + @change="dateChange"
37 + />
38 + </Formitem>
39 + </el-col>
40 + <el-col :span="2">
41 + <el-form-item class="textCenter">
42 + <el-button
43 + class="entrySreachButton"
44 + type="text"
45 + icon="el-icon-search"
46 + :loading="loadings.searchLoading"
47 + @click="search(0)"
48 + ></el-button>
49 + </el-form-item>
50 + </el-col>
51 + </el-row>
52 + </el-form>
53 + <div class="optionButton">
54 + <el-button
55 + class="entrySaveButton"
56 + icon="el-icon-plus"
57 + size="small"
58 + @click="addcipherMachine"
59 + >
60 + 新 增
61 + </el-button>
62 + </div>
63 + <Table
64 + class="fedexDetialTable fedexSreachTable"
65 + ref="entryTable"
66 + :data="tableData"
67 + :headerData="headerData"
68 + :maxHeight="tableMaxheight"
69 + :border="true"
70 + :pagination="true"
71 + :order="true"
72 + noLabel="序号"
73 + :loading="loadings.searchLoading"
74 + :page="page.pageNum"
75 + :pageSizes="[20, 30, 50, 100]"
76 + :totalCount="page.total"
77 + @sizeChange="sizeChange"
78 + @currentChange="currentChange"
79 + :selection="false"
80 + :selectFixed="false"
81 + :rowSelectDataType="false"
82 + >
83 + <template slot="optionColumn">
84 + <el-table-column align="left" label="操作" width="100">
85 + <template slot-scope="scope">
86 + <el-button type="text" @click="update(scope.row)"> 修改 </el-button>
87 + </template>
88 + </el-table-column>
89 + </template>
90 + </Table>
91 + <DialogVue
92 + :outerVisible="outerVisible"
93 + :title="dialogTitle"
94 + :type="editType"
95 + :active="activeData"
96 + @close="dialogClose"
97 + />
98 + </div>
99 +</template>
100 +
101 +<script>
102 +import { getCipherMachineList } from "@/api/system/cipherMachine-api.js";
103 +import DialogVue from "./dialog.vue";
104 +export default {
105 + name: "RoleConfig",
106 + components: {
107 + DialogVue,
108 + },
109 + data() {
110 + return {
111 + sreachFormData: {
112 + cipherMachineNumber: "",
113 + creationTime: [],
114 + },
115 + page: {
116 + pageNum: 1,
117 + pageSize: 20,
118 + total: 0,
119 + },
120 + activeData: null,
121 + tableData: [],
122 + headerData: [
123 + {
124 + name: "密码机编号",
125 + value: "cipherMachineNumber",
126 + width: "",
127 + align: "left",
128 + },
129 + {
130 + name: "密码机IP地址",
131 + value: "ipAddress",
132 + width: "",
133 + align: "left",
134 + },
135 + {
136 + name: "密码机可使用用户数量",
137 + value: "availableUserCount",
138 + width: "",
139 + align: "left",
140 + },
141 + {
142 + name: "创建时间",
143 + value: "creationTime",
144 + width: "",
145 + align: "left",
146 + },
147 + {
148 + name: "创建人",
149 + value: "creator",
150 + width: "",
151 + align: "left",
152 + },
153 + {
154 + name: "修改时间",
155 + value: "modificationTime",
156 + width: "",
157 + align: "left",
158 + },
159 + {
160 + name: "修改人",
161 + value: "modifier",
162 + width: "",
163 + align: "left",
164 + },
165 + ],
166 + loadings: {
167 + searchLoading: false,
168 + },
169 + tableMaxheight: null,
170 + outerVisible: false,
171 + dialogTitle: "",
172 + editType: "",
173 + };
174 + },
175 + created() {
176 + this.search(0);
177 + },
178 + mounted() {
179 + this.tableMaxheight = window.innerHeight - 300;
180 + },
181 + methods: {
182 + //查询
183 + search(val) {
184 + this.loadings.searchLoading = true;
185 + if (val == 0) {
186 + this.page.pageNum = 1;
187 + }
188 + let obj = this.sreachFormData;
189 + obj.pageNum = this.page.pageNum;
190 + obj.pageSize = this.page.pageSize;
191 + obj.endCreationTime = "";
192 + obj.startCreationTime = "";
193 + if (obj.creationTime.length > 0) {
194 + obj.endCreationTime = obj.creationTime[0];
195 + obj.startCreationTime = obj.creationTime[1];
196 + }
197 + getCipherMachineList(obj)
198 + .then((res) => {
199 + if (res.code === "200") {
200 + this.tableData = res.data.value;
201 + this.page.total = res.data.totalItems;
202 + this.tableData.forEach((item, idx) => {
203 + item.index = idx;
204 + });
205 + } else {
206 + this.alertWarningMsg(res.message);
207 + }
208 + this.loadings.searchLoading = false;
209 + })
210 + .catch((err) => {
211 + console.log(err);
212 + this.loadings.searchLoading = false;
213 + });
214 + },
215 + addcipherMachine() {
216 + this.dialogTitle = "新增密码机";
217 + this.editType = "add";
218 + this.outerVisible = true;
219 + },
220 + update(val) {
221 + this.dialogTitle = "修改密码机";
222 + this.editType = "update";
223 + this.outerVisible = true;
224 + this.activeData = val;
225 + },
226 + dialogClose() {
227 + this.outerVisible = false;
228 + this.activeData = null;
229 + this.search(1);
230 + },
231 + //分页
232 + currentChange(val) {
233 + this.page.pageNum = val.page;
234 + this.search(1);
235 + },
236 + sizeChange(val) {
237 + this.page.pageSize = val;
238 + this.search(1);
239 + },
240 + input() {
241 + this.$forceUpdate();
242 + },
243 + dateChange(val) {
244 + if (val == "" || val == null) {
245 + this.$nextTick(() => {
246 + this.sreachFormData.creationTime = [];
247 + });
248 + }
249 + },
250 + },
251 +};
252 +</script>
253 +
254 +<style scoped lang="scss">
255 +@import "@/assets/styles/variables.scss";
256 +.entrySreach {
257 + height: 100%;
258 + background-color: $menuLightBg;
259 +
260 + .entrySreachButton {
261 + display: inline-block;
262 + font-size: 20px;
263 + color: $fedexButton !important;
264 + }
265 +
266 + .optionButton {
267 + padding: 10px;
268 + text-align: left;
269 +
270 + .el-button {
271 + color: $fedexButton;
272 + border-color: $fedexButton !important;
273 +
274 + svg {
275 + display: inline-block;
276 + margin-right: 5px;
277 + fill: $fedexButton;
278 + }
279 + }
280 +
281 + .entrySaveButton:hover,
282 + .entrySaveButton:focus {
283 + color: $menuLightBg !important;
284 + background-color: $fedexButton !important;
285 + }
286 + }
287 +}
288 +
289 +.texttareaTip {
290 + position: absolute;
291 + top: 52%;
292 + right: 20px;
293 + transform: translate(0, -50%);
294 + z-index: 10;
295 +}
296 +</style>
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
63 prefix-icon="none" 63 prefix-icon="none"
64 value-format="yyyy-MM-dd" 64 value-format="yyyy-MM-dd"
65 range-separator="至" 65 range-separator="至"
66 - @chagne="dateChange" 66 + @change="dateChange"
67 /> 67 />
68 </Formitem> 68 </Formitem>
69 </el-col> 69 </el-col>
...@@ -346,7 +346,13 @@ export default { ...@@ -346,7 +346,13 @@ export default {
346 this.page.pageSize = val; 346 this.page.pageSize = val;
347 this.search(1); 347 this.search(1);
348 }, 348 },
349 - dateChange(val) {}, 349 + dateChange(val) {
350 + if (val == "" || val == null) {
351 + this.$nextTick(() => {
352 + this.sreachFormData.createTime = [];
353 + });
354 + }
355 + },
350 input() { 356 input() {
351 this.$forceUpdate(); 357 this.$forceUpdate();
352 }, 358 },
......
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
112 prefix-icon="none" 112 prefix-icon="none"
113 value-format="yyyy-MM-dd" 113 value-format="yyyy-MM-dd"
114 range-separator="至" 114 range-separator="至"
115 - @chagne="dateChange" 115 + @change="dateChange"
116 /> 116 />
117 </Formitem> 117 </Formitem>
118 </el-col> 118 </el-col>
...@@ -174,7 +174,9 @@ ...@@ -174,7 +174,9 @@
174 <span>{{ scope.row.returnStatus }}</span> 174 <span>{{ scope.row.returnStatus }}</span>
175 </template> 175 </template>
176 <template v-slot:logisticsNo="scope"> 176 <template v-slot:logisticsNo="scope">
177 - <el-button type="text" @click="view(scope.row)">{{ scope.row.logisticsNo }}</el-button> 177 + <el-button type="text" @click="view(scope.row)">{{
178 + scope.row.logisticsNo
179 + }}</el-button>
178 </template> 180 </template>
179 </Table> 181 </Table>
180 </div> 182 </div>
...@@ -401,7 +403,13 @@ export default { ...@@ -401,7 +403,13 @@ export default {
401 this.page.pageSize = val; 403 this.page.pageSize = val;
402 this.search(1); 404 this.search(1);
403 }, 405 },
404 - dateChange(val) {}, 406 + dateChange(val) {
407 + if (val == "" || val == null) {
408 + this.$nextTick(() => {
409 + this.sreachFormData.createTime = [];
410 + });
411 + }
412 + },
405 input() { 413 input() {
406 this.$forceUpdate(); 414 this.$forceUpdate();
407 }, 415 },
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
59 prefix-icon="none" 59 prefix-icon="none"
60 value-format="yyyy-MM-dd" 60 value-format="yyyy-MM-dd"
61 range-separator="至" 61 range-separator="至"
62 - @chagne="dateChange" 62 + @change="dateChange"
63 /> 63 />
64 </Formitem> 64 </Formitem>
65 </el-col> 65 </el-col>
...@@ -605,7 +605,13 @@ export default { ...@@ -605,7 +605,13 @@ export default {
605 input() { 605 input() {
606 this.$forceUpdate(); 606 this.$forceUpdate();
607 }, 607 },
608 - dateChange(val) {}, 608 + dateChange(val) {
609 + if (val == "" || val == null) {
610 + this.$nextTick(() => {
611 + this.sreachFormData.createTime = [];
612 + });
613 + }
614 + },
609 }, 615 },
610 }; 616 };
611 </script> 617 </script>
......
...@@ -87,13 +87,13 @@ ...@@ -87,13 +87,13 @@
87 </el-col> 87 </el-col>
88 <!-- 传真 --> 88 <!-- 传真 -->
89 <el-col :span="8"> 89 <el-col :span="8">
90 - <Formitem label="传真" prop="fex" type="edit"> 90 + <Formitem label="传真" prop="fax" type="edit">
91 <el-input 91 <el-input
92 type="text" 92 type="text"
93 class="inputShadow" 93 class="inputShadow"
94 - id="inputInner-edit-fex" 94 + id="inputInner-edit-fax"
95 resize="none" 95 resize="none"
96 - v-model="formData.fex" 96 + v-model="formData.fax"
97 clearable 97 clearable
98 placeholder="" 98 placeholder=""
99 ></el-input> 99 ></el-input>
...@@ -195,7 +195,12 @@ ...@@ -195,7 +195,12 @@
195 </template> 195 </template>
196 196
197 <script> 197 <script>
198 -import { updateUserData, updateUserRoleChange } from "@/api/system/user.js"; 198 +import {
199 + updateUserData,
200 + updateUserRoleChange,
201 + getUserRoleType,
202 + getUserDetailData,
203 +} from "@/api/system/user.js";
199 export default { 204 export default {
200 props: { 205 props: {
201 outerVisible: { 206 outerVisible: {
...@@ -224,12 +229,6 @@ export default { ...@@ -224,12 +229,6 @@ export default {
224 }, 229 },
225 }, 230 },
226 }, 231 },
227 - watch: {
228 - outerVisible(val) {
229 - if (val) {
230 - }
231 - },
232 - },
233 data() { 232 data() {
234 return { 233 return {
235 formData: { 234 formData: {
...@@ -237,7 +236,7 @@ export default { ...@@ -237,7 +236,7 @@ export default {
237 username: "", 236 username: "",
238 remark: "", 237 remark: "",
239 port: "", 238 port: "",
240 - fex: "", 239 + fax: "",
241 phone: "", 240 phone: "",
242 employeeNumber: "", 241 employeeNumber: "",
243 email: "", 242 email: "",
...@@ -282,20 +281,44 @@ export default { ...@@ -282,20 +281,44 @@ export default {
282 outerVisible(val) { 281 outerVisible(val) {
283 if (val) { 282 if (val) {
284 this.loadings.dialogLoading = false; 283 this.loadings.dialogLoading = false;
284 + this.searchUserData(this.active.id);
285 if (this.type == "update") { 285 if (this.type == "update") {
286 - this.formData = this.active;
287 } else if (this.type == "roleChange") { 286 } else if (this.type == "roleChange") {
288 - this.portDataInfo(); 287 + this.searchRoleData();
289 - this.formData = this.active;
290 - this.searchTreeData();
291 } 288 }
292 } 289 }
293 }, 290 },
294 }, 291 },
295 methods: { 292 methods: {
293 + //查询用户信息详情
294 + searchUserData(id) {
295 + this.loadings.dialogLoading = true;
296 + getUserDetailData({ id: id })
297 + .then((res) => {
298 + if (res.code === "200") {
299 + this.formData = res.data;
300 + } else {
301 + this.alertWarningMsg(res.message);
302 + }
303 + this.loadings.dialogLoading = false;
304 + })
305 + .catch((err) => {
306 + console.log(err);
307 + this.loadings.dialogLoading = false;
308 + });
309 + },
296 //查询角色 310 //查询角色
297 - searchTreeData() { 311 + searchRoleData() {
298 - // this.loadings.dialogLoading = true; 312 + getUserRoleType({ userId: this.active.id })
313 + .then((res) => {
314 + if (res.code === "200") {
315 + let unassigned = res.data.unassigned.concat(res.data.assigned);
316 + this.portDataInfo(unassigned, res.data.assigned);
317 + }
318 + })
319 + .catch((err) => {
320 + console.log(err);
321 + });
299 }, 322 },
300 //数据保存 323 //数据保存
301 submit() { 324 submit() {
...@@ -404,14 +427,15 @@ export default { ...@@ -404,14 +427,15 @@ export default {
404 }); 427 });
405 }, 428 },
406 //穿梭框数据初始化 429 //穿梭框数据初始化
407 - portDataInfo() { 430 + portDataInfo(roleList, valueList) {
408 let arr = []; 431 let arr = [];
409 let select = []; 432 let select = [];
410 - if (this.active.roleName != null && this.active.roleName != "") { 433 + if (valueList != null && valueList != "") {
411 - select = this.active.roleName.split(";"); 434 + valueList.forEach((item) => {
435 + select.push(item.roleId);
436 + });
412 } 437 }
413 - let value = []; 438 + roleList.forEach((item, idx) => {
414 - this.dict.roleList.forEach((item, idx) => {
415 let obj = { 439 let obj = {
416 index: idx, 440 index: idx,
417 poolCode: item.roleId, 441 poolCode: item.roleId,
...@@ -419,12 +443,9 @@ export default { ...@@ -419,12 +443,9 @@ export default {
419 disabled: false, 443 disabled: false,
420 }; 444 };
421 arr.push(obj); 445 arr.push(obj);
422 - if (select.includes(item.roleName)) {
423 - value.push(item.roleId);
424 - }
425 }); 446 });
426 this.customData = arr; 447 this.customData = arr;
427 - this.value = value; 448 + this.value = select;
428 }, 449 },
429 close() { 450 close() {
430 this.formData = { 451 this.formData = {
...@@ -436,6 +457,10 @@ export default { ...@@ -436,6 +457,10 @@ export default {
436 employeeNumber: "", 457 employeeNumber: "",
437 email: "", 458 email: "",
438 }; 459 };
460 + this.customData = [];
461 + this.rightSelect = [];
462 + this.value = [];
463 + this.rightSelectIdx = 0;
439 this.$emit("close"); 464 this.$emit("close");
440 }, 465 },
441 }, 466 },
......
...@@ -146,7 +146,7 @@ ...@@ -146,7 +146,7 @@
146 </template> 146 </template>
147 147
148 <script> 148 <script>
149 -import { getRoleList, getUserData, getPortList } from "@/api/system/user.js"; 149 +import { getRoleDict, getUserData, getPortList } from "@/api/system/user.js";
150 import DialogVue from "../userRoleConfig/dialog.vue"; 150 import DialogVue from "../userRoleConfig/dialog.vue";
151 export default { 151 export default {
152 name: "UserRoleConfig", 152 name: "UserRoleConfig",
...@@ -267,7 +267,7 @@ export default { ...@@ -267,7 +267,7 @@ export default {
267 }, 267 },
268 //查询角色 268 //查询角色
269 searchRole() { 269 searchRole() {
270 - getRoleList({ roleName: "", pageNum: 1, pageSize: 999999 }) 270 + getRoleDict()
271 .then((res) => { 271 .then((res) => {
272 if (res.code === "200") { 272 if (res.code === "200") {
273 this.dict.roleList = res.data.value; 273 this.dict.roleList = res.data.value;
......