GuLiMmo
2023-12-11 ec120466a417834d15d97595cace9ab73b081beb
评优任务页面修改
4 files modified
36 ■■■■ changed files
src/option/evaluate/evaluateTask.js 4 ●●●● patch | view | raw | blame | history
src/views/employee/list.vue 1 ●●●● patch | view | raw | blame | history
src/views/evaluate/components/addDialog.vue 2 ●●●●● patch | view | raw | blame | history
src/views/evaluate/evaluateTask.vue 29 ●●●●● patch | view | raw | blame | history
src/option/evaluate/evaluateTask.js
@@ -60,7 +60,6 @@
      //   label: "title",
      // },
      formatter: (row, value) => {
        console.log(value);
        let num = 0
        if (value === void 0) {
          num = 0
@@ -70,7 +69,8 @@
          })
        }
        return num + '人'
      }
      },
    },
    {
      label: "候选人截止日期",
src/views/employee/list.vue
@@ -28,7 +28,6 @@
import 'nprogress/nprogress.css';
import { getPostList } from '@/api/system/post';
import { getDeptTree } from '@/api/system/dept';
import func from "@/utils/func";
export default {
    data() {
src/views/evaluate/components/addDialog.vue
@@ -172,6 +172,8 @@
                    if (item.children) {
                        this.depts = result.concat(item.children)
                        delete item.children
                    } else {
                        this.depts.push(item)
                    }
                })
                if (this.params.isEdit) return
src/views/evaluate/evaluateTask.vue
@@ -43,7 +43,7 @@
      </template>
    </el-dialog>
    <!-- 新增编辑弹窗 -->
    <addDialog :params="addParams" @refreshTable="this.onLoad"/>
    <addDialog :params="addParams" @refreshTable="this.onLoad" />
  </basic-container>
</template>
@@ -58,6 +58,7 @@
import NProgress from 'nprogress';
import 'nprogress/nprogress.css';
import addDialog from "./components/addDialog.vue";
import { getDeptTree } from '@/api/system/dept';
export default {
  components: {
@@ -85,6 +86,7 @@
      isAddDialogVisible: false,
      addParams: {},
      viewParams: {},
      depts: []
    };
  },
  computed: {
@@ -213,6 +215,16 @@
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getDetail(this.form.id).then(res => {
          if (type === 'view') {
            this.deptData().then(deptRes => {
              const candidates = []
              res.data.data.candidateNum.forEach(item => {
                const value = deptRes.find(dept => dept.id === item.deptId)
                candidates.push(`${value.title}: ${item.val}人`)
              })
              this.form.candidateNum = candidates.join('、')
            })
          }
          this.form = res.data.data;
        });
      }
@@ -262,6 +274,21 @@
        this.loading = false;
        this.selectionClear();
      });
    },
    deptData() {
      return getDeptTree(this.website.tenantId).then(deptResult => {
        const result = deptResult.data.data
        let deptList = []
        result.forEach(dept => {
          if (dept.children) {
            deptList = result.concat(dept.children)
            delete dept.children
          } else {
            deptList.push(dept)
          }
        })
        return deptList
      });
    }
  }
};