Browse Source

优化页面逻辑

wucl 8 months ago
parent
commit
d1d4bee10c

+ 8 - 0
src/api/documentProduction.js

@@ -0,0 +1,8 @@
+import request from '@/utils/request'
+
+export function page(params) {
+    return request.get(`/production`,params)
+}
+
+
+

+ 4 - 0
src/api/fileUpload.js

@@ -2,4 +2,8 @@ import request from '@/utils/request'
 
 export function uploadAssetsCalculateTmpl(params) {
     return request.post('/file/assets/uploadCalculateTmpl',params)
+}
+
+export function updateHouseGuarntyTargetTable(params) {
+    return request.post('/file/house/guaranty/target',params)
 }

+ 10 - 4
src/api/houseGuaranty.js

@@ -1,8 +1,14 @@
 import request from '@/utils/request'
 
 export function genConsignorLetter(params) {
-    return request({
-        url: '/house/guaranty/consignor/' + params,
-        method: 'get'
-    })
+    return request.get(`/house/guaranty/consignor/${params}`)
 }
+
+export function analysisCollect1(params) {
+    return request.get(`/house/guaranty/collect1/${params}`)
+}
+
+export function genTargetsTableWord(params) {
+    return request.post("/house/guaranty/targetTable",params)
+}
+

+ 12 - 1
src/components/SheetView/index.vue

@@ -1,6 +1,6 @@
 <template>
     <div>
-      <input type="file" @change="readExcel" />
+      <input type="file" @change="readExcel" id="upload"/>
       <div v-if="excelData" style="height: 600px; text-align: center;">
         <el-button type="primary" class="fsbtn" @click="fullScreenDialog = true">全屏预览</el-button>
         <div style="float: left; height: 600px; margin-top: -60px;">
@@ -16,6 +16,7 @@
    
   <script>
   import * as XLSX from 'xlsx';
+  import {updateHouseGuarntyTargetTable} from '@/api/fileUpload'
    
   export default {
     data() {
@@ -50,6 +51,16 @@
           };
           fileReader.readAsArrayBuffer(files[0]);
         }
+        let fileData = new FormData();
+        fileData.append("file", files[0])
+        updateHouseGuarntyTargetTable(fileData).then(res=>{
+          if (res.code === 200){
+            this.$emit('getUploadReture', res.data);
+            ElMessage.success({message:"表单上传成功.",plain:true})
+          }else{
+            document.getElementById("upload").value= '';
+          }
+        })
         
       },
 

+ 4 - 3
src/utils/request.js

@@ -8,7 +8,7 @@ const service = axios.create({
   // Vite默认不支持process
   // baseURL: process.env.VITE_BASE_URL,
   baseURL: import.meta.env.VITE_BASE_URL,
-  timeout: 5000 // 请求超时
+  timeout: 50000 // 请求超时
 })
 
 // 请求拦截器
@@ -64,10 +64,11 @@ service.interceptors.response.use(
   },
   error => {
     console.log('err' + error)
-    Message({
+    ElMessage({
       message: error.message,
       type: 'error',
-      duration: 5 * 1000
+      duration: 5 * 1000,
+      plain:true
     })
     return Promise.reject(error)
   }

+ 36 - 79
src/views/home/index.vue

@@ -64,102 +64,32 @@
                 </button>
               </div>
               <div class="example-list">
-              <el-card class="report-item no-border" shadow="never">
+              <el-card class="report-item no-border" shadow="never" v-for="(doc,id) in page.records">
                 <div class="report-icon">
-                  <img src="../../assets/icons/folder.png" style="width: 52px; height: 52px;"/>
+                  <img :src="docLog(doc.docType)" style="width: 52px; height: 52px;"/>
                 </div>
                 <div class="report-text">
                   <div>
-                    <span class="report-text-type">房地产抵押类报告</span>
+                    <span class="report-text-type">{{doc.docNo}}</span>
                     <span> 一 </span>
-                    <span class="report-text-name">成都市双流区怡心街道万顺路二段370号“西派国樾”共计22套商业用房地产市场价值咨询评估</span>
+                    <span class="report-text-name">{{ doc.docName }}</span>
                   </div>
                   <div style="padding-top: 5px;">
                     <span>
                       <el-icon>
                         <Avatar />
                       </el-icon>
-                      成都中铁华府置业有限公司</span>
+                      {{ doc.consignor }}</span>
                     <span>
                       <el-tag style="margin-left: 5px;">
-                        房地产
+                        {{ doc.businessType }}
                       </el-tag>
                       <el-tag style="margin-left: 5px;" type="success">
-                        抵押
+                        {{ doc.businessCate }}
                       </el-tag>
                     </span>
                     <span style="float: right; color:darkgrey">
-                      2024-10-16 12:10:09
-                    </span>
-                  </div>
-                </div>
-                <div class="report-button">
-                  <el-icon>
-                    <Download />
-                  </el-icon>
-                </div>
-              </el-card>
-              <el-card class="report-item no-border" shadow="never">
-                <div class="report-icon">
-                  <img src="../../assets/icons/word.png" style="width: 52px; height: 52px;"/>
-                </div>
-                <div class="report-text">
-                  <span class="report-text-type">房地产咨询类报告</span>
-                  <span> 一 </span>
-                  <span
-                    class="report-text-name">自贡鑫景城实业有限公司开发建设的位于自贡市自流井区汇东路西段与汇兴路交叉口南侧中心城区D2-44-3地块(原汇西片区C1-03地块)4号楼在建工程(建筑物)抵押价值评估
-                  </span>
-                  <div style="margin-top: 5px;">
-                    <span>
-                      <el-icon>
-                        <Avatar />
-                      </el-icon>
-                      四川银行股份有限公司自贡分行</span>
-                    <span>
-                      <el-tag style="margin-left: 5px;">
-                        房地产
-                      </el-tag>
-                      <el-tag style="margin-left: 5px;" type="danger">
-                        咨询
-                      </el-tag>
-                    </span>
-                    <span style="float: right; color:darkgrey">
-                      2024-10-16 12:10:09
-                    </span>
-                  </div>
-                </div>
-                <div class="report-button">
-                  <el-icon>
-                    <Download />
-                  </el-icon>
-                </div>
-              </el-card>
-              <el-card class="report-item no-border" shadow="never">
-                <div class="report-icon">
-                  <img src="../../assets/icons/excel.png" style="width: 52px; height: 52px;"/>
-                </div>
-                <div class="report-text">
-                  <span class="report-text-type">房地产咨询类报告</span>
-                  <span> 一 </span>
-                  <span
-                    class="report-text-name">自贡鑫景城实业有限公司开发建设的位于自贡市自流井区汇东路西段与汇兴路交叉口南侧中心城区D2-44-3地块(原汇西片区C1-03地块)4号楼在建工程(建筑物)抵押价值评估
-                  </span>
-                  <div style="margin-top: 5px;">
-                    <span>
-                      <el-icon>
-                        <Avatar />
-                      </el-icon>
-                      四川银行股份有限公司自贡分行</span>
-                    <span>
-                      <el-tag style="margin-left: 5px;">
-                        房地产
-                      </el-tag>
-                      <el-tag style="margin-left: 5px;" type="danger">
-                        咨询
-                      </el-tag>
-                    </span>
-                    <span style="float: right; color:darkgrey">
-                      2024-10-16 12:10:09
+                      {{ doc.updateTime }}
                     </span>
                   </div>
                 </div>
@@ -180,11 +110,17 @@ import { loginByOAInfo } from '@/api/user';
 import { setToken, getToken } from '@/utils/auth';
 import { mapStores } from 'pinia'
 import { useUserStore } from '@/stores/useUserStore';
+import { page } from '@/api/documentProduction';
+import wordLog from '../../assets/icons/word.png'
+import excelLog from '../../assets/icons/excel.png'
+import folderLog from '../../assets/icons/folder.png'
 
 export default {
   data() {
     return {
-      mainType: null
+      page: {
+        records:[]
+      }
     }
   },
   computed: {
@@ -203,11 +139,32 @@ export default {
     }
     // 登录成功,重新跳转到主页
     this.$router.push(`/home/index`)
+    this.getDocuments();
   },
   methods: {
     goto(path) {
       this.$router.push(`/home/${path}`)
+    },
+
+    getDocuments(){
+      page().then(res=>{
+        if (res.code === 200){
+            this.page = res.data;
+        }
+      })
+    },
+    docLog(docType){
+      switch(docType){
+        case 'CALCULATE_TABLE':
+          return excelLog;
+        case 'FOLDER':
+            return folderLog;
+        default :
+            return wordLog;
+      }
+      
     }
+
   }
 
 }

+ 71 - 11
src/views/house/workbench/consignor.vue

@@ -11,9 +11,9 @@
         </div>
         
         <div class="target-windows">
-            <SheetView :uploadUrl="'/api/file/house/guaranty/target'" @getExcelDate="excelDate"></SheetView>
+            <SheetView :uploadUrl="'/api/file/house/guaranty/target'" @getExcelDate="excelDate" @getUploadReture="uploadReture"></SheetView>
         </div>
-         <SwitchButton :nextPath="nextPath" :nextDo="genConsignorLetter"></SwitchButton>
+         <SwitchButton :nextPath="nextPath" :nextDo="genarate"></SwitchButton>
         
     </div>
 </template>
@@ -21,7 +21,8 @@
 <script>
 import  SwitchButton from '../../../components/SwichButton/index.vue'
 import  SheetView from '../../../components/SheetView/index.vue'
- import { genConsignorLetter } from '@/api/houseGuaranty.js';
+import { genConsignorLetter,genTargetsTableWord,analysisCollect1 } from '@/api/houseGuaranty.js';
+
  export default {
     components:{
         SwitchButton,
@@ -30,22 +31,81 @@ import  SheetView from '../../../components/SheetView/index.vue'
     data() {
         return {
             nextPath:'/home/houseWorkbench/certificate',
-            excelHtml:null
+            excelHtml:null,
+            upload:null,
+            processId:null
         }
     },
 
     methods:{
-       genConsignorLetter(){
-            if (this.excelHtml){
-                genConsignorLetter(13).then(res=>{
-                    console.log(res)
+        genConsignorLetter(id){
+            genConsignorLetter(id).then(res=>{
+                ElMessage({
+                    message:'致委托人函已生成',
+                    type: 'success',
+                    plain: true
                 })
-            }
+            })
        },
 
        excelDate(data){
-         this.excelHtml = data;
-       }
+            this.excelHtml = data;
+       },
+
+       uploadReture(data){
+            this.upload = data;
+            //this.genTargetTableWord(this.excelHtml,data.filePath);
+       },
+
+       genTargetTableWord(excelData,homePath){
+            if (excelData && homePath){
+                const param = new Object();
+                param.html = excelData;
+                param.homePath = homePath;
+                genTargetsTableWord(param).then(res =>{
+                    if (res.code === 200){
+                        this.processId= res.data;
+                    }
+                })
+                
+            }
+       },
+
+        analysisExcel(id){
+            analysisCollect1(id).then(res=>{
+                if (res.code === 200){
+                    this.genConsignorLetter(id);
+                }
+            })
+        },
+
+        async genarate(){
+            if (this.excelHtml && this.upload){
+                    const param = new Object();
+                    param.html = this.excelHtml;
+                    param.homePath = this.upload.filePath;
+                    await genTargetsTableWord(param).then(res =>{
+                        if (res.code === 200){
+                            this.processId= res.data;
+                        }
+                    })
+                    await analysisCollect1(this.processId).then(res=>{
+                        if (res.code === 200){
+                            
+                        }
+                    })
+                    genConsignorLetter(this.processId).then(res=>{
+                        if (res.code === 200){
+                            ElMessage({
+                                message:'致委托人函已生成',
+                                type: 'success',
+                                plain: true
+                            })
+                        }
+                       
+                    })
+                }
+        }
 
 
     }