From 918b6b54684c215d264a0a387043d27592521909 Mon Sep 17 00:00:00 2001 From: TimSpan Date: Fri, 29 Nov 2024 14:10:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E6=AD=A5=E5=AE=8C=E6=88=90=E4=BA=BA?= =?UTF-8?q?=E5=91=98=20=E4=BA=BA=E5=91=98=E5=BD=95=E5=85=A5=E7=9A=84?= =?UTF-8?q?=E5=A2=9E=E5=88=A0=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- collect_information/.env.development | 4 +- .../views/unitManage/police/policeUnit.ts | 50 +++ .../src/views/query/assessmentRecord.vue.bak | 148 --------- policeManagement/src/views/query/index.tsx | 311 ++++++++++++++++++ .../src/views/query/publicUnit.vue | 71 ++-- policeManagement/src/views/user/user.vue | 2 +- 6 files changed, 416 insertions(+), 170 deletions(-) delete mode 100644 policeManagement/src/views/query/assessmentRecord.vue.bak create mode 100644 policeManagement/src/views/query/index.tsx diff --git a/collect_information/.env.development b/collect_information/.env.development index 4e393f7..d7a068a 100644 --- a/collect_information/.env.development +++ b/collect_information/.env.development @@ -1,7 +1,7 @@ # 配置文档参考 https://taro-docs.jd.com/docs/next/env-mode-config TARO_APP_ID="wx0acd1c4fcf94bdd3" -# TARO_APP_BASE_API="http://172.10.10.93:8765" -TARO_APP_BASE_API="https://www.hnjinglian.cn:5678" +TARO_APP_BASE_API="http://172.10.10.93:8765" +# TARO_APP_BASE_API="https://www.hnjinglian.cn:5678" diff --git a/policeManagement/src/types/views/unitManage/police/policeUnit.ts b/policeManagement/src/types/views/unitManage/police/policeUnit.ts index e444489..0804615 100644 --- a/policeManagement/src/types/views/unitManage/police/policeUnit.ts +++ b/policeManagement/src/types/views/unitManage/police/policeUnit.ts @@ -14,6 +14,8 @@ export interface PoliceUnitPagerQueryParams { } export interface PoliceUnitPagerVo extends BaseTableRowRecord { + + sex: { label: string } /** 名称 **/ name?: string; /** 代码 **/ @@ -53,6 +55,7 @@ export interface EnterprisesUnitPagerQueryParams { } export interface EnterprisesUnitPagerVo extends BaseTableRowRecord { + sex: { label: string } /** 名字 **/ name?: string; type: BaseEnum @@ -86,9 +89,12 @@ export interface EnterprisesUnitPagerVo extends BaseTableRowRecord { remark?: string; } + + export interface EnterprisesUnitSaveOrUpdateParams { /** id **/ snowFlakeId?: string; + /** 公安单位id **/ policeUnitId: string; /** 名称 **/ @@ -108,3 +114,47 @@ export interface EnterprisesUnitSaveOrUpdateParams { /** 备注 **/ remark?: string; } + +export interface securityUnitIdListParams { + snowFlakeId?: string; + serviceProjectId?: string; + securityUnitId?: string; + name?: string; + remark?: string; + photo?: string; + telephone?: string; + workPost?: string; + sex?: string; + nativePlace?: string; + idCard?: string; + dateOfBirth?: string; + securityNumber?: string; + noSecurityNumberDesc?: string; + homeAddress?: string; +} +export interface securityUnitIdListPagerVo { + snowFlakeId?: string; + serviceProjectId?: string; + securityUnitId?: string; + name?: string; + remark?: string; + photo?: string; + telephone?: { + desensitizedValue?: string; + originalValue?: string; + }; + workPost?: string; + sex?: { + label?: string; + value: number | string + }; + nativePlace?: string; + idCard?: { + desensitizedValue?: string; + originalValue?: string; + }; + dateOfBirth?: string; + securityNumber?: string; + noSecurityNumberDesc?: string; + homeAddress?: string; +} diff --git a/policeManagement/src/views/query/assessmentRecord.vue.bak b/policeManagement/src/views/query/assessmentRecord.vue.bak deleted file mode 100644 index 3fc71eb..0000000 --- a/policeManagement/src/views/query/assessmentRecord.vue.bak +++ /dev/null @@ -1,148 +0,0 @@ - - - - - \ No newline at end of file diff --git a/policeManagement/src/views/query/index.tsx b/policeManagement/src/views/query/index.tsx new file mode 100644 index 0000000..6178a6a --- /dev/null +++ b/policeManagement/src/views/query/index.tsx @@ -0,0 +1,311 @@ +import { TableProMaxProps, TableProMaxSlots } from '@/types/components/table' +import { EnterprisesUnitPagerQueryParams, securityUnitIdListPagerVo, securityUnitIdListParams, PoliceUnitPagerVo } from '@/types/views/unitManage/police/policeUnit.ts' +import { reactive, ref } from 'vue' +import { FormExpose } from 'ant-design-vue/es/form/Form' +import { ComponentExposed } from 'vue-component-type-helpers' +import { FormProMaxItemOptions } from '@/types/components/form' +import { dictSelectNodes } from '@/config/dict.ts' +import { Button, message, Modal, Space, Tag } from 'ant-design-vue' +import api from '@/axios' +import TableProMax from '@/components/table/TableProMax.vue' +import { deleteDataModal } from '@/components/tsx/ModalPro.tsx' +import { PageParams } from '@/types/hooks/useTableProMax.ts' +import FormProMax from '@/components/form/FormProMax.vue' + +type _TableProps = TableProMaxProps + +const _formParams = reactive({ + snowFlakeId: '', // + serviceProjectId: '', // 服务项目id + securityUnitId: '', // 保安单位id + name: '', // + photo: '', + telephone: '', + workPost: '', + sex: '', + nativePlace: '', + idCard: '', + dateOfBirth: '', + securityNumber: '', + noSecurityNumberDesc: '', + homeAddress: '', + remark: '', +}) +const saveOrUpdateEnterprisesUnit = (callback: Function, params, type: string) => { + console.log('🚀 ~ saveOrUpdateEnterprisesUnit ~ params:', params) + if (type === 'add') { + _formParams.serviceProjectId = params.snowFlakeId + _formParams.securityUnitId = params.securityUnitId + } else { + _formParams.snowFlakeId = params.snowFlakeId + _formParams.serviceProjectId = params.serviceProjectId + _formParams.securityUnitId = params.securityUnitId + _formParams.name = params.name + _formParams.photo = params?.photo + _formParams.telephone = params.telephone.originalValue + _formParams.workPost = params.workPost + _formParams.sex = params.sex.value + _formParams.nativePlace = params.nativePlace + _formParams.idCard = params.idCard.originalValue + _formParams.dateOfBirth = params.dateOfBirth + _formParams.securityNumber = params.securityNumber + _formParams.noSecurityNumberDesc = params?.noSecurityNumberDesc + _formParams.homeAddress = params.homeAddress + _formParams.remark = params.remark + } + + const _formRef = ref(null) + + const _formOptions = ref>({ + name: { + type: 'input', + label: '姓名', + required: true, + }, + idCard: { + type: 'input', + label: '身份证', + required: true, + }, + telephone: { + type: 'input', + label: '手机号', + required: true, + }, + sex: { + type: 'radioGroup', + label: '性别', + required: true, + options: [...dictSelectNodes('Sex')], + }, + securityNumber: { + type: 'input', + label: '保安证号', + required: true, + }, + dateOfBirth: { + type: 'datePicker', + label: '出生日期', + componentsProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + }, + required: true, + }, + + workPost: { + type: 'input', + label: '工作岗位', + }, + nativePlace: { + type: 'input', + label: '籍贯', + }, + homeAddress: { + type: 'input', + label: '家庭住址', + }, + noSecurityNumberDesc: { + type: 'input', + label: '无证说明', + }, + + remark: { + type: 'inputTextArea', + label: '备注', + }, + }) + Modal.confirm({ + title: params.name ? `【${params.name}】 编辑保安信息` : '新增保安人员', + width: 600, + icon: ' ', + centered: true, + content: () => , + onOk: async () => { + await _formRef.value?.validate() + + const resp = await api.post('/m2/eu/add_upd_sec_user', { + ..._formParams, + }) + message.success(resp.message) + callback && callback() + }, + onCancel: async () => { + console.log('onCancel') + + _formParams.snowFlakeId = '' + _formParams.serviceProjectId = '' + _formParams.securityUnitId = '' + _formParams.name = '' + _formParams.photo = '' + _formParams.telephone = '' + _formParams.workPost = '' + _formParams.sex = '' + _formParams.nativePlace = '' + _formParams.idCard = '' + _formParams.dateOfBirth = '' + _formParams.securityNumber = '' + _formParams.noSecurityNumberDesc = '' + _formParams.homeAddress = '' + _formParams.remark = '' + }, + }) +} +// record_ +export const showEnterprisesUnit = (record_) => { + console.log('🚀 ~ showEnterprisesUnit ~ record_:', record_) + const _tableRef = ref>(null) + const _columns: _TableProps['columns'] = [ + { + dataIndex: 'name', + title: '姓名', + width: 100, + ellipsis: true, + }, + + { + dataIndex: 'idCard', + title: '身份证', + customRender: ({ text }) => { + return text.desensitizedValue + }, + width: 160, + ellipsis: true, + }, + + { + dataIndex: 'sex', + title: '性别', + width: 60, + customRender: ({ record }) => { + return {record.sex.label} + }, + }, + { + dataIndex: 'dateOfBirth', + title: '出生日期', + width: 100, + ellipsis: true, + }, + { + dataIndex: 'telephone', + title: '手机号', + width: 120, + ellipsis: true, + customRender: ({ text }) => text?.originalValue, + }, + { + dataIndex: 'securityNumber', + title: '保安证号', + width: 120, + ellipsis: true, + }, + { + dataIndex: 'nativePlace', + title: '籍贯', + width: 120, + ellipsis: true, + }, + { + dataIndex: 'workPost', + title: '工作岗位', + width: 120, + ellipsis: true, + }, + + { + dataIndex: 'homeAddress', + title: '家庭住址', + width: 120, + ellipsis: true, + }, + { + dataIndex: 'remark', + title: '备注', + width: 120, + }, + { + dataIndex: 'createTime', + title: '创建时间', + width: 120, + ellipsis: true, + }, + + { + dataIndex: 'opt', + title: '操作', + width: 200, + fixed: 'right', + customRender: ({ record }) => ( + + + + + ), + }, + ] + const x: number = _columns.reduce((a, b) => a + (b.width as number), 0) + const _reqApi: _TableProps['requestApi'] = (params) => { + // console.log(record_); + + ;(params as PageParams).params.serviceProjectId = record_.snowFlakeId + return api.post('/m2/eu/sec_user_pager', params) + } + Modal.info({ + title: `【${record_.name}】 管理保安人员`, + width: '80%', + centered: true, + maskClosable: true, + content: () => ( + { + return ( + + + + + ) + }, + } as TableProMaxSlots + } + /> + ), + }) +} diff --git a/policeManagement/src/views/query/publicUnit.vue b/policeManagement/src/views/query/publicUnit.vue index 9ad450f..11c4b15 100644 --- a/policeManagement/src/views/query/publicUnit.vue +++ b/policeManagement/src/views/query/publicUnit.vue @@ -1,6 +1,7 @@