update
This commit is contained in:
parent
e5550582a9
commit
24088d3955
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ant-design-pro",
|
||||
"version": "4.5.88",
|
||||
"version": "4.5.90",
|
||||
"private": true,
|
||||
"description": "An out-of-box UI solution for enterprise applications",
|
||||
"scripts": {
|
||||
|
||||
@ -473,7 +473,8 @@ const AfterSalesManage: React.FC<{ currentUser: CurrentUser | undefined }> = (pr
|
||||
},
|
||||
showSearch: true,
|
||||
filterTreeNode: (input, node) =>
|
||||
(node.FIELDENUM_NAME || '').toLowerCase().includes(input.toLowerCase())
|
||||
(node.FIELDENUM_NAME || '').toLowerCase().includes(input.toLowerCase()),
|
||||
treeDefaultExpandAll: true
|
||||
}}
|
||||
rules={[
|
||||
{
|
||||
|
||||
@ -112,7 +112,7 @@ const MallEvaluationManage: React.FC<{ currentUser: CurrentUser | undefined, isC
|
||||
title: '商家名称',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
width: 150,
|
||||
width: 250,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
@ -120,7 +120,7 @@ const MallEvaluationManage: React.FC<{ currentUser: CurrentUser | undefined, isC
|
||||
title: '评价商品',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
width: 150,
|
||||
width: 250,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
|
||||
@ -27,7 +27,7 @@ import LeftSelectMallType from './component/LeftSelectMallType';
|
||||
import { handeDeleteCOMMODITY, handeDeleteRTCOMMODITY_MULTI, handeGetCOMMODITY_MULTIList, handeGetCOMMODITYDetail, handeGetCOMMODITYList, handeGetMERCHANTSList, handeGetRTCOMMODITY_MULTIList, handeSetCommodityState, handeSetGoodsDutyParagraph, handeSynchroCOMMODITY, handeSynchroRTCOMMODITYMULTIList, handleGetBRANDList, handlGetUSERDEFINEDTYPEList } from '../service';
|
||||
import session from '@/utils/session';
|
||||
import { deleteAHYDPicture, deletePicture, uploadAHYDPicture, uploadPicture } from '@/services/picture';
|
||||
import { handleSetlogSave } from '@/utils/format';
|
||||
import { exportXlsxFromProColumnsExcelJS, formatTreeData, handleSetlogSave } from '@/utils/format';
|
||||
import { highlightText } from '@/utils/highlightText';
|
||||
import { handlecsyncWeChatGetMallGoodsInfo, handlecsyncWeChatGetMallGoodsInfoAll } from '@/pages/operatingMerchants/service';
|
||||
import { isEqual } from 'lodash';
|
||||
@ -121,6 +121,8 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
const [relevanceCouponList, setRelevanceCouponList] = useState<any>([])
|
||||
// 当前选择的卡券行
|
||||
const [selectRelevanceId, setSelectRelevanceId] = useState<any>([])
|
||||
// 导出的数据
|
||||
const [reqDetailList, setReqDetailList] = useState<any>(); // 合计项数据源
|
||||
|
||||
// 预览上传后的图片
|
||||
const handlePreview = async (type: number) => {
|
||||
@ -324,6 +326,180 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
// },
|
||||
];
|
||||
|
||||
// 导出excel的columns
|
||||
const exportColumns: any = [
|
||||
{
|
||||
dataIndex: 'USERDEFINEDTYPE_NAME',
|
||||
title: '商城类别',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
width: 120,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'BRAND_NAME',
|
||||
title: '品牌名称',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
width: 120,
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
dataIndex: 'COMMODITY_NAME',
|
||||
title: '商品名称',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
hideInDescriptions: true,
|
||||
width: 300,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'COMMODITY_INDEX',
|
||||
title: '商品索引',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
width: 120,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'COMMODITY_NATURE',
|
||||
title: '商品属性',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
width: 120,
|
||||
ellipsis: true,
|
||||
valueType: 'select',
|
||||
valueEnum: COMMODITYNATUREObj
|
||||
},
|
||||
{
|
||||
dataIndex: 'COMMODITY_BARCODE',
|
||||
title: '商品条码',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
width: 120,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'COMMODITY_STOCK',
|
||||
title: '商品库存',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
width: 120,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'COMMODITY_EN',
|
||||
title: '商品销量',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
width: 120,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'COMMODITY_RETAILPRICE',
|
||||
title: '商品原价',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
width: 120,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'COMMODITY_MEMBERPRICE',
|
||||
title: '商品售价',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
width: 120,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'COMMODITY_PURCHASEPRICE',
|
||||
title: '商品成本',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
width: 120,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'DUTY_PARAGRAPH',
|
||||
title: '商品税率',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
width: 120,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'COMMODITY_POINT',
|
||||
title: '所需积分',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
width: 120,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'PAY_METHOD',
|
||||
title: '消费模式',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
width: 120,
|
||||
ellipsis: true,
|
||||
valueType: 'select',
|
||||
valueEnum: {
|
||||
1000: "余额消费",
|
||||
2000: "积分兑换",
|
||||
}
|
||||
},
|
||||
{
|
||||
dataIndex: 'COMMODITY_UNIT',
|
||||
title: '商品单位',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
width: 120,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'COMMODITY_RULE',
|
||||
title: '商品规格',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
width: 120,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'MERCHANTS_NAME',
|
||||
title: '供应商名称',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
width: 120,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'UPPER_STATE',
|
||||
title: '上架状态',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
width: 120,
|
||||
ellipsis: true,
|
||||
valueType: 'select',
|
||||
valueEnum: {
|
||||
1: "已上架",
|
||||
0: "未上架"
|
||||
}
|
||||
},
|
||||
{
|
||||
dataIndex: 'COMMODITY_STATE',
|
||||
title: '有效状态',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
width: 120,
|
||||
ellipsis: true,
|
||||
valueType: 'select',
|
||||
valueEnum: {
|
||||
1: "有效",
|
||||
0: "无效"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
// 多规格表格的字段
|
||||
const specsColumns: any = [
|
||||
{
|
||||
@ -862,8 +1038,27 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
handleSetlogSave(`点击查询按钮`)
|
||||
setSelectShopRowKey([])
|
||||
if (data.List && data.List.length > 0) {
|
||||
let res: any = []
|
||||
|
||||
let enumList: any = ["COMMODITY_NATURE", "PAY_METHOD", "UPPER_STATE", "COMMODITY_STATE"]
|
||||
let PAY_METHODList: any = [
|
||||
{ label: "余额消费", value: 1000 },
|
||||
{ label: "积分兑换", value: 2000 },
|
||||
]
|
||||
let UPPER_STATEList: any = [
|
||||
{ label: "已上架", value: 1 },
|
||||
{ label: "未上架", value: 0 },
|
||||
]
|
||||
let COMMODITY_STATEList: any = [
|
||||
{ label: "有效", value: 1 },
|
||||
{ label: "无效", value: 0 },
|
||||
]
|
||||
res = formatTreeData(JSON.parse(JSON.stringify(data.List)), [], enumList, [COMMODITYNATUREList, PAY_METHODList, UPPER_STATEList, COMMODITY_STATEList], [])
|
||||
console.log('resresresres', res);
|
||||
setReqDetailList(res)
|
||||
return { data: data.List, success: true, total: data.TotalCount }
|
||||
}
|
||||
setReqDetailList([])
|
||||
return { data: [], success: true }
|
||||
}}
|
||||
columns={columns}
|
||||
@ -914,7 +1109,20 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
</Button>
|
||||
</> : ""
|
||||
}
|
||||
</>
|
||||
</>,
|
||||
<Button type={"primary"} onClick={() => {
|
||||
if (reqDetailList && reqDetailList.length > 0) {
|
||||
exportXlsxFromProColumnsExcelJS(exportColumns,
|
||||
reqDetailList,
|
||||
`商品数据导出${moment().format('YYYY-MM-DD HH:mm:ss')}`,
|
||||
{
|
||||
|
||||
}
|
||||
)
|
||||
} else {
|
||||
message.error('暂无导出数据!')
|
||||
}
|
||||
}}>导出excel</Button>
|
||||
],
|
||||
}}
|
||||
pagination={{ defaultPageSize: 10 }}
|
||||
@ -1330,7 +1538,8 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
searchParameter: {
|
||||
OWNERUNIT_ID: currentUser?.OwnerUnitId,
|
||||
PROVINCE_CODE: currentUser?.ProvinceCode,
|
||||
MERCHANTS_TYPE: ""
|
||||
MERCHANTS_TYPE: "",
|
||||
MERCHANTS_STATE: 1
|
||||
},
|
||||
PageIndex: 1,
|
||||
PageSize: 999999,
|
||||
@ -1870,6 +2079,7 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
}
|
||||
if (!isAllOk) {
|
||||
message.error('请先完善表格数据!')
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -14,10 +14,10 @@ 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 { handeGetSupplierSaleBillList } from "../service";
|
||||
import { handeGetCOMPANYList, handeGetOnlineBillAccountList, handeGetSalebillAccountList, handeGetSupplierSaleBillList } from "../service";
|
||||
import moment from 'moment'
|
||||
import OrderDetailModal from "../BookingMealOrder/components/orderDetailModal";
|
||||
import { handleSetlogSave } from "@/utils/format";
|
||||
import { exportXlsxFromProColumnsExcelJS, formatTreeData, handleSetlogSave } from "@/utils/format";
|
||||
import { highlightText } from "@/utils/highlightText";
|
||||
|
||||
const TradingLedger: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
@ -44,7 +44,31 @@ const TradingLedger: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
const [modalVisible, handleModalVisible] = useState<boolean>(false);
|
||||
// 当前查询的文字
|
||||
const [currentSearchText, setCurrentSearchText] = useState<string>('')
|
||||
// 获取导出数据的loading
|
||||
const [getExportDataLoading, setGetExportDataLoading] = useState<boolean>(false);
|
||||
|
||||
// 获取所属单位
|
||||
const { loading: companyLoading, data: companyList = [] } = useRequest(async () => {
|
||||
const startReq: any = {
|
||||
SearchParameter: {
|
||||
OWNERUNIT_ID: "911",
|
||||
COMPANY_STATE: 1000
|
||||
},
|
||||
PageIndex: 1,
|
||||
PageSize: 999999
|
||||
}
|
||||
const startData: any = await handeGetCOMPANYList(startReq)
|
||||
console.log('fdsjfhsjlaf', startData);
|
||||
let list: any = []
|
||||
if (startData && startData.length > 0) {
|
||||
startData.forEach((item: any) => {
|
||||
list.push({ label: item.COMPANY_NAME, value: item.COMPANY_ID })
|
||||
})
|
||||
}
|
||||
return list
|
||||
})
|
||||
|
||||
// 页面显示的表格内容
|
||||
const columns: any = [
|
||||
{
|
||||
dataIndex: 'searchText',
|
||||
@ -54,6 +78,17 @@ const TradingLedger: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
placeholder: "请输入供货商/购买的商品/订单编号"
|
||||
}
|
||||
},
|
||||
{
|
||||
dataIndex: "CompanyId",
|
||||
title: "所属单位",
|
||||
hideInTable: true,
|
||||
valueType: 'select',
|
||||
fieldProps: {
|
||||
showSearch: true,
|
||||
options: companyList,
|
||||
filterOption: (input: any, option: any) => (option?.label ?? '').toLowerCase().includes(input.toLowerCase()),
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '下单时间',
|
||||
dataIndex: 'search_date',
|
||||
@ -79,82 +114,102 @@ const TradingLedger: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
// initialValue: [moment().subtract(1, 'M').format('YYYY-MM-DD'), moment().format('YYYY-MM-DD')],
|
||||
initialValue: [moment().startOf('M'), moment()],
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'MERCHANTS_NAME',
|
||||
title: "序号",
|
||||
dataIndex: "index",
|
||||
width: 80,
|
||||
hideInSearch: true,
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
valueType: 'index'
|
||||
},
|
||||
{
|
||||
dataIndex: 'SupplierName',
|
||||
title: <div style={{ textAlign: 'center' }}>供应商名称</div>,
|
||||
align: 'left',
|
||||
width: 200,
|
||||
width: 250,
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
render: (_, record) => {
|
||||
return highlightText(record?.MERCHANTS_NAME, currentSearchText)
|
||||
return highlightText(record?.SupplierName, currentSearchText)
|
||||
}
|
||||
},
|
||||
{
|
||||
dataIndex: 'SALEBILL_CODE',
|
||||
title: <div style={{ textAlign: 'center' }}>订单编码</div>,
|
||||
dataIndex: "SupplierName",
|
||||
title: <div style={{ textAlign: 'center' }}>所属单位</div>,
|
||||
hideInSearch: true,
|
||||
width: 250,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'OrderPerson',
|
||||
title: <div style={{ textAlign: 'center' }}>会员名称</div>,
|
||||
align: 'center',
|
||||
width: 220,
|
||||
width: 150,
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
render: (_, record) => {
|
||||
return record?.SALEBILL_CODE ?
|
||||
<a onClick={() => {
|
||||
setCurrentRow(record);
|
||||
handleModalVisible(true)
|
||||
handleSetlogSave(`查询收货人【${record?.ORDER_PERSON}】编码【${record.SALEBILL_CODE}】订单`)
|
||||
|
||||
}}>
|
||||
{/* {record?.SALEBILL_CODE} */}
|
||||
{highlightText(record?.SALEBILL_CODE, currentSearchText)}
|
||||
</a> : "-"
|
||||
return record?.OrderPerson ? `${record?.OrderPerson}${record?.ReceiverPhone ? `【${record?.ReceiverPhone}】` : ""}` : ""
|
||||
}
|
||||
},
|
||||
{
|
||||
dataIndex: 'PAYMENT_CODE',
|
||||
title: <div style={{ textAlign: 'center' }}>交易单号</div>,
|
||||
dataIndex: 'ReceiverName',
|
||||
title: <div style={{ textAlign: 'center' }}>收货人员</div>,
|
||||
align: 'center',
|
||||
width: 220,
|
||||
width: 150,
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
hideInSearch: true
|
||||
},
|
||||
{
|
||||
dataIndex: 'COMMODITY_NAME',
|
||||
title: <div style={{ textAlign: 'center' }}>购买商品</div>,
|
||||
dataIndex: 'ReceiverPhone',
|
||||
title: <div style={{ textAlign: 'center' }}>联系电话</div>,
|
||||
align: 'center',
|
||||
width: 150,
|
||||
ellipsis: true,
|
||||
hideInSearch: true
|
||||
},
|
||||
{
|
||||
dataIndex: 'CommodityName',
|
||||
title: <div style={{ textAlign: 'center' }}>购买的商品</div>,
|
||||
align: 'left',
|
||||
width: 300,
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
render: (_, record) => {
|
||||
return highlightText(record?.COMMODITY_NAME, currentSearchText)
|
||||
return highlightText(record?.CommodityName, currentSearchText)
|
||||
}
|
||||
},
|
||||
{
|
||||
dataIndex: 'ORDER_PERSON',
|
||||
title: '收货人',
|
||||
align: 'center',
|
||||
dataIndex: 'SaleTotalTaxAmount',
|
||||
title: '订单金额',
|
||||
align: 'right',
|
||||
width: 150,
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
sorter: (a, b) => a.ORDER_AMOUNT - b.ORDER_AMOUNT,
|
||||
},
|
||||
{
|
||||
dataIndex: 'ORDER_DATE',
|
||||
title: '下单时间',
|
||||
align: 'center',
|
||||
dataIndex: 'PayAmount',
|
||||
title: '实付金额',
|
||||
align: 'right',
|
||||
width: 150,
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
render: (_, record) => {
|
||||
return record?.ORDER_DATE ? moment(record?.ORDER_DATE).format('YYYY-MM-DD HH:mm:ss') : "-"
|
||||
sorter: (a, b) => a.PayAmount - b.PayAmount,
|
||||
},
|
||||
sorter: (a, b) => new Date(a.ORDER_DATE).getTime() - new Date(b.ORDER_DATE).getTime(),
|
||||
defaultSortOrder: 'descend',
|
||||
{
|
||||
dataIndex: 'BalancePayment',
|
||||
title: <div style={{ textAlign: 'center' }}>工会积分</div>,
|
||||
align: 'right',
|
||||
valueType: 'digit',
|
||||
width: 150,
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: "订单类型",
|
||||
width: 150,
|
||||
dataIndex: "SALEBILL_TYPE",
|
||||
dataIndex: "SaleBillType",
|
||||
valueType: "select",
|
||||
align: 'center',
|
||||
valueEnum: {
|
||||
@ -166,9 +221,67 @@ const TradingLedger: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
},
|
||||
initialValue: '0',
|
||||
},
|
||||
{
|
||||
title: "支付方式",
|
||||
dataIndex: "PaymentMethod",
|
||||
valueType: "select",
|
||||
valueEnum: {
|
||||
"0": "全部",
|
||||
"支付宝": "支付宝",
|
||||
"微信": "微信",
|
||||
"积分兑换": "积分兑换",
|
||||
"余额支付": "余额支付",
|
||||
},
|
||||
width: 120,
|
||||
hideInSearch: true,
|
||||
ellipsis: true,
|
||||
align: "center",
|
||||
initialValue: '0',
|
||||
},
|
||||
{
|
||||
dataIndex: 'PaymentTime',
|
||||
title: '下单时间',
|
||||
align: 'center',
|
||||
width: 150,
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
render: (_, record) => {
|
||||
return record?.PaymentTime ? moment(record?.PaymentTime).format('YYYY-MM-DD HH:mm:ss') : "-"
|
||||
},
|
||||
sorter: (a, b) => new Date(a.PaymentTime).getTime() - new Date(b.PaymentTime).getTime(),
|
||||
defaultSortOrder: 'descend',
|
||||
},
|
||||
{
|
||||
dataIndex: 'OrderCode',
|
||||
title: <div style={{ textAlign: 'center' }}>订单编码</div>,
|
||||
align: 'center',
|
||||
width: 220,
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
render: (_, record) => {
|
||||
return record?.OrderCode ?
|
||||
<a onClick={() => {
|
||||
setCurrentRow(record);
|
||||
handleModalVisible(true)
|
||||
handleSetlogSave(`查询收货人【${record?.ORDER_PERSON}】编码【${record.OrderCode}】订单`)
|
||||
|
||||
}}>
|
||||
{/* {record?.OrderCode} */}
|
||||
{highlightText(record?.OrderCode, currentSearchText)}
|
||||
</a> : "-"
|
||||
}
|
||||
},
|
||||
// {
|
||||
// dataIndex: 'PAYMENT_CODE',
|
||||
// title: <div style={{ textAlign: 'center' }}>交易单号</div>,
|
||||
// align: 'center',
|
||||
// width: 220,
|
||||
// ellipsis: true,
|
||||
// hideInSearch: true,
|
||||
// },
|
||||
{
|
||||
title: "订单状态",
|
||||
dataIndex: "SALEBILL_STATE",
|
||||
dataIndex: "OrderStatus",
|
||||
width: 150,
|
||||
ellipsis: true,
|
||||
valueType: "select",
|
||||
@ -186,70 +299,337 @@ const TradingLedger: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
align: "center",
|
||||
initialValue: '0',
|
||||
},
|
||||
// {
|
||||
// dataIndex: 'desc',
|
||||
// title: <div style={{ textAlign: 'center' }}>备注说明</div>,
|
||||
// align: 'left',
|
||||
// width: 150,
|
||||
// ellipsis: true,
|
||||
// hideInSearch: true,
|
||||
// },
|
||||
]
|
||||
|
||||
// 导出excel的表格内容
|
||||
const exportColumns: any = [
|
||||
{
|
||||
dataIndex: 'ORDER_AMOUNT',
|
||||
title: '订单金额',
|
||||
align: 'center',
|
||||
width: 150,
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
sorter: (a, b) => a.ORDER_AMOUNT - b.ORDER_AMOUNT,
|
||||
title: "订单编码",
|
||||
width: 250,
|
||||
dataIndex: "OrderCode",
|
||||
},
|
||||
{
|
||||
dataIndex: 'PAY_AMOUNT',
|
||||
title: '实付金额',
|
||||
align: 'center',
|
||||
title: "会员名称",
|
||||
width: 150,
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
sorter: (a, b) => a.PAY_AMOUNT - b.PAY_AMOUNT,
|
||||
dataIndex: "OrderPerson",
|
||||
},
|
||||
{
|
||||
title: "收货人",
|
||||
width: 150,
|
||||
dataIndex: "ReceiverName",
|
||||
},
|
||||
{
|
||||
title: "收货人电话",
|
||||
width: 150,
|
||||
dataIndex: "ReceiverPhone",
|
||||
},
|
||||
{
|
||||
title: "收货地址",
|
||||
width: 250,
|
||||
dataIndex: "ReceiverAddress",
|
||||
},
|
||||
{
|
||||
title: "物流信息",
|
||||
width: 250,
|
||||
dataIndex: "LogisticsInfo",
|
||||
},
|
||||
{
|
||||
title: "商品名称",
|
||||
width: 250,
|
||||
dataIndex: "CommodityName",
|
||||
},
|
||||
{
|
||||
title: "商品条码",
|
||||
width: 150,
|
||||
dataIndex: "商品条码",
|
||||
},
|
||||
{
|
||||
title: "供货商",
|
||||
width: 250,
|
||||
dataIndex: "SupplierName",
|
||||
},
|
||||
{
|
||||
title: "商品规格",
|
||||
width: 120,
|
||||
dataIndex: "CommodityRule",
|
||||
},
|
||||
{
|
||||
title: "下单数量",
|
||||
width: 120,
|
||||
dataIndex: "OrderCount",
|
||||
valueType: "digit",
|
||||
},
|
||||
{
|
||||
title: "采购单价",
|
||||
width: 120,
|
||||
dataIndex: "PurchaseTaxPrice",
|
||||
valueType: "digit",
|
||||
},
|
||||
{
|
||||
title: "采购合计金额",
|
||||
width: 120,
|
||||
dataIndex: "PurchaseTotalTaxAmount",
|
||||
valueType: "digit",
|
||||
},
|
||||
{
|
||||
title: "采购不含税合计金额",
|
||||
width: 120,
|
||||
dataIndex: "PurchaseTotalAmount",
|
||||
valueType: "digit",
|
||||
},
|
||||
{
|
||||
title: "销售单价",
|
||||
width: 120,
|
||||
dataIndex: "SaleTaxPrice",
|
||||
valueType: "digit",
|
||||
},
|
||||
{
|
||||
title: "销售合计金额",
|
||||
width: 120,
|
||||
dataIndex: "SaleTotalTaxAmount",
|
||||
valueType: "digit",
|
||||
},
|
||||
{
|
||||
title: "销售不含税合计金额",
|
||||
width: 120,
|
||||
dataIndex: "SaleTotalAmount",
|
||||
valueType: "digit",
|
||||
},
|
||||
{
|
||||
title: "平台手续费",
|
||||
width: 120,
|
||||
dataIndex: "PlatformFee",
|
||||
valueType: "digit",
|
||||
},
|
||||
{
|
||||
title: "财务到账含税金额",
|
||||
width: 120,
|
||||
dataIndex: "FinancialReceivedAmount",
|
||||
valueType: "digit",
|
||||
},
|
||||
{
|
||||
title: "税率",
|
||||
width: 120,
|
||||
dataIndex: "TaxRate",
|
||||
},
|
||||
{
|
||||
title: "单位名称",
|
||||
width: 250,
|
||||
dataIndex: "CompanyName",
|
||||
},
|
||||
{
|
||||
title: "付款积分",
|
||||
width: 120,
|
||||
dataIndex: "BalancePayment",
|
||||
},
|
||||
{
|
||||
title: "实付总金额",
|
||||
width: 120,
|
||||
dataIndex: "PayAmount",
|
||||
valueType: "digit",
|
||||
},
|
||||
{
|
||||
title: "支付方式",
|
||||
dataIndex: "CHANNEL_TYPE",
|
||||
valueType: "select",
|
||||
valueEnum: {
|
||||
"0": "全部",
|
||||
"支付宝": "支付宝",
|
||||
"微信": "微信",
|
||||
"积分兑换": "积分兑换",
|
||||
"余额支付": "余额支付",
|
||||
width: 150,
|
||||
dataIndex: "PaymentMethod",
|
||||
},
|
||||
{
|
||||
title: "支付时间",
|
||||
width: 180,
|
||||
dataIndex: "PaymentTime",
|
||||
},
|
||||
{
|
||||
title: "支付订单号",
|
||||
width: 150,
|
||||
dataIndex: "PaymentOrderCode",
|
||||
},
|
||||
{
|
||||
title: "订单状态",
|
||||
width: 150,
|
||||
dataIndex: "OrderStatus",
|
||||
},
|
||||
{
|
||||
title: "工会订单",
|
||||
width: 150,
|
||||
dataIndex: "IsUnionOrder",
|
||||
}
|
||||
]
|
||||
// 导出财务的结算excel表格内容
|
||||
const exportFinanceColumns: any = [
|
||||
{
|
||||
title: "支付订单号",
|
||||
width: 250,
|
||||
dataIndex: "PaymentOrderCode",
|
||||
},
|
||||
{
|
||||
title: "会员名称",
|
||||
width: 150,
|
||||
dataIndex: "OrderPerson",
|
||||
},
|
||||
{
|
||||
title: "支付时间",
|
||||
width: 180,
|
||||
dataIndex: "PaymentTime",
|
||||
},
|
||||
{
|
||||
title: "下单数量",
|
||||
width: 120,
|
||||
hideInSearch: true,
|
||||
ellipsis: true,
|
||||
align: "center",
|
||||
initialValue: '0',
|
||||
valueType: 'digit',
|
||||
dataIndex: "OrderCount",
|
||||
},
|
||||
|
||||
{
|
||||
title: "采购合计金额",
|
||||
width: 120,
|
||||
valueType: 'digit',
|
||||
dataIndex: "PurchaseTotalTaxAmount",
|
||||
},
|
||||
{
|
||||
title: "采购不含税合计金额",
|
||||
width: 120,
|
||||
valueType: 'digit',
|
||||
dataIndex: "PurchaseTotalAmount",
|
||||
},
|
||||
{
|
||||
title: "销售合计金额",
|
||||
width: 120,
|
||||
valueType: 'digit',
|
||||
dataIndex: "SaleTotalTaxAmount",
|
||||
},
|
||||
{
|
||||
title: "销售不含税合计金额",
|
||||
width: 120,
|
||||
valueType: 'digit',
|
||||
dataIndex: "SaleTotalAmount",
|
||||
},
|
||||
{
|
||||
title: "平台手续费",
|
||||
width: 120,
|
||||
valueType: 'digit',
|
||||
dataIndex: "PlatformFee",
|
||||
},
|
||||
{
|
||||
title: "财务到账含税金额",
|
||||
width: 120,
|
||||
valueType: 'digit',
|
||||
dataIndex: "FinancialReceivedAmount",
|
||||
},
|
||||
{
|
||||
title: "单位名称",
|
||||
width: 250,
|
||||
dataIndex: "CompanyName",
|
||||
},
|
||||
{
|
||||
title: "付款积分",
|
||||
width: 120,
|
||||
valueType: 'digit',
|
||||
dataIndex: "BalancePayment",
|
||||
},
|
||||
{
|
||||
title: "实付总金额",
|
||||
width: 120,
|
||||
valueType: 'digit',
|
||||
dataIndex: "PayAmount",
|
||||
},
|
||||
{
|
||||
title: "支付方式",
|
||||
width: 150,
|
||||
dataIndex: "PaymentMethod",
|
||||
},
|
||||
{
|
||||
title: "订单状态",
|
||||
width: 150,
|
||||
dataIndex: "OrderStatus",
|
||||
},
|
||||
{
|
||||
title: "工会订单",
|
||||
width: 150,
|
||||
dataIndex: "IsUnionOrder",
|
||||
}
|
||||
]
|
||||
|
||||
const exportTable = (e) => {
|
||||
e.stopPropagation(); // 防止Collapse组件收起
|
||||
const main = document.getElementsByClassName(`saleReportHideBox${printIndex}`)[0]
|
||||
const thead = main.querySelector('thead').cloneNode(true); // 深克隆DOM节点
|
||||
const tbody = main.querySelector('tbody').cloneNode(true); // 深克隆DOM节点
|
||||
const container = document.querySelector('#hiddenBox');
|
||||
|
||||
const tempTable = document.createElement('table');
|
||||
tempTable.appendChild(thead);
|
||||
tempTable.appendChild(tbody);
|
||||
|
||||
tempTable.setAttribute('id', 'table-to-xls-TradingLedger'); // 给table添加id,值与按钮上的table字段对应
|
||||
|
||||
container.appendChild(tempTable); // 把创建的节点添加到页面容器中
|
||||
|
||||
setShowLoading(false)
|
||||
|
||||
downloadBtnRef.current.handleDownload();
|
||||
setShowExportTable(false)
|
||||
tempTable.remove() // 防止重复打印一个内容
|
||||
}
|
||||
|
||||
const handleCloseModal = () => {
|
||||
handleModalVisible(false)
|
||||
}
|
||||
|
||||
// 获取导出数据
|
||||
const handleGetExportData = async (type: number) => {
|
||||
// type :1商品明细,2财务结算表
|
||||
setGetExportDataLoading(true)
|
||||
const req: any = {
|
||||
ExportType: type,
|
||||
OwnerUnitId: "911",
|
||||
CompanyId: searchParams?.CompanyId || "",
|
||||
MerchantId: "",
|
||||
SaleBillState: searchParams?.OrderStatus === '0' ? '' : (searchParams?.OrderStatus || ""),
|
||||
SaleBillType: searchParams?.SaleBillType === '0' ? '' : (searchParams?.SaleBillType || ""),
|
||||
ChannelType: searchParams?.PaymentMethod || "",
|
||||
StartDate: searchParams?.ORDER_DATE_Start || "",
|
||||
EndDate: searchParams?.ORDER_DATE_End || "",
|
||||
// SearchKeyName: "SupplierName,CommodityName,OrderCode",
|
||||
// SearchKeyValue: searchParams?.searchText || "",
|
||||
// SortStr: ""
|
||||
}
|
||||
console.log('reqreqreq', req);
|
||||
|
||||
const data = await handeGetOnlineBillAccountList(req)
|
||||
console.log('djskadjas', data);
|
||||
setGetExportDataLoading(false)
|
||||
if (data && data.length > 0) {
|
||||
// 用于导出的最后数据
|
||||
let res: any = []
|
||||
let enumList: any = ["PaymentMethod", "OrderStatus", "IsUnionOrder"]
|
||||
let PaymentMethodList: any = [
|
||||
{ label: "支付宝", value: "支付宝" },
|
||||
{ label: "微信", value: "微信" },
|
||||
{ label: "积分兑换", value: "积分兑换" },
|
||||
{ label: "余额支付", value: "余额支付" },
|
||||
]
|
||||
let OrderStatusList: any = [
|
||||
{ label: "订单待支付", value: 1005 },
|
||||
{ label: "订单待发货", value: 1010 },
|
||||
{ label: "订单已发货", value: 2010 },
|
||||
{ label: "订单已完成", value: 3000 },
|
||||
{ label: "退款申请中", value: 8000 },
|
||||
{ label: "订单已退款", value: 8900 },
|
||||
{ label: "订单已关闭", value: 9000 },
|
||||
{ label: "订单已撤销", value: 9999 },
|
||||
]
|
||||
let IsUnionOrder: any = [
|
||||
{ label: "是", value: 1 },
|
||||
{ label: "否", value: 0 }
|
||||
]
|
||||
res = formatTreeData(JSON.parse(JSON.stringify(data)), [], enumList, [PaymentMethodList, OrderStatusList, IsUnionOrder], [])
|
||||
|
||||
console.log('resresres', res);
|
||||
|
||||
exportXlsxFromProColumnsExcelJS(type === 1 ? exportColumns : type === 2 ? exportFinanceColumns : [],
|
||||
res,
|
||||
`${type === 1 ? `云南交投集团经营开发有限公司彩云驿商业管理分公司销售出库单(${searchParams.ORDER_DATE_Start}-${searchParams.ORDER_DATE_End})` :
|
||||
`云南交投集团经营开发有限公司彩云驿商业管理分公司财务结算单(${searchParams.ORDER_DATE_Start}-${searchParams.ORDER_DATE_End})`}`,
|
||||
{
|
||||
topTitle: `${type === 1 ? `云南交投集团经营开发有限公司彩云驿商业管理分公司销售出库单(${searchParams.ORDER_DATE_Start}-${searchParams.ORDER_DATE_End})` :
|
||||
`云南交投集团经营开发有限公司彩云驿商业管理分公司财务结算单(${searchParams.ORDER_DATE_Start}-${searchParams.ORDER_DATE_End})`}`,
|
||||
footerItems: type === 1 ? [
|
||||
{ label: "审核", value: "", labelSpan: 1, valueSpan: 2, labelAlign: "left", align: "left", startCol: 7 },
|
||||
{ label: "验收", value: "", labelSpan: 1, valueSpan: 2, labelAlign: "left", align: "left", startCol: 12 },
|
||||
{ label: "经办", value: "", labelSpan: 1, valueSpan: 2, labelAlign: "left", align: "left", startCol: 15 }
|
||||
] : []
|
||||
}
|
||||
)
|
||||
} else {
|
||||
message.error('暂无导出数据!')
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div ref={(el) => {
|
||||
// 打印报表
|
||||
@ -257,50 +637,6 @@ const TradingLedger: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
setPrintOut(el);
|
||||
}} >
|
||||
|
||||
{
|
||||
showLoading ?
|
||||
<div
|
||||
style={{
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
background: 'rgba(0,0,0,0.1)',
|
||||
position: 'fixed',
|
||||
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={`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={{
|
||||
@ -317,37 +653,53 @@ const TradingLedger: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
expandable={{
|
||||
expandRowByClick: true
|
||||
}}
|
||||
scroll={{ x: "100%", y: "calc(100vh - 430px)" }}
|
||||
scroll={{ x: "100%", y: "calc(100vh - 470px)" }}
|
||||
headerTitle={<PageTitleBox props={props} />} // 列表表头
|
||||
search={{ span: 6, defaultCollapsed: false }}
|
||||
request={async (params) => {
|
||||
// const req: any = {
|
||||
// SearchParameter: {
|
||||
// SALEBILL_IDS: "",
|
||||
// SALEBILL_TYPES: params?.SALEBILL_TYPE === '0' ? '3000,3001,3002,3010' : params?.SALEBILL_TYPE,
|
||||
// MEMBERSHIP_IDS: "",
|
||||
// MERCHANTS_IDS: "",
|
||||
// // PROVINCE_CODE: currentUser?.ProvinceCode,
|
||||
// SERVERPART_IDS: "",
|
||||
// SERVERPARTSHOP_IDS: "",
|
||||
// ORDER_DATE_Start: params?.ORDER_DATE_Start || "",
|
||||
// ORDER_DATE_End: params?.ORDER_DATE_End || "",
|
||||
// SALEBILL_STATES: params?.SALEBILL_STATE === "0" ? "1010,2010,3000" : params?.SALEBILL_STATE || "",
|
||||
// CHANNEL_TYPE: params?.CHANNEL_TYPE === "0" ? "" : params?.CHANNEL_TYPE || "",
|
||||
// WECHATAPPSIGN_ID: "",
|
||||
// WECHATAPP_APPID: "",
|
||||
// OWNERUNIT_ID: currentUser?.OwnerUnitId,
|
||||
// SearchKeyValue: params?.searchText || "",
|
||||
// },
|
||||
// PageIndex: 1,
|
||||
// PageSize: 999999
|
||||
// }
|
||||
|
||||
// setSearchParams(params)
|
||||
|
||||
// console.log('reqreqreqreq', req);
|
||||
// const data = await handeGetSupplierSaleBillList(req)
|
||||
|
||||
const req: any = {
|
||||
SearchParameter: {
|
||||
SALEBILL_IDS: "",
|
||||
SALEBILL_TYPES: params?.SALEBILL_TYPE === '0' ? '3000,3001,3002,3010' : params?.SALEBILL_TYPE,
|
||||
MEMBERSHIP_IDS: "",
|
||||
MERCHANTS_IDS: "",
|
||||
// PROVINCE_CODE: currentUser?.ProvinceCode,
|
||||
SERVERPART_IDS: "",
|
||||
SERVERPARTSHOP_IDS: "",
|
||||
ORDER_DATE_Start: params?.ORDER_DATE_Start || "",
|
||||
ORDER_DATE_End: params?.ORDER_DATE_End || "",
|
||||
SALEBILL_STATES: params?.SALEBILL_STATE === "0" ? "1010,2010,3000" : params?.SALEBILL_STATE || "",
|
||||
CHANNEL_TYPE: params?.CHANNEL_TYPE === "0" ? "" : params?.CHANNEL_TYPE || "",
|
||||
WECHATAPPSIGN_ID: "",
|
||||
WECHATAPP_APPID: "",
|
||||
OWNERUNIT_ID: currentUser?.OwnerUnitId,
|
||||
// SearchParameter: {
|
||||
OwnerUnitId: "911",
|
||||
CompanyId: params?.CompanyId || "",
|
||||
MerchantId: "",
|
||||
SaleBillState: params?.OrderStatus === '0' ? '' : (params?.OrderStatus || ""),
|
||||
SaleBillType: params?.SaleBillType === '0' ? '' : (params?.SaleBillType || ""),
|
||||
ChannelType: params?.PaymentMethod || "",
|
||||
StartDate: params?.ORDER_DATE_Start || "",
|
||||
EndDate: params?.ORDER_DATE_End || "",
|
||||
SearchKeyName: "SupplierName,CommodityName,OrderCode",
|
||||
SearchKeyValue: params?.searchText || "",
|
||||
},
|
||||
PageIndex: 1,
|
||||
PageSize: 999999
|
||||
SortStr: ""
|
||||
}
|
||||
|
||||
const data = await handeGetSalebillAccountList(req)
|
||||
setSearchParams(params)
|
||||
|
||||
console.log('reqreqreqreq', req);
|
||||
const data = await handeGetSupplierSaleBillList(req)
|
||||
setCurrentSearchText(params?.searchText || "")
|
||||
handleSetlogSave(`点击查询按钮`)
|
||||
console.log('datadatadatadatadata', data);
|
||||
@ -360,34 +712,25 @@ const TradingLedger: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
}}
|
||||
toolbar={{
|
||||
actions: [
|
||||
<span style={{ visibility: 'hidden' }}>
|
||||
<ReactHTMLTableToExcel
|
||||
buttonText={'导出excel'}
|
||||
ref={downloadBtnRef}
|
||||
table="table-to-xls-TradingLedger"
|
||||
filename={`交易台账${searchParams?.ORDER_DATE_Start}-${searchParams?.ORDER_DATE_End}`}
|
||||
sheet="sheet1"
|
||||
/>
|
||||
</span>,
|
||||
<Button
|
||||
key="new"
|
||||
type="primary"
|
||||
loading={getExportDataLoading}
|
||||
onClick={(e) => {
|
||||
if (reqDetailList && reqDetailList.length > 0) {
|
||||
setShowLoading(true)
|
||||
setTimeout(() => {
|
||||
setShowExportTable(true)
|
||||
setTimeout(() => {
|
||||
handleSetlogSave('导出Excel')
|
||||
exportTable(e)
|
||||
}, 100)
|
||||
}, 100)
|
||||
} else {
|
||||
message.error('暂无数据可导出!')
|
||||
}
|
||||
handleGetExportData(1)
|
||||
}}
|
||||
>
|
||||
导出excel
|
||||
导出Excel
|
||||
</Button>,
|
||||
<Button
|
||||
key="new"
|
||||
type="primary"
|
||||
loading={getExportDataLoading}
|
||||
onClick={(e) => {
|
||||
handleGetExportData(2)
|
||||
}}
|
||||
>
|
||||
导出财务结算Excel
|
||||
</Button>
|
||||
]
|
||||
}}
|
||||
|
||||
@ -205,7 +205,7 @@ export async function handlDeleteBRAND(params: any) {
|
||||
|
||||
// 获取供应商的分类列表 树形
|
||||
export async function handlGetNestingAUTOTYPEList(params: any) {
|
||||
const data = await requestEncryption(`/MemberBasic/GetNestingAUTOTYPEList`, {
|
||||
const data = await requestEncryption(`/MallBasic/GetNestingAUTOTYPEList`, {
|
||||
method: 'POST',
|
||||
data: { ...params, requestEncryption: true }
|
||||
})
|
||||
@ -217,7 +217,7 @@ export async function handlGetNestingAUTOTYPEList(params: any) {
|
||||
|
||||
// 同步供应商信息
|
||||
export async function handlSynchroAUTOTYPE(params: any) {
|
||||
const data = await requestEncryption(`/MemberBasic/SynchroAUTOTYPE`, {
|
||||
const data = await requestEncryption(`/MallBasic/SynchroAUTOTYPE`, {
|
||||
method: 'POST',
|
||||
data: { ...params, requestEncryption: true }
|
||||
})
|
||||
@ -229,7 +229,7 @@ export async function handlSynchroAUTOTYPE(params: any) {
|
||||
|
||||
// 删除供应商信息
|
||||
export async function handlDeleteAUTOTYPE(params: any) {
|
||||
const data = await requestEncryption(`/MemberBasic/DeleteAUTOTYPE`, {
|
||||
const data = await requestEncryption(`/MallBasic/DeleteAUTOTYPE`, {
|
||||
method: 'POST',
|
||||
data: { ...params, requestEncryption: true }
|
||||
})
|
||||
@ -785,6 +785,44 @@ export async function handeGetSupplierSaleBillList(params: any) {
|
||||
return data.Result_Data.List
|
||||
}
|
||||
|
||||
// 交易台账页面 调用的新接口 页面查询接口
|
||||
export async function handeGetSalebillAccountList(params: any) {
|
||||
const data = await requestEncryption(`/OnlineOrder/GetSalebillAccountList`, {
|
||||
method: 'POST',
|
||||
data: { ...params, requestEncryption: true }
|
||||
})
|
||||
if (data.Result_Code !== 100) {
|
||||
return []
|
||||
}
|
||||
return data.Result_Data.List
|
||||
}
|
||||
|
||||
// 交易台账页面 调用的新接口 导出接口
|
||||
export async function handeGetOnlineBillAccountList(params: any) {
|
||||
const data = await requestEncryption(`/OnlineOrder/GetOnlineBillAccountList`, {
|
||||
method: 'POST',
|
||||
data: { ...params, requestEncryption: true }
|
||||
})
|
||||
if (data.Result_Code !== 100) {
|
||||
return []
|
||||
}
|
||||
return data.Result_Data.List
|
||||
}
|
||||
|
||||
// 获取企业信息列表
|
||||
export async function handeGetCOMPANYList(params: any) {
|
||||
const data = await requestEncryption(`/Member/GetCOMPANYList`, {
|
||||
method: 'POST',
|
||||
data: { ...params, requestEncryption: true }
|
||||
})
|
||||
if (data.Result_Code !== 100) {
|
||||
return []
|
||||
}
|
||||
return data.Result_Data.List
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 拿到埋点的配置数据
|
||||
export async function handeGetWECHATAPPBURYPOINTList(params: any) {
|
||||
|
||||
@ -1063,7 +1063,7 @@ const estimateWidth = (v: any) => {
|
||||
return Math.min(Math.max(len + 2, 8), 60);
|
||||
};
|
||||
|
||||
|
||||
// 导出的方法 配合着 formatTreeData 处理过的数据去用 效果最佳
|
||||
export async function exportXlsxFromProColumnsExcelJS(
|
||||
rawColumns: AnyCol[],
|
||||
dataSource: any[],
|
||||
@ -1077,10 +1077,17 @@ export async function exportXlsxFromProColumnsExcelJS(
|
||||
freezeHeader?: boolean; // 已保留但默认不再生效(不触发冻结)
|
||||
childrenKey?: string;
|
||||
|
||||
// 底部信息
|
||||
footerMaker?: any;
|
||||
footerMakerTime?: any;
|
||||
footerStatsTime?: any;
|
||||
footerItems?: {
|
||||
label: string;
|
||||
value: string | number | null | undefined;
|
||||
labelSpan?: number;
|
||||
valueSpan?: number;
|
||||
startCol?: number; // 新增:起始列(1-based index)
|
||||
align?: 'left' | 'center' | 'right';
|
||||
labelAlign?: 'left' | 'center' | 'right';
|
||||
font?: Partial<ExcelJS.Font>;
|
||||
labelFont?: Partial<ExcelJS.Font>;
|
||||
}[]
|
||||
}
|
||||
) {
|
||||
const {
|
||||
@ -1092,9 +1099,7 @@ export async function exportXlsxFromProColumnsExcelJS(
|
||||
// 为兼容外部调用保留字段,但默认不做冻结以满足你的要求
|
||||
freezeHeader = false,
|
||||
childrenKey = 'children',
|
||||
footerMaker,
|
||||
footerMakerTime,
|
||||
footerStatsTime,
|
||||
footerItems = []
|
||||
} = options || {};
|
||||
|
||||
const flatData = flattenTree<any>(Array.isArray(dataSource) ? dataSource : [], childrenKey);
|
||||
@ -1201,45 +1206,63 @@ export async function exportXlsxFromProColumnsExcelJS(
|
||||
// 注意:不再对 ws.views 进行任何设置(避免冻结表头)
|
||||
// if (freezeHeader) { ... } // 已移除
|
||||
|
||||
// 底部三项(同一行 + 平均分列 + 直接显示“标题:值”)
|
||||
if (footerMaker != null || footerMakerTime != null || footerStatsTime != null) {
|
||||
if (Array.isArray(footerItems) && footerItems.length > 0) {
|
||||
currentRowIndex += 1;
|
||||
const footerRow = ws.getRow(currentRowIndex);
|
||||
|
||||
const items = [
|
||||
`制单人员:${footerMaker ?? ''}`,
|
||||
`制单时间:${footerMakerTime ?? ''}`,
|
||||
`统计时间:${footerStatsTime ?? ''}`,
|
||||
];
|
||||
|
||||
const groups = 3;
|
||||
const base = Math.floor(columnCount / groups);
|
||||
let remainder = columnCount - base * groups;
|
||||
const sizes: number[] = [];
|
||||
for (let g = 0; g < groups; g++) {
|
||||
sizes.push(base + (remainder > 0 ? 1 : 0));
|
||||
if (remainder > 0) remainder -= 1;
|
||||
}
|
||||
if (columnCount < groups) {
|
||||
for (let g = 0; g < groups; g++) sizes[g] = 0;
|
||||
for (let k = 0; k < columnCount; k++) sizes[k] = 1;
|
||||
}
|
||||
|
||||
let colCursor = 1;
|
||||
for (let g = 0; g < groups; g++) {
|
||||
const segSize = sizes[g];
|
||||
if (segSize <= 0) continue;
|
||||
|
||||
for (const item of footerItems) {
|
||||
// --- 核心修改 ---
|
||||
// 如果 startCol 被提供,则将光标“跳转”到指定位置
|
||||
if (typeof item.startCol === 'number' && item.startCol > 0) {
|
||||
colCursor = item.startCol;
|
||||
}
|
||||
|
||||
// 如果光标已在界外,则跳过此项的渲染
|
||||
if (colCursor > columnCount) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const {
|
||||
label,
|
||||
value,
|
||||
labelSpan = 1,
|
||||
valueSpan = 2,
|
||||
align = 'left',
|
||||
labelAlign = 'right',
|
||||
font = { size: 11 },
|
||||
labelFont = { size: 11 },
|
||||
} = item;
|
||||
|
||||
// --- 渲染 Label ---
|
||||
if (labelSpan > 0) {
|
||||
const startCol = colCursor;
|
||||
const endCol = colCursor + segSize - 1;
|
||||
const endCol = Math.min(colCursor + labelSpan - 1, columnCount);
|
||||
|
||||
if (endCol > startCol) ws.mergeCells(currentRowIndex, startCol, currentRowIndex, endCol);
|
||||
|
||||
const cell = footerRow.getCell(startCol);
|
||||
cell.value = items[g];
|
||||
cell.alignment = { horizontal: 'left', vertical: 'middle' };
|
||||
cell.font = { size: 11 };
|
||||
const labelCell = footerRow.getCell(startCol);
|
||||
labelCell.value = label ? `${label}:` : '';
|
||||
labelCell.alignment = { horizontal: labelAlign, vertical: 'middle' };
|
||||
labelCell.font = labelFont;
|
||||
|
||||
colCursor += segSize;
|
||||
colCursor = endCol + 1;
|
||||
}
|
||||
|
||||
// --- 渲染 Value ---
|
||||
if (colCursor <= columnCount && valueSpan > 0) {
|
||||
const startCol = colCursor;
|
||||
const endCol = Math.min(colCursor + valueSpan - 1, columnCount);
|
||||
|
||||
if (endCol > startCol) ws.mergeCells(currentRowIndex, startCol, currentRowIndex, endCol);
|
||||
|
||||
const valueCell = footerRow.getCell(startCol);
|
||||
valueCell.value = value ?? '';
|
||||
valueCell.alignment = { horizontal: align, vertical: 'middle' };
|
||||
valueCell.font = font;
|
||||
|
||||
colCursor = endCol + 1;
|
||||
}
|
||||
}
|
||||
|
||||
footerRow.height = 18;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// 由 scripts/writeVersion.js 自动生成
|
||||
export const VERSION = "4.5.88";
|
||||
export const GIT_HASH = "5275f79";
|
||||
export const BUILD_TIME = "2025-12-11T07:57:34.516Z";
|
||||
export const VERSION = "4.5.90";
|
||||
export const GIT_HASH = "e555058";
|
||||
export const BUILD_TIME = "2025-12-12T09:26:16.901Z";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user