Browse Source

辅助指标审核提供下载查看文件

1 year ago
parent
commit
3aab4c299f

+ 145 - 0
src/components/AuxiliaryAudit/index.vue

@@ -38,6 +38,102 @@
   
          
         </el-tab-pane>
+        <el-tab-pane
+          label="指标项"
+          name="指标项"
+          v-if="taskList.formobj.bondedFeeList.length != 0"
+        >
+          <el-form ref="form" >
+            <!-- v-if="dict.remark == item.normId" -->
+            <el-card
+              class="box-card"
+              v-for="(dict) in taskList.formobj.bondedFeeList"
+              :key="dict.id"
+              :value="dict"
+              style="margin-bottom: 24px; font-weight: bold"
+            >
+              <div slot="header" style="margin-left: 30px; font-size: 15px">
+                <el-row>
+                  <el-col :span="12">
+                    <el-form-item
+                      label-width="90px"
+                      prop="score"
+                      label="指标:"
+                    >
+                      <span>{{ dict.quotaName }}</span>
+                    </el-form-item>
+                  </el-col>
+                  <el-col :span="12">
+                    <el-form-item
+                      label-width="90px"
+                      prop="score"
+                      label="分数:"
+                    >
+                      <el-input
+                        :disabled="true"
+                        v-model="dict.score"
+                      ></el-input>
+                    </el-form-item>
+                  </el-col>
+                </el-row>
+              </div>
+              <!--          目前详情还没有返回,先在新增显示-->
+              <div
+                slot="header"
+                style="margin-left: 30px; font-size: 15px"
+                
+              >
+                <el-form-item
+                  label-width="90px"
+                  prop="score"
+                  label="指标内容:"
+                >
+                  <span>{{ dict.content }}</span>
+                </el-form-item>
+              </div>
+              <el-form-item
+                v-if="dict.confirmWay == '附件'"
+                label-width="70px"
+                prop="linkUrls"
+                label="附件"
+              >
+                <div style="cursor: pointer;" @click="downloadAttachmentFile(dict)">
+                  {{ dict.fileNames ? dict.fileNames.replace(',', '') : '' }}
+
+                </div>
+              </el-form-item>
+              <el-form-item
+                v-if="dict.confirmWay == '文字说明'"
+                label-width="70px"
+                prop="remark"
+                label="说明"
+              >
+                <el-input
+                  type="textarea"
+                  :disabled="true"
+                  v-model="dict.remark"
+                  rows="3"
+                ></el-input>
+              </el-form-item>
+              <el-form-item
+                v-if="dict.confirmWay == '数值'"
+                label-width="70px"
+                prop="numValue"
+                label="数值"
+              >
+                <el-input
+                  type="number"
+                  :disabled="true"
+                  v-model="dict.numValue"
+                ></el-input>
+              </el-form-item>
+            </el-card>
+
+            <!-- <el-form-item  label-width="100px" label="驳回理由">
+          <el-input type="textarea" width="100%" v-model="form.test"></el-input>
+        </el-form-item> -->
+          </el-form>
+        </el-tab-pane>
         <el-tab-pane label="审批记录" name="审批记录">
           <el-timeline>
             <el-timeline-item
@@ -60,6 +156,9 @@
   </template>
   
   <script>
+import { getToken } from "@/utils/auth";
+import { download } from '@/api/portal/OPSERVICE/OPSERVICE.js';
+import { saveAs } from 'file-saver';
   export default {
     data() {
       return {
@@ -67,14 +166,60 @@
         // 根路径
         baseURL: process.env.VUE_APP_BASE_API,
         BigImgVisible: false,
+
+        upload: {
+        // 是否显示弹出层(用户导入)
+        open: false,
+        // 弹出层标题(用户导入)
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/common/upload",
+      },
       };
     },
     props: ["taskList"],
+
     methods: {
       handlePictureCardPreview(file) {
         this.taskList.formobj.picture = file.url;
         this.BigImgVisible = true;
       },
+          // 文件上传成功处理
+    handleFileSuccess(index, response, file, fileList) {
+      let linkUrls = "";
+      let fileNames = "";
+      fileList.forEach((item) => {
+        linkUrls += item.response.fileName + ",";
+        fileNames += item.response.newFileName + ",";
+      });
+      this.QUOTAFEEList.forEach((item, key) => {
+        if (key == index) {
+          item.linkUrls = linkUrls;
+          item.fileNames = fileNames;
+        }
+      });
+    },
+    handleRemove(file, fileList) {
+      this.fileList = fileList;
+    },
+    handleChange(file, fileList) {},
+
+    downloadAttachmentFile(data){
+      let filename = data.fileNames.replace(",","");
+      let fileurl = data.linkUrls.replace('/profile','').replace(",","");
+
+      download(fileurl,data.id).then(res=>{
+        const blob = new Blob([res]);
+        saveAs(blob, filename);
+      })
+    },
+
     },
   };
   </script>

+ 2 - 2
src/views/AuxiliaryIndex/index.vue

@@ -157,7 +157,7 @@
         <el-form-item label="选择角色" prop="senId">
           <el-select filterable v-model="form.senId" placeholder="请选择">
             <el-option
-              v-for="(item, i) in roleList"
+              v-for="(item) in roleList"
               :key="item.value"
               :label="item.roleName"
               :value="item.roleId + ''"
@@ -168,7 +168,7 @@
         <el-form-item label="选择指标" prop="feeId">
           <el-select filterable v-model="form.feeId" placeholder="请选择">
             <el-option
-              v-for="(item, i) in indList"
+              v-for="(item) in indList"
               :key="item.value"
               :label="item.content"
               :value="item.id"

+ 5 - 1
src/views/norm/quotaBonded.vue

@@ -339,6 +339,8 @@
                 label="上传附件"
               >
                 <el-upload
+                  :on-exceed="exceedHandle"
+                  :limit="1"
                   :disabled="isAppoval"
                   class="upload-demo"
                   ref="upload"
@@ -349,7 +351,6 @@
                   :file-list="dict.fileList"
                   :on-remove="handleRemove"
                   :on-change="handleChange"
-                  :multiple="true"
                 >
                   <el-button
                     :disabled="isAppoval"
@@ -1034,6 +1035,9 @@ export default {
     handleRemove(file, fileList) {
       this.fileList = fileList;
     },
+    exceedHandle(files, fileList){
+      this.$message.warning("只能上传一个附件");
+    },
     download(resource) {
       let fileNames = resource.split(",");
       fileNames.forEach((item) => {