<template>
	<div class="snapshot-statistics-handle-table-container layout-padding">
		<div class="layout-padding-auto layout-padding-view pd20">
			<el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent inline :disabled="state.loading">
				<el-form-item prop="dateType">
					<el-segmented
						v-model="state.queryParams.dateType"
						:options="[
							{ label: '按日统计', value: 'date' },
							{ label: '按周统计', value: 'week' },
							{ label: '按月统计', value: 'month' },
							{ label: '按时间段统计', value: 'datetimerange' },
						]"
						@change="changeDateType"
						:disabled="state.loading"
					/>
				</el-form-item>
				<el-form-item prop="crTime" v-if="state.queryParams.dateType === 'datetimerange'" label="时间">
					<el-date-picker
						v-model="state.queryParams.crTime"
						type="datetimerange"
						unlink-panels
						range-separator="至"
						start-placeholder="开始时间"
						end-placeholder="结束时间"
						:shortcuts="shortcuts"
						@change="changeDateType('datetimerange')"
						value-format="YYYY-MM-DD[T]HH:mm:ss"
						:default-time="defaultTimeStartEnd"
						:clearable="false"
					/>
				</el-form-item>
				<el-form-item prop="time" v-else label="时间">
					<el-date-picker
						v-model="state.queryParams.time"
						:type="state.queryParams.dateType"
						placeholder="选择时间"
						@change="changeDateType(state.queryParams.dateType)"
						:value-format="valueFormat"
						:format="formats"
						:clearable="false"
						:default-time="defaultTimeStartEnd"
					/>
				</el-form-item>
				<el-form-item label="行业" prop="IndustryId">
					<el-select v-model="state.queryParams.IndustryId" class="w100" placeholder="请选择行业" @change="queryList" clearable>
						<el-option v-for="item in industry" :key="item.id" :label="item.name" :value="item.id" />
					</el-select>
				</el-form-item>
				<el-form-item>
					<el-button type="primary" @click="queryList" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
					<el-button @click="resetQuery(ruleFormRef)" class="default-button" :loading="state.loading">
						<SvgIcon name="ele-Refresh" class="mr5" />重置
					</el-button>
					<el-button class="default-button" :loading="state.loading" @click="exportWord"
						><SvgIcon name="iconfont icon-daochu" class="mr5" /> 导出</el-button
					>
				</el-form-item>
			</el-form>
			<el-scrollbar v-loading="state.loading" class="scrollbar-view" always>
				<table style="width: 85%; margin: 0 auto" ref="exportTableRef">
					<tr>
						<td>
							<table style="width: 100%; border: 1px solid #000000; border-collapse: collapse; padding: 0">
								<tbody>
									<tr>
										<th id="sspTitle" colspan="4" style="height: 79px; font-size: 2.2em; text-align: center; vertical-align: middle">
											随手拍 {{ tableTitle }}办理工作统计
										</th>
									</tr>
									<tr>
										<td style="width: 360px; height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080" rowspan="3">
											随手拍来件数
										</td>
										<td id="Td0" rowspan="3" style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('sspljs')">{{ infoForm.sspljs }}</el-button>
										</td>

										<td style="width: 360px; height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">未在受理范围内件数</td>
										<td id="Td1" style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('wzslfwnjs')">{{ infoForm.wzslfwnjs }}</el-button>
										</td>
									</tr>
									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">随手拍转12345件数</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080" id="Td15">
											<el-button type="primary" link @click="linkDetail('sspZ12345JS')">{{ infoForm.sspZ12345JS }}</el-button>
										</td>
									</tr>
									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">受理范围内总件数</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('slfwnzjs')">{{ infoForm.slfwnzjs }}</el-button>
										</td>
									</tr>
									<tr>
										<td rowspan="3" style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											受理范围内派给各网格员件数
										</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080" rowspan="3">
											<el-button type="primary" link @click="linkDetail('slfwnpggwgyjs')">{{ infoForm.slfwnpggwgyjs }}</el-button>
										</td>

										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">受理范围内派给网格员四小时内回复件数</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('slfwnpgwgysxsnhfjs')">{{ infoForm.slfwnpgwgysxsnhfjs }}</el-button>
										</td>
									</tr>
									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											受理范围内派给网格员超过四小时回复件数
										</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080" class="tdclicks">
											<el-button type="primary" link @click="linkDetail('slfwnpgwgycgsxshfjs')">{{ infoForm.slfwnpgwgycgsxshfjs }}</el-button>
										</td>
									</tr>
									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">受理范围内派给网格员未回复件数</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('slfwnpgwgywhfjs')">{{ infoForm.slfwnpgwgywhfjs }}</el-button>
										</td>
									</tr>

									<tr>
										<td rowspan="2" style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											受理范围内按12345直派给各区县或部门件数
										</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080" rowspan="2">
											{{ infoForm.slfwnA12345ZPGGQXHBMJS }}
										</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">受理范围内按12345直派给各部门件数</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('slfwnA12345ZPGGBMJS')">{{ infoForm.slfwnA12345ZPGGBMJS }}</el-button>
										</td>
									</tr>
									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">受理范围内按12345直派给各区县件数</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('slfwnA12345ZPGGQXJS')">{{ infoForm.slfwnA12345ZPGGQXJS }}</el-button>
										</td>
									</tr>

									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080" rowspan="2">受理范围内已办信件</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080" rowspan="2">
											{{ infoForm.slfwnybxj }}
										</td>

										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">中心已办</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('zxyb')">{{ infoForm.zxyb }}</el-button>
										</td>
									</tr>
									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">部门已办</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('bmyb')">{{ infoForm.bmyb }}</el-button>
										</td>
									</tr>

									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080" rowspan="2">受理范围满意度</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080" rowspan="2">
											{{ infoForm.slfwmydTxt }}
										</td>

										<td
											style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080"
											title="非常满意+满意+甄别为满意+默认满意+一般+未做评价+未接通"
										>
											满意量
										</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('myl')">{{ infoForm.myl }}</el-button>
										</td>
									</tr>
									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080" title="不满意+非常不满意">不满意量</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('bmyl')">{{ infoForm.bmyl }}</el-button>
										</td>
									</tr>

									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080" rowspan="2">审核发放奖励个数</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080" rowspan="2">
											<el-button type="primary" link @click="linkDetail('shffjlgs')">{{ infoForm.shffjlgs }}</el-button>
										</td>

										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">审批不同意红包个数</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('spbtyhbgs')">{{ infoForm.spbtyhbgs }}</el-button>
										</td>
									</tr>
									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">审批同意红包个数</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('sptyhbgs')">{{ infoForm.sptyhbgs }}</el-button>
										</td>
									</tr>

									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080" rowspan="2">特殊红包审批统计</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080" rowspan="2">
											<!--                      {{ infoForm.tshbsp }}-->
										</td>

										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">审批不同意红包个数</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('sptygs')">{{ infoForm.sptygs }}</el-button>
										</td>
									</tr>
									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">已发金额</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<!--                      {{ infoForm.yfje }}-->
										</td>
									</tr>

									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080" rowspan="2">局审核发放网格员奖励个数</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080" rowspan="2">
											{{ infoForm.jshffwgjlgs }}
										</td>

										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">审批同意（网格员）红包个数</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('sptywgyhbgs')">{{ infoForm.sptywgyhbgs }}</el-button>
										</td>
									</tr>
									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">审批不同意（网格员）红包个数</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('spbtywgyhbgs')">{{ infoForm.spbtywgyhbgs }}</el-button>
										</td>
									</tr>

									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080" rowspan="5">市民奖励总额</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080" rowspan="5">
											{{ infoForm.smjlze }}
										</td>

										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">市民已发放奖励总额</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('smyffjlze')">{{ infoForm.smyffjlze }}</el-button>
										</td>
									</tr>
									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">市民待发奖励总额</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('smdffjlze')">{{ infoForm.smdffjlze }}</el-button>
										</td>
									</tr>

									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">已发（个）</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('yfg')">{{ infoForm.yfg }}</el-button>
										</td>
									</tr>
									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">无法联系（个）</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('wflxg')">{{ infoForm.wflxg }}</el-button>
										</td>
									</tr>
									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">婉拒红包（个）</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('wjhbg')">{{ infoForm.wjhbg }}</el-button>
										</td>
									</tr>

									<tr>
										<td rowspan="4" style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">网格员应发奖励金额</td>
										<td rowspan="4" style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080"></td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">网格员已发放奖励总额</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('wgyyffjlze')">{{ infoForm.wgyyffjlze }}</el-button>
										</td>
									</tr>
									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">网格员待发放奖励总额</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('wgydffjlze')">{{ infoForm.wgydffjlze }}</el-button>
										</td>
									</tr>
									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">网格员扣款总额（已发）</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('wgykkzeyf')">{{ infoForm.wgykkzeyf }}</el-button>
										</td>
									</tr>
									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">网格员扣款总额（待发）</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('wgykkzedf')">{{ infoForm.wgykkzedf }}</el-button>
										</td>
									</tr>

									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">受理范围内多部门会签件件数</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('slfwndbmhqjjs')">{{ infoForm.slfwndbmhqjjs }}</el-button>
										</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080"></td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080"></td>
									</tr>
									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">受理范围内热线中心归档件数</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('slfwnrxzxgdjs')">{{ infoForm.slfwnrxzxgdjs }}</el-button>
										</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080"></td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080"></td>
									</tr>

									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">热线中心发起会签件件数</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('rxzxfqhqjjs')">{{ infoForm.rxzxfqhqjjs }}</el-button>
										</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080"></td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080"></td>
									</tr>

									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080" rowspan="2">安全隐患</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080" rowspan="2">
											{{ infoForm.aqyh }}
										</td>

										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">已完成安全隐患整改</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('ywcaqyhzg')">{{ infoForm.ywcaqyhzg }}</el-button>
										</td>
									</tr>
									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">申请延期工单件数</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('sqyqgdjs')">{{ infoForm.sqyqgdjs }}</el-button>
										</td>
									</tr>
									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">申请延期工单次数</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('sqyqgdcs')">{{ infoForm.sqyqgdcs }}</el-button>
										</td>

										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080"></td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080"></td>
									</tr>

									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">超期件</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('cqj')">{{ infoForm.cqj }}</el-button>
										</td>

										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080"></td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080"></td>
									</tr>

									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080" rowspan="3">二次办理件数</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080" rowspan="3">
											<el-button type="primary" link @click="linkDetail('ecbljs')">{{ infoForm.ecbljs }}</el-button>
										</td>

										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">二次办理件数-退回部门</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('ecbljsthbm')">{{ infoForm.ecbljsthbm }}</el-button>
										</td>
									</tr>
									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">二次办理件数-回访不满意重办</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('ecbljshfbmycb')">{{ infoForm.ecbljshfbmycb }}</el-button>
										</td>
									</tr>
									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">二次办理件数-特提到原一级部门</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('ecbljsttdyyjbm')">{{ infoForm.ecbljsttdyyjbm }}</el-button>
										</td>
									</tr>
									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080" rowspan="2">二次办理工单满意率</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080" rowspan="2">
											{{ infoForm.ecblgdmylTxt }}
										</td>

										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">二次办理工单满意率-退回部门</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">{{ infoForm.ecblgdmylthbmTxt }}</td>
									</tr>
									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">二次办理工单满意率-回访不满意重办</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">{{ infoForm.ecblgdmylhfbmycbTxt }}</td>
									</tr>
									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080" rowspan="3">特提件数</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080" rowspan="3">
											<el-button type="primary" link @click="linkDetail('ttjs')">{{ infoForm.ttjs }}</el-button>
										</td>

										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">特提到原一级部门件数</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('ttdyyjbmjs')">{{ infoForm.ttdyyjbmjs }}</el-button>
										</td>
									</tr>
									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">特提到派单组件数</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('ttdpdzjs')">{{ infoForm.ttdpdzjs }}</el-button>
										</td>
									</tr>
									<tr>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">其他特提件数</td>
										<td style="height: 36px; padding-left: 10px; font-size: 16px; border: 1px solid #808080">
											<el-button type="primary" link @click="linkDetail('qtttjs')">{{ infoForm.qtttjs }}</el-button>
										</td>
									</tr>
								</tbody>
							</table>
						</td>
					</tr>
				</table>
				<el-backtop target=".scrollbar-view > div" />
			</el-scrollbar>
		</div>
	</div>
</template>
<script setup lang="ts" name="snapshotStatisticsHandleTable">
import { onMounted, reactive, ref } from 'vue';
import { ElMessageBox, FormInstance } from 'element-plus';
import { defaultDate, defaultTimeStartEnd, shortcuts } from '@/utils/constants';
import dayjs from 'dayjs';
import { exportAsDocx } from '@/utils/exportAsWord';
import { useRouter } from 'vue-router';
import { getSSPStatistics, getSSPStatisticsBaseData } from '@/api/snapshot/statistics';
// 定义变量内容
const ruleFormRef = ref<RefType>(); // 表单ref
const state = reactive(<any>{
	queryParams: {
		dateType: 'date', //
		time: dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss'), // 时间默认今天
		crTime: defaultDate, // 时间默认今天开始到今天结束
		IndustryId: null,
	},
	loading: false, // 加载
});
const valueFormat = ref('YYYY-MM-DD');
const formats = ref('YYYY-MM-DD');
const tableTitle = ref(
	`『${dayjs(state.queryParams.time).startOf('day').format('YYYY-MM-DD HH:mm:ss')}』-『${dayjs(state.queryParams.time)
		.endOf('day')
		.format('YYYY-MM-DD HH:mm:ss')}』`
);
const changeDateType = (val: string) => {
	switch (val) {
		case 'date':
			valueFormat.value = 'YYYY-MM-DD';
			formats.value = 'YYYY-MM-DD';
			tableTitle.value = `『${dayjs(state.queryParams.time).startOf('day').format('YYYY-MM-DD HH:mm:ss')}』-『${dayjs(state.queryParams.time)
				.endOf('day')
				.format('YYYY-MM-DD HH:mm:ss')}』`;
			state.queryParams.crTime = [
				dayjs(state.queryParams.time).startOf('day').format('YYYY-MM-DD[T]HH:mm:ss'),
				dayjs(state.queryParams.time).endOf('day').format('YYYY-MM-DD[T]HH:mm:ss'),
			];
			queryList();
			break;
		case 'month':
			valueFormat.value = 'YYYY-MM';
			formats.value = 'YYYY-MM';
			tableTitle.value = `『${dayjs(state.queryParams.time).startOf('month').format('YYYY-MM-DD HH:mm:ss')}』-『${dayjs(state.queryParams.time)
				.endOf('month')
				.format('YYYY-MM-DD HH:mm:ss')}』`;
			state.queryParams.crTime = [
				dayjs(state.queryParams.time).startOf('month').format('YYYY-MM-DD[T]HH:mm:ss'),
				dayjs(state.queryParams.time).endOf('month').format('YYYY-MM-DD[T]HH:mm:ss'),
			];
			queryList();
			break;
		case 'week':
			valueFormat.value = 'YYYY-MM-DD';
			formats.value = 'YYYY 第ww周';
			tableTitle.value = `『${dayjs(state.queryParams.time).startOf('week').format('YYYY-MM-DD HH:mm:ss')}』-『${dayjs(state.queryParams.time)
				.endOf('week')
				.format('YYYY-MM-DD HH:mm:ss')}』`;
			state.queryParams.crTime = [
				dayjs(state.queryParams.time).startOf('week').format('YYYY-MM-DD[T]HH:mm:ss'),
				dayjs(state.queryParams.time).endOf('week').format('YYYY-MM-DD[T]HH:mm:ss'),
			];
			queryList();
			break;
		case 'datetimerange':
			tableTitle.value = `『${dayjs(state.queryParams.crTime[0]).format('YYYY-MM-DD HH:mm:ss')}』-『${dayjs(state.queryParams.crTime[1]).format(
				'YYYY-MM-DD HH:mm:ss'
			)}`;
			queryList();
			break;
		default:
			valueFormat.value = 'YYYY-MM-DD[T]HH:mm:ss';
			formats.value = 'YYYY-MM-DD[T]HH:mm:ss';
			tableTitle.value = `『${dayjs(state.queryParams.time).startOf('day').format('YYYY-MM-DD HH:mm:ss')}』-『${dayjs(state.queryParams.time)
				.endOf('day')
				.format('YYYY-MM-DD HH:mm:ss')}』`;
			state.queryParams.crTime = [
				dayjs(state.queryParams.time).startOf('day').format('YYYY-MM-DD[T]HH:mm:ss'),
				dayjs(state.queryParams.time).endOf('day').format('YYYY-MM-DD[T]HH:mm:ss'),
			];
			queryList();
			break;
	}
};
/** 获取列表 */
const infoForm = ref<EmptyObjectType>({});
const queryList = () => {
	state.loading = true;
	let StartTime = null;
	let EndTime = null;
	if (state.queryParams?.crTime) {
		StartTime = state.queryParams?.crTime[0];
		EndTime = state.queryParams?.crTime[1];
	}
	const request = {
		StartTime,
		EndTime,
	};
	getSSPStatistics(request)
		.then(({ result }) => {
			infoForm.value = result ?? {};
			state.loading = false;
		})
		.catch(() => {
			state.loading = false;
		});
};
/** 重置按钮操作 */
const resetQuery = (formEl: FormInstance | undefined) => {
	if (!formEl) return;
	formEl.resetFields();
	valueFormat.value = 'YYYY-MM-DD[T]HH:mm:ss';
	formats.value = 'YYYY-MM-DD';
	tableTitle.value = `『${dayjs(state.queryParams.time).startOf('day').format('YYYY-MM-DD HH:mm:ss')}』-『${dayjs(state.queryParams.time)
		.endOf('day')
		.format('YYYY-MM-DD HH:mm:ss')}』`;
	state.queryParams.crTime = [dayjs().startOf('day').format('YYYY-MM-DD[T]HH:mm:ss'), dayjs().endOf('day').format('YYYY-MM-DD[T]HH:mm:ss')];
	queryList();
};
const exportTableRef = ref<RefType>();
const exportWord = () => {
	ElMessageBox.confirm(`确定要导出 随手拍${tableTitle.value}办理工作统计，是否继续?`, '提示', {
		confirmButtonText: '确认导出',
		cancelButtonText: '取消',
		type: 'warning',
		draggable: true,
		cancelButtonClass: 'default-button',
		autofocus: false,
	})
		.then(() => {
			exportAsDocx(exportTableRef.value, `随手拍${tableTitle.value}办理工作统计`);
		})
		.catch(() => {});
};
// 点击详情
const router = useRouter();
const linkDetail = (FieldName: string) => {
	router.push({
		path: '/snapshot/statistics/detailStatistics',
		query: {
			FieldName,
			StartTime: state.queryParams.crTime[0],
			EndTime: state.queryParams.crTime[1],
		},
	});
};
const industry = ref<EmptyArrayType>([]);
// 获取基础数据
const getBaseData = () => {
	getSSPStatisticsBaseData()
		.then(({ result }) => {
			industry.value = result.industry ?? [];
		})
		.catch(() => {});
};
onMounted(() => {
	queryList();
	getBaseData();
});
</script>
