【禅道#1274】 乙方运维人员信息录入功能开发
Showing
4 changed files
with
71 additions
and
15 deletions
@@ -2,9 +2,18 @@ | @@ -2,9 +2,18 @@ | ||
2 | <div> | 2 | <div> |
3 | <!-- 人员信息总汇--> | 3 | <!-- 人员信息总汇--> |
4 | <el-divider content-position="left">人员信息汇总</el-divider> | 4 | <el-divider content-position="left">人员信息汇总</el-divider> |
5 | + <el-button @click="add" style="float:right;margin-right: 6px;margin-bottom: 6px">录入</el-button> | ||
5 | <cm-table-page :columns="columns" :dataList="dataList" @loaddata="getPage" :showIndex="true" | 6 | <cm-table-page :columns="columns" :dataList="dataList" @loaddata="getPage" :showIndex="true" |
6 | - :showBorder="true" :currentPage="currentPage" :total="total" :loading="false" | ||
7 | - :showPage="true" :height="height" :pageSize="pageSize"></cm-table-page> | 7 | + :showBorder="true" :currentPage="currentPage" :total="total" :loading="false" :showSelection="true" |
8 | + :showPage="true" :showTools="true" :height="height" :pageSize="pageSize"> | ||
9 | + <template #tools="{scope}"> | ||
10 | + <div class="list-handle"> | ||
11 | + <span class="icon-bg"> | ||
12 | + <i class="el-icon-delete" title="删除" @click="deleteUser(scope.row)"></i> | ||
13 | + </span> | ||
14 | + </div> | ||
15 | + </template> | ||
16 | + </cm-table-page> | ||
8 | </div> | 17 | </div> |
9 | <cm-dialog :title="title" width="80%" :showDialogVisible="dialogFlg" @hidedialog="showDialog" :showFooter="false"> | 18 | <cm-dialog :title="title" width="80%" :showDialogVisible="dialogFlg" @hidedialog="showDialog" :showFooter="false"> |
10 | <template v-slot> | 19 | <template v-slot> |
@@ -14,7 +23,7 @@ | @@ -14,7 +23,7 @@ | ||
14 | height="500" | 23 | height="500" |
15 | :docTypeName="docTypeName" | 24 | :docTypeName="docTypeName" |
16 | :pageSize="pageSize" | 25 | :pageSize="pageSize" |
17 | - :treeNode="treeNode" :parentNode="parentNode" :projectId="projectId"></component> | 26 | + :treeNode="treeNode" :parentNode="parentNode" :projectId="projectId" :isAdd="isAdd"></component> |
18 | </div> | 27 | </div> |
19 | </template> | 28 | </template> |
20 | </cm-dialog> | 29 | </cm-dialog> |
@@ -53,6 +53,7 @@ export default { | @@ -53,6 +53,7 @@ export default { | ||
53 | let docTypeName = Vue.ref(''); | 53 | let docTypeName = Vue.ref(''); |
54 | let componentName = Vue.ref(''); | 54 | let componentName = Vue.ref(''); |
55 | let dialogFlg = Vue.ref(false); | 55 | let dialogFlg = Vue.ref(false); |
56 | + let isAdd = Vue.ref(false); | ||
56 | 57 | ||
57 | 58 | ||
58 | let columns = Vue.ref([{ | 59 | let columns = Vue.ref([{ |
@@ -64,6 +65,7 @@ export default { | @@ -64,6 +65,7 @@ export default { | ||
64 | title.value = "个人信息"; | 65 | title.value = "个人信息"; |
65 | componentName.value = "USER"; | 66 | componentName.value = "USER"; |
66 | props.parentNode.id = row.id; | 67 | props.parentNode.id = row.id; |
68 | + isAdd.value = false; | ||
67 | showDialog(true); | 69 | showDialog(true); |
68 | } | 70 | } |
69 | }, { | 71 | }, { |
@@ -107,6 +109,7 @@ export default { | @@ -107,6 +109,7 @@ export default { | ||
107 | title.value = "个人信息"; | 109 | title.value = "个人信息"; |
108 | componentName.value = "USER"; | 110 | componentName.value = "USER"; |
109 | props.parentNode.id = row.id; | 111 | props.parentNode.id = row.id; |
112 | + isAdd.value = false; | ||
110 | showDialog(true); | 113 | showDialog(true); |
111 | }, | 114 | }, |
112 | render: function (row) { | 115 | render: function (row) { |
@@ -172,6 +175,29 @@ export default { | @@ -172,6 +175,29 @@ export default { | ||
172 | let currentPage = Vue.ref(1); | 175 | let currentPage = Vue.ref(1); |
173 | let total = Vue.ref(0); | 176 | let total = Vue.ref(0); |
174 | 177 | ||
178 | + let add=()=>{ | ||
179 | + title.value = "运维人员录入"; | ||
180 | + componentName.value = "USER"; | ||
181 | + isAdd.value = true; | ||
182 | + showDialog(true); | ||
183 | + } | ||
184 | + | ||
185 | + let deleteUser = (row) =>{ | ||
186 | + let params={ | ||
187 | + id:row.id | ||
188 | + } | ||
189 | + proxy.$http.get("/api-web/bOpsPerson/delete", params, function (res) { | ||
190 | + if (res.success){ | ||
191 | + proxy.$global.showMsg("删除成功!","success"); | ||
192 | + getPage(); | ||
193 | + }else { | ||
194 | + proxy.$global.showMsg("删除失败!","error"); | ||
195 | + } | ||
196 | + | ||
197 | + }); | ||
198 | + | ||
199 | + } | ||
200 | + | ||
175 | // 获取表格数据 | 201 | // 获取表格数据 |
176 | let getPage = (obj) => { | 202 | let getPage = (obj) => { |
177 | if (!props.treeNode.map || !props.treeNode.map.nodeType) { | 203 | if (!props.treeNode.map || !props.treeNode.map.nodeType) { |
@@ -228,7 +254,10 @@ export default { | @@ -228,7 +254,10 @@ export default { | ||
228 | docTypeName, | 254 | docTypeName, |
229 | dialogFlg, | 255 | dialogFlg, |
230 | showDialog, | 256 | showDialog, |
231 | - componentName | 257 | + componentName, |
258 | + add, | ||
259 | + isAdd, | ||
260 | + deleteUser | ||
232 | } | 261 | } |
233 | } | 262 | } |
234 | } | 263 | } |
@@ -21,7 +21,7 @@ | @@ -21,7 +21,7 @@ | ||
21 | <el-row :gutter="5"> | 21 | <el-row :gutter="5"> |
22 | <el-col :span="8"> | 22 | <el-col :span="8"> |
23 | <el-form-item label="姓名" prop="nickname" class="form-class"> | 23 | <el-form-item label="姓名" prop="nickname" class="form-class"> |
24 | - <el-input v-model="ruleForm.nickname" :readonly="true"></el-input> | 24 | + <el-input v-model="ruleForm.nickname" :readonly="whether"></el-input> |
25 | </el-form-item> | 25 | </el-form-item> |
26 | </el-col> | 26 | </el-col> |
27 | <el-col :span="8"> | 27 | <el-col :span="8"> |
@@ -100,7 +100,7 @@ | @@ -100,7 +100,7 @@ | ||
100 | </el-col> | 100 | </el-col> |
101 | <el-col :span="8"> | 101 | <el-col :span="8"> |
102 | <el-form-item label="在职状态" prop="certificate" :readonly="true" class="form-class"> | 102 | <el-form-item label="在职状态" prop="certificate" :readonly="true" class="form-class"> |
103 | - <el-radio-group v-model="ruleForm.state" :disabled="true"> | 103 | + <el-radio-group v-model="ruleForm.state" :disabled="whether"> |
104 | <el-radio :label="1">在职</el-radio> | 104 | <el-radio :label="1">在职</el-radio> |
105 | <el-radio :label="2">离职</el-radio> | 105 | <el-radio :label="2">离职</el-radio> |
106 | </el-radio-group> | 106 | </el-radio-group> |
@@ -185,7 +185,10 @@ const assets = (props, {attrs, slots, emit}) => { | @@ -185,7 +185,10 @@ const assets = (props, {attrs, slots, emit}) => { | ||
185 | * 时间:2021/11/3 20:17 | 185 | * 时间:2021/11/3 20:17 |
186 | */ | 186 | */ |
187 | let showDialog = (flg) => { | 187 | let showDialog = (flg) => { |
188 | - op.value = flg; | 188 | + if (!props.isAdd){ |
189 | + op.value = flg; | ||
190 | + } | ||
191 | + proxy.$global.showMsg("请先添加用户!","error"); | ||
189 | } | 192 | } |
190 | 193 | ||
191 | let okFunc = () => { | 194 | let okFunc = () => { |
@@ -233,6 +236,10 @@ export default { | @@ -233,6 +236,10 @@ export default { | ||
233 | type: String, | 236 | type: String, |
234 | default: '' | 237 | default: '' |
235 | }, | 238 | }, |
239 | + isAdd: { | ||
240 | + type: Boolean, | ||
241 | + default: false | ||
242 | + } | ||
236 | }, | 243 | }, |
237 | data() { | 244 | data() { |
238 | return { | 245 | return { |
@@ -256,11 +263,11 @@ export default { | @@ -256,11 +263,11 @@ export default { | ||
256 | company: '', | 263 | company: '', |
257 | headImgUrl: '', | 264 | headImgUrl: '', |
258 | post: '', | 265 | post: '', |
259 | - projectId: null, | ||
260 | quitTime: '', | 266 | quitTime: '', |
261 | state: '', | 267 | state: '', |
262 | idcard:'', | 268 | idcard:'', |
263 | - politicsStatus:'' | 269 | + politicsStatus:'', |
270 | + busId:'' | ||
264 | }) | 271 | }) |
265 | 272 | ||
266 | 273 | ||
@@ -330,16 +337,19 @@ export default { | @@ -330,16 +337,19 @@ export default { | ||
330 | */ | 337 | */ |
331 | let rules=Vue.ref({ | 338 | let rules=Vue.ref({ |
332 | nickname: [ | 339 | nickname: [ |
333 | - { message: '请输入姓名', trigger: 'blur' } | 340 | + { required: true,message: '请输入姓名', trigger: 'blur' } |
334 | ], | 341 | ], |
335 | phone: [ | 342 | phone: [ |
336 | - { validator: checkPhone, trigger: 'blur' } | 343 | + { required: true,message:'请输入手机号',validator: checkPhone, trigger: 'blur' } |
337 | ], | 344 | ], |
338 | company: [ | 345 | company: [ |
339 | - { message:'请输入所在公司', trigger: 'blur' } | 346 | + { required: true,message:'请输入所在公司', trigger: 'blur' } |
340 | ], | 347 | ], |
341 | idcard: [ | 348 | idcard: [ |
342 | { validator:checkIdCard,message:'请输入正确的身份证号', trigger: 'blur'} | 349 | { validator:checkIdCard,message:'请输入正确的身份证号', trigger: 'blur'} |
350 | + ], | ||
351 | + entryTime: [ | ||
352 | + { required: true,message:'请选择入职时间', trigger: 'blur'} | ||
343 | ] | 353 | ] |
344 | }); | 354 | }); |
345 | 355 | ||
@@ -353,6 +363,7 @@ export default { | @@ -353,6 +363,7 @@ export default { | ||
353 | proxy.$refs.rule.validate((valid) => { | 363 | proxy.$refs.rule.validate((valid) => { |
354 | if (valid) { | 364 | if (valid) { |
355 | console.log('submit!!'); | 365 | console.log('submit!!'); |
366 | + ruleForm.value.busId = props.treeNode.map.nodeType.projectId; | ||
356 | proxy.$http.post("/api-web/bOpsPerson/saveOrUpdate", ruleForm.value, function (res) { | 367 | proxy.$http.post("/api-web/bOpsPerson/saveOrUpdate", ruleForm.value, function (res) { |
357 | if (res && res.code == 0) { | 368 | if (res && res.code == 0) { |
358 | proxy.$global.showMsg('保存成功!'); | 369 | proxy.$global.showMsg('保存成功!'); |
@@ -411,12 +422,18 @@ export default { | @@ -411,12 +422,18 @@ export default { | ||
411 | getAssetType, | 422 | getAssetType, |
412 | icon | 423 | icon |
413 | } = assets(props, {attrs, slots, emit}); | 424 | } = assets(props, {attrs, slots, emit}); |
414 | - | 425 | + let whether = Vue.ref(true); |
415 | // // 挂载完 | 426 | // // 挂载完 |
416 | Vue.onMounted(() => { | 427 | Vue.onMounted(() => { |
428 | + if (!props.isAdd){ | ||
429 | + getPage(); | ||
430 | + getAssets(); | ||
431 | + }else { | ||
432 | + whether.value = false; | ||
433 | + } | ||
417 | getAssetType(); | 434 | getAssetType(); |
418 | - getPage(); | ||
419 | - getAssets(); | 435 | + |
436 | + | ||
420 | }) | 437 | }) |
421 | 438 | ||
422 | // 监听编辑状态 | 439 | // 监听编辑状态 |
@@ -447,6 +464,7 @@ export default { | @@ -447,6 +464,7 @@ export default { | ||
447 | // 资产属性 | 464 | // 资产属性 |
448 | icon, | 465 | icon, |
449 | rules, | 466 | rules, |
467 | + whether | ||
450 | } | 468 | } |
451 | } | 469 | } |
452 | } | 470 | } |
-
Please register or login to post a comment