zhouwx
2025-03-24 3f6bf89b1985b6668f02ffcc9af577b412e92e45
src/views/safetyReview/institution/components/viewInstitution.vue
@@ -2,7 +2,7 @@
    <el-dialog v-model="dialogVisible" width="75%" top="50vh" align-center @close="closeDialog">
        <el-form ref="registerRef" :model="registerForm" class="register-form" label-position="top">
            <el-row :gutter="30">
                <el-col :span="8">
                <el-col :span="6">
                    <el-form-item prop="agency.name" label="机构名称">
                        <el-input
                            disabled
@@ -13,7 +13,7 @@
                        </el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                <el-col :span="6">
                    <el-form-item prop="agency.creditCode" label="社会信用代码">
                        <el-input
                            disabled
@@ -24,7 +24,7 @@
                        </el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                <el-col :span="6">
                    <el-form-item prop="agency.attribute" label="机构属性">
                        <el-radio-group v-model="registerForm.agency.attribute" style="width: 50%" disabled>
                            <el-radio :label="0" size="large">疆内</el-radio>
@@ -32,6 +32,13 @@
                        </el-radio-group>
                    </el-form-item>
                </el-col>
              <el-col :span="6">
                <el-form-item prop="agency.businessType" label="业务类别">
                  <el-checkbox-group v-model="registerForm.agency.businessType" disabled>
                    <el-checkbox v-for="item in registerForm.businessTypeList" :label="item.value" :key="item.value">{{ item.label }}</el-checkbox>
                  </el-checkbox-group>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row :gutter="30">
                <el-col :span="12">
@@ -140,6 +147,15 @@
                    </el-form-item>
                </el-col>
            </el-row>
          <el-row :gutter="30">
            <el-col :span="8">
              <el-form-item prop="agency.certPath" label="资质证书">
                <el-upload  disabled v-model:file-list="certList" :limit='state.imgLimit' :on-preview="handlePictureCardPreview" list-type="picture-card" >
                </el-upload>
              </el-form-item>
            </el-col>
          </el-row>
            <el-row :gutter="30">
                <el-col :span="8">
                    <el-form-item prop="agency.assetValue" label="固定资产总值">
@@ -249,7 +265,9 @@
import {getDict} from "@/api/login";
import {getRegionTree} from "@/api/area";
const imageUrl = ref("");
const certImageUrl = ref("");
const srcList = ref([]);
const certList = ref([]);
const registerForm = ref({
    agency:{
        name: "",
@@ -273,11 +291,22 @@
        regAddress: '',
        business: '',
        reportPath: '',
        businessType: []
    },
    username: '',
    phone: '',
    password: '',
    confirmPassword: ''
    confirmPassword: '',
    businessTypeList: [
      {
        value: 1,
        label: '安全评价'
      },
      {
        value: 2,
        label: '检验检测'
      },
    ]
});
@@ -290,7 +319,7 @@
    areaList: [],
    busList: [],
    fileList: [],
    imgLimit: 1,
    imgLimit: 5,
    uploadUrl: import.meta.env.VITE_APP_BASE_API + '/system/common/uploadFile',
    header: {
        Authorization: 'Bearer ' + getToken()
@@ -345,8 +374,25 @@
            registerForm.value.agency.area = [res.data.province,res.data.city,res.data.district].filter(item => { return item && item.trim() })
        }
        registerForm.value.agency.business = res.data.business.split(",").map(Number)
        registerForm.value.agency.businessType = res.data.businessType ? res.data.businessType.split(',').map(Number): []
        imageUrl.value = import.meta.env.VITE_APP_BASE_API + "/" +  res.data.reportPath
        srcList.value.push(imageUrl.value)
        if(res.data.certPath) {
          const imgList = res.data.certPath.split(',')
          imgList.forEach((item,index) => {
            if(item.includes(import.meta.env.VITE_APP_BASE_API)){
            }else{
              imgList[index] = import.meta.env.VITE_APP_BASE_API + "/" + item
            }
          })
          const imgUrl = imgList.join(',')
          certList.value = imgUrl ? imgUrl.split(',').map(url => {return {url} }) : []
        }
        // certImageUrl.value = import.meta.env.VITE_APP_BASE_API + "/" +  res.data.certPath
    }else{
        ElMessage.warning(res.message)
@@ -359,6 +405,11 @@
    dialogVisible.value = false;
    state.fileList = []
    srcList.value = []
    certList.value = []
}
const handlePictureCardPreview = (uploadFile) => {
  state.dialogImageUrl = uploadFile.url
  state.dialogImg = true
}
defineExpose({
@@ -372,9 +423,12 @@
        margin-top: 500px !important;
    }
}
</style>
<style lang='scss' scoped>
.register-form {
  ::v-deep(.el-upload--picture-card){display: none}
    .el-input {
        height: 40px;
        input {