| | |
| | | <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"> |
| | |
| | | |
| | | <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'; |
| | | |
| | |
| | | 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 => { |