From 1564af86d4792d82c4aaeb9e370745c016e79022 Mon Sep 17 00:00:00 2001 From: liujun Date: Mon, 8 Apr 2024 14:48:21 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=B9=E7=A7=8D=E4=BD=9C=E4=B8=9A=E8=AF=81?= =?UTF-8?q?=E4=B9=A6=E7=8A=B6=E6=80=81=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/index.js | 2 +- pages/certificate_information/add.vue | 163 +++++++++++--------------- 2 files changed, 70 insertions(+), 95 deletions(-) diff --git a/api/index.js b/api/index.js index e077886..bd550d7 100644 --- a/api/index.js +++ b/api/index.js @@ -27,7 +27,7 @@ export const getUserInfo = (params) => post("/app/user/getDetailByUserIdAndCorpI export const setUserInfo = (params) => post("/app/user/edit", params) //修改用户信息 export const getCertificateInformationList = (params) => post("/app/specialUser/list", params) //证书信息列表 export const getCertificateInformationView = (params) => post("/app/specialUser/goEdit", params) //证书信息查看 -export const setCertificateInformationAdd = (params) => upload("/app/specialUser/add", params) //证书信息添加 +export const setCertificateInformationAdd = (params) => uploads("/app/specialUser/add", params) //证书信息添加 export const setCertificateInformationEdit = (params) => upload("/app/specialUser/edit", params) //证书信息修改 export const setCertificateInformationEditPost = (params) => post("/app/specialUser/edit", params) //证书信息修改 export const getDeptTree = (params) => post("/api/department/listzTree", params) //用户信息 diff --git a/pages/certificate_information/add.vue b/pages/certificate_information/add.vue index 71bea5a..c0cebf8 100644 --- a/pages/certificate_information/add.vue +++ b/pages/certificate_information/add.vue @@ -7,7 +7,7 @@ :fileList="form.fileList" @afterRead="fnAfterRead" @delete="fnDeletePic" - :maxCount="1" + :maxCount="2" previewFullImage > @@ -122,95 +122,57 @@ export default { REVIEW_TIME: '' }, rules: { - // fileList: { - // type: 'array', - // required: true, - // message: '请上传证书图片', - // trigger: ['change'] - // }, - // NAME: { - // required: true, - // message: '请填写姓名', - // trigger: ['blur'] - // }, - // SEX_NAME: { - // required: true, - // message: '请选择性别', - // trigger: ['change'] - // }, - // PHONE: [ - // { - // required: true, - // message: '请填写手机号', - // trigger: ['blur'] - // }, - // { - // validator: (rule, value, callback) => { - // return uni.$u.test.mobile(value); - // }, - // message: '手机号格式不正确', - // trigger: ['blur'], - // }, - // ], - // CARD_ID: [ - // { - // required: true, - // message: '请填写身份证号', - // trigger: ['blur'] - // }, - // { - // validator: (rule, value, callback) => { - // return uni.$u.test.idCard(value); - // }, - // message: '身份证号格式不正确', - // trigger: ['blur'], - // }, - // ], - // CER_TYPE_NAME: { - // required: true, - // message: '请选择证书类型', - // trigger: ['change'] - // }, - // CERTIFICATE: { - // required: true, - // message: '请填写证书名称', - // trigger: ['change'] - // }, - // SPECIAL_NUMBER: { - // required: true, - // message: '请填写证书编号', - // trigger: ['blur'] - // }, - // JOBS_TYPE: { - // required: true, - // message: '请填写工种', - // trigger: ['change'] - // }, - // specialName: { - // required: true, - // message: '请选择作业类别', - // trigger: ['change'] - // }, - // operationName: { - // required: true, - // message: '请选择操作项目', - // trigger: ['change'] - // }, - // ISSUING_AUTHORITY: { - // required: true, - // message: '请填写发证机关', - // trigger: ['blur'] - // }, - // VALIDITY_TIME_START: { - // required: true, - // message: '请选择有效期开始时间', - // trigger: ['change'] - // }, - // VALIDITY_TIME_END: { - // required: true, - // message: '请选择有效期结束时间', - // trigger: ['change'] - // }, + fileList: { + type: 'array', + required: true, + message: '请上传证书图片', + trigger: ['change'] + }, + CER_TYPE_NAME: { + required: true, + message: '请选择证书类型', + trigger: ['change'] + }, + CERTIFICATE: { + required: true, + message: '请填写证书名称', + trigger: ['change'] + }, + SPECIAL_NUMBER: { + required: true, + message: '请填写证书编号', + trigger: ['blur'] + }, + JOBS_TYPE: { + required: true, + message: '请填写工种', + trigger: ['change'] + }, + specialName: { + required: true, + message: '请选择作业类别', + trigger: ['change'] + }, + operationName: { + required: true, + message: '请选择操作项目', + trigger: ['change'] + }, + ISSUING_AUTHORITY: { + required: true, + message: '请填写发证机关', + trigger: ['blur'] + }, + VALIDITY_TIME_START: { + required: true, + message: '请选择有效期开始时间', + trigger: ['change'] + }, + VALIDITY_TIME_END: { + required: true, + message: '请选择有效期结束时间', + trigger: ['change'] + }, REVIEW_TIME: { required: true, message: '请选择复审时间', @@ -352,9 +314,9 @@ export default { }else{ uni.$u.toast('图片格式不正确,请上传jpg格式图片或者png格式图片') this.form.fileList=[] - + } - + }, fnDeletePic(event) { this.form.fileList.splice(event.index, 1) @@ -363,9 +325,22 @@ export default { console.info(this.$refs) this.$refs.form.validate().then(async () => { if(!this.SPECIAL_USER_ID){ + let files = [] + files.push({ + name: 'FILEPATH', + file: this.form.fileList[0], + uri: this.form.fileList[0].url, + }) + + files.push({ + name: 'FILEPATH_BACK', + file: this.form.fileList[1], + uri: this.form.fileList[1].url, + }) + await setCertificateInformationAdd({ - filePath: this.form.fileList[0].url, - name: 'file', + // filePath: this.form.fileList[0].url, + files: files, formData: { ...this.form }