From 3f6bf89b1985b6668f02ffcc9af577b412e92e45 Mon Sep 17 00:00:00 2001
From: zhouwx <1175765986@qq.com>
Date: 星期一, 24 三月 2025 17:17:45 +0800
Subject: [PATCH] bug修改

---
 src/views/safetyReview/institution/components/viewInstitution.vue |   57 ++++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 48 insertions(+), 9 deletions(-)

diff --git a/src/views/safetyReview/institution/components/viewInstitution.vue b/src/views/safetyReview/institution/components/viewInstitution.vue
index aa9a569..dd70118 100644
--- a/src/views/safetyReview/institution/components/viewInstitution.vue
+++ b/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">
@@ -143,8 +150,8 @@
           <el-row :gutter="30">
             <el-col :span="8">
               <el-form-item prop="agency.certPath" label="资质证书">
-                <el-upload  disabled :limit='state.imgLimit' :show-file-list="false" list-type="picture-card" >
-                  <el-image  v-if="certImageUrl"  :src="certImageUrl" :preview-src-list="certList" style="width: 100%;max-height: 146px;" />
+                <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>
@@ -284,11 +291,22 @@
         regAddress: '',
         business: '',
         reportPath: '',
+        businessType: []
     },
     username: '',
     phone: '',
     password: '',
-    confirmPassword: ''
+    confirmPassword: '',
+    businessTypeList: [
+      {
+        value: 1,
+        label: '安全评价'
+      },
+      {
+        value: 2,
+        label: '检验检测'
+      },
+    ]
 });
 
 
@@ -301,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()
@@ -356,10 +374,24 @@
             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)
-        certImageUrl.value = import.meta.env.VITE_APP_BASE_API + "/" +  res.data.certPath
-        certList.value.push(certImageUrl.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{
@@ -375,6 +407,10 @@
     srcList.value = []
     certList.value = []
 }
+const handlePictureCardPreview = (uploadFile) => {
+  state.dialogImageUrl = uploadFile.url
+  state.dialogImg = true
+}
 
 defineExpose({
     openDialog,
@@ -387,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 {

--
Gitblit v1.9.2