update
This commit is contained in:
parent
debd5be7f6
commit
a05dd915f3
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ant-design-pro",
|
"name": "ant-design-pro",
|
||||||
"version": "4.5.38",
|
"version": "4.5.40",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "An out-of-box UI solution for enterprise applications",
|
"description": "An out-of-box UI solution for enterprise applications",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@ -1,51 +1,51 @@
|
|||||||
// 结账数据管理
|
// 结账数据管理
|
||||||
import React, {useEffect, useRef, useState} from "react";
|
import React, { useEffect, useRef, useState } from "react";
|
||||||
import type {CurrentUser} from "@/models/user";
|
import type { CurrentUser } from "@/models/user";
|
||||||
import {connect} from "umi";
|
import { connect } from "umi";
|
||||||
import type {ConnectState} from "@/models/connect";
|
import type { ConnectState } from "@/models/connect";
|
||||||
import {PageContainer} from "@ant-design/pro-layout";
|
import { PageContainer } from "@ant-design/pro-layout";
|
||||||
import ProTable from "@ant-design/pro-table";
|
import ProTable from "@ant-design/pro-table";
|
||||||
import {getEndaccountPhoto, getServerpartOption, handleGetShopTypeTree} from "@/pages/DataVerification/list/service";
|
import { getEndaccountPhoto, getServerpartOption, handleGetShopTypeTree } from "@/pages/DataVerification/list/service";
|
||||||
import {handleGetAccountList, handleGetServiceShopList, submitEndaccountState} from "@/pages/DataVerification/service";
|
import { handleGetAccountList, handleGetServerpartShopList, handleGetServiceShopList, submitEndaccountState } from "@/pages/DataVerification/service";
|
||||||
import './list.less'
|
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 useRequest from "@ahooksjs/use-request";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import CheckDetail from "./components/checkDetail";
|
import CheckDetail from "./components/checkDetail";
|
||||||
import {handleCallLogs} from "@/services/options";
|
import { handleCallLogs } from "@/services/options";
|
||||||
|
|
||||||
|
|
||||||
const List: React.FC<{ currentUser?: CurrentUser }> = ({ currentUser }) => {
|
const List: React.FC<{ currentUser?: CurrentUser }> = ({ currentUser }) => {
|
||||||
// 详情的ref
|
// 详情的ref
|
||||||
const checkDetail = useRef()
|
const checkDetail = useRef()
|
||||||
// 表格数组
|
// 表格数组
|
||||||
const [tableData,setTableData] = useState<any>()
|
const [tableData, setTableData] = useState<any>()
|
||||||
// 选择的服务区
|
// 选择的服务区
|
||||||
const [selectServicePartId,setSelectServicePartId] = useState<any>()
|
const [selectServicePartId, setSelectServicePartId] = useState<any>()
|
||||||
// 门店列表
|
// 门店列表
|
||||||
const [shopList,setShopList] = useState<any>()
|
const [shopList, setShopList] = useState<any>()
|
||||||
// 选择的门店列表
|
// 选择的门店列表
|
||||||
const [selectShopId,setSelectShopId] = useState<any>('')
|
const [selectShopId, setSelectShopId] = useState<any>('')
|
||||||
// 处理状态
|
// 处理状态
|
||||||
const [selectState,setSelectState] = useState<any>(3)
|
const [selectState, setSelectState] = useState<any>(3)
|
||||||
// 异常类型
|
// 异常类型
|
||||||
const [errorType,setErrorType] = useState<any>('')
|
const [errorType, setErrorType] = useState<any>('')
|
||||||
// 经营模式
|
// 经营模式
|
||||||
const [managerModal,setManagerModal] = useState<any>('')
|
const [managerModal, setManagerModal] = useState<any>('')
|
||||||
// 查询时间
|
// 查询时间
|
||||||
const [selectTime,setSelectTime] = useState<any>([moment().subtract(1, 'day'),moment().subtract(1, 'day')])
|
const [selectTime, setSelectTime] = useState<any>([moment().subtract(1, 'day'), moment().subtract(1, 'day')])
|
||||||
// 表格的加载效果
|
// 表格的加载效果
|
||||||
const [tableLoading,setTableLoading] = useState<boolean>(false)
|
const [tableLoading, setTableLoading] = useState<boolean>(false)
|
||||||
// 显示抽屉
|
// 显示抽屉
|
||||||
const [showDrawer,setShowDrawer] = useState<boolean>(false)
|
const [showDrawer, setShowDrawer] = useState<boolean>(false)
|
||||||
// 点击 或者双击的当前行数据
|
// 点击 或者双击的当前行数据
|
||||||
const [currentRow,setCurrentRow] = useState<any>()
|
const [currentRow, setCurrentRow] = useState<any>()
|
||||||
// 根据子组件是否出现加载框来判断按钮是否禁用
|
// 根据子组件是否出现加载框来判断按钮是否禁用
|
||||||
const [showDisable,setShowDisable] = useState<boolean>(false)
|
const [showDisable, setShowDisable] = useState<boolean>(false)
|
||||||
|
|
||||||
const { RangePicker } = DatePicker;
|
const { RangePicker } = DatePicker;
|
||||||
// 格式化金钱的方法
|
// 格式化金钱的方法
|
||||||
const fmoney = (s: number, n?: number) => {
|
const fmoney = (s: number, n?: number) => {
|
||||||
/*
|
/*
|
||||||
* 参数说明:
|
* 参数说明:
|
||||||
* s:要格式化的数字
|
* s:要格式化的数字
|
||||||
@ -71,360 +71,379 @@ const List: React.FC<{ currentUser?: CurrentUser }> = ({ currentUser }) => {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const columns: any = [
|
const columns: any = [
|
||||||
{
|
{
|
||||||
dataIndex: 'key',
|
dataIndex: 'key',
|
||||||
title: '序号',
|
title: '序号',
|
||||||
width: 50,
|
width: 50,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
dataIndex: 'Treatment_MarkState',
|
dataIndex: 'Treatment_MarkState',
|
||||||
title: '处理状态',
|
title: '处理状态',
|
||||||
width: 90,
|
width: 90,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
render:(_,record)=>{
|
render: (_, record) => {
|
||||||
return <span
|
return <span
|
||||||
style={{
|
style={{
|
||||||
color:record.Treatment_MarkState===0 || record.Treatment_MarkState===3?'#ff6600':'#000000'
|
color: record.Treatment_MarkState === 0 || record.Treatment_MarkState === 3 ? '#ff6600' : '#000000'
|
||||||
}}
|
}}
|
||||||
>{record.Treatment_MarkState===0?'待处理':
|
>{record.Treatment_MarkState === 0 ? '待处理' :
|
||||||
record.Treatment_MarkState===1?'待审核':
|
record.Treatment_MarkState === 1 ? '待审核' :
|
||||||
record.Treatment_MarkState===2?'已审结':
|
record.Treatment_MarkState === 2 ? '已审结' :
|
||||||
record.Treatment_MarkState===3?'主任复核':
|
record.Treatment_MarkState === 3 ? '主任复核' :
|
||||||
record.Treatment_MarkState===4?'主任审结':''}</span>
|
record.Treatment_MarkState === 4 ? '主任审结' : ''}</span>
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
dataIndex: 'Serverpart_Name',
|
dataIndex: 'Serverpart_Name',
|
||||||
title: '服务区名称',
|
title: '服务区名称',
|
||||||
ellipsis:true
|
ellipsis: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
dataIndex: 'ServerpartShop_Name',
|
dataIndex: 'ServerpartShop_Name',
|
||||||
title: '门店名称',
|
title: '门店名称',
|
||||||
valueType:'select',
|
valueType: 'select',
|
||||||
ellipsis:true,
|
ellipsis: true,
|
||||||
width:250,
|
width: 250,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
dataIndex: 'Description_Info',
|
dataIndex: 'Description_Info',
|
||||||
title: '日结校验',
|
title: '日结校验',
|
||||||
width:600,
|
width: 600,
|
||||||
ellipsis:true,
|
ellipsis: true,
|
||||||
hideInSearch:true,
|
hideInSearch: true,
|
||||||
render:(_,record)=>{
|
render: (_, record) => {
|
||||||
return <div style={{width:'600px',whiteSpace:'nowrap',textOverflow:'ellipsis',overflow:'hidden'}}>{
|
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}`
|
`${record?.Description_Staff ? `${record?.Description_Staff.split('【')[0]}:` : ''} ${record?.Description_Info} ${record?.Approved_Staff ? `|${record?.Approved_Staff}:` : ''} ${record?.Approved_Info}`
|
||||||
}</div>
|
}</div>
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
dataIndex: 'TotalSell_Amount',
|
dataIndex: 'TotalSell_Amount',
|
||||||
title: '总销售额',
|
title: '总销售额',
|
||||||
width:100,
|
width: 100,
|
||||||
align: 'right',
|
align: 'right',
|
||||||
hideInSearch:true,
|
hideInSearch: true,
|
||||||
render:(_,record)=>{
|
render: (_, record) => {
|
||||||
return <span>{fmoney(record.TotalSell_Amount,2)}</span>
|
return <span>{fmoney(record.TotalSell_Amount, 2)}</span>
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
dataIndex: 'Difference_Amount',
|
dataIndex: 'Difference_Amount',
|
||||||
title: '长短款',
|
title: '长短款',
|
||||||
align: 'right',
|
align: 'right',
|
||||||
width:80,
|
width: 80,
|
||||||
hideInSearch:true,
|
hideInSearch: true,
|
||||||
render:(_,record)=>{
|
render: (_, record) => {
|
||||||
return <span style={{color:Number(record.Difference_Amount)>0?'green':Number(record.Difference_Amount)<0?'red':''}}>{fmoney(record.Difference_Amount,2)}</span>
|
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',
|
dataIndex: 'Revenue_Amount',
|
||||||
title: '实收金额',
|
title: '实收金额',
|
||||||
width:100,
|
width: 100,
|
||||||
align: 'right',
|
align: 'right',
|
||||||
hideInSearch:true,
|
hideInSearch: true,
|
||||||
render:(_,record)=>{
|
render: (_, record) => {
|
||||||
return <span>{fmoney(record.Revenue_Amount,2)}</span>
|
return <span>{fmoney(record.Revenue_Amount, 2)}</span>
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
dataIndex: 'Endaccount_EndDate',
|
dataIndex: 'Endaccount_EndDate',
|
||||||
title: '结账日期',
|
title: '结账日期',
|
||||||
width:200,
|
width: 200,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
// 请求服务区的列表的方法 且去掉第一个 安徽驿达 的列表数据
|
// 请求服务区的列表的方法 且去掉第一个 安徽驿达 的列表数据
|
||||||
const { loading, data: serviceList } = useRequest(async ()=>{
|
const { loading, data: serviceList } = useRequest(async () => {
|
||||||
const options = await getServerpartOption()
|
const options = await getServerpartOption()
|
||||||
const list: any = []
|
const list: any = []
|
||||||
if (options && options.length>0){
|
if (options && options.length > 0) {
|
||||||
options.forEach((item: any)=>{
|
options.forEach((item: any) => {
|
||||||
if (item.value!==424){
|
if (item.value !== 424) {
|
||||||
list.push(item)
|
list.push(item)
|
||||||
}
|
|
||||||
})
|
|
||||||
// setSelectServicePartId(list[0].value)
|
|
||||||
}
|
}
|
||||||
return list
|
})
|
||||||
})
|
// setSelectServicePartId(list[0].value)
|
||||||
// 请求表格数据
|
|
||||||
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)=>{
|
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)
|
setShowDisable(type)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 主任复核
|
// 主任复核
|
||||||
// type 0是财务驳回 2是财务审核 3是主任复核
|
// type 0是财务驳回 2是财务审核 3是主任复核
|
||||||
// desc 是点击审核驳回会出现的必填项
|
// desc 是点击审核驳回会出现的必填项
|
||||||
const handleSubmitEndaccountState = async (type: number,desc: string)=>{
|
const handleSubmitEndaccountState = async (type: number, desc: string) => {
|
||||||
const req = {
|
const req = {
|
||||||
TreatmentMarkState: type,
|
TreatmentMarkState: type,
|
||||||
EndaccountId:currentRow?.Endaccount_Id,
|
EndaccountId: currentRow?.Endaccount_Id,
|
||||||
RevenueAmount:currentRow?.Revenue_Amount,
|
RevenueAmount: currentRow?.Revenue_Amount,
|
||||||
DescriptionStaff:currentUser?.Name,
|
DescriptionStaff: currentUser?.Name,
|
||||||
DescriptionInfo:desc,
|
DescriptionInfo: desc,
|
||||||
DescriptionDate:moment().format('YYYY-MM-DD HH:mm:ss')
|
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)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
useEffect(() => {
|
const data = await submitEndaccountState(req)
|
||||||
handleGetTableList()
|
if (data.Result_Code === 100) {
|
||||||
}, []);
|
message.success(data.Result_Desc)
|
||||||
|
setShowDrawer(false);
|
||||||
|
handleGetTableList()
|
||||||
|
} else {
|
||||||
|
message.error(data.Result_Desc)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
useEffect(() => {
|
||||||
|
handleGetTableList()
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageContainer header={{
|
<PageContainer header={{
|
||||||
title: '',
|
title: '',
|
||||||
breadcrumb: {},
|
breadcrumb: {},
|
||||||
}}>
|
}}>
|
||||||
<div className={'searchBox'}>
|
<div className={'searchBox'}>
|
||||||
<div className={'searchBoxLeft'}>
|
<div className={'searchBoxLeft'}>
|
||||||
<div className={'searchItem'}>
|
<div className={'searchItem'}>
|
||||||
<span className={'searchLabel'}>服务区:</span>
|
<span className={'searchLabel'}>服务区:</span>
|
||||||
<Select
|
<Select
|
||||||
style={{minWidth:'150px'}}
|
style={{ minWidth: '150px' }}
|
||||||
value={selectServicePartId}
|
value={selectServicePartId}
|
||||||
options={serviceList}
|
options={serviceList}
|
||||||
allowClear
|
allowClear
|
||||||
showSearch
|
showSearch
|
||||||
filterOption={(input, option) =>
|
filterOption={(input, option) =>
|
||||||
(option?.label ?? '').toLowerCase().includes(input.toLowerCase())
|
(option?.label ?? '').toLowerCase().includes(input.toLowerCase())
|
||||||
}
|
}
|
||||||
onChange={async (e)=>{
|
onChange={async (e) => {
|
||||||
setSelectServicePartId(e)
|
setSelectServicePartId(e)
|
||||||
const req = {
|
// const req = {
|
||||||
ProvinceCode:currentUser?.USER_PROVINCE,
|
// ProvinceCode:currentUser?.USER_PROVINCE,
|
||||||
ServerpartId:e,
|
// ServerpartId:e,
|
||||||
ShowWholePower:true
|
// ShowWholePower:true
|
||||||
}
|
// }
|
||||||
const data = await handleGetServiceShopList(req)
|
// const data = await handleGetServiceShopList(req)
|
||||||
setSelectShopId(null)
|
|
||||||
setShopList(data.List)
|
const req = {
|
||||||
}}
|
SearchParameter: {
|
||||||
></Select>
|
SERVERPART_IDS: e,
|
||||||
</div>
|
ISVALID: 1
|
||||||
<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)
|
|
||||||
},
|
},
|
||||||
|
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
|
setSelectShopId(null)
|
||||||
width={'60%'}
|
setShopList(list)
|
||||||
visible={showDrawer}
|
}}
|
||||||
closable={false}
|
></Select>
|
||||||
bodyStyle={{ padding: 0 }}
|
</div>
|
||||||
onClose={() => {
|
<div className={'searchItem'}>
|
||||||
setShowDrawer(false);
|
<span className={'searchLabel'}>门店:</span>
|
||||||
}}
|
<Select
|
||||||
destroyOnClose={true}
|
style={{ minWidth: '150px' }}
|
||||||
footer={
|
value={selectShopId}
|
||||||
currentRow?.Treatment_MarkState===3?
|
allowClear
|
||||||
<div style={{width:'100%',display:'flex',alignItems:'center',justifyContent:'space-between'}}>
|
options={shopList}
|
||||||
<Button disabled={showDisable} danger onClick={()=>{
|
onChange={(e) => {
|
||||||
// 调用子组件里面的方法
|
setSelectShopId(e)
|
||||||
checkDetail.current?.handleEndaccountPhoto()
|
}}
|
||||||
}}>查看单据</Button>
|
></Select>
|
||||||
<div style={{display:'flex',justifyContent:'flex-end'}}>
|
</div>
|
||||||
<Button disabled={showDisable} style={{marginRight:'8px'}} type={'primary'} onClick={()=>{
|
<div className={'searchItem'}>
|
||||||
// 进行表单校验 校验通过之后调用保存的审核方法
|
<span className={'searchLabel'}>处理状态:</span>
|
||||||
checkDetail.current.formRef.current?.validateFields().then(res=>{
|
<Select
|
||||||
if (res){
|
style={{ minWidth: '150px' }}
|
||||||
const desc = checkDetail.current?.handleGetApprovedInfo()
|
value={selectState}
|
||||||
handleSubmitEndaccountState(3,desc.Review_Info)
|
allowClear
|
||||||
}
|
options={[{ label: '全部', value: '' },
|
||||||
})
|
{ label: '待我处理', value: 0 },
|
||||||
}}>审核</Button>
|
{ label: '财务审核', value: 1 },
|
||||||
<Button onClick={()=>{setShowDrawer(false)}}>关闭</Button>
|
{ label: '财务审结', value: 2 },
|
||||||
</div>
|
{ label: '主任复核', value: 3 },
|
||||||
</div>:''
|
{ 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()
|
||||||
<CheckDetail onRef={checkDetail} currentRow={currentRow} currentUser={currentUser} handleChangeShowDisable={handleChangeShowDisable}/>
|
const data = await handleGetAccountList(req)
|
||||||
</Drawer>
|
if (data && data.List && data.List.length > 0) {
|
||||||
</PageContainer>
|
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) => ({
|
export default connect(({ user }: ConnectState) => ({
|
||||||
currentUser: user?.currentUser
|
currentUser: user?.currentUser
|
||||||
}))(List);
|
}))(List);
|
||||||
|
|||||||
@ -1,19 +1,20 @@
|
|||||||
// 结账数据校验
|
// 结账数据校验
|
||||||
import React, {useEffect, useRef, useState} from "react";
|
import React, { useEffect, useRef, useState } from "react";
|
||||||
import type {CurrentUser} from "@/models/user";
|
import type { CurrentUser } from "@/models/user";
|
||||||
import {connect} from "umi";
|
import { connect } from "umi";
|
||||||
import type {ConnectState} from "@/models/connect";
|
import type { ConnectState } from "@/models/connect";
|
||||||
import {PageContainer} from "@ant-design/pro-layout";
|
import { PageContainer } from "@ant-design/pro-layout";
|
||||||
import ProTable from "@ant-design/pro-table";
|
import ProTable from "@ant-design/pro-table";
|
||||||
import { getServerpartOption} from "@/pages/DataVerification/list/service";
|
import { getServerpartOption } from "@/pages/DataVerification/list/service";
|
||||||
import {
|
import {
|
||||||
handleBatchReview,
|
handleBatchReview,
|
||||||
handleGetAccountList,
|
handleGetAccountList,
|
||||||
|
handleGetServerpartShopList,
|
||||||
handleGetServiceShopList,
|
handleGetServiceShopList,
|
||||||
submitEndaccountState
|
submitEndaccountState
|
||||||
} from "@/pages/DataVerification/service";
|
} from "@/pages/DataVerification/service";
|
||||||
import './list.less'
|
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 useRequest from "@ahooksjs/use-request";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import CheckDetail from "@/pages/DataVerification/dataExamine/components/checkDetail";
|
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 }) => {
|
const List: React.FC<{ currentUser?: CurrentUser }> = ({ currentUser }) => {
|
||||||
// 详情的ref
|
// 详情的ref
|
||||||
const checkDetail = useRef()
|
const checkDetail = useRef()
|
||||||
// 表格数组
|
// 表格数组
|
||||||
const [tableData,setTableData] = useState<any>()
|
const [tableData, setTableData] = useState<any>()
|
||||||
// 选择的服务区
|
// 选择的服务区
|
||||||
const [selectServicePartId,setSelectServicePartId] = useState<any>()
|
const [selectServicePartId, setSelectServicePartId] = useState<any>()
|
||||||
// 门店列表
|
// 门店列表
|
||||||
const [shopList,setShopList] = useState<any>()
|
const [shopList, setShopList] = useState<any>()
|
||||||
// 选择的门店列表
|
// 选择的门店列表
|
||||||
const [selectShopId,setSelectShopId] = useState<any>('')
|
const [selectShopId, setSelectShopId] = useState<any>('')
|
||||||
// 处理状态
|
// 处理状态
|
||||||
const [selectState,setSelectState] = useState<any>(1)
|
const [selectState, setSelectState] = useState<any>(1)
|
||||||
// 查询时间
|
// 查询时间
|
||||||
const [selectTime,setSelectTime] = useState<any>([moment().subtract(1, 'day'),moment().subtract(1, 'day')])
|
const [selectTime, setSelectTime] = useState<any>([moment().subtract(1, 'day'), moment().subtract(1, 'day')])
|
||||||
// 表格的加载效果
|
// 表格的加载效果
|
||||||
const [tableLoading,setTableLoading] = useState<boolean>(false)
|
const [tableLoading, setTableLoading] = useState<boolean>(false)
|
||||||
// 显示抽屉
|
// 显示抽屉
|
||||||
const [showDrawer,setShowDrawer] = useState<boolean>(false)
|
const [showDrawer, setShowDrawer] = useState<boolean>(false)
|
||||||
// 点击 或者双击的当前行数据
|
// 点击 或者双击的当前行数据
|
||||||
const [currentRow,setCurrentRow] = useState<any>()
|
const [currentRow, setCurrentRow] = useState<any>()
|
||||||
// 选中的行数据
|
// 选中的行数据
|
||||||
const [selectRowList,setSelectRowList] = useState<any>()
|
const [selectRowList, setSelectRowList] = useState<any>()
|
||||||
// 选中的行
|
// 选中的行
|
||||||
const [selectedOrderRowKeys,setSelectedOrderRowKeys] = useState<any>()
|
const [selectedOrderRowKeys, setSelectedOrderRowKeys] = useState<any>()
|
||||||
// 根据子组件是否出现加载框来判断按钮是否禁用
|
// 根据子组件是否出现加载框来判断按钮是否禁用
|
||||||
const [showDisable,setShowDisable] = useState<boolean>(false)
|
const [showDisable, setShowDisable] = useState<boolean>(false)
|
||||||
|
|
||||||
const { RangePicker } = DatePicker;
|
const { RangePicker } = DatePicker;
|
||||||
const fmoney = (s: number, n?: number) => {
|
const fmoney = (s: number, n?: number) => {
|
||||||
/*
|
/*
|
||||||
* 参数说明:
|
* 参数说明:
|
||||||
* s:要格式化的数字
|
* s:要格式化的数字
|
||||||
@ -74,413 +75,435 @@ const List: React.FC<{ currentUser?: CurrentUser }> = ({ currentUser }) => {
|
|||||||
return `${fuhao + [...t].reverse().join("")}.${r}`;
|
return `${fuhao + [...t].reverse().join("")}.${r}`;
|
||||||
|
|
||||||
}
|
}
|
||||||
const rowSelection: any ={
|
const rowSelection: any = {
|
||||||
selectedRowKeys: selectedOrderRowKeys,
|
selectedRowKeys: selectedOrderRowKeys,
|
||||||
onChange: (selectedRowKeys: any, selectedRows: any) => {
|
onChange: (selectedRowKeys: any, selectedRows: any) => {
|
||||||
setSelectRowList(selectedRows)
|
setSelectRowList(selectedRows)
|
||||||
setSelectedOrderRowKeys(selectedRowKeys)
|
setSelectedOrderRowKeys(selectedRowKeys)
|
||||||
},
|
},
|
||||||
getCheckboxProps: (record: any) => ({
|
getCheckboxProps: (record: any) => ({
|
||||||
disabled: record.Treatment_MarkState !== 1 ,
|
disabled: record.Treatment_MarkState !== 1,
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const columns: any = [
|
const columns: any = [
|
||||||
{
|
{
|
||||||
dataIndex: 'key',
|
dataIndex: 'key',
|
||||||
title: '序号',
|
title: '序号',
|
||||||
width: 50,
|
width: 50,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
dataIndex: '',
|
dataIndex: '',
|
||||||
title: '',
|
title: '',
|
||||||
width: 100,
|
width: 100,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
hideInSearch:true,
|
hideInSearch: true,
|
||||||
render:(_,record) =>{
|
render: (_, record) => {
|
||||||
return <span style={{color:record.Treatment_MarkState===0?'red':
|
return <span style={{
|
||||||
record.Treatment_MarkState===1?'#ff6600':'#0066FF',fontWeight:'bold',textDecoration:'underline',cursor:'pointer'}} onClick={()=>{
|
color: record.Treatment_MarkState === 0 ? 'red' :
|
||||||
setShowDrawer(true);
|
record.Treatment_MarkState === 1 ? '#ff6600' : '#0066FF', fontWeight: 'bold', textDecoration: 'underline', cursor: 'pointer'
|
||||||
setCurrentRow(record)
|
}} onClick={() => {
|
||||||
}}>
|
setShowDrawer(true);
|
||||||
{record.Treatment_MarkState===0?'未做校验':
|
setCurrentRow(record)
|
||||||
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: {},
|
|
||||||
}}>
|
}}>
|
||||||
<div className={'searchBox'}>
|
{record.Treatment_MarkState === 0 ? '未做校验' :
|
||||||
<div className={'searchBoxLeft'}>
|
record.Treatment_MarkState === 1 ? '待您审核' :
|
||||||
<div className={'searchItem'}>
|
record.Treatment_MarkState === 2 ? '审核原因' :
|
||||||
<span className={'searchLabel'}>服务区:</span>
|
record.Treatment_MarkState === 3 ? '主任复核' :
|
||||||
<Select
|
record.Treatment_MarkState === 4 ? '主任审结' : ''}
|
||||||
style={{minWidth:'150px'}}
|
</span>
|
||||||
value={selectServicePartId}
|
}
|
||||||
options={serviceList}
|
},
|
||||||
allowClear
|
{
|
||||||
showSearch
|
dataIndex: 'Treatment_MarkState',
|
||||||
filterOption={(input, option) =>
|
title: '处理状态',
|
||||||
(option?.label ?? '').toLowerCase().includes(input.toLowerCase())
|
width: 90,
|
||||||
}
|
align: 'center',
|
||||||
onChange={async (e)=>{
|
render: (_, record) => {
|
||||||
setSelectServicePartId(e)
|
return <span
|
||||||
const req = {
|
style={{
|
||||||
ProvinceCode:currentUser?.USER_PROVINCE,
|
color: record.Treatment_MarkState === 0 ? 'red' :
|
||||||
ServerpartId:e,
|
record.Treatment_MarkState === 1 ? '#ff6600' : '#0066FF'
|
||||||
ShowWholePower:true
|
}}
|
||||||
}
|
>{record.Treatment_MarkState === 0 ? '待处理' :
|
||||||
const data = await handleGetServiceShopList(req)
|
record.Treatment_MarkState === 1 ? '待审核' :
|
||||||
setSelectShopId(null)
|
record.Treatment_MarkState === 2 ? '已审结' :
|
||||||
setShopList(data.List)
|
record.Treatment_MarkState === 3 ? '主任复核' :
|
||||||
}}
|
record.Treatment_MarkState === 4 ? '主任审结' : ''}</span>
|
||||||
></Select>
|
}
|
||||||
</div>
|
},
|
||||||
<div className={'searchItem'}>
|
{
|
||||||
<span className={'searchLabel'}>门店:</span>
|
dataIndex: 'Serverpart_Name',
|
||||||
<Select
|
title: '服务区名称',
|
||||||
style={{minWidth:'150px'}}
|
width: 120,
|
||||||
value={selectShopId}
|
},
|
||||||
allowClear
|
{
|
||||||
options={shopList}
|
dataIndex: 'ServerpartShop_Name',
|
||||||
onChange={(e)=>{
|
title: '门店名称',
|
||||||
setSelectShopId(e)
|
valueType: 'select',
|
||||||
}}
|
ellipsis: true,
|
||||||
></Select>
|
width: 200,
|
||||||
</div>
|
},
|
||||||
<div className={'searchItem'}>
|
{
|
||||||
<span className={'searchLabel'}>处理状态:</span>
|
dataIndex: 'Description_Info',
|
||||||
<Select
|
title: '日结校验',
|
||||||
style={{minWidth:'150px'}}
|
width: 400,
|
||||||
value={selectState}
|
ellipsis: true,
|
||||||
allowClear
|
hideInSearch: true,
|
||||||
options={[{label:'待我审核',value:1},{label:'我已审核',value:2}]}
|
render: (_, record) => {
|
||||||
onChange={(e)=>{
|
return <div>{
|
||||||
setSelectState(e)
|
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>
|
||||||
></Select>
|
:
|
||||||
</div>
|
<div style={{ display: 'flex', alignItems: 'center', width: '390px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }}>
|
||||||
<div className={'searchItem'}>
|
<img style={{ width: '16px', height: '16px' }} src={mobile} />
|
||||||
<span className={'searchLabel'}>时间:</span>
|
<span>{`${record.Description_Staff.split('【')[0]}: ${record.Description_Info}`}</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>
|
|
||||||
</div>
|
</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('请先选择')
|
|
||||||
}
|
|
||||||
|
|
||||||
}}
|
}</div>
|
||||||
>
|
}
|
||||||
批量审核
|
},
|
||||||
</Button>,
|
{
|
||||||
],
|
dataIndex: 'TotalSell_Amount',
|
||||||
}}
|
title: '总销售额',
|
||||||
onRow={(record)=>{
|
width: 100,
|
||||||
return {
|
align: 'right',
|
||||||
onDoubleClick: () => {
|
hideInSearch: true,
|
||||||
setShowDrawer(true);
|
render: (_, record) => {
|
||||||
setCurrentRow(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)
|
||||||
}}
|
}}
|
||||||
>
|
></Select>
|
||||||
|
|
||||||
</ProTable>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div className={'searchItem'}>
|
||||||
<Drawer
|
<span className={'searchLabel'}>门店:</span>
|
||||||
width={'60%'}
|
<Select
|
||||||
visible={showDrawer}
|
style={{ minWidth: '150px' }}
|
||||||
closable={false}
|
value={selectShopId}
|
||||||
bodyStyle={{ padding: 0 }}
|
allowClear
|
||||||
onClose={() => {
|
options={shopList}
|
||||||
setShowDrawer(false);
|
onChange={(e) => {
|
||||||
}}
|
setSelectShopId(e)
|
||||||
destroyOnClose={true}
|
}}
|
||||||
footer={
|
></Select>
|
||||||
currentRow?.Treatment_MarkState===1?
|
</div>
|
||||||
<div style={{width:'100%',display:'flex',alignItems:'center',justifyContent:'space-between'}}>
|
<div className={'searchItem'}>
|
||||||
<Button disabled={showDisable} danger onClick={()=>{
|
<span className={'searchLabel'}>处理状态:</span>
|
||||||
checkDetail.current?.handleEndaccountPhoto()
|
<Select
|
||||||
}}>查看单据</Button>
|
style={{ minWidth: '150px' }}
|
||||||
<div style={{display:'flex',justifyContent:'flex-end'}}>
|
value={selectState}
|
||||||
<Button disabled={showDisable} style={{marginRight:'8px'}} type={'primary'} onClick={()=>{
|
allowClear
|
||||||
checkDetail.current.formRef.current?.validateFields().then(res=>{
|
options={[{ label: '待我审核', value: 1 }, { label: '我已审核', value: 2 }]}
|
||||||
if (res){
|
onChange={(e) => {
|
||||||
const desc = checkDetail.current?.handleGetApprovedInfo()
|
setSelectState(e)
|
||||||
handleSubmitEndaccountState(2,desc.Approved_Info)
|
}}
|
||||||
}
|
></Select>
|
||||||
})
|
</div>
|
||||||
}}>审核</Button>
|
<div className={'searchItem'}>
|
||||||
<Button disabled={showDisable} style={{marginRight:'8px'}} danger onClick={()=>{
|
<span className={'searchLabel'}>时间:</span>
|
||||||
checkDetail.current.formRef.current?.validateFields().then(res=>{
|
<RangePicker
|
||||||
if (res){
|
value={selectTime}
|
||||||
const desc = checkDetail.current?.handleGetApprovedInfo()
|
onChange={(e) => {
|
||||||
handleSubmitEndaccountState(0,desc.Approved_Info)
|
setSelectTime([moment(e[0]._d), moment(e[1]._d)])
|
||||||
}
|
}}
|
||||||
})
|
/>
|
||||||
}}>驳回</Button>
|
</div>
|
||||||
<Button onClick={()=>{setShowDrawer(false)}}>关闭</Button>
|
</div>
|
||||||
</div>
|
<div className={'searchBoxRight'}>
|
||||||
</div>:''
|
<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)
|
||||||
<CheckDetail onRef={checkDetail} currentRow={currentRow} currentUser={currentUser} handleChangeShowDisable={handleChangeShowDisable}/>
|
if (data && data.List && data.List.length > 0) {
|
||||||
</Drawer>
|
const list = []
|
||||||
</PageContainer>
|
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) => ({
|
export default connect(({ user }: ConnectState) => ({
|
||||||
currentUser: user?.currentUser
|
currentUser: user?.currentUser
|
||||||
}))(List);
|
}))(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);
|
console.log('leftList', leftList);
|
||||||
|
|
||||||
if (leftList && leftList.length > 0) {
|
if (leftList && leftList.length > 0) {
|
||||||
setSelectLeftTime(leftList[0].value)
|
// setSelectLeftTime(leftList[0].value)
|
||||||
handleGetDetail(leftList[0].value, selectTab)
|
// handleGetDetail(leftList[0].value, selectTab)
|
||||||
|
setSelectLeftTime(currentRow?.Endaccount_Id)
|
||||||
|
handleGetDetail(currentRow?.Endaccount_Id, selectTab)
|
||||||
} else {
|
} else {
|
||||||
formRef.current?.resetFields()
|
formRef.current?.resetFields()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,7 +37,7 @@ import haveOwner from '@/assets/DataVerification/haveOwner.png'
|
|||||||
import interfaceImg from '@/assets/DataVerification/interface.png'
|
import interfaceImg from '@/assets/DataVerification/interface.png'
|
||||||
import defaultIcon from '@/assets/brand/defaultIcon.png'
|
import defaultIcon from '@/assets/brand/defaultIcon.png'
|
||||||
import ItemDetail from './components/ItemDetail'
|
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 changeIcon from '../../../assets/versionChange.png'
|
||||||
import ProForm, { ProFormInstance, ProFormSelect } from "@ant-design/pro-form";
|
import ProForm, { ProFormInstance, ProFormSelect } from "@ant-design/pro-form";
|
||||||
import UnUploadDetail from "./components/unUploadDetail";
|
import UnUploadDetail from "./components/unUploadDetail";
|
||||||
@ -49,7 +49,7 @@ const List: React.FC<{ currentUser?: CurrentUser }> = ({ currentUser }) => {
|
|||||||
|
|
||||||
const UnUploadDetailRef = useRef<any>()
|
const UnUploadDetailRef = useRef<any>()
|
||||||
|
|
||||||
const [currentRow, setCurrentRow] = useState<EndaccountDetailModel>()
|
const [currentRow, setCurrentRow] = useState<any>()
|
||||||
// 切换页面版本
|
// 切换页面版本
|
||||||
const [pageVersion, setPageVersion] = useState<'new' | 'old'>('new')
|
const [pageVersion, setPageVersion] = useState<'new' | 'old'>('new')
|
||||||
const [selectService, setSelectService] = useState<number>()// 页面选择的服务区
|
const [selectService, setSelectService] = useState<number>()// 页面选择的服务区
|
||||||
@ -98,6 +98,7 @@ const List: React.FC<{ currentUser?: CurrentUser }> = ({ currentUser }) => {
|
|||||||
dataIndex: 'Serverpart_Name',
|
dataIndex: 'Serverpart_Name',
|
||||||
title: '服务区名称',
|
title: '服务区名称',
|
||||||
width: 120,
|
width: 120,
|
||||||
|
ellipsis: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
dataIndex: 'ServerpartShop_Name',
|
dataIndex: 'ServerpartShop_Name',
|
||||||
@ -305,6 +306,7 @@ const List: React.FC<{ currentUser?: CurrentUser }> = ({ currentUser }) => {
|
|||||||
EndDate: moment(selectTime[1]).format('YYYY-MM-DD'),
|
EndDate: moment(selectTime[1]).format('YYYY-MM-DD'),
|
||||||
TreatmentMarkState: selectState || selectState === 0 ? selectState : '',
|
TreatmentMarkState: selectState || selectState === 0 ? selectState : '',
|
||||||
EndaccountState: selectState || selectState === 0 ? 1 : '',
|
EndaccountState: selectState || selectState === 0 ? 1 : '',
|
||||||
|
PageIndex: 1,
|
||||||
PageSize: 999999
|
PageSize: 999999
|
||||||
}
|
}
|
||||||
const data = await handleGetAccountList(req)
|
const data = await handleGetAccountList(req)
|
||||||
@ -515,16 +517,37 @@ const List: React.FC<{ currentUser?: CurrentUser }> = ({ currentUser }) => {
|
|||||||
}
|
}
|
||||||
onChange={async (e) => {
|
onChange={async (e) => {
|
||||||
setSelectServicePartId(e)
|
setSelectServicePartId(e)
|
||||||
|
// const req = {
|
||||||
|
// ProvinceCode: currentUser?.ProvinceCode,
|
||||||
|
// ServerpartId: e,
|
||||||
|
// ShowWholePower: true
|
||||||
|
// }
|
||||||
|
// const data = await handleGetServiceShopList(req)
|
||||||
|
// console.log('datadatadatadatadata', data);
|
||||||
|
|
||||||
|
|
||||||
const req = {
|
const req = {
|
||||||
ProvinceCode: currentUser?.USER_PROVINCE,
|
SearchParameter: {
|
||||||
ServerpartId: e,
|
SERVERPART_IDS: e,
|
||||||
ShowWholePower: true
|
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)
|
setSelectShopId(null)
|
||||||
let list: any = data.List
|
// let list: any = data.List
|
||||||
list.unshift({ label: '全部', value: '' })
|
list.unshift({ label: '全部', value: '' })
|
||||||
setShopList(data.List)
|
setShopList(list)
|
||||||
}}
|
}}
|
||||||
></Select>
|
></Select>
|
||||||
</div>
|
</div>
|
||||||
@ -585,6 +608,7 @@ const List: React.FC<{ currentUser?: CurrentUser }> = ({ currentUser }) => {
|
|||||||
className={'proTableBox'}
|
className={'proTableBox'}
|
||||||
search={false}
|
search={false}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
|
bordered
|
||||||
dataSource={tableData}
|
dataSource={tableData}
|
||||||
scroll={{ y: 'calc(100vh - 470px)' }}
|
scroll={{ y: 'calc(100vh - 470px)' }}
|
||||||
pagination={{ pageSize: 20 }}
|
pagination={{ pageSize: 20 }}
|
||||||
@ -607,6 +631,7 @@ const List: React.FC<{ currentUser?: CurrentUser }> = ({ currentUser }) => {
|
|||||||
destroyOnClose={true}
|
destroyOnClose={true}
|
||||||
onClose={() => {
|
onClose={() => {
|
||||||
setShowDetail(false);
|
setShowDetail(false);
|
||||||
|
setCurrentRow(null)
|
||||||
}}
|
}}
|
||||||
footer={
|
footer={
|
||||||
selectChildrenTab ?
|
selectChildrenTab ?
|
||||||
|
|||||||
@ -1,30 +1,36 @@
|
|||||||
.qualificationsData{
|
.qualificationsData {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
.dataBox{
|
|
||||||
|
.dataBox {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 120px;
|
height: 130px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 16px 24px;
|
padding: 16px 24px;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
.dataBoxTop{
|
|
||||||
|
.dataBoxTop {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
.dataBoxTopLeft{
|
|
||||||
|
.dataBoxTopLeft {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
.leftIcon{
|
|
||||||
|
.leftIcon {
|
||||||
width: 28px;
|
width: 28px;
|
||||||
height: 28px;
|
height: 28px;
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
}
|
}
|
||||||
.pageSelect{
|
|
||||||
|
.pageSelect {
|
||||||
width: 150px;
|
width: 150px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.dataBoxTopRight{
|
|
||||||
.versionChangeBox{
|
.dataBoxTopRight {
|
||||||
|
.versionChangeBox {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
border-color: #40a9ff;
|
border-color: #40a9ff;
|
||||||
background: #40a9ff;
|
background: #40a9ff;
|
||||||
@ -35,7 +41,8 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 4px 15px;
|
padding: 4px 15px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
.changeIcon{
|
|
||||||
|
.changeIcon {
|
||||||
width: 20px;
|
width: 20px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
@ -43,64 +50,77 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.dataBoxBottom{
|
|
||||||
|
.dataBoxBottom {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 0 36px;
|
padding: 0 36px;
|
||||||
margin-top: 12px;
|
margin-top: 12px;
|
||||||
display: flex;
|
display: flex;
|
||||||
.dataBoxBottomLeft{
|
|
||||||
|
.dataBoxBottomLeft {
|
||||||
width: 70%;
|
width: 70%;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
.bottomItem{
|
|
||||||
|
.bottomItem {
|
||||||
width: 30%;
|
width: 30%;
|
||||||
display: flex;
|
display: flex;
|
||||||
.typeIcon{
|
|
||||||
|
.typeIcon {
|
||||||
width: 44px;
|
width: 44px;
|
||||||
height: 44px;
|
height: 44px;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
.smallData{
|
|
||||||
|
.smallData {
|
||||||
margin-left: 12px;
|
margin-left: 12px;
|
||||||
.dataLabel{
|
|
||||||
|
.dataLabel {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-family: PingFangSC-Regular, PingFang SC;
|
font-family: PingFangSC-Regular, PingFang SC;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: rgba(0,0,0,0.65);
|
color: rgba(0, 0, 0, 0.65);
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
}
|
}
|
||||||
.warningBoxs{
|
|
||||||
|
.warningBoxs {
|
||||||
display: flex;
|
display: flex;
|
||||||
position: relative;
|
position: relative;
|
||||||
.dataLabel{
|
|
||||||
|
.dataLabel {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-family: PingFangSC-Regular, PingFang SC;
|
font-family: PingFangSC-Regular, PingFang SC;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: rgba(0,0,0,0.65);
|
color: rgba(0, 0, 0, 0.65);
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
}
|
}
|
||||||
.unUpload{
|
|
||||||
|
.unUpload {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
.warningIcon{
|
|
||||||
|
.warningIcon {
|
||||||
width: 22px;
|
width: 22px;
|
||||||
height: 22px;
|
height: 22px;
|
||||||
}
|
}
|
||||||
.unUploadText{
|
|
||||||
|
.unUploadText {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-family: AppleColorEmoji;
|
font-family: AppleColorEmoji;
|
||||||
color: #1890FF;
|
color: #1890FF;
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
margin-left: 4px;
|
margin-left: 4px;
|
||||||
}
|
}
|
||||||
.text{
|
|
||||||
|
.text {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.uploadBox{
|
|
||||||
|
.uploadBox {
|
||||||
display: block;
|
display: block;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
z-index: 99;
|
z-index: 99;
|
||||||
@ -108,11 +128,13 @@
|
|||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
position: absolute;
|
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);
|
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-size: 20px;
|
||||||
font-family: DINAlternate-Bold, DINAlternate;
|
font-family: DINAlternate-Bold, DINAlternate;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
@ -122,7 +144,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.dataBoxBottomRight{
|
|
||||||
|
.dataBoxBottomRight {
|
||||||
width: 30%;
|
width: 30%;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -131,39 +154,44 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.dataList{
|
.dataList {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
height: calc(100vh - 280px);
|
height: calc(100vh - 280px);
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding-bottom: 20px;
|
padding-bottom: 20px;
|
||||||
position: relative;
|
position: relative;
|
||||||
.LoadingBox{
|
|
||||||
|
.LoadingBox {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 0;top: 0;
|
right: 0;
|
||||||
|
top: 0;
|
||||||
z-index: 999;
|
z-index: 999;
|
||||||
background:rgba(0,0,0,0.1);
|
background: rgba(0, 0, 0, 0.1);
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
.loading{
|
|
||||||
display:flex;
|
.loading {
|
||||||
align-items:center;
|
display: flex;
|
||||||
padding:15px 20px 10px;
|
align-items: center;
|
||||||
background:#fff;
|
padding: 15px 20px 10px;
|
||||||
border-radius:8px;
|
background: #fff;
|
||||||
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.listBox{
|
|
||||||
|
.listBox {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
align-content: flex-start;
|
align-content: flex-start;
|
||||||
.listItem{
|
|
||||||
|
.listItem {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
width: calc((100% - 68px) / 4);
|
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%);
|
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-radius: 8px;
|
||||||
border: 1px solid #E7E7E7;
|
border: 1px solid #E7E7E7;
|
||||||
.itemTop{
|
|
||||||
|
.itemTop {
|
||||||
display: flex;
|
display: flex;
|
||||||
.itemImg{
|
|
||||||
|
.itemImg {
|
||||||
width: 56px;
|
width: 56px;
|
||||||
height: 56px;
|
height: 56px;
|
||||||
margin-right: 12px;
|
margin-right: 12px;
|
||||||
}
|
}
|
||||||
.topBox{
|
|
||||||
.topText{
|
.topBox {
|
||||||
|
.topText {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-family: PingFangSC-Medium, PingFang SC;
|
font-family: PingFangSC-Medium, PingFang SC;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: rgba(0,0,0,0.85);
|
color: rgba(0, 0, 0, 0.85);
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
}
|
}
|
||||||
.typeList{
|
|
||||||
|
.typeList {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-top: 6px;
|
margin-top: 6px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
@ -204,72 +236,82 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.listItemCenter{
|
.listItemCenter {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
padding-bottom: 20px;
|
padding-bottom: 20px;
|
||||||
border-bottom: 1px solid rgba(0, 0, 0, 0.06);
|
border-bottom: 1px solid rgba(0, 0, 0, 0.06);
|
||||||
.realMoneyBox{
|
|
||||||
|
.realMoneyBox {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
margin-bottom: 17px;
|
margin-bottom: 17px;
|
||||||
.moneyLeft{
|
|
||||||
|
.moneyLeft {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
.moneyIcon{
|
|
||||||
|
.moneyIcon {
|
||||||
width: 24px;
|
width: 24px;
|
||||||
height: 24px;
|
height: 24px;
|
||||||
margin-right: 4px;
|
margin-right: 4px;
|
||||||
}
|
}
|
||||||
.leftLabel{
|
|
||||||
|
.leftLabel {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-family: PingFangSC-Regular, PingFang SC;
|
font-family: PingFangSC-Regular, PingFang SC;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: rgba(0,0,0,0.65);
|
color: rgba(0, 0, 0, 0.65);
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.moneyRight{
|
|
||||||
|
.moneyRight {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
font-family: DINAlternate-Bold, DINAlternate;
|
font-family: DINAlternate-Bold, DINAlternate;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: rgba(0,0,0,0.85);
|
color: rgba(0, 0, 0, 0.85);
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.progressBox{
|
.progressBox {
|
||||||
.boxTop{
|
.boxTop {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
margin-bottom: 4px;
|
margin-bottom: 4px;
|
||||||
.boxTopLabel{
|
|
||||||
|
.boxTopLabel {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-family: PingFangSC-Regular, PingFang SC;
|
font-family: PingFangSC-Regular, PingFang SC;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: rgba(0,0,0,0.65);
|
color: rgba(0, 0, 0, 0.65);
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
}
|
}
|
||||||
.boxTopValue{
|
|
||||||
|
.boxTopValue {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-family: PingFangSC-Semibold, PingFang SC;
|
font-family: PingFangSC-Semibold, PingFang SC;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: rgba(0,0,0,0.85);
|
color: rgba(0, 0, 0, 0.85);
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.progress{
|
|
||||||
|
.progress {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 8px;
|
height: 8px;
|
||||||
background: #EDEDED;
|
background: #EDEDED;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
position: relative;
|
position: relative;
|
||||||
.have{
|
|
||||||
width:50%;
|
.have {
|
||||||
|
width: 50%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
position:absolute;
|
position: absolute;
|
||||||
left: 0;top: 0;
|
left: 0;
|
||||||
|
top: 0;
|
||||||
background: #5B75FF;
|
background: #5B75FF;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
}
|
}
|
||||||
@ -277,26 +319,29 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.codeBox{
|
.codeBox {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
margin-top: 22px;
|
margin-top: 22px;
|
||||||
.codeLeft{
|
|
||||||
.code{
|
.codeLeft {
|
||||||
|
.code {
|
||||||
width: 24px;
|
width: 24px;
|
||||||
height: 24px;
|
height: 24px;
|
||||||
margin-right: 6px;
|
margin-right: 6px;
|
||||||
}
|
}
|
||||||
.text{
|
|
||||||
|
.text {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-family: PingFangSC-Regular, PingFang SC;
|
font-family: PingFangSC-Regular, PingFang SC;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: rgba(0,0,0,0.65);
|
color: rgba(0, 0, 0, 0.65);
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.codeRight{
|
|
||||||
|
.codeRight {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-family: PingFangSC-Regular, PingFang SC;
|
font-family: PingFangSC-Regular, PingFang SC;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
@ -316,8 +361,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
.oldPageBox{
|
.oldPageBox {
|
||||||
.searchBox{
|
.searchBox {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
@ -328,23 +373,28 @@
|
|||||||
margin-bottom: 24px;
|
margin-bottom: 24px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
display: flex;
|
display: flex;
|
||||||
.searchBoxLeft{
|
|
||||||
|
.searchBoxLeft {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
.searchItem{
|
|
||||||
|
.searchItem {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
margin-right: 12px;
|
margin-right: 12px;
|
||||||
.searchLabel{
|
|
||||||
|
.searchLabel {
|
||||||
margin-right: 4px;
|
margin-right: 4px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.searchBoxRight{
|
|
||||||
|
.searchBoxRight {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
.versionChangeBox{
|
|
||||||
|
.versionChangeBox {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
border-color: #40a9ff;
|
border-color: #40a9ff;
|
||||||
background: #40a9ff;
|
background: #40a9ff;
|
||||||
@ -356,7 +406,8 @@
|
|||||||
padding: 4px 15px;
|
padding: 4px 15px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
.changeIcon{
|
|
||||||
|
.changeIcon {
|
||||||
width: 20px;
|
width: 20px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
@ -364,23 +415,26 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.tableBox{
|
|
||||||
|
.tableBox {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 24px;
|
padding: 24px;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
.proTableBox{
|
|
||||||
.ant-pro-card{
|
.proTableBox {
|
||||||
.ant-pro-card-body{
|
.ant-pro-card {
|
||||||
.ant-table-wrapper{
|
.ant-pro-card-body {
|
||||||
.ant-spin-nested-loading{
|
.ant-table-wrapper {
|
||||||
.ant-spin-container{
|
.ant-spin-nested-loading {
|
||||||
.ant-table{
|
.ant-spin-container {
|
||||||
.ant-table-container{
|
.ant-table {
|
||||||
.ant-table-body{
|
.ant-table-container {
|
||||||
.ant-table-tbody{
|
.ant-table-body {
|
||||||
.greyRow{
|
.ant-table-tbody {
|
||||||
|
.greyRow {
|
||||||
background: #e1e1e1;
|
background: #e1e1e1;
|
||||||
.ant-table-cell-row-hover{
|
|
||||||
|
.ant-table-cell-row-hover {
|
||||||
background: #e1e1e1;
|
background: #e1e1e1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import ProForm, { ProFormDigit, ProFormSelect, ProFormText, ProFormTextArea } fr
|
|||||||
import { useRef, useState } from "react";
|
import { useRef, useState } from "react";
|
||||||
import Draggable from "react-draggable";
|
import Draggable from "react-draggable";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { handleGetINSALES_STATISTICDetail } from "../../service";
|
import { handleGetCommodityInSaleList, handleGetGetCOMMODITYDetail, handleGetINSALES_STATISTICDetail } from "../../service";
|
||||||
import session from "@/utils/session";
|
import session from "@/utils/session";
|
||||||
import COMMODITYINFO from "./COMMODITYINFO";
|
import COMMODITYINFO from "./COMMODITYINFO";
|
||||||
|
|
||||||
@ -13,8 +13,10 @@ type DetailProps = {
|
|||||||
onShow: boolean
|
onShow: boolean
|
||||||
parentRow: any
|
parentRow: any
|
||||||
onCancel: 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 formRef = useRef<FormInstance>();
|
||||||
const draggleRef = React.createRef<any>()
|
const draggleRef = React.createRef<any>()
|
||||||
|
|
||||||
@ -102,18 +104,128 @@ const InventoryDetailModal = ({ onShow, parentRow, onCancel }: DetailProps) => {
|
|||||||
submitter={false}
|
submitter={false}
|
||||||
preserve={false}
|
preserve={false}
|
||||||
request={async () => {
|
request={async () => {
|
||||||
if (!parentRow?.INSALES_STATISTIC_ID) {
|
if (come === 'inventory') {
|
||||||
return {}
|
console.log('parentRowparentRowparentRowparentRow', parentRow);
|
||||||
}
|
const req: any = {
|
||||||
console.log('parentRowparentRowparentRowparentRow', parentRow);
|
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>
|
<Divider orientation="left">商品基本信息</Divider>
|
||||||
|
|||||||
@ -907,7 +907,7 @@ const InventoryDetails: React.FC<{ currentUser: CurrentUser, isComponents?: any,
|
|||||||
PageIndex: 1,
|
PageIndex: 1,
|
||||||
PageSize: 999999
|
PageSize: 999999
|
||||||
}
|
}
|
||||||
|
setSearchParams(fromRes)
|
||||||
console.log('reqreqreqreqreqreqreqreq', req);
|
console.log('reqreqreqreqreqreqreqreq', req);
|
||||||
} else if (isComponents) {
|
} else if (isComponents) {
|
||||||
req = {
|
req = {
|
||||||
@ -920,6 +920,7 @@ const InventoryDetails: React.FC<{ currentUser: CurrentUser, isComponents?: any,
|
|||||||
PageIndex: 1,
|
PageIndex: 1,
|
||||||
PageSize: 999999
|
PageSize: 999999
|
||||||
}
|
}
|
||||||
|
setSearchParams(params)
|
||||||
} else {
|
} else {
|
||||||
req = {
|
req = {
|
||||||
SearchParameter: {
|
SearchParameter: {
|
||||||
@ -930,9 +931,10 @@ const InventoryDetails: React.FC<{ currentUser: CurrentUser, isComponents?: any,
|
|||||||
PageIndex: 1,
|
PageIndex: 1,
|
||||||
PageSize: 999999
|
PageSize: 999999
|
||||||
}
|
}
|
||||||
|
setSearchParams(params)
|
||||||
}
|
}
|
||||||
|
|
||||||
setSearchParams(params)
|
|
||||||
const data = await handleGetINSALES_STATISTICList(req)
|
const data = await handleGetINSALES_STATISTICList(req)
|
||||||
console.log('dkasjdkajd', data);
|
console.log('dkasjdkajd', data);
|
||||||
if (data && data.length > 0) {
|
if (data && data.length > 0) {
|
||||||
@ -1046,7 +1048,7 @@ const InventoryDetails: React.FC<{ currentUser: CurrentUser, isComponents?: any,
|
|||||||
buttonText={'导出excel'}
|
buttonText={'导出excel'}
|
||||||
ref={downloadBtnRef}
|
ref={downloadBtnRef}
|
||||||
table="table-to-xls-InventoryDetails"
|
table="table-to-xls-InventoryDetails"
|
||||||
filename={`进销存明细报表${searchParams?.InventoryTime}`}
|
filename={`进销存明细报表${searchParams?.InventoryTime || ""}`}
|
||||||
sheet="sheet1"
|
sheet="sheet1"
|
||||||
/>
|
/>
|
||||||
</span>,
|
</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>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,6 +14,7 @@ import ReactHTMLTableToExcel from "react-html-table-to-excel";
|
|||||||
import LeftSelectTree from "@/pages/reports/settlementAccount/component/leftSelectTree";
|
import LeftSelectTree from "@/pages/reports/settlementAccount/component/leftSelectTree";
|
||||||
import PageTitleBox from "@/components/PageTitleBox";
|
import PageTitleBox from "@/components/PageTitleBox";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
|
import { handleGetMERCHANTSList, handleGetStorageBackSummary } from "../service";
|
||||||
|
|
||||||
|
|
||||||
const purchaseReceiving: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
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 [showExportTable, setShowExportTable] = useState<boolean>(false)
|
||||||
// 查询的条件
|
// 查询的条件
|
||||||
const [searchParams, setSearchParams] = useState<any>()
|
const [searchParams, setSearchParams] = useState<any>()
|
||||||
|
// 拿到服务区下的所有门店id集合
|
||||||
|
const [handleAllShopId, sethandleAllShopId] = useState<any>()
|
||||||
|
|
||||||
const columns: any = [
|
const columns: any = [
|
||||||
{
|
{
|
||||||
@ -47,8 +50,8 @@ const purchaseReceiving: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
search: {
|
search: {
|
||||||
transform: (value) => {
|
transform: (value) => {
|
||||||
return {
|
return {
|
||||||
OPERATE_DATE_Start: value[0],
|
StartDate: value[0],
|
||||||
OPERATE_DATE_End: value[1],
|
EndDate: value[1],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -62,69 +65,128 @@ const purchaseReceiving: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
},
|
},
|
||||||
initialValue: [moment().startOf('M'), moment()],
|
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: "序号",
|
title: "序号",
|
||||||
dataIndex: "index",
|
dataIndex: "index",
|
||||||
valueType: 'index',
|
valueType: 'index',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 80,
|
width: 90,
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "服务区名",
|
title: <div style={{ textAlign: 'center' }}>供应商/服务区名</div>,
|
||||||
dataIndex: "",
|
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',
|
align: 'center',
|
||||||
width: 150,
|
width: 150,
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "采购总数量",
|
title: <div style={{ textAlign: 'center' }}>商品名称</div>,
|
||||||
dataIndex: "",
|
dataIndex: "Commodity_Name",
|
||||||
align: 'center',
|
align: 'left',
|
||||||
width: 150,
|
width: 200,
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "采购含税金额",
|
title: <div style={{ textAlign: 'center' }}>采购总数量</div>,
|
||||||
dataIndex: "",
|
dataIndex: "Storage_Count",
|
||||||
align: 'center',
|
align: 'right',
|
||||||
width: 150,
|
valueType: 'digit',
|
||||||
|
width: 120,
|
||||||
|
sorter: true,
|
||||||
|
defaultSortOrder: 'descend',
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "采购除税金额",
|
title: <div style={{ textAlign: 'center' }}>采购含税金额</div>,
|
||||||
dataIndex: "",
|
dataIndex: "Storage_TaxAmount",
|
||||||
align: 'center',
|
align: 'right',
|
||||||
width: 150,
|
valueType: 'digit',
|
||||||
|
width: 120,
|
||||||
|
sorter: true,
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "入库总数量",
|
title: <div style={{ textAlign: 'center' }}>采购除税金额</div>,
|
||||||
dataIndex: "",
|
dataIndex: "Storage_Amount",
|
||||||
align: 'center',
|
align: 'right',
|
||||||
width: 150,
|
valueType: 'digit',
|
||||||
|
width: 120,
|
||||||
|
sorter: true,
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "入库含税金额",
|
title: <div style={{ textAlign: 'center' }}>退货数量</div>,
|
||||||
dataIndex: "",
|
dataIndex: "Back_Count",
|
||||||
align: 'center',
|
align: 'right',
|
||||||
width: 150,
|
valueType: 'digit',
|
||||||
|
width: 120,
|
||||||
|
sorter: true,
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "入库除税金额",
|
title: <div style={{ textAlign: 'center' }}>退货含税金额</div>,
|
||||||
dataIndex: "",
|
dataIndex: "Back_TaxAmount",
|
||||||
align: 'center',
|
align: 'right',
|
||||||
width: 150,
|
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,
|
ellipsis: true,
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
}
|
}
|
||||||
@ -152,6 +214,34 @@ const purchaseReceiving: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
tempTable.remove() // 防止重复打印一个内容
|
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 (
|
return (
|
||||||
<div ref={(el) => {
|
<div ref={(el) => {
|
||||||
@ -193,7 +283,7 @@ const purchaseReceiving: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
{
|
{
|
||||||
showExportTable && reqDetailList && reqDetailList.length > 0 ?
|
showExportTable && reqDetailList && reqDetailList.length > 0 ?
|
||||||
<ProTable
|
<ProTable
|
||||||
columns={columns}
|
columns={[...exportColumns, ...columns.slice(4, columns.length)]}
|
||||||
dataSource={reqDetailList}
|
dataSource={reqDetailList}
|
||||||
pagination={false}
|
pagination={false}
|
||||||
expandable={{
|
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 id='hiddenBox' style={{ position: 'fixed', zIndex: -1, top: 0, left: 0 }} />
|
||||||
|
|
||||||
<div style={{ backgroundColor: '#fff', display: 'flex' }}>
|
<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={{
|
<div style={{
|
||||||
width: !collapsible ? 'calc(100% - 300px)' : 'calc(100% - 60px)',
|
width: !collapsible ? 'calc(100% - 300px)' : 'calc(100% - 60px)',
|
||||||
paddingTop: 0,
|
paddingTop: 0,
|
||||||
@ -220,15 +310,82 @@ const purchaseReceiving: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
expandable={{
|
expandable={{
|
||||||
expandRowByClick: true
|
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)" }}
|
scroll={{ x: "100%", y: "calc(100vh - 410px)" }}
|
||||||
headerTitle={<PageTitleBox props={props} />} // 列表表头
|
headerTitle={<PageTitleBox props={props} />} // 列表表头
|
||||||
search={{ span: 6 }}
|
search={{ span: 6 }}
|
||||||
request={async (params) => {
|
request={async (params, sorter) => {
|
||||||
|
console.log('selectedIdselectedIdselectedId', selectedId);
|
||||||
|
|
||||||
if (!selectedId) {
|
if (!selectedId) {
|
||||||
return
|
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)
|
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={{
|
toolbar={{
|
||||||
actions: [
|
actions: [
|
||||||
@ -237,7 +394,7 @@ const purchaseReceiving: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
buttonText={'导出excel'}
|
buttonText={'导出excel'}
|
||||||
ref={downloadBtnRef}
|
ref={downloadBtnRef}
|
||||||
table="table-to-xls-purchaseReceiving"
|
table="table-to-xls-purchaseReceiving"
|
||||||
filename={`领用流程统计${searchParams?.StartDate}-${searchParams?.EndDate}`}
|
filename={`入库退货统计表${searchParams?.StartDate}-${searchParams?.EndDate}`}
|
||||||
sheet="sheet1"
|
sheet="sheet1"
|
||||||
/>
|
/>
|
||||||
</span>,
|
</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 PageTitleBox from "@/components/PageTitleBox";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import { handleGetSALESTOREPROINSTList } from "../service";
|
import { handleGetSALESTOREPROINSTList } from "../service";
|
||||||
|
import ReturnGoodsTable from "./components/returnGoodsTable";
|
||||||
|
|
||||||
|
|
||||||
const returnProcess: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
const returnProcess: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||||
@ -37,6 +38,11 @@ const returnProcess: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
// 查询的条件
|
// 查询的条件
|
||||||
const [searchParams, setSearchParams] = useState<any>()
|
const [searchParams, setSearchParams] = useState<any>()
|
||||||
|
|
||||||
|
// 显示配送单
|
||||||
|
const [onShow, setOnShow] = useState<boolean>(false)
|
||||||
|
// 当前行数据
|
||||||
|
const [currentRow, setCurrentRow] = useState<any>()
|
||||||
|
|
||||||
const columns: any = [
|
const columns: any = [
|
||||||
{
|
{
|
||||||
dataIndex: 'searchText',
|
dataIndex: 'searchText',
|
||||||
@ -123,13 +129,25 @@ const returnProcess: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
align: 'right',
|
align: 'right',
|
||||||
width: 150,
|
width: 150,
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
|
sorter: true,
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
|
render: (_, record) => {
|
||||||
|
return <a onClick={() => {
|
||||||
|
console.log('recordrecordrecord', record);
|
||||||
|
|
||||||
|
setCurrentRow(record)
|
||||||
|
setOnShow(true)
|
||||||
|
}}>
|
||||||
|
1
|
||||||
|
</a>
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: <div style={{ textAlign: 'center' }}>合计含税进价</div>,
|
title: <div style={{ textAlign: 'center' }}>合计含税进价</div>,
|
||||||
dataIndex: "合计含税进价",
|
dataIndex: "合计含税进价",
|
||||||
align: 'right',
|
align: 'right',
|
||||||
width: 150,
|
width: 150,
|
||||||
|
sorter: true,
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
},
|
},
|
||||||
@ -189,6 +207,11 @@ const returnProcess: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
tempTable.remove() // 防止重复打印一个内容
|
tempTable.remove() // 防止重复打印一个内容
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 关闭方法
|
||||||
|
const handleCloseModal = () => {
|
||||||
|
setCurrentRow(null)
|
||||||
|
setOnShow(false)
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div ref={(el) => {
|
<div ref={(el) => {
|
||||||
@ -260,13 +283,16 @@ const returnProcess: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
scroll={{ x: "100%", y: "calc(100vh - 410px)" }}
|
scroll={{ x: "100%", y: "calc(100vh - 410px)" }}
|
||||||
headerTitle={<PageTitleBox props={props} />} // 列表表头
|
headerTitle={<PageTitleBox props={props} />} // 列表表头
|
||||||
search={{ span: 6 }}
|
search={{ span: 6 }}
|
||||||
request={async (params) => {
|
request={async (params, sorter) => {
|
||||||
console.log('selectedIdselectedIdselectedId', selectedId);
|
|
||||||
console.log('paramsparamsparamsparamsparams', params);
|
|
||||||
|
|
||||||
if (!selectedId) {
|
if (!selectedId) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// 排序字段
|
||||||
|
const sortstr = Object.keys(sorter).map(n => {
|
||||||
|
const value = sorter[n]
|
||||||
|
return value ? `${n} ${value.replace('end', '')}` : ''
|
||||||
|
})
|
||||||
const req: any = {
|
const req: any = {
|
||||||
SearchParameter: {
|
SearchParameter: {
|
||||||
DEPT_IDS: selectedId,
|
DEPT_IDS: selectedId,
|
||||||
@ -274,13 +300,16 @@ const returnProcess: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
CREATEDATE_End: params.CREATEDATE_End || "",
|
CREATEDATE_End: params.CREATEDATE_End || "",
|
||||||
},
|
},
|
||||||
PageIndex: 1,
|
PageIndex: 1,
|
||||||
PageSize: 999999
|
PageSize: 999999,
|
||||||
|
sortstr: sortstr.length ? sortstr.toString() : "",
|
||||||
}
|
}
|
||||||
setSearchParams(params)
|
setSearchParams(params)
|
||||||
|
|
||||||
const data = await handleGetSALESTOREPROINSTList(req)
|
const data = await handleGetSALESTOREPROINSTList(req)
|
||||||
console.log('datadatadata', data);
|
console.log('datadatadata', data);
|
||||||
if (data && data.length > 0) {
|
if (data && data.length > 0) {
|
||||||
|
setReqDetailList(data)
|
||||||
|
|
||||||
return { data, success: true }
|
return { data, success: true }
|
||||||
}
|
}
|
||||||
return { data: [], success: true }
|
return { data: [], success: true }
|
||||||
@ -320,6 +349,9 @@ const returnProcess: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* 退货单 */}
|
||||||
|
<ReturnGoodsTable showDetail={onShow} parentRow={currentRow} onCencel={handleCloseModal} />
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import { wrapTreeNode } from "@/utils/format"
|
||||||
import request from "@/utils/request"
|
import request from "@/utils/request"
|
||||||
|
|
||||||
// 拿到盘存信息的数据
|
// 拿到盘存信息的数据
|
||||||
@ -150,3 +151,54 @@ export async function handleGetSALESTOREPROINSTList(params: any) {
|
|||||||
}
|
}
|
||||||
return data.Result_Data.List
|
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 = {}
|
let req: any = {}
|
||||||
if (currentRow?.CASHWORKER_ID) {
|
if (currentRow?.CASHWORKER_ID) {
|
||||||
req = {
|
req = {
|
||||||
|
...personDetail,
|
||||||
...res,
|
...res,
|
||||||
WORKER_OTHER: defaultAuthor,
|
WORKER_OTHER: defaultAuthor,
|
||||||
SERVERPART_CODE: SERVERPART_CODE
|
SERVERPART_CODE: SERVERPART_CODE
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
req = {
|
req = {
|
||||||
...personDetail,
|
|
||||||
...res,
|
...res,
|
||||||
WORKER_OTHER: defaultAuthor,
|
WORKER_OTHER: defaultAuthor,
|
||||||
SERVERPART_CODE: SERVERPART_CODE
|
SERVERPART_CODE: SERVERPART_CODE
|
||||||
@ -560,18 +560,27 @@ const servicePartAudit: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
<ProFormRadio.Group
|
||||||
|
name="POST"
|
||||||
|
options={[{ label: "现场稽查", value: "现场稽查" }, { label: "区域稽查", value: "区域稽查" }, { label: "公司稽查", value: "公司稽查" }]}
|
||||||
|
/>
|
||||||
|
|
||||||
<Divider orientation="left" plain>人员权限</Divider>
|
<Divider orientation="left" plain>人员权限</Divider>
|
||||||
|
|
||||||
<ProFormCheckbox.Group
|
<ProFormCheckbox.Group
|
||||||
name="WORKER_OTHER"
|
name="WORKER_OTHER"
|
||||||
request={() => {
|
request={() => {
|
||||||
console.log('PROWERSET', PROWERSET);
|
console.log('PROWERSET', PROWERSET);
|
||||||
|
let list: any = []
|
||||||
if (PROWERSET && PROWERSET.length > 0) {
|
if (PROWERSET && PROWERSET.length > 0) {
|
||||||
PROWERSET.forEach((item: any) => {
|
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={[
|
// options={[
|
||||||
// { label: '销售', value: 1 },
|
// { label: '销售', value: 1 },
|
||||||
|
|||||||
@ -141,69 +141,38 @@ const warehouseInfo = ({ onShow, parentRow, onCencel }: DetailProps) => {
|
|||||||
const exportTable = (e) => {
|
const exportTable = (e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
||||||
const main = document.getElementsByClassName(`saleReportHideBox${printIndex}`)[0];
|
const main = document.getElementsByClassName(`warehouseInfo${printIndex}`)[0];
|
||||||
const originHead = main.querySelector('thead').cloneNode(true);
|
const thead = main.querySelector('thead').cloneNode(true);
|
||||||
const originBody = main.querySelector('tbody').cloneNode(true);
|
const tbody = main.querySelector('tbody').cloneNode(true);
|
||||||
|
const tfoot = main.querySelector('tfoot').cloneNode(true); // 深克隆DOM节点
|
||||||
const container = document.querySelector('#hiddenBox');
|
const container = document.querySelector('#hiddenBox');
|
||||||
|
|
||||||
const tempTable = document.createElement('table');
|
const tempTable = document.createElement('table');
|
||||||
tempTable.setAttribute('id', 'table-to-xls-warehouseInfo');
|
|
||||||
|
|
||||||
// 标题
|
const title = document.createElement('div');
|
||||||
const caption = document.createElement('caption');
|
title.innerText = `${currentModalDetail?.SERVERPART_NAME || ''}${currentModalDetail?.SHOPNAME || ''}入库单`;
|
||||||
caption.innerText = `${currentModalDetail?.SERVERPART_NAME || ''}${currentModalDetail?.SHOPNAME || ''}入库单`;
|
title.setAttribute('style', 'width:100%;text-align:center;font-size:20px;font-weight: 600;')
|
||||||
caption.style.fontSize = '20px';
|
|
||||||
caption.style.fontWeight = '600';
|
|
||||||
caption.style.padding = '10px 0';
|
|
||||||
tempTable.appendChild(caption);
|
|
||||||
|
|
||||||
const exportHead = document.createElement('thead');
|
tempTable.appendChild(title);
|
||||||
const mkTh = (text) => {
|
tempTable.appendChild(thead);
|
||||||
const th = document.createElement('th');
|
tempTable.appendChild(tfoot);
|
||||||
th.innerText = text || '';
|
tempTable.appendChild(tbody);
|
||||||
th.style.textAlign = 'left';
|
|
||||||
return th;
|
|
||||||
};
|
|
||||||
const mkEmpty = () => document.createElement('th'); // 空单元格
|
|
||||||
|
|
||||||
// 第一行:单号 + 空格 + 数量 + 空格 + 金额 + 空格 + 时间
|
tempTable.setAttribute('id', 'table-to-xls-warehouseInfo'); // 给table添加id,值与按钮上的table字段对应
|
||||||
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 ?? ''}`));
|
|
||||||
|
|
||||||
// 第二行:采购说明(跨满所有列)
|
container.appendChild(tempTable); // 把创建的节点添加到页面容器中
|
||||||
const row2 = document.createElement('tr');
|
|
||||||
const noteTh = mkTh(`采购说明:${parentRow?.RECEIVESERVERPART_DESC ?? ''}`);
|
|
||||||
noteTh.colSpan = 7; // 跨前面 7 列
|
|
||||||
row2.appendChild(noteTh);
|
|
||||||
|
|
||||||
exportHead.appendChild(row1);
|
setShowLoading(false)
|
||||||
exportHead.appendChild(row2);
|
|
||||||
|
|
||||||
// 原始表头列标题
|
|
||||||
Array.from(originHead.rows).forEach(r => exportHead.appendChild(r));
|
|
||||||
|
|
||||||
tempTable.appendChild(exportHead);
|
|
||||||
tempTable.appendChild(originBody);
|
|
||||||
|
|
||||||
container.appendChild(tempTable);
|
|
||||||
|
|
||||||
setShowLoading(false);
|
|
||||||
downloadBtnRef.current.handleDownload();
|
downloadBtnRef.current.handleDownload();
|
||||||
|
setShowExportTable(false)
|
||||||
|
tempTable.remove() // 防止重复打印一个内容
|
||||||
|
|
||||||
setShowExportTable(false);
|
|
||||||
tempTable.remove();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<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 ?
|
showExportTable && reqDetailList && reqDetailList.length > 0 ?
|
||||||
<ProTable
|
<ProTable
|
||||||
@ -283,7 +252,7 @@ const warehouseInfo = ({ onShow, parentRow, onCencel }: DetailProps) => {
|
|||||||
formRef={formRef}
|
formRef={formRef}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
bordered
|
bordered
|
||||||
scroll={{ x: '100%', y: 300 }}
|
scroll={{ x: '100%', y: 270 }}
|
||||||
search={false}
|
search={false}
|
||||||
options={false}
|
options={false}
|
||||||
request={async (params) => {
|
request={async (params) => {
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import React, { useRef, useState } from "react";
|
|||||||
import ProCard from "@ant-design/pro-card";
|
import ProCard from "@ant-design/pro-card";
|
||||||
import { MenuFoldOutlined } from "@ant-design/icons";
|
import { MenuFoldOutlined } from "@ant-design/icons";
|
||||||
import type { FormInstance } from "antd";
|
import type { FormInstance } from "antd";
|
||||||
import { 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 useRequest from "@ahooksjs/use-request";
|
||||||
import { getServerpartTree } from "@/services/options";
|
import { getServerpartTree } from "@/services/options";
|
||||||
import type { ActionType } from "@ant-design/pro-table";
|
import type { ActionType } from "@ant-design/pro-table";
|
||||||
@ -24,6 +24,7 @@ import { getMyShopList } from "@/pages/account/center/sevice";
|
|||||||
import { handleGetRECEIVESERVERPARTList } from "../service";
|
import { handleGetRECEIVESERVERPARTList } from "../service";
|
||||||
import WarehouseInfo from "./components/warehouseInfo";
|
import WarehouseInfo from "./components/warehouseInfo";
|
||||||
|
|
||||||
|
const { Text } = Typography;
|
||||||
|
|
||||||
const shopProcurement: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
const shopProcurement: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||||
const { currentUser } = props
|
const { currentUser } = props
|
||||||
@ -53,6 +54,12 @@ const shopProcurement: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
// 是否显示打印的表格
|
// 是否显示打印的表格
|
||||||
const [showExportTable, setShowExportTable] = useState<boolean>(false)
|
const [showExportTable, setShowExportTable] = useState<boolean>(false)
|
||||||
const [reqDetailList, setReqDetailList] = useState<any>(); // 合计项数据源
|
const [reqDetailList, setReqDetailList] = useState<any>(); // 合计项数据源
|
||||||
|
// 表格的合计值
|
||||||
|
const [tableSumObj, setTableSumObj] = useState<any>();
|
||||||
|
// 表格加载效果
|
||||||
|
const [tableLoading, setTableLoading] = useState<boolean>(false)
|
||||||
|
|
||||||
|
|
||||||
const onDraggaleStart = (event, uiData) => {
|
const onDraggaleStart = (event, uiData) => {
|
||||||
const { clientWidth, clientHeight } = window.document.documentElement;
|
const { clientWidth, clientHeight } = window.document.documentElement;
|
||||||
const targetRect = draggleRef.current?.getBoundingClientRect();
|
const targetRect = draggleRef.current?.getBoundingClientRect();
|
||||||
@ -104,7 +111,7 @@ const shopProcurement: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
title: '查询内容',
|
title: '查询内容',
|
||||||
hideInTable: true,
|
hideInTable: true,
|
||||||
fieldProps: {
|
fieldProps: {
|
||||||
placeholder: "请输入商品名称/商品条码"
|
placeholder: "请输入商品名称/入库单号"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -218,6 +225,9 @@ const shopProcurement: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
align: 'right',
|
align: 'right',
|
||||||
valueType: 'digit',
|
valueType: 'digit',
|
||||||
width: 120,
|
width: 120,
|
||||||
|
sorter: true,
|
||||||
|
// sorter: (a, b) => a.RECEIVE_TOTALCOUNT - b.RECEIVE_TOTALCOUNT,
|
||||||
|
defaultSortOrder: 'descend',
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
},
|
},
|
||||||
@ -227,6 +237,8 @@ const shopProcurement: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
align: 'right',
|
align: 'right',
|
||||||
valueType: 'digit',
|
valueType: 'digit',
|
||||||
width: 120,
|
width: 120,
|
||||||
|
sorter: true,
|
||||||
|
// sorter: (a, b) => a.RECEIVE_TOTALPRICE - b.RECEIVE_TOTALPRICE,
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
},
|
},
|
||||||
@ -235,6 +247,8 @@ const shopProcurement: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
dataIndex: "RECEIVECENTER_DATE",
|
dataIndex: "RECEIVECENTER_DATE",
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 150,
|
width: 150,
|
||||||
|
sorter: true,
|
||||||
|
// sorter: (a, b) => new Date(a?.RECEIVECENTER_DATE).getTime() - new Date(b?.RECEIVECENTER_DATE).getTime(),
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
},
|
},
|
||||||
@ -372,29 +386,52 @@ const shopProcurement: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
expandable={{
|
expandable={{
|
||||||
expandRowByClick: true
|
expandRowByClick: true
|
||||||
}}
|
}}
|
||||||
scroll={{ x: "100%", y: "calc(100vh - 450px)" }}
|
loading={tableLoading}
|
||||||
|
scroll={{ x: "100%", y: "calc(100vh - 520px)" }}
|
||||||
headerTitle={<PageTitleBox props={props} />} // 列表表头
|
headerTitle={<PageTitleBox props={props} />} // 列表表头
|
||||||
search={{ span: 6, defaultCollapsed: false }} // 查询表单
|
search={{ span: 6, defaultCollapsed: false }} // 查询表单
|
||||||
request={async (params) => {
|
request={async (params, sorter) => {
|
||||||
if (!selectedId) {
|
if (!selectedId) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// 排序字段
|
||||||
|
const sortstr = Object.keys(sorter).map(n => {
|
||||||
|
const value = sorter[n]
|
||||||
|
return value ? `${n} ${value.replace('end', '')}` : ''
|
||||||
|
})
|
||||||
const req: any = {
|
const req: any = {
|
||||||
SearchParameter: {
|
SearchParameter: {
|
||||||
SERVERPARTSHOP_IDS: selectedId,
|
SERVERPARTSHOP_IDS: selectedId,
|
||||||
RECEIVECENTER_DATE_Start: params?.RECEIVECENTER_DATE_Start || "",
|
RECEIVECENTER_DATE_Start: params?.RECEIVECENTER_DATE_Start || "",
|
||||||
RECEIVECENTER_DATE_End: params?.RECEIVECENTER_DATE_End || "",
|
RECEIVECENTER_DATE_End: params?.RECEIVECENTER_DATE_End || "",
|
||||||
},
|
},
|
||||||
|
keyWord: {
|
||||||
|
Key: 'RECEIVECENTER_CODE',
|
||||||
|
Value: params?.searchText || ''
|
||||||
|
},
|
||||||
PageIndex: 1,
|
PageIndex: 1,
|
||||||
PageSize: 999999
|
PageSize: 999999,
|
||||||
|
sortstr: sortstr.length ? sortstr.toString() : "",
|
||||||
}
|
}
|
||||||
|
|
||||||
setSearchParams(params)
|
setSearchParams(params)
|
||||||
|
setTableLoading(true)
|
||||||
const data = await handleGetRECEIVESERVERPARTList(req)
|
const data = await handleGetRECEIVESERVERPARTList(req)
|
||||||
|
setTableLoading(false)
|
||||||
console.log('表格数据', data);
|
console.log('表格数据', data);
|
||||||
setReqDetailList(data)
|
setReqDetailList(data)
|
||||||
if (data && data.length > 0) {
|
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 }
|
||||||
}
|
}
|
||||||
return { data: [], success: true }
|
return { data: [], success: true }
|
||||||
@ -434,6 +471,58 @@ const shopProcurement: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
// }}>填写申请</Button>
|
// }}>填写申请</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>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -44,7 +44,7 @@ const ContractDetail = ({ tableData, detail }: DetailProps) => {
|
|||||||
dataIndex: 'COMPACT_NAME',
|
dataIndex: 'COMPACT_NAME',
|
||||||
width: 300,
|
width: 300,
|
||||||
render: (_, record) => {
|
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)
|
setCurrentRow(record)
|
||||||
setContractDrawer(true)
|
setContractDrawer(true)
|
||||||
}}>
|
}}>
|
||||||
@ -90,7 +90,7 @@ const ContractDetail = ({ tableData, detail }: DetailProps) => {
|
|||||||
console.log('detail', detail);
|
console.log('detail', detail);
|
||||||
let req: any = {
|
let req: any = {
|
||||||
SearchParameter: {
|
SearchParameter: {
|
||||||
SERVERPARTSHOP_ID: detail?.SERVERPARTSHOP_ID,
|
SERVERPARTSHOP_ID: detail?.SERVERPARTSHOP_ID || detail?.PropertyShop.SERVERPARTSHOP_ID,
|
||||||
PROJECT_VALID: 1
|
PROJECT_VALID: 1
|
||||||
},
|
},
|
||||||
PageIndex: 1,
|
PageIndex: 1,
|
||||||
|
|||||||
@ -51,6 +51,8 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) =>
|
|||||||
const [relatedShop, setRelatedShop] = useState<any>()
|
const [relatedShop, setRelatedShop] = useState<any>()
|
||||||
// 选择的门店id数组
|
// 选择的门店id数组
|
||||||
const [selectShop, setSelectShop] = useState<any>()
|
const [selectShop, setSelectShop] = useState<any>()
|
||||||
|
// 显示的人员权限可以选择的内容
|
||||||
|
const [showPROWERSETList, setShowPROWERSETList] = useState<any>()
|
||||||
|
|
||||||
const { loading: PROWERSETLoading, data: PROWERSET } = useRequest(async () => {
|
const { loading: PROWERSETLoading, data: PROWERSET } = useRequest(async () => {
|
||||||
const data = await getFieldEnum({ FieldExplainField: 'PROWERSET' })
|
const data = await getFieldEnum({ FieldExplainField: 'PROWERSET' })
|
||||||
@ -362,7 +364,6 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) =>
|
|||||||
<div>
|
<div>
|
||||||
<Button type='primary' style={{ marginRight: '16px' }} onClick={() => {
|
<Button type='primary' style={{ marginRight: '16px' }} onClick={() => {
|
||||||
editFormRef.current?.validateFields().then(async (res) => {
|
editFormRef.current?.validateFields().then(async (res) => {
|
||||||
|
|
||||||
// 根据当前的服务区 去拿个code
|
// 根据当前的服务区 去拿个code
|
||||||
const code = await handleNewGetSERVERPARTDetail({ SERVERPARTId: res.SERVERPART_ID })
|
const code = await handleNewGetSERVERPARTDetail({ SERVERPARTId: res.SERVERPART_ID })
|
||||||
console.log('codecodecodecode', code);
|
console.log('codecodecodecode', code);
|
||||||
@ -385,13 +386,14 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) =>
|
|||||||
let req: any = {}
|
let req: any = {}
|
||||||
if (currentRow?.CASHWORKER_ID) {
|
if (currentRow?.CASHWORKER_ID) {
|
||||||
req = {
|
req = {
|
||||||
|
...personDetail,
|
||||||
...res,
|
...res,
|
||||||
WORKER_OTHER: defaultAuthor,
|
WORKER_OTHER: defaultAuthor,
|
||||||
SERVERPART_CODE: SERVERPART_CODE
|
SERVERPART_CODE: SERVERPART_CODE
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
req = {
|
req = {
|
||||||
...personDetail,
|
|
||||||
...res,
|
...res,
|
||||||
WORKER_OTHER: defaultAuthor,
|
WORKER_OTHER: defaultAuthor,
|
||||||
SERVERPART_CODE: SERVERPART_CODE
|
SERVERPART_CODE: SERVERPART_CODE
|
||||||
@ -494,6 +496,36 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) =>
|
|||||||
message: '请选择人员类别',
|
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>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
@ -561,15 +593,16 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) =>
|
|||||||
<Divider orientation="left" plain>人员权限</Divider>
|
<Divider orientation="left" plain>人员权限</Divider>
|
||||||
<ProFormCheckbox.Group
|
<ProFormCheckbox.Group
|
||||||
name="WORKER_OTHER"
|
name="WORKER_OTHER"
|
||||||
request={() => {
|
options={showPROWERSETList}
|
||||||
console.log('PROWERSET', PROWERSET);
|
// request={() => {
|
||||||
if (PROWERSET && PROWERSET.length > 0) {
|
// if (PROWERSET && PROWERSET.length > 0) {
|
||||||
PROWERSET.forEach((item: any) => {
|
// PROWERSET.forEach((item: any) => {
|
||||||
item.value = item.value.toString()
|
// item.value = item.value.toString()
|
||||||
})
|
// })
|
||||||
}
|
// }
|
||||||
return PROWERSET
|
// console.log('PROWERSET', PROWERSET);
|
||||||
}}
|
// return PROWERSET
|
||||||
|
// }}
|
||||||
// options={[
|
// options={[
|
||||||
// { label: '销售', value: 1 },
|
// { label: '销售', value: 1 },
|
||||||
// { label: '退货', value: 2 },
|
// { label: '退货', value: 2 },
|
||||||
|
|||||||
@ -253,7 +253,6 @@ const ConvenienceStoreProductReview: React.FC<{ currentUser: CurrentUser }> = (p
|
|||||||
let list: any = JSON.parse(JSON.stringify(selectedModalOrderRowKeys))
|
let list: any = JSON.parse(JSON.stringify(selectedModalOrderRowKeys))
|
||||||
console.log('listlistlist', list);
|
console.log('listlistlist', list);
|
||||||
console.log('tableDatatableDatatableData', tableData);
|
console.log('tableDatatableDatatableData', tableData);
|
||||||
|
|
||||||
let reqList: any = []
|
let reqList: any = []
|
||||||
// 判断是不是所有的价格都已经输入了
|
// 判断是不是所有的价格都已经输入了
|
||||||
let isAllOk: boolean = true
|
let isAllOk: boolean = true
|
||||||
@ -261,6 +260,9 @@ const ConvenienceStoreProductReview: React.FC<{ currentUser: CurrentUser }> = (p
|
|||||||
let noPriceName: string = ''
|
let noPriceName: string = ''
|
||||||
tableData.forEach((item: any) => {
|
tableData.forEach((item: any) => {
|
||||||
if (list.indexOf(item.COMMODITY_ID.toString()) !== -1) {
|
if (list.indexOf(item.COMMODITY_ID.toString()) !== -1) {
|
||||||
|
if (item.COMMODITY_TYPE === '普通商品') {
|
||||||
|
item.COMMODITY_TYPE = 1012
|
||||||
|
}
|
||||||
reqList.push(item)
|
reqList.push(item)
|
||||||
}
|
}
|
||||||
if (!item.COMMODITY_CURRPRICE) {
|
if (!item.COMMODITY_CURRPRICE) {
|
||||||
|
|||||||
@ -129,23 +129,23 @@ const commodityInfo: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
request: async () => {
|
request: async () => {
|
||||||
// const data = await getServerpartOption(340000)
|
// const data = await getServerpartOption(340000)
|
||||||
// return data
|
// return data
|
||||||
const serverpartList: any = session.get('serverpartList')
|
const ServerpartIdsTree: any = session.get('ServerpartIdsTree')
|
||||||
let serverpartId: string = ''
|
// let serverpartId: string = ''
|
||||||
if (serverpartList && serverpartList.length > 0) {
|
// if (serverpartList && serverpartList.length > 0) {
|
||||||
serverpartList.forEach((item: any) => {
|
// serverpartList.forEach((item: any) => {
|
||||||
if (serverpartId) {
|
// if (serverpartId) {
|
||||||
serverpartId += `,${item.value}`
|
// serverpartId += `,${item.value}`
|
||||||
} else {
|
// } else {
|
||||||
serverpartId = item.value
|
// serverpartId = item.value
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
}
|
// }
|
||||||
|
|
||||||
// serverpartList.unshift({
|
// serverpartList.unshift({
|
||||||
// label: "全部",
|
// label: "全部",
|
||||||
// value: ''
|
// value: ''
|
||||||
// })
|
// })
|
||||||
return serverpartList
|
return ServerpartIdsTree
|
||||||
},
|
},
|
||||||
fieldProps: {
|
fieldProps: {
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
@ -364,7 +364,7 @@ const commodityInfo: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
// 拿到对应的商品业态
|
// 拿到对应的商品业态
|
||||||
const handleGetCommodity = async (id: any) => {
|
const handleGetCommodity = async (id: any) => {
|
||||||
const req: any = {
|
const req: any = {
|
||||||
ProvinceCode: currentUser?.USER_PROVINCE,
|
ProvinceCode: currentUser?.ProvinceCode,
|
||||||
ServerpartId: id
|
ServerpartId: id
|
||||||
}
|
}
|
||||||
const data = await handleGetServerpartShopTrade(req)
|
const data = await handleGetServerpartShopTrade(req)
|
||||||
@ -455,7 +455,7 @@ const commodityInfo: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
setCollapsible(!collapsible)
|
setCollapsible(!collapsible)
|
||||||
}} />}
|
}} />}
|
||||||
colSpan={!collapsible ? "300px" : "60px"}
|
colSpan={!collapsible ? "300px" : "60px"}
|
||||||
title={!collapsible ? "请选择服务区" : ""}
|
title={!collapsible ? "请选择商品类别" : ""}
|
||||||
headerBordered
|
headerBordered
|
||||||
collapsed={collapsible}
|
collapsed={collapsible}
|
||||||
>
|
>
|
||||||
@ -610,21 +610,23 @@ const commodityInfo: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
name="SERVERPART_ID"
|
name="SERVERPART_ID"
|
||||||
label="服务区名"
|
label="服务区名"
|
||||||
request={async () => {
|
request={async () => {
|
||||||
const data = await getServerpartTree(currentUser?.ProvinceCode, currentUser?.CityAuthority, true, true, true)
|
const ServerpartIdsTree: any = session.get('ServerpartIdsTree')
|
||||||
const list: any = []
|
|
||||||
if (data && data.length > 0) {
|
// const data = await getServerpartTree(currentUser?.ProvinceCode, currentUser?.CityAuthority, true, true, true)
|
||||||
data.forEach((item: any) => {
|
// const list: any = []
|
||||||
if (item.children && item.children.length > 0) {
|
// if (data && data.length > 0) {
|
||||||
item.children.forEach((subItem: any) => {
|
// data.forEach((item: any) => {
|
||||||
list.push({ label: subItem.label, value: subItem.value })
|
// 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 })
|
// })
|
||||||
})
|
// data.forEach((item: any) => {
|
||||||
}
|
// list.push({ label: item.label, value: item.value })
|
||||||
return list
|
// })
|
||||||
|
// }
|
||||||
|
return ServerpartIdsTree
|
||||||
}}
|
}}
|
||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
|
|||||||
@ -123,8 +123,8 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
request: async () => {
|
request: async () => {
|
||||||
// const data = await getServerpartOption(currentUser?.ProvinceCode)
|
// const data = await getServerpartOption(currentUser?.ProvinceCode)
|
||||||
// console.log('datadatadatadata', data);
|
// console.log('datadatadatadata', data);
|
||||||
const serverpartList: any = session.get('serverpartList')
|
const ServerpartIdsTree: any = session.get('ServerpartIdsTree')
|
||||||
return serverpartList
|
return ServerpartIdsTree
|
||||||
},
|
},
|
||||||
fieldProps: {
|
fieldProps: {
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
@ -364,7 +364,7 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
setCollapsible(!collapsible)
|
setCollapsible(!collapsible)
|
||||||
}} />}
|
}} />}
|
||||||
colSpan={!collapsible ? "300px" : "60px"}
|
colSpan={!collapsible ? "300px" : "60px"}
|
||||||
title={!collapsible ? "请选择服务区" : ""}
|
title={!collapsible ? "请选择商品类别" : ""}
|
||||||
headerBordered
|
headerBordered
|
||||||
collapsed={collapsible}
|
collapsed={collapsible}
|
||||||
>
|
>
|
||||||
|
|||||||
@ -1,14 +1,15 @@
|
|||||||
import {connect} from "umi";
|
// 商品快捷键管理
|
||||||
import type {CurrentUser} from "umi";
|
import { connect } from "umi";
|
||||||
import type {ConnectState} from "@/models/connect";
|
import type { CurrentUser } from "umi";
|
||||||
import React, {useRef, useState} from "react";
|
import type { ConnectState } from "@/models/connect";
|
||||||
|
import React, { useRef, useState } from "react";
|
||||||
import ProCard from "@ant-design/pro-card";
|
import ProCard from "@ant-design/pro-card";
|
||||||
import {MenuFoldOutlined} from "@ant-design/icons";
|
import { MenuFoldOutlined } from "@ant-design/icons";
|
||||||
import type {FormInstance} from "antd";
|
import type { FormInstance } from "antd";
|
||||||
import {Avatar, Button, Drawer, Menu, message, Space, Spin, Tree} from "antd";
|
import { Avatar, Button, Drawer, Menu, message, Space, Spin, Tree } from "antd";
|
||||||
import useRequest from "@ahooksjs/use-request";
|
import useRequest from "@ahooksjs/use-request";
|
||||||
import {getFieldEnum, getServerpartTree, handleCallLogs} from "@/services/options";
|
import { getFieldEnum, getServerpartTree, handleCallLogs } from "@/services/options";
|
||||||
import type {ActionType} from "@ant-design/pro-table";
|
import type { ActionType } from "@ant-design/pro-table";
|
||||||
import ProTable from "@ant-design/pro-table";
|
import ProTable from "@ant-design/pro-table";
|
||||||
import ReactHTMLTableToExcel from "react-html-table-to-excel";
|
import ReactHTMLTableToExcel from "react-html-table-to-excel";
|
||||||
import {
|
import {
|
||||||
@ -22,7 +23,7 @@ import Detail from "@/pages/reports/productControl/components/detail";
|
|||||||
import PageTitleBox from "@/components/PageTitleBox";
|
import PageTitleBox from "@/components/PageTitleBox";
|
||||||
|
|
||||||
|
|
||||||
const hotkeyset: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
const hotkeyset: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||||
const { currentUser } = props
|
const { currentUser } = props
|
||||||
const downloadBtnRef = useRef<any>()
|
const downloadBtnRef = useRef<any>()
|
||||||
const actionRef = useRef<ActionType>();
|
const actionRef = useRef<ActionType>();
|
||||||
@ -30,8 +31,8 @@ const hotkeyset: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
|||||||
const [reqDetailList, setReqDetailList] = useState<any>(); // 合计项数据源
|
const [reqDetailList, setReqDetailList] = useState<any>(); // 合计项数据源
|
||||||
const [printOut, setPrintOut] = useState<any>(); // 打印数据的内容
|
const [printOut, setPrintOut] = useState<any>(); // 打印数据的内容
|
||||||
const [collapsible, setCollapsible] = useState<boolean>(false)
|
const [collapsible, setCollapsible] = useState<boolean>(false)
|
||||||
const [treeView,setTreeView] = useState<any>()
|
const [treeView, setTreeView] = useState<any>()
|
||||||
const [detailTreeView,setDetailTreeView] = useState<any>()
|
const [detailTreeView, setDetailTreeView] = useState<any>()
|
||||||
// 加载服务区树
|
// 加载服务区树
|
||||||
const { loading: treeLoading, data: treeViews } = useRequest(async () => {
|
const { loading: treeLoading, data: treeViews } = useRequest(async () => {
|
||||||
const data = await getServerpartTree(currentUser?.ProvinceCode, currentUser?.CityAuthority, true, true, true)
|
const data = await getServerpartTree(currentUser?.ProvinceCode, currentUser?.CityAuthority, true, true, true)
|
||||||
@ -49,35 +50,39 @@ const hotkeyset: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
|||||||
setDetailTreeView(data)
|
setDetailTreeView(data)
|
||||||
return data
|
return data
|
||||||
})
|
})
|
||||||
// 树相关的属性和方法
|
// 树相关的属性和方法
|
||||||
const [selectedId, setSelectedId] = useState<string>()
|
const [selectedId, setSelectedId] = useState<string>()
|
||||||
// 导出的加载效果
|
// 导出的加载效果
|
||||||
const [showLoading,setShowLoading] = useState<boolean>(false)
|
const [showLoading, setShowLoading] = useState<boolean>(false)
|
||||||
// 是否显示打印的表格
|
// 是否显示打印的表格
|
||||||
const [showExportTable,setShowExportTable] = useState<boolean>(false)
|
const [showExportTable, setShowExportTable] = useState<boolean>(false)
|
||||||
const [currenMenu, setCurrenMenu] = useState<any>(); // 当前选中左侧菜单的服务区节点
|
const [currenMenu, setCurrenMenu] = useState<any>(); // 当前选中左侧菜单的服务区节点
|
||||||
const [commodityList,setCommodityList] = useState<any>()
|
const [commodityList, setCommodityList] = useState<any>()
|
||||||
const [showDetail,setShowDetail] = useState<boolean>(false)
|
const [showDetail, setShowDetail] = useState<boolean>(false)
|
||||||
const [currentRow,setCurrentRow] = useState<any>()
|
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 = [
|
const columns: any = [
|
||||||
{
|
{
|
||||||
title:'商品业态',
|
title: '商品业态',
|
||||||
dataIndex: 'ShopTrade',
|
dataIndex: 'ShopTrade',
|
||||||
hideInTable: true,
|
hideInTable: true,
|
||||||
valueType: 'select',
|
valueType: 'select',
|
||||||
// initialValue: '1000',
|
// initialValue: '1000',
|
||||||
valueEnum: commodityList,
|
valueEnum: commodityList,
|
||||||
|
fieldProps: {
|
||||||
|
showSearch: true,
|
||||||
|
filterOption: (input: any, option: any) => (option?.label ?? '').toLowerCase().includes(input.toLowerCase()),
|
||||||
|
},
|
||||||
// request: async () => {
|
// request: async () => {
|
||||||
// return await getFieldEnum({ FieldExplainField: 'BUSINESSTYPE', sessionName: 'SHOPTRADE', notformate: true })
|
// return await getFieldEnum({ FieldExplainField: 'BUSINESSTYPE', sessionName: 'SHOPTRADE', notformate: true })
|
||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title:'商品状态',
|
title: '商品状态',
|
||||||
dataIndex: 'CommodityState',
|
dataIndex: 'CommodityState',
|
||||||
hideInTable: true,
|
hideInTable: true,
|
||||||
valueType: 'select',
|
valueType: 'select',
|
||||||
@ -86,48 +91,48 @@ const hotkeyset: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
|||||||
initialValue: '1'
|
initialValue: '1'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title:'序号',
|
title: '序号',
|
||||||
width: 70,
|
width: 70,
|
||||||
dataIndex: 'index',
|
dataIndex: 'index',
|
||||||
valueType: 'index',
|
valueType: 'index',
|
||||||
hieInSearch: true
|
hieInSearch: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title:<div style={{textAlign:'center'}}>快捷键</div>,
|
title: <div style={{ textAlign: 'center' }}>快捷键</div>,
|
||||||
dataIndex: 'COMMODITY_HOTKEY',
|
dataIndex: 'COMMODITY_HOTKEY',
|
||||||
width: 90,
|
width: 90,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
render:(_,record)=>{
|
render: (_, record) => {
|
||||||
return record?.COMMODITY_HOTKEY && record?.COMMODITY_HOTKEY!==""?
|
return record?.COMMODITY_HOTKEY && record?.COMMODITY_HOTKEY !== "" ?
|
||||||
<a style={{cursor:'pointer'}} onClick={()=>{
|
<a style={{ cursor: 'pointer' }} onClick={() => {
|
||||||
setCurrentRow(record)
|
setCurrentRow(record)
|
||||||
setShowHotKeyEdit(true)
|
setShowHotKeyEdit(true)
|
||||||
setShowDetail(true)
|
setShowDetail(true)
|
||||||
}}>{record?.COMMODITY_HOTKEY}</a>:
|
}}>{record?.COMMODITY_HOTKEY}</a> :
|
||||||
<span onClick={()=>{
|
<span onClick={() => {
|
||||||
setCurrentRow(record)
|
setCurrentRow(record)
|
||||||
setShowHotKeyEdit(true)
|
setShowHotKeyEdit(true)
|
||||||
setShowDetail(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',
|
dataIndex: 'COMMODITY_BARCODE',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
width: 120,
|
width: 120,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title:<div style={{textAlign:'center'}}>商品名称</div>,
|
title: <div style={{ textAlign: 'center' }}>商品名称</div>,
|
||||||
dataIndex: 'COMMODITY_NAME',
|
dataIndex: 'COMMODITY_NAME',
|
||||||
width: 200,
|
width: 200,
|
||||||
ellipsis:true,
|
ellipsis: true,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
render:(_,record)=>{
|
render: (_, record) => {
|
||||||
return <a onClick={()=>{
|
return <a onClick={() => {
|
||||||
setCurrentRow(record)
|
setCurrentRow(record)
|
||||||
setShowDetail(true)
|
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',
|
dataIndex: 'COMMODITY_UNIT',
|
||||||
width: 100,
|
width: 100,
|
||||||
ellipsis:true,
|
ellipsis: true,
|
||||||
align: 'right',
|
align: 'right',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title:<div style={{textAlign:'center'}}>商品规格</div>,
|
title: <div style={{ textAlign: 'center' }}>商品规格</div>,
|
||||||
dataIndex: 'COMMODITY_RULE',
|
dataIndex: 'COMMODITY_RULE',
|
||||||
width: 100,
|
width: 100,
|
||||||
ellipsis:true,
|
ellipsis: true,
|
||||||
align: 'right',
|
align: 'right',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title:<div style={{textAlign:'center'}}>零售价格</div>,
|
title: <div style={{ textAlign: 'center' }}>零售价格</div>,
|
||||||
dataIndex: 'COMMODITY_RETAILPRICE',
|
dataIndex: 'COMMODITY_RETAILPRICE',
|
||||||
width: 100,
|
width: 100,
|
||||||
ellipsis:true,
|
ellipsis: true,
|
||||||
align: 'right',
|
align: 'right',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title:<div style={{textAlign:'center'}}>商品业态</div>,
|
title: <div style={{ textAlign: 'center' }}>商品业态</div>,
|
||||||
dataIndex: 'BUSINESSTYPE',
|
dataIndex: 'BUSINESSTYPE',
|
||||||
width: 100,
|
width: 100,
|
||||||
ellipsis:true,
|
ellipsis: true,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
valueType: 'select',
|
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',
|
dataIndex: 'COMMODITY_STATE',
|
||||||
width: 100,
|
width: 100,
|
||||||
ellipsis:true,
|
ellipsis: true,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
valueType: 'select',
|
valueType: 'select',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
valueEnum:{
|
valueEnum: {
|
||||||
0:{text:'无效'},
|
0: { text: '无效' },
|
||||||
1:{text:'有效'}
|
1: { text: '有效' }
|
||||||
},
|
},
|
||||||
initialValue: '1'
|
initialValue: '1'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title:<div style={{textAlign:'center'}}>审核时间</div>,
|
title: <div style={{ textAlign: 'center' }}>审核时间</div>,
|
||||||
dataIndex: 'OPERATE_DATE',
|
dataIndex: 'OPERATE_DATE',
|
||||||
width: 140,
|
width: 140,
|
||||||
ellipsis:true,
|
ellipsis: true,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
},
|
},
|
||||||
@ -217,7 +222,7 @@ const hotkeyset: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
|||||||
tempTable.remove() // 防止重复打印一个内容
|
tempTable.remove() // 防止重复打印一个内容
|
||||||
}
|
}
|
||||||
// 查询的条件
|
// 查询的条件
|
||||||
const [searchParams,setSearchParams] = useState<any>()
|
const [searchParams, setSearchParams] = useState<any>()
|
||||||
|
|
||||||
const getMenuDom = (data: any[], callback: (item: any) => void) => {
|
const getMenuDom = (data: any[], callback: (item: any) => void) => {
|
||||||
return (data.map((element: any) => {
|
return (data.map((element: any) => {
|
||||||
@ -225,52 +230,52 @@ const hotkeyset: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
|||||||
if (element.children && element.children.length > 0) {
|
if (element.children && element.children.length > 0) {
|
||||||
return (
|
return (
|
||||||
<SubMenu title={<span>{element.label}</span>}
|
<SubMenu title={<span>{element.label}</span>}
|
||||||
icon={element.ico ? <Avatar src={element.ico} size={16} style={{ marginRight: 4 }} shape="square" /> : null}
|
icon={element.ico ? <Avatar src={element.ico} size={16} style={{ marginRight: 4 }} shape="square" /> : null}
|
||||||
key={`${element.key || element.value}`}
|
key={`${element.key || element.value}`}
|
||||||
onTitleClick={(item) => {
|
onTitleClick={(item) => {
|
||||||
// 选中一级菜单
|
// 选中一级菜单
|
||||||
if (!currenMenu || item.key !== `${currenMenu?.key}`) {
|
if (!currenMenu || item.key !== `${currenMenu?.key}`) {
|
||||||
callback.call(callback, item)
|
callback.call(callback, item)
|
||||||
}
|
}
|
||||||
item.domEvent.stopPropagation();
|
item.domEvent.stopPropagation();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{element.children && element.children.length > 0 && getMenuDom(element.children, callback)}
|
{element.children && element.children.length > 0 && getMenuDom(element.children, callback)}
|
||||||
</SubMenu>
|
</SubMenu>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
return (<Menu.Item icon={element.ico ? <Avatar src={element.ico} size={16} shape="square" /> : null}
|
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>
|
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={{ 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>)
|
[<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) => {
|
const loadSelectedId = (item?: any) => {
|
||||||
console.log('item',item)
|
console.log('item', item)
|
||||||
// 选中的子菜单key
|
// 选中的子菜单key
|
||||||
const [type, value] = item.key.split('-')
|
const [type, value] = item.key.split('-')
|
||||||
if (type === '1') {
|
if (type === '1') {
|
||||||
setCurrenMenu(value)
|
setCurrenMenu(value)
|
||||||
handleGetCommodity(value)
|
handleGetCommodity(value)
|
||||||
// actionRef?.current?.reload()
|
// actionRef?.current?.reload()
|
||||||
} else{
|
} else {
|
||||||
setCurrenMenu('')
|
setCurrenMenu('')
|
||||||
setCommodityList([])
|
setCommodityList([])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 拿到对应的商品业态
|
// 拿到对应的商品业态
|
||||||
const handleGetCommodity = async (id: any)=>{
|
const handleGetCommodity = async (id: any) => {
|
||||||
const req: any = {
|
const req: any = {
|
||||||
ProvinceCode: currentUser?.USER_PROVINCE,
|
ProvinceCode: currentUser?.ProvinceCode,
|
||||||
ServerpartId: id
|
ServerpartId: id
|
||||||
}
|
}
|
||||||
const data = await handleGetServerpartShopTrade(req)
|
const data = await handleGetServerpartShopTrade(req)
|
||||||
console.log('data',data)
|
console.log('data', data)
|
||||||
const obj: any = {}
|
const obj: any = {}
|
||||||
if (data && data.length>0){
|
if (data && data.length > 0) {
|
||||||
data.forEach((item: any)=>{
|
data.forEach((item: any) => {
|
||||||
obj[item.value] = item.label
|
obj[item.value] = item.label
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -307,13 +312,13 @@ const hotkeyset: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
|||||||
borderRadius: '8px',
|
borderRadius: '8px',
|
||||||
width: '200px'
|
width: '200px'
|
||||||
}}>
|
}}>
|
||||||
<Spin/>
|
<Spin />
|
||||||
<span style={{marginLeft: '5px'}}>数据导出中...</span>
|
<span style={{ marginLeft: '5px' }}>数据导出中...</span>
|
||||||
</div>
|
</div>
|
||||||
</div> : ''
|
</div> : ''
|
||||||
}
|
}
|
||||||
|
|
||||||
<div className={'saleReportHideBox'} style={{position: 'fixed', zIndex: -1, top: 0, left: 0}}>
|
<div className={'saleReportHideBox'} style={{ position: 'fixed', zIndex: -1, top: 0, left: 0 }}>
|
||||||
{
|
{
|
||||||
showExportTable && reqDetailList && reqDetailList.length > 0 ?
|
showExportTable && reqDetailList && reqDetailList.length > 0 ?
|
||||||
<ProTable
|
<ProTable
|
||||||
@ -326,16 +331,16 @@ const hotkeyset: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
|||||||
/> : ''
|
/> : ''
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
<div id='hiddenBox' style={{position: 'fixed', zIndex: -1, top: 0, left: 0}}/>
|
<div id='hiddenBox' style={{ position: 'fixed', zIndex: -1, top: 0, left: 0 }} />
|
||||||
|
|
||||||
<div style={{backgroundColor: '#fff',display:'flex'}}>
|
<div style={{ backgroundColor: '#fff', display: 'flex' }}>
|
||||||
<ProCard
|
<ProCard
|
||||||
style={{width:!collapsible ? "300px" : "60px"}}
|
style={{ width: !collapsible ? "300px" : "60px" }}
|
||||||
className="pageTable-leftnav"
|
className="pageTable-leftnav"
|
||||||
bodyStyle={{padding: 0, paddingTop: 20, paddingLeft: 20,width:!collapsible ? "300px" : "60px"}}
|
bodyStyle={{ padding: 0, paddingTop: 20, paddingLeft: 20, width: !collapsible ? "300px" : "60px" }}
|
||||||
extra={<MenuFoldOutlined onClick={() => {
|
extra={<MenuFoldOutlined onClick={() => {
|
||||||
setCollapsible(!collapsible)
|
setCollapsible(!collapsible)
|
||||||
}}/>}
|
}} />}
|
||||||
colSpan={!collapsible ? "300px" : "60px"}
|
colSpan={!collapsible ? "300px" : "60px"}
|
||||||
title={!collapsible ? "请选择服务区" : ""}
|
title={!collapsible ? "请选择服务区" : ""}
|
||||||
headerBordered
|
headerBordered
|
||||||
@ -346,7 +351,7 @@ const hotkeyset: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
|||||||
style={{ height: 'calc(100vh - 220px)', overflowY: 'auto', overflowX: 'hidden' }}
|
style={{ height: 'calc(100vh - 220px)', overflowY: 'auto', overflowX: 'hidden' }}
|
||||||
selectedKeys={`1-${currenMenu}`}
|
selectedKeys={`1-${currenMenu}`}
|
||||||
onSelect={(item) => {
|
onSelect={(item) => {
|
||||||
console.log('item',item)
|
console.log('item', item)
|
||||||
loadSelectedId(item)
|
loadSelectedId(item)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@ -354,7 +359,7 @@ const hotkeyset: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
|||||||
</Menu>}
|
</Menu>}
|
||||||
</ProCard>
|
</ProCard>
|
||||||
<div style={{
|
<div style={{
|
||||||
width:!collapsible?'calc(100% - 300px)':'calc(100% - 60px)',
|
width: !collapsible ? 'calc(100% - 300px)' : 'calc(100% - 60px)',
|
||||||
paddingTop: 0,
|
paddingTop: 0,
|
||||||
paddingBottom: 0,
|
paddingBottom: 0,
|
||||||
paddingRight: 0
|
paddingRight: 0
|
||||||
@ -365,33 +370,34 @@ const hotkeyset: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
|||||||
columns={columns}
|
columns={columns}
|
||||||
bordered
|
bordered
|
||||||
headerTitle={<PageTitleBox props={props} />}
|
headerTitle={<PageTitleBox props={props} />}
|
||||||
search={{span: 6}}
|
search={{ span: 6 }}
|
||||||
request={async(params)=>{
|
request={async (params) => {
|
||||||
if (!currenMenu){
|
if (!currenMenu) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const req: any = {
|
const req: any = {
|
||||||
SearchType: 4,
|
SearchType: 4,
|
||||||
ProvinceCode: currentUser?.USER_PROVINCE,
|
ProvinceCode: currentUser?.ProvinceCode,
|
||||||
ServerpartID: currenMenu,
|
ServerpartID: currenMenu,
|
||||||
CommodityState: params.CommodityState,
|
CommodityState: params.CommodityState,
|
||||||
ShopTrade: params.ShopTrade,
|
ShopTrade: params.ShopTrade,
|
||||||
PageIndex:1,
|
PageIndex: 1,
|
||||||
PageSize: 999999
|
PageSize: 999999
|
||||||
}
|
}
|
||||||
handleCallLogs()
|
handleCallLogs()
|
||||||
setSearchParams(params)
|
setSearchParams(params)
|
||||||
const data = await handleGetCommodityList(req)
|
const data = await handleGetCommodityList(req)
|
||||||
if (data.List && data.List.length>0){
|
if (data.List && data.List.length > 0) {
|
||||||
console.log('data',data)
|
console.log('data', data)
|
||||||
// setAllTotal(data.TotalCount)
|
// setAllTotal(data.TotalCount)
|
||||||
return { data: data.List,success: true}
|
return { data: data.List, success: true }
|
||||||
}
|
}
|
||||||
return {data: [],success: true}
|
return { data: [], success: true }
|
||||||
}}
|
}}
|
||||||
toolbar={{
|
toolbar={{
|
||||||
actions: [
|
actions: [
|
||||||
<span style={{visibility: 'hidden'}}>
|
<span style={{ visibility: 'hidden' }}>
|
||||||
<ReactHTMLTableToExcel
|
<ReactHTMLTableToExcel
|
||||||
buttonText={'导出excel'}
|
buttonText={'导出excel'}
|
||||||
ref={downloadBtnRef}
|
ref={downloadBtnRef}
|
||||||
@ -428,7 +434,7 @@ const hotkeyset: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
|||||||
<Drawer
|
<Drawer
|
||||||
width={1000}
|
width={1000}
|
||||||
open={showDetail}
|
open={showDetail}
|
||||||
onClose={()=>{
|
onClose={() => {
|
||||||
setCurrentRow(undefined)
|
setCurrentRow(undefined)
|
||||||
setShowDetail(false)
|
setShowDetail(false)
|
||||||
setShowHotKeyEdit(false)
|
setShowHotKeyEdit(false)
|
||||||
@ -436,33 +442,33 @@ const hotkeyset: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
|||||||
closable={false}
|
closable={false}
|
||||||
destroyOnClose
|
destroyOnClose
|
||||||
footer={
|
footer={
|
||||||
<div style={{width:'100%',display:'flex',alignItems:'center',justifyContent:'flex-end'}}>
|
<div style={{ width: '100%', display: 'flex', alignItems: 'center', justifyContent: 'flex-end' }}>
|
||||||
<Button type={'primary'} onClick={async ()=>{
|
<Button type={'primary'} onClick={async () => {
|
||||||
const req: any = {
|
const req: any = {
|
||||||
...currentRow,
|
...currentRow,
|
||||||
COMMODITY_HOTKEY: getNewHotKey
|
COMMODITY_HOTKEY: getNewHotKey
|
||||||
}
|
}
|
||||||
console.log('req',req)
|
console.log('req', req)
|
||||||
const data = await handleSynchroCOMMODITY(req)
|
const data = await handleSynchroCOMMODITY(req)
|
||||||
if (data.Result_Code===100){
|
if (data.Result_Code === 100) {
|
||||||
message.success(data.Result_Desc)
|
message.success(data.Result_Desc)
|
||||||
actionRef.current?.reload()
|
actionRef.current?.reload()
|
||||||
setCurrentRow(undefined)
|
setCurrentRow(undefined)
|
||||||
setShowDetail(false)
|
setShowDetail(false)
|
||||||
setShowHotKeyEdit(false)
|
setShowHotKeyEdit(false)
|
||||||
}else{
|
} else {
|
||||||
message.error(data.Result_Desc)
|
message.error(data.Result_Desc)
|
||||||
}
|
}
|
||||||
}}>确认</Button>
|
}}>确认</Button>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Detail showHotKeyEdit={showHotKeyEdit} currentRow={currentRow} currentUser={currentUser} treeView={detailTreeView} setGetNewHotKey={setGetNewHotKey}/>
|
<Detail showHotKeyEdit={showHotKeyEdit} currentRow={currentRow} currentUser={currentUser} treeView={detailTreeView} setGetNewHotKey={setGetNewHotKey} />
|
||||||
</Drawer>
|
</Drawer>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default connect(({user}: ConnectState) => ({
|
export default connect(({ user }: ConnectState) => ({
|
||||||
currentUser: user.currentUser
|
currentUser: user.currentUser
|
||||||
}))(hotkeyset);
|
}))(hotkeyset);
|
||||||
|
|||||||
@ -1,15 +1,16 @@
|
|||||||
import {connect} from "umi";
|
// 商品自定义归类
|
||||||
import type {CurrentUser} from "umi";
|
import { connect } from "umi";
|
||||||
import type {ConnectState} from "@/models/connect";
|
import type { CurrentUser } from "umi";
|
||||||
import React, {useRef, useState} from "react";
|
import type { ConnectState } from "@/models/connect";
|
||||||
|
import React, { useRef, useState } from "react";
|
||||||
import ProCard from "@ant-design/pro-card";
|
import ProCard from "@ant-design/pro-card";
|
||||||
import {MenuFoldOutlined} from "@ant-design/icons";
|
import { MenuFoldOutlined } from "@ant-design/icons";
|
||||||
import type {FormInstance} from "antd";
|
import type { FormInstance } from "antd";
|
||||||
import {Modal, Popconfirm} from "antd";
|
import { Modal, Popconfirm } from "antd";
|
||||||
import {Button, Menu, message, Space, Spin, Tree,Avatar,Select} from "antd";
|
import { Button, Menu, message, Space, Spin, Tree, Avatar, Select } from "antd";
|
||||||
import useRequest from "@ahooksjs/use-request";
|
import useRequest from "@ahooksjs/use-request";
|
||||||
import {getFieldEnumTree, getServerpartTree} from "@/services/options";
|
import { getFieldEnumTree, getServerpartTree } from "@/services/options";
|
||||||
import type {ActionType} from "@ant-design/pro-table";
|
import type { ActionType } from "@ant-design/pro-table";
|
||||||
import ProTable from "@ant-design/pro-table";
|
import ProTable from "@ant-design/pro-table";
|
||||||
import ReactHTMLTableToExcel from "react-html-table-to-excel";
|
import ReactHTMLTableToExcel from "react-html-table-to-excel";
|
||||||
import SubMenu from "antd/lib/menu/SubMenu";
|
import SubMenu from "antd/lib/menu/SubMenu";
|
||||||
@ -18,13 +19,14 @@ import {
|
|||||||
handleGetCommodityList,
|
handleGetCommodityList,
|
||||||
handleGetServerpartUDTypeTree, handleRelateUDType, handleSynchroCOMMODITY
|
handleGetServerpartUDTypeTree, handleRelateUDType, handleSynchroCOMMODITY
|
||||||
} from "@/pages/reports/productControl/setUserDefinedType/service";
|
} from "@/pages/reports/productControl/setUserDefinedType/service";
|
||||||
import {handleGetShopTypeTree} from "@/pages/DataVerification/list/service";
|
import { handleGetShopTypeTree } from "@/pages/DataVerification/list/service";
|
||||||
import {handleGetUSERDEFINEDTYPEList} from "@/pages/reports/productControl/userDefinedType/service";
|
import { handleGetUSERDEFINEDTYPEList } from "@/pages/reports/productControl/userDefinedType/service";
|
||||||
import {handleGetNestingCOMMODITYTYPETree} from "@/pages/reports/productControl/commodityInfo/service";
|
import { handleGetNestingCOMMODITYTYPETree, handleGetServerpartShopTrade } from "@/pages/reports/productControl/commodityInfo/service";
|
||||||
import './style.less'
|
import './style.less'
|
||||||
import PageTitleBox from "@/components/PageTitleBox";
|
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 { currentUser } = props
|
||||||
const downloadBtnRef = useRef<any>()
|
const downloadBtnRef = useRef<any>()
|
||||||
const actionRef = useRef<ActionType>();
|
const actionRef = useRef<ActionType>();
|
||||||
@ -34,7 +36,7 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
|||||||
const [reqDetailList, setReqDetailList] = useState<any>(); // 合计项数据源
|
const [reqDetailList, setReqDetailList] = useState<any>(); // 合计项数据源
|
||||||
const [printOut, setPrintOut] = useState<any>(); // 打印数据的内容
|
const [printOut, setPrintOut] = useState<any>(); // 打印数据的内容
|
||||||
const [collapsible, setCollapsible] = useState<boolean>(false)
|
const [collapsible, setCollapsible] = useState<boolean>(false)
|
||||||
const [treeView,setTreeView] = useState<any>()
|
const [treeView, setTreeView] = useState<any>()
|
||||||
// 加载服务区树
|
// 加载服务区树
|
||||||
const { loading: treeLoading, data: treeViews } = useRequest(async () => {
|
const { loading: treeLoading, data: treeViews } = useRequest(async () => {
|
||||||
const req: any = {
|
const req: any = {
|
||||||
@ -45,6 +47,7 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
|||||||
setTreeView(data)
|
setTreeView(data)
|
||||||
return data
|
return data
|
||||||
})
|
})
|
||||||
|
const [commodityList, setCommodityList] = useState<any>()
|
||||||
|
|
||||||
// 加载弹出框里面的关联商品的树状选择
|
// 加载弹出框里面的关联商品的树状选择
|
||||||
const { loading: modalTreeLoading, data: ModalTreeViews } = useRequest(async () => {
|
const { loading: modalTreeLoading, data: ModalTreeViews } = useRequest(async () => {
|
||||||
@ -56,43 +59,43 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
|||||||
const data = await handleGetNestingCOMMODITYTYPETree(req)
|
const data = await handleGetNestingCOMMODITYTYPETree(req)
|
||||||
return data
|
return data
|
||||||
})
|
})
|
||||||
// 树相关的属性和方法
|
// 树相关的属性和方法
|
||||||
const [selectedId, setSelectedId] = useState<string>()
|
const [selectedId, setSelectedId] = useState<string>()
|
||||||
// 导出的加载效果
|
// 导出的加载效果
|
||||||
const [showLoading,setShowLoading] = useState<boolean>(false)
|
const [showLoading, setShowLoading] = useState<boolean>(false)
|
||||||
// 是否显示打印的表格
|
// 是否显示打印的表格
|
||||||
const [showExportTable,setShowExportTable] = useState<boolean>(false)
|
const [showExportTable, setShowExportTable] = useState<boolean>(false)
|
||||||
const [currenMenu, setCurrenMenu] = useState<any>(); // 当前选中左侧菜单的服务区节点 type为1时
|
const [currenMenu, setCurrenMenu] = useState<any>(); // 当前选中左侧菜单的服务区节点 type为1时
|
||||||
const [modalCurrenMenu, setModalCurrenMenu] = useState<any>(); // 当前选中左侧菜单的服务区节点 type为1时
|
const [modalCurrenMenu, setModalCurrenMenu] = useState<any>(); // 当前选中左侧菜单的服务区节点 type为1时
|
||||||
const [selectBusiness,setSelectBusiness] = useState<any>()
|
const [selectBusiness, setSelectBusiness] = useState<any>()
|
||||||
const [customClassList,setCustomClassList] = useState<any>()
|
const [customClassList, setCustomClassList] = useState<any>()
|
||||||
const [correlationModal,setCorrelationModal] = useState<boolean>(false)
|
const [correlationModal, setCorrelationModal] = useState<boolean>(false)
|
||||||
const columns: any = [
|
const columns: any = [
|
||||||
{
|
{
|
||||||
title:'自定义类别',
|
title: '自定义类别',
|
||||||
dataIndex:'USERDEFINEDTYPE_ID',
|
dataIndex: 'USERDEFINEDTYPE_ID',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
width: 200,
|
width: 200,
|
||||||
valueType: 'select',
|
valueType: 'select',
|
||||||
render:(_,record)=>{
|
render: (_, record) => {
|
||||||
return <Select
|
return <Select
|
||||||
style={{width:'180px'}}
|
style={{ width: '180px' }}
|
||||||
options={customClassList}
|
options={customClassList}
|
||||||
value={record?.USERDEFINEDTYPE_ID || ''}
|
value={record?.USERDEFINEDTYPE_ID || ''}
|
||||||
onChange={async (e: any)=>{
|
onChange={async (e: any) => {
|
||||||
console.log('e',e)
|
console.log('e', e)
|
||||||
console.log('record',record)
|
console.log('record', record)
|
||||||
record.USERDEFINEDTYPE_ID = e
|
record.USERDEFINEDTYPE_ID = e
|
||||||
if (e){
|
if (e) {
|
||||||
const req = {
|
const req = {
|
||||||
...record,
|
...record,
|
||||||
USERDEFINEDTYPE_ID: e
|
USERDEFINEDTYPE_ID: e
|
||||||
}
|
}
|
||||||
const data = await handleSynchroCOMMODITY(req)
|
const data = await handleSynchroCOMMODITY(req)
|
||||||
if (data.Result_Code===100){
|
if (data.Result_Code === 100) {
|
||||||
message.success(data.Result_Desc)
|
message.success(data.Result_Desc)
|
||||||
actionRef.current?.reload()
|
actionRef.current?.reload()
|
||||||
}else{
|
} else {
|
||||||
message.error(data.Result_Desc)
|
message.error(data.Result_Desc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -101,146 +104,168 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title:'商品类型',
|
title: '商品类型',
|
||||||
dataIndex:'COMMODITY_TYPE',
|
dataIndex: 'COMMODITY_TYPE',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
valueType: 'treeSelect',
|
valueType: 'treeSelect',
|
||||||
request: async () => {
|
request: async () => {
|
||||||
const data = await handleGetShopTypeTree({ PROVINCE_CODE: currentUser?.ProvinceCode });
|
const data = await handleGetShopTypeTree({ PROVINCE_CODE: currentUser?.ProvinceCode });
|
||||||
console.log('data',data)
|
console.log('data', data)
|
||||||
return data
|
return data
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title:'商品条码',
|
title: '商品条码',
|
||||||
dataIndex:'COMMODITY_BARCODE',
|
dataIndex: 'COMMODITY_BARCODE',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title:'商品名称',
|
title: '商品名称',
|
||||||
dataIndex:'COMMODITY_NAME',
|
dataIndex: 'COMMODITY_NAME',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title:'零售价格',
|
title: '零售价格',
|
||||||
dataIndex:'COMMODITY_RETAILPRICE',
|
dataIndex: 'COMMODITY_RETAILPRICE',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title:'商品单位',
|
title: '商品单位',
|
||||||
dataIndex:'COMMODITY_UNIT',
|
dataIndex: 'COMMODITY_UNIT',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title:'商品规格',
|
title: '商品规格',
|
||||||
dataIndex:'COMMODITY_RULE',
|
dataIndex: 'COMMODITY_RULE',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title:'商品业态',
|
title: '商品业态',
|
||||||
dataIndex:'BUSINESSTYPE',
|
dataIndex: 'BUSINESSTYPE',
|
||||||
valueType: 'select',
|
valueType: 'select',
|
||||||
request:async ()=>{
|
valueEnum: commodityList,
|
||||||
const data = await getFieldEnumTree({ FieldExplainField: 'BUSINESSTYPE' })
|
fieldProps: {
|
||||||
return data
|
showSearch: true,
|
||||||
}
|
filterOption: (input: any, option: any) => (option?.label ?? '').toLowerCase().includes(input.toLowerCase()),
|
||||||
|
},
|
||||||
|
// request: async () => {
|
||||||
|
// const data = await getFieldEnumTree({ FieldExplainField: 'BUSINESSTYPE' })
|
||||||
|
// return data
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title:'商品状态',
|
title: '商品状态',
|
||||||
dataIndex:'COMMODITY_STATE',
|
dataIndex: 'COMMODITY_STATE',
|
||||||
valueEnum: { 0: { text: '无效', status: 'error' }, 1: { text: '有效', status: 'success' }, 2: { text: '不可选', status: 'default' } },
|
valueEnum: { 0: { text: '无效', status: 'error' }, 1: { text: '有效', status: 'success' }, 2: { text: '不可选', status: 'default' } },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title:'审核时间',
|
title: '审核时间',
|
||||||
dataIndex:'OPERATE_DATE',
|
dataIndex: 'OPERATE_DATE',
|
||||||
hideInSearch: true,
|
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 = [
|
const modalColumns: any = [
|
||||||
{
|
{
|
||||||
title:'商品类型',
|
title: '商品类型',
|
||||||
width: 120,
|
width: 120,
|
||||||
dataIndex:'COMMODITY_TYPE',
|
dataIndex: 'COMMODITY_TYPE',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
valueType: 'treeSelect',
|
valueType: 'select',
|
||||||
request: async () => {
|
valueEnum: toLabelValueMapSimple(commodityTree)
|
||||||
const data = await handleGetShopTypeTree({ PROVINCE_CODE: currentUser?.ProvinceCode });
|
|
||||||
return data
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title:'商品条码',
|
title: '商品条码',
|
||||||
width: 150,
|
width: 150,
|
||||||
dataIndex:'COMMODITY_BARCODE',
|
dataIndex: 'COMMODITY_BARCODE',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title:'商品名称',
|
title: '商品名称',
|
||||||
width: 150,
|
width: 150,
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
dataIndex:'COMMODITY_NAME',
|
dataIndex: 'COMMODITY_NAME',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title:'零售价格',
|
title: '零售价格',
|
||||||
width: 100,
|
width: 100,
|
||||||
dataIndex:'COMMODITY_RETAILPRICE',
|
dataIndex: 'COMMODITY_RETAILPRICE',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title:'商品单位',
|
title: '商品单位',
|
||||||
width: 100,
|
width: 100,
|
||||||
dataIndex:'COMMODITY_UNIT',
|
dataIndex: 'COMMODITY_UNIT',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title:'商品规格',
|
title: '商品规格',
|
||||||
width: 120,
|
width: 120,
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
dataIndex:'COMMODITY_RULE',
|
dataIndex: 'COMMODITY_RULE',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title:'商品业态',
|
title: '商品业态',
|
||||||
width: 100,
|
width: 100,
|
||||||
dataIndex:'BUSINESSTYPE',
|
dataIndex: 'BUSINESSTYPE',
|
||||||
valueType: 'select',
|
valueType: 'select',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
request:async ()=>{
|
request: async () => {
|
||||||
const data = await getFieldEnumTree({ FieldExplainField: 'BUSINESSTYPE' })
|
const data = await getFieldEnumTree({ FieldExplainField: 'BUSINESSTYPE' })
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title:'商品状态',
|
title: '商品状态',
|
||||||
width: 100,
|
width: 100,
|
||||||
dataIndex:'COMMODITY_STATE',
|
dataIndex: 'COMMODITY_STATE',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
valueEnum: { 0: { text: '无效', status: 'error' }, 1: { text: '有效', status: 'success' }, 2: { text: '不可选', status: 'default' } },
|
valueEnum: { 0: { text: '无效', status: 'error' }, 1: { text: '有效', status: 'success' }, 2: { text: '不可选', status: 'default' } },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title:'商品状态',
|
title: '商品状态',
|
||||||
dataIndex:'CommodityState',
|
dataIndex: 'CommodityState',
|
||||||
hideInTable: true,
|
hideInTable: true,
|
||||||
initialValue: '1',
|
initialValue: '1',
|
||||||
valueEnum: { 0: { text: '无效', status: 'error' }, 1: { text: '有效', status: 'success' }, 2: { text: '不可选', status: 'default' } },
|
valueEnum: { 0: { text: '无效', status: 'error' }, 1: { text: '有效', status: 'success' }, 2: { text: '不可选', status: 'default' } },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title:'审核时间',
|
title: '审核时间',
|
||||||
width: 180,
|
width: 180,
|
||||||
dataIndex:'OPERATE_DATE',
|
dataIndex: 'OPERATE_DATE',
|
||||||
hideInSearch: true,
|
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 = {
|
const req: any = {
|
||||||
SearchParameter:{
|
SearchParameter: {
|
||||||
USERDEFINEDTYPE_STATE:1,
|
USERDEFINEDTYPE_STATE: 1,
|
||||||
SERVERPART_ID: currenMenu || '',
|
SERVERPART_ID: currenMenu || '',
|
||||||
// BUSINESSTYPE: selectBusiness || ''
|
// BUSINESSTYPE: selectBusiness || ''
|
||||||
},
|
},
|
||||||
@ -249,14 +274,14 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
|||||||
pageSize: 999999,
|
pageSize: 999999,
|
||||||
}
|
}
|
||||||
const data = await handleGetUSERDEFINEDTYPEList(req)
|
const data = await handleGetUSERDEFINEDTYPEList(req)
|
||||||
if (data && data.length>0){
|
if (data && data.length > 0) {
|
||||||
const list: any = []
|
const list: any = []
|
||||||
data.forEach((item: any)=>{
|
data.forEach((item: any) => {
|
||||||
list.push({label: item.USERDEFINEDTYPE_NAME,value:item.USERDEFINEDTYPE_ID})
|
list.push({ label: item.USERDEFINEDTYPE_NAME, value: item.USERDEFINEDTYPE_ID })
|
||||||
})
|
})
|
||||||
setCustomClassList(list)
|
setCustomClassList(list)
|
||||||
}
|
}
|
||||||
console.log('data',data)
|
console.log('data', data)
|
||||||
}
|
}
|
||||||
const exportTable = (e) => {
|
const exportTable = (e) => {
|
||||||
e.stopPropagation(); // 防止Collapse组件收起
|
e.stopPropagation(); // 防止Collapse组件收起
|
||||||
@ -280,82 +305,104 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
|||||||
tempTable.remove() // 防止重复打印一个内容
|
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) => {
|
const getMenuDom = (data: any[], callback: (item: any) => void) => {
|
||||||
return (data.map((element: any) => {
|
return (data.map((element: any) => {
|
||||||
// 绑定嵌套树的子节点
|
// 绑定嵌套树的子节点
|
||||||
if (element.children && element.children.length > 0) {
|
if (element.children && element.children.length > 0) {
|
||||||
return (
|
return (
|
||||||
<SubMenu title={<span>{element.label}</span>}
|
<SubMenu title={<span>{element.label}</span>}
|
||||||
icon={element.ico ? <Avatar src={element.ico} size={16} style={{ marginRight: 4 }} shape="square" /> : null}
|
icon={element.ico ? <Avatar src={element.ico} size={16} style={{ marginRight: 4 }} shape="square" /> : null}
|
||||||
key={`${element.key || element.value}`}
|
key={`${element.key || element.value}`}
|
||||||
onTitleClick={(item) => {
|
onTitleClick={(item) => {
|
||||||
// 选中一级菜单
|
// 选中一级菜单
|
||||||
if (!currenMenu || item.key !== `${currenMenu?.key}`) {
|
if (!currenMenu || item.key !== `${currenMenu?.key}`) {
|
||||||
callback.call(callback, item)
|
callback.call(callback, item)
|
||||||
}
|
}
|
||||||
item.domEvent.stopPropagation();
|
item.domEvent.stopPropagation();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{element.children && element.children.length > 0 && getMenuDom(element.children, callback)}
|
{element.children && element.children.length > 0 && getMenuDom(element.children, callback)}
|
||||||
</SubMenu>
|
</SubMenu>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
return (<Menu.Item icon={element.ico ? <Avatar src={element.ico} size={16} shape="square" /> : null}
|
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>
|
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={{ 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>)
|
[<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) => {
|
const loadSelectedId = (item?: any) => {
|
||||||
|
console.log('itemitemitem', item);
|
||||||
|
|
||||||
// 选中的子菜单key
|
// 选中的子菜单key
|
||||||
const [type, value] = item.key.split('-')
|
const [type, value] = item.key.split('-')
|
||||||
if (type === '1') {
|
if (type === '1') {
|
||||||
setCurrenMenu(value)
|
setCurrenMenu(value)
|
||||||
setSelectBusiness(undefined)
|
setSelectBusiness(undefined)
|
||||||
// actionRef?.current?.reload()
|
// actionRef?.current?.reload()
|
||||||
}else if(type==='2'){
|
} else if (type === '2') {
|
||||||
// setCurrenMenu(undefined)
|
// setCurrenMenu(undefined)
|
||||||
setSelectBusiness(value)
|
setSelectBusiness(value)
|
||||||
} else{
|
// type 为2 那就说明是选择门店了
|
||||||
|
let serverpartId: string = item.keyPath[1].split('-')[1]
|
||||||
|
handleGetCommodity(serverpartId)
|
||||||
|
} else {
|
||||||
setCurrenMenu(undefined)
|
setCurrenMenu(undefined)
|
||||||
setSelectBusiness(undefined)
|
setSelectBusiness(undefined)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const modalLoadSelectedId = (item?: any) => {
|
const modalLoadSelectedId = (item?: any) => {
|
||||||
console.log('item',item)
|
console.log('item', item)
|
||||||
// 选中的子菜单key
|
// 选中的子菜单key
|
||||||
const [type, value] = item.key.split('-')
|
const [type, value] = item.key.split('-')
|
||||||
if (type === '1') {
|
if (type === '1') {
|
||||||
if (value === modalTreeSelect){
|
if (value === modalTreeSelect) {
|
||||||
setModalTreeSelect(undefined)
|
setModalTreeSelect(undefined)
|
||||||
}else{
|
} else {
|
||||||
setModalTreeSelect(value)
|
setModalTreeSelect(value)
|
||||||
}
|
}
|
||||||
} else{
|
} else {
|
||||||
setModalTreeSelect('')
|
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,
|
selectedRowKeys: selectedModalOrderRowKeys,
|
||||||
onChange: (selectedRowKeys: any, selectedRows: any) => {
|
onChange: (selectedRowKeys: any, selectedRows: any) => {
|
||||||
setSelectModalRowList(selectedRows)
|
setSelectModalRowList(selectedRows)
|
||||||
setSelectedModalOrderRowKeys(selectedRowKeys)
|
setSelectedModalOrderRowKeys(selectedRowKeys)
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
const rowSelection: any ={
|
const rowSelection: any = {
|
||||||
selectedRowKeys: selectedOrderRowKeys,
|
selectedRowKeys: selectedOrderRowKeys,
|
||||||
onChange: (selectedRowKeys: any, selectedRows: any) => {
|
onChange: (selectedRowKeys: any, selectedRows: any) => {
|
||||||
setSelectRowList(selectedRows)
|
setSelectRowList(selectedRows)
|
||||||
@ -393,13 +440,13 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
|||||||
borderRadius: '8px',
|
borderRadius: '8px',
|
||||||
width: '200px'
|
width: '200px'
|
||||||
}}>
|
}}>
|
||||||
<Spin/>
|
<Spin />
|
||||||
<span style={{marginLeft: '5px'}}>数据导出中...</span>
|
<span style={{ marginLeft: '5px' }}>数据导出中...</span>
|
||||||
</div>
|
</div>
|
||||||
</div> : ''
|
</div> : ''
|
||||||
}
|
}
|
||||||
|
|
||||||
<div className={'saleReportHideBox'} style={{position: 'fixed', zIndex: -1, top: 0, left: 0}}>
|
<div className={'saleReportHideBox'} style={{ position: 'fixed', zIndex: -1, top: 0, left: 0 }}>
|
||||||
{
|
{
|
||||||
showExportTable && reqDetailList && reqDetailList.length > 0 ?
|
showExportTable && reqDetailList && reqDetailList.length > 0 ?
|
||||||
<ProTable
|
<ProTable
|
||||||
@ -412,16 +459,16 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
|||||||
/> : ''
|
/> : ''
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
<div id='hiddenBox' style={{position: 'fixed', zIndex: -1, top: 0, left: 0}}/>
|
<div id='hiddenBox' style={{ position: 'fixed', zIndex: -1, top: 0, left: 0 }} />
|
||||||
|
|
||||||
<div style={{backgroundColor: '#fff',display:'flex'}}>
|
<div style={{ backgroundColor: '#fff', display: 'flex' }}>
|
||||||
<ProCard
|
<ProCard
|
||||||
style={{width:!collapsible ? "300px" : "60px"}}
|
style={{ width: !collapsible ? "300px" : "60px" }}
|
||||||
className="pageTable-leftnav"
|
className="pageTable-leftnav"
|
||||||
bodyStyle={{padding: 0, paddingTop: 20, paddingLeft: 20,width:!collapsible ? "300px" : "60px"}}
|
bodyStyle={{ padding: 0, paddingTop: 20, paddingLeft: 20, width: !collapsible ? "300px" : "60px" }}
|
||||||
extra={<MenuFoldOutlined onClick={() => {
|
extra={<MenuFoldOutlined onClick={() => {
|
||||||
setCollapsible(!collapsible)
|
setCollapsible(!collapsible)
|
||||||
}}/>}
|
}} />}
|
||||||
colSpan={!collapsible ? "300px" : "60px"}
|
colSpan={!collapsible ? "300px" : "60px"}
|
||||||
title={!collapsible ? "请选择服务区" : ""}
|
title={!collapsible ? "请选择服务区" : ""}
|
||||||
headerBordered
|
headerBordered
|
||||||
@ -430,7 +477,7 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
|||||||
{!treeLoading && <Menu
|
{!treeLoading && <Menu
|
||||||
mode="inline"
|
mode="inline"
|
||||||
style={{ height: 'calc(100vh - 220px)', overflowY: 'auto', overflowX: 'hidden' }}
|
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) => {
|
onSelect={(item) => {
|
||||||
loadSelectedId(item)
|
loadSelectedId(item)
|
||||||
}}
|
}}
|
||||||
@ -439,7 +486,7 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
|||||||
</Menu>}
|
</Menu>}
|
||||||
</ProCard>
|
</ProCard>
|
||||||
<div className={'bigPageTable'} style={{
|
<div className={'bigPageTable'} style={{
|
||||||
width:!collapsible?'calc(100% - 300px)':'calc(100% - 60px)',
|
width: !collapsible ? 'calc(100% - 300px)' : 'calc(100% - 60px)',
|
||||||
paddingTop: 0,
|
paddingTop: 0,
|
||||||
paddingBottom: 0,
|
paddingBottom: 0,
|
||||||
paddingRight: 0
|
paddingRight: 0
|
||||||
@ -458,9 +505,9 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
|||||||
...rowSelection,
|
...rowSelection,
|
||||||
}}
|
}}
|
||||||
headerTitle={<PageTitleBox props={props} />}
|
headerTitle={<PageTitleBox props={props} />}
|
||||||
search={{span: 6}}
|
search={{ span: 6 }}
|
||||||
request={async(params)=>{
|
request={async (params) => {
|
||||||
if (!currenMenu && !selectBusiness){
|
if (!currenMenu && !selectBusiness) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
setCustomClassList([])
|
setCustomClassList([])
|
||||||
@ -470,61 +517,61 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
|||||||
...params,
|
...params,
|
||||||
SearchType: 4,
|
SearchType: 4,
|
||||||
ShowJustUDType: true,
|
ShowJustUDType: true,
|
||||||
ServerpartID: selectBusiness?'':currenMenu,
|
ServerpartID: selectBusiness ? '' : currenMenu,
|
||||||
UserDefinedTypeId: selectBusiness || '',
|
UserDefinedTypeId: selectBusiness || '',
|
||||||
PageSize: 999999,
|
PageSize: 999999,
|
||||||
pageSize: 999999,
|
pageSize: 999999,
|
||||||
}
|
}
|
||||||
setSearchParams(params)
|
setSearchParams(params)
|
||||||
const data = await handleGetCommodityList(req)
|
const data = await handleGetCommodityList(req)
|
||||||
console.log('data',data)
|
console.log('data', data)
|
||||||
if (data && data.length>0){
|
if (data && data.length > 0) {
|
||||||
return {data, success: true}
|
return { data, success: true }
|
||||||
}
|
}
|
||||||
return {data:[],success:true}
|
return { data: [], success: true }
|
||||||
}}
|
}}
|
||||||
toolbar={{
|
toolbar={{
|
||||||
actions: [
|
actions: [
|
||||||
selectBusiness?
|
selectBusiness ?
|
||||||
<div>
|
<div>
|
||||||
<Button
|
<Button
|
||||||
key="new"
|
key="new"
|
||||||
type="primary"
|
type="primary"
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
setCorrelationModal(true)
|
setCorrelationModal(true)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
关联商品
|
关联商品
|
||||||
</Button>
|
</Button>
|
||||||
<Popconfirm // 删除按钮功能
|
<Popconfirm // 删除按钮功能
|
||||||
title="确认删除?"
|
title="确认删除?"
|
||||||
onConfirm={async () => {
|
onConfirm={async () => {
|
||||||
console.log('selectRowList',selectRowList)
|
console.log('selectRowList', selectRowList)
|
||||||
console.log('selectedOrderRowKeys',selectedOrderRowKeys)
|
console.log('selectedOrderRowKeys', selectedOrderRowKeys)
|
||||||
if (selectedOrderRowKeys && selectedOrderRowKeys.length>0){
|
if (selectRowList && selectRowList.length > 0) {
|
||||||
const list: any = []
|
const list: any = []
|
||||||
selectedOrderRowKeys.forEach((item: any)=>{
|
selectRowList.forEach((item: any) => {
|
||||||
list.push({label:'',value:item})
|
list.push({ label: item.USERDEFINEDTYPE_ID, value: item.COMMODITY_ID })
|
||||||
})
|
})
|
||||||
const data = await handleDeleteRTUDType(list)
|
const data = await handleDeleteRTUDType(list)
|
||||||
if (data.Result_Code === 100) {
|
if (data.Result_Code === 100) {
|
||||||
message.success(data.Result_Desc)
|
message.success(data.Result_Desc)
|
||||||
setSelectRowList([])
|
setSelectRowList([])
|
||||||
setSelectedOrderRowKeys([])
|
setSelectedOrderRowKeys([])
|
||||||
actionRef?.current?.reload()
|
actionRef?.current?.reload()
|
||||||
} else {
|
} else {
|
||||||
message.error(data.Result_Desc)
|
message.error(data.Result_Desc)
|
||||||
}
|
|
||||||
}else{
|
|
||||||
message.error('请选择')
|
|
||||||
}
|
}
|
||||||
}}
|
} else {
|
||||||
>
|
message.error('请选择')
|
||||||
<Button style={{marginLeft:'8px'}}>删除关联</Button>
|
}
|
||||||
</Popconfirm>
|
}}
|
||||||
|
>
|
||||||
|
<Button style={{ marginLeft: '8px' }}>删除关联</Button>
|
||||||
|
</Popconfirm>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
:''
|
: ''
|
||||||
]
|
]
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@ -537,18 +584,18 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
|||||||
wrapClassName={'shopModal'}
|
wrapClassName={'shopModal'}
|
||||||
destroyOnClose
|
destroyOnClose
|
||||||
title={'关联商品'}
|
title={'关联商品'}
|
||||||
onCancel={()=>{
|
onCancel={() => {
|
||||||
setCorrelationModal(false)
|
setCorrelationModal(false)
|
||||||
setModalTreeSelect(undefined)
|
setModalTreeSelect(undefined)
|
||||||
}}
|
}}
|
||||||
onOk={async ()=>{
|
onOk={async () => {
|
||||||
// console.log('selectModalRowList',selectModalRowList)
|
// console.log('selectModalRowList',selectModalRowList)
|
||||||
console.log('selectedModalOrderRowKeys',selectedModalOrderRowKeys)
|
console.log('selectedModalOrderRowKeys', selectedModalOrderRowKeys)
|
||||||
console.log('selectBusiness',selectBusiness)
|
console.log('selectBusiness', selectBusiness)
|
||||||
if (selectedModalOrderRowKeys && selectedModalOrderRowKeys.length>0){
|
if (selectedModalOrderRowKeys && selectedModalOrderRowKeys.length > 0) {
|
||||||
const req: any = []
|
const req: any = []
|
||||||
selectedModalOrderRowKeys.forEach((item: any)=>{
|
selectedModalOrderRowKeys.forEach((item: any) => {
|
||||||
req.push({label: selectBusiness,value:item})
|
req.push({ label: selectBusiness, value: item })
|
||||||
})
|
})
|
||||||
const data = await handleRelateUDType(req)
|
const data = await handleRelateUDType(req)
|
||||||
if (data.Result_Code === 100) {
|
if (data.Result_Code === 100) {
|
||||||
@ -561,19 +608,19 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
|||||||
} else {
|
} else {
|
||||||
message.error(data.Result_Desc)
|
message.error(data.Result_Desc)
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
message.error('请选择要关联的商品')
|
message.error('请选择要关联的商品')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div style={{width:'100%',height: '650px',backgroundColor: '#fff',display:'flex'}}>
|
<div style={{ width: '100%', height: '650px', backgroundColor: '#fff', display: 'flex' }}>
|
||||||
<ProCard
|
<ProCard
|
||||||
style={{width:"300px"}}
|
style={{ width: "300px" }}
|
||||||
className="pageTable-leftnav"
|
className="pageTable-leftnav"
|
||||||
bodyStyle={{padding: 0, paddingTop: 20, paddingLeft: 20,width: "280px"}}
|
bodyStyle={{ padding: 0, paddingTop: 20, paddingLeft: 20, width: "280px" }}
|
||||||
extra={<MenuFoldOutlined onClick={() => {}}/>}
|
extra={<MenuFoldOutlined onClick={() => { }} />}
|
||||||
headerBordered
|
headerBordered
|
||||||
>
|
>
|
||||||
{!modalTreeLoading && <Menu
|
{!modalTreeLoading && <Menu
|
||||||
@ -588,7 +635,7 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
|||||||
</Menu>}
|
</Menu>}
|
||||||
</ProCard>
|
</ProCard>
|
||||||
<div style={{
|
<div style={{
|
||||||
width:!collapsible?'calc(100% - 300px)':'calc(100% - 60px)',
|
width: !collapsible ? 'calc(100% - 300px)' : 'calc(100% - 60px)',
|
||||||
paddingTop: 0,
|
paddingTop: 0,
|
||||||
paddingBottom: 0,
|
paddingBottom: 0,
|
||||||
paddingRight: 0
|
paddingRight: 0
|
||||||
@ -606,10 +653,10 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
|||||||
type: 'checkbox',
|
type: 'checkbox',
|
||||||
...modalRowSelection,
|
...modalRowSelection,
|
||||||
}}
|
}}
|
||||||
scroll={{x:1000,y: 400}}
|
scroll={{ x: 1000, y: 400 }}
|
||||||
headerTitle={'未关联商品列表'}
|
headerTitle={'未关联商品列表'}
|
||||||
search={{span: 6}}
|
search={{ span: 6 }}
|
||||||
request={async(params)=>{
|
request={async (params) => {
|
||||||
const req: any = {
|
const req: any = {
|
||||||
...params,
|
...params,
|
||||||
SearchType: 4,
|
SearchType: 4,
|
||||||
@ -622,11 +669,11 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
|||||||
}
|
}
|
||||||
setSearchParams(params)
|
setSearchParams(params)
|
||||||
const data = await handleGetCommodityList(req)
|
const data = await handleGetCommodityList(req)
|
||||||
console.log('data',data)
|
console.log('data', data)
|
||||||
if (data && data.length>0){
|
if (data && data.length > 0) {
|
||||||
return {data, success: true}
|
return { data, success: true }
|
||||||
}
|
}
|
||||||
return {data:[],success:true}
|
return { data: [], success: true }
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</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
|
currentUser: user.currentUser
|
||||||
}))(setUserDefinedType);
|
}))(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) => {
|
export const handlePrintImg = (url: any) => {
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
// 由 scripts/writeVersion.js 自动生成
|
// 由 scripts/writeVersion.js 自动生成
|
||||||
export const VERSION = "4.5.38";
|
export const VERSION = "4.5.40";
|
||||||
export const GIT_HASH = "9fb0245";
|
export const GIT_HASH = "debd5be";
|
||||||
export const BUILD_TIME = "2025-08-28T02:13:12.174Z";
|
export const BUILD_TIME = "2025-08-29T07:11:29.945Z";
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user