Browse Source

房地产报告生成优化

wucl 1 day ago
parent
commit
51adbfd8bd

+ 10 - 3
src/components/SheetView/index.vue

@@ -70,7 +70,9 @@
             const bufferArray = e.target.result;
             const wb = XLSX.read(bufferArray, { type: 'buffer' });
             const ws = wb.Sheets['估价结果一览表'];
+            
             this.targetExcelData = XLSX.utils.sheet_to_html(ws);
+
             this.viewExcelData = this.targetExcelData  + viewTableCss;
             setTimeout(()=>{
               this.formatExcel();
@@ -118,9 +120,14 @@
         trs[1].remove();
         const td0 = trs[2].childNodes
         for (let i = 0 ; i<trs.length; i++){
-            if (trs[i].childNodes[0].textContent===''){
-              trs[i].remove();
-            }
+          console.log(trs[i].childNodes[0].textContent.trim())
+          if (trs[i].childNodes[0].textContent.trim()==='备注:'){
+                break;
+          }
+          if (trs[i].childNodes[0].textContent==='' ){
+            trs[i].remove();
+          }
+          
         }
         for (let i =td0.length-1;i>0;i--){
           if (td0[i].textContent===''){

+ 48 - 6
src/views/home/index.vue

@@ -65,7 +65,10 @@
                 </el-icon>
               </el-button>
             </div>
-            <el-card class="report-item no-border" shadow="never" v-for="(doc, id) in page" v-if="page !== null && page.length !== 0">
+            <div v-loading="loading" :element-loading-svg="svg"
+            class="custom-loading-svg" element-loading-text="Loading..."
+            element-loading-svg-view-box="-10, -10, 50, 50">
+              <el-card class="report-item no-border" shadow="never" v-for="(doc, id) in page" v-if="page !== null && page.length !== 0">
               <div class="report-icon">
                 <img :src="docLog(doc.docType)" style="width: 52px; height: 52px;" />
               </div>
@@ -87,6 +90,7 @@
                     <el-tag style="margin-left: 5px;" type="success">{{ doc.businessCate }}</el-tag>
                   </span>
                   <span style="float: right; color:darkgrey">{{ doc.updateTime }}</span>
+                  <span style="float: right; color:darkgrey">{{ doc.createUserName+'-' }}</span>
                 </div>
               </div>
               <div class="report-button" @click="downloadFile(doc.docUrl, doc.docName)">
@@ -94,7 +98,8 @@
                   <Download />
                 </el-icon>
               </div>
-            </el-card>
+              </el-card>
+            </div>
             <div class="null-div" v-if="page === null || page.length == 0">
               <img src="../../assets/icons/null.png" style="width: 128px; height: 128px;" />
               <div>
@@ -136,6 +141,9 @@ import excelLog from '../../assets/icons/excel.png'
 import folderLog from '../../assets/icons/folder.png'
 import fileUtil from '@/utils/file'
 
+
+
+
 export default {
   data() {
     return {
@@ -150,10 +158,24 @@ export default {
         total: null,
         createDate: null,
         docName: null,
+        state:true
       },
+      loading:false,
+      svg : `
+        <path class="path" d="
+          M 30 15
+          L 28 17
+          M 25.61 25.61
+          A 15 15, 0, 0, 1, 15 30
+          A 15 15, 0, 1, 1, 27.99 7.5
+          L 15 15
+        " style="stroke-width: 4px; fill: rgba(0, 0, 0, 0)"/>
+      `
     }
   },
   mounted() {
+    this.loading = true
+    this.login();
     // 使用$nextTick 等页面加载完毕之后,再选中tree组件默认节点,防止加载顺序问题
     this.$nextTick(function () {
       // 这行会生效
@@ -198,7 +220,10 @@ export default {
           break
       }
       this.$refs.treeDataYear.setCurrentKey(this.treeDataYear[0].children[childrenIndex].id)
-      this.setDay(this.$refs.treeDataYear.getCurrentNode())
+      //业务接口还没有验证token,查询会提示重新登录
+      setTimeout(()=>{
+        this.setDay(this.$refs.treeDataYear.getCurrentNode())
+      },1500)
     })
   },
   computed: {
@@ -208,8 +233,8 @@ export default {
     ...mapStores(useUserStore),
   },
   created() {
-    this.login()
-    // this.getDocuments();
+     
+    // // this.getDocuments();
     this.setYearMonth()
   },
   methods: {
@@ -218,7 +243,7 @@ export default {
     },
     choiceDay(index) {
       this.activeBtn = index
-      this.listQuery.createDate = this.days[index].date
+      this.listQuery.createDate = this.days[index].date;
       this.getDocuments()
     },
     // 设置横向的天数
@@ -373,10 +398,12 @@ export default {
       }
     },
     getDocuments() {
+      this.listQuery.state = true;
       documentProduction.page(this.listQuery).then((res) => {
         if (res.code === 200) {
           this.page = res.data.records
           this.listQuery.pages = res.data.pages
+          this.loading = false;
         }
       })
     },
@@ -578,4 +605,19 @@ p {
   margin-top: 20%;
   color: var(--vt-c-text-light-2);
 }
+
+:deep(.el-loading-spinner .path ){
+  -webkit-animation: loading-dash 1.5s ease-in-out infinite;
+  animation: loading-dash 1.5s ease-in-out infinite;
+  stroke-dasharray: 90, 150;
+  stroke-dashoffset: 0;
+  stroke-width: 4;
+  stroke-linecap: round;
+  stroke:#ff6154!important;
+}
+:deep(.el-loading-spinner .el-loading-text ){
+  color: #ff6154!important;
+  margin: 3px 0;
+  font-size: 20px;
+}
 </style>

+ 12 - 8
src/views/house/folder/parent.vue

@@ -50,6 +50,7 @@
                 <span style="float: right; color:darkgrey">
                   {{ doc.updateTime }}
                 </span>
+                <span style="float: right; color:darkgrey">{{ doc.createUserName+'-' }}</span>
               </div>
             </div>
             <div class="report-button">
@@ -64,9 +65,9 @@
             :page-count="listQuery1.pages" v-model:current-page="listQuery1.current" @current-change="getAllDocuments" />
         </div>
       </el-tab-pane>
-      <el-tab-pane label="进行中的项目" name="pending" disabled>
+      <el-tab-pane label="进行中的项目" name="pending">
         <div class="example-list">
-          <el-card class="report-item no-border" shadow="never" v-for="(doc, id) in allPage">
+          <el-card class="report-item no-border" shadow="never" v-for="(doc, id) in pendingPage">
             <div class="report-icon">
               <img :src="docLog(doc.docType)" style="width: 52px; height: 52px;" />
             </div>
@@ -74,7 +75,7 @@
               <div>
                 <span class="report-text-type">{{ doc.businessType + doc.businessCate + '【' + doc.docNo + '】' }}</span>
                 <span> 一 </span>
-                <span class="report-text-name">{{ doc.docName }}</span>
+                <span class="report-text-name" @click="docDetail(doc.id,doc.businessId)">{{ doc.docName }}</span>
               </div>
               <div style="padding-top: 5px;">
                 <span>
@@ -93,6 +94,8 @@
                 <span style="float: right; color:darkgrey">
                   {{ doc.updateTime }}
                 </span>
+                <span style="float: right; color:darkgrey">{{ doc.createUserName+'-' }}</span>
+
               </div>
             </div>
             <div class="report-button">
@@ -107,9 +110,9 @@
             :page-count="listQuery1.pages" v-model:current-page="listQuery1.current" @current-change="getPendingDocuments" />
         </div>
       </el-tab-pane>
-      <el-tab-pane label="已完成的项目" name="finished" disabled>
+      <el-tab-pane label="已完成的项目" name="finished">
         <div class="example-list">
-          <el-card class="report-item no-border" shadow="never" v-for="(doc, id) in allPage">
+          <el-card class="report-item no-border" shadow="never" v-for="(doc, id) in finshedPage">
             <div class="report-icon">
               <img :src="docLog(doc.docType)" style="width: 52px; height: 52px;" />
             </div>
@@ -117,7 +120,7 @@
               <div>
                 <span class="report-text-type">{{ doc.businessType + doc.businessCate + '【' + doc.docNo + '】' }}</span>
                 <span> 一 </span>
-                <span class="report-text-name">{{ doc.docName }}</span>
+                <span class="report-text-name" @click="docDetail(doc.id,doc.businessId)">{{ doc.docName }}</span>
               </div>
               <div style="padding-top: 5px;">
                 <span>
@@ -136,6 +139,7 @@
                 <span style="float: right; color:darkgrey">
                   {{ doc.updateTime }}
                 </span>
+                                  <span style="float: right; color:darkgrey">{{ doc.createUserName+'-' }}</span>
               </div>
             </div>
             <div class="report-button">
@@ -179,7 +183,7 @@ export default {
         size: 10,
         pages: null,
         total: null,
-        state:0
+        state:false
       },
       finshedPage: [],
       listQuery3: {
@@ -187,7 +191,7 @@ export default {
         size: 10,
         pages: null,
         total: null,
-        state:1
+        state:true
       }
     }
   },

+ 2 - 1
src/views/house/workbench/consignor.vue

@@ -105,7 +105,7 @@
             <img src="../../../assets/icons/form.png"
                 style="width: 26px; height: 26px; float: left; margin-top: 27px;" />
             <el-tooltip content="点击下载" effect="light" placement="top">
-                <span class="form-name" @click="downloadCollect1">估价结果一览表-模版.xlsx</span>
+                <span class="form-name" @click="downloadCollect1">报告自动生成_模版1.0.xlsx</span>
             </el-tooltip>
         </div>
 
@@ -313,6 +313,7 @@ export default {
                 houseGuaranty.getProcessByDocId(this.docId).then(res => {
                     if (res.code === 200) {
                         this.process = res.data;
+                        this.processId = this.process.id;
                         this.$emit('getProcessParentId', this.process.id)
                     }
                 })