Browse Source

提交禅道问题

刘湘琪 3 years ago
parent
commit
24c42ec88e

+ 8 - 0
src/api/common/common.js

@@ -31,3 +31,11 @@ export function downloadProjectByIDApi(projectId) {
     method: 'get'
   })
 }
+//下载附件
+export function downloadEnclosureByIdApi(ids) {
+  return request({
+    url: `/common/attach/${ids}`,
+    method: 'get',
+    responseType: 'blob'
+  })
+}

+ 9 - 1
src/api/enterprise/project/project.js

@@ -92,4 +92,12 @@ export function getProjectInfoCommonApi(id, query) {
     method: 'get',
     params: query
   })
-}
+}
+//重新提交审核
+export function entUserAudit(data) {
+  return request({
+    url: `/ent/user/auth`,
+    method: 'put',
+    data: data
+  })
+}

+ 20 - 1
src/main.js

@@ -47,7 +47,26 @@ Vue.prototype.addDateRange = addDateRange
 Vue.prototype.selectDictLabel = selectDictLabel
 Vue.prototype.selectDictLabels = selectDictLabels
 Vue.prototype.download = download
-Vue.prototype.handleTree = handleTree
+Vue.prototype.handleTree = handleTree
+
+// 下载
+Vue.prototype.downloadFile = (fileName, blob) => {
+  if ('download' in document.createElement('a')) {
+    // 非IE下载
+    const eLink = document.createElement('a')
+    eLink.download = fileName
+    eLink.style.display = 'none'
+    eLink.href = URL.createObjectURL(blob)
+    document.body.appendChild(eLink)
+    eLink.click()
+    // 释放URL 对象
+    URL.revokeObjectURL(eLink.href)
+    document.body.removeChild(eLink)
+  } else {
+    // IE10+下载
+    navigator.msSaveBlob(blob, fileName)
+  }
+}
 
 // 全局组件挂载
 Vue.component('DictTag', DictTag)

+ 2 - 2
src/utils/request.js

@@ -26,7 +26,7 @@ service.interceptors.request.use(config => {
   const isToken = (config.headers || {}).isToken === false
   // 是否需要防止数据重复提交
   const isRepeatSubmit = (config.headers || {}).repeatSubmit === false
-  const token = config.token 
+  const token = config.token
   if(token) {
     config.headers['Authorization'] = 'Bearer ' + token
   }else {
@@ -34,7 +34,7 @@ service.interceptors.request.use(config => {
       config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
     }
   }
-  
+
   // get请求映射params参数
   if (config.method === 'get' && config.params) {
     let url = config.url + '?' + tansParams(config.params);

+ 40 - 0
src/utils/zipdownload.js

@@ -0,0 +1,40 @@
+import axios from 'axios'
+import { getToken } from '@/utils/auth'
+
+const mimeMap = {
+  xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
+  zip: 'application/zip'
+}
+
+const baseUrl = process.env.VUE_APP_BASE_API
+export function downLoadZip(str, filename) {
+  var url = baseUrl + str
+  axios({
+    method: 'get',
+    url: url,
+    responseType: 'blob',
+    headers: { 'Authorization': 'Bearer ' + getToken() }
+  }).then(res => {
+    resolveBlob(res, mimeMap.zip)
+  })
+}
+/**
+ * 解析blob响应内容并下载
+ * @param {*} res blob响应内容
+ * @param {String} mimeType MIME类型
+ */
+export function resolveBlob(res, mimeType) {
+  const aLink = document.createElement('a')
+  var blob = new Blob([res.data], { type: mimeType })
+  // //从response的headers中获取filename, 后端response.setHeader("Content-disposition", "attachment; filename=xxxx.docx") 设置的文件名;
+  var patt = new RegExp('filename=([^;]+\\.[^\\.;]+);*')
+  var contentDisposition = decodeURI(res.headers['content-disposition'])
+  var result = patt.exec(contentDisposition)
+  var fileName = result[1]
+  fileName = fileName.replace(/\"/g, '')
+  aLink.href = URL.createObjectURL(blob)
+  aLink.setAttribute('download', fileName) // 设置下载文件名称
+  document.body.appendChild(aLink)
+  aLink.click()
+  document.body.appendChild(aLink)
+}

+ 15 - 1
src/views/enterprise/ent/basicInfo.vue

@@ -138,7 +138,10 @@
         </td>
         <th>其他附件</th>
         <td>
-          <div v-for="(file, index) in list" :key="index"><a class="link" :href="file.url" target="_blank">{{file.fileName}}</a></div>
+          <div v-for="(file, index) in list" :key="index">
+            <a class="link" style="margin-right: 10px;">{{file.fileName}}</a>
+            <el-button type="text" @click="handleView(file.id)">查看</el-button>
+          </div>
         </td>
       </tr>
     </table>
@@ -154,6 +157,11 @@
         </td>
       </tr>
     </table>
+    <div class="oper">
+      <template v-if="info.authState == '2'">
+        <el-button @click="handleUpdate">修改</el-button>
+      </template>
+    </div>
   </div>
 </template>
 
@@ -203,11 +211,17 @@
       }
     },
     methods: {
+      handleUpdate() {
+        this.$router.push("/ent/edit/"+this.info.id+'?type=updateEnt')
+      },
       getEnclosureData() {
         getEnclosureApi(this.attachType, this.dataId).then(res => {
           this.list = res.data.records || []
         })
       },
+      handleView(id) {
+        window.open("http://124.232.146.72:7015/api/common/attach/"+id)
+      },
       getData() {
         this.loading = true
         listEntUserApi().then(res => {

+ 23 - 2
src/views/enterprise/ent/edit.vue

@@ -305,7 +305,7 @@
         <el-col :span="24">
           <el-form-item label="其他附件" prop="attachIds">
             <FileUpload :files="form.fileList" @input="handleSaleSuccess" :multiple="true" :params="params">上传材料</FileUpload>
-            <el-table v-loading="loading" :data="list" border style="width: 100%;margin-top: 5px;" v-if="type == 'update'">
+            <el-table v-loading="loading" :data="list" border style="width: 100%;margin-top: 5px;" v-if="type == 'update' || type == 'updateEnt'">
               <el-table-column label="序号" type="index" width="50" align="center"></el-table-column>
               <el-table-column label="文件名称" prop="fileName" align="center"></el-table-column>
               <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
@@ -376,7 +376,7 @@ import {getProvinceDataApi,getRegionChildrenApi} from "@/api/common/common"
 import { regTypeOptions,mainProductsOptions,yesOrNoOptions } from "@/utils/dataFormat"
 import FileUpload from '@/components/FileUpload'
 import ImageUpload from '@/components/ImageUpload'
-import {getEnclosureApi} from "@/api/enterprise/project/project"
+import {getEnclosureApi,entUserAudit} from "@/api/enterprise/project/project"
 import UploadEnclosure from "./components/UploadEnclosure"
 import {deleteEnclosureApi} from '@/api/enterprise/project/project'
 import { validIDcard,validAmount,validNumber } from '@/utils/validate'
@@ -786,6 +786,27 @@ export default {
             })
           }
         });
+      }else if(this.type == 'updateEnt') {
+        this.$refs.form.validate(valid => {
+          if (valid) {
+            this.loading = true;
+            entUserAudit(this.form).then(res => {
+              const userName = this.form.userName;
+              this.$notify.success({
+                title: '系统提示',
+                message: '信息修改成功!',
+                showClose: false,
+                duration: 2000
+              });
+              setTimeout(() => {
+                this.$store.dispatch("tagsView/delView", this.$route);
+                this.$router.go(-1);
+              }, 2000);
+            }).catch(() => {
+              this.loading = false;
+            })
+          }
+        });
       }
 
     }

+ 8 - 2
src/views/enterprise/ent/info.vue

@@ -134,11 +134,13 @@
         <th>企业营业执照</th>
         <td>
           <a class="link" :href="info.licensePath" target="_blank">企业营业执照</a>
-          <!-- <img :src="info.licensePath" alt="license"> -->
         </td>
         <th>其他附件</th>
         <td>
-          <div v-for="(file, index) in list" :key="index"><a class="link" :href="file.url" target="_blank">{{file.fileName}}</a></div>
+          <div v-for="(file, index) in list" :key="index">
+            <a class="link">{{file.fileName}}</a>
+            <el-button type="text" @click="handleView(file.id)">查看</el-button>
+          </div>
         </td>
       </tr>
     </table>
@@ -174,6 +176,7 @@
   import {getEnclosureApi} from "@/api/enterprise/project/project"
   import {getEntInfoByIdTaxApi} from "@/api/gov/gov"
   import {regTypeOptions, getLabel,yesOrNoOptions} from '@/utils/dataFormat'
+  import {downloadEnclosureByIdApi} from "@/api/common/common"
   export default {
     name: 'EntInfo',
     components: {
@@ -280,6 +283,9 @@
       handleUpdate() {
 
       },
+      handleView(id) {
+        window.open("http://124.232.146.72:7015/api/common/attach/"+id)
+      },
       cancel() {
         this.$store.dispatch("tagsView/delView", this.$route); // 关闭当前tab
         this.$router.go(-1);

+ 1 - 1
src/views/enterprise/project/components/EntBasic.vue

@@ -317,7 +317,7 @@ export default {
     handleSuccess(file) {
       this.$refs.techLicenseUpload.clearValidate()
       this.form.techLicense = file.url;
-      this.form.fileName = '高新证书';
+      this.form.fileName = file.name;
     },
     cancel() {
       this.$store.dispatch("tagsView/delView", this.$route); // 关闭当前tab

+ 1 - 1
src/views/enterprise/project/components/FinBasic.vue

@@ -342,7 +342,7 @@ export default {
     },
     handleSuccess(file) {
       this.form.techLicense = file.url;
-      this.form.fileName = '高新证书';
+      this.form.fileName = file.name;
       this.$refs.techLicenseUpload.clearValidate()
     },
     handleSaleSuccess(files) {

+ 1 - 1
src/views/enterprise/project/components/TechBasic.vue

@@ -325,7 +325,7 @@ export default {
     handleSuccess(file) {
       this.$refs.techLicenseUpload.clearValidate()
       this.form.techLicense = file.url;
-      this.form.fileName = '高新证书';
+      this.form.fileName = file.name;
     },
     cancel() {
       this.$store.dispatch("tagsView/delView", this.$route); // 关闭当前tab

+ 9 - 5
src/views/enterprise/project/index.vue

@@ -77,7 +77,7 @@
             <span>审核通过</span>
           </template>
           <template v-if="scope.row.authState == '4'">
-            <span>审核通过</span>
+            <span>审核拒绝</span>
           </template>
         </template>
       </el-table-column>
@@ -126,6 +126,7 @@
   import {projectAuditApi} from '@/api/admin/project/project'
   import AuditProject from './components/audit'
   import {downloadProjectByIDApi} from '@/api/common/common'
+  import { downLoadZip } from "@/utils/zipdownload";
   export default {
     components: {
       AddProject,
@@ -259,12 +260,15 @@
         })
       },
       handleDownload(row) {
-        downloadProjectByIDApi(row.id).then(response => {
-          this.download(response.msg);
-        });
+        downLoadZip('/project/download/' +row.id, "项目附件")
       },
       handleDownloadBatch() {
-
+        if(this.selectCount <= 0) {
+          this.$message.error('请选择要下载的项目');
+          return
+        }
+        const delIds = this.ids.join(',')
+        downLoadZip('/project/download/' +delIds, "项目附件")
       },
       handleUpload() {
 

+ 3 - 1
src/views/message/index.vue

@@ -14,7 +14,8 @@
     </h3>
     <el-table v-loading="loading" :data="list" border>
       <el-table-column label="通知类型" prop="noticeType" width="120" align="center" :formatter="noticeTypeFormat"/>
-      <el-table-column label="内容" prop="noticeContent" align="center">
+      <el-table-column label="通知标题" prop="noticeTitle" align="center"></el-table-column>
+      <el-table-column label="内容" prop="noticeContent" align="left">
         <template slot-scope="scope" >
           <span class="content_msg"> {{scope.row.noticeContent}}</span> <el-button @click="handleView(scope.row)" type="text" size="small">查看详情</el-button>
          </template>
@@ -88,6 +89,7 @@
          noticeByIdApi(id).then(response => {
            this.$alert(response.data.noticeContent, "消息内容");
          });
+         this.getList()
       },
       // 重置
       resetQuery() {