diff --git a/src/pages/reports/Finance/businessAnalysis/index.tsx b/src/pages/reports/Finance/businessAnalysis/index.tsx index 3a3daaa..1878263 100644 --- a/src/pages/reports/Finance/businessAnalysis/index.tsx +++ b/src/pages/reports/Finance/businessAnalysis/index.tsx @@ -1,3 +1,4 @@ +// 多维招商优化分析 import { connect } from "umi"; import type { CurrentUser } from "umi"; import type { ConnectState } from "@/models/connect"; @@ -832,6 +833,7 @@ const BUSINESSANALYSIS: React.FC<{ currentUser: CurrentUser }> = (props) => { paddingRight: 0 }}> = (props) => { expandable={{ expandRowByClick: true }} + rowClassName={(record) => { + return new Date(record?.PROJECT_ENDDATE).getTime() < new Date().getTime() ? 'garyRowBg' : '' + }} headerTitle={} loading={tableLoading} search={{ diff --git a/src/pages/reports/Finance/businessAnalysis/style.less b/src/pages/reports/Finance/businessAnalysis/style.less index ac940c5..ca18474 100644 --- a/src/pages/reports/Finance/businessAnalysis/style.less +++ b/src/pages/reports/Finance/businessAnalysis/style.less @@ -1,11 +1,35 @@ -.BusinessDetail{ - .ant-drawer-content-wrapper{ - .ant-drawer-content{ - .ant-drawer-wrapper-body{ - .ant-pro-page-container-warp{ - padding-top: 0!important; +.BusinessDetail { + .ant-drawer-content-wrapper { + .ant-drawer-content { + .ant-drawer-wrapper-body { + .ant-pro-page-container-warp { + padding-top: 0 !important; } } } } } + + + + +.businessAnalysisProTable { + .garyRowBg { + + .ant-table-column-sort { + color: #ccc; + } + + .ant-table-cell { + color: #ccc; + + a { + color: #ccc; + } + + span { + color: #ccc; + } + } + } +} \ No newline at end of file diff --git a/src/pages/reports/contractWarningQuery/index.tsx b/src/pages/reports/contractWarningQuery/index.tsx index 5f2d8ec..7bc1add 100644 --- a/src/pages/reports/contractWarningQuery/index.tsx +++ b/src/pages/reports/contractWarningQuery/index.tsx @@ -293,7 +293,7 @@ const contractWarningQuery: React.FC<{ currentUser: CurrentUser }> = (props) => "下半年": [moment(), moment(moment().endOf('y'))], } }, - initialValue: [moment(), moment().add(1, 'months')], + initialValue: [moment(), moment().add(3, 'months')], }, { title: '合同状态', diff --git a/src/pages/reports/settlementAccount/component/HistoricalProjects.tsx b/src/pages/reports/settlementAccount/component/HistoricalProjects.tsx index 1957298..046a83d 100644 --- a/src/pages/reports/settlementAccount/component/HistoricalProjects.tsx +++ b/src/pages/reports/settlementAccount/component/HistoricalProjects.tsx @@ -1,29 +1,51 @@ import { connect } from "umi"; import type { ConnectState } from "@/models/connect"; import ProTable, { ActionType } from "@ant-design/pro-table"; -import { useRef } from "react"; -import { Button, FormInstance, Tooltip } from "antd"; +import { useImperativeHandle, useRef, useState } from "react"; +import { Button, Col, Divider, FormInstance, Input, InputNumber, Modal, Row, Tooltip } from "antd"; import { handleGetProjectPeriodAccount } from "../../ShopExpenseDetail/service"; import { wrapTreeNode } from "@/utils/format"; import { handleFormatNumber } from "@/services/options"; import numeral from 'numeral' +import { handleGetShopRoyaltyList } from "../../comparisonOfBusiness/service"; +import moment from 'moment' +import ProForm, { ProFormDigit } from "@ant-design/pro-form"; type DetailProps = { parentRow?: any // 外面的一些行数据 + onRef?: any // 实例 } -const HistoricalProjects = ({ parentRow }: DetailProps) => { +const HistoricalProjects = ({ parentRow, onRef }: DetailProps) => { const actionRef = useRef(); const formRef = useRef(); + const modalFormRef = useRef(); + + // 表格数据 + const [tableData, setTableData] = useState() + // 显示赋值抽屉 + const [showDetail, setShowDetail] = useState(false) + // 当前点击的行数据 + const [currentRow, setCurrentRow] = useState() const columns: any = [ { title:
期限
, - dataIndex: 'PeriodDesc', + dataIndex: 'STARTDATEENDDATE', align: 'left', width: 250, fixed: 'left', hideInSearch: true, + render: (_, record) => { + return { + console.log('recordrecordrecordrecord', record); + + setCurrentRow(record) + setShowDetail(true) + }}> + {`${record?.STARTDATE ? moment(record?.STARTDATE).format('YYYY/MM/DD') : ""}${record?.ENDDATE ? '-' : ''}${record?.ENDDATE ? moment(record?.ENDDATE).format('YYYY/MM/DD') : ""}`} + + } }, { title:
结算状态
, @@ -104,7 +126,7 @@ const HistoricalProjects = ({ parentRow }: DetailProps) => { width: 150, hideInSearch: true, render: (_, record) => { - return {record?.RevenueAmount ? `${numeral(record?.RevenueAmount).format('0,0.00')}${record?.addRevenueMoney ? `(${record?.addRevenueMoney > 0 ? '+' : record?.addRevenueMoney < 0 ? '-' : ''}${record?.addRevenueMoney})` : ''}` : '0'} + return {record?.RevenueAmount ? `${handleFormatNumber(record?.RevenueAmount)}` : ''} } } ] @@ -248,7 +270,7 @@ const HistoricalProjects = ({ parentRow }: DetailProps) => { hideInSearch: true, render: (_, record) => { const str: string = `水费(${numeral(record?.PaidFee_9010).format('0.00')}) + 电费(${numeral(record?.PaidFee_9020).format('0.00')}) + 房租(${numeral(record?.PaidFee_9030).format('0.00')}) - + 物业费(${numeral(record?.PaidFee_9050).format('0.00')})+ 租金(${numeral(record?.PaidFee_9090).format('0.00')})+ 其他(${numeral(record?.PaidFee_9099).format('0.00')})` + + 物业费(${numeral(record?.PaidFee_9050).format('0.00')})+ 租金(${numeral(record?.PaidFee_9090).format('0.00')})+ 其他(${numeral(record?.PaidFee_9099).format('0.00')})` return record?.PaidFee ? @@ -356,6 +378,11 @@ const HistoricalProjects = ({ parentRow }: DetailProps) => { }, ] + + useImperativeHandle(onRef, () => ({ + tableData + })); + return (
{ formRef={formRef} columns={columns} bordered + search={false} + options={false} + pagination={false} expandable={{ expandRowByClick: true }} scroll={{ x: "100%", y: "calc(100vh - 410px)" }} headerTitle={'往期项目'} // 列表表头 - search={{ span: 6 }} + dataSource={tableData} request={async (params) => { - console.log('parentRowparentRowparentRowparentRow321', parentRow); - if (!parentRow?.BUSINESSPROJECT_ID) { - return { data: [], success: true } - } - const req: any = { - BUSINESSPROJECT_ID: parentRow?.BUSINESSPROJECT_ID, + SearchParameter: { + BUSINESSPROJECT_ID: parentRow?.BUSINESSPROJECT_ID, + }, + PageIndex: 1, + PageSize: 99, + SortStr: 'ENDDATE desc', } - const data = await handleGetProjectPeriodAccount(req) - console.log('datadatadatadatadatadata321', data); - let list: any = data.ProjectPeriodList - if (list && list.length > 0) { - let res: any = wrapTreeNode(list) + const data = await handleGetShopRoyaltyList(req) + console.log('datadatadatadatadata321', data); + + if (data && data.length > 0) { + let SHOPROYALTY_IDList: any = [] + let res = data.filter((item: any) => item.SHOPROYALTY_ID !== 0 && item.SHOPROYALTY_ID !== parentRow?.SHOPROYALTY_ID) console.log('resresresresresresresresres', res); + if (res && res.length > 0) { + res.forEach((item: any, index: number) => { + item.id = index + 1 + SHOPROYALTY_IDList.push(item.SHOPROYALTY_ID) + }) + } + console.log('SHOPROYALTY_IDListSHOPROYALTY_IDListSHOPROYALTY_IDList', SHOPROYALTY_IDList); + + const req: any = { + BUSINESSPROJECT_ID: parentRow?.BUSINESSPROJECT_ID, + } + const data2 = await handleGetProjectPeriodAccount(req) + console.log('data2data2data2data2data2data2', data2); + let list: any = [] + if (data2.ProjectPeriodList && data2.ProjectPeriodList.length > 0) { + list = wrapTreeNode(data2.ProjectPeriodList) + + let resultList: any = [] + if (list && list.length > 0) { + list.forEach((item: any) => { + if (SHOPROYALTY_IDList && SHOPROYALTY_IDList.length > 0 && SHOPROYALTY_IDList.indexOf(item.ShopRoyalty_Id) !== -1) { + resultList.push(item) + } + }) + } + } + setTableData(res) + return { data: res, success: true } } return { data: [], success: true } + + + // const req: any = { + // BUSINESSPROJECT_ID: parentRow?.BUSINESSPROJECT_ID, + // } + // const data = await handleGetProjectPeriodAccount(req) + // console.log('datadatadatadatadatadata321', data); + // let list: any = data.ProjectPeriodList + // if (list && list.length > 0) { + // let res: any = wrapTreeNode(list) + // res = res.filter((item: any) => item.ShopRoyalty_Id !== 0 && item.ShopRoyalty_Id !== parentRow?.SHOPROYALTY_ID) + // console.log('resresresresresresresresres', res); + // return { data: res, success: true } + // } + // return { data: [], success: true } }} toolbar={{ actions: [] }} /> + + + { + setShowDetail(false) + setCurrentRow(null) + }} + onOk={() => { + modalFormRef?.current?.validateFields().then(() => { + modalFormRef?.current?.submit() + }) + }} + > + { + return { + ...currentRow + } + }} + onFinish={async (values) => { + console.log('values', values); + let list: any = JSON.parse(JSON.stringify(tableData)) + console.log('listlistlistlistlist', list); + let newList: any = [] + list.forEach((item: any) => { + if (item.id === currentRow?.id) { + let obj: any = { + ...item, + ...values + } + newList.push(obj) + } else { + newList.push(item) + } + }) + setTableData(newList) + setShowDetail(false) + setCurrentRow(null) + }} + > + + 营业额 + + + + + + + + + + 业主收款 + + + + + + 应收费用 + + + + + + + + + + + + + + + + + + + + + + + + + 已缴费用 + + + + + + + + + + + + + + + + + + + + + + + + 退补款 + + + + + + +
) } diff --git a/src/pages/reports/settlementAccount/component/YearExamineDetailTable.tsx b/src/pages/reports/settlementAccount/component/YearExamineDetailTable.tsx index 4feedea..058945c 100644 --- a/src/pages/reports/settlementAccount/component/YearExamineDetailTable.tsx +++ b/src/pages/reports/settlementAccount/component/YearExamineDetailTable.tsx @@ -2767,10 +2767,10 @@ const YearExamineDetailTable = ({ parentRow, currentApprovalstate, onRef, setIsS {/* 判断当期项目 是不是最后一期 是最后一期的话 就显示 历史期的数据 */} - + {/* */} {/* { - parentRow?.PROJECT_ENDDATE === parentRow?.ENDDATE ? - : "" + parentRow?.PROJECT_ENDDATE === parentRow?.ENDDATE && parentRow?.SETTLEMENT_STATE > 0 ? + < HistoricalProjects /> : "" } */} diff --git a/src/pages/reports/settlementAccount/component/afterSettlement.tsx b/src/pages/reports/settlementAccount/component/afterSettlement.tsx index b195808..23d1a8a 100644 --- a/src/pages/reports/settlementAccount/component/afterSettlement.tsx +++ b/src/pages/reports/settlementAccount/component/afterSettlement.tsx @@ -18,6 +18,7 @@ import ReviewProcess from "../../revenueConfirmation/components/ReviewProcess"; import { getMoney } from "@/services/options"; import { wrapTreeNode } from "@/utils/format"; import { handleGetBUSINESSAPPROVALDetail } from "@/pages/examine/monthSettlement/service"; +import HistoricalProjects from "./HistoricalProjects"; type DetailProps = { parentRow: any @@ -31,6 +32,7 @@ type DetailProps = { const AfterSettlement = ({ parentRow, dataRef, onShow, setIsFinishCalibration, onRef, currentUser, readonly }: DetailProps) => { const SETTLEMENTMODESOBJ: any = session.get('SETTLEMENT_MODESObj') const settlementRef = useRef(); + const HistoricalProjectsRef = useRef() // 表格数据 const [tableData, setTableData] = useState() @@ -418,7 +420,8 @@ const AfterSettlement = ({ parentRow, dataRef, onShow, setIsFinishCalibration, o settlementRef, tableData, fileList, - nextState + nextState, + HistoricalProjectsRef })); @@ -452,8 +455,6 @@ const AfterSettlement = ({ parentRow, dataRef, onShow, setIsFinishCalibration, o const res: any = dataRef.current?.YearExamineDetailTableRef?.current?.selectDetailList setTableData(res) console.log('res', res); - - // 拿最小的开始 最大的结束 let startTime: string = '' let endTime: string = '' @@ -558,6 +559,7 @@ const AfterSettlement = ({ parentRow, dataRef, onShow, setIsFinishCalibration, o dataSource={tableData} /> + {/* */} <> { tableLoading ? '' : @@ -742,6 +744,8 @@ const AfterSettlement = ({ parentRow, dataRef, onShow, setIsFinishCalibration, o } + + diff --git a/src/pages/reports/settlementAccount/component/correctTable.tsx b/src/pages/reports/settlementAccount/component/correctTable.tsx index eec1b36..fb1d145 100644 --- a/src/pages/reports/settlementAccount/component/correctTable.tsx +++ b/src/pages/reports/settlementAccount/component/correctTable.tsx @@ -119,7 +119,7 @@ const CorrectTable = ({ data, show, currentRow, money }: DetailProps) => { search={false} bordered headerTitle={
- 日结冲正信息表 + 日结冲正信息
} expandable={{ defaultExpandAllRows: true diff --git a/src/pages/reports/settlementAccount/component/yearExamineProcess.tsx b/src/pages/reports/settlementAccount/component/yearExamineProcess.tsx index e24cb45..fe8a854 100644 --- a/src/pages/reports/settlementAccount/component/yearExamineProcess.tsx +++ b/src/pages/reports/settlementAccount/component/yearExamineProcess.tsx @@ -16,7 +16,7 @@ import MonthSettlement from "../../revenueConfirmation/components/monthSettlemen import { ExclamationCircleOutlined, PlusOutlined } from "@ant-design/icons"; import { handleApproveAccount, handleApproveMonthAccountProinst, handleRejectAccount, handleRejectMonthAccountProinst } from "@/pages/examine/reconciliationApproval/base/service"; import React from "react"; -import { handleCreateSettlement } from "@/pages/reports/settlementDetail/service"; +import { handleCreateSettlement, handleSynchroRevenueConfirmList } from "@/pages/reports/settlementDetail/service"; import Item from "antd/lib/list/Item"; import { deletePicture, uploadPicture } from "@/services/picture"; @@ -77,6 +77,13 @@ const YearExamineProcess = ({ currentUser, onShow, setOnShow, parentRow, setPare // 新建结算申请 const handleCreateSettlementApplication = async () => { + // let previousPeriodRes: boolean = await handlePreviousPeriod() + // if (!previousPeriodRes) { + // message.error('往期数据同步失败,请检查!') + // return + // } + // return + setSubmitBtnLoading(true) // node const allList: any = [] @@ -408,6 +415,70 @@ const YearExamineProcess = ({ currentUser, onShow, setOnShow, parentRow, setPare setSubmitBtnLoading(false) } + // 往期项目存一下 + const handlePreviousPeriod = async () => { + let historyList: any = AfterSettlementRef.current?.HistoricalProjectsRef.current + console.log('historyListhistoryListhistoryList', historyList); + console.log('parentRowparentRowparentRowparentRow', parentRow); + + const req: any = [] + if (historyList && historyList.length > 0) { + historyList.forEach((item: any) => { + req.push({ + node: { + BUSINESSPROJECT_ID: item.BUSINESSPROJECT_ID, + BUSINESSPROJECT_NAME: parentRow?.BUSINESSPROJECT_NAME, + SHOPROYALTY_ID: item.SHOPROYALTY_ID, + SERVERPARTSHOP_ID: item.SERVERPARTSHOP_ID, + BUSINESS_TRADE: "", // 经营业态 + BUSINESS_BRAND: "",// 经营品牌 + BUSINESS_MONTH: "",// 经营年月 + BUSINESS_STARTDATE: "",// 开始日期 + BUSINESS_ENDDATE: "",// 结束日期 + BUSINESS_PERIOD: "",// 经营期数 + PERIOD_INDEX: "",// 第几期 + BUSINESS_DAYS: "",// 拆分天数 + GUARANTEE_AMOUNT: "",// 保底营业额 + GUARANTEERATIO: item.GUARANTEERATIO, + ACTUAL_REVENUE: item.RevenueAmount, // 实际营业额 营业额小计 + CORRECT_AMOUNT: "",// 冲正金额 + PARTYA_SHAREPROFIT: "",// 甲方分润 + PARTYB_SHAREPROFIT: "",// 乙方分润 + PARTYC_SHAREPROFIT: "",// 丙方分润 + LIQUIDATION_AMOUNT: item.RefundSupplement,// 清算金额 退补款 + ACTUAL_ACCOUNTS: item.GuaranteeFee,// 实际应收账款 应收费用租金 + ROYALTY_PRICE: item.RoyaltyAmount,// 甲方到账 业主收款 + SUBROYALTY_PRICE: "",// 乙方到账 + MOBILEPAY_AMOUNT: item.MobilePayAmount, + CASHPAY_AMOUNT: item.CashAmount, + OTHERPAY_AMOUNT: "",// 其他支付 + PROPERTYFEE: item.PropertyFee, + HOUSERENT: item.HouseRent, + BREACHPENALTY: item.BreachPenalty, + ELECTRICITYCHARGE: item.ElectricityCharge, + WATERCHARGE: item.WATERCHARGE, + OTHERFEE: item.OtherFee, + PAID_AMOUNT: item.PaidFee, + EARLY_SETTLEMENT: 1, + REVENUE_VALID: 1, + REVENUECONFIRM_DESC: `9010:${item.PaidFee_9010},9020:${item.PaidFee_9020},9030:${item.PaidFee_9030},9050:${item.PaidFee_9050},9090:${item.PaidFee_9090},9099:${item.PaidFee_9099}`, + MERCHANTS_ID: item.MERCHANTS_ID, + MERCHANTS_NAME: parentRow?.MERCHANTS_ID, + BUSINESSAPPROVAL_ID: "", + } + }) + }) + } + // 营业额小计 业主收款 应收费用合计 租金 水费 电费 住宿费 物业费 租金 其他 退补款 + const data = await handleSynchroRevenueConfirmList(req) + console.log('datadatadatadata', data); + if (data.Result_Code === 100) { + return true + } else { + return false + } + } + // 审批的方法 const handleGetToExamine = async (desc: string, target: any, nextPerson: any, allForm?: any) => { let req: any = {} @@ -613,6 +684,13 @@ const YearExamineProcess = ({ currentUser, onShow, setOnShow, parentRow, setPare '' } + + {/* + */} + { isYearAllowSettlement ?