From 32a95699e59c5c65e18c08643266c9cbfa380ee4 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期五, 07 六月 2024 09:56:05 +0800
Subject: [PATCH] 优化设备明细、检验任务附件权限
---
src/components/do/b3-work-time-management/work-time-statistics.vue | 49 +++++++++++++++++++++++++++++++++++--------------
1 files changed, 35 insertions(+), 14 deletions(-)
diff --git a/src/components/do/b3-work-time-management/work-time-statistics.vue b/src/components/do/b3-work-time-management/work-time-statistics.vue
index 4bf2a47..380987a 100644
--- a/src/components/do/b3-work-time-management/work-time-statistics.vue
+++ b/src/components/do/b3-work-time-management/work-time-statistics.vue
@@ -9,16 +9,20 @@
type="month"
format="yyyy-MM"
value-format="yyyy-MM"
- placeholder="閫夋嫨鏈�" size="small" style="width: 100%;">
+ placeholder="閫夋嫨鏈�" size="small" style="width: 100%;"
+ :clearable="false"
+ @change="refreshTable()">
</el-date-picker>
</div>
</div>
<div class="search_thing">
<div class="search_label">鍛樺伐锛�</div>
- <el-select v-model="entity.name" placeholder="鍏ㄩ儴" size="small" @change="refreshTable()">
+ <!-- <el-select v-model="entity.name" placeholder="鍏ㄩ儴" size="small" @change="refreshTable()" clearable>
<el-option v-for="item in personList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
- </el-select>
+ </el-select> -->
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable
+ v-model="entity.name" @keyup.enter.native="refreshTable()"></el-input>
</div>
<div class="search_thing">
<div class="search_label">閮ㄩ棬锛�</div>
@@ -36,8 +40,8 @@
<el-button size="small" type="primary" @click="refreshTable()">鏌� 璇�</el-button>
</div>
<div class="search_thing">
- <el-button size="small" type="primary" @click="handleDown" v-show="currentTable == 'value0'">瀵� 鍑�</el-button>
- <el-button size="small" type="primary" @click="handleUp" v-show="currentTable == 'value1'">瀵� 鍏�</el-button>
+ <el-button size="small" type="primary" @click="handleDown" v-show="currentTable == 'value0'" :loading="outLoading">瀵� 鍑�</el-button>
+ <el-button size="small" type="primary" @click="handleUp" v-show="currentTable == 'value1'">瀵� 鍏�</el-button>
</div>
</div>
<el-radio-group v-model="currentTable" size="small" :key="'111'" style="margin-top: 10px;">
@@ -51,8 +55,8 @@
<div class="table">
<ValueTable ref="ValueTable0"
v-if="currentTable == 'value0'"
- :url="$api.auxiliaryWorkingHours.selectAuxiliaryWorkingHours"
- :componentData="componentData" :inputUrl="$api.auxiliaryWorkingHours.selectAuxiliaryWorkingHours" :downUrl="$api.auxiliaryWorkingHours.selectAuxiliaryWorkingHours" :key="upIndex" />
+ :url="$api.auxiliaryOriginalHours.selectAuxiliaryOriginalHours"
+ :componentData="componentData" :key="upIndex" />
<ValueTable ref="ValueTable1"
v-if="currentTable == 'value1'"
:url="$api.auxiliaryCorrectionHours.selectAuxiliaryCorrectionHours"
@@ -79,10 +83,6 @@
month: getYearAndMonthAndDays().split('-')[0]+'-'+getYearAndMonthAndDays().split('-')[1],
name: null,
departLims: null,
- orderBy: {
- field: 'id',
- order: 'desc'
- }
},
isIndex: true,
showSelect: false,
@@ -94,7 +94,10 @@
requiredAdd: [],
requiredUp: [],
accept:聽'.xlsx',
- inputType:聽'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
+ inputType:聽'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
+ cellSpecialStyle:{
+ redColorByKey:'Hours'
+ }
},
componentData0: {
entity: {
@@ -128,7 +131,8 @@
upIndex1:100,
weekList:[],
personList:[],
- currentTable:'value0'
+ currentTable:'value0',
+ outLoading:false
}
},
mounted(){
@@ -152,6 +156,7 @@
},
refreshTable(){
let entity = {...this.entity}
+ entity.month = entity.month.split('-')[0]+'-'+entity.month.split('-')[1]
if(this.currentTable=='value0'){
this.componentData.entity = {...this.componentData.entity,...entity}
this.$refs['ValueTable0'].selectList()
@@ -182,7 +187,23 @@
})
},
handleDown(){
- this.$refs.ValueTable0.downFile(false)
+ // this.$refs.ValueTable0.downFile(false)
+ let entity = {...this.entity}
+ entity.month = entity.month.split('-')[0]+'-'+entity.month.split('-')[1]
+ this.outLoading = true
+ this.$axios.get(this.$api.auxiliaryOriginalHours.exportOriginalHours,{
+ params:entity,
+ },{responseType: "blob"}).then(res => {
+ this.outLoading = false
+ this.$message.success('瀵煎嚭鎴愬姛')
+ const blob = new Blob([res],{ type: 'application/octet-stream' });
+ console.log(blob)
+ const url = URL.createObjectURL(blob);
+ const link = document.createElement('a');
+ link.href = url;
+ link.download = entity.month+'宸ユ椂缁熻琛�.xlsx';
+ link.click();
+ })
},
handleUp(){
this.$refs.ValueTable1.openUpload()
--
Gitblit v1.9.3