<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<title>资质申报</title>
		<script src="../../js/vue/vue.js"></script>
		<script src="../../js/vue/element-ui/lib/index.js"></script>
		<script src="../../js/vue/axios/dist/axios.min.js"></script>
		<script src="../../js/myelement.js"></script>
		<script src="../../js/vue/page.js"></script>
		
		<link href="../../js/vue/element-ui/lib/theme-chalk/index.css" rel="stylesheet">
		<link href="../../css/myelement.css" rel="stylesheet">
		<link href="../../css/iconfont.css" rel="stylesheet">
		<link href="../../css/page.css" rel="stylesheet">
		<link href="//at.alicdn.com/t/font_2374495_mkoo966o0uo.css" rel="stylesheet">
	</head>
	
	<body>
		<div id="vbody">
			<div id="page_root">
				<div ref="popup_body" style="padding-right: 20px;">
					<div class="el-dialog_header">
						<div class="dialog-title">
							<i class="iconfont icon-customermanagement"></i>
							<span> {{title}} </span>
						</div>
						
					</div>	
					
					<div :style="{height: t_height +'px', 'overflow-y': 'auto'}">
					<!-- <div style="height: 550px; "> -->
						<div class="el-dialog_body">
							<h-form
								v-if="showform"
								ref="form1"
								:form-attr="formAttr_jc"
								:table-fields="formFields_jc"
								:form-data="formData_jc"
								
								:is-old-contrast="isOldContrast"
								:form-data-old="formDataOld"
							>
							</h-form>
							
							<div style="margin-top: 20px;">
							    <h-form
							        ref="form2"
							        :form-attr="formAttr_jc"
							        :table-fields="formFields2"
							        :form-data="formData2"
							    >
							    </h-form>
							</div>
							<!-- <div v-if="showAcctRowEdit" style="text-align: right;">
								<el-button-group >
									<el-button v-if="!acctObj.delivery_status || acctObj.delivery_status == 'input' || acctObj.delivery_status == 'refuse'" @click="editTableData">修改</el-button>
									<el-button v-if="!acctObj.delivery_status || acctObj.delivery_status == 'input'" @click="notActiveTableData">删 除</el-button>
									<el-button v-if="!acctObj.delivery_status || acctObj.delivery_status == 'input' || acctObj.delivery_status == 'refuse'" @click="saveRowTable">单条保存</el-button>
									<el-button v-if="acctObj.delivery_status == 'refuse'" @click="refusesubmitRowTable">再次提交</el-button>
									<el-button v-if="!acctObj.delivery_status || acctObj.delivery_status == 'input'" @click="submitRowTable">单条提交</el-button>
								</el-button-group>
							</div> -->
							
							<!-- <h-table
								v-if="isRefresh"
								ref="table2"
								:table-fields="tableFields_cj" 
								:table-data="tableData2" 
								:table-height="tableHeight1"
								:is-pagination="false"
								:is-show-index="true"
								
								v-on:cell-click="cellClick"
							>
							</h-table> -->
							
							<div class="el-dialog_body" style=" padding-top: 0px;"><!-- height: 550px; -->
								<el-tabs v-model="activeNames" @tab-click="handleChange">
									<el-tab-pane label="资质证照" name="1">
										<div class="zs_" style="float:left; width: 50%;">
											<el-form ref="form_zz" :model="file_zs" label-width="160px">
												<template v-for="file in attachment_type_zs">
													<el-form-item  :label="file.name + ':'" :rules="file.rules" :prop="file.code">
														<div v-if="file.type_active || file_zs[file.code]" style="width: 100%; min-height: 34px;">
															<div style="float: left; width: 60%; min-height: 35px; border-bottom: 1px solid #ccc ;">
																<span v-if="file_zs[file.code]">{{file_zs[file.code].file_name}}</span>
															</div>
															
															<div style="float: right; width: 40%;">
																<!-- <div v-if="(notdisabled || isapprovaledit) && file_zs[file.code] && file_zs[file.code].file_name" class="close_file"
																@click="delFile(file.code, 'zz', file.name, file_zs[file.code])">
																	<i class="el-icon-close" ></i>
																</div> -->
																
																<el-button-group class="fj_button" style="float: right;">
																  <!-- <el-button v-if="(notdisabled || isapprovaledit) && file.code !='ZGL01'" type="primary" size="small" @click="onPopupByUploadFile(file.code, 'zz')">上 传</el-button> -->
																  <el-button v-if="notdisabled || isapprovaledit" type="primary" size="small" @click="onPopupByUploadFile(file.code, 'zz')">上 传</el-button>
																  <el-button :disabled="!file_zs[file.code].file_name" type="primary" size="small" @click="showFileImg(file.code)">预 览</el-button>
																  <el-button v-if="file.only_attachment != 1" :disabled="!file_zs[file.code].file_name" type="primary" size="small" @click="showFileTxt(file.code)">详 情</el-button>
																</el-button-group>
															</div>
														</div>
													</el-form-item>
													<div v-if="file.remark" style="margin-left: 140px; font-size: 12px;">
														<span style="color: red;">{{file.remark}}</span>
													</div>
												</template>
											</el-form>
										</div>
										
										<div style="float: right; width: 50%;">
											<!-- <div class="el-dialog__footer" style="border: 0px;">
											  <el-button v-if="notdisabled" type="primary" 
											  @click="saveTabData('zz', file_zs)">保 存</el-button>
											</div> -->
											<div v-if="file_img" style="height: 50%;">
												<div style="margin-left: 30px; font-weight: bold;">
													<el-button v-if="zzimg.id" type="txt" size="small" @click="onDownloadFileByFileId(zzimg.id)">下载附件</el-button>
												</div>
												<el-image v-if="zzimg.url"
													style=" height: 400px; margin-left: 10px;" 
													:src="zzimg.url"
													:preview-src-list="zzimgList"
													fit="contain">
												</el-image>
											</div>
											
											<div  v-if="file_txt" style="height: 50%;">
												<div style="margin-left: 30px; font-weight: bold;">
													<span>{{selectZZName}}</span>
												</div>
												<h-form ref="form_zzxx" :form-attr="formAttr_zz"
													:table-fields="tableFields_zz" 
													:form-data="file_zs[selectZZType]" 
													v-on:form-change="formChange_zz"
													>
												</h-form>
											</div>
											
											<div v-if="!file_txt && !file_img" style="height: 50%;">
												<div style="margin-left: 30px; font-weight: bold;">
													<span v-if="attachment_type_zzobj && attachment_type_zzobj.ZGL01">{{attachment_type_zzobj.ZGL01.name}}</span>
												</div>
												<h-form ref="form_zzxx" :form-attr="formAttr_zz"
													:table-fields="tableFields_zz" 
													:form-data="file_zs[selectZZType]" 
													v-on:form-change="formChange_zz"
													>
												</h-form>
											</div>
											
										</div>
										
									</el-tab-pane>
									
									<el-tab-pane label="开票信息" name="2">
										<div class="zs_" style="float: left; width: 50%;">
											<el-form ref="form_kp_f" :model="formData_kp" label-width="130px">
												<template v-for="file in attachment_type_kp">
													<el-form-item :label="file.name + ':'" :rules="file.rules">
														<div style="width: 100%; min-height: 40px;">
															<div style="float: left; width: 70%; min-height: 35px; border-bottom: 1px solid #ccc ;">
																<span v-if="formData_kp[file.code]">{{formData_kp[file.namecode]}}</span>
															</div>
															<div style="float: right; width: 30%;">
																<!-- <div v-if="(notdisabled || isapprovaledit) && formData_kp[file.code] && formData_kp[file.namecode]" class="close_file"
																@click="delFile(file.code, 'kp', file.name, formData_kp)">
																	<i class="el-icon-close" ></i>
																</div> -->
																
																<el-button-group class="fj_button" style="float: right;">
																  <el-button v-if="notdisabled || isapprovaledit" type="primary" size="small" @click="onPopupByUploadFile(file.code,'kp')">上 传</el-button>
																  <el-button type="primary" size="small" @click="showFileImgByFileId(formData_kp[file.code], formData_kp[file.namecode])">预 览</el-button>
																</el-button-group>
															</div>
														</div>
													</el-form-item>
													<div v-if="file.remark" style="margin-left: 140px; font-size: 12px;">
														<span style="color: red;">{{file.remark}}</span>
													</div>
												</template>
											</el-form>
											
											<h-form ref="form_kp" :form-attr="formAttr_kp" 
												:table-fields="tableFields_kp" 
												:form-data="formData_kp" 
												v-on:form-change="formChange_kp"
												>
											</h-form>
										</div>
										<div style="float: right; width: 50%;">
											<div v-if="file_img" style="height: 50%;">
												<div style="margin-left: 30px; font-weight: bold;">
													<el-button v-if="zzimg.id" type="txt" size="small" @click="onDownloadFileByFileId(zzimg.id)">下载附件</el-button>
												</div>
												<el-image v-if="zzimg.url"
													style=" height: 400px; margin-left: 10px;" 
													:src="zzimg.url"
													:preview-src-list="zzimgList"
													fit="contain">
												</el-image>
											</div>
											
											<!-- <h-form ref="form1" :form-attr="formAttr_kp_act" 
												:table-fields="tableFields_kp" 
												:form-data="formData_kp_active" 
												>
											</h-form> -->
										</div>
										
										<!-- <div class="el-dialog__footer" style="border: 0px;">
										  <el-button v-if="notdisabled" type="primary" 
										  @click="saveTabData('kp', formData_kp)">保 存</el-button>
										</div> -->
									</el-tab-pane>
									<!-- <el-tab-pane label="经营范围" name="10">
										<el-form ref="form_zzwl" label-width="130px">
											<el-form-item label="合作伙伴类型:">
												<el-select v-model="bpkind" placeholder="请选择">
												    <el-option
												      v-for="item in bpkind_options"
												      :key="item.value"
												      :label="item.label"
												      :value="item.value"
													  :disabled="!(notdisabled || isapprovaledit)"
													  @change="">
												    </el-option>
												</el-select>
											</el-form-item>
											
											<el-form-item label="经营范围:">
												<el-checkbox-group v-model="zgsp" @change="" :disabled="!(notdisabled || isapprovaledit)">
												    <el-checkbox v-for="(o, k) in zgsp_options" :key="k" :label="o.code">{{o.name}}</el-checkbox>
												</el-checkbox-group>
											</el-form-item>
										</el-form>
									</el-tab-pane> -->
									
									<el-tab-pane label="收货信息" name="3">
										<div style="position: relative; min-height: 100px;">
											<div v-if="notdisabled || isapprovaledit" style="position: absolute; height: 30px; top:10px; right: 20px; z-index: 100;">
												<!-- <el-button-group  style="margin: 0px 20px;float: right;">
													<el-button v-if="notdisabled" type="primary" @click="saveTabData('consignee', tabs_sh)">保 存</el-button>
												</el-button-group> -->
												<el-button-group v-if="notdisabled || isapprovaledit" style="float: right; margin-right: 30px;">
													<el-button @click="addTableData_sh">新增收货</el-button>
												</el-button-group>
											</div>
											<el-tabs v-model="activeTabs_sh" type="card" :closable="notdisabled || isapprovaledit"
											@tab-remove="removeTab_sh">
											  <el-tab-pane
											    v-for="(item_sh, index) in tabs_sh"
											    :key="index"
											    :label="'收货信息' + (index + 1)"
											    :name="index + '_'"
											  >
											  <div class="zs_" style="float:left; width: 50%;">
												  <el-form ref="form_sh" :model="item_sh" label-width="150px">
												  	<template v-for="file in attachment_type_sh">
														<el-form-item  :label="file.name + ':'" :rules="file.rules">
															<div style="width: 100%; min-height: 40px;">
																<div style="float: left; width: 70%; min-height: 35px; border-bottom: 1px solid #ccc ;">
																	<span v-if="item_sh[file.code]">{{item_sh[file.namecode]}}</span>
																</div>
																<div style="float: right; width: 30%;">
																	<!-- <div v-if="(notdisabled || isapprovaledit) && item_sh[file.code] && item_sh[file.namecode]" class="close_file"
																	@click="delFile(file.code, 'sh', file.name, item_sh)">
																		<i class="el-icon-close" ></i>
																	</div> -->
																	
																	<el-button-group class="fj_button" style="float: right;">
																	  <el-button v-if="notdisabled || isapprovaledit" type="primary" size="small" @click="onPopupByUploadFile(file.code, 'sh')">上 传</el-button>
																	  <el-button type="primary" size="small" @click="showFileImgByFileId(item_sh[file.code], item_sh[file.namecode])">预 览</el-button>
																	</el-button-group>
																</div>
															</div>
														</el-form-item>
														<div v-if="file.remark" style="margin-left: 140px; font-size: 12px;">
															<span style="color: red;">{{file.remark}}</span>
														</div>
													</template>
												  </el-form>
												  
												  <h-form ref="form2" :form-attr="formAttr_sh"
												  	:table-fields="tableFields_sh" 
												  	:form-data="item_sh" 
													
													v-on:form-change="formChange_sh"
													v-on:form-checkbox-change="formCheckboxChange_sh"
												  	>
												  </h-form>
											  </div>
											  <div style="float: right; width: 50%;">
												  <div style="margin-left: 30px; font-weight: bold;">
												  	<el-button v-if="zzimg.id" type="txt" size="small" @click="onDownloadFileByFileId(zzimg.id)">下载附件</el-button>
												  </div>
												 <el-image v-if="zzimg.url"
												 	style=" height: 400px; margin-left: 10px;" 
												 	:src="zzimg.url"
													:preview-src-list="zzimgList"
												 	fit="contain">
												 </el-image>
											  </div>
											    
											  </el-tab-pane>
											</el-tabs>
										</div>
										
									</el-tab-pane>
									
									<el-tab-pane label="采购信息" name="4">
										<div style="position: relative; min-height: 100px;">
											<div v-if="notdisabled || isapprovaledit" style="position: absolute; height: 30px; top:10px; right: 20px; z-index: 100;">
												<!-- <el-button-group  style="margin: 0px 20px;float: right;">
													<el-button v-if="notdisabled" type="primary" @click="saveTabData('invoice', tabs_cg)">保 存</el-button>
												</el-button-group> -->
												<el-button-group v-if="notdisabled || isapprovaledit" style="float: right; margin-right: 30px;">
													<el-button @click="addTableData_cg">新增采购</el-button>
												</el-button-group>
											</div>
											<el-tabs v-model="activeTabs_cg" type="card" :closable="notdisabled || isapprovaledit"
												@tab-remove="removeTab_cg">
											  <el-tab-pane
												v-for="(item_cg, index) in tabs_cg"
												:key="index"
												:label="'采购信息' + (index + 1)"
												:name="index + '_'"
											  >
												<div class="zs_" style="float:left; width: 50%;">
													<el-form ref="form_cg" :model="item_cg" label-width="130px">
														<template v-for="file in attachment_type_cg">
															<el-form-item :label="file.name + ':'" :rules="file.rules">
																<div style="width: 100%; min-height: 40px;">
																	<div style="float: left; width: 70%; min-height: 35px; border-bottom: 1px solid #ccc ;">
																		<span v-if="item_cg[file.code]">{{item_cg[file.namecode]}}</span>
																	</div>
																	<div style="float: right; width: 30%;">
																		<!-- <div v-if="(notdisabled || isapprovaledit) && item_cg[file.code] && item_cg[file.namecode]" class="close_file"
																		@click="delFile(file.code, 'cg', file.name, item_cg)">
																			<i class="el-icon-close" ></i>
																		</div> -->
																		
																		<el-button-group class="fj_button" style="float: right;">
																		  <el-button v-if="notdisabled || isapprovaledit" type="primary" size="small" @click="onPopupByUploadFile(file.code, 'cg')">上 传</el-button>
																		  <el-button type="primary" size="small" @click="showFileImgByFileId(item_cg[file.code], item_cg[file.namecode])">预 览</el-button>
																		</el-button-group>
																	</div>
																</div>
															</el-form-item>
															<div v-if="file.remark" style="margin-left: 140px; font-size: 12px;">
																<span style="color: red;">{{file.remark}}</span>
															</div>
														</template>
													</el-form>
													
												  <h-form :form-attr="formAttr_cg"
													:table-fields="tableFields_cg" 
													:form-data="item_cg" 
													v-on:form-change="formChange_cg"
													
													v-on:form-checkbox-change="formCheckboxChange_cg"
													>
												  </h-form>
												</div>
												<div style="float: right; width: 50%;">
													<div style="margin-left: 30px; font-weight: bold;">
														<el-button v-if="zzimg.id" type="txt" size="small" @click="onDownloadFileByFileId(zzimg.id)">下载附件</el-button>
													</div>
													<el-image v-if="zzimg.url"
														style=" height: 400px; margin-left: 10px;" 
														:src="zzimg.url"
														:preview-src-list="zzimgList"
														fit="contain">
													</el-image>
												</div>
											  </el-tab-pane>
											</el-tabs>
										</div>
									</el-tab-pane>
									
									<el-tab-pane label="质保协议" name="5">
										<div class="zs_" style="float:left; width: 50%;">
											<el-form ref="form_zb" :model="file_zs" label-width="130px">
												<template v-for="file in attachment_type_zb">
														<el-form-item :label="file.name + ':'" :rules="file.rules">
															<div style="width: 100%; min-height: 40px;">
																<div style="float: left; width: 70%; min-height: 35px; border-bottom: 1px solid #ccc ;">
																	<span v-if="file_zs[file.code]">{{file_zs[file.code].file_name}}</span>
																</div>
																<div style="float: right; width: 30%;">
																	<!-- <div v-if="(notdisabled || isapprovaledit) && file_zs[file.code] && file_zs[file.code].file_name" class="close_file"
																	@click="delFile(file.code, 'zb', file.name, file_zs[file.code])">
																		<i class="el-icon-close" ></i>
																	</div> -->
																	
																	<el-button-group class="fj_button" style="float: right;">
																	  <el-button v-if="notdisabled || isapprovaledit" type="primary" size="small" @click="onPopupByUploadFile(file.code, 'zz')">上 传</el-button>
																	  <el-button type="primary" size="small" @click="showFileImg(file.code)">预 览</el-button>
																	</el-button-group>
																</div>
															</div>
														</el-form-item>
														
														<el-form-item label="质保协议有效期:">
															<el-date-picker
																:disabled="!(notdisabled || isapprovaledit)"
																@change="formChange_zb"
																style="width: 100%;"
															    v-model="file_zs[file.code].license_term"
															    type="date"
															    placeholder="有效期至"
															    format="yyyy-MM-dd"
																value-format="yyyy-MM-dd"
																>
															</el-date-picker>
														</el-form-item>
												</template>
											</el-form>
										</div>
										
										<div style="float: right; width: 50%;">
											<div style="height: 50%;">
												<div style="margin-left: 30px; font-weight: bold;">
													<el-button v-if="zzimg.id" type="txt" size="small" @click="onDownloadFileByFileId(zzimg.id)">下载附件</el-button>
												</div>
												<el-image v-if="zzimg.url"
													style=" height: 400px; margin-left: 10px;" 
													:src="zzimg.url"
													:preview-src-list="zzimgList"
													fit="contain">
												</el-image>
											</div>
										</div>
									</el-tab-pane>
									<el-tab-pane v-if="!isDistributor" label="纸质物流信息" name="6">
										<el-form ref="form_zzwl" label-width="130px">
											<el-form-item label="物流公司:">
												<el-input :disabled="!(notdisabled || isapprovaledit)" v-model="logistics_company" @change="formChange_wl"></el-input>
											</el-form-item>
											<el-form-item label="运单号:">
												<el-input :disabled="!(notdisabled || isapprovaledit)" v-model="logistics_no" @change="formChange_wl"></el-input>
											</el-form-item>
										</el-form>
									</el-tab-pane>
									<el-tab-pane v-if="acctObj.cer_status && acctObj.cer_status != 'input' && !isDistributor"  label="纸质文件确认" name="7">
										<el-switch
											disabled
										  v-model="logistics_check"
										  active-text="已确认"
										  inactive-text="未确认">
										</el-switch>
									</el-tab-pane>
								</el-tabs>
							</div>
							
							<div style="height: 200px; border-top: 15px">
								<div style="width: 100%; height: 100%; border: 0px;">
									<div class="topbar" style="padding-left: 13px;">
										<span style="font-size: 16px; color: rgb(96, 98, 102);">审批记录</span>
										
										<div style="float: right; margin-right: 20px;">
											<el-button-group>
												<el-button @click="">查看流程图</el-button>
											</el-button-group>
										</div>
									</div>
									<div class="versionNo">
										<h-table
											:table-fields="tableFields3" 
											:table-data="tableData3" 
											:table-height="tableHeight"
											:isdraggableorder="true"
											:is-pagination="false"
										>
										</h-table>
										
									</div>
								</div>
							</div>
						</div>
					</div>
					<div v-if="showRowEdit" class="el-dialog_footer">
						<el-button type="default" @click="closeDialog">取 消</el-button>
						<el-button type="primary" @click="saveTables" :loading="loading_save">保 存</el-button>
						<el-button-group style="margin: 0px 20px;">
							<el-button type="success" @click="onpassApproval">再次提交</el-button>
							<el-button type="danger" @click="onrefuseApproval">撤 销</el-button>
						</el-button-group>
					</div>
					
					<div v-else-if="!showRowEdit" class="el-dialog_footer">
						<el-button-group v-if="approval" style="margin: 0px 20px;">
							<el-button @click="onShowApproval">审批记录</el-button>
						</el-button-group>
						<el-button-group v-if="approval" style="margin: 0px 20px;">
							<el-button @click="onreturnApproval">退 回</el-button>
						</el-button-group>
						<el-button-group v-if="approval" style="margin: 0px 20px;">
							<el-button type="success" @click="onpassApproval">通 过</el-button>
						</el-button-group>
						<el-button-group v-if="approval" style="margin: 0px 20px;">
							<el-button type="danger" @click="onrefuseApproval">拒 绝</el-button>
						</el-button-group>
						<el-button v-if="close && !fromDing" type="default" @click="closeDialog">取 消</el-button>
						<el-button v-if="!close && !fromDing" type="default" @click="closeDialog">å…³ é—­</el-button>
						<el-button v-if="notdisabled" type="primary" @click="saveTables" :loading="loading_save">保 存</el-button>
						<el-button v-if="notdisabled && formData_jc.id" type="primary" @click="submitRowTable" :loading="loading_submit">提 交</el-button>
					</div>
					
				</div>
				
				<el-dialog title="填写原因" :visible.sync="reasonvisible" height="50%">
					<el-input
					  type="textarea"
					  :autosize="{ minRows: 2, maxRows: 10}"
					  placeholder="请输入原因"
					  v-model="textarea2">
					</el-input>
					<el-button type="primary" size="small" @click="onPopupByUploadFileAll()">上传附件</el-button>
					<span> {{attachment_name}}</span>
					
					<div slot="footer" class="dialog-footer" >
					  <el-button type="default" @click="reasonvisible = false">取 消</el-button>
					  <el-button type="primary" @click="saveReason" :loading="loading_approval">确 定</el-button>
					</div>
				</el-dialog>
				
			</div>
			
			
			<div id="page_loading" style="position: absolute; top:0px; width: 100vw; height: 100vh;">
				<div class="spinner">
				  <div class="cube1"></div>
				  <div class="cube2"></div>
				</div>
			</div>
		</div>	
		
		<script type="text/javascript">
			new ListVue({
				el: "#vbody",
				data: {
					title: "",
					disabled: false,
					notdisabled: true,
					approval:false,
					isapprovaledit: false,
					
					loading_save: false,
					loading_submit: false,
					loading_approval: false,
					
					form_dataname: "salesOrder",
					
					//filterFieldsName: "customer_acct",
					formFieldsName: "customer_factory",
					tabaleFieldsName: "customer_factory_licence",
					
					rolecode: window.top.userinfo.user.rolecode,
					showform: true,
					formAttr_jc: {
						title: "商业基本信息",
						istitle: true,
						columnnumber: 3,
						labelwidth: "100px",
						labelposition: "left", //"right",
						size: "medium",
						border: "0px solid #c6c6c600",
						disabled: true
					},
					formFields_jc: [],
					isOldContrast: false,
					formDataOld: {},
					
					formData_jc: {},
					formFields_jcObj: {},
					tableFields_cj: [],
					tableFields_cjObj: {},
					tableData2: [],
					tableHeight: 120,
					isRefresh: true,
					selectFormField: {},
					close:true,
					productDetail: [],
					
					reasonvisible:false,
					textarea2: '',
					attachment: "",
					attachment_name: "",
					
					passOrRefuse:false,
					
					issubmit: false,
					type_act: "",
					
					// 发货主体信息字段
					formAttr_jc: {
						title: "发货主体信息",
						istitle: true,
						columnnumber: 3,
						labelwidth: "100px",
						labelposition: "left", //"right",
						size: "medium",
						border: "0px solid #c6c6c600",
						disabled: true
					},
					formFields2: [
					    {isshow: "T", field: "delivery_part", name: "发货主体", type: "input", required: true,},
					],
					formData2: {},
					
					/////////////
					popupParames: {},
					dataRequest: [
						{
							isClientMode: false,
							code: "code",
							label: "name",
							name: "hierarchy",
							filter: "long_code like '01!0101!010102!010102628!01010218!20210420-0001%'"
						},
						{
							isClientMode: false,
							code: "code",
							label: "name",
							name: "division_level1",
							filter: " level='1' and active='1'"
						},
						{
							isClientMode: false,
							code: "code",
							label: "name",
							name: "deliveryOrganizationOpen",
						},
						{
							isClientMode: false,
							code: "code",
							label: "value",
							name: "dictitem",
							filter: " parent_id='customer_part'"
						},
						
						{
							isClientMode: false,
							isnotoption: true,//不是选择项的预加载
							code: "code",
							label: "value",
							name: "roleEditAble",
							filter: " type='accountCustomerCertification'"
						},
						
						{
							isClientMode: false,
							isnotoption: true,//不是选择项的预加载
							code: "code",
							label: "value",
							name: "customerRequiredByRoleid",
							dataname: "getCustomerRequiredByRoleid",
							filter: "1=1",
							url: "root/data/procedure",
							paramObjBydefault: {
								returnType: "entityset",
								role_id: window.top.roleid_str.replace(/;/g,"','")
							}
						},
						
					],
					dataRequestObj: {},
					customerRequiredByRoleid: [],
					customerRequiredByRoleidTypeObj: {},
					customerRequiredByRoleidTypeList: {},
					
					//////////////////
					//////资质信息
					//公用信息
					oldQualifications: {},
					newQualifications: {},
					
					showRowEdit: false,
					activeNames: "1",
					file_img: false,
					file_txt: false,
					zzimg: {},
					zzimgList: [],
					
					formAttr_zz: {
						istitle: false,
						title: "证照详情",
						columnnumber: 1,
						labelwidth: "150px",
						labelposition: "right",
						size: "medium",
						border: "3px solid #c6c6c600",
						
						formatter: function(data, fields) {
							
						}
					},
					
					attachment_type_kp: [
						{code: "prove_file_id", name: "银行开户证明", namecode: "prove_file_name"},//, rules: [{required: true, message: "请上传银行开票证明", trigger: "blur" }]
						{code: "invoice_file_id", name: "开票资料", namecode: "invoice_file_name", remark: "银行开户证明和开票资料至少上传一个"},
					],
					
					formAttr_kp: {
						istitle: false,
						title: "开票信息",
						columnnumber: 1,
						labelwidth: "130px",
						labelposition: "right",
						size: "medium",
						border: "3px solid #c6c6c600",
						
						formatter: function(data, fields) {
							
						}
					},
					formAttr_kp_act: {
						istitle: true,
						title: "有效开票信息",
						columnnumber: 1,
						labelwidth: "150px",
						labelposition: "right",
						size: "medium",
						border: "3px solid #c6c6c600",
						disabled: true,
						formatter: function(data, fields) {
							
						}
					},
					formAttr: {
						istitle: false,
						title: "开票信息",
						columnnumber: 1,
						labelwidth: "150px",
						labelposition: "right",
						size: "medium",
						border: "3px solid #c6c6c600",
						
						formatter: function(data, fields) {
							
						}
					},
					formAttr_sh: {
						istitle: false,
						title: "收货信息",
						columnnumber: 1,
						labelwidth: "130px",
						labelposition: "right",
						size: "medium",
						border: "3px solid #c6c6c600",
						
						formatter: function(data, fields) {
							
						}
					},
					formAttr_cg: {
						istitle: false,
						title: "采购信息",
						columnnumber: 1,
						labelwidth: "130px",
						labelposition: "right",
						size: "medium",
						border: "3px solid #c6c6c600",
						
						formatter: function(data, fields) {
							
						}
					},
					attachment_type_zzobj: {},
					
					//1.证照
					del_zz: [],
					file_zs: {},
					file_zs_old: {},
					attachment_type_zs: [],
					tableFields_zz: [
						{isshow: "T", field: "num", name: "序号"},
						{isshow: "T", field: "licence_date", name: "发证日期", type: "date"},
						{isshow: "T", field: "ia", name: "发证机构"},
						{isshow: "T", field: "license_term", name: "失效日期", type: "date"},
						{isshow: "T", field: "scope", name: "范围", type: "textarea", textarearows: 10, maxlength: 1000},
					],
					selectZZType: "ZGL01",
					selectZZName: "",
					
					filetypeMappin: {
						"ZGL01": {
							"num": "RegNum",
							"scope": "Business",
							"licence_date": "SetDate",
							"license_term": "Period"
						},
						"ZGL03": {
							"num": "num",
							"scope": "scope",
							"licence_date": "licence_date",
							"license_term": "license_term"
						},
						"ZGL06": {
							"num": "num",
							"scope": "scope",
							"licence_date": "licence_date",
							"license_term": "license_term"
						},
					},
					
					//2.开票
					formData_kp: {},
					formData_kp_old: {},
					formData_kp_active: {},
					tableFields_kp: [
						{isshow: "T", field: "bank_name", name: "开户银行", align: "center", required: true},
						{isshow: "T", field: "bank_account", name: "银行帐户", align: "center", required: true},
						{isshow: "T", field: "bank_account_name", name: "帐户名称", align: "center", width: "100", required: true},
						{isshow: "T", field: "bank_address", name: "开票地址", align: "center", width: "100", required: true},
						{isshow: "T", field: "bank_tel", name: "开票电话", align: "center", required: true},
					],
					
					//3.æ”¶è´§
					activeTabs_sh: "",
					tabs_sh: [
						{code: "t1"},
						{code: "t2"},
					],
					tabs_sh_old: [],
					tabs_sh_old_obj: {},
					tabsobj_sh: {},
					attachment_type_sh: [
						{code: "book_file_id", name: "授权委托书", namecode: "book_name", 
						remark: "需包含收件人身份证复印件",
						rules: [{required: true, message: "请上传授权委托书", trigger: "blur" }]},
						//{code: "id_card_file_id", name: "收货人身份证复印件", namecode: "id_card_name", rules: [{required: true, message: "请上传收货人身份证复印件", trigger: "blur" }]}
					],
					file_sh: {},
					tableFields_sh: [
						{isshow: "T", field: "emp_name", name: "收货人", align: "center", required: true},
						{isshow: "T", field: "address", name: "收货地址", align: "center", required: true},
						{isshow: "T", field: "emp_tel", name: "联系电话", align: "center", width: "100", required: true},
						{isshow: "T", field: "license_term", name: "委托书有效期", align: "center", type: "date"},
						{isshow: "T", field: "product_desc", name: "授权品种描述", align: "center"},
						{isshow: "T", field: "city", name: "收货城市", align: "center"},
						{isshow: "T", field: "id_card", name: "身份证号", align: "center"},
						{isshow: "T", field: "id_card_term", name: "身份证有效期", align: "center", type: "date", ischeckbox: "islongterm", checkbox_text: "长期"},
						{isshow: "T", field: "emp_email", name: "联系人邮箱", align: "center"}
					],
					default_form_sh: {
						emp_name: "",
						address: "",
						emp_tel: "",
						license_term: "",
						product_desc: "",
						city: "",
						id_card: "",
						id_card_term: "",
						emp_email: "",
						create_operate_id: localStorage.getItem("emp_id")
					},
					formData_sh: {
						islongterm: false,
					},
					//4.采购
					activeTabs_cg: "",
					tabs_cg: [
						{code: "t1"},
						{code: "t2"},
					],
					tabs_cg_old: [],
					tabs_cg_old_obj: {},
					attachment_type_cg: [
						{code: "book_file_id", name: "采购授权委托书", namecode: "book_name", 
						remark: "法人授权采购委托书原件应对应采购员的身份证、毕业证复印件(药学相关专业中专以上学历),委托书中应注明委托区域、品种、期限",
						rules: [{required: true, message: "请上传采购授权委托书", trigger: "blur" }]},
						//{code: "id_card_file_id", name: "采购员身份证", namecode: "id_card_name", rules: [{required: true, message: "请上传采购员身份证", trigger: "blur" }]},
						//{code: "diploma_file_id", name: "采购员毕业证", namecode: "diploma_name", rules: [{required: true, message: "请上传采购员毕业证", trigger: "blur" }]}
					],
					
					file_cg: {},
					tableFields_cg: [
						{isshow: "T", field: "license_term", name: "委托书有效期", align: "center", type: "date"},
						{isshow: "T", field: "product_desc", name: "授权品种描述", align: "center"},
						{isshow: "T", field: "area", name: "区域", align: "center"},
						{isshow: "T", field: "purchase_name", name: "采购人", align: "center"},
						{isshow: "T", field: "purchase_tel", name: "联系电话", align: "center"},
						{isshow: "T", field: "id_card_num", name: "身份证号", align: "center"},
						{isshow: "T", field: "id_card_term", name: "身份证有效期", align: "center", type: "date", ischeckbox: "islongterm", checkbox_text: "长期"},
						{isshow: "T", field: "purchase_email", name: "联系人邮箱", align: "center"},
					],
					default_form_cg: {
						license_term: "",
						product_desc: "",
						area: "",
						purchase_name: "",
						purchase_tel: "",
						id_card_num: "",
						id_card_term: "",
						purchase_email: "",
						create_operate_id: localStorage.getItem("emp_id")
					},
					formData_cg: {
						islongterm: false,
					},
					
					//5.质保
					del_zb: [],
					file_zb: {},
					attachment_type_zb: [],
					
					//6.纸质物流
					logistics_company: "",
					logistics_no: "",
					logistics_company_old: "",
					logistics_no_old: "",
					//7.纸质确认
					logistics_check: false,
					
					//10.经营范围
					bpkind: "",
					bpkind_options: [
						{value: "BUC",label: "经销企业"},
						{value: "BUM",label: "生产、经销企业"},
						{value: "CDC",label: "疾控中心"},
						{value: "CTM",label: "临床试验机构"},
						{value: "HPF",label: "非营利医院"},
						{value: "HPT",label: "营利医院"},
						{value: "MNF",label: "生产企业"},
						{value: "OTH",label: "å…¶ä»–"},
						{value: "PHC",label: "连锁药房"},
						{value: "PHI",label: "单体药房"}
					],
					zgsp: [],
					zgsp_options: [
						{code: "D-01",name: "中药饮片"},
						{code: "D-02",name: "中成药"},
						{code: "D-03",name: "抗生素制剂"},
						{code: "D-04",name: "化学药制剂"},
						{code: "D-05",name: "化学原料药"},
						{code: "D-06",name: "生化药品"},
						{code: "D-07",name: "生物制品"},
						{code: "D-08",name: "第二类精神药品"},
						{code: "D-09",name: "药品类体外诊断试剂"},
						{code: "D-10",name: "ç–«è‹—"},
						{code: "D-11",name: "蛋白同化制剂"},
						{code: "D-12",name: "肽类激素"},
						{code: "D-13",name: "含麻黄碱类复方制剂"},
						{code: "D-14",name: "中药材"},
						{code: "D-15",name: "抗生素原料药"},
						{code: "D-16",name: "麻醉药品"},
						{code: "D-17",name: "第一类精神药品"},
						{code: "D-18",name: "医疗用毒性药品"},
						{code: "D-19",name: "放射性药品"},
						{code: "D-20",name: "终止妊娠药品"},
						{code: "D-21",name: "蛋肽类(除胰岛素)"},
						{code: "D-22",name: "药品类易制毒化学品"},
						{code: "D-23",name: "胰岛素"}
					],
					
					acctObj: {},
					isnotcer: false,//是否没有资质,false值是存在资质
					isDistributor: false,
					fromDing: false,
					dingResult: false,
					dingResultTxt: "",

					// 审批
					tableFields3: [
							{isshow: "T", field: "field1", name: "当前节点", width: "150", type:"span", required: true},
							{isshow: "T", field: "field2", name: "申请/审批时间", width: "100", type:"span", formatter: "formatter_date", required: true, isminwidth: true,},
							{isshow: "T", field: "field3", name: "审批情况", width: "150", type:"span", formatter: "formatter_date", required: true, isminwidth: true,},
							{isshow: "T", field: "field4", name: "原因", width: "150", type: "span", required: true, isminwidth: true,},
							{isshow: "T", field: "field5", name: "申请/审批人", width: "150", type:"span", required: true, isminwidth: true,}, 
							{isshow: "T", field: "field6", name: "附件", width: "200", type:"span", required: true, isminwidth: true,}, 
					],
					tableData3: [],
					t_height: null,
				},
				
				created() {
					var me = this;
					this.isDistributor = localStorage.getItem("isdistributor") ? true : false;
					
					this.popupParames = clone(Root.popupParames);
					if (this.popupParames.delta) {
						let  formData1= clone(this.popupParames.delta);
						//this.formData_jc = formData1;
						//this.getInitOption();
					}
					if (this.popupParames.data) {
						var tableData2_ = [];
						let  formData1= clone(this.popupParames.data);
						tableData2_.push(formData1);
						this.tableData2 = tableData2_;
						
						this.acctObj = formData1;
						
						this.logistics_company = this.acctObj.cer_logistics_company;
						this.logistics_no = this.acctObj.cer_logistics_n;
						
						this.logistics_company_old = clone(this.logistics_company);
						this.logistics_no_old = clone(this.logistics_no);
						
						this.logistics_check = this.acctObj.cer_logistics_check ? true : false;
						
						if (!this.acctObj.cer_id) {
							this.isnotcer = true;
							this.acctObj.cer_id = uuid_short();
						}
						
						/* if(this.acctObj.customer_id) {
							this.getInfoForm();//商业信息
							this.getInfoKP();//开票信息
							this.getInfoSH();//收货信息
							this.getInfoCG();//采购信息
							//this.getInfoWL();//纸质物流信息
							//this.getInfoQR();//纸质确认信息
							
							//this.getTableDelivery();
						}
						else {
							this.getInitOption();
						} */
					}
					
					if (this.popupParames.title) {
						this.title = clone(this.popupParames.title);
					}
					
					if (this.popupParames.sceneCode) {
						if (this.popupParames.sceneCode == "browse") {
							this.formAttr.disabled = true;
							this.formAttr_zz.disabled = true;
							
							this.formAttr_sh.disabled = true;
							this.formAttr_cg.disabled = true;
							this.formAttr_kp.disabled = true;
							this.formAttr_kp_act.disabled = true;
							
							this.notdisabled = false;
							this.approval = false;
							this.close = false;
						}
						
						else if (this.popupParames.sceneCode == "acct_version") {//备案变更
						/* 
						tableFields_part: [
							{isshow: "T", field: "delivery_part_code", name: "发货主体", type: "select", options: [], props: {value: "code", label: "name", checkStrictly: true}},
							{isshow: "T", field: "customer_part_code", name: "客户主体", type: "select", options: [], props: {value: "code", label: "value", checkStrictly: true}},
							{isshow: "T", field: "customer_identity", name: "客户身份", type: "select", options: [{code: 1, name: "经销"}, {code: 2, name: "分销"}], props: {value: "code", label: "name", checkStrictly: true}},
							{isshow: "T", field: "business_type", name: "商业属性", type: "select", options: [{code: 1, name: "直管"}, {code: 2, name: "非直管"}], props: {value: "code", label: "name", checkStrictly: true}},
							{isshow: "T", field: "business_operate_name", name: "商业操作人", type: "popup"},
							{isshow: "T", field: "business_operate_code", name: "操作人编码",labelwidth: "130px", disabled: true},
							{isshow: "T", field: "remark", name: "备案原因", required: true},
						],
						
						
						*/
						
							/* this.acctObj.delivery_status = null;
							this.acctObj.old_id = clone(this.acctObj.id);
							this.acctObj.id = null;
							this.acctObj.flow_id = null;
							this.acctObj.freeze = null;
							this.acctObj.create_time = null;
							
							this.showAcctRowEdit = true;
							this.formAttr.disabled = true;
							this.notdisabled = false;
							this.approval = false;
							this.close = false; */
						}
						
						else if (this.popupParames.sceneCode == "acct_refuse") {//备案调整
							this.showAcctRowEdit = true;
							this.formAttr.disabled = true;
							this.notdisabled = false;
							this.approval = false;
							this.close = false;
						}
						else if (this.popupParames.sceneCode == "approval") {
							//根据审批人角色等存在不同的编辑权限
							var roleList_ = localStorage.getItem("roleList");
							this.roleList = JSON.parse(roleList_);
							var roleEditAble_ = me.dataRequestObj.roleEditAble;
							var role_edit = false;
							if (this.roleList.length && roleEditAble_ && roleEditAble_.length) {
								roleEditAble_.map(re=>{
									var role_id = re.r_id;
									this.roleList.map(zre=>{
										if (role_id == zre.id) {
											role_edit = true;
											return
										}
									})
									
									if(role_edit) {
										return
									}
								});
							}
							
							if (role_edit) {
								this.formAttr.disabled = false;
								if (this.acctObj.md_code) {//非首次,仅单项保存
									this.notdisabled = false;
									this.approval = true;
								
									this.showRowSave = true;
								}
								else {//首次,可批量保存
									this.notdisabled = false;
									this.approval = true;
									this.showRowSave = true;
								}
								
							}
							else {
								this.formAttr.disabled = true;
								this.formAttr_zz.disabled = true;
								this.formAttr_kp.disabled = true;
								this.formAttr_kp_act.disabled = true;
								this.formAttr_sh.disabled = true;
								this.formAttr_cg.disabled = true;
								
								
								this.notdisabled = false;
								this.approval = true;
								this.close = false;
								if(this.popupParames.disabledone){
									this.seal = true
								}
							}
							
							/* if(this.popupParames.disabledone){
								this.seal = true
							} */
						}
						else if (this.popupParames.sceneCode == "add") {
						}
						
						else if (this.popupParames.sceneCode == "licence_version") {//资质变更
							//this.acctObj.cer_id = uuid_short();
							this.getOldQualifications();
						}
						else if (this.popupParames.sceneCode == "refuse") {//资质调整
							this.formAttr.disabled = true;
							this.notdisabled = true;
							this.approval = true;
							this.showRowEdit = true;
						}
						else if (this.popupParames.sceneCode == "acct_refuse") {//备案调整
							this.formAttr.disabled = true;
							this.notdisabled = true;
							this.approval = true;
							this.showRowEdit = true;
						}
						
					}
					
				},
				
				mounted() {
					var me = this;
					me.t_height = document.documentElement.clientHeight*1 - 91;
					if (this.dataRequest.length) {
						var result = {};
						this.loadRequestData(this.dataRequest, result, function(data) {
							me.dataRequestObj = data;
							
							if (me.dataRequestObj.customerRequiredByRoleid) {
								me.customerRequiredByRoleid = clone(me.dataRequestObj.customerRequiredByRoleid)
								
								var customerRequiredByRoleidTypeObj = {};
								var customerRequiredByRoleidTypeList = {};
								me.customerRequiredByRoleid.map(cfr=>{
									if (!customerRequiredByRoleidTypeObj[cfr.type]) {
										customerRequiredByRoleidTypeObj[cfr.type] = {};
										customerRequiredByRoleidTypeList[cfr.type] = [];
									}
									customerRequiredByRoleidTypeObj[cfr.type][cfr.field] = cfr;
									customerRequiredByRoleidTypeList[cfr.type].push(cfr);
								})
								me.customerRequiredByRoleidTypeObj = clone(customerRequiredByRoleidTypeObj);
								me.customerRequiredByRoleidTypeList = clone(customerRequiredByRoleidTypeList);
							}
							
							if (me.popupParames.sceneCode == "approval") {
								//根据审批人角色等存在不同的编辑权限
								var roleList_ = localStorage.getItem("roleList");
								me.roleList = JSON.parse(roleList_);
								var roleEditAble_ = me.dataRequestObj.roleEditAble;
								var role_edit = false;
								if (me.roleList.length && roleEditAble_ && roleEditAble_.length) {
									roleEditAble_.map(re=>{
										var role_id = re.r_id;
										me.roleList.map(zre=>{
											if (role_id == zre.id) {
												role_edit = true;
												return
											}
										})
										
										if(role_edit) {
											return
										}
									});
								}
								
								if (role_edit) {
									
									me.isapprovaledit = true;
									
									me.formAttr_zz.disabled = false;
									me.formAttr_kp.disabled = false;
									me.formAttr_kp_act.disabled = false;
									me.formAttr_sh.disabled = false;
									me.formAttr_cg.disabled = false;
									
									me.showRowSave = true;
									/* me.formAttr.disabled = false;
									if (me.acctObj.md_code) {//非首次,仅单项保存
										me.notdisabled = false;
										me.approval = true;
									
										me.showRowSave = true;
									}
									else {//首次,可批量保存
										me.notdisabled = false;
										me.approval = true;
										me.showRowSave = true;
									} */
								}
								else {
									me.formAttr.disabled = true;
									me.formAttr_zz.disabled = true;
									me.formAttr_kp.disabled = true;
									me.formAttr_kp_act.disabled = true;
									me.formAttr_sh.disabled = true;
									me.formAttr_cg.disabled = true;
									
									me.notdisabled = false;
									me.approval = true;
									me.close = false;
									if(me.popupParames.disabledone){
										me.seal = true
									}
								}
							}
							
							if (me.tableFields_cj.length) {
								var tableFields_ = clone(me.tableFields_cj);
								tableFields_.map(fieldObj_=>{
									if (fieldObj_.field == "delivery_part_code") {
										fieldObj_.options = me.dataRequestObj.deliveryOrganizationOpen;
										fieldObj_.formatterjson = me.dataRequestObj.map.deliveryOrganizationOpen;
									}
									if (fieldObj_.field == "customer_part_code") {
										fieldObj_.options = me.dataRequestObj.dictitem;
										fieldObj_.formatterjson = me.dataRequestObj.map.dictitem;
									}
									//me.tableFields_cjObj[fieldObj_.field] = fieldObj_;
								});
								me.tableFields_cj = tableFields_;
							}
							
							if(me.formFields_jc.length > 0) {
								var formFields_jc_ = clone(me.formFields_jc);
								var requiredFields_business = me.customerRequiredByRoleidTypeObj.business;
								formFields_jc_.map(e=>{
									if (requiredFields_business[e.field] && (requiredFields_business[e.field].is_required == "T" || requiredFields_business[e.field].roleis_required == "T")) {
										e.required = true;
									}
									else if (requiredFields_business[e.field]) {
										e.required = false;
									}
								
									if(e.field == "cus_dep_code") {
										e.options = me.dataRequestObj.hierarchy;
									}
									if(e.field == "record_province") {
										e.options = me.dataRequestObj.division_level1;
									}
									me.formFields_jcObj[e.field] = e;
								});
								me.formFields_jc = formFields_jc_;
							}
							
							if(me.attachment_type_kp.length > 0) {
								var attachment_type_kp_ = clone(me.attachment_type_kp);
								var requiredFields_kp = me.customerRequiredByRoleidTypeObj.licence_kp;
								attachment_type_kp_.map(e=>{
									if (requiredFields_kp[e.code] && (requiredFields_kp[e.code].is_required == "T" || requiredFields_kp[e.code].roleis_required == "T")) {
										//e.required = true;
										e.rules = [];
										let required_ = {
											required: true,
											message: "请输入"+e.name, 
											trigger: "blur" 
										};
										e.rules.push(required_);
									}
									else if (requiredFields_kp[e.code]) {
										//e.required = false;
										e.rules = null;
									}
								})
								me.attachment_type_kp = clone(attachment_type_kp_);
							}
							if(me.tableFields_kp.length > 0) {
								var tableFields_kp_ = clone(me.tableFields_kp);
								var requiredFields_kp = me.customerRequiredByRoleidTypeObj.licence_kp;
								tableFields_kp_.map(e=>{
									if (requiredFields_kp[e.field] && (requiredFields_kp[e.field].is_required == "T" || requiredFields_kp[e.field].roleis_required == "T")) {
										e.required = true;
									}
									else if (requiredFields_kp[e.field]) {
										e.required = false;
									}
								});
								me.tableFields_kp = tableFields_kp_;
							}
							
							if(me.attachment_type_sh.length > 0) {
								var attachment_type_sh_ = clone(me.attachment_type_sh);
								var requiredFields_sh = me.customerRequiredByRoleidTypeObj.licence_sh;
								attachment_type_sh_.map(e=>{
									if (requiredFields_sh[e.code] && (requiredFields_sh[e.code].is_required == "T" || requiredFields_sh[e.code].roleis_required == "T")) {
										//e.required = true;
										e.rules = [];
										let required_ = {
											required: true,
											message: "请输入"+e.name, 
											trigger: "blur" 
										};
										e.rules.push(required_);
									}
									else if (requiredFields_sh[e.code]) {
										//e.required = false;
										e.rules = null;
									}
								})
								me.attachment_type_sh = clone(attachment_type_sh_);
							}
							if(me.tableFields_sh.length > 0) {
								var tableFields_sh_ = clone(me.tableFields_sh);
								var requiredFields_sh = me.customerRequiredByRoleidTypeObj.licence_sh;
								tableFields_sh_.map(e=>{
									if (requiredFields_sh[e.field] && (requiredFields_sh[e.field].is_required == "T" || requiredFields_sh[e.field].roleis_required == "T")) {
										e.required = true;
									}
									else if (requiredFields_sh[e.field]) {
										e.required = false;
									}
								});
								me.tableFields_sh = tableFields_sh_;
							}
							
							if(me.attachment_type_cg.length > 0) {
								var attachment_type_cg_ = clone(me.attachment_type_cg);
								var requiredFields_cg = me.customerRequiredByRoleidTypeObj.licence_cg;
								attachment_type_cg_.map(e=>{
									if (requiredFields_cg[e.code] && (requiredFields_cg[e.code].is_required == "T" || requiredFields_cg[e.code].roleis_required == "T")) {
										//e.required = true;
										e.rules = [];
										let required_ = {
											required: true,
											message: "请输入"+e.name, 
											trigger: "blur" 
										};
										e.rules.push(required_);
									}
									else if (requiredFields_cg[e.code]) {
										//e.required = false;
										e.rules = null;
									}
								})
								me.attachment_type_cg = clone(attachment_type_cg_);
							}
							if(me.tableFields_cg.length > 0) {
								var tableFields_cg_ = clone(me.tableFields_cg);
								var requiredFields_cg = me.customerRequiredByRoleidTypeObj.licence_cg;
								tableFields_cg_.map(e=>{
									if (requiredFields_cg[e.field] && (requiredFields_cg[e.field].is_required == "T" || requiredFields_cg[e.field].roleis_required == "T")) {
										e.required = true;
									}
									else if (requiredFields_cg[e.field]) {
										e.required = false;
									}
								});
								me.tableFields_cg = tableFields_cg_;
							}
							
							
							me.initData();
						});
					}
					else {
						this.initData();
					}
					
					var urlParam = getGetParams(this.popupParames.url);
					
					for(let key in urlParam) {
						if(key == "fromDing") {
							this.fromDing = urlParam[key];
						}
					}
					
					this.$nextTick(() => { // 以服务的方式调用的 Loading 需要异步关闭
						document.getElementById('page_root').style.display =  "block";
						document.getElementById('page_loading').style.display =  "none";
						
						//重新设置弹窗宽高
						this.$nextTick(function(){
							let w_ = this.$refs.popup_body.offsetWidth + "px";
							let h_ = this.$refs.popup_body.offsetHeight + "px";
							Root.setPopupWH(w_, h_);
						})
					});
				},
				
				methods:{
					onServerInitData(data) {
						var me = this.data;
						me.isDistributor = localStorage.getItem("isdistributor") ? true : false;
						me.tableFields_cj = data.tableFields;
						me.filterFields = data.filterFields;
						me.formFields_jc = data.formFields;
						
						me.dataRequestObj = data;
						if(me.filterFields.length > 0) {
							me.filterFields.map(e=>{
								me.filterFieldsObj[e.field] = e;
							});
						}
						
						if(me.formFields_jc.length > 0) {
							me.formFields_jc.map(e=>{
								me.formFields_jcObj[e.field] = e;
								
								if (me.isDistributor) {
									/* 
									 {isshow: "T", field: "cus_dep_code", name: "备案省商务部门",labelwidth: "130px", type: "select", options: [], props: {value: "md_code", label: "md_description", checkStrictly: true}},
									  {isshow: "T", field: "cus_dep_code", name: "省商务部门编码", disabled: true,labelwidth: "130px"},
									  {isshow: "T", field: "operator_code", name: "操作人", disabled: true, required: true,labelwidth: "130px"},
									  {isshow: "T", field: "operator_name", name: "操作人姓名", disabled: true, required: true,labelwidth: "130px"},
									  {isshow: "T", field: "apply_dep_code", name: "操作人部门编码", disabled: true,labelwidth: "130px"},
									  {isshow: "T", field: "apply_dep_name", name: "操作人部门", disabled: true},
									  {isshow: "T", field: "old_code", name: "EAS编码"},
									 */
									var notshowfield = {
										cus_dep_code: true,
										operator_code: true,
										operator_name: true,
										apply_dep_code: true,
										apply_dep_name: true,
										old_code: true
									}
									
									if (notshowfield[e.field]) {
										e.isshow = "F";
									}
								}
								
							});
						}
						
						if(me.tableFields_cj.length > 0) {
							me.tableFields_cj.map(e=>{
								me.tableFieldsObj[e.field] = e;
								/* 
								 {isshow: "T", field: "customer_part_code", name: "客户主体", width: "120"},
								   {isshow: "T", field: "business_type", name: "商业属性", width: "120", formatterjson: "{\"1\": \"直管\", \"2\": \"非直管\"}"},//, \"3\": \"直销\"
								   {isshow: "T", field: "remark", name: "备案原因", align: "left" , width: "320"},
								   {isshow: "T", field: "update_time", name: "æ›´æ–°æ—¶é—´", width: "120", formatter: "formatter_date"},
								 */
								if (me.isDistributor) {
									var notshowfield = {
										customer_part_code: true,
										business_type: true,
										remark: true,
										update_time: true,
									}
									
									if (notshowfield[e.field]) {
										e.isshow = "F";
									}
								}
								
								
								/* if(e.field == "delivery_part_code") {
									e.options = me.dataRequestObj.deliveryOrganizationOpen;
									
									me.dataRequestObj.deliveryOrganizationOpen.map(e=>{
										if (!me.dataRequestObj.map) {
											me.dataRequestObj.map = {};
										}
										if (!me.dataRequestObj.map.deliveryOrganizationOpen) {
											me.dataRequestObj.map.deliveryOrganizationOpen = {};
										}
										me.dataRequestObj.map.deliveryOrganizationOpen[e.code] = e.name;
									})
								}
								if(e.field == "customer_part_code") {
									e.options = me.dataRequestObj.dictitem;
									
									me.dataRequestObj.dictitem.map(e=>{
										if (!me.dataRequestObj.map) {
											me.dataRequestObj.map = {};
										}
										if (!me.dataRequestObj.map.dictitem) {
											me.dataRequestObj.map.dictitem = {};
										}
										me.dataRequestObj.map.dictitem[e.code] = e.value;
									})
								} */
							})
						}
					},
					
					getOldQualifications() {
						let me = this;
						let param_table = {
							isClientMode: false,
							dataname: "agCustomerDeliveryCertification",
							filter: "id='" + this.acctObj.cer_id + "'"
						}
						this.oldQualifications = {};
						Server.call("root/data/getEntitySet", param_table, function(result) {
							console.log(result);
							if (result && result.data) {
								me.oldQualifications = result.data.entityset[0];
								
								var newQualifications_ = {
									id: uuid_short(),
									old_id: clone(me.oldQualifications.id),
									customer_delivery_code: clone(me.acctObj.code),
									customer_delivery_id: clone(me.acctObj.id),
									customer_uscc: clone(me.oldQualifications.customer_uscc),
									delivery_part_code: clone(me.acctObj.delivery_part_code),
									create_time: null,
									update_time: null,
									
									customer_part_code: clone(me.acctObj.customer_part_code),
									business_operate_code: clone(me.acctObj.business_operate_code),
									customer_identity: clone(me.acctObj.customer_identity),
									business_type: clone(me.acctObj.business_type)
								}
								me.newQualifications = newQualifications_;
								//customer_certification_id
							}
						});
						
					},
					
					initData() {
						let me = this;
						this.getAttachmentType();
						
						if(this.acctObj.new_customer_id) {
							this.getInfoForm();//商业信息
							this.getInfoKP();//开票信息
							
							this.getInfoSH();//收货信息
							this.getInfoCG();//采购信息
						}
						else {
							this.getInitOption();
						}
					},
					
					getAttachmentType() {
						let me = this;
						let param_table = {
							isClientMode: false,
							dataname: "attachment_type",
							orderby: "order_no"
						}
						this.attachment_type_zs = [];//证书
						this.attachment_type_zb = [];//质保
						
						
						Server.call("root/data/getEntitySet", param_table, function(result) {
							console.log(result);
							if (result && result.data && result.data.entityset) {
								var attachmentTypes_ = result.data.entityset;
								
								var requiredFields_zz = me.customerRequiredByRoleidTypeObj.licence_zz;
								var requiredFields_zb = me.customerRequiredByRoleidTypeObj.licence_zb;
								attachmentTypes_.map(e=>{
									if(!me.file_zs[e.code]) {
										me.file_zs[e.code] = {};
									}
									if (e.owned_by) {
										if (e.cer_mandatory) {
											e.rules = [];
											let required_ = {
												required: true,
												message: "请上传"+e.name, 
												trigger: "blur" 
											};
											e.rules.push(required_);
										}
										
										if (requiredFields_zz[e.code] && (requiredFields_zz[e.code].is_required == "T" || requiredFields_zz[e.code].roleis_required == "T")) {
											//e.required = true;
											e.rules = [];
											let required_ = {
												required: true,
												message: "请上传"+e.name, 
												trigger: "blur" 
											};
											e.rules.push(required_);
										}
										else if (requiredFields_zz[e.code]) {
											//e.required = false;
											e.rules = null;
										}
										
										
										me.attachment_type_zs.push(e);
									}
									else {
										if (e.cer_mandatory) {
											e.rules = [];
											let required_ = {
												required: true,
												message: "请上传"+e.name, 
												trigger: "blur" 
											};
											e.rules.push(required_);
										}
										
										if (requiredFields_zb[e.code] && (requiredFields_zb[e.code].is_required == "T" || requiredFields_zb[e.code].roleis_required == "T")) {
											//e.required = true;
											e.rules = [];
											let required_ = {
												required: true,
												message: "请上传"+e.name, 
												trigger: "blur" 
											};
											e.rules.push(required_);
										}
										else if (requiredFields_zb[e.code]) {
											//e.required = false;
											e.rules = null;
										}
										
										me.attachment_type_zb.push(e);
									}
									
									me.attachment_type_zzobj[e.code] = e;
									
								});
							}
							me.getInfoZZ();//证照信息
						});
					},
					
					getInfoForm() {
						var me = this;
						var customer_id_ = this.acctObj.new_customer_id;
						
						var dataname_ = "agCustomer";
						let param_ = {
							isClientMode: false,
							dataname: dataname_,
							filter: "id='" + customer_id_ + "'",
						}
						
						Server.call("root/data/getEntitySet", param_, function(result) {
							console.log(result);
							if (result && result.data) {
								var formData_ = result.data.entityset[0];
								me.formData_jc = formData_;
								me.getInitOption();
							}
						});
					},
					
					getInfoZZ() {
						var me = this;
						var customer_uscc_ = this.acctObj.uscc;
						
						var filter_ = "customer_uscc='" + customer_uscc_ + "'";
						var dataname_ = "agCustomerLicence";
						/* if(this.acctObj.customer_id) {
							filter_ = "customer_id='" + this.acctObj.customer_id + "'";
							dataname_ = "customerLicenceMapping";
						} */
						
						let param_ = {
							isClientMode: false,
							dataname: dataname_,
							filter: filter_,
							orderby: "create_time desc"
						}
							//subFilter: "customer_certification_id = '" + this.acctObj.cer_id + "'",
						
						if (this.acctObj.cer_id && !this.isnotcer) {
							param_.subFilter = "customer_certification_id = '" + this.acctObj.cer_id + "'"
						}
						else {
							param_.subFilter = "customer_certification_id is null"
						}
						
						//if(!this.acctObj.cer_id) {
							param_.empId = localStorage.getItem("emp_id");
						//}
						
						Server.call("root/data/getEntitySet", param_, function(result) {
							console.log(result);
							if (result && result.data) {
								//me.licenceList = result.data.entityset;
								var file_zs_ = clone(me.file_zs);
								result.data.entityset.map(e=>{
									file_zs_[e.type] = e;
								});
								
								me.attachment_type_zb.map(zb=>{
									if (!file_zs_[zb.code]) {
										file_zs_[zb.code] = {}
									}
								});
								
								me.file_zs = file_zs_;
								me.file_zs_old = clone(me.file_zs);
								
							}
						});
					},
					
					getInfoKP() {
						var me = this;
						var customer_uscc_ = this.acctObj.uscc;
						
						var filter_ = "customer_uscc='" + customer_uscc_ + "'";
						var dataname_ = "agCustomerInvoice";
						let param_ = {
							isClientMode: false,
							dataname: dataname_,
							filter: filter_,
							orderby: "create_time desc"
						}
						
						if (this.acctObj.cer_id && !this.isnotcer) {
							param_.subFilter = "customer_certification_id = '" + this.acctObj.cer_id + "'"
						}
						else {
							param_.subFilter = "customer_certification_id is null"
						}
						
						param_.empId = localStorage.getItem("emp_id");
						
						Server.call("root/data/getEntitySet", param_, function(result) {
							console.log(result);
							if (result && result.data && result.data.entityset && result.data.entityset.length) {
								var formData_kp_ = result.data.entityset[0];
								me.formData_kp = formData_kp_;
								me.formData_kp_old = clone(me.formData_kp);
								/* if (!formData_kp_.customer_certification_id) {
									me.formData_kp_active = clone(formData_kp_);
								}
								else {
									var filter_1 = "customer_uscc='" + customer_uscc_ + "' and active=1";
									var dataname_1 = "customerInvoiceMapping";
									
									let param_1 = {
										isClientMode: false,
										dataname: dataname_1,
										filter: filter_1,
									}
									
									Server.call("root/data/getEntitySet", param_1, function(result1) {
										console.log(result);
										me.formData_kp_active = clone(result1.data.entityset[0]);
									})
								} */
								
							}
							
						});
					},
					
					getInfoSH() {
						var me = this;
						var customer_uscc_ = this.acctObj.uscc;
						
						var filter_ = "1=1";
						// if (this.acctObj.cer_id) {
						// 	filter_ += " and customer_certification_id = '" + this.acctObj.cer_id + "'";
						// }
						
						if (this.popupParames.sceneCode == "approval" || this.popupParames.sceneCode == "browse") {
							filter_ += " and cm.customer_uscc='" + this.acctObj.uscc +
							"' and cm.delivery_part_code='" + this.acctObj.delivery_part_code + 
							
							"' and cm.customer_part_code='" + this.acctObj.customer_part_code + 
							"' and cm.business_operate_code='" + this.acctObj.business_operate_code + 
							"' and cm.customer_identity='" + this.acctObj.customer_identity + 
							"' and cm.business_type='" + this.acctObj.business_type + 
							
							"' and ((cdpm.active = 1 AND cdpm.used = 1) OR (cdpm.used = 1 AND cdpm.active = 0 AND cdpm.customer_certification_id = '"+ this.acctObj.cer_id +"' ))";
						}
						else {
							filter_ += " and cm.customer_uscc='" + this.acctObj.uscc +
							"' and cm.delivery_part_code='" + this.acctObj.delivery_part_code + 
							
							"' and cm.customer_part_code='" + this.acctObj.customer_part_code + 
							"' and cm.business_operate_code='" + this.acctObj.business_operate_code + 
							"' and cm.customer_identity='" + this.acctObj.customer_identity + 
							"' and cm.business_type='" + this.acctObj.business_type + 
							
							"' and ((cdpm.active = 1 AND cdpm.used = 1) OR (cdpm.used = 1 AND cdpm.active = 0 AND (cdpm.create_operate_id = '"+ localStorage.getItem("emp_id") +"' or cdpm.create_operate_code = '"+ localStorage.getItem("emp_code") +"')  ))";
						}
						
						var dataname_ = "agCustomerDeliveryConsignee";
						let param_ = {
							isClientMode: false,
							dataname: dataname_,
							filter: filter_,
							orderby: "order_no"
						}
						/* if (this.acctObj.cer_id) {
							param_.subFilter = "customer_certification_id = '" + this.acctObj.cer_id + "'"
						}
						else {
							param_.subFilter = "customer_certification_id = null"
						} */
						me.tabs_sh = [];
						Server.call("root/data/getEntitySet", param_, function(result) {
							console.log(result);
							if (result && result.data && result.data.entityset && result.data.entityset.length) {
								me.activeTabs_sh = "0_";
								me.tabs_sh = result.data.entityset;
								me.tabs_sh_old = clone(me.tabs_sh);
								
								result.data.entityset.map(e=>{
									me.tabs_sh_old_obj[e.id] = clone(e);
									//me.tabsobj_sh[e.type] = e;
								});
								
							}
							
							else {
								var form_sh = clone(me.default_form_sh);
								me.tabs_sh.push(form_sh);
								me.tabs_sh_old = [];
								me.activeTabs_sh = "0_";
							}
						});
						
					},
					getInfoCG() {
						var me = this;
						var customer_uscc_ = this.acctObj.uscc;
						
						var filter_ = "1=1";
						// if (this.acctObj.cer_id) {
						// 	filter_ += " and customer_certification_id = '" + this.acctObj.cer_id + "'";
						// }
						/* 
						 customer_part_code: this.acctObj.customer_part_code,
						 business_operate_code: this.acctObj.business_operate_code,
						 customer_identity: this.acctObj.customer_identity,
						 business_type: this.acctObj.business_type
						 
						 */
						
						if (this.popupParames.sceneCode == "approval" || this.popupParames.sceneCode == "browse") {
							filter_ += " and cm.customer_uscc='" + this.acctObj.uscc +
							"' and cm.delivery_part_code='" + this.acctObj.delivery_part_code + 
							
							"' and cm.customer_part_code='" + this.acctObj.customer_part_code + 
							"' and cm.business_operate_code='" + this.acctObj.business_operate_code + 
							"' and cm.customer_identity='" + this.acctObj.customer_identity + 
							"' and cm.business_type='" + this.acctObj.business_type + 
							
							"' and ((cdpm.active = 1 AND cdpm.used = 1) OR (cdpm.used = 1 AND cdpm.active = 0 AND cdpm.customer_certification_id = '"+ this.acctObj.cer_id +"' ))";
						}
						else {
							filter_ += " and cm.customer_uscc='" + this.acctObj.uscc +
							"' and cm.delivery_part_code='" + this.acctObj.delivery_part_code + 
							
							"' and cm.customer_part_code='" + this.acctObj.customer_part_code + 
							"' and cm.business_operate_code='" + this.acctObj.business_operate_code + 
							"' and cm.customer_identity='" + this.acctObj.customer_identity + 
							"' and cm.business_type='" + this.acctObj.business_type + 
							
							"' and ((cdpm.active = 1 AND cdpm.used = 1) OR (cdpm.used = 1 AND cdpm.active = 0 AND (cdpm.create_operate_id = '"+ localStorage.getItem("emp_id") +"' or cdpm.create_operate_code = '"+ localStorage.getItem("emp_code") +"') ))";
						}
						var dataname_ = "agCustomerDeliveryProcure";
						let param_ = {
							isClientMode: false,
							dataname: dataname_,
							filter: filter_,
							orderby: "order_no"
						}
						/* if (this.acctObj.cer_id) {
							param_.subFilter = "customer_certification_id = '" + this.acctObj.cer_id + "'"
						}
						else {
							param_.subFilter = "customer_certification_id = null"
						} */
						me.tabs_cg = [];
						Server.call("root/data/getEntitySet", param_, function(result) {
							console.log(result);
							if (result && result.data && result.data.entityset && result.data.entityset.length) {
								me.activeTabs_cg = "0_";
								me.tabs_cg = result.data.entityset;
								me.tabs_cg_old = clone(me.tabs_cg);
								result.data.entityset.map(e=>{
									me.tabs_cg_old_obj[e.id] = clone(e);
									//me.tabsobj_sh[e.type] = e;
								});
							}
							
							else {
								var form_cg = clone(me.default_form_cg);
								me.tabs_cg.push(form_cg);
								me.tabs_cg_old = [];
								me.activeTabs_cg = "0_";
								
							}
						});
					},
					/* getInfoWL() {
						
					},
					getInfoQR() {
						
					}, */
					
					/* getTableDelivery() {
						var me = this;
						var customer_uscc_ = this.acctObj.uscc;
						
						var filter_ = "customer_uscc='" + customer_uscc_ + "'";
						var dataname_mapping = "agCustomerDeliveryLine";//"delivery_mapping";
						if(this.acctObj.customer_id) {
							filter_ = "id='" + this.acctObj.id + "'";
							dataname_mapping = "agCustomerDelivery";//"delivery_mapping";
						}
						
						let param_table = {
							isClientMode: false,
							dataname: dataname_mapping,
							filter: filter_,
						}
						if(!this.acctObj.customer_id) {
							param_table.empId = localStorage.getItem("emp_id");
						}
						
						me.tableData2 = [];
						me.tableloading = true;
						Server.call("root/data/getEntitySet", param_table, function(result_) {
							me.tableloading = false;
							console.log(result_);
							if (result_ && result_.data) {
								me.tableData2 = result_.data.entityset;
							}
						});
					},
					 */
					getInitOption() {
						var me = this;
						this.formFields_jc.map(e=>{
							if (e.type == "select" && e.options && e.options.length == 0 && this.formData_jc[e.field]) {
								if (e.field == "country") {
									let param_ = {
										isClientMode: false,
										filter: " level='0' and active='1' and code='" + this.formData_jc[e.field] + "'",
									}
									Server.call("root/data/getEntitySet/division_level0", param_, function(result){
										options_ = result.data.entityset;
										e.options = options_;
										
										me.showform = false;
										me.$nextTick(() => {
											me.showform = true;
										});
									});
								}
								else if (e.field == "province") {
									if (e.selectparent) {
										if(!this.formData_jc[e.selectparent]) {
											e.options = []
										}
										else {
											var code_ = this.formData_jc[e.selectparent];
											let param_ = {
												isClientMode: false,
												filter: " level='1' and active='1' and EXISTS( SELECT * from md_division p where code='" + code_ + "' and md_division.parent_id = p.id)",
											}
											Server.call("root/data/getEntitySet/division_level1", param_, function(result){
												options_ = result.data.entityset;
												e.options = options_;
												
												me.showform = false;
												me.$nextTick(() => {
													me.showform = true;
												});
											});
										}
									}
								}
								else if (e.field == "city") {
									if (e.selectparent) {
										if(!this.formData_jc[e.selectparent]) {
											e.options = []
										}
										else {
											var code_ = this.formData_jc[e.selectparent];
											let param_ = {
												isClientMode: false,
												filter: " level='2' and active='1' and EXISTS( SELECT * from md_division p where code='" + code_ + "' and md_division.parent_id = p.id)",
											}
											Server.call("root/data/getEntitySet/division_level2", param_, function(result){
												options_ = result.data.entityset;
												e.options = options_;
												
												me.showform = false;
												me.$nextTick(() => {
													me.showform = true;
												});
											});
										}
									}
								}
								else if (e.field == "county") {
									if (e.selectparent) {
										if(!this.formData_jc[e.selectparent]) {
											e.options = []
										}
										else {
											var code_ = this.formData_jc[e.selectparent];
											let param_ = {
												isClientMode: false,
												filter: " level='3' and active='1' and EXISTS( SELECT * from md_division p where code='" + code_ + "' and md_division.parent_id = p.id)",
											}
											Server.call("root/data/getEntitySet/division_level3", param_, function(result){
												options_ = result.data.entityset;
												e.options = options_;
												
												me.showform = false;
												me.$nextTick(() => {
													me.showform = true;
												});
											});
										}
									}
								}
								
								
							}
						})
					},
					
					closeDialog() {
						if (this.popupParames.totab){
							Root.tab.removeItem(Root.tab.selected);
							Root.tab.open(me.popupParames.parentOption, false); 
						}
						else {
							Root.hidePopup();
						}
					},
					
					submitRowTable() {
					    var me = this;
					    var actpassword_ = localStorage.getItem("actpassword");
					    if (actpassword_) {
					        var config = {
								text: "流程验证",
								url: "../tool/popup_actpassword.html",
								callback: function(obj, callback) {
									me.dosubmitRowTable();
									if (callback) {
										callback();
									}
								}
					       };
					       this.doPopupByPublic(config);
					    }
					    else {
					       this.dosubmitRowTable();
					    }
					},
					
					dosubmitRowTable() {
						this.issubmit = true;
						this.loading_submit = true;
						this.saveTables();
					},
					
					onCellClick(config, obj) {
						var clickContext = this.selectCellField.clickContext;
						
						var row_ = obj.row;
						if(this.selectCellField.field == "file_name") {
							if (!obj.row.file_id) {
								Root.message({
									type: 'warning',
									message: '没有附件文件'
								});
								return
							}
							
							////////////
							let fileid = clone(obj.row.file_id);
							let fileName = clone(obj.row.file_name);
							let index1 = fileName.lastIndexOf(".");
							let index2 = fileName.length;
							let suffix = fileName.substring(index1, index2).toLowerCase(); //后缀名
							
							if (suffix == ".png" || suffix == ".jpg") {
								var fileids_ = [];
								fileids_.push(fileid)
								row_ = {
									filetype: "img",
									fileids: fileids_
								};
								clickContext.url = "../tool/popup_file.html";
							}
							else if (suffix == ".pdf") {
								var row = {
									fileid: fileid,
									filename: fileName
								}
								
								var config = {
									totab: true,
									icon: "icon-product",
									text: "附件预览",
									id: "pdf_" + fileid,
									url: "../tool/popup_file_pdf.html",
									data: row,
									delta: {},
									callback: function(obj, callback) {
										if (callback) {
											callback();
										}
									}
								};
								this.doPopupByPublic(config);
								return false;
								
							}
							else {//只可下载,不可预览
								handleDownload(fileid);
							}
							
							/////////
							
						}
						
						if (clickContext && clickContext.type == "popup") {
							config.combine({
								url: clickContext.url,
								sceneCode: clickContext.sceneCode,
								data: row_,
								delta: clickContext.delta ? clickContext.delta : {},
							})
						}
						else {
							return false;
						}
						
						return true;
					},
					
					onCheckFormByRefTab(array_f, tabs, fields_) {
						var me = this;
						var bo_ = "";
						var i = 0;
						tabs.map(t=>{
							i++;
							var upload_fileobj = t;
							upload_fileobj
							array_f.map(f=>{
								var fileObj_ = upload_fileobj[f.code];
								if (f.rules && (!fileObj_)) {
									bo_ += i + "." + f.name;
									return bo_;
								}
							})
							
							if(fields_ && fields_.length) {
								fields_.map(f=>{
									var fileObj_ = upload_fileobj[f.field];
									
									if (f.required && !fileObj_) {
										bo_ += i + "." + f.name + ";";
										return bo_;
									}
								})
							}
							
							
						})
						
						return bo_;
					},
					
					onCheckFormByRef(array_f, upload_fileobj) {
						var me = this;
						var bo_ = "";
						
						array_f.map(f=>{
							var fileObj_ = upload_fileobj[f.code];
							if (f.rules && (!fileObj_ || !fileObj_.file_name)) {
								bo_ = f.name;
								return bo_;
							}
						})
						
						return bo_;
					},
					
					saveTables() {
						var me = this;
						me.loading_save = true;
						var param = {
							customer_delivery_code: this.acctObj.code,
							customer_delivery_id: this.acctObj.id,
							customer_uscc: this.acctObj.uscc,
							delivery_part_code: this.acctObj.delivery_part_code,
							
							customer_part_code: this.acctObj.customer_part_code,
							business_operate_code: this.acctObj.business_operate_code,
							customer_identity: this.acctObj.customer_identity,
							business_type: this.acctObj.business_type
						};
						param.id = this.acctObj.cer_id;
						
						if (this.popupParames.sceneCode == "licence_version") {//资质变更
							param = me.newQualifications;
						}
						
						//old_id
						//customer_certification_id
						//id
						
						
						
						//1证照
						//attachment_type_zs
						var c_form_zz = true;
						
						if (this.issubmit) {
							c_form_zz = me.onCheckFormByRef(this.attachment_type_zs, this.file_zs);
							if (c_form_zz) {
								Root.message({
									type: 'warning',
									message: '缺少证照必填项【' + c_form_zz + '】'
								});  
								me.loading_save = false;
								me.issubmit = false;
								me.loading_submit = false;
								return;
							}
						}
						
						var licenceList_ = [];
						this.attachment_type_zs.map(zs=>{
							var zsobj_ = me.file_zs[zs.code];
							var zsobj_old = me.file_zs_old[zs.code];
							
							if (zsobj_ && zsobj_.file_id) {
								//判断是否更改
								var is_old = true;//默认相同
								
								if (zsobj_.file_id && !zsobj_old.file_id) {
									//新增的证照信息
									is_old = false;
								}
								else if (zsobj_old.file_id && zsobj_.file_id) {
									//附件不同,有更改
									if (zsobj_old.file_id != zsobj_.file_id) {
										is_old = false;
									}
									else {
										me.tableFields_zz.map(zzf=>{
											if (zsobj_old[zzf.field] != zsobj_[zzf.field]) {
												is_old = false;
											}
										})
									}
								}
								
								//如果不相同
								if (!is_old) {
									//资质id是否是本此资质的id
									if (zsobj_.customer_certification_id != param.id) {
										zsobj_.customer_certification_id = param.id;
										if(zsobj_.id) {
											zsobj_.old_id = clone(zsobj_.id);
										}
										zsobj_.id = null;
									}
									
									licenceList_.push(zsobj_);
								}
							}
						});
						
						if (this.del_zz.length) {
							this.del_zz.map(z=>{
								licenceList_.push(z);
							})
						}
						
						if (licenceList_.length) {
							param.licence_list = licenceList_;
						}else {
							param.licence_list = null;
						}
						
						//开票
						// c_form_zz = me.onCheckFormByRef(this.attachment_type_kp, this.formData_kp);
						// if (c_form_zz) {
						// 	Root.message({
						// 		type: 'warning',
						// 		message: '缺少开票必填附件(二选一)'
						// 	});  
						// 	me.loading_save = false;
						// 	me.issubmit = false;
						// 	me.loading_submit = false;
						// 	return;
						// }
						
						if (this.issubmit) {
							var c_form_zz_ = false;
							
							c_form_zz = me.onCheckFormByRef(this.attachment_type_kp, this.formData_kp);
							if (c_form_zz) {
								Root.message({
									type: 'warning',
									message: '缺少开票附件必填项【' + c_form_zz + '】'
								});  
								me.loading_save = false;
								me.issubmit = false;
								me.loading_submit = false;
								return;
							}
							
							this.attachment_type_kp.map(f=>{
								var fileObj_ = this.formData_kp[f.code];
								if (fileObj_) {
									c_form_zz_ = true;
								}
							})
							if (!c_form_zz_) {
								Root.message({
									type: 'warning',
									message: '缺少开票必填附件(二选一)'
								});  
								me.loading_save = false;
								me.issubmit = false;
								me.loading_submit = false;
								return;
							}
							
							var checkResults = this.$refs.form_kp.checkForm();
							if (!checkResults) {
								Root.message({
									type: 'warning',
									message: '缺少开票必填项'
								}); 
								me.loading_save = false;
								me.issubmit = false;
								me.loading_submit = false;
								return
							}
						}
						
						var formData_kp_notnull = false;
						//判断是否更改
						var is_old_kp = true;//默认相同
						for (var kp_ in me.formData_kp) {
							if (me.formData_kp[kp_] != me.formData_kp_old[kp_]) {
								is_old_kp = false;
							}
						}
						//如果不相同
						if (!is_old_kp) {
							if (me.formData_kp.customer_certification_id != param.id) {
								me.formData_kp.customer_certification_id = param.id;
								if(me.formData_kp.id) {
									me.formData_kp.old_id = clone(me.formData_kp.id);
								}
								me.formData_kp.id = null;
							}
							
							if(!me.formData_kp.customer_uscc) {
								me.formData_kp.customer_uscc = this.acctObj.uscc;
							}
							param.invoice = me.formData_kp;
						}
						else {
							param.invoice = null;
						}
						
						//æ”¶è´§
						if (this.issubmit) {
							c_form_zz = me.onCheckFormByRefTab(this.attachment_type_sh, this.tabs_sh, this.tableFields_sh);
							if (c_form_zz) {
								Root.message({
									type: 'warning',
									message: '缺少收货必填项【' + c_form_zz + '】'
								});  
								me.loading_save = false;
								me.issubmit = false;
								me.loading_submit = false;
								return;
							}
						}
						
						//consigneeList
						var consigneeList_ = [];
						var i = 0;
						this.tabs_sh.map(sh=>{
							//判断是否更改
							var is_old_sh = true;//默认相同
							
							//判断附件是否相同
							if (!sh.id || !me.tabs_sh_old_obj[sh.id]) {
								is_old_sh = false;
							}
							
							if (is_old_sh) {
								me.attachment_type_sh.map(shff=>{
									if (sh[shff.code] != me.tabs_sh_old_obj[sh.id][shff.code]) {
										is_old_sh = false;
									}
								})
							}
							
							//如果附件相同,判断其它属性
							if (is_old_sh) {
								me.tableFields_sh.map(shff=>{
									if (sh[shff.field] != me.tabs_sh_old_obj[sh.id][shff.field]) {
										is_old_sh = false;
									}
								})
							}
							if (!is_old_sh) {
								if (sh.customer_certification_id != param.id) {
									sh.customer_certification_id = param.id;
									if(sh.id) {
										sh.old_id = clone(sh.id);
									}
									
									sh.id = null;
								}
								
								sh.delivery_part_code = (this.acctObj).delivery_part_code
								sh.delivery_part_name = (this.acctObj).delivery_part_name
								
								sh.order_no = i;
								if (sh.create_operate_code) {
									sh.create_operate_code = localStorage.getItem("emp_code");
								}
								consigneeList_.push(sh);
							}
							else if (sh.customer_certification_id == param.id) {
								sh.order_no = i;
								if (sh.create_operate_code) {
									sh.create_operate_code = localStorage.getItem("emp_code");
								}
								consigneeList_.push(sh);
							}
							i++;
						});
						
						
						if (consigneeList_.length) {
							param.consignee_list = consigneeList_;
						}else {
							param.consignee_list = null;
						}
						
						//采购
						if (this.issubmit) {
							c_form_zz = me.onCheckFormByRefTab(this.attachment_type_cg, this.tabs_cg);
							if (c_form_zz) {
								Root.message({
									type: 'warning',
									message: '缺少采购必填项【' + c_form_zz + '】'
								});  
								me.loading_save = false;
								me.issubmit = false;
								me.loading_submit = false;
								return;
							}
						}
						
						//procureList
						var procureList_ = [];
						var j = 0;
						this.tabs_cg.map(cg=>{
							//判断是否更改
							var is_old_cg = true;//默认相同
							
							//判断附件是否相同
							if (!cg.id || !me.tabs_cg_old_obj[cg.id]) {
								is_old_cg = false;
							}
							if (is_old_cg) {
								me.attachment_type_cg.map(cgff=>{
									if (cg[cgff.code] != me.tabs_cg_old_obj[cg.id][cgff.code]) {
										is_old_cg = false;
									}
								})
							}
							//如果附件相同,判断其它属性
							if (is_old_cg) {
								me.tableFields_cg.map(cgff=>{
									if (cg[cgff.field] != me.tabs_cg_old_obj[cg.id][cgff.field]) {
										is_old_cg = false;
									}
								})
							}
							if (!is_old_cg) {
								if (cg.customer_certification_id != param.id) {
									cg.customer_certification_id = param.id;
									if(cg.id) {
										cg.old_id = clone(cg.id);
									}
									
									cg.id = null;
								}
								
								cg.delivery_part_code = (this.acctObj).delivery_part_code
								cg.delivery_part_name = (this.acctObj).delivery_part_name
								
								cg.order_no = j;
								if (cg.create_operate_code) {
									cg.create_operate_code = localStorage.getItem("emp_code");
								}
								procureList_.push(cg);
							}
							else if (cg.customer_certification_id == param.id) {
								cg.order_no = j;
								if (cg.create_operate_code) {
									cg.create_operate_code = localStorage.getItem("emp_code");
								}
								procureList_.push(cg);
							}
							j++;
							
							/* if (this.popupParames.sceneCode == "licence_version") {//资质变更
								if (cg.customer_certification_id != param.id) {
									cg.customer_certification_id = param.id;
									if(cg.id) {
										cg.old_id = clone(cg.id);
									}
									cg.id = null;
								}
							}
							
							cg.delivery_part_code = (this.acctObj).delivery_part_code
							cg.delivery_part_name = (this.acctObj).delivery_part_name
							
							cg.order_no = j;
							procureList_.push(cg);
							j++ */
						});
						if (procureList_.length) {
							param.procure_list = procureList_;
						}else {
							param.procure_list = null;
						}
						
						//质保
						if (this.issubmit) {
							c_form_zz = me.onCheckFormByRef(this.attachment_type_zb, this.file_zs);
							if (c_form_zz) {
								Root.message({
									type: 'warning',
									message: '缺少质保必填项【' + c_form_zz + '】'
								});  
								me.loading_save = false;
								me.issubmit = false;
								me.loading_submit = false;
								return;
							}
						}
						//qaInfo
						var infoList_ = [];
						//attachment_type_zb
						this.attachment_type_zb.map(zb=>{
							var zbobj_ = me.file_zs[zb.code];
							var zbobj_old = me.file_zs_old[zb.code];
							
							if (zbobj_ && zbobj_.file_id) {
								//判断是否更改
								var is_old_zb = true;//默认相同
								
								if (zbobj_.file_id && !zbobj_old.file_id) {
									//新增的证照信息
									is_old_zb = false;
								}
								else if (zbobj_old.file_id && zbobj_.file_id) {
									//附件不同,有更改
									if (zbobj_old.file_id != zbobj_.file_id) {
										is_old_zb = false;
									}
									else {
										me.tableFields_zz.map(zzf=>{
											if (zbobj_old[zzf.field] != zbobj_[zzf.field]) {
												is_old_zb = false;
											}
										})
									}
								}
								
								//如果不相同
								if (!is_old_zb) {
									//资质id是否是本次资质的id
									if (zbobj_.customer_certification_id != param.id) {
										zbobj_.customer_certification_id = param.id;
										if(zbobj_.id) {
											zbobj_.old_id = clone(zbobj_.id);
										}
										zbobj_.id = null;
									}
									
									infoList_.push(zbobj_);
								}
							}
							
						});
						
						if (infoList_.length) {
							param.qa_info = infoList_[0];
						}else {
							param.qa_info = null;
						}
						
						//纸质物流
						param.logistics_company = this.logistics_company;
						param.logistics_no = this.logistics_no;
						//纸质确认
						//param.logistics_check = this.logistics_check;
						
						param.type = "create";
						param.isClientMode = false;
						///////
						/* Root.message({
							type: 'success',
							message: '13234'
						}); 
						me.loading_save = false;
						me.issubmit = false;
						me.loading_submit = false;
						return */
						//////
						//me.loading_save = false;
						//return
						Server.call("root/customer/saveCustomerCertification", param, function(result) {
							var result_ = result;
							me.loading_save = false;
							if (result && result.success) {
								if(me.issubmit) {
									me.issubmit = false;
									var id_ = result.data.id;
									
									let param_table = {
										isClientMode: false,
										dataname: "getCustomerDeliveryCertificationStatus",
										returnType: "entityset",
										filter: "customer_delivery_certification_mapping.customer_uscc='" + me.formData_jc.uscc + "' and customer_delivery_certification_mapping.delivery_part_code='"+ me.acctObj.delivery_part_code +"' and customer_delivery_certification_mapping.id<>'" + id_ + "'"
									}
									Server.call("root/data/procedure", param_table, function(result_t) {
										console.log(result_t);
										if (result_t.data.entityset && result_t.data.entityset.length) {
											Root.message({
												type: 'warning',
												message: '该商业备案和主体资质已存在流程'
											});  
											me.loading_submit = false;
										}
										else {
											var param_c = {
												isClientMode: false,
												id: id_
											}
											Server.call("root/customer/checkCustomerCertification", param_c, function(result1) {
												if (result1.success) {
													var businessType_ = "accountCustomerCertification";
													if (me.acctObj.is_poxy) {
														businessType_ = "poxyCertification";
													}
													var param_submit = {
														isClientMode: false,
														businessId: id_,
														businessType: businessType_,
														variableMap: {
															deliveryPartCode: me.acctObj.delivery_part_code,
															province: me.formData_jc.record_province,
														}
														
													}
													Server.call("root/api/startAct", param_submit, function(result2) {
														console.log(result2);
														if(result2.success && result2.data.data && result2.data.data.activitiId) {
															var param_act = {
																isClientMode: false,
																id: id_,
																flow_id: result2.data.data.activitiId,
																dataname: "agCustomerDeliveryCertification"
															};
															
															Server.call("root/data/updateEntity", param_act, function(result3) {
																console.log(result3);
																
																me.loading_submit = false;
																Root.message({
																	type: 'success',
																	message: '提交成功'
																}); 
																
																me.saveAfter();
															}, function(result3) {
																console.log(result3);
																me.loading_submit = false;
																if (result3.message) {
																	Root.message({
																		type: 'error',
																		message: result3.message
																	}); 
																}
															});
														}
														else if (result2.message) {
															Root.message({
																type: 'error',
																message: result2.message
															}); 
														}
														
													}, function(result2) {
														console.log(result2);
														me.loading_submit = false;
														if (result2.message) {
															Root.message({
																type: 'error',
																message: result2.message
															}); 
														}
													});
												}
												else {
													Root.message({
														type: 'warning',
														message: '校验失败'
													}); 
												}
												
											}, function(result1) {
												console.log(result1);
												me.loading_submit = false;
												if (result1.message) {
													Root.message({
														type: 'error',
														message: result1.message
													}); 
												}
											});
											
										}
									})
									
									
									
									
									
								}
								else {
									Root.message({
										type: 'success',
										message: '保存成功'
									}); 
									
									me.saveAfter();
								}
							}
						}, function(result1) {
							console.log(result1);
							me.loading_save = false;
							me.loading_submit = false;
							me.issubmit = false;
							if (result1.message) {
								Root.message({
									type: 'error',
									message: result1.message
								}); 
							}
						})
					},
					
					saveAfter(logcode) {
						var me = this;
						if (logcode) {
							//添加日志列表
							var logObjList = [];
							
							/* 
							logObjList = [
								{
									logtype: "",
									operatelogdataobj: {},
									fieldobjlist: []
								}
							] 
							 
							 */
							
							var logtype = "";//日志类型
							var operatelogdataobj = {};
							var fieldobjlist = [];//日志详情
							/* 
							var l_ = {
								type: "add", 
								field: "business_id", 
								fieldname: "角色关联商业",
								currentdata: p.business_id
							}
							*/
							
							var isclose = false;//是否关闭Tab或弹窗
							if (logcode == "zzxx") {//资质信息
								logtype = "customerDeliveryCertification";
								//执照
								//attachment_type_zs
								//file_zs_old
								//attachment_type_zb
								this.attachment_type_zb.map(zb=>{
									var zbobj_ = me.file_zs[zb.code];
									var zbobj_old = me.file_zs_old[zb.code];
									
									if (zbobj_ && zbobj_.file_id) {
										//判断是否更改
										var is_old_zb = true;//默认相同
										
										if (zbobj_.file_id && !zbobj_old.file_id) {
											//新增的证照信息
											is_old_zb = false;
										}
										else if (zbobj_old.file_id && zbobj_.file_id) {
											//附件不同,有更改
											if (zbobj_old.file_id != zbobj_.file_id) {
												is_old_zb = false;
											}
											else {
												me.tableFields_zz.map(zzf=>{
													if (zbobj_old[zzf.field] != zbobj_[zzf.field]) {
														is_old_zb = false;
													}
												})
											}
										}
										
										//如果不相同
										if (!is_old_zb) {
											var logObj = {};
											//日志头信息
											logObj.logtype = logtype;
											var businessid_ = null;
											if (zbobj_.id) {
												businessid_ = zbobj_.id;
											}
											logObj.operatelogdataobj = {//日志头信息
												businessid: businessid_,
												businessname: me.acctObj.uscc + "证照信息",
												dataname: "agCustomerLicence",
												operateremark: "资质信息调整"
											};
											
											//附件名称
											//详情信息
											var dataFields = clone(me.tableFields_zz);
											var field_obj_ = {field: "file_name", name: "附件名称"};
											dataFields.push(field_obj_);
											var old_data = clone(zbobj_old);
											var new_data = clone(zbobj_);
											fieldobjlist = me.getDataDifference(dataFields, old_data, new_data, isArray);
											logObj.fieldobjlist = fieldobjlist;
											
											//添加到日志列表
											logObjList.push(logObj);
										}
									}
									
								});
								
								//开票
								var is_old_kp = true;//默认相同
								for (var kp_ in me.formData_kp) {
									if (me.formData_kp[kp_] != me.formData_kp_old[kp_]) {
										is_old_kp = false;
									}
								}
								//如果不相同
								if (!is_old_kp) {
									var logObj = {};
									//日志头信息
									logObj.logtype = logtype;
									var businessid_ = null;
									if (formData_kp.id) {
										businessid_ = formData_kp.id;
									}
									logObj.operatelogdataobj = {//日志头信息
										businessid: businessid_,
										businessname: me.acctObj.uscc + "开票信息",
										dataname: "agCustomerInvoice",
										operateremark: "资质信息调整"
									};
									
									//附件名称
									//详情信息
									var dataFields = clone(me.tableFields_kp);
									var field_obj_ = {field: "prove_file_name", name: "银行开户证明附件名称"};
									dataFields.push(field_obj_);
									var field_obj_ = {field: "invoice_file_name", name: "开票资料附件名称"};
									dataFields.push(field_obj_);
									
									var old_data = clone(me.formData_kp_old);
									var new_data = clone(me.formData_kp);
									fieldobjlist = me.getDataDifference(dataFields, old_data, new_data, isArray);
									logObj.fieldobjlist = fieldobjlist;
									
									//添加到日志列表
									logObjList.push(logObj);
								}
								
								//æ”¶è´§
								this.tabs_sh.map(sh=>{
									//判断是否更改
									var is_old_sh = true;//默认相同
									
									//判断附件是否相同
									if (!sh.id || !me.tabs_sh_old_obj[sh.id]) {
										is_old_sh = false;
									}
									
									if (is_old_sh) {
										me.attachment_type_sh.map(shff=>{
											if (sh[shff.code] != me.tabs_sh_old_obj[sh.id][shff.code]) {
												is_old_sh = false;
											}
										})
									}
									
									//如果附件相同,判断其它属性
									if (is_old_sh) {
										me.tableFields_sh.map(shff=>{
											if (sh[shff.field] != me.tabs_sh_old_obj[sh.id][shff.field]) {
												is_old_sh = false;
											}
										})
									}
									if (!is_old_sh) {
										var logObj = {};
										//日志头信息
										logObj.logtype = logtype;
										var businessid_ = null;
										if (sh.id) {
											businessid_ = sh.id;
										}
										logObj.operatelogdataobj = {//日志头信息
											businessid: businessid_,
											businessname: me.acctObj.uscc + "收货信息",
											dataname: "agCustomerDeliveryConsignee",
											operateremark: "资质信息调整"
										};
										
										//附件名称
										//详情信息
										var old_data_ = {};
										var new_data_ = sh;
										
										if (me.tabs_sh_old_obj[sh.id]) {
											old_data_ = me.tabs_sh_old_obj[sh.id];
										}
										
										var dataFields = clone(me.tableFields_sh);
										var field_obj_ = {field: "book_name", name: "附件名称"};
										dataFields.push(field_obj_);
										
										var old_data = clone(old_data_);
										var new_data = clone(new_data_);
										fieldobjlist = me.getDataDifference(dataFields, old_data, new_data, isArray);
										logObj.fieldobjlist = fieldobjlist;
										
										//添加到日志列表
										logObjList.push(logObj);
									}
								});
								
								//采购
								this.tabs_cg.map(cg=>{
									//判断是否更改
									var is_old_cg = true;//默认相同
									
									//判断附件是否相同
									if (!cg.id || !me.tabs_cg_old_obj[cg.id]) {
										is_old_cg = false;
									}
									
									if (is_old_cg) {
										me.attachment_type_cg.map(cgff=>{
											if (cg[cgff.code] != me.tabs_cg_old_obj[cg.id][cgff.code]) {
												is_old_cg = false;
											}
										})
									}
									
									//如果附件相同,判断其它属性
									if (is_old_cg) {
										me.tableFields_cg.map(cgff=>{
											if (cg[cgff.field] != me.tabs_cg_old_obj[cg.id][cgff.field]) {
												is_old_cg = false;
											}
										})
									}
									if (!is_old_cg) {
										var logObj = {};
										//日志头信息
										logObj.logtype = logtype;
										var businessid_ = null;
										if (cg.id) {
											businessid_ = cg.id;
										}
										logObj.operatelogdataobj = {//日志头信息
											businessid: businessid_,
											businessname: me.acctObj.uscc + "采购信息",
											dataname: "agCustomerDeliveryProcure",
											operateremark: "资质信息调整"
										};
										
										//附件名称
										//详情信息
										var old_data_ = {};
										var new_data_ = cg;
										
										if (me.tabs_cg_old_obj[cg.id]) {
											old_data_ = me.tabs_cg_old_obj[cg.id];
										}
										
										var dataFields = clone(me.tableFields_cg);
										var field_obj_ = {field: "book_name", name: "附件名称"};
										dataFields.push(field_obj_);
										
										var old_data = clone(old_data_);
										var new_data = clone(new_data_);
										fieldobjlist = me.getDataDifference(dataFields, old_data, new_data, isArray);
										logObj.fieldobjlist = fieldobjlist;
										
										//添加到日志列表
										logObjList.push(logObj);
									}
								});
								//质保
								this.attachment_type_zb.map(zb=>{
									var zbobj_ = me.file_zs[zb.code];
									var zbobj_old = me.file_zs_old[zb.code];
									
									if (zbobj_ && zbobj_.file_id) {
										//判断是否更改
										var is_old_zb = true;//默认相同
										
										if (zbobj_.file_id && !zbobj_old.file_id) {
											//新增的证照信息
											is_old_zb = false;
										}
										else if (zbobj_old.file_id && zbobj_.file_id) {
											//附件不同,有更改
											if (zbobj_old.file_id != zbobj_.file_id) {
												is_old_zb = false;
											}
											else {
												me.tableFields_zz.map(zzf=>{
													if (zbobj_old[zzf.field] != zbobj_[zzf.field]) {
														is_old_zb = false;
													}
												})
											}
										}
										
										//如果不相同
										if (!is_old_zb) {
											var logObj = {};
											//日志头信息
											logObj.logtype = logtype;
											var businessid_ = null;
											if (zbobj_.id) {
												businessid_ = zbobj_.id;
											}
											logObj.operatelogdataobj = {//日志头信息
												businessid: businessid_,
												businessname: me.acctObj.uscc + "质保信息",
												dataname: "agCustomerLicence",
												operateremark: "资质信息调整"
											};
											
											//附件名称
											//详情信息
											var dataFields = clone(me.tableFields_zz);
											var field_obj_ = {field: "file_name", name: "附件名称"};
											dataFields.push(field_obj_);
											var old_data = clone(zbobj_old);
											var new_data = clone(zbobj_);
											fieldobjlist = me.getDataDifference(dataFields, old_data, new_data, isArray);
											logObj.fieldobjlist = fieldobjlist;
											
											//添加到日志列表
											logObjList.push(logObj);
										}
									}
								});
								//物流
								var logistics_old = {};
								var logistics_ = {};
								var logistics_fields = [];
								this.logistics_company_old = clone(this.logistics_company);
								this.logistics_no_old = clone(this.logistics_no);
								
								if (this.logistics_company != this.logistics_company_old) {
									logistics_old.logistics_company = this.logistics_company_old;
									logistics_.logistics_company = this.logistics_company;
									
									var field_obj_ = {field: "logistics_company", name: "物流公司"};
									logistics_fields.push(field_obj_);
								}
								if (this.logistics_no != this.logistics_no_old) {
									logistics_old.logistics_no = this.logistics_no_old;
									logistics_.logistics_no = this.logistics_no;
									
									var field_obj_ = {field: "logistics_no", name: "运单号"};
									logistics_fields.push(field_obj_);
								}
								if (logistics_fields.length) {
									var logObj = {};
									//日志头信息
									logObj.logtype = logtype;
									var businessid_ = null;
									if (me.acctObj.cer_id) {
										businessid_ = me.acctObj.cer_id;
									}
									logObj.operatelogdataobj = {//日志头信息
										businessid: businessid_,
										businessname: me.acctObj.uscc + "物流信息",
										dataname: "agCustomerDeliveryCertification",
										operateremark: "资质信息调整"
									};
									
									//详情信息
									var dataFields = clone(logistics_fields);
									var old_data = clone(logistics_old);
									var new_data = clone(logistics_);
									fieldobjlist = me.getDataDifference(dataFields, old_data, new_data, isArray);
									logObj.fieldobjlist = fieldobjlist;
									
									//添加到日志列表
									logObjList.push(logObj);
								}
							}
							
							//保存日志列表
							if (logObjList.length) {
								this.saveLogObjList(logObjList);
							}
							else {
								this.doSaveAfter();
							}
						}
						else {
							this.doSaveAfter();
						}
					},
					
					saveLogObjList(logObjList) {
						var me = this;
						var logObj = logObjList[0];
						
						me.addlog(logObj.logtype, logObj.operatelogdataobj, logObj.fieldobjlist, function(){
							logObjList.remove(logObj);
							
							if (logObjList.length) {
								me.saveLogObjList(logObjList);
							}
							else {
								me.doSaveAfter();
							}
						});
							
					},
					
					setlog(logtype, operatelogdataobj, fieldobjlist, isclose, callback) {
						var me = this;
						me.addlog(logtype, operatelogdataobj, fieldobjlist, function(){
							if (isclose) {
								me.doSaveAfter();
							}
						});
					},
					
					doSaveAfter() {
						var me = this;
						if(this.popupParames.callback) {
							let obj = {
								//row: this.formData
							}
							this.popupParames.callback(obj, function() {
								if (me.popupParames.totab){
									Root.tab.removeItem(Root.tab.selected);
									Root.tab.open(me.popupParames.parentOption, false); 
								}
								else {
									Root.hidePopup();
								}
							});
						}
						else {
							alert("该按键事件缺失!")
						}
					},
					
					saveTabData(code, data, type) {
						if (code == "customer") {
							this.saveCustomer(data);
						}
						else if (code == "licence") {
							if (data.mdm_id) {
								this.saveLicence(data, type);
							}
							else {
								Root.message({
									type: 'warning',
									message: '需先上传证件照'
								});
							}
						}
						else if (code == "invoice") {
							this.saveInvoice(data);
						}
						else if (code == "consignee") {
							this.saveConsignee(data);
						}
					},
					
					//资质信息
					handleChange(tab) {
						this.file_img = false;
						this.file_txt = false;
						
						this.selectZZName = "";
						this.selectZZType = "ZGL01";
						this.zzimg = {};
						this.zzimgList = [];
					},
					
					addTableData_sh() {
						var form_ = clone(this.default_form_sh);
						this.tabs_sh.push(form_);
						this.$nextTick(function(){
							this.activeTabs_sh = (this.tabs_sh.length - 1) + "_";
						})
					},
					
					removeTab_sh(targetName) {
						let tabs = this.tabs_sh;
						let activeName = targetName.split("_")[0];
						var rab_ = this.tabs_sh[activeName*1];
						
						if (rab_.create_operate_id != localStorage.getItem("emp_id")) {
							Root.message({
								type: 'warning',
								message: '此收货数据由_' + rab_.create_operate_name + "_录入,非本人不得删除"
							});
							return
						}
						
						this.tabs_sh.remove(rab_);
						this.$nextTick(function(){
							this.activeTabs_sh = (this.tabs_sh.length - 1) + "_";
						})
						/* if (activeName === targetName) {
						  tabs.forEach((tab, index) => {
							if (tab.name === targetName) {
							  let nextTab = tabs[index + 1] || tabs[index - 1];
							  if (nextTab) {
								activeName = nextTab.name;
							  }
							}
						  });
						}
						
						this.activeTabs_sh = activeName;
						this.tabs_sh = tabs.filter(tab => tab.name !== targetName); */
					},
					
					addTableData_cg() {
						var form_ = clone(this.default_form_cg);
						this.tabs_cg.push(form_);
						this.$nextTick(function(){
							this.activeTabs_cg = (this.tabs_cg.length - 1) + "_";
						})
					},
					
					removeTab_cg(targetName) {
						let tabs = this.tabs_cg;
						let activeName = targetName.split("_")[0];
						var rab_ = this.tabs_cg[activeName*1];
						
						if (rab_.create_operate_id != localStorage.getItem("emp_id")) {
							Root.message({
								type: 'warning',
								message: '此采购数据由_' + rab_.create_operate_name + "_录入,非本人不得删除"
							});
							return
						}
						
						this.tabs_cg.remove(rab_);
						this.$nextTick(function(){
							this.activeTabs_cg = (this.tabs_cg.length - 1) + "_";
						})
						/* let tabs = this.tabs_cg;
						let activeName = this.activeTabs_cg;
						if (activeName === targetName) {
						  tabs.forEach((tab, index) => {
							if (tab.name === targetName) {
							  let nextTab = tabs[index + 1] || tabs[index - 1];
							  if (nextTab) {
								activeName = nextTab.name;
							  }
							}
						  });
						}
						
						this.activeTabs_cg = activeName;
						this.tabs_cg = tabs.filter(tab => tab.name !== targetName); */
					},
					
					editTableData() {
						
					},
					
					saveForm_approval() {
						var me = this;
						me.loading_save = true;
						var param = {
							customer_delivery_code: this.acctObj.code,
							customer_delivery_id: this.acctObj.id,
							customer_uscc: this.acctObj.uscc,
							delivery_part_code: this.acctObj.delivery_part_code,
							
							customer_part_code: this.acctObj.customer_part_code,
							business_operate_code: this.acctObj.business_operate_code,
							customer_identity: this.acctObj.customer_identity,
							business_type: this.acctObj.business_type
						};
						param.id = this.acctObj.cer_id;
						
						//1证照
						//attachment_type_zs
						var c_form_zz = true;
						
						if (this.issubmit) {
							c_form_zz = me.onCheckFormByRef(this.attachment_type_zs, this.file_zs);
							if (c_form_zz) {
								Root.message({
									type: 'warning',
									message: '缺少证照必填项【' + c_form_zz + '】'
								});  
								me.loading_save = false;
								me.issubmit = false;
								me.loading_submit = false;
								return;
							}
						}
						
						var licenceList_ = [];
						this.attachment_type_zs.map(zs=>{
							var zsobj_ = me.file_zs[zs.code];
							var zsobj_old = me.file_zs_old[zs.code];
							
							if (zsobj_ && zsobj_.file_id) {
								//判断是否更改
								var is_old = true;//默认相同
								
								if (zsobj_.file_id && !zsobj_old.file_id) {
									//新增的证照信息
									is_old = false;
								}
								else if (zsobj_old.file_id && zsobj_.file_id) {
									//附件不同,有更改
									if (zsobj_old.file_id != zsobj_.file_id) {
										is_old = false;
									}
									else {
										me.tableFields_zz.map(zzf=>{
											if (zsobj_old[zzf.field] != zsobj_[zzf.field]) {
												is_old = false;
											}
										})
									}
								}
								
								//如果不相同
								if (!is_old) {
									//资质id是否是本此资质的id
									if (zsobj_.customer_certification_id != param.id) {
										zsobj_.customer_certification_id = param.id;
										if(zsobj_.id) {
											zsobj_.old_id = clone(zsobj_.id);
										}
										zsobj_.id = null;
									}
									
									licenceList_.push(zsobj_);
								}
							}
						});
						// this.attachment_type_zs.map(zs=>{
						// 	var zsobj_ = me.file_zs[zs.code];
						// 	//for (var k in zsobj_) {
						// 	if (zsobj_ && zsobj_.file_id && zsobj_.customer_certification_id) {
						// 		//zsobj_.code = zs.attachment_code;
						// 		if (this.popupParames.sceneCode == "licence_version") {//资质变更
						// 			if (zsobj_.customer_certification_id != me.newQualifications.id) {
						// 				zsobj_.customer_certification_id = me.newQualifications.id;
						// 				if(zsobj_.id) {
						// 					zsobj_.old_id = clone(zsobj_.id);
						// 				}
						// 				zsobj_.id = null;
						// 			}
						// 		}
						// 		licenceList_.push(zsobj_);
						// 	}
						// 	//}
						// });
						
						if (licenceList_.length) {
							param.licence_list = licenceList_;
						}else {
							param.licence_list = null;
						}
						
						if (this.issubmit) {
							var c_form_zz_ = false;
							this.attachment_type_kp.map(f=>{
								var fileObj_ = this.formData_kp[f.code];
								if (fileObj_) {
									c_form_zz_ = true;
								}
							})
							if (!c_form_zz_) {
								Root.message({
									type: 'warning',
									message: '缺少开票必填附件(二选一)'
								});  
								me.loading_save = false;
								me.issubmit = false;
								me.loading_submit = false;
								return;
							}
							
							var checkResults = this.$refs.form_kp.checkForm();
							if (!checkResults) {
								Root.message({
									type: 'warning',
									message: '缺少开票必填项'
								}); 
								me.loading_save = false;
								me.issubmit = false;
								me.loading_submit = false;
								return
							}
						}
						
						var formData_kp_notnull = false;
						//判断是否更改
						var is_old_kp = true;//默认相同
						for (var kp_ in me.formData_kp) {
							if (me.formData_kp[kp_] != me.formData_kp_old[kp_]) {
								is_old_kp = false;
							}
						}
						//如果不相同
						if (!is_old_kp) {
							if (me.formData_kp.customer_certification_id != param.id) {
								me.formData_kp.customer_certification_id = param.id;
								if(me.formData_kp.id) {
									me.formData_kp.old_id = clone(me.formData_kp.id);
								}
								me.formData_kp.id = null;
							}
							
							if(!me.formData_kp.customer_uscc) {
								me.formData_kp.customer_uscc = this.acctObj.uscc;
							}
							param.invoice = me.formData_kp;
						}
						else {
							param.invoice = null;
						}
						//  for (var kp_ in me.formData_kp) {
						// 	if (me.formData_kp.customer_certification_id) {
						// 		formData_kp_notnull = true;
						// 		if (this.popupParames.sceneCode == "licence_version") {//资质变更
						// 			if (me.formData_kp.customer_certification_id != me.newQualifications.id) {
						// 				me.formData_kp.customer_certification_id = me.newQualifications.id;
						// 				if(me.formData_kp.id) {
						// 					me.formData_kp.old_id = clone(me.formData_kp.id);
						// 				}
						// 				me.formData_kp.id = null;
						// 			}
						// 		}
						// 	}
						// }
						// if (formData_kp_notnull) {
						// 	if(!me.formData_kp.customer_uscc) {
						// 		me.formData_kp.customer_uscc = this.acctObj.uscc;
						// 	}
						// 	/* if(this.formData.id && !me.formData_kp.customer_id) {
						// 		me.formData_kp.customer_id = this.formData.id;
						// 	} */
							
						// 	param.invoice = me.formData_kp;
						// }else {
						// 	param.invoice = null;
						// }
						
						//æ”¶è´§
						if (this.issubmit) {
							c_form_zz = me.onCheckFormByRefTab(this.attachment_type_sh, this.tabs_sh, this.tableFields_sh);
							if (c_form_zz) {
								Root.message({
									type: 'warning',
									message: '缺少收货必填项【' + c_form_zz + '】'
								});  
								me.loading_save = false;
								me.issubmit = false;
								me.loading_submit = false;
								return;
							}
						}
						
						//consigneeList
						var consigneeList_ = [];
						var i = 0;
						this.tabs_sh.map(sh=>{
							//判断是否更改
							var is_old_sh = true;//默认相同
							
							//判断附件是否相同
							if (!sh.id || !me.tabs_sh_old_obj[sh.id]) {
								is_old_sh = false;
							}
							
							if (is_old_sh) {
								me.attachment_type_sh.map(shff=>{
									if (sh[shff.code] != me.tabs_sh_old_obj[sh.id][shff.code]) {
										is_old_sh = false;
									}
								})
							}
							
							//如果附件相同,判断其它属性
							if (is_old_sh) {
								me.tableFields_sh.map(shff=>{
									if (sh[shff.field] != me.tabs_sh_old_obj[sh.id][shff.field]) {
										is_old_sh = false;
									}
								})
							}
							if (!is_old_sh) {
								if (sh.customer_certification_id != param.id) {
									sh.customer_certification_id = param.id;
									if(sh.id) {
										sh.old_id = clone(sh.id);
									}
									
									sh.id = null;
								}
								
								sh.delivery_part_code = (this.acctObj).delivery_part_code
								sh.delivery_part_name = (this.acctObj).delivery_part_name
								
								sh.order_no = i;
								consigneeList_.push(sh);
							}
							else if (sh.customer_certification_id == param.id) {
								sh.order_no = i;
								consigneeList_.push(sh);
							}
							i++;
						});
						
						
						if (consigneeList_.length) {
							param.consignee_list = consigneeList_;
						}else {
							param.consignee_list = null;
						}
						// this.tabs_sh.map(sh=>{
						// 	if (this.popupParames.sceneCode == "licence_version") {//资质变更
						// 		if (sh.customer_certification_id != me.newQualifications.id) {
						// 			sh.customer_certification_id = me.newQualifications.id;
						// 			if(sh.id) {
						// 				sh.old_id = clone(sh.id);
						// 			}
									
						// 			sh.id = null;
						// 		}
						// 	}
						// 	sh.delivery_part_code = (this.acctObj).delivery_part_code
						// 	sh.delivery_part_name = (this.acctObj).delivery_part_name
							
						// 	sh.order_no = i;
						// 	consigneeList_.push(sh);
						// 	i++;
						// });
						// if (consigneeList_.length) {
						// 	param.consignee_list = consigneeList_;
						// }else {
						// 	param.consignee_list = null;
						// }
						
						//采购
						if (this.issubmit) {
							c_form_zz = me.onCheckFormByRefTab(this.attachment_type_cg, this.tabs_cg);
							if (c_form_zz) {
								Root.message({
									type: 'warning',
									message: '缺少采购必填项【' + c_form_zz + '】'
								});  
								me.loading_save = false;
								me.issubmit = false;
								me.loading_submit = false;
								return;
							}
						}
						
						//procureList
						var procureList_ = [];
						var j = 0;
						this.tabs_cg.map(cg=>{
							//判断是否更改
							var is_old_cg = true;//默认相同
							
							//判断附件是否相同
							if (!cg.id || !me.tabs_cg_old_obj[cg.id]) {
								is_old_cg = false;
							}
							if (is_old_cg) {
								me.attachment_type_cg.map(cgff=>{
									if (cg[cgff.code] != me.tabs_cg_old_obj[cg.id][cgff.code]) {
										is_old_cg = false;
									}
								})
							}
							//如果附件相同,判断其它属性
							if (is_old_cg) {
								me.tableFields_cg.map(cgff=>{
									if (cg[cgff.field] != me.tabs_cg_old_obj[cg.id][cgff.field]) {
										is_old_cg = false;
									}
								})
							}
							if (!is_old_cg) {
								if (cg.customer_certification_id != param.id) {
									cg.customer_certification_id = param.id;
									if(cg.id) {
										cg.old_id = clone(cg.id);
									}
									
									cg.id = null;
								}
								
								cg.delivery_part_code = (this.acctObj).delivery_part_code
								cg.delivery_part_name = (this.acctObj).delivery_part_name
								
								cg.order_no = j;
								procureList_.push(cg);
							}
							else if (cg.customer_certification_id == param.id) {
								cg.order_no = j;
								procureList_.push(cg);
							}
							j++;
						// var procureList_ = [];
						// var j = 0;
						// this.tabs_cg.map(cg=>{
						// 	if (this.popupParames.sceneCode == "licence_version") {//资质变更
						// 		if (cg.customer_certification_id != me.newQualifications.id) {
						// 			cg.customer_certification_id = me.newQualifications.id;
						// 			if(cg.id) {
						// 				cg.old_id = clone(cg.id);
						// 			}
						// 			cg.id = null;
						// 		}
						// 	}
							
						// 	cg.delivery_part_code = (this.acctObj).delivery_part_code
						// 	cg.delivery_part_name = (this.acctObj).delivery_part_name
							
						// 	cg.order_no = j;
						// 	procureList_.push(cg);
						// 	j++
						});
						if (procureList_.length) {
							param.procure_list = procureList_;
						}else {
							param.procure_list = null;
						}
						
						//质保
						if (this.issubmit) {
							c_form_zz = me.onCheckFormByRef(this.attachment_type_zb, this.file_zs);
							if (c_form_zz) {
								Root.message({
									type: 'warning',
									message: '缺少质保必填项【' + c_form_zz + '】'
								});  
								me.loading_save = false;
								me.issubmit = false;
								me.loading_submit = false;
								return;
							}
						}
						//qaInfo
						var infoList_ = [];
						//attachment_type_zb
						this.attachment_type_zb.map(zb=>{
							var zbobj_ = me.file_zs[zb.code];
							var zbobj_old = me.file_zs_old[zb.code];
							
							if (zbobj_ && zbobj_.file_id) {
								//判断是否更改
								var is_old_zb = true;//默认相同
								
								if (zbobj_.file_id && !zbobj_old.file_id) {
									//新增的证照信息
									is_old_zb = false;
								}
								else if (zbobj_old.file_id && zbobj_.file_id) {
									//附件不同,有更改
									if (zbobj_old.file_id != zbobj_.file_id) {
										is_old_zb = false;
									}
									else {
										me.tableFields_zz.map(zzf=>{
											if (zbobj_old[zzf.field] != zbobj_[zzf.field]) {
												is_old_zb = false;
											}
										})
									}
								}
								
								//如果不相同
								if (!is_old_zb) {
									//资质id是否是本此资质的id
									if (zbobj_.customer_certification_id != param.id) {
										zbobj_.customer_certification_id = param.id;
										if(zbobj_.id) {
											zbobj_.old_id = clone(zbobj_.id);
										}
										zbobj_.id = null;
									}
									
									infoList_.push(zbobj_);
								}
							}
							
						});
						
						if (infoList_.length) {
							param.qa_info = infoList_[0];
						}else {
							param.qa_info = null;
						}
						// var formData_zb_notnull = false;
						// //attachment_type_zb
						// this.attachment_type_zb.map(zb=>{
						// 	var zbobj_ = me.file_zs[zb.code];
							
						// 	if (zbobj_ && zbobj_.file_id && zbobj_.customer_certification_id) {
						// 		//zbobj_.code = zb.attachment_code;
						// 		if (this.popupParames.sceneCode == "licence_version") {//资质变更
						// 			if (zbobj_.customer_certification_id != me.newQualifications.id) {
						// 				zbobj_.customer_certification_id = me.newQualifications.id;
										
						// 				if(zbobj_.id) {
						// 					zbobj_.old_id = clone(zbobj_.id);
						// 				}
						// 				zbobj_.id = null;
						// 			}
						// 		}
						// 	}
														
						// 	for (var zb_ in zbobj_) {
						// 		zbobj_.only_attachment = true;
						// 		formData_zb_notnull = true;
						// 	}
							
						// 	if (formData_zb_notnull) {
						// 		param.qa_info = zbobj_;
						// 	}else {
						// 		param.qa_info = null;
						// 	}
						// });
						//纸质物流
						param.logistics_company = this.logistics_company;
						param.logistics_no = this.logistics_no;
						//纸质确认
						param.logistics_check = this.logistics_check;
						
						param.type = "create";
						param.isClientMode = false;
						
						Server.call("root/customer/saveCustomerCertification", param, function(result) {
							var result_ = result;
							me.loading_save = false;
							if (result && result.success) {
								me.issubmit = false;
								var id_ = result.data.id;
								
								let param_table = {
									isClientMode: false,
									dataname: "getCustomerDeliveryCertificationStatus",
									returnType: "entityset",
									filter: "customer_delivery_certification_mapping.customer_uscc='" + me.formData_jc.uscc + "' and customer_delivery_certification_mapping.delivery_part_code='"+ me.acctObj.delivery_part_code +"' and customer_delivery_certification_mapping.id<>'" + id_ + "'"
								}
								Server.call("root/data/procedure", param_table, function(result_t) {
									console.log(result_t);
									if (result_t.data.entityset && result_t.data.entityset.length) {
										Root.message({
											type: 'warning',
											message: '该商业备案和主体资质已存在流程'
										});  
										me.loading_submit = false;
									}
									else {
										var param_c = {
											isClientMode: false,
											id: id_
										}
										Server.call("root/customer/checkCustomerCertification", param_c, function(result1) {
											if (result1.success) {
												me.textarea2 = "";
												me.reasonvisible = true;
												me.passOrRefuse = true;
												me.type_act = "accountCustomerCertification";
											}
											else {
												Root.message({
													type: 'warning',
													message: '校验失败'
												});
											}
											
										}, function(result1) {
											console.log(result1);
											me.loading_submit = false;
											if (result1.message) {
												Root.message({
													type: 'error',
													message: result1.message
												}); 
											}
										});
										
									}
								})
							}
						}, function(result1) {
							console.log(result1);
							me.loading_save = false;
							me.loading_submit = false;
							me.issubmit = false;
							if (result1.message) {
								Root.message({
									type: 'error',
									message: result1.message
								}); 
							}
						})
					},
					onreturnApproval() {
						this.returnApproval(this.acctObj.cer_flow_id);
					},
					//资质审批
					onpassApproval(){
						if (this.isapprovaledit) {
							if(!this.logistics_check) {
								//弹出提示
								
								
							}
							
							
							this.issubmit = true;
							this.saveForm_approval();
						}
						else {
							this.textarea2 = "";
							this.reasonvisible = true;
							this.passOrRefuse = true;
							this.type_act = "accountCustomerCertification";
						}
					},
					
					onrefuseApproval(){
						this.textarea2 = "";
						this.reasonvisible = true;
						this.passOrRefuse = false;
						this.type_act = "accountCustomerCertification";
					},
					
					saveReason() {
					    var me = this;
					    var actpassword_ = localStorage.getItem("actpassword");
					    if (actpassword_) {
					        var config = {
								text: "流程验证",
								url: "../tool/popup_actpassword.html",
								callback: function(obj, callback) {
									me.dosaveReason();
									if (callback) {
										callback();
									}
								}
					       };
					       this.doPopupByPublic(config);
					    }
					    else {
					       this.dosaveReason();
					    }
					},
					
					dosaveReason(){
						this.loading_approval = true;
						if(this.passOrRefuse){
							this.passApproval(true,this.textarea2)
						}else{
							if(this.textarea2 != ""){
								this.passApproval(false,this.textarea2)
							}
							else{
								Root.message({
									type: 'warning',
									message: '请填写原因'
								});
								this.loading_approval = false;
							}
						}
					},
					
					//审批
					passApproval(pass_,reason_) {
						let me = this;
						
						if(reason_) {
							//去除两端的空格
							reason_ = reason_.replace(/(^\s*)|(\s*$)/g, "");
							
							//去除中间的回车换行
							reason_ = reason_.replace(/[\r\n]/g,"");
						}
						
						var variable_map_ = {
							reason: reason_,
							stict: false
						}
						
						if (this.acctObj.freeze) {
							variable_map_ = {
								reason: reason_,
								stict: false,
								
								province: me.acctObj.record_province,
								partType: me.acctObj.part_type,
								businessType: me.acctObj.business_type,
								customerPartCode: me.acctObj.customer_part_code,
								operateCode: me.acctObj.business_operate_code
							}
						}
						else {
							variable_map_ = {
								reason: reason_,
								stict: false,
								
								province: me.acctObj.record_province,
								partType: me.acctObj.part_type,
								businessType: me.acctObj.business_type,
								customerPartCode: me.acctObj.customer_part_code,
								operateCode: me.acctObj.business_operate_code
							}
						}
						
						if (this.attachment) {
							variable_map_.attachment = this.attachment;
						}
						
						let param = {
							flow_id: this.acctObj.cer_flow_id,
							pass: pass_,
							
							variable_map: variable_map_,
							business_type: this.type_act,
							isClientMode: false
						}
						
						Server.call("root/api/dealAct", param, function(result) {
							console.log(result);
							me.loading_approval = true;
							if (result.success){
								Root.message({
									type: 'success',
									message: '审批成功'
								}); 
								if(me.fromDing) {
									me.dingResult = true;
									me.dingResultTxt = "审批成功"
									return;
								}
							}else{
								Root.message({
									type: 'warning',
									message: '审批失败'
								}); 
								if(me.fromDing) {
									me.dingResult = true;
									me.dingResultTxt = "审批失败"
									return;
								}
							}
							me.saveAfter();
						});
					},
					
					showPopup(obj) {
						this.selectFormField = obj.obj;
						if (this.selectFormField.field == "customer_name") {
							
							let me = this;
							let filter_ = " 1=1 ";
							
							filter_ = this.Getfilter(filter_,"customer_name");
							filter_ += " and ";
							Root.showPopup({
								url: "../md/customer/popup/customer_list.html",
								width: 800,
								height: 550,
								filter:filter_,
								dataname:"getCustomer_name",
								callback: function(obj, callback) {
									let formData_ = clone(me.formData);
									formData_.customer_name = obj.row.md_description;
									formData_.customer_consignee_address = obj.row.address;
									formData_.customer_consignee_user_name = obj.row.operator_name;
									formData_.customer_code = obj.row.md_code;
									formData_.customer_id = obj.row.id;
									formData_.manager_part_name = "";
									formData_.delivery_part_name = "";
									formData_.province_name = "";
									formData_.settle_type = "";
									formData_.business_depart_name = "";
									
									if (obj.row.overdue == "0") {
										formData_.overdue = "超账期"
										formData_.iscreditsuccess = "0"
									}
									else if (obj.row.overdue == "1"){
										formData_.overdue = "未超账期"
										formData_.iscreditsuccess = "1"
									}
									me.formData = formData_;
									me.tableData2 = [];
									me.checkCustomerAndDelivery();
									if (callback) {
										callback();
									}
								}
							});
						}
						else if (this.selectFormField.field == "delivery_part_name" ) {
							let me = this;
							var filter_ = " 1 = 1";
							filter_ = this.Getfilter(filter_,"delivery_part_name");
							Root.showPopup({
								url: "../org/company/popup/managesubject_list.html",
								width: 800,
								height: 550,
								dataname:"getDelivery_part_name",
								type :"managesubjectname",
								filter:filter_,
								callback: function(obj, callback) {
									let formData_ = clone(me.formData);
									formData_.delivery_part_name = obj.row.delivery_part_name;
									formData_.delivery_part_code = obj.row.delivery_part_code;
									me.formData = formData_;
									me.tableData2 = [];
									
									me.checkCustomerAndDelivery();
									if (callback) {
										callback();
									}
								}
							});
						}
						else if (this.selectFormField.field == "business_depart_name"){ //业务部门
							let me = this;
							var filter_ = " 1 = 1 and name is not null ";
							filter_ = this.Getfilter(filter_,"business_depart_name");
							
							Root.showPopup({
								url: "../org/department/popup/department_list.html",
								width: 800,
								height: 550,
								dataname:"getBusiness_depart_name",
								filter:filter_,
								callback: function(obj, callback) {
									let formData_ = clone(me.formData);
									formData_.business_depart_name = obj.row.name
									me.formData = formData_;
									if (callback) {
										callback();
									}
								}
							});
						}
						else if (this.selectFormField.field == "province_name"){
							let me = this;
							var filter_ = " 1 = 1";
							filter_ = this.Getfilter(filter_,"province_name");
							
							Root.showPopup({
								url: "../org/department/popup/area_list.html",
								width: 800,
								height: 550,
								dataname:"getProvince_name",
								filter:filter_,
								callback: function(obj, callback) {
									let formData_ = clone(me.formData);
									formData_.province_name = obj.row.province_name
									me.formData = formData_;
									if (callback) {
										callback();
									}
								}
							});
						}
						else if (this.selectFormField.field == "upload"){
							let me = this;
							Root.showPopup({
								url: "../tool/popup_uploadEnclosure.html",
								width: 800,
								height: 550,
								callback: function(obj, callback) {
									let formData_ = clone(me.formData);
									formData_.ids = obj.row.id
									me.formData = formData_;
									if (callback) {
										callback();
									}
								}
							});
						}
					},
					
					showFileImgByFileId(file_id, file_name) {
						this.zzimg = {};
						this.zzimgList = [];
						this.file_txt = false;
						if(file_id && file_name) {
							var fileid = file_id;
							let fileName = clone(file_name);
							let index1 = fileName.lastIndexOf(".");
							let index2 = fileName.length;
							let suffix = fileName.substring(index1, index2).toLowerCase(); //后缀名
							
							if (suffix == ".png" || suffix == ".jpg") {
								var zzimg_ = {
									id: fileid,
									url: getDownloadFileUrl(fileid)
								}
								
								this.zzimgList.push(zzimg_.url);
								this.zzimg = zzimg_;
								this.file_img = true;
							}
							else if (suffix == ".pdf") {
								var row = {
									fileid: fileid,
									filename: fileName
								}
								
								var config = {
									totab: true,
									icon: "icon-product",
									text: "附件预览",
									id: "pdf_" + fileid,
									url: "../tool/popup_file_pdf.html",
									data: row,
									delta: {},
									callback: function(obj, callback) {
										if (callback) {
											callback();
										}
									}
								};
								this.doPopupByPublic(config);
								
							}
							else {//只可下载,不可预览
								var zzimg_ = {
									id: fileid
								}
								this.zzimg = zzimg_;
								this.file_img = true;
							}
							// var zzimg_ = {
							// 	id: fileid,
							// 	url: getDownloadFileUrl(fileid)
							// }
							// this.zzimgList.push(zzimg_.url);
							
							// this.zzimg = zzimg_;
							// this.file_img = true;
						}
						
					},
					
					showFileImg(type) {
						this.zzimg = {};
						this.zzimgList = [];
						this.file_txt = false;
						if(this.file_zs[type].file_id) {
							var fileid = this.file_zs[type].file_id;
							
							let fileName = clone(this.file_zs[type].file_name);
							let index1 = fileName.lastIndexOf(".");
							let index2 = fileName.length;
							let suffix = fileName.substring(index1, index2).toLowerCase(); //后缀名
							
							if (suffix == ".png" || suffix == ".jpg") {
								var zzimg_ = {
									id: fileid,
									url: getDownloadFileUrl(fileid)
								}
								
								this.zzimgList.push(zzimg_.url);
								this.zzimg = zzimg_;
								this.file_img = true;
							}
							else if (suffix == ".pdf") {
								var row = {
									fileid: fileid,
									filename: fileName
								}
								
								var config = {
									totab: true,
									icon: "icon-product",
									text: "附件预览",
									id: "pdf_" + fileid,
									url: "../tool/popup_file_pdf.html",
									data: row,
									delta: {},
									callback: function(obj, callback) {
										if (callback) {
											callback();
										}
									}
								};
								this.doPopupByPublic(config);
								
							}
							else {//只可下载,不可预览
								var zzimg_ = {
									id: fileid
								}
								this.zzimg = zzimg_;
								this.file_img = true;
							}
							
							
							
						}
						
					},
					
					/* showFileImg(type) {
						this.zzimg = {};
						this.zzimgList = [];
						this.file_txt = false;
						if(this.file_zs[type].file_id) {
							var fileid = this.file_zs[type].file_id;
							var zzimg_ = {
								id: fileid,
								url: getDownloadFileUrl(fileid)
							}
							this.zzimg = zzimg_;
							this.zzimgList.push(zzimg_.url);
							
							this.file_img = true;
						}
						
					}, */
					
					onDownloadFileByFileId(fileid) {
						handleDownload(fileid);
					},
					
					/* showFileImgByFileId(file_id) {
						this.zzimg = {};
						this.file_txt = false;
						if(file_id) {
							var fileid = file_id;
							var zzimg_ = {
								id: fileid,
								url: getDownloadFileUrl(fileid)
							}
							this.zzimg = zzimg_;
							this.file_img = true;
						}
						
					}, */
					
					showFileTxt(type) {
						//this.file_zs;
						var me = this;
						this.file_img = false;
						this.file_txt = true;
						this.selectZZName = this.attachment_type_zzobj[type].name;
						this.selectZZType = type;
						if (!me.formAttr_zz.disabled) {
							this.$nextTick(() => {
								var aa = me.$refs.form_zzxx.checkForm();
							})
						}
						
					},
					
					delFile(zz_code, type, filetypename, row) {//
						var me = this;
						
						Root.confirm('确定删除-' + filetypename + '-的附件吗?', '删除提示', {
						  confirmButtonText: '删除',
						  cancelButtonText: '取消',
						  type: 'warning'
						}).then(() => {
							me.doDelFile(zz_code, type, row);
						}).catch(() => {
							Root.message({
								type: 'info',
								message: '已取消删除'
							});          
						});
					},
					
					doDelFile(zz_code, type, row) {
						var row_ = clone(row);
						if (type == "zz") {
							//是否绑定在该资质上
							if (row_.customer_certification_id == this.acctObj.cer_id) {
								//如果在该资质上则不需要添加到删除数组中
								
							}
							else {
								//如果在其它资质或在公用信息中则需要添加到删除数组中
								row_.deleted = true;
								row_.customer_certification_id = this.acctObj.cer_id;
								row_.old_id = clone(row).id;
								row_.id = null;
								this.del_zz.push(row_);
							}
							
							row.file_id = "";
							row.file_name = "";
						}
						else if (type == "kp") {
							//是否绑定在该资质上
							if (row_.customer_certification_id == this.acctObj.cer_id) {
								//如果在该资质上则不需要添加到删除数组中
							}
							else {
								//如果在其它资质或在公用信息中则需要添加到删除数组中
								row_.deleted = true;
								row_.customer_certification_id = this.acctObj.cer_id;
								row_.old_id = clone(row).id;
								row_.id = null;
								this.del_zz.push(row_);
							}
							row.prove_file_id = "";
							row.prove_file_name = "";
						}
						else if (type == "sh") {
							row.book_file_id = "";
							row.book_name = "";
						}
						else if (type == "cg") {
							row.book_file_id = "";
							row.book_name = "";
						}
						else if (type == "zb") {
							row_.deleted=true;
							//this.del_zb.push(row_);
							
							row.file_id = "";
							row.file_name = "";
						}
						
						Root.message({
							type: 'success',
							message: '已删除,保存后生效'
						});
					},
					
					onPopupByUploadFile(zz_code, type) {
						var me = this;
						var analysistype_ = "";
						var delta_ = {filetypelist: []};
						if(zz_code == "ZGL01") {
							analysistype_ = "BizLicense";
							delta_ = {filetypelist: [".png", ".jpg"], analysistype: analysistype_}
						}
						else if(zz_code == "ZGL03") {
							analysistype_ = "BizYPLicence";
							delta_ = {filetypelist: [".png", ".jpg"], analysistype: analysistype_}
						}
						else if(zz_code == "ZGL06") {
							analysistype_ = "BizGSP";
							delta_ = {filetypelist: [".png", ".jpg"], analysistype: analysistype_}
						}
						var config = {
							totab: false,
							width: "1500px",
							icon: "icon-product",
							text: "附件上传",
							id: "popupByUploadFile",
							url: "../tool/popup_uploadFile.html",
							data: {},
							delta: delta_,
							callback: function(obj, callback) {
								me.uploadFileAfter(zz_code, type, obj);
							//	me.fileList = obj.row[0];
								if (callback) {
									callback();
								}
							}
						};
						this.doPopupByPublic(config);
					},
					
					doPopupByPublic(config) {
						if (config.totab) {
							if (config.url) {
								if (config.text.length > 4) {
									config.text = config.text.substr(0, 4) + "...";
								}
							}
							var parames = {
								totab: true,
								url: config.url,
								sceneCode: config.sceneCode,
								data: config.data,
								delta: config.delta,
								disabled: config.disabled,
								disabledone: config.disabledone,
								operationtype: config.operationtype,
								parentOption: window.top.tab.selected.option
							};
							
							Root.popupParames = parames;
							
							window.top.tab.open(config);
						}
						else {
							this.doPopup(config);
						}
					},
					
					uploadFileAfter(zz_code, type, obj) {
						//this.file_zs[zz_code] = obj.id;
						var me = this;
						if (type == "zz") {
							this.uploadFormByZZ(zz_code, type, obj);
						}
						if (type == "kp") {
							this.uploadFormByKP(zz_code, obj);
						}
						if (type == "sh") {
							this.uploadFormBySH(zz_code, type, obj);
						}
						if (type == "cg") {
							this.uploadFormByCG(zz_code, type, obj);
						}
						if (type == "zb") {
							this.uploadFormByZB(zz_code, type, obj);
						}
						
						/* this.refresh_formzz = false;
						this.$nextTick(() => {
							me.refresh_formzz = true;
						}) */
					},
					
					uploadFormByZZ(zz_code, type, obj) {
						var me = this;
						
						var licenceObj_ = {};
						var file_zs_ = clone(this.file_zs);
						if (file_zs_[zz_code] && file_zs_[zz_code].id) {
							licenceObj_ = file_zs_[zz_code];
							if (file_zs_[zz_code].customer_id) {
								file_zs_[zz_code].id = null;
								file_zs_[zz_code].customer_id = null;
							}
						}
						else {
							file_zs_[zz_code] = {};
						}
						if (!licenceObj_.customer_certification_id) {
							licenceObj_.customer_certification_id = this.acctObj.cer_id;
						}
						
						var file_ = obj.row[0];
						var filetxt = obj.filetxt;
						if((zz_code == "ZGL01" || zz_code == "ZGL03" || zz_code == "ZGL06") && !filetxt) {
							Root.message({
								type: 'warning',
								message: '没有解析到数据'
							}); 
						}
						
						else if(zz_code == "ZGL01" || zz_code == "ZGL03" || zz_code == "ZGL06") {
							
							/* if (!filetxt) {
								Root.message({
									type: 'warning',
									message: '没有解析到数据'
								}); 
								return
							} */
							
							if(zz_code == "ZGL01" && filetxt["RegNum"] != this.formData_jc.uscc) {
								Root.message({
									type: 'warning',
									message: '导入的营业执照序号与商业的统一信用代码不一致'
								}); 
								return
							}
							
							if (filetxt) {
								for (var k in this.filetypeMappin[zz_code]) {
									var txt = filetxt[this.filetypeMappin[zz_code][k]];
									if (!txt) {
										continue
									}
									
									if (k == "num" && txt && txt.length > 25) {
										txt = "";
									}
									
									if (k == "licence_date") {//"SetDate": "1998年11月"
										txt = txt.toString();
										var year_index = txt.indexOf("å¹´");
										var year_index_l = txt.lastIndexOf("å¹´");
										
										var month_index = txt.indexOf("月");
										var month_index_l = txt.lastIndexOf("月");
										
										var day_index = txt.indexOf("æ—¥");
										var day_index_l = txt.lastIndexOf("æ—¥");
										
										
										if (year_index != -1 && month_index != -1) {
											if (year_index == year_index_l && month_index == month_index_l) {
												txt = txt.substring(year_index - 4, day_index_l)
											}
											else {
												txt = "";
											}
										}
										
										txt = txt.replace("å¹´", "-");
										txt = txt.replace("月", "-");
										txt = txt.replace("æ—¥", "");
										
										if (txt) {
											licenceObj_[k] = txt;
										}
									}
									if (k == "license_term") {//"Period": "1998年11月至长期"
										var txtList = txt.split("至");
										
										if(txtList[0] == "年月日"){
											txt = "2099-12-31";
										}
										else {
											if (txtList.length > 1) {
												if(txtList[1].indexOf("长期") != -1){
													txt = "2099-12-31";
												}
												else {
													txt = txtList[1];
													
													txt = txt.replace("å¹´", "-");
													txt = txt.replace("月", "-");
													txt = txt.replace("æ—¥", "");
													
													//licenceObj_[k] = txt;
												}
											}
											else {
												txt = txtList[0];
												
												txt = txt.replace("å¹´", "-");
												txt = txt.replace("月", "-");
												txt = txt.replace("æ—¥", "");
											}
										}
										
										licenceObj_[k] = txt;
									}
									else {
										licenceObj_[k] = txt;
									}
								}
							}
						}
						
						var zzObj = this.attachment_type_zzobj[zz_code];
						
						licenceObj_.type = zzObj.code;
						licenceObj_.type_name = zzObj.name;
						licenceObj_.file_id = file_.id;
						licenceObj_.file_name = file_.name;
						licenceObj_.only_attachment = zzObj.only_attachment;
						licenceObj_.owned_by = zzObj.owned_by;
						
						/* if (this.formData_jc.id) {
							licenceObj_.customer_id = this.formData_jc.id;
						} */
						
						file_zs_[zz_code] = licenceObj_;
						
						this.file_zs = file_zs_;
						
					},
					
					uploadFormByKP(zz_code, obj){
						var me = this;
						var file_ = obj.row[0];
						
						var from_ = clone(this.formData_kp);
						
						if (!from_.customer_certification_id) {
							from_.customer_certification_id = this.acctObj.cer_id;
						}
						
						from_[zz_code] = file_.id;
						if (zz_code == "prove_file_id") {
							from_.prove_file_name = file_.name;
						}
						else if (zz_code == "invoice_file_id") {
							from_.invoice_file_name = file_.name;
						}
						this.formData_kp = from_;
					},
					
					uploadFormBySH(zz_code, type, obj){
						var me = this;
						var file_ = obj.row[0];
						let activeName = this.activeTabs_sh.split("_")[0];
						var tabs_sh_ = clone(this.tabs_sh);
						
						var from_ = tabs_sh_[activeName*1];
						from_[zz_code] = file_.id;
						if (zz_code == "book_file_id") {
							from_.book_name = file_.name;
						}
						else if (zz_code == "id_card_file_id") {
							from_.id_card_name = file_.name;
						}
						
						/* if (this.acctObj.cer_id) {
							licenceObj_.cer_id = this.acctObj.cer_id;
						} */
						this.tabs_sh = tabs_sh_;
					},
					formCheckboxChange_sh(obj) {
						if (obj.fieldobj.field =="id_card_term") {
							let activeName = this.activeTabs_sh.split("_")[0];
							var tabs_sh_ = clone(this.tabs_sh);
							
							var from_ = tabs_sh_[activeName*1];
							if(from_.islongterm) {
								from_.id_card_term = "2099-12-31"
							}
							this.tabs_sh = tabs_sh_;
						}
					},
					uploadFormByCG(zz_code, type, obj){
						var me = this;
						var file_ = obj.row[0];
						let activeName = this.activeTabs_cg.split("_")[0];
						var tabs_cg_ = clone(this.tabs_cg);
						
						var from_ = tabs_cg_[activeName*1];
						from_[zz_code] = file_.id;
						if (zz_code == "book_file_id") {
							from_.book_name = file_.name;
						}
						else if (zz_code == "id_card_file_id") {
							from_.id_card_name = file_.name;
						}
						else if (zz_code == "diploma_file_id") {
							from_.diploma_name = file_.name;
						}
						
						/* if (this.acctObj.cer_id) {
							licenceObj_.cer_id = this.acctObj.cer_id;
						} */
						this.tabs_cg = tabs_cg_;
					},
					
					formCheckboxChange_cg(obj) {
						if (obj.fieldobj.field =="id_card_term") {
							let activeName = this.activeTabs_cg.split("_")[0];
							var tabs_cg_ = clone(this.tabs_cg);
							
							var from_ = tabs_cg_[activeName*1];
							if(from_.islongterm) {
								from_.id_card_term = "2099-12-31"
							}
							this.tabs_cg = tabs_cg_;
						}
					},
					uploadFormByZB(zz_code, type, obj){
						
						
					},
					
					formChange_zz(obj) {
						var form_ = this.file_zs[this.selectZZType];
						if (!form_.customer_certification_id) {
							if(form_.id) {
								form_.old_id = clone(form_.id);
							}
							
							form_.customer_certification_id = this.acctObj.cer_id;
							form_.id = null;
						}
					},
					
					formChange_kp(obj) {
						var form_ = this.formData_kp;
						if (!form_.customer_certification_id) {
							if(form_.id) {
								form_.old_id = clone(form_.id);
							}
							form_.customer_certification_id = this.acctObj.cer_id;
							form_.id = null;
						}
						
					},
					
					formChange_sh(obj) {
						/* var tabs_sh_ = clone(this.tabs_sh);
						let activeName = this.activeTabs_sh.split("_")[0];
						
						var from_ = tabs_sh_[activeName*1];
						
						if (!form_.customer_certification_id) {
							form_.id = null;
							form_.customer_certification_id = this.acctObj.cer_id;
						}
						
						this.tabs_sh = tabs_sh_; */
					},
					
					formChange_cg(obj) {
						/* var tabs_cg_ = clone(this.tabs_cg);
						let activeName = this.activeTabs_cg.split("_")[0];
						
						var from_ = tabs_cg_[activeName*1];
						
						if (!form_.customer_certification_id) {
							form_.id = null;
							form_.customer_certification_id = this.acctObj.cer_id;
						}
						
						this.tabs_cg = tabs_cg_; */
					},
					
					
					formChange_zb(obj) {
						
					},
					
					formChange_wl() {
						
					},
					
					onPopupByUploadFileAll() {
						var me = this;
						this.attachment = "";
						this.attachment_name = "";
						
						var config = {
							totab: false,
							width: "1500px",
							icon: "icon-product",
							text: "附件上传",
							id: "popupByUploadFile",
							url: "../tool/popup_uploadFile.html",
							data: {},
							delta: {filetypelist: []},
							callback: function(obj, callback) {
								var file_ = obj.row[0];
								me.attachment = file_.id;
								me.attachment_name = file_.name;
								
								if (callback) {
									callback();
								}
							}
						};
						this.doPopupByPublic(config);
					},
					
					onShowApproval() {
						var me = this;
						let param = {
							isClientMode: false,
							flowId: this.acctObj.cer_flow_id
						}
						
						Server.call("root/order/getHistoryTask/", param, function(result) {
							console.log(result);
							if (result && result.data) {
								me.getApprovalRecord(result.data);
							}
						}); 
							
					},
					
					getApprovalRecord(data) {
						let me = this;
						var config = {
							hide_close: true,
							width: "900px",
							height:"600px",
							url: "../approval/ApprovalList.html",
							data: data,
							delta: {
								flow_id: this.acctObj.cer_flow_id,
								title: this.title
							},
						};
						this.doPopupByPublic(config);
					},
					
				}
			});
		</script>
		<style>
			.zs_ .el-form-item {
				position: relative;
				line-height: 34px !important;
			}
			.zs_ .el-form-item__label {
				font-size: 12px;
				line-height: 20px;
				position: absolute;
				bottom: 5px;
			}
			
			.zs_ .el-form-item__content {
				line-height: 34px !important;
			}
			
			.zs_ .close_file {
				float: left;
			}
			
			.zs_ .close_file:hover {
				color: red;
				font-weight: bold;
				cursor: pointer;
			}
			
			.el-image-viewer__wrapper .el-icon-circle-close {
			    color: #c00606;
			}
			
			.fj_button .el-button--small, .fj_button .el-button--small.is-round {
			    padding: 9px 9px;
			}
			.header {
				height: 21px;
			}
			.el-dialog__header {
			    border-bottom: 0;
			}
			.el-dialog__body {
			    text-align: center;
				/* height: 200px; */
			}
		</style>
		
	</body>
</html>