From 7dba00a80cee072bc9e193d5d2a75c1f7cf72d28 Mon Sep 17 00:00:00 2001
From: gaoluyang <gaoluyang@rengu.cc>
Date: 星期四, 04 七月 2024 10:51:41 +0800
Subject: [PATCH] 表格输入框转换为科学计数法

---
 src/components/do/b3-work-time-management/work-time-management.vue |   93 +++++++++++++++++++++++++++++++---------------
 1 files changed, 62 insertions(+), 31 deletions(-)

diff --git a/src/components/do/b3-work-time-management/work-time-management.vue b/src/components/do/b3-work-time-management/work-time-management.vue
index 583d07b..fa6f726 100644
--- a/src/components/do/b3-work-time-management/work-time-management.vue
+++ b/src/components/do/b3-work-time-management/work-time-management.vue
@@ -63,10 +63,12 @@
       </el-radio-group>
       <div style="display: flex;align-items: center;">
         <p style="font-size: 14px;margin-right: 30px;">
-          鎬诲伐鏃舵眹鎬伙細<span style="font-size: 16px;color: #3A7BFA;">{{ (totalInfo['浜ч噺宸ユ椂姹囨��']+totalInfo['杈呭姪宸ユ椂姹囨��'])? (totalInfo['浜ч噺宸ユ椂姹囨��']+totalInfo['杈呭姪宸ユ椂姹囨��']):0 }}</span>&nbsp;&nbsp;&nbsp;&nbsp;浜ч噺宸ユ椂姹囨�伙細<span style="font-size: 16px;color: #3A7BFA;">{{totalInfo['浜ч噺宸ユ椂姹囨��']?totalInfo['浜ч噺宸ユ椂姹囨��']:0}}</span>&nbsp;&nbsp;&nbsp;&nbsp;杈呭姪宸ユ椂姹囨�伙細<span style="font-size: 16px;color: #3A7BFA;">{{totalInfo['杈呭姪宸ユ椂姹囨��']?totalInfo['杈呭姪宸ユ椂姹囨��']:0}}</span>
+          鎬诲伐鏃舵眹鎬伙細<span style="font-size: 16px;color: #3A7BFA;" v-if="totalInfo">{{ (totalInfo['浜ч噺宸ユ椂姹囨��']+totalInfo['杈呭姪宸ユ椂姹囨��'])? (totalInfo['浜ч噺宸ユ椂姹囨��']+totalInfo['杈呭姪宸ユ椂姹囨��']):0 }}</span>&nbsp;&nbsp;&nbsp;&nbsp;浜ч噺宸ユ椂姹囨�伙細<span style="font-size: 16px;color: #3A7BFA;" v-if="totalInfo">{{totalInfo['浜ч噺宸ユ椂姹囨��']?totalInfo['浜ч噺宸ユ椂姹囨��']:0}}</span>&nbsp;&nbsp;&nbsp;&nbsp;杈呭姪宸ユ椂姹囨�伙細<span style="font-size: 16px;color: #3A7BFA;" v-if="totalInfo">{{totalInfo['杈呭姪宸ユ椂姹囨��']?totalInfo['杈呭姪宸ユ椂姹囨��']:0}}</span>
         </p>
-        <el-button size="small" type="primary" style="margin-right: 16px;" @click="openAdd" v-show="currentTable == 'ValueTable0'">褰曞叆鏁版嵁</el-button>
-        <el-button size="small" type="primary" @click="handleOut" :loading="outLoading">瀵� 鍑�</el-button>
+        <el-button size="small" type="primary" style="margin-right: 16px;" @click="openAdd" v-show="currentTable == 'ValueTable0'&&add">褰曞叆鏁版嵁</el-button>
+        <el-button size="small" type="primary"
+        v-if="down"
+        @click="handleOut" :loading="outLoading">瀵� 鍑�</el-button>
       </div>
     </div>
     <div class="table">
@@ -216,6 +218,8 @@
   data () {
     return{
       entity:{},
+      down:false,
+      add:false,
       componentData: {
 					entity: {
 						week: null,
@@ -333,6 +337,7 @@
 					requiredAdd: [],
 					requiredUp: []
 			},
+      addFileVisible:false,
       entityCopy1: {},
       upIndex1:100,
       weekList:[
@@ -393,7 +398,7 @@
           label:'宸叉壒鍑�'
         },
       ],
-      totalInfo:{},
+      totalInfo:null,
       auxiliaryWorking:null,
       outLoading:false
     }
@@ -458,8 +463,53 @@
     this.entityCopy1 = this.HaveJson(this.componentData1.entity);
     this.componentData.tagField.weekDay.select = this.weekList
     this.componentData.selectField.weekDay.select = this.weekList
+    this.getPower()
   },
   methods:{
+    getPower(){
+      let power = JSON.parse(sessionStorage.getItem('power'))
+        let del = false
+        let down = false
+        let add = false
+        let up = false
+        let check = false
+        let ratify = false
+        for (var i = 0; i < power.length; i++) {
+					if (power[i].menuMethod == 'exportWorkingHours') {
+						down = true
+					}
+					if (power[i].menuMethod == 'deleteAuxiliaryWorkingHoursDay') {
+						del = true
+					}
+          if (power[i].menuMethod == 'insertAuxiliaryWorkingHoursDay') {
+						add = true
+					}
+          console.log(add)
+          if (power[i].menuMethod == 'updateAuxiliaryWorkingHoursDay') {
+						up = true
+					}
+          if (power[i].menuMethod == 'check') {
+						check = true
+					}
+          if (power[i].menuMethod == 'approve') {
+						ratify = true
+					}
+				}
+        if (!ratify) {
+					this.componentData.do.splice(3, 1)
+				}
+        if (!check) {
+					this.componentData.do.splice(2, 1)
+				}
+        if (!up) {
+					this.componentData.do.splice(1, 1)
+				}
+        if (!del) {
+					this.componentData.do.splice(0, 1)
+				}
+        this.down = down
+        this.add = add
+    },
     getYearAndMonthAndDays(date){
       return getYearAndMonthAndDays(date)
     },
@@ -702,35 +752,16 @@
     },
     handleOut(){
       this.outLoading = true
-      this.$axios.post(this.$api.auxiliaryOutputWorkingHours.exportWorkingHours,{responseType: 'blob'}).then(res => {
+      this.$axios.get(this.$api.auxiliaryOutputWorkingHours.exportWorkingHours,{responseType: "blob"}).then(res => {
         this.outLoading = false
         this.$message.success('瀵煎嚭鎴愬姛')
-        // let fileName="鏃ュ伐鏃舵眹鎬昏〃";
-        // const blob = new Blob([res], {
-        //   type: 'application/force-download'
-        // })
-        // const filename = decodeURI(fileName+'.xlsx')
-        // // 鍒涘缓涓�涓秴閾炬帴锛屽皢鏂囦欢娴佽祴杩涘幓锛岀劧鍚庡疄鐜拌繖涓秴閾炬帴鐨勫崟鍑讳簨浠�
-        // const elink = document.createElement('a')
-        // elink.download = filename
-        // elink.style.display = 'none'
-        // elink.href = URL.createObjectURL(blob)
-        // document.body.appendChild(elink)
-        // elink.click()
-        // URL.revokeObjectURL(elink.href) // 閲婃斁URL 瀵硅薄
-        // document.body.removeChild(elink)
-        const blob = new Blob([res], {
-          type: 'application/force-download'
-        })
-        const link = document.createElement('a')
-        link.href = URL.createObjectURL(blob)
-        link.download = decodeURI('鏃ュ伐鏃舵眹鎬昏〃'+'.xlsx')
-        document.body.appendChild(link)
-        link.click()
-        window.setTimeout(function () {
-            URL.revokeObjectURL(blob)
-            document.body.removeChild(link)
-        }, 0)
+        const blob = new Blob([res]);
+        console.log(blob)
+        const url = URL.createObjectURL(blob);
+        const link = document.createElement('a');
+        link.href = url;
+        link.download = '鏃ュ伐鏃舵眹鎬昏〃.xlsx';
+        link.click();
       })
     },
   }

--
Gitblit v1.9.3