lct
Your Name
2022-08-09 8b7c2fe49917d670eb2a03cecda23ea50961c494
src/components/equipmentDailog/detectDailog.vue
@@ -1,11 +1,11 @@
<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>
@@ -19,10 +19,7 @@
         <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">
@@ -59,13 +56,16 @@
</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: '',
@@ -77,6 +77,7 @@
      const disabled = ref(false);
      const dialogVisible = ref(false);
      const openDailog = (title: string, data: any) => {
         department()
         dialogVisible.value = true;
         titles.value = `${title}设备检测`;
         if (title == '查看') {
@@ -94,6 +95,7 @@
      };
      const User = (val: any) => {
         form.value.testPersonId = val.uid;
         form.value.testPersonName=val.realName;
      };
      // 提交
      const submitForm = () => {
@@ -101,24 +103,28 @@
         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);
@@ -129,7 +135,28 @@
            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,