浏览代码

入职登记修改页添加身份证上传

huangguoce 1 月之前
父节点
当前提交
52d8ddc687
共有 1 个文件被更改,包括 46 次插入2 次删除
  1. 46 2
      src/views/human/enrollment/registration/EnrollmentRegistrationEditForm.vue

+ 46 - 2
src/views/human/enrollment/registration/EnrollmentRegistrationEditForm.vue

@@ -139,6 +139,18 @@
 
 
 				</el-row>
+				<el-row :gutter="26">
+					<el-col :span="12">
+						<el-form-item class="star-require" label="身份证人像面" prop="idCardFront" :rules="[]">
+							<SFZUpLoadComponent ref="idCardFront"></SFZUpLoadComponent>
+						</el-form-item>
+					</el-col>
+					<el-col :span="12">
+						<el-form-item class="star-require" label="身份证国徽面" prop="idCardBack" :rules="[]">
+							<SFZUpLoadComponent ref="idCardBack"></SFZUpLoadComponent>
+						</el-form-item>
+					</el-col>
+				</el-row>
 				<!-- <el-divider content-position="left"><i class="el-icon-document"></i> <span
 						style="font-weight: 900; font-size: 16px; color: #606266;">学历信息</span></el-divider>
 				<el-row :gutter="26">
@@ -400,6 +412,8 @@
 								</el-form-item>
 							</el-col>
 						</el-row>
+
+
 					</el-form>
 				</el-row>
 				<el-divider content-position="left"><i class="el-icon-document"></i> <span
@@ -1561,6 +1575,7 @@ import AttachmentView from './components/AttachmentView'
 import LaborContractInfo from "./components/LaborContractInfo"
 import SocietyInfo from "./components/SocietyInfo.vue"
 import PerformanceInfo from "./components/PerformanceInfo.vue"
+import SFZUpLoadComponent from '@/views/common/SFZUpLoadComponent'
 
 import postService from "@/api/sys/postService";
 import roleService from "@/api/sys/roleService";
@@ -1581,6 +1596,7 @@ export default {
 	},
 	data() {
 		return {
+			fileType: ['jpg', 'jpeg', 'png', 'webp'],
 			trialFlag: false,
 			bankHideUploadEdit: false, //控制上传点击
 			bankHideUploadEdit2: false, //控制上传点击
@@ -1610,6 +1626,8 @@ export default {
 			loading: false,
 			showViewer: false,
 			inputForm: {
+				idCardFront: [],
+				idCardBack: [],
 				wageCardId: '',//银行卡信息id
 				zxBankCardNumber: '',//银行卡信息
 				zxAccountHolder: '',
@@ -1705,7 +1723,8 @@ export default {
 			changeFlag: [
 				true, true, true, true, true, true, true, true, true, true, true
 			],
-			activeNames: []
+			activeNames: [],
+
 		}
 	},
 	created() {
@@ -1724,7 +1743,8 @@ export default {
 		AttachmentView,
 		LaborContractInfo,
 		SocietyInfo,
-		PerformanceInfo
+		PerformanceInfo,
+		SFZUpLoadComponent
 	},
 	computed: {
 		bus: {
@@ -1893,6 +1913,8 @@ export default {
 				laborContractInfoList: [],
 				societyInfoList: [],
 				performanceInfoList: [],
+				idCardFront: [],
+				idCardBack: [],
 				loginName: ""
 			}
 			if (method === 'add') {
@@ -1905,8 +1927,11 @@ export default {
 			this.inputForm.id = id
 			this.visible = true
 			this.loading = false
+
 			this.$nextTick(() => {
 				this.loading = true
+				this.$refs.idCardBack.clearUpload()
+				this.$refs.idCardFront.clearUpload()
 				enrollmentRegistrationService.findById(this.inputForm.id).then(async (data) => {
 					this.fileList = []
 					this.fileList2 = []
@@ -1972,10 +1997,27 @@ export default {
 					if (this.commonJS.isEmpty(this.inputForm.performanceInfoList)) {
 						this.inputForm.performanceInfoList = []
 					}
+					if (this.commonJS.isEmpty(this.inputForm.idCardFront)) {
+						this.inputForm.idCardFront = []
+					}
+
+					if (this.commonJS.isEmpty(this.inputForm.idCardBack)) {
+						this.inputForm.idCardBack = []
+					}
 
 					this.inputForm.certificateInfoList.forEach(temp => {
 						this.changeType(temp.type, temp)
 					})
+
+					console.log(this.inputForm.idCardFront);
+					console.log(this.inputForm.idCardFront);
+					console.log(this.inputForm.idCardFront);
+					console.log(this.inputForm.idCardBack);
+					console.log(this.inputForm.idCardBack);
+
+					this.$refs.idCardFront.newUpload('edit', this.inputForm.idCardFront, 'idCard', null, null, null, null, null, [...this.fileType])
+					this.$refs.idCardBack.newUpload('edit', this.inputForm.idCardBack, 'idCard', null, null, null, null, null, [...this.fileType])
+
 					// 展开所有
 					this.activeNames[0] = this.inputForm.eduInfoList.map(item => item.id)
 					this.activeNames[1] = this.inputForm.workInfoList.map(item => item.id)
@@ -2088,6 +2130,8 @@ export default {
 					// 	throw new Error('社保编号与社保银行卡号不能为空')
 					// }
 					// this.inputForm.id = this.businessId
+					this.inputForm.idCardFront = this.$refs.idCardFront.getDataList()
+					this.inputForm.idCardBack = this.$refs.idCardBack.getDataList()
 					enrollmentRegistrationService.updateInfo(this.inputForm).then((data) => {
 						this.close()
 						this.$message.success(data.msg)