This commit is contained in:
ylj20011123 2025-12-17 18:13:53 +08:00
parent fc695d48d3
commit 4dee3cbed6
10 changed files with 554 additions and 120 deletions

View File

@ -78,6 +78,11 @@ export default [
name: '不动产管理',
component: "@/pages/realEstate/index",
},
{
path: '/ComplaintApproval/index',
name: '投诉审批',
component: "@/pages/ComplaintApproval/index",
},
]

View File

@ -42,16 +42,13 @@ const LeftSelectTree = ({ setSelectedId, reload, actionRef, currentUser, width,
UserIdEncrypted: addressParams.UserIdEncrypted
}
const userInfo = await handleGetPassportInfoById(req)
console.log('userInfouserInfouserInfo', userInfo);
let data: any = []
if (userInfo?.UserPattern === 2000) {
data = await getMerchantShopTree({ BusinessManId: userInfo?.BusinessManID, ShowShop: false });
} else {
data = await getServerpartTree(userInfo?.ProvinceCode, userInfo?.CityAuthority, true, true, true, false, 1000)
data = await getServerpartTree(userInfo?.ProvinceCode, userInfo?.CityAuthority, true, true, true, false, '1000,4000')
}
console.log('datatree', data);
// 判断是否有多个片区的权限
if (data && data.length > 1) {
@ -81,10 +78,8 @@ const LeftSelectTree = ({ setSelectedId, reload, actionRef, currentUser, width,
if (noWj) {
list = handleFilterList(list, 89)
}
console.log('list2', list);
if (handleGetLeftTreeData) {
let newData: any = await handleGetLeftTreeData()
console.log('newData', newData);
setTreeView(newData)
} else {
setTreeView(list)
@ -150,7 +145,6 @@ const LeftSelectTree = ({ setSelectedId, reload, actionRef, currentUser, width,
res.push(item)
}
})
console.log('res', res);
return res
}

View File

@ -1,7 +1,7 @@
import request from "@/utils/requestOld"
export async function getServerpartTree(ProvinceCode?: number | string, ServerpartCodes?: string,
ShowWholePower?: boolean, ShowSPRegion?: boolean, ShowRoyalty?: boolean | false, ShowCompactCount?: boolean | false, StatisticsType?: number): Promise<ServerpartTree[]> {
ShowWholePower?: boolean, ShowSPRegion?: boolean, ShowRoyalty?: boolean | false, ShowCompactCount?: boolean | false, StatisticsType?: any): Promise<ServerpartTree[]> {
// ShowRoyalty 无论传入什么都是false
const data = await request(`/BaseInfo/GetServerpartTree?
ProvinceCode=${ProvinceCode || ''}&ServerpartCodes=${ServerpartCodes || ''}&

View File

@ -305,6 +305,12 @@ const UserModel: UserModelType = {
name: '不动产管理',
component: "@/pages/realEstate/index",
},
{
path: '/ComplaintApproval/index',
redirect: '',
name: '投诉审批',
component: "@/pages/ComplaintApproval/index",
},
]
}
@ -388,6 +394,7 @@ const UserModel: UserModelType = {
"/RentCalculation/index",
"/rentComparison/index",
"/realEstate/index",
"/ComplaintApproval/index",
// '/examine/index',
// '/examine/modal',
// '/examine/question',

View File

@ -0,0 +1,193 @@
import LeftSelectTree from "@/components/leftSelectTree/leftSelectTree"
import { ActionType, ProForm, ProFormSelect, ProFormText, ProFormTextArea, ProFormUploadButton, ProTable } from "@ant-design/pro-components"
import { Button, Col, FormInstance, Modal, Popconfirm, Row } from "antd"
import moment from "moment"
import { useRef, useState } from "react"
// 投诉审批页面
const ComplaintApproval = () => {
const actionRef = useRef<ActionType>();
const formRef = useRef<FormInstance>();
const modalFormRef = useRef<FormInstance>();
const transferFormRef = useRef<FormInstance>();
// 树相关的属性和方法
const [selectedId, setSelectedId] = useState<string>()
const [collapsible, setCollapsible] = useState<boolean>(false)
// 点击的行数据
const [currentRow, setCurrentRow] = useState<any>()
// 显示悬浮框
const [showDetail, setShowDetail] = useState<boolean>(false)
// 悬浮框点击确认的加载效果
const [confirmLoading, setConfirmLoading] = useState<boolean>(false)
// 转办的悬浮框
const [transferModal, setTransferModal] = useState<boolean>(false)
// 转办悬浮框的loading效果
const [transferLoading, setTransferLoading] = useState<boolean>(false)
// 列表配置
const columns: any = [
]
return <div style={{ height: 'calc(100vh - 100px)', backgroundColor: '#fff', display: 'flex' }}>
<LeftSelectTree setSelectedId={setSelectedId} setCollapsible={setCollapsible} collapsible={collapsible} />
<div style={{
width: !collapsible ? 'calc(100% - 300px)' : 'calc(100% - 60px)',
paddingTop: 0,
paddingBottom: 0,
paddingRight: 0
}}>
<ProTable
actionRef={actionRef}
formRef={formRef}
columns={columns}
bordered
scroll={{ x: '100%', y: 'calc(100vh - 450px)' }}
headerTitle={'投诉审批列表'}
search={{ span: 6, }}
request={async (params) => {
}}
toolbar={{
actions: [
<Button type="primary" onClick={() => {
setShowDetail(true)
}}></Button>
]
}}
/>
</div>
{/* 投诉的悬浮框 Modal */}
<Modal
title={currentRow ? '审批投诉' : '添加投诉'}
destroyOnClose
width={900}
open={showDetail}
className="ComplaintApprovalModalBox"
onCancel={() => {
setCurrentRow(undefined)
setShowDetail(false)
}}
confirmLoading={confirmLoading}
footer={<div style={{ width: '100%', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
<div>
<Button type={'primary'} loading={confirmLoading} onClick={() => {
setTransferModal(true)
}}></Button>
</div>
<div>
<Button style={{ marginRight: '8px' }} onClick={() => {
setCurrentRow(undefined)
setShowDetail(false)
}}></Button>
<Button type={'primary'} loading={confirmLoading} onClick={() => {
}}></Button>
<Popconfirm title="确定驳回审核?">
<Button type={'primary'} style={{ marginRight: '8px' }} danger loading={confirmLoading} onClick={() => {
}}></Button>
</Popconfirm>
<Popconfirm title="确定审核通过?">
<Button type={'primary'} loading={confirmLoading} onClick={() => {
}}></Button>
</Popconfirm>
</div>
</div>}
>
<ProForm
formRef={modalFormRef}
submitter={false}
onFinish={() => {
}}
>
<Row>
<Col span={24}>
<ProFormTextArea
label={'投诉内容'}
name={''}
rules={[{ required: true, message: '请输入投诉内容!' }]}
/>
</Col>
<Col span={24}>
<ProFormUploadButton
label={'上传附件'}
name={'attachment'}
rules={[{ required: true, message: '请上传附件!' }]}
/>
</Col>
{/* 安全员核实反馈内容 */}
<Col span={24}>
<ProFormTextArea
label={'核实情况'}
name={''}
rules={[{ required: true, message: '请输入核实情况!' }]}
/>
</Col>
<Col span={24}>
<ProFormTextArea
label={'处置结果'}
name={''}
rules={[{ required: true, message: '请输入处置结果!' }]}
/>
</Col>
<Col span={24}>
<ProFormUploadButton
label={'附件资料'}
name={''}
rules={[{ required: true, message: '请上传附件资料!' }]}
/>
</Col>
</Row>
</ProForm>
</Modal>
{/* 转办的悬浮框 */}
<Modal
title={'审批转办'}
destroyOnClose
width={600}
open={transferModal}
onCancel={() => {
setTransferModal(false)
}}
onOk={() => {
//因为如果是转办成功 那么肯定是两个悬浮框都关闭 且 表格重新刷新的
// 当前悬浮框的关闭内容
setTransferModal(false)
// 投诉悬浮框关闭的内容
setCurrentRow(undefined)
setShowDetail(false)
// 表格数据更新
actionRef.current?.reload()
}}
confirmLoading={transferLoading}
>
<ProForm
formRef={transferFormRef}
submitter={false}
>
<Row>
<Col span={24}>
<ProFormSelect
label={"转办人"}
name={'transferPerson'}
rules={[{ required: true, message: '请选择转办人!' }]}
/>
</Col>
</Row>
</ProForm>
</Modal>
</div>
}
export default ComplaintApproval

View File

@ -9,6 +9,7 @@ import moment from "moment";
import { encryptAES } from "@/utils/handleAes";
import { ProForm, ProFormSelect, ProFormTextArea } from "@ant-design/pro-components";
import InvoiceDetial from "../redReversal/components/InvoiceDetial";
import { handleGetREALESTATEList } from "../realEstate/service";
interface ConnectState {
user: {
@ -522,12 +523,12 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
// 同步旧票子 变为 红冲申请中
await handleSynchroBILL(2, {
...record,
billDetail: billDetail
DetailList: billDetail
})
// 针对这个红冲 开一张新票子 编码为新的红冲编码 状态为9000 开票中 且票据类型变为 3000 红票 BILL_TYPE
await handleUpdateOldBill({
...record,
billDetail: billDetail,
DetailList: billDetail,
BILL_TYPE: 3000,
BILL_STATE: 9000,
BILL_NO: `HC-${record?.BILL_NO}`,
@ -549,13 +550,11 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
const handleInvoice = async (record: Datum) => {
try {
message.loading({ content: '正在发起开票...', key: 'invoice' });
// 检查是否有access_token
if (!accessToken) {
message.error({ content: '缺少访问令牌,请先刷新页面重新获取', key: 'invoice' });
return;
}
// 拿个票据明细
const billDetail = await handleGetBILLDETAILList({
SearchParameter: {
@ -565,9 +564,12 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
PageSize: 999999,
SortStr: "BILLDETAIL_ID"
})
let billDetailReq: any = []
// 可能存在的不动产数据
let estateLeaseItems: any = []
if (billDetail && billDetail.length > 0) {
// 从当前商品的详情里面取出 用的到的 不动产id
let REALESTATE_IDList: Number[] = []
billDetail.forEach((item: any) => {
billDetailReq.push({
amount: item.INVOICE_AMOUNT, // 明细金额
@ -579,11 +581,60 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
revenueCode: item.TABLE_NAME,// 税收分类编码
taxRate: (item.DUTY_PARAGRAPH / 100).toFixed(2),// 税率
units: item.ITEM_UNIT,// 计量单位
specification: item.ITEM_RULE// 规格
specification: item.ITEM_RULE,// 规格
REALESTATE_ID: item.REALESTATE_ID,// 不动产id
BILLDETAIL_DESC: item.BILLDETAIL_DESC // 备注
})
REALESTATE_IDList.push(Number(item.REALESTATE_ID))
})
console.log('dhaskdhaslhdasl', billDetail);
// REALESTATE_ID 是,隔开的不动产id 这里去查询 记录 有多少条
const req: any = {
searchParameter: {
SERVERPART_IDS: record?.SERVERPART_ID || "",
REALESTATE_STATE: 1
},
PageIndex: 1,
PageSize: 999999,
}
let newReq: any = {
name: "",
value: encryptAES(JSON.stringify(req))
}
const data: any = await handleGetREALESTATEList(newReq)
console.log('dhaskdhaslhdasl', data);
// 这个服务区的全部不动产的数据 都在data里面
if (data && data.length > 0) {
let unitObj: any = {
1: "平方千米",
2: "平方米",
3: "公顷",
4: "亩",
5: "h㎡",
6: "k㎡",
7: "㎡"
}
data.forEach((item: any) => {
if (REALESTATE_IDList.indexOf(item.REALESTATE_ID) !== -1) {
estateLeaseItems.push({
provinceAdress: item.PROVINCE_NAME, // 省份
cityAdreess: item.CITY_NAME,// 城市
detailAddress: item.REALESTATE_ADDRESS,// 不动产详细地址
crossCitySign: item.CROSS_CITYSIGN,// 跨地(市)标志
areaunit: item.AREA_UNIT ? unitObj[item.AREA_UNIT] : "",//面积单位
startLeaseDate: item.START_LEASEDATE, // 租赁开始日期
endLeaseDate: item.END_LEASEDATE,//租赁结束日期
estateId: item.ESTATE_IDENTITY,//房屋产权证书/不动产权证号
specialIndustryNumber: item.SPECIALINDUSTRY_NUMBER,//不动产基础资料编码
carBrandNo: item.CARBRAND_NO,// 车牌号
})
}
})
}
}
let obj: any = {
billNo: record?.BILL_NO, // 单据编号
@ -625,13 +676,20 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
// originalIssueTime: record?.originalIssueTime,
// blueInvoiceType: record?.blueInvoiceType,
// blueinvoiceCode: record?.blueinvoiceCode,
billDetail: billDetailReq
billDetail: billDetailReq,
estateLeaseItems: estateLeaseItems,
specialType: estateLeaseItems && estateLeaseItems.length > 0 ? 'E06' : '00'
}
console.log('objobj', obj);
console.log('billDetailbillDetailbillDetail', billDetail);
console.log('estateLeaseItemsestateLeaseItemsestateLeaseItems', estateLeaseItems);
// 构造原始数据
const originalData = [obj]; // 将record作为data数组的一项
// 将data字段进行base64加密
const dataString = JSON.stringify(originalData);
console.log('dataStringdataStringdataString', dataString);
const encryptedData = btoa(unescape(encodeURIComponent(dataString))); // base64编码支持中文
// 构造开票请求数据
const invoiceData = {
@ -656,11 +714,14 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
if (response && response.success) {
let res: any = JSON.parse(decodeURIComponent(escape(atob(response.data))));
console.log('resresresresres', res);
message.success({ content: `单据 ${record.BILL_NO} 开票申请已提交成功`, key: 'invoice' });
actionRef.current?.reload()
// 他们的调用成功了 再调用我们自己的 同步票据信息表 的接口
handleSynchroBILL(1, record)
handleSynchroBILL(1, {
...record,
DetailList: billDetail
})
} else {
@ -901,28 +962,6 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
const handleSynchroBILL = async (type: number, obj: any) => {
// type 1 开票的同步状态 即 9000 2 开票的红冲状态 即 9990
// 发票明细列表
let detailList: any = []
if (obj?.billDetail && obj?.billDetail.length > 0) {
obj?.billDetail.forEach((item: any) => {
detailList.push({
ITEM_NAME: item.goodsName,// 款项名称
ITEM_RULE: item.specification,// 规格型号
ITEM_UNIT: item.units,// 计量单位
INVOICE_COUNT: item.quantity,// 开票数量
INVOICE_PRICE: item.price,// 开票单价
INVOICE_AMOUNT: item.amount,// 开票金额
DUTY_PARAGRAPH: item.taxRate,// 开票税率
INVOICE_TAX: item.taxAmount,// 开票税额
INVOICE_DISCOUNT: item.discountAmount,// 折扣金额
INVOICE_DISCOUNTTAX: "",// 折扣税额
ITEM_ACTAMOUNT: "",// 款项价税合计
ITEM_DEDUCTIONAMOUNT: "",// 扣除额
ITEM_ID: "",// 关联数据表内码(多个)
TABLE_NAME: "",// 数据表名称
OPERATE_DATE: moment().format('YYYY-MM-DD HH:mm:ss'),// 操作时间
})
})
}
let req: any = {
...obj,
BILL_TYPE: obj.BILL_TYPE || "", // 票据类型1000增值税专用发票2000普通发票 ,
@ -1116,7 +1155,7 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
</ProForm>
</Modal>
<InvoiceDetial showDetail={showDetailModal} setShowDetail={setShowDetailModal} parentRow={currentRow} setParentRow={setCurrentRow} />
<InvoiceDetial showDetail={showDetailModal} setShowDetail={setShowDetailModal} parentRow={currentRow} setParentRow={setCurrentRow} parentTableRef={actionRef} />
</div>
)

View File

@ -14,6 +14,7 @@ const authority: PageAuthority = {
'/RentCalculation/index': ['/RentCalculation/index'],
'/rentComparison/index': ['/rentComparison/index'],
'/realEstate/index': ['/realEstate/index'],
'/ComplaintApproval/index': ['/ComplaintApproval/index'],
};

View File

@ -88,7 +88,7 @@ const RealEstate = ({ serverPartId, isComponent, onRef, selectRealEstateId }: {
width: 150,
align: 'center',
render: (_, record) => {
return record?.ESTATE_IDENTITY ? isComponent ? record?.ESTATE_IDENTITY : <a onClick={() => {
return record?.ESTATE_IDENTITY ? <a onClick={() => {
setCurrentRow(record)
setShowDetail(true)
}}>
@ -104,7 +104,7 @@ const RealEstate = ({ serverPartId, isComponent, onRef, selectRealEstateId }: {
width: 150,
align: 'center',
render: (_, record) => {
return record?.SPECIALINDUSTRY_NUMBER ? isComponent ? record?.ESTATE_IDENTITY : <a onClick={() => {
return record?.SPECIALINDUSTRY_NUMBER ? <a onClick={() => {
setCurrentRow(record)
setShowDetail(true)
}}>
@ -161,7 +161,17 @@ const RealEstate = ({ serverPartId, isComponent, onRef, selectRealEstateId }: {
hideInSearch: true,
ellipsis: true,
width: 120,
align: 'center'
align: 'center',
valueType: "select",
valueEnum: {
1: "平方千米",
2: "平方米",
3: "公顷",
4: "亩",
5: "h㎡",
6: "k㎡",
7: "㎡"
}
},
{
title: "租赁期限",
@ -294,6 +304,7 @@ const RealEstate = ({ serverPartId, isComponent, onRef, selectRealEstateId }: {
headerTitle={'不动产列表'}
search={isComponent ? false : { span: 6, }}
request={async (params) => {
if (!selectedId && !isComponent) {
return []
}
@ -325,7 +336,7 @@ const RealEstate = ({ serverPartId, isComponent, onRef, selectRealEstateId }: {
return { data: [], success: true }
}}
rowSelection={isComponent ? {
type: 'checkbox',
type: 'radio',
defaultSelectedRowKeys: selectRealEstateId || [],
onChange: (_, row) => {
console.log('__', _);
@ -335,7 +346,7 @@ const RealEstate = ({ serverPartId, isComponent, onRef, selectRealEstateId }: {
}
} : false}
toolbar={{
actions: [
actions: isComponent ? [] : [
<Button type="primary" onClick={() => {
setShowDetail(true)
}}></Button>
@ -356,6 +367,7 @@ const RealEstate = ({ serverPartId, isComponent, onRef, selectRealEstateId }: {
}}
confirmLoading={confirmLoading}
footer={
isComponent ? false :
<ModalFooter
confirmLoading={confirmLoading}
hideDelete={!currentRow?.REALESTATE_ID}
@ -406,6 +418,7 @@ const RealEstate = ({ serverPartId, isComponent, onRef, selectRealEstateId }: {
required: true,
message: '请选择不动产类型!'
}]}
readonly={isComponent}
/>
</Col>
@ -454,12 +467,14 @@ const RealEstate = ({ serverPartId, isComponent, onRef, selectRealEstateId }: {
required: true,
message: '请选择服务区!'
}]}
readonly={isComponent}
/>
</Col>
<Col span={8} style={{ display: 'none' }}>
<ProFormText
label={'服务区'}
name={'SERVERPART_NAME'}
readonly={isComponent}
/>
</Col>
<Col span={8}>
@ -467,6 +482,8 @@ const RealEstate = ({ serverPartId, isComponent, onRef, selectRealEstateId }: {
label={'租赁日期'}
name={"LEASEDATE"}
style={{ width: '100%' }}
rules={[{ required: true, message: '请选择租赁日期!' }]}
readonly={isComponent}
/>
</Col>
@ -474,12 +491,16 @@ const RealEstate = ({ serverPartId, isComponent, onRef, selectRealEstateId }: {
<ProFormText
label={'省份名称'}
name={'PROVINCE_NAME'}
rules={[{ required: true, message: '请输入省份名称!' }]}
readonly={isComponent}
/>
</Col>
<Col span={8} >
<ProFormText
label={'城市名称'}
name={'CITY_NAME'}
rules={[{ required: true, message: '请输入城市名称!' }]}
readonly={isComponent}
/>
</Col>
<Col span={8} >
@ -490,12 +511,15 @@ const RealEstate = ({ serverPartId, isComponent, onRef, selectRealEstateId }: {
{ label: "是", value: 1 },
{ label: "否", value: 0 },
]}
readonly={isComponent}
/>
</Col>
<Col span={24} >
<ProFormTextArea
label={'详细地址'}
name={'REALESTATE_ADDRESS'}
rules={[{ required: true, message: '请输入详细地址!' }]}
readonly={isComponent}
/>
</Col>
<Col span={8} >
@ -511,6 +535,8 @@ const RealEstate = ({ serverPartId, isComponent, onRef, selectRealEstateId }: {
{ label: "k㎡", value: 6 },
{ label: "㎡", value: 7 }
]}
rules={[{ required: true, message: '请选择面积单位!' }]}
readonly={isComponent}
/>
</Col>
<Col span={8} >
@ -527,6 +553,7 @@ const RealEstate = ({ serverPartId, isComponent, onRef, selectRealEstateId }: {
},
}),
]}
readonly={isComponent}
/>
</Col>
<Col span={8} >
@ -543,6 +570,7 @@ const RealEstate = ({ serverPartId, isComponent, onRef, selectRealEstateId }: {
},
}),
]}
readonly={isComponent}
/>
</Col>

View File

@ -22,10 +22,11 @@ interface ParamsType {
setShowDetail: (v: boolean) => void;
parentRow: any;
setParentRow: (v: any) => void;
parentTableRef?: any; // 父表格实例
}
const InvoiceDetail = ({ showDetail, setShowDetail, parentRow, setParentRow }: ParamsType) => {
const InvoiceDetail = ({ showDetail, setShowDetail, parentRow, setParentRow, parentTableRef }: ParamsType) => {
const realEstateRef = useRef<any>();
const formRef = useRef<FormInstance<any>>();
const detailActionRef = useRef<ActionType>();
@ -60,6 +61,10 @@ const InvoiceDetail = ({ showDetail, setShowDetail, parentRow, setParentRow }: P
const [selectRealEstateId, setSelectRealEstateId] = useState<any>();
// 选择不动产的loading
const [realEstateLoading, setRealEstateLoading] = useState<boolean>(false);
// 当前发票明细 点击的行的信息
const [currentRow, setCurrentRow] = useState<any>();
// 解析不动产的枚举
const [realEstateEnum, setRealEstateEnum] = useState<any>();
const detailColumns: any = [
@ -68,19 +73,19 @@ const InvoiceDetail = ({ showDetail, setShowDetail, parentRow, setParentRow }: P
dataIndex: "index",
valueType: "index",
align: 'center',
width: 80
width: 70
},
{
title: <div style={{ textAlign: 'center' }}></div>,
align: 'left',
width: 250,
width: 230,
dataIndex: "ITEM_NAME",
ellipsis: true
},
{
title: <div style={{ textAlign: 'center' }}></div>,
align: 'left',
width: 200,
width: 180,
dataIndex: "TABLE_NAME",
ellipsis: true,
render: (_, record) => {
@ -96,11 +101,10 @@ const InvoiceDetail = ({ showDetail, setShowDetail, parentRow, setParentRow }: P
}} /> : record.TABLE_NAME
}
},
{
title: <div style={{ textAlign: 'center' }}></div>,
align: 'center',
width: 120,
width: 80,
dataIndex: "DUTY_PARAGRAPH",
render: (_, record) => {
return isEdit ?
@ -125,7 +129,7 @@ const InvoiceDetail = ({ showDetail, setShowDetail, parentRow, setParentRow }: P
{
title: <div style={{ textAlign: 'center' }}></div>,
align: 'left',
width: 150,
width: 120,
dataIndex: "ITEM_ID",
ellipsis: true
},
@ -133,13 +137,15 @@ const InvoiceDetail = ({ showDetail, setShowDetail, parentRow, setParentRow }: P
title: <div style={{ textAlign: 'center' }}></div>,
align: 'center',
width: 120,
dataIndex: "ITEM_RULE"
dataIndex: "ITEM_RULE",
ellipsis: true
},
{
title: <div style={{ textAlign: 'center' }}></div>,
align: 'center',
width: 100,
dataIndex: "ITEM_UNIT"
dataIndex: "ITEM_UNIT",
ellipsis: true
},
{
title: <div style={{ textAlign: 'center' }}></div>,
@ -175,6 +181,26 @@ const InvoiceDetail = ({ showDetail, setShowDetail, parentRow, setParentRow }: P
width: 120,
dataIndex: "INVOICE_DISCOUNT"
},
{
title: "不动产",
dataIndex: "option",
width: 120,
align: 'center',
render: (_: any, record: any) => {
return record?.REALESTATE_ID ?
<a onClick={() => {
setCurrentRow(record)
setSelectRealEstateId([Number(record?.REALESTATE_ID)])
setSelectRealEstateModal(true)
}}>
{realEstateEnum && realEstateEnum[record?.REALESTATE_ID] ? realEstateEnum[record?.REALESTATE_ID] : record?.REALESTATE_ID}
</a> :
< Button type={'primary'} onClick={async () => {
setCurrentRow(record)
setSelectRealEstateModal(true)
}}> </Button >
}
}
// {
// title: <div style={{ textAlign: 'center' }}>操作时间</div>,
// align: 'center',
@ -311,7 +337,17 @@ const InvoiceDetail = ({ showDetail, setShowDetail, parentRow, setParentRow }: P
hideInSearch: true,
ellipsis: true,
width: 120,
align: 'center'
align: 'center',
valueType: "select",
valueEnum: {
1: "平方千米",
2: "平方米",
3: "公顷",
4: "亩",
5: "h㎡",
6: "k㎡",
7: "㎡"
}
},
{
title: "租赁期限",
@ -350,10 +386,34 @@ const InvoiceDetail = ({ showDetail, setShowDetail, parentRow, setParentRow }: P
const handleGetSelectRealEstate = (data: any) => {
setRealEstateData(data)
}
// 获取到这个服务区的全部 不动产信息 并给枚举的解析赋值
const handleGetThisServerpartRealEstateData = async () => {
const req: any = {
searchParameter: {
SERVERPART_IDS: parentRow?.SERVERPART_ID || "",
REALESTATE_STATE: 1
},
PageIndex: 1,
PageSize: 999999,
}
let newReq: any = {
name: "",
value: encryptAES(JSON.stringify(req))
}
const data: any = await handleGetREALESTATEList(newReq)
console.log('datadatadata', data);
let obj: any = {}
if (data && data.length > 0) {
data.forEach((item: any) => {
obj[item.REALESTATE_ID] = item.ESTATE_IDENTITY
})
}
setRealEstateEnum(obj)
}
return (
<Drawer
width="70%"
width="80%"
open={showDetail}
title="票据详情"
onClose={() => {
@ -484,6 +544,9 @@ const InvoiceDetail = ({ showDetail, setShowDetail, parentRow, setParentRow }: P
scroll={{ x: "100%", y: '500px' }}
pagination={false}
request={async () => {
// 调用一次 获取这个服务区里面的全部 不动产信息
handleGetThisServerpartRealEstateData()
// 拿到发票明细
const billDetail = await handleGetBILLDETAILList({
SearchParameter: {
BILL_ID: parentRow?.BILL_ID
@ -494,13 +557,6 @@ const InvoiceDetail = ({ showDetail, setShowDetail, parentRow, setParentRow }: P
})
if (billDetail && billDetail.length > 0) {
let idList: any = billDetail[0].REALESTATE_ID ? billDetail[0].REALESTATE_ID.split(',') : ""
console.log('idListidListidList', idList);
if (idList && idList.length > 0) {
detailActionRef.current?.reload()
setSelectRealEstateId(idList)
}
setTableEditData(billDetail)
setReqDetailList(billDetail)
return { data: billDetail, success: true }
@ -553,7 +609,7 @@ const InvoiceDetail = ({ showDetail, setShowDetail, parentRow, setParentRow }: P
</div>
{/* 不动产信息 */}
<div style={{ marginTop: 24 }}>
{/* <div style={{ marginTop: 24 }}>
<Space direction="vertical" style={{ width: '100%' }}>
<Text strong></Text>
</Space>
@ -612,7 +668,7 @@ const InvoiceDetail = ({ showDetail, setShowDetail, parentRow, setParentRow }: P
}}
/>
</div>
</div>
</div> */}
{/* 审批意见 */}
<div style={{ marginTop: 24 }}>
@ -668,21 +724,34 @@ const InvoiceDetail = ({ showDetail, setShowDetail, parentRow, setParentRow }: P
setSelectRealEstateModal(false)
}}
confirmLoading={realEstateLoading}
onOk={async () => {
// 已经开票申请了的 就不能改变不动产数据了
if (parentRow?.BILL_STATE > 2000) {
setCurrentRow(undefined)
setSelectRealEstateModal(false)
setRealEstateLoading(false)
return
}
let data = realEstateRef?.current?.selectRowDetail
console.log('32131', data);
// 开始保存内容
handleGetSelectRealEstate(data)
console.log('tableEditDatatableEditDatatableEditData', tableEditData);
console.log('currentRow', currentRow);
if (tableEditData && tableEditData.length > 0) {
setRealEstateLoading(true)
let list: any = JSON.parse(JSON.stringify(tableEditData))
let idList: any = []
if (data && data.length > 0) {
idList = data.map((item: any) => item.REALESTATE_ID)
idList = data.map((item: any) => Number(item.REALESTATE_ID))
}
list.forEach((item: any) => {
item.REALESTATE_ID = idList ? idList.toString() : ""
if (item.REALESTATE_ID === currentRow?.REALESTATE_ID) {
item.REALESTATE_ID = idList && idList.length > 0 ? Number(idList.toString()) : ""
}
})
setSelectRealEstateId(idList)
let newreqResult: any = {
@ -693,11 +762,14 @@ const InvoiceDetail = ({ showDetail, setShowDetail, parentRow, setParentRow }: P
if (res.Result_Code === 100) {
message.success('同步成功!')
detailActionRef.current?.reload()
setCurrentRow(undefined)
if (parentTableRef) {
parentTableRef.current?.reload()
}
} else {
message.error(data.Result_Desc)
}
}
setSelectRealEstateModal(false)
setRealEstateLoading(false)
}}

View File

@ -9,6 +9,7 @@ import moment from "moment";
import { encryptAES } from "@/utils/handleAes";
import { ProForm, ProFormSelect, ProFormTextArea } from "@ant-design/pro-components";
import InvoiceDetial from "./components/InvoiceDetial";
import { handleGetREALESTATEList } from "../realEstate/service";
interface ConnectState {
user: {
@ -76,6 +77,22 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
});
const columns: any = [
{
title: "查询内容",
dataIndex: "searchText",
hideInTable: true,
fieldProps: {
placeholder: "请输入经办人/单据号",
}
},
{
title: "含税开票金额",
dataIndex: "INVOICE_TAXAMOUNT",
hideInTable: true,
fieldProps: {
placeholder: "请输入含税开票金额",
}
},
{
title: '服务区名称',
dataIndex: 'SERVERPART_NAME',
@ -243,7 +260,8 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
<Button danger style={{ marginLeft: "8px" }} type="primary" size="small">退</Button>
</Popconfirm>
</div>
: record?.BILL_TYPE === 2000 && record?.BILL_STATE >= 9200 && record?.BILL_STATE !== 9999 ?
: record?.BILL_STATE >= 9200 && record?.BILL_STATE !== 9999 ?
// record?.BILL_TYPE === 2000 &&
<div>
<Popconfirm
title="确认红冲发票?"
@ -447,7 +465,7 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
const cleanString = (str: string) => {
return str.replace(/[\s]/g, '');
}
// 红冲发票
// 红冲发票(开票红冲 普票专票都可以使用)
const handleRedGoBill = async (record?: any) => {
// 这个方法 比较复杂 我做一下注释
// 先拿到表单数据 里面有 红冲类型和 红冲原因
@ -472,6 +490,9 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
SortStr: "BILLDETAIL_ID"
})
console.log('billDetailbillDetail', billDetail);
// 调用金票云那里的列表接口
// 构造查询数据
const queryData = {
@ -512,7 +533,13 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
}
let billDetailReq: any = []
// 给自己接口的
let DetailList: any = []
// 可能存在的不动产数据
let estateLeaseItems: any = []
if (billDetail && billDetail.length > 0) {
// 从当前商品的详情里面取出 用的到的 不动产id
let REALESTATE_IDList: Number[] = []
billDetail.forEach((item: any) => {
billDetailReq.push({
amount: -item.INVOICE_AMOUNT, // 明细金额
@ -524,10 +551,67 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
revenueCode: item.TABLE_NAME,// 税收分类编码
taxRate: (item.DUTY_PARAGRAPH / 100).toFixed(2),// 税率
units: item.ITEM_UNIT,// 计量单位
specification: item.ITEM_RULE,// 规格
REALESTATE_ID: item.REALESTATE_ID,// 不动产id
BILLDETAIL_DESC: item.BILLDETAIL_DESC // 备注
})
DetailList.push({
...item,
INVOICE_AMOUNT: -item.INVOICE_AMOUNT,
INVOICE_COUNT: -item.INVOICE_COUNT,
INVOICE_TAX: -item.INVOICE_TAX
})
REALESTATE_IDList.push(Number(item.REALESTATE_ID))
})
console.log('dhaskdhaslhdasl', billDetail);
// REALESTATE_ID 是,隔开的不动产id 这里去查询 记录 有多少条
const req: any = {
searchParameter: {
SERVERPART_IDS: record?.SERVERPART_ID || "",
REALESTATE_STATE: 1
},
PageIndex: 1,
PageSize: 999999,
}
let newReq: any = {
name: "",
value: encryptAES(JSON.stringify(req))
}
const data: any = await handleGetREALESTATEList(newReq)
console.log('dhaskdhaslhdasl', data);
// 这个服务区的全部不动产的数据 都在data里面
if (data && data.length > 0) {
let unitObj: any = {
1: "平方千米",
2: "平方米",
3: "公顷",
4: "亩",
5: "h㎡",
6: "k㎡",
7: "㎡"
}
data.forEach((item: any) => {
if (REALESTATE_IDList.indexOf(item.REALESTATE_ID) !== -1) {
estateLeaseItems.push({
provinceAdress: item.PROVINCE_NAME, // 省份
cityAdreess: item.CITY_NAME,// 城市
detailAddress: item.REALESTATE_ADDRESS,// 不动产详细地址
crossCitySign: item.CROSS_CITYSIGN,// 跨地(市)标志
areaunit: item.AREA_UNIT ? unitObj[item.AREA_UNIT] : "",//面积单位
startLeaseDate: item.START_LEASEDATE, // 租赁开始日期
endLeaseDate: item.END_LEASEDATE,//租赁结束日期
estateId: item.ESTATE_IDENTITY,//房屋产权证书/不动产权证号
specialIndustryNumber: item.SPECIALINDUSTRY_NUMBER,//不动产基础资料编码
carBrandNo: item.CARBRAND_NO,// 车牌号
})
}
})
}
}
let newDesc: string = ''
let addStr: string = `被红冲蓝字数电发票号码:${record?.blueinvoiceNo || ""}\t\t红字发票信息确认单编号${record?.BILL_NO ? `HC-${record?.BILL_NO}` : ""};\n`
@ -574,7 +658,10 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
blueinvoiceCode: "",
billDetail: billDetailReq,
remark: `被红冲蓝字数电发票号码:${record?.SERIAL_NO}\t\t红字发票信息确认单编号${record?.BILL_NO ? `HC-${record?.BILL_NO}` : ""};\n` + record?.BILL_DESC,
estateLeaseItems: estateLeaseItems,
specialType: estateLeaseItems && estateLeaseItems.length > 0 ? 'E06' : '00'
}
console.log('objobj', obj);
// 构造原始数据
const originalData = [obj]; // 将record作为data数组的一项
@ -619,15 +706,26 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
billDetail: billDetail
})
// 针对这个红冲 开一张新票子 编码为新的红冲编码 状态为9000 开票中 且票据类型变为 3000 红票 BILL_TYPE
// 因为 DetailList 里面要把id去掉 所以要处理一下
let newDetailList: any = []
if (DetailList && DetailList.length > 0) {
DetailList.forEach((item: any) => {
newDetailList.push({
...item,
BILLDETAIL_ID: null,
BILL_ID: null,
})
})
}
await handleUpdateOldBill({
...record,
billDetail: billDetail,
DetailList: newDetailList,
BILL_TYPE: 3000,
BILL_STATE: 9000,
BILL_NO: `HC-${record?.BILL_NO}`,
BILL_DATE: moment().format('YYYY-MM-DD'),
BILL_DESC: formData?.redReasonSelect ? redReasonObj[formData?.redReasonSelect] : "",
BILL_ID: "",
BILL_ID: null,
BILL_TAXAMOUNT: -record?.BILL_TAXAMOUNT,
BILL_AMOUNT: -record?.BILL_AMOUNT,
INVOICE_TAXAMOUNT: -record?.INVOICE_TAXAMOUNT,
@ -897,28 +995,6 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
const handleSynchroBILL = async (type: number, obj: any) => {
// type 1 开票的同步状态 即 9000 2 开票的红冲状态 即 9990
// 发票明细列表
let detailList: any = []
if (obj?.billDetail && obj?.billDetail.length > 0) {
obj?.billDetail.forEach((item: any) => {
detailList.push({
ITEM_NAME: item.goodsName,// 款项名称
ITEM_RULE: item.specification,// 规格型号
ITEM_UNIT: item.units,// 计量单位
INVOICE_COUNT: item.quantity,// 开票数量
INVOICE_PRICE: item.price,// 开票单价
INVOICE_AMOUNT: item.amount,// 开票金额
DUTY_PARAGRAPH: item.taxRate,// 开票税率
INVOICE_TAX: item.taxAmount,// 开票税额
INVOICE_DISCOUNT: item.discountAmount,// 折扣金额
INVOICE_DISCOUNTTAX: "",// 折扣税额
ITEM_ACTAMOUNT: "",// 款项价税合计
ITEM_DEDUCTIONAMOUNT: "",// 扣除额
ITEM_ID: "",// 关联数据表内码(多个)
TABLE_NAME: "",// 数据表名称
OPERATE_DATE: moment().format('YYYY-MM-DD HH:mm:ss'),// 操作时间
})
})
}
let req: any = {
...obj,
BILL_TYPE: obj.BILL_TYPE || "", // 票据类型1000增值税专用发票2000普通发票 ,
@ -953,6 +1029,7 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
BILL_STATE: type === 1 ? 9000 : type === 2 ? '9990' : '',// 票据状态
DetailList: obj?.DetailList,// 发票明细列表
}
console.log('reqreq', req);
const data = await handleSynchroBILLInterface(req)
}
// 获取当前用户信息
@ -992,6 +1069,8 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
...record,
}
const data = await handleSynchroBILLInterface(req)
// 新的也要同步 红冲发起申请的流程记录
await handleSynchroAPPLYAPPROVEFun(3, data.Result_Data)
}
useEffect(async () => {
@ -1015,8 +1094,7 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
}}
scroll={{ x: "100%", y: '400px' }}
headerTitle={<span style={{ color: "#1890ff", fontSize: 14, fontWeight: 600 }}></span>}
// search={{ span: 6, labelWidth: 100 }}
search={false}
search={{ span: 6, labelWidth: 100 }}
request={async (params: any, sorter: any) => {
const search = window.location.search;
const addressParams = Object.fromEntries(new URLSearchParams(search).entries());
@ -1028,18 +1106,22 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
return value ? `${n} ${value.replace('end', '')}` : ''
})
// 获取票据信息表列表
const req: any = {
SearchParameter: {
BILL_TYPES: "2000",// 现在只支持普票红冲 所以找普票 且状态为 普票的已开票即可
BILL_TYPES: "1000,2000",// 看普票 和 专票
SERVERPART_IDS: userInfo?.ServerpartIds,
BILL_STATES: "9200"
BILL_STATES: "9200",
INVOICE_TAXAMOUNT: params?.INVOICE_TAXAMOUNT || ""
// BILL_TYPES: "1000,2000"
},
PageIndex: 1,
PageSize: 999999,
sortstr: sortstr.length ? sortstr.toString() : "BILL_ID desc",
keyWord: {
Key: "BILL_PERSON,BILL_NO",
Value: params?.searchText || ""
}
}
const data = await handleGetBILLList(req)
@ -1082,7 +1164,7 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
// 获取票据信息表列表
const req: any = {
SearchParameter: {
BILL_TYPES: "3000",// 现在只支持普票红冲 所以找普票 且状态为 普票的已开票即可
BILL_TYPES: "3000",// 只看红票
SERVERPART_IDS: userInfo?.ServerpartIds,
BILL_STATES: "9000"
// BILL_TYPES: "1000,2000"
@ -1102,6 +1184,11 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
value: columnsStateBottomMap,
onChange: setColumnsStateBottomMap,
}}
toolbar={{
actions: [
]
}}
/>
{/* 用来输入红冲原因的 */}
@ -1128,6 +1215,14 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
onFinish={() => {
setConfirmLoading(true)
handleRedGoBill(currentRow)
// if (currentRow?.BILL_TYPE === 2000) {
// // 普票的情况下
// handleRedGoBill(currentRow)
// } else {
// // 专票红冲
// handleRedGoBill(currentRow)
// // handleSpecialBillRed(currentRow)
// }
}}
>
<ProFormSelect