| | |
| | | <el-dialog v-model="dialogVisible" :fullscreen="full" :title="titles" width="50%" draggable @close="resetForm(ruleFormRef)"> |
| | | <el-button @click="toggleFullscreen" size="small" class="pot" :icon="FullScreen"></el-button> |
| | | <el-form :model="form" :disabled="disabled" label-width="120px" ref="ruleFormRef" :rules="rules"> |
| | | <el-row> |
| | | <!-- <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="责任部门" prop="dutyDepartmentId" size="default"> |
| | | <el-tree-select v-model="form.dutyDepartmentId" check-strictly="true" @current-change="dutyName" :data="data" class="w100" :props="propse" placeholder="请选择" /> |
| | |
| | | <el-col :span="11"> |
| | | <el-form-item label="上报值" prop="uploadValue" size="default"> |
| | | <el-input v-model="form.uploadValue"> |
| | | <!-- <template #append> <el-button :icon="Search" @click="openUser" /> </template>--> |
| | | <template #append> <el-button :icon="Search" @click="openUser" /> </template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <el-date-picker v-model="form.uploadDate" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" type="datetime" placeholder="请选择" style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> --> |
| | | <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="考核结果" prop="examineResult" size="default"> |
| | | <el-select v-model="form.examineResult" placeholder="请选择" style="width: 100%"> |
| | | <el-option label="合格" :value="1" /> |
| | | <el-option label="不合格" :value="2" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="考核人" prop="examinePersonName" size="default"> |
| | | <el-input v-model="form.examinePersonName"> |
| | | <template #append> <el-button :icon="Search" @click="openUser" /> </template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="考核结果" prop="examineResult" size="default"> |
| | | <el-select v-model="form.examineResult" placeholder="请选择" style="width: 100%"> |
| | | <el-option label="合格" :value="1" /> |
| | | <el-option label="不合格" :value="2" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="考核人" prop="examinePersonName" size="default"> |
| | | <el-input v-model="form.examinePersonName"> |
| | | <template #append> <el-button :icon="Search" @click="openUser" /> </template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <!-- <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="考核时间" prop="examineDate" size="default"> |
| | | <el-date-picker v-model="form.examineDate" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" type="datetime" placeholder="请选择" style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"></el-col> |
| | | </el-row> |
| | | </el-row> --> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | |
| | | <el-button @click="resetForm(ruleFormRef)" size="default">关闭</el-button> |
| | | <el-button type="primary" @click="submitForm(ruleFormRef)" size="default">确定</el-button> |
| | | </span> |
| | |
| | | export default defineComponent({ |
| | | components: { DailogSearchUser }, |
| | | setup(props, { emit }) { |
| | | const ruleFormRef = ref<FormInstance>() |
| | | const ruleFormRef = ref<FormInstance>(); |
| | | const form = ref({ |
| | | "dutyDepartmentId": '', ////责任部门id/外键 |
| | | "examineDate": '', ////考核时间 |
| | | "examinePersonId": '', ////考核人ID/外键 |
| | | "examineResult": '', ////考核结果 1:合格 2:不合格 |
| | | "examineValue": '', ////考核指标 |
| | | "makeDate": '', ////制定日期 |
| | | "makerDepartmentId": '', ////制定部门/外键 |
| | | "uploadDate": '', ////上报时间 |
| | | "uploadValue": "", ////上报值 |
| | | targetDivideDetailId: "", //关联的目标分解/外键 |
| | | examinePersonId: "", |
| | | examinePersonName: '', |
| | | examineResult: "", //考核结果 1:合格 2:不合格 |
| | | id: "", //目标指标ID |
| | | }); |
| | | //部门 |
| | | const department = () => { |
| | | goalManagementApi() |
| | | .getTreedepartment() |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | data.value = res.data.data; |
| | | } else { |
| | | ElMessage.error(res.data.msg); |
| | | } |
| | | }); |
| | | }; |
| | | const propse = { |
| | | label: 'depName', |
| | | children: 'children', |
| | | value: 'depId', |
| | | }; |
| | | onMounted(() => { |
| | | department(); |
| | | }); |
| | | // const department = () => { |
| | | // goalManagementApi() |
| | | // .getTreedepartment() |
| | | // .then((res) => { |
| | | // if (res.data.code == 200) { |
| | | // data.value = res.data.data; |
| | | // } else { |
| | | // ElMessage.error(res.data.msg); |
| | | // } |
| | | // }); |
| | | // }; |
| | | // const propse = { |
| | | // label: 'depName', |
| | | // children: 'children', |
| | | // value: 'depId', |
| | | // }; |
| | | // onMounted(() => { |
| | | // department(); |
| | | // }); |
| | | const disabled = ref(false); |
| | | // 开启弹窗 |
| | | const titles = ref(); |
| | |
| | | if (title == '查看') { |
| | | disabled.value = true; |
| | | form.value = data; |
| | | // form.value.id = data.targetId; |
| | | form.value.targetDivideDetailId=data.id |
| | | form.value.examinePersonName = data.examinePersonName; |
| | | form.value.examinePersonId=data.examinePersonId |
| | | form.value.examineResult=data.examineResult |
| | | } else if (title == '修改') { |
| | | console.log(data) |
| | | disabled.value = false; |
| | | form.value = data; |
| | | // form.value.id = data.targetId; |
| | | form.value.targetDivideDetailId=data.id |
| | | form.value.examinePersonName = data.examinePersonName; |
| | | form.value.examinePersonId=data.examinePersonId |
| | | form.value.examineResult=data.examineResult |
| | | } else { |
| | | disabled.value = false; |
| | | } |
| | |
| | | Show.value.openDailog(); |
| | | }; |
| | | const rules = reactive<FormRules>({ |
| | | dutyDepartmentId: [ |
| | | { |
| | | required: true, |
| | | message: '责任部门不能为空', |
| | | trigger: 'blur', |
| | | }, |
| | | ], |
| | | makerDepartmentId: [ |
| | | { |
| | | required: true, |
| | | message: '制定人部门不能为空', |
| | | trigger: 'blur', |
| | | }, |
| | | ], |
| | | commitPersonId: [ |
| | | { |
| | | required: true, |
| | | message: '上报人不能为空', |
| | | trigger: 'blur', |
| | | }, |
| | | ], |
| | | examineValue: [ |
| | | { |
| | | required: true, |
| | | message: '考核指标值不能为空', |
| | | trigger: 'blur', |
| | | }, |
| | | { |
| | | type: 'number', |
| | | message: '考核指标值只能为数字类型', |
| | | trigger: 'blur', |
| | | }, |
| | | ], |
| | | makeDate: [ |
| | | { |
| | | required: true, |
| | | message: '制定日期不能为空', |
| | | trigger: 'blur', |
| | | }, |
| | | ], |
| | | commitPersonName: [], |
| | | // dutyDepartmentId: [ |
| | | // { |
| | | // required: true, |
| | | // message: '责任部门不能为空', |
| | | // trigger: 'blur', |
| | | // }, |
| | | // ], |
| | | // makerDepartmentId: [ |
| | | // { |
| | | // required: true, |
| | | // message: '制定人部门不能为空', |
| | | // trigger: 'blur', |
| | | // }, |
| | | // ], |
| | | // commitPersonId: [ |
| | | // { |
| | | // required: true, |
| | | // message: '上报人不能为空', |
| | | // trigger: 'blur', |
| | | // }, |
| | | // ], |
| | | // examineValue: [ |
| | | // { |
| | | // required: true, |
| | | // message: '考核指标值不能为空', |
| | | // trigger: 'blur', |
| | | // }, |
| | | // { |
| | | // type: 'number', |
| | | // message: '考核指标值只能为数字类型', |
| | | // trigger: 'blur', |
| | | // }, |
| | | // ], |
| | | // makeDate: [ |
| | | // { |
| | | // required: true, |
| | | // message: '制定日期不能为空', |
| | | // trigger: 'blur', |
| | | // }, |
| | | // ], |
| | | examinePersonName: [], |
| | | examineResult:[] |
| | | |
| | | }); |
| | | const dutyName=(data:any)=>{ |
| | | form.value.dutyDepartmentName=data.depName |
| | | } |
| | | const makerDepartmentName=(data:any)=>{ |
| | | form.value.makerDepartmentName=data.depName |
| | | } |
| | | // const dutyName = (data: any) => { |
| | | // form.value.dutyDepartmentName = data.depName; |
| | | // }; |
| | | // const makerDepartmentName = (data: any) => { |
| | | // form.value.makerDepartmentName = data.depName; |
| | | // }; |
| | | |
| | | const submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return; |
| | | await formEl.validate((valid, fields) => { |
| | | if (valid) { |
| | | emit('onAdd', form.value); |
| | | console.log(form.value) |
| | | dialogVisible.value = false; |
| | | goalManagementApi().gettargetExamineAddOrUpdate(form.value).then(res=>{ |
| | | if(res.data.code==200){ |
| | | ElMessage({ |
| | | message: res.data.msg, |
| | | type: 'success', |
| | | }); |
| | | }else{ |
| | | ElMessage.error(res.data.msg); |
| | | } |
| | | }) |
| | | // handleClose(formEl) |
| | | } else { |
| | | console.log('error submit!', fields); |
| | | } |
| | | }); |
| | | emit('onAdd'); |
| | | }; |
| | | |
| | | const resetForm = (formEl: FormInstance | undefined) => { |
| | | // console.log(formEl); |
| | | if (!formEl) return |
| | | formEl.resetFields(); |
| | | if (!formEl) return; |
| | | // formEl.resetFields(); |
| | | dialogVisible.value = false; |
| | | form.value={} |
| | | form.value = {}; |
| | | }; |
| | | // const handleClose = (formEl: any) => { |
| | | // formEl.resetFields(); |
| | |
| | | full.value = false; |
| | | } |
| | | }; |
| | | const data = ref(); |
| | | // const data = ref(); |
| | | const onUser = (e: any) => { |
| | | console.log(e) |
| | | console.log(e); |
| | | form.value.examinePersonId = e.uid; |
| | | form.value.examinePersonName = e.realName; |
| | | }; |
| | |
| | | titles, |
| | | // handleClose, |
| | | form, |
| | | propse, |
| | | department, |
| | | // propse, |
| | | // department, |
| | | dialogVisible, |
| | | openDailog, |
| | | Show, |
| | |
| | | full, |
| | | toggleFullscreen, |
| | | FullScreen, |
| | | data, |
| | | // data, |
| | | onUser, |
| | | ruleFormRef, |
| | | rules, |
| | | submitForm, |
| | | resetForm, |
| | | dutyName, |
| | | makerDepartmentName |
| | | // dutyName, |
| | | // makerDepartmentName, |
| | | }; |
| | | }, |
| | | }); |