diff --git a/pages/mine/information/update.vue b/pages/mine/information/update.vue index badf1b0..5428f40 100644 --- a/pages/mine/information/update.vue +++ b/pages/mine/information/update.vue @@ -66,14 +66,29 @@ - + - + + + + + + + + + + + + + + + + + + + + + @@ -106,6 +134,13 @@ + + + + @@ -144,13 +179,18 @@ degreeOfEducationColumns: [], showPersonWorkType: false, showFloatingPersonnel: false, + showBf: false, + showIsSignLabor: false, + showPhotosOfLevel: false, personWorkTypeColumns: [], prePhotoId: [], form: { userPhoto: [], userCardIDPhotoFile: [], socialPhotoFile: [], - injuriesPayTiemFile: [], //工伤保险有效凭证 + contractFile:[], + injuriesPayTiemFile: [], + photosOfLevel:[], IS_INJURIES_PAY_TIME:'', NAME: '', USERNAME: '', @@ -169,6 +209,13 @@ ISFLOW_NAME: '', IS_SOCIAL:'', IS_SOCIAL_NAME:'', + IS_BF_NAME: '', + IS_BF: '', + IS_SIGN_LABOR: '', + IS_SIGN_LABOR_NAME: '', + POST_ID: '', + IS_LEVEL_THREE: '', + IS_LEVEL_THREE_NAME: '' }, rules: { userPhoto: { @@ -267,14 +314,43 @@ message: '请选择工伤保险有效期', trigger: ['change'] }, + IS_BF_NAME:{ + required: true, + message: '请选择是否是否缴纳保险', + trigger: ['change'] + }, + IS_SIGN_LABOR_NAME:{ + required: true, + message: '请选择是否签订劳动合同', + trigger: ['change'] + }, + contractFile:{ + type: 'array', + required: true, + message: '请上传劳动合同', + trigger: ['change'] + }, + POST_ID:{ + required: true, + message: '请填写岗位', + trigger: ['change'] + }, + photosOfLevel:{ + type: 'array', + required: true, + message: '请上传三级安全培训照片', + trigger: ['change'] + }, + IS_LEVEL_THREE_NAME:{ + required: true, + message: '请选择是否为三级人员', + trigger: ['change'] + } } } }, onLoad() { this.fnGetData() - // this.fnGetDataDictionary('d7d80f08d73a4accbccf4fd3d8d1d867', 'degreeOfEducationColumns') - // this.fnGetDataDictionary('55484e491a5e442d839c4595380713ec', 'personWorkTypeColumns') - }, computed: { userInfo() { @@ -330,20 +406,13 @@ if (event.file.id) { // 准备删除的数据 this.prePhotoId.push(event.file.id) - // await removeUploadAttachments({ - // IMGFILES_ID: event.file.id - // }) } uni.showToast({ title: '操作成功', duration: 2000 }); - // var pages = getCurrentPages(); // 获取当前页面栈 - // var prePage = pages[pages.length - 2]; // 上级页面 - // prePage.$vm.reloadx(); this.form.userCardIDPhotoFile.splice(event.index, 1) } else if (res.cancel) { - // console.log('用户点击取消'); } } }); @@ -363,17 +432,11 @@ if (res.confirm) { if (event.file.id) { this.prePhotoId.push(event.file.id) - // await removeUploadAttachments({ - // IMGFILES_ID: event.file.id - // }) } uni.showToast({ title: '操作成功', duration: 2000 }); - // var pages = getCurrentPages(); // 获取当前页面栈 - // var prePage = pages[pages.length - 2]; // 上级页面 - // prePage.$vm.reloadx(); this.form.socialPhotoFile.splice(event.index, 1) } else if (res.cancel) { // console.log('用户点击取消'); @@ -381,6 +444,60 @@ } }); }, + // 合同图片 + fnIsSignLaborAdd(event) { + for (let i = 0; i < event.file.length; i++) { + this.form.contractFile.push(event.file[i]) + } + }, + // 合同图片删除 + fnIsSignLaborDelete(event) { + uni.showModal({ + title: '提示', + content: '确定删除吗', + success: async (res) => { + if (res.confirm) { + if (event.file.id) { + this.prePhotoId.push(event.file.id) + } + uni.showToast({ + title: '操作成功', + duration: 2000 + }); + this.form.contractFile.splice(event.index, 1) + } else if (res.cancel) { + // console.log('用户点击取消'); + } + } + }); + }, + // 合同图片 + fnPhotosOfLevelAdd(event) { + for (let i = 0; i < event.file.length; i++) { + this.form.photosOfLevel.push(event.file[i]) + } + }, + // 合同图片删除 + fnPhotosOfLevelDelete(event) { + uni.showModal({ + title: '提示', + content: '确定删除吗', + success: async (res) => { + if (res.confirm) { + if (event.file.id) { + this.prePhotoId.push(event.file.id) + } + uni.showToast({ + title: '操作成功', + duration: 2000 + }); + this.form.photosOfLevel.splice(event.index, 1) + } else if (res.cancel) { + // console.log('用户点击取消'); + } + } + }); + }, async fnGetDataDictionary(DICTIONARIES_ID) { let resData = await getDataDictionary({ @@ -399,22 +516,38 @@ fnShowPersonWorkType() { this.showPersonWorkType = !this.showPersonWorkType }, - // fnPersonWorkTypeConfirm(e) { - // this.form.PERSON_WORK_TYPE = e.value[0].BIANMA - // this.form.PERSON_WORK_TYPE_NAME = e.value[0].NAME - // this.fnShowPersonWorkType() - // }, fnShowFloatingPersonnel() { this.showFloatingPersonnel = !this.showFloatingPersonnel }, - + fnShowBf(){ + this.showBf = !this.showBf + }, + fnShowIsSignLabor(){ + this.showIsSignLabor = !this.showIsSignLabor + }, + fnShowPhotosOfLevel(){ + this.showPhotosOfLevel = !this.showPhotosOfLevel + }, + fnShowPhotosOfLevelConfirm(e){ + this.form.IS_LEVEL_THREE = e.value[0].id + this.form.IS_LEVEL_THREE_NAME = e.value[0].name + this.fnShowPhotosOfLevel() + }, fnFloatingPersonnelConfirm(e) { this.form.ISFLOW = e.value[0].id this.form.ISFLOW_NAME = e.value[0].name this.fnShowFloatingPersonnel() }, - - + fnBFConfirm(e){ + this.form.IS_BF = e.value[0].id + this.form.IS_BF_NAME = e.value[0].name + this.fnShowBf() + }, + fnIsSignLaborConfirm(e){ + this.form.IS_SIGN_LABOR = e.value[0].id + this.form.IS_SIGN_LABOR_NAME = e.value[0].name + this.fnShowIsSignLabor() + }, fnShowIsSocial() { this.showIsSocial = !this.showIsSocial }, @@ -447,17 +580,11 @@ if (res.confirm) { if (event.file.id) { this.prePhotoId.push(event.file.id) - // await removeUploadAttachments({ - // IMGFILES_ID: event.file.id - // }) } uni.showToast({ title: '操作成功', duration: 2000 }); - // var pages = getCurrentPages(); // 获取当前页面栈 - // var prePage = pages[pages.length - 2]; // 上级页面 - // prePage.$vm.reloadx(); this.form.injuriesPayTiemFile.splice(event.index, 1) } else if (res.cancel) { // console.log('用户点击取消'); @@ -557,16 +684,34 @@ } else if (this.form.IS_INJURIES_PAY === '1') { this.form.IS_INJURIES_PAY_NAME = '是' } - if (this.form.SEX_NAME == '0') { + if (this.form.SEX_NAME === '0') { this.form.SEX_NAME = '男' - } else if (this.form.SEX_NAME == '1') { + } else if (this.form.SEX_NAME === '1') { this.form.SEX_NAME = '女' } - if (this.form.ISFLOW == '0') { + if (this.form.ISFLOW === '0') { this.form.ISFLOW_NAME = '否' - } else if (this.form.ISFLOW == '1') { + } else if (this.form.ISFLOW === '1') { this.form.ISFLOW_NAME = '是' } + + if (this.form.IS_LEVEL_THREE === '0'){ + this.form.IS_LEVEL_THREE_NAME = '否' + }else { + this.form.IS_LEVEL_THREE_NAME = '是' + } + + if (this.form.IS_BF === '0'){ + this.form.IS_BF_NAME = '否' + }else { + this.form.IS_BF_NAME = '是' + } + if (this.form.IS_SIGN_LABOR === '0'){ + this.form.IS_SIGN_LABOR_NAME = '否' + }else { + this.form.IS_SIGN_LABOR_NAME = '是' + } + if (resData.userPhotoFile.length > 0) { this.$set(this.form, 'userPhoto', [{ url: this.$filePath + resData.userPhotoFile[0].FILEPATH, @@ -617,12 +762,12 @@ } if (await this.fnIDCardDeduplication()) return if (await this.fnPhoneNumberDeduplication()) return - if (this.form.userCardIDPhotoFile.length != 2) { + if (this.form.userCardIDPhotoFile.length !== 2) { uni.$u.toast('身份证照片需要两张') return } if(this.form.IS_SOCIAL==='1'){ - if (this.form.socialPhotoFile.length != 2) { + if (this.form.socialPhotoFile.length !== 2) { uni.$u.toast('社保卡照片需要两张') return } @@ -635,6 +780,7 @@ IMGFILES_ID: this.prePhotoId[i] }) } + // 保存图片 for (let i = 0; i < this.form.userPhoto.length; i++) { if (!this.form.userPhoto[i].FILEPATH) { let resData = await setUploadAttachments({ @@ -660,7 +806,6 @@ } }) } - for (let i = 0; i < this.form.socialPhotoFile.length; i++) { await setUploadAttachments({ filePath: this.form.socialPhotoFile[i].url, @@ -672,7 +817,7 @@ } }) } - for (let i = 0; i < this.form.injuriesPayTiemFile.length; i++) { // 16上传工伤保险凭证 + for (let i = 0; i < this.form.injuriesPayTiemFile.length; i++) { await setUploadAttachments({ filePath: this.form.injuriesPayTiemFile[i].url, name: 'files', @@ -683,6 +828,29 @@ } }) } + for (let i = 0; i < this.form.photosOfLevel.length; i++) { + await setUploadAttachments({ + filePath: this.form.photosOfLevel[i].url, + name: 'files', + formData: { + TYPE: '19', + FOREIGN_KEY: this.userInfo.USER_ID, + CORPINFO_ID: this.CORPINFO_ID, + } + }) + } + for (let i = 0; i < this.form.contractFile.length; i++) { + await setUploadAttachments({ + filePath: this.form.contractFile[i].url, + name: 'files', + formData: { + TYPE: '10', + FOREIGN_KEY: this.userInfo.USER_ID, + CORPINFO_ID: this.CORPINFO_ID, + } + }) + } + // 保存人员信息 await setUserInfo({ ...this.form, PHOTO: fileUrl