<template xmlns:v-slot="http://www.w3.org/1999/XSL/Transform">
	<div>
		<el-form :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''" :disabled="(status === 'audit' || status === 'taskFormDetail') && testFlag"
				 label-width="100px" @submit.native.prevent>

			<el-divider content-position="left"><i class="el-icon-document"></i> 中信银行卡信息</el-divider>
			<el-row :gutter="26">
				<el-col :span="12">
					<el-form-item label="中信银行卡号" prop="zxBankCardNumber" :rules="[{required: true, message: '中信银行卡号不能为空', trigger: 'blur'}]">
						<el-input v-model="inputForm.zxBankCardNumber" @change="checkBankNumber(inputForm.zxBankCardNumber,'zx')" maxlength="19"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="开户行" prop="zxAccountHolder" :rules="[{required: true, message: '开户行不能为空', trigger: 'blur'}]">
						<el-input v-model="inputForm.zxAccountHolder" ></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="银行卡正面" prop="accountHolderFront" :rules="[
						{required: true, message: '银行卡正面不能为空', trigger: 'blur'}
					]">
						<!--<el-upload
							class="avatar-uploader"
							:action="`${$http.BASE_URL}/public-modules-server/oss/file/webUpload/upload`"
							:show-file-list="false"
							:on-success="handleAvatarSuccess"
						>
							<img v-if="imageUrl" :src="imageUrl" class="avatar" />
							<el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
						</el-upload>-->
						<el-upload :action="`${$http.BASE_URL}/public-modules-server/oss/file/webUpload/upload`"
								   :limit="limitNum"
								   :disabled="hideUploadEdit"
								   list-type="picture-card"
								   :auto-upload="true"
								   :on-success="handleUploadSuccess"
								   v-model:file-list="fileList"
						>
							<el-icon><Plus /></el-icon>

							<template #file="{ file }">
								<div>
									<img class="el-upload-list__item-thumbnail" :src="file.url" alt="" />
									<span class="el-upload-list__item-actions">
										  <span
											  class="el-upload-list__item-preview"
											  @click="handlePictureCardPreview(file)"
										  >
											<el-icon><zoom-in /></el-icon>
										  </span>
										  <span
											  class="el-upload-list__item-delete"
											  @click="handleDownload(file)"
										  >
											<el-icon><Download /></el-icon>
										  </span>
										  <span
											  v-if="!testDisabledFlag"
											  class="el-upload-list__item-delete"
											  @click="handleRemove(file,fileList)"
										  >
											<el-icon><Delete /></el-icon>
										  </span>
									</span>
								</div>
							</template>
						</el-upload>
						<el-dialog v-model="dialogVisible">
							<img w-full :src="inputForm.accountHolderFrontUrl" alt="Preview Image" :style="{ maxWidth: '100%', maxHeight: '100%' }"/>
						</el-dialog>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="银行卡反面" prop="accountHolderOpposite" :rules="[
						{required: true, message: '银行卡反面不能为空', trigger: 'blur'}
					]">
						<!--<el-upload
							class="avatar-uploader"
							:action="`${$http.BASE_URL}/public-modules-server/oss/file/webUpload/upload`"
							:show-file-list="false"
							:on-success="handleAvatarSuccess"
						>
							<img v-if="imageUrl" :src="imageUrl" class="avatar" />
							<el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
						</el-upload>-->
						<el-upload :action="`${$http.BASE_URL}/public-modules-server/oss/file/webUpload/upload`"
								   :limit="limitNum"
								   :disabled="hideUploadEdit2"
								   list-type="picture-card"
								   :auto-upload="true"
								   :on-success="handleUploadSuccess2"
								   v-model:file-list="fileList2"
						>
							<el-icon><Plus /></el-icon>

							<template #file="{ file }">
								<div>
									<img class="el-upload-list__item-thumbnail" :src="file.url" alt="" />
									<span class="el-upload-list__item-actions">
										  <span
											  class="el-upload-list__item-preview"
											  @click="handlePictureCardPreview2(file)"
										  >
											<el-icon><zoom-in /></el-icon>
										  </span>
										  <span
											  class="el-upload-list__item-delete"
											  @click="handleDownload2(file)"
										  >
											<el-icon><Download /></el-icon>
										  </span>
										  <span
											  v-if="!testDisabledFlag"
											  class="el-upload-list__item-delete"
											  @click="handleRemove2(file,fileList)"
										  >
											<el-icon><Delete /></el-icon>
										  </span>
									</span>
								</div>
							</template>
						</el-upload>
						<el-dialog v-model="dialogVisible2">
							<img w-full :src="inputForm.accountHolderOppositeUrl" alt="Preview Image" :style="{ maxWidth: '100%', maxHeight: '100%' }"/>
						</el-dialog>
					</el-form-item>
				</el-col>
			</el-row>
			<el-divider content-position="left"><i class="el-icon-document"></i> 招商银行卡信息</el-divider>
			<el-row :gutter="26">
				<el-col :span="12">
					<el-form-item label="招商银行卡号" prop="gsBankCardNumber" :rules="[{required: true, message: '招商银行卡号不能为空', trigger: 'blur'}]">
						<el-input v-model="inputForm.gsBankCardNumber" @change="checkBankNumber(inputForm.gsBankCardNumber,'gs')" maxlength="19"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="开户行" prop="gsAccountHolder" :rules="[{required: true, message: '开户行不能为空', trigger: 'blur'}]">
						<el-input v-model="inputForm.gsAccountHolder" ></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="银行卡正面" prop="gsAccountHolderFront" :rules="[
						{required: true, message: '银行卡正面不能为空', trigger: 'blur'}
					]">
						<!--<el-upload
							class="avatar-uploader"
							:action="`${$http.BASE_URL}/public-modules-server/oss/file/webUpload/upload`"
							:show-file-list="false"
							:on-success="handleAvatarSuccess"
						>
							<img v-if="imageUrl" :src="imageUrl" class="avatar" />
							<el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
						</el-upload>-->
						<el-upload :action="`${$http.BASE_URL}/public-modules-server/oss/file/webUpload/upload`"
								   :limit="limitNum"
								   :disabled="gsHideUploadEdit"
								   list-type="picture-card"
								   :auto-upload="true"
								   :on-success="gsHandleUploadSuccess"
								   v-model:file-list="gsFileList"
						>
							<el-icon><Plus /></el-icon>

							<template #file="{ file }">
								<div>
									<img class="el-upload-list__item-thumbnail" :src="file.url" alt="" />
									<span class="el-upload-list__item-actions">
										  <span
											  class="el-upload-list__item-preview"
											  @click="gsHandlePictureCardPreview(file)"
										  >
											<el-icon><zoom-in /></el-icon>
										  </span>
										  <span
											  class="el-upload-list__item-delete"
											  @click="gsHandleDownload(file)"
										  >
											<el-icon><Download /></el-icon>
										  </span>
										  <span
											  v-if="!testDisabledFlag"
											  class="el-upload-list__item-delete"
											  @click="gsHandleRemove(file,fileList)"
										  >
											<el-icon><Delete /></el-icon>
										  </span>
									</span>
								</div>
							</template>
						</el-upload>
						<el-dialog v-model="gsDialogVisible">
							<img w-full :src="inputForm.gsAccountHolderFrontUrl" alt="Preview Image" :style="{ maxWidth: '100%', maxHeight: '100%' }"/>
						</el-dialog>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="银行卡反面" prop="gsAccountHolderOpposite" :rules="[
						{required: true, message: '银行卡反面不能为空', trigger: 'blur'}
					]">
						<!--<el-upload
							class="avatar-uploader"
							:action="`${$http.BASE_URL}/public-modules-server/oss/file/webUpload/upload`"
							:show-file-list="false"
							:on-success="handleAvatarSuccess"
						>
							<img v-if="imageUrl" :src="imageUrl" class="avatar" />
							<el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
						</el-upload>-->
						<el-upload :action="`${$http.BASE_URL}/public-modules-server/oss/file/webUpload/upload`"
								   :limit="limitNum"
								   :disabled="gsHideUploadEdit2"
								   list-type="picture-card"
								   :auto-upload="true"
								   :on-success="gsHandleUploadSuccess2"
								   v-model:file-list="gsFileList2"
						>
							<el-icon><Plus /></el-icon>

							<template #file="{ file }">
								<div>
									<img class="el-upload-list__item-thumbnail" :src="file.url" alt="" />
									<span class="el-upload-list__item-actions">
										  <span
											  class="el-upload-list__item-preview"
											  @click="gsHandlePictureCardPreview2(file)"
										  >
											<el-icon><zoom-in /></el-icon>
										  </span>
										  <span
											  class="el-upload-list__item-delete"
											  @click="gsHandleDownload2(file)"
										  >
											<el-icon><Download /></el-icon>
										  </span>
										  <span
											  v-if="!testDisabledFlag"
											  class="el-upload-list__item-delete"
											  @click="gsHandleRemove2(file,fileList)"
										  >
											<el-icon><Delete /></el-icon>
										  </span>
									</span>
								</div>
							</template>
						</el-upload>
						<el-dialog v-model="gsDialogVisible2">
							<img w-full :src="inputForm.gsAccountHolderOppositeUrl" alt="Preview Image" :style="{ maxWidth: '100%', maxHeight: '100%' }"/>
						</el-dialog>
					</el-form-item>
				</el-col>
			</el-row>
		</el-form>
	</div>
</template>

<script>
	import enrollmentWageCardService from '@/api/human/enrollment/EnrollmentWageCardService'
	import CommonApi from '@/api/cw/common/CommonApi'
	import OSSSerivce, {
		httpRequest,
		fileName,
		toHref,
	} from '@/api/sys/OSSService'

	export default {
		props: {
			businessId: {
				type: String,
				default: ''
			},
			formReadOnly: {
				type: Boolean,
				default: false
			},
			status: {
				type: String,
				default: ''
			}
		},
		data () {
			return {
				title: '',
				method: '',
				testFlag: false,
				testDisabledFlag: false,
				dialogVisible: false,
				dialogVisible2: false,
				hideUploadEdit: false, //控制上传点击
				hideUploadEdit2: false, //控制上传点击
				fileList: [],
				fileList2: [],
				gsDialogVisible: false,
				gsDialogVisible2: false,
				gsHideUploadEdit: false, //控制上传点击
				gsHideUploadEdit2: false, //控制上传点击
				gsFileList: [],
				gsFileList2: [],
				visible: false,
				loading: false,
				limitNum: 1,
				// imageUrl: '',
				inputForm: {
					userId: '',
					procInsId: '',
					zxBankCardNumber: '',
					zxAccountHolder: '',
					gsAccountHolder: '',
					gsBankCardNumber: '',
					accountHolderFront: '',
					accountHolderFrontUrl: '',
					accountHolderOpposite: '',
					accountHolderOppositeUrl: '',
					gsAccountHolderFront: '',
					gsAccountHolderFrontUrl: '',
					gsAccountHolderOpposite: '',
					gsAccountHolderOppositeUrl: '',
				},
				keyWatch: '',
			}
		},
		commonApi: null,
		created () {
			this.ossService = new OSSSerivce()
			this.commonApi = new CommonApi()
		},
		components: {
		},
		computed: {
			bus: {
				get () {
					return this.businessId
				},
				set (val) {
					this.businessId = val
				}
			},
			name () {
				return this.$store.state.user.name
			},
			userId () {
				return this.$store.state.user.id
			}
		},
		watch: {
			'keyWatch': {
				handler (newVal) {
					if (this.commonJS.isNotEmpty(this.bus)) {
						this.init('', this.bus)
					} else {
						this.$nextTick(() => {
							this.$refs.inputForm.resetFields()
						})
					}
				}
			},
			'loading': {
				handler (newVal) {
					this.$emit('changeLoading', newVal)
				}
			}
		},
		methods: {
			handleRemove(file, fileList) {
				this.hideUploadEdit = false
				// 如果需要删除图片信息，可以根据file或其他标识从相应的数据结构中删除信息
				const fileIndex = this.fileList.indexOf(file);
				if (fileIndex !== -1) {
					this.fileList.splice(fileIndex, 1); // 从fileList中删除该图片信息
				}
			},
			handleRemove2(file, fileList) {
				this.hideUploadEdit2 = false
				// 如果需要删除图片信息，可以根据file或其他标识从相应的数据结构中删除信息
				const fileIndex = this.fileList2.indexOf(file);
				if (fileIndex !== -1) {
					this.fileList2.splice(fileIndex, 1); // 从fileList中删除该图片信息
				}
			},
			gsHandleRemove(file, fileList) {
				this.gsHideUploadEdit = false
				// 如果需要删除图片信息，可以根据file或其他标识从相应的数据结构中删除信息
				const fileIndex = this.gsFileList.indexOf(file);
				if (fileIndex !== -1) {
					this.gsFileList.splice(fileIndex, 1); // 从fileList中删除该图片信息
				}
			},
			gsHandleRemove2(file, fileList) {
				this.gsHideUploadEdit2 = false
				// 如果需要删除图片信息，可以根据file或其他标识从相应的数据结构中删除信息
				const fileIndex = this.gsFileList2.indexOf(file);
				if (fileIndex !== -1) {
					this.gsFileList2.splice(fileIndex, 1); // 从fileList中删除该图片信息
				}
			},
			handleDownload(file) {
				let file2 = {
					url: this.inputForm.accountHolderFront
				}
				toHref(file2)
			},
			handleDownload2(file) {
				let file2 = {
					url: this.inputForm.accountHolderOpposite
				}
				toHref(file2)
			},
			gsHandleDownload(file) {
				let file2 = {
					url: this.inputForm.gsAccountHolderFront
				}
				toHref(file2)
			},
			gsHandleDownload2(file) {
				let file2 = {
					url: this.inputForm.gsAccountHolderOpposite
				}
				toHref(file2)
			},
			handlePictureCardPreview(file) {
				this.dialogImageUrl = file.url;
				this.inputForm.accountHolderFrontUrl = file.url
				this.dialogVisible = true;
			},
			handlePictureCardPreview2(file) {
				this.dialogImageUrl = file.url;
				this.inputForm.accountHolderOppositeUrl = file.url
				this.dialogVisible2 = true;
			},
			gsHandlePictureCardPreview(file) {
				this.dialogImageUrl = file.url;
				this.inputForm.gsAccountHolderFrontUrl = file.url
				this.gsDialogVisible = true;
			},
			gsHandlePictureCardPreview2(file) {
				this.dialogImageUrl = file.url;
				this.inputForm.gsAccountHolderOppositeUrl = file.url
				this.gsDialogVisible2 = true;
			},
			handleUploadSuccess(response, file,fileList) {
				return this.handleAvatarSuccess(response,file,fileList,null,'front')
			},
			handleUploadSuccess2(response, file,fileList) {
				return this.handleAvatarSuccess2(response,file,fileList,null,'front')
			},
			gsHandleUploadSuccess(response, file,fileList) {
				return this.gsHandleAvatarSuccess(response,file,fileList,null,'front')
			},
			gsHandleUploadSuccess2(response, file,fileList) {
				return this.gsHandleAvatarSuccess2(response,file,fileList,null,'front')
			},
			handleAvatarSuccess (res, file, fileList, index, val) {
				if (val === 'front') {
					this.inputForm.accountHolderFront = '/' +res.url
					this.inputForm.accountHolderFrontUrl = res.lsUrl
				}
				this.hideUploadEdit = true
				this.$forceUpdate()
			},
			handleAvatarSuccess2 (res, file, fileList, index, val) {
				if (val === 'front') {
					this.inputForm.accountHolderOpposite = '/' +res.url
					this.inputForm.accountHolderOppositeUrl = res.lsUrl
				}
				this.hideUploadEdit2 = true
				this.$forceUpdate()
			},
			gsHandleAvatarSuccess (res, file, fileList, index, val) {
				if (val === 'front') {
					this.inputForm.gsAccountHolderFront = '/' +res.url
					this.inputForm.gsAccountHolderFrontUrl = res.lsUrl
				}
				this.gsHideUploadEdit = true
				this.$forceUpdate()
			},
			gsHandleAvatarSuccess2 (res, file, fileList, index, val) {
				if (val === 'front') {
					this.inputForm.gsAccountHolderOpposite = '/' +res.url
					this.inputForm.gsAccountHolderOppositeUrl = res.lsUrl
				}
				this.hideUploadEdit2 = true
				this.$forceUpdate()
			},
			getKeyWatch (keyWatch) {
				this.keyWatch = keyWatch
			},
			getUpload () {
			},
			init (method, id) {
				this.method = method
				this.inputForm = {
					userId: '',
					procInsId: '',
					zxBankCardNumber: '',
					zxAccountHolder: '',
					gsAccountHolder: '',
					gsBankCardNumber: '',
					accountHolderFront: '',
					accountHolderFrontUrl: '',
					accountHolderOpposite: '',
					accountHolderOppositeUrl: '',
					gsAccountHolderFront: '',
					gsAccountHolderFrontUrl: '',
					gsAccountHolderOpposite: '',
					gsAccountHolderOppositeUrl: '',
				}
				if (method === 'add') {
					this.title = `新建工资卡信息登记`
				} else if (method === 'edit') {
					this.title = '修改报销类型'
				}
				this.inputForm.id = id
				this.visible = true
				this.loading = false

				this.testFlag = false,
					this.testDisabledFlag = false,
					this.dialogVisible = false,
					this.dialogVisible2 = false,
					this.hideUploadEdit = false, //控制上传点击
					this.hideUploadEdit2 = false, //控制上传点击
					this.gsDialogVisible = false,
					this.gsDialogVisible2 = false,
					this.gsHideUploadEdit = false, //控制上传点击
					this.gsHideUploadEdit2 = false, //控制上传点击
				this.$nextTick(() => {
					this.loading = true
					enrollmentWageCardService.findWageCardById(this.inputForm.id).then( async (data) => {
						this.fileList = []
						this.fileList2 = []
						this.gsFileList = []
						this.gsFileList2 = []
						if (this.status === 'audit' || this.status === 'taskFormDetail') {
							method = 'view'
						}
						this.inputForm = this.recover(this.inputForm, data)
						this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
						if (this.commonJS.isNotEmpty(this.inputForm.zxBankCardNumber)) {
							this.testFlag = true
						}
						if (this.commonJS.isNotEmpty(this.inputForm.accountHolderFront)){

							await this.ossService.getTemporaryUrl(this.inputForm.accountHolderFront).then((data) => {
								console.log('data', data)
								let file = {
									url: data
								}
								this.hideUploadEdit = true, //控制上传点击
									this.fileList.push(file)
								// this.inputForm.socialSecurityPictureFrontUrl = data
							})
						}
						if (this.commonJS.isNotEmpty(this.inputForm.accountHolderOpposite)){
							console.log('123')
							await this.ossService.getTemporaryUrl(this.inputForm.accountHolderOpposite).then((data) => {
								let file = {
									url: data
								}
								this.hideUploadEdit2 = true, //控制上传点击
								this.fileList2.push(file)
								// this.inputForm.socialSecurityPictureFrontUrl = data
							})
						}
						if (this.commonJS.isNotEmpty(this.inputForm.gsAccountHolderFront)){
							await this.ossService.getTemporaryUrl(this.inputForm.gsAccountHolderFront).then((data) => {
								let file = {
									url: data
								}
								this.gsHideUploadEdit = true, //控制上传点击
								this.gsFileList.push(file)
								// this.inputForm.socialSecurityPictureFrontUrl = data
							})
						}
						if (this.commonJS.isNotEmpty(this.inputForm.gsAccountHolderOpposite)){
							await this.ossService.getTemporaryUrl(this.inputForm.gsAccountHolderOpposite).then((data) => {
								let file = {
									url: data
								}
								this.gsHideUploadEdit2 = true, //控制上传点击
								this.gsFileList2.push(file)
								// this.inputForm.socialSecurityPictureFrontUrl = data
							})
						}
						await this.commonApi.getTaskNameByProcInsId(this.inputForm.procInsId).then((data) => {
							if (this.commonJS.isNotEmpty(data)) {
								if (data === '审核') {
									this.testDisabledFlag = true
								}
							}
						})
						this.loading = false
					})
				})
			},
			// 表单提交
			doSubmit () {
				this.$refs['inputForm'].validate((valid) => {
					if (valid) {
						this.loading = true
						if (this.commonJS.isEmpty(this.inputForm.files)) {
							this.inputForm.files = []
						}
						this.inputForm.id = this.businessId
						enrollmentWageCardService.saveWageCard(this.inputForm).then((data) => {
							this.close()
							this.$message.success(data)
							this.$emit('refreshDataList')
							this.loading = false
						}).catch(() => {
							this.loading = false
						})
					}
				})
			},
			close () {
				this.$refs.inputForm.resetFields()
				this.fileList = []
				this.fileList2 = []
				this.gsFileList = []
				this.gsFileList2 = []

				this.testFlag = false,
				this.testDisabledFlag = false,
				this.dialogVisible = false,
				this.dialogVisible2 = false,
				this.hideUploadEdit = false, //控制上传点击
				this.hideUploadEdit2 = false, //控制上传点击
				this.gsDialogVisible = false,
				this.gsDialogVisible2 = false,
				this.gsHideUploadEdit = false, //控制上传点击
				this.gsHideUploadEdit2 = false, //控制上传点击
				this.visible = false
			},
			reapplyForm (callback) {
				this.loading = true
				enrollmentWageCardService.findWageCardById(this.inputForm.id).then((data) => {
					if (data.type !== '4') { // 审核状态不是“驳回”，就弹出提示
						this.loading = false
						this.$message.error('任务数据已发生改变或不存在，请在待办任务中确认此任务是否存在')
						throw new Error('任务数据已发生改变或不存在，请在待办任务中确认此任务是否存在')
					} else {
						this.startForm(callback)
					}
				})
			},
			// 送审
			async startForm (callback) {
				this.$refs['inputForm'].validate(async (valid) => {
					if (valid) {
						this.loading = true
						this.inputForm.type = '2'
						enrollmentWageCardService.saveWageCard(this.inputForm).then((data) => {
							this.inputForm.title = `${this.$store.state.user.name} 发起了 [工资卡信息登记]`
							this.inputForm.id = data.businessId
							callback(data.businessTable, data.businessId, this.inputForm)
							this.$refs.inputForm.resetFields()
							this.loading = false
						}).catch(() => {
							this.$refs.inputForm.resetFields()
							this.loading = false
						})
					} else {
						this.loading = false
					}
				})
			},

			// 通过
			async agreeForm (callback) {
				this.loading = true
				enrollmentWageCardService.findWageCardById(this.inputForm.id).then((data) => {
					if (data.type !== '2') { // 审核状态不是“审核中”，就弹出提示
						this.loading = false
						this.$message.error('任务数据已发生改变或不存在，请在待办任务中确认此任务是否存在')
						throw new Error('任务数据已发生改变或不存在，请在待办任务中确认此任务是否存在')
					} else {
						this.$refs['inputForm'].validate(async (valid) => {
							if (valid) {
								this.loading = true

								this.commonApi.getTaskNameByProcInsId(this.inputForm.procInsId).then((data) => {
									if (this.commonJS.isNotEmpty(data)) {
										if (data === '审核') {
											this.inputForm.type = '5'
										}
									}
									enrollmentWageCardService.saveWageCard(this.inputForm).then((data) => {
										callback(data.businessTable, data.businessId, this.inputForm)
										this.loading = false
									}).catch(() => {
										this.loading = false
									})
								})
							} else {
								this.loading = false
							}
						})
					}
				})
			},
			// 修改状态
			updateStatusById (type, callback) {
				if (type === 'reject') {
					this.loading = true
					enrollmentWageCardService.findWageCardById(this.inputForm.id).then((data) => {
						if (data.type !== '2') { // 审核状态不是“审核中”，就弹出提示
							this.loading = false
							this.$message.error('任务数据已发生改变或不存在，请在待办任务中确认此任务是否存在')
							throw new Error('任务数据已发生改变或不存在，请在待办任务中确认此任务是否存在')
						} else {
							this.inputForm.type = '4'
							enrollmentWageCardService.updateWageCardStatusById(this.inputForm).then(() => {
								this.loading = false
								callback()
							})
						}
					})
				} else if (type === 'hold') {
					this.loading = true
					enrollmentWageCardService.findWageCardById(this.inputForm.id).then((data) => {
						if (data.type !== '4') { // 审核状态不是“驳回”，就弹出提示
							this.loading = false
							this.$message.error('任务数据已发生改变或不存在，请在待办任务中确认此任务是否存在')
							throw new Error('任务数据已发生改变或不存在，请在待办任务中确认此任务是否存在')
						} else {
							this.inputForm.type = '1'
							enrollmentWageCardService.updateWageCardStatusById(this.inputForm).then(() => {
								this.loading = false
								callback()
							})
						}
						this.inputForm.type = '1'
						enrollmentWageCardService.updateWageCardStatusById(this.inputForm).then(() => {
							this.loading = false
							callback()
						})
					})
				}
			},
			checkBankNumber(bankNumber,type) {
				if (!this.validateXG.isBankNum(bankNumber)) {
					if (type === 'zx' ){
						this.inputForm.zxBankCardNumber = ''
					} else if (type === 'gs') {
						this.inputForm.gsBankCardNumber = ''
					}
					this.$message.error('请输入正确的银行卡号')
					throw new Error('请输入正确的银行卡号')
				}
			},
		}
	}
</script>

<style scoped>
	.avatar-uploader .avatar {
		width: 178px;
		height: 178px;
		display: block;
	}
</style>

<style>
	.avatar-uploader .el-upload {
		border: 1px dashed var(--el-border-color);
		border-radius: 6px;
		cursor: pointer;
		position: relative;
		overflow: hidden;
		transition: var(--el-transition-duration-fast);
	}

	.avatar-uploader .el-upload:hover {
		border-color: var(--el-color-primary);
	}

	.el-icon.avatar-uploader-icon {
		font-size: 28px;
		color: #8c939d;
		width: 178px;
		height: 178px;
		text-align: center;
	}
</style>
