From 87c9c7b0536218a555212889dff49343d0d1cd24 Mon Sep 17 00:00:00 2001 From: TimSpan Date: Fri, 29 Nov 2024 15:37:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=90=9C=E7=B4=A2=E4=BF=9D=E5=AE=89=E8=AF=81?= =?UTF-8?q?=E4=BB=B6=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- policeManagement/src/views/query/index.tsx | 53 ++++++++++++++----- .../src/views/query/publicUnit.vue | 4 +- 2 files changed, 43 insertions(+), 14 deletions(-) diff --git a/policeManagement/src/views/query/index.tsx b/policeManagement/src/views/query/index.tsx index 6178a6a..43e5a76 100644 --- a/policeManagement/src/views/query/index.tsx +++ b/policeManagement/src/views/query/index.tsx @@ -1,17 +1,19 @@ 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 { reactive, ref, h } 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 { Button, message, Modal, Space, Tag, Input } 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' - +import { debounce } from 'lodash-es' +import { SearchOutlined } from '@ant-design/icons-vue' +import axios from 'axios' type _TableProps = TableProMaxProps const _formParams = reactive({ @@ -31,8 +33,29 @@ const _formParams = reactive({ homeAddress: '', remark: '', }) + +const searchSecurityUnitId = debounce(async () => { + if (process.env.NODE_ENV === 'development') { + console.log('process.env.NODE_ENV === development') + const res = await axios.get(`https://www.hnjinglian.cn:5678/common/querySecurityNumberByIdCard?idCard=${_formParams.idCard}`) + if (res.data?.data?.hasOwnProperty('bayzh')) { + _formParams.securityNumber = res.data.data.bayzh + message.success(res.data.message) + } else { + message.error('未查询到保安证件号') + } + } else { + const res = await api.get('/common/querySecurityNumberByIdCard', { idCard: _formParams.idCard }) + if (res.data?.data?.hasOwnProperty('bayzh')) { + _formParams.securityNumber = res.data.data.bayzh + message.success(res.data.message) + } else { + message.error('未查询到保安证件号') + } + } +}, 300) const saveOrUpdateEnterprisesUnit = (callback: Function, params, type: string) => { - console.log('🚀 ~ saveOrUpdateEnterprisesUnit ~ params:', params) + // console.log('🚀 ~ saveOrUpdateEnterprisesUnit ~ params:', params) if (type === 'add') { _formParams.serviceProjectId = params.snowFlakeId _formParams.securityUnitId = params.securityUnitId @@ -56,17 +79,26 @@ const saveOrUpdateEnterprisesUnit = (callback: Function, params, type: string) = const _formRef = ref(null) - const _formOptions = ref>({ + const _formOptions = ref>({ name: { type: 'input', label: '姓名', required: true, }, idCard: { - type: 'input', + type: 'custom', label: '身份证', required: true, + customRender: () => ( + + + + + ), }, + telephone: { type: 'input', label: '手机号', @@ -122,7 +154,6 @@ const saveOrUpdateEnterprisesUnit = (callback: Function, params, type: string) = content: () => , onOk: async () => { await _formRef.value?.validate() - const resp = await api.post('/m2/eu/add_upd_sec_user', { ..._formParams, }) @@ -130,8 +161,6 @@ const saveOrUpdateEnterprisesUnit = (callback: Function, params, type: string) = callback && callback() }, onCancel: async () => { - console.log('onCancel') - _formParams.snowFlakeId = '' _formParams.serviceProjectId = '' _formParams.securityUnitId = '' @@ -150,9 +179,9 @@ const saveOrUpdateEnterprisesUnit = (callback: Function, params, type: string) = }, }) } -// record_ + export const showEnterprisesUnit = (record_) => { - console.log('🚀 ~ showEnterprisesUnit ~ record_:', record_) + // console.log('🚀 ~ showEnterprisesUnit ~ record_:', record_) const _tableRef = ref>(null) const _columns: _TableProps['columns'] = [ { @@ -245,7 +274,7 @@ export const showEnterprisesUnit = (record_) => { onClick={() => deleteDataModal(record.name, async () => { const resp = await api.delete('/m2/eu/del_security_user_id', { - enterprisesUnitId: record.snowFlakeId, + securityUserId: record?.securityUnitId, }) message.success(resp.message) await _tableRef.value?.requestGetTableData() diff --git a/policeManagement/src/views/query/publicUnit.vue b/policeManagement/src/views/query/publicUnit.vue index 11c4b15..1b50c6a 100644 --- a/policeManagement/src/views/query/publicUnit.vue +++ b/policeManagement/src/views/query/publicUnit.vue @@ -635,8 +635,8 @@ const expandedRowRender: TableProMaxProps['expandedRowRender'] = ({ record }) => return (