zhanbo.xu

feat: 开发监管场所

...@@ -32,3 +32,13 @@ export function updateOperatorPlace(data) { ...@@ -32,3 +32,13 @@ export function updateOperatorPlace(data) {
32 data: data, 32 data: data,
33 }); 33 });
34 } 34 }
35 +
36 +// GET
37 +// ​/portInfo​/getPortCodeList
38 +// 获取口岸列表作用于条件查询的下拉框
39 +export function getPortCodeList() {
40 + return request({
41 + url: "/bus-customer/portInfo/getPortCodeList",
42 + method: "get",
43 + });
44 +}
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
12 > 12 >
13 <div class="modelItem"> 13 <div class="modelItem">
14 <el-form 14 <el-form
15 - v-if="type != 'menuChange'"
16 class="fedexFormStyle" 15 class="fedexFormStyle"
17 ref="formData" 16 ref="formData"
18 :model="formData" 17 :model="formData"
...@@ -57,17 +56,25 @@ ...@@ -57,17 +56,25 @@
57 </el-col> 56 </el-col>
58 <el-col :span="8"> 57 <el-col :span="8">
59 <Formitem label="所属口岸" prop="portCode" type="edit"> 58 <Formitem label="所属口岸" prop="portCode" type="edit">
60 - <el-input 59 + <el-select
61 type="text" 60 type="text"
62 - class="inputShadow" 61 + id="inputInner--portCode"
63 - id="inputInner-edit-portCode"
64 - resize="none"
65 v-model="formData.portCode" 62 v-model="formData.portCode"
66 clearable 63 clearable
64 + filterable
67 placeholder="" 65 placeholder=""
68 - ></el-input> 66 + >
67 + <el-option
68 + v-for="item in portCodeList"
69 + :key="item"
70 + :label="item"
71 + :value="item"
72 + ></el-option>
73 + </el-select>
69 </Formitem> 74 </Formitem>
70 </el-col> 75 </el-col>
76 + </el-row>
77 + <el-row :gutter="5">
71 <el-col :span="8"> 78 <el-col :span="8">
72 <Formitem label="监管场所代码" prop="loctNo" type="edit"> 79 <Formitem label="监管场所代码" prop="loctNo" type="edit">
73 <el-input 80 <el-input
...@@ -113,20 +120,6 @@ ...@@ -113,20 +120,6 @@
113 </el-col> 120 </el-col>
114 </el-row> 121 </el-row>
115 </el-form> 122 </el-form>
116 - <el-tree
117 - ref="tree"
118 - class="menuTree"
119 - v-else
120 - :data="treeData"
121 - show-checkbox
122 - default-expand-all
123 - node-key="id"
124 - :default-expanded-keys="expandedKeys"
125 - :default-checked-keys="checkedKeys"
126 - :props="defaultProps"
127 - @check="treeCheckChange"
128 - >
129 - </el-tree>
130 </div> 123 </div>
131 <div class="dialogOption entrySave"> 124 <div class="dialogOption entrySave">
132 <el-button 125 <el-button
...@@ -147,12 +140,9 @@ ...@@ -147,12 +140,9 @@
147 140
148 <script> 141 <script>
149 import { 142 import {
150 - addRoleData, 143 + addOperatorPlace,
151 - updateRoleData, 144 + updateOperatorPlace,
152 - updateRoleMenuData, 145 +} from "@/api/supervisePlaceManage-api.js";
153 - getMenuByRoleId,
154 -} from "@/api/system/user.js";
155 -import { getRouters } from "@/api/menu";
156 export default { 146 export default {
157 props: { 147 props: {
158 outerVisible: { 148 outerVisible: {
...@@ -161,7 +151,7 @@ export default { ...@@ -161,7 +151,7 @@ export default {
161 }, 151 },
162 title: { 152 title: {
163 type: String, 153 type: String,
164 - default: "新增角色", 154 + default: "监管场所管理新增",
165 }, 155 },
166 type: { 156 type: {
167 type: String, 157 type: String,
...@@ -171,6 +161,12 @@ export default { ...@@ -171,6 +161,12 @@ export default {
171 type: Object, 161 type: Object,
172 default: null, 162 default: null,
173 }, 163 },
164 + portCodeList: {
165 + type: Array,
166 + default: () => {
167 + return [];
168 + },
169 + },
174 }, 170 },
175 watch: { 171 watch: {
176 outerVisible(val) { 172 outerVisible(val) {
...@@ -178,10 +174,6 @@ export default { ...@@ -178,10 +174,6 @@ export default {
178 this.loadings.dialogLoading = false; 174 this.loadings.dialogLoading = false;
179 if (this.type == "update") { 175 if (this.type == "update") {
180 this.formData = this.active; 176 this.formData = this.active;
181 - } else if (this.type == "menuChange") {
182 - this.formData = this.active;
183 - this.searchTreeData();
184 - this.loadCheckedKeys(); //加载已绑定的菜单
185 } 177 }
186 } 178 }
187 }, 179 },
...@@ -196,23 +188,23 @@ export default { ...@@ -196,23 +188,23 @@ export default {
196 operatorPersonInCharge: "", 188 operatorPersonInCharge: "",
197 contactNumber: "", 189 contactNumber: "",
198 }, 190 },
199 - treeData: [],
200 - treeCheckData: [],
201 - expandedKeys: [],
202 - checkedKeys: [],
203 rules: { 191 rules: {
204 - roleName: [ 192 + operatorCode: [
205 { 193 {
206 required: true, 194 required: true,
207 trigger: "blur", 195 trigger: "blur",
208 - message: "角色名称不能为空!", 196 + message: "监管场所代码不能为空!",
209 }, 197 },
210 ], 198 ],
199 + operatorName: [
200 + {
201 + required: true,
202 + trigger: "blur",
203 + message: "监管场所负责人不能为空!",
211 }, 204 },
212 - defaultProps: { 205 + ],
213 - children: "children",
214 - label: "label",
215 }, 206 },
207 +
216 searchForm: {}, 208 searchForm: {},
217 loadings: { 209 loadings: {
218 dialogLoading: false, 210 dialogLoading: false,
...@@ -223,69 +215,15 @@ export default { ...@@ -223,69 +215,15 @@ export default {
223 }; 215 };
224 }, 216 },
225 methods: { 217 methods: {
226 - //查询菜单数据
227 - searchTreeData() {
228 - this.loadings.dialogLoading = true;
229 - getRouters()
230 - .then((res) => {
231 - if (res.code === "200") {
232 - let arr = [];
233 - res.data.forEach((item) => {
234 - let status = true;
235 - if (item.parentMenuId == 0) {
236 - let obj = {
237 - id: item.menuId,
238 - label: item.menuName,
239 - children: [],
240 - };
241 - arr.forEach((menuItem) => {
242 - if (menuItem.id == item.menuId) {
243 - status = false;
244 - menuItem.label = item.menuName;
245 - }
246 - });
247 - if (status) {
248 - arr.push(obj);
249 - }
250 - } else {
251 - let obj = {
252 - id: item.menuId,
253 - label: item.menuName,
254 - };
255 - arr.forEach((menuItem) => {
256 - if (menuItem.id == item.parentMenuId) {
257 - status = false;
258 - menuItem.children.push(obj);
259 - }
260 - });
261 - if (status) {
262 - arr.push({
263 - id: item.parentMenuId,
264 - label: "",
265 - children: [obj],
266 - });
267 - }
268 - }
269 - });
270 - this.treeData = arr;
271 - } else {
272 - this.alertWarningMsg(res.message);
273 - }
274 - this.loadings.dialogLoading = false;
275 - })
276 - .catch((err) => {
277 - console.log(err);
278 - this.loadings.dialogLoading = false;
279 - });
280 - },
281 //数据保存 218 //数据保存
282 submit() { 219 submit() {
283 this.loadings.dialogLoading = true; 220 this.loadings.dialogLoading = true;
284 - let obj = {}; 221 + let obj = {
222 + ...this.formData,
223 + };
285 if (this.type == "add") { 224 if (this.type == "add") {
286 this.$refs.formData.validate((valid) => { 225 this.$refs.formData.validate((valid) => {
287 if (valid) { 226 if (valid) {
288 - obj.roleName = this.formData.roleName;
289 this.addapi(obj); 227 this.addapi(obj);
290 } else { 228 } else {
291 this.loadings.dialogLoading = false; 229 this.loadings.dialogLoading = false;
...@@ -294,22 +232,17 @@ export default { ...@@ -294,22 +232,17 @@ export default {
294 } else if (this.type == "update") { 232 } else if (this.type == "update") {
295 this.$refs.formData.validate((valid) => { 233 this.$refs.formData.validate((valid) => {
296 if (valid) { 234 if (valid) {
297 - obj.roleId = this.formData.roleId; 235 + obj.id = this.active.id;
298 - obj.roleName = this.formData.roleName;
299 this.updateapi(obj); 236 this.updateapi(obj);
300 } else { 237 } else {
301 this.loadings.dialogLoading = false; 238 this.loadings.dialogLoading = false;
302 } 239 }
303 }); 240 });
304 - } else if (this.type == "menuChange") {
305 - obj.menuId = this.treeCheckData; // 使用合并后的选中节点
306 - obj.roleId = this.formData.roleId;
307 - this.menuChangeapi(obj);
308 } 241 }
309 }, 242 },
310 //新增 243 //新增
311 addapi(val) { 244 addapi(val) {
312 - addRoleData(val) 245 + addOperatorPlace(val)
313 .then((res) => { 246 .then((res) => {
314 if (res.code === "200") { 247 if (res.code === "200") {
315 this.msgSuccess(res.message); 248 this.msgSuccess(res.message);
...@@ -326,7 +259,7 @@ export default { ...@@ -326,7 +259,7 @@ export default {
326 }, 259 },
327 //修改 260 //修改
328 updateapi(val) { 261 updateapi(val) {
329 - updateRoleData(val) 262 + updateOperatorPlace(val)
330 .then((res) => { 263 .then((res) => {
331 if (res.code === "200") { 264 if (res.code === "200") {
332 this.msgSuccess(res.message); 265 this.msgSuccess(res.message);
...@@ -343,7 +276,7 @@ export default { ...@@ -343,7 +276,7 @@ export default {
343 }, 276 },
344 //菜单权限修改 277 //菜单权限修改
345 menuChangeapi(val) { 278 menuChangeapi(val) {
346 - updateRoleMenuData(val) 279 + updateOperatorPlace(val)
347 .then((res) => { 280 .then((res) => {
348 if (res.code === "200") { 281 if (res.code === "200") {
349 this.msgSuccess(res.message); 282 this.msgSuccess(res.message);
...@@ -359,49 +292,18 @@ export default { ...@@ -359,49 +292,18 @@ export default {
359 this.loadings.dialogLoading = false; 292 this.loadings.dialogLoading = false;
360 }); 293 });
361 }, 294 },
362 - treeCheckChange(data, checked) { 295 +
363 - console.log(data, checked);
364 - let arr = [];
365 - arr = checked.checkedKeys.concat(checked.halfCheckedKeys);
366 - this.treeCheckData = arr;
367 - },
368 close() { 296 close() {
369 this.formData = { 297 this.formData = {
370 - roleName: "", 298 + operatorCode: "",
299 + operatorName: "",
300 + portCode: "",
301 + loctNo: "",
302 + operatorPersonInCharge: "",
303 + contactNumber: "",
371 }; 304 };
372 - this.checkedKeys = [];
373 this.$emit("close"); 305 this.$emit("close");
374 }, 306 },
375 - // 加载已绑定的菜单
376 - loadCheckedKeys() {
377 - if (this.formData.roleId) {
378 - getMenuByRoleId(this.formData.roleId)
379 - .then((res) => {
380 - if (res.code === "200") {
381 - this.checkedKeys = res.data
382 - .filter((item) => item.isBinding && item.parentMenuId != 0)
383 - .map((item) => item.menuId);
384 - //console.log('初始 checkedKeys:', this.checkedKeys);
385 - this.$nextTick(() => {
386 - this.$refs.tree.setCheckedKeys(this.checkedKeys);
387 - this.updateTreeCheckData();
388 - });
389 - } else {
390 - this.alertWarningMsg(res.message);
391 - }
392 - })
393 - .catch((err) => {
394 - console.log(err);
395 - });
396 - }
397 - },
398 - //加载选中的节点及半选中的父节点
399 - updateTreeCheckData() {
400 - const checkedKeys = this.$refs.tree.getCheckedKeys();
401 - const halfCheckedKeys = this.$refs.tree.getHalfCheckedKeys();
402 - this.treeCheckData = checkedKeys.concat(halfCheckedKeys);
403 - //console.log('合并后的 treeCheckData:', this.treeCheckData);
404 - },
405 }, 307 },
406 }; 308 };
407 </script> 309 </script>
......
...@@ -37,15 +37,21 @@ ...@@ -37,15 +37,21 @@
37 </el-col> 37 </el-col>
38 <el-col :span="5"> 38 <el-col :span="5">
39 <Formitem label="所属口岸" prop="portCode"> 39 <Formitem label="所属口岸" prop="portCode">
40 - <el-input 40 + <el-select
41 type="text" 41 type="text"
42 - class="inputShadow"
43 id="inputInner--portCode" 42 id="inputInner--portCode"
44 - resize="none"
45 v-model="sreachFormData.portCode" 43 v-model="sreachFormData.portCode"
46 clearable 44 clearable
45 + filterable
47 placeholder="" 46 placeholder=""
48 - ></el-input> 47 + >
48 + <el-option
49 + v-for="item in portCodeList"
50 + :key="item"
51 + :label="item"
52 + :value="item"
53 + ></el-option>
54 + </el-select>
49 </Formitem> 55 </Formitem>
50 </el-col> 56 </el-col>
51 <el-col :span="2"> 57 <el-col :span="2">
...@@ -106,12 +112,7 @@ ...@@ -106,12 +112,7 @@
106 <template slot="optionColumn"> 112 <template slot="optionColumn">
107 <el-table-column align="left" label="操作"> 113 <el-table-column align="left" label="操作">
108 <template slot-scope="scope"> 114 <template slot-scope="scope">
109 - <el-button type="text" @click="update(scope.row)"> 115 + <el-button type="text" @click="update(scope.row)"> 修改 </el-button>
110 - 角色修改
111 - </el-button>
112 - <el-button type="text" @click="muenChange(scope.row)">
113 - 权限绑定
114 - </el-button>
115 </template> 116 </template>
116 </el-table-column> 117 </el-table-column>
117 </template> 118 </template>
...@@ -122,12 +123,16 @@ ...@@ -122,12 +123,16 @@
122 :type="editType" 123 :type="editType"
123 :active="activeData" 124 :active="activeData"
124 @close="dialogClose" 125 @close="dialogClose"
126 + :portCodeList="portCodeList"
125 /> 127 />
126 </div> 128 </div>
127 </template> 129 </template>
128 130
129 <script> 131 <script>
130 -import { getOperatorPlaceList } from "@/api/supervisePlaceManage-api.js"; 132 +import {
133 + getOperatorPlaceList,
134 + getPortCodeList,
135 +} from "@/api/supervisePlaceManage-api.js";
131 import DialogVue from "./dialog.vue"; 136 import DialogVue from "./dialog.vue";
132 export default { 137 export default {
133 name: "SupervisePlaceManage", 138 name: "SupervisePlaceManage",
...@@ -193,6 +198,7 @@ export default { ...@@ -193,6 +198,7 @@ export default {
193 outerVisible: false, 198 outerVisible: false,
194 dialogTitle: "", 199 dialogTitle: "",
195 editType: "", 200 editType: "",
201 + portCodeList: [],
196 }; 202 };
197 }, 203 },
198 created() { 204 created() {
...@@ -200,8 +206,22 @@ export default { ...@@ -200,8 +206,22 @@ export default {
200 }, 206 },
201 mounted() { 207 mounted() {
202 this.tableMaxheight = window.innerHeight - 300; 208 this.tableMaxheight = window.innerHeight - 300;
209 + this.fetchPortCodeList();
203 }, 210 },
204 methods: { 211 methods: {
212 + // 获取所属口岸
213 + fetchPortCodeList() {
214 + getPortCodeList()
215 + .then((res) => {
216 + if (res.code === "200") {
217 + this.portCodeList = res.data;
218 + } else {
219 + }
220 + })
221 + .catch((err) => {
222 + console.log(err);
223 + });
224 + },
205 clear() { 225 clear() {
206 this.$refs.sreachForm.resetFields(); 226 this.$refs.sreachForm.resetFields();
207 }, 227 },
...@@ -233,22 +253,17 @@ export default { ...@@ -233,22 +253,17 @@ export default {
233 }); 253 });
234 }, 254 },
235 addRole() { 255 addRole() {
236 - this.dialogTitle = "新增角色"; 256 + this.dialogTitle = "监管场所管理新增";
237 this.editType = "add"; 257 this.editType = "add";
238 this.outerVisible = true; 258 this.outerVisible = true;
239 }, 259 },
240 update(val) { 260 update(val) {
241 - this.dialogTitle = "修改角色"; 261 + this.dialogTitle = "监管场所管理修改";
242 this.editType = "update"; 262 this.editType = "update";
243 this.outerVisible = true; 263 this.outerVisible = true;
244 - this.activeData = val; 264 + this.activeData = JSON.parse(JSON.stringify(val));
245 - },
246 - muenChange(val) {
247 - this.dialogTitle = "绑定权限";
248 - this.editType = "menuChange";
249 - this.outerVisible = true;
250 - this.activeData = val;
251 }, 265 },
266 +
252 dialogClose() { 267 dialogClose() {
253 this.outerVisible = false; 268 this.outerVisible = false;
254 this.activeData = null; 269 this.activeData = null;
......