From a05dd915f3cc1cc5abe2403af759db35375d86b1 Mon Sep 17 00:00:00 2001 From: ylj20011123 Date: Fri, 29 Aug 2025 19:14:40 +0800 Subject: [PATCH] update --- package.json | 2 +- .../checkDataManager/list.tsx | 777 +++++------ .../DataVerification/dataExamine/list.tsx | 883 +++++++------ .../handleDailyError/list.tsx | 1155 +++++++++-------- .../list/components/ItemDetail.tsx | 6 +- src/pages/DataVerification/list/list.tsx | 41 +- src/pages/DataVerification/list/newStyle.less | 240 ++-- .../components/InventoryDetailModal.tsx | 136 +- src/pages/ahjgPage/InventoryDetails/index.tsx | 8 +- .../components/inventoryDetail.tsx | 2 +- .../ahjgPage/purchaseReceiving/index.tsx | 223 +++- .../components/returnGoodsTable.tsx | 274 ++++ src/pages/ahjgPage/returnProcess/index.tsx | 40 +- src/pages/ahjgPage/service.ts | 52 + src/pages/ahjgPage/servicePartAudit/index.tsx | 15 +- .../components/warehouseInfo.tsx | 67 +- src/pages/ahjgPage/shopProcurement/index.tsx | 103 +- .../component/contractDetail.tsx | 4 +- .../serviceAreaPersonnel/index.tsx | 55 +- .../ConvenienceStoreProductReview/index.tsx | 4 +- .../productControl/commodityInfo/index.tsx | 60 +- .../productControl/commoditySearch/index.tsx | 6 +- .../productControl/hotkeyset/index.tsx | 204 +-- .../setUserDefinedType/index.tsx | 431 +++--- src/utils/format.ts | 191 +++ src/versionEnv.ts | 6 +- 26 files changed, 3053 insertions(+), 1932 deletions(-) create mode 100644 src/pages/ahjgPage/returnProcess/components/returnGoodsTable.tsx diff --git a/package.json b/package.json index 0518468..0f2becb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ant-design-pro", - "version": "4.5.38", + "version": "4.5.40", "private": true, "description": "An out-of-box UI solution for enterprise applications", "scripts": { diff --git a/src/pages/DataVerification/checkDataManager/list.tsx b/src/pages/DataVerification/checkDataManager/list.tsx index 7194742..200dfa7 100644 --- a/src/pages/DataVerification/checkDataManager/list.tsx +++ b/src/pages/DataVerification/checkDataManager/list.tsx @@ -1,51 +1,51 @@ // 结账数据管理 -import React, {useEffect, useRef, useState} from "react"; -import type {CurrentUser} from "@/models/user"; -import {connect} from "umi"; -import type {ConnectState} from "@/models/connect"; -import {PageContainer} from "@ant-design/pro-layout"; +import React, { useEffect, useRef, useState } from "react"; +import type { CurrentUser } from "@/models/user"; +import { connect } from "umi"; +import type { ConnectState } from "@/models/connect"; +import { PageContainer } from "@ant-design/pro-layout"; import ProTable from "@ant-design/pro-table"; -import {getEndaccountPhoto, getServerpartOption, handleGetShopTypeTree} from "@/pages/DataVerification/list/service"; -import {handleGetAccountList, handleGetServiceShopList, submitEndaccountState} from "@/pages/DataVerification/service"; +import { getEndaccountPhoto, getServerpartOption, handleGetShopTypeTree } from "@/pages/DataVerification/list/service"; +import { handleGetAccountList, handleGetServerpartShopList, handleGetServiceShopList, submitEndaccountState } from "@/pages/DataVerification/service"; import './list.less' -import {Button, DatePicker, Select, Drawer, message} from "antd"; +import { Button, DatePicker, Select, Drawer, message } from "antd"; import useRequest from "@ahooksjs/use-request"; import moment from "moment"; import CheckDetail from "./components/checkDetail"; -import {handleCallLogs} from "@/services/options"; +import { handleCallLogs } from "@/services/options"; const List: React.FC<{ currentUser?: CurrentUser }> = ({ currentUser }) => { - // 详情的ref - const checkDetail = useRef() - // 表格数组 - const [tableData,setTableData] = useState() - // 选择的服务区 - const [selectServicePartId,setSelectServicePartId] = useState() - // 门店列表 - const [shopList,setShopList] = useState() - // 选择的门店列表 - const [selectShopId,setSelectShopId] = useState('') - // 处理状态 - const [selectState,setSelectState] = useState(3) - // 异常类型 - const [errorType,setErrorType] = useState('') - // 经营模式 - const [managerModal,setManagerModal] = useState('') - // 查询时间 - const [selectTime,setSelectTime] = useState([moment().subtract(1, 'day'),moment().subtract(1, 'day')]) - // 表格的加载效果 - const [tableLoading,setTableLoading] = useState(false) - // 显示抽屉 - const [showDrawer,setShowDrawer] = useState(false) - // 点击 或者双击的当前行数据 - const [currentRow,setCurrentRow] = useState() + // 详情的ref + const checkDetail = useRef() + // 表格数组 + const [tableData, setTableData] = useState() + // 选择的服务区 + const [selectServicePartId, setSelectServicePartId] = useState() + // 门店列表 + const [shopList, setShopList] = useState() + // 选择的门店列表 + const [selectShopId, setSelectShopId] = useState('') + // 处理状态 + const [selectState, setSelectState] = useState(3) + // 异常类型 + const [errorType, setErrorType] = useState('') + // 经营模式 + const [managerModal, setManagerModal] = useState('') + // 查询时间 + const [selectTime, setSelectTime] = useState([moment().subtract(1, 'day'), moment().subtract(1, 'day')]) + // 表格的加载效果 + const [tableLoading, setTableLoading] = useState(false) + // 显示抽屉 + const [showDrawer, setShowDrawer] = useState(false) + // 点击 或者双击的当前行数据 + const [currentRow, setCurrentRow] = useState() // 根据子组件是否出现加载框来判断按钮是否禁用 - const [showDisable,setShowDisable] = useState(false) + const [showDisable, setShowDisable] = useState(false) - const { RangePicker } = DatePicker; - // 格式化金钱的方法 - const fmoney = (s: number, n?: number) => { + const { RangePicker } = DatePicker; + // 格式化金钱的方法 + const fmoney = (s: number, n?: number) => { /* * 参数说明: * s:要格式化的数字 @@ -71,360 +71,379 @@ const List: React.FC<{ currentUser?: CurrentUser }> = ({ currentUser }) => { } - const columns: any = [ - { - dataIndex: 'key', - title: '序号', - width: 50, - align: 'center', - }, - { - dataIndex: 'Treatment_MarkState', - title: '处理状态', - width: 90, - align: 'center', - render:(_,record)=>{ - return {record.Treatment_MarkState===0?'待处理': - record.Treatment_MarkState===1?'待审核': - record.Treatment_MarkState===2?'已审结': - record.Treatment_MarkState===3?'主任复核': - record.Treatment_MarkState===4?'主任审结':''} - } - }, - { - dataIndex: 'Serverpart_Name', - title: '服务区名称', - ellipsis:true - }, - { - dataIndex: 'ServerpartShop_Name', - title: '门店名称', - valueType:'select', - ellipsis:true, - width:250, - }, - { - dataIndex: 'Description_Info', - title: '日结校验', - width:600, - ellipsis:true, - hideInSearch:true, - render:(_,record)=>{ - return
{ - `${record?.Description_Staff?`${record?.Description_Staff.split('【')[0]}:`:''} ${record?.Description_Info} ${record?.Approved_Staff?`|${record?.Approved_Staff}:`:''} ${record?.Approved_Info}` - }
- } - }, - { - dataIndex: 'TotalSell_Amount', - title: '总销售额', - width:100, - align: 'right', - hideInSearch:true, - render:(_,record)=>{ - return {fmoney(record.TotalSell_Amount,2)} - } - }, - { - dataIndex: 'Difference_Amount', - title: '长短款', - align: 'right', - width:80, - hideInSearch:true, - render:(_,record)=>{ - return 0?'green':Number(record.Difference_Amount)<0?'red':''}}>{fmoney(record.Difference_Amount,2)} - } - }, - { - dataIndex: 'Revenue_Amount', - title: '实收金额', - width:100, - align: 'right', - hideInSearch:true, - render:(_,record)=>{ - return {fmoney(record.Revenue_Amount,2)} - } - }, - { - dataIndex: 'Endaccount_EndDate', - title: '结账日期', - width:200, - align: 'center', - }, - ] - // 请求服务区的列表的方法 且去掉第一个 安徽驿达 的列表数据 - const { loading, data: serviceList } = useRequest(async ()=>{ - const options = await getServerpartOption() - const list: any = [] - if (options && options.length>0){ - options.forEach((item: any)=>{ - if (item.value!==424){ - list.push(item) - } - }) - // setSelectServicePartId(list[0].value) + const columns: any = [ + { + dataIndex: 'key', + title: '序号', + width: 50, + align: 'center', + }, + { + dataIndex: 'Treatment_MarkState', + title: '处理状态', + width: 90, + align: 'center', + render: (_, record) => { + return {record.Treatment_MarkState === 0 ? '待处理' : + record.Treatment_MarkState === 1 ? '待审核' : + record.Treatment_MarkState === 2 ? '已审结' : + record.Treatment_MarkState === 3 ? '主任复核' : + record.Treatment_MarkState === 4 ? '主任审结' : ''} + } + }, + { + dataIndex: 'Serverpart_Name', + title: '服务区名称', + ellipsis: true + }, + { + dataIndex: 'ServerpartShop_Name', + title: '门店名称', + valueType: 'select', + ellipsis: true, + width: 250, + }, + { + dataIndex: 'Description_Info', + title: '日结校验', + width: 600, + ellipsis: true, + hideInSearch: true, + render: (_, record) => { + return
{ + `${record?.Description_Staff ? `${record?.Description_Staff.split('【')[0]}:` : ''} ${record?.Description_Info} ${record?.Approved_Staff ? `|${record?.Approved_Staff}:` : ''} ${record?.Approved_Info}` + }
+ } + }, + { + dataIndex: 'TotalSell_Amount', + title: '总销售额', + width: 100, + align: 'right', + hideInSearch: true, + render: (_, record) => { + return {fmoney(record.TotalSell_Amount, 2)} + } + }, + { + dataIndex: 'Difference_Amount', + title: '长短款', + align: 'right', + width: 80, + hideInSearch: true, + render: (_, record) => { + return 0 ? 'green' : Number(record.Difference_Amount) < 0 ? 'red' : '' }}>{fmoney(record.Difference_Amount, 2)} + } + }, + { + dataIndex: 'Revenue_Amount', + title: '实收金额', + width: 100, + align: 'right', + hideInSearch: true, + render: (_, record) => { + return {fmoney(record.Revenue_Amount, 2)} + } + }, + { + dataIndex: 'Endaccount_EndDate', + title: '结账日期', + width: 200, + align: 'center', + }, + ] + // 请求服务区的列表的方法 且去掉第一个 安徽驿达 的列表数据 + const { loading, data: serviceList } = useRequest(async () => { + const options = await getServerpartOption() + const list: any = [] + if (options && options.length > 0) { + options.forEach((item: any) => { + if (item.value !== 424) { + list.push(item) } - return list - }) - // 请求表格数据 - const handleGetTableList = async ()=>{ - setTableLoading(true) - const req = { - ServerpartIds: selectServicePartId, - ServerpartShopCode: selectShopId, - StartDate: moment(selectTime[0]).format('YYYY-MM-DD'), - EndDate: moment(selectTime[1]).format('YYYY-MM-DD'), - // TreatmentMarkState:selectState, - ExceptionState: errorType, - EndaccountState: selectState, - PageSize:999999 - } - handleCallLogs() - const data = await handleGetAccountList(req) - if (data && data.List && data.List.length>0){ - const list = [] - data.List.forEach((item: any,index: number)=>{ - item.key = index + 1 - list.push(item) - }) - setTableData(list) - }else{ - setTableData([]) - } - setTableLoading(false) + }) + // setSelectServicePartId(list[0].value) } - const handleChangeShowDisable = (type: boolean)=>{ + return list + }) + // 请求表格数据 + const handleGetTableList = async () => { + setTableLoading(true) + const req = { + ServerpartIds: selectServicePartId, + ServerpartShopCode: selectShopId, + StartDate: moment(selectTime[0]).format('YYYY-MM-DD'), + EndDate: moment(selectTime[1]).format('YYYY-MM-DD'), + // TreatmentMarkState:selectState, + ExceptionState: errorType, + EndaccountState: selectState, + PageSize: 999999 + } + handleCallLogs() + const data = await handleGetAccountList(req) + if (data && data.List && data.List.length > 0) { + const list = [] + data.List.forEach((item: any, index: number) => { + item.key = index + 1 + list.push(item) + }) + setTableData(list) + } else { + setTableData([]) + } + setTableLoading(false) + } + const handleChangeShowDisable = (type: boolean) => { setShowDisable(type) } - // 主任复核 - // type 0是财务驳回 2是财务审核 3是主任复核 - // desc 是点击审核驳回会出现的必填项 - const handleSubmitEndaccountState = async (type: number,desc: string)=>{ - const req = { - TreatmentMarkState: type, - EndaccountId:currentRow?.Endaccount_Id, - RevenueAmount:currentRow?.Revenue_Amount, - DescriptionStaff:currentUser?.Name, - DescriptionInfo:desc, - DescriptionDate:moment().format('YYYY-MM-DD HH:mm:ss') - } - const data = await submitEndaccountState(req) - if (data.Result_Code===100){ - message.success(data.Result_Desc) - setShowDrawer(false); - handleGetTableList() - }else{ - message.error(data.Result_Desc) - } + // 主任复核 + // type 0是财务驳回 2是财务审核 3是主任复核 + // desc 是点击审核驳回会出现的必填项 + const handleSubmitEndaccountState = async (type: number, desc: string) => { + const req = { + TreatmentMarkState: type, + EndaccountId: currentRow?.Endaccount_Id, + RevenueAmount: currentRow?.Revenue_Amount, + DescriptionStaff: currentUser?.Name, + DescriptionInfo: desc, + DescriptionDate: moment().format('YYYY-MM-DD HH:mm:ss') } - useEffect(() => { - handleGetTableList() - }, []); + const data = await submitEndaccountState(req) + if (data.Result_Code === 100) { + message.success(data.Result_Desc) + setShowDrawer(false); + handleGetTableList() + } else { + message.error(data.Result_Desc) + } + } + useEffect(() => { + handleGetTableList() + }, []); - return ( - -
-
-
- 服务区: - -
-
- 门店: - -
-
- 处理状态: - -
-
- 异常类型: - -
-
- 经营模式: - -
-
- 时间: - { - setSelectTime([moment(e[0]._d),moment(e[1]._d)]) - }} - /> -
-
-
- - -
-
-
- { - return { - onClick: () => { - setShowDrawer(true); - console.log('record',record) - setCurrentRow(record) + return ( + +
+
+
+ 服务区: + +
+
+ 门店: + +
+
+ 处理状态: + +
+
+ 异常类型: + +
+
+ 经营模式: + +
+
+ 时间: + { + setSelectTime([moment(e[0]._d), moment(e[1]._d)]) + }} + /> +
+
+
+ + +
+
+
+ { + return { + onClick: () => { + setShowDrawer(true); + console.log('record', record) + setCurrentRow(record) + }, + } + }} + > + +
+ + { + setShowDrawer(false); + }} + destroyOnClose={true} + footer={ + currentRow?.Treatment_MarkState === 3 ? +
+ +
+ + +
+
: '' + } + > + +
+
+ ) } export default connect(({ user }: ConnectState) => ({ - currentUser: user?.currentUser + currentUser: user?.currentUser }))(List); diff --git a/src/pages/DataVerification/dataExamine/list.tsx b/src/pages/DataVerification/dataExamine/list.tsx index 0dbd51d..2dd2365 100644 --- a/src/pages/DataVerification/dataExamine/list.tsx +++ b/src/pages/DataVerification/dataExamine/list.tsx @@ -1,19 +1,20 @@ // 结账数据校验 -import React, {useEffect, useRef, useState} from "react"; -import type {CurrentUser} from "@/models/user"; -import {connect} from "umi"; -import type {ConnectState} from "@/models/connect"; -import {PageContainer} from "@ant-design/pro-layout"; +import React, { useEffect, useRef, useState } from "react"; +import type { CurrentUser } from "@/models/user"; +import { connect } from "umi"; +import type { ConnectState } from "@/models/connect"; +import { PageContainer } from "@ant-design/pro-layout"; import ProTable from "@ant-design/pro-table"; -import { getServerpartOption} from "@/pages/DataVerification/list/service"; +import { getServerpartOption } from "@/pages/DataVerification/list/service"; import { handleBatchReview, handleGetAccountList, + handleGetServerpartShopList, handleGetServiceShopList, submitEndaccountState } from "@/pages/DataVerification/service"; import './list.less' -import {Button, DatePicker, Select, Drawer, message} from "antd"; +import { Button, DatePicker, Select, Drawer, message } from "antd"; import useRequest from "@ahooksjs/use-request"; import moment from "moment"; import CheckDetail from "@/pages/DataVerification/dataExamine/components/checkDetail"; @@ -21,35 +22,35 @@ import mobile from '@/assets/DataVerification/mobilePay.png' const List: React.FC<{ currentUser?: CurrentUser }> = ({ currentUser }) => { - // 详情的ref - const checkDetail = useRef() - // 表格数组 - const [tableData,setTableData] = useState() - // 选择的服务区 - const [selectServicePartId,setSelectServicePartId] = useState() - // 门店列表 - const [shopList,setShopList] = useState() - // 选择的门店列表 - const [selectShopId,setSelectShopId] = useState('') - // 处理状态 - const [selectState,setSelectState] = useState(1) - // 查询时间 - const [selectTime,setSelectTime] = useState([moment().subtract(1, 'day'),moment().subtract(1, 'day')]) - // 表格的加载效果 - const [tableLoading,setTableLoading] = useState(false) - // 显示抽屉 - const [showDrawer,setShowDrawer] = useState(false) - // 点击 或者双击的当前行数据 - const [currentRow,setCurrentRow] = useState() - // 选中的行数据 - const [selectRowList,setSelectRowList] = useState() - // 选中的行 - const [selectedOrderRowKeys,setSelectedOrderRowKeys] = useState() - // 根据子组件是否出现加载框来判断按钮是否禁用 - const [showDisable,setShowDisable] = useState(false) + // 详情的ref + const checkDetail = useRef() + // 表格数组 + const [tableData, setTableData] = useState() + // 选择的服务区 + const [selectServicePartId, setSelectServicePartId] = useState() + // 门店列表 + const [shopList, setShopList] = useState() + // 选择的门店列表 + const [selectShopId, setSelectShopId] = useState('') + // 处理状态 + const [selectState, setSelectState] = useState(1) + // 查询时间 + const [selectTime, setSelectTime] = useState([moment().subtract(1, 'day'), moment().subtract(1, 'day')]) + // 表格的加载效果 + const [tableLoading, setTableLoading] = useState(false) + // 显示抽屉 + const [showDrawer, setShowDrawer] = useState(false) + // 点击 或者双击的当前行数据 + const [currentRow, setCurrentRow] = useState() + // 选中的行数据 + const [selectRowList, setSelectRowList] = useState() + // 选中的行 + const [selectedOrderRowKeys, setSelectedOrderRowKeys] = useState() + // 根据子组件是否出现加载框来判断按钮是否禁用 + const [showDisable, setShowDisable] = useState(false) const { RangePicker } = DatePicker; - const fmoney = (s: number, n?: number) => { + const fmoney = (s: number, n?: number) => { /* * 参数说明: * s:要格式化的数字 @@ -74,413 +75,435 @@ const List: React.FC<{ currentUser?: CurrentUser }> = ({ currentUser }) => { return `${fuhao + [...t].reverse().join("")}.${r}`; } - const rowSelection: any ={ - selectedRowKeys: selectedOrderRowKeys, - onChange: (selectedRowKeys: any, selectedRows: any) => { - setSelectRowList(selectedRows) - setSelectedOrderRowKeys(selectedRowKeys) - }, - getCheckboxProps: (record: any) => ({ - disabled: record.Treatment_MarkState !== 1 , - }), - }; + const rowSelection: any = { + selectedRowKeys: selectedOrderRowKeys, + onChange: (selectedRowKeys: any, selectedRows: any) => { + setSelectRowList(selectedRows) + setSelectedOrderRowKeys(selectedRowKeys) + }, + getCheckboxProps: (record: any) => ({ + disabled: record.Treatment_MarkState !== 1, + }), + }; - const columns: any = [ - { - dataIndex: 'key', - title: '序号', - width: 50, - align: 'center', - }, - { - dataIndex: '', - title: '', - width: 100, - align: 'center', - hideInSearch:true, - render:(_,record) =>{ - return { - setShowDrawer(true); - setCurrentRow(record) - }}> - {record.Treatment_MarkState===0?'未做校验': - record.Treatment_MarkState===1?'待您审核': - record.Treatment_MarkState===2?'审核原因': - record.Treatment_MarkState===3?'主任复核': - record.Treatment_MarkState===4?'主任审结':''} - - } - }, - { - dataIndex: 'Treatment_MarkState', - title: '处理状态', - width: 90, - align: 'center', - render:(_,record)=>{ - return {record.Treatment_MarkState===0?'待处理': - record.Treatment_MarkState===1?'待审核': - record.Treatment_MarkState===2?'已审结': - record.Treatment_MarkState===3?'主任复核': - record.Treatment_MarkState===4?'主任审结':''} - } - }, - { - dataIndex: 'Serverpart_Name', - title: '服务区名称', - width:120, - }, - { - dataIndex: 'ServerpartShop_Name', - title: '门店名称', - valueType:'select', - ellipsis:true, - width:200, - }, - { - dataIndex: 'Description_Info', - title: '日结校验', - width:400, - ellipsis:true, - hideInSearch:true, - render:(_,record)=>{ - return
{ - record.Description_Staff.indexOf('移')===-1? - {`${record.Description_Staff?`${record.Description_Staff}:`:''} ${record.Description_Info}`} - : -
- - {`${record.Description_Staff.split('【')[0]}: ${record.Description_Info}`} -
- - }
- } - }, - { - dataIndex: 'TotalSell_Amount', - title: '总销售额', - width:100, - align: 'right', - hideInSearch:true, - render:(_,record)=>{ - return {fmoney(record.TotalSell_Amount,2)} - } - }, - { - dataIndex: 'Difference_Amount', - title: '长短款', - width:80, - align: 'right', - hideInSearch:true, - render:(_,record)=>{ - return {fmoney(record.Difference_Amount,2)} - } - }, - { - dataIndex: '', - title: '客单均价', - width:80, - align: 'right', - hideInTable:true, - hideInSearch:true, - render:(_,record)=>{ - return {record.Ticket_Count?(record.TotalSell_Amount / record.Ticket_Count).toFixed(2):'-'} - } - }, - { - dataIndex: 'Revenue_Amount', - title: '实收金额', - width:100, - align: 'right', - hideInSearch:true, - render:(_,record)=>{ - return {fmoney(record.Revenue_Amount,2)} - } - }, - { - dataIndex: 'Endaccount_EndDate', - title: '结账日期', - width:200, - align: 'center', - }, - ] - const { loading, data: serviceList } = useRequest(async ()=>{ - const options = await getServerpartOption() - const list: any = [] - if (options && options.length>0){ - options.forEach((item: any)=>{ - if (item.value!==424){ - list.push(item) - } - }) - // setSelectServicePartId(list[0].value) - } - return list - }) - // 财务审核 主任复核 驳回 - const handleSubmitEndaccountState = async (type: number,desc: string)=>{ - const req = { - TreatmentMarkState: type, - EndaccountId:currentRow?.Endaccount_Id, - RevenueAmount:currentRow?.Revenue_Amount, - DescriptionStaff:currentUser?.Name, - DescriptionInfo:desc, - DescriptionDate:moment().format('YYYY-MM-DD HH:mm:ss') - } - const data = await submitEndaccountState(req) - if (data.Result_Code===100){ - if (type===0){ - message.success('驳回成功!') - }else{ - message.success(data.Result_Desc) - } - setShowDrawer(false); - handleGetTableList() - }else{ - message.error(data.Result_Desc) - } - } - - const handleGetTableList = async ()=>{ - const newSelect: any = [] - setTableLoading(true) - const req = { - ServerpartIds: selectServicePartId, - ServerpartShopCode: selectShopId, - StartDate: moment(selectTime[0]).format('YYYY-MM-DD'), - EndDate: moment(selectTime[1]).format('YYYY-MM-DD'), - TreatmentMarkState:selectState, - EndaccountState:1, - PageSize:999999 - } - const data = await handleGetAccountList(req) - if (data && data.List && data.List.length>0){ - const list = [] - data.List.forEach((item: any,index: number)=>{ - item.key = index + 1 - list.push(item) - if (selectedOrderRowKeys && selectedOrderRowKeys.length>0){ - if (selectedOrderRowKeys.indexOf(item.Endaccount_Id)!==-1){ - newSelect.push(item.Endaccount_Id) - } - } - }) - setSelectedOrderRowKeys(newSelect) - setTableData(list) - }else{ - setSelectedOrderRowKeys([]) - setTableData([]) - } - setTableLoading(false) - } - useEffect(() => { - handleGetTableList() - }, []); - const handleChangeShowDisable = (type: boolean)=>{ - setShowDisable(type) - } - - return ( - { + return { + setShowDrawer(true); + setCurrentRow(record) }}> -
-
-
- 服务区: - -
-
- 门店: - -
-
- 处理状态: - -
-
- 时间: - { - setSelectTime([moment(e[0]._d),moment(e[1]._d)]) - }} - /> -
-
-
- - -
+ {record.Treatment_MarkState === 0 ? '未做校验' : + record.Treatment_MarkState === 1 ? '待您审核' : + record.Treatment_MarkState === 2 ? '审核原因' : + record.Treatment_MarkState === 3 ? '主任复核' : + record.Treatment_MarkState === 4 ? '主任审结' : ''} + + } + }, + { + dataIndex: 'Treatment_MarkState', + title: '处理状态', + width: 90, + align: 'center', + render: (_, record) => { + return {record.Treatment_MarkState === 0 ? '待处理' : + record.Treatment_MarkState === 1 ? '待审核' : + record.Treatment_MarkState === 2 ? '已审结' : + record.Treatment_MarkState === 3 ? '主任复核' : + record.Treatment_MarkState === 4 ? '主任审结' : ''} + } + }, + { + dataIndex: 'Serverpart_Name', + title: '服务区名称', + width: 120, + }, + { + dataIndex: 'ServerpartShop_Name', + title: '门店名称', + valueType: 'select', + ellipsis: true, + width: 200, + }, + { + dataIndex: 'Description_Info', + title: '日结校验', + width: 400, + ellipsis: true, + hideInSearch: true, + render: (_, record) => { + return
{ + record.Description_Staff.indexOf('移') === -1 ? + {`${record.Description_Staff ? `${record.Description_Staff}:` : ''} ${record.Description_Info}`} + : +
+ + {`${record.Description_Staff.split('【')[0]}: ${record.Description_Info}`}
-
- { - if(selectRowList && selectRowList.length>0){ - const req = [] - selectRowList.forEach((item: any)=>{ - req.push(item.Endaccount_Id) - }) - const data = await handleBatchReview(req) - if (data.Result_Code===100){ - message.success(data.Result_Desc) - handleGetTableList() - }else{ - message.error(data.Result_Desc) - } - }else{ - message.error('请先选择') - } - }} - > - 批量审核 - , - ], - }} - onRow={(record)=>{ - return { - onDoubleClick: () => { - setShowDrawer(true); - setCurrentRow(record) + }
+ } + }, + { + dataIndex: 'TotalSell_Amount', + title: '总销售额', + width: 100, + align: 'right', + hideInSearch: true, + render: (_, record) => { + return {fmoney(record.TotalSell_Amount, 2)} + } + }, + { + dataIndex: 'Difference_Amount', + title: '长短款', + width: 80, + align: 'right', + hideInSearch: true, + render: (_, record) => { + return {fmoney(record.Difference_Amount, 2)} + } + }, + { + dataIndex: '', + title: '客单均价', + width: 80, + align: 'right', + hideInTable: true, + hideInSearch: true, + render: (_, record) => { + return {record.Ticket_Count ? (record.TotalSell_Amount / record.Ticket_Count).toFixed(2) : '-'} + } + }, + { + dataIndex: 'Revenue_Amount', + title: '实收金额', + width: 100, + align: 'right', + hideInSearch: true, + render: (_, record) => { + return {fmoney(record.Revenue_Amount, 2)} + } + }, + { + dataIndex: 'Endaccount_EndDate', + title: '结账日期', + width: 200, + align: 'center', + }, + ] + const { loading, data: serviceList } = useRequest(async () => { + const options = await getServerpartOption() + const list: any = [] + if (options && options.length > 0) { + options.forEach((item: any) => { + if (item.value !== 424) { + list.push(item) + } + }) + // setSelectServicePartId(list[0].value) + } + return list + }) + // 财务审核 主任复核 驳回 + const handleSubmitEndaccountState = async (type: number, desc: string) => { + const req = { + TreatmentMarkState: type, + EndaccountId: currentRow?.Endaccount_Id, + RevenueAmount: currentRow?.Revenue_Amount, + DescriptionStaff: currentUser?.Name, + DescriptionInfo: desc, + DescriptionDate: moment().format('YYYY-MM-DD HH:mm:ss') + } + const data = await submitEndaccountState(req) + if (data.Result_Code === 100) { + if (type === 0) { + message.success('驳回成功!') + } else { + message.success(data.Result_Desc) + } + setShowDrawer(false); + handleGetTableList() + } else { + message.error(data.Result_Desc) + } + } + + const handleGetTableList = async () => { + const newSelect: any = [] + setTableLoading(true) + const req = { + ServerpartIds: selectServicePartId, + ServerpartShopCode: selectShopId, + StartDate: moment(selectTime[0]).format('YYYY-MM-DD'), + EndDate: moment(selectTime[1]).format('YYYY-MM-DD'), + TreatmentMarkState: selectState, + EndaccountState: 1, + PageSize: 999999 + } + const data = await handleGetAccountList(req) + if (data && data.List && data.List.length > 0) { + const list = [] + data.List.forEach((item: any, index: number) => { + item.key = index + 1 + list.push(item) + if (selectedOrderRowKeys && selectedOrderRowKeys.length > 0) { + if (selectedOrderRowKeys.indexOf(item.Endaccount_Id) !== -1) { + newSelect.push(item.Endaccount_Id) + } + } + }) + setSelectedOrderRowKeys(newSelect) + setTableData(list) + } else { + setSelectedOrderRowKeys([]) + setTableData([]) + } + setTableLoading(false) + } + useEffect(() => { + handleGetTableList() + }, []); + const handleChangeShowDisable = (type: boolean) => { + setShowDisable(type) + } + + return ( + +
+
+
+ 服务区: +
- - { - setShowDrawer(false); - }} - destroyOnClose={true} - footer={ - currentRow?.Treatment_MarkState===1? -
- -
- - - -
-
:'' +
+ 门店: + +
+
+ 处理状态: + +
+
+ 时间: + { + setSelectTime([moment(e[0]._d), moment(e[1]._d)]) + }} + /> +
+
+
+ + +
+
+
+ { + if (selectRowList && selectRowList.length > 0) { + const req = [] + selectRowList.forEach((item: any) => { + req.push(item.Endaccount_Id) + }) + const data = await handleBatchReview(req) + if (data.Result_Code === 100) { + message.success(data.Result_Desc) + handleGetTableList() + } else { + message.error(data.Result_Desc) + } + } else { + message.error('请先选择') + } + + }} + > + 批量审核 + , + ], + }} + onRow={(record) => { + return { + onDoubleClick: () => { + setShowDrawer(true); + setCurrentRow(record) + }, + } + }} + > + + +
+ + { + setShowDrawer(false); + }} + destroyOnClose={true} + footer={ + currentRow?.Treatment_MarkState === 1 ? +
+ +
+ + + +
+
: '' + } + > + +
+
+ ) } export default connect(({ user }: ConnectState) => ({ - currentUser: user?.currentUser + currentUser: user?.currentUser }))(List); diff --git a/src/pages/DataVerification/handleDailyError/list.tsx b/src/pages/DataVerification/handleDailyError/list.tsx index 19f1f2c..00c54f7 100644 --- a/src/pages/DataVerification/handleDailyError/list.tsx +++ b/src/pages/DataVerification/handleDailyError/list.tsx @@ -1,67 +1,68 @@ // 异常日结处理 -import React, {useEffect, useRef, useState} from "react"; -import type {CurrentUser} from "@/models/user"; -import {connect} from "umi"; -import type {ConnectState} from "@/models/connect"; -import {PageContainer} from "@ant-design/pro-layout"; +import React, { useEffect, useRef, useState } from "react"; +import type { CurrentUser } from "@/models/user"; +import { connect } from "umi"; +import type { ConnectState } from "@/models/connect"; +import { PageContainer } from "@ant-design/pro-layout"; import ProTable from "@ant-design/pro-table"; -import {getEndaccountPhoto, getServerpartOption, handleGetShopTypeTree} from "@/pages/DataVerification/list/service"; +import { getEndaccountPhoto, getServerpartOption, handleGetShopTypeTree } from "@/pages/DataVerification/list/service"; import { handleBatchReview, handleDailyException, handleGetAccountList, + handleGetServerpartShopList, handleGetServiceShopList } from "@/pages/DataVerification/service"; import './list.less' -import {Button, DatePicker, Select, Drawer, message, Modal, Popconfirm} from "antd"; +import { Button, DatePicker, Select, Drawer, message, Modal, Popconfirm } from "antd"; import useRequest from "@ahooksjs/use-request"; import moment from "moment"; import CheckDetail from "./components/checkDetail"; -import ProForm, {ProFormDatePicker, ProFormRadio, ProFormTextArea} from "@ant-design/pro-form"; +import ProForm, { ProFormDatePicker, ProFormRadio, ProFormTextArea } from "@ant-design/pro-form"; const List: React.FC<{ currentUser?: CurrentUser }> = ({ currentUser }) => { - // 详情的ref - const checkDetail = useRef() - const modalRef = useRef() - // 表格数组 - const [tableData,setTableData] = useState() - // 选择的服务区 - const [selectServicePartId,setSelectServicePartId] = useState() - // 门店列表 - const [shopList,setShopList] = useState() - // 选择的门店列表 - const [selectShopId,setSelectShopId] = useState('') - // 处理状态 - const [selectState,setSelectState] = useState('') - // 查询时间 - const [selectTime,setSelectTime] = useState([moment().subtract(1, 'day'),moment().subtract(1, 'day')]) - // 表格的加载效果 - const [tableLoading,setTableLoading] = useState(false) - // 显示抽屉 - const [showDrawer,setShowDrawer] = useState(false) - // 点击 或者双击的当前行数据 - const [currentRow,setCurrentRow] = useState() - // 显示悬浮框 - const [showModal,setShowModal] = useState(false) - // 悬浮框的显示内容 - const [modalType,setModalType] = useState(0) - // 选择的表格项 - const [selectTableList,setSelectTableList] = useState() - // 选中的行 - const [selectedOrderRowKeys,setSelectedOrderRowKeys] = useState() + // 详情的ref + const checkDetail = useRef() + const modalRef = useRef() + // 表格数组 + const [tableData, setTableData] = useState() + // 选择的服务区 + const [selectServicePartId, setSelectServicePartId] = useState() + // 门店列表 + const [shopList, setShopList] = useState() + // 选择的门店列表 + const [selectShopId, setSelectShopId] = useState('') + // 处理状态 + const [selectState, setSelectState] = useState('') + // 查询时间 + const [selectTime, setSelectTime] = useState([moment().subtract(1, 'day'), moment().subtract(1, 'day')]) + // 表格的加载效果 + const [tableLoading, setTableLoading] = useState(false) + // 显示抽屉 + const [showDrawer, setShowDrawer] = useState(false) + // 点击 或者双击的当前行数据 + const [currentRow, setCurrentRow] = useState() + // 显示悬浮框 + const [showModal, setShowModal] = useState(false) + // 悬浮框的显示内容 + const [modalType, setModalType] = useState(0) + // 选择的表格项 + const [selectTableList, setSelectTableList] = useState() + // 选中的行 + const [selectedOrderRowKeys, setSelectedOrderRowKeys] = useState() // 根据子组件是否出现加载框来判断按钮是否禁用 - const [showDisable,setShowDisable] = useState(false) - const { RangePicker } = DatePicker; + const [showDisable, setShowDisable] = useState(false) + const { RangePicker } = DatePicker; const rowSelection: any = { selectedRowKeys: selectedOrderRowKeys, onChange: (selectedRowKeys: any, selectedRows: any) => { setSelectTableList(selectedRows) - console.log('selectedRowKeys',selectedRowKeys) + console.log('selectedRowKeys', selectedRowKeys) setSelectedOrderRowKeys(selectedRowKeys) }, }; - const fmoney = (s: number, n?: number) => { + const fmoney = (s: number, n?: number) => { /* * 参数说明: * s:要格式化的数字 @@ -87,558 +88,578 @@ const List: React.FC<{ currentUser?: CurrentUser }> = ({ currentUser }) => { } - const columns: any = [ - { - dataIndex: 'key', - title: '序号', - width: 50, - align: 'center', - }, - { - dataIndex: 'Treatment_MarkState', - title: '处理状态', - width: 90, - align: 'center', - render:(_,record)=>{ - return { - setShowDrawer(true); - setCurrentRow(record) - }} - style={{color:'#0066FF',textDecoration:'underline',cursor:'pointer'}} - >账期退回 - } - }, - { - dataIndex: 'Serverpart_Name', - title: '服务区名称', - width:120, - ellipsis: true - }, - { - dataIndex: 'ServerpartShop_Name', - title: '门店名称', - valueType:'select', - width:150, - ellipsis: true - }, - { - dataIndex: 'Description_Info', - title: '日结校验', - width:500, - ellipsis:true, - hideInSearch:true, - render:(_,record)=>{ - return
{ - `${record?.Description_Staff?`${record?.Description_Staff.split('【')[0]}:`:''} ${record?.Description_Info} ${record?.Approved_Staff?`|${record?.Approved_Staff}:`:''} ${record?.Approved_Info}` - }
- } - }, - { - dataIndex: 'TotalSell_Amount', - title: '总销售额', - align: 'right', - hideInSearch:true, - render:(_,record)=>{ - return {fmoney(record.TotalSell_Amount,2)} - } - }, - { - dataIndex: 'Difference_Amount', - title: '长短款', - align: 'right', - width:70, - hideInSearch:true, - render:(_,record)=>{ - return 0?'green':Number(record.Difference_Amount)<0?'red':''}}>{fmoney(record.Difference_Amount,2)} - } - }, - { - dataIndex: 'Revenue_Amount', - title: '实收金额', - align: 'right', - hideInSearch:true, - render:(_,record)=>{ - return {fmoney(record.Revenue_Amount,2)} - } - }, - { - dataIndex: 'Endaccount_EndDate', - title: '结账日期', - align: 'center', - width:200 - }, - { - dataIndex: 'Endaccount_State', - title: '有效状态', - width:90, - valueEnum:{ - 1:{text:'有效'}, - 0:{text:'无效'} - }, - render:(_,record)=>{ - return {record.Endaccount_State===1?'有效':record.Endaccount_State===0?'无效':''} - } - }, + const columns: any = [ + { + dataIndex: 'key', + title: '序号', + width: 50, + align: 'center', + }, + { + dataIndex: 'Treatment_MarkState', + title: '处理状态', + width: 90, + align: 'center', + render: (_, record) => { + return { + setShowDrawer(true); + setCurrentRow(record) + }} + style={{ color: '#0066FF', textDecoration: 'underline', cursor: 'pointer' }} + >账期退回 + } + }, + { + dataIndex: 'Serverpart_Name', + title: '服务区名称', + width: 120, + ellipsis: true + }, + { + dataIndex: 'ServerpartShop_Name', + title: '门店名称', + valueType: 'select', + width: 150, + ellipsis: true + }, + { + dataIndex: 'Description_Info', + title: '日结校验', + width: 500, + ellipsis: true, + hideInSearch: true, + render: (_, record) => { + return
{ + `${record?.Description_Staff ? `${record?.Description_Staff.split('【')[0]}:` : ''} ${record?.Description_Info} ${record?.Approved_Staff ? `|${record?.Approved_Staff}:` : ''} ${record?.Approved_Info}` + }
+ } + }, + { + dataIndex: 'TotalSell_Amount', + title: '总销售额', + align: 'right', + hideInSearch: true, + render: (_, record) => { + return {fmoney(record.TotalSell_Amount, 2)} + } + }, + { + dataIndex: 'Difference_Amount', + title: '长短款', + align: 'right', + width: 70, + hideInSearch: true, + render: (_, record) => { + return 0 ? 'green' : Number(record.Difference_Amount) < 0 ? 'red' : '' }}>{fmoney(record.Difference_Amount, 2)} + } + }, + { + dataIndex: 'Revenue_Amount', + title: '实收金额', + align: 'right', + hideInSearch: true, + render: (_, record) => { + return {fmoney(record.Revenue_Amount, 2)} + } + }, + { + dataIndex: 'Endaccount_EndDate', + title: '结账日期', + align: 'center', + width: 200 + }, + { + dataIndex: 'Endaccount_State', + title: '有效状态', + width: 90, + valueEnum: { + 1: { text: '有效' }, + 0: { text: '无效' } + }, + render: (_, record) => { + return {record.Endaccount_State === 1 ? '有效' : record.Endaccount_State === 0 ? '无效' : ''} + } + }, - ] - const { loading, data: serviceList } = useRequest(async ()=>{ - const options = await getServerpartOption() - const list: any = [] - if (options && options.length>0){ - options.forEach((item: any)=>{ - if (item.value!==424){ - list.push(item) - } - }) - setSelectServicePartId(list[0].value) + ] + const { loading, data: serviceList } = useRequest(async () => { + const options = await getServerpartOption() + const list: any = [] + if (options && options.length > 0) { + options.forEach((item: any) => { + if (item.value !== 424) { + list.push(item) } - return list - }) - const handleGetTableList = async ()=>{ - const newSelect: any = [] - setTableLoading(true) - const req = { - ServerpartIds: selectServicePartId, - ServerpartShopCode: selectShopId, - StartDate: moment(selectTime[0]).format('YYYY-MM-DD'), - EndDate: moment(selectTime[1]).format('YYYY-MM-DD'), - EndaccountState:selectState, - PageSize:999999 - } - const data = await handleGetAccountList(req) - if (data && data.List && data.List.length>0){ - const list = [] - data.List.forEach((item: any,index: number)=>{ - item.key = index + 1 - list.push(item) - if (selectedOrderRowKeys && selectedOrderRowKeys.length>0){ - if (selectedOrderRowKeys.indexOf(item.Endaccount_Id)!==-1){ - newSelect.push(item.Endaccount_Id) - } - } - }) - setSelectedOrderRowKeys(newSelect) - setTableData(list) - }else{ - setSelectedOrderRowKeys([]) - setTableData([]) - } - setTableLoading(false) + }) + setSelectServicePartId(list[0].value) } - - const closeModal = ()=>{ - setShowDrawer(false); - setShowModal(false) + return list + }) + const handleGetTableList = async () => { + const newSelect: any = [] + setTableLoading(true) + const req = { + ServerpartIds: selectServicePartId, + ServerpartShopCode: selectShopId, + StartDate: moment(selectTime[0]).format('YYYY-MM-DD'), + EndDate: moment(selectTime[1]).format('YYYY-MM-DD'), + EndaccountState: selectState, + PageSize: 999999 } + const data = await handleGetAccountList(req) + if (data && data.List && data.List.length > 0) { + const list = [] + data.List.forEach((item: any, index: number) => { + item.key = index + 1 + list.push(item) + if (selectedOrderRowKeys && selectedOrderRowKeys.length > 0) { + if (selectedOrderRowKeys.indexOf(item.Endaccount_Id) !== -1) { + newSelect.push(item.Endaccount_Id) + } + } + }) + setSelectedOrderRowKeys(newSelect) + setTableData(list) + } else { + setSelectedOrderRowKeys([]) + setTableData([]) + } + setTableLoading(false) + } - // 结账校验详情下方的三个按钮调用的时间 + const closeModal = () => { + setShowDrawer(false); + setShowModal(false) + } + + // 结账校验详情下方的三个按钮调用的时间 // 日期账期异常处理的 1保存 2回退 3无效 - const handleError = async (type: number,reason?: string,isBatch?: boolean)=>{ - let req = {} - if (type===1){ + const handleError = async (type: number, reason?: string, isBatch?: boolean) => { + let req = {} + if (type === 1) { + let ids: string = '' + selectTableList.forEach((item: any) => { + if (ids) { + ids += `,${item.Endaccount_Id}` + } else { + ids = item.Endaccount_Id + } + }) + req = { + OperateType: type, + EndaccountIds: ids, + StatisticsDate: reason ? moment(reason).format('YYYY-MM-DD') : '' + } + } else { + if (isBatch) { let ids: string = '' - selectTableList.forEach((item: any)=>{ - if (ids){ - ids+=`,${item.Endaccount_Id}` - }else{ + selectTableList.forEach((item: any) => { + if (ids) { + ids += `,${item.Endaccount_Id}` + } else { ids = item.Endaccount_Id } }) req = { - OperateType:type, - EndaccountIds:ids, - StatisticsDate:reason?moment(reason).format('YYYY-MM-DD'):'' + OperateType: type, + EndaccountIds: ids, + OperateReason: reason, } - }else{ - if (isBatch){ - let ids: string = '' - selectTableList.forEach((item: any)=>{ - if (ids){ - ids+=`,${item.Endaccount_Id}` - }else{ - ids = item.Endaccount_Id - } - }) - req = { - OperateType:type, - EndaccountIds:ids, - OperateReason:reason, - } - }else{ - req = { - OperateType:type, - EndaccountIds:currentRow.Endaccount_Id, - OperateReason:reason, - } + } else { + req = { + OperateType: type, + EndaccountIds: currentRow.Endaccount_Id, + OperateReason: reason, } } - const data = await handleDailyException(req) - if (data.Result_Code===100){ - message.success(data.Result_Desc) - closeModal() - handleGetTableList() - }else{ - message.error(data.Result_Desc) - } + } + const data = await handleDailyException(req) + if (data.Result_Code === 100) { + message.success(data.Result_Desc) + closeModal() + handleGetTableList() + } else { + message.error(data.Result_Desc) + } } - const handleChangeShowDisable = (type: boolean)=>{ + const handleChangeShowDisable = (type: boolean) => { setShowDisable(type) } - useEffect(() => { - handleGetTableList() - }, []); + useEffect(() => { + handleGetTableList() + }, []); - return ( - -
-
-
- 服务区: - -
-
- 门店: - -
-
- 有效状态: - -
-
- 时间: - { - if (e){ - setSelectTime([moment(e[0]._d),moment(e[1]._d)]) - } - }} - /> -
-
-
- - -
-
-
- { - let isFlag: boolean = true - if (selectTableList){ - selectTableList.forEach((item: any)=>{ - if (item.Endaccount_State===0){ - isFlag = false - } - }) - } - if (selectTableList && selectTableList.length>0&& isFlag){ - setModalType(1) - setShowModal(true) - }else if(!isFlag){ - message.error('请检查,选择行中有无效行') - } - else{ - message.error('请先选择') - } - }} - > - 调整日期 - , - , - ], - }} - onRow={(record)=>{ - return { - // onClick: () => { - // setShowDrawer(true); - // setCurrentRow(record) - // }, + return ( + +
+
+
+ 服务区: +
- - { - setShowDrawer(false); - }} - destroyOnClose={true} - footer={ -
- { - currentRow?.Treatment_MarkState===2 || currentRow?.Treatment_MarkState===3? - { - checkDetail.current?.formRef.current?.submit() - checkDetail.current?.formRef.current?.validateFields().then(res=>{ - if (res){ - handleError(2,res.Review_Info) - } - }) - }} - okText="确认" - cancelText="取消" - > - - :'' - } - { - currentRow?.Endaccount_State===1? - { - checkDetail.current?.formRef.current?.submit() - checkDetail.current?.formRef.current?.validateFields().then(res=>{ - if (res){ - handleError(3,res.Review_Info) - } - - }) - }} - okText="确认" - cancelText="取消" - > - - :'' - } - { - currentRow?.Endaccount_State===0? - :'' - } - -
- } - > - -
- - { - setShowModal(false) +
+ 门店: + +
+
+ 有效状态: + +
+
+ 时间: + { + if (e) { + setSelectTime([moment(e[0]._d), moment(e[1]._d)]) + } + }} + /> +
+
+
+ + +
+
+
+ { + let isFlag: boolean = true + if (selectTableList) { + selectTableList.forEach((item: any) => { + if (item.Endaccount_State === 0) { + isFlag = false } - } - }) - }}>驳回, - ]:''}> - { - return [] - } - }} - > - { - modalType===1? - :modalType===2? - - :'' + }) } - - - - ) + if (selectTableList && selectTableList.length > 0 && isFlag) { + setModalType(1) + setShowModal(true) + } else if (!isFlag) { + message.error('请检查,选择行中有无效行') + } + else { + message.error('请先选择') + } + }} + > + 调整日期 + , + , + ], + }} + onRow={(record) => { + return { + // onClick: () => { + // setShowDrawer(true); + // setCurrentRow(record) + // }, + } + }} + > + + +
+ + { + setShowDrawer(false); + }} + destroyOnClose={true} + footer={ +
+ { + currentRow?.Treatment_MarkState === 2 || currentRow?.Treatment_MarkState === 3 ? + { + checkDetail.current?.formRef.current?.submit() + checkDetail.current?.formRef.current?.validateFields().then(res => { + if (res) { + handleError(2, res.Review_Info) + } + }) + }} + okText="确认" + cancelText="取消" + > + + : '' + } + { + currentRow?.Endaccount_State === 1 ? + { + checkDetail.current?.formRef.current?.submit() + checkDetail.current?.formRef.current?.validateFields().then(res => { + if (res) { + handleError(3, res.Review_Info) + } + + }) + }} + okText="确认" + cancelText="取消" + > + + : '' + } + { + currentRow?.Endaccount_State === 0 ? + : '' + } + +
+ } + > + +
+ + { + setShowModal(false) + }} + footer={ + modalType === 1 ? [ + , + + ] : modalType === 2 ? [ + , + , + ] : ''}> + { + return [] + } + }} + > + { + modalType === 1 ? + : modalType === 2 ? + + : '' + } + + +
+ ) } export default connect(({ user }: ConnectState) => ({ - currentUser: user?.currentUser + currentUser: user?.currentUser }))(List); diff --git a/src/pages/DataVerification/list/components/ItemDetail.tsx b/src/pages/DataVerification/list/components/ItemDetail.tsx index 22c40e8..3144621 100644 --- a/src/pages/DataVerification/list/components/ItemDetail.tsx +++ b/src/pages/DataVerification/list/components/ItemDetail.tsx @@ -205,8 +205,10 @@ const ItemDetail: React.FC<{ currentItem?: any, showDetail?: any, currentRow?: a console.log('leftList', leftList); if (leftList && leftList.length > 0) { - setSelectLeftTime(leftList[0].value) - handleGetDetail(leftList[0].value, selectTab) + // setSelectLeftTime(leftList[0].value) + // handleGetDetail(leftList[0].value, selectTab) + setSelectLeftTime(currentRow?.Endaccount_Id) + handleGetDetail(currentRow?.Endaccount_Id, selectTab) } else { formRef.current?.resetFields() } diff --git a/src/pages/DataVerification/list/list.tsx b/src/pages/DataVerification/list/list.tsx index 7f20f9f..79a1bd5 100644 --- a/src/pages/DataVerification/list/list.tsx +++ b/src/pages/DataVerification/list/list.tsx @@ -37,7 +37,7 @@ import haveOwner from '@/assets/DataVerification/haveOwner.png' import interfaceImg from '@/assets/DataVerification/interface.png' import defaultIcon from '@/assets/brand/defaultIcon.png' import ItemDetail from './components/ItemDetail' -import { dailyVerifyEndaccount, handleGetAccountList, handleGetServiceShopList, submitEndaccountState } from "@/pages/DataVerification/service"; +import { dailyVerifyEndaccount, handleGetAccountList, handleGetServerpartShopList, handleGetServiceShopList, submitEndaccountState } from "@/pages/DataVerification/service"; import changeIcon from '../../../assets/versionChange.png' import ProForm, { ProFormInstance, ProFormSelect } from "@ant-design/pro-form"; import UnUploadDetail from "./components/unUploadDetail"; @@ -49,7 +49,7 @@ const List: React.FC<{ currentUser?: CurrentUser }> = ({ currentUser }) => { const UnUploadDetailRef = useRef() - const [currentRow, setCurrentRow] = useState() + const [currentRow, setCurrentRow] = useState() // 切换页面版本 const [pageVersion, setPageVersion] = useState<'new' | 'old'>('new') const [selectService, setSelectService] = useState()// 页面选择的服务区 @@ -98,6 +98,7 @@ const List: React.FC<{ currentUser?: CurrentUser }> = ({ currentUser }) => { dataIndex: 'Serverpart_Name', title: '服务区名称', width: 120, + ellipsis: true, }, { dataIndex: 'ServerpartShop_Name', @@ -305,6 +306,7 @@ const List: React.FC<{ currentUser?: CurrentUser }> = ({ currentUser }) => { EndDate: moment(selectTime[1]).format('YYYY-MM-DD'), TreatmentMarkState: selectState || selectState === 0 ? selectState : '', EndaccountState: selectState || selectState === 0 ? 1 : '', + PageIndex: 1, PageSize: 999999 } const data = await handleGetAccountList(req) @@ -515,16 +517,37 @@ const List: React.FC<{ currentUser?: CurrentUser }> = ({ currentUser }) => { } onChange={async (e) => { setSelectServicePartId(e) + // const req = { + // ProvinceCode: currentUser?.ProvinceCode, + // ServerpartId: e, + // ShowWholePower: true + // } + // const data = await handleGetServiceShopList(req) + // console.log('datadatadatadatadata', data); + + const req = { - ProvinceCode: currentUser?.USER_PROVINCE, - ServerpartId: e, - ShowWholePower: true + SearchParameter: { + SERVERPART_IDS: e, + ISVALID: 1 + }, + PageIndex: 1, + PageSize: 999999, + SortStr: "SHOPREGION,SHOPTRADE,SHOPSHORTNAME,SHOPCODE" } - const data = await handleGetServiceShopList(req) + const data = await handleGetServerpartShopList(req) + console.log('shop', data); + let list: any = [] + if (data && data.length > 0) { + data.forEach((item: any) => { + list.push({ label: item.SHOPNAME, value: item.SHOPCODE }) + }) + } + setSelectShopId(null) - let list: any = data.List + // let list: any = data.List list.unshift({ label: '全部', value: '' }) - setShopList(data.List) + setShopList(list) }} >
@@ -585,6 +608,7 @@ const List: React.FC<{ currentUser?: CurrentUser }> = ({ currentUser }) => { className={'proTableBox'} search={false} columns={columns} + bordered dataSource={tableData} scroll={{ y: 'calc(100vh - 470px)' }} pagination={{ pageSize: 20 }} @@ -607,6 +631,7 @@ const List: React.FC<{ currentUser?: CurrentUser }> = ({ currentUser }) => { destroyOnClose={true} onClose={() => { setShowDetail(false); + setCurrentRow(null) }} footer={ selectChildrenTab ? diff --git a/src/pages/DataVerification/list/newStyle.less b/src/pages/DataVerification/list/newStyle.less index bffc372..88c160e 100644 --- a/src/pages/DataVerification/list/newStyle.less +++ b/src/pages/DataVerification/list/newStyle.less @@ -1,30 +1,36 @@ -.qualificationsData{ +.qualificationsData { width: 100%; height: 100%; - .dataBox{ + + .dataBox { width: 100%; - height: 120px; + height: 130px; box-sizing: border-box; padding: 16px 24px; background: #fff; - .dataBoxTop{ + + .dataBoxTop { display: flex; align-items: center; justify-content: space-between; - .dataBoxTopLeft{ + + .dataBoxTopLeft { display: flex; align-items: center; - .leftIcon{ + + .leftIcon { width: 28px; height: 28px; margin-right: 8px; } - .pageSelect{ + + .pageSelect { width: 150px; } } - .dataBoxTopRight{ - .versionChangeBox{ + + .dataBoxTopRight { + .versionChangeBox { color: #fff; border-color: #40a9ff; background: #40a9ff; @@ -35,7 +41,8 @@ align-items: center; padding: 4px 15px; cursor: pointer; - .changeIcon{ + + .changeIcon { width: 20px; height: 20px; margin-right: 8px; @@ -43,64 +50,77 @@ } } } - .dataBoxBottom{ + + .dataBoxBottom { width: 100%; box-sizing: border-box; padding: 0 36px; margin-top: 12px; display: flex; - .dataBoxBottomLeft{ + + .dataBoxBottomLeft { width: 70%; display: flex; align-items: center; - .bottomItem{ + + .bottomItem { width: 30%; display: flex; - .typeIcon{ + + .typeIcon { width: 44px; height: 44px; border-radius: 8px; } - .smallData{ + + .smallData { margin-left: 12px; - .dataLabel{ + + .dataLabel { font-size: 14px; font-family: PingFangSC-Regular, PingFang SC; font-weight: 400; - color: rgba(0,0,0,0.65); + color: rgba(0, 0, 0, 0.65); line-height: 22px; } - .warningBoxs{ + + .warningBoxs { display: flex; position: relative; - .dataLabel{ + + .dataLabel { font-size: 14px; font-family: PingFangSC-Regular, PingFang SC; font-weight: 400; - color: rgba(0,0,0,0.65); + color: rgba(0, 0, 0, 0.65); line-height: 22px; margin-right: 8px; } - .unUpload{ + + .unUpload { display: flex; align-items: center; - .warningIcon{ + + .warningIcon { width: 22px; height: 22px; } - .unUploadText{ + + .unUploadText { font-size: 14px; font-family: AppleColorEmoji; color: #1890FF; line-height: 22px; margin-left: 4px; } - .text{ + + .text { font-size: 14px; line-height: 22px; } } - .uploadBox{ + + .uploadBox { display: block; white-space: nowrap; z-index: 99; @@ -108,11 +128,13 @@ border-radius: 8px; background: #fff; position: absolute; - top: 18px;left: 0; + top: 18px; + left: 0; box-shadow: 0 1px 2px -2px rgba(0, 0, 0, 0.16), 0 3px 6px 0 rgba(0, 0, 0, 0.12), 0 5px 12px 4px rgba(0, 0, 0, 0.09); } } - .dataValue{ + + .dataValue { font-size: 20px; font-family: DINAlternate-Bold, DINAlternate; font-weight: bold; @@ -122,7 +144,8 @@ } } } - .dataBoxBottomRight{ + + .dataBoxBottomRight { width: 30%; display: flex; align-items: center; @@ -131,39 +154,44 @@ } } - .dataList{ + .dataList { width: 100%; margin-top: 20px; height: calc(100vh - 280px); box-sizing: border-box; padding-bottom: 20px; position: relative; - .LoadingBox{ + + .LoadingBox { width: 100%; height: 100%; position: absolute; - right: 0;top: 0; + right: 0; + top: 0; z-index: 999; - background:rgba(0,0,0,0.1); + background: rgba(0, 0, 0, 0.1); display: flex; justify-content: center; align-items: center; - .loading{ - display:flex; - align-items:center; - padding:15px 20px 10px; - background:#fff; - border-radius:8px; + + .loading { + display: flex; + align-items: center; + padding: 15px 20px 10px; + background: #fff; + border-radius: 8px; } } - .listBox{ + + .listBox { width: 100%; height: 100%; display: flex; flex-wrap: wrap; overflow-y: auto; align-content: flex-start; - .listItem{ + + .listItem { cursor: pointer; margin-bottom: 20px; width: calc((100% - 68px) / 4); @@ -173,22 +201,26 @@ background: linear-gradient(180deg, rgba(246, 250, 255, 1) 0%, rgba(254, 255, 255, 1) 60%, rgba(255, 255, 255, 1) 100%); border-radius: 8px; border: 1px solid #E7E7E7; - .itemTop{ + + .itemTop { display: flex; - .itemImg{ + + .itemImg { width: 56px; height: 56px; margin-right: 12px; } - .topBox{ - .topText{ + + .topBox { + .topText { font-size: 16px; font-family: PingFangSC-Medium, PingFang SC; font-weight: 500; - color: rgba(0,0,0,0.85); + color: rgba(0, 0, 0, 0.85); line-height: 22px; } - .typeList{ + + .typeList { display: inline-block; margin-top: 6px; box-sizing: border-box; @@ -204,72 +236,82 @@ } } - .listItemCenter{ + .listItemCenter { margin-top: 20px; padding-bottom: 20px; border-bottom: 1px solid rgba(0, 0, 0, 0.06); - .realMoneyBox{ + + .realMoneyBox { display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; - .moneyLeft{ + + .moneyLeft { display: flex; align-items: center; - .moneyIcon{ + + .moneyIcon { width: 24px; height: 24px; margin-right: 4px; } - .leftLabel{ + + .leftLabel { font-size: 14px; font-family: PingFangSC-Regular, PingFang SC; font-weight: 400; - color: rgba(0,0,0,0.65); + color: rgba(0, 0, 0, 0.65); line-height: 22px; } } - .moneyRight{ + + .moneyRight { font-size: 18px; font-family: DINAlternate-Bold, DINAlternate; font-weight: bold; - color: rgba(0,0,0,0.85); + color: rgba(0, 0, 0, 0.85); line-height: 22px; } } - .progressBox{ - .boxTop{ + .progressBox { + .boxTop { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; - .boxTopLabel{ + + .boxTopLabel { font-size: 14px; font-family: PingFangSC-Regular, PingFang SC; font-weight: 400; - color: rgba(0,0,0,0.65); + color: rgba(0, 0, 0, 0.65); line-height: 22px; } - .boxTopValue{ + + .boxTopValue { font-size: 14px; font-family: PingFangSC-Semibold, PingFang SC; font-weight: 600; - color: rgba(0,0,0,0.85); + color: rgba(0, 0, 0, 0.85); line-height: 22px; } } - .progress{ + + .progress { width: 100%; height: 8px; background: #EDEDED; border-radius: 5px; position: relative; - .have{ - width:50%; + + .have { + width: 50%; height: 100%; - position:absolute; - left: 0;top: 0; + position: absolute; + left: 0; + top: 0; background: #5B75FF; border-radius: 5px; } @@ -277,26 +319,29 @@ } } - .codeBox{ + .codeBox { display: flex; align-items: center; justify-content: space-between; margin-top: 22px; - .codeLeft{ - .code{ + + .codeLeft { + .code { width: 24px; height: 24px; margin-right: 6px; } - .text{ + + .text { font-size: 14px; font-family: PingFangSC-Regular, PingFang SC; font-weight: 400; - color: rgba(0,0,0,0.65); + color: rgba(0, 0, 0, 0.65); line-height: 22px; } } - .codeRight{ + + .codeRight { font-size: 14px; font-family: PingFangSC-Regular, PingFang SC; font-weight: 400; @@ -316,8 +361,8 @@ -.oldPageBox{ - .searchBox{ +.oldPageBox { + .searchBox { display: flex; align-items: center; justify-content: space-between; @@ -328,23 +373,28 @@ margin-bottom: 24px; border-radius: 4px; display: flex; - .searchBoxLeft{ + + .searchBoxLeft { display: flex; align-items: center; - .searchItem{ + + .searchItem { display: flex; align-items: center; flex-wrap: wrap; margin-right: 12px; - .searchLabel{ + + .searchLabel { margin-right: 4px; } } } - .searchBoxRight{ + + .searchBoxRight { display: flex; align-items: center; - .versionChangeBox{ + + .versionChangeBox { color: #fff; border-color: #40a9ff; background: #40a9ff; @@ -356,7 +406,8 @@ padding: 4px 15px; cursor: pointer; text-align: center; - .changeIcon{ + + .changeIcon { width: 20px; height: 20px; margin-right: 8px; @@ -364,23 +415,26 @@ } } } - .tableBox{ + + .tableBox { box-sizing: border-box; padding: 24px; background: #fff; - .proTableBox{ - .ant-pro-card{ - .ant-pro-card-body{ - .ant-table-wrapper{ - .ant-spin-nested-loading{ - .ant-spin-container{ - .ant-table{ - .ant-table-container{ - .ant-table-body{ - .ant-table-tbody{ - .greyRow{ + + .proTableBox { + .ant-pro-card { + .ant-pro-card-body { + .ant-table-wrapper { + .ant-spin-nested-loading { + .ant-spin-container { + .ant-table { + .ant-table-container { + .ant-table-body { + .ant-table-tbody { + .greyRow { background: #e1e1e1; - .ant-table-cell-row-hover{ + + .ant-table-cell-row-hover { background: #e1e1e1; } } @@ -395,5 +449,5 @@ } } } - + } \ No newline at end of file diff --git a/src/pages/ahjgPage/InventoryDetails/components/InventoryDetailModal.tsx b/src/pages/ahjgPage/InventoryDetails/components/InventoryDetailModal.tsx index bddd1bd..bc3b5e4 100644 --- a/src/pages/ahjgPage/InventoryDetails/components/InventoryDetailModal.tsx +++ b/src/pages/ahjgPage/InventoryDetails/components/InventoryDetailModal.tsx @@ -5,7 +5,7 @@ import ProForm, { ProFormDigit, ProFormSelect, ProFormText, ProFormTextArea } fr import { useRef, useState } from "react"; import Draggable from "react-draggable"; import React from "react"; -import { handleGetINSALES_STATISTICDetail } from "../../service"; +import { handleGetCommodityInSaleList, handleGetGetCOMMODITYDetail, handleGetINSALES_STATISTICDetail } from "../../service"; import session from "@/utils/session"; import COMMODITYINFO from "./COMMODITYINFO"; @@ -13,8 +13,10 @@ type DetailProps = { onShow: boolean parentRow: any onCancel: any + come?: string } -const InventoryDetailModal = ({ onShow, parentRow, onCancel }: DetailProps) => { +const InventoryDetailModal = ({ onShow, parentRow, onCancel, come }: DetailProps) => { + // come 若等于 inventory 那么说明是库存里面来的 那么请求详情的方法就不一样了 const formRef = useRef(); const draggleRef = React.createRef() @@ -102,18 +104,128 @@ const InventoryDetailModal = ({ onShow, parentRow, onCancel }: DetailProps) => { submitter={false} preserve={false} request={async () => { - if (!parentRow?.INSALES_STATISTIC_ID) { - return {} - } - console.log('parentRowparentRowparentRowparentRow', parentRow); + if (come === 'inventory') { + console.log('parentRowparentRowparentRowparentRow', parentRow); + const req: any = { + ServerpartShopId: parentRow?.ServerpartShop_Id, + CommodityId: parentRow?.COMMODITY_ID, + CommodityBarcode: parentRow?.COMMODITY_BARCODE, + } + const data = await handleGetCommodityInSaleList(req) + console.log('datadatadatadatadatadata', data); + let obj: any = {} + if (data && data.length > 0) { + /// 1000:入库业务 + /// 2000:调拨业务 + /// 3000:退货业务 + /// 4000:领用业务 + /// 5000:单品销售 + /// 6000:盘点结存 + /// 6001:盘点损溢 + /// 6002:上期盘点结存 + /// 6003:上期盘点损溢 + data.forEach((item: any) => { + if (item.OPERATE_TYPE === 1000) { + obj = { + ...obj, + PURCHASE_COUNT: item.OPERATE_COUNT,// 入库数量 + PURCHASE_TAXPRICE: item.PURCHASE_TAXPRICE,// 含税单价 + PURCHASE_TOTALTAXPRICE: item.OPERATE_TAXAMOUNT,// 含税金额 + PURCHASE_PRICE: item.PURCHASE_PRICE,// 除税单价 + PURCHASE_TOTALPRICE: item.OPERATE_AMOUNT,// 除税金额 + } + } else if (item.OPERATE_TYPE === 2000) { + obj = { + ...obj, + TRANSFER_COUNT: item.OPERATE_COUNT,// 调拨数量 + TRANSFER_AMOUNT: item.OPERATE_TAXAMOUNT,// 调拨金额 + TRANSFER_PRICE: item.OPERATE_AMOUNT,// 除税金额 + } + } else if (item.OPERATE_TYPE === 3000) { + obj = { + ...obj, + BACK_COUNT: item.OPERATE_COUNT,// 退货数量 + BACK_AMOUNT: item.OPERATE_TAXAMOUNT,// 退货金额 + BACK_PRICE: item.OPERATE_AMOUNT,// 除税金额 + } + } else if (item.OPERATE_TYPE === 4000) { + obj = { + ...obj, + RECEIVE_COUNT: item.OPERATE_COUNT,// 领用数量 + RECEIVE_AMOUNT: item.OPERATE_TAXAMOUNT,// 领用金额 + RECEIVE_PRICE: item.OPERATE_AMOUNT,// 除税金额 + } + } else if (item.OPERATE_TYPE === 5000) { + obj = { + ...obj, + SELL_COUNT: item.OPERATE_COUNT,// 销售数量 + SELL_UNITTAXPRICE: item.PURCHASE_TAXPRICE,// 含税单价 + SELL_TOTALTAXPRICE: item.OPERATE_TAXAMOUNT,// 含税金额 + // SELL_COST: item.OPERATE_AMOUNT,// 含税成本 + SELL_UNITPRICE: item.PURCHASE_PRICE,// 除税单价 + SELL_TOTALPRICE: item.OPERATE_AMOUNT,// 除税金额 + // SELL_COSTPRICE: item.OPERATE_AMOUNT,// 除税成本 + } + } else if (item.OPERATE_TYPE === 6000) { + obj = { + ...obj, + PURCHASE_COUNT: item.OPERATE_COUNT,// 入库数量 + PURCHASE_TAXPRICE: item.PURCHASE_TAXPRICE,// 含税单价 + PURCHASE_TOTALTAXPRICE: item.OPERATE_TAXAMOUNT,// 含税金额 + PURCHASE_PRICE: item.PURCHASE_PRICE,// 除税单价 + LAST_OVERPLUSPRICE: item.OPERATE_AMOUNT,// 上期库存除税 + } + } else if (item.OPERATE_TYPE === 6001) { + obj = { + ...obj, + LOSSPROFIT_COUNT: item.OPERATE_COUNT,// 损溢数量 + LOSSPROFIT_AMOUNT: item.OPERATE_TAXAMOUNT,// 损溢金额 + LOSSPROFIT_PRICE: item.OPERATE_AMOUNT,// 损溢除税 + } + } else if (item.OPERATE_TYPE === 6002) { + obj = { + ...obj, + LAST_OVERPLUSCOUNT: item.OPERATE_COUNT,// 上期库存数量 + LAST_OVERPLUSAMOUNT: item.OPERATE_TAXAMOUNT,// 上期库存金额 + LAST_OVERPLUSPRICE: item.OPERATE_AMOUNT,// 上期库存除税 + } + } else if (item.OPERATE_TYPE === 6003) { - const req: any = { - INSALES_STATISTICId: parentRow?.INSALES_STATISTIC_ID + } + }) + } + // 商品详情再调用一下 + const detail: any = await handleGetGetCOMMODITYDetail({ COMMODITYId: parentRow?.COMMODITY_ID }) + console.log('detaildetaildetaildetail', detail); + obj = { + ...obj, + SERVERPART_NAME: parentRow?.Serverpart_Name, // 服务区名 + SHOPNAME: parentRow?.ServerpartShop_Name, // 门店名称 + COMMODITY_CODE: detail?.COMMODITY_CODE, // 商品编码 + BUSINESSTYPE: detail?.BUSINESSTYPE, // 业态 + COMMODITY_TYPE: detail?.COMMODITY_TYPE, // 商品类型 + COMMODITY_BARCODE: detail?.COMMODITY_BARCODE, // 商品条码 + COMMODITY_NAME: detail?.COMMODITY_NAME, // 商品名称 + COMMODITY_UNIT: detail?.COMMODITY_UNIT, // 商品单位 + COMMODITY_RULE: detail?.COMMODITY_RULE, // 商品规格 + CHECKDATE_Start: "", + CHECKDATE: "", + } + return obj + } else { + if (!parentRow?.INSALES_STATISTIC_ID) { + return {} + } + console.log('parentRowparentRowparentRowparentRow', parentRow); + + const req: any = { + INSALES_STATISTICId: parentRow?.INSALES_STATISTIC_ID + } + const data = await handleGetINSALES_STATISTICDetail(req) + console.log('抽屉的详情', data); + setCommodityDetail(data) + return data } - const data = await handleGetINSALES_STATISTICDetail(req) - console.log('抽屉的详情', data); - setCommodityDetail(data) - return data }} > 商品基本信息 diff --git a/src/pages/ahjgPage/InventoryDetails/index.tsx b/src/pages/ahjgPage/InventoryDetails/index.tsx index 2e2e644..4da0ec7 100644 --- a/src/pages/ahjgPage/InventoryDetails/index.tsx +++ b/src/pages/ahjgPage/InventoryDetails/index.tsx @@ -907,7 +907,7 @@ const InventoryDetails: React.FC<{ currentUser: CurrentUser, isComponents?: any, PageIndex: 1, PageSize: 999999 } - + setSearchParams(fromRes) console.log('reqreqreqreqreqreqreqreq', req); } else if (isComponents) { req = { @@ -920,6 +920,7 @@ const InventoryDetails: React.FC<{ currentUser: CurrentUser, isComponents?: any, PageIndex: 1, PageSize: 999999 } + setSearchParams(params) } else { req = { SearchParameter: { @@ -930,9 +931,10 @@ const InventoryDetails: React.FC<{ currentUser: CurrentUser, isComponents?: any, PageIndex: 1, PageSize: 999999 } + setSearchParams(params) } - setSearchParams(params) + const data = await handleGetINSALES_STATISTICList(req) console.log('dkasjdkajd', data); if (data && data.length > 0) { @@ -1046,7 +1048,7 @@ const InventoryDetails: React.FC<{ currentUser: CurrentUser, isComponents?: any, buttonText={'导出excel'} ref={downloadBtnRef} table="table-to-xls-InventoryDetails" - filename={`进销存明细报表${searchParams?.InventoryTime}`} + filename={`进销存明细报表${searchParams?.InventoryTime || ""}`} sheet="sheet1" /> , diff --git a/src/pages/ahjgPage/inventoryInformation/components/inventoryDetail.tsx b/src/pages/ahjgPage/inventoryInformation/components/inventoryDetail.tsx index 00c9eda..f165730 100644 --- a/src/pages/ahjgPage/inventoryInformation/components/inventoryDetail.tsx +++ b/src/pages/ahjgPage/inventoryInformation/components/inventoryDetail.tsx @@ -221,7 +221,7 @@ const inventoryDetail = ({ onShow, onCancel, parentRow, currentUser, ServerpartI {/* 进销存明细的悬浮框 */} - +
) } diff --git a/src/pages/ahjgPage/purchaseReceiving/index.tsx b/src/pages/ahjgPage/purchaseReceiving/index.tsx index 5fb5d7d..1bbd560 100644 --- a/src/pages/ahjgPage/purchaseReceiving/index.tsx +++ b/src/pages/ahjgPage/purchaseReceiving/index.tsx @@ -14,6 +14,7 @@ import ReactHTMLTableToExcel from "react-html-table-to-excel"; import LeftSelectTree from "@/pages/reports/settlementAccount/component/leftSelectTree"; import PageTitleBox from "@/components/PageTitleBox"; import moment from "moment"; +import { handleGetMERCHANTSList, handleGetStorageBackSummary } from "../service"; const purchaseReceiving: React.FC<{ currentUser: CurrentUser }> = (props) => { @@ -36,6 +37,8 @@ const purchaseReceiving: React.FC<{ currentUser: CurrentUser }> = (props) => { const [showExportTable, setShowExportTable] = useState(false) // 查询的条件 const [searchParams, setSearchParams] = useState() + // 拿到服务区下的所有门店id集合 + const [handleAllShopId, sethandleAllShopId] = useState() const columns: any = [ { @@ -47,8 +50,8 @@ const purchaseReceiving: React.FC<{ currentUser: CurrentUser }> = (props) => { search: { transform: (value) => { return { - OPERATE_DATE_Start: value[0], - OPERATE_DATE_End: value[1], + StartDate: value[0], + EndDate: value[1], }; }, }, @@ -62,69 +65,128 @@ const purchaseReceiving: React.FC<{ currentUser: CurrentUser }> = (props) => { }, initialValue: [moment().startOf('M'), moment()], }, + { + title: "供应商", + dataIndex: "SupplierId", + valueType: 'select', + request: async () => { + const req: any = { + PROVINCE_CODE: currentUser?.ProvinceCode, + MERCHANTS_STATE: 1 + } + const data = await handleGetMERCHANTSList(req) + console.log('datadatadatadata', data); + let list: any = [] + if (data && data.length > 0) { + data.forEach((item: any) => { + list.push({ label: item.MERCHANTS_NAME, value: item.MERCHANTS_ID }) + }) + list.unshift({ label: "全部", value: "" }) + } + return list + }, + fieldProps: { + showSearch: true, + filterOption: (input: any, option: any) => (option?.label ?? '').toLowerCase().includes(input.toLowerCase()), + }, + initialValue: "", + hideInTable: true, + }, { title: "序号", dataIndex: "index", valueType: 'index', align: 'center', - width: 80, + width: 90, ellipsis: true, hideInSearch: true, }, { - title: "服务区名", - dataIndex: "", + title:
供应商/服务区名
, + dataIndex: "Serverpart_Name", + align: 'left', + width: 200, + ellipsis: true, + hideInSearch: true, + render: (_, record) => { + return record?.Serverpart_Name || record?.Supplier_Name + } + }, + { + title:
门店名称
, + dataIndex: "ServerpartShop_Name", align: 'center', width: 150, ellipsis: true, hideInSearch: true, }, { - title: "采购总数量", - dataIndex: "", - align: 'center', - width: 150, + title:
商品名称
, + dataIndex: "Commodity_Name", + align: 'left', + width: 200, ellipsis: true, hideInSearch: true, }, { - title: "采购含税金额", - dataIndex: "", - align: 'center', - width: 150, + title:
采购总数量
, + dataIndex: "Storage_Count", + align: 'right', + valueType: 'digit', + width: 120, + sorter: true, + defaultSortOrder: 'descend', ellipsis: true, hideInSearch: true, }, { - title: "采购除税金额", - dataIndex: "", - align: 'center', - width: 150, + title:
采购含税金额
, + dataIndex: "Storage_TaxAmount", + align: 'right', + valueType: 'digit', + width: 120, + sorter: true, ellipsis: true, hideInSearch: true, }, { - title: "入库总数量", - dataIndex: "", - align: 'center', - width: 150, + title:
采购除税金额
, + dataIndex: "Storage_Amount", + align: 'right', + valueType: 'digit', + width: 120, + sorter: true, ellipsis: true, hideInSearch: true, }, { - title: "入库含税金额", - dataIndex: "", - align: 'center', - width: 150, + title:
退货数量
, + dataIndex: "Back_Count", + align: 'right', + valueType: 'digit', + width: 120, + sorter: true, ellipsis: true, hideInSearch: true, }, { - title: "入库除税金额", - dataIndex: "", - align: 'center', - width: 150, + title:
退货含税金额
, + dataIndex: "Back_TaxAmount", + align: 'right', + valueType: 'digit', + width: 120, + sorter: true, + ellipsis: true, + hideInSearch: true, + }, + { + title:
退货除税金额
, + dataIndex: "Back_Amount", + align: 'right', + valueType: 'digit', + width: 120, + sorter: true, ellipsis: true, hideInSearch: true, } @@ -152,6 +214,34 @@ const purchaseReceiving: React.FC<{ currentUser: CurrentUser }> = (props) => { tempTable.remove() // 防止重复打印一个内容 } + const exportColumns: any = [ + { + title: "序号", + dataIndex: "index", + valueType: 'index', + align: 'center', + width: 90, + ellipsis: true, + hideInSearch: true, + }, + { + title:
服务区名
, + dataIndex: "Serverpart_Name", + align: 'left', + width: 200, + ellipsis: true, + hideInSearch: true, + }, + { + title:
供应商名
, + dataIndex: "Supplier_Name", + align: 'left', + width: 200, + ellipsis: true, + hideInSearch: true, + + }, + ] return (
{ @@ -193,7 +283,7 @@ const purchaseReceiving: React.FC<{ currentUser: CurrentUser }> = (props) => { { showExportTable && reqDetailList && reqDetailList.length > 0 ? = (props) => {
- +
= (props) => { expandable={{ expandRowByClick: true }} + rowKey={(record: any) => { + return `${record?.Supplier_Id}-${record?.Serverpart_Id}-${record?.ServerpartShop_Name}-${record?.Commodity_Id}-${record?.Commodity_BarCode}` + }} scroll={{ x: "100%", y: "calc(100vh - 410px)" }} headerTitle={} // 列表表头 search={{ span: 6 }} - request={async (params) => { + request={async (params, sorter) => { + console.log('selectedIdselectedIdselectedId', selectedId); + if (!selectedId) { return } + // 根据门店去判断 是哪个服务区里面的 再把服务区的id 记录下来 而且要去重 + let serverpartId: any = [] + + if (selectedId) { + let list: any = selectedId.split(',') + if (list && list.length > 0) { + list.forEach((item: any) => { + for (let key in handleAllShopId) { + console.log('handleAllShopId[key]', handleAllShopId[key]); + + if (handleAllShopId[key] && handleAllShopId[key].length > 0) { + if (handleAllShopId[key].indexOf(Number(item)) !== -1) { + if (serverpartId && serverpartId.length > 0) { + if (serverpartId.indexOf(key) === -1) { + serverpartId.push(key) + } + } else { + serverpartId.push(key) + } + } + } + } + }) + } + } + // 排序字段 + const sortstr = Object.keys(sorter).map(n => { + const value = sorter[n] + return value ? `${n} ${value.replace('end', '')}` : '' + }) + const req: any = { + ServerpartId: serverpartId && serverpartId.length > 0 ? serverpartId.toString() : "", + ServerpartShopId: selectedId, + SupplierId: params?.SupplierId || "", + StartDate: params?.StartDate || "", + EndDate: params?.EndDate || "", + SearchKeyName: "", + SearchKeyValue: "", + sortstr: sortstr.length ? sortstr.toString() : "", + } setSearchParams(params) + + const data = await handleGetStorageBackSummary(req) + console.log('dafjkdjaf', data); + if (data && data.length > 0) { + + let exportList: any = [] + data.forEach((item: any) => { + if (item.children && item.children.length > 0) { + item.children.forEach((subItem: any) => { + if (subItem.children && subItem.children.length > 0) { + subItem.children.forEach((thirdItem: any) => { + exportList.push(thirdItem) + }) + } + }) + } + }) + + setReqDetailList(exportList) + return { data, success: true } + } + return { data: [], success: true } }} toolbar={{ actions: [ @@ -237,7 +394,7 @@ const purchaseReceiving: React.FC<{ currentUser: CurrentUser }> = (props) => { buttonText={'导出excel'} ref={downloadBtnRef} table="table-to-xls-purchaseReceiving" - filename={`领用流程统计${searchParams?.StartDate}-${searchParams?.EndDate}`} + filename={`入库退货统计表${searchParams?.StartDate}-${searchParams?.EndDate}`} sheet="sheet1" /> , diff --git a/src/pages/ahjgPage/returnProcess/components/returnGoodsTable.tsx b/src/pages/ahjgPage/returnProcess/components/returnGoodsTable.tsx new file mode 100644 index 0000000..3a988d8 --- /dev/null +++ b/src/pages/ahjgPage/returnProcess/components/returnGoodsTable.tsx @@ -0,0 +1,274 @@ +import { connect } from "umi"; +import type { ConnectState } from "@/models/connect"; +import { Button, Descriptions, FormInstance, Modal } from "antd"; +import { useRef, useState } from "react"; +import React from "react"; +import Draggable from "react-draggable"; +import ProTable, { ActionType } from "@ant-design/pro-table"; +import { handleGetBACKCOMMODITYDetail, handleGetBACKCOMMODITYList, handleGetSALESTOREPROINSTDetail } from "../../service"; +import { handleNewPrint, handleNewPrintAHJG } from "@/utils/format"; + +type DetailProps = { + showDetail: boolean; + parentRow: any; + onCencel: any; +} +const ReturnGoodsTable = ({ showDetail, parentRow, onCencel }: DetailProps) => { + const actionRef = useRef(); + const formRef = useRef(); + const draggleRef = React.createRef() + + // 弹出框拖动效果 + const [bounds, setBounds] = useState<{ left: number, right: number, top: number, bottom: number }>() // 移动的位置 + const [disabled, setDraggleDisabled] = useState() // 是否拖动 + const onDraggaleStart = (event, uiData) => { + const { clientWidth, clientHeight } = window.document.documentElement; + const targetRect = draggleRef.current?.getBoundingClientRect(); + if (!targetRect) { + return; + } + setBounds({ + left: -targetRect.left + uiData.x, + right: clientWidth - (targetRect.right - uiData.x), + top: -targetRect.top + uiData.y, + bottom: clientHeight - (targetRect.bottom - uiData.y), + }); + }; + // 当前查到的退货单详情 + const [currentModalDetail, setCurrentModalDetail] = useState() + + const columns: any = [ + { + title: "序号", + width: 80, + valueType: 'index', + dataIndex: "index", + align: 'center' + }, + { + title: "商品条码", + width: 120, + dataIndex: "COMMODITY_BARCODE", + align: 'center', + ellipsis: true + }, + { + title:
商品名称
, + width: 150, + dataIndex: "COMMODITY_NAME", + align: 'left', + ellipsis: true + }, + { + title: '退货门店', + width: 120, + dataIndex: "SHOPNAME", + align: 'center', + ellipsis: true + }, + { + title:
供应商名
, + width: 150, + dataIndex: "SUPPLIER_NAME", + align: 'left', + ellipsis: true + }, + { + title:
退货数量
, + width: 120, + dataIndex: "BACK_COUNT", + valueType: 'digit', + align: 'right', + ellipsis: true + }, + { + title:
税率
, + width: 120, + dataIndex: "DUTY_PARAGRAPH", + align: 'right', + ellipsis: true + }, + { + title:
含税进价
, + width: 120, + dataIndex: "PURCHASE_TAXPRICE", + valueType: 'digit', + align: 'right', + ellipsis: true + }, + { + title:
含税金额
, + width: 120, + dataIndex: "BACKTAXPRICE", + valueType: 'digit', + align: 'right', + ellipsis: true + }, + { + title: '退货时间', + width: 150, + dataIndex: "BACK_DATE", + align: 'center', + ellipsis: true + }, + { + title: '退货原由', + width: 120, + dataIndex: "BACK_DESC", + align: 'center', + ellipsis: true + } + ] + + return ( +
+ { + if (disabled) { + setDraggleDisabled(false) + } + }} + onMouseOut={() => { + setDraggleDisabled(true) + }} + + onFocus={() => { }} + onBlur={() => { }} + >退货表单
+ } + destroyOnClose={true} + width={'80%'} + bodyStyle={{ + height: '700px', // 你可以根据需要调整高度 + overflowY: 'auto', + }} + visible={showDetail} + onCancel={() => { + if (onCencel) { + onCencel() + } + }} + footer={false} + modalRender={(modal) => { + return onDraggaleStart(event, uiData)} + handle=".returnGoodsTableTitle" + > +
{modal}
+
+ }} + > +
+ +
+ +
+ {`${parentRow?.DEPT_NAME}自采退货单`} +
+ + { + console.log('parentRow', parentRow); + if (!parentRow?.SALESTOREPROINST_ID) { + return + } + + const req: any = { + SearchParameter: { + SALESTOREPROINST_IDS: parentRow?.SALESTOREPROINST_ID, + }, + PageIndex: 1, + PageSize: 999999 + } + + const data = await handleGetBACKCOMMODITYList(req) + console.log('退货单详情', data); + if (data && data.length > 0) { + return { data, success: true } + } + return { data: [], success: true } + }} + tableExtraRender={(_, data) => { + return
+ + {parentRow?.ACCEPT_CODE || ""} + {""} + {""} + {parentRow?.STAFF_NAME || ""} + + {parentRow?.PROINST_DESC || ""} + +
+ }} + /> + +
+ ) +} + +export default connect(({ user, }: ConnectState) => ({ + currentUser: user.currentUser, +}))(ReturnGoodsTable); diff --git a/src/pages/ahjgPage/returnProcess/index.tsx b/src/pages/ahjgPage/returnProcess/index.tsx index 99c1fce..58d9a03 100644 --- a/src/pages/ahjgPage/returnProcess/index.tsx +++ b/src/pages/ahjgPage/returnProcess/index.tsx @@ -15,6 +15,7 @@ import LeftSelectTree from "@/pages/reports/settlementAccount/component/leftSele import PageTitleBox from "@/components/PageTitleBox"; import moment from "moment"; import { handleGetSALESTOREPROINSTList } from "../service"; +import ReturnGoodsTable from "./components/returnGoodsTable"; const returnProcess: React.FC<{ currentUser: CurrentUser }> = (props) => { @@ -37,6 +38,11 @@ const returnProcess: React.FC<{ currentUser: CurrentUser }> = (props) => { // 查询的条件 const [searchParams, setSearchParams] = useState() + // 显示配送单 + const [onShow, setOnShow] = useState(false) + // 当前行数据 + const [currentRow, setCurrentRow] = useState() + const columns: any = [ { dataIndex: 'searchText', @@ -123,13 +129,25 @@ const returnProcess: React.FC<{ currentUser: CurrentUser }> = (props) => { align: 'right', width: 150, ellipsis: true, + sorter: true, hideInSearch: true, + render: (_, record) => { + return { + console.log('recordrecordrecord', record); + + setCurrentRow(record) + setOnShow(true) + }}> + 1 + + } }, { title:
合计含税进价
, dataIndex: "合计含税进价", align: 'right', width: 150, + sorter: true, ellipsis: true, hideInSearch: true, }, @@ -189,6 +207,11 @@ const returnProcess: React.FC<{ currentUser: CurrentUser }> = (props) => { tempTable.remove() // 防止重复打印一个内容 } + // 关闭方法 + const handleCloseModal = () => { + setCurrentRow(null) + setOnShow(false) + } return (
{ @@ -260,13 +283,16 @@ const returnProcess: React.FC<{ currentUser: CurrentUser }> = (props) => { scroll={{ x: "100%", y: "calc(100vh - 410px)" }} headerTitle={} // 列表表头 search={{ span: 6 }} - request={async (params) => { - console.log('selectedIdselectedIdselectedId', selectedId); - console.log('paramsparamsparamsparamsparams', params); + request={async (params, sorter) => { if (!selectedId) { return } + // 排序字段 + const sortstr = Object.keys(sorter).map(n => { + const value = sorter[n] + return value ? `${n} ${value.replace('end', '')}` : '' + }) const req: any = { SearchParameter: { DEPT_IDS: selectedId, @@ -274,13 +300,16 @@ const returnProcess: React.FC<{ currentUser: CurrentUser }> = (props) => { CREATEDATE_End: params.CREATEDATE_End || "", }, PageIndex: 1, - PageSize: 999999 + PageSize: 999999, + sortstr: sortstr.length ? sortstr.toString() : "", } setSearchParams(params) const data = await handleGetSALESTOREPROINSTList(req) console.log('datadatadata', data); if (data && data.length > 0) { + setReqDetailList(data) + return { data, success: true } } return { data: [], success: true } @@ -320,6 +349,9 @@ const returnProcess: React.FC<{ currentUser: CurrentUser }> = (props) => { />
+ + {/* 退货单 */} +
) } diff --git a/src/pages/ahjgPage/service.ts b/src/pages/ahjgPage/service.ts index 1b5ef43..685e0fc 100644 --- a/src/pages/ahjgPage/service.ts +++ b/src/pages/ahjgPage/service.ts @@ -1,3 +1,4 @@ +import { wrapTreeNode } from "@/utils/format" import request from "@/utils/request" // 拿到盘存信息的数据 @@ -150,3 +151,54 @@ export async function handleGetSALESTOREPROINSTList(params: any) { } return data.Result_Data.List } + + +// 获取退货表列表 +export async function handleGetBACKCOMMODITYList(params: any) { + const data = await request(`/SaleStore/GetBACKCOMMODITYList`, { + method: 'POST', + data: { ...params, requestEncryption: true } + }) + if (data.Result_Code !== 100) { + return [] + } + return data.Result_Data.List +} + + +// 获取商户信息表列表 +export async function handleGetMERCHANTSList(params: any) { + const data = await request(`/SaleStore/GetMERCHANTSList`, { + method: 'POST', + data: { ...params, requestEncryption: true } + }) + if (data.Result_Code !== 100) { + return [] + } + return data.Result_Data.List +} + +// 入库退货统计表 +export async function handleGetStorageBackSummary(params: any) { + const data = await request(`/SaleStore/GetStorageBackSummary`, { + method: 'POST', + data: { ...params, requestEncryption: true } + }) + if (data.Result_Code !== 100) { + return [] + } + return wrapTreeNode(data.Result_Data.List) +} + + +// 查询商品实时进销存明细数据 +export async function handleGetCommodityInSaleList(params: any) { + const data = await request(`/SaleStore/GetCommodityInSaleList`, { + method: 'POST', + data: { ...params, requestEncryption: true } + }) + if (data.Result_Code !== 100) { + return [] + } + return data.Result_Data.List +} \ No newline at end of file diff --git a/src/pages/ahjgPage/servicePartAudit/index.tsx b/src/pages/ahjgPage/servicePartAudit/index.tsx index 2ade1a9..fdd584a 100644 --- a/src/pages/ahjgPage/servicePartAudit/index.tsx +++ b/src/pages/ahjgPage/servicePartAudit/index.tsx @@ -386,13 +386,13 @@ const servicePartAudit: React.FC<{ currentUser: CurrentUser }> = (props) => { let req: any = {} if (currentRow?.CASHWORKER_ID) { req = { + ...personDetail, ...res, WORKER_OTHER: defaultAuthor, SERVERPART_CODE: SERVERPART_CODE } } else { req = { - ...personDetail, ...res, WORKER_OTHER: defaultAuthor, SERVERPART_CODE: SERVERPART_CODE @@ -560,18 +560,27 @@ const servicePartAudit: React.FC<{ currentUser: CurrentUser }> = (props) => { /> + 人员权限 + { console.log('PROWERSET', PROWERSET); + let list: any = [] if (PROWERSET && PROWERSET.length > 0) { PROWERSET.forEach((item: any) => { - item.value = item.value.toString() + if (item.value === 50 || item.value === '50') { + item.value = item.value.toString() + list.push(item) + } }) } - return PROWERSET + return list }} // options={[ // { label: '销售', value: 1 }, diff --git a/src/pages/ahjgPage/shopProcurement/components/warehouseInfo.tsx b/src/pages/ahjgPage/shopProcurement/components/warehouseInfo.tsx index 0ffb222..359df7b 100644 --- a/src/pages/ahjgPage/shopProcurement/components/warehouseInfo.tsx +++ b/src/pages/ahjgPage/shopProcurement/components/warehouseInfo.tsx @@ -141,69 +141,38 @@ const warehouseInfo = ({ onShow, parentRow, onCencel }: DetailProps) => { const exportTable = (e) => { e.stopPropagation(); - const main = document.getElementsByClassName(`saleReportHideBox${printIndex}`)[0]; - const originHead = main.querySelector('thead').cloneNode(true); - const originBody = main.querySelector('tbody').cloneNode(true); + const main = document.getElementsByClassName(`warehouseInfo${printIndex}`)[0]; + const thead = main.querySelector('thead').cloneNode(true); + const tbody = main.querySelector('tbody').cloneNode(true); + const tfoot = main.querySelector('tfoot').cloneNode(true); // 深克隆DOM节点 const container = document.querySelector('#hiddenBox'); - const tempTable = document.createElement('table'); - tempTable.setAttribute('id', 'table-to-xls-warehouseInfo'); - // 标题 - const caption = document.createElement('caption'); - caption.innerText = `${currentModalDetail?.SERVERPART_NAME || ''}${currentModalDetail?.SHOPNAME || ''}入库单`; - caption.style.fontSize = '20px'; - caption.style.fontWeight = '600'; - caption.style.padding = '10px 0'; - tempTable.appendChild(caption); + const title = document.createElement('div'); + title.innerText = `${currentModalDetail?.SERVERPART_NAME || ''}${currentModalDetail?.SHOPNAME || ''}入库单`; + title.setAttribute('style', 'width:100%;text-align:center;font-size:20px;font-weight: 600;') - const exportHead = document.createElement('thead'); - const mkTh = (text) => { - const th = document.createElement('th'); - th.innerText = text || ''; - th.style.textAlign = 'left'; - return th; - }; - const mkEmpty = () => document.createElement('th'); // 空单元格 + tempTable.appendChild(title); + tempTable.appendChild(thead); + tempTable.appendChild(tfoot); + tempTable.appendChild(tbody); - // 第一行:单号 + 空格 + 数量 + 空格 + 金额 + 空格 + 时间 - const row1 = document.createElement('tr'); - row1.appendChild(mkTh(`入库单号:${currentModalDetail?.RECEIVECENTER_CODE ?? ''}`)); - row1.appendChild(mkEmpty()); - row1.appendChild(mkTh(`入库数量:${parentRow?.RECEIVE_TOTALCOUNT ?? ''}`)); - row1.appendChild(mkEmpty()); - row1.appendChild(mkTh(`入库金额:${parentRow?.RECEIVE_TOTALPRICE ?? ''}`)); - row1.appendChild(mkEmpty()); - row1.appendChild(mkTh(`入库时间:${parentRow?.RECEIVECENTER_DATE ?? ''}`)); + tempTable.setAttribute('id', 'table-to-xls-warehouseInfo'); // 给table添加id,值与按钮上的table字段对应 - // 第二行:采购说明(跨满所有列) - const row2 = document.createElement('tr'); - const noteTh = mkTh(`采购说明:${parentRow?.RECEIVESERVERPART_DESC ?? ''}`); - noteTh.colSpan = 7; // 跨前面 7 列 - row2.appendChild(noteTh); + container.appendChild(tempTable); // 把创建的节点添加到页面容器中 - exportHead.appendChild(row1); - exportHead.appendChild(row2); + setShowLoading(false) - // 原始表头列标题 - Array.from(originHead.rows).forEach(r => exportHead.appendChild(r)); - - tempTable.appendChild(exportHead); - tempTable.appendChild(originBody); - - container.appendChild(tempTable); - - setShowLoading(false); downloadBtnRef.current.handleDownload(); + setShowExportTable(false) + tempTable.remove() // 防止重复打印一个内容 - setShowExportTable(false); - tempTable.remove(); }; return (
-
+
{ showExportTable && reqDetailList && reqDetailList.length > 0 ? { formRef={formRef} columns={columns} bordered - scroll={{ x: '100%', y: 300 }} + scroll={{ x: '100%', y: 270 }} search={false} options={false} request={async (params) => { diff --git a/src/pages/ahjgPage/shopProcurement/index.tsx b/src/pages/ahjgPage/shopProcurement/index.tsx index 64ab02d..8b31d02 100644 --- a/src/pages/ahjgPage/shopProcurement/index.tsx +++ b/src/pages/ahjgPage/shopProcurement/index.tsx @@ -5,7 +5,7 @@ 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 { Button, Col, message, Modal, Row, Space, Spin, Tree } from "antd"; +import { Button, Col, Descriptions, message, Modal, Row, Space, Spin, Table, Tree, Typography } from "antd"; import useRequest from "@ahooksjs/use-request"; import { getServerpartTree } from "@/services/options"; import type { ActionType } from "@ant-design/pro-table"; @@ -24,6 +24,7 @@ import { getMyShopList } from "@/pages/account/center/sevice"; import { handleGetRECEIVESERVERPARTList } from "../service"; import WarehouseInfo from "./components/warehouseInfo"; +const { Text } = Typography; const shopProcurement: React.FC<{ currentUser: CurrentUser }> = (props) => { const { currentUser } = props @@ -53,6 +54,12 @@ const shopProcurement: React.FC<{ currentUser: CurrentUser }> = (props) => { // 是否显示打印的表格 const [showExportTable, setShowExportTable] = useState(false) const [reqDetailList, setReqDetailList] = useState(); // 合计项数据源 + // 表格的合计值 + const [tableSumObj, setTableSumObj] = useState(); + // 表格加载效果 + const [tableLoading, setTableLoading] = useState(false) + + const onDraggaleStart = (event, uiData) => { const { clientWidth, clientHeight } = window.document.documentElement; const targetRect = draggleRef.current?.getBoundingClientRect(); @@ -104,7 +111,7 @@ const shopProcurement: React.FC<{ currentUser: CurrentUser }> = (props) => { title: '查询内容', hideInTable: true, fieldProps: { - placeholder: "请输入商品名称/商品条码" + placeholder: "请输入商品名称/入库单号" } }, { @@ -218,6 +225,9 @@ const shopProcurement: React.FC<{ currentUser: CurrentUser }> = (props) => { align: 'right', valueType: 'digit', width: 120, + sorter: true, + // sorter: (a, b) => a.RECEIVE_TOTALCOUNT - b.RECEIVE_TOTALCOUNT, + defaultSortOrder: 'descend', ellipsis: true, hideInSearch: true, }, @@ -227,6 +237,8 @@ const shopProcurement: React.FC<{ currentUser: CurrentUser }> = (props) => { align: 'right', valueType: 'digit', width: 120, + sorter: true, + // sorter: (a, b) => a.RECEIVE_TOTALPRICE - b.RECEIVE_TOTALPRICE, ellipsis: true, hideInSearch: true, }, @@ -235,6 +247,8 @@ const shopProcurement: React.FC<{ currentUser: CurrentUser }> = (props) => { dataIndex: "RECEIVECENTER_DATE", align: 'center', width: 150, + sorter: true, + // sorter: (a, b) => new Date(a?.RECEIVECENTER_DATE).getTime() - new Date(b?.RECEIVECENTER_DATE).getTime(), ellipsis: true, hideInSearch: true, }, @@ -372,29 +386,52 @@ const shopProcurement: React.FC<{ currentUser: CurrentUser }> = (props) => { expandable={{ expandRowByClick: true }} - scroll={{ x: "100%", y: "calc(100vh - 450px)" }} + loading={tableLoading} + scroll={{ x: "100%", y: "calc(100vh - 520px)" }} headerTitle={} // 列表表头 search={{ span: 6, defaultCollapsed: false }} // 查询表单 - request={async (params) => { + request={async (params, sorter) => { if (!selectedId) { return } - + // 排序字段 + const sortstr = Object.keys(sorter).map(n => { + const value = sorter[n] + return value ? `${n} ${value.replace('end', '')}` : '' + }) const req: any = { SearchParameter: { SERVERPARTSHOP_IDS: selectedId, RECEIVECENTER_DATE_Start: params?.RECEIVECENTER_DATE_Start || "", RECEIVECENTER_DATE_End: params?.RECEIVECENTER_DATE_End || "", }, + keyWord: { + Key: 'RECEIVECENTER_CODE', + Value: params?.searchText || '' + }, PageIndex: 1, - PageSize: 999999 + PageSize: 999999, + sortstr: sortstr.length ? sortstr.toString() : "", } - setSearchParams(params) + setTableLoading(true) const data = await handleGetRECEIVESERVERPARTList(req) + setTableLoading(false) console.log('表格数据', data); setReqDetailList(data) if (data && data.length > 0) { + // 总数合计 + let RECEIVE_TOTALCOUNTSUM: number = 0 + // 金额合计 + let RECEIVE_TOTALPRICESUM: number = 0 + data.forEach((item: any) => { + RECEIVE_TOTALCOUNTSUM += item.RECEIVE_TOTALCOUNT + RECEIVE_TOTALPRICESUM += item.RECEIVE_TOTALPRICE + }) + setTableSumObj({ + RECEIVE_TOTALCOUNT: Number(RECEIVE_TOTALCOUNTSUM.toFixed(2)), + RECEIVE_TOTALPRICE: Number(RECEIVE_TOTALPRICESUM.toFixed(2)) + }) return { data, success: true } } return { data: [], success: true } @@ -434,6 +471,58 @@ const shopProcurement: React.FC<{ currentUser: CurrentUser }> = (props) => { // }}>填写申请 ] }} + tableExtraRender={ + (_, data) => { + return
+ + {tableSumObj?.RECEIVE_TOTALCOUNT ? tableSumObj?.RECEIVE_TOTALCOUNT.toLocaleString('zh-CN') : ""} + {tableSumObj?.RECEIVE_TOTALPRICE ? tableSumObj?.RECEIVE_TOTALPRICE.toLocaleString('zh-CN') : ""} + +
+ } + } + summary={(pageData) => { + // 总数合计 + let RECEIVE_TOTALCOUNTSUM: number = 0 + // 金额合计 + let RECEIVE_TOTALPRICESUM: number = 0 + + if (pageData && pageData.length > 0) { + pageData.forEach((item: any) => { + RECEIVE_TOTALCOUNTSUM += item.RECEIVE_TOTALCOUNT + RECEIVE_TOTALPRICESUM += item.RECEIVE_TOTALPRICE + }) + } + return ( + + + +
本页合计
+
+ + + + +
+ {RECEIVE_TOTALCOUNTSUM ? Number(RECEIVE_TOTALCOUNTSUM.toFixed(2)).toLocaleString('zh-CN') : ''} +
+
+ +
+ {RECEIVE_TOTALPRICESUM ? Number(RECEIVE_TOTALPRICESUM.toFixed(2)).toLocaleString('zh-CN') : ''} +
+
+ +
+
+ ) + }} />
diff --git a/src/pages/basicManage/serverpartAssets/component/contractDetail.tsx b/src/pages/basicManage/serverpartAssets/component/contractDetail.tsx index 24bea7e..a3d9617 100644 --- a/src/pages/basicManage/serverpartAssets/component/contractDetail.tsx +++ b/src/pages/basicManage/serverpartAssets/component/contractDetail.tsx @@ -44,7 +44,7 @@ const ContractDetail = ({ tableData, detail }: DetailProps) => { dataIndex: 'COMPACT_NAME', width: 300, render: (_, record) => { - return { + return { setCurrentRow(record) setContractDrawer(true) }}> @@ -90,7 +90,7 @@ const ContractDetail = ({ tableData, detail }: DetailProps) => { console.log('detail', detail); let req: any = { SearchParameter: { - SERVERPARTSHOP_ID: detail?.SERVERPARTSHOP_ID, + SERVERPARTSHOP_ID: detail?.SERVERPARTSHOP_ID || detail?.PropertyShop.SERVERPARTSHOP_ID, PROJECT_VALID: 1 }, PageIndex: 1, diff --git a/src/pages/newDataAnalysis/serviceAreaPersonnel/index.tsx b/src/pages/newDataAnalysis/serviceAreaPersonnel/index.tsx index d304dab..af80825 100644 --- a/src/pages/newDataAnalysis/serviceAreaPersonnel/index.tsx +++ b/src/pages/newDataAnalysis/serviceAreaPersonnel/index.tsx @@ -51,6 +51,8 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) => const [relatedShop, setRelatedShop] = useState() // 选择的门店id数组 const [selectShop, setSelectShop] = useState() + // 显示的人员权限可以选择的内容 + const [showPROWERSETList, setShowPROWERSETList] = useState() const { loading: PROWERSETLoading, data: PROWERSET } = useRequest(async () => { const data = await getFieldEnum({ FieldExplainField: 'PROWERSET' }) @@ -362,7 +364,6 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) =>
: '' } -
+
{ showExportTable && reqDetailList && reqDetailList.length > 0 ? = (props) => { /> : '' }
-
+
-
+
{ setCollapsible(!collapsible) - }}/>} + }} />} colSpan={!collapsible ? "300px" : "60px"} title={!collapsible ? "请选择服务区" : ""} headerBordered @@ -346,7 +351,7 @@ const hotkeyset: 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) }} > @@ -354,7 +359,7 @@ const hotkeyset: React.FC<{ currentUser: CurrentUser}> = (props) => { }
= (props) => { columns={columns} bordered headerTitle={} - search={{span: 6}} - request={async(params)=>{ - if (!currenMenu){ + search={{ span: 6 }} + request={async (params) => { + if (!currenMenu) { return } + const req: any = { SearchType: 4, - ProvinceCode: currentUser?.USER_PROVINCE, + ProvinceCode: currentUser?.ProvinceCode, ServerpartID: currenMenu, CommodityState: params.CommodityState, ShopTrade: params.ShopTrade, - PageIndex:1, + PageIndex: 1, PageSize: 999999 } handleCallLogs() setSearchParams(params) 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) - return { data: data.List,success: true} + return { data: data.List, success: true } } - return {data: [],success: true} + return { data: [], success: true } }} toolbar={{ actions: [ - + = (props) => { { + onClose={() => { setCurrentRow(undefined) setShowDetail(false) setShowHotKeyEdit(false) @@ -436,33 +442,33 @@ const hotkeyset: React.FC<{ currentUser: CurrentUser}> = (props) => { closable={false} destroyOnClose footer={ -
-
} > - +
) } -export default connect(({user}: ConnectState) => ({ +export default connect(({ user }: ConnectState) => ({ currentUser: user.currentUser }))(hotkeyset); diff --git a/src/pages/reports/productControl/setUserDefinedType/index.tsx b/src/pages/reports/productControl/setUserDefinedType/index.tsx index f2899bf..94e3d5a 100644 --- a/src/pages/reports/productControl/setUserDefinedType/index.tsx +++ b/src/pages/reports/productControl/setUserDefinedType/index.tsx @@ -1,15 +1,16 @@ -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 {Modal, Popconfirm} from "antd"; -import {Button, Menu, message, Space, Spin, Tree,Avatar,Select} from "antd"; +import { MenuFoldOutlined } from "@ant-design/icons"; +import type { FormInstance } from "antd"; +import { Modal, Popconfirm } from "antd"; +import { Button, Menu, message, Space, Spin, Tree, Avatar, Select } from "antd"; import useRequest from "@ahooksjs/use-request"; -import {getFieldEnumTree, getServerpartTree} from "@/services/options"; -import type {ActionType} from "@ant-design/pro-table"; +import { getFieldEnumTree, getServerpartTree } 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"; @@ -18,13 +19,14 @@ import { handleGetCommodityList, handleGetServerpartUDTypeTree, handleRelateUDType, handleSynchroCOMMODITY } from "@/pages/reports/productControl/setUserDefinedType/service"; -import {handleGetShopTypeTree} from "@/pages/DataVerification/list/service"; -import {handleGetUSERDEFINEDTYPEList} from "@/pages/reports/productControl/userDefinedType/service"; -import {handleGetNestingCOMMODITYTYPETree} from "@/pages/reports/productControl/commodityInfo/service"; +import { handleGetShopTypeTree } from "@/pages/DataVerification/list/service"; +import { handleGetUSERDEFINEDTYPEList } from "@/pages/reports/productControl/userDefinedType/service"; +import { handleGetNestingCOMMODITYTYPETree, handleGetServerpartShopTrade } from "@/pages/reports/productControl/commodityInfo/service"; import './style.less' import PageTitleBox from "@/components/PageTitleBox"; +import session from "@/utils/session"; -const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => { +const setUserDefinedType: React.FC<{ currentUser: CurrentUser }> = (props) => { const { currentUser } = props const downloadBtnRef = useRef() const actionRef = useRef(); @@ -34,7 +36,7 @@ const setUserDefinedType: 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 req: any = { @@ -45,6 +47,7 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => { setTreeView(data) return data }) + const [commodityList, setCommodityList] = useState() // 加载弹出框里面的关联商品的树状选择 const { loading: modalTreeLoading, data: ModalTreeViews } = useRequest(async () => { @@ -56,43 +59,43 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => { const data = await handleGetNestingCOMMODITYTYPETree(req) 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(); // 当前选中左侧菜单的服务区节点 type为1时 const [modalCurrenMenu, setModalCurrenMenu] = useState(); // 当前选中左侧菜单的服务区节点 type为1时 - const [selectBusiness,setSelectBusiness] = useState() - const [customClassList,setCustomClassList] = useState() - const [correlationModal,setCorrelationModal] = useState(false) + const [selectBusiness, setSelectBusiness] = useState() + const [customClassList, setCustomClassList] = useState() + const [correlationModal, setCorrelationModal] = useState(false) const columns: any = [ { - title:'自定义类别', - dataIndex:'USERDEFINEDTYPE_ID', + title: '自定义类别', + dataIndex: 'USERDEFINEDTYPE_ID', hideInSearch: true, width: 200, valueType: 'select', - render:(_,record)=>{ + render: (_, record) => { return