xieb
2025-01-21 d13cebe7fbadd396e91a989af331df8a8e7b40f8
src/views/evaluate/components/editSectionTask.vue
@@ -1,6 +1,6 @@
<template>
    <el-dialog v-model="params.visible" :title="params.title || '编辑部门评优任务'" width="50%" @open="openDialog"
        @close="dialogClose">
        @close="dialogClose" destroy-on-close>
        <div class="content">
            <el-form :model="form" ref="formRef" :rules="rules" label-width="130px">
                <el-form-item label="任务名称" prop="taskName">
@@ -46,7 +46,7 @@
<script>
import { getDict } from '@/api/dict'
import { update } from '@/api/evaluate/evaluateTask'
import { update, getEmployeeLevelList } from '@/api/evaluate/evaluateTask'
import _ from 'lodash';
import selectionDialog from './selectionDialog.vue';
@@ -136,24 +136,49 @@
            selectionParams: {}
        }
    },
    watch: {
        'params.visible': {
            handler(val) {
                if (!val) return
                const { id, taskName, evaluateAwards, identificationStandard, pollingPersons, votePersonObjInfo, evaluateCutoffTimeStart, evaluateCutoffTimeEnd } = this.params.data
                this.form.id = id
                this.form.taskName = taskName
                this.form.evaluateAwards = evaluateAwards
                this.form.identificationStandard = identificationStandard
                this.form.pollingPersons = pollingPersons.split(',') || []
                this.form.votePersonObjInfo = JSON.parse(votePersonObjInfo) || []
                this.form.evaluateCutoffTimeStart = evaluateCutoffTimeStart
                this.form.evaluateCutoffTimeEnd = evaluateCutoffTimeEnd
                console.log('编辑回显');
            },
            deep: true
        }
    },
    methods: {
        dialogClose() {
            this.$refs.formRef.resetFields()
        },
        openDialog() {
            this.initDict()
            const { id, taskName, evaluateAwards, identificationStandard, pollingPersons, votePersonObjInfo, evaluateCutoffTimeStart, evaluateCutoffTimeEnd } = this.params.data
            this.form = {
                id,
                taskName,
                evaluateAwards,
                identificationStandard,
                pollingPersons: pollingPersons.split(',') || [],
                votePersonObjInfo: JSON.parse(votePersonObjInfo) || [],
                evaluateCutoffTimeStart,
                evaluateCutoffTimeEnd
            }
            console.log(this.form);
            // const { id, taskName, evaluateAwards, identificationStandard, pollingPersons, votePersonObjInfo, evaluateCutoffTimeStart, evaluateCutoffTimeEnd } = this.params.data
            // this.form.id = id
            // this.form.taskName = taskName
            // this.form.evaluateAwards = evaluateAwards
            // this.form.identificationStandard = identificationStandard
            // this.form.pollingPersons = pollingPersons.split(',') || []
            // this.form.votePersonObjInfo = JSON.parse(votePersonObjInfo) || []
            // this.form.evaluateCutoffTimeStart = evaluateCutoffTimeStart
            // this.form.evaluateCutoffTimeEnd = evaluateCutoffTimeEnd
            // this.form = {
            //     id,
            //     taskName,
            //     evaluateAwards,
            //     identificationStandard,
            //     pollingPersons: pollingPersons.split(',') || [],
            //     votePersonObjInfo: JSON.parse(votePersonObjInfo) || [],
            //     evaluateCutoffTimeStart,
            //     evaluateCutoffTimeEnd
            // }
        },
        submit() {
            this.$refs.formRef.validate(vaild => {