<template>
	<view class="todo-page">
		<step-title :stepPage="stepsPage" :stepText="stepsText"></step-title>
		<view class="allview">
			<view class="card" v-if="stepsPageList === 0">
				<u--form labelWidth="auto" :model="model" ref="wForm" class="demo-ruleForm">
					<view style="position: relative;">
						<view style="position: absolute;left: -10px;color: #3d4b70;top: -3px;">*</view>
					</view>

					<view style="font-size: 15px; font-weight: bold;color: #3d4b70;margin-bottom: 10px;">基本信息填写</view>
					<u-form-item v-if="model.HIDDEN_DANGER_CONFIRM_ID!=null || model.HIDDEN_DANGER_REPORT_ID!=null" label="检查区域:" @click="handleChangeStep('CheckArea')">
						<u--input v-model="(model.Nav_RiskArea||{}).NAME" placeholder="请选择检查区域" disabled disabledColor="#ffffff" inputAlign="right" fontSize="14px" border="none">
						</u--input>
						<u-icon style="margin-left: 4px;" slot="right" name="arrow-down" size="12">
						</u-icon>
					</u-form-item>
					<u-form-item v-if="model.HIDDEN_DANGER_CONFIRM_ID!=null || model.HIDDEN_DANGER_REPORT_ID!=null" label="检查内容:" @click="handleChangeStep('CheckContent')">
						<u--input v-model="(model.Nav_Contents||{}).CHECKCONTENT" placeholder="请选择检查内容" disabled disabledColor="#ffffff" inputAlign="right" fontSize="14px" border="none">
						</u--input>
						<u-icon style="margin-left: 4px;" slot="right" name="arrow-down" size="12">
						</u-icon>
					</u-form-item>
					<u-form-item v-if="model.HIDDEN_DANGER_CONFIRM_ID!=null || model.HIDDEN_DANGER_REPORT_ID!=null" label="隐患描述:" @click="handleChangeStep('RiskDes')">
						<u--input v-model="(model.Nav_Question||{}).DESCREPTION" placeholder="请选择隐患描述" disabled disabledColor="#ffffff" inputAlign="right" fontSize="14px" border="none">
						</u--input>
						<u-icon style="margin-left: 4px;" slot="right" name="arrow-down" size="12">
						</u-icon>
					</u-form-item>
					<u-form-item v-if="model.HIDDEN_DANGER_CONFIRM_ID!=null || model.HIDDEN_DANGER_REPORT_ID!=null" label="隐患等级:" @click="handleChangeUnit('SKHiddenLevel')">
						<u--input v-model="model.HIDDEN_LEVELName" placeholder="请选择隐患等级" disabled disabledColor="#ffffff" inputAlign="right" fontSize="14px" border="none">
						</u--input>
					</u-form-item>
					<u-form-item v-if="model.HIDDEN_DANGER_CONFIRM_ID!=null || model.HIDDEN_DANGER_REPORT_ID!=null" label="整改措施:">
					</u-form-item>
					<u--textarea v-if="model.HIDDEN_DANGER_CONFIRM_ID!=null || model.HIDDEN_DANGER_REPORT_ID!=null" v-model="model.RECTIFICATION_MEASURES" disabled autoHeight></u--textarea>
					<view class="upload-title">附件：</view>
					<full-upload v-model="model.Nav_DoubleFiles" :isShowBtn='true' :listProp='listPropUpload' :listPropVal='listPropValUpload'></full-upload>

				</u--form>
			</view>
			<view style="padding: 10px 16px;" v-if="stepsPageList === 0" class="bottom-button">
				<u-button type="primary" :loading="stepLoad" @click="stepAdd" color="#3d4b70">下一步</u-button>
			</view>
			<view class="card" v-if="stepsPageList === 1">
				<u--form labelWidth="auto" :model="model" ref="wForm" class="sub-form">


					<view style="position: relative;">

						<view style="position: absolute;left: -10px;color: #3d4b70;top: -3px;">*</view>
					</view>

					<view style="font-size: 15px; font-weight: bold;color: #3d4b70;margin-bottom: 10px;margin-top: 20px;">辨识内容</view>
					<view v-for="(item,index) in model.Nav_DoubleDetails" :key="index" style="border-bottom: #ceccca 1px solid;margin-bottom: 10px;padding-bottom: 10px;">
						<u-form-item prop="Nav_Contents" :label="index+1+'.辨识区域：'" @click="handleChangeStep('Area',[index])">

							<view style="display: flex;flex-direction: row;justify-content: space-between;align-items: center;flex: 1;">
								<!-- <view @click="handleChangeStep(index,'','Area')" style="flex: 1;">
									{{index+1+'.辨识区域：'+item.Nav_Area.NAME}}
								</view> -->
								<u--input v-model="item.Nav_Area.NAME" disabled disabledColor="#ffffff" placeholder="请选择辨识区域" border="none" fontSize="14px">
								</u--input>
								<view class="action" @click.stop style="display: flex;flex-direction: row;align-items: center;justify-content: space-around;">
									<u-icon @click="handleDelRowBefore('Area',[index])" name="trash" color="#ff4d4f" size="21" style="margin-right: 20px;"></u-icon>
									<u-icon name="arrow-up" size="12" v-if="item.showPack" @click="handlePack(index)"></u-icon>
									<u-icon name="arrow-down" size="12" v-if="!item.showPack" @click="handlePack(index)"></u-icon>
								</view>
							</view>

						</u-form-item>
						<view v-if="item.showPack==true">
							<u-form-item label="生产单元：" @click="handleChangeUnit('SKProductionUnit',item)" border-bottom>
								<u--input v-model="(item.Nav_ProductionUnit||{}).NAME" disabled disabledColor="#ffffff" placeholder="请选择生产单元" border="none" inputAlign="right" fontSize="14px">
								</u--input>
								<u-icon style="margin-left: 4px;" slot="right" name="arrow-down" size="12">
								</u-icon>
							</u-form-item>
							<!-- <u-form-item label="风险名称" prop="CHECKSTANDARD" border-bottom>
								<u--input v-model="item.Nav_RiskName.NAME" placeholder="请填写风险名称" disabledColor="#ffffff" inputAlign="right" fontSize="14px" border="none">
								</u--input>
							</u-form-item> -->
							<u-form-item label="风险名称" prop="CHECKSTANDARD" @click="handleChangeStep('RiskName',[index])" border-bottom>
								<u--input v-model="item.RISK_NAME" placeholder="请填写风险名称" suffixIcon="arrow-down" suffixIconStyle="font-size: 12px" disabledColor="#ffffff" inputAlign="right" fontSize="14px" border="none">
								</u--input>
							</u-form-item>
							<u-form-item label="风险描述" prop="HIDDEN_DESCRIPTION">
							</u-form-item>
							<u--textarea v-model="item.RISK_DESCRIPTION" placeholder="请填写风险描述" autoHeight maxlength="-1"></u--textarea>
							<u-form-item label="风险类别" prop="HIDDEN_LEVEL" @click="handleChangeStep('Category',[index])" border-bottom>
								<u--input v-model="item.Nav_Type.NAME" placeholder="请选择风险类别" disabled suffixIcon="arrow-down" suffixIconStyle="font-size: 12px" disabledColor="#ffffff" inputAlign="right" fontSize="14px"
									border="none">
								</u--input>
							</u-form-item>
							<u-form-item label="风险评价L" border-bottom @click="handleShowSheetForArea(item,{title: '风险评价', name: 'EVALUATE_L'})">
								<u--input v-model="(item.Nav_SCOREL||{}).SCORE" placeholder="请选择风险评价" disabled suffixIcon="arrow-down" suffixIconStyle="font-size: 12px" disabledColor="#ffffff" inputAlign="right"
									fontSize="14px" border="none">
								</u--input>

							</u-form-item>
							<u-form-item label="风险评价E" border-bottom @click="handleShowSheetForArea(item,{title: '风险评价', name: 'EVALUATE_E'})">
								<u--input v-model="(item.Nav_SCOREE||{}).SCORE" placeholder="请选择风险评价" disabled suffixIcon="arrow-down" suffixIconStyle="font-size: 12px" disabledColor="#ffffff" inputAlign="right"
									fontSize="14px" border="none">
								</u--input>
							</u-form-item>
							<u-form-item label="风险评价C" border-bottom @click="handleShowSheetForArea(item,{title: '风险评价', name: 'EVALUATE_C'})">
								<u--input v-model="(item.Nav_SCOREC||{}).SCORE" placeholder="请选择风险评价" disabled suffixIcon="arrow-down" suffixIconStyle="font-size: 12px" disabledColor="#ffffff" inputAlign="right"
									fontSize="14px" border="none">
								</u--input>
							</u-form-item>
							<u-form-item label="分值D" border-bottom>
								<u--input v-model="item.EVALUATE_SCORE" placeholder="请输入风险评价" disabled disabledColor="#ffffff" inputAlign="right" fontSize="14px" border="none">
								</u--input>
							</u-form-item>
							<u-form-item label="风险等级" prop="HIDDEN_PLACE" @click="handleChangeUnit('SKEvaluateLevelEnum',item)" border-bottom>
								<u--input v-model="item.EVALUATE_LEVELName" placeholder="请选择风险等级" disabled disabledColor="#ffffff" inputAlign="right" fontSize="14px" border="none">
								</u--input>
								<u-icon style="margin-left: 4px;" slot="right" name="arrow-down" size="12">
								</u-icon>
							</u-form-item>
							<u-form-item label="应急处置" prop="EMERGENCY">

							</u-form-item>
							<u--textarea v-model="item.EMERGENCY" placeholder="请填写应急处置" autoHeight maxlength="-1"></u--textarea>
							<uni-collapse class="collapse" ref="collapse">
								<uni-collapse-item title="管控措施" name="Docs guide">
									<view v-if="item.Nav_DoubleDetailMeasures.length!==0">
										<view v-for="(item1,index1) in item.Nav_DoubleDetailMeasures" :key="index1" style="margin: 5px 5px;padding: 0px 10px;">
											<u-form-item :label="index1+1+'.顺序'" prop="NUM" borderBottom>
												<u-number-box integer v-model="item1.NUM" :min="-10000" :max="10000"></u-number-box>
												<!-- <u--input disabledColor="#ffffff" v-model="item1.NUM" border="none" inputAlign="right" placeholder="请输入顺序">
												</u--input> -->
												<u-icon @click="handleDelRowBefore('Num',[index,index1])" name="trash" color="#ff4d4f" size="21" style="margin-left: 20px;"></u-icon>
											</u-form-item>
											<u-form-item label="管控措施" prop="MEASURES_NAME">

											</u-form-item>
											<u--textarea v-model="item1.MEASURES_NAME" placeholder="请填写管控措施" autoHeight maxlength="-1"></u--textarea>

											<u-form-item label="检查内容" prop="EMERGENCY" @click="ishowCheckCo(index,index1)" border-bottom>
												<u-icon name="arrow-up" size="12" v-if="item1.ishowCheckCo"></u-icon>
												<u-icon name="arrow-down" size="12" v-if="!item1.ishowCheckCo"></u-icon>
											</u-form-item>

											<view v-if="item1.ishowCheckCo">
												<view v-for="(item2,index2) in item1.Nav_DetailMeasureContents" :key="index2">
													<u-form-item borderBottom>
														<view style="display: flex;flex-direction: row;justify-content: space-between;align-items: center;flex: 1;">
															<view @click="handleChangeStep('CheckCoTwo',[index,index1,index2])" style="flex: 1;display: flex;flex-direction: row;align-items: center;">
																<view style="flex: 1;">
																	{{index2+1+'.检查内容 : ' +item2.Nav_Contents.CHECKCONTENT}}
																</view>
																<u-icon style="margin-left: 5px;margin-right: 20px;" name="arrow-down" size="12">
																</u-icon>
															</view>
															<view class="action" style="display: flex;flex-direction: row;align-items: center;justify-content: space-around;">
																<u-icon @click="handleDelRowBefore('CheckCoTwo',[index,index1,index2])" name="trash" color="#ff4d4f" size="21"></u-icon>
															</view>
														</view>
													</u-form-item>
													<!-- <u-form-item borderBottom label="检查依据" prop="HIDDEN_PLACE" @click="handleChangeStep('Inspection',[index,index1,index2])" border-bottom>
														<u-icon style="margin-left: 4px;" slot="right" name="arrow-down" size="12">
														</u-icon>
													</u-form-item>
													<u--textarea v-model="item2.Nav_DetailMeasureContentBasicsName" disabled placeholder="请选择检查依据" maxlength="-1"></u--textarea>
													<u-form-item borderBottom label="判定标准" prop="HIDDEN_PLACE" border-bottom>
														<u--input v-model="item2.CHECK_STANDARD" placeholder="请填写判定标准" disabledColor="#ffffff" inputAlign="right" fontSize="14px" border="none">
														</u--input>
													</u-form-item> -->
													<u-form-item label="检查层级" prop="EMERGENCY" @click="ishowCheckLe(index,index1,index2)" border-bottom>
														<u-icon name="arrow-up" size="12" v-if="item2.ishowCheckLe"></u-icon>
														<u-icon name="arrow-down" size="12" v-if="!item2.ishowCheckLe"></u-icon>
													</u-form-item>
													<view v-if="item2.ishowCheckLe">
														<view v-for="(item3,index3) in item2.Nav_DetailMeasureContentPosts" :key="index3">
															<u-form-item :label="index3+1+'.顺序'" prop="NUM" borderBottom>
																<u-number-box integer v-model="item3.NUM" :min="-10000" :max="10000"></u-number-box>
																<!-- <u--input disabledColor="#ffffff" v-model="item1.NUM" border="none" inputAlign="right" placeholder="请输入顺序">
																</u--input> -->
																<u-icon @click="handleDelRowBefore('CheckNum',[index,index1,index2,index3])" name="trash" color="#ff4d4f" size="21" style="margin-left: 20px;"></u-icon>
															</u-form-item>
															<u-form-item label="检查层级：" @click="handleChangeUnit('SKDepartmentTypeEnum',item3,1)" border-bottom>
																<u--input v-model="item3.CHECK_TYPEName" disabled disabledColor="#ffffff" placeholder="请选择检查层级" border="none" inputAlign="right" fontSize="14px">
																</u--input>
																<u-icon style="margin-left: 4px;" slot="right" name="arrow-down" size="12">
																</u-icon>
															</u-form-item>
															<u-form-item borderBottom label="检查部门" prop="HIDDEN_PLACE" @click="handleChangeStep('CheckThreeDep',[index,index1,index2,index3])" border-bottom>
																<u--input v-model="item3.Nav_Department.NAME" placeholder="请选择检查部门" suffixIcon="arrow-down" suffixIconStyle="font-size: 12px" disabled
																	disabledColor="#ffffff" inputAlign="right" fontSize="14px" border="none">
																</u--input>
															</u-form-item>
															<u-form-item borderBottom label="检查类型" prop="HIDDEN_PLACE" @click="handleChangeStep('CheckThreeType',[index,index1,index2,index3])" border-bottom>
																<u--input v-model="item3.Nav_CheckType.NAME" placeholder="请选择检查类型" suffixIcon="arrow-down" suffixIconStyle="font-size: 12px" disabled
																	disabledColor="#ffffff" inputAlign="right" fontSize="14px" border="none">
																</u--input>
															</u-form-item>
															<u-form-item label="检查周期：" @click="handleChangeUnit('SKPLANCHECKFREQUENCYEnum',item3)" border-bottom>
																<u--input v-model="item3.CHECK_CYCLEName" disabled disabledColor="#ffffff" placeholder="请选择检查周期" border="none" inputAlign="right" fontSize="14px">
																</u--input>
																<u-icon style="margin-left: 4px;" slot="right" name="arrow-down" size="12">
																</u-icon>
															</u-form-item>
															<u-form-item borderBottom label="检查岗位" prop="HIDDEN_PLACE" @click="handleChangeStep('CheckThreePost',[index,index1,index2,index3])" border-bottom>
																<u-icon style="margin-left: 4px;" slot="right" name="arrow-down" size="12">
																</u-icon>
															</u-form-item>
															<u--textarea v-model="item3.Nav_DetailPostsName" disabled placeholder="请选择检查岗位" maxlength="-1"></u--textarea>

														</view>
														<u-button text="新增检查层级" size="small" type="primary" style="width: 80%;margin-top: 20px;"
															@click="handleNewControlMea('CheckThreeLel',[index,index1,index2])"></u-button>
													</view>
													<u-form-item label="隐患描述" prop="EMERGENCY" @click="ishowRiskDes(index,index1,index2)" border-bottom>
														<u-icon name="arrow-up" size="12" v-if="item2.ishowRiskDes"></u-icon>
														<u-icon name="arrow-down" size="12" v-if="!item2.ishowRiskDes"></u-icon>
													</u-form-item>
													<view v-if="item2.ishowRiskDes">
														<view v-for="(item3,index3) in item2.Nav_DetailMeasureContentHiddens" :key="index3">
															<u-form-item borderBottom :label="index3+1+'.隐患描述'" prop="HIDDEN_PLACE" @click="handleChangeStep('RiskDesThree',[index,index1,index2,index3])" border-bottom>
																<u--input v-model="item3.Nav_Question.DESCREPTION" placeholder="请选择隐患描述" suffixIcon="arrow-down" suffixIconStyle="font-size: 12px" disabled
																	disabledColor="#ffffff" inputAlign="right" fontSize="14px" border="none">
																</u--input>
																<view @click.stop>
																	<u-icon @click="handleDelRowBefore('RiskDesThree',[index,index1,index2,index3])" name="trash" color="#ff4d4f" size="21"
																		style="margin-left: 20px;"></u-icon>
																</view>

															</u-form-item>
															<u-form-item label="隐患等级：" @click="handleChangeUnit('SKHiddenLevel',item3)" border-bottom>
																<u--input v-model="item3.HIDDEN_LEVELName" disabled disabledColor="#ffffff" placeholder="请选择隐患等级" border="none" inputAlign="right" fontSize="14px">
																</u--input>
																<u-icon style="margin-left: 4px;" slot="right" name="arrow-down" size="12">
																</u-icon>
															</u-form-item>
															<u-form-item borderBottom label="整改措施" prop="HIDDEN_PLACE" border-bottom>

															</u-form-item>
															<u--textarea v-model="item3.RECTIFICATION_MEASURES" placeholder="请填写整改措施" maxlength="-1"></u--textarea>

														</view>
														<u-button text="新增隐患描述" size="small" type="primary" style="width: 80%;margin-top: 20px;"
															@click="handleNewControlMea('RiskDesThree',[index,index1,index2])"></u-button>
													</view>
												</view>
												<u-button text="新增检查内容" size="small" type="primary" style="width: 80%;margin-top: 20px;" @click="handleNewControlMea('CheckCo',[index,index1])"></u-button>
											</view>



										</view>
									</view>

									<u-button text="新增管控措施" size="small" type="primary" style="width: 80%;margin-top: 10px;" @click="handleNewControlMea('Mea',index)"></u-button>
									<!-- <text class="u-collapse-content">涵盖uniapp各个方面，给开发者方向指导和设计理念，让您茅塞顿开，一马平川</text> -->
								</uni-collapse-item>
								<uni-collapse-item title="管控层级" name="Variety components">
									<view v-if="item.Nav_DetailPosts.length!==0">
										<view v-for="(item1,index1) in item.Nav_DetailPosts" :key="index1" style="margin: 5px 5px;padding: 0px 10px;">
											<u-form-item borderBottom>
												<view style="display: flex;flex-direction: row;justify-content: space-between;align-items: center;flex: 1;">
													<view @click="handleChangeStep('Dep',[index,index1])" style="flex: 1;display: flex;flex-direction: row;align-items: center;">
														<view style="flex: 1;">
															{{index1+1+'.管控部门 : ' +item1.Nav_Department.NAME}}
														</view>
														<u-icon style="margin-left: 5px;margin-right: 20px;" name="arrow-down" size="12">
														</u-icon>
													</view>
													<view class="action" style="display: flex;flex-direction: row;align-items: center;justify-content: space-around;">
														<u-icon @click="handleDelRowBefore('Dep',[index,index1])" name="trash" color="#ff4d4f" size="21"></u-icon>
													</view>
												</view>
											</u-form-item>
											<u-form-item borderBottom label="管控层级：" prop="Check_Level" @click="handleChangeUnit('SKDepartmentTypeEnum',item1,2)">
												<u--input v-model="item1.DEPARTMENT_TYPEName" disabled disabledColor="#ffffff" placeholder="请选择管控层级" border="none" inputAlign="right" fontSize="14px">

												</u--input>
												<u-icon style="margin-left: 4px;" slot="right" name="arrow-down" size="12">
												</u-icon>
											</u-form-item>
											<u-form-item borderBottom label="管控责任人" prop="HIDDEN_PLACE" @click="handleChangeStep('Peo',[index,index1])" border-bottom>
												<u--input v-model="item1.Nav_User.NAME" placeholder="请选择管控责任人" suffixIcon="arrow-down" suffixIconStyle="font-size: 12px" disabled disabledColor="#ffffff" inputAlign="right"
													fontSize="14px" border="none">
												</u--input>
											</u-form-item>
										</view>
									</view>
									<u-button text="新增管控层级" size="small" type="primary" style="width: 80%;margin-top: 20px;" @click="handleNewControlMea('Lel',index)"></u-button>
								</uni-collapse-item>
								<uni-collapse-item title="辨识岗位" name="Numerous tools">
									<view v-if="item.Nav_DetailDeparts.length!==0">
										<view v-for="(item1,index1) in item.Nav_DetailDeparts" :key="index1" style="margin: 5px 5px;padding: 0px 10px;">
											<u-form-item borderBottom>
												<view style="display: flex;flex-direction: row;justify-content: space-between;align-items: center;flex: 1;">
													<view @click="handleChangeStep('RecDep',[index,index1])" style="flex: 1;display: flex;flex-direction: row;align-items: center;">
														<view style="flex: 1;">
															{{index1+1+'.辨识部门 : ' +item1.Nav_Department.NAME}}
														</view>
														<u-icon style="margin-left: 5px;margin-right: 20px;" name="arrow-down" size="12">
														</u-icon>
													</view>
													<view class="action" style="display: flex;flex-direction: row;align-items: center;justify-content: space-around;">
														<u-icon @click="handleDelRowBefore('RecDep',[index,index1])" name="trash" color="#ff4d4f" size="21"></u-icon>
													</view>
												</view>
											</u-form-item>
											<u-form-item label="辨识岗位" prop="HIDDEN_PLACE" @click="handleChangeStep('RecPost',[index,index1])" border-bottom>
												<u-icon style="margin-left: 4px;" slot="right" name="arrow-down" size="12">
												</u-icon>
											</u-form-item>
											<u--textarea v-model="item1.Nav_DepartDetailsName" disabled placeholder="请选择辨识岗位" maxlength="-1"></u--textarea>
										</view>
									</view>
									<u-button text="新增辨识岗位" size="small" type="primary" style="width: 80%;margin-top: 20px;" @click="handleNewControlMea('Post',index)"></u-button>
								</uni-collapse-item>
							</uni-collapse>
						</view>
					</view>
					<u-button text="新增检查区域" type="primary" @click="handleNewCheckContent"></u-button>
				</u--form>
			</view>
			<view style="padding: 10px 16px;display: flex;flex-direction: row;" v-if="stepsPageList === 1" class="bottom-button">
				<u-button type="primary" @click="stepReduce" color="#3d4b70" :plain="true" style="margin-right: 5px;">上一步</u-button>
				<u-button type="primary" @click="submit" color="#3d4b70" style="margin-left: 5px;">提交</u-button>
			</view>
			<u-picker :show="comPickerInfo.showSheet" :columns="comPickerInfo.columns" @confirm="onConfirmPicker" @close="comPickerInfo.showSheet=false" @cancel="comPickerInfo.showSheet=false" keyName="NAME"></u-picker>
			<u-modal :show="showDelModalIndex >= 0" @confirm="confirmDel" @cancel="cacelDel" :showCancelButton="true" title="确认删除？"></u-modal>
			<u-datetime-picker :show="showPopupRecitifyDate" v-model="dateRecitifyTime" mode="date" @confirm="confirmRecitifyDate" @cancel="cancelRecitifyDate"></u-datetime-picker>
			<query-selector :multiple="isMultiple" :show="showPopupStep" :total="curTotalStep" :lists="stepLists" :defaultValue="currentOperateStep.NAME" @close="handleClosePopupStep" @search="handleSearchStep"
				@select="handleSelectedStep" :defaultChecked="defaultChecked" />
			<query-selector :multiple="selectorInfo.isMultiple" :show="selectorInfo.showPopup" :title="selectorInfo.title" :lists="selectorInfo.dataLists" :defaultChecked="selectorInfo.defaultChecked"
				@search="handleSearch" @select="handleSelected" @close="selectorInfo.showPopup=false" :total="selectorInfo.totalCount" />
		</view>
	</view>
</template>

<script>
	import {
		extendFilterGroup,
		extendGroupRule,
		extendInclude,
		extendOrder,
		extendRule,
		extendIgnoreDataRule,
		guid,
		initFilter,
		initFilterGroup,
		handleOriginalArray,
		extendFilterGroupGroupRules,
		transformData
	} from '../../../../utils/common'
	import {
		FMProductionUnit,
		SKEffective,
		SKMarkEnum,
		SKLevelEnum,
		CheckPeriods,
		CheckLevels,
		MineTypeIndex,
		MineTypeName
	} from '../../../../utils/enums.js'
	import {
		DouPreGet,
		SKDoublePreventFullUpdate,
		getUserLists,
		GetSKRequestInfo,
		GetRiskAreaInfo,
		GetRiskTypeInfo,
		GetDepartmentInfo,
		GetCheckContentsInfo,
		GetHiddenScripList,
		GetUserPostInfo,
		GetCheckInspection,
		CheckTypeNewOrderPaged,
		GetPostOrderPaged,
		GetRiskNameInfo,
		GetScorel,
		GetScoree,
		GetScorec
	} from '../../../../services/apply/subPages/SK/SKServices.js'
	import {
		getRequest,
	} from '../../../../services/apply/FOServices/FOServices';
	import stepTitle from '@/components/custom/step-title.vue'
	import swipeActionItem from '../../../../uni_modules/uview-ui/libs/config/props/swipeActionItem';
	import formItem from '../../../../uni_modules/uview-ui/libs/config/props/formItem';
	import {
		getEnum,
		GetEnumAnyOrder
	} from '../../../../services/common';
	export default {
		components: {
			stepTitle,
		},
		data() {
			return {
				showDelModalIndex: undefined,
				newContent: false,
				showPopupDate: false,
				showPopupRecitifyDate: false,
				listPropUpload: ['NOTIFY_ID'],
				listPropValUpload: [],
				ORG_ID: uni.getStorageSync('orgId'),
				currentOperateStep: {},
				showPopupStep: false,
				isMultiple: false,
				stepLists: [],
				curTotalStep: 0,
				showPopupUnit: false,
				stepLoad: true,
				UnitLists: [],
				UnitDefaultIndex: [0],
				LevelLists: [],
				defaultChecked: [],
				model: {
					Nav_RiskArea: {
						NAME: ''
					},
					Nav_Contents: {
						CHECKCONTENT: ''
					},
					Nav_Question: {
						DESCREPTION: ''
					},
					HIDDEN_LEVEL: '',
					RECTIFICATION_MEASURES: '',
					Nav_DoubleFiles: [],
					Nav_DoubleDetails: [{
						showPack: false,
						MineType: '',
						Nav_Area: {
							NAME: ''
						},
						RISK_NAME: '',
						Nav_RiskName: {
							NAME: ''
						},
						RISK_DESCRIPTION: '',
						Nav_Type: {
							NAME: ''
						},
						Nav_SCOREL: {
							SCORE: 0
						},
						Nav_SCOREE: {
							SCORE: 0
						},
						Nav_SCOREC: {
							SCORE: 0
						},
						EVALUATE_SCORE: 0,
						EVALUATE_LEVEL: '',
						Nav_DetailPosts: [],
						Nav_DoubleDetailMeasures: [],
					}]
				},
				selectorInfo: {
					name: 'user',
					isMultiple: false,
					showPopup: false,
					totalCount: 0,
					title: '考核结果选择',
					dataItem: {},
					index: 0,
					columns: [],
					dataLists: [],
					defaultText: '',
					defaultChecked: []
				},
				comPickerInfo: {
					showSheet: false,
					dataItem: {},
					columns: [],
					title: '',
					dataIndex: undefined,
					formIndex: undefined,
					name: ''
				},
				dateRecitifyTime: uni.$u.timeFormat(new Date(), 'yyyy-mm-dd'),
				stepsText: ['发起', '审批', '归档'],
				stepsPage: 0,
				stepsPageList: 0,
				TaskID: '',
				nowName: '',
				nowIndex: 0,
				childList: ['管控措施', '管控层级', '辨识岗位'],
				enumsData: {}, // 存储所有枚举数据（键：枚举名称，值：处理后的枚举列表）
				enumsText: {} // 存储枚举文本列表（用于下拉选择等场景）

			}
		},
		onLoad(option) {
			this.TaskID = option.taskID ? option.taskID : '';
			this.ID = option.ID ? option.ID : '';
			this.fetchEnums(['SKHiddenLevel', 'SKProductionUnit', 'SKEvaluateLevelEnum', 'SKPLANCHECKFREQUENCYEnum', 'SKDepartmentTypeEnum']);
		},
		methods: {
			fetchEnums(enumNames) {
				var dataParm = {
					'name': enumNames.join('|')
				}
				GetEnumAnyOrder(dataParm).then(res => {
					let newd = transformData(res, enumNames)
					this.enumsData = newd[0];
					// 生成文本列表（如需要）
					this.enumsText = newd[1]
					this.loadData();
				})
			},
			loadData() {
				// const json = {}
				const orgId = uni.getStorageSync('orgId')
				const json = initFilter(orgId, "", "")
				extendRule(json, 'ID', 1, this.ID);
				extendInclude(json, 'Nav_ApplyDepartment');
				extendInclude(json, 'Nav_ApplyUser');
				extendInclude(json, 'Nav_RiskArea');
				extendInclude(json, 'Nav_DoubleFiles.Nav_ImgFile');
				extendInclude(json, 'Nav_Contents');
				extendInclude(json, 'Nav_Question');
				extendInclude(json, 'Nav_DoubleDetails.Nav_DoubleDetailMeasures.Nav_DetailMeasureContents.Nav_DetailMeasureContentPosts');
				extendInclude(json, 'Nav_DoubleDetails.Nav_DoubleDetailMeasures.Nav_DetailMeasureContents.Nav_DetailMeasureContentPosts.Nav_Department');
				extendInclude(json, 'Nav_DoubleDetails.Nav_DoubleDetailMeasures.Nav_DetailMeasureContents.Nav_DetailMeasureContentPosts.Nav_CheckType');
				extendInclude(json, 'Nav_DoubleDetails.Nav_DoubleDetailMeasures.Nav_DetailMeasureContents.Nav_DetailMeasureContentPosts.Nav_DetailPosts.Nav_Post');
				extendInclude(json, 'Nav_DoubleDetails.Nav_DoubleDetailMeasures.Nav_DetailMeasureContents.Nav_DetailMeasureContentHiddens');
				extendInclude(json, 'Nav_DoubleDetails.Nav_DoubleDetailMeasures.Nav_DetailMeasureContents.Nav_DetailMeasureContentHiddens.Nav_Question');
				extendInclude(json, 'Nav_DoubleDetails.Nav_DoubleDetailMeasures.Nav_DetailMeasureContents');
				extendInclude(json, 'Nav_DoubleDetails.Nav_DoubleDetailMeasures.Nav_DetailMeasureContents.Nav_DetailMeasureContentBasics.Nav_Law');
				extendInclude(json, 'Nav_DoubleDetails.Nav_DoubleDetailMeasures.Nav_DetailMeasureContents.Nav_Contents');
				extendInclude(json, 'Nav_DoubleDetails.Nav_DoubleDetailMeasures');
				extendInclude(json, 'Nav_DoubleDetails.Nav_DetailPosts');
				extendInclude(json, 'Nav_DoubleDetails.Nav_DetailPosts.Nav_Department');
				extendInclude(json, 'Nav_DoubleDetails.Nav_DetailPosts.Nav_User');
				extendInclude(json, 'Nav_DoubleDetails.Nav_DetailDeparts');
				extendInclude(json, 'Nav_DoubleDetails.Nav_DetailDeparts.Nav_Department');
				extendInclude(json, 'Nav_DoubleDetails.Nav_DetailDeparts.Nav_DepartDetails.Nav_Post');
				extendInclude(json, 'Nav_DoubleDetails');
				extendInclude(json, 'Nav_DoubleDetails.Nav_Area');
				extendInclude(json, 'Nav_DoubleDetails.Nav_Type');
				extendInclude(json, 'Nav_DoubleDetails.Nav_RiskName');
				extendIgnoreDataRule(json)
				// extendRule(json, 'TASK_ID', 1, this.TaskID);
				DouPreGet(json).then(res => {
					this.stepLoad = false
					this.model = res;
					this.model.HIDDEN_LEVELName = res.HIDDEN_LEVEL !== undefined ? this.enumsData['SKHiddenLevel'].find(item4 => item4.code === res.HIDDEN_LEVEL).name : '';
					this.stepsPage = res.STATUS == 0 ? 0 : res.STATUS == 20 ? 1 : 2
					this.model.Nav_DoubleDetails.map(item => {
						item['showPack'] = false
						item.Nav_SCOREL = item.Nav_SCOREL ? item.Nav_SCOREL : {
							SCORE: ''
						}
						item.Nav_SCOREE = item.Nav_SCOREE ? item.Nav_SCOREE : {
							SCORE: ''
						}
						item.Nav_SCOREC = item.Nav_SCOREC ? item.Nav_SCOREC : {
							SCORE: ''
						}

						item.EVALUATE_LEVELName = item.EVALUATE_LEVEL !== undefined ? this.enumsData['SKEvaluateLevelEnum'].find(item4 => item4.code === item.EVALUATE_LEVEL).name : '';

						item.Nav_DetailPosts.map(item1 => {
							item1.DEPARTMENT_TYPEName = item1.DEPARTMENT_TYPE !== undefined ? this.enumsData['SKDepartmentTypeEnum'].find(item4 => item4.code === item1.DEPARTMENT_TYPE).name : '';
						})
						item.Nav_DetailDeparts.map(item1 => { //辨识岗位
							if (item1.Nav_DepartDetails.length > 0) {
								let areaShow = ''
								item1.Nav_DepartDetails.map(o => {
									areaShow += o.Nav_Post.NAME
								})
								item1['Nav_DepartDetailsName'] = areaShow
							} else {
								item1['Nav_DepartDetailsName'] = ''
							}
						})
						if (item.Nav_DoubleDetailMeasures.length > 0) { //管控措施
							item.Nav_DoubleDetailMeasures.map(item1 => {
								item1['ishowCheckCo'] = false
								if (item1.Nav_DetailMeasureContents.length > 0) { //检查内容
									item1.Nav_DetailMeasureContents.map(item2 => {
										item2['ishowCheckLe'] = false
										item2['ishowRiskDes'] = false
										if (item2.Nav_DetailMeasureContentBasics.length > 0) {
											let areaShow = ''
											item2.Nav_DetailMeasureContentBasics.map(o => {
												if (o.Nav_Law && o.Nav_Law.NAME) {
													areaShow += o.Nav_Law.NAME + ' 、'
												}

											})
											item2['Nav_DetailMeasureContentBasicsName'] = areaShow
										} else {
											item2['Nav_DetailMeasureContentBasicsName'] = ''
										}
										if (item2.Nav_DetailMeasureContentPosts.length > 0) {
											item2.Nav_DetailMeasureContentPosts.map(item3 => {
												item3.CHECK_CYCLEName = item3.CHECK_CYCLE !== undefined ? this.enumsData['SKPLANCHECKFREQUENCYEnum'].find(item4 => item4.code === item3
													.CHECK_CYCLE).name : '';
												item3.CHECK_TYPEName = item3.CHECK_TYPE !== undefined ? this.enumsData['SKDepartmentTypeEnum'].find(item4 => item4.code === item3
													.CHECK_TYPE).name : '';
												if (item3.Nav_DetailPosts.length > 0) {
													let areaShow = ''
													item3.Nav_DetailPosts.map(o => { //检查岗位
														areaShow += o.Nav_Post.NAME
													})
													item3['Nav_DetailPostsName'] = areaShow
												} else {
													item3['Nav_DetailPostsName'] = ''
												}
											})
										}
										if (item2.Nav_DetailMeasureContentHiddens.length > 0) {
											item2.Nav_DetailMeasureContentHiddens.map(item3 => {
												item3.Nav_Question = item3.Nav_Question ? item3.Nav_Question : {
														DESCREPTION: ''
													},
													item3.HIDDEN_LEVELName = item3.HIDDEN_LEVEL !== undefined ? this.enumsData['SKHiddenLevel'].find(item4 => item4.code === item3
														.HIDDEN_LEVEL).name : '';

											})
										}

									})
								}
							})
						}

					})


				})
			},
			handleShowSheetForArea(item, todo) {
				const validDetails = this.model.Nav_DoubleDetails.filter(i => !i.IS_DELETED);
				const index = validDetails.indexOf(item);
				this.handleShowSheet({
					title: todo.title,
					name: todo.name,
					index: index
				});
			},
			async handleShowSheet(p) {
				const orgId = uni.getStorageSync('orgId')
				const json = initFilter(orgId, "", "", 0, p.pageIndex ?? 1)
				// const json = initFilter(this.ORG_ID, "", "", 0, p.pageIndex ?? 1)
				let dataSelect = []
				var defaultChecked = []
				this.selectorInfo.isMultiple = false




				if (p.val) {
					extendRule(json, 'NAME', 9, p.val);
				}
				json.Limit = 20
				if (p.pageIndex) {
					json.Start = (p.pageIndex - 1) * json.Limit;
				}
				json.Sort = 'NAME'
				// json.SelectField = ["ID", "NAME", "NAME", "CODE"]
				// json.Sort = "NAME"
				// json.Order = 1
				if (p.name == 'EVALUATE_L') {

					// extendRule(json, 'DEVICE_STATUS', 1, '1');
					dataSelect = await GetScorel(json).then(res => {
						this.selectorInfo.totalCount = res.TotalCount
						if (res != undefined && res.Data.length > 0) {
							for (let i = 0; i < res.Data.length; i++) {
								res.Data[i].name = res.Data[i].NAME
							}
						}
						return res.Data
					})
				} else if (p.name == 'EVALUATE_E') {
					dataSelect = await GetScoree(json).then(res => {
						this.selectorInfo.totalCount = res.TotalCount
						if (res != undefined && res.Data.length > 0) {
							for (let i = 0; i < res.Data.length; i++) {
								res.Data[i].name = res.Data[i].NAME
							}
						}
						return res.Data
					})
				} else if (p.name == 'EVALUATE_C') {
					dataSelect = await GetScorec(json).then(res => {
						this.selectorInfo.totalCount = res.TotalCount
						if (res != undefined && res.Data.length > 0) {
							for (let i = 0; i < res.Data.length; i++) {
								res.Data[i].name = res.Data[i].NAME
							}
						}
						return res.Data
					})
				}

				if (defaultChecked == null)
					defaultChecked = []
				if (dataSelect.length) {
					this.selectorInfo = {
						itemData: p.itemData != undefined ? p.itemData : this.selectorInfo
							.itemData, //itemData: p.itemData,  搜索的时候  p.itemData为空  赋值修改 为 她自己本身 this.selectorInfo.itemData
						isMultiple: this.selectorInfo.isMultiple,
						totalCount: this.selectorInfo.totalCount,
						showPopup: true,
						title: p.title,
						name: p.name,
						dataLists: dataSelect,
						defaultChecked: defaultChecked,
						index: p.index
					}
				} else {
					// 暂无数据
				}
			},
			//数据加载
			handleSearch(val, pageIndex) {
				var p = {
					name: this.selectorInfo.name,
					title: this.selectorInfo.title,
					val: val,
					pageIndex: pageIndex,
					index: this.selectorInfo.index
				}
				this.handleShowSheet(p)
			},

			handleSelected(e) {
				this.selectorInfo.showPopup = false
				const validDetails = this.model.Nav_DoubleDetails.filter(i => !i.IS_DELETED);
				const index = this.selectorInfo.index;
				const realIndex = this.model.Nav_DoubleDetails.findIndex(item => item === validDetails[index]);
				if (this.selectorInfo.name == 'EVALUATE_L') {
					this.model.Nav_DoubleDetails[realIndex].Nav_SCOREL = e;
					this.model.Nav_DoubleDetails[realIndex].SCOREL_ID = e.ID;
				} else if (this.selectorInfo.name == 'EVALUATE_E') {
					this.model.Nav_DoubleDetails[realIndex].Nav_SCOREE = e;
					this.model.Nav_DoubleDetails[realIndex].SCOREE_ID = e.ID;
				} else if (this.selectorInfo.name == 'EVALUATE_C') {
					this.model.Nav_DoubleDetails[realIndex].Nav_SCOREC = e;
					this.model.Nav_DoubleDetails[realIndex].SCOREC_ID = e.ID;
				}
				let l = this.model.Nav_DoubleDetails[realIndex].Nav_SCOREL.SCORE
				let o = this.model.Nav_DoubleDetails[realIndex].Nav_SCOREE.SCORE
				let c = this.model.Nav_DoubleDetails[realIndex].Nav_SCOREC.SCORE
				this.model.Nav_DoubleDetails[realIndex].EVALUATE_SCORE = l * o * c
				let D = this.model.Nav_DoubleDetails[realIndex].EVALUATE_SCORE
				if (D >= 320) {
					this.model.Nav_DoubleDetails[realIndex].EVALUATE_LEVELName = "重大风险";
				} else if (D >= 160 && D < 320) {
					this.model.Nav_DoubleDetails[realIndex].EVALUATE_LEVELName = "较大风险";
				} else if (D >= 70 && D < 160) {
					this.model.Nav_DoubleDetails[realIndex].EVALUATE_LEVELName = "一般风险";
				} else {
					this.model.Nav_DoubleDetails[realIndex].EVALUATE_LEVELName = "低风险";
				}
				this.model.Nav_DoubleDetails[realIndex].EVALUATE_LEVEL = this.model.Nav_DoubleDetails[realIndex].EVALUATE_LEVELName !== undefined ? this.enumsData['SKEvaluateLevelEnum'].find(item1 => item1.name === this
					.model
					.Nav_DoubleDetails[
						realIndex].EVALUATE_LEVELName).code : ''

			},
			handlePack(index) {
				this.model.Nav_DoubleDetails[index].showPack = this.model.Nav_DoubleDetails[index].showPack == false ? true : false
				this.model.Nav_DoubleDetails = [...this.model.Nav_DoubleDetails]

			},
			ishowCheckCo(index, index1) {
				this.model.Nav_DoubleDetails[index].Nav_DoubleDetailMeasures[index1].ishowCheckCo = this.model.Nav_DoubleDetails[index].Nav_DoubleDetailMeasures[index1].ishowCheckCo == false ? true : false
				this.model.Nav_DoubleDetails = [...this.model.Nav_DoubleDetails]
			},
			ishowCheckLe(index, index1, index2) {
				this.model.Nav_DoubleDetails[index].Nav_DoubleDetailMeasures[index1].Nav_DetailMeasureContents[index2].ishowCheckLe = this.model.Nav_DoubleDetails[index].Nav_DoubleDetailMeasures[index1]
					.Nav_DetailMeasureContents[index2].ishowCheckLe == false ? true : false
				this.model.Nav_DoubleDetails = [...this.model.Nav_DoubleDetails]
			},
			ishowRiskDes(index, index1, index2) {
				this.model.Nav_DoubleDetails[index].Nav_DoubleDetailMeasures[index1].Nav_DetailMeasureContents[index2].ishowRiskDes = this.model.Nav_DoubleDetails[index].Nav_DoubleDetailMeasures[index1]
					.Nav_DetailMeasureContents[index2].ishowRiskDes == false ? true : false
				this.model.Nav_DoubleDetails = [...this.model.Nav_DoubleDetails]
			},
			cancelUnit() {
				this.showPopupUnit = false
			},
			handleChangeUnit(name, item, index) {
				if (name == 'SKProductionUnit') {
					const json = initFilter(this.ORG_ID)
					getRequest(json, "/FM/UserProductionUnitSet/OrderPaged").then(res => {
						this.comPickerInfo = {
							showSheet: true,
							columns: [res],
							dataItem: item,
							name: name,
							index: index
						}
					})
				} else {
					this.comPickerInfo = {
						showSheet: true,
						columns: [this.enumsText[name]],
						dataItem: item,
						name: name,
						index: index
					}
				}
				// this.fetchEnums(['SKHiddenLevel', 'SKProductionUnit', 'SKEvaluateLevelEnum', 'SKDepartmentTypeEnum', 'SKPLANCHECKFREQUENCYEnum']);

			},
			onConfirmPicker(e) {
				if (this.comPickerInfo.name == 'SKHiddenLevel') {
					if (this.comPickerInfo.dataItem) {
						this.comPickerInfo.dataItem.HIDDEN_LEVELName = e.value[0]
						this.comPickerInfo.dataItem.HIDDEN_LEVEL = this.enumsData['SKHiddenLevel'][e.indexs[0]].code
					} else {
						this.model.HIDDEN_LEVELName = this.enumsData['SKHiddenLevel'][e.indexs[0]].code
						this.model.HIDDEN_LEVEL = e.value[0]
					}

				} else if (this.comPickerInfo.name == 'SKProductionUnit') {
					this.comPickerInfo.dataItem.Nav_ProductionUnit = e.value[0]
					this.comPickerInfo.dataItem.PRODUCTION_UNIT_ID = e.value[0].ID

				} else if (this.comPickerInfo.name == 'SKEvaluateLevelEnum') {
					this.comPickerInfo.dataItem.EVALUATE_LEVELName = e.value[0]
					this.comPickerInfo.dataItem.EVALUATE_LEVEL = this.enumsData['SKEvaluateLevelEnum'][e.indexs[0]].code
				} else if (this.comPickerInfo.name == 'SKDepartmentTypeEnum') {
					if (this.comPickerInfo.index == 1) {
						this.comPickerInfo.dataItem.CHECK_TYPEName = e.value[0]
						this.comPickerInfo.dataItem.CHECK_TYPE = this.enumsData['SKDepartmentTypeEnum'][e.indexs[0]].code
					} else {
						this.comPickerInfo.dataItem.DEPARTMENT_TYPEName = e.value[0]
						this.comPickerInfo.dataItem.DEPARTMENT_TYPE = this.enumsData['SKDepartmentTypeEnum'][e.indexs[0]].code
					}
				} else if (this.comPickerInfo.name == 'SKPLANCHECKFREQUENCYEnum') {
					this.comPickerInfo.dataItem.CHECK_CYCLEName = e.value[0]
					this.comPickerInfo.dataItem.CHECK_CYCLE = this.enumsData['SKPLANCHECKFREQUENCYEnum'][e.indexs[0]].code
				}
				this.comPickerInfo = {
					showSheet: false,
					dataItem: this.comPickerInfo.dataItem,
					columns: [],
					title: '',
					formIndex: undefined
				}
			},
			stepAdd() {
				if (!this.model.RISK_AREA_ID && this.model.RISK_EVALUATE_SUMMARY_ID == null) {
					uni.showToast({
						title: '请选择检查区域',
						icon: 'none'
					})
					return
				}
				if (!this.model.CHECK_CONTENTS_ID && this.model.RISK_EVALUATE_SUMMARY_ID == null) {
					uni.showToast({
						title: '请选择检查内容',
						icon: 'none'
					})
					return
				}
				if (!this.model.CHECK_QUESTION_ID && this.model.RISK_EVALUATE_SUMMARY_ID == null) {
					uni.showToast({
						title: '请选择隐患描述',
						icon: 'none'
					})
					return
				}
				this.stepsPageList = this.stepsPageList + 1
			},
			stepReduce() {
				this.stepsPageList = this.stepsPageList - 1
			},
			handleNewCheckContent() {
				this.model.Nav_DoubleDetails.push({
					showPack: false,
					Nav_ProductionUnit: {
						NAME: ''
					},
					PRODUCTION_UNIT_ID:'',
					Nav_Area: {
						NAME: ''
					},
					RISK_NAME: '',
					RISK_DESCRIPTION: '',
					Nav_Type: {
						NAME: ''
					},
					Nav_SCOREL: {
						SCORE: 0
					},
					Nav_SCOREE: {
						SCORE: 0
					},
					Nav_SCOREC: {
						SCORE: 0
					},
					EVALUATE_SCORE: 0,
					EVALUATE_LEVEL: '低风险',
					Nav_DetailPosts: [],
					Nav_DoubleDetailMeasures: [],
					Nav_DetailDeparts: [],
				})

				this.model.Nav_DoubleDetails = [...this.model.Nav_DoubleDetails]
			},
			handleNewControlMea(name, index) {
				if (name == 'Mea') {
					this.model.Nav_DoubleDetails[index].Nav_DoubleDetailMeasures.push({
						NUM: 0,
						MEASURES_NAME: '',
						EMERGENCY: '',
						Nav_DetailMeasureContents: []
					})
				} else if (name == 'Lel') {
					this.model.Nav_DoubleDetails[index].Nav_DetailPosts.push({
						DEPARTMENT_TYPE: '',
						Nav_Department: {
							NAME: ''
						},
						Nav_User: {
							NAME: ''
						},
					})
				} else if (name == 'Post') {
					this.model.Nav_DoubleDetails[index].Nav_DetailDeparts.push({
						Nav_Department: {
							NAME: '',
							ID: ''
						},
						Nav_DepartDetails: []
					})
				} else if (name == 'CheckCo') {
					this.model.Nav_DoubleDetails[index[0]].Nav_DoubleDetailMeasures[index[1]].Nav_DetailMeasureContents.push({
						Nav_Contents: {
							CHECKCONTENT: ''
						},
						Nav_DetailMeasureContentBasicsName: '',
						Nav_DetailMeasureContentBasics: [],
						CHECK_STANDARD: '',
						Nav_DetailMeasureContentPosts: [],
						Nav_DetailMeasureContentHiddens: []
					})
				} else if (name == 'CheckThreeLel') {
					this.model.Nav_DoubleDetails[index[0]].Nav_DoubleDetailMeasures[index[1]].Nav_DetailMeasureContents[index[2]].Nav_DetailMeasureContentPosts.push({
						NUM: 0,
						CHECK_TYPE: '',
						Nav_Department: {
							NAME: '',
							ID: ''
						},
						Nav_CheckType: {
							NAME: ''
						},
						CHECK_CYCLE: '',
						Nav_DetailPosts: '',
					})
				} else if (name == 'RiskDesThree') {
					this.model.Nav_DoubleDetails[index[0]].Nav_DoubleDetailMeasures[index[1]].Nav_DetailMeasureContents[index[2]].Nav_DetailMeasureContentHiddens.push({
						Nav_Question: {
							DESCREPTION: ''
						},
						HIDDEN_LEVEL: '一般',
						RECTIFICATION_MEASURES: '',
					})
				}

				// this.$nextTick(() => {
				// 	this.$refs.collapse.resize();
				// });
			},
			handleDelRowBefore(name, nowIndex) {
				this.showDelModalIndex = nowIndex[0]
				this.nowName = name
				this.nowIndex = nowIndex
			},
			confirmDel() {
				if (this.nowName == 'Area') {
					this.model.Nav_DoubleDetails.splice(this.nowIndex[0], 1)
				} else if (this.nowName == 'Num') {
					this.model.Nav_DoubleDetails[this.nowIndex[0]].Nav_DoubleDetailMeasures.splice(this.nowIndex[1], 1)
				} else if (this.nowName == 'RecDep') {
					this.model.Nav_DoubleDetails[this.nowIndex[0]].Nav_DetailDeparts.splice(this.nowIndex[1], 1)
				} else if (this.nowName == 'CheckCoTwo') {
					this.model.Nav_DoubleDetails[this.nowIndex[0]].Nav_DoubleDetailMeasures[this.nowIndex[1]].Nav_DetailMeasureContents.splice(this.nowIndex[2], 1)
				} else if (this.nowName == 'CheckNum') {
					this.model.Nav_DoubleDetails[this.nowIndex[0]].Nav_DoubleDetailMeasures[this.nowIndex[1]].Nav_DetailMeasureContents[this.nowIndex[2]].Nav_DetailMeasureContentPosts.splice(this.nowIndex[3], 1)
				} else if (this.nowName == 'RiskDesThree') {
					this.model.Nav_DoubleDetails[this.nowIndex[0]].Nav_DoubleDetailMeasures[this.nowIndex[1]].Nav_DetailMeasureContents[this.nowIndex[2]].Nav_DetailMeasureContentHiddens.splice(this.nowIndex[3], 1)
				} else {
					this.model.Nav_DoubleDetails[this.nowIndex[0]].Nav_DetailPosts.splice(this.nowIndex[1], 1)
				}
				this.showDelModalIndex = undefined

			},
			cacelDel() {
				this.showDelModalIndex = undefined
			},
			cancelRecitifyDate() {
				this.showPopupRecitifyDate = false
			},
			handleChangeRecitify(name) {
				this.nowName = name
				this.showPopupRecitifyDate = true
			},
			confirmRecitifyDate(e) {
				if (this.nowName == 'start') {
					this.model.START_DATE = uni.$u.timeFormat(e.value,
						'yyyy-mm-dd')

				} else {
					this.model.END_DATE = uni.$u.timeFormat(e.value,
						'yyyy-mm-dd')
				}
				this.dateRecitifyTime = uni.$u.timeFormat(e.value,
					'yyyy-mm-dd')

				this.showPopupRecitifyDate = false
			},
			handleChangeStep(name, nowIndex) {
				this.currentOperateStep = {}
				this.showPopupStep = true
				this.nowName = name
				this.nowIndex = nowIndex
				this.handleSearchStep('init')
			},
			handleClosePopupStep() {
				this.showPopupStep = false
				this.isMultiple = false
				this.defaultChecked = []
				// this.showPopupCertificate = false
			},
			handleSearchStep(val, pageIndex) {
				const orgId = uni.getStorageSync('orgId')
				const json = initFilter(orgId, "", "", 0, pageIndex ?? 1)

				json.Limit = 20
				if (pageIndex) {
					json.Start = (pageIndex - 1) * json.Limit;
				}
				this.defaultChecked = []

				if (val !== 'init') {
					const tempGroup = initFilterGroup(false);
					if (this.nowName == 'CheckContent' || this.nowName == 'CheckCoTwo') {
						extendGroupRule(tempGroup, 'CHECKCONTENT', 9, val)
					} else if (this.nowName == 'RecPost' || this.nowName == 'CheckThreePost') {
						extendGroupRule(tempGroup, 'DESCREPTION', 9, val)
					} else {
						extendGroupRule(tempGroup, 'NAME', 9, val)
					}
					extendFilterGroup(json, tempGroup);
				}
				let requestInfo = this.nowName == 'CheckArea' || this.nowName == 'Area' ? GetRiskAreaInfo :
					this.nowName == 'CheckContent' || this.nowName == 'CheckCoTwo' ? GetCheckContentsInfo :
					this.nowName == 'RiskDes' || this.nowName == 'RiskDesThree' ? GetHiddenScripList :
					this.nowName == 'demand' ? GetSKRequestInfo :
					this.nowName == 'Category' ? GetRiskTypeInfo :
					this.nowName == 'RecPost' || this.nowName == 'CheckThreePost' ? GetPostOrderPaged :
					this.nowName == 'Inspection' ? GetCheckInspection :
					this.nowName == 'CheckThreeType' ? CheckTypeNewOrderPaged :
					this.nowName == 'Dep' || this.nowName == 'RecDep' || this.nowName == 'CheckThreeDep' ?
					GetDepartmentInfo : this.nowName == 'RiskName' ? GetRiskNameInfo : getUserLists
				if (this.nowName == 'CheckThreeType') {
					if (this.model.Nav_DoubleDetails[this.nowIndex[0]].PRODUCTION_UNIT_ID !== undefined && this.model.Nav_DoubleDetails[this.nowIndex[0]].PRODUCTION_UNIT_ID !== null) {
						extendRule(json, 'PRODUCTION_UNIT_ID', 1, String(this.model.Nav_DoubleDetails[this.nowIndex[0]].PRODUCTION_UNIT_ID));
					}

				}
				if (this.nowName == 'Inspection') {
					this.isMultiple = true
					let p = this.model.Nav_DoubleDetails[this.nowIndex[0]].Nav_DoubleDetailMeasures[this.nowIndex[1]].Nav_DetailMeasureContents[this.nowIndex[2]]
					if (p.Nav_DetailMeasureContentBasics && p.Nav_DetailMeasureContentBasics.length > 0) {

						p.Nav_DetailMeasureContentBasics.map(item => {
							let newId = item.LAW_ID;
							// 创建一个新对象，ID 为 item.LAW_ID，其他属性和 item 相同
							let newItem = {
								...item,
								ID: newId
							};
							// 将新对象添加到 this.defaultChecked 数组中
							this.defaultChecked.push(newItem);
						})
					} else {
						this.defaultChecked = []
					}
				} else if (this.nowName == 'RecPost') {
					this.isMultiple = true
					let p = this.model.Nav_DoubleDetails[this.nowIndex[0]].Nav_DetailDeparts[this.nowIndex[1]]
					if (p.Nav_DepartDetails && p.Nav_DepartDetails.length > 0) {

						p.Nav_DepartDetails.map(item => {
							let newId = item.Nav_Post ? item.Nav_Post.ID : item.ID;
							// 创建一个新对象，ID 为 item.LAW_ID，其他属性和 item 相同
							let newItem = {
								...item,
								ID: newId
							};
							this.defaultChecked.push(newItem)
						})
					} else {
						this.defaultChecked = []
					}
					if (p.Nav_Department.ID) {
						extendFilterGroupGroupRules(json, 'DEPARTMENT_ID', 1, p.Nav_Department.ID)
					}


				} else if (this.nowName == 'CheckThreePost') {
					this.isMultiple = true
					let p = this.model.Nav_DoubleDetails[this.nowIndex[0]].Nav_DoubleDetailMeasures[this.nowIndex[1]].Nav_DetailMeasureContents[this.nowIndex[2]].Nav_DetailMeasureContentPosts[this.nowIndex[3]]
					if (p.Nav_DetailPosts && p.Nav_DetailPosts.length > 0) {
						p.Nav_DetailPosts.map(item => {
							let newId = item.Nav_Post ? item.Nav_Post.ID : item.ID;
							// 创建一个新对象，ID 为 item.LAW_ID，其他属性和 item 相同
							let newItem = {
								...item,
								ID: newId
							};
							this.defaultChecked.push(newItem)
						})
					} else {
						this.defaultChecked = []
					}
					if (p.Nav_Department.ID) {
						extendFilterGroupGroupRules(json, 'DEPARTMENT_ID', 1, p.Nav_Department.ID)
					}

				} else {
					this.isMultiple = false
				}
				json.Limit = 100
				requestInfo(json).then(res => {
					this.stepLists = (res.Data || res).map(i => {
						return {
							...i,
							id: i.ID,
							name: i.NAME || i.CHECKCONTENT || i.DEMAND,
						}
					})
					this.curTotalStep = res.TotalCount
					// }
				})



			},
			handleSelectedStep(val) {
				this.defaultChecked = []
				if (this.nowName == 'demand') {
					this.model.Nav_Require.NAME = val.NAME
					this.model.REQUIRE_ID = val.ID
					this.model.RequireName = val.NAME
				} else if (this.nowName == 'Area') {
					this.model.Nav_DoubleDetails[this.nowIndex[0]].Nav_Area.NAME = val.NAME
					this.model.Nav_DoubleDetails[this.nowIndex[0]].AREA_ID = val.ID
				} else if (this.nowName == 'Category') {
					this.model.Nav_DoubleDetails[this.nowIndex[0]].Nav_Type.NAME = val.NAME
					this.model.Nav_DoubleDetails[this.nowIndex[0]].TYPE_ID = val.ID
				} else if (this.nowName == 'Dep') {
					this.model.Nav_DoubleDetails[this.nowIndex[0]].Nav_DetailPosts[this.nowIndex[1]].Nav_Department = val
					this.model.Nav_DoubleDetails[this.nowIndex[0]].Nav_DetailPosts[this.nowIndex[1]].DEPARTMENT_ID = val.ID
				} else if (this.nowName == 'RecDep') {
					this.model.Nav_DoubleDetails[this.nowIndex[0]].Nav_DetailDeparts[this.nowIndex[1]].Nav_Department = val
					this.model.Nav_DoubleDetails[this.nowIndex[0]].Nav_DetailDeparts[this.nowIndex[1]].DEPARTMENT_ID = val.ID
				} else if (this.nowName == 'RecPost') {
					let listArea = []
					let areaShow = ''
					if (val.length > 0) {
						val.forEach((item, i) => {
							if (i > 0) {
								areaShow += ' '
							}
							// 创建一个新对象，ID 为 item.LAW_ID，其他属性和 item 相同
							let newItem = {
								...item,
								MECHANISM_DETAIL_DEPART_ID: item.ID,
								POST_ID: item.ID,
								NAME: item.NAME || item.Nav_Post.NAME,
							};
							listArea.push(newItem)
							if (item.NAME && item.NAME != null) {
								areaShow += item.NAME
							} else if (item.Nav_Post && item.Nav_Post.NAME != null) {
								areaShow += item.Nav_Post.NAME
							}

						})
					}
					this.model.Nav_DoubleDetails[this.nowIndex[0]].Nav_DetailDeparts[this.nowIndex[1]].Nav_DepartDetails = listArea
					this.model.Nav_DoubleDetails[this.nowIndex[0]].Nav_DetailDeparts[this.nowIndex[1]].Nav_DepartDetailsName = areaShow
				} else if (this.nowName == 'CheckCoTwo') {
					this.model.Nav_DoubleDetails[this.nowIndex[0]].Nav_DoubleDetailMeasures[this.nowIndex[1]].Nav_DetailMeasureContents[this.nowIndex[2]].Nav_Contents.CHECKCONTENT = val.CHECKCONTENT
					this.model.Nav_DoubleDetails[this.nowIndex[0]].Nav_DoubleDetailMeasures[this.nowIndex[1]].Nav_DetailMeasureContents[this.nowIndex[2]].CHECK_CONTENTS_ID = val.ID
				} else if (this.nowName == 'Inspection') {
					let listArea = []
					let areaShow = ''
					if (val.length > 0) {
						val.forEach((item, i) => {
							if (i > 0) {
								areaShow += ' '
							}
							let newItem = {
								...item,
								LAW_ID: item.ID,
								DOUBLE_PREVENT_MECHANISM_DETAIL_MEASURES_CONTENT_ID: item.ID,
								NAME: item.NAME || item.Nav_Law.NAME,
							};
							listArea.push(newItem)
							if (item.NAME && item.NAME != null) {
								areaShow += item.NAME
							} else if (item.Nav_Law && item.Nav_Law.NAME != null) {
								areaShow += item.Nav_Law.NAME
							}
						})
					}
					this.model.Nav_DoubleDetails[this.nowIndex[0]].Nav_DoubleDetailMeasures[this.nowIndex[1]].Nav_DetailMeasureContents[this.nowIndex[2]].Nav_DetailMeasureContentBasics = listArea
					this.model.Nav_DoubleDetails[this.nowIndex[0]].Nav_DoubleDetailMeasures[this.nowIndex[1]].Nav_DetailMeasureContents[this.nowIndex[2]].Nav_DetailMeasureContentBasicsName = areaShow
				} else if (this.nowName == 'CheckThreePost') {
					let listArea = []
					let areaShow = ''
					if (val.length > 0) {
						val.forEach((item, i) => {
							if (i > 0) {
								areaShow += ' '
							}
							// 创建一个新对象，ID 为 item.LAW_ID，其他属性和 item 相同
							let newItem = {
								...item,
								POST_ID: item.ID,
								DOUBLE_PREVENT_MECHANISM_DETAIL_MEASURES_CONTENT_ID: item.ID,
								NAME: item.NAME || item.Nav_Post.NAME,
							};
							listArea.push(newItem)
							if (item.NAME && item.NAME != null) {
								areaShow += item.NAME
							} else if (item.Nav_Post && item.Nav_Post.NAME != null) {
								areaShow += item.Nav_Post.NAME
							}
						})
					}
					this.model.Nav_DoubleDetails[this.nowIndex[0]].Nav_DoubleDetailMeasures[this.nowIndex[1]].Nav_DetailMeasureContents[this.nowIndex[2]].Nav_DetailMeasureContentPosts[this.nowIndex[3]].Nav_DetailPosts =
						listArea
					this.model.Nav_DoubleDetails[this.nowIndex[0]].Nav_DoubleDetailMeasures[this.nowIndex[1]].Nav_DetailMeasureContents[this.nowIndex[2]].Nav_DetailMeasureContentPosts[this.nowIndex[3]]
						.Nav_DetailPostsName = areaShow
				} else if (this.nowName == 'CheckThreeDep') {
					this.model.Nav_DoubleDetails[this.nowIndex[0]].Nav_DoubleDetailMeasures[this.nowIndex[1]].Nav_DetailMeasureContents[this.nowIndex[2]].Nav_DetailMeasureContentPosts[this.nowIndex[3]].Nav_Department =
						val
					this.model.Nav_DoubleDetails[this.nowIndex[0]].Nav_DoubleDetailMeasures[this.nowIndex[1]].Nav_DetailMeasureContents[this.nowIndex[2]].Nav_DetailMeasureContentPosts[this.nowIndex[3]]
						.DEPARTMENT_ID = val.ID
				} else if (this.nowName == 'CheckThreeType') {
					this.model.Nav_DoubleDetails[this.nowIndex[0]].Nav_DoubleDetailMeasures[this.nowIndex[1]].Nav_DetailMeasureContents[this.nowIndex[2]].Nav_DetailMeasureContentPosts[this.nowIndex[3]].Nav_CheckType =
						val
					this.model.Nav_DoubleDetails[this.nowIndex[0]].Nav_DoubleDetailMeasures[this.nowIndex[1]].Nav_DetailMeasureContents[this.nowIndex[2]].Nav_DetailMeasureContentPosts[this.nowIndex[3]]
						.CHECK_TYPE_ID = val.ID
				} else if (this.nowName == 'RiskDesThree') {
					this.model.Nav_DoubleDetails[this.nowIndex[0]].Nav_DoubleDetailMeasures[this.nowIndex[1]].Nav_DetailMeasureContents[this.nowIndex[2]].Nav_DetailMeasureContentHiddens[this.nowIndex[3]]
						.CHECK_QUESTION_ID = val.ID
					this.model.Nav_DoubleDetails[this.nowIndex[0]].Nav_DoubleDetailMeasures[this.nowIndex[1]].Nav_DetailMeasureContents[this.nowIndex[2]].Nav_DetailMeasureContentHiddens[this.nowIndex[3]].Nav_Question
						.DESCREPTION = val.DESCREPTION
					this.model.Nav_DoubleDetails[this.nowIndex[0]].Nav_DoubleDetailMeasures[this.nowIndex[1]].Nav_DetailMeasureContents[this.nowIndex[2]].Nav_DetailMeasureContentHiddens[this.nowIndex[3]]
						.RECTIFICATION_MEASURES = val.DEMAND
				} else if (this.nowName == 'CheckArea') {
					this.model.Nav_RiskArea.NAME = val.NAME
					this.model.RISK_AREA_ID = val.ID

				} else if (this.nowName == 'CheckContent') {
					this.model.Nav_Contents.CHECKCONTENT = val.CHECKCONTENT
					this.model.CHECK_CONTENTS_ID = val.ID
				} else if (this.nowName == 'RiskDes') {
					this.model.Nav_Question.DESCREPTION = val.DESCREPTION
					this.model.CHECK_QUESTION_ID = val.ID
					this.model.HIDDEN_LEVEL = val.QUESTION_LEVEL == 0 ? '一般' : '重大'
					this.model.HIDDEN_DESCRIPTION = val.DEMAND
				} else if (this.nowName == 'RiskName') {
					this.model.Nav_DoubleDetails[this.nowIndex[0]].RISK_NAME = val.NAME
					this.model.Nav_DoubleDetails[this.nowIndex[0]].RISK_NAME_ID = val.ID
				} else {
					this.model.Nav_DoubleDetails[this.nowIndex[0]].Nav_DetailPosts[this.nowIndex[1]].Nav_User.NAME = val.NAME
					this.model.Nav_DoubleDetails[this.nowIndex[0]].Nav_DetailPosts[this.nowIndex[1]].USER_ID = val.ID
				}
				this.showPopupStep = false

			},
			submit() {
				let i = 1
				for (let item of this.model.Nav_DoubleDetails) {
					if (!item.PRODUCTION_UNIT_ID) {
						uni.showToast({
							title: '顺序' + i + '生产单元不能为空',
							icon: 'none'
						})
						return
					}
					if (!item.AREA_ID) {
						uni.showToast({
							title: '顺序' + i + '辨识区域不能为空',
							icon: 'none'
						})
						return
					}
					// if (!item.RISK_NAME) {
					// 	uni.showToast({
					// 		title: '顺序'+i+'风险名称不能为空',
					// 		icon: 'none'
					// 	})
					// 	return
					// }
					if (!item.RISK_NAME) {
						uni.showToast({
							title: '顺序' + i + '风险名称不能为空',
							icon: 'none'
						})
						return
					}
					if (!item.RISK_DESCRIPTION) {
						uni.showToast({
							title: '顺序' + i + '风险描述不能为空',
							icon: 'none'
						})
						return
					}
					if (!item.TYPE_ID) {
						uni.showToast({
							title: '顺序' + i + '风险类别不能为空',
							icon: 'none'
						})
						return
					}
					if (!item.SCOREL_ID) {
						uni.showToast({
							title: '顺序' + i + '风险评价L不能为空',
							icon: 'none'
						})
						return
					}
					if (!item.SCOREE_ID) {
						uni.showToast({
							title: '顺序' + i + '风险评价E不能为空',
							icon: 'none'
						})
						return
					}
					if (!item.SCOREC_ID) {
						uni.showToast({
							title: '顺序' + i + '风险评价C不能为空',
							icon: 'none'
						})
						return
					}
					if (!item.EVALUATE_SCORE) {
						uni.showToast({
							title: '顺序' + i + '分值D不能为空',
							icon: 'none'
						})
						return
					}
					if (!item.EVALUATE_LEVEL) {
						uni.showToast({
							title: '顺序' + i + '风险等级不能为空',
							icon: 'none'
						})
						return
					}
					if (item.Nav_DoubleDetailMeasures.length !== 0) {
						for (let item1 of item.Nav_DoubleDetailMeasures) {
							if (!item1.MEASURES_NAME) {
								uni.showToast({
									title: '顺序' + i + '管控措施不能为空',
									icon: 'none'
								})
								return
							}
							// if (!item1.EMERGENCY) {
							// 	uni.showToast({
							// 		title: '应急处置不能为空',
							// 		icon: 'none'
							// 	})
							// 	return
							// }
							if (item1.Nav_DetailMeasureContents.length !== 0) {
								for (let item2 of item1.Nav_DetailMeasureContents) {
									if (!item2.CHECK_CONTENTS_ID) {
										uni.showToast({
											title: '顺序' + i + '检查内容不能为空',
											icon: 'none'
										})
										return
									}
									if (item2.Nav_DetailMeasureContentPosts.length !== 0) {
										for (let item3 of item2.Nav_DetailMeasureContentPosts) {
											if (!item3.CHECK_TYPEName) {
												uni.showToast({
													title: '顺序' + i + '检查层级不能为空',
													icon: 'none'
												})
												return
											}
											if (!item3.DEPARTMENT_ID) {
												uni.showToast({
													title: '顺序' + i + '检查部门不能为空',
													icon: 'none'
												})
												return
											}
											if (!item3.CHECK_TYPE_ID) {
												uni.showToast({
													title: '顺序' + i + '检查类型不能为空',
													icon: 'none'
												})
												return
											}
											if (!item3.CHECK_CYCLEName) {
												uni.showToast({
													title: '顺序' + i + '检查周期不能为空',
													icon: 'none'
												})
												return
											}
											if (item3.Nav_DetailPosts.length == 0) {
												uni.showToast({
													title: '顺序' + i + '检查岗位不能为空',
													icon: 'none'
												})
												return
											}
										}
									}
									if (item2.Nav_DetailMeasureContentHiddens.length !== 0) {
										for (let item3 of item2.Nav_DetailMeasureContentHiddens) {
											if (!item3.CHECK_QUESTION_ID) {
												uni.showToast({
													title: '顺序' + i + '隐患描述不能为空',
													icon: 'none'
												})
												return
											}
											if (!item3.HIDDEN_LEVELName) {
												uni.showToast({
													title: '顺序' + i + '隐患等级不能为空',
													icon: 'none'
												})
												return
											}
											if (!item3.RECTIFICATION_MEASURES) {
												uni.showToast({
													title: '顺序' + i + '整改措施不能为空',
													icon: 'none'
												})
												return
											}
										}
									}

								}
							}
						}
					}
					if (item.Nav_DetailPosts.length !== 0) {
						for (let item1 of item.Nav_DetailPosts) {
							if (!item1.DEPARTMENT_TYPEName) {
								uni.showToast({
									title: '顺序' + i + '管控层级不能为空',
									icon: 'none'
								})
								return
							}
							if (!item1.DEPARTMENT_ID) {
								uni.showToast({
									title: '顺序' + i + '管控部门不能为空',
									icon: 'none'
								})
								return
							}
							if (!item1.USER_ID) {
								uni.showToast({
									title: '顺序' + i + '管控责任人不能为空',
									icon: 'none'
								})
								return
							}
						}
					}
					if (item.Nav_DetailDeparts.length !== 0) {
						for (let item1 of item.Nav_DetailDeparts) {
							if (!item1.DEPARTMENT_ID) {
								uni.showToast({
									title: '顺序' + i + '辨识部门不能为空',
									icon: 'none'
								})
								return
							}
							if (item1.Nav_DepartDetails.length == 0) {
								uni.showToast({
									title: '顺序' + i + '辨识岗位不能为空',
									icon: 'none'
								})
								return
							}
						}
					}
					i++
				}

				this.modelEdit = JSON.parse(JSON.stringify(this.model))
				delete this.modelEdit.Nav_ApplyDepartment
				delete this.modelEdit.Nav_ApplyUser
				this.modelEdit.Nav_DoubleDetails.map(item => {
					delete item.Nav_Area
					delete item.Nav_RiskName
					delete item.Nav_Type
					delete item.Nav_SCOREC
					delete item.Nav_SCOREE
					delete item.Nav_SCOREL
					delete item.showPack
					item.Nav_DetailDeparts.map(item1 => {
						delete item1.Nav_Department
					})
					item.Nav_DetailPosts.map(item1 => {
						delete item1.Nav_Department
						delete item1.Nav_User
					})
					item.Nav_DoubleDetailMeasures.map(item1 => {
						delete item1.ishowCheckCo
						item1.Nav_DetailMeasureContents.map(item2 => {
							delete item2.Nav_Contents
							delete item2.ishowCheckLe
							delete item2.ishowRiskDes
							item2.Nav_DetailMeasureContentHiddens.map(item3 => {
								delete item3.Nav_Question
							})
							item2.Nav_DetailMeasureContentPosts.map(item3 => {
								delete item3.Nav_CheckType
								delete item3.Nav_Department
							})

						})
					})
				})
				if (this.TaskID == null || this.TaskID == '') {
					this.modelEdit.TaskID = '00000000-0000-0000-0000-000000000000'
				} else {
					this.modelEdit.TaskID = this.TaskID
				}
				if (this.modelEdit.ORG_ID == null || this.modelEdit.ORG_ID == '')
					this.modelEdit.ORG_ID = this.ORG_ID
				this.modelEdit.ID = this.ID
				this.modelEdit.PUBLISH = 'SaveAndNotify'
				SKDoublePreventFullUpdate(this.modelEdit).then(res => {
					if (res) {
						uni.$showMsgFunc('操作成功!', () => {
							uni.navigateBack()
						}, 'success', 1000)
					}
				})


			}

		},
	}
</script>

<style scoped>
	@import url("../../../../style/css/newTemplate.css");

	.sub-form>>>.u-form-item__body__right__content__slot {
		display: flex;
		justify-content: flex-end;
	}

	.collapse>>>.uni-collapse-item__title-box {
		padding: 0px;
	}

	.collapse>>>.uni-collapse-item__title-arrow {
		margin-right: 0px;
	}

	.collapse>>>.uni-icons {
		color: #606266 !important;
	}

	.collapse>>>.uni-collapse-item__wrap-content.open {
		padding: 0px 0px 20px 0px;
	}

	.force-reflow {
		/* 这里可以设置一个无实际影响的样式，例如透明边框 */
		border: 1px solid transparent;
	}

	.collapse-content {
		height: 400px;
		width: 100%;
	}

	.collapse-content-no {
		/* height: 200px;
		width: 100%; */
	}
</style>