From e16107be27e880157b0f09c1ce0164c4dd9f1f52 Mon Sep 17 00:00:00 2001 From: gyj Date: Mon, 18 Mar 2024 16:12:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=AF=81=E4=BB=B6=E7=B1=BB=E5=9E=8B=E5=8F=96=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/handlecase/index.js | 8 +++ api/login.js | 8 +++ pages/handlecase/component/newlyAddedCase.vue | 18 ++++-- pages/register.vue | 60 +++++++++++-------- 4 files changed, 63 insertions(+), 31 deletions(-) diff --git a/api/handlecase/index.js b/api/handlecase/index.js index fa4ae61..9006349 100644 --- a/api/handlecase/index.js +++ b/api/handlecase/index.js @@ -184,4 +184,12 @@ export function msCaseSign(data) { method: "post", data: data, }) +} +//证件类型 +export function idType(data) { + return request({ + url: '/system/dict/data/type/id_type', + method: 'get', + params: data + }) } \ No newline at end of file diff --git a/api/login.js b/api/login.js index c543fa6..3f113c7 100644 --- a/api/login.js +++ b/api/login.js @@ -93,4 +93,12 @@ export function wxregister(data) { method: 'post', data: data }) +} +// 获取证件类型 +export function idType(data){ + return request({ + url: '/system/dict/data/type/id_type', + method: 'get', + params: data + }) } \ No newline at end of file diff --git a/pages/handlecase/component/newlyAddedCase.vue b/pages/handlecase/component/newlyAddedCase.vue index 03e9600..9bdc841 100644 --- a/pages/handlecase/component/newlyAddedCase.vue +++ b/pages/handlecase/component/newlyAddedCase.vue @@ -163,7 +163,8 @@ caseApplicationInsert, updateComfire, caseApplicationSelectById, - getUserInfo + getUserInfo, + idType } from '../../../api/handlecase/index.js' import { getToken @@ -173,10 +174,7 @@ data() { return { baseUrl: config.baseUrlTJ, - certificate: [ - { value: 0, text: "身份证" }, - { value: 1, text: "护照" }, - ], + certificate: [], nationality: [ { value: 0, text: "国内" }, { value: 1, text: "国外" }, @@ -599,6 +597,15 @@ // 改变证件类型 changeDocment(e){ console.log(e) + }, + // 获取证件类型 + getIdType(){ + idType().then(res =>{ + console.log(res) + res.data.forEach(item =>{ + this.certificate.push({value:item.dictSort,text:item.dictLabel}) + }) + }) } }, onLoad(data) { @@ -617,6 +624,7 @@ } this.getTemplateFn() this.getUserInfoNumber() + this.getIdType() //获取证件类型 }, onReady() { this.$refs.form.setRules(this.rules) diff --git a/pages/register.vue b/pages/register.vue index 1576382..9eee9b5 100644 --- a/pages/register.vue +++ b/pages/register.vue @@ -30,14 +30,14 @@ - @@ -84,7 +84,8 @@ getCodeImg, register, sendCode, - wxregister + wxregister, + idType } from '@/api/login' import constant from '../utils/constant' @@ -109,10 +110,7 @@ import constant from '../utils/constant' nationality:0 }, sysType:null, - certificate: [ - { value: 0, text: "身份证" }, - { value: 1, text: "护照" }, - ], + certificate: [], nationality: [ { value: 0, text: "国内" }, { value: 1, text: "国外" }, @@ -123,24 +121,6 @@ import constant from '../utils/constant' created() { this.getCode() }, - onLoad(option) { - this.sysType = uni.getStorageSync('sysType'); - // this.passportVal = option; - if(option.valus==1){ - this.registerForm.idType =1 - this.registerForm.nationality =1 - }else{ - let { - params - } = option - // this.improvedetail = JSON.parse(improvedetail) - let paramsObj = JSON.parse(params); - this.registerForm.name = paramsObj.nickName; - this.registerForm.identityNo = paramsObj.idCard - this.registerForm.id = paramsObj.id - } - - }, methods: { // 获取手机验证码 getCodeNumber(data) { @@ -235,9 +215,37 @@ import constant from '../utils/constant' }) }, certificateValue(e){ - this.registerForm.idType = e + // this.registerForm.idType = e + }, + // 获取证件类型 + getIdType(){ + idType().then(res=>{ + res.data.forEach(item=>{ + this.certificate.push({value:item.dictSort,text:item.dictLabel}) + }) + console.log(this.certificate) + }) } }, + onLoad(option) { + this.sysType = uni.getStorageSync('sysType'); + // this.passportVal = option; + console.log(option) + if(option.valus==1){ + this.registerForm.idType =0 + this.registerForm.nationality =0 + }else{ + let { + params + } = option + // this.improvedetail = JSON.parse(improvedetail) + let paramsObj = JSON.parse(params); + this.registerForm.name = paramsObj.nickName; + this.registerForm.identityNo = paramsObj.idCard + this.registerForm.id = paramsObj.id + } + this.getIdType() + }, }