update
This commit is contained in:
parent
debd5be7f6
commit
a05dd915f3
@ -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": {
|
||||
|
||||
@ -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<any>()
|
||||
// 选择的服务区
|
||||
const [selectServicePartId,setSelectServicePartId] = useState<any>()
|
||||
// 门店列表
|
||||
const [shopList,setShopList] = useState<any>()
|
||||
// 选择的门店列表
|
||||
const [selectShopId,setSelectShopId] = useState<any>('')
|
||||
// 处理状态
|
||||
const [selectState,setSelectState] = useState<any>(3)
|
||||
// 异常类型
|
||||
const [errorType,setErrorType] = useState<any>('')
|
||||
// 经营模式
|
||||
const [managerModal,setManagerModal] = useState<any>('')
|
||||
// 查询时间
|
||||
const [selectTime,setSelectTime] = useState<any>([moment().subtract(1, 'day'),moment().subtract(1, 'day')])
|
||||
// 表格的加载效果
|
||||
const [tableLoading,setTableLoading] = useState<boolean>(false)
|
||||
// 显示抽屉
|
||||
const [showDrawer,setShowDrawer] = useState<boolean>(false)
|
||||
// 点击 或者双击的当前行数据
|
||||
const [currentRow,setCurrentRow] = useState<any>()
|
||||
// 详情的ref
|
||||
const checkDetail = useRef()
|
||||
// 表格数组
|
||||
const [tableData, setTableData] = useState<any>()
|
||||
// 选择的服务区
|
||||
const [selectServicePartId, setSelectServicePartId] = useState<any>()
|
||||
// 门店列表
|
||||
const [shopList, setShopList] = useState<any>()
|
||||
// 选择的门店列表
|
||||
const [selectShopId, setSelectShopId] = useState<any>('')
|
||||
// 处理状态
|
||||
const [selectState, setSelectState] = useState<any>(3)
|
||||
// 异常类型
|
||||
const [errorType, setErrorType] = useState<any>('')
|
||||
// 经营模式
|
||||
const [managerModal, setManagerModal] = useState<any>('')
|
||||
// 查询时间
|
||||
const [selectTime, setSelectTime] = useState<any>([moment().subtract(1, 'day'), moment().subtract(1, 'day')])
|
||||
// 表格的加载效果
|
||||
const [tableLoading, setTableLoading] = useState<boolean>(false)
|
||||
// 显示抽屉
|
||||
const [showDrawer, setShowDrawer] = useState<boolean>(false)
|
||||
// 点击 或者双击的当前行数据
|
||||
const [currentRow, setCurrentRow] = useState<any>()
|
||||
// 根据子组件是否出现加载框来判断按钮是否禁用
|
||||
const [showDisable,setShowDisable] = useState<boolean>(false)
|
||||
const [showDisable, setShowDisable] = useState<boolean>(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 <span
|
||||
style={{
|
||||
color:record.Treatment_MarkState===0 || record.Treatment_MarkState===3?'#ff6600':'#000000'
|
||||
}}
|
||||
>{record.Treatment_MarkState===0?'待处理':
|
||||
record.Treatment_MarkState===1?'待审核':
|
||||
record.Treatment_MarkState===2?'已审结':
|
||||
record.Treatment_MarkState===3?'主任复核':
|
||||
record.Treatment_MarkState===4?'主任审结':''}</span>
|
||||
}
|
||||
},
|
||||
{
|
||||
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 <div style={{width:'600px',whiteSpace:'nowrap',textOverflow:'ellipsis',overflow:'hidden'}}>{
|
||||
`${record?.Description_Staff?`${record?.Description_Staff.split('【')[0]}:`:''} ${record?.Description_Info} ${record?.Approved_Staff?`|${record?.Approved_Staff}:`:''} ${record?.Approved_Info}`
|
||||
}</div>
|
||||
}
|
||||
},
|
||||
{
|
||||
dataIndex: 'TotalSell_Amount',
|
||||
title: '总销售额',
|
||||
width:100,
|
||||
align: 'right',
|
||||
hideInSearch:true,
|
||||
render:(_,record)=>{
|
||||
return <span>{fmoney(record.TotalSell_Amount,2)}</span>
|
||||
}
|
||||
},
|
||||
{
|
||||
dataIndex: 'Difference_Amount',
|
||||
title: '长短款',
|
||||
align: 'right',
|
||||
width:80,
|
||||
hideInSearch:true,
|
||||
render:(_,record)=>{
|
||||
return <span style={{color:Number(record.Difference_Amount)>0?'green':Number(record.Difference_Amount)<0?'red':''}}>{fmoney(record.Difference_Amount,2)}</span>
|
||||
}
|
||||
},
|
||||
{
|
||||
dataIndex: 'Revenue_Amount',
|
||||
title: '实收金额',
|
||||
width:100,
|
||||
align: 'right',
|
||||
hideInSearch:true,
|
||||
render:(_,record)=>{
|
||||
return <span>{fmoney(record.Revenue_Amount,2)}</span>
|
||||
}
|
||||
},
|
||||
{
|
||||
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 <span
|
||||
style={{
|
||||
color: record.Treatment_MarkState === 0 || record.Treatment_MarkState === 3 ? '#ff6600' : '#000000'
|
||||
}}
|
||||
>{record.Treatment_MarkState === 0 ? '待处理' :
|
||||
record.Treatment_MarkState === 1 ? '待审核' :
|
||||
record.Treatment_MarkState === 2 ? '已审结' :
|
||||
record.Treatment_MarkState === 3 ? '主任复核' :
|
||||
record.Treatment_MarkState === 4 ? '主任审结' : ''}</span>
|
||||
}
|
||||
},
|
||||
{
|
||||
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 <div style={{ width: '600px', whiteSpace: 'nowrap', textOverflow: 'ellipsis', overflow: 'hidden' }}>{
|
||||
`${record?.Description_Staff ? `${record?.Description_Staff.split('【')[0]}:` : ''} ${record?.Description_Info} ${record?.Approved_Staff ? `|${record?.Approved_Staff}:` : ''} ${record?.Approved_Info}`
|
||||
}</div>
|
||||
}
|
||||
},
|
||||
{
|
||||
dataIndex: 'TotalSell_Amount',
|
||||
title: '总销售额',
|
||||
width: 100,
|
||||
align: 'right',
|
||||
hideInSearch: true,
|
||||
render: (_, record) => {
|
||||
return <span>{fmoney(record.TotalSell_Amount, 2)}</span>
|
||||
}
|
||||
},
|
||||
{
|
||||
dataIndex: 'Difference_Amount',
|
||||
title: '长短款',
|
||||
align: 'right',
|
||||
width: 80,
|
||||
hideInSearch: true,
|
||||
render: (_, record) => {
|
||||
return <span style={{ color: Number(record.Difference_Amount) > 0 ? 'green' : Number(record.Difference_Amount) < 0 ? 'red' : '' }}>{fmoney(record.Difference_Amount, 2)}</span>
|
||||
}
|
||||
},
|
||||
{
|
||||
dataIndex: 'Revenue_Amount',
|
||||
title: '实收金额',
|
||||
width: 100,
|
||||
align: 'right',
|
||||
hideInSearch: true,
|
||||
render: (_, record) => {
|
||||
return <span>{fmoney(record.Revenue_Amount, 2)}</span>
|
||||
}
|
||||
},
|
||||
{
|
||||
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 (
|
||||
<PageContainer header={{
|
||||
title: '',
|
||||
breadcrumb: {},
|
||||
}}>
|
||||
<div className={'searchBox'}>
|
||||
<div className={'searchBoxLeft'}>
|
||||
<div className={'searchItem'}>
|
||||
<span className={'searchLabel'}>服务区:</span>
|
||||
<Select
|
||||
style={{minWidth:'150px'}}
|
||||
value={selectServicePartId}
|
||||
options={serviceList}
|
||||
allowClear
|
||||
showSearch
|
||||
filterOption={(input, option) =>
|
||||
(option?.label ?? '').toLowerCase().includes(input.toLowerCase())
|
||||
}
|
||||
onChange={async (e)=>{
|
||||
setSelectServicePartId(e)
|
||||
const req = {
|
||||
ProvinceCode:currentUser?.USER_PROVINCE,
|
||||
ServerpartId:e,
|
||||
ShowWholePower:true
|
||||
}
|
||||
const data = await handleGetServiceShopList(req)
|
||||
setSelectShopId(null)
|
||||
setShopList(data.List)
|
||||
}}
|
||||
></Select>
|
||||
</div>
|
||||
<div className={'searchItem'}>
|
||||
<span className={'searchLabel'}>门店:</span>
|
||||
<Select
|
||||
style={{minWidth:'150px'}}
|
||||
value={selectShopId}
|
||||
allowClear
|
||||
options={shopList}
|
||||
onChange={(e)=>{
|
||||
setSelectShopId(e)
|
||||
}}
|
||||
></Select>
|
||||
</div>
|
||||
<div className={'searchItem'}>
|
||||
<span className={'searchLabel'}>处理状态:</span>
|
||||
<Select
|
||||
style={{minWidth:'150px'}}
|
||||
value={selectState}
|
||||
allowClear
|
||||
options={[{label:'全部',value:''},
|
||||
{label:'待我处理',value:0},
|
||||
{label:'财务审核',value:1},
|
||||
{label:'财务审结',value:2},
|
||||
{label:'主任复核',value:3},
|
||||
{label:'主任审结',value:4},
|
||||
]}
|
||||
onChange={(e)=>{
|
||||
setSelectState(e)
|
||||
}}
|
||||
></Select>
|
||||
</div>
|
||||
<div className={'searchItem'}>
|
||||
<span className={'searchLabel'}>异常类型:</span>
|
||||
<Select
|
||||
style={{minWidth:'100px'}}
|
||||
value={errorType}
|
||||
allowClear
|
||||
options={[{label:'全部',value:''},
|
||||
{label:'短款日结',value:0},
|
||||
{label:'长款日结',value:1},
|
||||
{label:'异常校验',value:2},
|
||||
{label:'手工录入',value:3},
|
||||
{label:'扫码上传',value:4},
|
||||
]}
|
||||
onChange={(e)=>{
|
||||
setErrorType(e)
|
||||
}}
|
||||
></Select>
|
||||
</div>
|
||||
<div className={'searchItem'}>
|
||||
<span className={'searchLabel'}>经营模式:</span>
|
||||
<Select
|
||||
style={{minWidth:'100px'}}
|
||||
value={managerModal}
|
||||
allowClear
|
||||
options={[{label:'全部',value:''},
|
||||
{label:'业主自营',value:1000},
|
||||
{label:'合作经营',value:2000},
|
||||
{label:'固定租金',value:3000},
|
||||
{label:'临时展销',value:4000}
|
||||
]}
|
||||
onChange={(e)=>{
|
||||
setManagerModal(e)
|
||||
}}
|
||||
></Select>
|
||||
</div>
|
||||
<div className={'searchItem'}>
|
||||
<span className={'searchLabel'}>时间:</span>
|
||||
<RangePicker
|
||||
value={selectTime}
|
||||
onChange={(e)=>{
|
||||
setSelectTime([moment(e[0]._d),moment(e[1]._d)])
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className={'searchBoxRight'}>
|
||||
<Button style={{marginRight:'8px'}} onClick={async ()=>{
|
||||
setTableLoading(true)
|
||||
setSelectServicePartId(null)
|
||||
setSelectShopId(null)
|
||||
setSelectState(1)
|
||||
setSelectTime([moment().subtract(1, 'day'),moment().subtract(1, 'day')])
|
||||
const req = {
|
||||
StartDate: moment().subtract(1, 'day').format('YYYY-MM-DD'),
|
||||
EndDate: moment().subtract(1, 'day').format('YYYY-MM-DD'),
|
||||
// TreatmentMarkState:1,
|
||||
EndaccountState: selectState,
|
||||
ExceptionState: errorType,
|
||||
PageSize:999999
|
||||
}
|
||||
handleCallLogs()
|
||||
const data = await handleGetAccountList(req)
|
||||
if (data && data.List && data.List.length>0){
|
||||
const list: any = []
|
||||
data.List.forEach((item: any,index: number)=>{
|
||||
item.key = index + 1
|
||||
list.push(item)
|
||||
})
|
||||
setTableData(list)
|
||||
}else{
|
||||
setTableData([])
|
||||
}
|
||||
setTableLoading(false)
|
||||
}}>重置</Button>
|
||||
<Button type={'primary'} onClick={()=>{
|
||||
handleGetTableList()
|
||||
}}>查询</Button>
|
||||
</div>
|
||||
</div>
|
||||
<div className={'tableBox'}>
|
||||
<ProTable
|
||||
loading={tableLoading}
|
||||
options={false}
|
||||
search={false}
|
||||
columns={columns}
|
||||
dataSource={tableData}
|
||||
pagination={{ pageSize: 20 }}
|
||||
scroll={{y:'calc(100vh - 460px)'}}
|
||||
onRow={(record)=>{
|
||||
return {
|
||||
onClick: () => {
|
||||
setShowDrawer(true);
|
||||
console.log('record',record)
|
||||
setCurrentRow(record)
|
||||
return (
|
||||
<PageContainer header={{
|
||||
title: '',
|
||||
breadcrumb: {},
|
||||
}}>
|
||||
<div className={'searchBox'}>
|
||||
<div className={'searchBoxLeft'}>
|
||||
<div className={'searchItem'}>
|
||||
<span className={'searchLabel'}>服务区:</span>
|
||||
<Select
|
||||
style={{ minWidth: '150px' }}
|
||||
value={selectServicePartId}
|
||||
options={serviceList}
|
||||
allowClear
|
||||
showSearch
|
||||
filterOption={(input, option) =>
|
||||
(option?.label ?? '').toLowerCase().includes(input.toLowerCase())
|
||||
}
|
||||
onChange={async (e) => {
|
||||
setSelectServicePartId(e)
|
||||
// const req = {
|
||||
// ProvinceCode:currentUser?.USER_PROVINCE,
|
||||
// ServerpartId:e,
|
||||
// ShowWholePower:true
|
||||
// }
|
||||
// const data = await handleGetServiceShopList(req)
|
||||
|
||||
const req = {
|
||||
SearchParameter: {
|
||||
SERVERPART_IDS: e,
|
||||
ISVALID: 1
|
||||
},
|
||||
PageIndex: 1,
|
||||
PageSize: 999999,
|
||||
SortStr: "SHOPREGION,SHOPTRADE,SHOPSHORTNAME,SHOPCODE"
|
||||
}
|
||||
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 })
|
||||
})
|
||||
}
|
||||
}}
|
||||
>
|
||||
</ProTable>
|
||||
</div>
|
||||
|
||||
<Drawer
|
||||
width={'60%'}
|
||||
visible={showDrawer}
|
||||
closable={false}
|
||||
bodyStyle={{ padding: 0 }}
|
||||
onClose={() => {
|
||||
setShowDrawer(false);
|
||||
}}
|
||||
destroyOnClose={true}
|
||||
footer={
|
||||
currentRow?.Treatment_MarkState===3?
|
||||
<div style={{width:'100%',display:'flex',alignItems:'center',justifyContent:'space-between'}}>
|
||||
<Button disabled={showDisable} danger onClick={()=>{
|
||||
// 调用子组件里面的方法
|
||||
checkDetail.current?.handleEndaccountPhoto()
|
||||
}}>查看单据</Button>
|
||||
<div style={{display:'flex',justifyContent:'flex-end'}}>
|
||||
<Button disabled={showDisable} style={{marginRight:'8px'}} type={'primary'} onClick={()=>{
|
||||
// 进行表单校验 校验通过之后调用保存的审核方法
|
||||
checkDetail.current.formRef.current?.validateFields().then(res=>{
|
||||
if (res){
|
||||
const desc = checkDetail.current?.handleGetApprovedInfo()
|
||||
handleSubmitEndaccountState(3,desc.Review_Info)
|
||||
}
|
||||
})
|
||||
}}>审核</Button>
|
||||
<Button onClick={()=>{setShowDrawer(false)}}>关闭</Button>
|
||||
</div>
|
||||
</div>:''
|
||||
setSelectShopId(null)
|
||||
setShopList(list)
|
||||
}}
|
||||
></Select>
|
||||
</div>
|
||||
<div className={'searchItem'}>
|
||||
<span className={'searchLabel'}>门店:</span>
|
||||
<Select
|
||||
style={{ minWidth: '150px' }}
|
||||
value={selectShopId}
|
||||
allowClear
|
||||
options={shopList}
|
||||
onChange={(e) => {
|
||||
setSelectShopId(e)
|
||||
}}
|
||||
></Select>
|
||||
</div>
|
||||
<div className={'searchItem'}>
|
||||
<span className={'searchLabel'}>处理状态:</span>
|
||||
<Select
|
||||
style={{ minWidth: '150px' }}
|
||||
value={selectState}
|
||||
allowClear
|
||||
options={[{ label: '全部', value: '' },
|
||||
{ label: '待我处理', value: 0 },
|
||||
{ label: '财务审核', value: 1 },
|
||||
{ label: '财务审结', value: 2 },
|
||||
{ label: '主任复核', value: 3 },
|
||||
{ label: '主任审结', value: 4 },
|
||||
]}
|
||||
onChange={(e) => {
|
||||
setSelectState(e)
|
||||
}}
|
||||
></Select>
|
||||
</div>
|
||||
<div className={'searchItem'}>
|
||||
<span className={'searchLabel'}>异常类型:</span>
|
||||
<Select
|
||||
style={{ minWidth: '100px' }}
|
||||
value={errorType}
|
||||
allowClear
|
||||
options={[{ label: '全部', value: '' },
|
||||
{ label: '短款日结', value: 0 },
|
||||
{ label: '长款日结', value: 1 },
|
||||
{ label: '异常校验', value: 2 },
|
||||
{ label: '手工录入', value: 3 },
|
||||
{ label: '扫码上传', value: 4 },
|
||||
]}
|
||||
onChange={(e) => {
|
||||
setErrorType(e)
|
||||
}}
|
||||
></Select>
|
||||
</div>
|
||||
<div className={'searchItem'}>
|
||||
<span className={'searchLabel'}>经营模式:</span>
|
||||
<Select
|
||||
style={{ minWidth: '100px' }}
|
||||
value={managerModal}
|
||||
allowClear
|
||||
options={[{ label: '全部', value: '' },
|
||||
{ label: '业主自营', value: 1000 },
|
||||
{ label: '合作经营', value: 2000 },
|
||||
{ label: '固定租金', value: 3000 },
|
||||
{ label: '临时展销', value: 4000 }
|
||||
]}
|
||||
onChange={(e) => {
|
||||
setManagerModal(e)
|
||||
}}
|
||||
></Select>
|
||||
</div>
|
||||
<div className={'searchItem'}>
|
||||
<span className={'searchLabel'}>时间:</span>
|
||||
<RangePicker
|
||||
value={selectTime}
|
||||
onChange={(e) => {
|
||||
setSelectTime([moment(e[0]._d), moment(e[1]._d)])
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className={'searchBoxRight'}>
|
||||
<Button style={{ marginRight: '8px' }} onClick={async () => {
|
||||
setTableLoading(true)
|
||||
setSelectServicePartId(null)
|
||||
setSelectShopId(null)
|
||||
setSelectState(1)
|
||||
setSelectTime([moment().subtract(1, 'day'), moment().subtract(1, 'day')])
|
||||
const req = {
|
||||
StartDate: moment().subtract(1, 'day').format('YYYY-MM-DD'),
|
||||
EndDate: moment().subtract(1, 'day').format('YYYY-MM-DD'),
|
||||
// TreatmentMarkState:1,
|
||||
EndaccountState: selectState,
|
||||
ExceptionState: errorType,
|
||||
PageSize: 999999
|
||||
}
|
||||
>
|
||||
<CheckDetail onRef={checkDetail} currentRow={currentRow} currentUser={currentUser} handleChangeShowDisable={handleChangeShowDisable}/>
|
||||
</Drawer>
|
||||
</PageContainer>
|
||||
)
|
||||
handleCallLogs()
|
||||
const data = await handleGetAccountList(req)
|
||||
if (data && data.List && data.List.length > 0) {
|
||||
const list: any = []
|
||||
data.List.forEach((item: any, index: number) => {
|
||||
item.key = index + 1
|
||||
list.push(item)
|
||||
})
|
||||
setTableData(list)
|
||||
} else {
|
||||
setTableData([])
|
||||
}
|
||||
setTableLoading(false)
|
||||
}}>重置</Button>
|
||||
<Button type={'primary'} onClick={() => {
|
||||
handleGetTableList()
|
||||
}}>查询</Button>
|
||||
</div>
|
||||
</div>
|
||||
<div className={'tableBox'}>
|
||||
<ProTable
|
||||
loading={tableLoading}
|
||||
options={false}
|
||||
search={false}
|
||||
columns={columns}
|
||||
dataSource={tableData}
|
||||
pagination={{ pageSize: 20 }}
|
||||
scroll={{ y: 'calc(100vh - 460px)' }}
|
||||
onRow={(record) => {
|
||||
return {
|
||||
onClick: () => {
|
||||
setShowDrawer(true);
|
||||
console.log('record', record)
|
||||
setCurrentRow(record)
|
||||
},
|
||||
}
|
||||
}}
|
||||
>
|
||||
</ProTable>
|
||||
</div>
|
||||
|
||||
<Drawer
|
||||
width={'60%'}
|
||||
visible={showDrawer}
|
||||
closable={false}
|
||||
bodyStyle={{ padding: 0 }}
|
||||
onClose={() => {
|
||||
setShowDrawer(false);
|
||||
}}
|
||||
destroyOnClose={true}
|
||||
footer={
|
||||
currentRow?.Treatment_MarkState === 3 ?
|
||||
<div style={{ width: '100%', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
|
||||
<Button disabled={showDisable} danger onClick={() => {
|
||||
// 调用子组件里面的方法
|
||||
checkDetail.current?.handleEndaccountPhoto()
|
||||
}}>查看单据</Button>
|
||||
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
|
||||
<Button disabled={showDisable} style={{ marginRight: '8px' }} type={'primary'} onClick={() => {
|
||||
// 进行表单校验 校验通过之后调用保存的审核方法
|
||||
checkDetail.current.formRef.current?.validateFields().then(res => {
|
||||
if (res) {
|
||||
const desc = checkDetail.current?.handleGetApprovedInfo()
|
||||
handleSubmitEndaccountState(3, desc.Review_Info)
|
||||
}
|
||||
})
|
||||
}}>审核</Button>
|
||||
<Button onClick={() => { setShowDrawer(false) }}>关闭</Button>
|
||||
</div>
|
||||
</div> : ''
|
||||
}
|
||||
>
|
||||
<CheckDetail onRef={checkDetail} currentRow={currentRow} currentUser={currentUser} handleChangeShowDisable={handleChangeShowDisable} />
|
||||
</Drawer>
|
||||
</PageContainer>
|
||||
)
|
||||
}
|
||||
|
||||
export default connect(({ user }: ConnectState) => ({
|
||||
currentUser: user?.currentUser
|
||||
currentUser: user?.currentUser
|
||||
}))(List);
|
||||
|
||||
@ -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<any>()
|
||||
// 选择的服务区
|
||||
const [selectServicePartId,setSelectServicePartId] = useState<any>()
|
||||
// 门店列表
|
||||
const [shopList,setShopList] = useState<any>()
|
||||
// 选择的门店列表
|
||||
const [selectShopId,setSelectShopId] = useState<any>('')
|
||||
// 处理状态
|
||||
const [selectState,setSelectState] = useState<any>(1)
|
||||
// 查询时间
|
||||
const [selectTime,setSelectTime] = useState<any>([moment().subtract(1, 'day'),moment().subtract(1, 'day')])
|
||||
// 表格的加载效果
|
||||
const [tableLoading,setTableLoading] = useState<boolean>(false)
|
||||
// 显示抽屉
|
||||
const [showDrawer,setShowDrawer] = useState<boolean>(false)
|
||||
// 点击 或者双击的当前行数据
|
||||
const [currentRow,setCurrentRow] = useState<any>()
|
||||
// 选中的行数据
|
||||
const [selectRowList,setSelectRowList] = useState<any>()
|
||||
// 选中的行
|
||||
const [selectedOrderRowKeys,setSelectedOrderRowKeys] = useState<any>()
|
||||
// 根据子组件是否出现加载框来判断按钮是否禁用
|
||||
const [showDisable,setShowDisable] = useState<boolean>(false)
|
||||
// 详情的ref
|
||||
const checkDetail = useRef()
|
||||
// 表格数组
|
||||
const [tableData, setTableData] = useState<any>()
|
||||
// 选择的服务区
|
||||
const [selectServicePartId, setSelectServicePartId] = useState<any>()
|
||||
// 门店列表
|
||||
const [shopList, setShopList] = useState<any>()
|
||||
// 选择的门店列表
|
||||
const [selectShopId, setSelectShopId] = useState<any>('')
|
||||
// 处理状态
|
||||
const [selectState, setSelectState] = useState<any>(1)
|
||||
// 查询时间
|
||||
const [selectTime, setSelectTime] = useState<any>([moment().subtract(1, 'day'), moment().subtract(1, 'day')])
|
||||
// 表格的加载效果
|
||||
const [tableLoading, setTableLoading] = useState<boolean>(false)
|
||||
// 显示抽屉
|
||||
const [showDrawer, setShowDrawer] = useState<boolean>(false)
|
||||
// 点击 或者双击的当前行数据
|
||||
const [currentRow, setCurrentRow] = useState<any>()
|
||||
// 选中的行数据
|
||||
const [selectRowList, setSelectRowList] = useState<any>()
|
||||
// 选中的行
|
||||
const [selectedOrderRowKeys, setSelectedOrderRowKeys] = useState<any>()
|
||||
// 根据子组件是否出现加载框来判断按钮是否禁用
|
||||
const [showDisable, setShowDisable] = useState<boolean>(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 <span style={{color:record.Treatment_MarkState===0?'red':
|
||||
record.Treatment_MarkState===1?'#ff6600':'#0066FF',fontWeight:'bold',textDecoration:'underline',cursor:'pointer'}} onClick={()=>{
|
||||
setShowDrawer(true);
|
||||
setCurrentRow(record)
|
||||
}}>
|
||||
{record.Treatment_MarkState===0?'未做校验':
|
||||
record.Treatment_MarkState===1?'待您审核':
|
||||
record.Treatment_MarkState===2?'审核原因':
|
||||
record.Treatment_MarkState===3?'主任复核':
|
||||
record.Treatment_MarkState===4?'主任审结':''}
|
||||
</span>
|
||||
}
|
||||
},
|
||||
{
|
||||
dataIndex: 'Treatment_MarkState',
|
||||
title: '处理状态',
|
||||
width: 90,
|
||||
align: 'center',
|
||||
render:(_,record)=>{
|
||||
return <span
|
||||
style={{
|
||||
color:record.Treatment_MarkState===0?'red':
|
||||
record.Treatment_MarkState===1?'#ff6600':'#0066FF'
|
||||
}}
|
||||
>{record.Treatment_MarkState===0?'待处理':
|
||||
record.Treatment_MarkState===1?'待审核':
|
||||
record.Treatment_MarkState===2?'已审结':
|
||||
record.Treatment_MarkState===3?'主任复核':
|
||||
record.Treatment_MarkState===4?'主任审结':''}</span>
|
||||
}
|
||||
},
|
||||
{
|
||||
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 <div>{
|
||||
record.Description_Staff.indexOf('移')===-1?
|
||||
<span style={{display:'inline-block',width:'390px',textOverflow:'ellipsis',overflow:'hidden',whiteSpace:'nowrap'}}>{`${record.Description_Staff?`${record.Description_Staff}:`:''} ${record.Description_Info}`}</span>
|
||||
:
|
||||
<div style={{display:'flex',alignItems:'center',width:'390px',textOverflow:'ellipsis',overflow:'hidden',whiteSpace:'nowrap'}}>
|
||||
<img style={{width:'16px',height:'16px'}} src={mobile}/>
|
||||
<span>{`${record.Description_Staff.split('【')[0]}: ${record.Description_Info}`}</span>
|
||||
</div>
|
||||
|
||||
}</div>
|
||||
}
|
||||
},
|
||||
{
|
||||
dataIndex: 'TotalSell_Amount',
|
||||
title: '总销售额',
|
||||
width:100,
|
||||
align: 'right',
|
||||
hideInSearch:true,
|
||||
render:(_,record)=>{
|
||||
return <span>{fmoney(record.TotalSell_Amount,2)}</span>
|
||||
}
|
||||
},
|
||||
{
|
||||
dataIndex: 'Difference_Amount',
|
||||
title: '长短款',
|
||||
width:80,
|
||||
align: 'right',
|
||||
hideInSearch:true,
|
||||
render:(_,record)=>{
|
||||
return <span>{fmoney(record.Difference_Amount,2)}</span>
|
||||
}
|
||||
},
|
||||
{
|
||||
dataIndex: '',
|
||||
title: '客单均价',
|
||||
width:80,
|
||||
align: 'right',
|
||||
hideInTable:true,
|
||||
hideInSearch:true,
|
||||
render:(_,record)=>{
|
||||
return <span>{record.Ticket_Count?(record.TotalSell_Amount / record.Ticket_Count).toFixed(2):'-'}</span>
|
||||
}
|
||||
},
|
||||
{
|
||||
dataIndex: 'Revenue_Amount',
|
||||
title: '实收金额',
|
||||
width:100,
|
||||
align: 'right',
|
||||
hideInSearch:true,
|
||||
render:(_,record)=>{
|
||||
return <span>{fmoney(record.Revenue_Amount,2)}</span>
|
||||
}
|
||||
},
|
||||
{
|
||||
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 (
|
||||
<PageContainer header={{
|
||||
title: '',
|
||||
breadcrumb: {},
|
||||
const columns: any = [
|
||||
{
|
||||
dataIndex: 'key',
|
||||
title: '序号',
|
||||
width: 50,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
dataIndex: '',
|
||||
title: '',
|
||||
width: 100,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
render: (_, record) => {
|
||||
return <span style={{
|
||||
color: record.Treatment_MarkState === 0 ? 'red' :
|
||||
record.Treatment_MarkState === 1 ? '#ff6600' : '#0066FF', fontWeight: 'bold', textDecoration: 'underline', cursor: 'pointer'
|
||||
}} onClick={() => {
|
||||
setShowDrawer(true);
|
||||
setCurrentRow(record)
|
||||
}}>
|
||||
<div className={'searchBox'}>
|
||||
<div className={'searchBoxLeft'}>
|
||||
<div className={'searchItem'}>
|
||||
<span className={'searchLabel'}>服务区:</span>
|
||||
<Select
|
||||
style={{minWidth:'150px'}}
|
||||
value={selectServicePartId}
|
||||
options={serviceList}
|
||||
allowClear
|
||||
showSearch
|
||||
filterOption={(input, option) =>
|
||||
(option?.label ?? '').toLowerCase().includes(input.toLowerCase())
|
||||
}
|
||||
onChange={async (e)=>{
|
||||
setSelectServicePartId(e)
|
||||
const req = {
|
||||
ProvinceCode:currentUser?.USER_PROVINCE,
|
||||
ServerpartId:e,
|
||||
ShowWholePower:true
|
||||
}
|
||||
const data = await handleGetServiceShopList(req)
|
||||
setSelectShopId(null)
|
||||
setShopList(data.List)
|
||||
}}
|
||||
></Select>
|
||||
</div>
|
||||
<div className={'searchItem'}>
|
||||
<span className={'searchLabel'}>门店:</span>
|
||||
<Select
|
||||
style={{minWidth:'150px'}}
|
||||
value={selectShopId}
|
||||
allowClear
|
||||
options={shopList}
|
||||
onChange={(e)=>{
|
||||
setSelectShopId(e)
|
||||
}}
|
||||
></Select>
|
||||
</div>
|
||||
<div className={'searchItem'}>
|
||||
<span className={'searchLabel'}>处理状态:</span>
|
||||
<Select
|
||||
style={{minWidth:'150px'}}
|
||||
value={selectState}
|
||||
allowClear
|
||||
options={[{label:'待我审核',value:1},{label:'我已审核',value:2}]}
|
||||
onChange={(e)=>{
|
||||
setSelectState(e)
|
||||
}}
|
||||
></Select>
|
||||
</div>
|
||||
<div className={'searchItem'}>
|
||||
<span className={'searchLabel'}>时间:</span>
|
||||
<RangePicker
|
||||
value={selectTime}
|
||||
onChange={(e)=>{
|
||||
setSelectTime([moment(e[0]._d),moment(e[1]._d)])
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className={'searchBoxRight'}>
|
||||
<Button style={{marginRight:'8px'}} onClick={async ()=>{
|
||||
setTableLoading(true)
|
||||
setSelectServicePartId(null)
|
||||
setSelectShopId(null)
|
||||
setSelectState(1)
|
||||
setSelectTime([moment().subtract(1, 'day'),moment().subtract(1, 'day')])
|
||||
const req = {
|
||||
StartDate: moment().subtract(1, 'day').format('YYYY-MM-DD'),
|
||||
EndDate: moment().subtract(1, 'day').format('YYYY-MM-DD'),
|
||||
TreatmentMarkState:1,
|
||||
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)
|
||||
})
|
||||
setTableData(list)
|
||||
}else{
|
||||
setTableData([])
|
||||
}
|
||||
setTableLoading(false)
|
||||
}}>重置</Button>
|
||||
<Button type={'primary'} onClick={()=>{
|
||||
handleGetTableList()
|
||||
}}>查询</Button>
|
||||
</div>
|
||||
{record.Treatment_MarkState === 0 ? '未做校验' :
|
||||
record.Treatment_MarkState === 1 ? '待您审核' :
|
||||
record.Treatment_MarkState === 2 ? '审核原因' :
|
||||
record.Treatment_MarkState === 3 ? '主任复核' :
|
||||
record.Treatment_MarkState === 4 ? '主任审结' : ''}
|
||||
</span>
|
||||
}
|
||||
},
|
||||
{
|
||||
dataIndex: 'Treatment_MarkState',
|
||||
title: '处理状态',
|
||||
width: 90,
|
||||
align: 'center',
|
||||
render: (_, record) => {
|
||||
return <span
|
||||
style={{
|
||||
color: record.Treatment_MarkState === 0 ? 'red' :
|
||||
record.Treatment_MarkState === 1 ? '#ff6600' : '#0066FF'
|
||||
}}
|
||||
>{record.Treatment_MarkState === 0 ? '待处理' :
|
||||
record.Treatment_MarkState === 1 ? '待审核' :
|
||||
record.Treatment_MarkState === 2 ? '已审结' :
|
||||
record.Treatment_MarkState === 3 ? '主任复核' :
|
||||
record.Treatment_MarkState === 4 ? '主任审结' : ''}</span>
|
||||
}
|
||||
},
|
||||
{
|
||||
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 <div>{
|
||||
record.Description_Staff.indexOf('移') === -1 ?
|
||||
<span style={{ display: 'inline-block', width: '390px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }}>{`${record.Description_Staff ? `${record.Description_Staff}:` : ''} ${record.Description_Info}`}</span>
|
||||
:
|
||||
<div style={{ display: 'flex', alignItems: 'center', width: '390px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }}>
|
||||
<img style={{ width: '16px', height: '16px' }} src={mobile} />
|
||||
<span>{`${record.Description_Staff.split('【')[0]}: ${record.Description_Info}`}</span>
|
||||
</div>
|
||||
<div className={'tableBox'}>
|
||||
<ProTable
|
||||
key={'Endaccount_Id'}
|
||||
rowKey={'Endaccount_Id'}
|
||||
loading={tableLoading}
|
||||
options={false}
|
||||
search={false}
|
||||
rowSelection={{
|
||||
type: 'checkbox',
|
||||
...rowSelection,
|
||||
}}
|
||||
columns={columns}
|
||||
dataSource={tableData}
|
||||
scroll={{y:'calc(100vh - 470px)'}}
|
||||
pagination={{ pageSize: 20 }}
|
||||
toolbar={{
|
||||
actions: [
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={async () => {
|
||||
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('请先选择')
|
||||
}
|
||||
|
||||
}}
|
||||
>
|
||||
批量审核
|
||||
</Button>,
|
||||
],
|
||||
}}
|
||||
onRow={(record)=>{
|
||||
return {
|
||||
onDoubleClick: () => {
|
||||
setShowDrawer(true);
|
||||
setCurrentRow(record)
|
||||
}</div>
|
||||
}
|
||||
},
|
||||
{
|
||||
dataIndex: 'TotalSell_Amount',
|
||||
title: '总销售额',
|
||||
width: 100,
|
||||
align: 'right',
|
||||
hideInSearch: true,
|
||||
render: (_, record) => {
|
||||
return <span>{fmoney(record.TotalSell_Amount, 2)}</span>
|
||||
}
|
||||
},
|
||||
{
|
||||
dataIndex: 'Difference_Amount',
|
||||
title: '长短款',
|
||||
width: 80,
|
||||
align: 'right',
|
||||
hideInSearch: true,
|
||||
render: (_, record) => {
|
||||
return <span>{fmoney(record.Difference_Amount, 2)}</span>
|
||||
}
|
||||
},
|
||||
{
|
||||
dataIndex: '',
|
||||
title: '客单均价',
|
||||
width: 80,
|
||||
align: 'right',
|
||||
hideInTable: true,
|
||||
hideInSearch: true,
|
||||
render: (_, record) => {
|
||||
return <span>{record.Ticket_Count ? (record.TotalSell_Amount / record.Ticket_Count).toFixed(2) : '-'}</span>
|
||||
}
|
||||
},
|
||||
{
|
||||
dataIndex: 'Revenue_Amount',
|
||||
title: '实收金额',
|
||||
width: 100,
|
||||
align: 'right',
|
||||
hideInSearch: true,
|
||||
render: (_, record) => {
|
||||
return <span>{fmoney(record.Revenue_Amount, 2)}</span>
|
||||
}
|
||||
},
|
||||
{
|
||||
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 (
|
||||
<PageContainer header={{
|
||||
title: '',
|
||||
breadcrumb: {},
|
||||
}}>
|
||||
<div className={'searchBox'}>
|
||||
<div className={'searchBoxLeft'}>
|
||||
<div className={'searchItem'}>
|
||||
<span className={'searchLabel'}>服务区:</span>
|
||||
<Select
|
||||
style={{ minWidth: '150px' }}
|
||||
value={selectServicePartId}
|
||||
options={serviceList}
|
||||
allowClear
|
||||
showSearch
|
||||
filterOption={(input, option) =>
|
||||
(option?.label ?? '').toLowerCase().includes(input.toLowerCase())
|
||||
}
|
||||
onChange={async (e) => {
|
||||
setSelectServicePartId(e)
|
||||
// const req = {
|
||||
// ProvinceCode:currentUser?.USER_PROVINCE,
|
||||
// ServerpartId:e,
|
||||
// ShowWholePower:true
|
||||
// }
|
||||
// const data = await handleGetServiceShopList(req)
|
||||
|
||||
const req = {
|
||||
SearchParameter: {
|
||||
SERVERPART_IDS: e,
|
||||
ISVALID: 1
|
||||
},
|
||||
PageIndex: 1,
|
||||
PageSize: 999999,
|
||||
SortStr: "SHOPREGION,SHOPTRADE,SHOPSHORTNAME,SHOPCODE"
|
||||
}
|
||||
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)
|
||||
setShopList(list)
|
||||
}}
|
||||
>
|
||||
|
||||
</ProTable>
|
||||
></Select>
|
||||
</div>
|
||||
|
||||
<Drawer
|
||||
width={'60%'}
|
||||
visible={showDrawer}
|
||||
closable={false}
|
||||
bodyStyle={{ padding: 0 }}
|
||||
onClose={() => {
|
||||
setShowDrawer(false);
|
||||
}}
|
||||
destroyOnClose={true}
|
||||
footer={
|
||||
currentRow?.Treatment_MarkState===1?
|
||||
<div style={{width:'100%',display:'flex',alignItems:'center',justifyContent:'space-between'}}>
|
||||
<Button disabled={showDisable} danger onClick={()=>{
|
||||
checkDetail.current?.handleEndaccountPhoto()
|
||||
}}>查看单据</Button>
|
||||
<div style={{display:'flex',justifyContent:'flex-end'}}>
|
||||
<Button disabled={showDisable} style={{marginRight:'8px'}} type={'primary'} onClick={()=>{
|
||||
checkDetail.current.formRef.current?.validateFields().then(res=>{
|
||||
if (res){
|
||||
const desc = checkDetail.current?.handleGetApprovedInfo()
|
||||
handleSubmitEndaccountState(2,desc.Approved_Info)
|
||||
}
|
||||
})
|
||||
}}>审核</Button>
|
||||
<Button disabled={showDisable} style={{marginRight:'8px'}} danger onClick={()=>{
|
||||
checkDetail.current.formRef.current?.validateFields().then(res=>{
|
||||
if (res){
|
||||
const desc = checkDetail.current?.handleGetApprovedInfo()
|
||||
handleSubmitEndaccountState(0,desc.Approved_Info)
|
||||
}
|
||||
})
|
||||
}}>驳回</Button>
|
||||
<Button onClick={()=>{setShowDrawer(false)}}>关闭</Button>
|
||||
</div>
|
||||
</div>:''
|
||||
<div className={'searchItem'}>
|
||||
<span className={'searchLabel'}>门店:</span>
|
||||
<Select
|
||||
style={{ minWidth: '150px' }}
|
||||
value={selectShopId}
|
||||
allowClear
|
||||
options={shopList}
|
||||
onChange={(e) => {
|
||||
setSelectShopId(e)
|
||||
}}
|
||||
></Select>
|
||||
</div>
|
||||
<div className={'searchItem'}>
|
||||
<span className={'searchLabel'}>处理状态:</span>
|
||||
<Select
|
||||
style={{ minWidth: '150px' }}
|
||||
value={selectState}
|
||||
allowClear
|
||||
options={[{ label: '待我审核', value: 1 }, { label: '我已审核', value: 2 }]}
|
||||
onChange={(e) => {
|
||||
setSelectState(e)
|
||||
}}
|
||||
></Select>
|
||||
</div>
|
||||
<div className={'searchItem'}>
|
||||
<span className={'searchLabel'}>时间:</span>
|
||||
<RangePicker
|
||||
value={selectTime}
|
||||
onChange={(e) => {
|
||||
setSelectTime([moment(e[0]._d), moment(e[1]._d)])
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className={'searchBoxRight'}>
|
||||
<Button style={{ marginRight: '8px' }} onClick={async () => {
|
||||
setTableLoading(true)
|
||||
setSelectServicePartId(null)
|
||||
setSelectShopId(null)
|
||||
setSelectState(1)
|
||||
setSelectTime([moment().subtract(1, 'day'), moment().subtract(1, 'day')])
|
||||
const req = {
|
||||
StartDate: moment().subtract(1, 'day').format('YYYY-MM-DD'),
|
||||
EndDate: moment().subtract(1, 'day').format('YYYY-MM-DD'),
|
||||
TreatmentMarkState: 1,
|
||||
EndaccountState: 1,
|
||||
PageSize: 999999
|
||||
}
|
||||
>
|
||||
<CheckDetail onRef={checkDetail} currentRow={currentRow} currentUser={currentUser} handleChangeShowDisable={handleChangeShowDisable}/>
|
||||
</Drawer>
|
||||
</PageContainer>
|
||||
)
|
||||
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)
|
||||
}}>重置</Button>
|
||||
<Button type={'primary'} onClick={() => {
|
||||
handleGetTableList()
|
||||
}}>查询</Button>
|
||||
</div>
|
||||
</div>
|
||||
<div className={'tableBox'}>
|
||||
<ProTable
|
||||
key={'Endaccount_Id'}
|
||||
rowKey={'Endaccount_Id'}
|
||||
loading={tableLoading}
|
||||
options={false}
|
||||
search={false}
|
||||
rowSelection={{
|
||||
type: 'checkbox',
|
||||
...rowSelection,
|
||||
}}
|
||||
bordered
|
||||
columns={columns}
|
||||
dataSource={tableData}
|
||||
scroll={{ y: 'calc(100vh - 470px)' }}
|
||||
pagination={{ pageSize: 20 }}
|
||||
toolbar={{
|
||||
actions: [
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={async () => {
|
||||
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('请先选择')
|
||||
}
|
||||
|
||||
}}
|
||||
>
|
||||
批量审核
|
||||
</Button>,
|
||||
],
|
||||
}}
|
||||
onRow={(record) => {
|
||||
return {
|
||||
onDoubleClick: () => {
|
||||
setShowDrawer(true);
|
||||
setCurrentRow(record)
|
||||
},
|
||||
}
|
||||
}}
|
||||
>
|
||||
|
||||
</ProTable>
|
||||
</div>
|
||||
|
||||
<Drawer
|
||||
width={'60%'}
|
||||
visible={showDrawer}
|
||||
closable={false}
|
||||
bodyStyle={{ padding: 0 }}
|
||||
onClose={() => {
|
||||
setShowDrawer(false);
|
||||
}}
|
||||
destroyOnClose={true}
|
||||
footer={
|
||||
currentRow?.Treatment_MarkState === 1 ?
|
||||
<div style={{ width: '100%', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
|
||||
<Button disabled={showDisable} danger onClick={() => {
|
||||
checkDetail.current?.handleEndaccountPhoto()
|
||||
}}>查看单据</Button>
|
||||
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
|
||||
<Button disabled={showDisable} style={{ marginRight: '8px' }} type={'primary'} onClick={() => {
|
||||
checkDetail.current.formRef.current?.validateFields().then(res => {
|
||||
if (res) {
|
||||
const desc = checkDetail.current?.handleGetApprovedInfo()
|
||||
handleSubmitEndaccountState(2, desc.Approved_Info)
|
||||
}
|
||||
})
|
||||
}}>审核</Button>
|
||||
<Button disabled={showDisable} style={{ marginRight: '8px' }} danger onClick={() => {
|
||||
checkDetail.current.formRef.current?.validateFields().then(res => {
|
||||
if (res) {
|
||||
const desc = checkDetail.current?.handleGetApprovedInfo()
|
||||
handleSubmitEndaccountState(0, desc.Approved_Info)
|
||||
}
|
||||
})
|
||||
}}>驳回</Button>
|
||||
<Button onClick={() => { setShowDrawer(false) }}>关闭</Button>
|
||||
</div>
|
||||
</div> : ''
|
||||
}
|
||||
>
|
||||
<CheckDetail onRef={checkDetail} currentRow={currentRow} currentUser={currentUser} handleChangeShowDisable={handleChangeShowDisable} />
|
||||
</Drawer>
|
||||
</PageContainer >
|
||||
)
|
||||
}
|
||||
|
||||
export default connect(({ user }: ConnectState) => ({
|
||||
currentUser: user?.currentUser
|
||||
currentUser: user?.currentUser
|
||||
}))(List);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -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()
|
||||
}
|
||||
|
||||
@ -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<any>()
|
||||
|
||||
const [currentRow, setCurrentRow] = useState<EndaccountDetailModel>()
|
||||
const [currentRow, setCurrentRow] = useState<any>()
|
||||
// 切换页面版本
|
||||
const [pageVersion, setPageVersion] = useState<'new' | 'old'>('new')
|
||||
const [selectService, setSelectService] = useState<number>()// 页面选择的服务区
|
||||
@ -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)
|
||||
}}
|
||||
></Select>
|
||||
</div>
|
||||
@ -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 ?
|
||||
|
||||
@ -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 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -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<FormInstance>();
|
||||
const draggleRef = React.createRef<any>()
|
||||
|
||||
@ -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
|
||||
}}
|
||||
>
|
||||
<Divider orientation="left">商品基本信息</Divider>
|
||||
|
||||
@ -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"
|
||||
/>
|
||||
</span>,
|
||||
|
||||
@ -221,7 +221,7 @@ const inventoryDetail = ({ onShow, onCancel, parentRow, currentUser, ServerpartI
|
||||
|
||||
|
||||
{/* 进销存明细的悬浮框 */}
|
||||
<InventoryDetailModal onShow={showDetail} parentRow={currentRow} onCancel={handleModalCancel} />
|
||||
<InventoryDetailModal onShow={showDetail} parentRow={currentRow} onCancel={handleModalCancel} come={'inventory'} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@ -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<boolean>(false)
|
||||
// 查询的条件
|
||||
const [searchParams, setSearchParams] = useState<any>()
|
||||
// 拿到服务区下的所有门店id集合
|
||||
const [handleAllShopId, sethandleAllShopId] = useState<any>()
|
||||
|
||||
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: <div style={{ textAlign: 'center' }}>供应商/服务区名</div>,
|
||||
dataIndex: "Serverpart_Name",
|
||||
align: 'left',
|
||||
width: 200,
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
render: (_, record) => {
|
||||
return record?.Serverpart_Name || record?.Supplier_Name
|
||||
}
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>门店名称</div>,
|
||||
dataIndex: "ServerpartShop_Name",
|
||||
align: 'center',
|
||||
width: 150,
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: "采购总数量",
|
||||
dataIndex: "",
|
||||
align: 'center',
|
||||
width: 150,
|
||||
title: <div style={{ textAlign: 'center' }}>商品名称</div>,
|
||||
dataIndex: "Commodity_Name",
|
||||
align: 'left',
|
||||
width: 200,
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: "采购含税金额",
|
||||
dataIndex: "",
|
||||
align: 'center',
|
||||
width: 150,
|
||||
title: <div style={{ textAlign: 'center' }}>采购总数量</div>,
|
||||
dataIndex: "Storage_Count",
|
||||
align: 'right',
|
||||
valueType: 'digit',
|
||||
width: 120,
|
||||
sorter: true,
|
||||
defaultSortOrder: 'descend',
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: "采购除税金额",
|
||||
dataIndex: "",
|
||||
align: 'center',
|
||||
width: 150,
|
||||
title: <div style={{ textAlign: 'center' }}>采购含税金额</div>,
|
||||
dataIndex: "Storage_TaxAmount",
|
||||
align: 'right',
|
||||
valueType: 'digit',
|
||||
width: 120,
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: "入库总数量",
|
||||
dataIndex: "",
|
||||
align: 'center',
|
||||
width: 150,
|
||||
title: <div style={{ textAlign: 'center' }}>采购除税金额</div>,
|
||||
dataIndex: "Storage_Amount",
|
||||
align: 'right',
|
||||
valueType: 'digit',
|
||||
width: 120,
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: "入库含税金额",
|
||||
dataIndex: "",
|
||||
align: 'center',
|
||||
width: 150,
|
||||
title: <div style={{ textAlign: 'center' }}>退货数量</div>,
|
||||
dataIndex: "Back_Count",
|
||||
align: 'right',
|
||||
valueType: 'digit',
|
||||
width: 120,
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: "入库除税金额",
|
||||
dataIndex: "",
|
||||
align: 'center',
|
||||
width: 150,
|
||||
title: <div style={{ textAlign: 'center' }}>退货含税金额</div>,
|
||||
dataIndex: "Back_TaxAmount",
|
||||
align: 'right',
|
||||
valueType: 'digit',
|
||||
width: 120,
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>退货除税金额</div>,
|
||||
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: <div style={{ textAlign: 'center' }}>服务区名</div>,
|
||||
dataIndex: "Serverpart_Name",
|
||||
align: 'left',
|
||||
width: 200,
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>供应商名</div>,
|
||||
dataIndex: "Supplier_Name",
|
||||
align: 'left',
|
||||
width: 200,
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
|
||||
},
|
||||
]
|
||||
|
||||
return (
|
||||
<div ref={(el) => {
|
||||
@ -193,7 +283,7 @@ const purchaseReceiving: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
{
|
||||
showExportTable && reqDetailList && reqDetailList.length > 0 ?
|
||||
<ProTable
|
||||
columns={columns}
|
||||
columns={[...exportColumns, ...columns.slice(4, columns.length)]}
|
||||
dataSource={reqDetailList}
|
||||
pagination={false}
|
||||
expandable={{
|
||||
@ -205,7 +295,7 @@ const purchaseReceiving: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
<div id='hiddenBox' style={{ position: 'fixed', zIndex: -1, top: 0, left: 0 }} />
|
||||
|
||||
<div style={{ backgroundColor: '#fff', display: 'flex' }}>
|
||||
<LeftSelectTree setSelectedId={setSelectedId} setCollapsible={setCollapsible} collapsible={collapsible} />
|
||||
<LeftSelectTree setSelectedId={setSelectedId} setCollapsible={setCollapsible} setAllServiceShop={sethandleAllShopId} collapsible={collapsible} pageType={'ahjg'} />
|
||||
<div style={{
|
||||
width: !collapsible ? 'calc(100% - 300px)' : 'calc(100% - 60px)',
|
||||
paddingTop: 0,
|
||||
@ -220,15 +310,82 @@ const purchaseReceiving: React.FC<{ currentUser: CurrentUser }> = (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={<PageTitleBox props={props} />} // 列表表头
|
||||
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"
|
||||
/>
|
||||
</span>,
|
||||
|
||||
274
src/pages/ahjgPage/returnProcess/components/returnGoodsTable.tsx
Normal file
274
src/pages/ahjgPage/returnProcess/components/returnGoodsTable.tsx
Normal file
@ -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<ActionType>();
|
||||
const formRef = useRef<FormInstance>();
|
||||
const draggleRef = React.createRef<any>()
|
||||
|
||||
// 弹出框拖动效果
|
||||
const [bounds, setBounds] = useState<{ left: number, right: number, top: number, bottom: number }>() // 移动的位置
|
||||
const [disabled, setDraggleDisabled] = useState<boolean>() // 是否拖动
|
||||
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<any>()
|
||||
|
||||
const columns: any = [
|
||||
{
|
||||
title: "序号",
|
||||
width: 80,
|
||||
valueType: 'index',
|
||||
dataIndex: "index",
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: "商品条码",
|
||||
width: 120,
|
||||
dataIndex: "COMMODITY_BARCODE",
|
||||
align: 'center',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>商品名称</div>,
|
||||
width: 150,
|
||||
dataIndex: "COMMODITY_NAME",
|
||||
align: 'left',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '退货门店',
|
||||
width: 120,
|
||||
dataIndex: "SHOPNAME",
|
||||
align: 'center',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>供应商名</div>,
|
||||
width: 150,
|
||||
dataIndex: "SUPPLIER_NAME",
|
||||
align: 'left',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>退货数量</div>,
|
||||
width: 120,
|
||||
dataIndex: "BACK_COUNT",
|
||||
valueType: 'digit',
|
||||
align: 'right',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>税率</div>,
|
||||
width: 120,
|
||||
dataIndex: "DUTY_PARAGRAPH",
|
||||
align: 'right',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>含税进价</div>,
|
||||
width: 120,
|
||||
dataIndex: "PURCHASE_TAXPRICE",
|
||||
valueType: 'digit',
|
||||
align: 'right',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>含税金额</div>,
|
||||
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 (
|
||||
<div>
|
||||
<Modal
|
||||
title={
|
||||
<div
|
||||
className="returnGoodsTableTitle"
|
||||
style={{
|
||||
width: '100%',
|
||||
cursor: 'move',
|
||||
}}
|
||||
onMouseOver={() => {
|
||||
if (disabled) {
|
||||
setDraggleDisabled(false)
|
||||
}
|
||||
}}
|
||||
onMouseOut={() => {
|
||||
setDraggleDisabled(true)
|
||||
}}
|
||||
|
||||
onFocus={() => { }}
|
||||
onBlur={() => { }}
|
||||
>退货表单</div>
|
||||
}
|
||||
destroyOnClose={true}
|
||||
width={'80%'}
|
||||
bodyStyle={{
|
||||
height: '700px', // 你可以根据需要调整高度
|
||||
overflowY: 'auto',
|
||||
}}
|
||||
visible={showDetail}
|
||||
onCancel={() => {
|
||||
if (onCencel) {
|
||||
onCencel()
|
||||
}
|
||||
}}
|
||||
footer={false}
|
||||
modalRender={(modal) => {
|
||||
return <Draggable
|
||||
disabled={disabled}
|
||||
bounds={bounds}
|
||||
onStart={(event, uiData) => onDraggaleStart(event, uiData)}
|
||||
handle=".returnGoodsTableTitle"
|
||||
>
|
||||
<div ref={draggleRef}>{modal}</div>
|
||||
</Draggable>
|
||||
}}
|
||||
>
|
||||
<div style={{ width: '100%', display: 'flex', alignItems: 'center', justifyContent: 'flex-end', boxSizing: 'border-box', padding: '0 24px' }}>
|
||||
<Button type={'primary'} onClick={() => {
|
||||
const printName: string = `${parentRow?.DEPT_NAME || ''}自采退货单`;
|
||||
|
||||
// 获取页面所有样式
|
||||
const styles = Array.from(document.styleSheets)
|
||||
.map((sheet: any) =>
|
||||
Array.from(sheet.cssRules || []).map((rule: any) => rule.cssText).join('\n')
|
||||
)
|
||||
.join('\n');
|
||||
|
||||
// 克隆表格 DOM
|
||||
const originalTable: any = document.getElementsByClassName('returnGoodsTable')[0];
|
||||
const clonedTable = originalTable.cloneNode(true) as HTMLElement;
|
||||
clonedTable.style.display = 'block';
|
||||
|
||||
// 遍历设置字体大小
|
||||
const setFontSizeRecursively = (element: HTMLElement) => {
|
||||
element.style.fontSize = '10px';
|
||||
element.style.padding = '4px';
|
||||
Array.from(element.children).forEach((child) =>
|
||||
setFontSizeRecursively(child as HTMLElement)
|
||||
);
|
||||
};
|
||||
const tableCells = clonedTable.querySelectorAll('thead th, tbody td, tfoot td');
|
||||
tableCells.forEach((cell) => setFontSizeRecursively(cell as HTMLElement));
|
||||
console.log('clonedTableclonedTableclonedTableclonedTable', clonedTable);
|
||||
|
||||
// 获取克隆后的 HTML 内容
|
||||
const clonedHTML = clonedTable.getElementsByClassName('ant-table')[0].innerHTML;
|
||||
|
||||
// 页眉(标题 + 描述)
|
||||
let neckList: any = [
|
||||
{ label: "退货单号", value: parentRow?.ACCEPT_CODE || '' },
|
||||
{ label: "退货数量", value: currentModalDetail?.RETURN_COUNT || '' },
|
||||
{ label: "退货金额", value: currentModalDetail?.RETURN_AMOUNT || '' },
|
||||
{ label: "申请人员", value: parentRow?.STAFF_NAME || '' },
|
||||
{ label: "退货说明", value: parentRow?.PROINST_DESC || '' },
|
||||
]
|
||||
|
||||
|
||||
// 调用统一打印方法
|
||||
handleNewPrintAHJG(printName, `${parentRow?.DEPT_NAME || ''}自采退货单`, neckList, styles, clonedHTML, '');
|
||||
}}>打印退货单</Button>
|
||||
</div>
|
||||
|
||||
<div style={{ width: "100%", display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: "24px", fontWeight: 500 }}>
|
||||
{`${parentRow?.DEPT_NAME}自采退货单`}
|
||||
</div>
|
||||
|
||||
<ProTable
|
||||
actionRef={actionRef}
|
||||
className="returnGoodsTable"
|
||||
formRef={formRef}
|
||||
bordered
|
||||
search={false}
|
||||
pagination={false}
|
||||
columns={columns}
|
||||
options={false}
|
||||
request={async () => {
|
||||
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 <div style={{ width: '100%', boxSizing: 'border-box', padding: '24px' }}>
|
||||
<Descriptions
|
||||
size="small" column={4}
|
||||
className="commity-sale-description"
|
||||
contentStyle={{ fontWeight: "bolder" }} labelStyle={{ color: "#00000073" }}
|
||||
>
|
||||
<Descriptions.Item label="退货单号">{parentRow?.ACCEPT_CODE || ""}</Descriptions.Item>
|
||||
<Descriptions.Item label="退货数量">{""}</Descriptions.Item>
|
||||
<Descriptions.Item label="退货金额">{""}</Descriptions.Item>
|
||||
<Descriptions.Item label="申请人员">{parentRow?.STAFF_NAME || ""}</Descriptions.Item>
|
||||
|
||||
<Descriptions.Item label="退货说明">{parentRow?.PROINST_DESC || ""}</Descriptions.Item>
|
||||
</Descriptions>
|
||||
</div>
|
||||
}}
|
||||
/>
|
||||
</Modal >
|
||||
</div >
|
||||
)
|
||||
}
|
||||
|
||||
export default connect(({ user, }: ConnectState) => ({
|
||||
currentUser: user.currentUser,
|
||||
}))(ReturnGoodsTable);
|
||||
@ -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<any>()
|
||||
|
||||
// 显示配送单
|
||||
const [onShow, setOnShow] = useState<boolean>(false)
|
||||
// 当前行数据
|
||||
const [currentRow, setCurrentRow] = useState<any>()
|
||||
|
||||
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 <a onClick={() => {
|
||||
console.log('recordrecordrecord', record);
|
||||
|
||||
setCurrentRow(record)
|
||||
setOnShow(true)
|
||||
}}>
|
||||
1
|
||||
</a>
|
||||
}
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>合计含税进价</div>,
|
||||
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 (
|
||||
<div ref={(el) => {
|
||||
@ -260,13 +283,16 @@ const returnProcess: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
scroll={{ x: "100%", y: "calc(100vh - 410px)" }}
|
||||
headerTitle={<PageTitleBox props={props} />} // 列表表头
|
||||
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) => {
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 退货单 */}
|
||||
<ReturnGoodsTable showDetail={onShow} parentRow={currentRow} onCencel={handleCloseModal} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@ -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
|
||||
}
|
||||
@ -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) => {
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
<ProFormRadio.Group
|
||||
name="POST"
|
||||
options={[{ label: "现场稽查", value: "现场稽查" }, { label: "区域稽查", value: "区域稽查" }, { label: "公司稽查", value: "公司稽查" }]}
|
||||
/>
|
||||
|
||||
<Divider orientation="left" plain>人员权限</Divider>
|
||||
|
||||
<ProFormCheckbox.Group
|
||||
name="WORKER_OTHER"
|
||||
request={() => {
|
||||
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 },
|
||||
|
||||
@ -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 (
|
||||
<div>
|
||||
<div className={`saleReportHideBox${printIndex}`} style={{ position: 'fixed', zIndex: -1, top: 0, left: 0 }}>
|
||||
<div className={`warehouseInfo${printIndex}`} style={{ position: 'fixed', zIndex: -1, top: 0, left: 0 }}>
|
||||
{
|
||||
showExportTable && reqDetailList && reqDetailList.length > 0 ?
|
||||
<ProTable
|
||||
@ -283,7 +252,7 @@ const warehouseInfo = ({ onShow, parentRow, onCencel }: DetailProps) => {
|
||||
formRef={formRef}
|
||||
columns={columns}
|
||||
bordered
|
||||
scroll={{ x: '100%', y: 300 }}
|
||||
scroll={{ x: '100%', y: 270 }}
|
||||
search={false}
|
||||
options={false}
|
||||
request={async (params) => {
|
||||
|
||||
@ -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<boolean>(false)
|
||||
const [reqDetailList, setReqDetailList] = useState<any>(); // 合计项数据源
|
||||
// 表格的合计值
|
||||
const [tableSumObj, setTableSumObj] = useState<any>();
|
||||
// 表格加载效果
|
||||
const [tableLoading, setTableLoading] = useState<boolean>(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={<PageTitleBox props={props} />} // 列表表头
|
||||
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) => {
|
||||
// }}>填写申请</Button>
|
||||
]
|
||||
}}
|
||||
tableExtraRender={
|
||||
(_, data) => {
|
||||
return <div style={{ paddingLeft: 24 }}>
|
||||
<Descriptions
|
||||
size="small" column={5}
|
||||
className="commity-sale-description"
|
||||
contentStyle={{ fontWeight: "bolder" }} labelStyle={{ color: "#00000073" }}
|
||||
>
|
||||
<Descriptions.Item label="入库总数">{tableSumObj?.RECEIVE_TOTALCOUNT ? tableSumObj?.RECEIVE_TOTALCOUNT.toLocaleString('zh-CN') : ""}<Text
|
||||
type="secondary"> </Text></Descriptions.Item>
|
||||
<Descriptions.Item label="入库金额">{tableSumObj?.RECEIVE_TOTALPRICE ? tableSumObj?.RECEIVE_TOTALPRICE.toLocaleString('zh-CN') : ""}<Text
|
||||
type="secondary"> </Text></Descriptions.Item>
|
||||
</Descriptions>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
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 (
|
||||
<Table.Summary fixed="top">
|
||||
<Table.Summary.Row>
|
||||
<Table.Summary.Cell index={0} colSpan={3}>
|
||||
<div style={{ textAlign: 'center', fontWeight: 600 }}>本页合计</div>
|
||||
</Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={1}></Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={2}></Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={3}></Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={4}>
|
||||
<div style={{ textAlign: 'right' }}>
|
||||
{RECEIVE_TOTALCOUNTSUM ? Number(RECEIVE_TOTALCOUNTSUM.toFixed(2)).toLocaleString('zh-CN') : ''}
|
||||
</div>
|
||||
</Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={5}>
|
||||
<div style={{ textAlign: 'right' }}>
|
||||
{RECEIVE_TOTALPRICESUM ? Number(RECEIVE_TOTALPRICESUM.toFixed(2)).toLocaleString('zh-CN') : ''}
|
||||
</div>
|
||||
</Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={6}></Table.Summary.Cell>
|
||||
</Table.Summary.Row>
|
||||
</Table.Summary>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -44,7 +44,7 @@ const ContractDetail = ({ tableData, detail }: DetailProps) => {
|
||||
dataIndex: 'COMPACT_NAME',
|
||||
width: 300,
|
||||
render: (_, record) => {
|
||||
return <a style={{ display: 'inline-block', width: '270px', whiteSpace: 'nowrap', textOverflow: 'ellipsis', overflow: 'hidden' }} onClick={() => {
|
||||
return <a style={{ display: 'inline-block', width: '270px', whiteSpace: 'nowrap', textOverflow: 'ellipsis', overflow: 'hidden' }} onClick={() => {
|
||||
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,
|
||||
|
||||
@ -51,6 +51,8 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) =>
|
||||
const [relatedShop, setRelatedShop] = useState<any>()
|
||||
// 选择的门店id数组
|
||||
const [selectShop, setSelectShop] = useState<any>()
|
||||
// 显示的人员权限可以选择的内容
|
||||
const [showPROWERSETList, setShowPROWERSETList] = useState<any>()
|
||||
|
||||
const { loading: PROWERSETLoading, data: PROWERSET } = useRequest(async () => {
|
||||
const data = await getFieldEnum({ FieldExplainField: 'PROWERSET' })
|
||||
@ -362,7 +364,6 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) =>
|
||||
<div>
|
||||
<Button type='primary' style={{ marginRight: '16px' }} onClick={() => {
|
||||
editFormRef.current?.validateFields().then(async (res) => {
|
||||
|
||||
// 根据当前的服务区 去拿个code
|
||||
const code = await handleNewGetSERVERPARTDetail({ SERVERPARTId: res.SERVERPART_ID })
|
||||
console.log('codecodecodecode', code);
|
||||
@ -385,13 +386,14 @@ const serviceAreaPersonnel: 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
|
||||
@ -494,6 +496,36 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) =>
|
||||
message: '请选择人员类别',
|
||||
},
|
||||
]}
|
||||
fieldProps={{
|
||||
onChange: (e: any) => {
|
||||
console.log('e', e);
|
||||
// WORKER_OTHER: ['']
|
||||
let list: any = []
|
||||
let nowValueList: any = []
|
||||
|
||||
if (e === 1) {
|
||||
editFormRef.current?.setFieldsValue({ WORKER_OTHER: ['1', '5', '8', '13', '15', '47', '52', '53'] })
|
||||
nowValueList = ['1', '2', '4', '5', '6', '8', '9', '10', '13', '15', '35', '47', '52', '53']
|
||||
} else if (e === 2) {
|
||||
editFormRef.current?.setFieldsValue({ WORKER_OTHER: ['2', '3', '4', '6', '18', '35', '36', '51'] })
|
||||
nowValueList = ['1', '2', '3', '4', '5', '6', '8', '9', '10', '13', '15', '18', '35', '36', '47', '50', '51', '52', '53', '120']
|
||||
} else if (e === 20) {
|
||||
editFormRef.current?.setFieldsValue({ WORKER_OTHER: ['2', '3', '4', '6', '8', '18', '35', '47', '51'] })
|
||||
nowValueList = ['2', '3', '4', '6', '8', '9', '10', '18', '35', '47', '51']
|
||||
}
|
||||
if (PROWERSET && PROWERSET.length > 0) {
|
||||
PROWERSET.forEach((item: any) => {
|
||||
if (nowValueList.indexOf(item.value.toString()) !== -1) {
|
||||
list.push(item)
|
||||
}
|
||||
})
|
||||
}
|
||||
console.log('PROWERSETPROWERSETPROWERSETPROWERSET', PROWERSET);
|
||||
console.log('listlistlistlistlist', list);
|
||||
|
||||
setShowPROWERSETList(list)
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
@ -561,15 +593,16 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) =>
|
||||
<Divider orientation="left" plain>人员权限</Divider>
|
||||
<ProFormCheckbox.Group
|
||||
name="WORKER_OTHER"
|
||||
request={() => {
|
||||
console.log('PROWERSET', PROWERSET);
|
||||
if (PROWERSET && PROWERSET.length > 0) {
|
||||
PROWERSET.forEach((item: any) => {
|
||||
item.value = item.value.toString()
|
||||
})
|
||||
}
|
||||
return PROWERSET
|
||||
}}
|
||||
options={showPROWERSETList}
|
||||
// request={() => {
|
||||
// if (PROWERSET && PROWERSET.length > 0) {
|
||||
// PROWERSET.forEach((item: any) => {
|
||||
// item.value = item.value.toString()
|
||||
// })
|
||||
// }
|
||||
// console.log('PROWERSET', PROWERSET);
|
||||
// return PROWERSET
|
||||
// }}
|
||||
// options={[
|
||||
// { label: '销售', value: 1 },
|
||||
// { label: '退货', value: 2 },
|
||||
|
||||
@ -253,7 +253,6 @@ const ConvenienceStoreProductReview: React.FC<{ currentUser: CurrentUser }> = (p
|
||||
let list: any = JSON.parse(JSON.stringify(selectedModalOrderRowKeys))
|
||||
console.log('listlistlist', list);
|
||||
console.log('tableDatatableDatatableData', tableData);
|
||||
|
||||
let reqList: any = []
|
||||
// 判断是不是所有的价格都已经输入了
|
||||
let isAllOk: boolean = true
|
||||
@ -261,6 +260,9 @@ const ConvenienceStoreProductReview: React.FC<{ currentUser: CurrentUser }> = (p
|
||||
let noPriceName: string = ''
|
||||
tableData.forEach((item: any) => {
|
||||
if (list.indexOf(item.COMMODITY_ID.toString()) !== -1) {
|
||||
if (item.COMMODITY_TYPE === '普通商品') {
|
||||
item.COMMODITY_TYPE = 1012
|
||||
}
|
||||
reqList.push(item)
|
||||
}
|
||||
if (!item.COMMODITY_CURRPRICE) {
|
||||
|
||||
@ -129,23 +129,23 @@ const commodityInfo: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
request: async () => {
|
||||
// const data = await getServerpartOption(340000)
|
||||
// return data
|
||||
const serverpartList: any = session.get('serverpartList')
|
||||
let serverpartId: string = ''
|
||||
if (serverpartList && serverpartList.length > 0) {
|
||||
serverpartList.forEach((item: any) => {
|
||||
if (serverpartId) {
|
||||
serverpartId += `,${item.value}`
|
||||
} else {
|
||||
serverpartId = item.value
|
||||
}
|
||||
})
|
||||
}
|
||||
const ServerpartIdsTree: any = session.get('ServerpartIdsTree')
|
||||
// let serverpartId: string = ''
|
||||
// if (serverpartList && serverpartList.length > 0) {
|
||||
// serverpartList.forEach((item: any) => {
|
||||
// if (serverpartId) {
|
||||
// serverpartId += `,${item.value}`
|
||||
// } else {
|
||||
// serverpartId = item.value
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
|
||||
// serverpartList.unshift({
|
||||
// label: "全部",
|
||||
// value: ''
|
||||
// })
|
||||
return serverpartList
|
||||
return ServerpartIdsTree
|
||||
},
|
||||
fieldProps: {
|
||||
showSearch: true,
|
||||
@ -364,7 +364,7 @@ const commodityInfo: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
// 拿到对应的商品业态
|
||||
const handleGetCommodity = async (id: any) => {
|
||||
const req: any = {
|
||||
ProvinceCode: currentUser?.USER_PROVINCE,
|
||||
ProvinceCode: currentUser?.ProvinceCode,
|
||||
ServerpartId: id
|
||||
}
|
||||
const data = await handleGetServerpartShopTrade(req)
|
||||
@ -455,7 +455,7 @@ const commodityInfo: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
setCollapsible(!collapsible)
|
||||
}} />}
|
||||
colSpan={!collapsible ? "300px" : "60px"}
|
||||
title={!collapsible ? "请选择服务区" : ""}
|
||||
title={!collapsible ? "请选择商品类别" : ""}
|
||||
headerBordered
|
||||
collapsed={collapsible}
|
||||
>
|
||||
@ -610,21 +610,23 @@ const commodityInfo: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
name="SERVERPART_ID"
|
||||
label="服务区名"
|
||||
request={async () => {
|
||||
const data = await getServerpartTree(currentUser?.ProvinceCode, currentUser?.CityAuthority, true, true, true)
|
||||
const list: any = []
|
||||
if (data && data.length > 0) {
|
||||
data.forEach((item: any) => {
|
||||
if (item.children && item.children.length > 0) {
|
||||
item.children.forEach((subItem: any) => {
|
||||
list.push({ label: subItem.label, value: subItem.value })
|
||||
})
|
||||
}
|
||||
})
|
||||
data.forEach((item: any) => {
|
||||
list.push({ label: item.label, value: item.value })
|
||||
})
|
||||
}
|
||||
return list
|
||||
const ServerpartIdsTree: any = session.get('ServerpartIdsTree')
|
||||
|
||||
// const data = await getServerpartTree(currentUser?.ProvinceCode, currentUser?.CityAuthority, true, true, true)
|
||||
// const list: any = []
|
||||
// if (data && data.length > 0) {
|
||||
// data.forEach((item: any) => {
|
||||
// if (item.children && item.children.length > 0) {
|
||||
// item.children.forEach((subItem: any) => {
|
||||
// list.push({ label: subItem.label, value: subItem.value })
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
// data.forEach((item: any) => {
|
||||
// list.push({ label: item.label, value: item.value })
|
||||
// })
|
||||
// }
|
||||
return ServerpartIdsTree
|
||||
}}
|
||||
rules={[
|
||||
{
|
||||
|
||||
@ -123,8 +123,8 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
request: async () => {
|
||||
// const data = await getServerpartOption(currentUser?.ProvinceCode)
|
||||
// console.log('datadatadatadata', data);
|
||||
const serverpartList: any = session.get('serverpartList')
|
||||
return serverpartList
|
||||
const ServerpartIdsTree: any = session.get('ServerpartIdsTree')
|
||||
return ServerpartIdsTree
|
||||
},
|
||||
fieldProps: {
|
||||
showSearch: true,
|
||||
@ -364,7 +364,7 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
setCollapsible(!collapsible)
|
||||
}} />}
|
||||
colSpan={!collapsible ? "300px" : "60px"}
|
||||
title={!collapsible ? "请选择服务区" : ""}
|
||||
title={!collapsible ? "请选择商品类别" : ""}
|
||||
headerBordered
|
||||
collapsed={collapsible}
|
||||
>
|
||||
|
||||
@ -1,14 +1,15 @@
|
||||
import {connect} from "umi";
|
||||
import type {CurrentUser} from "umi";
|
||||
import type {ConnectState} from "@/models/connect";
|
||||
import React, {useRef, useState} from "react";
|
||||
// 商品快捷键管理
|
||||
import { connect } from "umi";
|
||||
import type { CurrentUser } from "umi";
|
||||
import type { ConnectState } from "@/models/connect";
|
||||
import React, { useRef, useState } from "react";
|
||||
import ProCard from "@ant-design/pro-card";
|
||||
import {MenuFoldOutlined} from "@ant-design/icons";
|
||||
import type {FormInstance} from "antd";
|
||||
import {Avatar, Button, Drawer, Menu, message, Space, Spin, Tree} from "antd";
|
||||
import { MenuFoldOutlined } from "@ant-design/icons";
|
||||
import type { FormInstance } from "antd";
|
||||
import { Avatar, Button, Drawer, Menu, message, Space, Spin, Tree } from "antd";
|
||||
import useRequest from "@ahooksjs/use-request";
|
||||
import {getFieldEnum, getServerpartTree, handleCallLogs} from "@/services/options";
|
||||
import type {ActionType} from "@ant-design/pro-table";
|
||||
import { getFieldEnum, getServerpartTree, handleCallLogs } 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 {
|
||||
@ -22,7 +23,7 @@ import Detail from "@/pages/reports/productControl/components/detail";
|
||||
import PageTitleBox from "@/components/PageTitleBox";
|
||||
|
||||
|
||||
const hotkeyset: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
const hotkeyset: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
const { currentUser } = props
|
||||
const downloadBtnRef = useRef<any>()
|
||||
const actionRef = useRef<ActionType>();
|
||||
@ -30,8 +31,8 @@ const hotkeyset: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
const [reqDetailList, setReqDetailList] = useState<any>(); // 合计项数据源
|
||||
const [printOut, setPrintOut] = useState<any>(); // 打印数据的内容
|
||||
const [collapsible, setCollapsible] = useState<boolean>(false)
|
||||
const [treeView,setTreeView] = useState<any>()
|
||||
const [detailTreeView,setDetailTreeView] = useState<any>()
|
||||
const [treeView, setTreeView] = useState<any>()
|
||||
const [detailTreeView, setDetailTreeView] = useState<any>()
|
||||
// 加载服务区树
|
||||
const { loading: treeLoading, data: treeViews } = useRequest(async () => {
|
||||
const data = await getServerpartTree(currentUser?.ProvinceCode, currentUser?.CityAuthority, true, true, true)
|
||||
@ -49,35 +50,39 @@ const hotkeyset: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
setDetailTreeView(data)
|
||||
return data
|
||||
})
|
||||
// 树相关的属性和方法
|
||||
// 树相关的属性和方法
|
||||
const [selectedId, setSelectedId] = useState<string>()
|
||||
// 导出的加载效果
|
||||
const [showLoading,setShowLoading] = useState<boolean>(false)
|
||||
// 导出的加载效果
|
||||
const [showLoading, setShowLoading] = useState<boolean>(false)
|
||||
// 是否显示打印的表格
|
||||
const [showExportTable,setShowExportTable] = useState<boolean>(false)
|
||||
const [showExportTable, setShowExportTable] = useState<boolean>(false)
|
||||
const [currenMenu, setCurrenMenu] = useState<any>(); // 当前选中左侧菜单的服务区节点
|
||||
const [commodityList,setCommodityList] = useState<any>()
|
||||
const [showDetail,setShowDetail] = useState<boolean>(false)
|
||||
const [currentRow,setCurrentRow] = useState<any>()
|
||||
const [commodityList, setCommodityList] = useState<any>()
|
||||
const [showDetail, setShowDetail] = useState<boolean>(false)
|
||||
const [currentRow, setCurrentRow] = useState<any>()
|
||||
// 显示快捷键值的编辑
|
||||
const [showHotKeyEdit,setShowHotKeyEdit] = useState<boolean>(false)
|
||||
const [showHotKeyEdit, setShowHotKeyEdit] = useState<boolean>(false)
|
||||
// 编辑的快捷键值
|
||||
const [getNewHotKey,setGetNewHotKey] = useState<string>('')
|
||||
const [getNewHotKey, setGetNewHotKey] = useState<string>('')
|
||||
|
||||
const columns: any = [
|
||||
{
|
||||
title:'商品业态',
|
||||
title: '商品业态',
|
||||
dataIndex: 'ShopTrade',
|
||||
hideInTable: true,
|
||||
valueType: 'select',
|
||||
// initialValue: '1000',
|
||||
valueEnum: commodityList,
|
||||
fieldProps: {
|
||||
showSearch: true,
|
||||
filterOption: (input: any, option: any) => (option?.label ?? '').toLowerCase().includes(input.toLowerCase()),
|
||||
},
|
||||
// request: async () => {
|
||||
// return await getFieldEnum({ FieldExplainField: 'BUSINESSTYPE', sessionName: 'SHOPTRADE', notformate: true })
|
||||
// }
|
||||
},
|
||||
{
|
||||
title:'商品状态',
|
||||
title: '商品状态',
|
||||
dataIndex: 'CommodityState',
|
||||
hideInTable: true,
|
||||
valueType: 'select',
|
||||
@ -86,48 +91,48 @@ const hotkeyset: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
initialValue: '1'
|
||||
},
|
||||
{
|
||||
title:'序号',
|
||||
title: '序号',
|
||||
width: 70,
|
||||
dataIndex: 'index',
|
||||
valueType: 'index',
|
||||
hieInSearch: true
|
||||
},
|
||||
{
|
||||
title:<div style={{textAlign:'center'}}>快捷键</div>,
|
||||
title: <div style={{ textAlign: 'center' }}>快捷键</div>,
|
||||
dataIndex: 'COMMODITY_HOTKEY',
|
||||
width: 90,
|
||||
align: 'left',
|
||||
hideInSearch: true,
|
||||
render:(_,record)=>{
|
||||
return record?.COMMODITY_HOTKEY && record?.COMMODITY_HOTKEY!==""?
|
||||
<a style={{cursor:'pointer'}} onClick={()=>{
|
||||
render: (_, record) => {
|
||||
return record?.COMMODITY_HOTKEY && record?.COMMODITY_HOTKEY !== "" ?
|
||||
<a style={{ cursor: 'pointer' }} onClick={() => {
|
||||
setCurrentRow(record)
|
||||
setShowHotKeyEdit(true)
|
||||
setShowDetail(true)
|
||||
}}>{record?.COMMODITY_HOTKEY}</a>:
|
||||
<span onClick={()=>{
|
||||
}}>{record?.COMMODITY_HOTKEY}</a> :
|
||||
<span onClick={() => {
|
||||
setCurrentRow(record)
|
||||
setShowHotKeyEdit(true)
|
||||
setShowDetail(true)
|
||||
}} style={{color:'red',cursor:'pointer'}}>未设置</span>
|
||||
}} style={{ color: 'red', cursor: 'pointer' }}>未设置</span>
|
||||
}
|
||||
},
|
||||
{
|
||||
title:<div style={{textAlign:'center'}}>商品条码</div>,
|
||||
title: <div style={{ textAlign: 'center' }}>商品条码</div>,
|
||||
dataIndex: 'COMMODITY_BARCODE',
|
||||
hideInSearch: true,
|
||||
width: 120,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title:<div style={{textAlign:'center'}}>商品名称</div>,
|
||||
title: <div style={{ textAlign: 'center' }}>商品名称</div>,
|
||||
dataIndex: 'COMMODITY_NAME',
|
||||
width: 200,
|
||||
ellipsis:true,
|
||||
ellipsis: true,
|
||||
align: 'left',
|
||||
hideInSearch: true,
|
||||
render:(_,record)=>{
|
||||
return <a onClick={()=>{
|
||||
render: (_, record) => {
|
||||
return <a onClick={() => {
|
||||
setCurrentRow(record)
|
||||
setShowDetail(true)
|
||||
}}>
|
||||
@ -136,34 +141,34 @@ const hotkeyset: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
}
|
||||
},
|
||||
{
|
||||
title:<div style={{textAlign:'center'}}>商品单位</div>,
|
||||
title: <div style={{ textAlign: 'center' }}>商品单位</div>,
|
||||
dataIndex: 'COMMODITY_UNIT',
|
||||
width: 100,
|
||||
ellipsis:true,
|
||||
ellipsis: true,
|
||||
align: 'right',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title:<div style={{textAlign:'center'}}>商品规格</div>,
|
||||
title: <div style={{ textAlign: 'center' }}>商品规格</div>,
|
||||
dataIndex: 'COMMODITY_RULE',
|
||||
width: 100,
|
||||
ellipsis:true,
|
||||
ellipsis: true,
|
||||
align: 'right',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title:<div style={{textAlign:'center'}}>零售价格</div>,
|
||||
title: <div style={{ textAlign: 'center' }}>零售价格</div>,
|
||||
dataIndex: 'COMMODITY_RETAILPRICE',
|
||||
width: 100,
|
||||
ellipsis:true,
|
||||
ellipsis: true,
|
||||
align: 'right',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title:<div style={{textAlign:'center'}}>商品业态</div>,
|
||||
title: <div style={{ textAlign: 'center' }}>商品业态</div>,
|
||||
dataIndex: 'BUSINESSTYPE',
|
||||
width: 100,
|
||||
ellipsis:true,
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
valueType: 'select',
|
||||
@ -172,24 +177,24 @@ const hotkeyset: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
}
|
||||
},
|
||||
{
|
||||
title:<div style={{textAlign:'center'}}>商品状态</div>,
|
||||
title: <div style={{ textAlign: 'center' }}>商品状态</div>,
|
||||
dataIndex: 'COMMODITY_STATE',
|
||||
width: 100,
|
||||
ellipsis:true,
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
valueType: 'select',
|
||||
hideInSearch: true,
|
||||
valueEnum:{
|
||||
0:{text:'无效'},
|
||||
1:{text:'有效'}
|
||||
valueEnum: {
|
||||
0: { text: '无效' },
|
||||
1: { text: '有效' }
|
||||
},
|
||||
initialValue: '1'
|
||||
},
|
||||
{
|
||||
title:<div style={{textAlign:'center'}}>审核时间</div>,
|
||||
title: <div style={{ textAlign: 'center' }}>审核时间</div>,
|
||||
dataIndex: 'OPERATE_DATE',
|
||||
width: 140,
|
||||
ellipsis:true,
|
||||
ellipsis: true,
|
||||
align: 'left',
|
||||
hideInSearch: true,
|
||||
},
|
||||
@ -217,7 +222,7 @@ const hotkeyset: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
tempTable.remove() // 防止重复打印一个内容
|
||||
}
|
||||
// 查询的条件
|
||||
const [searchParams,setSearchParams] = useState<any>()
|
||||
const [searchParams, setSearchParams] = useState<any>()
|
||||
|
||||
const getMenuDom = (data: any[], callback: (item: any) => void) => {
|
||||
return (data.map((element: any) => {
|
||||
@ -225,52 +230,52 @@ const hotkeyset: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
if (element.children && element.children.length > 0) {
|
||||
return (
|
||||
<SubMenu title={<span>{element.label}</span>}
|
||||
icon={element.ico ? <Avatar src={element.ico} size={16} style={{ marginRight: 4 }} shape="square" /> : null}
|
||||
key={`${element.key || element.value}`}
|
||||
onTitleClick={(item) => {
|
||||
// 选中一级菜单
|
||||
if (!currenMenu || item.key !== `${currenMenu?.key}`) {
|
||||
callback.call(callback, item)
|
||||
}
|
||||
item.domEvent.stopPropagation();
|
||||
}}
|
||||
icon={element.ico ? <Avatar src={element.ico} size={16} style={{ marginRight: 4 }} shape="square" /> : null}
|
||||
key={`${element.key || element.value}`}
|
||||
onTitleClick={(item) => {
|
||||
// 选中一级菜单
|
||||
if (!currenMenu || item.key !== `${currenMenu?.key}`) {
|
||||
callback.call(callback, item)
|
||||
}
|
||||
item.domEvent.stopPropagation();
|
||||
}}
|
||||
>
|
||||
{element.children && element.children.length > 0 && getMenuDom(element.children, callback)}
|
||||
</SubMenu>
|
||||
)
|
||||
}
|
||||
return (<Menu.Item icon={element.ico ? <Avatar src={element.ico} size={16} shape="square" /> : null}
|
||||
key={`${element.key || element.value}`}>{element.desc && element.desc !== '0/0' ? <><span>{element.label}</span>
|
||||
<span style={{ position: 'absolute', right: '10', top: '9px', lineHeight: '20px', padding: '2px 3px' }}>
|
||||
[<span style={{ color: 'red' }}>{element.desc.split('/')[0]}</span>/<span style={{ color: '#1890ff' }}>{element.desc.split('/')[1]}</span>]</span></> : element.label}</Menu.Item>)
|
||||
key={`${element.key || element.value}`}>{element.desc && element.desc !== '0/0' ? <><span>{element.label}</span>
|
||||
<span style={{ position: 'absolute', right: '10', top: '9px', lineHeight: '20px', padding: '2px 3px' }}>
|
||||
[<span style={{ color: 'red' }}>{element.desc.split('/')[0]}</span>/<span style={{ color: '#1890ff' }}>{element.desc.split('/')[1]}</span>]</span></> : element.label}</Menu.Item>)
|
||||
}))
|
||||
}
|
||||
|
||||
const loadSelectedId = (item?: any) => {
|
||||
console.log('item',item)
|
||||
console.log('item', item)
|
||||
// 选中的子菜单key
|
||||
const [type, value] = item.key.split('-')
|
||||
if (type === '1') {
|
||||
setCurrenMenu(value)
|
||||
handleGetCommodity(value)
|
||||
// actionRef?.current?.reload()
|
||||
} else{
|
||||
} else {
|
||||
setCurrenMenu('')
|
||||
setCommodityList([])
|
||||
}
|
||||
}
|
||||
|
||||
// 拿到对应的商品业态
|
||||
const handleGetCommodity = async (id: any)=>{
|
||||
const handleGetCommodity = async (id: any) => {
|
||||
const req: any = {
|
||||
ProvinceCode: currentUser?.USER_PROVINCE,
|
||||
ProvinceCode: currentUser?.ProvinceCode,
|
||||
ServerpartId: id
|
||||
}
|
||||
const data = await handleGetServerpartShopTrade(req)
|
||||
console.log('data',data)
|
||||
console.log('data', data)
|
||||
const obj: any = {}
|
||||
if (data && data.length>0){
|
||||
data.forEach((item: any)=>{
|
||||
if (data && data.length > 0) {
|
||||
data.forEach((item: any) => {
|
||||
obj[item.value] = item.label
|
||||
})
|
||||
}
|
||||
@ -307,13 +312,13 @@ const hotkeyset: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
borderRadius: '8px',
|
||||
width: '200px'
|
||||
}}>
|
||||
<Spin/>
|
||||
<span style={{marginLeft: '5px'}}>数据导出中...</span>
|
||||
<Spin />
|
||||
<span style={{ marginLeft: '5px' }}>数据导出中...</span>
|
||||
</div>
|
||||
</div> : ''
|
||||
}
|
||||
|
||||
<div className={'saleReportHideBox'} style={{position: 'fixed', zIndex: -1, top: 0, left: 0}}>
|
||||
<div className={'saleReportHideBox'} style={{ position: 'fixed', zIndex: -1, top: 0, left: 0 }}>
|
||||
{
|
||||
showExportTable && reqDetailList && reqDetailList.length > 0 ?
|
||||
<ProTable
|
||||
@ -326,16 +331,16 @@ const hotkeyset: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
/> : ''
|
||||
}
|
||||
</div>
|
||||
<div id='hiddenBox' style={{position: 'fixed', zIndex: -1, top: 0, left: 0}}/>
|
||||
<div id='hiddenBox' style={{ position: 'fixed', zIndex: -1, top: 0, left: 0 }} />
|
||||
|
||||
<div style={{backgroundColor: '#fff',display:'flex'}}>
|
||||
<div style={{ backgroundColor: '#fff', display: 'flex' }}>
|
||||
<ProCard
|
||||
style={{width:!collapsible ? "300px" : "60px"}}
|
||||
style={{ width: !collapsible ? "300px" : "60px" }}
|
||||
className="pageTable-leftnav"
|
||||
bodyStyle={{padding: 0, paddingTop: 20, paddingLeft: 20,width:!collapsible ? "300px" : "60px"}}
|
||||
bodyStyle={{ padding: 0, paddingTop: 20, paddingLeft: 20, width: !collapsible ? "300px" : "60px" }}
|
||||
extra={<MenuFoldOutlined onClick={() => {
|
||||
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) => {
|
||||
</Menu>}
|
||||
</ProCard>
|
||||
<div style={{
|
||||
width:!collapsible?'calc(100% - 300px)':'calc(100% - 60px)',
|
||||
width: !collapsible ? 'calc(100% - 300px)' : 'calc(100% - 60px)',
|
||||
paddingTop: 0,
|
||||
paddingBottom: 0,
|
||||
paddingRight: 0
|
||||
@ -365,33 +370,34 @@ const hotkeyset: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
columns={columns}
|
||||
bordered
|
||||
headerTitle={<PageTitleBox props={props} />}
|
||||
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: [
|
||||
<span style={{visibility: 'hidden'}}>
|
||||
<span style={{ visibility: 'hidden' }}>
|
||||
<ReactHTMLTableToExcel
|
||||
buttonText={'导出excel'}
|
||||
ref={downloadBtnRef}
|
||||
@ -428,7 +434,7 @@ const hotkeyset: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
<Drawer
|
||||
width={1000}
|
||||
open={showDetail}
|
||||
onClose={()=>{
|
||||
onClose={() => {
|
||||
setCurrentRow(undefined)
|
||||
setShowDetail(false)
|
||||
setShowHotKeyEdit(false)
|
||||
@ -436,33 +442,33 @@ const hotkeyset: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
closable={false}
|
||||
destroyOnClose
|
||||
footer={
|
||||
<div style={{width:'100%',display:'flex',alignItems:'center',justifyContent:'flex-end'}}>
|
||||
<Button type={'primary'} onClick={async ()=>{
|
||||
<div style={{ width: '100%', display: 'flex', alignItems: 'center', justifyContent: 'flex-end' }}>
|
||||
<Button type={'primary'} onClick={async () => {
|
||||
const req: any = {
|
||||
...currentRow,
|
||||
COMMODITY_HOTKEY: getNewHotKey
|
||||
}
|
||||
console.log('req',req)
|
||||
console.log('req', req)
|
||||
const data = await handleSynchroCOMMODITY(req)
|
||||
if (data.Result_Code===100){
|
||||
if (data.Result_Code === 100) {
|
||||
message.success(data.Result_Desc)
|
||||
actionRef.current?.reload()
|
||||
setCurrentRow(undefined)
|
||||
setShowDetail(false)
|
||||
setShowHotKeyEdit(false)
|
||||
}else{
|
||||
} else {
|
||||
message.error(data.Result_Desc)
|
||||
}
|
||||
}}>确认</Button>
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<Detail showHotKeyEdit={showHotKeyEdit} currentRow={currentRow} currentUser={currentUser} treeView={detailTreeView} setGetNewHotKey={setGetNewHotKey}/>
|
||||
<Detail showHotKeyEdit={showHotKeyEdit} currentRow={currentRow} currentUser={currentUser} treeView={detailTreeView} setGetNewHotKey={setGetNewHotKey} />
|
||||
</Drawer>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default connect(({user}: ConnectState) => ({
|
||||
export default connect(({ user }: ConnectState) => ({
|
||||
currentUser: user.currentUser
|
||||
}))(hotkeyset);
|
||||
|
||||
@ -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<any>()
|
||||
const actionRef = useRef<ActionType>();
|
||||
@ -34,7 +36,7 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
const [reqDetailList, setReqDetailList] = useState<any>(); // 合计项数据源
|
||||
const [printOut, setPrintOut] = useState<any>(); // 打印数据的内容
|
||||
const [collapsible, setCollapsible] = useState<boolean>(false)
|
||||
const [treeView,setTreeView] = useState<any>()
|
||||
const [treeView, setTreeView] = useState<any>()
|
||||
// 加载服务区树
|
||||
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<any>()
|
||||
|
||||
// 加载弹出框里面的关联商品的树状选择
|
||||
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<string>()
|
||||
// 导出的加载效果
|
||||
const [showLoading,setShowLoading] = useState<boolean>(false)
|
||||
// 导出的加载效果
|
||||
const [showLoading, setShowLoading] = useState<boolean>(false)
|
||||
// 是否显示打印的表格
|
||||
const [showExportTable,setShowExportTable] = useState<boolean>(false)
|
||||
const [showExportTable, setShowExportTable] = useState<boolean>(false)
|
||||
const [currenMenu, setCurrenMenu] = useState<any>(); // 当前选中左侧菜单的服务区节点 type为1时
|
||||
const [modalCurrenMenu, setModalCurrenMenu] = useState<any>(); // 当前选中左侧菜单的服务区节点 type为1时
|
||||
const [selectBusiness,setSelectBusiness] = useState<any>()
|
||||
const [customClassList,setCustomClassList] = useState<any>()
|
||||
const [correlationModal,setCorrelationModal] = useState<boolean>(false)
|
||||
const [selectBusiness, setSelectBusiness] = useState<any>()
|
||||
const [customClassList, setCustomClassList] = useState<any>()
|
||||
const [correlationModal, setCorrelationModal] = useState<boolean>(false)
|
||||
const columns: any = [
|
||||
{
|
||||
title:'自定义类别',
|
||||
dataIndex:'USERDEFINEDTYPE_ID',
|
||||
title: '自定义类别',
|
||||
dataIndex: 'USERDEFINEDTYPE_ID',
|
||||
hideInSearch: true,
|
||||
width: 200,
|
||||
valueType: 'select',
|
||||
render:(_,record)=>{
|
||||
render: (_, record) => {
|
||||
return <Select
|
||||
style={{width:'180px'}}
|
||||
style={{ width: '180px' }}
|
||||
options={customClassList}
|
||||
value={record?.USERDEFINEDTYPE_ID || ''}
|
||||
onChange={async (e: any)=>{
|
||||
console.log('e',e)
|
||||
console.log('record',record)
|
||||
onChange={async (e: any) => {
|
||||
console.log('e', e)
|
||||
console.log('record', record)
|
||||
record.USERDEFINEDTYPE_ID = e
|
||||
if (e){
|
||||
if (e) {
|
||||
const req = {
|
||||
...record,
|
||||
USERDEFINEDTYPE_ID: e
|
||||
}
|
||||
const data = await handleSynchroCOMMODITY(req)
|
||||
if (data.Result_Code===100){
|
||||
if (data.Result_Code === 100) {
|
||||
message.success(data.Result_Desc)
|
||||
actionRef.current?.reload()
|
||||
}else{
|
||||
} else {
|
||||
message.error(data.Result_Desc)
|
||||
}
|
||||
}
|
||||
@ -101,146 +104,168 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
}
|
||||
},
|
||||
{
|
||||
title:'商品类型',
|
||||
dataIndex:'COMMODITY_TYPE',
|
||||
title: '商品类型',
|
||||
dataIndex: 'COMMODITY_TYPE',
|
||||
hideInSearch: true,
|
||||
valueType: 'treeSelect',
|
||||
request: async () => {
|
||||
const data = await handleGetShopTypeTree({ PROVINCE_CODE: currentUser?.ProvinceCode });
|
||||
console.log('data',data)
|
||||
console.log('data', data)
|
||||
return data
|
||||
},
|
||||
},
|
||||
{
|
||||
title:'商品条码',
|
||||
dataIndex:'COMMODITY_BARCODE',
|
||||
title: '商品条码',
|
||||
dataIndex: 'COMMODITY_BARCODE',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title:'商品名称',
|
||||
dataIndex:'COMMODITY_NAME',
|
||||
title: '商品名称',
|
||||
dataIndex: 'COMMODITY_NAME',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title:'零售价格',
|
||||
dataIndex:'COMMODITY_RETAILPRICE',
|
||||
title: '零售价格',
|
||||
dataIndex: 'COMMODITY_RETAILPRICE',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title:'商品单位',
|
||||
dataIndex:'COMMODITY_UNIT',
|
||||
title: '商品单位',
|
||||
dataIndex: 'COMMODITY_UNIT',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title:'商品规格',
|
||||
dataIndex:'COMMODITY_RULE',
|
||||
title: '商品规格',
|
||||
dataIndex: 'COMMODITY_RULE',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title:'商品业态',
|
||||
dataIndex:'BUSINESSTYPE',
|
||||
title: '商品业态',
|
||||
dataIndex: 'BUSINESSTYPE',
|
||||
valueType: 'select',
|
||||
request:async ()=>{
|
||||
const data = await getFieldEnumTree({ FieldExplainField: 'BUSINESSTYPE' })
|
||||
return data
|
||||
}
|
||||
valueEnum: commodityList,
|
||||
fieldProps: {
|
||||
showSearch: true,
|
||||
filterOption: (input: any, option: any) => (option?.label ?? '').toLowerCase().includes(input.toLowerCase()),
|
||||
},
|
||||
// request: async () => {
|
||||
// const data = await getFieldEnumTree({ FieldExplainField: 'BUSINESSTYPE' })
|
||||
// return data
|
||||
// }
|
||||
},
|
||||
{
|
||||
title:'商品状态',
|
||||
dataIndex:'COMMODITY_STATE',
|
||||
title: '商品状态',
|
||||
dataIndex: 'COMMODITY_STATE',
|
||||
valueEnum: { 0: { text: '无效', status: 'error' }, 1: { text: '有效', status: 'success' }, 2: { text: '不可选', status: 'default' } },
|
||||
},
|
||||
{
|
||||
title:'审核时间',
|
||||
dataIndex:'OPERATE_DATE',
|
||||
title: '审核时间',
|
||||
dataIndex: 'OPERATE_DATE',
|
||||
hideInSearch: true,
|
||||
},
|
||||
]
|
||||
const commodityTree = session.get('CommodityTypeIdsTree')
|
||||
|
||||
const toLabelValueMapSimple = (tree: any[]) => {
|
||||
const map: Record<string, any> = {};
|
||||
const dfs = (nodes: any[]) => {
|
||||
if (!nodes) {
|
||||
return
|
||||
}
|
||||
nodes.forEach(n => {
|
||||
map[n.value.toString()] = n.label;
|
||||
if (n.children?.length) dfs(n.children);
|
||||
});
|
||||
};
|
||||
dfs(tree);
|
||||
return map;
|
||||
}
|
||||
|
||||
console.log('fdskfsd', toLabelValueMapSimple(commodityTree));
|
||||
|
||||
|
||||
|
||||
const modalColumns: any = [
|
||||
{
|
||||
title:'商品类型',
|
||||
title: '商品类型',
|
||||
width: 120,
|
||||
dataIndex:'COMMODITY_TYPE',
|
||||
dataIndex: 'COMMODITY_TYPE',
|
||||
hideInSearch: true,
|
||||
valueType: 'treeSelect',
|
||||
request: async () => {
|
||||
const data = await handleGetShopTypeTree({ PROVINCE_CODE: currentUser?.ProvinceCode });
|
||||
return data
|
||||
},
|
||||
valueType: 'select',
|
||||
valueEnum: toLabelValueMapSimple(commodityTree)
|
||||
},
|
||||
{
|
||||
title:'商品条码',
|
||||
title: '商品条码',
|
||||
width: 150,
|
||||
dataIndex:'COMMODITY_BARCODE',
|
||||
dataIndex: 'COMMODITY_BARCODE',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title:'商品名称',
|
||||
title: '商品名称',
|
||||
width: 150,
|
||||
ellipsis: true,
|
||||
dataIndex:'COMMODITY_NAME',
|
||||
dataIndex: 'COMMODITY_NAME',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title:'零售价格',
|
||||
title: '零售价格',
|
||||
width: 100,
|
||||
dataIndex:'COMMODITY_RETAILPRICE',
|
||||
dataIndex: 'COMMODITY_RETAILPRICE',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title:'商品单位',
|
||||
title: '商品单位',
|
||||
width: 100,
|
||||
dataIndex:'COMMODITY_UNIT',
|
||||
dataIndex: 'COMMODITY_UNIT',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title:'商品规格',
|
||||
title: '商品规格',
|
||||
width: 120,
|
||||
ellipsis: true,
|
||||
dataIndex:'COMMODITY_RULE',
|
||||
dataIndex: 'COMMODITY_RULE',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title:'商品业态',
|
||||
title: '商品业态',
|
||||
width: 100,
|
||||
dataIndex:'BUSINESSTYPE',
|
||||
dataIndex: 'BUSINESSTYPE',
|
||||
valueType: 'select',
|
||||
hideInSearch: true,
|
||||
request:async ()=>{
|
||||
request: async () => {
|
||||
const data = await getFieldEnumTree({ FieldExplainField: 'BUSINESSTYPE' })
|
||||
return data
|
||||
}
|
||||
},
|
||||
{
|
||||
title:'商品状态',
|
||||
title: '商品状态',
|
||||
width: 100,
|
||||
dataIndex:'COMMODITY_STATE',
|
||||
dataIndex: 'COMMODITY_STATE',
|
||||
hideInSearch: true,
|
||||
valueEnum: { 0: { text: '无效', status: 'error' }, 1: { text: '有效', status: 'success' }, 2: { text: '不可选', status: 'default' } },
|
||||
},
|
||||
{
|
||||
title:'商品状态',
|
||||
dataIndex:'CommodityState',
|
||||
title: '商品状态',
|
||||
dataIndex: 'CommodityState',
|
||||
hideInTable: true,
|
||||
initialValue: '1',
|
||||
valueEnum: { 0: { text: '无效', status: 'error' }, 1: { text: '有效', status: 'success' }, 2: { text: '不可选', status: 'default' } },
|
||||
},
|
||||
{
|
||||
title:'审核时间',
|
||||
title: '审核时间',
|
||||
width: 180,
|
||||
dataIndex:'OPERATE_DATE',
|
||||
dataIndex: 'OPERATE_DATE',
|
||||
hideInSearch: true,
|
||||
},
|
||||
]
|
||||
|
||||
const [modalTreeSelect,setModalTreeSelect] = useState<any>()
|
||||
const [modalTreeSelect, setModalTreeSelect] = useState<any>()
|
||||
|
||||
// 请求自定义类的选择列表
|
||||
const handleGetCustomClassList = async (id: any)=>{
|
||||
const handleGetCustomClassList = async (id: any) => {
|
||||
const req: any = {
|
||||
SearchParameter:{
|
||||
USERDEFINEDTYPE_STATE:1,
|
||||
SearchParameter: {
|
||||
USERDEFINEDTYPE_STATE: 1,
|
||||
SERVERPART_ID: currenMenu || '',
|
||||
// BUSINESSTYPE: selectBusiness || ''
|
||||
},
|
||||
@ -249,14 +274,14 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
pageSize: 999999,
|
||||
}
|
||||
const data = await handleGetUSERDEFINEDTYPEList(req)
|
||||
if (data && data.length>0){
|
||||
if (data && data.length > 0) {
|
||||
const list: any = []
|
||||
data.forEach((item: any)=>{
|
||||
list.push({label: item.USERDEFINEDTYPE_NAME,value:item.USERDEFINEDTYPE_ID})
|
||||
data.forEach((item: any) => {
|
||||
list.push({ label: item.USERDEFINEDTYPE_NAME, value: item.USERDEFINEDTYPE_ID })
|
||||
})
|
||||
setCustomClassList(list)
|
||||
}
|
||||
console.log('data',data)
|
||||
console.log('data', data)
|
||||
}
|
||||
const exportTable = (e) => {
|
||||
e.stopPropagation(); // 防止Collapse组件收起
|
||||
@ -280,82 +305,104 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
tempTable.remove() // 防止重复打印一个内容
|
||||
}
|
||||
// 查询的条件
|
||||
const [searchParams,setSearchParams] = useState<any>()
|
||||
const [searchParams, setSearchParams] = useState<any>()
|
||||
// 选中的行数据
|
||||
const [selectModalRowList,setSelectModalRowList] = useState<any>()
|
||||
const [selectModalRowList, setSelectModalRowList] = useState<any>()
|
||||
// 选中的行
|
||||
const [selectedModalOrderRowKeys,setSelectedModalOrderRowKeys] = useState<any>()
|
||||
const [selectedModalOrderRowKeys, setSelectedModalOrderRowKeys] = useState<any>()
|
||||
// 选中的行数据
|
||||
const [selectRowList,setSelectRowList] = useState<any>()
|
||||
const [selectRowList, setSelectRowList] = useState<any>()
|
||||
// 选中的行
|
||||
const [selectedOrderRowKeys,setSelectedOrderRowKeys] = useState<any>()
|
||||
const [selectedOrderRowKeys, setSelectedOrderRowKeys] = useState<any>()
|
||||
const getMenuDom = (data: any[], callback: (item: any) => void) => {
|
||||
return (data.map((element: any) => {
|
||||
// 绑定嵌套树的子节点
|
||||
if (element.children && element.children.length > 0) {
|
||||
return (
|
||||
<SubMenu title={<span>{element.label}</span>}
|
||||
icon={element.ico ? <Avatar src={element.ico} size={16} style={{ marginRight: 4 }} shape="square" /> : null}
|
||||
key={`${element.key || element.value}`}
|
||||
onTitleClick={(item) => {
|
||||
// 选中一级菜单
|
||||
if (!currenMenu || item.key !== `${currenMenu?.key}`) {
|
||||
callback.call(callback, item)
|
||||
}
|
||||
item.domEvent.stopPropagation();
|
||||
}}
|
||||
icon={element.ico ? <Avatar src={element.ico} size={16} style={{ marginRight: 4 }} shape="square" /> : null}
|
||||
key={`${element.key || element.value}`}
|
||||
onTitleClick={(item) => {
|
||||
// 选中一级菜单
|
||||
if (!currenMenu || item.key !== `${currenMenu?.key}`) {
|
||||
callback.call(callback, item)
|
||||
}
|
||||
item.domEvent.stopPropagation();
|
||||
}}
|
||||
>
|
||||
{element.children && element.children.length > 0 && getMenuDom(element.children, callback)}
|
||||
</SubMenu>
|
||||
)
|
||||
}
|
||||
return (<Menu.Item icon={element.ico ? <Avatar src={element.ico} size={16} shape="square" /> : null}
|
||||
key={`${element.key || element.value}`}>{element.desc && element.desc !== '0/0' ? <><span>{element.label}</span>
|
||||
<span style={{ position: 'absolute', right: '10', top: '9px', lineHeight: '20px', padding: '2px 3px' }}>
|
||||
[<span style={{ color: 'red' }}>{element.desc.split('/')[0]}</span>/<span style={{ color: '#1890ff' }}>{element.desc.split('/')[1]}</span>]</span></> : element.label}</Menu.Item>)
|
||||
key={`${element.key || element.value}`}>{element.desc && element.desc !== '0/0' ? <><span>{element.label}</span>
|
||||
<span style={{ position: 'absolute', right: '10', top: '9px', lineHeight: '20px', padding: '2px 3px' }}>
|
||||
[<span style={{ color: 'red' }}>{element.desc.split('/')[0]}</span>/<span style={{ color: '#1890ff' }}>{element.desc.split('/')[1]}</span>]</span></> : element.label}</Menu.Item>)
|
||||
}))
|
||||
}
|
||||
|
||||
const loadSelectedId = (item?: any) => {
|
||||
console.log('itemitemitem', item);
|
||||
|
||||
// 选中的子菜单key
|
||||
const [type, value] = item.key.split('-')
|
||||
if (type === '1') {
|
||||
setCurrenMenu(value)
|
||||
setSelectBusiness(undefined)
|
||||
// actionRef?.current?.reload()
|
||||
}else if(type==='2'){
|
||||
} else if (type === '2') {
|
||||
// setCurrenMenu(undefined)
|
||||
setSelectBusiness(value)
|
||||
} else{
|
||||
// type 为2 那就说明是选择门店了
|
||||
let serverpartId: string = item.keyPath[1].split('-')[1]
|
||||
handleGetCommodity(serverpartId)
|
||||
} else {
|
||||
setCurrenMenu(undefined)
|
||||
setSelectBusiness(undefined)
|
||||
}
|
||||
}
|
||||
|
||||
const modalLoadSelectedId = (item?: any) => {
|
||||
console.log('item',item)
|
||||
console.log('item', item)
|
||||
// 选中的子菜单key
|
||||
const [type, value] = item.key.split('-')
|
||||
if (type === '1') {
|
||||
if (value === modalTreeSelect){
|
||||
if (value === modalTreeSelect) {
|
||||
setModalTreeSelect(undefined)
|
||||
}else{
|
||||
} else {
|
||||
setModalTreeSelect(value)
|
||||
}
|
||||
} else{
|
||||
} else {
|
||||
setModalTreeSelect('')
|
||||
}
|
||||
actionModalRef?.current?.reload()
|
||||
// actionModalRef?.current?.reload()
|
||||
}
|
||||
|
||||
const modalRowSelection: any ={
|
||||
// 拿到对应的商品业态
|
||||
const handleGetCommodity = async (id: any) => {
|
||||
const req: any = {
|
||||
ProvinceCode: currentUser?.ProvinceCode,
|
||||
ServerpartId: id
|
||||
}
|
||||
const data = await handleGetServerpartShopTrade(req)
|
||||
console.log('data', data)
|
||||
const obj: any = {}
|
||||
if (data && data.length > 0) {
|
||||
data.forEach((item: any) => {
|
||||
obj[item.value] = item.label
|
||||
})
|
||||
}
|
||||
setCommodityList(obj)
|
||||
}
|
||||
|
||||
const modalRowSelection: any = {
|
||||
selectedRowKeys: selectedModalOrderRowKeys,
|
||||
onChange: (selectedRowKeys: any, selectedRows: any) => {
|
||||
setSelectModalRowList(selectedRows)
|
||||
setSelectedModalOrderRowKeys(selectedRowKeys)
|
||||
},
|
||||
};
|
||||
const rowSelection: any ={
|
||||
const rowSelection: any = {
|
||||
selectedRowKeys: selectedOrderRowKeys,
|
||||
onChange: (selectedRowKeys: any, selectedRows: any) => {
|
||||
setSelectRowList(selectedRows)
|
||||
@ -393,13 +440,13 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
borderRadius: '8px',
|
||||
width: '200px'
|
||||
}}>
|
||||
<Spin/>
|
||||
<span style={{marginLeft: '5px'}}>数据导出中...</span>
|
||||
<Spin />
|
||||
<span style={{ marginLeft: '5px' }}>数据导出中...</span>
|
||||
</div>
|
||||
</div> : ''
|
||||
}
|
||||
|
||||
<div className={'saleReportHideBox'} style={{position: 'fixed', zIndex: -1, top: 0, left: 0}}>
|
||||
<div className={'saleReportHideBox'} style={{ position: 'fixed', zIndex: -1, top: 0, left: 0 }}>
|
||||
{
|
||||
showExportTable && reqDetailList && reqDetailList.length > 0 ?
|
||||
<ProTable
|
||||
@ -412,16 +459,16 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
/> : ''
|
||||
}
|
||||
</div>
|
||||
<div id='hiddenBox' style={{position: 'fixed', zIndex: -1, top: 0, left: 0}}/>
|
||||
<div id='hiddenBox' style={{ position: 'fixed', zIndex: -1, top: 0, left: 0 }} />
|
||||
|
||||
<div style={{backgroundColor: '#fff',display:'flex'}}>
|
||||
<div style={{ backgroundColor: '#fff', display: 'flex' }}>
|
||||
<ProCard
|
||||
style={{width:!collapsible ? "300px" : "60px"}}
|
||||
style={{ width: !collapsible ? "300px" : "60px" }}
|
||||
className="pageTable-leftnav"
|
||||
bodyStyle={{padding: 0, paddingTop: 20, paddingLeft: 20,width:!collapsible ? "300px" : "60px"}}
|
||||
bodyStyle={{ padding: 0, paddingTop: 20, paddingLeft: 20, width: !collapsible ? "300px" : "60px" }}
|
||||
extra={<MenuFoldOutlined onClick={() => {
|
||||
setCollapsible(!collapsible)
|
||||
}}/>}
|
||||
}} />}
|
||||
colSpan={!collapsible ? "300px" : "60px"}
|
||||
title={!collapsible ? "请选择服务区" : ""}
|
||||
headerBordered
|
||||
@ -430,7 +477,7 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
{!treeLoading && <Menu
|
||||
mode="inline"
|
||||
style={{ height: 'calc(100vh - 220px)', overflowY: 'auto', overflowX: 'hidden' }}
|
||||
selectedKeys={[selectBusiness?`2-${selectBusiness}`:currenMenu?`1-${currenMenu}`:'']}
|
||||
selectedKeys={[selectBusiness ? `2-${selectBusiness}` : currenMenu ? `1-${currenMenu}` : '']}
|
||||
onSelect={(item) => {
|
||||
loadSelectedId(item)
|
||||
}}
|
||||
@ -439,7 +486,7 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
</Menu>}
|
||||
</ProCard>
|
||||
<div className={'bigPageTable'} style={{
|
||||
width:!collapsible?'calc(100% - 300px)':'calc(100% - 60px)',
|
||||
width: !collapsible ? 'calc(100% - 300px)' : 'calc(100% - 60px)',
|
||||
paddingTop: 0,
|
||||
paddingBottom: 0,
|
||||
paddingRight: 0
|
||||
@ -458,9 +505,9 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
...rowSelection,
|
||||
}}
|
||||
headerTitle={<PageTitleBox props={props} />}
|
||||
search={{span: 6}}
|
||||
request={async(params)=>{
|
||||
if (!currenMenu && !selectBusiness){
|
||||
search={{ span: 6 }}
|
||||
request={async (params) => {
|
||||
if (!currenMenu && !selectBusiness) {
|
||||
return
|
||||
}
|
||||
setCustomClassList([])
|
||||
@ -470,61 +517,61 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
...params,
|
||||
SearchType: 4,
|
||||
ShowJustUDType: true,
|
||||
ServerpartID: selectBusiness?'':currenMenu,
|
||||
ServerpartID: selectBusiness ? '' : currenMenu,
|
||||
UserDefinedTypeId: selectBusiness || '',
|
||||
PageSize: 999999,
|
||||
pageSize: 999999,
|
||||
}
|
||||
setSearchParams(params)
|
||||
const data = await handleGetCommodityList(req)
|
||||
console.log('data',data)
|
||||
if (data && data.length>0){
|
||||
return {data, success: true}
|
||||
console.log('data', data)
|
||||
if (data && data.length > 0) {
|
||||
return { data, success: true }
|
||||
}
|
||||
return {data:[],success:true}
|
||||
return { data: [], success: true }
|
||||
}}
|
||||
toolbar={{
|
||||
actions: [
|
||||
selectBusiness?
|
||||
<div>
|
||||
<Button
|
||||
key="new"
|
||||
type="primary"
|
||||
onClick={(e) => {
|
||||
setCorrelationModal(true)
|
||||
}}
|
||||
>
|
||||
关联商品
|
||||
</Button>
|
||||
<Popconfirm // 删除按钮功能
|
||||
title="确认删除?"
|
||||
onConfirm={async () => {
|
||||
console.log('selectRowList',selectRowList)
|
||||
console.log('selectedOrderRowKeys',selectedOrderRowKeys)
|
||||
if (selectedOrderRowKeys && selectedOrderRowKeys.length>0){
|
||||
const list: any = []
|
||||
selectedOrderRowKeys.forEach((item: any)=>{
|
||||
list.push({label:'',value:item})
|
||||
})
|
||||
const data = await handleDeleteRTUDType(list)
|
||||
if (data.Result_Code === 100) {
|
||||
message.success(data.Result_Desc)
|
||||
setSelectRowList([])
|
||||
setSelectedOrderRowKeys([])
|
||||
actionRef?.current?.reload()
|
||||
} else {
|
||||
message.error(data.Result_Desc)
|
||||
}
|
||||
}else{
|
||||
message.error('请选择')
|
||||
selectBusiness ?
|
||||
<div>
|
||||
<Button
|
||||
key="new"
|
||||
type="primary"
|
||||
onClick={(e) => {
|
||||
setCorrelationModal(true)
|
||||
}}
|
||||
>
|
||||
关联商品
|
||||
</Button>
|
||||
<Popconfirm // 删除按钮功能
|
||||
title="确认删除?"
|
||||
onConfirm={async () => {
|
||||
console.log('selectRowList', selectRowList)
|
||||
console.log('selectedOrderRowKeys', selectedOrderRowKeys)
|
||||
if (selectRowList && selectRowList.length > 0) {
|
||||
const list: any = []
|
||||
selectRowList.forEach((item: any) => {
|
||||
list.push({ label: item.USERDEFINEDTYPE_ID, value: item.COMMODITY_ID })
|
||||
})
|
||||
const data = await handleDeleteRTUDType(list)
|
||||
if (data.Result_Code === 100) {
|
||||
message.success(data.Result_Desc)
|
||||
setSelectRowList([])
|
||||
setSelectedOrderRowKeys([])
|
||||
actionRef?.current?.reload()
|
||||
} else {
|
||||
message.error(data.Result_Desc)
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Button style={{marginLeft:'8px'}}>删除关联</Button>
|
||||
</Popconfirm>
|
||||
} else {
|
||||
message.error('请选择')
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Button style={{ marginLeft: '8px' }}>删除关联</Button>
|
||||
</Popconfirm>
|
||||
|
||||
</div>
|
||||
:''
|
||||
</div>
|
||||
: ''
|
||||
]
|
||||
}}
|
||||
/>
|
||||
@ -537,18 +584,18 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
wrapClassName={'shopModal'}
|
||||
destroyOnClose
|
||||
title={'关联商品'}
|
||||
onCancel={()=>{
|
||||
onCancel={() => {
|
||||
setCorrelationModal(false)
|
||||
setModalTreeSelect(undefined)
|
||||
}}
|
||||
onOk={async ()=>{
|
||||
onOk={async () => {
|
||||
// console.log('selectModalRowList',selectModalRowList)
|
||||
console.log('selectedModalOrderRowKeys',selectedModalOrderRowKeys)
|
||||
console.log('selectBusiness',selectBusiness)
|
||||
if (selectedModalOrderRowKeys && selectedModalOrderRowKeys.length>0){
|
||||
console.log('selectedModalOrderRowKeys', selectedModalOrderRowKeys)
|
||||
console.log('selectBusiness', selectBusiness)
|
||||
if (selectedModalOrderRowKeys && selectedModalOrderRowKeys.length > 0) {
|
||||
const req: any = []
|
||||
selectedModalOrderRowKeys.forEach((item: any)=>{
|
||||
req.push({label: selectBusiness,value:item})
|
||||
selectedModalOrderRowKeys.forEach((item: any) => {
|
||||
req.push({ label: selectBusiness, value: item })
|
||||
})
|
||||
const data = await handleRelateUDType(req)
|
||||
if (data.Result_Code === 100) {
|
||||
@ -561,19 +608,19 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
} else {
|
||||
message.error(data.Result_Desc)
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
message.error('请选择要关联的商品')
|
||||
}
|
||||
|
||||
|
||||
}}
|
||||
>
|
||||
<div style={{width:'100%',height: '650px',backgroundColor: '#fff',display:'flex'}}>
|
||||
<div style={{ width: '100%', height: '650px', backgroundColor: '#fff', display: 'flex' }}>
|
||||
<ProCard
|
||||
style={{width:"300px"}}
|
||||
style={{ width: "300px" }}
|
||||
className="pageTable-leftnav"
|
||||
bodyStyle={{padding: 0, paddingTop: 20, paddingLeft: 20,width: "280px"}}
|
||||
extra={<MenuFoldOutlined onClick={() => {}}/>}
|
||||
bodyStyle={{ padding: 0, paddingTop: 20, paddingLeft: 20, width: "280px" }}
|
||||
extra={<MenuFoldOutlined onClick={() => { }} />}
|
||||
headerBordered
|
||||
>
|
||||
{!modalTreeLoading && <Menu
|
||||
@ -588,7 +635,7 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
</Menu>}
|
||||
</ProCard>
|
||||
<div style={{
|
||||
width:!collapsible?'calc(100% - 300px)':'calc(100% - 60px)',
|
||||
width: !collapsible ? 'calc(100% - 300px)' : 'calc(100% - 60px)',
|
||||
paddingTop: 0,
|
||||
paddingBottom: 0,
|
||||
paddingRight: 0
|
||||
@ -606,10 +653,10 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
type: 'checkbox',
|
||||
...modalRowSelection,
|
||||
}}
|
||||
scroll={{x:1000,y: 400}}
|
||||
scroll={{ x: 1000, y: 400 }}
|
||||
headerTitle={'未关联商品列表'}
|
||||
search={{span: 6}}
|
||||
request={async(params)=>{
|
||||
search={{ span: 6 }}
|
||||
request={async (params) => {
|
||||
const req: any = {
|
||||
...params,
|
||||
SearchType: 4,
|
||||
@ -622,11 +669,11 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
}
|
||||
setSearchParams(params)
|
||||
const data = await handleGetCommodityList(req)
|
||||
console.log('data',data)
|
||||
if (data && data.length>0){
|
||||
return {data, success: true}
|
||||
console.log('data', data)
|
||||
if (data && data.length > 0) {
|
||||
return { data, success: true }
|
||||
}
|
||||
return {data:[],success:true}
|
||||
return { data: [], success: true }
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
@ -636,6 +683,6 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
)
|
||||
}
|
||||
|
||||
export default connect(({user}: ConnectState) => ({
|
||||
export default connect(({ user }: ConnectState) => ({
|
||||
currentUser: user.currentUser
|
||||
}))(setUserDefinedType);
|
||||
|
||||
@ -400,6 +400,197 @@ export const handleNewPrint = (printName: string, title: string, neckBox?: any,
|
||||
}
|
||||
}
|
||||
|
||||
// 自定义打印的内容的打印方法
|
||||
export const handleNewPrintAHJG = (printName: string, title: string, neckBox?: any, styles?: any, tableDom?: any, footer?: any) => {
|
||||
// printName 打印出来文件的名称
|
||||
// title 打印内容的标题
|
||||
// neckBox 标题下面可能会要求的打印的内容 数组 {label,value}格式 样式已写死
|
||||
// styles 获取页面的样式
|
||||
// tableDom 要打印显示的表格 直接dom元素拿进来(处理好的)
|
||||
// footer 打印内容底部的自定义样式 需求不一样 样式也不一样 外面写好样式和标签直接传入
|
||||
const printWindow = window.open('', '_blank', 'width=1400,height=800');
|
||||
if (printWindow) {
|
||||
printWindow.document.open();
|
||||
printWindow.document.write(`
|
||||
<html>
|
||||
<head>
|
||||
<title>${printName || ''}</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
margin: 20px;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
${styles}
|
||||
.handlePrintBox{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
z-index: 0;
|
||||
box-sizing: border-box;
|
||||
padding: 20px 0 0 0;
|
||||
}
|
||||
.handlePrintBox .custom-header {
|
||||
font-size: 24px;
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
font-weight: 600;
|
||||
}
|
||||
.handlePrintBox .neckBox{
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 12px 5% 12px 5%;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.handlePrintBox .neckBox .neckBoxItem{
|
||||
width: calc(100% / 4);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.handlePrintBox .neckBox .bigNeckBoxItem{
|
||||
width: calc((100% / 4) * 2);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.handlePrintBox .neckBox .bigNeckBoxItem .itemLabel{
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
margin-right: 2px;
|
||||
}
|
||||
.handlePrintBox .neckBox .bigNeckBoxItem .itemValue{
|
||||
font-size: 12px;
|
||||
}
|
||||
.handlePrintBox .neckBox .neckBoxItem .itemLabel{
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
margin-right: 2px;
|
||||
}
|
||||
.handlePrintBox .neckBox .neckBoxItem .itemValue{
|
||||
font-size: 12px;
|
||||
}
|
||||
.handlePrintBox .tableBox{
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 12px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
border-collapse: separate;
|
||||
border-spacing: 0;
|
||||
}
|
||||
.handlePrintBox .tableBox .ant-table-thead tr th{
|
||||
border: 2px solid #000;
|
||||
}
|
||||
.handlePrintBox .tableBox .ant-table-tbody tr td{
|
||||
border: 2px solid #000;
|
||||
}
|
||||
.handlePrintBox .tableBox .ant-table-summary tr td{
|
||||
border: 2px solid #000;
|
||||
}
|
||||
.handlePrintBox .tableUnit{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
box-sizing: border-box;
|
||||
font-size: 14px;
|
||||
}
|
||||
.handlePrintBox .tableUnit .tableRight{
|
||||
width: calc(100% / 3);
|
||||
font-size: 14px;
|
||||
box-sizing: border-box;
|
||||
padding-left: 5%;
|
||||
}
|
||||
.pro-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
.pro-table th, .pro-table td {
|
||||
border: 1px solid #ddd;
|
||||
padding: 8px;
|
||||
}
|
||||
.pro-table th {
|
||||
background-color: #f2f2f2;
|
||||
text-align: left;
|
||||
}
|
||||
/* 水印样式 */
|
||||
.watermark {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: grid;
|
||||
grid-template-rows: repeat(4, 1fr); /* 水平行数 */
|
||||
grid-template-columns: repeat(4, 1fr); /* 垂直列数 */
|
||||
opacity: 0.2;
|
||||
pointer-events: none;
|
||||
z-index: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
.watermark span {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
transform: rotate(-45deg); /* 水印旋转 */
|
||||
font-size: 14px;
|
||||
color: rgba(0, 0, 0); /* 半透明水印 */
|
||||
user-select: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="handlePrintBox">
|
||||
<div class="custom-header">${title}</div>
|
||||
<div class="neckBox">
|
||||
${neckBox && neckBox.length > 0
|
||||
? neckBox
|
||||
.map((item: any) => {
|
||||
return `<div class="${item.label === '门店名称' ? 'bigNeckBoxItem' : 'neckBoxItem'}">
|
||||
<span class="itemLabel">${item.label ? item.label + ':' : ''}</span>
|
||||
<span class="itemValue">${item.value}</span>
|
||||
</div>`;
|
||||
})
|
||||
.join('') // 连接成单一字符串,避免逗号
|
||||
: ''}
|
||||
</div>
|
||||
<div class="tableBox">
|
||||
${tableDom}
|
||||
</div>
|
||||
<div>
|
||||
${footer}
|
||||
</div>
|
||||
</div>
|
||||
<div class="watermark">
|
||||
${Array(16) // 5x5 网格的水印内容
|
||||
.fill('<span>安徽建工集团投资运营管理有限公司</span>')
|
||||
.join('')}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
`)
|
||||
printWindow.document.close();
|
||||
printWindow.print();
|
||||
|
||||
// 使用定时器检测打印窗口是否关闭
|
||||
const closeCheckInterval = setInterval(() => {
|
||||
if (printWindow.closed) {
|
||||
clearInterval(closeCheckInterval);
|
||||
}
|
||||
}, 500);
|
||||
|
||||
// 监听窗口焦点事件,若打印窗口失去焦点,关闭窗口
|
||||
printWindow.onfocus = () => {
|
||||
printWindow.close();
|
||||
clearInterval(closeCheckInterval);
|
||||
};
|
||||
printWindow.onafterprint = () => printWindow.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 打印图片
|
||||
export const handlePrintImg = (url: any) => {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// 由 scripts/writeVersion.js 自动生成
|
||||
export const VERSION = "4.5.38";
|
||||
export const GIT_HASH = "9fb0245";
|
||||
export const BUILD_TIME = "2025-08-28T02:13:12.174Z";
|
||||
export const VERSION = "4.5.40";
|
||||
export const GIT_HASH = "debd5be";
|
||||
export const BUILD_TIME = "2025-08-29T07:11:29.945Z";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user