From 323f2add277bd2626afd3808fe1dbe5bf161b1bb Mon Sep 17 00:00:00 2001 From: ylj20011123 Date: Wed, 24 Sep 2025 14:34:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=95=86=E5=93=81=E5=AE=A1?= =?UTF-8?q?=E6=89=B9=E7=BB=84=E4=BB=B6=E5=8C=96=E5=AE=8C=E6=88=90=20?= =?UTF-8?q?=E5=B0=9D=E8=AF=95=E5=85=BC=E5=AE=B9=E5=95=86=E5=93=81=E8=B0=83?= =?UTF-8?q?=E4=BB=B7=E5=AE=A1=E6=89=B9=E4=B9=8B=E5=89=8D=E7=9A=84=E5=A4=87?= =?UTF-8?q?=E4=BB=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layouts/BasicLayout.tsx | 2 +- .../ahjgPage/InventoryCategory/index.tsx | 57 +- src/pages/ahjgPage/InventoryDetails/index.tsx | 58 +- .../ahjgPage/inventoryInformation/index.tsx | 50 +- .../oneProductMultipleSizes/index.tsx | 57 +- .../ahjgPage/purchaseReceiving/index.tsx | 62 +- src/pages/ahjgPage/returnProcess/index.tsx | 35 +- src/pages/ahjgPage/shopProcurement/index.tsx | 22 +- .../revenueQOQReport/index.tsx | 77 +- .../revenueYOYQOQReport/index.tsx | 90 +- .../saleTypeHisReport/index.tsx | 4 +- .../transactionAnalysis/index.tsx | 68 +- .../components/addShopModal.tsx | 520 +++++++ .../components/newApplicationModal.tsx | 674 +++++++++ .../NewProductApproval/index.tsx | 1333 +---------------- src/utils/format.ts | 6 + 16 files changed, 1658 insertions(+), 1457 deletions(-) create mode 100644 src/pages/reports/productControl/NewProductApproval/components/addShopModal.tsx create mode 100644 src/pages/reports/productControl/NewProductApproval/components/newApplicationModal.tsx diff --git a/src/layouts/BasicLayout.tsx b/src/layouts/BasicLayout.tsx index 2dcedf3..2b2b3f3 100644 --- a/src/layouts/BasicLayout.tsx +++ b/src/layouts/BasicLayout.tsx @@ -698,7 +698,7 @@ const BasicLayout: React.FC = (props) => { // 商品业态 // const SHOPTRADEList = await - getFieldEnum({ FieldExplainField: 'BUSINESSTYPE' }).then(SHOPTRADEList => { + getFieldEnum({ FieldExplainField: 'BUSINESSTYPE' }).then(SHOPTRADEList => { session.set('SHOPTRADEList', SHOPTRADEList); const SHOPTRADEObj: any = {} if (SHOPTRADEList && SHOPTRADEList.length > 0) { diff --git a/src/pages/ahjgPage/InventoryCategory/index.tsx b/src/pages/ahjgPage/InventoryCategory/index.tsx index b5b338a..2e626b9 100644 --- a/src/pages/ahjgPage/InventoryCategory/index.tsx +++ b/src/pages/ahjgPage/InventoryCategory/index.tsx @@ -20,6 +20,7 @@ import { handleGetCHECKCOMMODITYList, handleGetTypeStatisticsList } from "../ser import Draggable from "react-draggable"; import InventoryDetails from "../InventoryDetails"; import { exportXlsxFromProColumns, exportXlsxFromProColumnsExcelJS } from "@/utils/exportExcelFun"; +import { formatTreeData } from "@/utils/format"; const InventoryCategory: React.FC<{ currentUser: CurrentUser }> = (props) => { @@ -869,7 +870,43 @@ const InventoryCategory: React.FC<{ currentUser: CurrentUser }> = (props) => { const data = await handleGetTypeStatisticsList(req) console.log('data321312', data); - setReqDetailList(data) + + let fieldData: any = [ + "OVERPLUSCOUNT", + "OVERPLUS_PRICE", + "LOSSPROFIT_COUNT", + "LOSSPROFIT_PRICE", + "GROSS_PROFITPRICE", + "LAST_OVERPLUSCOUNT", + "LAST_OVERPLUSPRICE", + "PURCHASE_COUNT", + "PURCHASE_TOTALPRICE", + "SELL_COUNT", + "SELL_UNITPRICE", + "SELL_TOTALPRICE", + "SELL_COSTPRICE", + "TRANSFER_COUNT", + "TRANSFER_PRICE", + "RECEIVE_COUNT", + "RECEIVE_PRICE", + "BACK_COUNT", + "BACK_PRICE", + "OVERPLUS_AMOUNT", + "LOSSPROFIT_AMOUNT", + "GROSS_PROFIT", + "LAST_OVERPLUSAMOUNT", + "PURCHASE_TOTALTAXPRICE", + "SELL_UNITTAXPRICE", + "SELL_TOTALTAXPRICE", + "SELL_COST", + "TRANSFER_AMOUNT", + "RECEIVE_AMOUNT", + "BACK_AMOUNT", + ] + let enumList: any = [] + let newPrintData: any = formatTreeData(JSON.parse(JSON.stringify(data)), fieldData, enumList, [], []) + + setReqDetailList(newPrintData) if (data && data.length > 0) { return { data, success: true } } @@ -877,15 +914,15 @@ const InventoryCategory: React.FC<{ currentUser: CurrentUser }> = (props) => { }} toolbar={{ actions: [ - - - , + // + // + // , + + + } + onOk={() => { + if (parentRow?.BusinessProcess_State > 1000) { + modalApproveFormRef?.current?.validateFields().then(() => { + modalApproveFormRef?.current?.submit() + }) + } else { + modalFormRef?.current?.validateFields().then(() => { + modalFormRef?.current?.submit() + }) + } + }} + > + { + if (parentRow?.BusinessApproval_ID) { + const req: any = { + BUSINESSAPPROVALId: parentRow?.BusinessApproval_ID, + } + const data = await handleGetBUSINESSAPPROVALDetail(req) + console.log('datadatadata', data); + setBUSINESSAPPROVALDETAIL(data.Result_Data) + + let shopData: any = [] + + if (parentRow?.BusinessProcess_State === 9000) { + shopData = await handleGetApprovalCommodityList({ + ProvinceCode: currentUser?.ProvinceCode, + // CommodityId: currentUser?.ProvinceCode, + BusinessApprovalId: parentRow?.BusinessApproval_ID, + PageIndex: 1, + PageSize: 999999, + }) + } else { + shopData = await handleGetCOMMODITYRUNNINGList({ + SearchParameter: { + BUSINESSAPPROVAL_ID: parentRow?.BusinessApproval_ID, + }, + PageIndex: 1, + pageSize: 999999, + }) + } + + + console.log('shopDatashopDatashopDatashopData', shopData); + + // setShopData(shopData.Result_Data.List) + if (handleChangeShopData) { + handleChangeShopData(shopData.Result_Data.List) + } + + return { + reasonForApplication: data.Result_Data.BUSINESSAPPROVAL_DESC, + ServerpartId: data.Result_Data.SERVERPART_ID, + NextApproveStaffId: data.Result_Data.APPOVED_IDS + } + } else { + return {} + } + }} + onFinish={async (res) => { + setConfirmLoading(true) + let data: any = {} + if (parentRow?.BusinessApproval_ID) { + const req: any = { + ProinstId: parentRow?.BusinessApproval_ID, + ProinstName: res.reasonForApplication, + UserId: currentUser?.ID, + OperateType: "100100", + ServerpartId: res.ServerpartId, + NextApproveStaffId: res.NextApproveStaffId, + NextApproveState: 2000, + CommodityRunningList: shopData + } + data = await handleReapplyCommodityProInst(req) + } else { + const req: any = { + ProinstName: res.reasonForApplication, + UserId: currentUser?.ID, + OperateType: "100100", + ServerpartId: res.ServerpartId, + NextApproveStaffId: res.NextApproveStaffId, + NextApproveState: 2000, + CommodityRunningList: shopData + } + data = await handleCreateCommodityProInst(req) + console.log('dsaidjaskda', data); + } + setConfirmLoading(false) + if (data.Result_Code === 100) { + message.success(data.Result_Desc) + if (handleCencel) { + handleCencel() + } + + if (tableRef) { + tableRef.current?.reload() + } + + } else { + message.error(data.Result_Desc) + } + + + + }} + > + + + 1000 || (parentRow?.BusinessApproval_ID && parentRow?.ApproveStaff_ID !== currentUser?.ID)} + /> + + + { + const ServerpartIdsTree = session.get('ServerpartIdsTree') + return ServerpartIdsTree + }} + disabled={parentRow?.BusinessProcess_State > 1000 || (parentRow?.BusinessApproval_ID && parentRow?.ApproveStaff_ID !== currentUser?.ID)} + fieldProps={{ + showSearch: true, // 启用搜索框 + filterOption: (inputValue: any, option: any) => { + // 通过 label 搜索 + return option.label.toLowerCase().includes(inputValue.toLowerCase()); + } + }} + + /> + + 1000 && ApprovalType !== 0 ? "none" : "" }}> + { + const reqState: any = { + SearchParameter: { + PROVINCE_CODE: currentUser?.ProvinceCode, + APPROVALROUTE_STATES: "", + APPROVALROUTE_VALID: 1, + OPERATION_TYPES: "100100", + }, + PageIndex: 1, + PageSize: 999999 + } + const dataState = await handleGetAPPROVALROUTEList(reqState) + if (dataState && dataState.length > 0) { + let obj: any = {} + // 下面的环节 + let nextList: any = [] + console.log('dataState', dataState); + + dataState.forEach((item: any) => { + if (item.APPROVALROUTE_STATE === 2000) { + obj = item + } + if (item.APPROVALROUTE_STATE >= parentRow?.BusinessProcess_State) { + if (item.APPROVALROUTE_STATE === parentRow?.BusinessProcess_State) { + item.status = "process" + } + nextList.push(item) + } + }) + setNextStepsList(nextList) + console.log('next', nextList); + + let personTotal: number = obj.APPROVALSTAFF_ID.split(',').length || 0 + if (personTotal > 0) { + let STAFFIDList: number[] = obj.APPROVALSTAFF_ID.split(',') + let STAFFNAMEList: string[] = obj.APPROVALSTAFF_NAME.split(',') + let list: any = [] + for (let i = 0; i < personTotal; i++) { + list.push({ label: STAFFNAMEList[i], value: STAFFIDList[i] }) + } + return list + } + } + }} + disabled={parentRow?.BusinessProcess_State > 1000 || (parentRow?.BusinessApproval_ID && parentRow?.ApproveStaff_ID !== currentUser?.ID)} + /> + + + + + { + parentRow?.BusinessProcess_State > 1000 ? + { + const reqState: any = { + SearchParameter: { + APPROVALROUTE_STATES: "", + APPROVALROUTE_VALID: 1, + OPERATION_TYPES: "100100", + }, + PageIndex: 1, + PageSize: 999999 + } + const dataState = await handleGetAPPROVALROUTEList(reqState) + console.log('dataStatedataStatedataState', dataState); + let obj: any = {} + let currentIndex: number = 0 + if (dataState && dataState.length > 0) { + dataState.forEach((item: any, index: number) => { + if (item.APPROVALROUTE_STATE === parentRow.BusinessProcess_State) { + obj = item + currentIndex = index + } + }) + } + if (obj) { + // 审批的时候 拿到当前状态 去找下一个状态 + if (ApprovalType === 1) { + // 拿到当前状态的信息 判断下一状态 是不是结束了 结束了 就不显示 下一结算审批人 不是结束 就拿到下一流程的审批人 + setNextApproval(obj.NEXT_STATE) + let nextObj: any = currentIndex + 1 <= dataState.length ? dataState[currentIndex + 1] : {} + if (nextObj) { + let personTotal: number = nextObj.APPROVALSTAFF_ID.split(',').length || 0 + if (personTotal > 0) { + let STAFFIDList: number[] = nextObj.APPROVALSTAFF_ID.split(',') + let STAFFNAMEList: string[] = nextObj.APPROVALSTAFF_NAME.split(',') + let list: any = [] + for (let i = 0; i < personTotal; i++) { + list.push({ label: STAFFNAMEList[i], value: STAFFIDList[i] }) + } + setNextApprovalPerson(list) + } + } + } else { + // 驳回的话 去找历史状态 + if (dataState && dataState.length > 0) { + let list: any = [] + dataState.forEach((item: any, index: number) => { + if (obj.APPROVALROUTE_STATE > item.APPROVALROUTE_STATE) { + list.push({ label: item.APPROVALROUTE_NAME, value: item.APPROVALROUTE_STATE }) + } + }) + setNextApprovalPerson(list) + } + + } + + } + return {} + }} + onFinish={async (res) => { + setAddApprovalLoading(true) + setConfirmLoading(true) + let data: any = {} + + if (ApprovalType === 1) { + // 审批 + const req: any = { + businessApprovalId: parentRow?.BusinessApproval_ID, + UserId: currentUser?.ID, + ApproveInfo: res.ApproveInfo, + nextApproveStaffId: res.nextApproveStaffId || "", + nextApproveState: nextApproval || "" + } + + data = await handleApproveCommodityProInst(req) + } else { + // 驳回 + const req: any = { + businessApprovalId: parentRow?.BusinessApproval_ID, + UserId: currentUser?.ID, + RejectInfo: res.ApproveInfo, + nextApproveState: res.nextApproveState || "" + } + console.log('reqreqreqreq', req); + + data = await handleRejectCommodityProInst(req) + } + setAddApprovalLoading(false) + setConfirmLoading(false) + console.log('datadatadata', data); + if (data.Result_Code === 100) { + message.success(data.Result_Desc) + + // setShowApplyFor(false) + // setCurrentRow(undefined) + // setShopData([]) + // setShowDetailType(null) + + // setApprovaType(0) + if (handleCencel) { + handleCencel() + } + + setBUSINESSAPPROVALDETAIL(undefined) + // setApproveCurrentRow(undefined) + // setApproveModal(false) + setNextApproval(null) + setNextApprovalPerson(null) + // actionRef.current?.reload() + if (tableRef) { + tableRef.current?.reload() + } + } else { + message.error(data.Result_Desc) + } + + }} + > + { + ApprovalType === 1 ? + + { + nextApproval === 9000 ? '' : + + + + + } + + + + : ApprovalType === 2 ? + + + + + + + + + : "" + } + : "" + } + + 1000 || (parentRow?.BusinessApproval_ID && parentRow?.ApproveStaff_ID !== currentUser?.ID) ? '' : + ] + }} + /> + + { + parentRow?.BusinessProcess_State > 1000 ? + +
+ + { + BUSINESSAPPROVALDETAIL?.approveList && BUSINESSAPPROVALDETAIL?.approveList.length > 0 ? + BUSINESSAPPROVALDETAIL?.approveList.map((item: any, index: number) => ( + + +

{`${item.APPLYAPPROVE_DATE || ''}`}

+
+
} + /> + )) : '' + } + + { + nextStepsList && nextStepsList.length > 0 ? + nextStepsList.map((item: any, index: number) => ( + + )) : '' + } + + +
+ : '' + } + + + ) +} + +export default connect(({ user, }: ConnectState) => ({ + currentUser: user.currentUser, +}))(NewApplicationModal); diff --git a/src/pages/reports/productControl/NewProductApproval/index.tsx b/src/pages/reports/productControl/NewProductApproval/index.tsx index 1e71d0f..377d6ba 100644 --- a/src/pages/reports/productControl/NewProductApproval/index.tsx +++ b/src/pages/reports/productControl/NewProductApproval/index.tsx @@ -19,6 +19,8 @@ import moment from 'moment' import { handleApproveCommodityProInst, handleCreateCommodityProInst, handleDeleteCOMMODITY_RUNNING, handleDeleteCommodityProInst, handleGetApprovalCommodityList, handleGetBUSINESSAPPROVALDetail, handleGetCOMMODITYRUNNINGList, handleReapplyCommodityProInst, handleRejectCommodityProInst } from "../ProductApprovalProcess/service"; import './style.less' import session from "@/utils/session"; +import NewApplicationModal from "./components/newApplicationModal"; +import AddShopModal from "./components/addShopModal"; const { Step } = Steps @@ -29,7 +31,6 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props const formRef = useRef(); const modalFormRef = useRef(); const modalShopFormRef = useRef(); - const modalApproveFormRef = useRef(); // 新增商品申请 const [showApplyFor, setShowApplyFor] = useState(false); @@ -258,160 +259,11 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props }, ] - const modalColumns: any = [ - { - title: "序号", - width: 70, - dataIndex: "index", - valueType: "index", - align: 'center', - ellipsis: true, - }, - { - title: "名称", - width: 300, - dataIndex: "COMMODITY_NAME", - ellipsis: true, - align: 'center', - }, - { - title: "条码", - width: 150, - dataIndex: "COMMODITY_BARCODE", - ellipsis: true, - align: 'center', - }, - { - title: "零售价", - width: 150, - dataIndex: "COMMODITY_RETAILPRICE", - ellipsis: true, - align: 'center', - }, - { - title: "规格", - width: 150, - dataIndex: "COMMODITY_RULE", - ellipsis: true, - align: 'center', - }, - { - title: "单位", - width: 150, - dataIndex: "COMMODITY_UNIT", - ellipsis: true, - align: 'center', - }, - { - dataIndex: 'option', - title: '操作', - valueType: 'option', - align: 'center', - hideInSearch: true, - width: 120, - fixed: "right", - ellipsis: true, - render: (_, record) => { - return ( - - { - currentRow?.BusinessProcess_State > 1000 || (currentRow?.BusinessApproval_ID && currentRow?.ApproveStaff_ID !== currentUser?.ID) ? '' : - <> - { - setCurrentShopRow(record) - setShowAddShopModal(true) - }} - > - 编辑 - - { - if (currentRow?.BusinessApproval_ID) { - // 申请回到发起时候的真删 - const req: any = { - COMMODITY_RUNNINGId: record?.COMMODITY_ID - } - const data = await handleDeleteCOMMODITY_RUNNING(req) - console.log('datadatadatadata', data); - actionRef.current?.reload() - // 实现直接删除的效果 - let oldData: any = JSON.parse(JSON.stringify(shopData)) - let list: any = [] - oldData.forEach((item: any) => { - if (item.COMMODITY_ID !== record?.COMMODITY_ID) { - list.push(item) - } - }) - setShopData(list) - } else { - // 还未发起申请的假删 - console.log('record', record); - let oldData: any = JSON.parse(JSON.stringify(shopData)) - let list: any = [] - oldData.forEach((item: any) => { - if (item.ADDTIME !== record?.ADDTIME) { - list.push(item) - } - }) - setShopData(list) - } - }} - > - 删除 - - - } - { - currentRow?.BusinessProcess_State === 9000 ? - { - setCurrentShopRow(record) - setShowAddShopModal(true) - }}>详情 - : '' - } - - ); - }, - }, - ] - // 拿到对应的商品业态 - const handleGetCommodity = async (id: any) => { - const req: any = { - ProvinceCode: currentUser?.ProvinceCode, - ServerpartId: id - } - const data = await handleGetServerpartShopTrade(req) - console.log('data', data) - setCommodityList(data) - } - // 请求自定义类的选择列表 - const handleGetCustomClassList = async (id: any) => { - const req: any = { - SearchParameter: { - USERDEFINEDTYPE_STATE: 1, - SERVERPART_ID: id, - BUSINESSTYPE: selectBUSINESSTYPE - }, - PageIndex: 1, - PageSize: 999999, - pageSize: 999999, - } - const data = await handleGetUSERDEFINEDTYPEList(req) - if (data && data.length > 0) { - const list: any = [] - data.forEach((item: any) => { - list.push({ label: item.USERDEFINEDTYPE_NAME, value: item.USERDEFINEDTYPE_ID }) - }) - setCustomClassList(list) - } - console.log('data', data) - } + useEffect(async () => { @@ -446,6 +298,30 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props }, []) + // 新增申请的悬浮框取消的调用 + const handleNewApplicationModalCencel = () => { + setShowApplyFor(false) + setCurrentRow(undefined) + setShopData([]) + setBUSINESSAPPROVALDETAIL(undefined) + setShowDetailType(null) + + setApprovaType(0) + } + + // 组件里面 改变shpoData的方法 + const handleChangeShopData = (list: any) => { + setShopData(list) + } + + // 关闭新增商品悬浮框的方法 + const handleCloseShopModal = () => { + setShowAddShopModal(false) + setCommodityList([]) + setCustomClassList([]) + setCurrentShopRow(undefined) + } + return (
@@ -510,1161 +386,14 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props />
- - {/* 审批的悬浮框 */} - {/* { - setApproveCurrentRow(undefined) - setApproveModal(false) - setApprovaType(0) - }} - onOk={() => { - modalApproveFormRef?.current?.validateFields().then(() => { - modalApproveFormRef?.current?.submit() - }) - }} - > - { - console.log('approveCurrentRowapproveCurrentRowapproveCurrentRow', approveCurrentRow); - const reqState: any = { - SearchParameter: { - APPROVALROUTE_STATES: "", - APPROVALROUTE_VALID: 1, - OPERATION_TYPES: "100100", - }, - PageIndex: 1, - PageSize: 999999 - } - const dataState = await handleGetAPPROVALROUTEList(reqState) - console.log('dataStatedataStatedataState', dataState); - let obj: any = {} - let currentIndex: number = 0 - if (dataState && dataState.length > 0) { - dataState.forEach((item: any, index: number) => { - if (item.APPROVALROUTE_STATE === approveCurrentRow.BusinessProcess_State) { - obj = item - currentIndex = index - } - }) - } - if (obj) { - // 审批的时候 拿到当前状态 去找下一个状态 - if (ApprovalType === 1) { - // 拿到当前状态的信息 判断下一状态 是不是结束了 结束了 就不显示 下一结算审批人 不是结束 就拿到下一流程的审批人 - setNextApproval(obj.NEXT_STATE) - let nextObj: any = currentIndex + 1 <= dataState.length ? dataState[currentIndex + 1] : {} - if (nextObj) { - let personTotal: number = nextObj.APPROVALSTAFF_ID.split(',').length || 0 - if (personTotal > 0) { - let STAFFIDList: number[] = nextObj.APPROVALSTAFF_ID.split(',') - let STAFFNAMEList: string[] = nextObj.APPROVALSTAFF_NAME.split(',') - let list: any = [] - for (let i = 0; i < personTotal; i++) { - list.push({ label: STAFFNAMEList[i], value: STAFFIDList[i] }) - } - setNextApprovalPerson(list) - } - } - } else { - // 驳回的话 去找历史状态 - if (dataState && dataState.length > 0) { - let list: any = [] - dataState.forEach((item: any, index: number) => { - if (obj.APPROVALROUTE_STATE > item.APPROVALROUTE_STATE) { - list.push({ label: item.APPROVALROUTE_NAME, value: item.APPROVALROUTE_STATE }) - } - }) - setNextApprovalPerson(list) - } - - } - - } - return {} - }} - onFinish={async (res) => { - setAddApprovalLoading(true) - let data: any = {} - - if (ApprovalType === 1) { - // 审批 - const req: any = { - businessApprovalId: approveCurrentRow?.BusinessApproval_ID, - UserId: currentUser?.ID, - ApproveInfo: res.ApproveInfo, - nextApproveStaffId: res.nextApproveStaffId || "", - nextApproveState: nextApproval || "" - } - - data = await handleApproveCommodityProInst(req) - } else { - // 驳回 - const req: any = { - businessApprovalId: approveCurrentRow?.BusinessApproval_ID, - UserId: currentUser?.ID, - RejectInfo: res.ApproveInfo, - nextApproveState: res.nextApproveState || "" - } - console.log('reqreqreqreq', req); - - data = await handleRejectCommodityProInst(req) - } - setAddApprovalLoading(false) - console.log('datadatadata', data); - if (data.Result_Code === 100) { - message.success(data.Result_Desc) - setApproveCurrentRow(undefined) - setApproveModal(false) - setNextApproval(null) - setNextApprovalPerson(null) - setApprovaType(0) - actionRef.current?.reload() - } else { - message.error(data.Result_Desc) - } - - }} - > - { - ApprovalType === 1 ? - - { - nextApproval === 9000 ? '' : - - - - - } - - - - : ApprovalType === 2 ? - - - - - - - - - : "" - } - - */} - {/* 新增申请的悬浮框 */} - { - setShowApplyFor(false) - setCurrentRow(undefined) - setShopData([]) - setBUSINESSAPPROVALDETAIL(undefined) - setShowDetailType(null) + - setApprovaType(0) - }} - footer={showDetailType === 'detail' || !InitiateApplication || (currentRow?.BusinessApproval_ID && currentRow?.ApproveStaff_ID !== currentUser?.ID) ? false : -
- - - -
} - onOk={() => { - if (currentRow?.BusinessProcess_State > 1000) { - modalApproveFormRef?.current?.validateFields().then(() => { - modalApproveFormRef?.current?.submit() - }) - } else { - modalFormRef?.current?.validateFields().then(() => { - modalFormRef?.current?.submit() - }) - } - }} - > - { - if (currentRow?.BusinessApproval_ID) { - const req: any = { - BUSINESSAPPROVALId: currentRow?.BusinessApproval_ID, - } - const data = await handleGetBUSINESSAPPROVALDetail(req) - console.log('datadatadata', data); - setBUSINESSAPPROVALDETAIL(data.Result_Data) - - let shopData: any = [] - - if (currentRow?.BusinessProcess_State === 9000) { - shopData = await handleGetApprovalCommodityList({ - ProvinceCode: currentUser?.ProvinceCode, - // CommodityId: currentUser?.ProvinceCode, - BusinessApprovalId: currentRow?.BusinessApproval_ID, - PageIndex: 1, - PageSize: 999999, - }) - } else { - shopData = await handleGetCOMMODITYRUNNINGList({ - SearchParameter: { - BUSINESSAPPROVAL_ID: currentRow?.BusinessApproval_ID, - }, - PageIndex: 1, - pageSize: 999999, - }) - } - - - console.log('shopDatashopDatashopDatashopData', shopData); - setShopData(shopData.Result_Data.List) - return { - reasonForApplication: data.Result_Data.BUSINESSAPPROVAL_DESC, - ServerpartId: data.Result_Data.SERVERPART_ID, - NextApproveStaffId: data.Result_Data.APPOVED_IDS - } - } else { - return {} - } - }} - onFinish={async (res) => { - let data: any = {} - if (currentRow?.BusinessApproval_ID) { - const req: any = { - ProinstId: currentRow?.BusinessApproval_ID, - ProinstName: res.reasonForApplication, - UserId: currentUser?.ID, - OperateType: "100100", - ServerpartId: res.ServerpartId, - NextApproveStaffId: res.NextApproveStaffId, - NextApproveState: 2000, - CommodityRunningList: shopData - } - data = await handleReapplyCommodityProInst(req) - } else { - const req: any = { - ProinstName: res.reasonForApplication, - UserId: currentUser?.ID, - OperateType: "100100", - ServerpartId: res.ServerpartId, - NextApproveStaffId: res.NextApproveStaffId, - NextApproveState: 2000, - CommodityRunningList: shopData - } - data = await handleCreateCommodityProInst(req) - console.log('dsaidjaskda', data); - } - if (data.Result_Code === 100) { - message.success(data.Result_Desc) - // setShowApplyFor(false) - // setCurrentRow(undefined) - setShowApplyFor(false) - setCurrentRow(undefined) - setShopData([]) - setBUSINESSAPPROVALDETAIL(undefined) - setShowDetailType(null) - setApprovaType(0) - actionRef.current?.reload() - - } else { - message.error(data.Result_Desc) - } - - - - }} - > - - - 1000 || (currentRow?.BusinessApproval_ID && currentRow?.ApproveStaff_ID !== currentUser?.ID)} - /> - - - { - const ServerpartIdsTree = session.get('ServerpartIdsTree') - return ServerpartIdsTree - - // const data = await getServerpartTree(currentUser?.ProvinceCode, currentUser?.CityAuthority, true, true, true) - // console.log('data321312', data); - - // const list: any = [] - // if (data && data.length > 0) { - // data.forEach((item: any) => { - // if (item.children && item.children.length > 0) { - // item.children.forEach((subItem: any) => { - // list.push({ label: subItem.label, value: subItem.value }) - // }) - // } - // }) - // // data.forEach((item: any) => { - // // list.push({ label: item.label, value: item.value }) - // // }) - // } - // return list - }} - disabled={currentRow?.BusinessProcess_State > 1000 || (currentRow?.BusinessApproval_ID && currentRow?.ApproveStaff_ID !== currentUser?.ID)} - fieldProps={{ - showSearch: true, // 启用搜索框 - filterOption: (inputValue: any, option: any) => { - // 通过 label 搜索 - return option.label.toLowerCase().includes(inputValue.toLowerCase()); - } - }} - - /> - - 1000 && ApprovalType !== 0 ? "none" : "" }}> - { - const reqState: any = { - SearchParameter: { - PROVINCE_CODE: currentUser?.ProvinceCode, - APPROVALROUTE_STATES: "", - APPROVALROUTE_VALID: 1, - OPERATION_TYPES: "100100", - }, - PageIndex: 1, - PageSize: 999999 - } - const dataState = await handleGetAPPROVALROUTEList(reqState) - if (dataState && dataState.length > 0) { - let obj: any = {} - // 下面的环节 - let nextList: any = [] - console.log('dataState', dataState); - - dataState.forEach((item: any) => { - if (item.APPROVALROUTE_STATE === 2000) { - obj = item - } - if (item.APPROVALROUTE_STATE >= currentRow?.BusinessProcess_State) { - if (item.APPROVALROUTE_STATE === currentRow?.BusinessProcess_State) { - item.status = "process" - } - nextList.push(item) - } - }) - setNextStepsList(nextList) - console.log('next', nextList); - - let personTotal: number = obj.APPROVALSTAFF_ID.split(',').length || 0 - if (personTotal > 0) { - let STAFFIDList: number[] = obj.APPROVALSTAFF_ID.split(',') - let STAFFNAMEList: string[] = obj.APPROVALSTAFF_NAME.split(',') - let list: any = [] - for (let i = 0; i < personTotal; i++) { - list.push({ label: STAFFNAMEList[i], value: STAFFIDList[i] }) - } - return list - } - } - }} - disabled={currentRow?.BusinessProcess_State > 1000 || (currentRow?.BusinessApproval_ID && currentRow?.ApproveStaff_ID !== currentUser?.ID)} - /> - - - - - { - currentRow?.BusinessProcess_State > 1000 ? - { - console.log('approveCurrentRowapproveCurrentRowapproveCurrentRow', approveCurrentRow); - const reqState: any = { - SearchParameter: { - APPROVALROUTE_STATES: "", - APPROVALROUTE_VALID: 1, - OPERATION_TYPES: "100100", - }, - PageIndex: 1, - PageSize: 999999 - } - const dataState = await handleGetAPPROVALROUTEList(reqState) - console.log('dataStatedataStatedataState', dataState); - let obj: any = {} - let currentIndex: number = 0 - if (dataState && dataState.length > 0) { - dataState.forEach((item: any, index: number) => { - if (item.APPROVALROUTE_STATE === currentRow.BusinessProcess_State) { - obj = item - currentIndex = index - } - }) - } - if (obj) { - // 审批的时候 拿到当前状态 去找下一个状态 - if (ApprovalType === 1) { - // 拿到当前状态的信息 判断下一状态 是不是结束了 结束了 就不显示 下一结算审批人 不是结束 就拿到下一流程的审批人 - setNextApproval(obj.NEXT_STATE) - let nextObj: any = currentIndex + 1 <= dataState.length ? dataState[currentIndex + 1] : {} - if (nextObj) { - let personTotal: number = nextObj.APPROVALSTAFF_ID.split(',').length || 0 - if (personTotal > 0) { - let STAFFIDList: number[] = nextObj.APPROVALSTAFF_ID.split(',') - let STAFFNAMEList: string[] = nextObj.APPROVALSTAFF_NAME.split(',') - let list: any = [] - for (let i = 0; i < personTotal; i++) { - list.push({ label: STAFFNAMEList[i], value: STAFFIDList[i] }) - } - setNextApprovalPerson(list) - } - } - } else { - // 驳回的话 去找历史状态 - if (dataState && dataState.length > 0) { - let list: any = [] - dataState.forEach((item: any, index: number) => { - if (obj.APPROVALROUTE_STATE > item.APPROVALROUTE_STATE) { - list.push({ label: item.APPROVALROUTE_NAME, value: item.APPROVALROUTE_STATE }) - } - }) - setNextApprovalPerson(list) - } - - } - - } - return {} - }} - onFinish={async (res) => { - setAddApprovalLoading(true) - let data: any = {} - - if (ApprovalType === 1) { - // 审批 - const req: any = { - businessApprovalId: currentRow?.BusinessApproval_ID, - UserId: currentUser?.ID, - ApproveInfo: res.ApproveInfo, - nextApproveStaffId: res.nextApproveStaffId || "", - nextApproveState: nextApproval || "" - } - - data = await handleApproveCommodityProInst(req) - } else { - // 驳回 - const req: any = { - businessApprovalId: currentRow?.BusinessApproval_ID, - UserId: currentUser?.ID, - RejectInfo: res.ApproveInfo, - nextApproveState: res.nextApproveState || "" - } - console.log('reqreqreqreq', req); - - data = await handleRejectCommodityProInst(req) - } - setAddApprovalLoading(false) - console.log('datadatadata', data); - if (data.Result_Code === 100) { - message.success(data.Result_Desc) - - setShowApplyFor(false) - setCurrentRow(undefined) - setShopData([]) - setBUSINESSAPPROVALDETAIL(undefined) - setShowDetailType(null) - - - // setApproveCurrentRow(undefined) - // setApproveModal(false) - setNextApproval(null) - setNextApprovalPerson(null) - setApprovaType(0) - actionRef.current?.reload() - } else { - message.error(data.Result_Desc) - } - - }} - > - { - ApprovalType === 1 ? - - { - nextApproval === 9000 ? '' : - - - - - } - - - - : ApprovalType === 2 ? - - - - - - - - - : "" - } - : "" - } - - 1000 || (currentRow?.BusinessApproval_ID && currentRow?.ApproveStaff_ID !== currentUser?.ID) ? '' : - ] - }} - /> - - { - currentRow?.BusinessProcess_State > 1000 ? - -
- - {/* 1000 ? 'finish' : 'wait'} - title="发起申请" - description={ -
- -

{`${currentRow?.BusinessProcess_StartDate || ''}`}

-
-
- } - /> */} - { - BUSINESSAPPROVALDETAIL?.approveList && BUSINESSAPPROVALDETAIL?.approveList.length > 0 ? - BUSINESSAPPROVALDETAIL?.approveList.map((item: any, index: number) => ( - - -

{`${item.APPLYAPPROVE_DATE || ''}`}

-
-
} - /> - )) : '' - } - - { - nextStepsList && nextStepsList.length > 0 ? - nextStepsList.map((item: any, index: number) => ( - - )) : '' - } - - -
- : '' - } -
- {/* 新增商品的悬浮框 */} - < Modal - open={showAddShopModal} - width={1200} - wrapClassName={'shopModal'} - destroyOnClose - title={currentShopRow?.COMMODITY_ID ? '编辑商品' : '添加商品'} - onOk={() => { - modalShopFormRef.current?.validateFields().then(async (res: any) => { - let oldData: any = shopData && shopData.length > 0 ? JSON.parse(JSON.stringify(shopData)) : [] - - console.log('oldDataoldDataoldData', oldData); - console.log('resresresresresres', res); - - let newList: any = [] - // 判断当前的里面有没有一样的 - if (oldData && oldData.length > 0) { - let same: boolean = false - oldData.forEach((item: any, index: number) => { - if (item.ADDTIME === res.ADDTIME) { - same = true - newList.push({ - ...item, - ...res - }) - } else { - newList.push(item) - } - }) - if (!same) { - newList.push(res) - } - - } else { - newList.push(res) - } - console.log('newList', newList); - - // 如果进入到了添加商品 里面选了服务区 会 带给外面的表单 - if (res.SERVERPART_ID) { - modalFormRef.current?.setFieldsValue({ - ServerpartId: res.SERVERPART_ID - }) - - - } - - setShopData(newList) - setShowAddShopModal(false) - setCommodityList([]) - setCustomClassList([]) - setCurrentShopRow(undefined) - }) - }} - onCancel={() => { - setShowAddShopModal(false) - setCommodityList([]) - setCustomClassList([]) - setCurrentShopRow(undefined) - }} - > - - { - // !currentShopRow?.COMMODITY_ID && - if (currentShopRow?.SERVERPART_ID) { - await handleGetCommodity(currentShopRow?.SERVERPART_ID) - } - return { ...currentShopRow, BUSINESSTYPE: currentShopRow?.BUSINESSTYPE.toString() } - }} - disabled={currentRow?.BusinessProcess_State === 9000} - > -
商品基本信息
- - - - - - - - - - { - const data = await getServerpartTree(currentUser?.ProvinceCode, currentUser?.CityAuthority, true, true, true) - const list: any = [] - if (data && data.length > 0) { - data.forEach((item: any) => { - if (item.children && item.children.length > 0) { - item.children.forEach((subItem: any) => { - list.push({ label: subItem.label, value: subItem.value }) - }) - } - }) - data.forEach((item: any) => { - list.push({ label: item.label, value: item.value }) - }) - } - return list - }} - rules={[ - { - required: true, - message: '请选择服务区', - }, - ]} - fieldProps={{ - onChange: async (e: any) => { - console.log('e', e) - if (e) { - setSelectSERVERPARTID(e) - await handleGetCommodity(e) - if (selectBUSINESSTYPE) { - await handleGetCustomClassList(e) - } - } else { - setSelectSERVERPARTID(undefined) - setCommodityList([]) - setCustomClassList([]) - } - }, - showSearch: true, // 启用搜索框 - filterOption: (inputValue: any, option: any) => { - // 通过 label 搜索 - return option.label.toLowerCase().includes(inputValue.toLowerCase()); - } - }} - /> - - - { - if (e) { - setSelectBUSINESSTYPE(e) - if (selectSERVERPARTID) { - await handleGetCustomClassList(e) - } - } else { - setSelectBUSINESSTYPE(undefined) - } - } - }} - /> - - - { - return treeView - }} - fieldProps={{ - treeDefaultExpandAll: true - }} - /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
商品状态信息
- - - - - - - - - - - - - - - - - - - - - - -
商品价格信息
- - - - - - - - - - - - - - - - - - - - - -
商品进销信息
- - - - - - - - - - - -
- + ) } diff --git a/src/utils/format.ts b/src/utils/format.ts index 98ca330..0831b1b 100644 --- a/src/utils/format.ts +++ b/src/utils/format.ts @@ -1064,6 +1064,12 @@ export function formatTreeData( percentFields.forEach((fieldPath) => { const value = getNestedValue(newNode, fieldPath); if (value !== undefined) { + // 如果值是null,设置为空字符串 + if (value === null) { + setNestedValue(newNode, fieldPath, ''); + return; + } + const currentValueStr = String(value); // 如果值后面还没有百分号,则添加