update
This commit is contained in:
parent
b31d9a8d41
commit
9ca62d437d
@ -24,6 +24,7 @@ import styles from './index.less';
|
|||||||
import { line } from '@antv/g2plot';
|
import { line } from '@antv/g2plot';
|
||||||
import session from '@/utils/session';
|
import session from '@/utils/session';
|
||||||
import { getLocationByIP, getUserIP } from '@/utils/format';
|
import { getLocationByIP, getUserIP } from '@/utils/format';
|
||||||
|
import { handleGetIPDetail } from './service';
|
||||||
|
|
||||||
// 可接受的页面参数
|
// 可接受的页面参数
|
||||||
export type LoginProps = {
|
export type LoginProps = {
|
||||||
@ -123,7 +124,8 @@ const Login: React.FC<LoginProps> = (props) => {
|
|||||||
let IpInfo: any = await getUserIP()
|
let IpInfo: any = await getUserIP()
|
||||||
console.log('IpInfoIpInfoIpInfoIpInfo', IpInfo);
|
console.log('IpInfoIpInfoIpInfoIpInfo', IpInfo);
|
||||||
// 用ip 去获取信息
|
// 用ip 去获取信息
|
||||||
let ipDetail: any = await getLocationByIP(IpInfo, 'XrQQuNQRGxap9YH2xmvx3dzuJVkXhTzT')
|
let ipDetail: any = await handleGetIPDetail({ ip: IpInfo })
|
||||||
|
|
||||||
console.log('ipDetailipDetailipDetail', ipDetail);
|
console.log('ipDetailipDetailipDetail', ipDetail);
|
||||||
const ipRes: any = {
|
const ipRes: any = {
|
||||||
country: ipDetail.country,
|
country: ipDetail.country,
|
||||||
|
|||||||
16
src/pages/User/login/service.ts
Normal file
16
src/pages/User/login/service.ts
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
|
||||||
|
import request from '@/utils/requestNewJava'
|
||||||
|
|
||||||
|
export async function handleGetIPDetail(params: any) {
|
||||||
|
|
||||||
|
const data = await request(`/location/ip`, {
|
||||||
|
method: 'GET',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
|
||||||
|
if (data.Result_Code === 500) {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
|
||||||
|
return data.content.address_detail
|
||||||
|
}
|
||||||
@ -138,6 +138,7 @@ const CommoditysaleTable: React.FC<{ currentUser: CurrentUser | undefined, id: s
|
|||||||
contentStyle={{ fontWeight: "bolder" }} labelStyle={{ color: "#00000073" }}
|
contentStyle={{ fontWeight: "bolder" }} labelStyle={{ color: "#00000073" }}
|
||||||
>
|
>
|
||||||
|
|
||||||
|
<Descriptions.Item span={2} label="流水号">{id || ""}</Descriptions.Item>
|
||||||
<Descriptions.Item label="实收金额">¥{numeral(reduceData.SELLDETAILS_AMOUNT).format('0,0.00')}</Descriptions.Item>
|
<Descriptions.Item label="实收金额">¥{numeral(reduceData.SELLDETAILS_AMOUNT).format('0,0.00')}</Descriptions.Item>
|
||||||
<Descriptions.Item label="销售数量">{numeral(reduceData.SELLDETAILS_COUNT).format('0,0')}</Descriptions.Item>
|
<Descriptions.Item label="销售数量">{numeral(reduceData.SELLDETAILS_COUNT).format('0,0')}</Descriptions.Item>
|
||||||
<Descriptions.Item label="优惠金额">¥{numeral(reduceData.SELLDETAILS_OFFPRICE).format('0,0.00')}</Descriptions.Item>
|
<Descriptions.Item label="优惠金额">¥{numeral(reduceData.SELLDETAILS_OFFPRICE).format('0,0.00')}</Descriptions.Item>
|
||||||
|
|||||||
@ -177,6 +177,12 @@ const SERVERPARTTable = ({ currentRow, onShow, onRef }: DetailProps) => {
|
|||||||
disabled
|
disabled
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
|
<Col span={8}>
|
||||||
|
<ProFormText
|
||||||
|
name="SERVERPART_TEL"
|
||||||
|
label="经理联系电话"
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
<Col span={8}>
|
<Col span={8}>
|
||||||
<ProFormText
|
<ProFormText
|
||||||
name="EXPRESSWAY_NAME"
|
name="EXPRESSWAY_NAME"
|
||||||
|
|||||||
@ -51,7 +51,7 @@ const basicServiceInformation: React.FC<{ currentUser: CurrentUser }> = (props)
|
|||||||
|
|
||||||
let list: any = []
|
let list: any = []
|
||||||
data.forEach((item: any) => {
|
data.forEach((item: any) => {
|
||||||
if (item.value !== 424 ) {
|
if (item.value !== 424) {
|
||||||
list.push(item)
|
list.push(item)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -76,6 +76,15 @@ const RevenueSummaryTable: React.FC<{ currentUser?: CurrentUser }> = (props) =>
|
|||||||
"RegionARevenue.Cash_Correct": { show: false },
|
"RegionARevenue.Cash_Correct": { show: false },
|
||||||
"RegionBRevenue.Mobile_Correct": { show: false },
|
"RegionBRevenue.Mobile_Correct": { show: false },
|
||||||
"RegionBRevenue.Cash_Correct": { show: false },
|
"RegionBRevenue.Cash_Correct": { show: false },
|
||||||
|
"TotalRevenue.CostBill_Amount": { show: false },
|
||||||
|
"TotalRevenue.InternalPay_Amount": { show: false },
|
||||||
|
"TotalRevenue.YFHD_Amount": { show: false },
|
||||||
|
"RegionARevenue.CostBill_Amount": { show: false },
|
||||||
|
"RegionARevenue.InternalPay_Amount": { show: false },
|
||||||
|
"RegionARevenue.YFHD_Amount": { show: false },
|
||||||
|
"RegionBRevenue.CostBill_Amount": { show: false },
|
||||||
|
"RegionBRevenue.InternalPay_Amount": { show: false },
|
||||||
|
"RegionBRevenue.YFHD_Amount": { show: false }
|
||||||
})
|
})
|
||||||
const [columnsDailyStateMap, setColumnsDailyStateMap] = useState<any>({
|
const [columnsDailyStateMap, setColumnsDailyStateMap] = useState<any>({
|
||||||
Shop_Count: { show: false },
|
Shop_Count: { show: false },
|
||||||
@ -248,6 +257,8 @@ const RevenueSummaryTable: React.FC<{ currentUser?: CurrentUser }> = (props) =>
|
|||||||
placeholder: "请输入商户/品牌/门店/服务区"
|
placeholder: "请输入商户/品牌/门店/服务区"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
// title: () => <Text strong>服务区信息</Text>,
|
// title: () => <Text strong>服务区信息</Text>,
|
||||||
title: '服务区信息',
|
title: '服务区信息',
|
||||||
@ -396,6 +407,21 @@ const RevenueSummaryTable: React.FC<{ currentUser?: CurrentUser }> = (props) =>
|
|||||||
// return options;
|
// return options;
|
||||||
// },
|
// },
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '传输方式',
|
||||||
|
width: 120,
|
||||||
|
ellipsis: true,
|
||||||
|
dataIndex: 'Transfer_Type',
|
||||||
|
hideInSearch: true,
|
||||||
|
valueType: 'select',
|
||||||
|
valueEnum: {
|
||||||
|
0: "收银系统",
|
||||||
|
1: "扫码传输",
|
||||||
|
2: "接口传输"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -466,6 +492,50 @@ const RevenueSummaryTable: React.FC<{ currentUser?: CurrentUser }> = (props) =>
|
|||||||
return record?.TotalRevenue?.Cash_Correct ? numeral(record?.TotalRevenue?.Cash_Correct).format('0,0.00') : '-'
|
return record?.TotalRevenue?.Cash_Correct ? numeral(record?.TotalRevenue?.Cash_Correct).format('0,0.00') : '-'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: "长款",
|
||||||
|
dataIndex: ["TotalRevenue", "Different_Price_More"],
|
||||||
|
width: 120,
|
||||||
|
align: 'right',
|
||||||
|
hideInSearch: true,
|
||||||
|
valueType: 'digit'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "短款",
|
||||||
|
dataIndex: ["TotalRevenue", "Different_Price_Less"],
|
||||||
|
width: 120,
|
||||||
|
align: 'right',
|
||||||
|
hideInSearch: true,
|
||||||
|
valueType: 'digit'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "大巴优惠",
|
||||||
|
dataIndex: ['TotalRevenue', 'CostBill_Amount'],
|
||||||
|
key: "TotalRevenue.CostBill_Amount",
|
||||||
|
width: 120,
|
||||||
|
align: 'right',
|
||||||
|
hideInSearch: true,
|
||||||
|
valueType: 'digit'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "企业会员",
|
||||||
|
dataIndex: ["TotalRevenue", "InternalPay_Amount"],
|
||||||
|
key: "TotalRevenue.InternalPay_Amount",
|
||||||
|
width: 120,
|
||||||
|
align: 'right',
|
||||||
|
hideInSearch: true,
|
||||||
|
valueType: 'digit'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "油非互动",
|
||||||
|
dataIndex: ["TotalRevenue", "YFHD_Amount"],
|
||||||
|
key: "TotalRevenue.YFHD_Amount",
|
||||||
|
width: 120,
|
||||||
|
align: 'right',
|
||||||
|
hideInSearch: true,
|
||||||
|
valueType: 'digit'
|
||||||
|
},
|
||||||
|
|
||||||
// {
|
// {
|
||||||
// title: '长/短款',
|
// title: '长/短款',
|
||||||
// dataIndex: 'TotalRevenue.Different_Price_Less',
|
// dataIndex: 'TotalRevenue.Different_Price_Less',
|
||||||
@ -478,7 +548,6 @@ const RevenueSummaryTable: React.FC<{ currentUser?: CurrentUser }> = (props) =>
|
|||||||
// return Different_Price_More === '-' && Different_Price_Less === '-' ? '-' : `${Different_Price_More} / ${Different_Price_Less}`
|
// return Different_Price_More === '-' && Different_Price_Less === '-' ? '-' : `${Different_Price_More} / ${Different_Price_Less}`
|
||||||
// }
|
// }
|
||||||
// },
|
// },
|
||||||
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -543,6 +612,49 @@ const RevenueSummaryTable: React.FC<{ currentUser?: CurrentUser }> = (props) =>
|
|||||||
return record?.RegionARevenue?.Cash_Correct ? numeral(record?.RegionARevenue?.Cash_Correct).format('0,0.00') : '-'
|
return record?.RegionARevenue?.Cash_Correct ? numeral(record?.RegionARevenue?.Cash_Correct).format('0,0.00') : '-'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: "长款",
|
||||||
|
dataIndex: ["RegionARevenue", "Different_Price_More"],
|
||||||
|
width: 120,
|
||||||
|
align: 'right',
|
||||||
|
hideInSearch: true,
|
||||||
|
valueType: 'digit'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "短款",
|
||||||
|
dataIndex: ["RegionARevenue", "Different_Price_Less"],
|
||||||
|
width: 120,
|
||||||
|
align: 'right',
|
||||||
|
hideInSearch: true,
|
||||||
|
valueType: 'digit'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "大巴优惠",
|
||||||
|
dataIndex: ["RegionARevenue", "CostBill_Amount"],
|
||||||
|
key: "RegionARevenue.CostBill_Amount",
|
||||||
|
width: 120,
|
||||||
|
align: 'right',
|
||||||
|
hideInSearch: true,
|
||||||
|
valueType: 'digit'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "企业会员",
|
||||||
|
dataIndex: ["RegionARevenue", "InternalPay_Amount"],
|
||||||
|
key: "RegionARevenue.InternalPay_Amount",
|
||||||
|
width: 120,
|
||||||
|
align: 'right',
|
||||||
|
hideInSearch: true,
|
||||||
|
valueType: 'digit'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "油非互动",
|
||||||
|
dataIndex: ["RegionARevenue", "YFHD_Amount"],
|
||||||
|
key: "RegionARevenue.YFHD_Amount",
|
||||||
|
width: 120,
|
||||||
|
align: 'right',
|
||||||
|
hideInSearch: true,
|
||||||
|
valueType: 'digit'
|
||||||
|
},
|
||||||
// {
|
// {
|
||||||
// title: '长/短款',
|
// title: '长/短款',
|
||||||
// dataIndex: 'RegionARevenue.Different_Price_Less',
|
// dataIndex: 'RegionARevenue.Different_Price_Less',
|
||||||
@ -621,6 +733,49 @@ const RevenueSummaryTable: React.FC<{ currentUser?: CurrentUser }> = (props) =>
|
|||||||
return record?.RegionBRevenue?.Cash_Correct ? numeral(record?.RegionBRevenue?.Cash_Correct).format('0,0.00') : '-'
|
return record?.RegionBRevenue?.Cash_Correct ? numeral(record?.RegionBRevenue?.Cash_Correct).format('0,0.00') : '-'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: "长款",
|
||||||
|
dataIndex: ["RegionBRevenue", "Different_Price_More"],
|
||||||
|
width: 120,
|
||||||
|
align: 'right',
|
||||||
|
hideInSearch: true,
|
||||||
|
valueType: 'digit'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "短款",
|
||||||
|
dataIndex: ["RegionBRevenue", "Different_Price_Less"],
|
||||||
|
width: 120,
|
||||||
|
align: 'right',
|
||||||
|
hideInSearch: true,
|
||||||
|
valueType: 'digit'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "大巴优惠",
|
||||||
|
dataIndex: ["RegionBRevenue", "CostBill_Amount"],
|
||||||
|
key: "RegionBRevenue.CostBill_Amount",
|
||||||
|
width: 120,
|
||||||
|
align: 'right',
|
||||||
|
hideInSearch: true,
|
||||||
|
valueType: 'digit'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "企业会员",
|
||||||
|
dataIndex: ["RegionBRevenue", "InternalPay_Amount"],
|
||||||
|
key: "RegionBRevenue.InternalPay_Amount",
|
||||||
|
width: 120,
|
||||||
|
align: 'right',
|
||||||
|
hideInSearch: true,
|
||||||
|
valueType: 'digit'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "油非互动",
|
||||||
|
dataIndex: ["RegionBRevenue", "YFHD_Amount"],
|
||||||
|
key: "RegionBRevenue.YFHD_Amount",
|
||||||
|
width: 120,
|
||||||
|
align: 'right',
|
||||||
|
hideInSearch: true,
|
||||||
|
valueType: 'digit'
|
||||||
|
},
|
||||||
// {
|
// {
|
||||||
// title: '长/短款',
|
// title: '长/短款',
|
||||||
// dataIndex: 'RegionBRevenue.Different_Price_Less',
|
// dataIndex: 'RegionBRevenue.Different_Price_Less',
|
||||||
@ -1051,7 +1206,6 @@ const RevenueSummaryTable: React.FC<{ currentUser?: CurrentUser }> = (props) =>
|
|||||||
return { data: [], success: true }
|
return { data: [], success: true }
|
||||||
|
|
||||||
}}
|
}}
|
||||||
|
|
||||||
// params={{ ServerpartShopIds: shopId && shopId.length > 0 ? shopId.toString() : '' }}
|
// params={{ ServerpartShopIds: shopId && shopId.length > 0 ? shopId.toString() : '' }}
|
||||||
rowClassName={(record) => expandRow?.includes(record?.Serverpart_ID) && !record?.ServerpartShop_Name ? 'expanded' : ''}
|
rowClassName={(record) => expandRow?.includes(record?.Serverpart_ID) && !record?.ServerpartShop_Name ? 'expanded' : ''}
|
||||||
expandable={
|
expandable={
|
||||||
|
|||||||
@ -278,6 +278,16 @@ const revenueYOYQOQReport: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
return options;
|
return options;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '经营模式',
|
||||||
|
width: 120,
|
||||||
|
ellipsis: true,
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'BUSINESS_TYPE',
|
||||||
|
hideInSearch: true,
|
||||||
|
valueType: 'select',
|
||||||
|
valueEnum: BUSINESSTYPEObj,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '实收金额',
|
title: '实收金额',
|
||||||
dataIndex: '',
|
dataIndex: '',
|
||||||
@ -685,7 +695,7 @@ const revenueYOYQOQReport: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
reqDetailList,
|
reqDetailList,
|
||||||
`销售同环比分析_${searchParams?.StartDate}-${searchParams?.EndDate}`,
|
`销售同环比分析_${searchParams?.StartDate}-${searchParams?.EndDate}`,
|
||||||
{
|
{
|
||||||
footerMaker: currentUser?.Name,
|
footerMaker: currentUser?.Name,
|
||||||
footerMakerTime: moment().format('YYYY-MM-DD HH:mm:ss'),
|
footerMakerTime: moment().format('YYYY-MM-DD HH:mm:ss'),
|
||||||
footerStatsTime: `${searchParams?.StartDate}-${searchParams?.EndDate}`
|
footerStatsTime: `${searchParams?.StartDate}-${searchParams?.EndDate}`
|
||||||
}
|
}
|
||||||
|
|||||||
@ -138,6 +138,7 @@ const saleFlow: React.FC<{ currentUser: CurrentUser | undefined }> = (props) =>
|
|||||||
placeholder: "请输入商品名称/商品条码"
|
placeholder: "请输入商品名称/商品条码"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
dataIndex: 'TICKET_CODE',
|
dataIndex: 'TICKET_CODE',
|
||||||
title: '小票编号',
|
title: '小票编号',
|
||||||
@ -197,6 +198,53 @@ const saleFlow: React.FC<{ currentUser: CurrentUser | undefined }> = (props) =>
|
|||||||
align: 'right',
|
align: 'right',
|
||||||
sorter: (a, b) => a.SELLMASTER_OFFPRICE - b.SELLMASTER_OFFPRICE
|
sorter: (a, b) => a.SELLMASTER_OFFPRICE - b.SELLMASTER_OFFPRICE
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// dataIndex: '',
|
||||||
|
// title: <div style={{ textAlign: 'center' }}>实付金额</div>,
|
||||||
|
// width: 120,
|
||||||
|
// hideInSearch: true,
|
||||||
|
// valueType: "money",
|
||||||
|
// ellipsis: true,
|
||||||
|
// align: 'right',
|
||||||
|
// },
|
||||||
|
|
||||||
|
{
|
||||||
|
dataIndex: 'INTERNAL_AMOUNT',
|
||||||
|
title: <div style={{ textAlign: 'center' }}>抵扣金额</div>,
|
||||||
|
width: 120,
|
||||||
|
hideInSearch: true,
|
||||||
|
valueType: "money",
|
||||||
|
ellipsis: true,
|
||||||
|
align: 'right',
|
||||||
|
sorter: (a, b) => a.INTERNAL_AMOUNT - b.INTERNAL_AMOUNT
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dataIndex: 'COUPON_TYPE',
|
||||||
|
title: <div style={{ textAlign: 'center' }}>抵扣类型</div>,
|
||||||
|
width: 120,
|
||||||
|
hideInSearch: true,
|
||||||
|
valueType: "select",
|
||||||
|
valueEnum: {
|
||||||
|
"1000": "满减券",
|
||||||
|
"2000": "折扣券",
|
||||||
|
"3000": "抵扣券",
|
||||||
|
"4000": "兑换券",
|
||||||
|
"5000": "代金券",
|
||||||
|
"9000": "实物券"
|
||||||
|
},
|
||||||
|
ellipsis: true,
|
||||||
|
align: 'right',
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// dataIndex: '',
|
||||||
|
// title: <div style={{ textAlign: 'center' }}>其他支付</div>,
|
||||||
|
// width: 120,
|
||||||
|
// hideInSearch: true,
|
||||||
|
// valueType: "money",
|
||||||
|
// ellipsis: true,
|
||||||
|
// align: 'right',
|
||||||
|
// },
|
||||||
|
|
||||||
{
|
{
|
||||||
dataIndex: 'PAYMENT_TYPE_TEXT',
|
dataIndex: 'PAYMENT_TYPE_TEXT',
|
||||||
width: 120,
|
width: 120,
|
||||||
|
|||||||
@ -176,6 +176,7 @@ const saleHisReport: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
valueType: 'digit',
|
valueType: 'digit',
|
||||||
dataIndex: 'Commodity_RetailPrice',
|
dataIndex: 'Commodity_RetailPrice',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
|
sorter: (a, b) => a.Commodity_RetailPrice - b.Commodity_RetailPrice
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: <div style={{ textAlign: 'center' }}>销售数量</div>,
|
title: <div style={{ textAlign: 'center' }}>销售数量</div>,
|
||||||
@ -184,6 +185,7 @@ const saleHisReport: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
width: 150,
|
width: 150,
|
||||||
align: 'right',
|
align: 'right',
|
||||||
valueType: 'digit',
|
valueType: 'digit',
|
||||||
|
sorter: (a, b) => a.Total_Count - b.Total_Count
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: <div style={{ textAlign: 'center' }}>优惠金额</div>,
|
title: <div style={{ textAlign: 'center' }}>优惠金额</div>,
|
||||||
@ -192,6 +194,7 @@ const saleHisReport: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
width: 150,
|
width: 150,
|
||||||
align: 'right',
|
align: 'right',
|
||||||
|
sorter: (a, b) => a.Total_OffAmount - b.Total_OffAmount
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: <div style={{ textAlign: 'center' }}>对客营收</div>,
|
title: <div style={{ textAlign: 'center' }}>对客营收</div>,
|
||||||
@ -200,6 +203,7 @@ const saleHisReport: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
width: 150,
|
width: 150,
|
||||||
align: 'right',
|
align: 'right',
|
||||||
|
sorter: (a, b) => a.Total_SellAmount - b.Total_SellAmount
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: <div style={{ textAlign: 'center', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
|
title: <div style={{ textAlign: 'center', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
|
||||||
|
|||||||
@ -405,7 +405,7 @@ const saleReport: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
columns={columns}
|
columns={columns}
|
||||||
bordered
|
bordered
|
||||||
headerTitle={<PageTitleBox props={props} />}
|
headerTitle={<PageTitleBox props={props} />}
|
||||||
search={{ span: 6 }}
|
search={{ span: 6, defaultCollapsed: false }}
|
||||||
scroll={{ x: "100%", y: 'calc(100vh - 510px)' }}
|
scroll={{ x: "100%", y: 'calc(100vh - 510px)' }}
|
||||||
pagination={{ pageSize: 100 }}
|
pagination={{ pageSize: 100 }}
|
||||||
request={async (params, sorter) => {
|
request={async (params, sorter) => {
|
||||||
|
|||||||
@ -112,7 +112,9 @@ const curVerify: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
dataIndex: 'PassCommCount/Current_GoodsCount',
|
dataIndex: 'PassCommCount/Current_GoodsCount',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
render: (_, record) => {
|
render: (_, record) => {
|
||||||
return `${record?.PassCommCount || '0'}/${record?.Current_GoodsCount || '0'}`
|
return <span style={{ color: record?.PassCommCount !== record?.Current_GoodsCount ? 'red' : '' }}>
|
||||||
|
{`${record?.PassCommCount || '0'}/${record?.Current_GoodsCount || '0'}`}
|
||||||
|
</span>
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -19,6 +19,7 @@ import { handleGetAPPROVALROUTEList } from "@/pages/Setting/serviceConfig/servic
|
|||||||
import ProForm, { ProFormSelect, ProFormTextArea } from "@ant-design/pro-form";
|
import ProForm, { ProFormSelect, ProFormTextArea } from "@ant-design/pro-form";
|
||||||
import { handleGetApprovalCommodityList, handleGetBUSINESSAPPROVALDetail, handleGetCOMMODITYRUNNINGList } from "./service";
|
import { handleGetApprovalCommodityList, handleGetBUSINESSAPPROVALDetail, handleGetCOMMODITYRUNNINGList } from "./service";
|
||||||
import './style.less'
|
import './style.less'
|
||||||
|
import session from "@/utils/session";
|
||||||
|
|
||||||
const { Step } = Steps
|
const { Step } = Steps
|
||||||
const ProductApprovalProcess: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
const ProductApprovalProcess: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||||
@ -88,10 +89,36 @@ const ProductApprovalProcess: React.FC<{ currentUser: CurrentUser }> = (props) =
|
|||||||
},
|
},
|
||||||
initialValue: "0"
|
initialValue: "0"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
dataIndex: 'Serverpart_IDS',
|
||||||
|
title: '服务区',
|
||||||
|
width: 150,
|
||||||
|
ellipsis: true,
|
||||||
|
align: 'center',
|
||||||
|
hideInTable: true,
|
||||||
|
valueType: 'select',
|
||||||
|
fieldProps: {
|
||||||
|
showSearch: true,
|
||||||
|
},
|
||||||
|
request: async () => {
|
||||||
|
const list = session.get('ServerpartIdsTree')
|
||||||
|
return list || []
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dataIndex: 'searchText',
|
||||||
|
title: '查询内容',
|
||||||
|
ellipsis: true,
|
||||||
|
align: 'center',
|
||||||
|
hideInTable: true,
|
||||||
|
fieldProps: {
|
||||||
|
placeholder: '请输入查询商品名称/商品条码'
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
dataIndex: 'BusinessProcess_Name',
|
dataIndex: 'BusinessProcess_Name',
|
||||||
title: '业务名称',
|
title: '业务名称',
|
||||||
width: 300,
|
width: 200,
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
@ -105,7 +132,7 @@ const ProductApprovalProcess: React.FC<{ currentUser: CurrentUser }> = (props) =
|
|||||||
{
|
{
|
||||||
dataIndex: 'Serverpart_Name',
|
dataIndex: 'Serverpart_Name',
|
||||||
title: '服务区名称',
|
title: '服务区名称',
|
||||||
width: 200,
|
width: 150,
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
@ -113,7 +140,7 @@ const ProductApprovalProcess: React.FC<{ currentUser: CurrentUser }> = (props) =
|
|||||||
{
|
{
|
||||||
dataIndex: 'ServerpartShop_Name',
|
dataIndex: 'ServerpartShop_Name',
|
||||||
title: '门店名称',
|
title: '门店名称',
|
||||||
width: 200,
|
width: 150,
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
@ -129,7 +156,7 @@ const ProductApprovalProcess: React.FC<{ currentUser: CurrentUser }> = (props) =
|
|||||||
{
|
{
|
||||||
dataIndex: 'BusinessProcess_StateText',
|
dataIndex: 'BusinessProcess_StateText',
|
||||||
title: '待审核环节',
|
title: '待审核环节',
|
||||||
width: 200,
|
width: 150,
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
@ -149,7 +176,7 @@ const ProductApprovalProcess: React.FC<{ currentUser: CurrentUser }> = (props) =
|
|||||||
{
|
{
|
||||||
dataIndex: 'Accept_Code',
|
dataIndex: 'Accept_Code',
|
||||||
title: '业务类别',
|
title: '业务类别',
|
||||||
width: 200,
|
width: 150,
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
@ -274,7 +301,7 @@ const ProductApprovalProcess: React.FC<{ currentUser: CurrentUser }> = (props) =
|
|||||||
}}
|
}}
|
||||||
scroll={{ x: "100%", y: "calc(100vh - 410px)" }}
|
scroll={{ x: "100%", y: "calc(100vh - 410px)" }}
|
||||||
headerTitle={<PageTitleBox props={props} />} // 列表表头
|
headerTitle={<PageTitleBox props={props} />} // 列表表头
|
||||||
search={{ span: 6 }}
|
search={{ span: 6, defaultCollapsed: false }}
|
||||||
request={async (params) => {
|
request={async (params) => {
|
||||||
|
|
||||||
const req: any = {
|
const req: any = {
|
||||||
@ -282,7 +309,8 @@ const ProductApprovalProcess: React.FC<{ currentUser: CurrentUser }> = (props) =
|
|||||||
SearchParameter: {
|
SearchParameter: {
|
||||||
Operation_Type: 6,
|
Operation_Type: 6,
|
||||||
Accept_Code: params?.searchType === "0" ? '' : params?.searchType,
|
Accept_Code: params?.searchType === "0" ? '' : params?.searchType,
|
||||||
BusinessProcess_StateSearch: statusList[params?.BusinessProcess_StateSearch] === "0" ? '' : statusList[params?.BusinessProcess_StateSearch]
|
BusinessProcess_StateSearch: statusList[params?.BusinessProcess_StateSearch] === "0" ? '' : statusList[params?.BusinessProcess_StateSearch],
|
||||||
|
Serverpart_IDS: params?.Serverpart_IDS || ""
|
||||||
},
|
},
|
||||||
PageIndex: 1,
|
PageIndex: 1,
|
||||||
PageSize: 999999
|
PageSize: 999999
|
||||||
|
|||||||
@ -33,6 +33,7 @@ import Detail from "@/pages/reports/productControl/components/detail";
|
|||||||
import PageTitleBox from "@/components/PageTitleBox";
|
import PageTitleBox from "@/components/PageTitleBox";
|
||||||
import { exportXlsxFromProColumnsExcelJS } from "@/utils/exportExcelFun";
|
import { exportXlsxFromProColumnsExcelJS } from "@/utils/exportExcelFun";
|
||||||
import { formatTreeData } from "@/utils/format";
|
import { formatTreeData } from "@/utils/format";
|
||||||
|
import { getMyShopList } from "@/pages/account/center/sevice";
|
||||||
|
|
||||||
const commoditySearch: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
const commoditySearch: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||||
const { currentUser } = props
|
const { currentUser } = props
|
||||||
@ -81,7 +82,8 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
|
|
||||||
const [showDetail, setShowDetail] = useState<boolean>(false)
|
const [showDetail, setShowDetail] = useState<boolean>(false)
|
||||||
const SHOPTRADEObj = session.get('SHOPTRADEObj')
|
const SHOPTRADEObj = session.get('SHOPTRADEObj')
|
||||||
|
// 当前的门店列表
|
||||||
|
const [currentShopList, setCurrentShopList] = useState<any>()
|
||||||
|
|
||||||
const ServerpartIdsList: any = session.get('ServerpartIdsList')
|
const ServerpartIdsList: any = session.get('ServerpartIdsList')
|
||||||
const { loading: CommodityLoading, data: CommodityData } = useRequest(async () => {
|
const { loading: CommodityLoading, data: CommodityData } = useRequest(async () => {
|
||||||
@ -112,16 +114,30 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
valueType: 'select',
|
valueType: 'select',
|
||||||
hideInTable: true,
|
hideInTable: true,
|
||||||
request: async () => {
|
request: async () => {
|
||||||
// const data = await getServerpartOption(currentUser?.ProvinceCode)
|
|
||||||
// console.log('datadatadatadata', data);
|
|
||||||
const ServerpartIdsTree: any = session.get('ServerpartIdsTree')
|
const ServerpartIdsTree: any = session.get('ServerpartIdsTree')
|
||||||
return ServerpartIdsTree
|
return ServerpartIdsTree
|
||||||
},
|
},
|
||||||
fieldProps: {
|
fieldProps: {
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
filterOption: (input, option) => (option?.label ?? '').toLowerCase().includes(input.toLowerCase()),
|
filterOption: (input, option) => (option?.label ?? '').toLowerCase().includes(input.toLowerCase()),
|
||||||
|
onChange: async (value: any, label: any) => {
|
||||||
|
formRef.current?.setFieldsValue({ serverpartShopId: undefined, InventoryTime: undefined })
|
||||||
|
await handleGetShopList(value)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: "门店",
|
||||||
|
dataIndex: "serverpartShopId",
|
||||||
|
hideInTable: true,
|
||||||
|
valueType: 'select',
|
||||||
|
fieldProps: {
|
||||||
|
showSearch: true,
|
||||||
|
options: currentShopList
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
title: '状态',
|
title: '状态',
|
||||||
dataIndex: 'COMMODITY_STATE',
|
dataIndex: 'COMMODITY_STATE',
|
||||||
@ -296,26 +312,31 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportTable = (e) => {
|
// 拿到门店的列表数据
|
||||||
e.stopPropagation(); // 防止Collapse组件收起
|
const handleGetShopList = async (id: any) => {
|
||||||
const main = document.getElementsByClassName('commoditySearchHideBox')[0]
|
if (!id) {
|
||||||
const thead = main.querySelector('thead').cloneNode(true); // 深克隆DOM节点
|
setCurrentShopList([])
|
||||||
const tbody = main.querySelector('tbody').cloneNode(true); // 深克隆DOM节点
|
return
|
||||||
const container = document.querySelector('#hiddenBox');
|
}
|
||||||
|
const req: any = {
|
||||||
const tempTable = document.createElement('table');
|
// 调用的接口 里面 自己包了一层
|
||||||
tempTable.appendChild(thead);
|
// SearchParameter: {
|
||||||
tempTable.appendChild(tbody);
|
ISVALID: 1,
|
||||||
|
SERVERPART_ID: id,
|
||||||
tempTable.setAttribute('id', 'table-to-xls-commoditySearch'); // 给table添加id,值与按钮上的table字段对应
|
INSALES_TYPE: 1,
|
||||||
|
// },
|
||||||
container.appendChild(tempTable); // 把创建的节点添加到页面容器中
|
PageIndex: 1,
|
||||||
|
PageSize: 999999,
|
||||||
setShowLoading(false)
|
SortStr: "SHOPTRADE,SHOPREGION,SHOPCODE"
|
||||||
|
}
|
||||||
downloadBtnRef.current.handleDownload();
|
const data = await getMyShopList(req)
|
||||||
setShowExportTable(false)
|
let list: any = []
|
||||||
tempTable.remove() // 防止重复打印一个内容
|
if (data && data.length > 0) {
|
||||||
|
data.forEach((item: any) => {
|
||||||
|
list.push({ label: item.SHOPNAME, value: item.SERVERPARTSHOP_ID })
|
||||||
|
})
|
||||||
|
}
|
||||||
|
setCurrentShopList(list)
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -430,12 +451,16 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
|||||||
sortstr += `,COMMODITY_ID ${dir}`
|
sortstr += `,COMMODITY_ID ${dir}`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log('paramsparamsparams', params);
|
||||||
|
|
||||||
|
|
||||||
const req: any = {
|
const req: any = {
|
||||||
SearchType: 3,
|
SearchType: 3,
|
||||||
ProvinceCode: currentUser?.ProvinceCode,
|
ProvinceCode: currentUser?.ProvinceCode,
|
||||||
CommodityTypeId: currenMenu === '999999' ? '' : currenMenu,
|
CommodityTypeId: currenMenu === '999999' ? '' : currenMenu,
|
||||||
CommodityState: params?.COMMODITY_STATE,
|
CommodityState: params?.COMMODITY_STATE,
|
||||||
ServerpartID: params?.ServerpartID,
|
ServerpartID: params?.ServerpartID,
|
||||||
|
ServerpartShopID: params?.serverpartShopId || "",
|
||||||
PageIndex: 1,
|
PageIndex: 1,
|
||||||
PageSize: 999999,
|
PageSize: 999999,
|
||||||
SearchKey: "COMMODITY_NAME,COMMODITY_BARCODE",
|
SearchKey: "COMMODITY_NAME,COMMODITY_BARCODE",
|
||||||
|
|||||||
@ -220,7 +220,6 @@ const detail = ({ currentUser, treeView, currentRow, showHotKeyEdit, setGetNewHo
|
|||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
|
|
||||||
|
|
||||||
<Col span={8}>
|
<Col span={8}>
|
||||||
<ProFormSelect
|
<ProFormSelect
|
||||||
name="COMMODITY_STATE"
|
name="COMMODITY_STATE"
|
||||||
@ -233,7 +232,7 @@ const detail = ({ currentUser, treeView, currentRow, showHotKeyEdit, setGetNewHo
|
|||||||
<Col span={8}>
|
<Col span={8}>
|
||||||
<ProFormText
|
<ProFormText
|
||||||
name="ADDTIME"
|
name="ADDTIME"
|
||||||
label="添加时间"
|
label="审核时间"
|
||||||
readonly
|
readonly
|
||||||
initialValue={moment().format('YYYY-MM-DD HH:mm:ss')}
|
initialValue={moment().format('YYYY-MM-DD HH:mm:ss')}
|
||||||
/>
|
/>
|
||||||
|
|||||||
214
src/utils/requestNewJava.ts
Normal file
214
src/utils/requestNewJava.ts
Normal file
@ -0,0 +1,214 @@
|
|||||||
|
/** Request 网络请求工具 更详细的 api 文档: https://github.com/umijs/umi-request */
|
||||||
|
import { extend } from 'umi-request';
|
||||||
|
|
||||||
|
import { notification } from 'antd';
|
||||||
|
|
||||||
|
import Cookies from 'js-cookie';
|
||||||
|
import moment from 'moment';
|
||||||
|
import session from './session';
|
||||||
|
import type { CurrentUser } from '@/models/user';
|
||||||
|
import { SynchroBEHAVIORRECORD } from '@/services/user';
|
||||||
|
|
||||||
|
const codeMessage: Record<number, string> = {
|
||||||
|
200: '服务器成功返回请求的数据。',
|
||||||
|
201: '新建或修改数据成功。',
|
||||||
|
202: '一个请求已经进入后台排队(异步任务)。',
|
||||||
|
204: '删除数据成功。',
|
||||||
|
400: '发出的请求有错误,服务器没有进行新建或修改数据的操作。',
|
||||||
|
401: '用户没有权限(令牌、用户名、密码错误)。',
|
||||||
|
403: '用户得到授权,但是访问是被禁止的。',
|
||||||
|
404: '发出的请求针对的是不存在的记录,服务器没有进行操作。',
|
||||||
|
406: '请求的格式不可得。',
|
||||||
|
410: '请求的资源被永久删除,且不会再得到的。',
|
||||||
|
422: '当创建一个对象时,发生一个验证错误。',
|
||||||
|
500: '服务器发生错误,请检查服务器。',
|
||||||
|
502: '网关错误。',
|
||||||
|
503: '服务不可用,服务器暂时过载或维护。',
|
||||||
|
504: '网关超时。',
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @zh-CN 异常处理程序
|
||||||
|
* @en-US Exception handler
|
||||||
|
*/
|
||||||
|
const errorHandler = (error: { response: Response }): Response => {
|
||||||
|
const { response } = error;
|
||||||
|
|
||||||
|
|
||||||
|
if (response && response.status) {
|
||||||
|
const errorText = codeMessage[response.status] || response.statusText;
|
||||||
|
const { status, url } = response;
|
||||||
|
|
||||||
|
notification.error({
|
||||||
|
message: `请求错误 ${status}: ${url}`,
|
||||||
|
description: errorText,
|
||||||
|
});
|
||||||
|
} else if (!response) {
|
||||||
|
notification.error({
|
||||||
|
description: '您的网络异常,无法连接到服务器.',
|
||||||
|
message: '网络异常',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* @en-US Configure the default parameters for request
|
||||||
|
* @zh-CN 配置request请求时的默认参数
|
||||||
|
*/
|
||||||
|
const request = extend({
|
||||||
|
errorHandler, // default error handling
|
||||||
|
// prefix: '/EShangApiMain',// 开发
|
||||||
|
prefix: 'https://java.es.eshangtech.com:443', // 正式
|
||||||
|
// prefix: 'http://111.229.213.193:18071', // 正式
|
||||||
|
headers: {
|
||||||
|
token: '',
|
||||||
|
ProvinceCode: '',
|
||||||
|
ServerpartCodes: '',
|
||||||
|
// tmp: (new Date()).getTime()
|
||||||
|
}
|
||||||
|
|
||||||
|
// credentials: 'include', // Does the default request bring cookies
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// 存一下进来调用的值
|
||||||
|
// let userbeHaviObj: any = {}
|
||||||
|
|
||||||
|
// request拦截器, 改变url 或 options.
|
||||||
|
request.interceptors.request.use((url, opt: any) => {
|
||||||
|
const options = { ...opt }
|
||||||
|
const currentUser: CurrentUser = session.get('currentUser');
|
||||||
|
// let userbeHaviObj = {
|
||||||
|
// url: url,
|
||||||
|
// options: options,
|
||||||
|
// currentUser: currentUser,
|
||||||
|
// startTime: new Date().getTime()
|
||||||
|
// }
|
||||||
|
// options.userbeHaviObj = userbeHaviObj
|
||||||
|
|
||||||
|
if (currentUser) {
|
||||||
|
if (options.headers) {
|
||||||
|
if (url.indexOf('SynchroSERVERPART') > -1) {
|
||||||
|
options.headers = {
|
||||||
|
...options.headers,
|
||||||
|
PROVINCE_CODE: opt?.data?.PROVINCE_CODE,
|
||||||
|
ProvinceCode: opt?.data?.PROVINCE_CODE,
|
||||||
|
provincecode: opt?.data?.PROVINCE_CODE,
|
||||||
|
token: currentUser.UserToken || '',
|
||||||
|
ServerpartCodes: currentUser.CityAuthority || '',
|
||||||
|
ServerpartShopIds: currentUser.ServerpartShopIds || '',
|
||||||
|
UserPattern: currentUser?.UserPattern || '',
|
||||||
|
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
options.headers = {
|
||||||
|
...options.headers,
|
||||||
|
token: currentUser.UserToken || '',
|
||||||
|
ProvinceCode: opt?.data?.noProvinceCode ? '' : (currentUser.ProvinceCode || ''),
|
||||||
|
ServerpartCodes: currentUser.CityAuthority || '',
|
||||||
|
ServerpartShopIds: currentUser.ServerpartShopIds || '',
|
||||||
|
UserPattern: currentUser?.UserPattern || '',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (url.indexOf('SynchroSERVERPART') > -1) {
|
||||||
|
options.data = {
|
||||||
|
...options.data,
|
||||||
|
STAFF_ID: currentUser.ID,
|
||||||
|
STAFF_NAME: currentUser.Name,
|
||||||
|
OPERATE_DATE: moment().format('YYYY-MM-DD HH:mm:ss'),
|
||||||
|
PROVINCE_CODE: opt?.data?.PROVINCE_CODE,
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ((url.indexOf('Synchro') > -1 || url.indexOf('Save') > -1) &&
|
||||||
|
url.indexOf('Picture/SaveImgFile') === -1) {
|
||||||
|
|
||||||
|
// 添加操作人和业主单位信息
|
||||||
|
options.data = {
|
||||||
|
...options.data,
|
||||||
|
STAFF_ID: currentUser.ID,
|
||||||
|
STAFF_NAME: currentUser.Name,
|
||||||
|
OWNERUNIT_ID: options.data.OWNERUNIT_ID || currentUser.OwnerUnitId,
|
||||||
|
OWNERUNIT_NAME: options.data.OWNERUNIT_NAME || currentUser.ProvinceUnit,
|
||||||
|
PROVINCE_CODE: (options.data.PROVINCE_CODE || currentUser.ProvinceCode),
|
||||||
|
|
||||||
|
OPERATE_DATE: moment().format('YYYY-MM-DD HH:mm:ss')
|
||||||
|
}
|
||||||
|
if (currentUser?.UserPattern === 2000) {
|
||||||
|
options.data = {
|
||||||
|
...options.data,
|
||||||
|
PROVINCE_CODE: (options.data.PROVINCE_CODE || currentUser.ProvinceCode),
|
||||||
|
BUSINESSMAN_ID: currentUser.BusinessManID,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
// url: url.indexOf('handler_ajax.ashx')>-1 ?`https://user.eshangtech.com${url}`: `http://47.96.233.105/EShangApiMain${url}`,
|
||||||
|
url,// .indexOf('handler_ajax.ashx')>-1 ?`${url}`: `/EShangApiMain${url}`,
|
||||||
|
options,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
request.interceptors.response.use((response, option) => {
|
||||||
|
const nowTmp = moment()
|
||||||
|
Cookies.set('tmp', nowTmp.format())
|
||||||
|
|
||||||
|
// // 加个数组 如果请求地址是数组里面的 那就不调用 记录用户行为了
|
||||||
|
// let specialList = ['/FrameWork/GetFieldEnumByField', "/FrameWork/GetUserModuleList", "/FrameWork/GetFieldEnumTree", '/Logging/GetPassportInfoByToken', '/Logging/UserLogin', 'Dictionary/GetFieEnumList', '/Platform/SynchroBehaviorrecord']
|
||||||
|
// // 判断一下 现在的这次请求 是不是特殊 不需要进行记录的
|
||||||
|
// let isOk: boolean = true
|
||||||
|
|
||||||
|
// let userbeHaviObj = option?.userbeHaviObj || {}
|
||||||
|
|
||||||
|
// specialList.forEach((item: any) => {
|
||||||
|
// if (userbeHaviObj.url.indexOf(item) !== -1) {
|
||||||
|
// isOk = false
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
|
||||||
|
// if (isOk) {
|
||||||
|
// let nowMenu = session.get("currentMenu")
|
||||||
|
// let endTime = new Date().getTime()
|
||||||
|
// let basicInfo = session.get("basicInfo")
|
||||||
|
// let systemBasin = session.get("systemBasin")
|
||||||
|
// let browserVersion = session.get("browserVersion")
|
||||||
|
|
||||||
|
// const req: any = {
|
||||||
|
// USER_ID: userbeHaviObj.currentUser.ID,
|
||||||
|
// USER_NAME: userbeHaviObj.currentUser.Name,
|
||||||
|
// BEHAVIORRECORD_TYPE: "2000", // 1000 浏览页面 2000 行为记录
|
||||||
|
// BEHAVIORRECORD_EXPLAIN: `在页面${nowMenu.name}调用接口${userbeHaviObj.url.split('https://api.eshangtech.com')[1]}`,
|
||||||
|
// BEHAVIORRECORD_TIME: moment(new Date(userbeHaviObj.startTime)).format('YYYY-MM-DD HH:mm:ss'),
|
||||||
|
// BEHAVIORRECORD_ROUT: nowMenu.pathname,
|
||||||
|
// BEHAVIORRECORD_ROUTNAME: nowMenu.name,
|
||||||
|
// BEHAVIORRECORD_LEAVETIME: moment(new Date(endTime)).format('YYYY-MM-DD HH:mm:ss'),
|
||||||
|
// BEHAVIORRECORD_DURATION: (endTime - userbeHaviObj.startTime) / 1000,
|
||||||
|
// OWNERUNIT_ID: userbeHaviObj.currentUser.OwnerUnitId,
|
||||||
|
// OWNERUNIT_NAME: userbeHaviObj.currentUser.OwnerUnitName,
|
||||||
|
// BUSINESSMAN_ID: userbeHaviObj.currentUser.BusinessManID,
|
||||||
|
// BUSINESSMAN_NAME: userbeHaviObj.currentUser.BusinessManName,
|
||||||
|
// SOURCE_PLATFORM: '驿商云平台',
|
||||||
|
// BEHAVIORRECORD_DESC: JSON.stringify(userbeHaviObj.options.params) === '{}' ? userbeHaviObj.url.split('?')[1] : JSON.stringify(userbeHaviObj.options.params), // 入参
|
||||||
|
// USER_LOGINIP: basicInfo.ip,
|
||||||
|
// USER_LOGINPLACE: `${basicInfo.country}${basicInfo.prov}${basicInfo.city}${basicInfo.district}`,
|
||||||
|
// BROWSER_VERSION: browserVersion,
|
||||||
|
// OPERATING_SYSTEM: systemBasin
|
||||||
|
// }
|
||||||
|
// console.log('reqreqreqreqreq', req);
|
||||||
|
// // fetch('https://api.eshangtech.com/EShangApiMain/Platform/SynchroBEHAVIORRECORD', {
|
||||||
|
// // method: 'POST',
|
||||||
|
// // headers: {
|
||||||
|
// // 'Content-Type': 'application/json',
|
||||||
|
// // },
|
||||||
|
// // body: JSON.stringify(req),
|
||||||
|
// // })
|
||||||
|
// }
|
||||||
|
return response
|
||||||
|
})
|
||||||
|
export default request;
|
||||||
Loading…
x
Reference in New Issue
Block a user