13937891274
2022-08-05 2dcd6731b0ba9359dac02931211e53e81e56be68
src/views/contingencyManagement/panManagement/component/openAdd.vue
@@ -1,20 +1,8 @@
<template>
  <div class="system-edit-user-container">
    <el-dialog
        :title="titles"
        v-model="isShowDialog"
        width="40%"
        draggable
        :fullscreen="full"
    >
      <el-dialog :title="titles" v-model="isShowDialog" width="40%" draggable :fullscreen="full" :close-on-click-modal="false">
      <el-button @click="toggleFullscreen" size="small" class="pot" :icon="FullScreen"></el-button>
      <el-form
          ref="ruleFormRef"
          :model="ruleForm"
          size="default"
          label-width="120px"
          :disabled="disabled"
      >
         <el-form ref="ruleFormRef" :model="ruleForm" size="default" label-width="120px" :disabled="disabled">
        <el-row :gutter="35">
          <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
            <el-form-item label="预案名称" prop="name">
@@ -65,11 +53,7 @@
          </el-col>
          <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
            <el-form-item label="编写人" prop="authorId" >
              <el-input
                  v-model="ruleForm.authorUid"
                  placeholder="请选择"
                  class="input-with-select"
              >
                     <el-input v-model="ruleForm.authorName" placeholder="请选择" class="input-with-select">
                <template #append>
                  <el-button :icon="Search" @click="openUser"/>
                </template>
@@ -86,7 +70,8 @@
                  :props="propse"
                  clearable
                  :render-after-expand="false"
                  placeholder="请选择"/>
                        placeholder="请选择"
                     />
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
@@ -102,11 +87,7 @@
          </el-col>
          <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
            <el-form-item label="应急队伍" prop="emergencyTeam">
              <el-input
                  v-model="ruleForm.emergencyTeam"
                  placeholder="请选择"
                  class="input-with-select"
              >
                     <el-input v-model="ruleForm.emergencyTeam" placeholder="请选择" class="input-with-select">
                <template #append>
                  <el-button :icon="Search" @click="daiInpt" />
                </template>
@@ -121,12 +102,9 @@
                  action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15"
                  :on-change="handleChange"
              >
                <el-button type="primary"
                >点击上传</el-button>
                        <el-button type="primary">点击上传</el-button>
                <template #tip>
                  <div class="el-upload__tip">
                    添加相关附件
                  </div>
                           <div class="el-upload__tip">添加相关附件</div>
                </template>
              </el-upload>
            </el-form-item>
@@ -154,38 +132,28 @@
      </template>
    </el-dialog>
    <CheckTemplate ref="Shows"/>
    <DailogSearchUser ref="userRef" @SearchUser="onUser"/>
      <DailogSearchUserManger ref="userRef" @SearchUser="onUser" />
    <RegionsDialog ref="openRef"/>
  </div>
</template>
<script lang="ts">
import {
  ref,
  defineComponent,
  onMounted,
} from 'vue';
import { ref, defineComponent, onMounted } from 'vue';
import type {
  UploadUserFile,
  FormInstance,
} from 'element-plus'
import type { UploadUserFile, FormInstance } from 'element-plus';
import { ElMessage } from 'element-plus';
import {
  Search,
  FullScreen
} from '@element-plus/icons-vue'
import DailogSearchUser from "/@/components/DailogSearchUser/index.vue"
import CheckTemplate from '/@/components/checkTemplate/index.vue'
import RegionsDialog from '/@/components/regionsDialog/index.vue'
import {emergencyPlanApi} from "/@/api/emergencyPlan";
import {goalManagementApi} from "/@/api/goalManagement";
import { Search, FullScreen } from '@element-plus/icons-vue';
import DailogSearchUserManger from '/@/components/DailogSearchUserManger/index.vue';
import CheckTemplate from '/@/components/checkTemplate/index.vue';
import RegionsDialog from '/@/components/regionsDialog/index.vue';
import { emergencyPlanApi } from '/@/api/emergencyPlan';
import { goalManagementApi } from '/@/api/goalManagement';
export default defineComponent({
  name: 'openAdd',
  components: {
    CheckTemplate,
    DailogSearchUser,
      DailogSearchUserManger,
    RegionsDialog,
  },
  setup(prop, {emit}) {
@@ -197,20 +165,21 @@
      associatedDanger: '', // 危险源关联
      level: '', // 预案级别
      authorUid: '', // 编写人
         authorName: '',
      authorDeptId: '', // 编写部门
      releaseDate: '', // 发布实施日期
      fileList: [
        {
          fileUrl: 'url',
          fileName: 'name',
        }
            },
      ],
      emergencyTeam: '', //应急队伍
      areaList: [],  //区域列表
      teamList: [],
      deptList: [],
      abolishStatus: false,
    })
      });
    const titles = ref();
    const disabled = ref();
@@ -230,9 +199,9 @@
      }
    };
    //日期选择器
    const releaseDate = ref('')
      const releaseDate = ref('');
    // 上传附件
    const fileList = ref<UploadUserFile[]>([])
      const fileList = ref<UploadUserFile[]>([]);
    //部门树
    const department = () => {
      goalManagementApi()
@@ -245,7 +214,7 @@
            }
          });
    };
    const treeSelect = ref()
      const treeSelect = ref();
    // const trees = ref();
    const propse = {
      label: 'depName',
@@ -256,7 +225,7 @@
      department();
    });
    //定义树形下拉框
    const responsibleDepartment = ref()
      const responsibleDepartment = ref();
    const data = ref();
    const submitForm = async (title: string, formEl: FormInstance | undefined) => {
@@ -288,9 +257,8 @@
          } else {
            console.log('error submit!', fields);
          }
        })
      }
      else if (title == '修改应急预案管理') {
            });
         } else if (title == '修改应急预案管理') {
        if (!formEl) return;
        await formEl.validate((valid, fields) => {
          if (valid) {
@@ -326,13 +294,14 @@
          associatedDanger: '', // 危险源关联
          level: '', // 预案级别
          authorUid: '', // 编写人
               authorName: '',
          authorDeptId: '', // 编写部门
          releaseDate: '', // 发布实施日期
          fileList: [
            {
              fileUrl: 'url',
              fileName: 'name',
            }
                  },
          ],
          emergencyTeam: '', //应急队伍
          areaList: [],  //区域列表
@@ -348,15 +317,15 @@
      formEl.resetFields();
    };
    // 应急队伍弹窗
    const Shows=ref()
      const Shows = ref();
    const daiInpt=()=>{
      Shows.value.openDailog()
    }
         Shows.value.openDailog();
      };
    // 选择区域弹窗
    const openRef=ref()
      const openRef = ref();
    const regionsDialog=()=>{
      openRef.value.openDailog()
    }
         openRef.value.openDailog();
      };
    // 打开用户选择弹窗
    const userRef = ref();
    const openUser = () => {
@@ -364,7 +333,8 @@
    };
    //回显
    const onUser = (e:any) => {
      ruleForm.value.authorUid=e.uid
         ruleForm.value.authorUid = e[0].uid;
         ruleForm.value.authorName = e[0].realName;
    };
    //全屏
    const full = ref(false);