<template>
	<div class="checkProcess">
		<headNav
			@backPage="backPage"
			@rightClick="rightClick"
			:iconName="showIcon"
			:title="'任务详情'"
		></headNav>

		<!-- 搜索 -->
		<div class="search">
			<van-search
				v-model="searchValue"
				placeholder="请输入搜索关键词"
				input-align="center"
				@search="startSearch"
				@clear="clearSearch"
				:disabled="collapseDisabled"
			/>
		</div>

		<div class="totalPro">
			<div class="left">
				共需检查：
				<span>{{ totaNum }}</span>
				项
			</div>
			<div class="right df">
				<div class="FontColorOther pr15">
					已完成：
					<span>{{ complateNum }}</span>
					项
				</div>
				<div class="FontColorWarn">
					未检查：
					<span>{{ uncheckNum }}</span>
					项
				</div>
			</div>
		</div>

		<!-- 项目列表 -->
		<div class="proList">
			<van-sidebar v-model="activeKey" @change="sidebarChange">
				<van-sidebar-item
					v-for="(item, index) in mainList"
					:class="item.colorName"
					:disabled="collapseDisabled"
					:title="item.sonProcessName"
					:key="index"
				/>
			</van-sidebar>
			<div class="proItem" v-if="mainList">
				<van-collapse v-model="activeName_item" accordion>
					<div
						class="item"
						v-for="(_item, index) in mainList[activeKey].stylecontList"
						:key="index"
					>
						<van-collapse-item
							:name="_item.id"
							:disabled="
								(_item.pointEvents !== '' || collapseDisabled) && !hasChecked
							"
						>
							<template #title>
								<div class="width100 OPoint">{{ _item.examineProname }}</div>

								<!-- 检查流程及方法 -->
								<!-- v-if="activeName_item != _item.id" -->
								<div>
									<div class="checkExplain_top">
										<div class="funExplain">
											<van-cell title="检查流程及方法"></van-cell>
										</div>
										<div class="explainContent">
											<div
												v-if="_item.trueExamineFunState"
												v-html="_item.trueExamineFunState"
											></div>
											<div v-else>暂无</div>
										</div>
									</div>

									<!-- 常见问题 -->
									<div class="checkExplain_top">
										<div class="funExplain">
											<van-cell
												@click="commonQes(_item.id)"
												is-link
												title="常见问题"
												value="查看"
											/>
										</div>
										<div class="explainContent">
											<div
												v-if="_item.commonProblemConts"
												class="swiperContainer"
											>
												<van-swipe indicator-color="#3da9f0">
													<van-swipe-item
														v-for="(__item,
														__index) in handleProblemConts(
															_item.commonProblemConts
														)"
														:key="__index"
													>
														<div class="swiper_content">
															<div
																v-for="(___item,
																___index) in __item"
																class="swiper_content_item"
																:key="___index"
															>
																<div
																	class="swiper_img"
																	v-if="_item.commonProblemImgs"
																>
																	<van-image
																		:src="
																			handleProblemImgs(
																				_item.commonProblemImgs,
																				__index,
																				___index
																			)
																		"
																	></van-image>
																</div>
																<div class="swiper_title">
																	{{ ___item }}
																</div>
															</div>
														</div>
													</van-swipe-item>
												</van-swipe>
											</div>
											<div v-else>暂无</div>
										</div>
									</div>

									<!-- 检查结果 -->
									<div class="checkRes">
										<div class="FontColorInfo mr5">检查结果：</div>
										<van-radio-group
											style="margin-top: 3px;"
											v-model="_item.checkResult"
											direction="horizontal"
										>
											<div @click.stop class="mr10">
												<van-radio
													:class="_item.pointEvents"
													@click="
														clickRadio(
															mainList[activeKey].stylecontList,
															_item
														)
													"
													icon-size="0.4rem"
													:disabled="_item.pointEvents !== ''"
													name="1"
												>
													合格
												</van-radio>
											</div>
											<div @click.stop>
												<van-radio
													:class="_item.pointEvents"
													:disabled="_item.pointEvents !== ''"
													icon-size="0.4rem"
													name="2"
													@click="startCheck(_item)"
												>
													不合格
												</van-radio>
											</div>
										</van-radio-group>
									</div>
								</div>
							</template>
							<div class="fz13">
								<van-form>
									<div class="carItem" v-if="_item.examineOptions">
										<div class="mr5">检查类型</div>
										<div class="FontColorInfo">
											<span>{{ _item.examineType | getType }}</span>
										</div>
									</div>

									<div class="carItem" v-if="_item.examineOptions">
										<div class="mr5">历史隐患</div>
										<div class="FontColorOther">无</div>
									</div>
									<div class="carItem" v-if="_item.examineOptions">
										<div class="carItem_issue">是否涉及</div>
										<van-radio-group
											v-model="_item.answerOption"
											direction="horizontal"
										>
											<template v-if="_item.examineOptions">
												<van-radio
													v-for="j in getRadioGroup(_item.examineOptions)"
													icon-size="0.4rem"
													:disabled="handleEnabled"
													:name="j"
													:key="j"
												>
													{{ j }}
												</van-radio>
											</template>
										</van-radio-group>
									</div>

									<div v-if="_item.extraExamineTitle">
										<div
											v-for="(i, index_) in _item.extraExamineTitle.split(',')"
											:key="index_"
										>
											<div class="carItem">
												<div>附属检查</div>
												<span class="FontColorNormal">
													{{ _item.extraExamineTitle.split(',')[index_] }}
												</span>
											</div>

											<div class="carItem">
												<div v-if="_item.extraExamineContent">
													{{
														_item.extraExamineContent.split(',')[index_]
													}}
												</div>
												<van-field
													class="flex1"
													v-model="_item.checkSite[index_]"
													:disabled="handleEnabled"
													input-align="right"
													placeholder="请输入抽查部位"
												/>
											</div>
										</div>
									</div>

									<template v-if="!hasChecked">
										<div
											class="mb20"
											v-for="(item_checkSituation,index_checkSituation) in _item.checkSituation"
											:key="index_checkSituation"
										>
											<div class="mt10">
												<div class="df jfsb aic">
													<div>检查情况 ({{ index_checkSituation + 1 }})</div>
													<div>
														<span
															v-if="index_checkSituation > 0"
															@click="
																delCheckSituation(
																	_item.checkSituation,
																	index_checkSituation
																)
															"
															class="FontColorError"
														>
															删除
														</span>
													</div>
												</div>
												<div class="mt10">
													<van-field
														rows="4"
														autosize
														border
														class="textArea"
														v-model="item_checkSituation.content"
														type="textarea"
														:disabled="handleEnabled"
														placeholder="请输入情况说明"
													/>
												</div>
											</div>

											<div v-if="!hasChecked" class="mt10 imgItem">
												<van-uploader
													v-model="item_checkSituation.fileList"
													:max-count="4"
													:after-read="afterRead"
													:disabled="handleEnabled"
													multiple
													capture="camera"
												/>
											</div>
										</div>
									</template>
									<template v-else>
										<div v-if="_item.checkCaseConts">
											<div
												v-for="(item__, index__) in _item.checkCaseConts.split('@')"
												:key="index__"
											>
												<div class="mt10">
													<div class="df jfsb aic">
														<div>检查情况 ({{ index__ + 1 }})</div>
													</div>
													<div class="mt10">
														<van-field
															rows="4"
															autosize
															border
															class="textArea"
															:value="item__"
															type="textarea"
															:disabled="handleEnabled"
															placeholder="请输入情况说明"
														/>
													</div>
												</div>

												<div
													class="mt10 imgItem"
													v-if="_item.checkCaseImgs"
												>
													<van-image
														v-for="(item___,
														index___) in _item.checkCaseImgs
															.split('@')
															[index__].split(',')"
														@click="showImageDetails(item___, 0)"
														:src="getImgUrl(item___, 0)"
														:key="index___"
													/>
												</div>
											</div>
										</div>
									</template>
									
									<div class="addCheckBtn" v-if="!hasChecked">
										<van-button
											type="info"
											@click="addCheck(_item)"
											:disabled="handleEnabled"
										>
											添加检查情况
										</van-button>
									</div>

									<!-- 									<div class="checkExplain">
										<div class="funExplain">
											<van-cell
												@click="funExplain(_item.id)"
												is-link
												title="检查流程及方法"
												value="查看"
											/>
										</div>
										<div class="explainContent">
											<div v-html="_item.trueExamineFunState"></div>
										</div>
									</div> -->

									<div class="standExplain">
										<div class="funExplain">
											<van-cell
												@click="stepExplain(_item.id)"
												is-link
												title="设置要求"
												value="查看"
											/>
										</div>
										<div class="explainContent">
											<div v-html="_item.examineNormState"></div>
										</div>
									</div>

									<!-- <div class="standExplain">
										<div class="funExplain">
											<van-cell
												@click="commonQes(_item.id)"
												is-link
												title="常见问题"
												value="查看"
											/>
										</div>
									</div> -->

									<div class="btn" v-if="!hasChecked">
										<!-- 										<van-button
											v-if="_item.isStartBtnClick == '0' && !_item.isStop"
											@click="startCheck(_item)"
										>
											开始检查
										</van-button> -->

										<!-- 										<van-button
											v-if="_item.isStartBtnClick == '1' && !_item.isStop"
											@click="stopCheck(_item)"
										>
											暂停检查
										</van-button> -->

										<!-- 										<van-button
											class="stopBtn"
											v-if="_item.isStartBtnClick == '' && !_item.isStop"
											@click="turnStop"
										>
											跳转暂停项
										</van-button>

										<van-button
											class="stopBtn"
											v-if="_item.isStop"
											@click="reStart(_item)"
										>
											继续检查
										</van-button> -->


										<van-button
											v-if="_item.finishAll"
											type="info"
											style="flex: 1;"
											@click="submitCheck(_item)"
										>
											提交检查
										</van-button>
										<van-button
											type="info"
											v-else
											style="flex: 1;"
											@click="
												nextStep(
													mainList[activeKey].stylecontList,
													_item,
													index
												)
											"
										>
											完成本项
										</van-button>
									</div>
								</van-form>
							</div>
						</van-collapse-item>
					</div>
				</van-collapse>
			</div>
		</div>

		<!-- 遮罩层 -->
		<v-mask :showOverLay="showOverLay" :tipMsg="tipMsg"></v-mask>
	</div>
</template>

<script>
import headNav from '@/components/headNav.vue';
import { get, post, postImg, imgBaseUrl } from '@/utils/http.js';
import mask_overLay from '@/components/overLay_xy.vue';
import { ImagePreview } from 'vant';

export default {
	name: 'checkProcess',
	components: {
		headNav,
		'v-mask': mask_overLay
	},
	inject: ['reload'],
	data() {
		return {
			totaNum: 0,
			complateNum: 0,
			uncheckNum: 0,
			searchValue: '',
			activeKey: 0,
			activeName_item: [],
			isInvolve: '',
			isCorrect: '',
			mainList: '',
			storageList: '',
			deepList: '',
			isStartBtnClick: '0',
			radio_examineOptions: [],
			handleEnabled: true,
			nowEditItem: [],
			collapseDisabled: false,
			submitList: [],
			showOverLay: false,
			tipMsg: '图片上传中',
			hasChecked: false,
			showIcon: 'plus',
			isOnSearch: false,
			checkStatus: '',
			pointEvents: '',
			localStorageData: ''
		};
	},
	filters: {
		getType(data) {
			switch (data) {
				case '1':
					return '消防许可及验收备案';
					break;
				case '2':
					return '消防安全管理';
					break;
				case '3':
					return '建筑防火';
					break;
				case '4':
					return '安全疏散';
					break;
				case '5':
					return '消防控制室';
					break;
				case '6':
					return '消防设施器材——火灾自动报警系统';
					break;
				case '7':
					return '消防设施器材——消防给水设施';
					break;
				case '8':
					return '消防设施器材——自动灭火系统';
					break;
				case '9':
					return '消防设施器材——其他设施器材';
					break;
				case '10':
					return '其它消防安全管理';
					break;
				case '11':
					return '备注';
					break;
			}
		}
	},
	mounted() {
		this.init();

		this.checkStatus = this.$store.state.taskInfo.taskInfo.checkStatus;

		if (JSON.parse(localStorage.getItem('TASKID'))) {
			let taskId = JSON.parse(localStorage.getItem('TASKID'));

			if (this.$route.params.ID != taskId) {
				localStorage.removeItem('SUBLIST');
				this.submitList = [];
			} else {
				this.submitList = JSON.parse(localStorage.getItem('SUBLIST'))
					? JSON.parse(localStorage.getItem('SUBLIST'))
					: [];
			}
		} else {
			localStorage.setItem('TASKID', JSON.stringify(this.$route.params.ID));
		}

		console.warn(this.submitList);
	},
	methods: {
		// 初始化
		init() {
			this.getMainListApi();
		},

		// 获取主列表Api
		getMainListApi() {
			this.showOverLay = true;
			this.tipMsg = '加载中';
			get(`/cdsupervisionStylestep/allCheck/${this.$route.params.ID}`).then(res => {
				if (res.success == true) {
					if (res.data.length === 0) {
						this.showOverLay = false;
					} else {
						let num = 0;
						let _num = 0;
						let flag;
						res.data.forEach(item => {
							item.colorName = 'colorNor';
							flag = 0;

							item.stylecontList.forEach(j => {
								j.finishAll = false;
								j.checkSite = [];
								j.isStartBtnClick = '0';
								j.pointEvents = '';
								j.answerOption = '';
								j.checkSituation = [
									{
										content: '',
										fileList: []
									}
								];

								if (j.extraExamineContent) {
									j.extraExamineContent.split(',').map(k => {
										j.checkSite.push(item.sonProcessName);
									});
								}

								num++;

								this.submitList.map(k => {
									if (k.id == j.id) {
										j.answerOption = k.answerOption;
										j.checkCaseConts = k.checkCaseConts;
										j.checkResult = k.checkResult.toString();
										j.checkSite = k.checkSite;
										j.checkSituation = k.checkSituation;

										flag++;

										item.colorName = 'colorNow';
									}
								});

								if (flag == item.stylecontList.length) {
									item.colorName = 'colorComplate';
								} else if (flag > 0) {
									item.colorName = 'colorNow';
								}
							});
						});

						res.data.forEach((item, index) => {
							item.stylecontList.forEach(j => {
								_num++;
								if (_num === num) {
									j.finishAll = true;
								}
							});
						});

						this.mainList = res.data;
						this.storageList = res.data;
						this.deepList = JSON.parse(JSON.stringify(res.data));

						this.getTotalItem();
						this.getAnswerApi();
					}
				}
			});
		},

		// 获取答案列表
		getAnswerApi() {
			post('/cdsupervisionAnswer/checkAllCont', {
				pageSize: 999,
				taskId: this.$route.params.ID
			}).then(res => {
				this.showOverLay = false;
				if (res.success) {
					let flag = false;

					if (res.data && res.data.list.length > 0) {
						res.data.list.map(item => {
							if (!item.checkStatus) {
								flag = true;
							}
						});
					}

					console.warn(flag);

					if (flag) {
						this.hasChecked = false;
						this.showIcon = 'plus';
					} else {
						this.hasChecked = true;
						this.showIcon = 'notes-o';

						this.mainList.forEach(item => {
							if (item.stylecontList.length > 0) {
								item.colorName = 'colorComplate';
							}
						});

						this.mainList.map(i => {
							i.stylecontList.map(j => {
								j.pointEvents = 'stopClick';
							});
						});

						this.complateNum = this.totaNum;
						this.uncheckNum = 0;

						for (var i = 0; i < res.data.list.length; i++) {
							this.getAnswerDetailApi(res.data.list[i].id);
						}
					}
				}
			});
		},

		// 查询是否在默认模板
		async getFixedTemplateItem(val) {
			return get('/applet/getFixedTemplateItem', {
				matchCont: val
			});
		},

		// 获取答案详情Api
		getAnswerDetailApi(id) {
			get(`/cdsupervisionStylecont/contAndAnswer/${id}`).then(res => {
				if (res.success === true) {
					this.mainList.forEach(i => {
						if (i.stylecontList.length > 0) {
							i.stylecontList.forEach(j => {
								if (j.id === res.data.answer.styleContId) {
									j.answerOption = res.data.answer.answerOption;
									j.checkCaseConts = res.data.answer.checkCaseConts;
									j.checkResult = res.data.answer.checkResult.toString();
									j.checkSite = res.data.answer.checkSite
										? res.data.answer.checkSite.split(',')
										: [];
									j.checkCaseImgs = res.data.answer.checkCaseImgs;
								}
							});
						}
					});
				}
			});
		},

		// 返回上一页
		backPage() {
			this.$router.go(-1);
		},

		// 跳转监督检查记录
		rightClick() {
			if (this.showIcon == 'plus') {
				let id;
				let taskId;
				this.mainList.map((item, index) => {
					if (index === this.activeKey) {
						id = item.id;
						taskId = item.taskId;
					}
				});
				this.$router.push(`/addCheck/${taskId}/${id}`);
			} else {
				this.$router.push(
					`/checkRecord/${this.$route.params.ID}/${this.$route.params.currentID}`
				);
			}
		},

		// 侧边栏修改状态
		sidebarChange(index) {},

		// 获取总共检查项数
		getTotalItem() {
			let num = 0;

			if (this.storageList) {
				this.storageList.forEach(i => {
					i.stylecontList.forEach(j => {
						num++;
					});
				});
			}

			this.totaNum = num;
			this.complateNum = this.submitList.length;
			this.uncheckNum = num - this.submitList.length;
		},

		// 缓存数据
		storageItem() {
			// 本地缓存
			// const storageData = JSON.parse(JSON.stringify(this.mainList));
			let storageData = JSON.parse(JSON.stringify(this.submitList));

			// storageData.map(item => {
			// 	console.warn(item);
			// });

			storageData.map(i => {
				let imgArr = i.fileSrc.split('@');
				let FileSrcArr = [];

				imgArr.map((j, index) => {
					let arr = j.split(',');

					arr.map((k, index_) => {
						arr[index_] = { url: imgBaseUrl + k };
					});

					FileSrcArr.push(arr);
				});

				i.checkSituation.map((j, index) => {
					j.fileList = [];
					j.fileList = FileSrcArr[index];
				});
			});

			storageData = JSON.stringify(storageData);

			// localStorage.removeItem('MISSIONLIST');
			localStorage.removeItem('SUBLIST');

			localStorage.setItem('SUBLIST', storageData);
			// localStorage.setItem('SUBLISTList', storageData_);
		},

		// 检查 方法说明
		funExplain(id) {
			this.$router.push(`/funExplain/${this.$route.params.ID}/${id}`);
		},

		// 解析radio的字符串为数组
		getRadioGroup(str) {
			if (str) {
				return str.split(',');
			} else {
				return;
			}
		},

		// 检查 标准说明
		stepExplain(id) {
			this.$router.push(`/checkStandardExplain/${this.$route.params.ID}/${id}`);
		},

		// 常见问题
		commonQes(id) {
			this.$router.push(`/commonQes/${this.$route.params.ID}/${id}`);
		},

		// 新增检查项
		addCheck(item) {
			item.checkSituation.push({
				content: '',
				fileList: []
			});
		},

		// 删除一项检查情况
		delCheckSituation(item, index) {
			item.splice(index, 1);
		},

		// 开始检查
		startCheck(_item) {
			this.mainList.map(i => {
				i.stylecontList.map(j => {
					if (_item.id == j.id) {
						j.pointEvents = '';
					} else {
						// j.pointEvents = 'stopClick';
					}
				});
			});

			this.submitList.forEach((i, index) => {
				if (i.id === _item.id) {
					this.submitList.splice(index, 1);
				}
			});

			this.mainList[this.activeKey].colorName = 'colorNor';

			this.getTotalItem();

			if (_item.finishAll && this.uncheckNum > 1) {
				this.$toast.fail('本项为最后提交项，请先完成其他项');
				_item.checkResult = '';
				this.mainList.map(i => {
					i.stylecontList.map(j => {
						j.pointEvents = '';
					});
				});
				return;
			} else {
				if (this.nowEditItem.length > 0) {
					this.activeName_item = _item.id;
					this.handleEnabled = false;
					// this.collapseDisabled = true;
					_item.isStartBtnClick = '1';
					this.mainList[this.activeKey].colorName = 'colorNow';

					return;
				} else {
					this.activeName_item = _item.id;
					this.handleEnabled = false;
					// this.collapseDisabled = true;
					_item.isStartBtnClick = '1';
					this.mainList[this.activeKey].colorName = 'colorNow';
				}
			}
		},

		// 暂停检查
		stopCheck(item) {
			this.nowEditItem = [];
			this.nowEditItem.push(this.activeKey);
			this.nowEditItem.push(this.activeName_item);
			this.collapseDisabled = false;
			this.handleEnabled = true;
			item.isStop = true;
			item.isStartBtnClick = '';
		},

		// 继续检查
		reStart(item) {
			this.nowEditItem = [];
			this.collapseDisabled = true;
			this.handleEnabled = false;
			item.isStartBtnClick = '1';
			item.isStop = false;
		},

		// 跳转检查
		turnStop() {
			if (this.isOnSearch) {
				this.deepList.map((i, index_i) => {
					i.stylecontList.map((j, index_j) => {
						if (this.storageList[index_i].stylecontList[index_j]) {
							if (
								this.storageList[index_i].stylecontList[index_j].contSort !=
								j.contSort
							) {
								this.storageList[index_i].stylecontList.splice(
									j.contSort - 1,
									0,
									j
								);
							}
						} else {
							this.storageList[index_i].stylecontList.push(j);
						}
					});
				});

				this.mainList = this.storageList;
			}

			this.activeKey = this.nowEditItem[0];

			this.$nextTick(() => {
				this.activeName_item = this.nowEditItem[1];
			});
		},

		// 开始检索
		async startSearch(value) {
			this.mainList = [];
			this.activeKey = 0;

			this.deepList.map((i, index_i) => {
				// 合并子项
				i.stylecontList.map((j, index_j) => {
					if (this.storageList[index_i].stylecontList[index_j]) {
						if (
							this.storageList[index_i].stylecontList[index_j].contSort != j.contSort
						) {
							this.storageList[index_i].stylecontList.splice(j.contSort - 1, 0, j);
						}
					} else {
						this.storageList[index_i].stylecontList.push(j);
					}
				});
			});

			this.deepList = JSON.parse(JSON.stringify(this.storageList));

			this.storageList.map((i, index) => {
				let flag = true;

				i.stylecontList.map(j => {
					if (j.examineProname.indexOf(value) != -1) {
						// 是否存在搜索项

						if (flag) {
							this.mainList.push(i); // 展示的列表项与子项
							this.mainList[this.mainList.length - 1].stylecontList = [];
							this.mainList[this.mainList.length - 1].stylecontList.push(j);
							flag = false;
						} else {
							this.mainList[this.mainList.length - 1].stylecontList.push(j);
						}
					}
				});
			});

			if (this.mainList.length === 0) {
				this.mainList = this.storageList;
				if (this.searchValue.trim() != '' && !this.hasChecked) {
					const res = await this.getFixedTemplateItem(value);
					let flag = false;
					let selectItem = '';

					if (res.success) {
						res.data.map(item => {
							if (item.examineProname === value) {
								flag = true;
								selectItem = item;
							}
						});

						if (flag) {
							this.$dialog
								.confirm({
									title: '已有流程',
									message: '模板中已存在此项，是否添加？'
								})
								.then(() => {
									let id;
									let taskId;

									this.mainList.map((item, index) => {
										if (index === this.activeKey) {
											id = item.id;
											taskId = item.taskId;
										}
									});

									this.$router.push({
										path: `/addCheck/${taskId}/${id}`,
										query: {
											list: JSON.stringify(selectItem)
										}
									});
								})
								.catch(() => {
									// on cancel
								});
						} else {
							this.$dialog
								.confirm({
									title: '新增流程',
									message: '检查项中无此项，是否新增？'
								})
								.then(() => {
									let id;
									let taskId;

									this.mainList.map((item, index) => {
										if (index === this.activeKey) {
											id = item.id;
											taskId = item.taskId;
										}
									});

									this.$router.push(
										`/addCheck/${taskId}/${id}/${this.searchValue}`
									);
								})
								.catch(() => {
									// on cancel
								});
						}
					} else {
						this.$toast.fail('操作失败!');
						return;
					}
				} else {
					this.$toast.fail('暂无此数据');
				}
			} else {
				this.isOnSearch = true;
			}
		},

		handleProblemConts(cont) {
			let arr = cont.split('@');
			let arr_back = [];

			if (arr.length > 1) {
				for (let i = 0; i < arr.length; i++) {
					if (arr[i + 1]) {
						arr_back.push([arr[i], arr[i + 1]]);
					} else {
						arr_back.push([arr[i]]);
					}

					i++;
				}
			} else {
				arr_back.push(arr);
			}

			return arr_back;
		},

		handleProblemImgs(cont, index, _index) {
			const arr = cont.split('@');

			index = index * 2;

			if (_index == 0) {
				return imgBaseUrl + arr[index];
			} else if (_index == 1) {
				return imgBaseUrl + arr[index + 1];
			}
		},

		// 清空检索
		clearSearch() {
			this.mainList = [];

			this.deepList.map((i, index_i) => {
				i.stylecontList.map((j, index_j) => {
					if (this.storageList[index_i].stylecontList[index_j]) {
						if (
							this.storageList[index_i].stylecontList[index_j].contSort != j.contSort
						) {
							this.storageList[index_i].stylecontList.splice(j.contSort - 1, 0, j);
						}
					} else {
						this.storageList[index_i].stylecontList.push(j);
					}
				});
			});

			this.storageList.map((i, index) => {
				let flag = true;

				i.stylecontList.map(j => {
					if (j.examineProname.indexOf('') != -1) {
						if (flag) {
							this.mainList.push(i);
							this.mainList[this.mainList.length - 1].stylecontList = [];
							this.mainList[this.mainList.length - 1].stylecontList.push(j);
							flag = false;
						} else {
							this.mainList[this.mainList.length - 1].stylecontList.push(j);
						}
					}
				});
			});
			this.isOnSearch = false;
		},

		// 下一步
		async nextStep(mainList, item, index) {
			if (this.handleEnabled == false) {
				// 开始了检查进行下一项必须全部内容填好

				let extraExamineTitle = true;
				let answerOption = false;
				let imgCorrect = true;

				// if (item.extraExamineTitle === null) {
				// 	extraExamineTitle = true;
				// } else {
				// 	if (item.checkSite) {
				// 		extraExamineTitle = true;
				// 	} else {
				// 		extraExamineTitle = false;
				// 	}
				// }

				if (item.answerOption === null) {
					answerOption = true;
				} else {
					if (item.answerOption) {
						answerOption = true;
					} else {
						answerOption = false;
					}
				}

				item.checkSituation.map(i => {
					if (i.fileList.length == 0) {
						imgCorrect = false;
					}
				});

				if (answerOption && imgCorrect) {
					// 所有项填完
					if (mainList.length === index + 1) {
						// 一个列表检查 完成
						if (this.activeKey < this.mainList.length - 1) {
							//  还没有到倒数第二项
							this.handleEnabled = true;
							item.isStartBtnClick = '0';
							this.collapseDisabled = false;
							this.activeKey++;
							let flag = 0;

							if (this.submitList.length > 0) {
								this.submitList.forEach((i, index) => {
									if (i.id === item.id) {
										this.submitList.splice(index, 1);
									}
								});

								// 检查图片
								let arr = [];

								for (var i = 0; i < item.checkSituation.length; i++) {
									let imgSrc = '';
									let foo = false;
									let num_str_img = 0;
									let isNew;

									item.checkSituation[i].fileList.map(item_num => {
										if (item_num.url) {
											num_str_img++;
										} else {
											isNew = true;
										}
									});

									for (
										var j = 0;
										j < item.checkSituation[i].fileList.length;
										j++
									) {
										if (item.checkSituation[i].fileList[j].url) {
											if (j + 1 < num_str_img || isNew) {
												imgSrc +=
													'/' +
													item.checkSituation[i].fileList[j].url.split(
														'///'
													)[1] +
													',';
											} else {
												imgSrc +=
													'/' +
													item.checkSituation[i].fileList[j].url.split(
														'///'
													)[1];
											}
										} else {
											if (!foo) {
												imgSrc += await this.subImg(item.checkSituation[i]);
												foo = true;
											}
										}
									}

									arr.push(imgSrc);
								}

								item.fileSrc = arr.join('@');

								// 检查情况
								let arr_sit = [];
								item.checkSituation.map(item_sit => {
									arr_sit.push(item_sit.content);
								});

								item.checkCaseConts = arr_sit.join('@');

								this.submitList.push(item);

								this.submitList.forEach((i, index) => {
									mainList.forEach(j => {
										if (j.id === i.id) {
											flag++;
										}
									});
								});

								if (flag === mainList.length) {
									this.mainList[this.activeKey - 1].colorName = 'colorComplate';
								}

								if (this.mainList[this.activeKey].stylecontList.length === 0) {
									for (var i = this.activeKey; i < this.mainList.length; i++) {
										if (
											this.mainList[this.activeKey].stylecontList.length > 0
										) {
											break;
										} else {
											this.activeKey++;
										}
									}
								}

								// this.$nextTick(() => {
								// 	this.activeName_item = this.mainList[this.activeKey].stylecontList[0].id;
								// });
								this.activeName_item = '';

								this.mainList.map(i => {
									i.stylecontList.map(j => {
										j.pointEvents = '';
									});
								});

								// 本地缓存
								this.storageItem();

								this.getTotalItem();
							} else {
								// 检查图片
								let arr = [];

								for (var i = 0; i < item.checkSituation.length; i++) {
									let imgSrc = '';
									let foo = false;
									let num_str_img = 0;
									let isNew;

									item.checkSituation[i].fileList.map(item_num => {
										if (item_num.url) {
											num_str_img++;
										} else {
											isNew = true;
										}
									});

									for (
										var j = 0;
										j < item.checkSituation[i].fileList.length;
										j++
									) {
										if (item.checkSituation[i].fileList[j].url) {
											if (j + 1 < num_str_img || isNew) {
												imgSrc +=
													'/' +
													item.checkSituation[i].fileList[j].url.split(
														'///'
													)[1] +
													',';
											} else {
												imgSrc +=
													'/' +
													item.checkSituation[i].fileList[j].url.split(
														'///'
													)[1];
											}
										} else {
											if (!foo) {
												imgSrc += await this.subImg(item.checkSituation[i]);
												foo = true;
											}
										}
									}

									arr.push(imgSrc);
								}

								item.fileSrc = arr.join('@');

								// 检查情况
								let arr_sit = [];
								item.checkSituation.map(item_sit => {
									arr_sit.push(item_sit.content);
								});

								item.checkCaseConts = arr_sit.join('@');

								this.submitList.push(item);

								this.submitList.forEach((i, index) => {
									mainList.forEach(j => {
										if (j.id === i.id) {
											flag++;
										}
									});
								});

								if (flag === mainList.length) {
									this.mainList[this.activeKey - 1].colorName = 'colorComplate';
								}
								if (this.mainList[this.activeKey].stylecontList.length === 0) {
									for (var i = this.activeKey; i < this.mainList.length; i++) {
										if (
											this.mainList[this.activeKey].stylecontList.length > 0
										) {
											break;
										} else {
											this.activeKey++;
										}
									}
								}
								this.getTotalItem();
								// this.$nextTick(() => {
								// 	this.activeName_item = this.mainList[this.activeKey].stylecontList[0].id;
								// 	this.activeName_item = '';
								// });
								this.activeName_item = '';

								this.mainList.map(i => {
									i.stylecontList.map(j => {
										j.pointEvents = '';
									});
								});

								// 本地缓存
								this.storageItem();
							}
						} else {
							if (this.isOnSearch) {
								this.mainList = this.storageList;

								this.handleEnabled = true;
								item.isStartBtnClick = '0';
								this.collapseDisabled = false;
								this.activeKey++;

								let flag = 0;

								if (this.submitList.length > 0) {
									this.submitList.forEach((i, index) => {
										if (i.id === item.id) {
											this.submitList.splice(index, 1);
										}
									});

									// 检查图片
									let arr = [];

									for (var i = 0; i < item.checkSituation.length; i++) {
										let imgSrc = '';
										let foo = false;
										let num_str_img = 0;
										let isNew;

										item.checkSituation[i].fileList.map(item_num => {
											if (item_num.url) {
												num_str_img++;
											} else {
												isNew = true;
											}
										});

										for (
											var j = 0;
											j < item.checkSituation[i].fileList.length;
											j++
										) {
											if (item.checkSituation[i].fileList[j].url) {
												if (j + 1 < num_str_img || isNew) {
													imgSrc +=
														'/' +
														item.checkSituation[i].fileList[
															j
														].url.split('///')[1] +
														',';
												} else {
													imgSrc +=
														'/' +
														item.checkSituation[i].fileList[
															j
														].url.split('///')[1];
												}
											} else {
												if (!foo) {
													imgSrc += await this.subImg(
														item.checkSituation[i]
													);
													foo = true;
												}
											}
										}

										arr.push(imgSrc);
									}

									item.fileSrc = arr.join('@');

									// 检查情况
									let arr_sit = [];
									item.checkSituation.map(item_sit => {
										arr_sit.push(item_sit.content);
									});

									item.checkCaseConts = arr_sit.join('@');

									this.submitList.push(item);

									this.submitList.forEach((i, index) => {
										mainList.forEach(j => {
											if (j.id === i.id) {
												flag++;
											}
										});
									});

									if (flag === mainList.length) {
										this.mainList[this.activeKey - 1].colorName =
											'colorComplate';
									}

									if (this.mainList[this.activeKey].stylecontList.length === 0) {
										for (
											var i = this.activeKey;
											i < this.mainList.length;
											i++
										) {
											if (
												this.mainList[this.activeKey].stylecontList.length >
												0
											) {
												break;
											} else {
												this.activeKey++;
											}
										}
									}

									// this.$nextTick(() => {
									// 	this.activeName_item = this.mainList[this.activeKey].stylecontList[0].id;
									// 	this.activeName_item = '';
									// });
									this.activeName_item = '';

									this.mainList.map(i => {
										i.stylecontList.map(j => {
											j.pointEvents = '';
										});
									});

									this.getTotalItem();

									// 本地缓存
									this.storageItem();
								} else {
									// 检查图片
									let arr = [];

									for (var i = 0; i < item.checkSituation.length; i++) {
										let imgSrc = '';
										let foo = false;
										let num_str_img = 0;
										let isNew;

										item.checkSituation[i].fileList.map(item_num => {
											if (item_num.url) {
												num_str_img++;
											} else {
												isNew = true;
											}
										});

										for (
											var j = 0;
											j < item.checkSituation[i].fileList.length;
											j++
										) {
											if (item.checkSituation[i].fileList[j].url) {
												if (j + 1 < num_str_img || isNew) {
													imgSrc +=
														'/' +
														item.checkSituation[i].fileList[
															j
														].url.split('///')[1] +
														',';
												} else {
													imgSrc +=
														'/' +
														item.checkSituation[i].fileList[
															j
														].url.split('///')[1];
												}
											} else {
												if (!foo) {
													imgSrc += await this.subImg(
														item.checkSituation[i]
													);
													foo = true;
												}
											}
										}

										arr.push(imgSrc);
									}

									item.fileSrc = arr.join('@');

									// 检查情况
									let arr_sit = [];
									item.checkSituation.map(item_sit => {
										arr_sit.push(item_sit.content);
									});

									item.checkCaseConts = arr_sit.join('@');

									this.submitList.push(item);

									this.submitList.forEach((i, index) => {
										mainList.forEach(j => {
											if (j.id === i.id) {
												flag++;
											}
										});
									});

									if (flag === mainList.length) {
										this.mainList[this.activeKey - 1].colorName =
											'colorComplate';
									}
									if (this.mainList[this.activeKey].stylecontList.length === 0) {
										for (
											var i = this.activeKey;
											i < this.mainList.length;
											i++
										) {
											if (
												this.mainList[this.activeKey].stylecontList.length >
												0
											) {
												break;
											} else {
												this.activeKey++;
											}
										}
									}
									this.getTotalItem();

									// this.$nextTick(() => {
									// 	this.activeName_item = this.mainList[this.activeKey].stylecontList[0].id;
									// 	this.activeName_item = '';
									// });

									this.activeName_item = '';

									this.mainList.map(i => {
										i.stylecontList.map(j => {
											j.pointEvents = '';
										});
									});

									// 本地缓存
									this.storageItem();
								}
							}
						}
					} else {
						this.handleEnabled = true;
						this.collapseDisabled = false;
						item.isStartBtnClick = '0';

						// this.activeName_item = mainList[item.contSort].id;
						this.activeName_item = '';

						this.mainList.map(i => {
							i.stylecontList.map(j => {
								j.pointEvents = '';
							});
						});

						var flag = 0;
						if (this.submitList.length > 0) {
							this.submitList.forEach((i, index) => {
								if (i.id === item.id) {
									this.submitList.splice(index, 1);
								}
							});

							// 检查图片
							let arr = [];

							for (var i = 0; i < item.checkSituation.length; i++) {
								let imgSrc = '';
								let foo = false;
								let num_str_img = 0;
								let isNew;

								item.checkSituation[i].fileList.map(item_num => {
									if (item_num.url) {
										num_str_img++;
									} else {
										isNew = true;
									}
								});

								for (var j = 0; j < item.checkSituation[i].fileList.length; j++) {
									if (item.checkSituation[i].fileList[j].url) {
										if (j + 1 < num_str_img || isNew) {
											imgSrc +=
												'/' +
												item.checkSituation[i].fileList[j].url.split(
													'///'
												)[1] +
												',';
										} else {
											imgSrc +=
												'/' +
												item.checkSituation[i].fileList[j].url.split(
													'///'
												)[1];
										}
									} else {
										if (!foo) {
											imgSrc += await this.subImg(item.checkSituation[i]);
											foo = true;
										}
									}
								}

								arr.push(imgSrc);
							}

							item.fileSrc = arr.join('@');

							// 检查情况
							let arr_sit = [];
							item.checkSituation.map(item_sit => {
								arr_sit.push(item_sit.content);
							});

							item.checkCaseConts = arr_sit.join('@');

							this.submitList.push(item);

							this.submitList.forEach((i, index) => {
								mainList.forEach(j => {
									if (j.id === i.id) {
										flag++;
									}
								});
							});

							if (flag === mainList.length) {
								this.mainList[this.activeKey].colorName = 'colorComplate';
							}

							this.getTotalItem();

							// 本地缓存
							this.storageItem();
						} else {
							// 检查图片
							let arr = [];

							for (var i = 0; i < item.checkSituation.length; i++) {
								let imgSrc = '';
								let foo = false;
								let num_str_img = 0;
								let isNew;

								item.checkSituation[i].fileList.map(item_num => {
									if (item_num.url) {
										num_str_img++;
									} else {
										isNew = true;
									}
								});

								for (var j = 0; j < item.checkSituation[i].fileList.length; j++) {
									if (item.checkSituation[i].fileList[j].url) {
										if (j + 1 < num_str_img || isNew) {
											imgSrc +=
												'/' +
												item.checkSituation[i].fileList[j].url.split(
													'///'
												)[1] +
												',';
										} else {
											imgSrc +=
												'/' +
												item.checkSituation[i].fileList[j].url.split(
													'///'
												)[1];
										}
									} else {
										if (!foo) {
											imgSrc += await this.subImg(item.checkSituation[i]);
											foo = true;
										}
									}
								}

								arr.push(imgSrc);
							}

							item.fileSrc = arr.join('@');

							// 检查情况
							let arr_sit = [];
							item.checkSituation.map(item_sit => {
								arr_sit.push(item_sit.content);
							});

							item.checkCaseConts = arr_sit.join('@');

							this.submitList.push(item);
							this.getTotalItem();

							// 本地缓存
							this.storageItem();
						}
					}

					// 存储图片
				} else {
					this.$toast.fail('当前检查项不能有空');
				}
			} else {
				if (item.isStartBtnClick == '0') {
					this.$toast.fail('还没有开始检查');
				} else {
					this.$toast.fail('暂停检查中');
				}
			}
		},

		afterRead(file) {
			console.warn(file, 'file23333');

			if (file.file.size > 3000000) {
				// 创建Canvas对象(画布)
				let canvas = document.createElement('canvas');
				// 获取对应的CanvasRenderingContext2D对象(画笔)
				let context = canvas.getContext('2d');
				// 创建新的图片对象
				let img = new Image();
				// 指定图片的DataURL(图片的base64编码数据)
				img.src = file.content;

				img.onload = () => {
					// 监听浏览器加载图片完成，然后进行进行绘制

					// 指定canvas画布大小，该大小为最后生成图片的大小
					canvas.width = img.width;
					canvas.height = img.height;
					/* drawImage画布绘制的方法。(0,0)表示以Canvas画布左上角为起点，400，300是将图片按给定的像素进行缩小。
					        如果不指定缩小的像素图片将以图片原始大小进行绘制，图片像素如果大于画布将会从左上角开始按画布大小部分绘制图片，最后的图片就是张局部图。*/
					context.drawImage(img, 0, 0, img.width, img.height);
					// 将绘制完成的图片重新转化为base64编码，file.file.type为图片类型，0.92为默认压缩质量
					let base_img = canvas.toDataURL(file.file.type, 0.75);
					const blodBin = atob(base_img.split(',')[1]);
					let data = [];
					for (let i = 0; i < blodBin.length; i++) {
						data.push(blodBin.charCodeAt(i));
					}
					let blob1 = new Blob([new Uint8Array(data)], { type: 'image/png' });
					let file1 = new File([blob1], new Date().getTime() + '.png');

					console.warn(file1);

					file.file = file1;
				};
			}
		},

		// 上传图片
		async subImg(item) {
			this.showOverLay = true;
			var formData = new FormData();

			console.warn(item, 'file>>>>>>');

			item.fileList.map((i, index) => {
				formData.append('file', i.file);
			});

			let res = await postImg('/upload/moreUploadImg', formData);

			this.showOverLay = false;

			if (res.success === true) {
				return res.data;
			} else {
				this.$toast.fail(`${res.msg}`);
			}
		},

		getImgUrl(item, index) {
			return imgBaseUrl + item;
		},

		showImageDetails(item, index) {
			ImagePreview([imgBaseUrl + item]);
		},

		// 检查合格
		clickRadio(mainList, item) {
			if (item.finishAll && this.uncheckNum > 1) {
				this.$toast.fail('本项为最后提交项，请先完成其他项');
				item.checkResult = '';
				return;
			} else if (item.finishAll && this.uncheckNum == 1) {
				// if (item.extraExamineContent) {
				// 	item.extraExamineContent.map(i => {
				// 		item.checkSite.push('不涉及');
				// 	});
				// }

				this.$dialog
					.confirm({
						title: '检查完成',
						message: `已根据检查流程检查完成消防监督检查，此次共检查完成${this
							.complateNum + 1}项`
					})
					.then(() => {
						this.submitCheck(item);
					})
					.catch(() => {
						item.checkResult = '';
						item.isStartBtnClick = '0';
						this.handleEnabled = true;
					});
			} else {
				this.mainList.map(i => {
					i.stylecontList.map(j => {
						j.pointEvents = '';
					});
				});

				console.log(item);

				// if (item.extraExamineContent) {
				// 	item.checkSite = [];
				// 	item.extraExamineContent.split(',').map(i => {
				// 		item.checkSite.push('不涉及');
				// 	});
				// }

				this.handleEnabled = true;
				item.isStartBtnClick = '1';
				item.isStop = false;
				this.collapseDisabled = false;
				item.answerOption = '';
				item.checkCaseConts = '';
				item.checkSituation = [
					{
						content: '',
						fileList: []
					}
				];
				item.checkSiteStr = '';
				item.fileSrc = '';

				if (item.examineOptions) {
					item.answerOption = item.examineOptions.split(',')[0];
				}

				this.mainList[this.activeKey].colorName = 'colorNow';

				let flag = 0;

				if (this.submitList.length > 0) {
					this.submitList.forEach((i, index) => {
						if (i.id === item.id) {
							this.submitList.splice(index, 1);
						}
					});

					this.submitList.push(item);

					this.submitList.forEach((i, index) => {
						mainList.forEach(j => {
							if (j.id === i.id) {
								flag++;
							}
						});
					});

					if (flag === mainList.length) {
						this.mainList[this.activeKey].colorName = 'colorComplate';
					}

					this.getTotalItem();

					// 本地缓存
					this.storageItem();
				} else {
					this.submitList.push(item);

					this.submitList.forEach((i, index) => {
						mainList.forEach(j => {
							if (j.id === i.id) {
								flag++;
							}
						});
					});

					if (flag === mainList.length) {
						this.mainList[this.activeKey].colorName = 'colorComplate';
					}

					this.getTotalItem();

					// 本地缓存
					this.storageItem();
				}
			}

			this.activeName_item = [];
		},

		openCollapse(item) {},

		// 提交检查
		async submitCheck(item) {
			if (this.uncheckNum > 1) {
				this.$toast.fail('还有未完成检查');
				return;
			}

			if (item.checkResult == '2') {
				// 开始了检查进行下一项必须全部内容填好

				let extraExamineTitle = false;
				let answerOption = false;
				let imgCorrect = true;

				if (item.extraExamineTitle === null) {
					extraExamineTitle = true;
				} else {
					if (item.checkSite) {
						extraExamineTitle = true;
					} else {
						extraExamineTitle = false;
					}
				}

				if (item.answerOption === null) {
					answerOption = true;
				} else {
					if (item.answerOption) {
						answerOption = true;
					} else {
						answerOption = false;
					}
				}

				item.checkSituation.map(i => {
					if (i.fileList.length == 0) {
						imgCorrect = false;
					}
				});

				if (answerOption && imgCorrect) {
					// 所有项填完

					this.$dialog.confirm({
						title: '提交检查',
						message: `已根据检查流程检查完成消防监督检查，此次共检查完成${this
							.complateNum + 1}项`,
						beforeClose
					});

					let that = this;

					async function beforeClose(action, done) {
						if (action == 'confirm') {
							// 检查图片
							let arr = [];

							for (var i = 0; i < item.checkSituation.length; i++) {
								let imgSrc = '';
								let foo = false;
								let num_str_img = 0;
								let isNew;

								item.checkSituation[i].fileList.map(item_num => {
									if (item_num.url) {
										num_str_img++;
									} else {
										isNew = true;
									}
								});

								for (var j = 0; j < item.checkSituation[i].fileList.length; j++) {
									if (item.checkSituation[i].fileList[j].url) {
										if (j + 1 < num_str_img || isNew) {
											imgSrc +=
												'/' +
												item.checkSituation[i].fileList[j].url.split(
													'///'
												)[1] +
												',';
										} else {
											imgSrc +=
												'/' +
												item.checkSituation[i].fileList[j].url.split(
													'///'
												)[1];
										}
									} else {
										if (!foo) {
											imgSrc += await that.subImg(item.checkSituation[i]);
											foo = true;
										}
									}
								}

								arr.push(imgSrc);
							}

							item.fileSrc = arr.join('@');

							// 检查情况
							let arr_sit = [];
							item.checkSituation.map(item_sit => {
								arr_sit.push(item_sit.content);
							});

							item.checkCaseConts = arr_sit.join('@');

							that.submitList.push(item);

							that.getTotalItem();

							that.mainList[that.activeKey].colorName = 'colorComplate';

							let submitData = [];

							that.submitList.forEach(i => {
								let checkSiteStr = i.checkSite.join(',');

								submitData.push({
									answerOption: i.answerOption ? i.answerOption : '',
									checkCaseConts: i.checkCaseConts,
									checkResult: i.checkResult,
									checkSite: checkSiteStr,
									checkCaseImgs: i.fileSrc,
									styleContId: i.id,
									taskId: i.taskId
								});
							});

							that.tipMsg = '数据提交中';
							that.showOverLay = true;

							post('/cdsupervisionAnswer/addBatch', submitData).then(res => {
								that.showOverLay = false;
								if (res.success == true) {
									localStorage.removeItem('SUBLIST');
									localStorage.removeItem('TASKID');

									that.$router.push(
										`/checkRecord/${that.$route.params.ID}/${
											that.$route.params.currentID
										}`
									);
								} else {
									that.$toast.fail(`${res.msg}`);
								}
							});

							done();
						} else {
							done();
						}
					}
				} else {
					this.$toast.fail('当前检查项不能有空');
					return;
				}
			} else {
				if (item.examineOptions) {
					item.answerOption = item.examineOptions.split(',')[0];
				}

				this.submitList.push(item);

				let submitData = [];

				this.submitList.forEach(i => {
					let checkSiteStr = i.checkSite.join(',');

					submitData.push({
						answerOption: i.answerOption ? i.answerOption : '',
						checkCaseConts: i.checkCaseConts,
						checkResult: i.checkResult,
						checkSite: checkSiteStr,
						checkCaseImgs: i.fileSrc,
						styleContId: i.id,
						taskId: i.taskId
					});
				});

				this.tipMsg = '数据提交中';
				this.showOverLay = true;

				post('/cdsupervisionAnswer/addBatch', submitData).then(res => {
					this.showOverLay = false;
					if (res.success == true) {
						localStorage.removeItem('SUBLIST');
						localStorage.removeItem('TASKID');

						this.$router.push(
							`/checkRecord/${this.$route.params.ID}/${this.$route.params.currentID}`
						);
					} else {
						this.$toast.fail(`${res.msg}`);
					}
				});
			}
		}
	},

	//  keep-alive
	beforeRouteEnter: (to, from, next) => {
		to.meta.keepAlive = true;

		if (from.name === 'dailyDetails') {
			next(vm => {
				vm.reload(); // 调用app.vue的方法
			});
		} else {
			next();
		}
	}
};
</script>

<style lang="scss" scoped>
.checkProcess {
	font-size: 14px;

	.colorComplate {
		color: #02a7f0;
	}

	.colorNow {
		color: #03a012;
	}

	.colorNor {
		color: #a5a5a5;
	}

	.width100 {
		width: 230px;
	}

	.titleContent {
	}

	.mt5 {
		margin-top: 5px;
	}

	.search {
		margin-top: 57px;
	}

	.totalPro {
		color: #7f7f7f;
		font-size: 12px;
		display: flex;
		justify-content: space-between;
		padding: 10px 15px;
	}

	.proList {
		background-color: #fff;
		display: flex;
		justify-content: space-between;
		min-height: calc(100vh - 155px);

		.proItem {
			flex: 1;
			width: 1px;

			.itemContent {
				height: 42px;
				overflow: hidden;
				margin: 0 15px;
				border-bottom: 1px solid #ddd;
				padding-bottom: 5px;
			}

			.checkRes {
				margin: 5px 0;
				margin-top: 20px;
				display: flex;
				justify-content: space-between;
				align-items: flex-start;
				width: 107%;
			}

			.btn {
				margin-top: 10px;
				display: flex;
				justify-content: space-between;

				button {
					font-size: 12px;
					width: 110px;
				}
			}

			.checkExplain {
				font-size: 11px;
				border-radius: 5px;
				margin-top: 20px;
				padding: 10px 15px;
				border: 1px solid #dfdfdf;
				border-bottom: 1px solid #c2c2c2;
				padding-top: 5px;

				.explainContent {
					color: #a3a3a3;
					font-size: 10px;
					line-height: 15px;
					letter-spacing: 2px;
					overflow: hidden;
					text-overflow: ellipsis;
					display: -webkit-box;
					-webkit-line-clamp: 3; //行数
					-webkit-box-orient: vertical;
				}
			}

			.standExplain {
				font-size: 11px;
				padding: 10px 15px;
				border: 1px solid #dfdfdf;
				border-bottom: 1px solid #c2c2c2;
				border-radius: 5px;
				margin-top: 10px;
				padding-top: 5px;

				.explainContent {
					color: #a3a3a3;
					font-size: 10px;
					line-height: 15px;
					letter-spacing: 2px;
					overflow: hidden;
					text-overflow: ellipsis;
					display: -webkit-box;
					-webkit-line-clamp: 3; //行数
					-webkit-box-orient: vertical;
				}
			}

			.carItem {
				display: flex;
				justify-content: space-between;
				align-items: center;
				margin: 15px 0;
			}

			.addCheckBtn {
				display: flex;
				justify-content: center;
				align-items: center;
				margin: 15px 0;
				margin-top: 40px;

				button {
					width: 100%;
				}
			}
		}

		.carItem_issue {
			width: 100px;
			display: flex;
		}
	}

	.rightPadding {
	}
}
</style>

<style lang="scss">
.checkProcess {
	p {
		margin: 2px 0 !important;
		word-wrap: break-word;
	}

	.checkExplain_top {
		border: 1px solid #eaeaea;
		border-bottom: 1px solid #cfcfcf;
		padding: 10px;
		box-sizing: border-box;
		// border-radius: 5px;
		margin-top: 10px;

		p {
			width: 220px;
		}
	}

	.stopClick {
		pointer-events: none;
	}

	.carItem {
		.van-cell.van-field {
			margin-left: 10px;
			width: 120px;
		}

		.van-field__body {
			input {
				padding: 0px 10px;
				background-color: #f2f2f2;
			}
		}
	}

	.van-sidebar-item.van-sidebar-item--select {
		&::before {
			height: 100%;
			background-color: #0066ff;
		}
	}

	.van-sidebar-item {
		background-color: #f5f5f5;
		margin-bottom: 1px;
		padding: 8px 10px;
		// overflow: hidden;
		// white-space: nowrap;
		// text-overflow: ellipsis;
		font-size: 12px;
		width: 90px;
		text-align: center;
	}

	.van-sidebar-item.van-sidebar-item--select {
		background-color: #fff;
	}

	.van-sidebar {
		width: 100px;
	}

	.van-cell__title {
		font-size: 13px;
	}

	.van-collapse-item__wrapper {
		width: 95%;
		border: 1px solid #f7f7f7;
		// margin: 8px 15px;
		box-shadow: 0 5px 5px rgba($color: #6a6a6a, $alpha: 0.2);
		// border-radius: 5px;
		margin-bottom: 10px;
	}

	.van-collapse-item__content {
		padding: 10px 10px;
	}

	.checkExplain,
	.standExplain {
		.van-cell.van-cell--clickable {
			padding: 3px 0;
			font-size: 12px;
			color: #7f7f7f;
		}

		.van-cell__value {
			font-size: 12px;
			color: #02a7f0;
		}

		.van-icon.van-icon-arrow.van-cell__right-icon {
			color: #02a7f0;
			font-size: 12px;
		}
	}

	.proItem {
		.van-field {
			width: 60%;
		}

		.van-cell.van-field {
			padding: 0;
		}

		.van-field__control {
		}

		.van-cell__title.van-field__label {
			width: auto;
			font-size: 12px;
		}
	}

	.van-button.van-button--default.van-button--normal {
		background-color: #9a9a9a;
		color: #fff;
		height: 36px;
	}

	.van-button.van-button--info.van-button--normal {
		height: 36px;
	}

	.van-cell.van-cell--clickable.van-collapse-item__title.van-collapse-item__title--expanded {
		&::after {
			border: none;
		}
	}

	.stopBtn.van-button.van-button--default.van-button--normal {
		background-color: #cc8800;
	}

	.van-cell__value {
		text-align: left;
	}

	.van-radio.van-radio--disabled.van-radio--horizontal {
		&:last-child {
			margin-right: 0;
		}
	}

	.van-radio.van-radio--horizontal {
		&:last-child {
			margin-right: 0;
		}
	}

	.textArea.van-field {
		background-color: #f4f4f4;
		width: 100%;

		.van-field__control {
			padding: 5px 10px;
		}
	}

	.van-icon.van-icon-photograph.van-uploader__upload-icon {
		color: #b6b6b6;
	}

	.van-uploader__upload {
		border: 1px solid #e2e2e3;
		width: 65px;
		height: 65px;
		margin: 0;
	}

	.van-uploader__preview {
		margin: 0;
	}

	.van-image.van-uploader__preview-image {
		width: 65px;
		height: 65px;
	}

	.checkExplain,
	.standExplain {
		.van-cell__value {
			text-align: right;
		}
	}

	.van-sidebar-item {
		display: flex;
		align-items: center;
	}

	.van-sidebar-item__text {
		width: 100%;
		text-align: left;
		// overflow: hidden;
		// white-space: nowrap;
		// text-overflow: ellipsis;
	}

	// .van-sidebar-item.van-sidebar-item--select {
	// 	.van-sidebar-item__text {
	// 		overflow: auto;
	// 		white-space: normal;
	// 		text-overflow: inherit;
	// 	}
	// }

	.van-collapse-item {
		border-bottom: 1px solid #dedede;
		margin-bottom: 10px;
	}

	.van-collapse-item__title {
		padding-left: 5px;
	}

	.van-collapse-item--border::after {
		border-top: none;
	}

	.van-hairline--top-bottom::after {
		border: none;
	}

	.imgItem {
		display: flex;
		justify-content: space-between;

		.van-image {
			width: 110px;
			height: 100px;
			margin-bottom: 20px;
		}

		.van-uploader {
			width: 100%;
		}

		.van-uploader__wrapper {
			width: 100%;
			display: flex;
			justify-content: space-between;
		}

		.van-uploader__preview {
			margin: 0;
			width: 110px;
			height: 100px;
			// margin-right: 20px;
			margin-bottom: 20px;

			.van-image {
				height: 100%;
				width: 100%;
			}
		}
	}

	.van-uploader__upload {
		width: 110px;
		height: 100px;
	}

	.checkExplain_top {
		background-color: transparent;
		// margin-top: 10px;
		width: 105.4%;
		font-size: 11px;

		.explainContent {
			color: #a3a3a3;
			font-size: 10px;
			line-height: 15px;
			letter-spacing: 2px;

			.van-swipe-item {
				height: 140px;
			}

			.swiperContainer {
				width: 220px;
				height: 140px;
				margin: 0 auto;

				.swiper_content {
					padding-top: 5px;
					width: 100%;
					height: 100%;
					display: flex;
					flex-direction: row;
					justify-content: space-between;
					align-items: center;

					.swiper_content_item {
						flex: 1;
					}

					.swiper_img {
						display: flex;
						align-items: center;
						justify-content: center;
						padding: 5px;

						img {
							height: 75px;
							max-width: 140px;
						}
					}

					.swiper_title {
						margin-top: 10px;
						height: 30px;
						text-align: center;
						color: #323232;
						font-size: 10px;
						line-height: 15px;
						letter-spacing: 2px;
						overflow: hidden;
						text-overflow: ellipsis;
						display: -webkit-box;
						-webkit-line-clamp: 2; //行数
						-webkit-box-orient: vertical;
					}
				}
			}
		}

		.van-cell.van-cell--clickable {
			padding: 3px 0;
			font-size: 12px;
			color: #7f7f7f;
		}

		.van-cell__title {
			color: #888;
		}

		.van-cell {
			background-color: transparent;

			.van-cell__value {
				span {
					&:last-child {
						text-decoration: underline;
					}
				}
			}
		}

		.van-cell__value {
			font-size: 12px;
			color: #02a7f0;
			text-align: right;
		}

		.van-icon.van-icon-arrow.van-cell__right-icon {
			color: #02a7f0;
			font-size: 12px;
		}

		.van-cell__right-icon {
			&::before {
				transform: rotate(0deg);
			}
		}
	}

	.funExplain {
		.van-cell {
			padding: 0;
		}
	}

	.checkRes {
		.van-radio-group.van-radio-group--horizontal {
			padding-right: 5px;
		}
	}

	.van-icon.van-icon-arrow.van-cell__right-icon {
		transform: rotate(90deg);
		padding-top: 5px;
	}

	.van-collapse-item__title--expanded .van-cell__right-icon::before {
		transform: rotate(0);
	}

	.funExplain {
		.van-icon.van-icon-arrow.van-cell__right-icon {
			transform: rotate(0deg);
			padding-top: 0px;
		}
	}
}

.van-dialog {
	border-radius: 0;
}

.van-dialog__header {
	background-color: #f0f0f0;
	padding: 10px 0;
	border-bottom: 1px solid #c9cacc;
	color: #323233;
	margin-bottom: 20px;
}

.van-dialog__message.van-dialog__message--has-title {
	color: #bf0309;
	font-weight: bold;
}
</style>
