This commit is contained in:
ylj20011123 2025-08-22 19:39:48 +08:00
parent e03ffe4902
commit 9fb0245d17
14 changed files with 529 additions and 465 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "ant-design-pro", "name": "ant-design-pro",
"version": "4.5.35", "version": "4.5.36",
"private": true, "private": true,
"description": "An out-of-box UI solution for enterprise applications", "description": "An out-of-box UI solution for enterprise applications",
"scripts": { "scripts": {

View File

@ -206,7 +206,7 @@ const CommoditysaleTable: React.FC<{ currentUser: CurrentUser | undefined }> = (
...params, ...params,
SERVERPARTSHOP_ID: shopId && shopId.length > 0 ? shopId.toString() : currentUser?.ServerpartShopIds, SERVERPARTSHOP_ID: shopId && shopId.length > 0 ? shopId.toString() : currentUser?.ServerpartShopIds,
}); });
setReqDetailList(data.data); setReqDetailList(data.List);
console.log('data', data); console.log('data', data);
const list: any = JSON.parse(JSON.stringify(data.List)) const list: any = JSON.parse(JSON.stringify(data.List))
if (list && list.length > 0) { if (list && list.length > 0) {
@ -346,7 +346,6 @@ const CommoditysaleTable: React.FC<{ currentUser: CurrentUser | undefined }> = (
} }
onRow={(record) => { onRow={(record) => {
return { return {
onClick: () => { onClick: () => {
setCurrentRow(record) setCurrentRow(record)
setVisible(true) setVisible(true)

View File

@ -11,7 +11,7 @@ import type { CurrentUser } from "umi";
import type { ConnectState } from "@/models/connect"; import type { ConnectState } from "@/models/connect";
import React, { useRef, useState } from "react"; import React, { useRef, useState } from "react";
import ProCard from "@ant-design/pro-card"; 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 { Col, Divider, FormInstance, Modal, Row } from "antd";
import { Button, message, Space, Spin, Tree } from "antd"; import { Button, message, Space, Spin, Tree } from "antd";
import useRequest from "@ahooksjs/use-request"; 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 ProForm, { ProFormCheckbox, ProFormRadio, ProFormSelect, ProFormText } from "@ant-design/pro-form";
import { handleGetCASHWORKERDetail, handleGetCASHWORKERList, handleGetServerpartShopList, handleSynchroCASHWORKER } from "./service"; import { handleGetCASHWORKERDetail, handleGetCASHWORKERList, handleGetServerpartShopList, handleSynchroCASHWORKER } from "./service";
import PageTitleBox from "@/components/PageTitleBox"; import PageTitleBox from "@/components/PageTitleBox";
import session from "@/utils/session";
import { handleNewGetSERVERPARTDetail } from "../service";
const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) => { const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) => {
@ -55,7 +57,7 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) =>
// 关联门店悬浮框 // 关联门店悬浮框
const [relatedShop, setRelatedShop] = useState<any>() const [relatedShop, setRelatedShop] = useState<any>()
// 选择的门店id数组 // 选择的门店id数组
const [selectShop,setSelectShop] = useState<any>() const [selectShop, setSelectShop] = useState<any>()
const { loading: PROWERSETLoading, data: PROWERSET } = useRequest(async () => { const { loading: PROWERSETLoading, data: PROWERSET } = useRequest(async () => {
const data = await getFieldEnum({ FieldExplainField: 'PROWERSET' }) const data = await getFieldEnum({ FieldExplainField: 'PROWERSET' })
@ -273,10 +275,10 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) =>
} }
const data = await handleGetCASHWORKERList(req) const data = await handleGetCASHWORKERList(req)
if (data && data.length > 0) { if (data && data.length > 0) {
console.log('data',data); console.log('data', data);
let res = JSON.parse(JSON.stringify(data)) let res = JSON.parse(JSON.stringify(data))
let list: any = [] let list: any = []
data.forEach((item: any)=>{ data.forEach((item: any) => {
item.CASHWORKER_LOGINNAME = `"${item.CASHWORKER_LOGINNAME}"` item.CASHWORKER_LOGINNAME = `"${item.CASHWORKER_LOGINNAME}"`
item.CASHWORKER_LOGINPWD = `"${item.CASHWORKER_LOGINPWD}"` item.CASHWORKER_LOGINPWD = `"${item.CASHWORKER_LOGINPWD}"`
list.push(item) list.push(item)
@ -316,7 +318,10 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) =>
}} }}
> >
excel excel
</Button> </Button>,
<Button icon={<PlusOutlined />} type={"primary"} onClick={() => {
setEditModal(true)
}}></Button>
] ]
}} }}
/> />
@ -331,7 +336,6 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) =>
open={editModal} open={editModal}
footer={null} footer={null}
destroyOnClose={true} destroyOnClose={true}
onCancel={() => { onCancel={() => {
setEditModal(false) setEditModal(false)
setCurrentRow(undefined) setCurrentRow(undefined)
@ -339,13 +343,19 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) =>
}} }}
footer={<div style={{ width: '100%', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}> footer={<div style={{ width: '100%', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
<div> <div>
<Button type='primary' onClick={() => { {/* <Button type='primary' onClick={() => {
setRelatedShop(true) setRelatedShop(true)
}}></Button> }}></Button> */}
</div> </div>
<div> <div>
<Button type='primary' style={{ marginRight: '16px' }} onClick={() => { <Button type='primary' style={{ marginRight: '16px' }} onClick={() => {
editFormRef.current?.validateFields().then(async (res) => { editFormRef.current?.validateFields().then(async (res) => {
// 根据当前的服务区 去拿个code
const code = await handleNewGetSERVERPARTDetail({ SERVERPARTId: res.SERVERPART_ID })
console.log('codecodecodecode', code);
let SERVERPART_CODE = code.SERVERPART_CODE
// 255个0 // 255个0
let defaultAuthor: string = "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" let defaultAuthor: string = "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
console.log('personDetail', personDetail); console.log('personDetail', personDetail);
@ -360,10 +370,22 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) =>
actionRef.current?.reload() actionRef.current?.reload()
}) })
} }
const req: any = { let req: any = {}
...personDetail, if (currentRow?.CASHWORKER_ID) {
WORKER_OTHER: defaultAuthor req = {
...res,
WORKER_OTHER: defaultAuthor,
SERVERPART_CODE: SERVERPART_CODE
} }
} else {
req = {
...personDetail,
...res,
WORKER_OTHER: defaultAuthor,
SERVERPART_CODE: SERVERPART_CODE
}
}
const data = await handleSynchroCASHWORKER(req) const data = await handleSynchroCASHWORKER(req)
console.log('data', data); console.log('data', data);
if (data.Result_Code === 100) { if (data.Result_Code === 100) {
@ -371,6 +393,8 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) =>
setEditModal(false) setEditModal(false)
setCurrentRow(undefined) setCurrentRow(undefined)
setPersonDetail(undefined) setPersonDetail(undefined)
actionRef.current?.reload()
} else { } else {
message.error(data.Result_Desc) message.error(data.Result_Desc)
} }
@ -388,7 +412,7 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) =>
formRef={editFormRef} formRef={editFormRef}
request={async () => { request={async () => {
console.log('currentRow', currentRow); console.log('currentRow', currentRow);
if (currentRow?.CASHWORKER_ID) {
const req: any = { const req: any = {
CASHWORKERId: currentRow?.CASHWORKER_ID CASHWORKERId: currentRow?.CASHWORKER_ID
} }
@ -414,6 +438,11 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) =>
...data, ...data,
WORKER_OTHER: author WORKER_OTHER: author
} }
} else {
return {
WORKER_VALID: 1
}
}
}} }}
submitter={{ submitter={{
render: (props, doms) => { render: (props, doms) => {
@ -422,6 +451,19 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) =>
}} }}
> >
<Row gutter={18}> <Row gutter={18}>
<Col span={12}>
<ProFormText
label='人员名称'
name="CASHWORKER_NAME"
rules={[
{
required: true,
message: '请输入人员名称',
},
]}
/>
</Col>
<Col span={12}> <Col span={12}>
<ProFormSelect <ProFormSelect
label='人员类别' label='人员类别'
@ -437,32 +479,18 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) =>
rules={[ rules={[
{ {
required: true, required: true,
message: '请输入名称', message: '请选择人员类别',
}, },
]} ]}
/> />
</Col> </Col>
<Col span={12}> <Col span={12}>
<ProFormText <ProFormText
disabled disabled={currentRow?.CASHWORKER_ID}
label="人员账号" label="人员账号"
name="CASHWORKER_LOGINNAME" name="CASHWORKER_LOGINNAME"
/> />
</Col> </Col>
</Row>
<Row gutter={18}>
<Col span={12}>
<ProFormText
label='人员名称'
name="CASHWORKER_NAME"
rules={[
{
required: true,
message: '请输入名称',
},
]}
/>
</Col>
<Col span={12}> <Col span={12}>
<ProFormText <ProFormText
label="人员密码" label="人员密码"
@ -470,13 +498,27 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) =>
rules={[ rules={[
{ {
required: true, required: true,
message: '请输入名称', message: '请输入人员密码',
},
]}
/>
</Col>
<Col span={12}>
<ProFormSelect
label='服务区'
name="SERVERPART_ID"
request={() => {
let serverpartList = session.get('ServerpartIdsTree')
return serverpartList
}}
rules={[
{
required: true,
message: '请选择服务区',
}, },
]} ]}
/> />
</Col> </Col>
</Row>
<Row gutter={18}>
<Col span={12}> <Col span={12}>
<ProFormSelect <ProFormSelect
label='人员状态' label='人员状态'
@ -491,7 +533,7 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) =>
rules={[ rules={[
{ {
required: true, required: true,
message: '请输入名称', message: '请选择人员状态',
}, },
]} ]}
/> />
@ -599,7 +641,7 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) =>
setSelectShop(undefined) setSelectShop(undefined)
}} }}
footer={ footer={
<div style={{width:'100%',display:'flex',justifyContent:'flex-end'}}> <div style={{ width: '100%', display: 'flex', justifyContent: 'flex-end' }}>
<Button type={'primary'}></Button> <Button type={'primary'}></Button>
</div> </div>
} }
@ -607,17 +649,20 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) =>
<ProTable <ProTable
actionRef={realteActionRef} actionRef={realteActionRef}
columns={relateColumns} columns={relateColumns}
rowKey={(record)=>{ rowKey={(record) => {
return `${record?.SERVERPARTSHOP_ID}` return `${record?.SERVERPARTSHOP_ID}`
}} }}
request={async () => { request={async () => {
if (!currentRow?.SERVERPART_ID) { let id: string = ''
return if (!currentRow?.CASHWORKER_ID) {
let formRef: any = editFormRef.current?.getFieldsValue()
console.log('formRefformRefformRef', formRef);
id = formRef.SERVERPART_ID
} }
const req: any = { const req: any = {
SearchParameter: { SearchParameter: {
ISVALID: 1, 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"
}, },
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 } return { data: [], success: true }
}} }}
headerTitle={`当前收银员为【${currentRow?.CASHWORKER_NAME}`} headerTitle={`当前收银员为【${currentRow?.CASHWORKER_NAME || ""}`}
pagination={false} pagination={false}
scroll={{ y: 400 }} scroll={{ y: 400 }}
rowSelection={{ rowSelection={{
onChange: (selectedRowKeys, selectedRows) => { // 选中行时 存储选中的行数据 onChange: (selectedRowKeys, selectedRows) => { // 选中行时 存储选中的行数据
console.log('selectedRowKeys',selectedRowKeys); console.log('selectedRowKeys', selectedRowKeys);
console.log('selectedRows',selectedRows); console.log('selectedRows', selectedRows);
setSelectShop(selectedRowKeys) setSelectShop(selectedRowKeys)
}, },
defaultSelectedRowKeys: selectShop defaultSelectedRowKeys: selectShop

View File

@ -4,7 +4,7 @@ import request from "@/utils/request";
export async function handleGetCASHWORKERList(params?: any) { export async function handleGetCASHWORKERList(params?: any) {
const data = await request(`/BaseInfo/GetCASHWORKERList`, { const data = await request(`/BaseInfo/GetCASHWORKERList`, {
method: 'POST', method: 'POST',
data:params data: params
}); });
if (data.Result_Code !== 100) { if (data.Result_Code !== 100) {
@ -49,13 +49,7 @@ export async function handleSynchroCASHWORKER(params?: any) {
}); });
if (data.Result_Code !== 100) { if (data.Result_Code !== 100) {
return { return data
data: [],
current: 1,
pageSize: 10,
total: 0,
success: false
}
} }
return data; return data;

View File

@ -1,18 +1,18 @@
import {connect} from "umi"; import { connect } from "umi";
import type {CurrentUser} from "umi"; import type { CurrentUser } from "umi";
import type {ConnectState} from "@/models/connect"; import type { ConnectState } from "@/models/connect";
import React, {useRef, useState} from "react"; import React, { useRef, useState } from "react";
import ProCard from "@ant-design/pro-card"; import ProCard from "@ant-design/pro-card";
import {MenuFoldOutlined} from "@ant-design/icons"; import { MenuFoldOutlined } from "@ant-design/icons";
import type { FormInstance} from "antd"; import type { FormInstance } from "antd";
import {Drawer} from "antd"; import { Drawer } from "antd";
import { Select} from "antd"; import { Select } from "antd";
import {Button, message, Space, Spin, Tree} from "antd"; import { Button, message, Space, Spin, Tree } from "antd";
import useRequest from "@ahooksjs/use-request"; import useRequest from "@ahooksjs/use-request";
import {getFieldEnum, getMoney, getServerpartTree, handleCallLogs} from "@/services/options"; import { getFieldEnum, getMoney, 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 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 moment from "moment";
import session from "@/utils/session"; import session from "@/utils/session";
import { import {
@ -24,11 +24,11 @@ import * as numeral from "numeral";
import { import {
handleGetShopShortNamesGet handleGetShopShortNamesGet
} from "@/pages/reports/BusinessAnalysis/transactionAnalysis/service"; } 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"; import PageTitleBox from "@/components/PageTitleBox";
const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => { const transactionAnalysis: React.FC<{ currentUser: CurrentUser }> = (props) => {
const { currentUser } = props const { currentUser } = props
const downloadBtnRef = useRef<any>() const downloadBtnRef = useRef<any>()
@ -39,45 +39,45 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => {
const [reqDetailList, setReqDetailList] = useState<any>(); // 合计项数据源 const [reqDetailList, setReqDetailList] = useState<any>(); // 合计项数据源
const [printOut, setPrintOut] = useState<any>(); // 打印数据的内容 const [printOut, setPrintOut] = useState<any>(); // 打印数据的内容
const [collapsible, setCollapsible] = useState<boolean>(false) const [collapsible, setCollapsible] = useState<boolean>(false)
const [treeView,setTreeView] = useState<any>() const [treeView, setTreeView] = useState<any>()
// 加载服务区树 // 加载服务区树
const { loading: treeLoading, data: treeViews } = useRequest(async () => { const { loading: treeLoading, data: treeViews } = useRequest(async () => {
const data = await getServerpartTree(currentUser?.ProvinceCode, currentUser?.CityAuthority, true, false, true) const data = await getServerpartTree(currentUser?.ProvinceCode, currentUser?.CityAuthority, true, false, true)
setTreeView(data) setTreeView(data)
return data return data
}) })
// 树相关的属性和方法 // 树相关的属性和方法
const [selectedId, setSelectedId] = useState<string>() const [selectedId, setSelectedId] = useState<string>()
const businessTypeList = session.get("BUSINESSTYPEList") const businessTypeList = session.get("BUSINESSTYPEList")
const businessTypeObj = session.get("BUSINESSTYPEObj") const businessTypeObj = session.get("BUSINESSTYPEObj")
const BUSINESSTYPEObj = session.get('BUSINESSTYPEObj') const BUSINESSTYPEObj = session.get('BUSINESSTYPEObj')
// 判断是不是第一次进入页面 // 判断是不是第一次进入页面
const [isFirst,setIsFirst] = useState<boolean>(true) const [isFirst, setIsFirst] = useState<boolean>(true)
// 导出的加载效果 // 导出的加载效果
const [showLoading,setShowLoading] = useState<boolean>(false) const [showLoading, setShowLoading] = useState<boolean>(false)
// 是否显示打印的表格 // 是否显示打印的表格
const [showExportTable,setShowExportTable] = useState<boolean>(false) const [showExportTable, setShowExportTable] = useState<boolean>(false)
// 查询的条件 // 查询的条件
const [searchParams,setSearchParams] = useState<any>() const [searchParams, setSearchParams] = useState<any>()
// 自营业态的选择列表 // 自营业态的选择列表
const [selfList,setSelfList] = useState<any>() const [selfList, setSelfList] = useState<any>()
const [businessModel,setBusinessModel] = useState<any>() const [businessModel, setBusinessModel] = useState<any>()
// 经营模式 // 经营模式
const [businessType,setBusinessType] = useState<any>() const [businessType, setBusinessType] = useState<any>()
// 展示自营业态 // 展示自营业态
const [showSelfBusiness,setShowSelfBusiness] = useState<boolean>(true) const [showSelfBusiness, setShowSelfBusiness] = useState<boolean>(true)
// 自营业态的选择列表 // 自营业态的选择列表
const [shopNamesList,setShopNamesList] = useState<any>() const [shopNamesList, setShopNamesList] = useState<any>()
const [printIndex,setPrintIndex] = useState<number>(new Date().getTime()) const [printIndex, setPrintIndex] = useState<number>(new Date().getTime())
// 显示每日流水抽屉 // 显示每日流水抽屉
const [showDailyDrawer,setShowDailyDrawer] = useState<boolean>(false) const [showDailyDrawer, setShowDailyDrawer] = useState<boolean>(false)
const [currentRow,setCurrentRow] = useState<any>() const [currentRow, setCurrentRow] = useState<any>()
const {loading: selfLoading,data: self} = useRequest(async ()=>{ const { loading: selfLoading, data: self } = useRequest(async () => {
const data = await handleGetShopShortNames() const data = await handleGetShopShortNames()
if (data && data.length>0){ if (data && data.length > 0) {
const list: any = [] const list: any = []
data.forEach((item: any)=>{ data.forEach((item: any) => {
list.push({label: item,value: item}) list.push({ label: item, value: item })
}) })
return list return list
} }
@ -85,10 +85,10 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => {
const [columnsStateMap, setColumnsStateMap] = useState<any>({ const [columnsStateMap, setColumnsStateMap] = useState<any>({
// Business_Type:{show:false}, // Business_Type:{show:false},
ShopTrade:{show:false} ShopTrade: { show: false }
}) })
const [columnsDailyStateMap, setColumnsDailyStateMap] = useState<any>({ const [columnsDailyStateMap, setColumnsDailyStateMap] = useState<any>({
ShopTrade:{show:false} ShopTrade: { show: false }
}) })
const columns: any = [ const columns: any = [
{ {
@ -111,21 +111,21 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => {
} }
}, },
{ {
title:'经营模式', title: '经营模式',
dataIndex:'businessType', dataIndex: 'businessType',
valueType:'select', valueType: 'select',
hideInTable: true, hideInTable: true,
valueEnum: BUSINESSTYPEObj, valueEnum: BUSINESSTYPEObj,
fieldProps:{ fieldProps: {
mode: "multiple", mode: "multiple",
onChange:async (e)=>{ onChange: async (e) => {
console.log('e',e) console.log('e', e)
const flag = e.filter(item=>item==='1000')?.toString() || '' const flag = e.filter(item => item === '1000')?.toString() || ''
console.log('flag',flag) console.log('flag', flag)
if (flag){ if (flag) {
setShowSelfBusiness(false) setShowSelfBusiness(false)
// handleGetShopNamesList(selectedId) // handleGetShopNamesList(selectedId)
}else{ } else {
setShowSelfBusiness(true) setShowSelfBusiness(true)
// setShopNamesList({}) // setShopNamesList({})
} }
@ -133,46 +133,46 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => {
} }
}, },
{ {
title:'自营业态', title: '自营业态',
dataIndex:'shopNames', dataIndex: 'shopNames',
hideInTable: true, hideInTable: true,
hideInSearch: showSelfBusiness, hideInSearch: showSelfBusiness,
valueType: 'select', valueType: 'select',
valueEnum:shopNamesList, valueEnum: shopNamesList,
// request: async () => { // request: async () => {
// return await getFieldEnum({ FieldExplainField: 'BUSINESSTYPE' }) // return await getFieldEnum({ FieldExplainField: 'BUSINESSTYPE' })
// }, // },
fieldProps:{ fieldProps: {
multiple: true, multiple: true,
showSearch: true, showSearch: true,
filterOption:(input, option) => (option?.label ?? '').toLowerCase().includes(input.toLowerCase()), filterOption: (input, option) => (option?.label ?? '').toLowerCase().includes(input.toLowerCase()),
} }
}, },
{ {
title:'外接系统', title: '外接系统',
dataIndex:'targetSystem', dataIndex: 'targetSystem',
valueType: 'select', valueType: 'select',
hideInTable: true, hideInTable: true,
valueEnum:{ valueEnum: {
"":'全部', "": '全部',
1:"是", 1: "是",
0:"否" 0: "否"
}, },
initialValue: "" initialValue: ""
}, },
{ {
title:'', title: '',
dataIndex:'SearchKeyValue', dataIndex: 'SearchKeyValue',
hideInTable: true, hideInTable: true,
fieldProps:{ fieldProps: {
placeholder: "请输入商户/品牌/门店/服务区" placeholder: "请输入商户/品牌/门店/服务区"
} }
}, },
{ {
title:'服务区信息', title: '服务区信息',
dataIndex:'', dataIndex: '',
hideInSearch: true, hideInSearch: true,
children:[ children: [
// { // {
// title: '序号', // title: '序号',
// width: 120, // width: 120,
@ -180,22 +180,22 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => {
// dataIndex: 'index' // dataIndex: 'index'
// }, // },
{ {
title:'门店名称', title: '门店名称',
width: 200, width: 200,
hideInSearch: true, hideInSearch: true,
dataIndex:'Name', dataIndex: 'Name',
ellipsis:true, ellipsis: true,
render:(_,record)=>{ render: (_, record) => {
return showDailyDrawer?record?.Name:<a onClick={()=>{ return showDailyDrawer ? record?.Name : <a onClick={() => {
if (record?.Name === '合计'){ if (record?.Name === '合计') {
let id: string = '' let id: string = ''
if (record?.children && record?.children.length>0){ if (record?.children && record?.children.length > 0) {
record?.children.forEach((item: any)=>{ record?.children.forEach((item: any) => {
if (item?.children && item?.children.length>0){ if (item?.children && item?.children.length > 0) {
item?.children.forEach((subItem: any)=>{ item?.children.forEach((subItem: any) => {
if (id){ if (id) {
id +=`,${subItem.Id}` id += `,${subItem.Id}`
}else{ } else {
id = subItem.Id id = subItem.Id
} }
}) })
@ -207,13 +207,13 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => {
Id: id Id: id
}) })
} }
else if(record?.Name && record?.Name.indexOf('管理中心')!==-1){ else if (record?.Name && record?.Name.indexOf('管理中心') !== -1) {
let id: string = '' let id: string = ''
if (record?.children && record?.children.length>0){ if (record?.children && record?.children.length > 0) {
record?.children.forEach((item: any)=>{ record?.children.forEach((item: any) => {
if (id){ if (id) {
id +=`,${item.Id}` id += `,${item.Id}`
}else{ } else {
id = item.Id id = item.Id
} }
}) })
@ -225,13 +225,13 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => {
ServerpartId: id ServerpartId: id
}) })
} }
else if (record?.Name && record?.Name.indexOf('服务区')!==-1){ else if (record?.Name && record?.Name.indexOf('服务区') !== -1) {
setCurrentRow({ setCurrentRow({
...record, ...record,
ServerpartId: record?.Id, ServerpartId: record?.Id,
ServerpartName: record?.Name, ServerpartName: record?.Name,
}) })
}else{ } else {
setCurrentRow(record) setCurrentRow(record)
} }
setShowDailyDrawer(true) setShowDailyDrawer(true)
@ -241,26 +241,26 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => {
} }
}, },
{ {
title:'门店数量', title: '门店数量',
hideInSearch: true, hideInSearch: true,
valueType: 'digit', valueType: 'digit',
dataIndex:'ShopCount' dataIndex: 'ShopCount'
}, },
{ {
title:'经营模式', title: '经营模式',
width: 150, width: 150,
dataIndex:'Business_Type', dataIndex: 'Business_Type',
valueType: 'select', valueType: 'select',
valueEnum: businessTypeObj, valueEnum: businessTypeObj,
render:(_,record)=>{ render: (_, record) => {
return record.BusinessType?businessTypeObj[record.BusinessType]:'-' return record.BusinessType ? businessTypeObj[record.BusinessType] : '-'
} }
}, },
{ {
title:'经营商户', title: '经营商户',
width: 120, width: 120,
ellipsis: true, ellipsis: true,
dataIndex:'MERCHANTS_NAME', dataIndex: 'MERCHANTS_NAME',
hideInSearch: true, hideInSearch: true,
}, },
{ {
@ -279,45 +279,45 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => {
] ]
}, },
{ {
title:'经营数据', title: '经营数据',
dataIndex:'', dataIndex: '',
hideInSearch: true, hideInSearch: true,
children:[ children: [
{ {
title:'客单数量', title: '客单数量',
hideInSearch: true, hideInSearch: true,
dataIndex:'TicketCount', dataIndex: 'TicketCount',
valueType: 'digit' valueType: 'digit'
}, },
{ {
title:'销售数量', title: '销售数量',
hideInSearch: true, hideInSearch: true,
valueType: 'digit', valueType: 'digit',
dataIndex:'TotalCount' dataIndex: 'TotalCount'
}, },
{ {
title:'销售金额', title: '销售金额',
hideInSearch: true, hideInSearch: true,
valueType: 'digit', valueType: 'digit',
dataIndex:'TotalSellAmount' dataIndex: 'TotalSellAmount'
}, },
{ {
title:'客单均量', title: '客单均量',
hideInSearch: true, hideInSearch: true,
valueType: 'digit', valueType: 'digit',
dataIndex:'AverageCount' dataIndex: 'AverageCount'
}, },
{ {
title:'客单均价', title: '客单均价',
hideInSearch: true, hideInSearch: true,
valueType: 'digit', valueType: 'digit',
dataIndex:'AverageAmount' dataIndex: 'AverageAmount'
}, },
{ {
title:'商品均价', title: '商品均价',
hideInSearch: true, hideInSearch: true,
valueType: 'digit', 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 = { const req: any = {
ProvinceCode: currentUser?.USER_PROVINCE, ProvinceCode: currentUser?.USER_PROVINCE,
BusinessType:1000, BusinessType: 1000,
ServerpartId: id || selectedId ServerpartId: id || selectedId
} }
const data = await handleGetShopShortNamesGet(req) const data = await handleGetShopShortNamesGet(req)
console.log('data',data) console.log('data', data)
if (data && data.length>0){ if (data && data.length > 0) {
const obj: any = {} const obj: any = {}
if (data && data.length>0){ if (data && data.length > 0) {
data.forEach((item: any)=>{ data.forEach((item: any) => {
obj[item] = item obj[item] = item
}) })
} }
@ -394,13 +394,13 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => {
borderRadius: '8px', borderRadius: '8px',
width: '200px' width: '200px'
}}> }}>
<Spin/> <Spin />
<span style={{marginLeft: '5px'}}>...</span> <span style={{ marginLeft: '5px' }}>...</span>
</div> </div>
</div> : '' </div> : ''
} }
<div className={`transactionAnalysisHideBox${printIndex}`} style={{position: 'fixed', zIndex: -1, top: 0, left: 0}}> <div className={`transactionAnalysisHideBox${printIndex}`} style={{ position: 'fixed', zIndex: -1, top: 0, left: 0 }}>
{ {
showExportTable && reqDetailList && reqDetailList.length > 0 ? showExportTable && reqDetailList && reqDetailList.length > 0 ?
<ProTable <ProTable
@ -413,15 +413,15 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => {
/> : '' /> : ''
} }
</div> </div>
<div id='hiddenBox' style={{position: 'fixed', zIndex: -1, top: 0, left: 0}}/> <div id='hiddenBox' style={{ position: 'fixed', zIndex: -1, top: 0, left: 0 }} />
<div style={{backgroundColor: '#fff', display: 'flex'}}> <div style={{ backgroundColor: '#fff', display: 'flex' }}>
<ProCard <ProCard
style={{width: !collapsible ? "300px" : "60px"}} style={{ width: !collapsible ? "300px" : "60px" }}
className="pageTable-leftnav" className="pageTable-leftnav"
bodyStyle={{padding: 0, paddingTop: 20, paddingLeft: 20, width: !collapsible ? "300px" : "60px"}} bodyStyle={{ padding: 0, paddingTop: 20, paddingLeft: 20, width: !collapsible ? "300px" : "60px" }}
extra={<MenuFoldOutlined onClick={() => { extra={<MenuFoldOutlined onClick={() => {
setCollapsible(!collapsible) setCollapsible(!collapsible)
}}/>} }} />}
colSpan={!collapsible ? "300px" : "60px"} colSpan={!collapsible ? "300px" : "60px"}
title={!collapsible ? "请选择服务区" : ""} title={!collapsible ? "请选择服务区" : ""}
headerBordered headerBordered
@ -466,8 +466,8 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => {
}} }}
bordered bordered
headerTitle={<PageTitleBox props={props} />} headerTitle={<PageTitleBox props={props} />}
search={{span: 6,defaultCollapsed:false,}} search={{ span: 6, defaultCollapsed: false, }}
scroll={{y: 'calc(100vh - 470px)'}} scroll={{ y: 'calc(100vh - 470px)' }}
request={async (params) => { request={async (params) => {
if (isFirst) { if (isFirst) {
setIsFirst(false) setIsFirst(false)
@ -477,7 +477,7 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => {
message.error('请选择服务区') message.error('请选择服务区')
return return
} }
console.log('params',params) console.log('params', params)
handleCallLogs() handleCallLogs()
setSearchParams(params) setSearchParams(params)
const req = { const req = {
@ -488,7 +488,7 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => {
// shopNames: businessModel, // shopNames: businessModel,
targetSystem: params.targetSystem || '', targetSystem: params.targetSystem || '',
shopNames: params.shopNames || '', shopNames: params.shopNames || '',
SearchKeyName:"MerchantName,Brand,Shop,Serverpart", SearchKeyName: "MerchantName,Brand,Shop,Serverpart",
SearchKeyValue: params?.SearchKeyValue || '' SearchKeyValue: params?.SearchKeyValue || ''
} }
const data = await handleGetGetTransactionCustomer(req) const data = await handleGetGetTransactionCustomer(req)
@ -538,11 +538,11 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => {
} }
console.log('list', list) console.log('list', list)
setReqDetailList(list) setReqDetailList(list)
return {data: list, success: true} return { data: list, success: true }
}} }}
toolbar={{ toolbar={{
actions: [ actions: [
<span style={{visibility: 'hidden'}}> <span style={{ visibility: 'hidden' }}>
<ReactHTMLTableToExcel <ReactHTMLTableToExcel
buttonText={'导出excel'} buttonText={'导出excel'}
ref={downloadBtnRef} ref={downloadBtnRef}
@ -587,11 +587,11 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => {
setCurrentRow(undefined); setCurrentRow(undefined);
setShowDailyDrawer(false); setShowDailyDrawer(false);
}} }}
bodyStyle={{backgroundColor: "#f9f9f9", padding: 16}} bodyStyle={{ backgroundColor: "#f9f9f9", padding: 16 }}
destroyOnClose destroyOnClose
closable={false} closable={false}
> >
<div style={{width: '100%'}}> <div style={{ width: '100%' }}>
<ProTable <ProTable
actionRef={actionByDateRef} actionRef={actionByDateRef}
formRef={formByDateRef} formRef={formByDateRef}
@ -603,12 +603,12 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => {
search={false} search={false}
options={false} options={false}
pagination={false} pagination={false}
headerTitle={ currentRow?.Name==='合计'?'合计':`${currentRow?.SpregiontypeName}${currentRow?.ServerpartName?`-${currentRow?.ServerpartName}`:''}${currentRow?.SERVERPARTSHOP_NAME?`-${currentRow?.SERVERPARTSHOP_NAME}`:''}`} headerTitle={currentRow?.Name === '合计' ? '合计' : `${currentRow?.SpregiontypeName}${currentRow?.ServerpartName ? `-${currentRow?.ServerpartName}` : ''}${currentRow?.SERVERPARTSHOP_NAME ? `-${currentRow?.SERVERPARTSHOP_NAME}` : ''}`}
request={async (params)=>{ request={async (params) => {
console.log('currentRow',currentRow) console.log('currentRow', currentRow)
const req = { const req = {
ServerpartIds: currentRow?.Name==='合计'?selectedId:currentRow?.ServerpartId?currentRow?.ServerpartId:'', ServerpartIds: currentRow?.Name === '合计' ? selectedId : currentRow?.ServerpartId ? currentRow?.ServerpartId : '',
ServerpartShopId:currentRow?.SERVERPARTSHOP_ID?currentRow?.SERVERPARTSHOP_ID:'', ServerpartShopId: currentRow?.SERVERPARTSHOP_ID ? currentRow?.SERVERPARTSHOP_ID : '',
startDate: searchParams?.StartDate, startDate: searchParams?.StartDate,
endDate: searchParams?.EndDate, endDate: searchParams?.EndDate,
businessType, businessType,
@ -616,22 +616,22 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => {
targetSystem: searchParams?.targetSystem || '', targetSystem: searchParams?.targetSystem || '',
} }
const data = await handleGetTransactionCustomerByDate(req) const data = await handleGetTransactionCustomerByDate(req)
console.log('data22222',data) console.log('data22222', data)
if (data && data.length>0){ if (data && data.length > 0) {
console.log('data',data) console.log('data', data)
data.forEach((item: any,index: number)=>{ data.forEach((item: any, index: number) => {
item.index = index + 1 item.index = index + 1
if (item.children && item.children.length>0){ if (item.children && item.children.length > 0) {
item.children.forEach((subItem: any,subIndex: number)=>{ item.children.forEach((subItem: any, subIndex: number) => {
subItem.index = subIndex + 1 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={{ columnsState={{
value: columnsDailyStateMap, value: columnsDailyStateMap,
onChange: setColumnsDailyStateMap, onChange: setColumnsDailyStateMap,
@ -640,9 +640,9 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser}> = (props) => {
</div> </div>
</Drawer> </Drawer>
</div> </div>
) )
} }
export default connect(({user}: ConnectState) => ({ export default connect(({ user }: ConnectState) => ({
currentUser: user.currentUser currentUser: user.currentUser
}))(transactionAnalysis); }))(transactionAnalysis);

View File

@ -1,23 +1,23 @@
import {connect} from "umi"; import { connect } from "umi";
import type {CurrentUser} from "umi"; import type { CurrentUser } from "umi";
import type {ConnectState} from "@/models/connect"; import type { ConnectState } from "@/models/connect";
import React, {useRef, useState} from "react"; import React, { useRef, useState } from "react";
import ProCard from "@ant-design/pro-card"; import ProCard from "@ant-design/pro-card";
import {MenuFoldOutlined} from "@ant-design/icons"; import { MenuFoldOutlined } from "@ant-design/icons";
import type {FormInstance} from "antd"; import type { FormInstance } from "antd";
import {Avatar, Button, Menu, message, Space, Spin, Tree,Drawer} from "antd"; import { Avatar, Button, Menu, message, Space, Spin, Tree, Drawer } from "antd";
import useRequest from "@ahooksjs/use-request"; import useRequest from "@ahooksjs/use-request";
import {getServerpartTree, handleCallLogs, handleGetDate} from "@/services/options"; import { getServerpartTree, handleCallLogs, handleGetDate } 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 ProTable from "@ant-design/pro-table";
import ReactHTMLTableToExcel from "react-html-table-to-excel"; import ReactHTMLTableToExcel from "react-html-table-to-excel";
import SubMenu from "antd/lib/menu/SubMenu"; import SubMenu from "antd/lib/menu/SubMenu";
import moment from "moment"; 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"; import PageTitleBox from "@/components/PageTitleBox";
const abnormalAudit: React.FC<{ currentUser: CurrentUser}> = (props) => { const abnormalAudit: React.FC<{ currentUser: CurrentUser }> = (props) => {
const { currentUser } = props const { currentUser } = props
const downloadBtnRef = useRef<any>() const downloadBtnRef = useRef<any>()
const actionRef = useRef<ActionType>(); const actionRef = useRef<ActionType>();
@ -25,25 +25,25 @@ const abnormalAudit: React.FC<{ currentUser: CurrentUser}> = (props) => {
const [reqDetailList, setReqDetailList] = useState<any>(); // 合计项数据源 const [reqDetailList, setReqDetailList] = useState<any>(); // 合计项数据源
const [printOut, setPrintOut] = useState<any>(); // 打印数据的内容 const [printOut, setPrintOut] = useState<any>(); // 打印数据的内容
const [collapsible, setCollapsible] = useState<boolean>(false) const [collapsible, setCollapsible] = useState<boolean>(false)
const [treeView,setTreeView] = useState<any>() const [treeView, setTreeView] = useState<any>()
// 加载服务区树 // 加载服务区树
const { loading: treeLoading, data: treeViews } = useRequest(async () => { const { loading: treeLoading, data: treeViews } = useRequest(async () => {
const data = await getServerpartTree(currentUser?.ProvinceCode, currentUser?.CityAuthority, true, true, true) const data = await getServerpartTree(currentUser?.ProvinceCode, currentUser?.CityAuthority, true, true, true)
console.log('data',data) console.log('data', data)
setTreeView(data) setTreeView(data)
return data return data
}) })
// 树相关的属性和方法 // 树相关的属性和方法
const [selectedId, setSelectedId] = useState<string>() const [selectedId, setSelectedId] = useState<string>()
// 导出的加载效果 // 导出的加载效果
const [showLoading,setShowLoading] = useState<boolean>(false) const [showLoading, setShowLoading] = useState<boolean>(false)
// 是否显示打印的表格 // 是否显示打印的表格
const [showExportTable,setShowExportTable] = useState<boolean>(false) const [showExportTable, setShowExportTable] = useState<boolean>(false)
const [currenMenu, setCurrenMenu] = useState<any>(); // 当前选中左侧菜单的服务区节点 const [currenMenu, setCurrenMenu] = useState<any>(); // 当前选中左侧菜单的服务区节点
// 显示详情抽屉 // 显示详情抽屉
const [showDetailDrawer,setShowDetailDrawer] = useState<boolean>(false) const [showDetailDrawer, setShowDetailDrawer] = useState<boolean>(false)
// 选择的当行详情 // 选择的当行详情
const [currentRow,setCurrentRow] = useState<any>() const [currentRow, setCurrentRow] = useState<any>()
const columns: any = [ const columns: any = [
{ {
@ -53,7 +53,7 @@ const abnormalAudit: React.FC<{ currentUser: CurrentUser}> = (props) => {
hideInTable: true, hideInTable: true,
hideInDescriptions: true, hideInDescriptions: true,
colSize: 1, 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: { search: {
transform: (value) => { transform: (value) => {
return { return {
@ -67,107 +67,107 @@ const abnormalAudit: React.FC<{ currentUser: CurrentUser}> = (props) => {
} }
}, },
{ {
title:'序号', title: '序号',
width: 60, width: 60,
dataIndex: '', dataIndex: '',
valueType: 'index', valueType: 'index',
hideInSearch: true hideInSearch: true
}, },
{ {
title:'服务区名称', title: '服务区名称',
width: 150, width: 150,
ellipsis: true, ellipsis: true,
dataIndex: 'SERVERPART_NAME', dataIndex: 'SERVERPART_NAME',
hideInSearch: true hideInSearch: true
}, },
{ {
title:'门店名称', title: '门店名称',
width: 150, width: 150,
ellipsis: true, ellipsis: true,
dataIndex: 'SHOPNAME', dataIndex: 'SHOPNAME',
hideInSearch: true, hideInSearch: true,
render:(_,record)=>{ render: (_, record) => {
return record?.SHOPNAME?<a onClick={()=>{ return record?.SHOPNAME ? <a onClick={() => {
setCurrentRow(record) setCurrentRow(record)
setShowDetailDrawer(true) setShowDetailDrawer(true)
}}>{record?.SHOPNAME}</a>:'' }}>{record?.SHOPNAME}</a> : ''
} }
}, },
{ {
title:'总销售额', title: '总销售额',
width: 120, width: 120,
valueType: 'digit', valueType: 'digit',
dataIndex: 'TOTALSELLAMOUNT', dataIndex: 'TOTALSELLAMOUNT',
hideInSearch: true hideInSearch: true
}, },
{ {
title:'长短款', title: '长短款',
width: 120, width: 120,
valueType: 'digit', valueType: 'digit',
dataIndex: 'DIFFERENT_PRICE', dataIndex: 'DIFFERENT_PRICE',
hideInSearch: true hideInSearch: true
}, },
{ {
title:'稽核金额/对客现金', title: '稽核金额/对客现金',
width: 180, width: 180,
dataIndex: 'CHECK_CASHPAY/CASH_PAYMENT', dataIndex: 'CHECK_CASHPAY/CASH_PAYMENT',
hideInSearch: true, hideInSearch: true,
render:(_,record)=>{ render: (_, record) => {
return `${record?.CHECK_CASHPAY || '0'}/${record?.CASH_PAYMENT || '0'}` return `${record?.CHECK_CASHPAY || '0'}/${record?.CASH_PAYMENT || '0'}`
} }
}, },
{ {
title:'间隔时长(分)', title: '间隔时长(分)',
width: 120, width: 120,
dataIndex: 'TIME_INTERVAL', dataIndex: 'TIME_INTERVAL',
hideInSearch: true hideInSearch: true
}, },
{ {
title:'结账时间', title: '结账时间',
width: 180, width: 180,
dataIndex: 'ENDACCOUNT_DATE', dataIndex: 'ENDACCOUNT_DATE',
hideInSearch: true, hideInSearch: true,
render:(_,record)=>{ render: (_, record) => {
return record?.ENDACCOUNT_DATE?handleGetDate(record?.ENDACCOUNT_DATE):'-' return record?.ENDACCOUNT_DATE ? handleGetDate(record?.ENDACCOUNT_DATE) : '-'
} }
}, },
{ {
title:'稽查时间', title: '稽查时间',
width: 180, width: 180,
dataIndex: 'CHECK_ENDDATE', dataIndex: 'CHECK_ENDDATE',
hideInSearch: true, hideInSearch: true,
render:(_,record)=>{ render: (_, record) => {
return record?.CHECK_ENDDATE?handleGetDate(record?.CHECK_ENDDATE):'-' return record?.CHECK_ENDDATE ? handleGetDate(record?.CHECK_ENDDATE) : '-'
} }
}, },
{ {
title:'起始时间', title: '起始时间',
width: 180, width: 180,
dataIndex: 'CHECK_STARTDATE', dataIndex: 'CHECK_STARTDATE',
hideInSearch: true, hideInSearch: true,
render:(_,record)=>{ render: (_, record) => {
return record?.CHECK_STARTDATE?handleGetDate(record?.CHECK_STARTDATE):'-' return record?.CHECK_STARTDATE ? handleGetDate(record?.CHECK_STARTDATE) : '-'
} }
}, },
{ {
title:'稽查类型', title: '稽查类型',
width: 120, width: 120,
dataIndex:'CHECK_TYPE', dataIndex: 'CHECK_TYPE',
valueType: 'select', valueType: 'select',
valueEnum:{ valueEnum: {
"现场稽查":"现场稽查", "现场稽查": "现场稽查",
"区域稽查":"区域稽查", "区域稽查": "区域稽查",
"公司稽查":"公司稽查", "公司稽查": "公司稽查",
} }
}, },
{ {
title:'稽核人员', title: '稽核人员',
width: 120, width: 120,
dataIndex: 'WORKER_NAME', dataIndex: 'WORKER_NAME',
hideInSearch: true hideInSearch: true
}, },
{ {
title:'收银人员', title: '收银人员',
width: 120, width: 120,
dataIndex: 'CASHIER_NAME', dataIndex: 'CASHIER_NAME',
ellipsis: true, ellipsis: true,
@ -197,7 +197,7 @@ const abnormalAudit: React.FC<{ currentUser: CurrentUser}> = (props) => {
tempTable.remove() // 防止重复打印一个内容 tempTable.remove() // 防止重复打印一个内容
} }
// 查询的条件 // 查询的条件
const [searchParams,setSearchParams] = useState<any>() const [searchParams, setSearchParams] = useState<any>()
return ( return (
@ -230,13 +230,13 @@ const abnormalAudit: React.FC<{ currentUser: CurrentUser}> = (props) => {
borderRadius: '8px', borderRadius: '8px',
width: '200px' width: '200px'
}}> }}>
<Spin/> <Spin />
<span style={{marginLeft: '5px'}}>...</span> <span style={{ marginLeft: '5px' }}>...</span>
</div> </div>
</div> : '' </div> : ''
} }
<div className={'saleReportHideBox'} style={{position: 'fixed', zIndex: -1, top: 0, left: 0}}> <div className={'saleReportHideBox'} style={{ position: 'fixed', zIndex: -1, top: 0, left: 0 }}>
{ {
showExportTable && reqDetailList && reqDetailList.length > 0 ? showExportTable && reqDetailList && reqDetailList.length > 0 ?
<ProTable <ProTable
@ -249,16 +249,16 @@ const abnormalAudit: React.FC<{ currentUser: CurrentUser}> = (props) => {
/> : '' /> : ''
} }
</div> </div>
<div id='hiddenBox' style={{position: 'fixed', zIndex: -1, top: 0, left: 0}}/> <div id='hiddenBox' style={{ position: 'fixed', zIndex: -1, top: 0, left: 0 }} />
<div style={{backgroundColor: '#fff',display:'flex'}}> <div style={{ backgroundColor: '#fff', display: 'flex' }}>
<ProCard <ProCard
style={{width:!collapsible ? "300px" : "60px"}} style={{ width: !collapsible ? "300px" : "60px" }}
className="pageTable-leftnav" className="pageTable-leftnav"
bodyStyle={{padding: 0, paddingTop: 20, paddingLeft: 20,width:!collapsible ? "300px" : "60px"}} bodyStyle={{ padding: 0, paddingTop: 20, paddingLeft: 20, width: !collapsible ? "300px" : "60px" }}
extra={<MenuFoldOutlined onClick={() => { extra={<MenuFoldOutlined onClick={() => {
setCollapsible(!collapsible) setCollapsible(!collapsible)
}}/>} }} />}
colSpan={!collapsible ? "300px" : "60px"} colSpan={!collapsible ? "300px" : "60px"}
title={!collapsible ? "请选择服务区" : ""} title={!collapsible ? "请选择服务区" : ""}
headerBordered headerBordered
@ -288,7 +288,7 @@ const abnormalAudit: React.FC<{ currentUser: CurrentUser}> = (props) => {
/> : ''} /> : ''}
</ProCard> </ProCard>
<div style={{ <div style={{
width:!collapsible?'calc(100% - 300px)':'calc(100% - 60px)', width: !collapsible ? 'calc(100% - 300px)' : 'calc(100% - 60px)',
paddingTop: 0, paddingTop: 0,
paddingBottom: 0, paddingBottom: 0,
paddingRight: 0 paddingRight: 0
@ -299,15 +299,16 @@ const abnormalAudit: React.FC<{ currentUser: CurrentUser}> = (props) => {
columns={columns} columns={columns}
bordered bordered
headerTitle={<PageTitleBox props={props} />} headerTitle={<PageTitleBox props={props} />}
search={{span: 6}} search={{ span: 6 }}
scroll={{x: 1500}} scroll={{ x: 1500 }}
request={async(params)=>{ request={async (params) => {
if (!selectedId){ if (!selectedId) {
return return
} }
const req = { const req = {
SearchParameter:{ SearchParameter: {
...params, ...params,
PROVINCE_CODE: currentUser?.ProvinceCode,
SERVERPART_ID: selectedId SERVERPART_ID: selectedId
}, },
PageIndex: 1, PageIndex: 1,
@ -316,17 +317,17 @@ const abnormalAudit: React.FC<{ currentUser: CurrentUser}> = (props) => {
handleCallLogs() handleCallLogs()
setSearchParams(params) setSearchParams(params)
const data = await handleGetABNORMALAUDITList(req) const data = await handleGetABNORMALAUDITList(req)
console.log('data',data) console.log('data', data)
if (data && data.length>0){ if (data && data.length > 0) {
setReqDetailList(data) setReqDetailList(data)
return {data,success: true} return { data, success: true }
} }
setReqDetailList([]) setReqDetailList([])
return {data:[],success: true} return { data: [], success: true }
}} }}
toolbar={{ toolbar={{
actions: [ actions: [
<span style={{visibility: 'hidden'}}> <span style={{ visibility: 'hidden' }}>
<ReactHTMLTableToExcel <ReactHTMLTableToExcel
buttonText={'导出excel'} buttonText={'导出excel'}
ref={downloadBtnRef} ref={downloadBtnRef}
@ -369,7 +370,7 @@ const abnormalAudit: React.FC<{ currentUser: CurrentUser}> = (props) => {
setCurrentRow(undefined); setCurrentRow(undefined);
}} }}
destroyOnClose destroyOnClose
bodyStyle={{backgroundColor: "#f9f9f9", padding: 16}} bodyStyle={{ backgroundColor: "#f9f9f9", padding: 16 }}
closable={false} 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 currentUser: user.currentUser
}))(abnormalAudit); }))(abnormalAudit);

View File

@ -18,6 +18,7 @@ import useRequest from "@ahooksjs/use-request";
import moment from 'moment' import moment from 'moment'
import { handleApproveCommodityProInst, handleCreateCommodityProInst, handleDeleteCOMMODITY_RUNNING, handleDeleteCommodityProInst, handleGetApprovalCommodityList, handleGetBUSINESSAPPROVALDetail, handleGetCOMMODITYRUNNINGList, handleReapplyCommodityProInst, handleRejectCommodityProInst } from "../ProductApprovalProcess/service"; import { handleApproveCommodityProInst, handleCreateCommodityProInst, handleDeleteCOMMODITY_RUNNING, handleDeleteCommodityProInst, handleGetApprovalCommodityList, handleGetBUSINESSAPPROVALDetail, handleGetCOMMODITYRUNNINGList, handleReapplyCommodityProInst, handleRejectCommodityProInst } from "../ProductApprovalProcess/service";
import './style.less' import './style.less'
import session from "@/utils/session";
const { Step } = Steps const { Step } = Steps
@ -867,23 +868,26 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
message: "请选择服务区!" message: "请选择服务区!"
}]} }]}
request={async () => { request={async () => {
const data = await getServerpartTree(currentUser?.ProvinceCode, currentUser?.CityAuthority, true, true, true) const ServerpartIdsTree = session.get('ServerpartIdsTree')
console.log('data321312', data); return ServerpartIdsTree
const list: any = [] // const data = await getServerpartTree(currentUser?.ProvinceCode, currentUser?.CityAuthority, true, true, true)
if (data && data.length > 0) { // console.log('data321312', data);
data.forEach((item: any) => {
if (item.children && item.children.length > 0) { // const list: any = []
item.children.forEach((subItem: any) => { // if (data && data.length > 0) {
list.push({ label: subItem.label, value: subItem.value })
})
}
})
// data.forEach((item: any) => { // data.forEach((item: any) => {
// list.push({ label: item.label, value: item.value }) // if (item.children && item.children.length > 0) {
// item.children.forEach((subItem: any) => {
// list.push({ label: subItem.label, value: subItem.value })
// }) // })
} // }
return list // })
// // 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)} disabled={currentRow?.BusinessProcess_State > 1000 || (currentRow?.BusinessApproval_ID && currentRow?.ApproveStaff_ID !== currentUser?.ID)}
fieldProps={{ fieldProps={{

View File

@ -1028,21 +1028,23 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
message: "请选择服务区!" message: "请选择服务区!"
}]} }]}
request={async () => { request={async () => {
const data = await getServerpartTree(currentUser?.ProvinceCode, currentUser?.CityAuthority, true, true, true) const ServerpartIdsTree = session.get('ServerpartIdsTree')
const list: any = [] return ServerpartIdsTree
if (data && data.length > 0) { // const data = await getServerpartTree(currentUser?.ProvinceCode, currentUser?.CityAuthority, true, true, true)
data.forEach((item: any) => { // const list: any = []
if (item.children && item.children.length > 0) { // if (data && data.length > 0) {
item.children.forEach((subItem: any) => {
list.push({ label: subItem.label, value: subItem.value })
})
}
})
// data.forEach((item: any) => { // data.forEach((item: any) => {
// list.push({ label: item.label, value: item.value }) // if (item.children && item.children.length > 0) {
// item.children.forEach((subItem: any) => {
// list.push({ label: subItem.label, value: subItem.value })
// }) // })
} // }
return list // })
// // 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)} disabled={currentRow?.BusinessProcess_State > 1000 || (currentRow?.BusinessApproval_ID && currentRow?.ApproveStaff_ID !== currentUser?.ID)}
fieldProps={{ fieldProps={{
@ -1633,7 +1635,7 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
<ProFormText <ProFormText
name="COMMODITY_BARCODE" name="COMMODITY_BARCODE"
label="商品条码" label="商品条码"
disabled={currentRow} disabled={true}
/> />
</Col> </Col>
<Col span={8}> <Col span={8}>

View File

@ -1075,21 +1075,23 @@ const ProductChangePriceApproval: React.FC<{ currentUser: CurrentUser }> = (prop
message: "请选择服务区!" message: "请选择服务区!"
}]} }]}
request={async () => { request={async () => {
const data = await getServerpartTree(currentUser?.ProvinceCode, currentUser?.CityAuthority, true, true, true) const ServerpartIdsTree = session.get('ServerpartIdsTree')
const list: any = [] return ServerpartIdsTree
if (data && data.length > 0) { // const data = await getServerpartTree(currentUser?.ProvinceCode, currentUser?.CityAuthority, true, true, true)
data.forEach((item: any) => { // const list: any = []
if (item.children && item.children.length > 0) { // if (data && data.length > 0) {
item.children.forEach((subItem: any) => {
list.push({ label: subItem.label, value: subItem.value })
})
}
})
// data.forEach((item: any) => { // data.forEach((item: any) => {
// list.push({ label: item.label, value: item.value }) // if (item.children && item.children.length > 0) {
// item.children.forEach((subItem: any) => {
// list.push({ label: subItem.label, value: subItem.value })
// }) // })
} // }
return list // })
// // 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)} disabled={currentRow?.BusinessProcess_State > 1000 || (currentRow?.BusinessApproval_ID && currentRow?.ApproveStaff_ID !== currentUser?.ID)}
fieldProps={{ fieldProps={{

View File

@ -1,3 +1,4 @@
// 商品信息管理
import { connect } from "umi"; import { connect } from "umi";
import type { CurrentUser } from "umi"; import type { CurrentUser } from "umi";
import type { ConnectState } from "@/models/connect"; import type { ConnectState } from "@/models/connect";

View File

@ -1,12 +1,13 @@
import {connect} from "umi"; // 商品信息查询
import type {CurrentUser} from "umi"; import { connect } from "umi";
import type {ConnectState} from "@/models/connect"; import type { CurrentUser } from "umi";
import React, {useRef, useState} from "react"; import type { ConnectState } from "@/models/connect";
import React, { useRef, useState } from "react";
import ProCard from "@ant-design/pro-card"; import ProCard from "@ant-design/pro-card";
import {MenuFoldOutlined} from "@ant-design/icons"; import { MenuFoldOutlined } from "@ant-design/icons";
import type { FormInstance} from "antd"; import type { FormInstance } from "antd";
import {Col, Drawer, Row} from "antd"; import { Col, Drawer, Row } from "antd";
import {Avatar, Button, Menu, message, Modal, Popconfirm, Space, Spin, Tree} from "antd"; import { Avatar, Button, Menu, message, Modal, Popconfirm, Space, Spin, Tree } from "antd";
import useRequest from "@ahooksjs/use-request"; import useRequest from "@ahooksjs/use-request";
import { import {
getFieldEnum, getFieldEnum,
@ -15,7 +16,7 @@ import {
getServerpartTree, getServerpartTree,
handleCallLogs handleCallLogs
} from "@/services/options"; } 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 ProTable from "@ant-design/pro-table";
import ReactHTMLTableToExcel from "react-html-table-to-excel"; import ReactHTMLTableToExcel from "react-html-table-to-excel";
import SubMenu from "antd/lib/menu/SubMenu"; import SubMenu from "antd/lib/menu/SubMenu";
@ -24,26 +25,27 @@ import {
handleGetCommodityList, handleGetCommodityList,
handleGetNestingCOMMODITYTYPETree, handleSynchroCOMMODITY handleGetNestingCOMMODITYTYPETree, handleSynchroCOMMODITY
} from "@/pages/reports/productControl/commodityInfo/service"; } 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 moment from "moment";
import session from "@/utils/session"; import session from "@/utils/session";
import './style.less' import './style.less'
import Detail from "@/pages/reports/productControl/components/detail"; import Detail from "@/pages/reports/productControl/components/detail";
import PageTitleBox from "@/components/PageTitleBox"; import PageTitleBox from "@/components/PageTitleBox";
const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => { const commoditySearch: React.FC<{ currentUser: CurrentUser }> = (props) => {
const { currentUser } = props const { currentUser } = props
const downloadBtnRef = useRef<any>() const downloadBtnRef = useRef<any>()
const actionRef = useRef<ActionType>(); const actionRef = useRef<ActionType>();
const formRef = useRef<FormInstance>(); const formRef = useRef<FormInstance>();
const modalFormRef = useRef<any>(); const modalFormRef = useRef<any>();
const [currentRow,setCurrentRow] = useState<any>() const [currentRow, setCurrentRow] = useState<any>()
const [reqDetailList, setReqDetailList] = useState<any>(); // 合计项数据源 const [reqDetailList, setReqDetailList] = useState<any>(); // 合计项数据源
const [printOut, setPrintOut] = useState<any>(); // 打印数据的内容 const [printOut, setPrintOut] = useState<any>(); // 打印数据的内容
const [collapsible, setCollapsible] = useState<boolean>(false) const [collapsible, setCollapsible] = useState<boolean>(false)
const [treeView,setTreeView] = useState<any>() const [treeView, setTreeView] = useState<any>()
const [allTotal,setAllTotal] = useState<number>(20) const [allTreeView, setAllTreeView] = useState<any>()
const [allTotal, setAllTotal] = useState<number>(20)
// 加载服务区树 // 加载服务区树
const { loading: treeLoading, data: treeViews } = useRequest(async () => { const { loading: treeLoading, data: treeViews } = useRequest(async () => {
const req = { const req = {
@ -52,35 +54,45 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => {
ShowCode: true ShowCode: true
} }
const data = await handleGetNestingCOMMODITYTYPETree(req) const data = await handleGetNestingCOMMODITYTYPETree(req)
console.log('data',data) let list: any = data
setTreeView(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 return data
}) })
// 树相关的属性和方法 // 树相关的属性和方法
const [selectedId, setSelectedId] = useState<string>() const [selectedId, setSelectedId] = useState<string>()
// 导出的加载效果 // 导出的加载效果
const [showLoading,setShowLoading] = useState<boolean>(false) const [showLoading, setShowLoading] = useState<boolean>(false)
// 是否显示打印的表格 // 是否显示打印的表格
const [showExportTable,setShowExportTable] = useState<boolean>(false) const [showExportTable, setShowExportTable] = useState<boolean>(false)
const [currenMenu, setCurrenMenu] = useState<any>(); // 当前选中左侧菜单的服务区节点 const [currenMenu, setCurrenMenu] = useState<any>(); // 当前选中左侧菜单的服务区节点
const [showModal,setShowModal] = useState<boolean>(false) const [showModal, setShowModal] = useState<boolean>(false)
const [showDetail,setShowDetail] = useState<boolean>(false) const [showDetail, setShowDetail] = useState<boolean>(false)
const ServerpartIdsList: any = session.get('ServerpartIdsList') 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 data = await getFieldEnumTree({ FieldExplainField: 'CommodityTypeIds' })
const obj: any = {} const obj: any = {}
if (data && data.length>0){ if (data && data.length > 0) {
data.forEach((item: any)=>{ data.forEach((item: any) => {
obj[item.value] = item.label obj[item.value] = item.label
if (item.children && item.children.length>0){ if (item.children && item.children.length > 0) {
item.children.forEach((subItem: any)=>{ item.children.forEach((subItem: any) => {
obj[subItem.value] = subItem.label obj[subItem.value] = subItem.label
if (subItem.children && subItem.children.length>0){ if (subItem.children && subItem.children.length > 0) {
subItem.children.forEach((thirdItem: any)=>{ subItem.children.forEach((thirdItem: any) => {
obj[thirdItem.value] = thirdItem.label obj[thirdItem.value] = thirdItem.label
}) })
} }
@ -93,56 +105,58 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => {
const columns: any = [ const columns: any = [
{ {
title:'状态', title: '状态',
dataIndex: 'COMMODITY_STATE', dataIndex: 'COMMODITY_STATE',
hideInTable: true, hideInTable: true,
valueType: 'select', valueType: 'select',
valueEnum:{ valueEnum: {
0:{text:'无效'}, 0: { text: '无效' },
1:{text:'有效'} 1: { text: '有效' }
}, },
initialValue: '1' initialValue: '1'
}, },
{ {
title:'服务区', title: '服务区',
dataIndex: 'ServerpartID', dataIndex: 'ServerpartID',
valueType: 'select', valueType: 'select',
hideInTable: true, hideInTable: true,
request:async ()=>{ request: async () => {
const data = await getServerpartOption(340000) // const data = await getServerpartOption(currentUser?.ProvinceCode)
return data // console.log('datadatadatadata', data);
const serverpartList: any = session.get('serverpartList')
return serverpartList
}, },
fieldProps:{ fieldProps: {
showSearch: true, showSearch: true,
filterOption:(input, option) => (option?.label ?? '').toLowerCase().includes(input.toLowerCase()), filterOption: (input, option) => (option?.label ?? '').toLowerCase().includes(input.toLowerCase()),
} }
}, },
{ {
title:<div style={{textAlign:'center'}}></div>, title: <div style={{ textAlign: 'center' }}></div>,
width: 70, width: 70,
dataIndex:'index', dataIndex: 'index',
hideInSearch: true, hideInSearch: true,
valueType:'index' valueType: 'index'
}, },
{ {
title:<div style={{textAlign:'center'}}></div>, title: <div style={{ textAlign: 'center' }}></div>,
width: 150, width: 150,
ellipsis: true, ellipsis: true,
align:'center', align: 'center',
dataIndex: 'SERVERPART_NAME', dataIndex: 'SERVERPART_NAME',
hideInSearch: true, hideInSearch: true,
render:(_,record)=>{ render: (_, record) => {
return <span> return <span>
{record?.SERVERPART_ID ? ServerpartIdsList[record?.SERVERPART_ID] : '-'} {record?.SERVERPART_ID ? ServerpartIdsList[record?.SERVERPART_ID] : '-'}
</span> </span>
} }
}, },
{ {
title:<div style={{textAlign:'center'}}></div>, title: <div style={{ textAlign: 'center' }}></div>,
width: 120, width: 120,
ellipsis: true, ellipsis: true,
dataIndex: 'BUSINESSTYPE', dataIndex: 'BUSINESSTYPE',
align:'center', align: 'center',
hideInSearch: true, hideInSearch: true,
valueType: 'select', valueType: 'select',
request: async () => { request: async () => {
@ -151,23 +165,23 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => {
} }
}, },
{ {
title:<div style={{textAlign:'center'}}></div>, title: <div style={{ textAlign: 'center' }}></div>,
width: 120, width: 120,
ellipsis: true, ellipsis: true,
dataIndex: 'COMMODITY_TYPE', dataIndex: 'COMMODITY_TYPE',
align:'center', align: 'center',
hideInSearch: true, hideInSearch: true,
valueEnum: CommodityData valueEnum: CommodityData
}, },
{ {
title:<div style={{textAlign:'center'}}></div>, title: <div style={{ textAlign: 'center' }}></div>,
width: 200, width: 200,
ellipsis: true, ellipsis: true,
align:'left', align: 'left',
dataIndex: 'COMMODITY_NAME', dataIndex: 'COMMODITY_NAME',
hideInSearch: true, hideInSearch: true,
render:(_,record)=>{ render: (_, record) => {
return <a onClick={()=>{ return <a onClick={() => {
setCurrentRow(record) setCurrentRow(record)
setShowDetail(true) setShowDetail(true)
}}> }}>
@ -176,51 +190,51 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => {
} }
}, },
{ {
title:<div style={{textAlign:'center'}}></div>, title: <div style={{ textAlign: 'center' }}></div>,
width: 150, width: 150,
ellipsis: true, ellipsis: true,
align:'left', align: 'left',
dataIndex: 'COMMODITY_BARCODE', dataIndex: 'COMMODITY_BARCODE',
hideInSearch: true, hideInSearch: true,
}, },
{ {
title:<div style={{textAlign:'center'}}></div>, title: <div style={{ textAlign: 'center' }}></div>,
width: 70, width: 70,
ellipsis: true, ellipsis: true,
align:'right', align: 'right',
dataIndex: 'COMMODITY_RETAILPRICE', dataIndex: 'COMMODITY_RETAILPRICE',
hideInSearch: true, hideInSearch: true,
}, },
{ {
title:<div style={{textAlign:'center'}}></div>, title: <div style={{ textAlign: 'center' }}></div>,
width: 70, width: 70,
ellipsis: true, ellipsis: true,
align:'right', align: 'right',
dataIndex: 'COMMODITY_PURCHASEPRICE', dataIndex: 'COMMODITY_PURCHASEPRICE',
hideInSearch: true, hideInSearch: true,
}, },
{ {
title:<div style={{textAlign:'center'}}></div>, title: <div style={{ textAlign: 'center' }}></div>,
width: 80, width: 80,
ellipsis: true, ellipsis: true,
align:'right', align: 'right',
dataIndex: 'COMMODITY_UNIT', dataIndex: 'COMMODITY_UNIT',
hideInSearch: true, hideInSearch: true,
}, },
{ {
title:<div style={{textAlign:'center'}}></div>, title: <div style={{ textAlign: 'center' }}></div>,
width: 100, width: 100,
ellipsis: true, ellipsis: true,
dataIndex: 'COMMODITY_STATE', dataIndex: 'COMMODITY_STATE',
hideInSearch: true, hideInSearch: true,
align:'center', align: 'center',
valueType: 'select', valueType: 'select',
valueEnum: { 0: { text: '无效', status: 'error' }, 1: { text: '有效', status: 'success' }, 2: { text: '不可选', status: 'default' } }, valueEnum: { 0: { text: '无效', status: 'error' }, 1: { text: '有效', status: 'success' }, 2: { text: '不可选', status: 'default' } },
}, },
{ {
title:<div style={{textAlign:'center'}}></div>, title: <div style={{ textAlign: 'center' }}></div>,
width: 150, width: 150,
align:'center', align: 'center',
ellipsis: true, ellipsis: true,
dataIndex: 'OPERATE_DATE', dataIndex: 'OPERATE_DATE',
hideInSearch: true, hideInSearch: true,
@ -228,7 +242,7 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => {
] ]
// 查询的条件 // 查询的条件
const [searchParams,setSearchParams] = useState<any>() const [searchParams, setSearchParams] = useState<any>()
const getMenuDom = (data: any[], callback: (item: any) => void) => { const getMenuDom = (data: any[], callback: (item: any) => void) => {
return (data.map((element: any) => { return (data.map((element: any) => {
// 绑定嵌套树的子节点 // 绑定嵌套树的子节点
@ -257,13 +271,13 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => {
} }
const loadSelectedId = (item?: any) => { const loadSelectedId = (item?: any) => {
console.log('item',item) console.log('item', item)
// 选中的子菜单key // 选中的子菜单key
const [type, value] = item.key.split('-') const [type, value] = item.key.split('-')
if (type === '1') { if (type === '1') {
setCurrenMenu(value) setCurrenMenu(value)
// actionRef?.current?.reload() // actionRef?.current?.reload()
} else{ } else {
setCurrenMenu('') setCurrenMenu('')
} }
} }
@ -320,13 +334,13 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => {
borderRadius: '8px', borderRadius: '8px',
width: '200px' width: '200px'
}}> }}>
<Spin/> <Spin />
<span style={{marginLeft: '5px'}}>...</span> <span style={{ marginLeft: '5px' }}>...</span>
</div> </div>
</div> : '' </div> : ''
} }
<div className={'commoditySearchHideBox'} style={{position: 'fixed', zIndex: -1, top: 0, left: 0}}> <div className={'commoditySearchHideBox'} style={{ position: 'fixed', zIndex: -1, top: 0, left: 0 }}>
{ {
showExportTable && reqDetailList && reqDetailList.length > 0 ? showExportTable && reqDetailList && reqDetailList.length > 0 ?
<ProTable <ProTable
@ -339,16 +353,16 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => {
/> : '' /> : ''
} }
</div> </div>
<div id='hiddenBox' style={{position: 'fixed', zIndex: -1, top: 0, left: 0}}/> <div id='hiddenBox' style={{ position: 'fixed', zIndex: -1, top: 0, left: 0 }} />
<div style={{backgroundColor: '#fff',display:'flex'}}> <div style={{ backgroundColor: '#fff', display: 'flex' }}>
<ProCard <ProCard
style={{width:!collapsible ? "300px" : "60px"}} style={{ width: !collapsible ? "300px" : "60px" }}
className="pageTable-leftnav" className="pageTable-leftnav"
bodyStyle={{padding: 0, paddingTop: 20, paddingLeft: 20,width:!collapsible ? "300px" : "60px"}} bodyStyle={{ padding: 0, paddingTop: 20, paddingLeft: 20, width: !collapsible ? "300px" : "60px" }}
extra={<MenuFoldOutlined onClick={() => { extra={<MenuFoldOutlined onClick={() => {
setCollapsible(!collapsible) setCollapsible(!collapsible)
}}/>} }} />}
colSpan={!collapsible ? "300px" : "60px"} colSpan={!collapsible ? "300px" : "60px"}
title={!collapsible ? "请选择服务区" : ""} title={!collapsible ? "请选择服务区" : ""}
headerBordered headerBordered
@ -359,7 +373,7 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => {
style={{ height: 'calc(100vh - 220px)', overflowY: 'auto', overflowX: 'hidden' }} style={{ height: 'calc(100vh - 220px)', overflowY: 'auto', overflowX: 'hidden' }}
selectedKeys={`1-${currenMenu}`} selectedKeys={`1-${currenMenu}`}
onSelect={(item) => { onSelect={(item) => {
console.log('item',item) console.log('item', item)
loadSelectedId(item) loadSelectedId(item)
}} }}
> >
@ -367,7 +381,7 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => {
</Menu>} </Menu>}
</ProCard> </ProCard>
<div style={{ <div style={{
width:!collapsible?'calc(100% - 300px)':'calc(100% - 60px)', width: !collapsible ? 'calc(100% - 300px)' : 'calc(100% - 60px)',
paddingTop: 0, paddingTop: 0,
paddingBottom: 0, paddingBottom: 0,
paddingRight: 0 paddingRight: 0
@ -377,20 +391,21 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => {
formRef={formRef} formRef={formRef}
columns={columns} columns={columns}
bordered bordered
scroll={{ x: '100%', y: 'calc(100vh - 450px)' }}
headerTitle={<PageTitleBox props={props} />} headerTitle={<PageTitleBox props={props} />}
search={{span: 6}} search={{ span: 6 }}
pagination={{ pagination={{
// defaultPageSize: 20, // defaultPageSize: 20,
// total: allTotal || 20 // total: allTotal || 20
}} }}
request={async(params)=>{ request={async (params) => {
if (!currenMenu){ if (!currenMenu) {
return return
} }
const req: any = { const req: any = {
SearchType: 3, SearchType: 3,
ProvinceCode: currentUser?.USER_PROVINCE, ProvinceCode: currentUser?.USER_PROVINCE,
CommodityTypeId: currenMenu, CommodityTypeId: currenMenu === '999999' ? '' : currenMenu,
CommodityState: params?.COMMODITY_STATE, CommodityState: params?.COMMODITY_STATE,
ServerpartID: params?.ServerpartID, ServerpartID: params?.ServerpartID,
PageIndex: 1, PageIndex: 1,
@ -399,17 +414,17 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => {
} }
handleCallLogs() handleCallLogs()
const data = await handleGetCommodityList(req) const data = await handleGetCommodityList(req)
if (data.List && data.List.length>0){ if (data.List && data.List.length > 0) {
console.log('data',data) console.log('data', data)
// setAllTotal(data.TotalCount) // setAllTotal(data.TotalCount)
setReqDetailList(data.List) setReqDetailList(data.List)
return { data: data.List,success: true} return { data: data.List, success: true }
} }
return {data: [],success: true} return { data: [], success: true }
}} }}
toolbar={{ toolbar={{
actions: [ actions: [
<span style={{visibility: 'hidden'}}> <span style={{ visibility: 'hidden' }}>
<ReactHTMLTableToExcel <ReactHTMLTableToExcel
buttonText={'导出excel'} buttonText={'导出excel'}
ref={downloadBtnRef} ref={downloadBtnRef}
@ -450,7 +465,7 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => {
destroyOnClose destroyOnClose
title={'商品详情'} title={'商品详情'}
footer={false} footer={false}
onCancel={()=>{ onCancel={() => {
setCurrentRow(undefined) setCurrentRow(undefined)
setShowModal(false) setShowModal(false)
}} }}
@ -497,12 +512,12 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => {
data.forEach((item: any) => { data.forEach((item: any) => {
if (item.children && item.children.length > 0) { if (item.children && item.children.length > 0) {
item.children.forEach((subItem: any) => { 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) => { data.forEach((item: any) => {
list.push({label: item.label, value: item.value}) list.push({ label: item.label, value: item.value })
}) })
} }
return list return list
@ -526,7 +541,7 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => {
message: '请选择商品业态', message: '请选择商品业态',
}, },
]} ]}
request={async ()=>{ request={async () => {
const BUSINESSTYPEList = await getFieldEnum({ FieldExplainField: 'BUSINESSTYPE' }) const BUSINESSTYPEList = await getFieldEnum({ FieldExplainField: 'BUSINESSTYPE' })
return BUSINESSTYPEList return BUSINESSTYPEList
}} }}
@ -545,18 +560,18 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => {
]} ]}
request={async () => { request={async () => {
const list: any = [] const list: any = []
if (treeView && treeView.length>0){ if (treeView && treeView.length > 0) {
treeView.forEach((item: any)=>{ treeView.forEach((item: any) => {
item.disabled = true item.disabled = true
if (item.children && item.children.length>0){ if (item.children && item.children.length > 0) {
item.children.forEach((subItem: any)=>{ item.children.forEach((subItem: any) => {
subItem.disabled = true subItem.disabled = true
}) })
} }
}) })
console.log('treeView',treeView) console.log('treeView', treeView)
treeView.forEach((item: any)=>{ treeView.forEach((item: any) => {
if (item.value>=885 && item.value<=891){ if (item.value >= 885 && item.value <= 891) {
list.push(item) list.push(item)
} }
}) })
@ -622,7 +637,7 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => {
}, },
]} ]}
initialValue={1000} 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 },]}
/> />
</Col> </Col>
<Col span={8}> <Col span={8}>
@ -686,7 +701,7 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => {
}, },
]} ]}
initialValue={1} initialValue={1}
options={[{label:'是',value:1},{label:'否',value:0}]} options={[{ label: '是', value: 1 }, { label: '否', value: 0 }]}
/> />
</Col> </Col>
<Col span={8}> <Col span={8}>
@ -701,7 +716,7 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => {
}, },
]} ]}
initialValue={0} initialValue={0}
options={[{label:'是',value:1},{label:'否',value:0}]} options={[{ label: '是', value: 1 }, { label: '否', value: 0 }]}
/> />
</Col> </Col>
<Col span={8}> <Col span={8}>
@ -716,7 +731,7 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => {
}, },
]} ]}
initialValue={1} initialValue={1}
options={[{label:'计价',value:1},{label:'散装称重',value:0}]} options={[{ label: '计价', value: 1 }, { label: '散装称重', value: 0 }]}
/> />
</Col> </Col>
@ -733,7 +748,7 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => {
}, },
]} ]}
initialValue={1} initialValue={1}
options={[{label:'有效',value:1},{label:'审核中',value:2},{label:'无效',value:0}]} options={[{ label: '有效', value: 1 }, { label: '审核中', value: 2 }, { label: '无效', value: 0 }]}
/> />
</Col> </Col>
<Col span={8}> <Col span={8}>
@ -844,7 +859,7 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => {
name="COMMODITY_FROZENCOUNT" name="COMMODITY_FROZENCOUNT"
label="采购状态" label="采购状态"
readonly readonly
options={[{label:'允许',value:1000},{label:'禁止',value:2000}]} options={[{ label: '允许', value: 1000 }, { label: '禁止', value: 2000 }]}
/> />
</Col> </Col>
</Row> </Row>
@ -855,20 +870,20 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser}> = (props) => {
<Drawer <Drawer
width={1000} width={1000}
open={showDetail} open={showDetail}
onClose={()=>{ onClose={() => {
setCurrentRow(undefined) setCurrentRow(undefined)
setShowDetail(false) setShowDetail(false)
}} }}
closable={false} closable={false}
destroyOnClose destroyOnClose
> >
<Detail currentRow={currentRow} currentUser={currentUser} treeView={treeView}/> <Detail currentRow={currentRow} currentUser={currentUser} treeView={treeView} />
</Drawer> </Drawer>
</div> </div>
) )
} }
export default connect(({user}: ConnectState) => ({ export default connect(({ user }: ConnectState) => ({
currentUser: user.currentUser currentUser: user.currentUser
}))(commoditySearch); }))(commoditySearch);

View File

@ -34,7 +34,8 @@ const shopCommodity: React.FC<{ currentUser: CurrentUser }> = (props) => {
const [treeView, setTreeView] = useState<any>() const [treeView, setTreeView] = useState<any>()
// 加载服务区树 // 加载服务区树
const { loading: treeLoading, data: treeViews } = useRequest(async () => { 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) setTreeView(data)
console.log('data222', data) console.log('data222', data)
return data return data

View File

@ -235,7 +235,7 @@ export async function getServerpartTree(ProvinceCode?: number | string, Serverpa
const data = await request(`/BaseInfo/GetServerpartTree? const data = await request(`/BaseInfo/GetServerpartTree?
ProvinceCode=${ProvinceCode || ''}&ServerpartCodes=${ServerpartCodes || ''}& ProvinceCode=${ProvinceCode || ''}&ServerpartCodes=${ServerpartCodes || ''}&
ShowWholePower=${ShowWholePower || false}&ShowWholePower=${ShowSPRegion || true}& ShowWholePower=${ShowWholePower || false}&ShowWholePower=${ShowSPRegion || true}&
ShowRoyalty=${false}&ShowCompactCount=${ShowCompactCount || false}&StatisticsType=${StatisticsType || ''}`, { ShowRoyalty=${ShowRoyalty}&ShowCompactCount=${ShowCompactCount || false}&StatisticsType=${StatisticsType || ''}`, {
method: 'GET', method: 'GET',
}); });

View File

@ -1,4 +1,4 @@
// 由 scripts/writeVersion.js 自动生成 // 由 scripts/writeVersion.js 自动生成
export const VERSION = "4.5.35"; export const VERSION = "4.5.36";
export const GIT_HASH = "1ce314d"; export const GIT_HASH = "e03ffe4";
export const BUILD_TIME = "2025-08-21T11:03:22.048Z"; export const BUILD_TIME = "2025-08-22T10:43:11.324Z";