| | |
| | | <template> |
| | | <el-dialog v-model="dialogVisible" :fullscreen="full" :title="titles" width="50%" draggable> |
| | | <el-dialog v-model="dialogVisible" @close="resetForm" :fullscreen="full" :title="titles" width="50%" draggable> |
| | | <el-button @click="toggleFullscreen" size="small" class="pot" :icon="FullScreen"></el-button> |
| | | <el-form :model="form" :disabled="disabled" label-width="120px"> |
| | | <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="检测人" size="default"> |
| | | <el-input v-model="form.testPersonId"> |
| | | <el-input v-model="form.testPersonName"> |
| | | <template #append> <el-button :icon="Search" @click="openUser" /> </template |
| | | ></el-input> |
| | | </el-form-item> |
| | |
| | | <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="检测人单位" size="default"> |
| | | <el-select v-model="form.testPersonDepartmentId" placeholder="请选择" style="width: 100%"> |
| | | <el-option label="xxx单位1" value="1" /> |
| | | <el-option label="xxx单位2" value="2" /> |
| | | </el-select> |
| | | <el-tree-select v-model="form.testPersonDepartmentId" :data="data" check-strictly="true" class="w100" :props="propse" placeholder="请选择" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | |
| | | </template> |
| | | <script lang="ts"> |
| | | import { defineComponent, ref, reactive } from 'vue'; |
| | | import { ElMessage, ElMessageBox} from 'element-plus'; |
| | | import { Search, FullScreen } from '@element-plus/icons-vue'; |
| | | import DailogSearchUser from '/@/components/DailogSearchUser/index.vue'; |
| | | import { goalManagementApi } from '/@/api/goalManagement'; |
| | | export default defineComponent({ |
| | | components: { DailogSearchUser }, |
| | | setup(props, { emit }) { |
| | | const form = ref({ |
| | | testPersonId: '', |
| | | testPersonName:'', |
| | | testDate: '', |
| | | testPersonDepartmentId: '', |
| | | testMemo: '', |
| | |
| | | const disabled = ref(false); |
| | | const dialogVisible = ref(false); |
| | | const openDailog = (title: string, data: any) => { |
| | | department() |
| | | dialogVisible.value = true; |
| | | titles.value = `${title}设备检测`; |
| | | if (title == '查看') { |
| | |
| | | }; |
| | | const User = (val: any) => { |
| | | form.value.testPersonId = val.uid; |
| | | form.value.testPersonName=val.realName; |
| | | }; |
| | | // 提交 |
| | | const submitForm = () => { |
| | |
| | | emit('onDelect', form.value); |
| | | form.value = { |
| | | testPersonId: '', |
| | | testPersonName:'', |
| | | testDate: '', |
| | | testPersonDepartmentId: '', |
| | | testMemo: '', |
| | | testResult: '', |
| | | testStatus: '', |
| | | }; |
| | | disabled.value = false; |
| | | }; |
| | | // 取消 |
| | | const resetForm = () => { |
| | | dialogVisible.value = false; |
| | | form.value = { |
| | | testPersonId: '', |
| | | testPersonName:'', |
| | | testDate: '', |
| | | testPersonDepartmentId: '', |
| | | testMemo: '', |
| | | testResult: '', |
| | | testStatus: '', |
| | | }; |
| | | disabled.value = false; |
| | | }; |
| | | //全屏 |
| | | const full = ref(false); |
| | |
| | | full.value = false; |
| | | } |
| | | }; |
| | | //部门树 |
| | | 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', |
| | | }; |
| | | const data = ref(); |
| | | return { |
| | | department, |
| | | propse, |
| | | data, |
| | | form, |
| | | titles, |
| | | User, |