Prechádzať zdrojové kódy

为空查询bug修改&&当日开票颜色区分

wucl 15 hodín pred
rodič
commit
e893798c38

+ 15 - 1
src/utils/utils.js

@@ -205,7 +205,21 @@ const utils = {
   roundToDecimalPlace(number, decimalPlaces) {
       const factor = Math.pow(10, decimalPlaces);
       return Math.round(+number+'e'+ decimalPlaces) / factor;
-    }
+    },
+  getCurrentDate(){
+    // 获取当前时间
+    const today = new Date();
+    // 获取当前时间(today)的年份
+    const year = today.getFullYear();
+    // 获取月份
+    const month = String(today.getMonth() + 1).padStart(2, '0');
+    // 获取当前日
+    const day = String(today.getDate()).padStart(2, '0');
+    // 得到年月日
+    const thisDayDate = `${year}-${month}-${day}`; //打印当前日期
+    return thisDayDate;
+
+  }
 
 };
 

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

@@ -1013,7 +1013,7 @@ export default {
       this.$api.workNodeTaskRecord.personalTaskTodoList().then(res => {
         if (res.code === 200) {
           this.personalTodoList = res.data.records;
-          const businessIds = res.data.records.map(item=>item.businessId)
+          const businessIds = res.data.records.map(item=>item.businessId);
           this.queryLastComments(businessIds);
         }
       })
@@ -1286,6 +1286,7 @@ export default {
        })
     },
     queryLastComments(businessIds){
+        if (businessIds && businessIds.length>0){
           this.$api.workflowLog.queryLastComments(businessIds).then(res=>{
               if (res.code === 200){
                  for (let i in this.personalTodoList){
@@ -1298,6 +1299,7 @@ export default {
               }
           })
         }
+    }
 
   },
 

+ 65 - 2
src/views/finance/invoiceCheck.vue

@@ -44,7 +44,8 @@
             :header-row-style="{ color: '#333333' }" style="
               border-left: 1px solid #ebeced;
               border-right: 1px solid #ebeced;
-              color: #333333;">
+              color: #333333;" :row-style="isCurrentDate"
+              @cell-mouse-enter="enter" @cell-mouse-leave="leave"	>
             <el-table-column label="业务类型" align="center">
               <template slot-scope="{row}">
                 <span>{{ row.businessType}}</span>
@@ -544,6 +545,7 @@
 <script>
 import YPageListLayout from '@/components/YPageListLayout'
 import Breadcrumb from '@/components/Breadcrumb'
+import utils from '@/utils/utils'
 
 export default {
   name: 'invoiceCheck',
@@ -690,10 +692,12 @@ export default {
             }
           }]
       },
+      currentDate:null
     }
   },
   created() {
     this.getList1();
+    this.currentDate = new Date().getTime();
   },
   methods: {
 
@@ -999,7 +1003,66 @@ export default {
               }
             })
           })
-    }
+    },
+    isCurrentDate({row,rowIndex}){
+      var date = new Date(row.planMakeDate);
+      var date1 = date.getTime();
+       let styleJosn = {}
+       if (row.state=='审核中' && date1 > this.currentDate){
+        styleJosn.color = '#99a9bf'
+       }else{
+        styleJosn.color = 'red'
+       }
+       return styleJosn;
+    },
+    enter (row, column, cell) {
+      this.createTips(event, row, `当日开票`)
+    },
+    leave (row, column, cell) {
+      this.removeTips(row)
+    },
+    // 创建toolTip
+    createTips(el, row, value) {
+      var date = new Date(row.planMakeDate);
+      var date1 = date.getTime();
+      if (row.state=='审核中' && date1 <= this.currentDate){
+        const { detailId } = row
+        const tooltipDom = document.createElement('div')
+        tooltipDom.style.cssText = `
+          display: inline-block;
+          max-width: 400px;
+          max-height: 400px;
+          position: absolute;
+          top: ${el.clientY + 5}px;
+          left: ${el.clientX}px;
+          padding:5px 10px;
+          overflow: auto;
+          font-size: 14px;
+          font-family: PingFangSC-Regular, PingFang SC;
+          font-weight: 400;
+          color: #595959;
+          background: #fff;
+          border-radius: 5px;
+          z-index: 19999;
+          box-shadow: 0 4px 12px 1px #ccc;
+        `
+        tooltipDom.innerHTML = value
+        tooltipDom.setAttribute('id', `tooltip-${detailId}`)
+        // 将浮层插入到body中
+        document.body.appendChild(tooltipDom)
+      }
+      
+    },
+    // 删除tooltip
+    removeTips(row) {
+      const { detailId } = row
+      const tooltipDomLeave = document.querySelectorAll(`#tooltip-${detailId}`)
+      if (tooltipDomLeave.length) {
+          tooltipDomLeave.forEach(dom => {
+          document.body.removeChild(dom)
+        })
+      }
+    },
   },
   
 }