diff --git a/src/pages/realEstate/index.tsx b/src/pages/realEstate/index.tsx index 6564261..9fed200 100644 --- a/src/pages/realEstate/index.tsx +++ b/src/pages/realEstate/index.tsx @@ -10,7 +10,7 @@ import ModalFooter from "./components/modalFooter"; import { handleGetPassportInfoById } from "../DigitalElectronics/service"; // 引入地址解析工具 import { handleAddressChange, parseAddress } from "@/utils/addressParser"; -import { handleGetServerpartDDL, handleGetServerpartInfo } from "../serverpartAssets/service"; +import { handleGetServerpartDDL, handleGetServerpartInfo, handleGetServerpartTree } from "../serverpartAssets/service"; import { handleGetSERVERPARTDetail } from "../operationReport/service"; @@ -39,7 +39,13 @@ const RealEstate = ({ serverPartId, isComponent, onRef, selectRealEstateId }: { const [selectRowDetail, setSelectRowDetail] = useState() // 当前服务区下的方位 const [SERVERPARTREGION, setSERVERPARTREGION] = useState() - + // 服务区列表 + const [searchServerPartList, setSearchServerPartList] = useState() + const [columnsState, setColumnsState] = useState({ + PROVINCE_NAME: { show: false }, + CITY_NAME: { show: false }, + SPECIALINDUSTRY_NUMBER: { show: false }, + }) // 列表配置 const columns: any = [ @@ -60,7 +66,25 @@ const RealEstate = ({ serverPartId, isComponent, onRef, selectRealEstateId }: { fieldProps: { picker: "day", format: 'YYYY-MM-DD', - } + }, + hideInSearch: isComponent + }, + { + title: "服务区", + dataIndex: "serverPartId", + ellipsis: true, + width: 180, + align: 'center', + hideInTable: true, + valueType: 'select', + fieldProps: { + options: searchServerPartList, + showSearch: true, + filterOption: (input: string, option: any) => { + return option?.label?.toLowerCase().includes(input.toLowerCase()) + } + }, + hideInSearch: !isComponent }, { title: "服务区名称", @@ -71,16 +95,80 @@ const RealEstate = ({ serverPartId, isComponent, onRef, selectRealEstateId }: { align: 'center' }, { - title: "不动产类型", - dataIndex: "REALESTATE_TYPE", - width: 150, - valueType: "select", + title: "租赁期限", + dataIndex: "LEASEDATE", + hideInSearch: true, + ellipsis: true, + width: 250, align: 'center', - valueEnum: { - 1000: "房屋租赁", - 2000: "车辆资产", + render: (_: any, record: any) => { + return `${record?.START_LEASEDATE || ""}${record?.END_LEASEDATE ? `-${record?.END_LEASEDATE}` : ''}` } }, + + { + title: "查询内容", + dataIndex: "searchText", + hideInTable: true, + fieldProps: { + placeholder: "请输入省份名称/城市名称", + }, + hideInSearch: isComponent + }, + { + title: "省份名称", + dataIndex: "PROVINCE_NAME", + hideInSearch: true, + ellipsis: true, + width: 150, + align: 'center' + }, + { + title: "城市名称", + dataIndex: "CITY_NAME", + hideInSearch: true, + ellipsis: true, + width: 150, + align: 'center' + }, + { + title: "详细地址", + dataIndex: "REALESTATE_ADDRESS", + hideInSearch: true, + ellipsis: true, + width: 380, + align: 'center' + }, + { + title: "是否跨地", + dataIndex: "CROSS_CITYSIGN", + hideInSearch: true, + ellipsis: true, + width: 120, + align: 'center', + render: (_: any, record: any) => { + return record?.CROSS_CITYSIGN ? "是" : "否" + } + }, + { + title: "面积单位", + dataIndex: "AREA_UNIT", + hideInSearch: true, + ellipsis: true, + width: 120, + align: 'center', + valueType: "select", + valueEnum: { + 1: "平方千米", + 2: "平方米", + 3: "公顷", + 4: "亩", + 5: "h㎡", + 6: "k㎡", + 7: "㎡" + } + }, + { title: "产权证号", dataIndex: "ESTATE_IDENTITY", @@ -114,77 +202,17 @@ const RealEstate = ({ serverPartId, isComponent, onRef, selectRealEstateId }: { } }, { - title: "查询内容", - dataIndex: "searchText", - hideInTable: true, - fieldProps: { - placeholder: "请输入省份名称/城市名称", - } - }, - { - title: "省份名称", - dataIndex: "PROVINCE_NAME", - hideInSearch: true, - ellipsis: true, + title: "不动产类型", + dataIndex: "REALESTATE_TYPE", width: 150, - align: 'center' - }, - { - title: "城市名称", - dataIndex: "CITY_NAME", - hideInSearch: true, - ellipsis: true, - width: 150, - align: 'center' - }, - { - title: "详细地址", - dataIndex: "REALESTATE_ADDRESS", - hideInSearch: true, - ellipsis: true, - width: 180, - align: 'center' - }, - { - title: "是否跨地", - dataIndex: "CROSS_CITYSIGN", - hideInSearch: true, - ellipsis: true, - width: 120, - align: 'center', - render: (_: any, record: any) => { - return record?.CROSS_CITYSIGN ? "是" : "否" - } - }, - { - title: "面积单位", - dataIndex: "AREA_UNIT", - hideInSearch: true, - ellipsis: true, - width: 120, - align: 'center', valueType: "select", - valueEnum: { - 1: "平方千米", - 2: "平方米", - 3: "公顷", - 4: "亩", - 5: "h㎡", - 6: "k㎡", - 7: "㎡" - } - }, - { - title: "租赁期限", - dataIndex: "LEASEDATE", - hideInSearch: true, - ellipsis: true, - width: 250, align: 'center', - render: (_: any, record: any) => { - return `${record?.START_LEASEDATE || ""}${record?.END_LEASEDATE ? `-${record?.END_LEASEDATE}` : ''}` - } - } + valueEnum: { + 1000: "房屋租赁", + 2000: "车辆资产", + }, + hideInSearch: isComponent + }, ] // 获取当前用户信息的方法 @@ -289,11 +317,20 @@ const RealEstate = ({ serverPartId, isComponent, onRef, selectRealEstateId }: { return data } + // 获得服务区列表 + const handleGetServerPartList = async () => { + const req: any = { + ProvinceCode: "530000", + } + const data = await handleGetServerpartDDL(req) + setSearchServerPartList(data) + } useEffect(() => { if (isFirst) { handleGetUserInfo() setIsFirst(false) + handleGetServerPartList() } }, []) @@ -323,20 +360,47 @@ const RealEstate = ({ serverPartId, isComponent, onRef, selectRealEstateId }: { rowKey={'REALESTATE_ID'} scroll={{ x: '100%', y: 'calc(100vh - 450px)' }} headerTitle={'不动产列表'} - search={isComponent ? false : { span: 6, }} + search={isComponent && Number(serverPartId) !== 1269 ? false : { span: 6 }} request={async (params) => { + console.log('selectRealEstateIdselectRealEstateId', selectRealEstateId); + if (!selectedId && !isComponent) { return [] } + if (isComponent && selectRealEstateId && selectRealEstateId.length > 0) { + + } else { + if (Number(serverPartId) === 1269 && params?.serverPartId) { + + } else { + return [] + } + } + + + // if (Number(serverPartId) === 1269 && params?.serverPartId && !(selectRealEstateId && selectRealEstateId.length > 0)) { + + // } else { + // return [] + // } + + // if (isComponent && !(selectRealEstateId && selectRealEstateId.length > 0)) { + // return [] + // } + + console.log('serverPartIdserverPartIdserverPartId', serverPartId); + + const req: any = { searchParameter: { REALESTATE_TYPE: isComponent ? '' : params?.REALESTATE_TYPE || "",// 不动产类型 - SERVERPART_IDS: isComponent ? serverPartId : selectedId, + SERVERPART_IDS: isComponent ? Number(serverPartId) === 1269 ? params?.serverPartId : selectedId : selectedId, START_LEASEDATE_End: isComponent ? '' : params?.END_LEASEDATE_Start || "", END_LEASEDATE_Start: isComponent ? '' : params?.START_LEASEDATE_End || "", - REALESTATE_STATE: 1 + REALESTATE_STATE: 1, + REALESTATE_IDS: isComponent ? Number(serverPartId) === 1269 && !params?.serverPartId ? selectRealEstateId ? selectRealEstateId.toString() : "" : '' : '' }, PageIndex: 1, PageSize: 999999, @@ -349,6 +413,8 @@ const RealEstate = ({ serverPartId, isComponent, onRef, selectRealEstateId }: { name: "", value: encryptAES(JSON.stringify(req)) } + console.log('req', req); + const data: any = await handleGetREALESTATEList(newReq) console.log('datadatadata', data); if (data && data.length > 0) { @@ -373,6 +439,12 @@ const RealEstate = ({ serverPartId, isComponent, onRef, selectRealEstateId }: { }}>添加不动产 ] }} + columnsState={{ + value: columnsState, + onChange: (value) => { + setColumnsState(value) + } + }} /> @@ -521,10 +593,10 @@ const RealEstate = ({ serverPartId, isComponent, onRef, selectRealEstateId }: { diff --git a/src/pages/redReversal/components/InvoiceDetial.tsx b/src/pages/redReversal/components/InvoiceDetial.tsx index 6b91958..fe3182e 100644 --- a/src/pages/redReversal/components/InvoiceDetial.tsx +++ b/src/pages/redReversal/components/InvoiceDetial.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useRef, useState } from "react"; import ProForm, { ProFormSelect, ProFormText, ProFormTextArea } from "@ant-design/pro-form"; -import { Col, Drawer, FormInstance, Row, Table, Typography, Space, Button, Empty, Divider, Input, message, Select, Modal } from "antd"; +import { Col, Drawer, FormInstance, Row, Table, Typography, Space, Button, Empty, Divider, Input, message, Select, Modal, Tooltip } from "antd"; import { connect } from "umi"; import { ActionType, ProTable } from "@ant-design/pro-components"; import { handleGetAPPLYAPPROVEList, handleGetBILLDETAILList, handleSynchroBILLDETAILList } from "@/pages/DigitalElectronics/service"; @@ -73,44 +73,53 @@ const InvoiceDetail = ({ showDetail, setShowDetail, parentRow, setParentRow, par dataIndex: "index", valueType: "index", align: 'center', - width: 70 + width: 70, + fixed: 'left' }, { title:
款项名称
, align: 'left', - width: 230, + width: 200, dataIndex: "ITEM_NAME", - ellipsis: true + ellipsis: true, + fixed: 'left' }, { title:
税务代码
, align: 'left', width: 180, dataIndex: "TABLE_NAME", + fixed: 'left', ellipsis: true, render: (_, record) => { - return isEdit ? { - let value: string = e.target.value || "" - let tableData: any = JSON.parse(JSON.stringify(tableEditData)) - tableData.forEach((item: any) => { - if (item.BILLDETAIL_ID === record.BILLDETAIL_ID) { - item.TABLE_NAME = value - } - }) - setTableEditData(tableData) - }} /> : record.TABLE_NAME + const currentItem = tableEditData?.find((item: any) => item.BILLDETAIL_ID === record.BILLDETAIL_ID) || record; + return isEdit ? { + let value: string = e.target.value || "" + let tableData: any = JSON.parse(JSON.stringify(tableEditData)) + tableData.forEach((item: any) => { + if (item.BILLDETAIL_ID === record.BILLDETAIL_ID) { + item.TABLE_NAME = value + } + }) + setTableEditData(tableData) + }} /> : currentItem.TABLE_NAME } }, { title:
税率
, align: 'center', width: 80, + fixed: 'left', dataIndex: "DUTY_PARAGRAPH", render: (_, record) => { + const currentItem = tableEditData?.find((item: any) => item.BILLDETAIL_ID === record.BILLDETAIL_ID) || record; return isEdit ? { - let value: string = e.target.value || "" - let tableData: any = JSON.parse(JSON.stringify(tableEditData)) - tableData.forEach((item: any) => { - if (item.BILLDETAIL_ID === record.BILLDETAIL_ID) { - item.ITEM_RULE = value - } - }) - setTableEditData(tableData) - }} /> : record.ITEM_RULE + const currentItem = tableEditData?.find((item: any) => item.BILLDETAIL_ID === record.BILLDETAIL_ID) || record; + return isEdit ? { + let value: string = e.target.value || "" + let tableData: any = JSON.parse(JSON.stringify(tableEditData)) + tableData.forEach((item: any) => { + if (item.BILLDETAIL_ID === record.BILLDETAIL_ID) { + item.ITEM_RULE = value + } + }) + setTableEditData(tableData) + }} /> : currentItem.ITEM_RULE } }, { @@ -159,16 +172,19 @@ const InvoiceDetail = ({ showDetail, setShowDetail, parentRow, setParentRow, par dataIndex: "ITEM_UNIT", ellipsis: true, render: (_, record) => { - return isEdit ? { - let value: string = e.target.value || "" - let tableData: any = JSON.parse(JSON.stringify(tableEditData)) - tableData.forEach((item: any) => { - if (item.BILLDETAIL_ID === record.BILLDETAIL_ID) { - item.ITEM_UNIT = value - } - }) - setTableEditData(tableData) - }} /> : record.ITEM_UNIT + const currentItem = tableEditData?.find((item: any) => item.BILLDETAIL_ID === record.BILLDETAIL_ID) || record; + return isEdit ? { + let value: string = e.target.value || "" + let tableData: any = JSON.parse(JSON.stringify(tableEditData)) + tableData.forEach((item: any) => { + if (item.BILLDETAIL_ID === record.BILLDETAIL_ID) { + item.ITEM_UNIT = value + } + }) + setTableEditData(tableData) + }} /> : currentItem.ITEM_UNIT } }, { @@ -181,34 +197,34 @@ const InvoiceDetail = ({ showDetail, setShowDetail, parentRow, setParentRow, par { title:
单价
, align: 'right', - width: 120, + width: 80, valueType: 'digit', dataIndex: "INVOICE_PRICE" }, { title:
金额
, align: 'right', - width: 120, + width: 80, valueType: 'digit', dataIndex: "INVOICE_AMOUNT" }, { title:
税额
, align: 'right', - width: 120, + width: 80, valueType: 'digit', dataIndex: "INVOICE_TAX" }, { title:
折扣
, align: 'center', - width: 120, + width: 80, dataIndex: "INVOICE_DISCOUNT" }, { title: "不动产", dataIndex: "option", - width: 120, + width: 80, align: 'center', render: (_: any, record: any) => { return record?.REALESTATE_ID ? @@ -219,10 +235,16 @@ const InvoiceDetail = ({ showDetail, setShowDetail, parentRow, setParentRow, par }}> {realEstateEnum && realEstateEnum[record?.REALESTATE_ID] ? realEstateEnum[record?.REALESTATE_ID] : record?.REALESTATE_ID} : - < Button type={'primary'} onClick={async () => { - setCurrentRow(record) - setSelectRealEstateModal(true) - }}> 选择不动产 + + + + } } // { @@ -388,6 +410,9 @@ const InvoiceDetail = ({ showDetail, setShowDetail, parentRow, setParentRow, par // 保存税务代码触发的事件 const handleSaveTaxCode = async () => { + console.log('dsamkdas', tableEditData); + + return // 当前的表格数据 let newreqResult: any = { name: "", @@ -414,7 +439,7 @@ const InvoiceDetail = ({ showDetail, setShowDetail, parentRow, setParentRow, par const handleGetThisServerpartRealEstateData = async () => { const req: any = { searchParameter: { - SERVERPART_IDS: parentRow?.SERVERPART_ID || "", + SERVERPART_IDS: Number(parentRow?.SERVERPART_ID) === 1269 ? '' : (parentRow?.SERVERPART_ID || ""), REALESTATE_STATE: 1 }, PageIndex: 1, @@ -566,7 +591,11 @@ const InvoiceDetail = ({ showDetail, setShowDetail, parentRow, setParentRow, par columns={detailColumns} bordered scroll={{ x: "100%", y: '500px' }} - pagination={false} + // pagination={false} + pagination={{ + defaultPageSize: 100, + pageSizeOptions: ['100', '200', '500', '1000'], + }} request={async () => { // 调用一次 获取这个服务区里面的全部 不动产信息 handleGetThisServerpartRealEstateData() @@ -583,6 +612,8 @@ const InvoiceDetail = ({ showDetail, setShowDetail, parentRow, setParentRow, par if (billDetail && billDetail.length > 0) { setTableEditData(billDetail) setReqDetailList(billDetail) + console.log('billDetailbillDetailbillDetail', billDetail); + return { data: billDetail, success: true } } return { data: [], success: true } @@ -740,7 +771,7 @@ const InvoiceDetail = ({ showDetail, setShowDetail, parentRow, setParentRow, par {/* 不动产的悬浮框 */}