From 6ef9e5189ac1888b8c4c504d5c5d3f431807ff56 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期六, 15 三月 2025 11:57:40 +0800
Subject: [PATCH] 修改电路试验单位
---
src/components/view/b1-expenses.vue | 56 +++++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 41 insertions(+), 15 deletions(-)
diff --git a/src/components/view/b1-expenses.vue b/src/components/view/b1-expenses.vue
index 92081fb..d444071 100644
--- a/src/components/view/b1-expenses.vue
+++ b/src/components/view/b1-expenses.vue
@@ -50,9 +50,9 @@
<div>
<el-row class="title">
<el-col :span="12" style="padding-left: 20px;text-align: left;">璐圭敤缁熻</el-col>
- <el-col :span="12" style="text-align: right;">
+ <!-- <el-col :span="12" style="text-align: right;">
<el-button size="small" type="primary">OA鎺ㄩ��</el-button>
- </el-col>
+ </el-col> -->
</el-row>
</div>
<div class="search">
@@ -84,11 +84,12 @@
</div>
<div class="search_thing" style="padding-left: 70px;">鎬讳环锛歿{total}}</div>
<div class="search_thing" style="padding-left: 70px;">
- <el-button size="small" type="primary" @click="handleDown" :loading="outLoading">瀵煎嚭</el-button>
+ <el-button size="small" type="primary" @click="handleDown" :loading="outLoading" v-if="isExport">瀵煎嚭</el-button>
</div>
</div>
<div class="table">
- <ValueTable ref="ValueTable" :url="$api.insOrder.costStatistics" :componentData="componentData" :key="upIndex"
+ <ValueTable ref="ValueTable" :url="$api.insOrder.costStatistics"
+ :componentData="componentData" :key="upIndex"
@handleWeave="handleWeave" :column-min-width="'140'"/>
</div>
</div>
@@ -104,11 +105,9 @@
<script>
import ValueTable from '../tool/value-table.vue'
- import Word from '../tool/word.vue'
export default {
components: {
ValueTable,
- Word,
},
data() {
return {
@@ -199,7 +198,8 @@
},
selectField: {},
requiredAdd: [],
- requiredUp: []
+ requiredUp: [],
+ needSort: ['createTime', 'sample'],
},
entityCopy: {},
upIndex: 0,
@@ -218,7 +218,8 @@
current: -1,
size: -1,
},
- outLoading:false
+ outLoading:false,
+ isExport:false
}
},
mounted() {
@@ -241,14 +242,35 @@
}
,responseType: "blob"}).then(res => {
this.outLoading = false
- this.$message.success('瀵煎嚭鎴愬姛')
const blob = new Blob([res],{ type: 'application/octet-stream' });
- const url = URL.createObjectURL(blob);
- const link = document.createElement('a');
- link.href = url;
- let date = JSON.parse(entity.dates)
- link.download = (entity.company?entity.company+' ':'')+date[0]+' - '+date[1]+'璐圭敤缁熻.xlsx';
- link.click();
+ //灏咮lob 瀵硅薄杞崲鎴愬瓧绗︿覆
+ let reader = new FileReader();
+ reader.readAsText(blob, 'utf-8');
+ reader.onload = () => {
+ try {
+ let result = JSON.parse(reader.result);
+ if (result.message) {
+ this.$message.error(result.message);
+ } else {
+ const url = URL.createObjectURL(blob);
+ const link = document.createElement('a');
+ link.href = url;
+ let date = JSON.parse(entity.dates)
+ link.download = (entity.company?entity.company+' ':'')+date[0]+' - '+date[1]+'璐圭敤缁熻.xlsx';
+ link.click();
+ this.$message.success('瀵煎嚭鎴愬姛')
+ }
+ } catch (err) {
+ console.log(err);
+ const url = URL.createObjectURL(blob);
+ const link = document.createElement('a');
+ link.href = url;
+ let date = JSON.parse(entity.dates)
+ link.download = (entity.company?entity.company+' ':'')+date[0]+' - '+date[1]+'璐圭敤缁熻.xlsx';
+ link.click();
+ this.$message.success('瀵煎嚭鎴愬姛')
+ }
+ }
})
},
getTotal(){
@@ -332,6 +354,10 @@
if (power[i].menuMethod == 'addInsOrder') {
add = true
}
+ //
+ if (power[i].menuMethod == 'export') {
+ this.isExport = true
+ }
}
if (!up) {
this.componentData.do.splice(4, 1)
--
Gitblit v1.9.3