| | |
| | | <el-form :model="form" :disabled="disabled" label-width="120px" ref="ruleFormRef" :rules="rules"> |
| | | <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="目标分类" prop="targetTypeId" size="default"> |
| | | <el-select v-model="form.targetTypeId" class="m-2" placeholder="请选择" style="width:100%"> |
| | | <el-option v-for="item in options" :key="item.id" :label="item.typeName" :value="item.id" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="责任人" prop="dutyPersonName" size="default"> |
| | | <el-input v-model="form.dutyPersonName"> |
| | | <template #append> <el-button :icon="Search" @click="openUser(1)" /> </template |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </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-tree-select |
| | | v-model="form.dutyDepartmentId" |
| | | check-strictly="true" |
| | | @current-change="dutyName" |
| | | :data="data" |
| | | class="w100" |
| | | :props="propse" |
| | | placeholder="请选择" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | |
| | | <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="制定人部门" prop="makerDepartmentId" size="default"> |
| | | <el-tree-select v-model="form.makerDepartmentId" :data="data" @current-change="makerName" check-strictly="true" class="w100" :props="propse" placeholder="请选择" /> |
| | | <el-tree-select |
| | | v-model="form.makerDepartmentId" |
| | | :data="data" |
| | | @current-change="makerName" |
| | | check-strictly="true" |
| | | class="w100" |
| | | :props="propse" |
| | | placeholder="请选择" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="制定日期" prop="makeDate" size="default"> |
| | | <el-date-picker v-model="form.makeDate" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" type="datetime" placeholder="请选择" style="width: 100%" /> |
| | | <el-date-picker |
| | | v-model="form.makeDate" |
| | | 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-col :span="11"> |
| | | <el-form-item label="上报人" prop="commitPersonName" size="default"> |
| | | <el-input v-model="form.commitPersonName"> |
| | | <template #append> <el-button :icon="Search" @click="openUser" /> </template |
| | | <template #append> <el-button :icon="Search" @click="openUser(2)" /> </template |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="计划措施" prop="commitPersonName" size="default"> |
| | | <el-input v-model="form.planDesc"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </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)" :disabled="disabled" 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: '', ////责任部门/外键 |
| | | makerDepartmentId: '', ////制定人部门/外键 |
| | |
| | | commitPersonName: '', |
| | | value: '', ////考核指标值 |
| | | makeDate: '', ////制定日期 |
| | | targetTypeId: '', ///目标分类 |
| | | dutyPersonId: '', ///责任人id |
| | | dutyPersonName: '', ///责任人 |
| | | planDesc: '', ///计划措施 |
| | | }); |
| | | //部门 |
| | | const department = () => { |
| | |
| | | }; |
| | | onMounted(() => { |
| | | department(); |
| | | allList() |
| | | }); |
| | | const disabled = ref(false); |
| | | // 开启弹窗 |
| | |
| | | } |
| | | dialogVisible.value = true; |
| | | }; |
| | | // 分类 All |
| | | const allList=()=>{ |
| | | goalManagementApi().gettargetClassAll({}).then(res=>{ |
| | | if(res.data.code==200){ |
| | | options.value=res.data.data |
| | | }else{ |
| | | ElMessage.error(res.data.msg); |
| | | } |
| | | }) |
| | | } |
| | | // 开启用户弹窗 |
| | | const Show = ref(); |
| | | const openUser = () => { |
| | | Show.value.openDailog(); |
| | | const openUser = (type:any) => { |
| | | Show.value.openDailog(type); |
| | | }; |
| | | const rules = reactive<FormRules>({ |
| | | targetTypeId: [ |
| | | { |
| | | required: true, |
| | | message: '目标分类不能为空', |
| | | trigger: 'blur', |
| | | }, |
| | | ], |
| | | dutyPersonName: [ |
| | | { |
| | | required: true, |
| | | message: '责任人不能为空', |
| | | trigger: 'blur', |
| | | }, |
| | | ], |
| | | dutyDepartmentId: [ |
| | | { |
| | | required: true, |
| | |
| | | |
| | | const resetForm = (formEl: FormInstance | undefined) => { |
| | | // console.log(formEl); |
| | | if (!formEl) return |
| | | if (!formEl) return; |
| | | formEl.clearValidate(); |
| | | dialogVisible.value = false; |
| | | form.value={} |
| | | form.value = {}; |
| | | }; |
| | | // const handleClose = (formEl: any) => { |
| | | // formEl.resetFields(); |
| | |
| | | } |
| | | }; |
| | | const data = ref(); |
| | | const onUser = (e: any) => { |
| | | console.log(e) |
| | | form.value.commitPersonId = e.uid; |
| | | form.value.commitPersonName = e.realName; |
| | | const onUser = (e: any, type: any) => { |
| | | console.log(e); |
| | | if (type == 1) { |
| | | form.value.dutyPersonId = e.uid; |
| | | form.value.dutyPersonName = e.realName; |
| | | } else if (type == 2) { |
| | | form.value.commitPersonId = e.uid; |
| | | form.value.commitPersonName = e.realName; |
| | | } |
| | | }; |
| | | const makerName=(data:any)=>{ |
| | | form.value.makerDepartmentName=data.depName |
| | | } |
| | | const dutyName=(data:any)=>{ |
| | | form.value.dutyDepartmentName=data.depName |
| | | } |
| | | const makerName = (data: any) => { |
| | | form.value.makerDepartmentName = data.depName; |
| | | }; |
| | | const dutyName = (data: any) => { |
| | | form.value.dutyDepartmentName = data.depName; |
| | | }; |
| | | const options = ref([]); |
| | | return { |
| | | options, |
| | | allList, |
| | | disabled, |
| | | makerName, |
| | | dutyName, |