diff --git a/collect_information/.env.development b/collect_information/.env.development index f811773..c876df6 100644 --- a/collect_information/.env.development +++ b/collect_information/.env.development @@ -1,2 +1,2 @@ -TARO_APP_ID="wx8902ddbfddb820d1" +TARO_APP_ID="wx0acd1c4fcf94bdd3" TARO_APP_BASE_API="http://172.10.10.93:8765" diff --git a/collect_information/src/subPages/pages/form/form.vue b/collect_information/src/subPages/pages/form/form.vue index 04281ae..012dc8f 100644 --- a/collect_information/src/subPages/pages/form/form.vue +++ b/collect_information/src/subPages/pages/form/form.vue @@ -24,6 +24,10 @@ + + + + @@ -67,6 +71,8 @@ const showPicker = ref(false) const formData = ref({} as any) const formRef = ref(null) +const qrcodeId = ref() + const rules: FormRules = { name: [ {required: true, message: "请输入姓名"}, @@ -78,11 +84,33 @@ const rules: FormRules = { regex: /^(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))((0[1-9])|([12][0-9])|(30|31))\d{3}(\d|X)$)/, message: "身份证格式错误", }, + ], + telephone:[ + {required: true, message: "请输入手机号"}, ] }; useLoad((options) => { - formData.value = JSON.parse(options.item) + qrcodeId.value = options + console.log(JSON.parse(options.item)) + if(options.id === '2'){ + formData.value = { + serviceProjectId: JSON.parse(options.item).serviceProjectId, + securityUnitId:JSON.parse(options.item).securityUnitId, + name: '', + workPost: '', + sex: 0, + nativePlace: '', + idCard: '', + dateOfBirth: null, + securityNumber: '', + remark: '', + homeAddress: '', + telephone:'' + } + }else{ + formData.value = JSON.parse(options.item) + } }) const idCardBlur = (e: any) => { @@ -98,10 +126,17 @@ const idCardBlur = (e: any) => { formData.value.dateOfBirth = new Date(parseInt(year), parseInt(month) - 1, parseInt(day)) } +const url = ref('') const submit = () => { formRef.value?.validate().then(async ({valid}) => { if (valid) { - const resp = await api.post('/projectManageIndex/saveOrUpdateSecurityUser', formData.value) + if( qrcodeId.value.id === '1'){ + url.value = '/projectManageIndex/saveOrUpdateSecurityUser' + }else{ + url.value = '/miniProgramUser/qrCodeFormInputSecurityUser' + } + console.log(formData.value) + const resp = await api.post(`${ url.value}`, formData.value) Taro.showToast({ title: resp.message, icon: 'success', @@ -111,6 +146,7 @@ const submit = () => { formData.value = { snowFlakeId: undefined, serviceProjectId: formData.value.serviceProjectId, + securityUnitId:formData.value.securityUnitId, name: '', workPost: '', telephone: '', diff --git a/collect_information/src/subPages/pages/myProject/myProject.vue b/collect_information/src/subPages/pages/myProject/myProject.vue index 06eedd0..32eadff 100644 --- a/collect_information/src/subPages/pages/myProject/myProject.vue +++ b/collect_information/src/subPages/pages/myProject/myProject.vue @@ -45,6 +45,7 @@ const getMyServiceProject = async () => { } const projectClick = (items: ServiceProjectList, name: string) => { + console.log(items) Taro.navigateTo({ url: `/subPages/pages/projectDetails/projectDetails?name=${name}&item=${JSON.stringify(items)}`, }) diff --git a/collect_information/src/subPages/pages/projectDetails/projectDetails.scss b/collect_information/src/subPages/pages/projectDetails/projectDetails.scss index 958e0cf..5ede9f2 100644 --- a/collect_information/src/subPages/pages/projectDetails/projectDetails.scss +++ b/collect_information/src/subPages/pages/projectDetails/projectDetails.scss @@ -66,6 +66,27 @@ display: flex; flex-wrap: wrap; } + .qrcodeVisibleUrl{ + margin-bottom: 5px; + image { + width: 100%; + } + } + .warp{ + display: flex; + align-items: center; + justify-content: center; + height: 100vh; + .warpItem{ + width: 90%; + height: 50%; + text-align: center; + .rect{ + width: 100%; + height: 100%; + } + } + } } diff --git a/collect_information/src/subPages/pages/projectDetails/projectDetails.vue b/collect_information/src/subPages/pages/projectDetails/projectDetails.vue index a04f043..51231ab 100644 --- a/collect_information/src/subPages/pages/projectDetails/projectDetails.vue +++ b/collect_information/src/subPages/pages/projectDetails/projectDetails.vue @@ -85,9 +85,8 @@ 项目人员录入 - 二维码录入 + 二维码录入 - + + + + + + + + + + + + + + + + + + + + + diff --git a/collect_information/types/global.d.ts b/collect_information/types/global.d.ts index fe190e8..8a62d44 100644 --- a/collect_information/types/global.d.ts +++ b/collect_information/types/global.d.ts @@ -60,3 +60,19 @@ interface TreeNode { extData?: Record, children?: TreeNode[] } + + +interface TokenInfo> { + name: string; + value: string; + extData?: T +} + +/** + * 基本枚举类型 + */ +interface BaseEnum> { + value: T; + label: string; + extData: E; +} diff --git a/collect_information/types/pages/form/index.d.ts b/collect_information/types/pages/form/index.d.ts index 4aed7ab..6c51ace 100644 --- a/collect_information/types/pages/form/index.d.ts +++ b/collect_information/types/pages/form/index.d.ts @@ -1,5 +1,6 @@ interface formDate { snowFlakeId?: string; + securityUnitId:string; serviceProjectId: string; name?: string; workPost?: string; diff --git a/collect_information/types/pages/myProject/index.d.ts b/collect_information/types/pages/myProject/index.d.ts index d0d8d24..8b4c210 100644 --- a/collect_information/types/pages/myProject/index.d.ts +++ b/collect_information/types/pages/myProject/index.d.ts @@ -12,6 +12,7 @@ remark?: string; serviceProjectList: ServiceProjectList[]; snowFlakeId?: string; + securityUnitId:string; street?: string; streetName?:string; }