From 9fb0245d177c1b7186be2ca12b89cb9a5348c383 Mon Sep 17 00:00:00 2001 From: ylj20011123 Date: Fri, 22 Aug 2025 19:39:48 +0800 Subject: [PATCH] update --- package.json | 2 +- .../reports/SalesFlow/index.tsx | 3 +- .../serviceAreaPersonnel/index.tsx | 171 +++++++---- .../serviceAreaPersonnel/service.ts | 18 +- .../transactionAnalysis/index.tsx | 290 +++++++++--------- .../reports/audit/abnormalAudit/index.tsx | 143 ++++----- .../NewProductApproval/index.tsx | 36 ++- .../ProductChangeInfoApproval/index.tsx | 34 +- .../ProductChangePriceApproval/index.tsx | 32 +- .../productControl/commodityInfo/index.tsx | 1 + .../productControl/commoditySearch/index.tsx | 253 ++++++++------- .../productControl/shopCommodity/index.tsx | 3 +- src/services/options/index.ts | 2 +- src/versionEnv.ts | 6 +- 14 files changed, 529 insertions(+), 465 deletions(-) diff --git a/package.json b/package.json index 5c55bab..99f450b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ant-design-pro", - "version": "4.5.35", + "version": "4.5.36", "private": true, "description": "An out-of-box UI solution for enterprise applications", "scripts": { diff --git a/src/pages/merchantManagement/reports/SalesFlow/index.tsx b/src/pages/merchantManagement/reports/SalesFlow/index.tsx index aa54d97..92bd4d1 100644 --- a/src/pages/merchantManagement/reports/SalesFlow/index.tsx +++ b/src/pages/merchantManagement/reports/SalesFlow/index.tsx @@ -206,7 +206,7 @@ const CommoditysaleTable: React.FC<{ currentUser: CurrentUser | undefined }> = ( ...params, SERVERPARTSHOP_ID: shopId && shopId.length > 0 ? shopId.toString() : currentUser?.ServerpartShopIds, }); - setReqDetailList(data.data); + setReqDetailList(data.List); console.log('data', data); const list: any = JSON.parse(JSON.stringify(data.List)) if (list && list.length > 0) { @@ -346,7 +346,6 @@ const CommoditysaleTable: React.FC<{ currentUser: CurrentUser | undefined }> = ( } onRow={(record) => { return { - onClick: () => { setCurrentRow(record) setVisible(true) diff --git a/src/pages/newDataAnalysis/serviceAreaPersonnel/index.tsx b/src/pages/newDataAnalysis/serviceAreaPersonnel/index.tsx index 1536d92..982205b 100644 --- a/src/pages/newDataAnalysis/serviceAreaPersonnel/index.tsx +++ b/src/pages/newDataAnalysis/serviceAreaPersonnel/index.tsx @@ -11,7 +11,7 @@ import type { CurrentUser } from "umi"; import type { ConnectState } from "@/models/connect"; import React, { useRef, useState } from "react"; import ProCard from "@ant-design/pro-card"; -import { MenuFoldOutlined } from "@ant-design/icons"; +import { MenuFoldOutlined, PlusOutlined } from "@ant-design/icons"; import { Col, Divider, FormInstance, Modal, Row } from "antd"; import { Button, message, Space, Spin, Tree } from "antd"; import useRequest from "@ahooksjs/use-request"; @@ -23,6 +23,8 @@ import LeftSelectTree from "@/pages/reports/settlementAccount/component/leftSele import ProForm, { ProFormCheckbox, ProFormRadio, ProFormSelect, ProFormText } from "@ant-design/pro-form"; import { handleGetCASHWORKERDetail, handleGetCASHWORKERList, handleGetServerpartShopList, handleSynchroCASHWORKER } from "./service"; import PageTitleBox from "@/components/PageTitleBox"; +import session from "@/utils/session"; +import { handleNewGetSERVERPARTDetail } from "../service"; const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) => { @@ -55,7 +57,7 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) => // 关联门店悬浮框 const [relatedShop, setRelatedShop] = useState() // 选择的门店id数组 - const [selectShop,setSelectShop] = useState() + const [selectShop, setSelectShop] = useState() const { loading: PROWERSETLoading, data: PROWERSET } = useRequest(async () => { const data = await getFieldEnum({ FieldExplainField: 'PROWERSET' }) @@ -65,7 +67,7 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) => const addQuotesToNumbers = (value: any) => { return /^-?\d+(\.\d+)?$/.test(value) ? `'${value}` : value; - }; + }; const columns: any = [ { @@ -273,10 +275,10 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) => } const data = await handleGetCASHWORKERList(req) if (data && data.length > 0) { - console.log('data',data); + console.log('data', data); let res = JSON.parse(JSON.stringify(data)) let list: any = [] - data.forEach((item: any)=>{ + data.forEach((item: any) => { item.CASHWORKER_LOGINNAME = `"${item.CASHWORKER_LOGINNAME}"` item.CASHWORKER_LOGINPWD = `"${item.CASHWORKER_LOGINPWD}"` list.push(item) @@ -316,7 +318,10 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) => }} > 导出excel - + , + ] }} /> @@ -331,7 +336,6 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) => open={editModal} footer={null} destroyOnClose={true} - onCancel={() => { setEditModal(false) setCurrentRow(undefined) @@ -339,13 +343,19 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) => }} footer={
- + }}>关联门店 */}
} @@ -607,17 +649,20 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) => { + rowKey={(record) => { return `${record?.SERVERPARTSHOP_ID}` }} request={async () => { - if (!currentRow?.SERVERPART_ID) { - return + let id: string = '' + if (!currentRow?.CASHWORKER_ID) { + let formRef: any = editFormRef.current?.getFieldsValue() + console.log('formRefformRefformRef', formRef); + id = formRef.SERVERPART_ID } const req: any = { SearchParameter: { ISVALID: 1, - SERVERPART_IDS: currentRow?.SERVERPART_ID, + SERVERPART_IDS: id || currentRow?.SERVERPART_ID, SortStr: "BUSINESS_STATE,SHOPTRADE,SHOPSHORTNAME,SHOPREGION" }, SortStr: "BUSINESS_STATE,SHOPTRADE,SHOPSHORTNAME,SHOPREGION", @@ -629,13 +674,13 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) => } return { data: [], success: true } }} - headerTitle={`当前收银员为【${currentRow?.CASHWORKER_NAME}】`} + headerTitle={`当前收银员为【${currentRow?.CASHWORKER_NAME || ""}】`} pagination={false} scroll={{ y: 400 }} rowSelection={{ onChange: (selectedRowKeys, selectedRows) => { // 选中行时 存储选中的行数据 - console.log('selectedRowKeys',selectedRowKeys); - console.log('selectedRows',selectedRows); + console.log('selectedRowKeys', selectedRowKeys); + console.log('selectedRows', selectedRows); setSelectShop(selectedRowKeys) }, defaultSelectedRowKeys: selectShop diff --git a/src/pages/newDataAnalysis/serviceAreaPersonnel/service.ts b/src/pages/newDataAnalysis/serviceAreaPersonnel/service.ts index 417c7b3..b0f9a1e 100644 --- a/src/pages/newDataAnalysis/serviceAreaPersonnel/service.ts +++ b/src/pages/newDataAnalysis/serviceAreaPersonnel/service.ts @@ -4,7 +4,7 @@ import request from "@/utils/request"; export async function handleGetCASHWORKERList(params?: any) { const data = await request(`/BaseInfo/GetCASHWORKERList`, { method: 'POST', - data:params + data: params }); if (data.Result_Code !== 100) { @@ -17,7 +17,7 @@ export async function handleGetCASHWORKERList(params?: any) { } } - return data.Result_Data.List; + return data.Result_Data.List; } @@ -38,7 +38,7 @@ export async function handleGetCASHWORKERDetail(params?: any) { } } - return data.Result_Data; + return data.Result_Data; } // 同步收银人员表 @@ -49,16 +49,10 @@ export async function handleSynchroCASHWORKER(params?: any) { }); if (data.Result_Code !== 100) { - return { - data: [], - current: 1, - pageSize: 10, - total: 0, - success: false - } + return data } - return data; + return data; } // 获得可以关联的门店列表 @@ -78,5 +72,5 @@ export async function handleGetServerpartShopList(params?: any) { } } - return data.Result_Data.List; + return data.Result_Data.List; } \ No newline at end of file diff --git a/src/pages/reports/BusinessAnalysis/transactionAnalysis/index.tsx b/src/pages/reports/BusinessAnalysis/transactionAnalysis/index.tsx index e6dc882..8e3fe91 100644 --- a/src/pages/reports/BusinessAnalysis/transactionAnalysis/index.tsx +++ b/src/pages/reports/BusinessAnalysis/transactionAnalysis/index.tsx @@ -1,18 +1,18 @@ -import {connect} from "umi"; -import type {CurrentUser} from "umi"; -import type {ConnectState} from "@/models/connect"; -import React, {useRef, useState} from "react"; +import { connect } from "umi"; +import type { CurrentUser } from "umi"; +import type { ConnectState } from "@/models/connect"; +import React, { useRef, useState } from "react"; import ProCard from "@ant-design/pro-card"; -import {MenuFoldOutlined} from "@ant-design/icons"; -import type { FormInstance} from "antd"; -import {Drawer} from "antd"; -import { Select} from "antd"; -import {Button, message, Space, Spin, Tree} from "antd"; +import { MenuFoldOutlined } from "@ant-design/icons"; +import type { FormInstance } from "antd"; +import { Drawer } from "antd"; +import { Select } from "antd"; +import { Button, message, Space, Spin, Tree } from "antd"; import useRequest from "@ahooksjs/use-request"; -import {getFieldEnum, getMoney, getServerpartTree, handleCallLogs} from "@/services/options"; -import type {ActionType} from "@ant-design/pro-table"; +import { getFieldEnum, getMoney, getServerpartTree, handleCallLogs } from "@/services/options"; +import type { ActionType } from "@ant-design/pro-table"; import ProTable from "@ant-design/pro-table"; -import {handleGetExamineList} from "@/pages/examine/examineList/service"; +import { handleGetExamineList } from "@/pages/examine/examineList/service"; import moment from "moment"; import session from "@/utils/session"; import { @@ -24,11 +24,11 @@ import * as numeral from "numeral"; import { handleGetShopShortNamesGet } from "@/pages/reports/BusinessAnalysis/transactionAnalysis/service"; -import {handleGetGetRevenueYOYQOQByDate} from "@/pages/reports/BusinessAnalysis/revenueYOYQOQReport/service"; +import { handleGetGetRevenueYOYQOQByDate } from "@/pages/reports/BusinessAnalysis/revenueYOYQOQReport/service"; import PageTitleBox from "@/components/PageTitleBox"; -const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => { +const transactionAnalysis: React.FC<{ currentUser: CurrentUser }> = (props) => { const { currentUser } = props const downloadBtnRef = useRef() @@ -39,45 +39,45 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => { const [reqDetailList, setReqDetailList] = useState(); // 合计项数据源 const [printOut, setPrintOut] = useState(); // 打印数据的内容 const [collapsible, setCollapsible] = useState(false) - const [treeView,setTreeView] = useState() + const [treeView, setTreeView] = useState() // 加载服务区树 const { loading: treeLoading, data: treeViews } = useRequest(async () => { const data = await getServerpartTree(currentUser?.ProvinceCode, currentUser?.CityAuthority, true, false, true) setTreeView(data) return data }) -// 树相关的属性和方法 + // 树相关的属性和方法 const [selectedId, setSelectedId] = useState() const businessTypeList = session.get("BUSINESSTYPEList") const businessTypeObj = session.get("BUSINESSTYPEObj") const BUSINESSTYPEObj = session.get('BUSINESSTYPEObj') // 判断是不是第一次进入页面 - const [isFirst,setIsFirst] = useState(true) -// 导出的加载效果 - const [showLoading,setShowLoading] = useState(false) + const [isFirst, setIsFirst] = useState(true) + // 导出的加载效果 + const [showLoading, setShowLoading] = useState(false) // 是否显示打印的表格 - const [showExportTable,setShowExportTable] = useState(false) + const [showExportTable, setShowExportTable] = useState(false) // 查询的条件 - const [searchParams,setSearchParams] = useState() + const [searchParams, setSearchParams] = useState() // 自营业态的选择列表 - const [selfList,setSelfList] = useState() - const [businessModel,setBusinessModel] = useState() + const [selfList, setSelfList] = useState() + const [businessModel, setBusinessModel] = useState() // 经营模式 - const [businessType,setBusinessType] = useState() + const [businessType, setBusinessType] = useState() // 展示自营业态 - const [showSelfBusiness,setShowSelfBusiness] = useState(true) + const [showSelfBusiness, setShowSelfBusiness] = useState(true) // 自营业态的选择列表 - const [shopNamesList,setShopNamesList] = useState() - const [printIndex,setPrintIndex] = useState(new Date().getTime()) + const [shopNamesList, setShopNamesList] = useState() + const [printIndex, setPrintIndex] = useState(new Date().getTime()) // 显示每日流水抽屉 - const [showDailyDrawer,setShowDailyDrawer] = useState(false) - const [currentRow,setCurrentRow] = useState() - const {loading: selfLoading,data: self} = useRequest(async ()=>{ + const [showDailyDrawer, setShowDailyDrawer] = useState(false) + const [currentRow, setCurrentRow] = useState() + const { loading: selfLoading, data: self } = useRequest(async () => { const data = await handleGetShopShortNames() - if (data && data.length>0){ + if (data && data.length > 0) { const list: any = [] - data.forEach((item: any)=>{ - list.push({label: item,value: item}) + data.forEach((item: any) => { + list.push({ label: item, value: item }) }) return list } @@ -85,10 +85,10 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => { const [columnsStateMap, setColumnsStateMap] = useState({ // Business_Type:{show:false}, - ShopTrade:{show:false} + ShopTrade: { show: false } }) const [columnsDailyStateMap, setColumnsDailyStateMap] = useState({ - ShopTrade:{show:false} + ShopTrade: { show: false } }) const columns: any = [ { @@ -111,21 +111,21 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => { } }, { - title:'经营模式', - dataIndex:'businessType', - valueType:'select', + title: '经营模式', + dataIndex: 'businessType', + valueType: 'select', hideInTable: true, valueEnum: BUSINESSTYPEObj, - fieldProps:{ + fieldProps: { mode: "multiple", - onChange:async (e)=>{ - console.log('e',e) - const flag = e.filter(item=>item==='1000')?.toString() || '' - console.log('flag',flag) - if (flag){ + onChange: async (e) => { + console.log('e', e) + const flag = e.filter(item => item === '1000')?.toString() || '' + console.log('flag', flag) + if (flag) { setShowSelfBusiness(false) // handleGetShopNamesList(selectedId) - }else{ + } else { setShowSelfBusiness(true) // setShopNamesList({}) } @@ -133,46 +133,46 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => { } }, { - title:'自营业态', - dataIndex:'shopNames', + title: '自营业态', + dataIndex: 'shopNames', hideInTable: true, hideInSearch: showSelfBusiness, valueType: 'select', - valueEnum:shopNamesList, + valueEnum: shopNamesList, // request: async () => { // return await getFieldEnum({ FieldExplainField: 'BUSINESSTYPE' }) // }, - fieldProps:{ + fieldProps: { multiple: true, showSearch: true, - filterOption:(input, option) => (option?.label ?? '').toLowerCase().includes(input.toLowerCase()), + filterOption: (input, option) => (option?.label ?? '').toLowerCase().includes(input.toLowerCase()), } }, { - title:'外接系统', - dataIndex:'targetSystem', + title: '外接系统', + dataIndex: 'targetSystem', valueType: 'select', hideInTable: true, - valueEnum:{ - "":'全部', - 1:"是", - 0:"否" + valueEnum: { + "": '全部', + 1: "是", + 0: "否" }, initialValue: "" }, { - title:'', - dataIndex:'SearchKeyValue', + title: '', + dataIndex: 'SearchKeyValue', hideInTable: true, - fieldProps:{ + fieldProps: { placeholder: "请输入商户/品牌/门店/服务区" } }, { - title:'服务区信息', - dataIndex:'', + title: '服务区信息', + dataIndex: '', hideInSearch: true, - children:[ + children: [ // { // title: '序号', // width: 120, @@ -180,22 +180,22 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => { // dataIndex: 'index' // }, { - title:'门店名称', + title: '门店名称', width: 200, hideInSearch: true, - dataIndex:'Name', - ellipsis:true, - render:(_,record)=>{ - return showDailyDrawer?record?.Name:{ - if (record?.Name === '合计'){ + dataIndex: 'Name', + ellipsis: true, + render: (_, record) => { + return showDailyDrawer ? record?.Name : { + if (record?.Name === '合计') { let id: string = '' - if (record?.children && record?.children.length>0){ - record?.children.forEach((item: any)=>{ - if (item?.children && item?.children.length>0){ - item?.children.forEach((subItem: any)=>{ - if (id){ - id +=`,${subItem.Id}` - }else{ + if (record?.children && record?.children.length > 0) { + record?.children.forEach((item: any) => { + if (item?.children && item?.children.length > 0) { + item?.children.forEach((subItem: any) => { + if (id) { + id += `,${subItem.Id}` + } else { id = subItem.Id } }) @@ -207,13 +207,13 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => { Id: id }) } - else if(record?.Name && record?.Name.indexOf('管理中心')!==-1){ + else if (record?.Name && record?.Name.indexOf('管理中心') !== -1) { let id: string = '' - if (record?.children && record?.children.length>0){ - record?.children.forEach((item: any)=>{ - if (id){ - id +=`,${item.Id}` - }else{ + if (record?.children && record?.children.length > 0) { + record?.children.forEach((item: any) => { + if (id) { + id += `,${item.Id}` + } else { id = item.Id } }) @@ -225,13 +225,13 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => { ServerpartId: id }) } - else if (record?.Name && record?.Name.indexOf('服务区')!==-1){ + else if (record?.Name && record?.Name.indexOf('服务区') !== -1) { setCurrentRow({ ...record, ServerpartId: record?.Id, ServerpartName: record?.Name, }) - }else{ + } else { setCurrentRow(record) } setShowDailyDrawer(true) @@ -241,26 +241,26 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => { } }, { - title:'门店数量', + title: '门店数量', hideInSearch: true, valueType: 'digit', - dataIndex:'ShopCount' + dataIndex: 'ShopCount' }, { - title:'经营模式', + title: '经营模式', width: 150, - dataIndex:'Business_Type', + dataIndex: 'Business_Type', valueType: 'select', valueEnum: businessTypeObj, - render:(_,record)=>{ - return record.BusinessType?businessTypeObj[record.BusinessType]:'-' + render: (_, record) => { + return record.BusinessType ? businessTypeObj[record.BusinessType] : '-' } }, { - title:'经营商户', + title: '经营商户', width: 120, ellipsis: true, - dataIndex:'MERCHANTS_NAME', + dataIndex: 'MERCHANTS_NAME', hideInSearch: true, }, { @@ -279,45 +279,45 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => { ] }, { - title:'经营数据', - dataIndex:'', + title: '经营数据', + dataIndex: '', hideInSearch: true, - children:[ + children: [ { - title:'客单数量', + title: '客单数量', hideInSearch: true, - dataIndex:'TicketCount', + dataIndex: 'TicketCount', valueType: 'digit' }, { - title:'销售数量', + title: '销售数量', hideInSearch: true, valueType: 'digit', - dataIndex:'TotalCount' + dataIndex: 'TotalCount' }, { - title:'销售金额', + title: '销售金额', hideInSearch: true, valueType: 'digit', - dataIndex:'TotalSellAmount' + dataIndex: 'TotalSellAmount' }, { - title:'客单均量', + title: '客单均量', hideInSearch: true, valueType: 'digit', - dataIndex:'AverageCount' + dataIndex: 'AverageCount' }, { - title:'客单均价', + title: '客单均价', hideInSearch: true, valueType: 'digit', - dataIndex:'AverageAmount' + dataIndex: 'AverageAmount' }, { - title:'商品均价', + title: '商品均价', hideInSearch: true, valueType: 'digit', - dataIndex:'AverageCommodity' + dataIndex: 'AverageCommodity' }, ] } @@ -346,18 +346,18 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => { } // 自营业态的选择的列表方法 - const handleGetShopNamesList = async (id: any )=>{ + const handleGetShopNamesList = async (id: any) => { const req: any = { ProvinceCode: currentUser?.USER_PROVINCE, - BusinessType:1000, + BusinessType: 1000, ServerpartId: id || selectedId } const data = await handleGetShopShortNamesGet(req) - console.log('data',data) - if (data && data.length>0){ + console.log('data', data) + if (data && data.length > 0) { const obj: any = {} - if (data && data.length>0){ - data.forEach((item: any)=>{ + if (data && data.length > 0) { + data.forEach((item: any) => { obj[item] = item }) } @@ -394,13 +394,13 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => { borderRadius: '8px', width: '200px' }}> - - 数据导出中... + + 数据导出中...
: '' } -
+
{ showExportTable && reqDetailList && reqDetailList.length > 0 ? = (props) => { /> : '' }
-
-
+
+
{ setCollapsible(!collapsible) - }}/>} + }} />} colSpan={!collapsible ? "300px" : "60px"} title={!collapsible ? "请选择服务区" : ""} headerBordered @@ -448,7 +448,7 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => { // actionRef?.current?.reload() // getData(selectedIds.map(n => n?.value)?.toString() || '') }} - // switcherIcon={} + // switcherIcon={} /> : ''}
= (props) => { }} bordered headerTitle={} - search={{span: 6,defaultCollapsed:false,}} - scroll={{y: 'calc(100vh - 470px)'}} + search={{ span: 6, defaultCollapsed: false, }} + scroll={{ y: 'calc(100vh - 470px)' }} request={async (params) => { if (isFirst) { setIsFirst(false) @@ -477,7 +477,7 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => { message.error('请选择服务区') return } - console.log('params',params) + console.log('params', params) handleCallLogs() setSearchParams(params) const req = { @@ -488,7 +488,7 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => { // shopNames: businessModel, targetSystem: params.targetSystem || '', shopNames: params.shopNames || '', - SearchKeyName:"MerchantName,Brand,Shop,Serverpart", + SearchKeyName: "MerchantName,Brand,Shop,Serverpart", SearchKeyValue: params?.SearchKeyValue || '' } const data = await handleGetGetTransactionCustomer(req) @@ -538,11 +538,11 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => { } console.log('list', list) setReqDetailList(list) - return {data: list, success: true} + return { data: list, success: true } }} toolbar={{ actions: [ - + = (props) => { setCurrentRow(undefined); setShowDailyDrawer(false); }} - bodyStyle={{backgroundColor: "#f9f9f9", padding: 16}} + bodyStyle={{ backgroundColor: "#f9f9f9", padding: 16 }} destroyOnClose closable={false} > -
+
= (props) => { search={false} options={false} pagination={false} - headerTitle={ currentRow?.Name==='合计'?'合计':`${currentRow?.SpregiontypeName}${currentRow?.ServerpartName?`-${currentRow?.ServerpartName}`:''}${currentRow?.SERVERPARTSHOP_NAME?`-${currentRow?.SERVERPARTSHOP_NAME}`:''}`} - request={async (params)=>{ - console.log('currentRow',currentRow) + headerTitle={currentRow?.Name === '合计' ? '合计' : `${currentRow?.SpregiontypeName}${currentRow?.ServerpartName ? `-${currentRow?.ServerpartName}` : ''}${currentRow?.SERVERPARTSHOP_NAME ? `-${currentRow?.SERVERPARTSHOP_NAME}` : ''}`} + request={async (params) => { + console.log('currentRow', currentRow) const req = { - ServerpartIds: currentRow?.Name==='合计'?selectedId:currentRow?.ServerpartId?currentRow?.ServerpartId:'', - ServerpartShopId:currentRow?.SERVERPARTSHOP_ID?currentRow?.SERVERPARTSHOP_ID:'', + ServerpartIds: currentRow?.Name === '合计' ? selectedId : currentRow?.ServerpartId ? currentRow?.ServerpartId : '', + ServerpartShopId: currentRow?.SERVERPARTSHOP_ID ? currentRow?.SERVERPARTSHOP_ID : '', startDate: searchParams?.StartDate, endDate: searchParams?.EndDate, businessType, @@ -616,22 +616,22 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => { targetSystem: searchParams?.targetSystem || '', } const data = await handleGetTransactionCustomerByDate(req) - console.log('data22222',data) - if (data && data.length>0){ - console.log('data',data) - data.forEach((item: any,index: number)=>{ + console.log('data22222', data) + if (data && data.length > 0) { + console.log('data', data) + data.forEach((item: any, index: number) => { item.index = index + 1 - if (item.children && item.children.length>0){ - item.children.forEach((subItem: any,subIndex: number)=>{ + if (item.children && item.children.length > 0) { + item.children.forEach((subItem: any, subIndex: number) => { subItem.index = subIndex + 1 }) } }) - return {data, success: true} + return { data, success: true } } - return {data:[],success: true} + return { data: [], success: true } }} - scroll={{x: 1700}} + scroll={{ x: 1700 }} columnsState={{ value: columnsDailyStateMap, onChange: setColumnsDailyStateMap, @@ -640,9 +640,9 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => {
-) + ) } -export default connect(({user}: ConnectState) => ({ +export default connect(({ user }: ConnectState) => ({ currentUser: user.currentUser }))(transactionAnalysis); diff --git a/src/pages/reports/audit/abnormalAudit/index.tsx b/src/pages/reports/audit/abnormalAudit/index.tsx index 1f0fbae..3f7914f 100644 --- a/src/pages/reports/audit/abnormalAudit/index.tsx +++ b/src/pages/reports/audit/abnormalAudit/index.tsx @@ -1,23 +1,23 @@ -import {connect} from "umi"; -import type {CurrentUser} from "umi"; -import type {ConnectState} from "@/models/connect"; -import React, {useRef, useState} from "react"; +import { connect } from "umi"; +import type { CurrentUser } from "umi"; +import type { ConnectState } from "@/models/connect"; +import React, { useRef, useState } from "react"; import ProCard from "@ant-design/pro-card"; -import {MenuFoldOutlined} from "@ant-design/icons"; -import type {FormInstance} from "antd"; -import {Avatar, Button, Menu, message, Space, Spin, Tree,Drawer} from "antd"; +import { MenuFoldOutlined } from "@ant-design/icons"; +import type { FormInstance } from "antd"; +import { Avatar, Button, Menu, message, Space, Spin, Tree, Drawer } from "antd"; import useRequest from "@ahooksjs/use-request"; -import {getServerpartTree, handleCallLogs, handleGetDate} from "@/services/options"; -import type {ActionType} from "@ant-design/pro-table"; +import { getServerpartTree, handleCallLogs, handleGetDate } from "@/services/options"; +import type { ActionType } from "@ant-design/pro-table"; import ProTable from "@ant-design/pro-table"; import ReactHTMLTableToExcel from "react-html-table-to-excel"; import SubMenu from "antd/lib/menu/SubMenu"; import moment from "moment"; -import {handleGetABNORMALAUDITList} from "@/pages/reports/audit/abnormalAudit/service"; +import { handleGetABNORMALAUDITList } from "@/pages/reports/audit/abnormalAudit/service"; import PageTitleBox from "@/components/PageTitleBox"; -const abnormalAudit: React.FC<{ currentUser: CurrentUser}> = (props) => { +const abnormalAudit: React.FC<{ currentUser: CurrentUser }> = (props) => { const { currentUser } = props const downloadBtnRef = useRef() const actionRef = useRef(); @@ -25,25 +25,25 @@ const abnormalAudit: React.FC<{ currentUser: CurrentUser}> = (props) => { const [reqDetailList, setReqDetailList] = useState(); // 合计项数据源 const [printOut, setPrintOut] = useState(); // 打印数据的内容 const [collapsible, setCollapsible] = useState(false) - const [treeView,setTreeView] = useState() + const [treeView, setTreeView] = useState() // 加载服务区树 const { loading: treeLoading, data: treeViews } = useRequest(async () => { const data = await getServerpartTree(currentUser?.ProvinceCode, currentUser?.CityAuthority, true, true, true) - console.log('data',data) + console.log('data', data) setTreeView(data) return data }) -// 树相关的属性和方法 + // 树相关的属性和方法 const [selectedId, setSelectedId] = useState() -// 导出的加载效果 - const [showLoading,setShowLoading] = useState(false) + // 导出的加载效果 + const [showLoading, setShowLoading] = useState(false) // 是否显示打印的表格 - const [showExportTable,setShowExportTable] = useState(false) + const [showExportTable, setShowExportTable] = useState(false) const [currenMenu, setCurrenMenu] = useState(); // 当前选中左侧菜单的服务区节点 // 显示详情抽屉 - const [showDetailDrawer,setShowDetailDrawer] = useState(false) + const [showDetailDrawer, setShowDetailDrawer] = useState(false) // 选择的当行详情 - const [currentRow,setCurrentRow] = useState() + const [currentRow, setCurrentRow] = useState() const columns: any = [ { @@ -53,7 +53,7 @@ const abnormalAudit: React.FC<{ currentUser: CurrentUser}> = (props) => { hideInTable: true, hideInDescriptions: true, colSize: 1, - initialValue: [moment().add(-1, 'month').format('YYYY-MM-DD'), moment().add(-1,'day').format('YYYY-MM-DD')], + initialValue: [moment().add(-1, 'month').format('YYYY-MM-DD'), moment().add(-1, 'day').format('YYYY-MM-DD')], search: { transform: (value) => { return { @@ -67,107 +67,107 @@ const abnormalAudit: React.FC<{ currentUser: CurrentUser}> = (props) => { } }, { - title:'序号', + title: '序号', width: 60, dataIndex: '', valueType: 'index', hideInSearch: true }, { - title:'服务区名称', + title: '服务区名称', width: 150, ellipsis: true, dataIndex: 'SERVERPART_NAME', hideInSearch: true }, { - title:'门店名称', + title: '门店名称', width: 150, ellipsis: true, dataIndex: 'SHOPNAME', hideInSearch: true, - render:(_,record)=>{ - return record?.SHOPNAME?
{ + render: (_, record) => { + return record?.SHOPNAME ? { setCurrentRow(record) setShowDetailDrawer(true) - }}>{record?.SHOPNAME}:'' + }}>{record?.SHOPNAME} : '' } }, { - title:'总销售额', + title: '总销售额', width: 120, valueType: 'digit', dataIndex: 'TOTALSELLAMOUNT', hideInSearch: true }, { - title:'长短款', + title: '长短款', width: 120, valueType: 'digit', dataIndex: 'DIFFERENT_PRICE', hideInSearch: true }, { - title:'稽核金额/对客现金', + title: '稽核金额/对客现金', width: 180, dataIndex: 'CHECK_CASHPAY/CASH_PAYMENT', hideInSearch: true, - render:(_,record)=>{ + render: (_, record) => { return `${record?.CHECK_CASHPAY || '0'}/${record?.CASH_PAYMENT || '0'}` } }, { - title:'间隔时长(分)', + title: '间隔时长(分)', width: 120, dataIndex: 'TIME_INTERVAL', hideInSearch: true }, { - title:'结账时间', + title: '结账时间', width: 180, dataIndex: 'ENDACCOUNT_DATE', hideInSearch: true, - render:(_,record)=>{ - return record?.ENDACCOUNT_DATE?handleGetDate(record?.ENDACCOUNT_DATE):'-' + render: (_, record) => { + return record?.ENDACCOUNT_DATE ? handleGetDate(record?.ENDACCOUNT_DATE) : '-' } }, { - title:'稽查时间', + title: '稽查时间', width: 180, dataIndex: 'CHECK_ENDDATE', hideInSearch: true, - render:(_,record)=>{ - return record?.CHECK_ENDDATE?handleGetDate(record?.CHECK_ENDDATE):'-' + render: (_, record) => { + return record?.CHECK_ENDDATE ? handleGetDate(record?.CHECK_ENDDATE) : '-' } }, { - title:'起始时间', + title: '起始时间', width: 180, dataIndex: 'CHECK_STARTDATE', hideInSearch: true, - render:(_,record)=>{ - return record?.CHECK_STARTDATE?handleGetDate(record?.CHECK_STARTDATE):'-' + render: (_, record) => { + return record?.CHECK_STARTDATE ? handleGetDate(record?.CHECK_STARTDATE) : '-' } }, { - title:'稽查类型', + title: '稽查类型', width: 120, - dataIndex:'CHECK_TYPE', + dataIndex: 'CHECK_TYPE', valueType: 'select', - valueEnum:{ - "现场稽查":"现场稽查", - "区域稽查":"区域稽查", - "公司稽查":"公司稽查", + valueEnum: { + "现场稽查": "现场稽查", + "区域稽查": "区域稽查", + "公司稽查": "公司稽查", } }, { - title:'稽核人员', + title: '稽核人员', width: 120, dataIndex: 'WORKER_NAME', hideInSearch: true }, { - title:'收银人员', + title: '收银人员', width: 120, dataIndex: 'CASHIER_NAME', ellipsis: true, @@ -197,7 +197,7 @@ const abnormalAudit: React.FC<{ currentUser: CurrentUser}> = (props) => { tempTable.remove() // 防止重复打印一个内容 } // 查询的条件 - const [searchParams,setSearchParams] = useState() + const [searchParams, setSearchParams] = useState() return ( @@ -230,13 +230,13 @@ const abnormalAudit: React.FC<{ currentUser: CurrentUser}> = (props) => { borderRadius: '8px', width: '200px' }}> - - 数据导出中... + + 数据导出中...
: '' } -
+
{ showExportTable && reqDetailList && reqDetailList.length > 0 ? = (props) => { /> : '' }
-
+
-
+
{ setCollapsible(!collapsible) - }}/>} + }} />} colSpan={!collapsible ? "300px" : "60px"} title={!collapsible ? "请选择服务区" : ""} headerBordered @@ -284,11 +284,11 @@ const abnormalAudit: React.FC<{ currentUser: CurrentUser}> = (props) => { // actionRef?.current?.reload() // getData(selectedIds.map(n => n?.value)?.toString() || '') }} - // switcherIcon={} + // switcherIcon={} /> : ''}
= (props) => { columns={columns} bordered headerTitle={} - search={{span: 6}} - scroll={{x: 1500}} - request={async(params)=>{ - if (!selectedId){ + search={{ span: 6 }} + scroll={{ x: 1500 }} + request={async (params) => { + if (!selectedId) { return } const req = { - SearchParameter:{ + SearchParameter: { ...params, + PROVINCE_CODE: currentUser?.ProvinceCode, SERVERPART_ID: selectedId }, PageIndex: 1, @@ -316,17 +317,17 @@ const abnormalAudit: React.FC<{ currentUser: CurrentUser}> = (props) => { handleCallLogs() setSearchParams(params) const data = await handleGetABNORMALAUDITList(req) - console.log('data',data) - if (data && data.length>0){ + console.log('data', data) + if (data && data.length > 0) { setReqDetailList(data) - return {data,success: true} + return { data, success: true } } setReqDetailList([]) - return {data:[],success: true} + return { data: [], success: true } }} toolbar={{ actions: [ - + = (props) => { setCurrentRow(undefined); }} destroyOnClose - bodyStyle={{backgroundColor: "#f9f9f9", padding: 16}} + bodyStyle={{ backgroundColor: "#f9f9f9", padding: 16 }} closable={false} > @@ -378,6 +379,6 @@ const abnormalAudit: React.FC<{ currentUser: CurrentUser}> = (props) => { ) } -export default connect(({user}: ConnectState) => ({ +export default connect(({ user }: ConnectState) => ({ currentUser: user.currentUser }))(abnormalAudit); diff --git a/src/pages/reports/productControl/NewProductApproval/index.tsx b/src/pages/reports/productControl/NewProductApproval/index.tsx index cfb1a82..4a35fbe 100644 --- a/src/pages/reports/productControl/NewProductApproval/index.tsx +++ b/src/pages/reports/productControl/NewProductApproval/index.tsx @@ -18,6 +18,7 @@ import useRequest from "@ahooksjs/use-request"; 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"; const { Step } = Steps @@ -867,23 +868,26 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props message: "请选择服务区!" }]} request={async () => { - const data = await getServerpartTree(currentUser?.ProvinceCode, currentUser?.CityAuthority, true, true, true) - console.log('data321312', data); + const ServerpartIdsTree = session.get('ServerpartIdsTree') + return ServerpartIdsTree - 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 + // 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={{ diff --git a/src/pages/reports/productControl/ProductChangeInfoApproval/index.tsx b/src/pages/reports/productControl/ProductChangeInfoApproval/index.tsx index 65be801..9c64956 100644 --- a/src/pages/reports/productControl/ProductChangeInfoApproval/index.tsx +++ b/src/pages/reports/productControl/ProductChangeInfoApproval/index.tsx @@ -1028,21 +1028,23 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props message: "请选择服务区!" }]} request={async () => { - 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 + const ServerpartIdsTree = session.get('ServerpartIdsTree') + return ServerpartIdsTree + // 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 }} disabled={currentRow?.BusinessProcess_State > 1000 || (currentRow?.BusinessApproval_ID && currentRow?.ApproveStaff_ID !== currentUser?.ID)} fieldProps={{ @@ -1633,7 +1635,7 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props diff --git a/src/pages/reports/productControl/ProductChangePriceApproval/index.tsx b/src/pages/reports/productControl/ProductChangePriceApproval/index.tsx index d4cb708..238073e 100644 --- a/src/pages/reports/productControl/ProductChangePriceApproval/index.tsx +++ b/src/pages/reports/productControl/ProductChangePriceApproval/index.tsx @@ -1075,21 +1075,23 @@ const ProductChangePriceApproval: React.FC<{ currentUser: CurrentUser }> = (prop message: "请选择服务区!" }]} request={async () => { - 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 + const ServerpartIdsTree = session.get('ServerpartIdsTree') + return ServerpartIdsTree + // 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 }} disabled={currentRow?.BusinessProcess_State > 1000 || (currentRow?.BusinessApproval_ID && currentRow?.ApproveStaff_ID !== currentUser?.ID)} fieldProps={{ diff --git a/src/pages/reports/productControl/commodityInfo/index.tsx b/src/pages/reports/productControl/commodityInfo/index.tsx index d6db5af..9561f97 100644 --- a/src/pages/reports/productControl/commodityInfo/index.tsx +++ b/src/pages/reports/productControl/commodityInfo/index.tsx @@ -1,3 +1,4 @@ +// 商品信息管理 import { connect } from "umi"; import type { CurrentUser } from "umi"; import type { ConnectState } from "@/models/connect"; diff --git a/src/pages/reports/productControl/commoditySearch/index.tsx b/src/pages/reports/productControl/commoditySearch/index.tsx index 4cfb59d..73641db 100644 --- a/src/pages/reports/productControl/commoditySearch/index.tsx +++ b/src/pages/reports/productControl/commoditySearch/index.tsx @@ -1,12 +1,13 @@ -import {connect} from "umi"; -import type {CurrentUser} from "umi"; -import type {ConnectState} from "@/models/connect"; -import React, {useRef, useState} from "react"; +// 商品信息查询 +import { connect } from "umi"; +import type { CurrentUser } from "umi"; +import type { ConnectState } from "@/models/connect"; +import React, { useRef, useState } from "react"; import ProCard from "@ant-design/pro-card"; -import {MenuFoldOutlined} from "@ant-design/icons"; -import type { FormInstance} from "antd"; -import {Col, Drawer, Row} from "antd"; -import {Avatar, Button, Menu, message, Modal, Popconfirm, Space, Spin, Tree} from "antd"; +import { MenuFoldOutlined } from "@ant-design/icons"; +import type { FormInstance } from "antd"; +import { Col, Drawer, Row } from "antd"; +import { Avatar, Button, Menu, message, Modal, Popconfirm, Space, Spin, Tree } from "antd"; import useRequest from "@ahooksjs/use-request"; import { getFieldEnum, @@ -15,7 +16,7 @@ import { getServerpartTree, handleCallLogs } from "@/services/options"; -import type {ActionType} from "@ant-design/pro-table"; +import type { ActionType } from "@ant-design/pro-table"; import ProTable from "@ant-design/pro-table"; import ReactHTMLTableToExcel from "react-html-table-to-excel"; import SubMenu from "antd/lib/menu/SubMenu"; @@ -24,26 +25,27 @@ import { handleGetCommodityList, handleGetNestingCOMMODITYTYPETree, handleSynchroCOMMODITY } from "@/pages/reports/productControl/commodityInfo/service"; -import ProForm, {ProFormDateTimePicker, ProFormDigit, ProFormSelect, ProFormText, ProFormTextArea, ProFormTreeSelect} from "@ant-design/pro-form"; +import ProForm, { ProFormDateTimePicker, ProFormDigit, ProFormSelect, ProFormText, ProFormTextArea, ProFormTreeSelect } from "@ant-design/pro-form"; import moment from "moment"; import session from "@/utils/session"; import './style.less' import Detail from "@/pages/reports/productControl/components/detail"; import PageTitleBox from "@/components/PageTitleBox"; -const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => { +const commoditySearch: React.FC<{ currentUser: CurrentUser }> = (props) => { const { currentUser } = props const downloadBtnRef = useRef() const actionRef = useRef(); const formRef = useRef(); const modalFormRef = useRef(); - const [currentRow,setCurrentRow] = useState() + const [currentRow, setCurrentRow] = useState() const [reqDetailList, setReqDetailList] = useState(); // 合计项数据源 const [printOut, setPrintOut] = useState(); // 打印数据的内容 const [collapsible, setCollapsible] = useState(false) - const [treeView,setTreeView] = useState() - const [allTotal,setAllTotal] = useState(20) + const [treeView, setTreeView] = useState() + const [allTreeView, setAllTreeView] = useState() + const [allTotal, setAllTotal] = useState(20) // 加载服务区树 const { loading: treeLoading, data: treeViews } = useRequest(async () => { const req = { @@ -52,35 +54,45 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => { ShowCode: true } const data = await handleGetNestingCOMMODITYTYPETree(req) - console.log('data',data) - setTreeView(data) + let list: any = data + if (currentUser?.ProvinceCode === '734100') { + list.unshift({ + label: "全部", + value: 999999, + key: '1-999999', + type: 1 + }) + console.log('listlistlistlist', list); + } + setTreeView(list) + setAllTreeView(list) return data }) -// 树相关的属性和方法 + // 树相关的属性和方法 const [selectedId, setSelectedId] = useState() -// 导出的加载效果 - const [showLoading,setShowLoading] = useState(false) + // 导出的加载效果 + const [showLoading, setShowLoading] = useState(false) // 是否显示打印的表格 - const [showExportTable,setShowExportTable] = useState(false) + const [showExportTable, setShowExportTable] = useState(false) const [currenMenu, setCurrenMenu] = useState(); // 当前选中左侧菜单的服务区节点 - const [showModal,setShowModal] = useState(false) + const [showModal, setShowModal] = useState(false) - const [showDetail,setShowDetail] = useState(false) + const [showDetail, setShowDetail] = useState(false) const ServerpartIdsList: any = session.get('ServerpartIdsList') - const {loading: CommodityLoading,data: CommodityData} = useRequest(async()=>{ + const { loading: CommodityLoading, data: CommodityData } = useRequest(async () => { const data = await getFieldEnumTree({ FieldExplainField: 'CommodityTypeIds' }) const obj: any = {} - if (data && data.length>0){ - data.forEach((item: any)=>{ + if (data && data.length > 0) { + data.forEach((item: any) => { obj[item.value] = item.label - if (item.children && item.children.length>0){ - item.children.forEach((subItem: any)=>{ + if (item.children && item.children.length > 0) { + item.children.forEach((subItem: any) => { obj[subItem.value] = subItem.label - if (subItem.children && subItem.children.length>0){ - subItem.children.forEach((thirdItem: any)=>{ + if (subItem.children && subItem.children.length > 0) { + subItem.children.forEach((thirdItem: any) => { obj[thirdItem.value] = thirdItem.label }) } @@ -93,56 +105,58 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => { const columns: any = [ { - title:'状态', + title: '状态', dataIndex: 'COMMODITY_STATE', hideInTable: true, valueType: 'select', - valueEnum:{ - 0:{text:'无效'}, - 1:{text:'有效'} + valueEnum: { + 0: { text: '无效' }, + 1: { text: '有效' } }, initialValue: '1' }, { - title:'服务区', + title: '服务区', dataIndex: 'ServerpartID', valueType: 'select', hideInTable: true, - request:async ()=>{ - const data = await getServerpartOption(340000) - return data + request: async () => { + // const data = await getServerpartOption(currentUser?.ProvinceCode) + // console.log('datadatadatadata', data); + const serverpartList: any = session.get('serverpartList') + return serverpartList }, - fieldProps:{ + fieldProps: { showSearch: true, - filterOption:(input, option) => (option?.label ?? '').toLowerCase().includes(input.toLowerCase()), + filterOption: (input, option) => (option?.label ?? '').toLowerCase().includes(input.toLowerCase()), } }, { - title:
序号
, + title:
序号
, width: 70, - dataIndex:'index', + dataIndex: 'index', hideInSearch: true, - valueType:'index' + valueType: 'index' }, { - title:
服务区
, + title:
服务区
, width: 150, ellipsis: true, - align:'center', + align: 'center', dataIndex: 'SERVERPART_NAME', hideInSearch: true, - render:(_,record)=>{ + render: (_, record) => { return {record?.SERVERPART_ID ? ServerpartIdsList[record?.SERVERPART_ID] : '-'} } }, { - title:
商品业态
, + title:
商品业态
, width: 120, ellipsis: true, dataIndex: 'BUSINESSTYPE', - align:'center', + align: 'center', hideInSearch: true, valueType: 'select', request: async () => { @@ -151,23 +165,23 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => { } }, { - title:
商品类型
, + title:
商品类型
, width: 120, ellipsis: true, dataIndex: 'COMMODITY_TYPE', - align:'center', + align: 'center', hideInSearch: true, valueEnum: CommodityData }, { - title:
商品名称
, + title:
商品名称
, width: 200, ellipsis: true, - align:'left', + align: 'left', dataIndex: 'COMMODITY_NAME', hideInSearch: true, - render:(_,record)=>{ - return { + render: (_, record) => { + return { setCurrentRow(record) setShowDetail(true) }}> @@ -176,51 +190,51 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => { } }, { - title:
商品条码
, + title:
商品条码
, width: 150, ellipsis: true, - align:'left', + align: 'left', dataIndex: 'COMMODITY_BARCODE', hideInSearch: true, }, { - title:
零售价
, + title:
零售价
, width: 70, ellipsis: true, - align:'right', + align: 'right', dataIndex: 'COMMODITY_RETAILPRICE', hideInSearch: true, }, { - title:
进货价
, + title:
进货价
, width: 70, ellipsis: true, - align:'right', + align: 'right', dataIndex: 'COMMODITY_PURCHASEPRICE', hideInSearch: true, }, { - title:
商品单位
, + title:
商品单位
, width: 80, ellipsis: true, - align:'right', + align: 'right', dataIndex: 'COMMODITY_UNIT', hideInSearch: true, }, { - title:
状态
, + title:
状态
, width: 100, ellipsis: true, dataIndex: 'COMMODITY_STATE', hideInSearch: true, - align:'center', + align: 'center', valueType: 'select', valueEnum: { 0: { text: '无效', status: 'error' }, 1: { text: '有效', status: 'success' }, 2: { text: '不可选', status: 'default' } }, }, { - title:
审核时间
, + title:
审核时间
, width: 150, - align:'center', + align: 'center', ellipsis: true, dataIndex: 'OPERATE_DATE', hideInSearch: true, @@ -228,42 +242,42 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => { ] // 查询的条件 - const [searchParams,setSearchParams] = useState() + const [searchParams, setSearchParams] = useState() const getMenuDom = (data: any[], callback: (item: any) => void) => { return (data.map((element: any) => { // 绑定嵌套树的子节点 if (element.children && element.children.length > 0) { return ( {element.label}
} - icon={element.ico ? : null} - key={`${element.key || element.value}`} - onTitleClick={(item) => { - // 选中一级菜单 - if (!currenMenu || item.key !== `${currenMenu?.key}`) { - callback.call(callback, item) - } - item.domEvent.stopPropagation(); - }} + icon={element.ico ? : null} + key={`${element.key || element.value}`} + onTitleClick={(item) => { + // 选中一级菜单 + if (!currenMenu || item.key !== `${currenMenu?.key}`) { + callback.call(callback, item) + } + item.domEvent.stopPropagation(); + }} > {element.children && element.children.length > 0 && getMenuDom(element.children, callback)} ) } return ( : null} - key={`${element.key || element.value}`}>{element.desc && element.desc !== '0/0' ? <>{element.label} - - [{element.desc.split('/')[0]}/{element.desc.split('/')[1]}] : element.label}) + key={`${element.key || element.value}`}>{element.desc && element.desc !== '0/0' ? <>{element.label} + + [{element.desc.split('/')[0]}/{element.desc.split('/')[1]}] : element.label}) })) } const loadSelectedId = (item?: any) => { - console.log('item',item) + console.log('item', item) // 选中的子菜单key const [type, value] = item.key.split('-') if (type === '1') { setCurrenMenu(value) // actionRef?.current?.reload() - } else{ + } else { setCurrenMenu('') } } @@ -320,13 +334,13 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => { borderRadius: '8px', width: '200px' }}> - - 数据导出中... + + 数据导出中...
: '' } -
+
{ showExportTable && reqDetailList && reqDetailList.length > 0 ? = (props) => { /> : '' }
-
+
-
+
{ setCollapsible(!collapsible) - }}/>} + }} />} colSpan={!collapsible ? "300px" : "60px"} title={!collapsible ? "请选择服务区" : ""} headerBordered @@ -359,7 +373,7 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => { style={{ height: 'calc(100vh - 220px)', overflowY: 'auto', overflowX: 'hidden' }} selectedKeys={`1-${currenMenu}`} onSelect={(item) => { - console.log('item',item) + console.log('item', item) loadSelectedId(item) }} > @@ -367,7 +381,7 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => { }
= (props) => { formRef={formRef} columns={columns} bordered + scroll={{ x: '100%', y: 'calc(100vh - 450px)' }} headerTitle={} - search={{span: 6}} + search={{ span: 6 }} pagination={{ // defaultPageSize: 20, // total: allTotal || 20 }} - request={async(params)=>{ - if (!currenMenu){ + request={async (params) => { + if (!currenMenu) { return } const req: any = { SearchType: 3, ProvinceCode: currentUser?.USER_PROVINCE, - CommodityTypeId: currenMenu, + CommodityTypeId: currenMenu === '999999' ? '' : currenMenu, CommodityState: params?.COMMODITY_STATE, ServerpartID: params?.ServerpartID, PageIndex: 1, @@ -399,17 +414,17 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => { } handleCallLogs() const data = await handleGetCommodityList(req) - if (data.List && data.List.length>0){ - console.log('data',data) + if (data.List && data.List.length > 0) { + console.log('data', data) // setAllTotal(data.TotalCount) setReqDetailList(data.List) - return { data: data.List,success: true} + return { data: data.List, success: true } } - return {data: [],success: true} + return { data: [], success: true } }} toolbar={{ actions: [ - + = (props) => { destroyOnClose title={'商品详情'} footer={false} - onCancel={()=>{ + onCancel={() => { setCurrentRow(undefined) setShowModal(false) }} @@ -497,12 +512,12 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => { data.forEach((item: any) => { if (item.children && item.children.length > 0) { item.children.forEach((subItem: any) => { - list.push({label: subItem.label, value: subItem.value}) + list.push({ label: subItem.label, value: subItem.value }) }) } }) data.forEach((item: any) => { - list.push({label: item.label, value: item.value}) + list.push({ label: item.label, value: item.value }) }) } return list @@ -526,7 +541,7 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => { message: '请选择商品业态', }, ]} - request={async ()=>{ + request={async () => { const BUSINESSTYPEList = await getFieldEnum({ FieldExplainField: 'BUSINESSTYPE' }) return BUSINESSTYPEList }} @@ -545,18 +560,18 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => { ]} request={async () => { const list: any = [] - if (treeView && treeView.length>0){ - treeView.forEach((item: any)=>{ + if (treeView && treeView.length > 0) { + treeView.forEach((item: any) => { item.disabled = true - if (item.children && item.children.length>0){ - item.children.forEach((subItem: any)=>{ + if (item.children && item.children.length > 0) { + item.children.forEach((subItem: any) => { subItem.disabled = true }) } }) - console.log('treeView',treeView) - treeView.forEach((item: any)=>{ - if (item.value>=885 && item.value<=891){ + console.log('treeView', treeView) + treeView.forEach((item: any) => { + if (item.value >= 885 && item.value <= 891) { list.push(item) } }) @@ -622,7 +637,7 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => { }, ]} initialValue={1000} - options={[{label:'一等品',value:1000},{label:'二等品',value:2000},{label:'三等品',value:5000},{label:'优等品',value:3000},{label:'合格品',value:4000},]} + options={[{ label: '一等品', value: 1000 }, { label: '二等品', value: 2000 }, { label: '三等品', value: 5000 }, { label: '优等品', value: 3000 }, { label: '合格品', value: 4000 },]} /> @@ -686,7 +701,7 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => { }, ]} initialValue={1} - options={[{label:'是',value:1},{label:'否',value:0}]} + options={[{ label: '是', value: 1 }, { label: '否', value: 0 }]} /> @@ -701,7 +716,7 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => { }, ]} initialValue={0} - options={[{label:'是',value:1},{label:'否',value:0}]} + options={[{ label: '是', value: 1 }, { label: '否', value: 0 }]} /> @@ -716,7 +731,7 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => { }, ]} initialValue={1} - options={[{label:'计价',value:1},{label:'散装称重',value:0}]} + options={[{ label: '计价', value: 1 }, { label: '散装称重', value: 0 }]} /> @@ -733,7 +748,7 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => { }, ]} initialValue={1} - options={[{label:'有效',value:1},{label:'审核中',value:2},{label:'无效',value:0}]} + options={[{ label: '有效', value: 1 }, { label: '审核中', value: 2 }, { label: '无效', value: 0 }]} /> @@ -844,7 +859,7 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => { name="COMMODITY_FROZENCOUNT" label="采购状态" readonly - options={[{label:'允许',value:1000},{label:'禁止',value:2000}]} + options={[{ label: '允许', value: 1000 }, { label: '禁止', value: 2000 }]} /> @@ -855,20 +870,20 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => { { + onClose={() => { setCurrentRow(undefined) setShowDetail(false) }} closable={false} destroyOnClose > - +
) } -export default connect(({user}: ConnectState) => ({ +export default connect(({ user }: ConnectState) => ({ currentUser: user.currentUser }))(commoditySearch); diff --git a/src/pages/reports/productControl/shopCommodity/index.tsx b/src/pages/reports/productControl/shopCommodity/index.tsx index caa5e76..208c2d7 100644 --- a/src/pages/reports/productControl/shopCommodity/index.tsx +++ b/src/pages/reports/productControl/shopCommodity/index.tsx @@ -34,7 +34,8 @@ const shopCommodity: React.FC<{ currentUser: CurrentUser }> = (props) => { const [treeView, setTreeView] = useState() // 加载服务区树 const { loading: treeLoading, data: treeViews } = useRequest(async () => { - const data = await getSPRegionShopTree(currentUser?.ProvinceCode, '', '', '', '1000,2000,3000', '2000,3000,4000', true, false, true, 'SERVERPARTSHOP_INDEX,BUSINESS_STATE,SHOPSHORTNAME', false, true); + // 734100 是建工 他要显示多一点 + const data = await getSPRegionShopTree(currentUser?.ProvinceCode, '', '', '', '1000,2000,3000', currentUser?.ProvinceCode === '734100' ? '' : '2000,3000,4000', true, true, true, 'SERVERPARTSHOP_INDEX,BUSINESS_STATE,SHOPSHORTNAME', false, true); setTreeView(data) console.log('data222', data) return data diff --git a/src/services/options/index.ts b/src/services/options/index.ts index af082c2..539f7a0 100644 --- a/src/services/options/index.ts +++ b/src/services/options/index.ts @@ -235,7 +235,7 @@ export async function getServerpartTree(ProvinceCode?: number | string, Serverpa const data = await request(`/BaseInfo/GetServerpartTree? ProvinceCode=${ProvinceCode || ''}&ServerpartCodes=${ServerpartCodes || ''}& ShowWholePower=${ShowWholePower || false}&ShowWholePower=${ShowSPRegion || true}& - ShowRoyalty=${false}&ShowCompactCount=${ShowCompactCount || false}&StatisticsType=${StatisticsType || ''}`, { + ShowRoyalty=${ShowRoyalty}&ShowCompactCount=${ShowCompactCount || false}&StatisticsType=${StatisticsType || ''}`, { method: 'GET', }); diff --git a/src/versionEnv.ts b/src/versionEnv.ts index 54858ae..e12da49 100644 --- a/src/versionEnv.ts +++ b/src/versionEnv.ts @@ -1,4 +1,4 @@ // 由 scripts/writeVersion.js 自动生成 -export const VERSION = "4.5.35"; -export const GIT_HASH = "1ce314d"; -export const BUILD_TIME = "2025-08-21T11:03:22.048Z"; +export const VERSION = "4.5.36"; +export const GIT_HASH = "e03ffe4"; +export const BUILD_TIME = "2025-08-22T10:43:11.324Z";