Browse Source

部门考评启动页面服务接口修改返回数据

SunZehao 1 year atrás
parent
commit
adae6c2af8

+ 14 - 11
src/components/assessment/evaluationDeptStartFrom.vue

@@ -79,9 +79,9 @@
                                      placeholder="请选择所属部门" filterable v-if="scope.row.showInput">
                                         <el-option
                                         v-for="item in departData"
-                                        :key="item.id"
-                                        :label="item.name"
-                                        :value="item.id"
+                                        :key="item.deptId"
+                                        :label="item.deptName"
+                                        :value="item.deptId"
                                         >
                                         </el-option>
                                     </el-select>
@@ -339,15 +339,18 @@ export default {
             }
             // 获取部门数据
             apiGetevaluationdetailDeptData(params).then(datas =>{
-                if (datas && datas.data) {
-                    for(let i in datas.data) {
-                        let obj = {
-                            id: i,
-                            name: datas.data[i]
-                        } 
-                        that.departData.push(obj)
-                    }
+                if (datas && datas.data && datas.data.length>0) {
+                    that.departData = datas.data
                 }
+                // if (datas && datas.data) {
+                //     for(let i in datas.data) {
+                //         let obj = {
+                //             id: i,
+                //             name: datas.data[i]
+                //         } 
+                //         that.departData.push(obj)
+                //     }
+                // }
             })
             let paramsDe = {
                 id: id,

+ 12 - 11
src/components/taskCenter/taskCenterDeptStartFrom.vue

@@ -80,9 +80,9 @@
                                      placeholder="请选择所属部门" filterable v-if="scope.row.showInput">
                                         <el-option
                                         v-for="item in departData"
-                                        :key="item.id"
-                                        :label="item.name"
-                                        :value="item.id"
+                                        :key="item.deptId"
+                                        :label="item.deptName"
+                                        :value="item.deptId"
                                         >
                                         </el-option>
                                     </el-select>
@@ -275,14 +275,15 @@ export default {
             }
             // 获取部门数据
             apiGetevaluationdetailDeptData(params).then(datas =>{
-                if (datas && datas.data) {
-                    for(let i in datas.data) {
-                        let obj = {
-                            id: i,
-                            name: datas.data[i]
-                        } 
-                        that.departData.push(obj)
-                    }
+                if (datas && datas.data && datas.data.length>0) {
+                    that.departData = datas.data
+                    // for(let i in datas.data) {
+                    //     let obj = {
+                    //         id: i,
+                    //         name: datas.data[i]
+                    //     } 
+                    //     that.departData.push(obj)
+                    // }
                 }
             })
         },