update
This commit is contained in:
parent
524c0abc26
commit
a14b50b7f6
@ -464,6 +464,12 @@ export default [
|
|||||||
name: 'ProductApprovalProcess',
|
name: 'ProductApprovalProcess',
|
||||||
component: './reports/productControl/ProductApprovalProcess',
|
component: './reports/productControl/ProductApprovalProcess',
|
||||||
},
|
},
|
||||||
|
// 便利店商品审核
|
||||||
|
{
|
||||||
|
path: 'ConvenienceStoreProductReview',
|
||||||
|
name: 'ConvenienceStoreProductReview',
|
||||||
|
component: './reports/productControl/ConvenienceStoreProductReview',
|
||||||
|
},
|
||||||
// 新增商品流程
|
// 新增商品流程
|
||||||
{
|
{
|
||||||
path: 'NewProductApproval',
|
path: 'NewProductApproval',
|
||||||
@ -1092,6 +1098,12 @@ export default [
|
|||||||
name: 'ProductWarningRuleSetting',
|
name: 'ProductWarningRuleSetting',
|
||||||
component: './travelMember/ProductWarningRuleSetting/index'
|
component: './travelMember/ProductWarningRuleSetting/index'
|
||||||
},
|
},
|
||||||
|
// 注册途径统计
|
||||||
|
{
|
||||||
|
path: 'RegistrationStatistics',
|
||||||
|
name: 'RegistrationStatistics',
|
||||||
|
component: './travelMember/RegistrationStatistics/index'
|
||||||
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ant-design-pro",
|
"name": "ant-design-pro",
|
||||||
"version": "4.5.11",
|
"version": "4.5.13",
|
||||||
"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": {
|
||||||
|
|||||||
@ -317,6 +317,7 @@ const DataDictionary: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
headerTitle="菜单管理"
|
headerTitle="菜单管理"
|
||||||
rowKey="SYSTEMMENU_ID"
|
rowKey="SYSTEMMENU_ID"
|
||||||
actionRef={actionRef}
|
actionRef={actionRef}
|
||||||
|
scroll={{ x: '100%', y: 'calc(100vh - 430px)' }}
|
||||||
pagination={{ defaultPageSize: 20 }}
|
pagination={{ defaultPageSize: 20 }}
|
||||||
request={async (params) => {
|
request={async (params) => {
|
||||||
console.log('currentUsercurrentUsercurrentUser', currentUser);
|
console.log('currentUsercurrentUsercurrentUser', currentUser);
|
||||||
|
|||||||
@ -0,0 +1,260 @@
|
|||||||
|
import { connect } from "umi";
|
||||||
|
import type { ConnectState } from "@/models/connect";
|
||||||
|
import { Button, Col, FormInstance, Modal, Popconfirm, Row } from "antd";
|
||||||
|
import { useEffect, useRef, useState } from "react";
|
||||||
|
import Draggable from "react-draggable";
|
||||||
|
import React from "react";
|
||||||
|
import ProForm, { ProFormSelect, ProFormText } from "@ant-design/pro-form";
|
||||||
|
import { handleGetCOMMODITYList } from "../service";
|
||||||
|
import session from "@/utils/session";
|
||||||
|
|
||||||
|
type DetailProps = {
|
||||||
|
showDetailDrawer: boolean
|
||||||
|
handleCloseModal: any
|
||||||
|
parentRow?: any
|
||||||
|
handleDelete?: any
|
||||||
|
}
|
||||||
|
const ShopDetailModal = ({ showDetailDrawer, handleCloseModal, parentRow, handleDelete }: DetailProps) => {
|
||||||
|
|
||||||
|
const modalRef = 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),
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
|
||||||
|
}, [showDetailDrawer])
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
title={parentRow?.COMMODITY_NAME || ""}
|
||||||
|
destroyOnClose={true}
|
||||||
|
width={1200}
|
||||||
|
visible={showDetailDrawer}
|
||||||
|
footer={<div style={{ width: '100%', display: 'flex', alignItems: 'center', justifyContent: 'space-between', boxSizing: 'border-box', padding: '0 32px' }}>
|
||||||
|
<div>
|
||||||
|
<Popconfirm
|
||||||
|
title="确认删除该商品?"
|
||||||
|
onConfirm={async () => {
|
||||||
|
if (handleDelete) {
|
||||||
|
handleDelete(parentRow?.COMMODITY_ID)
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onCancel={() => {
|
||||||
|
}}
|
||||||
|
okText="确认"
|
||||||
|
cancelText="取消"
|
||||||
|
>
|
||||||
|
<Button danger>删除</Button>
|
||||||
|
</Popconfirm>
|
||||||
|
</div>
|
||||||
|
<div></div>
|
||||||
|
</div>}
|
||||||
|
afterClose={() => {
|
||||||
|
modalRef.current?.resetFields();
|
||||||
|
// setCurrentRow(undefined);
|
||||||
|
}}
|
||||||
|
maskClosable={true}
|
||||||
|
bodyStyle={{
|
||||||
|
maxHeight: '850px', // 你可以根据需要调整高度
|
||||||
|
overflowY: 'auto',
|
||||||
|
}}
|
||||||
|
onCancel={() => {
|
||||||
|
handleCloseModal()
|
||||||
|
}}
|
||||||
|
modalRender={(modal) => {
|
||||||
|
return <Draggable
|
||||||
|
disabled={disabled}
|
||||||
|
bounds={bounds}
|
||||||
|
onStart={(event, uiData) => onDraggaleStart(event, uiData)}
|
||||||
|
handle=".modalTop"
|
||||||
|
>
|
||||||
|
<div ref={draggleRef}>{modal}</div>
|
||||||
|
</Draggable>
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
|
||||||
|
<ProForm
|
||||||
|
layout={'horizontal'}
|
||||||
|
formRef={modalRef}
|
||||||
|
submitter={false}
|
||||||
|
request={async () => {
|
||||||
|
if (parentRow?.COMMODITY_ID) {
|
||||||
|
let req: any = {
|
||||||
|
SearchParameter: {
|
||||||
|
COMMODITY_IDS: parentRow?.COMMODITY_ID
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const data = await handleGetCOMMODITYList(req)
|
||||||
|
console.log('datadatadatadata', data);
|
||||||
|
let list: any = data.Result_Data.List
|
||||||
|
if (list && list.length > 0) {
|
||||||
|
return list[0]
|
||||||
|
} else {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
|
||||||
|
<Row gutter={8}>
|
||||||
|
<Col span={8}>
|
||||||
|
<ProFormText
|
||||||
|
label={"商品名称"}
|
||||||
|
name={"COMMODITY_NAME"}
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col span={8}>
|
||||||
|
<ProFormText
|
||||||
|
label={"商品编码"}
|
||||||
|
name={"COMMODITY_CODE"}
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col span={8}>
|
||||||
|
<ProFormText
|
||||||
|
label={"商品类型"}
|
||||||
|
name={"COMMODITY_TYPE"}
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
|
||||||
|
<Col span={8}>
|
||||||
|
<ProFormSelect
|
||||||
|
label={"商品状态"}
|
||||||
|
name={"COMMODITY_STATE"}
|
||||||
|
options={[{ label: "有效", value: 1 }, { label: "无效", value: 0 }]}
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col span={8}>
|
||||||
|
<ProFormSelect
|
||||||
|
label={"商品业态"}
|
||||||
|
name={"BUSINESSTYPE"}
|
||||||
|
readonly
|
||||||
|
request={() => {
|
||||||
|
let list = session.get('SHOPTRADEList')
|
||||||
|
return list
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col span={8}>
|
||||||
|
<ProFormText
|
||||||
|
label={"商品单位"}
|
||||||
|
name={"COMMODITY_UNIT"}
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
|
||||||
|
<Col span={8}>
|
||||||
|
<ProFormText
|
||||||
|
label={"商品规格"}
|
||||||
|
name={"COMMODITY_RULE"}
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col span={8}>
|
||||||
|
<ProFormText
|
||||||
|
label={"商品产地"}
|
||||||
|
name={"COMMODITY_ORI"}
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col span={8}>
|
||||||
|
<ProFormSelect
|
||||||
|
label={"商品质量"}
|
||||||
|
name={"COMMODITY_GRADE"}
|
||||||
|
request={() => {
|
||||||
|
let list = session.get('COMMODITYGRADEList')
|
||||||
|
return list
|
||||||
|
}}
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
|
||||||
|
<Col span={8}>
|
||||||
|
<ProFormText
|
||||||
|
label={"零售价"}
|
||||||
|
name={"COMMODITY_RETAILPRICE"}
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col span={8}>
|
||||||
|
<ProFormText
|
||||||
|
label={"会员价"}
|
||||||
|
name={"COMMODITY_MEMBERPRICE"}
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col span={8}>
|
||||||
|
<ProFormText
|
||||||
|
label={"进货价"}
|
||||||
|
name={"COMMODITY_PURCHASEPRICE"}
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
|
||||||
|
<Col span={8}>
|
||||||
|
<ProFormText
|
||||||
|
label={"进货税率"}
|
||||||
|
name={"DUTY_PARAGRAPH"}
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col span={8}>
|
||||||
|
<ProFormText
|
||||||
|
label={"零售税率"}
|
||||||
|
name={"RETAIL_DUTY"}
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col span={8}>
|
||||||
|
<ProFormSelect
|
||||||
|
label={"是否可售"}
|
||||||
|
name={"CANSALE"}
|
||||||
|
options={[{ label: "是", value: 1 }, { label: "否", value: 0 }]}
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col span={8}>
|
||||||
|
<ProFormSelect
|
||||||
|
label={"是否散装"}
|
||||||
|
name={"ISBULK"}
|
||||||
|
options={[{ label: "是", value: 1 }, { label: "否", value: 0 }]}
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col span={8}>
|
||||||
|
<ProFormSelect
|
||||||
|
label={"称重方式"}
|
||||||
|
name={"METERINGMETHOD"}
|
||||||
|
options={[{ label: '计价', value: 1 }, { label: '散装称重', value: 0 }]}
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</ProForm>
|
||||||
|
</Modal >
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default connect(({ user, }: ConnectState) => ({
|
||||||
|
currentUser: user.currentUser,
|
||||||
|
}))(ShopDetailModal);
|
||||||
@ -0,0 +1,322 @@
|
|||||||
|
// 便利店商品审核
|
||||||
|
import { connect } from "umi";
|
||||||
|
import type { CurrentUser } from "umi";
|
||||||
|
import type { ConnectState } from "@/models/connect";
|
||||||
|
import React, { useRef, useState } from "react";
|
||||||
|
import ProCard from "@ant-design/pro-card";
|
||||||
|
import { MenuFoldOutlined } from "@ant-design/icons";
|
||||||
|
import type { FormInstance } from "antd";
|
||||||
|
import { Button, Input, InputNumber, message, Popconfirm, Space, Spin, Tree } from "antd";
|
||||||
|
import useRequest from "@ahooksjs/use-request";
|
||||||
|
import { getServerpartTree } from "@/services/options";
|
||||||
|
import type { ActionType } from "@ant-design/pro-table";
|
||||||
|
import ProTable from "@ant-design/pro-table";
|
||||||
|
import ReactHTMLTableToExcel from "react-html-table-to-excel";
|
||||||
|
import LeftSelectTree from "@/pages/reports/settlementAccount/component/leftSelectTree";
|
||||||
|
import PageTitleBox from "@/components/PageTitleBox";
|
||||||
|
import { handleApproveCommodityInfo_AHJG, handleDeleteCOMMODITY_RUNNING, handleGetCOMMODITY_RUNNINGList } from "./service";
|
||||||
|
import session from "@/utils/session";
|
||||||
|
import ShopDetailModal from "./components/ShopDetailModal";
|
||||||
|
|
||||||
|
|
||||||
|
const ConvenienceStoreProductReview: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||||
|
const { currentUser } = props
|
||||||
|
const downloadBtnRef = useRef<any>()
|
||||||
|
const actionRef = useRef<ActionType>();
|
||||||
|
const formRef = useRef<FormInstance>();
|
||||||
|
const [reqDetailList, setReqDetailList] = useState<any>(); // 合计项数据源
|
||||||
|
const [printOut, setPrintOut] = useState<any>(); // 打印数据的内容
|
||||||
|
const [collapsible, setCollapsible] = useState<boolean>(false)
|
||||||
|
const [treeView, setTreeView] = useState<any>()
|
||||||
|
const [printIndex, setPrintIndex] = useState<number>(new Date().getTime())
|
||||||
|
|
||||||
|
const serverpartObj = session.get('serverpartObj')
|
||||||
|
|
||||||
|
|
||||||
|
// 树相关的属性和方法
|
||||||
|
const [selectedId, setSelectedId] = useState<string>()
|
||||||
|
// 导出的加载效果
|
||||||
|
const [showLoading, setShowLoading] = useState<boolean>(false)
|
||||||
|
// 是否显示打印的表格
|
||||||
|
const [showExportTable, setShowExportTable] = useState<boolean>(false)
|
||||||
|
// 查询的条件
|
||||||
|
const [searchParams, setSearchParams] = useState<any>()
|
||||||
|
// 表格数据
|
||||||
|
const [tableData, setTableData] = useState<any>()
|
||||||
|
// 审批的loading效果
|
||||||
|
const [loading, setLoading] = useState<boolean>(false)
|
||||||
|
// 选中的行
|
||||||
|
const [selectedModalOrderRowKeys, setSelectedModalOrderRowKeys] = useState<any>()
|
||||||
|
// 选中的行数据
|
||||||
|
const [selectModalRowList, setSelectModalRowList] = useState<any>()
|
||||||
|
// 显示商品详情悬浮框
|
||||||
|
const [showShopDetail, setShowShopDetail] = useState<boolean>(false)
|
||||||
|
// 行数据
|
||||||
|
const [currentRow, setCurrentRow] = useState<any>()
|
||||||
|
|
||||||
|
const columns: any = [
|
||||||
|
{
|
||||||
|
title: '查询内容',
|
||||||
|
dataIndex: 'searchText',
|
||||||
|
hideInTable: true,
|
||||||
|
fieldProps: {
|
||||||
|
placeholder: '请输入商品名称'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "服务区",
|
||||||
|
width: 200,
|
||||||
|
dataIndex: "SERVERPART_ID",
|
||||||
|
hideInSearch: true,
|
||||||
|
valueType: 'select',
|
||||||
|
valueEnum: serverpartObj,
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "商品名称",
|
||||||
|
width: 200,
|
||||||
|
dataIndex: "COMMODITY_NAME",
|
||||||
|
hideInSearch: true,
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true,
|
||||||
|
render: (_, record) => {
|
||||||
|
return record?.COMMODITY_NAME ?
|
||||||
|
<a onClick={() => {
|
||||||
|
setCurrentRow(record)
|
||||||
|
setShowShopDetail(true)
|
||||||
|
}}>{record?.COMMODITY_NAME}</a> : "-"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "商品规格",
|
||||||
|
width: 150,
|
||||||
|
dataIndex: "COMMODITY_RULE",
|
||||||
|
hideInSearch: true,
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "商品类型",
|
||||||
|
width: 150,
|
||||||
|
dataIndex: "COMMODITY_TYPE",
|
||||||
|
hideInSearch: true,
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "商品价格",
|
||||||
|
width: 150,
|
||||||
|
dataIndex: "COMMODITY_CURRPRICE",
|
||||||
|
hideInSearch: true,
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true,
|
||||||
|
render: (_, record) => {
|
||||||
|
return <InputNumber min={0} defaultValue={record?.COMMODITY_CURRPRICE} onBlur={(e: any) => {
|
||||||
|
// 拿到当前输入的内容
|
||||||
|
let newPrice = e.target.value
|
||||||
|
let list = JSON.parse(JSON.stringify(tableData))
|
||||||
|
let newTableData: any = []
|
||||||
|
list.forEach((item: any) => {
|
||||||
|
if (item.COMMODITY_ID === record?.COMMODITY_ID) {
|
||||||
|
item.COMMODITY_CURRPRICE = newPrice
|
||||||
|
newTableData.push(item)
|
||||||
|
} else {
|
||||||
|
newTableData.push(item)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
setTableData(newTableData)
|
||||||
|
}} />
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "商品税率",
|
||||||
|
width: 150,
|
||||||
|
dataIndex: "DUTY_PARAGRAPH",
|
||||||
|
hideInSearch: true,
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "商品说明",
|
||||||
|
width: 250,
|
||||||
|
dataIndex: "COMMODITY_DESC",
|
||||||
|
hideInSearch: true,
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
// 批量审核
|
||||||
|
const handleBatchReviewCommodity = async () => {
|
||||||
|
// 拿到当前的审批列表
|
||||||
|
if (selectModalRowList && selectModalRowList.length > 0) {
|
||||||
|
// 商品勾选的行
|
||||||
|
let list: any = JSON.parse(JSON.stringify(selectedModalOrderRowKeys))
|
||||||
|
console.log('listlistlist', list);
|
||||||
|
console.log('tableDatatableDatatableData', tableData);
|
||||||
|
let reqList: any = []
|
||||||
|
// 判断是不是所有的价格都已经输入了
|
||||||
|
let isAllOk: boolean = true
|
||||||
|
// 没有价格的商品名称
|
||||||
|
let noPriceName: string = ''
|
||||||
|
tableData.forEach((item: any) => {
|
||||||
|
if (list.indexOf(item.COMMODITY_ID.toString()) !== -1) {
|
||||||
|
reqList.push(item)
|
||||||
|
}
|
||||||
|
if (!item.COMMODITY_CURRPRICE) {
|
||||||
|
isAllOk = false
|
||||||
|
if (noPriceName) {
|
||||||
|
noPriceName += `【${item.COMMODITY_NAME}】`
|
||||||
|
} else {
|
||||||
|
noPriceName = `【${item.COMMODITY_NAME}】`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
if (!isAllOk) {
|
||||||
|
message.error(`${noPriceName}为输入价格!`)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
let req: any = {
|
||||||
|
list: reqList
|
||||||
|
}
|
||||||
|
const data = await handleApproveCommodityInfo_AHJG(req)
|
||||||
|
console.log('datadatadatadata', data);
|
||||||
|
|
||||||
|
if (data.Result_Code === 100) {
|
||||||
|
message.success(data.Result_Desc)
|
||||||
|
setSelectedModalOrderRowKeys([])
|
||||||
|
setSelectModalRowList([])
|
||||||
|
actionRef.current?.reload()
|
||||||
|
} else {
|
||||||
|
message.error(data.Result_Desc)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
message.error('请选择审批商品!')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除商品
|
||||||
|
const handleBatchDeleteCommodity = async (id: any) => {
|
||||||
|
const req: any = {
|
||||||
|
COMMODITY_RUNNINGId: id
|
||||||
|
}
|
||||||
|
const data = await handleDeleteCOMMODITY_RUNNING(req)
|
||||||
|
if (data.Result_Code === 100) {
|
||||||
|
message.success('删除成功!')
|
||||||
|
handleCloseModal()
|
||||||
|
actionRef.current?.reload()
|
||||||
|
} else {
|
||||||
|
message.error(data.Result_Desc)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 关闭的方法
|
||||||
|
const handleCloseModal = () => {
|
||||||
|
setCurrentRow(undefined)
|
||||||
|
setShowShopDetail(false)
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div ref={(el) => {
|
||||||
|
// 打印报表
|
||||||
|
if (!reqDetailList || reqDetailList.length === 0) return;
|
||||||
|
setPrintOut(el);
|
||||||
|
}} >
|
||||||
|
|
||||||
|
<div style={{ backgroundColor: '#fff', display: 'flex' }}>
|
||||||
|
<LeftSelectTree setSelectedId={setSelectedId} setCollapsible={setCollapsible} collapsible={collapsible} />
|
||||||
|
<div style={{
|
||||||
|
width: !collapsible ? 'calc(100% - 300px)' : 'calc(100% - 60px)',
|
||||||
|
paddingTop: 0,
|
||||||
|
paddingBottom: 0,
|
||||||
|
paddingRight: 0
|
||||||
|
}}>
|
||||||
|
<ProTable
|
||||||
|
actionRef={actionRef}
|
||||||
|
formRef={formRef}
|
||||||
|
columns={columns}
|
||||||
|
bordered
|
||||||
|
expandable={{
|
||||||
|
expandRowByClick: true
|
||||||
|
}}
|
||||||
|
rowKey={(record: any) => {
|
||||||
|
return `${record?.COMMODITY_ID}`
|
||||||
|
}}
|
||||||
|
scroll={{ x: "100%", y: "calc(100vh - 430px)" }}
|
||||||
|
headerTitle={<PageTitleBox props={props} />} // 列表表头
|
||||||
|
search={{ span: 6 }}
|
||||||
|
dataSource={tableData}
|
||||||
|
request={async (params) => {
|
||||||
|
if (!selectedId) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
setSearchParams(params)
|
||||||
|
let req: any = {
|
||||||
|
SearchParameter: {
|
||||||
|
SERVERPART_IDS: selectedId,
|
||||||
|
BUSINESSTYPES: 1005
|
||||||
|
},
|
||||||
|
keyWord: {
|
||||||
|
Key: "COMMODITY_NAME",
|
||||||
|
Value: params?.searchText || ""
|
||||||
|
},
|
||||||
|
PageIndex: 1,
|
||||||
|
PageSize: 999999,
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = await handleGetCOMMODITY_RUNNINGList(req)
|
||||||
|
if (data.List && data.List.length > 0) {
|
||||||
|
setTableData(data.List)
|
||||||
|
return
|
||||||
|
// return { data: data.List, success: true }
|
||||||
|
}
|
||||||
|
setTableData([])
|
||||||
|
return
|
||||||
|
// return { data: [], success: true }
|
||||||
|
}}
|
||||||
|
toolbar={{
|
||||||
|
actions: [
|
||||||
|
<Popconfirm
|
||||||
|
title="确认批量审核已选商品?"
|
||||||
|
onConfirm={async () => {
|
||||||
|
if (loading) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
setLoading(true)
|
||||||
|
await handleBatchReviewCommodity()
|
||||||
|
setLoading(false)
|
||||||
|
}}
|
||||||
|
onCancel={() => {
|
||||||
|
}}
|
||||||
|
okText="确认"
|
||||||
|
cancelText="取消"
|
||||||
|
>
|
||||||
|
<Button type={"primary"} loading={loading}>批量审核</Button>
|
||||||
|
</Popconfirm>
|
||||||
|
]
|
||||||
|
}}
|
||||||
|
rowSelection={{
|
||||||
|
type: 'checkbox',
|
||||||
|
selectedRowKeys: selectedModalOrderRowKeys,
|
||||||
|
onChange: (selectedRowKeys: any, selectedRows: any) => {
|
||||||
|
setSelectModalRowList(selectedRows)
|
||||||
|
setSelectedModalOrderRowKeys(selectedRowKeys)
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<ShopDetailModal showDetailDrawer={showShopDetail} handleCloseModal={handleCloseModal} parentRow={currentRow} handleDelete={handleBatchDeleteCommodity} />
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default connect(({ user }: ConnectState) => ({
|
||||||
|
currentUser: user.currentUser
|
||||||
|
}))(ConvenienceStoreProductReview);
|
||||||
@ -0,0 +1,51 @@
|
|||||||
|
import request from "@/utils/request"
|
||||||
|
|
||||||
|
// 拿到便利店商品的审核列表
|
||||||
|
export async function handleGetCOMMODITY_RUNNINGList(params: any) {
|
||||||
|
const data = await request(`/Commodity/GetCOMMODITY_RUNNINGList`, {
|
||||||
|
method: 'POST',
|
||||||
|
data: { ...params, requestEncryption: true }
|
||||||
|
})
|
||||||
|
if (data.Result_Code !== 100) {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
return data.Result_Data
|
||||||
|
}
|
||||||
|
|
||||||
|
// 审核安徽建工便利店商品数据
|
||||||
|
export async function handleApproveCommodityInfo_AHJG(params: any) {
|
||||||
|
const data = await request(`/Commodity/ApproveCommodityInfo_AHJG`, {
|
||||||
|
method: 'POST',
|
||||||
|
data: { ...params, requestEncryption: true }
|
||||||
|
})
|
||||||
|
if (data.Result_Code !== 100) {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
return data
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 获取商品详情
|
||||||
|
export async function handleGetCOMMODITYList(params: any) {
|
||||||
|
const data = await request(`/Commodity/GetCOMMODITY_RUNNINGList`, {
|
||||||
|
method: 'POST',
|
||||||
|
data: { ...params, requestEncryption: true }
|
||||||
|
})
|
||||||
|
if (data.Result_Code !== 100) {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
return data
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 删除商品审核
|
||||||
|
export async function handleDeleteCOMMODITY_RUNNING(params: any) {
|
||||||
|
const data = await request(`/Commodity/DeleteCOMMODITY_RUNNING`, {
|
||||||
|
method: 'POST',
|
||||||
|
data: { ...params, requestEncryption: true }
|
||||||
|
})
|
||||||
|
if (data.Result_Code !== 100) {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
return data
|
||||||
|
}
|
||||||
@ -22,6 +22,7 @@ import { deletePicture, uploadPicture } from "@/services/picture";
|
|||||||
import PrintContent from "./printContent";
|
import PrintContent from "./printContent";
|
||||||
import { handleHighPrecision } from "@/utils/utils";
|
import { handleHighPrecision } from "@/utils/utils";
|
||||||
import HistoricalProjects from "./HistoricalProjects";
|
import HistoricalProjects from "./HistoricalProjects";
|
||||||
|
import { getProjectDetail } from "@/pages/BussinessProject/service";
|
||||||
|
|
||||||
const { confirm } = Modal;
|
const { confirm } = Modal;
|
||||||
type DetailProps = {
|
type DetailProps = {
|
||||||
@ -131,6 +132,8 @@ const YearExamineDetailTable = ({ parentRow, currentApprovalstate, onRef, setIsS
|
|||||||
const [showRentReduction, setShowRentReduction] = useState<boolean>(false)
|
const [showRentReduction, setShowRentReduction] = useState<boolean>(false)
|
||||||
// 悬浮框的加载效果
|
// 悬浮框的加载效果
|
||||||
const [rentReductionLoading, setRentReductionLoading] = useState<boolean>(false)
|
const [rentReductionLoading, setRentReductionLoading] = useState<boolean>(false)
|
||||||
|
// 项目详情
|
||||||
|
const [dataProjectDetail, setDataProjectDetail] = useState<any>()
|
||||||
|
|
||||||
|
|
||||||
const columns: any = [
|
const columns: any = [
|
||||||
@ -2420,6 +2423,8 @@ const YearExamineDetailTable = ({ parentRow, currentApprovalstate, onRef, setIsS
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const dataProject = await getProjectDetail(parentRow?.BUSINESSPROJECT_ID)
|
||||||
|
setDataProjectDetail(dataProject)
|
||||||
// if (parentRow?.BUSINESSAPPROVAL_ID) {
|
// if (parentRow?.BUSINESSAPPROVAL_ID) {
|
||||||
// handleGetProcessProgress(parentRow?.BUSINESSAPPROVAL_ID)
|
// handleGetProcessProgress(parentRow?.BUSINESSAPPROVAL_ID)
|
||||||
// }
|
// }
|
||||||
@ -2480,8 +2485,8 @@ const YearExamineDetailTable = ({ parentRow, currentApprovalstate, onRef, setIsS
|
|||||||
</span>,
|
</span>,
|
||||||
<>
|
<>
|
||||||
{
|
{
|
||||||
parentRow?.CLOSED_DATE ?
|
parentRow?.CLOSED_DATE || dataProjectDetail?.CLOSED_DATE ?
|
||||||
<Typography.Text type="secondary" style={{ marginRight: '4px' }}>撤场时间:{parentRow?.CLOSED_DATE}</Typography.Text>
|
<Typography.Text type="secondary" style={{ marginRight: '4px' }}>撤场时间:{parentRow?.CLOSED_DATE || dataProjectDetail?.CLOSED_DATE}</Typography.Text>
|
||||||
: ''
|
: ''
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { connect } from "umi";
|
import { connect } from "umi";
|
||||||
import type { ConnectState } from "@/models/connect";
|
import type { ConnectState } from "@/models/connect";
|
||||||
import { Button, Col, Drawer, message, Modal, Popconfirm, Row } from "antd";
|
import { Button, Col, Drawer, message, Modal, Popconfirm, Row } from "antd";
|
||||||
import { useRef, useState } from "react";
|
import { useEffect, useRef, useState } from "react";
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
import { handleApprovePeriodAccount, handleGetPictureList } from "../service";
|
import { handleApprovePeriodAccount, handleGetPictureList } from "../service";
|
||||||
import YearContentTable from "./yearContentTable";
|
import YearContentTable from "./yearContentTable";
|
||||||
@ -19,6 +19,7 @@ import React from "react";
|
|||||||
import { handleCreateSettlement, handleSynchroRevenueConfirmList } from "@/pages/reports/settlementDetail/service";
|
import { handleCreateSettlement, handleSynchroRevenueConfirmList } from "@/pages/reports/settlementDetail/service";
|
||||||
import Item from "antd/lib/list/Item";
|
import Item from "antd/lib/list/Item";
|
||||||
import { deletePicture, uploadPicture } from "@/services/picture";
|
import { deletePicture, uploadPicture } from "@/services/picture";
|
||||||
|
import { getProjectDetail } from "@/pages/BussinessProject/service";
|
||||||
|
|
||||||
const { confirm } = Modal;
|
const { confirm } = Modal;
|
||||||
type DetailProps = {
|
type DetailProps = {
|
||||||
@ -74,6 +75,8 @@ const YearExamineProcess = ({ currentUser, onShow, setOnShow, parentRow, setPare
|
|||||||
const [fileLists, setFileLists] = useState<any>()
|
const [fileLists, setFileLists] = useState<any>()
|
||||||
// 判断拿到驳回类型
|
// 判断拿到驳回类型
|
||||||
const [rejectTypeDetail, setRejectTypeDetail] = useState<any>()
|
const [rejectTypeDetail, setRejectTypeDetail] = useState<any>()
|
||||||
|
// 项目详情
|
||||||
|
const [ProjectDetail, setProjectDetail] = useState<any>()
|
||||||
|
|
||||||
// 新建结算申请
|
// 新建结算申请
|
||||||
const handleCreateSettlementApplication = async () => {
|
const handleCreateSettlementApplication = async () => {
|
||||||
@ -842,6 +845,10 @@ const YearExamineProcess = ({ currentUser, onShow, setOnShow, parentRow, setPare
|
|||||||
<div ref={draggleRef}>{modal}</div>
|
<div ref={draggleRef}>{modal}</div>
|
||||||
</Draggable>
|
</Draggable>
|
||||||
}}
|
}}
|
||||||
|
bodyStyle={{
|
||||||
|
height: '700px', // 你可以根据需要调整高度
|
||||||
|
overflowY: 'auto',
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<YearExamineTable examineDetail={parentRow} />
|
<YearExamineTable examineDetail={parentRow} />
|
||||||
|
|
||||||
@ -995,14 +1002,34 @@ const YearExamineProcess = ({ currentUser, onShow, setOnShow, parentRow, setPare
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 剔除 结算时间在2025年4月1日 之后的数据 不给孙青
|
// 拿个项目撤场时间
|
||||||
if (parentRow?.ENDDATE && new Date(parentRow?.ENDDATE).getTime() > new Date('2025-04-01 00:00:00').getTime()) {
|
const dataProject = await getProjectDetail(parentRow?.BUSINESSPROJECT_ID)
|
||||||
list = list.filter((item: any) => item.value !== 827);
|
console.log('dataProjectdataProjectdataProjectdataProject', dataProject);
|
||||||
|
setProjectDetail(dataProject)
|
||||||
|
|
||||||
|
// 剔除 结算时间在2025年4月1日 之后的数据 不给孙青 如果提前撤场时间还在 4月1号之前的话 那还是给孙青
|
||||||
|
// 先判断是不是撤场项目 如果是 那就看时间 如果4月1号之前的 就不排除孙青 如果4月1号之后 就排除孙青
|
||||||
|
if (dataProject?.CLOSED_DATE) {
|
||||||
|
if (new Date(dataProject?.CLOSED_DATE).getTime() > new Date('2025-04-01 00:00:00').getTime()) {
|
||||||
|
list = list.filter((item: any) => item.value !== 827);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (parentRow?.ENDDATE && new Date(parentRow?.ENDDATE).getTime() > new Date('2025-04-01 00:00:00').getTime()) {
|
||||||
|
list = list.filter((item: any) => item.value !== 827);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 剔除 结算时间在2025年4月1日 之前的数据 不给陶杰
|
// 剔除 结算时间在2025年4月1日 之前的数据 不给陶杰
|
||||||
if (parentRow?.ENDDATE && new Date(parentRow?.ENDDATE).getTime() < new Date('2025-04-01 00:00:00').getTime()) {
|
// 这里也同理 如果 撤场时间在4月1号之前 那么就要排除陶杰
|
||||||
list = list.filter((item: any) => item.value !== 1802);
|
if (dataProject?.CLOSED_DATE) {
|
||||||
|
if (new Date(dataProject?.CLOSED_DATE).getTime() <= new Date('2025-04-01 00:00:00').getTime()) {
|
||||||
|
list = list.filter((item: any) => item.value !== 1802);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (parentRow?.ENDDATE && new Date(parentRow?.ENDDATE).getTime() < new Date('2025-04-01 00:00:00').getTime()) {
|
||||||
|
list = list.filter((item: any) => item.value !== 1802);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,11 +1,156 @@
|
|||||||
// 热销滞销分析
|
// 热销滞销分析
|
||||||
|
import PageTitleBox from "@/components/PageTitleBox";
|
||||||
import { ConnectState } from "@/models/connect";
|
import { ConnectState } from "@/models/connect";
|
||||||
|
import ProTable, { ActionType } from "@ant-design/pro-table";
|
||||||
|
import { FormInstance } from "antd";
|
||||||
|
import { useRef, useState } from "react";
|
||||||
import { connect, CurrentUser } from "umi";
|
import { connect, CurrentUser } from "umi";
|
||||||
|
import { handeGetCommoditySaleSummary } from "../service";
|
||||||
|
import moment from 'moment'
|
||||||
|
|
||||||
const AnalysisOfHotSellingButUnsoldProducts: React.FC<{ currentUser: CurrentUser | undefined }> = (props) => {
|
const AnalysisOfHotSellingButUnsoldProducts: React.FC<{ currentUser: CurrentUser | undefined }> = (props) => {
|
||||||
|
const { currentUser } = props
|
||||||
|
const actionRef = useRef<ActionType>();
|
||||||
|
const formRef = useRef<FormInstance>();
|
||||||
|
// 树相关的属性和方法
|
||||||
|
const [selectedId, setSelectedId] = useState<string>()
|
||||||
|
// 查询的条件
|
||||||
|
const [searchParams, setSearchParams] = useState<any>()
|
||||||
|
|
||||||
|
const columns: any = [
|
||||||
|
{
|
||||||
|
title: '统计时间',
|
||||||
|
dataIndex: 'search_date',
|
||||||
|
valueType: 'dateRange',
|
||||||
|
hideInTable: true,
|
||||||
|
hideInDescriptions: true,
|
||||||
|
initialValue: [moment().subtract(1, 'month'), moment()],
|
||||||
|
search: {
|
||||||
|
transform: (value: any) => {
|
||||||
|
return {
|
||||||
|
StartDate: value[0],
|
||||||
|
EndDate: value[1],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "订单类型",
|
||||||
|
dataIndex: "SaleBillType",
|
||||||
|
valueType: 'select',
|
||||||
|
hideInTable: true,
|
||||||
|
valueEnum: {
|
||||||
|
"3000": "零售商城",
|
||||||
|
"3001": "工会商城",
|
||||||
|
"3002": "品诺商城",
|
||||||
|
"3010": "积分商城",
|
||||||
|
"6000": "点餐订单",
|
||||||
|
},
|
||||||
|
initialValue: "3000",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: <div style={{ textAlign: 'center' }}>商品名称</div>,
|
||||||
|
width: 300,
|
||||||
|
dataIndex: "Commodity_Name",
|
||||||
|
hideInSearch: true,
|
||||||
|
align: 'left',
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "商品条码",
|
||||||
|
width: 150,
|
||||||
|
dataIndex: "Commodity_Barcode",
|
||||||
|
hideInSearch: true,
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "商品规格",
|
||||||
|
width: 150,
|
||||||
|
dataIndex: "Commodity_Rule",
|
||||||
|
hideInSearch: true,
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "零售价格",
|
||||||
|
width: 150,
|
||||||
|
dataIndex: "Commodity_RetailPrice",
|
||||||
|
hideInSearch: true,
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "订单笔数",
|
||||||
|
width: 150,
|
||||||
|
dataIndex: "Ticket_Count",
|
||||||
|
hideInSearch: true,
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "销售数量",
|
||||||
|
width: 150,
|
||||||
|
dataIndex: "Total_Count",
|
||||||
|
hideInSearch: true,
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "订单金额",
|
||||||
|
width: 150,
|
||||||
|
dataIndex: "Total_Amount",
|
||||||
|
hideInSearch: true,
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "实付金额",
|
||||||
|
width: 150,
|
||||||
|
dataIndex: "Actual_Amount",
|
||||||
|
hideInSearch: true,
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true,
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
|
<ProTable
|
||||||
|
actionRef={actionRef}
|
||||||
|
formRef={formRef}
|
||||||
|
columns={columns}
|
||||||
|
bordered
|
||||||
|
expandable={{
|
||||||
|
expandRowByClick: true
|
||||||
|
}}
|
||||||
|
scroll={{ x: "100%", y: "calc(100vh - 410px)" }}
|
||||||
|
headerTitle={<PageTitleBox props={props} />} // 列表表头
|
||||||
|
search={{ span: 6 }}
|
||||||
|
request={async (params) => {
|
||||||
|
const req: any = {
|
||||||
|
OwnerUnitId: currentUser?.OwnerUnitId,
|
||||||
|
ServerpartId: "",
|
||||||
|
StartDate: params?.StartDate || "",
|
||||||
|
EndDate: params?.EndDate || "",
|
||||||
|
SaleBillType: params?.SaleBillType || ""
|
||||||
|
}
|
||||||
|
|
||||||
|
setSearchParams(params)
|
||||||
|
const data = await handeGetCommoditySaleSummary(req)
|
||||||
|
console.log('datadatadatadata', data);
|
||||||
|
if (data.List && data.List.length > 0) {
|
||||||
|
return { data: data.List, success: true }
|
||||||
|
}
|
||||||
|
return { data: [], success: true }
|
||||||
|
}}
|
||||||
|
toolbar={{
|
||||||
|
actions: [
|
||||||
|
]
|
||||||
|
}}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +1,584 @@
|
|||||||
// 失物招领申请
|
import { connect } from "umi";
|
||||||
import { ConnectState } from "@/models/connect";
|
import type { CurrentUser } from "umi";
|
||||||
import { connect, CurrentUser } from "umi";
|
import type { ConnectState } from "@/models/connect";
|
||||||
|
import React, { useRef, useState } from "react";
|
||||||
|
import ProCard from "@ant-design/pro-card";
|
||||||
|
import { ExclamationCircleOutlined, MenuFoldOutlined } from "@ant-design/icons";
|
||||||
|
import { Col, FormInstance, Modal, Popconfirm, Row } from "antd";
|
||||||
|
import { Button, message, Space, Spin, Tree, Image } from "antd";
|
||||||
|
import useRequest from "@ahooksjs/use-request";
|
||||||
|
import { getFieldEnumTree, getServerpartTree } from "@/services/options";
|
||||||
|
import type { ActionType } from "@ant-design/pro-table";
|
||||||
|
import ProTable from "@ant-design/pro-table";
|
||||||
|
import ReactHTMLTableToExcel from "react-html-table-to-excel";
|
||||||
|
import LeftSelectTree from "@/pages/reports/settlementAccount/component/leftSelectTree";
|
||||||
|
import PageTitleBox from "@/components/PageTitleBox";
|
||||||
|
import moment from 'moment'
|
||||||
|
import ProForm, { ProFormDatePicker, ProFormDateRangePicker, ProFormSelect, ProFormText, ProFormTextArea, ProFormTreeSelect, ProFormUploadButton } from "@ant-design/pro-form";
|
||||||
|
import { handleGetPictureList } from "@/pages/reports/settlementAccount/service";
|
||||||
|
import session from "@/utils/session";
|
||||||
|
import { handeDeleteSUGGESTION, handeGetPictureList, handeGetSUGGESTIONList, handeSynchroSUGGESTION } from "../service";
|
||||||
|
import { deletePicture, uploadPicture } from "@/services/picture";
|
||||||
|
|
||||||
const LostandFoundAPPliance: React.FC<{ currentUser: CurrentUser | undefined }> = (props) => {
|
const beforeUpload = (file: any) => {
|
||||||
|
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
|
||||||
|
if (!isJpgOrPng) {
|
||||||
|
message.error('请上传JPEG、jpg、png格式的图片文件!');
|
||||||
|
}
|
||||||
|
const isLt2M = file.size / 1024 / 1024 < 5;
|
||||||
|
if (!isLt2M) {
|
||||||
|
message.error('图片大小不超过 5MB!');
|
||||||
|
}
|
||||||
|
return isJpgOrPng && isLt2M;
|
||||||
|
}
|
||||||
|
|
||||||
|
const LostandFoundAPPliance: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||||
|
const { confirm } = Modal;
|
||||||
|
const { currentUser } = props
|
||||||
|
const downloadBtnRef = useRef<any>()
|
||||||
|
const actionRef = useRef<ActionType>();
|
||||||
|
const formRef = useRef<FormInstance>();
|
||||||
|
const modalRef = useRef<FormInstance>();
|
||||||
|
const [reqDetailList, setReqDetailList] = useState<any>(); // 合计项数据源
|
||||||
|
const [printOut, setPrintOut] = useState<any>(); // 打印数据的内容
|
||||||
|
const [collapsible, setCollapsible] = useState<boolean>(false)
|
||||||
|
const [treeView, setTreeView] = useState<any>()
|
||||||
|
const [printIndex, setPrintIndex] = useState<number>(new Date().getTime())
|
||||||
|
const [lostTypeList, setLostTypeList] = useState<any>()
|
||||||
|
const [lostTypeObj, setLostTypeObj] = useState<any>()
|
||||||
|
// 显示新增窗口
|
||||||
|
const [showAddModal, setShowAddModal] = useState<boolean>(false)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 树相关的属性和方法
|
||||||
|
const [selectedId, setSelectedId] = useState<string>()
|
||||||
|
// 导出的加载效果
|
||||||
|
const [showLoading, setShowLoading] = useState<boolean>(false)
|
||||||
|
// 是否显示打印的表格
|
||||||
|
const [showExportTable, setShowExportTable] = useState<boolean>(false)
|
||||||
|
// 查询的条件
|
||||||
|
const [searchParams, setSearchParams] = useState<any>()
|
||||||
|
// 当前选中行数据
|
||||||
|
const [currentRow, setCurrentRow] = useState<any>()
|
||||||
|
// 弹出框的确认效果
|
||||||
|
const [confirmLoading, setConfirmLoading] = useState<boolean>(false)
|
||||||
|
// 图片列表
|
||||||
|
const [fileList, setFileList] = useState<any>()
|
||||||
|
|
||||||
|
const [imagePreviewVisible, setImagePreviewVisible] = useState<boolean>(false) // 预览图片
|
||||||
|
|
||||||
|
const { loading: serverpartloading, data: myServerpartList = [] } = useRequest(async () => {
|
||||||
|
const list = await getFieldEnumTree({ FieldExplainField: 'business_target' })
|
||||||
|
let lostList: any = []
|
||||||
|
if (list && list.length > 0) {
|
||||||
|
list.forEach((item: any) => {
|
||||||
|
if (item.value === 6000) {
|
||||||
|
lostList = item.children
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
setLostTypeList(lostList)
|
||||||
|
let obj: any = {}
|
||||||
|
if (lostList && lostList.length > 0) {
|
||||||
|
lostList.forEach((item: any) => {
|
||||||
|
item.disabled = true
|
||||||
|
if (item.children && item.children.length > 0) {
|
||||||
|
item.children.forEach((subItem: any) => {
|
||||||
|
obj[subItem.value] = subItem.label
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
setLostTypeObj(obj)
|
||||||
|
return lostList
|
||||||
|
})
|
||||||
|
|
||||||
|
const columns: any = [
|
||||||
|
{
|
||||||
|
title: '统计时间',
|
||||||
|
dataIndex: 'search_date',
|
||||||
|
valueType: 'dateRange',
|
||||||
|
hideInTable: true,
|
||||||
|
hideInDescriptions: true,
|
||||||
|
initialValue: [moment().subtract(1, 'month'), moment()],
|
||||||
|
search: {
|
||||||
|
transform: (value: any) => {
|
||||||
|
return {
|
||||||
|
StartDate: value[0],
|
||||||
|
EndDate: value[1],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// title: '失物类型',
|
||||||
|
// width: 150,
|
||||||
|
// dataIndex: 'ENUM_LABEL',
|
||||||
|
// valueType: 'treeSelect',
|
||||||
|
// request: async () => {
|
||||||
|
// return myServerpartList
|
||||||
|
// },
|
||||||
|
// // valueEnum: lostTypeList,
|
||||||
|
// fieldProps: {
|
||||||
|
// showSearch: true,
|
||||||
|
// allowClear: true,
|
||||||
|
// treeDefaultExpandAll: true,
|
||||||
|
// filterTreeNode: (inputValue: any, treeNode: any) => {
|
||||||
|
// // 通过 label 搜索
|
||||||
|
// return treeNode.label.toLowerCase().includes(inputValue.toLowerCase());
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// render: (_, record) => {
|
||||||
|
// return record?.ENUM_LABEL && lostTypeObj ? lostTypeObj[record?.ENUM_LABEL] : '-'
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
title: '服务区名称',
|
||||||
|
width: 150,
|
||||||
|
dataIndex: 'SERVERPART_NAME',
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true,
|
||||||
|
hideInSearch: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '物品名称',
|
||||||
|
width: 150,
|
||||||
|
dataIndex: 'SUGGESTION_TITLE',
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true,
|
||||||
|
hideInSearch: true,
|
||||||
|
render: (_, record) => {
|
||||||
|
return record?.SUGGESTION_TITLE ? <a onClick={() => {
|
||||||
|
setCurrentRow(record)
|
||||||
|
setShowAddModal(true)
|
||||||
|
}}>{record?.SUGGESTION_TITLE || "-"}</a> : "-"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '申请状态',
|
||||||
|
width: 150,
|
||||||
|
dataIndex: 'SUGGESTION_STATE',
|
||||||
|
align: 'center',
|
||||||
|
valueType: 'select',
|
||||||
|
valueEnum: {
|
||||||
|
"2": "审核中",
|
||||||
|
"9": "已驳回"
|
||||||
|
},
|
||||||
|
ellipsis: true,
|
||||||
|
hideInSearch: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '发现时间',
|
||||||
|
width: 150,
|
||||||
|
dataIndex: 'SUGGESTION_CREATEDATE',
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true,
|
||||||
|
hideInSearch: true,
|
||||||
|
render: (_, record) => {
|
||||||
|
return record?.SUGGESTION_CREATEDATE ? moment(record?.SUGGESTION_CREATEDATE).format('YYYY-MM-DD HH:mm') : ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '联系电话',
|
||||||
|
width: 150,
|
||||||
|
dataIndex: 'PHONE_NUMBER',
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true,
|
||||||
|
hideInSearch: true,
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// title: '操作',
|
||||||
|
// dataIndex: "options",
|
||||||
|
// hideInSearch: true,
|
||||||
|
// width: 120,
|
||||||
|
// align: 'center',
|
||||||
|
// ellipsis: true,
|
||||||
|
// render: (_, record) => {
|
||||||
|
// return <div>
|
||||||
|
// <a onClick={() => {
|
||||||
|
// setCurrentRow(record)
|
||||||
|
// setShowAddModal(true)
|
||||||
|
// }}>
|
||||||
|
// 编辑
|
||||||
|
// </a>
|
||||||
|
// <Popconfirm
|
||||||
|
// title={'确认删除?'}
|
||||||
|
// onConfirm={() => {
|
||||||
|
// handleDeleteThing(record?.SUGGESTION_ID)
|
||||||
|
// }}
|
||||||
|
// >
|
||||||
|
// <a style={{ marginLeft: '8px' }}>删除</a>
|
||||||
|
// </Popconfirm>
|
||||||
|
|
||||||
|
// </div>
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
// 悬浮框的关闭事件
|
||||||
|
const handleModalClose = () => {
|
||||||
|
setConfirmLoading(false)
|
||||||
|
setCurrentRow(undefined)
|
||||||
|
setFileList([])
|
||||||
|
setShowAddModal(false)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增
|
||||||
|
const handleAddLostThing = async (obj: any) => {
|
||||||
|
let serverpartObj: any = session.get('serverpartObj')
|
||||||
|
let req: any = {}
|
||||||
|
if (currentRow?.SUGGESTION_ID) {
|
||||||
|
req = {
|
||||||
|
...currentRow,
|
||||||
|
...obj,
|
||||||
|
SUGGESTION_ID: currentRow?.SUGGESTION_ID,
|
||||||
|
SUGGESTION_STATE: 2,
|
||||||
|
OPERATE_DATE: moment().format('YYYY-MM-DD HH:mm:ss'),
|
||||||
|
SUGGESTION_CREATEDATE: obj?.SUGGESTION_CREATEDATE ? moment(obj?.SUGGESTION_CREATEDATE).format('YYYY-MM-DD HH:mm:ss') : '',
|
||||||
|
SERVERPART_NAME: obj.SERVERPART_ID ? serverpartObj[obj.SERVERPART_ID] : ''
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
req = {
|
||||||
|
...obj,
|
||||||
|
OPERATE_DATE: moment().format('YYYY-MM-DD HH:mm:ss'),
|
||||||
|
PROVINCE_CODE: currentUser?.ProvinceCode,
|
||||||
|
SUGGESTION_CREATEDATE: obj?.SUGGESTION_CREATEDATE ? moment(obj?.SUGGESTION_CREATEDATE).format('YYYY-MM-DD HH:mm:ss') : '',
|
||||||
|
SUGGESTION_STATE: 2,
|
||||||
|
SUGGESTION_TYPE: 4000,
|
||||||
|
SERVERPART_NAME: obj.SERVERPART_ID ? serverpartObj[obj.SERVERPART_ID] : ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('req', req);
|
||||||
|
const data = await handeSynchroSUGGESTION(req)
|
||||||
|
if (data.Result_Code === 100) {
|
||||||
|
console.log('datadatadatadata', data);
|
||||||
|
message.success(data.Result_Desc)
|
||||||
|
if (obj.SCENICAREA_Image && obj.SCENICAREA_Image.length > 0) {
|
||||||
|
handleSaveImg(obj.SCENICAREA_Image, data.Result_Data)
|
||||||
|
}
|
||||||
|
handleModalClose()
|
||||||
|
actionRef.current?.reload()
|
||||||
|
} else {
|
||||||
|
message.error(data.Result_Desc)
|
||||||
|
setConfirmLoading(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 保存图片
|
||||||
|
const handleSaveImg = async (imgList: any, objData: any) => {
|
||||||
|
// objData 保存之后的数据
|
||||||
|
const formData = new FormData();
|
||||||
|
imgList.forEach((file: any) => {
|
||||||
|
formData.append('files[]', file.originFileObj);
|
||||||
|
formData.append('ImageName', typeof file !== 'string' ? file?.name : '');
|
||||||
|
});
|
||||||
|
formData.append('TableId', objData.SUGGESTION_ID);
|
||||||
|
// formData.append('TableId', shopData.COMMODITY_ID);
|
||||||
|
formData.append('TableType', "1306");
|
||||||
|
|
||||||
|
console.log('formData', formData);
|
||||||
|
let res = await uploadPicture(formData)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除
|
||||||
|
const handleDeleteThing = async (id: any) => {
|
||||||
|
const data = await handeDeleteSUGGESTION({ SUGGESTIONId: id })
|
||||||
|
if (data.Result_Code === 100) {
|
||||||
|
message.success(data.Result_Desc)
|
||||||
|
actionRef.current?.reload()
|
||||||
|
} else {
|
||||||
|
message.error(data.Result_Desc)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 预览上传后的图片
|
||||||
|
const handlePreview = async () => {
|
||||||
|
setFileList(fileList)
|
||||||
|
setImagePreviewVisible(true)
|
||||||
|
};
|
||||||
|
const handleChangePreview = (val: any) => {
|
||||||
|
setImagePreviewVisible(val)
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<div>
|
<div ref={(el) => {
|
||||||
|
// 打印报表
|
||||||
|
if (!reqDetailList || reqDetailList.length === 0) return;
|
||||||
|
setPrintOut(el);
|
||||||
|
}} >
|
||||||
|
|
||||||
|
<div className={`saleReportHideBox${printIndex}`} style={{ position: 'fixed', zIndex: -1, top: 0, left: 0 }}>
|
||||||
|
{
|
||||||
|
showExportTable && reqDetailList && reqDetailList.length > 0 ?
|
||||||
|
<ProTable
|
||||||
|
columns={columns}
|
||||||
|
dataSource={reqDetailList}
|
||||||
|
pagination={false}
|
||||||
|
expandable={{
|
||||||
|
defaultExpandAllRows: true
|
||||||
|
}}
|
||||||
|
/> : ''
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
<div id='hiddenBox' style={{ position: 'fixed', zIndex: -1, top: 0, left: 0 }} />
|
||||||
|
|
||||||
|
<div style={{ backgroundColor: '#fff', display: 'flex' }}>
|
||||||
|
<LeftSelectTree setSelectedId={setSelectedId} setCollapsible={setCollapsible} collapsible={collapsible} />
|
||||||
|
<div style={{
|
||||||
|
width: !collapsible ? 'calc(100% - 300px)' : 'calc(100% - 60px)',
|
||||||
|
paddingTop: 0,
|
||||||
|
paddingBottom: 0,
|
||||||
|
paddingRight: 0
|
||||||
|
}}>
|
||||||
|
<ProTable
|
||||||
|
actionRef={actionRef}
|
||||||
|
formRef={formRef}
|
||||||
|
columns={columns}
|
||||||
|
bordered
|
||||||
|
expandable={{
|
||||||
|
expandRowByClick: true
|
||||||
|
}}
|
||||||
|
headerTitle={<PageTitleBox props={props} />}
|
||||||
|
search={{ span: 6 }}
|
||||||
|
request={async (params) => {
|
||||||
|
if (!selectedId) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const req: any = {
|
||||||
|
SearchParameter: {
|
||||||
|
SUGGESTION_TYPES: 4000,
|
||||||
|
SERVERPART_IDS: selectedId,
|
||||||
|
SUGGESTION_STATES: "2,9",
|
||||||
|
ENUM_LABEL: params?.ENUM_LABEL || ''
|
||||||
|
},
|
||||||
|
PageIndex: 1,
|
||||||
|
PageSize: 999999,
|
||||||
|
}
|
||||||
|
setSearchParams(params)
|
||||||
|
|
||||||
|
const data = await handeGetSUGGESTIONList(req)
|
||||||
|
if (data && data.length > 0) {
|
||||||
|
return { data, success: true }
|
||||||
|
}
|
||||||
|
return { data: [], success: true }
|
||||||
|
}}
|
||||||
|
toolbar={{
|
||||||
|
actions: [
|
||||||
|
<Button type="primary" onClick={() => {
|
||||||
|
setShowAddModal(true)
|
||||||
|
}}>新增失物招领</Button>
|
||||||
|
]
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* 图片预览组件 */}
|
||||||
|
{fileList && fileList.length > 0 && <div style={{ display: 'none' }}>
|
||||||
|
<Image.PreviewGroup
|
||||||
|
preview={{
|
||||||
|
visible: imagePreviewVisible,
|
||||||
|
onVisibleChange: vis => {
|
||||||
|
handleChangePreview(vis)
|
||||||
|
}
|
||||||
|
}}>
|
||||||
|
{
|
||||||
|
fileList.map((n) => <Image src={n.url} key={n.url} />)
|
||||||
|
}
|
||||||
|
</Image.PreviewGroup>
|
||||||
|
</div>}
|
||||||
|
|
||||||
|
<Modal
|
||||||
|
title={currentRow ? "编辑失物信息" : "新增失物信息"}
|
||||||
|
destroyOnClose={true}
|
||||||
|
width={900}
|
||||||
|
bodyStyle={{
|
||||||
|
height: '700px', // 你可以根据需要调整高度
|
||||||
|
overflowY: 'auto',
|
||||||
|
}}
|
||||||
|
visible={showAddModal}
|
||||||
|
confirmLoading={confirmLoading}
|
||||||
|
onCancel={() => {
|
||||||
|
handleModalClose()
|
||||||
|
}}
|
||||||
|
okText={"发起申请"}
|
||||||
|
onOk={async () => { // 提交框内的数据
|
||||||
|
modalRef.current?.validateFields().then(async (res: any) => {
|
||||||
|
setConfirmLoading(true)
|
||||||
|
await handleAddLostThing(res)
|
||||||
|
setConfirmLoading(false)
|
||||||
|
})
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<ProForm
|
||||||
|
formRef={modalRef}
|
||||||
|
layout={'horizontal'}
|
||||||
|
submitter={false}
|
||||||
|
request={async () => {
|
||||||
|
if (currentRow?.SUGGESTION_ID) {
|
||||||
|
let imgList: any = []
|
||||||
|
if (currentRow?.ImageList && currentRow?.ImageList.length > 0) {
|
||||||
|
currentRow?.ImageList.forEach((item: any) => {
|
||||||
|
imgList.push({
|
||||||
|
label: item.ImageName,
|
||||||
|
url: item.ImageUrl
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
setFileList(imgList)
|
||||||
|
return { ...currentRow, SCENICAREA_Image: imgList }
|
||||||
|
}
|
||||||
|
return {}
|
||||||
|
}}
|
||||||
|
labelCol={{ style: { width: 80 } }}
|
||||||
|
>
|
||||||
|
<Row gutter={16}>
|
||||||
|
<Col span={12}>
|
||||||
|
<ProFormSelect
|
||||||
|
label={'服务区'}
|
||||||
|
name={'SERVERPART_ID'}
|
||||||
|
rules={[{
|
||||||
|
required: true,
|
||||||
|
message: '请选择服务区'
|
||||||
|
}]}
|
||||||
|
request={async () => {
|
||||||
|
let serverpartList = session.get('serverpartList')
|
||||||
|
let list: any = []
|
||||||
|
if (serverpartList && serverpartList.length > 0) {
|
||||||
|
serverpartList.forEach((item: any) => {
|
||||||
|
if (item.value !== 586 && item.value !== 650 && item.value !== 680 && item.value !== 897 && item.value !== 841) {
|
||||||
|
list.push(item)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return list
|
||||||
|
}}
|
||||||
|
fieldProps={{
|
||||||
|
showSearch: true, // 启用搜索框
|
||||||
|
filterOption: (inputValue: any, option: any) => {
|
||||||
|
// 通过 label 搜索
|
||||||
|
return option.label.toLowerCase().includes(inputValue.toLowerCase());
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
{/* <Col span={12}>
|
||||||
|
<ProFormTreeSelect
|
||||||
|
label={'失物类型'}
|
||||||
|
name={'ENUM_LABEL'}
|
||||||
|
rules={[{
|
||||||
|
required: true,
|
||||||
|
message: '请选择失物类型'
|
||||||
|
}]}
|
||||||
|
fieldProps={{
|
||||||
|
showSearch: true, // 启用搜索框
|
||||||
|
treeDefaultExpandAll: true, // 默认展开所有节点
|
||||||
|
filterTreeNode: (inputValue: string, treeNode: any) => {
|
||||||
|
// 通过label进行模糊匹配
|
||||||
|
return treeNode.label.toLowerCase().includes(inputValue.toLowerCase());
|
||||||
|
},
|
||||||
|
options: lostTypeList // 传入树形节点数据
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Col> */}
|
||||||
|
<Col span={12}>
|
||||||
|
<ProFormText
|
||||||
|
label={'物品名称'}
|
||||||
|
name={'SUGGESTION_TITLE'}
|
||||||
|
rules={[{
|
||||||
|
required: true,
|
||||||
|
message: '请输入物品名称'
|
||||||
|
}]}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col span={12}>
|
||||||
|
<ProFormDatePicker
|
||||||
|
label={'发现时间'}
|
||||||
|
name={'SUGGESTION_CREATEDATE'}
|
||||||
|
width="lg"
|
||||||
|
fieldProps={{
|
||||||
|
showTime: {
|
||||||
|
format: 'HH:mm', // 只显示时和分
|
||||||
|
minuteStep: 1, // 分钟步长,可以设置为 5、10 等
|
||||||
|
hourStep: 1, // 小时步长
|
||||||
|
},
|
||||||
|
format: 'YYYY-MM-DD HH:mm', // 格式化为日期和时间(只显示时分)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col span={12}>
|
||||||
|
<ProFormText
|
||||||
|
name={"PHONE_NUMBER"}
|
||||||
|
label={"联系电话"}
|
||||||
|
placeholder="请输入手机号"
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col span={24}>
|
||||||
|
<ProFormTextArea
|
||||||
|
name={"SUGGESTION_REASON"}
|
||||||
|
label={"描述信息"}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
|
||||||
|
<Col span={24}>
|
||||||
|
<ProFormUploadButton
|
||||||
|
name="SCENICAREA_Image"
|
||||||
|
label={'附件图片'}
|
||||||
|
listType="picture-card"
|
||||||
|
accept="image/*"
|
||||||
|
fieldProps={{
|
||||||
|
beforeUpload,
|
||||||
|
onPreview: handlePreview,
|
||||||
|
// fileList: fileList, // 绑定 fileList
|
||||||
|
onChange: async (info: any) => {
|
||||||
|
console.log('info', info);
|
||||||
|
console.log('fileList', fileList);
|
||||||
|
if (info.file.status === 'removed') {
|
||||||
|
const index = fileList.findIndex(n => n.uid === info.file.uid);
|
||||||
|
confirm({
|
||||||
|
title: '确认删除该文件吗?',
|
||||||
|
icon: <ExclamationCircleOutlined />,
|
||||||
|
async onOk() {
|
||||||
|
if (info.file.ImageId) {
|
||||||
|
const deleteLoading = message.loading('正在删除...')
|
||||||
|
const success = await deletePicture(info.file?.ImagePath, info.file?.uid, '')
|
||||||
|
deleteLoading()
|
||||||
|
|
||||||
|
if (success) {
|
||||||
|
const files = [...fileList]
|
||||||
|
files.splice(index, 1)
|
||||||
|
setFileList(files)
|
||||||
|
message.success("删除成功")
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
message.error("删除失败")
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const files = [...fileList];
|
||||||
|
files.splice(index, 1);
|
||||||
|
setFileList(files);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onCancel() {
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
setFileList(info.fileList)
|
||||||
|
}
|
||||||
|
// else {
|
||||||
|
// setFileList(info.fileList)
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</ProForm>
|
||||||
|
|
||||||
|
</Modal>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,12 +1,399 @@
|
|||||||
// 失物招领审核
|
// 失物招领审核
|
||||||
|
import PageTitleBox from "@/components/PageTitleBox";
|
||||||
import { ConnectState } from "@/models/connect";
|
import { ConnectState } from "@/models/connect";
|
||||||
|
import ProTable, { ActionType } from "@ant-design/pro-table";
|
||||||
|
import { Button, Col, FormInstance, Image, message, Modal, Popconfirm, Row } from "antd";
|
||||||
|
import { useRef, useState } from "react";
|
||||||
import { connect, CurrentUser } from "umi";
|
import { connect, CurrentUser } from "umi";
|
||||||
|
import { handeGetSUGGESTIONList, handeSynchroSUGGESTION } from "../service";
|
||||||
|
import moment from 'moment'
|
||||||
|
import ProForm, { ProFormDatePicker, ProFormSelect, ProFormText, ProFormTextArea, ProFormUploadButton } from "@ant-design/pro-form";
|
||||||
|
import session from "@/utils/session";
|
||||||
|
import { ExclamationCircleOutlined } from "@ant-design/icons";
|
||||||
|
import { deletePicture } from "@/services/picture";
|
||||||
|
|
||||||
|
const beforeUpload = (file: any) => {
|
||||||
|
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
|
||||||
|
if (!isJpgOrPng) {
|
||||||
|
message.error('请上传JPEG、jpg、png格式的图片文件!');
|
||||||
|
}
|
||||||
|
const isLt2M = file.size / 1024 / 1024 < 5;
|
||||||
|
if (!isLt2M) {
|
||||||
|
message.error('图片大小不超过 5MB!');
|
||||||
|
}
|
||||||
|
return isJpgOrPng && isLt2M;
|
||||||
|
}
|
||||||
|
|
||||||
const LostandFoundReview: React.FC<{ currentUser: CurrentUser | undefined }> = (props) => {
|
const LostandFoundReview: React.FC<{ currentUser: CurrentUser | undefined }> = (props) => {
|
||||||
|
const { currentUser } = props
|
||||||
|
const { confirm } = Modal;
|
||||||
|
const actionRef = useRef<ActionType>();
|
||||||
|
const formRef = useRef<FormInstance>();
|
||||||
|
const modalRef = useRef<FormInstance>();
|
||||||
|
// 当前选中行数据
|
||||||
|
const [currentRow, setCurrentRow] = useState<any>()
|
||||||
|
// 显示新增窗口
|
||||||
|
const [showAddModal, setShowAddModal] = useState<boolean>(false)
|
||||||
|
// 图片列表
|
||||||
|
const [fileList, setFileList] = useState<any>()
|
||||||
|
const [imagePreviewVisible, setImagePreviewVisible] = useState<boolean>(false) // 预览图片
|
||||||
|
// 弹出框的确认效果
|
||||||
|
const [confirmLoading, setConfirmLoading] = useState<boolean>(false)
|
||||||
|
|
||||||
|
|
||||||
|
const columns: any = [
|
||||||
|
{
|
||||||
|
title: '统计时间',
|
||||||
|
dataIndex: 'search_date',
|
||||||
|
valueType: 'dateRange',
|
||||||
|
hideInTable: true,
|
||||||
|
hideInDescriptions: true,
|
||||||
|
initialValue: [moment().subtract(1, 'month'), moment()],
|
||||||
|
search: {
|
||||||
|
transform: (value: any) => {
|
||||||
|
return {
|
||||||
|
StartDate: value[0],
|
||||||
|
EndDate: value[1],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '服务区名称',
|
||||||
|
width: 150,
|
||||||
|
dataIndex: 'SERVERPART_NAME',
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true,
|
||||||
|
hideInSearch: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '物品名称',
|
||||||
|
width: 150,
|
||||||
|
dataIndex: 'SUGGESTION_TITLE',
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true,
|
||||||
|
hideInSearch: true,
|
||||||
|
render: (_, record) => {
|
||||||
|
return record?.SUGGESTION_TITLE ? <a onClick={() => {
|
||||||
|
setCurrentRow(record)
|
||||||
|
setShowAddModal(true)
|
||||||
|
}}>{record?.SUGGESTION_TITLE || "-"}</a> : "-"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '发现时间',
|
||||||
|
width: 150,
|
||||||
|
dataIndex: 'SUGGESTION_CREATEDATE',
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true,
|
||||||
|
hideInSearch: true,
|
||||||
|
render: (_, record) => {
|
||||||
|
return record?.SUGGESTION_CREATEDATE ? moment(record?.SUGGESTION_CREATEDATE).format('YYYY-MM-DD HH:mm') : ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '联系电话',
|
||||||
|
width: 150,
|
||||||
|
dataIndex: 'PHONE_NUMBER',
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true,
|
||||||
|
hideInSearch: true,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
const handleChangePreview = (val: any) => {
|
||||||
|
setImagePreviewVisible(val)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 悬浮框的关闭事件
|
||||||
|
const handleModalClose = () => {
|
||||||
|
setConfirmLoading(false)
|
||||||
|
setCurrentRow(undefined)
|
||||||
|
setFileList([])
|
||||||
|
setShowAddModal(false)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 新增
|
||||||
|
const handleAddLostThing = async (type: number) => {
|
||||||
|
// type 1 审核通过 2 驳回
|
||||||
|
let req: any = {}
|
||||||
|
req = {
|
||||||
|
...currentRow,
|
||||||
|
SUGGESTION_STATE: type === 1 ? 1 : 9,
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('req', req);
|
||||||
|
const data = await handeSynchroSUGGESTION(req)
|
||||||
|
if (data.Result_Code === 100) {
|
||||||
|
message.success('审核通过!')
|
||||||
|
handleModalClose()
|
||||||
|
actionRef.current?.reload()
|
||||||
|
} else {
|
||||||
|
message.error(data.Result_Desc)
|
||||||
|
setConfirmLoading(false)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// 预览上传后的图片
|
||||||
|
const handlePreview = async () => {
|
||||||
|
setFileList(fileList)
|
||||||
|
setImagePreviewVisible(true)
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
<ProTable
|
||||||
|
actionRef={actionRef}
|
||||||
|
formRef={formRef}
|
||||||
|
columns={columns}
|
||||||
|
bordered
|
||||||
|
expandable={{
|
||||||
|
expandRowByClick: true
|
||||||
|
}}
|
||||||
|
scroll={{ x: "100%", y: "calc(100vh - 430px)" }}
|
||||||
|
headerTitle={<PageTitleBox props={props} />} // 列表表头
|
||||||
|
search={{ span: 6 }}
|
||||||
|
request={async (params) => {
|
||||||
|
const req: any = {
|
||||||
|
SearchParameter: {
|
||||||
|
SUGGESTION_TYPES: 4000,
|
||||||
|
SUGGESTION_STATES: 2,
|
||||||
|
ENUM_LABEL: params?.ENUM_LABEL || ''
|
||||||
|
},
|
||||||
|
PageIndex: 1,
|
||||||
|
PageSize: 999999,
|
||||||
|
}
|
||||||
|
|
||||||
</div>
|
const data = await handeGetSUGGESTIONList(req)
|
||||||
|
console.log('1111', data);
|
||||||
|
if (data && data.length > 0) {
|
||||||
|
return { data, success: true }
|
||||||
|
}
|
||||||
|
return { data: [], success: true }
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
{/* 图片预览组件 */}
|
||||||
|
{fileList && fileList.length > 0 && <div style={{ display: 'none' }}>
|
||||||
|
<Image.PreviewGroup
|
||||||
|
preview={{
|
||||||
|
visible: imagePreviewVisible,
|
||||||
|
onVisibleChange: vis => {
|
||||||
|
handleChangePreview(vis)
|
||||||
|
}
|
||||||
|
}}>
|
||||||
|
{
|
||||||
|
fileList.map((n) => <Image src={n.url} key={n.url} />)
|
||||||
|
}
|
||||||
|
</Image.PreviewGroup>
|
||||||
|
</div>}
|
||||||
|
|
||||||
|
<Modal
|
||||||
|
title={"审核失物"}
|
||||||
|
destroyOnClose={true}
|
||||||
|
width={900}
|
||||||
|
bodyStyle={{
|
||||||
|
height: '700px', // 你可以根据需要调整高度
|
||||||
|
overflowY: 'auto',
|
||||||
|
}}
|
||||||
|
visible={showAddModal}
|
||||||
|
confirmLoading={confirmLoading}
|
||||||
|
onCancel={() => {
|
||||||
|
handleModalClose()
|
||||||
|
}}
|
||||||
|
footer={
|
||||||
|
<div style={{ width: '100%', boxSizing: 'border-box', padding: '0 8px', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
|
||||||
|
<div></div>
|
||||||
|
<div>
|
||||||
|
<Popconfirm
|
||||||
|
title={'确认驳回?'}
|
||||||
|
onConfirm={() => {
|
||||||
|
handleAddLostThing(2)
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Button danger>驳回</Button>
|
||||||
|
</Popconfirm>
|
||||||
|
|
||||||
|
<Popconfirm
|
||||||
|
title={'确认审核通过?'}
|
||||||
|
onConfirm={() => {
|
||||||
|
handleAddLostThing(1)
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Button style={{ marginLeft: '8px' }} type={"primary"}>审核通过</Button>
|
||||||
|
</Popconfirm>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
okText={"审核通过"}
|
||||||
|
onOk={async () => { // 提交框内的数据
|
||||||
|
modalRef.current?.validateFields().then(async (res: any) => {
|
||||||
|
setConfirmLoading(true)
|
||||||
|
await handleAddLostThing(res)
|
||||||
|
setConfirmLoading(false)
|
||||||
|
})
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<ProForm
|
||||||
|
formRef={modalRef}
|
||||||
|
layout={'horizontal'}
|
||||||
|
submitter={false}
|
||||||
|
request={async () => {
|
||||||
|
if (currentRow?.SUGGESTION_ID) {
|
||||||
|
let imgList: any = []
|
||||||
|
if (currentRow?.ImageList && currentRow?.ImageList.length > 0) {
|
||||||
|
currentRow?.ImageList.forEach((item: any) => {
|
||||||
|
imgList.push({
|
||||||
|
label: item.ImageName,
|
||||||
|
url: item.ImageUrl
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
setFileList(imgList)
|
||||||
|
return { ...currentRow, SCENICAREA_Image: imgList }
|
||||||
|
}
|
||||||
|
return {}
|
||||||
|
}}
|
||||||
|
labelCol={{ style: { width: 80 } }}
|
||||||
|
>
|
||||||
|
<Row gutter={16}>
|
||||||
|
<Col span={12}>
|
||||||
|
<ProFormSelect
|
||||||
|
label={'服务区'}
|
||||||
|
name={'SERVERPART_ID'}
|
||||||
|
rules={[{
|
||||||
|
required: true,
|
||||||
|
message: '请选择服务区'
|
||||||
|
}]}
|
||||||
|
request={async () => {
|
||||||
|
let serverpartList = session.get('serverpartList')
|
||||||
|
let list: any = []
|
||||||
|
if (serverpartList && serverpartList.length > 0) {
|
||||||
|
serverpartList.forEach((item: any) => {
|
||||||
|
if (item.value !== 586 && item.value !== 650 && item.value !== 680 && item.value !== 897 && item.value !== 841) {
|
||||||
|
list.push(item)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return list
|
||||||
|
}}
|
||||||
|
fieldProps={{
|
||||||
|
showSearch: true, // 启用搜索框
|
||||||
|
filterOption: (inputValue: any, option: any) => {
|
||||||
|
// 通过 label 搜索
|
||||||
|
return option.label.toLowerCase().includes(inputValue.toLowerCase());
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col span={12}>
|
||||||
|
<ProFormText
|
||||||
|
label={'物品名称'}
|
||||||
|
name={'SUGGESTION_TITLE'}
|
||||||
|
rules={[{
|
||||||
|
required: true,
|
||||||
|
message: '请输入物品名称'
|
||||||
|
}]}
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col span={12}>
|
||||||
|
<ProFormDatePicker
|
||||||
|
label={'发现时间'}
|
||||||
|
name={'SUGGESTION_CREATEDATE'}
|
||||||
|
width="lg"
|
||||||
|
fieldProps={{
|
||||||
|
showTime: {
|
||||||
|
format: 'HH:mm', // 只显示时和分
|
||||||
|
minuteStep: 1, // 分钟步长,可以设置为 5、10 等
|
||||||
|
hourStep: 1, // 小时步长
|
||||||
|
},
|
||||||
|
format: 'YYYY-MM-DD HH:mm', // 格式化为日期和时间(只显示时分)
|
||||||
|
}}
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col span={12}>
|
||||||
|
<ProFormText
|
||||||
|
name={"PHONE_NUMBER"}
|
||||||
|
label={"联系电话"}
|
||||||
|
placeholder="请输入手机号"
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col span={24}>
|
||||||
|
<ProFormTextArea
|
||||||
|
name={"SUGGESTION_REASON"}
|
||||||
|
label={"描述信息"}
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
|
||||||
|
<Col span={24}>
|
||||||
|
<ProFormUploadButton
|
||||||
|
name="SCENICAREA_Image"
|
||||||
|
label={'附件图片'}
|
||||||
|
listType="picture-card"
|
||||||
|
accept="image/*"
|
||||||
|
readonly
|
||||||
|
disabled
|
||||||
|
fieldProps={{
|
||||||
|
beforeUpload,
|
||||||
|
onPreview: handlePreview,
|
||||||
|
// fileList: fileList, // 绑定 fileList
|
||||||
|
onChange: async (info: any) => {
|
||||||
|
console.log('info', info);
|
||||||
|
console.log('fileList', fileList);
|
||||||
|
if (info.file.status === 'removed') {
|
||||||
|
const index = fileList.findIndex(n => n.uid === info.file.uid);
|
||||||
|
confirm({
|
||||||
|
title: '确认删除该文件吗?',
|
||||||
|
icon: <ExclamationCircleOutlined />,
|
||||||
|
async onOk() {
|
||||||
|
if (info.file.ImageId) {
|
||||||
|
const deleteLoading = message.loading('正在删除...')
|
||||||
|
const success = await deletePicture(info.file?.ImagePath, info.file?.uid, '')
|
||||||
|
deleteLoading()
|
||||||
|
|
||||||
|
if (success) {
|
||||||
|
const files = [...fileList]
|
||||||
|
files.splice(index, 1)
|
||||||
|
setFileList(files)
|
||||||
|
message.success("删除成功")
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
message.error("删除失败")
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const files = [...fileList];
|
||||||
|
files.splice(index, 1);
|
||||||
|
setFileList(files);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onCancel() {
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
setFileList(info.fileList)
|
||||||
|
}
|
||||||
|
// else {
|
||||||
|
// setFileList(info.fileList)
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</ProForm>
|
||||||
|
|
||||||
|
</Modal >
|
||||||
|
|
||||||
|
</div >
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -222,7 +222,9 @@ const MerchantSalesRanking: React.FC<{ currentUser: CurrentUser | undefined }> =
|
|||||||
}}
|
}}
|
||||||
closable={false}
|
closable={false}
|
||||||
destroyOnClose
|
destroyOnClose
|
||||||
|
bodyStyle={{ padding: 32 }}
|
||||||
>
|
>
|
||||||
|
|
||||||
<MerchantEvaluationManage isComponent={true} parentDetail={currentRow} come={'MerchantSalesRanking'} />
|
<MerchantEvaluationManage isComponent={true} parentDetail={currentRow} come={'MerchantSalesRanking'} />
|
||||||
</Drawer>
|
</Drawer>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -0,0 +1,443 @@
|
|||||||
|
.ActiveMemberStatisticsMain {
|
||||||
|
width: 100%;
|
||||||
|
height: calc(100vh - 150px);
|
||||||
|
background: #FFFFFF;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.ActiveMemberStatisticsTop {
|
||||||
|
width: 100%;
|
||||||
|
background: #FFFFFF;
|
||||||
|
// box-shadow: 0px 0px 6px 0px rgba(31, 48, 95, 0.2);
|
||||||
|
// border-radius: 4px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 16px;
|
||||||
|
|
||||||
|
.ActiveMemberStatisticsTitleBox {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
// justify-content: space-between;
|
||||||
|
|
||||||
|
|
||||||
|
.ActiveMemberStatisticsTitle {
|
||||||
|
font-family: PingFangSC, PingFang SC;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 18px;
|
||||||
|
color: #757575;
|
||||||
|
line-height: 18px;
|
||||||
|
text-align: left;
|
||||||
|
font-style: normal;
|
||||||
|
margin-left: 12px;
|
||||||
|
position: relative;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ActiveMemberStatisticsTitleSelect {
|
||||||
|
font-family: PingFangSC, PingFang SC;
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 18px;
|
||||||
|
color: #333333;
|
||||||
|
line-height: 18px;
|
||||||
|
text-align: left;
|
||||||
|
font-style: normal;
|
||||||
|
margin-left: 12px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ActiveMemberStatisticsTitleSelect::after {
|
||||||
|
content: "";
|
||||||
|
width: 4px;
|
||||||
|
height: 18px;
|
||||||
|
background: #1492FF;
|
||||||
|
border-radius: 2px;
|
||||||
|
position: absolute;
|
||||||
|
left: -12px;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.ActiveMemberStatisticsContentBox {
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 16px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
// .ActiveMemberStatisticsItemFirst {
|
||||||
|
// width: 280px;
|
||||||
|
// height: 180px;
|
||||||
|
// background-image: url('../../../assets/detail/staticSumTotalBg.png');
|
||||||
|
// background-size: 100% 100%;
|
||||||
|
// background-repeat: no-repeat;
|
||||||
|
// box-sizing: border-box;
|
||||||
|
// padding: 26px 39px;
|
||||||
|
// margin-right: 16px;
|
||||||
|
|
||||||
|
// .firstItemTitle {
|
||||||
|
// font-family: PingFangSC, PingFang SC;
|
||||||
|
// font-weight: 500;
|
||||||
|
// font-size: 18px;
|
||||||
|
// color: #FFFFFF;
|
||||||
|
// line-height: 13px;
|
||||||
|
// text-align: left;
|
||||||
|
// font-style: normal;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// .firstItemValue {
|
||||||
|
// font-family: DINAlternate, DINAlternate;
|
||||||
|
// font-weight: bold;
|
||||||
|
// font-size: 28px;
|
||||||
|
// color: #FFFFFF;
|
||||||
|
// line-height: 32px;
|
||||||
|
// text-align: left;
|
||||||
|
// font-style: normal;
|
||||||
|
// margin-top: 12px;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
.ActiveMemberStatisticsItemOther {
|
||||||
|
width: 100%;
|
||||||
|
height: 180px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.ActiveMemberStatisticsOtherItem {
|
||||||
|
width: calc((100% - 112px) / 7);
|
||||||
|
height: 100%;
|
||||||
|
background: #F6F9FF;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 20px 24px;
|
||||||
|
position: relative;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
.otherItemTitle {
|
||||||
|
height: 36px;
|
||||||
|
font-family: PingFangSC, PingFang SC;
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #333333;
|
||||||
|
line-height: 18px;
|
||||||
|
text-align: left;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.otherItemValue {
|
||||||
|
font-family: DINAlternate, DINAlternate;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 32px;
|
||||||
|
color: #1492FF;
|
||||||
|
line-height: 38px;
|
||||||
|
text-align: left;
|
||||||
|
margin-top: 4px;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.addLabel {
|
||||||
|
font-family: PingFangSC, PingFang SC;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 12px;
|
||||||
|
color: rgba(0, 0, 0, 0.65);
|
||||||
|
line-height: 12px;
|
||||||
|
text-align: left;
|
||||||
|
font-style: normal;
|
||||||
|
margin-right: 5px;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.otherItemAddBox {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-top: 10px;
|
||||||
|
|
||||||
|
|
||||||
|
.addIcon {
|
||||||
|
width: 7px;
|
||||||
|
height: 10px;
|
||||||
|
margin-right: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.addValue {
|
||||||
|
font-family: PingFangSC, PingFang SC;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 16px;
|
||||||
|
color: rgba(0, 0, 0, 0.65);
|
||||||
|
line-height: 16px;
|
||||||
|
text-align: center;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// .otherBgIcon {
|
||||||
|
// width: 76px;
|
||||||
|
// height: 51px;
|
||||||
|
// position: absolute;
|
||||||
|
// top: 29px;
|
||||||
|
// right: 4px;
|
||||||
|
// background-image: url(../../../assets/detail/otherBgIcon.png);
|
||||||
|
// background-repeat: no-repeat;
|
||||||
|
// background-size: 100% 100%;
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
.ActiveMemberStatisticsOtherItemSelect {
|
||||||
|
background-image: url('../../../assets/detail/staticSumTotalBg.png');
|
||||||
|
background-size: 100% 100%;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
|
||||||
|
.otherItemTitle {
|
||||||
|
font-family: PingFangSC, PingFang SC;
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #fff;
|
||||||
|
line-height: 18px;
|
||||||
|
text-align: left;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.otherItemValue {
|
||||||
|
font-family: DINAlternate, DINAlternate;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 32px;
|
||||||
|
color: #fff;
|
||||||
|
line-height: 38px;
|
||||||
|
text-align: left;
|
||||||
|
margin-top: 17px;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.addLabel {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.otherItemAddBox {
|
||||||
|
|
||||||
|
.addValue {
|
||||||
|
font-family: PingFangSC, PingFang SC;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #fff;
|
||||||
|
line-height: 16px;
|
||||||
|
text-align: center;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.ActiveMemberStatisticsBottom {
|
||||||
|
width: 100%;
|
||||||
|
// margin-top: 16px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background: #FFFFFF;
|
||||||
|
// box-shadow: 0px 0px 6px 0px rgba(31, 48, 95, 0.2);
|
||||||
|
// border-radius: 4px;
|
||||||
|
padding: 16px;
|
||||||
|
|
||||||
|
.ActiveMemberStatisticsTitleBox {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.ActiveMemberStatisticsTitle {
|
||||||
|
font-family: PingFangSC, PingFang SC;
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 18px;
|
||||||
|
color: #333333;
|
||||||
|
line-height: 18px;
|
||||||
|
text-align: left;
|
||||||
|
font-style: normal;
|
||||||
|
margin-left: 12px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ActiveMemberStatisticsTitle::after {
|
||||||
|
content: "";
|
||||||
|
width: 4px;
|
||||||
|
height: 18px;
|
||||||
|
background: #1492FF;
|
||||||
|
border-radius: 2px;
|
||||||
|
position: absolute;
|
||||||
|
left: -12px;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.ActiveMemberStatisticsContentBox {
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 16px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.ActiveMemberStatisticsItemOther {
|
||||||
|
width: 100%;
|
||||||
|
height: 180px;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: center;
|
||||||
|
// justify-content: space-between;
|
||||||
|
|
||||||
|
.ActiveMemberStatisticsOtherItem {
|
||||||
|
width: calc((100% - 112px) / 7);
|
||||||
|
height: 100%;
|
||||||
|
background: #F6F9FF;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 29px 24px;
|
||||||
|
position: relative;
|
||||||
|
cursor: pointer;
|
||||||
|
margin-right: 16px;
|
||||||
|
|
||||||
|
.otherItemTitle {
|
||||||
|
height: 36px;
|
||||||
|
font-family: PingFangSC, PingFang SC;
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #333333;
|
||||||
|
line-height: 18px;
|
||||||
|
text-align: left;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.otherItemValue {
|
||||||
|
font-family: DINAlternate, DINAlternate;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 32px;
|
||||||
|
color: #1492FF;
|
||||||
|
line-height: 38px;
|
||||||
|
text-align: left;
|
||||||
|
margin-top: 17px;
|
||||||
|
font-style: normal;
|
||||||
|
|
||||||
|
.otherItemValueUnit {
|
||||||
|
font-family: PingFangSC, PingFang SC;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 12px;
|
||||||
|
color: rgba(0, 0, 0, 0.65);
|
||||||
|
line-height: 12px;
|
||||||
|
text-align: left;
|
||||||
|
font-style: normal;
|
||||||
|
margin-right: 5px;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.addLabel {
|
||||||
|
font-family: PingFangSC, PingFang SC;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 12px;
|
||||||
|
color: rgba(0, 0, 0, 0.65);
|
||||||
|
line-height: 12px;
|
||||||
|
text-align: left;
|
||||||
|
font-style: normal;
|
||||||
|
margin-right: 5px;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.otherItemAddBox {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-top: 10px;
|
||||||
|
|
||||||
|
|
||||||
|
.addIcon {
|
||||||
|
width: 7px;
|
||||||
|
height: 10px;
|
||||||
|
margin-right: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.addValue {
|
||||||
|
font-family: PingFangSC, PingFang SC;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 16px;
|
||||||
|
color: rgba(0, 0, 0, 0.65);
|
||||||
|
line-height: 16px;
|
||||||
|
text-align: center;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// .otherBgIcon {
|
||||||
|
// width: 76px;
|
||||||
|
// height: 51px;
|
||||||
|
// position: absolute;
|
||||||
|
// top: 29px;
|
||||||
|
// right: 4px;
|
||||||
|
// background-image: url(../../../assets/detail/otherBgIcon.png);
|
||||||
|
// background-repeat: no-repeat;
|
||||||
|
// background-size: 100% 100%;
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
.ActiveMemberStatisticsOtherItemSelect {
|
||||||
|
background-image: url('../../../assets/detail/staticSumTotalBg.png');
|
||||||
|
background-size: 100% 100%;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
|
||||||
|
.otherItemTitle {
|
||||||
|
font-family: PingFangSC, PingFang SC;
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #fff;
|
||||||
|
line-height: 18px;
|
||||||
|
text-align: left;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.otherItemValue {
|
||||||
|
font-family: DINAlternate, DINAlternate;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 32px;
|
||||||
|
color: #fff;
|
||||||
|
line-height: 38px;
|
||||||
|
text-align: left;
|
||||||
|
margin-top: 17px;
|
||||||
|
font-style: normal;
|
||||||
|
|
||||||
|
.otherItemValueUnit {
|
||||||
|
|
||||||
|
font-family: DINAlternate, DINAlternate;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #fff;
|
||||||
|
line-height: 20px;
|
||||||
|
text-align: left;
|
||||||
|
margin-top: 17px;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.addLabel {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.otherItemAddBox {
|
||||||
|
|
||||||
|
.addValue {
|
||||||
|
font-family: PingFangSC, PingFang SC;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #fff;
|
||||||
|
line-height: 16px;
|
||||||
|
text-align: center;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
278
src/pages/travelMember/RegistrationStatistics/index.tsx
Normal file
278
src/pages/travelMember/RegistrationStatistics/index.tsx
Normal file
@ -0,0 +1,278 @@
|
|||||||
|
// 活跃会员统计
|
||||||
|
import { connect, CurrentUser } from "umi";
|
||||||
|
import { ConnectState } from "@/models/connect";
|
||||||
|
import { useEffect, useRef, useState } from "react";
|
||||||
|
import { Button, Col, Drawer, FormInstance, Row, Spin } from "antd";
|
||||||
|
import ProForm, { ProFormDateRangePicker, ProFormSelect } from "@ant-design/pro-form";
|
||||||
|
import './RegistrationStatistics.less'
|
||||||
|
import { handeGetMembershipCount } from "../service";
|
||||||
|
import session from "@/utils/session";
|
||||||
|
import ProTable, { ActionType } from "@ant-design/pro-table";
|
||||||
|
import MemberInfor from "../memberInfor";
|
||||||
|
import moment from 'moment'
|
||||||
|
|
||||||
|
const RegistrationStatistics: React.FC<{ currentUser: CurrentUser | undefined }> = (props) => {
|
||||||
|
const { currentUser } = props
|
||||||
|
const formRef = useRef<FormInstance>();
|
||||||
|
const actionRef = useRef<ActionType>();
|
||||||
|
|
||||||
|
// 选择的tab
|
||||||
|
const [selectPageTab, setSelectPageTab] = useState<any>(1)
|
||||||
|
// 会员类型数据
|
||||||
|
const [membershipType, setMembershipType] = useState<any>()
|
||||||
|
// 会员数量
|
||||||
|
const [memberShipTotal, setMemberShipTotal] = useState<number>(1)
|
||||||
|
// 会员等级数据
|
||||||
|
const [revenueList, setRevenueList] = useState<any>()
|
||||||
|
// 显示详情抽屉
|
||||||
|
const [showDetail, setShowDetail] = useState<boolean>(false)
|
||||||
|
const [currentRow, setCurrentRow] = useState<any>()
|
||||||
|
// 抽屉显示的标题
|
||||||
|
const [currentDrawerTitle, setCurrentDrawerTitle] = useState<string>()
|
||||||
|
// 1 是 会员类型 2是 会员等级
|
||||||
|
const [searchType, setSearchType] = useState<any>()
|
||||||
|
// 对应的枚举类型
|
||||||
|
const [valueType, setValueType] = useState<any>()
|
||||||
|
// 显示加载效果
|
||||||
|
const [showLoading, setShowLoading] = useState<boolean>(false)
|
||||||
|
|
||||||
|
let MEMBERSHIPLEVELYNObj = session.get('MEMBERSHIPLEVELYNObj')
|
||||||
|
let MEMBERSHIPLEVELYNList = session.get('MEMBERSHIPLEVELYNList')
|
||||||
|
let MEMBERSHIPTYPEYNObj = session.get('MEMBERSHIPTYPEYNObj')
|
||||||
|
let MEMBERSHIPTYPEYNList = session.get('MEMBERSHIPTYPEYNList')
|
||||||
|
|
||||||
|
|
||||||
|
const handleGetData = async (formData?: any) => {
|
||||||
|
console.log('formDataformDataformData', formData);
|
||||||
|
let [start, end] = ['', '']
|
||||||
|
if (formData && formData?.searchTime) {
|
||||||
|
[start, end] = formData.searchTime
|
||||||
|
} else {
|
||||||
|
[start, end] = [moment().startOf('M').format('YYYY-MM-DD'), moment().format('YYYY-MM-DD')]
|
||||||
|
}
|
||||||
|
|
||||||
|
const req: any = {
|
||||||
|
CalcType: 5, // 注册途径
|
||||||
|
OwnerUnitId: currentUser?.OwnerUnitId,
|
||||||
|
ExcludeTest: formData ? formData?.ExcludeTest === 1 ? true : false : true,
|
||||||
|
StartDate: start ? start : "",
|
||||||
|
EndDate: end ? end : "",
|
||||||
|
MembershipType: formData?.MembershipType === 1 ? "" : formData?.MembershipType || "",
|
||||||
|
// MembershipLevel: formData?.MembershipLevel || "",
|
||||||
|
MembershipLevel: "",
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('reqreqreq', req);
|
||||||
|
|
||||||
|
|
||||||
|
setShowLoading(true)
|
||||||
|
const data = await handeGetMembershipCount(req)
|
||||||
|
setShowLoading(false)
|
||||||
|
console.log('datadatadatadata', data);
|
||||||
|
|
||||||
|
setMembershipType(data.List)
|
||||||
|
setMemberShipTotal(data.OtherData)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 点击事件
|
||||||
|
const handleShowTableData = async (type: number, memberType: any) => {
|
||||||
|
// type 1 的话是 会员类型 2 的话是 会员等级 memberType 对应的枚举值
|
||||||
|
setCurrentDrawerTitle(`${type === 1 ? '会员类型' : type === 2 ? '会员等级' : ''}【${type === 1 ? MEMBERSHIPTYPEYNObj && memberType ? MEMBERSHIPTYPEYNObj[memberType] : '' : type === 2 ? MEMBERSHIPLEVELYNObj && memberType ? MEMBERSHIPLEVELYNObj[memberType] : '' : ''}】`)
|
||||||
|
setSearchType(type)
|
||||||
|
setValueType(memberType)
|
||||||
|
setShowDetail(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
handleGetData()
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="ActiveMemberStatisticsMain">
|
||||||
|
{
|
||||||
|
showLoading ?
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
width: '100%',
|
||||||
|
height: '100%',
|
||||||
|
background: 'rgba(0,0,0,0.1)',
|
||||||
|
position: 'absolute',
|
||||||
|
zIndex: 5,
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center'
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div style={{
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
padding: '15px 20px 10px',
|
||||||
|
background: '#fff',
|
||||||
|
borderRadius: '8px',
|
||||||
|
width: '200px'
|
||||||
|
}}>
|
||||||
|
<Spin />
|
||||||
|
<span style={{ marginLeft: '5px' }}>加载中...</span>
|
||||||
|
</div>
|
||||||
|
</div> : ''
|
||||||
|
}
|
||||||
|
|
||||||
|
<div className="ActiveMemberStatisticsTop">
|
||||||
|
{/* <div className="ActiveMemberStatisticsTitleBox">
|
||||||
|
<div className={selectPageTab === 1 ? 'ActiveMemberStatisticsTitle ActiveMemberStatisticsTitleSelect' : 'ActiveMemberStatisticsTitle'} onClick={() => {
|
||||||
|
setSelectPageTab(1)
|
||||||
|
}}>会员类型</div>
|
||||||
|
<div style={{ marginLeft: '48px' }} className={selectPageTab === 2 ? 'ActiveMemberStatisticsTitle ActiveMemberStatisticsTitleSelect' : 'ActiveMemberStatisticsTitle'} onClick={() => {
|
||||||
|
setSelectPageTab(2)
|
||||||
|
}}>会员等级</div>
|
||||||
|
</div> */}
|
||||||
|
<ProForm
|
||||||
|
layout={'horizontal'}
|
||||||
|
formRef={formRef}
|
||||||
|
submitter={false}
|
||||||
|
onFinish={async (values: any) => {
|
||||||
|
console.log('valuesvaluesvaluesvalues', values);
|
||||||
|
handleGetData(values)
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Row gutter={16} style={{ marginTop: "16px" }}>
|
||||||
|
<Col span={6}>
|
||||||
|
<ProFormDateRangePicker
|
||||||
|
label={"查询时间"}
|
||||||
|
name={"searchTime"}
|
||||||
|
// initialValue={[moment().startOf('M').format('YYYY-MM-DD'), moment().format('YYYY-MM-DD')]}
|
||||||
|
initialValue={[moment().startOf('M'), moment()]}
|
||||||
|
fieldProps={{
|
||||||
|
ranges: {
|
||||||
|
"本月": [moment().startOf('M'), moment()],
|
||||||
|
"上月": [moment().subtract(1, 'M').startOf('M'), moment().subtract(1, 'M').endOf('M')],
|
||||||
|
"近三月": [moment().subtract(3, 'M').startOf('M'), moment().endOf('M')],
|
||||||
|
"近半年": [moment().subtract(6, 'M').startOf('M'), moment().endOf('M')],
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col span={6}>
|
||||||
|
<ProFormSelect
|
||||||
|
label={"会员类型"}
|
||||||
|
name={"MembershipType"}
|
||||||
|
options={MEMBERSHIPTYPEYNList}
|
||||||
|
/>
|
||||||
|
|
||||||
|
</Col>
|
||||||
|
{/* <Col span={6}>
|
||||||
|
<ProFormSelect
|
||||||
|
label={"会员等级"}
|
||||||
|
name={"MembershipLevel"}
|
||||||
|
options={MEMBERSHIPLEVELYNList}
|
||||||
|
/>
|
||||||
|
</Col> */}
|
||||||
|
<Col span={6}>
|
||||||
|
|
||||||
|
<ProFormSelect
|
||||||
|
label={"是否排除测试会员"}
|
||||||
|
name={"ExcludeTest"}
|
||||||
|
options={[{ label: '是', value: 1 }, { label: '否', value: 0 }]}
|
||||||
|
initialValue={1}
|
||||||
|
/>
|
||||||
|
|
||||||
|
</Col>
|
||||||
|
{/* <Col span={18}></Col> */}
|
||||||
|
<Col span={6}>
|
||||||
|
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
|
||||||
|
<Button style={{ marginRight: '8px' }} onClick={() => {
|
||||||
|
formRef.current?.resetFields()
|
||||||
|
}}>重置</Button>
|
||||||
|
<Button type={"primary"} onClick={() => {
|
||||||
|
formRef.current?.submit()
|
||||||
|
}}>查询</Button>
|
||||||
|
</div>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</ProForm>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div className="ActiveMemberStatisticsBottom">
|
||||||
|
{
|
||||||
|
membershipType && membershipType.length > 0 ?
|
||||||
|
<>
|
||||||
|
<div className="ActiveMemberStatisticsTitleBox">
|
||||||
|
<div className="ActiveMemberStatisticsTitle">拉新活动</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="ActiveMemberStatisticsContentBox">
|
||||||
|
<div className="ActiveMemberStatisticsItemOther">
|
||||||
|
{
|
||||||
|
membershipType.map((item: any) => {
|
||||||
|
return <div className="ActiveMemberStatisticsOtherItem">
|
||||||
|
<div className="otherItemTitle">{item.label || ''}</div>
|
||||||
|
<div className="otherItemValue">{item.value}<span className="otherItemValueUnit">人</span></div>
|
||||||
|
<div className="addLabel">占比</div>
|
||||||
|
<div className="otherItemAddBox">
|
||||||
|
<span className="addValue">{item.key ? item.key + '%' : ""}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
: ""
|
||||||
|
}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="ActiveMemberStatisticsBottom">
|
||||||
|
{
|
||||||
|
revenueList && revenueList.length > 0 ?
|
||||||
|
<>
|
||||||
|
<div className="ActiveMemberStatisticsTitleBox">
|
||||||
|
<div className="ActiveMemberStatisticsTitle">营销活动</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="ActiveMemberStatisticsContentBox">
|
||||||
|
<div className="ActiveMemberStatisticsItemOther">
|
||||||
|
{
|
||||||
|
revenueList.map((item: any) => {
|
||||||
|
return <div className="ActiveMemberStatisticsOtherItem">
|
||||||
|
<div className="otherItemTitle">{item.label}</div>
|
||||||
|
<div className="otherItemValue">{item.value}<span className="otherItemValueUnit">人</span></div>
|
||||||
|
<div className="addLabel">占比</div>
|
||||||
|
<div className="otherItemAddBox">
|
||||||
|
<span className="addValue">{item.key ? item.key + '%' : ""}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
: ""
|
||||||
|
}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<Drawer
|
||||||
|
width={'80%'}
|
||||||
|
title={currentDrawerTitle || ""}
|
||||||
|
visible={showDetail}
|
||||||
|
destroyOnClose
|
||||||
|
closable={false}
|
||||||
|
onClose={() => {
|
||||||
|
setSearchType(null)
|
||||||
|
setValueType(null)
|
||||||
|
setShowDetail(false)
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<MemberInfor searchType={searchType} valueType={valueType} isComponent={true} />
|
||||||
|
</Drawer>
|
||||||
|
</div >
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default connect(({ user }: ConnectState) => ({
|
||||||
|
currentUser: user.currentUser
|
||||||
|
}))(RegistrationStatistics);
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
.proformList {
|
||||||
|
.ant-form-item-control-input-content>div:first-of-type {
|
||||||
|
width: 100% !important;
|
||||||
|
max-width: none !important;
|
||||||
|
|
||||||
|
.ant-pro-form-list-item {
|
||||||
|
display: block !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,17 +1,585 @@
|
|||||||
// 商户评价汇总
|
// 商户评价汇总
|
||||||
import { ConnectState } from "@/models/connect";
|
import { connect } from "umi";
|
||||||
import { connect, CurrentUser } from "umi";
|
import type { CurrentUser } from "umi";
|
||||||
|
import type { ConnectState } from "@/models/connect";
|
||||||
|
import React, { useRef, useState } from "react";
|
||||||
|
import type { FormInstance } from "antd";
|
||||||
|
import { Button, Col, message, Modal, Row, Space, Spin, Tree, Image } from "antd";
|
||||||
|
import useRequest from "@ahooksjs/use-request";
|
||||||
|
import type { ActionType } from "@ant-design/pro-table";
|
||||||
|
import ProTable from "@ant-design/pro-table";
|
||||||
|
import LeftSelectTree from "@/pages/reports/settlementAccount/component/leftSelectTree";
|
||||||
|
import PageTitleBox from "@/components/PageTitleBox";
|
||||||
|
import { handeDeleteCOMMENT, handeDeleteREPLY, handeGetCOMMENTDetail, handeGetCOMMENTList, handeGetREPLYDetail, handeSynchroCOMMENT, handeSynchroREPLY, handeSynchroReplyList } from "../service";
|
||||||
|
import moment from 'moment'
|
||||||
|
import session from "@/utils/session";
|
||||||
|
import { handleSetlogSave } from "@/utils/format";
|
||||||
|
import Draggable from "react-draggable";
|
||||||
|
import ProForm, { ProFormList, ProFormText, ProFormTextArea, ProFormUploadButton } from "@ant-design/pro-form";
|
||||||
|
import { getBase64 } from "@/utils/utils";
|
||||||
|
import './SummaryofMerchantReviews.less'
|
||||||
|
|
||||||
const SummaryofMerchantReviews: React.FC<{ currentUser: CurrentUser | undefined }> = (props) => {
|
|
||||||
const { currentUser } = props
|
|
||||||
|
const SummaryofMerchantReviews: React.FC<{ currentUser: CurrentUser, isComponent?: boolean, parentDetail?: any, come?: string }> = (props) => {
|
||||||
|
const draggleRef = React.createRef<any>()
|
||||||
|
// come 来自哪里
|
||||||
|
const { currentUser, isComponent, parentDetail, come } = props
|
||||||
|
const actionRef = useRef<ActionType>();
|
||||||
|
const formRef = useRef<FormInstance>();
|
||||||
|
const modalFormRef = useRef<FormInstance>();
|
||||||
|
const [collapsible, setCollapsible] = useState<boolean>(false)
|
||||||
|
// 弹出框拖动效果
|
||||||
|
const [bounds, setBounds] = useState<{ left: number, right: number, top: number, bottom: number }>() // 移动的位置
|
||||||
|
const [disabled, setDraggleDisabled] = useState<boolean>() // 是否拖动
|
||||||
|
// 显示回复抽屉
|
||||||
|
const [showDetailDrawer, setShowDetailDrawer] = useState<boolean>(false)
|
||||||
|
// 点击的当前数据
|
||||||
|
const [currentRow, setCurrentRow] = useState<any>()
|
||||||
|
// 评论的附件
|
||||||
|
const [fileList, setFileList] = useState<any>()
|
||||||
|
const [imagePreviewVisible, setImagePreviewVisible] = useState<boolean>(false) // 预览图片
|
||||||
|
const [priviewImage, setPriviewImage] = useState<string>(); // 预览的图片地址
|
||||||
|
// 删除回复的加载效果
|
||||||
|
const [deleteREPLYLoading, setDeleteREPLYLoading] = useState<boolean>(false)
|
||||||
|
|
||||||
|
|
||||||
|
const MEMBERSHIPTYPEYNObj = session.get('MEMBERSHIPTYPEYNObj')
|
||||||
|
// 树相关的属性和方法
|
||||||
|
const [selectedId, setSelectedId] = useState<string>()
|
||||||
|
|
||||||
|
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 columns: any = [
|
||||||
|
{
|
||||||
|
dataIndex: 'searchText',
|
||||||
|
title: '查询内容',
|
||||||
|
hideInTable: true,
|
||||||
|
fieldProps: {
|
||||||
|
placeholder: "请输入评价人员/商家名称/评价内容"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '评价时间',
|
||||||
|
dataIndex: 'search_date',
|
||||||
|
valueType: 'dateRange',
|
||||||
|
hideInTable: true,
|
||||||
|
hideInDescriptions: true,
|
||||||
|
search: {
|
||||||
|
transform: (value) => {
|
||||||
|
return {
|
||||||
|
CREATE_DATE_Start: value[0],
|
||||||
|
CREATE_DATE_End: value[1],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
},
|
||||||
|
fieldProps: {
|
||||||
|
ranges: {
|
||||||
|
"本月": [moment().startOf('M'), moment()],
|
||||||
|
"上月": [moment().subtract(1, 'M').startOf('M'), moment().subtract(1, 'M').endOf('M')],
|
||||||
|
"近三月": [moment().subtract(3, 'M').startOf('M'), moment().endOf('M')],
|
||||||
|
"近半年": [moment().subtract(6, 'M').startOf('M'), moment().endOf('M')],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// initialValue: [moment().add(-1, 'M').format('YYYY-MM-DD'), moment().format('YYYY-MM-DD')],
|
||||||
|
initialValue: [moment().startOf('M'), moment()],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "序号",
|
||||||
|
dataIndex: "index",
|
||||||
|
valueType: "index",
|
||||||
|
hideInSearch: true,
|
||||||
|
align: "center",
|
||||||
|
width: 60,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "商家名称",
|
||||||
|
dataIndex: "SELLER_NAME",
|
||||||
|
width: 270,
|
||||||
|
hideInSearch: true,
|
||||||
|
ellipsis: true,
|
||||||
|
align: "center",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "评价时间",
|
||||||
|
dataIndex: "CREATE_DATE",
|
||||||
|
width: 170,
|
||||||
|
hideInSearch: true,
|
||||||
|
ellipsis: true,
|
||||||
|
align: "center",
|
||||||
|
sorter: (a, b) => new Date(a.CREATE_DATE).getTime() - new Date(b.CREATE_DATE).getTime(),
|
||||||
|
defaultSortOrder: 'descend',
|
||||||
|
render: (_, record) => {
|
||||||
|
return record?.CREATE_DATE ? moment(record?.CREATE_DATE).format('YYYY-MM-DD HH:mm:ss') : "-"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "评价人员",
|
||||||
|
dataIndex: "MEMBERSHIP_NAME",
|
||||||
|
width: 150,
|
||||||
|
hideInSearch: true,
|
||||||
|
ellipsis: true,
|
||||||
|
align: "center",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "会员类型",
|
||||||
|
dataIndex: "MEMBERSHIP_TYPE",
|
||||||
|
width: 150,
|
||||||
|
hideInSearch: true,
|
||||||
|
ellipsis: true,
|
||||||
|
align: "center",
|
||||||
|
valueType: "select",
|
||||||
|
valueEnum: MEMBERSHIPTYPEYNObj
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "消费评价",
|
||||||
|
dataIndex: "SALEBILL_ID",
|
||||||
|
width: 120,
|
||||||
|
hideInSearch: true,
|
||||||
|
ellipsis: true,
|
||||||
|
align: "center",
|
||||||
|
render: (_, record) => {
|
||||||
|
return record?.SALEBILL_ID ? '是' : '否'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "评分",
|
||||||
|
dataIndex: "COMMENT_SCORE",
|
||||||
|
width: 120,
|
||||||
|
hideInSearch: true,
|
||||||
|
ellipsis: true,
|
||||||
|
align: "center",
|
||||||
|
sorter: (a, b) => a.COMMENT_SCORE - b.COMMENT_SCORE,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "评价内容",
|
||||||
|
dataIndex: "COMMENT_CONTENT",
|
||||||
|
width: 250,
|
||||||
|
hideInSearch: true,
|
||||||
|
ellipsis: true,
|
||||||
|
align: "center",
|
||||||
|
render: (_, record) => {
|
||||||
|
return record?.COMMENT_CONTENT ? <a onClick={() => {
|
||||||
|
console.log('recordrecord', record);
|
||||||
|
|
||||||
|
if (record?.ImageList && record?.ImageList.length > 0) {
|
||||||
|
let list: any = []
|
||||||
|
record?.ImageList.forEach((item: any) => {
|
||||||
|
list.push({
|
||||||
|
name: "",
|
||||||
|
url: item?.ImageUrl
|
||||||
|
})
|
||||||
|
})
|
||||||
|
setFileList(list)
|
||||||
|
}
|
||||||
|
|
||||||
|
setCurrentRow({
|
||||||
|
...record,
|
||||||
|
ReplyList: record?.ReplyList || []
|
||||||
|
})
|
||||||
|
setShowDetailDrawer(true)
|
||||||
|
}}>{record?.COMMENT_CONTENT}</a> : "-"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// title: "回复内容",
|
||||||
|
// dataIndex: "回复内容",
|
||||||
|
// width: 250,
|
||||||
|
// hideInSearch: true,
|
||||||
|
// ellipsis: true,
|
||||||
|
// align: "center",
|
||||||
|
// },
|
||||||
|
]
|
||||||
|
|
||||||
|
// 删除评论
|
||||||
|
const handleDeleteEvaluation = async () => {
|
||||||
|
const req: any = {
|
||||||
|
COMMENTId: currentRow?.COMMENT_ID
|
||||||
|
}
|
||||||
|
const data = await handeDeleteCOMMENT(req)
|
||||||
|
if (data.Result_Code === 100) {
|
||||||
|
message.success(data.Result_Desc)
|
||||||
|
setShowDetailDrawer(false)
|
||||||
|
setCurrentRow(undefined);
|
||||||
|
setFileList([])
|
||||||
|
actionRef.current?.reload()
|
||||||
|
} else {
|
||||||
|
message.error(data.Result_Desc)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 删除回复
|
||||||
|
const handleDeleteEvaluationREPLY = async (REPLY_ID: string) => {
|
||||||
|
const req: any = {
|
||||||
|
REPLYId: REPLY_ID
|
||||||
|
}
|
||||||
|
setDeleteREPLYLoading(true)
|
||||||
|
const data = await handeDeleteREPLY(req)
|
||||||
|
setDeleteREPLYLoading(false)
|
||||||
|
if (data.Result_Code === 100) {
|
||||||
|
message.success(data.Result_Desc)
|
||||||
|
actionRef?.current?.reload()
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
message.error(data.Result_Desc)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 预览上传后的图片
|
||||||
|
const handlePreview = async () => {
|
||||||
|
setFileList(fileList)
|
||||||
|
setImagePreviewVisible(true)
|
||||||
|
};
|
||||||
|
const handleChangePreview = (val: any) => {
|
||||||
|
setImagePreviewVisible(val)
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
<div style={{ backgroundColor: '#fff', display: 'flex' }}>
|
||||||
|
{
|
||||||
|
isComponent ? '' :
|
||||||
|
<LeftSelectTree setSelectedId={setSelectedId} setCollapsible={setCollapsible} collapsible={collapsible} />
|
||||||
|
|
||||||
|
}
|
||||||
|
<div style={{
|
||||||
|
width: isComponent ? '100%' : !collapsible ? 'calc(100% - 300px)' : 'calc(100% - 60px)',
|
||||||
|
paddingTop: 0,
|
||||||
|
paddingBottom: 0,
|
||||||
|
paddingRight: 0
|
||||||
|
}}>
|
||||||
|
<ProTable
|
||||||
|
actionRef={actionRef}
|
||||||
|
formRef={formRef}
|
||||||
|
columns={columns}
|
||||||
|
bordered
|
||||||
|
expandable={{
|
||||||
|
expandRowByClick: true
|
||||||
|
}}
|
||||||
|
options={false}
|
||||||
|
scroll={{ x: "100%", y: isComponent ? '300px' : "calc(100vh - 410px)" }}
|
||||||
|
headerTitle={isComponent ? '' : <PageTitleBox props={props} />} // 列表表头
|
||||||
|
search={isComponent ? false : { span: 8 }}
|
||||||
|
request={async (params) => {
|
||||||
|
if (!selectedId && !isComponent) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
console.log('parentDetailparentDetailparentDetail', parentDetail);
|
||||||
|
|
||||||
|
const req: any = isComponent ? come === 'MerchantSalesRanking' ? {
|
||||||
|
SearchParameter: {
|
||||||
|
OWNERUNIT_ID: currentUser?.OwnerUnitId,
|
||||||
|
SERVERPART_IDS: parentDetail?.SERVERPART_ID || "",
|
||||||
|
COMMENT_ISVALID: 1,
|
||||||
|
// MEMBERSHIP_IDS: parentDetail?.MEMBERSHIP_ID,
|
||||||
|
MERCHANTS_ID: parentDetail?.SELLER_ID
|
||||||
|
},
|
||||||
|
PageIndex: 1,
|
||||||
|
PageSize: 999999,
|
||||||
|
keyWord: {
|
||||||
|
Key: "SELLER_NAME,MEMBERSHIP_NAME",
|
||||||
|
Value: params?.searchText || ""
|
||||||
|
},
|
||||||
|
SortStr: "CREATE_DATE desc"
|
||||||
|
} : {
|
||||||
|
SearchParameter: {
|
||||||
|
OWNERUNIT_ID: currentUser?.OwnerUnitId,
|
||||||
|
// PROVINCE_CODE: currentUser?.ProvinceCode,
|
||||||
|
COMMENT_ISVALID: 1,
|
||||||
|
CREATE_DATE_Start: params?.CREATE_DATE_Start || "",
|
||||||
|
CREATE_DATE_End: params?.CREATE_DATE_End || "",
|
||||||
|
MEMBERSHIP_IDS: parentDetail?.MEMBERSHIP_ID,
|
||||||
|
},
|
||||||
|
PageIndex: 1,
|
||||||
|
PageSize: 999999,
|
||||||
|
keyWord: {
|
||||||
|
Key: "SELLER_NAME,MEMBERSHIP_NAME",
|
||||||
|
Value: params?.searchText || ""
|
||||||
|
},
|
||||||
|
SortStr: "CREATE_DATE desc"
|
||||||
|
} : {
|
||||||
|
SearchParameter: {
|
||||||
|
OWNERUNIT_ID: currentUser?.OwnerUnitId,
|
||||||
|
// PROVINCE_CODE: currentUser?.ProvinceCode,
|
||||||
|
COMMENT_ISVALID: 1,
|
||||||
|
CREATE_DATE_Start: params?.CREATE_DATE_Start || "",
|
||||||
|
CREATE_DATE_End: params?.CREATE_DATE_End || "",
|
||||||
|
},
|
||||||
|
PageIndex: 1,
|
||||||
|
PageSize: 999999,
|
||||||
|
keyWord: {
|
||||||
|
Key: "SELLER_NAME,MEMBERSHIP_NAME,COMMENT_CONTENT",
|
||||||
|
Value: params?.searchText || ""
|
||||||
|
},
|
||||||
|
SortStr: "CREATE_DATE desc"
|
||||||
|
}
|
||||||
|
const data = await handeGetCOMMENTList(req)
|
||||||
|
console.log('datadatadatadatadata222', data);
|
||||||
|
|
||||||
|
handleSetlogSave(`点击查询按钮`)
|
||||||
|
|
||||||
|
if (data.List && data.List.length > 0) {
|
||||||
|
return { data: data.List, success: true, total: data.TotalCount }
|
||||||
|
}
|
||||||
|
return { data: [], success: true }
|
||||||
|
}}
|
||||||
|
toolbar={{
|
||||||
|
actions: [
|
||||||
|
]
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/* 图片预览组件 */}
|
||||||
|
{fileList && fileList.length > 0 && <div style={{ display: 'none' }}>
|
||||||
|
<Image.PreviewGroup
|
||||||
|
preview={{
|
||||||
|
visible: imagePreviewVisible,
|
||||||
|
onVisibleChange: vis => {
|
||||||
|
handleChangePreview(vis)
|
||||||
|
}
|
||||||
|
}}>
|
||||||
|
{
|
||||||
|
fileList.map((n) => <Image src={n.url} key={n.url} />)
|
||||||
|
}
|
||||||
|
</Image.PreviewGroup>
|
||||||
|
</div>}
|
||||||
|
|
||||||
|
|
||||||
|
<Modal
|
||||||
|
title={
|
||||||
|
<div
|
||||||
|
className="SummaryofMerchantReviews"
|
||||||
|
>
|
||||||
|
评价回复
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
destroyOnClose={true}
|
||||||
|
width={900}
|
||||||
|
visible={showDetailDrawer}
|
||||||
|
afterClose={() => {
|
||||||
|
}}
|
||||||
|
bodyStyle={{
|
||||||
|
height: '700px', // 你可以根据需要调整高度
|
||||||
|
overflowY: 'auto',
|
||||||
|
}}
|
||||||
|
onCancel={() => {
|
||||||
|
setShowDetailDrawer(false)
|
||||||
|
setCurrentRow(undefined);
|
||||||
|
setFileList([])
|
||||||
|
}}
|
||||||
|
footer={false}
|
||||||
|
modalRender={(modal) => {
|
||||||
|
return <Draggable
|
||||||
|
disabled={disabled}
|
||||||
|
bounds={bounds}
|
||||||
|
onStart={(event, uiData) => onDraggaleStart(event, uiData)}
|
||||||
|
handle=".SummaryofMerchantReviews"
|
||||||
|
>
|
||||||
|
<div ref={draggleRef}>{modal}</div>
|
||||||
|
</Draggable>
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
|
||||||
|
<ProForm
|
||||||
|
formRef={modalFormRef}
|
||||||
|
submitter={false}
|
||||||
|
labelCol={{ style: { width: 80 } }}
|
||||||
|
initialValues={currentRow}
|
||||||
|
onFinish={async (res: any) => {
|
||||||
|
if (res.ReplyList && res.ReplyList.length > 0) {
|
||||||
|
let list: any = []
|
||||||
|
res.ReplyList.forEach((item: any) => {
|
||||||
|
if (!item.REPLY_ID) {
|
||||||
|
list.push({
|
||||||
|
COMMENT_ID: currentRow?.COMMENT_ID || "",
|
||||||
|
COMMENT_CONTENT: currentRow?.COMMENT_CONTENT || "",
|
||||||
|
// COMMENT_DATE: moment().format('YYYY-MM-DD HH:mm:ss'),
|
||||||
|
STAFF_ID: currentUser?.ID,
|
||||||
|
STAFF_NAME: currentUser?.Name,
|
||||||
|
REPLY_DATE: moment().format('YYYY-MM-DD HH:mm:ss'),
|
||||||
|
REPLY_CONTENT: item.REPLY_CONTENT,
|
||||||
|
REPLY_STATE: 1
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log('list', list);
|
||||||
|
|
||||||
|
const data = await handeSynchroReplyList({
|
||||||
|
list: list
|
||||||
|
})
|
||||||
|
console.log('datadatadatadata', data);
|
||||||
|
if (data.Result_Code === 100) {
|
||||||
|
message.success(data.Result_Desc)
|
||||||
|
setFileList([])
|
||||||
|
setShowDetailDrawer(false)
|
||||||
|
setCurrentRow(undefined);
|
||||||
|
actionRef.current?.reload()
|
||||||
|
} else {
|
||||||
|
message.error(data.Result_Desc)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
setFileList([])
|
||||||
|
setShowDetailDrawer(false)
|
||||||
|
setCurrentRow(undefined);
|
||||||
|
actionRef.current?.reload()
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
// request={async () => {
|
||||||
|
// if (currentRow?.ReplyList && currentRow?.ReplyList.length > 0) {
|
||||||
|
// const req: any = {
|
||||||
|
// REPLYId: currentRow?.ReplyList[0].REPLY_ID
|
||||||
|
// }
|
||||||
|
// const data = await handeGetREPLYDetail(req)
|
||||||
|
// console.log('datadatadata', data);
|
||||||
|
// return {
|
||||||
|
// ...data,
|
||||||
|
// ReplyToEvaluation: data.REPLY_CONTENT
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// return {}
|
||||||
|
// }
|
||||||
|
|
||||||
|
// }}
|
||||||
|
>
|
||||||
|
<Row>
|
||||||
|
<Col span={24}>
|
||||||
|
<ProFormTextArea
|
||||||
|
label={"评论内容"}
|
||||||
|
name={"COMMENT_CONTENT"}
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
|
||||||
|
<Col span={24}>
|
||||||
|
<ProFormUploadButton
|
||||||
|
label={""}
|
||||||
|
name={"ImageList"}
|
||||||
|
disabled
|
||||||
|
readonly
|
||||||
|
max={0}
|
||||||
|
fileList={fileList || []}
|
||||||
|
listType="picture-card"
|
||||||
|
accept="image/*"
|
||||||
|
fieldProps={{
|
||||||
|
onPreview: handlePreview,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
<Col span={24} className="proformList">
|
||||||
|
<ProFormList
|
||||||
|
name="ReplyList"
|
||||||
|
label="回复评价"
|
||||||
|
copyIconProps={false}
|
||||||
|
deleteIconProps={false}
|
||||||
|
// creatorButtonProps={{
|
||||||
|
// position: 'bottom',
|
||||||
|
// creatorButtonText: '新增一条回复',
|
||||||
|
// }}
|
||||||
|
creatorButtonProps={false}
|
||||||
|
style={{ width: '100%' }}
|
||||||
|
itemContainerStyle={{ width: '100%' }}
|
||||||
|
>
|
||||||
|
{(field, index, action) => {
|
||||||
|
const isInitialItem = index < (currentRow?.ReplyList?.length || 0);
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
key={field.key}
|
||||||
|
style={{
|
||||||
|
width: '100%',
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'flex-start',
|
||||||
|
marginBottom: '10px',
|
||||||
|
padding: '12px',
|
||||||
|
borderRadius: '4px'
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div style={{ flex: 1 }}>
|
||||||
|
<ProFormTextArea
|
||||||
|
name={"REPLY_CONTENT"} // 确保使用 field.name
|
||||||
|
placeholder="请输入回复内容"
|
||||||
|
readonly={isInitialItem} // 直接使用 isInitialItem
|
||||||
|
readonly
|
||||||
|
fieldProps={{
|
||||||
|
style: { width: '100%' },
|
||||||
|
autoSize: { minRows: 3, maxRows: 6 },
|
||||||
|
}}
|
||||||
|
rules={[{ required: true, message: '请输入回复内容' }]}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div style={{
|
||||||
|
width: '50px',
|
||||||
|
marginLeft: '8px',
|
||||||
|
gap: '8px'
|
||||||
|
}}>
|
||||||
|
{/* {isInitialItem ? (
|
||||||
|
<Button
|
||||||
|
danger
|
||||||
|
loading={deleteREPLYLoading}
|
||||||
|
onClick={async () => {
|
||||||
|
const replyId = currentRow?.ReplyList?.[index]?.REPLY_ID;
|
||||||
|
if (replyId) {
|
||||||
|
const success = await handleDeleteEvaluationREPLY(replyId);
|
||||||
|
if (success) {
|
||||||
|
action?.remove(index);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
action?.remove(index);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</Button>
|
||||||
|
) : (
|
||||||
|
<Button
|
||||||
|
danger
|
||||||
|
onClick={() => action?.remove(index)}
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</Button>
|
||||||
|
)} */}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
</ProFormList>
|
||||||
|
</Col>
|
||||||
|
|
||||||
|
{/* <Col span={24}>
|
||||||
|
<ProFormTextArea
|
||||||
|
label={"回复评价"}
|
||||||
|
name={"ReplyToEvaluation"}
|
||||||
|
rules={[{
|
||||||
|
required: true,
|
||||||
|
message: '请输入回复内容'
|
||||||
|
}]}
|
||||||
|
readonly={currentRow?.ReplyList && currentRow?.ReplyList.length > 0 ? true : false}
|
||||||
|
/>
|
||||||
|
</Col> */}
|
||||||
|
</Row>
|
||||||
|
|
||||||
|
</ProForm>
|
||||||
|
|
||||||
|
</Modal >
|
||||||
|
</div >
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1169,3 +1169,54 @@ export async function handeGetDeleteCOMMODITYWARNING(params: any) {
|
|||||||
}
|
}
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 统计商品销售汇总情况 热销滞销分析
|
||||||
|
export async function handeGetCommoditySaleSummary(params: any) {
|
||||||
|
const data = await requestEncryption(`/MallBasic/GetCommoditySaleSummary`, {
|
||||||
|
method: 'POST',
|
||||||
|
data: { ...params, requestEncryption: true }
|
||||||
|
})
|
||||||
|
if (data.Result_Code !== 100) {
|
||||||
|
return data
|
||||||
|
}
|
||||||
|
return data.Result_Data
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 查看投诉建议 失物招领的列表
|
||||||
|
export async function handeGetSUGGESTIONList(params: any) {
|
||||||
|
const data = await requestEncryption(`/WisdomServerpart/GetSUGGESTIONList`, {
|
||||||
|
method: 'POST',
|
||||||
|
data: { ...params, requestEncryption: true }
|
||||||
|
})
|
||||||
|
if (data.Result_Code !== 100) {
|
||||||
|
return data
|
||||||
|
}
|
||||||
|
return data.Result_Data.List
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 删除失物招领
|
||||||
|
export async function handeDeleteSUGGESTION(params: any) {
|
||||||
|
const data = await requestEncryption(`/WisdomServerpart/DeleteSUGGESTION`, {
|
||||||
|
method: 'POST',
|
||||||
|
data: { ...params, requestEncryption: true }
|
||||||
|
})
|
||||||
|
if (data.Result_Code !== 100) {
|
||||||
|
return data
|
||||||
|
}
|
||||||
|
return data
|
||||||
|
}
|
||||||
|
|
||||||
|
// 同步失物招领
|
||||||
|
export async function handeSynchroSUGGESTION(params: any) {
|
||||||
|
const data = await requestEncryption(`/WisdomServerpart/SynchroSUGGESTION`, {
|
||||||
|
method: 'POST',
|
||||||
|
data: { ...params, requestEncryption: true }
|
||||||
|
})
|
||||||
|
if (data.Result_Code !== 100) {
|
||||||
|
return data
|
||||||
|
}
|
||||||
|
return data
|
||||||
|
}
|
||||||
@ -1,4 +1,4 @@
|
|||||||
// 由 scripts/writeVersion.js 自动生成
|
// 由 scripts/writeVersion.js 自动生成
|
||||||
export const VERSION = "4.5.11";
|
export const VERSION = "4.5.13";
|
||||||
export const GIT_HASH = "edeca34";
|
export const GIT_HASH = "524c0ab";
|
||||||
export const BUILD_TIME = "2025-07-30T12:19:28.444Z";
|
export const BUILD_TIME = "2025-08-04T10:43:20.278Z";
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user