shj
2022-08-09 3b54a522b60cc50f9867deb3046f55b84aec1b7f
src/components/equipmentDailog/DailogS.vue
@@ -1,13 +1,13 @@
<template>
   <el-dialog :fullscreen="full" v-model="dialogVisible" draggable :title="titles" width="60%">
   <el-dialog :fullscreen="full" v-model="dialogVisible" draggable :title="titles" width="60%" @close="resetForm(ruleFormRef)">
      <el-button @click="toggleFullscreen" size="small" class="pot" :icon="FullScreen"></el-button>
      <el-form :model="form" label-width="130px" :disabled="disabled">
      <el-form :model="form" ref="ruleFormRef" label-width="130px" :rules="rules" :disabled="disabled">
         <el-row>
            <el-col :span="11">
               <el-form-item label="类型/类别外键" size="default">
               <el-form-item label="类型/类别外键" size="default" prop="equipmentTypeId">
                  <el-input v-model="form.equipmentTypeId" placeholder="请选择">
                     <template #append>
                        <el-button :icon="Search" @click="opencategory"></el-button>
                        <el-button :icon="Search" @click="opencategory" disabled></el-button>
                     </template>
                  </el-input>
               </el-form-item>
@@ -39,10 +39,10 @@
               </el-form-item>
            </el-col>
            <el-col :span="11" :offset="2">
               <el-form-item label="联系人" size="default">
               <el-form-item label="联系人" size="default" prop="connectPersonName">
                  <el-input v-model="form.connectPersonName" placeholder="请选择">
                     <template #append>
                        <el-button :icon="Search" @click="openUser(0)"></el-button>
                        <el-button :icon="Search" @click="openUser(1)"></el-button>
                     </template>
                  </el-input>
               </el-form-item>
@@ -50,19 +50,19 @@
         </el-row>
         <el-row>
            <el-col :span="11">
               <el-form-item label="录入人" size="default">
               <el-form-item label="录入人" size="default" prop="inputPersonName">
                  <el-input v-model="form.inputPersonName" placeholder="请选择">
                     <template #append>
                        <el-button :icon="Search" @click="openUser(1)"></el-button>
                        <el-button :icon="Search" @click="openUser(2)"></el-button>
                     </template>
                  </el-input>
               </el-form-item>
            </el-col>
            <el-col :span="11" :offset="2">
               <el-form-item label="责任人" size="default">
               <el-form-item label="责任人" size="default" prop="responsibilityPersonName">
                  <el-input v-model="form.responsibilityPersonName" placeholder="请选择">
                     <template #append>
                        <el-button :icon="Search" @click="openUser(2)"></el-button>
                        <el-button :icon="Search" @click="openUser(3)"></el-button>
                     </template>
                  </el-input>
               </el-form-item>
@@ -241,23 +241,21 @@
      </el-tabs>
      <template #footer>
         <span class="dialog-footer">
            <el-button @click="resetForm">关闭</el-button>
            <el-button type="primary" @click="submitForm">确定</el-button>
            <el-button @click="resetForm(ruleFormRef)">关闭</el-button>
            <el-button type="primary" @click="submitForm(ruleFormRef)">确定</el-button>
         </span>
      </template>
   </el-dialog>
   <categoryDailog ref="categoryShow"></categoryDailog>
   <RegionsDialog ref="planShow" @SearchUser="onUser"></RegionsDialog>
   <DailogSearchUser ref="UserOneShow" @SearchUser="userId"></DailogSearchUser>
<!--   <DailogSearchUser ref="UserTwoShow" @SearchUser="userId"></DailogSearchUser>-->
<!--   <DailogSearchUser ref="UserThreeShow" @SearchUser="userId"></DailogSearchUser>-->
   <DailogSearchUser ref="UserShow" @SearchUser="userId"></DailogSearchUser>
   <maintenanceDailog ref="maintenanceShow" @onMain="main"></maintenanceDailog>
   <detectDailog ref="detectShow" @onDelect="delect"></detectDailog>
   <repairDailog ref="repairShow" @onRepair="Repair"></repairDailog>
   <standardDailog ref="standardShow" @onStand="Stand"></standardDailog>
</template>
<script lang="ts">
import { defineComponent, ref } from 'vue';
import { defineComponent, ref ,reactive} from 'vue';
import { Search, Plus, FullScreen } from '@element-plus/icons-vue';
import { timeDate } from '/@/assets/index.ts';
import categoryDailog from './categoryDailog.vue';
@@ -267,7 +265,7 @@
import repairDailog from './repairDailog.vue';
import standardDailog from './standardDailog.vue';
import DailogSearchUser from '/@/components/DailogSearchUser/index.vue';
import { ElMessage, ElMessageBox } from 'element-plus';
import { ElMessage, ElMessageBox ,FormInstance ,FormRules,} from 'element-plus';
import type { UploadProps, UploadUserFile } from 'element-plus';
import { facilityManagementApi } from '/@/api/facilityManagement';
import { goalManagementApi } from '/@/api/goalManagement';
@@ -276,12 +274,12 @@
   setup(props, { emit }) {
      const dialogVisible = ref(false);
      const form = ref({
         equipmentTypeId: '',
         equipmentTypeId: 1,
         treatment: '',
         inputPersonId: '',
      inputPersonName:'',
      inputPersonName: '',
         departmentId: '',
         delRepaireDetailList: [],
@@ -292,11 +290,11 @@
         checkDetailList: [],
         responsibilityPersonId: '',
      responsibilityPersonName:'',
      responsibilityPersonName: '',
         delTakecareStardardeDetailList: [],
         connectPersonId: '',
      connectPersonName:'',
      connectPersonName: '',
         scenePic: '',
@@ -338,6 +336,7 @@
         delTestDetails: '',
      });
    const ruleFormRef = ref<FormInstance>();
      const titles = ref();
      const disabled = ref(false);
      const Dailogtype = ref(false);
@@ -410,29 +409,20 @@
         form.value.emergencePlanId = e.id;
      };
      const UserOneShow = ref();
      // const UserTwoShow = ref();
      // const UserThreeShow = ref();
      const openUser = (type: number) => {
         // if (type == 0) {
         //    UserOneShow.value.openDailog();
         // } else if (type == 1) {
         //    UserTwoShow.value.openDailog();
         // } else if (type == 2) {
         //    UserThreeShow.value.openDailog();
         // }
      UserOneShow.value.openDailog();
      const UserShow = ref();
      const openUser = (type: any) => {
      UserShow.value.openDailog(type);
      };
      const userId = ( type: number,val: any) => {
         if (type == 0) {
        form.value.connectPersonId = val.uid;
        form.value.connectPersonName = val.realName;
         } else if (type == 1) {
        form.value.inputPersonId = val.uid;
        form.value.inputPersonName = val.username;
      const userId = (val: any, type: number) => {
         if (type == 1) {
            form.value.connectPersonId = val.uid;
            form.value.connectPersonName = val.realName;
         } else if (type == 2) {
        form.value.responsibilityPersonId = val.id;
        form.value.responsibilityPersonName = val.username;
            form.value.inputPersonId = val.uid;
            form.value.inputPersonName = val.realName;
         } else if (type == 3) {
            form.value.responsibilityPersonId = val.id;
            form.value.responsibilityPersonName = val.realName;
         }
      };
      const maintenanceShow = ref();
@@ -535,7 +525,11 @@
            form.value.checkStandardeDetailList[index.value] = val;
         }
      };
    const rules = reactive<FormRules>({
      equipmentTypeId: {
      }
    })
      //图片提交
      const imageUrl = ref('');
@@ -594,6 +588,7 @@
         delect,
         Repair,
         Stand,
      ruleFormRef,
         index,
         activeName,
         categoryShow,
@@ -601,10 +596,9 @@
         planShow,
         onUser,
         openPlan,
         UserOneShow,
         // UserTwoShow,
         // UserThreeShow,
      UserShow,
         openUser,
      rules,
         maintenanceShow,
         openMaintenance,
         detectShow,