zhouwx
2025-02-05 7132270dbcb01808e205e108ad6bb87270dbe4b8
src/views/safetyReview/institution/components/viewInstitution.vue
@@ -140,6 +140,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 +258,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: "",
@@ -290,7 +301,7 @@
    areaList: [],
    busList: [],
    fileList: [],
    imgLimit: 1,
    imgLimit: 5,
    uploadUrl: import.meta.env.VITE_APP_BASE_API + '/system/common/uploadFile',
    header: {
        Authorization: 'Bearer ' + getToken()
@@ -348,6 +359,22 @@
        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 +386,11 @@
    dialogVisible.value = false;
    state.fileList = []
    srcList.value = []
    certList.value = []
}
const handlePictureCardPreview = (uploadFile) => {
  state.dialogImageUrl = uploadFile.url
  state.dialogImg = true
}
defineExpose({
@@ -372,9 +404,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 {