小程序保安录入增加新字段
This commit is contained in:
parent
79b50df5ac
commit
bbec0065eb
|
@ -9,6 +9,7 @@ type EnumType =
|
|||
| 'Sex'
|
||||
| 'ServiceProjectType'
|
||||
| 'MiniProgramUserIdentity'
|
||||
| 'EducationLevel'
|
||||
|
||||
export const initEnum = () => {
|
||||
api.get<Record<EnumType, SelectNodeVo<any>[]>>('/common/enums').then(resp => {
|
||||
|
|
|
@ -96,10 +96,11 @@
|
|||
<nut-dialog no-cancel-btn content="详情" v-model:visible="detailVisible">
|
||||
<slot>
|
||||
<view style="margin-bottom: 5px">
|
||||
<view>籍贯:{{ securityUserDetail.nativePlace }}</view>
|
||||
<view>公司:{{ securityUserDetail.securityUnitName }}</view>
|
||||
<view>家庭地址:{{ securityUserDetail.homeAddress }}</view>
|
||||
<view>备注:{{ securityUserDetail.remark }}</view>
|
||||
<view>籍贯:{{ securityUserDetail?.nativePlace }}</view>
|
||||
<view>公司:{{ securityUserDetail?.securityUnitName }}</view>
|
||||
<view>家庭地址:{{ securityUserDetail?.homeAddress }}</view>
|
||||
<view>文化程度:{{ securityUserDetail.educationLevel?.label }}</view>
|
||||
<view>备注:{{ securityUserDetail?.remark }}</view>
|
||||
</view>
|
||||
</slot>
|
||||
</nut-dialog>
|
||||
|
@ -240,7 +241,7 @@ const detail = (item: ServiceProjectSecurityUserPagerVo) => {
|
|||
}
|
||||
const securityUserEdit = (item: ServiceProjectSecurityUserPagerVo) => {
|
||||
console.log(item)
|
||||
const params = {...item, sex: item.sex.value}
|
||||
const params = {...item, sex: item.sex.value,educationLevel:item.educationLevel}
|
||||
Taro.navigateTo({url: `/subPages/projectManager/securityUserForm/securityUserForm?securityUser=${JSON.stringify(params)}&type=formInput`})
|
||||
}
|
||||
|
||||
|
|
|
@ -38,6 +38,11 @@
|
|||
<nut-form-item label="手机号" prop="telephone">
|
||||
<nut-input v-model="formData.telephone" placeholder="请输入手机号" type="text"/>
|
||||
</nut-form-item>
|
||||
<nut-form-item label="文化程度" prop="educationLevel">
|
||||
<view @click="showBottom = true" >
|
||||
{{educationLevelValue?educationLevelValue:'请选择文化程度'}}
|
||||
</view>
|
||||
</nut-form-item>
|
||||
<nut-form-item label="籍贯" prop="nativePlace">
|
||||
<nut-input v-model="formData.nativePlace" placeholder="请输入籍贯" type="text"/>
|
||||
</nut-form-item>
|
||||
|
@ -71,12 +76,25 @@
|
|||
<nut-dialog content="详情" v-model:visible="visible" @ok="onOk" @cancel="cancel">
|
||||
<slot>
|
||||
<view style="margin-bottom: 5px">
|
||||
<view>姓名:{{ securityNumberByIdCard.name ? securityNumberByIdCard.name : '无' }}</view>
|
||||
<view>姓名:{{ securityNumberByIdCard?.name ? securityNumberByIdCard.name : '无' }}</view>
|
||||
<view>保安证件号:{{ securityNumberByIdCard?.bayzh ? securityNumberByIdCard?.bayzh : '无' }}</view>
|
||||
<view>身份证:{{ securityNumberByIdCard?.sfzhm ? securityNumberByIdCard?.sfzhm : '无' }}</view>
|
||||
</view>
|
||||
</slot>
|
||||
</nut-dialog>
|
||||
<nut-popup v-model:visible="showBottom" position="bottom" :style="{ height: '40%' }">
|
||||
<nut-picker
|
||||
:columns="columns"
|
||||
:field-names="{
|
||||
text: 'label',
|
||||
value: 'value',
|
||||
children: 'extData'
|
||||
}"
|
||||
title="学历选择"
|
||||
@confirm="confirm"
|
||||
@cancel="showBottom = false"
|
||||
/>
|
||||
</nut-popup>
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
|
@ -95,6 +113,7 @@ const SEX:any = enumSelectNodes('Sex')
|
|||
const minioBaseUrl = process.env.TARO_APP_MINIO_URL
|
||||
const BUCKET = process.env.TARO_APP_MINIO_BUCKET
|
||||
const showPicker = ref(false)
|
||||
const showBottom = ref(false)
|
||||
const Url = ref('')
|
||||
const type = ref<'formInput' | 'QcCodeInput'>(null!)
|
||||
const formData = ref<SecurityUserFormParams>({} as any)
|
||||
|
@ -103,6 +122,8 @@ const visible = ref<boolean>(false)
|
|||
const securityNumberByIdCard = ref<securityNumberByIdCard | any>()
|
||||
const uploadRef = ref<any>(null)
|
||||
const modelValue = ref('')
|
||||
const columns: any = enumSelectNodes('EducationLevel')
|
||||
|
||||
|
||||
const rules: FormRules = {
|
||||
name: [{required: true, message: '请输入姓名'}],
|
||||
|
@ -115,11 +136,23 @@ const rules: FormRules = {
|
|||
},
|
||||
],
|
||||
telephone: [{required: true, message: '请输入手机号'}],
|
||||
educationLevel:[{required: true, message: '请选择文化程度'}]
|
||||
}
|
||||
|
||||
const educationLevelValue = ref('')
|
||||
// 文化程度
|
||||
const confirm = ({selectedOptions}) => {
|
||||
Object.keys(selectedOptions).forEach((item:any,index:number)=>{
|
||||
console.log(item)
|
||||
educationLevelValue.value = selectedOptions[index].label
|
||||
formData.value.educationLevel = selectedOptions[index].value
|
||||
})
|
||||
showBottom.value = false
|
||||
}
|
||||
useLoad((options) => {
|
||||
type.value = options.type
|
||||
if (type.value === 'QcCodeInput') {
|
||||
console.log(1111)
|
||||
formData.value = {
|
||||
name: '',
|
||||
serviceProjectId: options.pid,
|
||||
|
@ -130,13 +163,16 @@ useLoad((options) => {
|
|||
dateOfBirth: null,
|
||||
noSecurityNumberDesc: options.noSecurityNumberDesc,
|
||||
photo: '',
|
||||
educationLevel: ''
|
||||
}
|
||||
} else {
|
||||
const form = JSON.parse(options.securityUser)
|
||||
educationLevelValue.value = form.educationLevel.label
|
||||
formData.value = Object.assign({}, form, {
|
||||
idCard: form.idCard.originalValue,
|
||||
telephone: form.telephone.originalValue,
|
||||
photo: form.photo
|
||||
photo: form.photo,
|
||||
educationLevel: form.educationLevel.value
|
||||
})
|
||||
}
|
||||
})
|
||||
|
@ -244,6 +280,7 @@ const submit = () => {
|
|||
} else {
|
||||
url = '/mp/user/qrCodeFormInputSecurityUser'
|
||||
}
|
||||
console.log(formData.value)
|
||||
const resp = await api.post(url, formData.value)
|
||||
Taro.showToast({
|
||||
title: resp.message,
|
||||
|
@ -267,7 +304,9 @@ const submit = () => {
|
|||
homeAddress: '',
|
||||
noSecurityNumberDesc: '',
|
||||
photo: '',
|
||||
educationLevel: ''
|
||||
}
|
||||
educationLevelValue.value = ''
|
||||
uploadRef.value?.clearUploadQueue()
|
||||
}
|
||||
})
|
||||
|
|
|
@ -62,5 +62,9 @@ export interface ServiceProjectSecurityUserPagerVo {
|
|||
snowFlakeId: string;
|
||||
workPost?: string;
|
||||
sex: BaseEnum<number>
|
||||
educationLevel:{
|
||||
label:string,
|
||||
value:string
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,8 @@ export interface SecurityUserFormParams {
|
|||
photo?:string;
|
||||
remark?: string;
|
||||
noSecurityNumberDesc:string;
|
||||
homeAddress?: string
|
||||
homeAddress?: string;
|
||||
educationLevel:string
|
||||
}
|
||||
|
||||
export interface value{
|
||||
|
|
Loading…
Reference in New Issue