93547876 by xiaomiao

人员管理模块添加组织机构字段

1 parent 46a705e8
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
2 * @Author: xiaomiao 1158771342@qq.com 2 * @Author: xiaomiao 1158771342@qq.com
3 * @Date: 2023-01-30 17:59:51 3 * @Date: 2023-01-30 17:59:51
4 * @LastEditors: xiaomiao 1158771342@qq.com 4 * @LastEditors: xiaomiao 1158771342@qq.com
5 * @LastEditTime: 2023-03-21 15:00:39 5 * @LastEditTime: 2023-03-21 18:34:17
6 * @FilePath: \监管系统\js-web-jianguan\src\views\system\users\data\index.js 6 * @FilePath: \监管系统\js-web-jianguan\src\views\system\users\data\index.js
7 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE 7 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
8 */ 8 */
...@@ -32,13 +32,13 @@ class data extends filter { ...@@ -32,13 +32,13 @@ class data extends filter {
32 label: "组织机构" 32 label: "组织机构"
33 }, 33 },
34 { 34 {
35 prop: "job_group",
36 label: "职位"
37 },
38 {
39 prop: "telephone", 35 prop: "telephone",
40 label: "电话" 36 label: "电话"
41 } 37 },
38 {
39 prop: "jobLevel",
40 label: "职位"
41 },
42 ] 42 ]
43 } 43 }
44 } 44 }
......
...@@ -61,8 +61,8 @@ ...@@ -61,8 +61,8 @@
61 </el-row> 61 </el-row>
62 <el-row :gutter="24"> 62 <el-row :gutter="24">
63 <el-col :span="24"> 63 <el-col :span="24">
64 <el-form-item label="组织机构:" label-width="100px"> 64 <el-form-item label="组织机构:" label-width="100px" prop="departmentId">
65 <el-select class="selbig" v-model="form.departmentName" placeholder="组织机构"> 65 <el-select class="selbig" v-model="form.departmentId" placeholder="组织机构">
66 <el-option v-for="item in districtAreaList" :key="item.id" :label="item.name" :value="item.id" /> 66 <el-option v-for="item in districtAreaList" :key="item.id" :label="item.name" :value="item.id" />
67 </el-select> 67 </el-select>
68 </el-form-item> 68 </el-form-item>
...@@ -93,10 +93,12 @@ ...@@ -93,10 +93,12 @@
93 districtAreaList: [], 93 districtAreaList: [],
94 form: { 94 form: {
95 sex: "0", 95 sex: "0",
96 departmentId: '',
96 }, 97 },
97 rules: { 98 rules: {
98 name: [{ required: true, message: "请输入姓名", trigger: "blur" }], 99 name: [{ required: true, message: "请输入姓名", trigger: "blur" }],
99 code: [{ required: true, message: "请输入工号", trigger: "blur" }], 100 code: [{ required: true, message: "请输入工号", trigger: "blur" }],
101 departmentId: [{ required: true, message: "请选择组织机构", trigger: 'change' }],
100 mobilePhone: [{ validator: "sddd", trigger: "blur" }], 102 mobilePhone: [{ validator: "sddd", trigger: "blur" }],
101 loginName: [ 103 loginName: [
102 { required: true, message: "请输入用户名", trigger: "blur" }, 104 { required: true, message: "请输入用户名", trigger: "blur" },
...@@ -109,11 +111,6 @@ ...@@ -109,11 +111,6 @@
109 dataUrl: api.users 111 dataUrl: api.users
110 }; 112 };
111 }, 113 },
112 computed: {
113 departmentid () {
114 return this.$store.state.user.userInfo;
115 },
116 },
117 watch: { 114 watch: {
118 value (val) { 115 value (val) {
119 this.myValue = val 116 this.myValue = val
...@@ -147,17 +144,17 @@ ...@@ -147,17 +144,17 @@
147 }) 144 })
148 } 145 }
149 }, 146 },
150 handleChange (value) {
151 this.form.departmentId = value;
152 },
153 // 保存 147 // 保存
154 submitForm () { 148 submitForm () {
149 this.districtAreaList.forEach((item) => {
150 if (this.form.departmentId == item.id) {
151 this.form.organizationId = item.organizationId
152 }
153 })
155 this.$refs.form.validate((valid) => { 154 this.$refs.form.validate((valid) => {
156 if (valid) { 155 if (valid) {
157 let method = '' 156 let method = ''
158 let url = '' 157 let url = ''
159 this.form.organizationId = this.departmentid.organizationId;
160 this.form.departmentId = this.departmentid.departmentId;
161 const formData = this.form 158 const formData = this.form
162 if (!formData.id) { 159 if (!formData.id) {
163 method = 'post' 160 method = 'post'
...@@ -166,7 +163,6 @@ ...@@ -166,7 +163,6 @@
166 method = 'put' 163 method = 'put'
167 url = `${this.dataUrl}/${formData.id}` 164 url = `${this.dataUrl}/${formData.id}`
168 } 165 }
169
170 httpAction(url, formData, method).then((res) => { 166 httpAction(url, formData, method).then((res) => {
171 if (res.status === 1) { 167 if (res.status === 1) {
172 this.$message.success({ message: res.message, showClose: true }) 168 this.$message.success({ message: res.message, showClose: true })
......
...@@ -111,6 +111,15 @@ ...@@ -111,6 +111,15 @@
111 .concat(data.columns()) 111 .concat(data.columns())
112 .concat([ 112 .concat([
113 { 113 {
114 label: "职位",
115 render: (h, scope) => {
116 return (
117 <div v-show={scope.row.jobLevel !== null}>{scope.row.jobLevel ? "干事" : "经理"}</div>
118 )
119
120 }
121 },
122 {
114 label: "负责人", 123 label: "负责人",
115 render: (h, scope) => { 124 render: (h, scope) => {
116 return ( 125 return (
...@@ -235,7 +244,6 @@ ...@@ -235,7 +244,6 @@
235 code: this.form.code, 244 code: this.form.code,
236 loginName: this.form.loginName, 245 loginName: this.form.loginName,
237 }; 246 };
238 console.log("this.queryParam", this.queryParam);
239 getUserLists(this.queryParam).then((res) => { 247 getUserLists(this.queryParam).then((res) => {
240 if (res.status === 1) { 248 if (res.status === 1) {
241 this.loading = false; 249 this.loading = false;
...@@ -271,7 +279,6 @@ ...@@ -271,7 +279,6 @@
271 getAction(api.departments, params).then( 279 getAction(api.departments, params).then(
272 (res) => { 280 (res) => {
273 let deptsList = res.content; 281 let deptsList = res.content;
274 console.log(deptsList);
275 deptsList.forEach((ele) => { 282 deptsList.forEach((ele) => {
276 this.tableData.data.forEach((item) => { 283 this.tableData.data.forEach((item) => {
277 if (ele.id == item.departmentId) { 284 if (ele.id == item.departmentId) {
...@@ -367,6 +374,7 @@ ...@@ -367,6 +374,7 @@
367 374
368 // 修改人员信息 375 // 修改人员信息
369 handleEdit (row) { 376 handleEdit (row) {
377 console.log("rowwwww", row);
370 this.isDialog = true 378 this.isDialog = true
371 this.$refs.dialogForm.edit(row); 379 this.$refs.dialogForm.edit(row);
372 this.$refs.dialogForm.title = "修改"; 380 this.$refs.dialogForm.title = "修改";
......