From 5a28e6e5194ddd3727fb5411c785bef0f29152bb Mon Sep 17 00:00:00 2001
From: Admin <978517621@qq.com>
Date: Fri, 25 Nov 2022 16:15:07 +0800
Subject: [PATCH] 新增有效期限
---
src/views/specialCheck/components/sumSheet.vue | 111 +++++++++++++++++++++++++++++++++++++------------------
1 files changed, 75 insertions(+), 36 deletions(-)
diff --git a/src/views/specialCheck/components/sumSheet.vue b/src/views/specialCheck/components/sumSheet.vue
index 39231e3..043a63c 100644
--- a/src/views/specialCheck/components/sumSheet.vue
+++ b/src/views/specialCheck/components/sumSheet.vue
@@ -10,8 +10,7 @@
<div style="display: flex;justify-content: space-between;align-items: center;margin: 10px 0 20px;height: 40px">
<div style="width: 140px"></div>
<h2 style="text-align: center;margin: 0">{{taskName}}{{ activeTab==1?'批发':'零售' }}环节信息报送汇总表({{sheetStatus==1?'省级层面':(sheetStatus==2?'市级层面':'区县级')}})</h2>
- <el-button icon="el-icon-download" v-if="sheetStatus==1||sheetStatus==2" style="width: 140px" size="medium" type="primary" @click="exportSheet()" id="export">导出汇总表</el-button>
- <div v-else style="width: 140px"></div>
+ <el-button icon="el-icon-download" style="width: 140px" size="medium" type="primary" @click="exportSheet()" id="export">导出汇总表</el-button>
</div>
<div class="tabpanel">
<table v-show="sheetStatus==1||sheetStatus==2" class="data-table" id="tableExcel" v-if="thisLevelStatistic && institutionalData && institutionalData.length>0">
@@ -127,8 +126,8 @@
<td>{{thisLevelStatistic.thisLevelSpotCheckinfo.amerceEnterpriseNum}}</td>
<td>{{thisLevelStatistic.thisLevelSpotCheckinfo.amerceMoneySum}}</td>
</tr>
- <template v-for="(item,index) in institutionalData">
- <tr>
+ <template v-if="institutionalData && institutionalData.length>0" v-for="(item,index) in institutionalData">
+ <tr v-if="item.citySpotCheckinfo || item.areaSpotCheckinfo">
<td :rowspan="sheetStatus==1?2:1">{{ index + 1}}</td>
<td :rowspan="sheetStatus==1?2:1" class="point-item" @click="toDig(item.enterpriseCity,item.enterpriseArea)">
{{sheetStatus==1?item.enterpriseCity:item.enterpriseArea }}
@@ -149,30 +148,54 @@
<td :rowspan="sheetStatus==1?2:1">{{ item.completedRectifyMajorHiddendangerNum }}</td>
<td :rowspan="sheetStatus==1?2:1">{{ item.hiddendangerRectifyRate==null?'--':item.hiddendangerRectifyRate + '%' }}</td>
<td>{{ sheetStatus==1?'设立区级':'县级' }}</td>
- <td class="point-item" @click="checkEnterprise(item.enterpriseCity,item.enterpriseArea)">{{sheetStatus==1?item.citySpotCheckinfo.spotCheckEnterpriseNum:item.areaSpotCheckinfo.spotCheckEnterpriseNum}}</td>
- <td>{{sheetStatus==1?item.citySpotCheckinfo.spotCheckRateRequire + '%':item.areaSpotCheckinfo.spotCheckRateRequire + '%'}}</td>
- <td v-if="sheetStatus==1" :class="item.citySpotCheckinfo.spotCheckCompleteRate<item.citySpotCheckinfo.spotCheckRateRequire?'warning':''">
- {{item.citySpotCheckinfo.spotCheckCompleteRate + '%'}}
+ <td v-if="(item.citySpotCheckinfo && item.citySpotCheckinfo.spotCheckEnterpriseNum)|| (item.areaSpotCheckinfo && item.areaSpotCheckinfo.spotCheckEnterpriseNum)" class="point-item" @click="checkEnterprise(item.enterpriseCity,item.enterpriseArea)">
+ {{sheetStatus==1?item.citySpotCheckinfo.spotCheckEnterpriseNum:item.areaSpotCheckinfo.spotCheckEnterpriseNum}}
+ </td>
+ <td v-if="(item.citySpotCheckinfo && item.citySpotCheckinfo.spotCheckRateRequire)|| (item.areaSpotCheckinfo && item.areaSpotCheckinfo.spotCheckRateRequire)">
+ {{sheetStatus==1?item.citySpotCheckinfo.spotCheckRateRequire + '%':item.areaSpotCheckinfo.spotCheckRateRequire + '%'}}
+ </td>
+ <td v-if="sheetStatus==1 && item.citySpotCheckinfo && item.citySpotCheckinfo.spotCheckCompleteRate" :class="item.citySpotCheckinfo.spotCheckCompleteRate<item.citySpotCheckinfo.spotCheckRateRequire?'warning':''">
+ {{item.citySpotCheckinfo.spotCheckCompleteRate==null?'--':item.citySpotCheckinfo.spotCheckCompleteRate + '%'}}
</td>
<td v-else :class="item.areaSpotCheckinfo.spotCheckCompleteRate<item.areaSpotCheckinfo.spotCheckRateRequire?'warning':''">
- {{item.areaSpotCheckinfo.spotCheckCompleteRate + '%'}}
+ {{item.areaSpotCheckinfo.spotCheckCompleteRate==null?'--':item.areaSpotCheckinfo.spotCheckCompleteRate + '%'}}
</td>
- <td>{{sheetStatus==1?item.citySpotCheckHiddendangerinfo.spotCheckHiddendangerSum:item.areaSpotCheckHiddendangerinfo.spotCheckHiddendangerSum}}</td>
- <td>{{sheetStatus==1?item.citySpotCheckHiddendangerinfo.spotCheckMajorHiddendangerNum:item.areaSpotCheckHiddendangerinfo.spotCheckMajorHiddendangerNum}}</td>
- <td>{{sheetStatus==1?item.citySpotCheckHiddendangerinfo.spotCheckCompletedRectifyHiddendangerSum:item.areaSpotCheckHiddendangerinfo.spotCheckCompletedRectifyHiddendangerSum}}</td>
- <td>{{sheetStatus==1?item.citySpotCheckHiddendangerinfo.spotCheckCompletedRectifyMajorHiddendangerNum:item.areaSpotCheckHiddendangerinfo.spotCheckCompletedRectifyMajorHiddendangerNum}}</td>
- <td>
- {{sheetStatus==1?(item.citySpotCheckHiddendangerinfo.spotCheckHiddendangerRectifyRate==null?'--':item.citySpotCheckHiddendangerinfo.spotCheckHiddendangerRectifyRate + '%'):(item.areaSpotCheckHiddendangerinfo.spotCheckHiddendangerRectifyRate==null?'--':item.areaSpotCheckHiddendangerinfo.spotCheckHiddendangerRectifyRate + '%')}}</td>
- <td>{{sheetStatus==1?item.citySpotCheckinfo.revokeLicenseEnterpriseSum:item.areaSpotCheckinfo.revokeLicenseEnterpriseSum}}</td>
- <td>{{sheetStatus==1?item.citySpotCheckinfo.detainLicenseSum:item.areaSpotCheckinfo.detainLicenseSum}}</td>
- <td>{{sheetStatus==1?item.citySpotCheckinfo.amerceEnterpriseNum:item.areaSpotCheckinfo.amerceEnterpriseNum}}</td>
- <td>{{sheetStatus==1?item.citySpotCheckinfo.amerceMoneySum:item.areaSpotCheckinfo.amerceMoneySum}}</td>
+ <td v-if="(item.citySpotCheckHiddendangerinfo && item.citySpotCheckHiddendangerinfo.spotCheckHiddendangerSum)|| (item.areaSpotCheckHiddendangerinfo && item.areaSpotCheckHiddendangerinfo.spotCheckHiddendangerSum)">
+ {{sheetStatus==1?item.citySpotCheckHiddendangerinfo.spotCheckHiddendangerSum:item.areaSpotCheckHiddendangerinfo.spotCheckHiddendangerSum}}
+ </td>
+ <td v-if="(item.citySpotCheckHiddendangerinfo && item.citySpotCheckHiddendangerinfo.spotCheckMajorHiddendangerNum)|| (item.areaSpotCheckHiddendangerinfo && item.areaSpotCheckHiddendangerinfo.spotCheckMajorHiddendangerNum)">
+ {{sheetStatus==1?item.citySpotCheckHiddendangerinfo.spotCheckMajorHiddendangerNum:item.areaSpotCheckHiddendangerinfo.spotCheckMajorHiddendangerNum}}
+ </td>
+ <td v-if="(item.citySpotCheckHiddendangerinfo && item.citySpotCheckHiddendangerinfo.spotCheckCompletedRectifyHiddendangerSum)|| (item.areaSpotCheckHiddendangerinfo && item.areaSpotCheckHiddendangerinfo.spotCheckCompletedRectifyHiddendangerSum)">
+ {{sheetStatus==1?item.citySpotCheckHiddendangerinfo.spotCheckCompletedRectifyHiddendangerSum:item.areaSpotCheckHiddendangerinfo.spotCheckCompletedRectifyHiddendangerSum}}
+ </td>
+ <td v-if="(item.citySpotCheckHiddendangerinfo && item.citySpotCheckHiddendangerinfo.spotCheckCompletedRectifyMajorHiddendangerNum)|| (item.areaSpotCheckHiddendangerinfo && item.areaSpotCheckHiddendangerinfo.spotCheckCompletedRectifyMajorHiddendangerNum)">
+ {{sheetStatus==1?item.citySpotCheckHiddendangerinfo.spotCheckCompletedRectifyMajorHiddendangerNum:item.areaSpotCheckHiddendangerinfo.spotCheckCompletedRectifyMajorHiddendangerNum}}
+ </td>
+ <td v-if="sheetStatus==1 && item.citySpotCheckHiddendangerinfo && item.citySpotCheckHiddendangerinfo.spotCheckHiddendangerRectifyRate">
+ {{item.citySpotCheckHiddendangerinfo.spotCheckHiddendangerRectifyRate == null ? '--' : item.citySpotCheckHiddendangerinfo.spotCheckHiddendangerRectifyRate + '%' }}
+ </td>
+ <td v-else>
+ {{item.areaSpotCheckHiddendangerinfo.spotCheckHiddendangerRectifyRate==null?'--':item.areaSpotCheckHiddendangerinfo.spotCheckHiddendangerRectifyRate + '%'}}
+ </td>
+ <td v-if="(item.citySpotCheckinfo && item.citySpotCheckinfo.revokeLicenseEnterpriseSum)|| (item.areaSpotCheckinfo && item.areaSpotCheckinfo.revokeLicenseEnterpriseSum)">
+ {{sheetStatus==1?item.citySpotCheckinfo.revokeLicenseEnterpriseSum:item.areaSpotCheckinfo.revokeLicenseEnterpriseSum}}
+ </td>
+ <td v-if="(item.citySpotCheckinfo && item.citySpotCheckinfo.detainLicenseSum)|| (item.areaSpotCheckinfo && item.areaSpotCheckinfo.detainLicenseSum)">
+ {{sheetStatus==1?item.citySpotCheckinfo.detainLicenseSum:item.areaSpotCheckinfo.detainLicenseSum}}
+ </td>
+ <td v-if="(item.citySpotCheckinfo && item.citySpotCheckinfo.amerceEnterpriseNum)|| (item.areaSpotCheckinfo && item.areaSpotCheckinfo.amerceEnterpriseNum)">
+ {{sheetStatus==1?item.citySpotCheckinfo.amerceEnterpriseNum:item.areaSpotCheckinfo.amerceEnterpriseNum}}
+ </td>
+ <td v-if="(item.citySpotCheckinfo && item.citySpotCheckinfo.amerceMoneySum)|| (item.areaSpotCheckinfo && item.areaSpotCheckinfo.amerceMoneySum)">
+ {{sheetStatus==1?item.citySpotCheckinfo.amerceMoneySum:item.areaSpotCheckinfo.amerceMoneySum}}
+ </td>
</tr>
<tr v-if="sheetStatus==1">
<td>县级</td>
<td class="point-item" @click="checkEnterprise(item.enterpriseCity,'all')">{{item.areaSpotCheckinfo.spotCheckEnterpriseNum}}</td>
- <td>{{item.areaSpotCheckinfo.spotCheckRateRequire + '%'}}</td>
- <td :class="item.areaSpotCheckinfo.spotCheckCompleteRate<item.areaSpotCheckinfo.spotCheckRateRequire?'warning':''">{{item.areaSpotCheckinfo.spotCheckCompleteRate + '%'}}</td>
+ <td>{{item.areaSpotCheckinfo.spotCheckRateRequire==null?'--':item.areaSpotCheckinfo.spotCheckRateRequire + '%'}}</td>
+ <td :class="item.areaSpotCheckinfo.spotCheckCompleteRate<item.areaSpotCheckinfo.spotCheckRateRequire?'warning':''">{{item.areaSpotCheckinfo.spotCheckCompleteRate==null?'--':item.areaSpotCheckinfo.spotCheckCompleteRate + '%'}}</td>
<td>{{item.areaSpotCheckHiddendangerinfo.spotCheckHiddendangerSum}}</td>
<td>{{item.areaSpotCheckHiddendangerinfo.spotCheckMajorHiddendangerNum}}</td>
<td>{{item.areaSpotCheckHiddendangerinfo.spotCheckCompletedRectifyHiddendangerSum}}</td>
@@ -202,6 +225,8 @@
import { getCheckUnitType,getDataStatistics, getSpecialCheckTask } from "@/api/specialCheck"
import areaForm from "./areaForm"
import checkEnterprises from "./checkEnterprises"
+import FileSaver from 'file-saver'
+import XLSX from 'xlsx'
export default {
name: "sumSheet",
@@ -255,7 +280,7 @@
created() {
const t = this
t.getCheckUnitType()
- if(t.taskId){t.getDataStatistics()}
+ // if(t.taskId){t.getDataStatistics()}
},
computed: {
...mapGetters([
@@ -284,6 +309,13 @@
},
async getDataStatistics(){
const t = this
+ const loading = this.$loading({
+ lock: true,
+ target: document.querySelector('.tabpanel'),
+ text: '正在获取汇总数据',
+ spinner: 'el-icon-loading',
+ fullscreen: false
+ });
const data = {id: t.taskId,enterpriseType: t.activeTab,enterpriseCity: t.enterpriseCity,enterpriseArea: t.enterpriseArea,pageIndex: t.currentPage,pageSize: t.pageSize}
const res = await getDataStatistics(data)
if(res.data.code === "200"){
@@ -326,10 +358,10 @@
message:res.data.message
})
}
+ loading.close();
},
switchSheet() {
const t = this
- console.log(t.sheetStatus,'status')
if(t.sheetStatus == 1 || t.sheetStatus == 2){
t.getDataStatistics()
}else{
@@ -356,8 +388,9 @@
const t = this
if(t.sheetStatus==1){
t.enterpriseCity = city
- t.getDataStatistics()
t.sheetStatus = 2
+ t.getDataStatistics()
+ console.log(t.sheetStatus,t.institutionalData[0].citySpotCheckinfo.spotCheckEnterpriseNum,'666666666666666666')
}else{
t.sheetStatus = 3
t.$refs.areaSheet.taskId = t.taskId
@@ -368,14 +401,14 @@
}
},
tableToExcel(tableid,btnname,sheetname) {
- var uri = 'data:application/vnd.ms-excel;base64,'
+ let uri = 'data:application/vnd.ms-excel;base64,'
, template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><meta charset="UTF-8"><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head><body><table>{table}</table></body></html>'
, base64 = function (s) { return window.btoa(unescape(encodeURIComponent(s))) }
, format = function (s, c) { return s.replace(/{(\w+)}/g, function (m, p) { return c[p]; }) }
//根据ID获取table表格HTML
- var table = document.getElementById(tableid);
- var ctx = { worksheet: 'Worksheet', table: table.innerHTML };
- var alink = document.createElement("a");
+ let table = document.getElementById(tableid);
+ let ctx = { worksheet: 'Worksheet', table: table.innerHTML };
+ let alink = document.createElement("a");
alink.href = uri + base64(format(template, ctx));
alink.download = sheetname + ').xls';
alink.click();
@@ -383,8 +416,17 @@
exportSheet(){
const t = this
const sheetName = t.taskName + (t.activeTab==1 ?'批发':'零售') + '环节信息报送汇总表(' + (t.sheetStatus==1?'省级层面':(t.sheetStatus==2?'市级层面':'区县级'))
- t.tableToExcel("tableExcel", "export",sheetName);
- }
+ if(t.sheetStatus==1||t.sheetStatus==2){
+ t.tableToExcel("tableExcel", "export",sheetName);
+ }else{
+ let wb = XLSX.utils.table_to_book(document.querySelector('#' + 'areaSheet'))
+ let wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: true, type: 'array' })
+ try {
+ FileSaver.saveAs(new Blob([wbout], { type: 'application/octet-stream' }), sheetName + ').xlsx')
+ } catch (e) { if (typeof console !== 'undefined') console.log(e, wbout) }
+ // return wbout
+ }
+ },
}
}
</script>
@@ -415,7 +457,7 @@
border-left: none;
font-weight: bolder;
text-align: center;
- color: #409EFF;
+ color: #034EA2;
&:first-of-type{
border-top: 1px solid #ccc;
@@ -438,11 +480,8 @@
}
.point-item{
cursor: pointer;
-
- &:hover{
- text-decoration: underline;
- color: #409EFF;
- }
+ text-decoration: underline;
+ color: #409EFF;
}
.warning{
color: red;
--
Gitblit v1.9.2