马宇豪
2023-04-21 754f2fa9c8076a5d13ad7476eb9bc5984f78c99c
src/views/experiment/developing/components/developDialog.vue
@@ -3,8 +3,7 @@
        <el-dialog :title="projectDialogState.title" v-model="projectDialogState.projectDialogVisible" width="80%">
            <el-form ref="ProjectFormRef" :rules="projectDialogState.projectFormRules" :model="projectDialogState.projectForm" size="default" label-width="0">
                <table class="report-table">
                    <th class="m-color b-font" style="text-align: center">***研究所/***大学<br />科学研究实验项目安全风险基础信息录入表(已开展
                      )(带*为必填项)</th>
                  <th class="m-color b-font" style="text-align: center">***研究所/***大学<br />科学研究实验项目安全风险基础信息录入表(已开展)(带<span style="color: red">*</span>为必填项)</th>
                    <tr>
                        <td class="w-25 m-color required">实验名称</td>
                        <td class="w-75 m-color">
@@ -231,6 +230,7 @@
import SelectRoom from "/@/views/experiment/project/components/selectRoom.vue";
import {useUserInfo} from "/@/stores/userInfo";
import {storeToRefs} from "pinia";
import {checkChineseName, verifyPhone} from "/@/utils/toolsValidate";
const SelectEquipment = defineAsyncComponent(() => import('../../project/components/selectEquipment.vue'))
const SelectMaterial = defineAsyncComponent(() => import('../../project/components/selectMaterial.vue'))
const SelectDanger = defineAsyncComponent(() => import('../../project/components/selectDanger.vue'))
@@ -398,6 +398,62 @@
    ProjectFormRef.value.validate(async(valid: boolean) => {
        if(valid){
            if(projectDialogState.title === '新增'){
                if(checkChineseName(projectDialogState.projectForm.safeLiabilityUser) == false){
                  ElMessage({
                    type: 'warning',
                    message: '安全负责人姓名格式有误',
                    duration: 1000
                  });
                  return
                }
                if(verifyPhone(projectDialogState.projectForm.safeLiabilityUserPhone) == false || verifyPhone(projectDialogState.projectForm.liabilityUserPhone) == false){
                  ElMessage({
                    type: 'warning',
                    message: '请输入正确的手机号',
                    duration: 1000
                  });
                  return
                }
                if(projectDialogState.projectForm.siteList.length === 0){
                  ElMessage({
                    type: 'warning',
                    message: '请至少添加一处实验场所',
                    duration: 1000
                  });
                  return
                }
                if(projectDialogState.projectForm.stuffList.length === 0){
                  ElMessage({
                    type: 'warning',
                    message: '请至少选择一种试剂/材料',
                    duration: 1000
                  });
                  return
                }
                if(projectDialogState.projectForm.deviceList.length === 0){
                  ElMessage({
                    type: 'warning',
                    message: '请至少选择一种仪器/设备',
                    duration: 1000
                  });
                  return
                }
                if(projectDialogState.projectForm.hazardousWasteList.length === 0){
                  ElMessage({
                    type: 'warning',
                    message: '请选择添加危废数据',
                    duration: 1000
                  });
                  return
                }
                if(projectDialogState.projectForm.persons.length === 0){
                  ElMessage({
                    type: 'warning',
                    message: '请至少添加一名实验人员',
                    duration: 1000
                  });
                  return
                }
                projectDialogState.projectForm.persons = selectPersonRef.value.dataList
                projectDialogState.projectForm.hazardousWasteList = selectDangerRef.value.dataList
                projectDialogState.projectForm.siteList = selectRoomRef.value.dataList.map(({siteId}) => ({siteId}))
@@ -446,12 +502,15 @@
const getPersonList = async () => {
    let res = await userApi().getUserList({
        roleId: 1,
        usePage: false,
        pageIndex: 1,
        pageSize: 10
        pageSize: 99999,
        searchParams:{
          roleId: null,
          name: '',
          realName: ''
        }
    });
    if(res.data.code === 100){
    if(res.data.code === 200){
        projectDialogState.systemPersonList = JSON.parse(JSON.stringify(res.data.data));
    }else{
        ElMessage({