新增商品审批组件化完成 尝试兼容商品调价审批之前的备份
This commit is contained in:
parent
cee81d5037
commit
323f2add27
@ -698,7 +698,7 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
|
||||
|
||||
// 商品业态
|
||||
// const SHOPTRADEList = await
|
||||
getFieldEnum({ FieldExplainField: 'BUSINESSTYPE' }).then(SHOPTRADEList => {
|
||||
getFieldEnum({ FieldExplainField: 'BUSINESSTYPE' }).then(SHOPTRADEList => {
|
||||
session.set('SHOPTRADEList', SHOPTRADEList);
|
||||
const SHOPTRADEObj: any = {}
|
||||
if (SHOPTRADEList && SHOPTRADEList.length > 0) {
|
||||
|
||||
@ -20,6 +20,7 @@ import { handleGetCHECKCOMMODITYList, handleGetTypeStatisticsList } from "../ser
|
||||
import Draggable from "react-draggable";
|
||||
import InventoryDetails from "../InventoryDetails";
|
||||
import { exportXlsxFromProColumns, exportXlsxFromProColumnsExcelJS } from "@/utils/exportExcelFun";
|
||||
import { formatTreeData } from "@/utils/format";
|
||||
|
||||
|
||||
const InventoryCategory: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
@ -869,7 +870,43 @@ const InventoryCategory: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
|
||||
const data = await handleGetTypeStatisticsList(req)
|
||||
console.log('data321312', data);
|
||||
setReqDetailList(data)
|
||||
|
||||
let fieldData: any = [
|
||||
"OVERPLUSCOUNT",
|
||||
"OVERPLUS_PRICE",
|
||||
"LOSSPROFIT_COUNT",
|
||||
"LOSSPROFIT_PRICE",
|
||||
"GROSS_PROFITPRICE",
|
||||
"LAST_OVERPLUSCOUNT",
|
||||
"LAST_OVERPLUSPRICE",
|
||||
"PURCHASE_COUNT",
|
||||
"PURCHASE_TOTALPRICE",
|
||||
"SELL_COUNT",
|
||||
"SELL_UNITPRICE",
|
||||
"SELL_TOTALPRICE",
|
||||
"SELL_COSTPRICE",
|
||||
"TRANSFER_COUNT",
|
||||
"TRANSFER_PRICE",
|
||||
"RECEIVE_COUNT",
|
||||
"RECEIVE_PRICE",
|
||||
"BACK_COUNT",
|
||||
"BACK_PRICE",
|
||||
"OVERPLUS_AMOUNT",
|
||||
"LOSSPROFIT_AMOUNT",
|
||||
"GROSS_PROFIT",
|
||||
"LAST_OVERPLUSAMOUNT",
|
||||
"PURCHASE_TOTALTAXPRICE",
|
||||
"SELL_UNITTAXPRICE",
|
||||
"SELL_TOTALTAXPRICE",
|
||||
"SELL_COST",
|
||||
"TRANSFER_AMOUNT",
|
||||
"RECEIVE_AMOUNT",
|
||||
"BACK_AMOUNT",
|
||||
]
|
||||
let enumList: any = []
|
||||
let newPrintData: any = formatTreeData(JSON.parse(JSON.stringify(data)), fieldData, enumList, [], [])
|
||||
|
||||
setReqDetailList(newPrintData)
|
||||
if (data && data.length > 0) {
|
||||
return { data, success: true }
|
||||
}
|
||||
@ -877,15 +914,15 @@ const InventoryCategory: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
}}
|
||||
toolbar={{
|
||||
actions: [
|
||||
<span style={{ visibility: 'hidden' }}>
|
||||
<ReactHTMLTableToExcel
|
||||
buttonText={'导出excel'}
|
||||
ref={downloadBtnRef}
|
||||
table="table-to-xls-InventoryCategory"
|
||||
filename={`进销存类别报表${searchParams?.InventoryTime ? searchParams?.InventoryTime.split('-')[1] : ""}`}
|
||||
sheet="sheet1"
|
||||
/>
|
||||
</span>,
|
||||
// <span style={{ visibility: 'hidden' }}>
|
||||
// <ReactHTMLTableToExcel
|
||||
// buttonText={'导出excel'}
|
||||
// ref={downloadBtnRef}
|
||||
// table="table-to-xls-InventoryCategory"
|
||||
// filename={`进销存类别报表${searchParams?.InventoryTime ? searchParams?.InventoryTime.split('-')[1] : ""}`}
|
||||
// sheet="sheet1"
|
||||
// />
|
||||
// </span>,
|
||||
<Button
|
||||
key="new"
|
||||
type="primary"
|
||||
|
||||
@ -21,6 +21,7 @@ import { render } from "react-dom";
|
||||
import { initial } from "lodash";
|
||||
import InventoryDetailModal from "./components/InventoryDetailModal";
|
||||
import { exportXlsxFromProColumnsExcelJS } from "@/utils/exportExcelFun";
|
||||
import { formatTreeData } from "@/utils/format";
|
||||
|
||||
|
||||
const InventoryDetails: React.FC<{ currentUser: CurrentUser, isComponents?: any, parentRow?: any, birthIn?: any, parentSearchForm?: any }> = (props) => {
|
||||
@ -944,7 +945,44 @@ const InventoryDetails: React.FC<{ currentUser: CurrentUser, isComponents?: any,
|
||||
SHOPNAME: obj.SHOPNAME,
|
||||
SERVERPART_NAME: obj.SERVERPART_NAME
|
||||
})
|
||||
setReqDetailList(data)
|
||||
|
||||
|
||||
let fieldData: any = [
|
||||
"OVERPLUSCOUNT",
|
||||
"OVERPLUS_PRICE",
|
||||
"LOSSPROFIT_COUNT",
|
||||
"LOSSPROFIT_PRICE",
|
||||
"GROSS_PROFITPRICE",
|
||||
"LAST_OVERPLUSCOUNT",
|
||||
"LAST_OVERPLUSPRICE",
|
||||
"PURCHASE_COUNT",
|
||||
"PURCHASE_TOTALPRICE",
|
||||
"SELL_COUNT",
|
||||
"SELL_UNITPRICE",
|
||||
"SELL_TOTALPRICE",
|
||||
"SELL_COSTPRICE",
|
||||
"TRANSFER_COUNT",
|
||||
"TRANSFER_PRICE",
|
||||
"RECEIVE_COUNT",
|
||||
"RECEIVE_PRICE",
|
||||
"BACK_COUNT",
|
||||
"BACK_PRICE",
|
||||
"OVERPLUS_AMOUNT",
|
||||
"LOSSPROFIT_AMOUNT",
|
||||
"GROSS_PROFIT",
|
||||
"LAST_OVERPLUSAMOUNT",
|
||||
"PURCHASE_TOTALTAXPRICE",
|
||||
"SELL_UNITTAXPRICE",
|
||||
"SELL_TOTALTAXPRICE",
|
||||
"SELL_COST",
|
||||
"TRANSFER_AMOUNT",
|
||||
"RECEIVE_AMOUNT",
|
||||
"BACK_AMOUNT",
|
||||
]
|
||||
let enumList: any = []
|
||||
let newPrintData: any = formatTreeData(JSON.parse(JSON.stringify(data)), fieldData, enumList, [], [])
|
||||
|
||||
setReqDetailList(newPrintData)
|
||||
// 来计算全部的合计值
|
||||
// 本期结存数量
|
||||
let total_OVERPLUSCOUNT = 0
|
||||
@ -1044,15 +1082,15 @@ const InventoryDetails: React.FC<{ currentUser: CurrentUser, isComponents?: any,
|
||||
}}
|
||||
toolbar={{
|
||||
actions: isComponents ? [] : [
|
||||
<span style={{ visibility: 'hidden' }}>
|
||||
<ReactHTMLTableToExcel
|
||||
buttonText={'导出excel'}
|
||||
ref={downloadBtnRef}
|
||||
table="table-to-xls-InventoryDetails"
|
||||
filename={`进销存明细报表${searchParams?.InventoryTime || ""}`}
|
||||
sheet="sheet1"
|
||||
/>
|
||||
</span>,
|
||||
// <span style={{ visibility: 'hidden' }}>
|
||||
// <ReactHTMLTableToExcel
|
||||
// buttonText={'导出excel'}
|
||||
// ref={downloadBtnRef}
|
||||
// table="table-to-xls-InventoryDetails"
|
||||
// filename={`进销存明细报表${searchParams?.InventoryTime || ""}`}
|
||||
// sheet="sheet1"
|
||||
// />
|
||||
// </span>,
|
||||
<Button
|
||||
key="new"
|
||||
type="primary"
|
||||
|
||||
@ -20,6 +20,7 @@ import { keyBy } from "lodash";
|
||||
import InventoryDetail from "./components/inventoryDetail";
|
||||
import { highlightText } from "@/utils/highlightText";
|
||||
import { exportXlsxFromProColumnsExcelJS } from "@/utils/exportExcelFun";
|
||||
import { formatTreeData, sortTreeData } from "@/utils/format";
|
||||
|
||||
const { Text } = Typography;
|
||||
|
||||
@ -460,7 +461,23 @@ const inventoryInformation: React.FC<{ currentUser: CurrentUser }> = (props) =>
|
||||
|
||||
console.log('datadata', data);
|
||||
setTableSumObj(data.OtherData)
|
||||
setReqDetailList(data.List)
|
||||
|
||||
|
||||
let sorterList: any = sortTreeData(JSON.parse(JSON.stringify(data.List)), sortstr.toString())
|
||||
|
||||
let fieldData: any = [
|
||||
"OVERPLUSCOUNT",
|
||||
"OVERPLUS_AMOUNT",
|
||||
"OVERPLUS_PRICE",
|
||||
"OVERPLUS_XS_AMOUNT",
|
||||
"OVERPLUS_XS_PRICE",
|
||||
]
|
||||
|
||||
let enumList: any = []
|
||||
let newPrintData: any = formatTreeData(JSON.parse(JSON.stringify(sorterList)), fieldData, enumList, [], [])
|
||||
console.log('newPrintDatanewPrintData', newPrintData);
|
||||
|
||||
setReqDetailList(newPrintData)
|
||||
setReqDefaultDetailList(data.List)
|
||||
setTableData(data.List)
|
||||
// if (data.List && data.List.length > 0) {
|
||||
@ -471,15 +488,15 @@ const inventoryInformation: React.FC<{ currentUser: CurrentUser }> = (props) =>
|
||||
dataSource={tableData}
|
||||
toolbar={{
|
||||
actions: [
|
||||
<span style={{ visibility: 'hidden' }}>
|
||||
<ReactHTMLTableToExcel
|
||||
buttonText={'导出excel'}
|
||||
ref={downloadBtnRef}
|
||||
table="table-to-xls-inventoryInformation"
|
||||
filename={`库存信息统计表`}
|
||||
sheet="sheet1"
|
||||
/>
|
||||
</span>,
|
||||
// <span style={{ visibility: 'hidden' }}>
|
||||
// <ReactHTMLTableToExcel
|
||||
// buttonText={'导出excel'}
|
||||
// ref={downloadBtnRef}
|
||||
// table="table-to-xls-inventoryInformation"
|
||||
// filename={`库存信息统计表`}
|
||||
// sheet="sheet1"
|
||||
// />
|
||||
// </span>,
|
||||
<Button
|
||||
key="new"
|
||||
type="primary"
|
||||
@ -596,7 +613,18 @@ const inventoryInformation: React.FC<{ currentUser: CurrentUser }> = (props) =>
|
||||
const order = Array.isArray(sorter) ? sorter[0]?.order : sorter?.order;
|
||||
const newList: any = sortListByState(reqDefaultDetailList, { field, order })
|
||||
console.log('newListnewList', newList);
|
||||
setReqDetailList(newList)
|
||||
|
||||
let fieldData: any = [
|
||||
"OVERPLUSCOUNT",
|
||||
"OVERPLUS_AMOUNT",
|
||||
"OVERPLUS_PRICE",
|
||||
"OVERPLUS_XS_AMOUNT",
|
||||
"OVERPLUS_XS_PRICE",
|
||||
]
|
||||
|
||||
let enumList: any = []
|
||||
let newPrintData: any = formatTreeData(JSON.parse(JSON.stringify(newList)), fieldData, enumList, [], [])
|
||||
setReqDetailList(newPrintData)
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
||||
@ -20,6 +20,7 @@ import InventoryDetailModal from "../InventoryDetails/components/InventoryDetail
|
||||
import Draggable from "react-draggable";
|
||||
import InventoryDetails from "../InventoryDetails";
|
||||
import { exportXlsxFromProColumnsExcelJS } from "@/utils/exportExcelFun";
|
||||
import { formatTreeData } from "@/utils/format";
|
||||
|
||||
|
||||
const oneProductMultipleSizes: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
@ -906,7 +907,43 @@ const oneProductMultipleSizes: React.FC<{ currentUser: CurrentUser }> = (props)
|
||||
console.log('datadatadata', data);
|
||||
|
||||
if (data && data.length > 0) {
|
||||
setReqDetailList(data)
|
||||
|
||||
let fieldData: any = [
|
||||
"OVERPLUSCOUNT",
|
||||
"OVERPLUS_PRICE",
|
||||
"LOSSPROFIT_COUNT",
|
||||
"LOSSPROFIT_PRICE",
|
||||
"GROSS_PROFITPRICE",
|
||||
"LAST_OVERPLUSCOUNT",
|
||||
"LAST_OVERPLUSPRICE",
|
||||
"PURCHASE_COUNT",
|
||||
"PURCHASE_TOTALPRICE",
|
||||
"SELL_COUNT",
|
||||
"SELL_UNITPRICE",
|
||||
"SELL_TOTALPRICE",
|
||||
"SELL_COSTPRICE",
|
||||
"TRANSFER_COUNT",
|
||||
"TRANSFER_PRICE",
|
||||
"RECEIVE_COUNT",
|
||||
"RECEIVE_PRICE",
|
||||
"BACK_COUNT",
|
||||
"BACK_PRICE",
|
||||
"OVERPLUS_AMOUNT",
|
||||
"LOSSPROFIT_AMOUNT",
|
||||
"GROSS_PROFIT",
|
||||
"LAST_OVERPLUSAMOUNT",
|
||||
"PURCHASE_TOTALTAXPRICE",
|
||||
"SELL_UNITTAXPRICE",
|
||||
"SELL_TOTALTAXPRICE",
|
||||
"SELL_COST",
|
||||
"TRANSFER_AMOUNT",
|
||||
"RECEIVE_AMOUNT",
|
||||
"BACK_AMOUNT",
|
||||
]
|
||||
let enumList: any = []
|
||||
let newPrintData: any = formatTreeData(JSON.parse(JSON.stringify(data)), fieldData, enumList, [], [])
|
||||
|
||||
setReqDetailList(newPrintData)
|
||||
|
||||
let res: any = []
|
||||
data.forEach((item: any) => {
|
||||
@ -922,15 +959,15 @@ const oneProductMultipleSizes: React.FC<{ currentUser: CurrentUser }> = (props)
|
||||
}}
|
||||
toolbar={{
|
||||
actions: [
|
||||
<span style={{ visibility: 'hidden' }}>
|
||||
<ReactHTMLTableToExcel
|
||||
buttonText={'导出excel'}
|
||||
ref={downloadBtnRef}
|
||||
table="table-to-xls-oneProductMultipleSizes"
|
||||
filename={`一品多码统计表`}
|
||||
sheet="sheet1"
|
||||
/>
|
||||
</span>,
|
||||
// <span style={{ visibility: 'hidden' }}>
|
||||
// <ReactHTMLTableToExcel
|
||||
// buttonText={'导出excel'}
|
||||
// ref={downloadBtnRef}
|
||||
// table="table-to-xls-oneProductMultipleSizes"
|
||||
// filename={`一品多码统计表`}
|
||||
// sheet="sheet1"
|
||||
// />
|
||||
// </span>,
|
||||
<Button
|
||||
key="new"
|
||||
type="primary"
|
||||
|
||||
@ -16,6 +16,7 @@ import PageTitleBox from "@/components/PageTitleBox";
|
||||
import moment from "moment";
|
||||
import { handleGetMERCHANTSList, handleGetStorageBackSummary } from "../service";
|
||||
import { exportXlsxFromProColumnsExcelJS } from "@/utils/exportExcelFun";
|
||||
import { formatTreeData, sortTreeData } from "@/utils/format";
|
||||
|
||||
|
||||
const purchaseReceiving: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
@ -504,10 +505,10 @@ const purchaseReceiving: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
}
|
||||
}
|
||||
// 排序字段
|
||||
// const sortstr = Object.keys(sorter).map(n => {
|
||||
// const value = sorter[n]
|
||||
// return value ? `${n} ${value.replace('end', '')}` : ''
|
||||
// })
|
||||
const sortstr = Object.keys(sorter).map(n => {
|
||||
const value = sorter[n]
|
||||
return value ? `${n} ${value.replace('end', '')}` : ''
|
||||
})
|
||||
const req: any = {
|
||||
ServerpartId: serverpartId && serverpartId.length > 0 ? serverpartId.toString() : "",
|
||||
ServerpartShopId: selectedId,
|
||||
@ -540,7 +541,23 @@ const purchaseReceiving: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
}
|
||||
})
|
||||
|
||||
setReqDetailList(exportList)
|
||||
|
||||
let sorterList: any = sortTreeData(JSON.parse(JSON.stringify(exportList)), sortstr.toString())
|
||||
|
||||
let fieldData: any = [
|
||||
"Storage_Count",
|
||||
"Storage_TaxAmount",
|
||||
"Storage_Amount",
|
||||
"Back_Count",
|
||||
"Back_TaxAmount",
|
||||
"Back_Amount",
|
||||
]
|
||||
|
||||
let enumList: any = []
|
||||
let newPrintData: any = formatTreeData(JSON.parse(JSON.stringify(sorterList)), fieldData, enumList, [], [])
|
||||
|
||||
|
||||
setReqDetailList(newPrintData)
|
||||
setReqDefaultDetailList(exportList)
|
||||
setTableData(data)
|
||||
// return { data, success: true }
|
||||
@ -551,15 +568,15 @@ const purchaseReceiving: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
}}
|
||||
toolbar={{
|
||||
actions: [
|
||||
<span style={{ visibility: 'hidden' }}>
|
||||
<ReactHTMLTableToExcel
|
||||
buttonText={'导出excel'}
|
||||
ref={downloadBtnRef}
|
||||
table="table-to-xls-purchaseReceiving"
|
||||
filename={`入库退货统计表${searchParams?.StartDate}-${searchParams?.EndDate}`}
|
||||
sheet="sheet1"
|
||||
/>
|
||||
</span>,
|
||||
// <span style={{ visibility: 'hidden' }}>
|
||||
// <ReactHTMLTableToExcel
|
||||
// buttonText={'导出excel'}
|
||||
// ref={downloadBtnRef}
|
||||
// table="table-to-xls-purchaseReceiving"
|
||||
// filename={`入库退货统计表${searchParams?.StartDate}-${searchParams?.EndDate}`}
|
||||
// sheet="sheet1"
|
||||
// />
|
||||
// </span>,
|
||||
<Button
|
||||
key="new"
|
||||
type="primary"
|
||||
@ -595,14 +612,25 @@ const purchaseReceiving: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
]
|
||||
}}
|
||||
onChange={(_pagination: any, _filters: any, sorter: any, extra: any) => {
|
||||
console.log('onChange');
|
||||
isNoTableReload.current = true
|
||||
if (extra?.action === 'sort') {
|
||||
const field = Array.isArray(sorter) ? sorter[0]?.field : sorter?.field;
|
||||
const order = Array.isArray(sorter) ? sorter[0]?.order : sorter?.order;
|
||||
const newList: any = sortListByState(reqDefaultDetailList, { field, order }, { childrenKey: 'children' })
|
||||
console.log('newListnewList', newList);
|
||||
setReqDetailList(newList)
|
||||
|
||||
let fieldData: any = [
|
||||
"Storage_Count",
|
||||
"Storage_TaxAmount",
|
||||
"Storage_Amount",
|
||||
"Back_Count",
|
||||
"Back_TaxAmount",
|
||||
"Back_Amount",
|
||||
]
|
||||
|
||||
let enumList: any = []
|
||||
let newPrintData: any = formatTreeData(JSON.parse(JSON.stringify(newList)), fieldData, enumList, [], [])
|
||||
|
||||
setReqDetailList(newPrintData)
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
||||
@ -17,6 +17,7 @@ import moment from "moment";
|
||||
import { handleGetSALESTOREPROINSTList } from "../service";
|
||||
import ReturnGoodsTable from "./components/returnGoodsTable";
|
||||
import { exportXlsxFromProColumnsExcelJS } from "@/utils/exportExcelFun";
|
||||
import { formatTreeData } from "@/utils/format";
|
||||
|
||||
|
||||
const returnProcess: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
@ -140,13 +141,14 @@ const returnProcess: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
setCurrentRow(record)
|
||||
setOnShow(true)
|
||||
}}>
|
||||
{record?.OPERATE_COUNT || ""}
|
||||
{record?.OPERATE_COUNT ? record?.OPERATE_COUNT.toLocaleString() : ""}
|
||||
</a>
|
||||
}
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>合计含税进价</div>,
|
||||
dataIndex: "OPERATE_TAXAMOUNT",
|
||||
valueType: 'digit',
|
||||
align: 'right',
|
||||
width: 150,
|
||||
sorter: (a, b) => a.OPERATE_TAXAMOUNT - b.OPERATE_TAXAMOUNT,
|
||||
@ -157,6 +159,7 @@ const returnProcess: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
title: <div style={{ textAlign: 'center' }}>合计除税进价</div>,
|
||||
dataIndex: "OPERATE_AMOUNT",
|
||||
align: 'right',
|
||||
valueType: 'digit',
|
||||
width: 150,
|
||||
sorter: (a, b) => a.OPERATE_AMOUNT - b.OPERATE_AMOUNT,
|
||||
ellipsis: true,
|
||||
@ -326,7 +329,17 @@ const returnProcess: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
const data = await handleGetSALESTOREPROINSTList(req)
|
||||
console.log('datadatadata', data);
|
||||
if (data && data.length > 0) {
|
||||
setReqDetailList(data)
|
||||
|
||||
let fieldData: any = [
|
||||
"OPERATE_COUNT",
|
||||
"OPERATE_TAXAMOUNT",
|
||||
"OPERATE_AMOUNT"
|
||||
]
|
||||
|
||||
|
||||
let enumList: any = []
|
||||
let newPrintData: any = formatTreeData(JSON.parse(JSON.stringify(data)), fieldData, enumList, [], [])
|
||||
setReqDetailList(newPrintData)
|
||||
|
||||
return { data, success: true }
|
||||
}
|
||||
@ -334,15 +347,15 @@ const returnProcess: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
}}
|
||||
toolbar={{
|
||||
actions: [
|
||||
<span style={{ visibility: 'hidden' }}>
|
||||
<ReactHTMLTableToExcel
|
||||
buttonText={'导出excel'}
|
||||
ref={downloadBtnRef}
|
||||
table="table-to-xls-returnProcess"
|
||||
filename={`调拨流程统计${searchParams?.StartDate}-${searchParams?.EndDate}`}
|
||||
sheet="sheet1"
|
||||
/>
|
||||
</span>,
|
||||
// <span style={{ visibility: 'hidden' }}>
|
||||
// <ReactHTMLTableToExcel
|
||||
// buttonText={'导出excel'}
|
||||
// ref={downloadBtnRef}
|
||||
// table="table-to-xls-returnProcess"
|
||||
// filename={`调拨流程统计${searchParams?.StartDate}-${searchParams?.EndDate}`}
|
||||
// sheet="sheet1"
|
||||
// />
|
||||
// </span>,
|
||||
<Button
|
||||
key="new"
|
||||
type="primary"
|
||||
|
||||
@ -24,6 +24,7 @@ import { getMyShopList } from "@/pages/account/center/sevice";
|
||||
import { handleGetRECEIVESERVERPARTList } from "../service";
|
||||
import WarehouseInfo from "./components/warehouseInfo";
|
||||
import { exportXlsxFromProColumnsExcelJS } from "@/utils/exportExcelFun";
|
||||
import { formatTreeData } from "@/utils/format";
|
||||
|
||||
const { Text } = Typography;
|
||||
|
||||
@ -221,9 +222,9 @@ const shopProcurement: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
// ellipsis: true,
|
||||
// },
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>入库总数</div>,
|
||||
title: <div style={{ textAlign: 'center' }}>入库总数</div>,
|
||||
dataIndex: "RECEIVE_TOTALCOUNT",
|
||||
align: 'right',
|
||||
align: 'right',
|
||||
valueType: 'digit',
|
||||
width: 120,
|
||||
sorter: true,
|
||||
@ -233,9 +234,9 @@ const shopProcurement: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>入库金额</div>,
|
||||
title: <div style={{ textAlign: 'center' }}>入库金额</div>,
|
||||
dataIndex: "RECEIVE_TOTALPRICE",
|
||||
align: 'right',
|
||||
align: 'right',
|
||||
valueType: 'digit',
|
||||
width: 120,
|
||||
sorter: true,
|
||||
@ -421,7 +422,18 @@ const shopProcurement: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
const data = await handleGetRECEIVESERVERPARTList(req)
|
||||
setTableLoading(false)
|
||||
console.log('表格数据', data);
|
||||
setReqDetailList(data)
|
||||
|
||||
|
||||
let fieldData: any = [
|
||||
"RECEIVE_TOTALCOUNT",
|
||||
"RECEIVE_TOTALPRICE",
|
||||
]
|
||||
|
||||
|
||||
let enumList: any = []
|
||||
let newPrintData: any = formatTreeData(JSON.parse(JSON.stringify(data)), fieldData, enumList, [], [])
|
||||
|
||||
setReqDetailList(newPrintData)
|
||||
if (data && data.length > 0) {
|
||||
// 总数合计
|
||||
let RECEIVE_TOTALCOUNTSUM: number = 0
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
// 区域销售环比分析
|
||||
import { connect } from "umi";
|
||||
import type { CurrentUser } from "umi";
|
||||
import type { ConnectState } from "@/models/connect";
|
||||
@ -20,6 +21,8 @@ import session from "@/utils/session";
|
||||
import { handleGetShopShortNamesGet } from "../transactionAnalysis/service";
|
||||
import { handleGetGetRevenueYOYQOQByDate } from "@/pages/reports/BusinessAnalysis/revenueYOYQOQReport/service";
|
||||
import PageTitleBox from "@/components/PageTitleBox";
|
||||
import { exportXlsxFromProColumnsExcelJS } from "@/utils/exportExcelFun";
|
||||
import { formatTreeData } from "@/utils/format";
|
||||
|
||||
|
||||
const revenueQOQReport: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
@ -70,6 +73,7 @@ const revenueQOQReport: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
ShopTrade: { show: false },
|
||||
BUSINESS_TYPE: { show: false }
|
||||
})
|
||||
const SHOPTRADEObj = session.get('SHOPTRADEObj')
|
||||
|
||||
const columns: any = [
|
||||
// {
|
||||
@ -287,12 +291,13 @@ const revenueQOQReport: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
align: 'center',
|
||||
width: 120,
|
||||
valueType: 'select',
|
||||
valueEnum: SHOPTRADEObj,
|
||||
hideInSearch: true,
|
||||
request: async () => {
|
||||
// 这里要手动添加枚举字段(从下面这些字典中选择一个):商品业态[BUSINESSTYPE]
|
||||
const options = await getFieldEnum({ FieldExplainField: 'BUSINESSTYPE' });
|
||||
return options;
|
||||
},
|
||||
// request: async () => {
|
||||
// // 这里要手动添加枚举字段(从下面这些字典中选择一个):商品业态[BUSINESSTYPE]
|
||||
// const options = await getFieldEnum({ FieldExplainField: 'BUSINESSTYPE' });
|
||||
// return options;
|
||||
// },
|
||||
},
|
||||
{
|
||||
title: '合计',
|
||||
@ -563,35 +568,63 @@ const revenueQOQReport: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
})
|
||||
}
|
||||
console.log('list', list)
|
||||
setReqDetailList(list)
|
||||
|
||||
let fieldData: any = [
|
||||
"CASHPAY_TotalA",
|
||||
"CASHPAY_TotalB",
|
||||
"CASHPAY_A",
|
||||
"CASHPAY_C",
|
||||
"CASHPAY_B",
|
||||
"CASHPAY_D",
|
||||
]
|
||||
|
||||
let enumList: any = ["BUSINESS_TYPE", "ShopTrade"]
|
||||
let newPrintData: any = formatTreeData(JSON.parse(JSON.stringify(list)), fieldData, enumList, [shopNamesList, SHOPTRADEObj], ["MOMTOTAL", "MOM_A", "MOM_B"])
|
||||
|
||||
|
||||
setReqDetailList(newPrintData)
|
||||
return { data: list, success: true }
|
||||
}}
|
||||
toolbar={{
|
||||
actions: [
|
||||
<span style={{ visibility: 'hidden' }}>
|
||||
<ReactHTMLTableToExcel
|
||||
buttonText={'导出excel'}
|
||||
ref={downloadBtnRef}
|
||||
table="table-to-xls-revenueQOQReport"
|
||||
filename={`销售同/环比分析表_${searchParams?.StartDate}-${searchParams?.EndDate}`}
|
||||
sheet="sheet1"
|
||||
/>
|
||||
</span>,
|
||||
// <span style={{ visibility: 'hidden' }}>
|
||||
// <ReactHTMLTableToExcel
|
||||
// buttonText={'导出excel'}
|
||||
// ref={downloadBtnRef}
|
||||
// table="table-to-xls-revenueQOQReport"
|
||||
// filename={`销售同/环比分析表_${searchParams?.StartDate}-${searchParams?.EndDate}`}
|
||||
// sheet="sheet1"
|
||||
// />
|
||||
// </span>,
|
||||
<Button
|
||||
key="new"
|
||||
type="primary"
|
||||
onClick={(e) => {
|
||||
if (reqDetailList && reqDetailList.length > 0) {
|
||||
setShowLoading(true)
|
||||
setTimeout(() => {
|
||||
setShowExportTable(true)
|
||||
setTimeout(() => {
|
||||
exportTable(e)
|
||||
}, 100)
|
||||
}, 100)
|
||||
// 尝试一下 导出新方法
|
||||
exportXlsxFromProColumnsExcelJS(columns,
|
||||
reqDetailList,
|
||||
`销售同/环比分析表_${searchParams?.StartDate}-${searchParams?.EndDate}`,
|
||||
// {
|
||||
// topTitle: `历史销售单品报表`, // 顶部大标题
|
||||
// }
|
||||
)
|
||||
} else {
|
||||
message.error('暂无数据可导出!')
|
||||
}
|
||||
|
||||
|
||||
// if (reqDetailList && reqDetailList.length > 0) {
|
||||
// setShowLoading(true)
|
||||
// setTimeout(() => {
|
||||
// setShowExportTable(true)
|
||||
// setTimeout(() => {
|
||||
// exportTable(e)
|
||||
// }, 100)
|
||||
// }, 100)
|
||||
// } else {
|
||||
// message.error('暂无数据可导出!')
|
||||
// }
|
||||
}}
|
||||
>
|
||||
导出excel
|
||||
|
||||
@ -25,6 +25,8 @@ import session from "@/utils/session";
|
||||
import { handleGetShopShortNames, handleGetShopShortNamesGet } from "@/pages/reports/BusinessAnalysis/transactionAnalysis/service";
|
||||
import CarTrafficChart from "./components/CarTrafficChart";
|
||||
import PageTitleBox from "@/components/PageTitleBox";
|
||||
import { formatTreeData } from "@/utils/format";
|
||||
import { exportXlsxFromProColumnsExcelJS } from "@/utils/exportExcelFun";
|
||||
|
||||
|
||||
const revenueYOYQOQReport: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
@ -72,7 +74,7 @@ const revenueYOYQOQReport: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
const [showDailyDrawer, setShowDailyDrawer] = useState<boolean>(false)
|
||||
const [currentRow, setCurrentRow] = useState<any>()
|
||||
const [printIndex, setPrintIndex] = useState<number>(new Date().getTime())
|
||||
|
||||
const SHOPTRADEObj = session.get('SHOPTRADEObj')
|
||||
// 实收金额数据
|
||||
const [amountReceivedData, setAmountReceivedData] = useState<any>()
|
||||
// 销售数量数据
|
||||
@ -606,15 +608,6 @@ const revenueYOYQOQReport: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
const data = await handleGetGetRevenueYOYQOQ(req)
|
||||
console.log('data', data)
|
||||
let list: any = []
|
||||
// let CASHPAY_CURRSUM: number = 0
|
||||
// let CASHPAY_MONTHSUM: number = 0
|
||||
// let CASHPAY_YEARSUM: number = 0
|
||||
// let TOTALCOUNT_CURRSUM: number = 0
|
||||
// let TOTALCOUNT_MONTHSUM: number = 0
|
||||
// let TOTALCOUNT_YEARSUM: number = 0
|
||||
// let TICKETCOUNT_CURRSUM: number = 0
|
||||
// let TICKETCOUNT_MONTHSUM: number = 0
|
||||
// let TICKETCOUNT_YEARSUM: number = 0
|
||||
|
||||
if (data && data.length > 0) {
|
||||
list = JSON.parse(JSON.stringify(data))
|
||||
@ -649,48 +642,67 @@ const revenueYOYQOQReport: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
}
|
||||
})
|
||||
}
|
||||
// list.unshift({
|
||||
// Name:'合计',
|
||||
// CASHPAY_CURR: CASHPAY_CURRSUM,
|
||||
// CASHPAY_MONTH: CASHPAY_MONTHSUM,
|
||||
// CASHPAY_YEAR: CASHPAY_YEARSUM,
|
||||
// TOTALCOUNT_CURR: TOTALCOUNT_CURRSUM,
|
||||
// TOTALCOUNT_MONTH: TOTALCOUNT_MONTHSUM,
|
||||
// TOTALCOUNT_YEAR: TOTALCOUNT_YEARSUM,
|
||||
// TICKETCOUNT_CURR: TICKETCOUNT_CURRSUM,
|
||||
// TICKETCOUNT_MONTH: TICKETCOUNT_MONTHSUM,
|
||||
// TICKETCOUNT_YEAR: TICKETCOUNT_YEARSUM,
|
||||
// })
|
||||
setReqDetailList(list)
|
||||
|
||||
let fieldData: any = [
|
||||
"CASHPAY_CURR",
|
||||
"CASHPAY_MONTH",
|
||||
"CASHPAY_YEAR",
|
||||
"TOTALCOUNT_CURR",
|
||||
"TOTALCOUNT_MONTH",
|
||||
"TOTALCOUNT_YEAR",
|
||||
"TICKETCOUNT_CURR",
|
||||
"TICKETCOUNT_MONTH",
|
||||
"TICKETCOUNT_YEAR",
|
||||
]
|
||||
|
||||
|
||||
let enumList: any = ["ShopTrade"]
|
||||
let newPrintData: any = formatTreeData(JSON.parse(JSON.stringify(list)), fieldData, enumList, [SHOPTRADEObj], ["MOM_YEARASHPAY_MONTH", "MOM_YEARASHPAY_YEAR", "MOM_TOTALCOUNT_MONTH", "MOM_TOTALCOUNT_YEAR", "MOM_TICKETCOUNT_MONTH", "MOM_TICKETCOUNT_YEAR"])
|
||||
|
||||
|
||||
setReqDetailList(newPrintData)
|
||||
return { data: list, success: true }
|
||||
}}
|
||||
pagination={false}
|
||||
toolbar={{
|
||||
actions: [
|
||||
<span style={{ visibility: 'hidden' }}>
|
||||
<ReactHTMLTableToExcel
|
||||
buttonText={'导出excel'}
|
||||
ref={downloadBtnRef}
|
||||
table="table-to-xls-revenueYOYQOQReport"
|
||||
filename={`销售同环比分析_${searchParams?.StartDate}-${searchParams?.EndDate}`}
|
||||
sheet="sheet1"
|
||||
/>
|
||||
</span>,
|
||||
// <span style={{ visibility: 'hidden' }}>
|
||||
// <ReactHTMLTableToExcel
|
||||
// buttonText={'导出excel'}
|
||||
// ref={downloadBtnRef}
|
||||
// table="table-to-xls-revenueYOYQOQReport"
|
||||
// filename={`销售同环比分析_${searchParams?.StartDate}-${searchParams?.EndDate}`}
|
||||
// sheet="sheet1"
|
||||
// />
|
||||
// </span>,
|
||||
<Button
|
||||
key="new"
|
||||
type="primary"
|
||||
onClick={(e) => {
|
||||
if (reqDetailList && reqDetailList.length > 0) {
|
||||
setShowLoading(true)
|
||||
setTimeout(() => {
|
||||
setShowExportTable(true)
|
||||
setTimeout(() => {
|
||||
exportTable(e)
|
||||
}, 100)
|
||||
}, 100)
|
||||
// 尝试一下 导出新方法
|
||||
exportXlsxFromProColumnsExcelJS(columns,
|
||||
reqDetailList,
|
||||
`销售同环比分析_${searchParams?.StartDate}-${searchParams?.EndDate}`,
|
||||
// {
|
||||
// topTitle: `历史销售单品报表`, // 顶部大标题
|
||||
// }
|
||||
)
|
||||
} else {
|
||||
message.error('暂无数据可导出!')
|
||||
}
|
||||
|
||||
// if (reqDetailList && reqDetailList.length > 0) {
|
||||
// setShowLoading(true)
|
||||
// setTimeout(() => {
|
||||
// setShowExportTable(true)
|
||||
// setTimeout(() => {
|
||||
// exportTable(e)
|
||||
// }, 100)
|
||||
// }, 100)
|
||||
// } else {
|
||||
// message.error('暂无数据可导出!')
|
||||
// }
|
||||
}}
|
||||
>
|
||||
导出excel
|
||||
|
||||
@ -310,8 +310,8 @@ const saleTypeHisReport: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
columns={columns}
|
||||
bordered
|
||||
headerTitle={<PageTitleBox props={props} />}
|
||||
search={{ span: 6 }}
|
||||
scroll={{ x: '100%', y: 'calc(100vh - 540px)' }}
|
||||
search={{ span: 6, defaultCollapsed: false }}
|
||||
scroll={{ x: '100%', y: 'calc(100vh - 570px)' }}
|
||||
request={async (params) => {
|
||||
if (isFirst) {
|
||||
setIsFirst(false)
|
||||
|
||||
@ -27,6 +27,8 @@ import {
|
||||
} from "@/pages/reports/BusinessAnalysis/transactionAnalysis/service";
|
||||
import { handleGetGetRevenueYOYQOQByDate } from "@/pages/reports/BusinessAnalysis/revenueYOYQOQReport/service";
|
||||
import PageTitleBox from "@/components/PageTitleBox";
|
||||
import { formatTreeData } from "@/utils/format";
|
||||
import { exportXlsxFromProColumnsExcelJS } from "@/utils/exportExcelFun";
|
||||
|
||||
|
||||
const transactionAnalysis: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
@ -83,6 +85,9 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
const [columnsDailyStateMap, setColumnsDailyStateMap] = useState<any>({
|
||||
ShopTrade: { show: false }
|
||||
})
|
||||
|
||||
const SHOPTRADEObj = session.get('SHOPTRADEObj')
|
||||
|
||||
const columns: any = [
|
||||
{
|
||||
title: '统计时间',
|
||||
@ -544,35 +549,64 @@ const transactionAnalysis: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
// })
|
||||
}
|
||||
console.log('list', list)
|
||||
setReqDetailList(list)
|
||||
|
||||
|
||||
let fieldData: any = [
|
||||
"TicketCount",
|
||||
"TotalCount",
|
||||
"TotalSellAmount",
|
||||
"AverageCount",
|
||||
"AverageAmount",
|
||||
"AverageCommodity",
|
||||
]
|
||||
|
||||
|
||||
|
||||
let enumList: any = ["Business_Type", "ShopTrade"]
|
||||
let newPrintData: any = formatTreeData(JSON.parse(JSON.stringify(list)), fieldData, enumList, [shopNamesList, SHOPTRADEObj], [])
|
||||
|
||||
|
||||
setReqDetailList(newPrintData)
|
||||
return { data: list, success: true }
|
||||
}}
|
||||
toolbar={{
|
||||
actions: [
|
||||
<span style={{ visibility: 'hidden' }}>
|
||||
<ReactHTMLTableToExcel
|
||||
buttonText={'导出excel'}
|
||||
ref={downloadBtnRef}
|
||||
table="table-to-xls-transactionAnalysis"
|
||||
filename={`客单交易分析${searchParams?.StartDate}-${searchParams?.EndDate}`}
|
||||
sheet="sheet1"
|
||||
/>
|
||||
</span>,
|
||||
// <span style={{ visibility: 'hidden' }}>
|
||||
// <ReactHTMLTableToExcel
|
||||
// buttonText={'导出excel'}
|
||||
// ref={downloadBtnRef}
|
||||
// table="table-to-xls-transactionAnalysis"
|
||||
// filename={`客单交易分析${searchParams?.StartDate}-${searchParams?.EndDate}`}
|
||||
// sheet="sheet1"
|
||||
// />
|
||||
// </span>,
|
||||
<Button
|
||||
key="new"
|
||||
type="primary"
|
||||
onClick={(e) => {
|
||||
if (reqDetailList && reqDetailList.length > 0) {
|
||||
setShowLoading(true)
|
||||
setTimeout(() => {
|
||||
setShowExportTable(true)
|
||||
setTimeout(() => {
|
||||
exportTable(e)
|
||||
}, 100)
|
||||
}, 100)
|
||||
// 尝试一下 导出新方法
|
||||
exportXlsxFromProColumnsExcelJS(columns,
|
||||
reqDetailList,
|
||||
`客单交易分析${searchParams?.StartDate}-${searchParams?.EndDate}`,
|
||||
// {
|
||||
// topTitle: `历史销售单品报表`, // 顶部大标题
|
||||
// }
|
||||
)
|
||||
} else {
|
||||
message.error('暂无数据可导出!')
|
||||
}
|
||||
// if (reqDetailList && reqDetailList.length > 0) {
|
||||
// setShowLoading(true)
|
||||
// setTimeout(() => {
|
||||
// setShowExportTable(true)
|
||||
// setTimeout(() => {
|
||||
// exportTable(e)
|
||||
// }, 100)
|
||||
// }, 100)
|
||||
// } else {
|
||||
// message.error('暂无数据可导出!')
|
||||
// }
|
||||
}}
|
||||
>
|
||||
导出excel
|
||||
|
||||
@ -0,0 +1,520 @@
|
||||
import { connect } from "umi";
|
||||
import type { ConnectState } from "@/models/connect";
|
||||
import { Col, FormInstance, Modal, Row } from "antd";
|
||||
import { useRef, useState } from "react";
|
||||
import ProForm, { ProFormDateTimePicker, ProFormDigit, ProFormSelect, ProFormText, ProFormTextArea, ProFormTreeSelect } from "@ant-design/pro-form";
|
||||
import { handleGetServerpartShopTrade } from "../../commodityInfo/service";
|
||||
import { getServerpartTree } from "@/services/options";
|
||||
import moment from 'moment'
|
||||
import { handleGetUSERDEFINEDTYPEList } from "../../userDefinedType/service";
|
||||
|
||||
type DetailProps = {
|
||||
parentRow: any // 详细信息
|
||||
onShow: any // 显示新增商品的悬浮框
|
||||
currentShopRow: any // 当前选择的商品行数据
|
||||
shopData: any // 商品列表数据
|
||||
handleCloseShopModal: any // 关闭悬浮框的方法
|
||||
handleChangeShopData: any // 改变商品列表的方法
|
||||
currentUser: any // 公参信息
|
||||
treeView: any // 商品类别信息
|
||||
}
|
||||
const AddShopModal = ({ parentRow, onShow, currentShopRow, shopData, handleCloseShopModal, handleChangeShopData, currentUser, treeView }: DetailProps) => {
|
||||
const modalShopFormRef = useRef<FormInstance>();
|
||||
const modalFormRef = useRef<FormInstance>();
|
||||
|
||||
// 商品业态的搜索框内容
|
||||
const [commodityList, setCommodityList] = useState<any>([])
|
||||
const [customClassList, setCustomClassList] = useState<any>()
|
||||
const [selectBUSINESSTYPE, setSelectBUSINESSTYPE] = useState<any>()
|
||||
const [selectSERVERPARTID, setSelectSERVERPARTID] = useState<any>()
|
||||
|
||||
// 拿到对应的商品业态
|
||||
const handleGetCommodity = async (id: any) => {
|
||||
const req: any = {
|
||||
ProvinceCode: currentUser?.ProvinceCode,
|
||||
ServerpartId: id
|
||||
}
|
||||
const data = await handleGetServerpartShopTrade(req)
|
||||
console.log('data', data)
|
||||
setCommodityList(data)
|
||||
}
|
||||
|
||||
// 请求自定义类的选择列表
|
||||
const handleGetCustomClassList = async (id: any) => {
|
||||
const req: any = {
|
||||
SearchParameter: {
|
||||
USERDEFINEDTYPE_STATE: 1,
|
||||
SERVERPART_ID: id,
|
||||
BUSINESSTYPE: selectBUSINESSTYPE
|
||||
},
|
||||
PageIndex: 1,
|
||||
PageSize: 999999,
|
||||
pageSize: 999999,
|
||||
}
|
||||
const data = await handleGetUSERDEFINEDTYPEList(req)
|
||||
if (data && data.length > 0) {
|
||||
const list: any = []
|
||||
data.forEach((item: any) => {
|
||||
list.push({ label: item.USERDEFINEDTYPE_NAME, value: item.USERDEFINEDTYPE_ID })
|
||||
})
|
||||
setCustomClassList(list)
|
||||
}
|
||||
console.log('data', data)
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
{/* 新增商品的悬浮框 */}
|
||||
<Modal
|
||||
open={onShow}
|
||||
width={1200}
|
||||
wrapClassName={'shopModal'}
|
||||
destroyOnClose
|
||||
title={currentShopRow?.COMMODITY_ID ? '编辑商品' : '添加商品'}
|
||||
onOk={() => {
|
||||
modalShopFormRef.current?.validateFields().then(async (res: any) => {
|
||||
let oldData: any = shopData && shopData.length > 0 ? JSON.parse(JSON.stringify(shopData)) : []
|
||||
|
||||
console.log('oldDataoldDataoldData', oldData);
|
||||
console.log('resresresresresres', res);
|
||||
|
||||
let newList: any = []
|
||||
// 判断当前的里面有没有一样的
|
||||
if (oldData && oldData.length > 0) {
|
||||
let same: boolean = false
|
||||
oldData.forEach((item: any, index: number) => {
|
||||
if (item.ADDTIME === res.ADDTIME) {
|
||||
same = true
|
||||
newList.push({
|
||||
...item,
|
||||
...res
|
||||
})
|
||||
} else {
|
||||
newList.push(item)
|
||||
}
|
||||
})
|
||||
if (!same) {
|
||||
newList.push(res)
|
||||
}
|
||||
|
||||
} else {
|
||||
newList.push(res)
|
||||
}
|
||||
console.log('newList', newList);
|
||||
|
||||
// 如果进入到了添加商品 里面选了服务区 会 带给外面的表单
|
||||
if (res.SERVERPART_ID) {
|
||||
modalFormRef.current?.setFieldsValue({
|
||||
ServerpartId: res.SERVERPART_ID
|
||||
})
|
||||
}
|
||||
if (handleChangeShopData) {
|
||||
handleChangeShopData(newList)
|
||||
}
|
||||
if (handleCloseShopModal) {
|
||||
handleCloseShopModal()
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
}}
|
||||
onCancel={() => {
|
||||
if (handleCloseShopModal) {
|
||||
handleCloseShopModal()
|
||||
}
|
||||
}}
|
||||
bodyStyle={{
|
||||
height: '700px', // 你可以根据需要调整高度
|
||||
overflowY: 'auto',
|
||||
}}
|
||||
>
|
||||
|
||||
<ProForm
|
||||
formRef={modalShopFormRef}
|
||||
submitter={false}
|
||||
initialValues={currentShopRow}
|
||||
request={async () => {
|
||||
// !currentShopRow?.COMMODITY_ID &&
|
||||
if (currentShopRow?.SERVERPART_ID) {
|
||||
await handleGetCommodity(currentShopRow?.SERVERPART_ID)
|
||||
}
|
||||
return { ...currentShopRow, BUSINESSTYPE: currentShopRow?.BUSINESSTYPE.toString() }
|
||||
}}
|
||||
disabled={parentRow?.BusinessProcess_State === 9000}
|
||||
>
|
||||
<div className={'modalTitle'}>商品基本信息</div>
|
||||
<Row gutter={16}>
|
||||
<Col span={16}>
|
||||
<ProFormText
|
||||
name="COMMODITY_NAME"
|
||||
label="商品名称"
|
||||
placeholder="请输入商品名称"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '请输入商品名称',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormText
|
||||
name="COMMODITY_EN"
|
||||
label="拼音简码"
|
||||
/>
|
||||
</Col>
|
||||
|
||||
<Col span={8}>
|
||||
<ProFormSelect
|
||||
name="SERVERPART_ID"
|
||||
label="服务区名"
|
||||
request={async () => {
|
||||
const data = await getServerpartTree(currentUser?.ProvinceCode, currentUser?.CityAuthority, true, true, true)
|
||||
const list: any = []
|
||||
if (data && data.length > 0) {
|
||||
data.forEach((item: any) => {
|
||||
if (item.children && item.children.length > 0) {
|
||||
item.children.forEach((subItem: any) => {
|
||||
list.push({ label: subItem.label, value: subItem.value })
|
||||
})
|
||||
}
|
||||
})
|
||||
data.forEach((item: any) => {
|
||||
list.push({ label: item.label, value: item.value })
|
||||
})
|
||||
}
|
||||
return list
|
||||
}}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '请选择服务区',
|
||||
},
|
||||
]}
|
||||
fieldProps={{
|
||||
onChange: async (e: any) => {
|
||||
console.log('e', e)
|
||||
if (e) {
|
||||
setSelectSERVERPARTID(e)
|
||||
await handleGetCommodity(e)
|
||||
if (selectBUSINESSTYPE) {
|
||||
await handleGetCustomClassList(e)
|
||||
}
|
||||
} else {
|
||||
setSelectSERVERPARTID(undefined)
|
||||
setCommodityList([])
|
||||
setCustomClassList([])
|
||||
}
|
||||
},
|
||||
showSearch: true, // 启用搜索框
|
||||
filterOption: (inputValue: any, option: any) => {
|
||||
// 通过 label 搜索
|
||||
return option.label.toLowerCase().includes(inputValue.toLowerCase());
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormSelect
|
||||
name="BUSINESSTYPE"
|
||||
label="商品业态"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '请选择商品业态',
|
||||
},
|
||||
]}
|
||||
options={commodityList}
|
||||
fieldProps={{
|
||||
onChange: async (e: any) => {
|
||||
if (e) {
|
||||
setSelectBUSINESSTYPE(e)
|
||||
if (selectSERVERPARTID) {
|
||||
await handleGetCustomClassList(e)
|
||||
}
|
||||
} else {
|
||||
setSelectBUSINESSTYPE(undefined)
|
||||
}
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormTreeSelect
|
||||
name="COMMODITY_TYPE"
|
||||
label="商品类别"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '请选择商品类别',
|
||||
},
|
||||
]}
|
||||
request={() => {
|
||||
return treeView
|
||||
}}
|
||||
fieldProps={{
|
||||
treeDefaultExpandAll: true
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
|
||||
<Col span={8}>
|
||||
<ProFormText
|
||||
name="COMMODITY_BARCODE"
|
||||
label="商品条码"
|
||||
disabled={parentRow}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormText
|
||||
name="COMMODITY_UNIT"
|
||||
label="商品单位"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '请输入商品单位',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormText
|
||||
name="COMMODITY_RULE"
|
||||
label="商品规格"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '请输入商品规格',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
|
||||
<Col span={8}>
|
||||
<ProFormText
|
||||
name="COMMODITY_HOTKEY"
|
||||
label="快捷键值"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormSelect
|
||||
name="COMMODITY_GRADE"
|
||||
label="质量等级"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '请选择质量等级',
|
||||
},
|
||||
]}
|
||||
initialValue={1000}
|
||||
options={[{ label: '一等品', value: 1000 }, { label: '二等品', value: 2000 }, { label: '三等品', value: 5000 }, { label: '优等品', value: 3000 }, { label: '合格品', value: 4000 },]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormText
|
||||
name="COMMODITY_ORI"
|
||||
label="商品产地"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '请输入商品产地',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
|
||||
<Col span={8}>
|
||||
<ProFormSelect
|
||||
name="USERDEFINEDTYPE_ID"
|
||||
label="自定义类"
|
||||
options={customClassList}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormText
|
||||
name="PROVINCE_CODE"
|
||||
label="省份编码"
|
||||
disabled
|
||||
// initialValue={currentUser?.ProvinceCode}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormText
|
||||
name="COMMODITY_CODE"
|
||||
label="商品编码"
|
||||
disabled
|
||||
/>
|
||||
</Col>
|
||||
|
||||
<Col span={24}>
|
||||
<ProFormTextArea
|
||||
name="COMMODITY_DESC"
|
||||
label="商品说明"
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
<div className={'modalTitle'}>商品状态信息</div>
|
||||
<Row gutter={16}>
|
||||
<Col span={8}>
|
||||
<ProFormSelect
|
||||
name="CANSALE"
|
||||
label="是否销售"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '请选择是否销售',
|
||||
},
|
||||
]}
|
||||
initialValue={1}
|
||||
options={[{ label: '是', value: 1 }, { label: '否', value: 0 }]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormSelect
|
||||
name="ISBULK"
|
||||
label="是否散装"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '请选择是否散装',
|
||||
},
|
||||
]}
|
||||
initialValue={0}
|
||||
options={[{ label: '是', value: 1 }, { label: '否', value: 0 }]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormSelect
|
||||
name="METERINGMETHOD"
|
||||
label="称重方式"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '请选择称重方式',
|
||||
},
|
||||
]}
|
||||
initialValue={1}
|
||||
options={[{ label: '计价', value: 1 }, { label: '散装称重', value: 0 }]}
|
||||
/>
|
||||
</Col>
|
||||
|
||||
|
||||
<Col span={8}>
|
||||
<ProFormSelect
|
||||
name="COMMODITY_STATE"
|
||||
label="审核状态"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '请选择审核状态',
|
||||
},
|
||||
]}
|
||||
initialValue={1}
|
||||
options={[{ label: '有效', value: 1 }, { label: '审核中', value: 2 }, { label: '无效', value: 0 }]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormText
|
||||
name="ADDTIME"
|
||||
label="添加时间"
|
||||
disabled
|
||||
initialValue={moment().format('YYYY-MM-DD HH:mm:ss')}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormDateTimePicker
|
||||
name="OPERATE_DATE"
|
||||
label="生效时间"
|
||||
initialValue={moment().format('YYYY-MM-DD HH:mm:ss')}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
<div className={'modalTitle'}>商品价格信息</div>
|
||||
<Row gutter={16}>
|
||||
<Col span={8}>
|
||||
<ProFormDigit
|
||||
name="COMMODITY_RETAILPRICE"
|
||||
label="零售价"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '请输入零售价',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormDigit
|
||||
name="COMMODITY_CURRPRICE"
|
||||
label="当前价格"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '请输入当前价格',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormDigit
|
||||
name="COMMODITY_MEMBERPRICE"
|
||||
label="会员价"
|
||||
/>
|
||||
</Col>
|
||||
|
||||
<Col span={8}>
|
||||
<ProFormDigit
|
||||
name="COMMODITY_PURCHASEPRICE"
|
||||
label="进货价"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '请输入进货价',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormDigit
|
||||
name="COMMODITY_MINPRICE"
|
||||
label="最低价"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormDigit
|
||||
name="COMMODITY_MAXPRICE"
|
||||
label="最高价"
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
<div className={'modalTitle'}>商品进销信息</div>
|
||||
<Row gutter={16}>
|
||||
<Col span={8}>
|
||||
<ProFormDigit
|
||||
name="DUTY_PARAGRAPH"
|
||||
label="进价税率"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormDigit
|
||||
name="RETAIL_DUTY"
|
||||
label="零售税率"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormSelect
|
||||
name="COMMODITY_FROZENCOUNT"
|
||||
label="采购状态"
|
||||
options={[{ label: '允许', value: 1000 }, { label: '禁止', value: 2000 }]}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
</ProForm>
|
||||
</Modal >
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default connect(({ user, }: ConnectState) => ({
|
||||
currentUser: user.currentUser,
|
||||
}))(AddShopModal);
|
||||
@ -0,0 +1,674 @@
|
||||
import { connect } from "umi";
|
||||
import type { ConnectState } from "@/models/connect";
|
||||
import { Button, Card, Col, FormInstance, message, Modal, Popconfirm, Row, Space, Steps, Tooltip } from "antd";
|
||||
import { useRef, useState } from "react";
|
||||
import ProForm, { ProFormSelect, ProFormTextArea } from "@ant-design/pro-form";
|
||||
import { handleApproveCommodityProInst, handleCreateCommodityProInst, handleDeleteCOMMODITY_RUNNING, handleGetApprovalCommodityList, handleGetBUSINESSAPPROVALDetail, handleGetCOMMODITYRUNNINGList, handleReapplyCommodityProInst, handleRejectCommodityProInst } from "../../ProductApprovalProcess/service";
|
||||
import session from "@/utils/session";
|
||||
import { handleGetAPPROVALROUTEList } from "@/pages/Setting/serviceConfig/service";
|
||||
import ProTable from "@ant-design/pro-table";
|
||||
|
||||
type DetailProps = {
|
||||
modalType: number // 1 新增商品申请 2 商品调价申请 3 信息修改审批
|
||||
parentRow: any // 父级传入的基本信息
|
||||
tableRef: any // 表格的实例
|
||||
onShow: any // 控制组件是否显示
|
||||
handleCencel: any // 悬浮框取消显示的效果
|
||||
currentUser: any // 公参
|
||||
showDetailType: any // 显示的类型
|
||||
InitiateApplication: any // 有无发起的权限
|
||||
shopData: any // 商品数据
|
||||
handleChangeShopData: any // 改变shopData的方法
|
||||
ApprovalType: any // 审批还是驳回的判断
|
||||
setCurrentShopRow: any // 当前的商品行
|
||||
setShowAddShopModal: any // 新增商品的悬浮框
|
||||
}
|
||||
const NewApplicationModal = ({ parentRow, tableRef, onShow, handleCencel, currentUser, showDetailType, InitiateApplication, shopData, handleChangeShopData, ApprovalType, setCurrentShopRow, setShowAddShopModal }: DetailProps) => {
|
||||
const { Step } = Steps
|
||||
|
||||
const modalApproveFormRef = useRef<FormInstance>();
|
||||
const modalFormRef = useRef<FormInstance>();
|
||||
|
||||
// 审批记录详情
|
||||
const [BUSINESSAPPROVALDETAIL, setBUSINESSAPPROVALDETAIL] = useState<any>()
|
||||
// 还有几个环节 拼在流程进度后面
|
||||
const [nextStepsList, setNextStepsList] = useState<any>()
|
||||
// 下一个审批流程
|
||||
const [nextApproval, setNextApproval] = useState<any>()
|
||||
// 下一审批流程的审批人
|
||||
const [nextApprovalPerson, setNextApprovalPerson] = useState<any>()
|
||||
// 新增申请的加载效果
|
||||
const [addApprovalLoading, setAddApprovalLoading] = useState<boolean>(false);
|
||||
// 确认按钮的加载效果
|
||||
const [confirmLoading, setConfirmLoading] = useState<boolean>(false);
|
||||
|
||||
const modalColumns: any = [
|
||||
{
|
||||
title: "序号",
|
||||
width: 70,
|
||||
dataIndex: "index",
|
||||
valueType: "index",
|
||||
align: 'center',
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: "名称",
|
||||
width: 300,
|
||||
dataIndex: "COMMODITY_NAME",
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: "条码",
|
||||
width: 150,
|
||||
dataIndex: "COMMODITY_BARCODE",
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: "零售价",
|
||||
width: 150,
|
||||
dataIndex: "COMMODITY_RETAILPRICE",
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: "规格",
|
||||
width: 150,
|
||||
dataIndex: "COMMODITY_RULE",
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: "单位",
|
||||
width: 150,
|
||||
dataIndex: "COMMODITY_UNIT",
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
dataIndex: 'option',
|
||||
title: '操作',
|
||||
valueType: 'option',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
width: 120,
|
||||
fixed: "right",
|
||||
ellipsis: true,
|
||||
render: (_, record) => {
|
||||
return (
|
||||
<Space>
|
||||
{
|
||||
parentRow?.BusinessProcess_State > 1000 || (parentRow?.BusinessApproval_ID && parentRow?.ApproveStaff_ID !== currentUser?.ID) ? '' :
|
||||
<>
|
||||
<a
|
||||
onClick={() => {
|
||||
setCurrentShopRow(record)
|
||||
setShowAddShopModal(true)
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</a>
|
||||
<Popconfirm
|
||||
title="确认删除该商品管理列表信息吗?"
|
||||
onConfirm={async () => {
|
||||
if (parentRow?.BusinessApproval_ID) {
|
||||
// 申请回到发起时候的真删
|
||||
const req: any = {
|
||||
COMMODITY_RUNNINGId: record?.COMMODITY_ID
|
||||
}
|
||||
const data = await handleDeleteCOMMODITY_RUNNING(req)
|
||||
console.log('datadatadatadata', data);
|
||||
// actionRef.current?.reload()
|
||||
if (tableRef) {
|
||||
tableRef.current?.reload()
|
||||
}
|
||||
// 实现直接删除的效果
|
||||
let oldData: any = JSON.parse(JSON.stringify(shopData))
|
||||
let list: any = []
|
||||
oldData.forEach((item: any) => {
|
||||
if (item.COMMODITY_ID !== record?.COMMODITY_ID) {
|
||||
list.push(item)
|
||||
}
|
||||
})
|
||||
if (handleChangeShopData) {
|
||||
handleChangeShopData(list)
|
||||
}
|
||||
} else {
|
||||
// 还未发起申请的假删
|
||||
console.log('record', record);
|
||||
let oldData: any = JSON.parse(JSON.stringify(shopData))
|
||||
let list: any = []
|
||||
oldData.forEach((item: any) => {
|
||||
if (item.ADDTIME !== record?.ADDTIME) {
|
||||
list.push(item)
|
||||
}
|
||||
})
|
||||
if (handleChangeShopData) {
|
||||
handleChangeShopData(list)
|
||||
}
|
||||
}
|
||||
}}
|
||||
>
|
||||
<a>删除</a>
|
||||
</Popconfirm>
|
||||
</>
|
||||
}
|
||||
|
||||
{
|
||||
parentRow?.BusinessProcess_State === 9000 ?
|
||||
<a onClick={() => {
|
||||
setCurrentShopRow(record)
|
||||
setShowAddShopModal(true)
|
||||
}}>详情</a>
|
||||
: ''
|
||||
}
|
||||
|
||||
</Space>
|
||||
);
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
return (
|
||||
<div>
|
||||
{/* 新增申请的悬浮框 */}
|
||||
<Modal
|
||||
className="addProductModal"
|
||||
width={"70%"}
|
||||
title={parentRow?.BusinessApproval_ID ? "商品申请详情" : "新增商品申请"}
|
||||
open={onShow}
|
||||
destroyOnClose
|
||||
onCancel={() => {
|
||||
if (handleCencel) {
|
||||
handleCencel()
|
||||
}
|
||||
}}
|
||||
footer={showDetailType === 'detail' || !InitiateApplication || (parentRow?.BusinessApproval_ID && parentRow?.ApproveStaff_ID !== currentUser?.ID) ? false :
|
||||
<div style={{ width: '100%', display: 'flex', alignItems: 'center', justifyContent: 'flex-end', boxSizing: 'border-box', padding: "0 16px" }}>
|
||||
<Button style={{ marginRight: '8px' }} onClick={() => {
|
||||
if (handleCencel) {
|
||||
handleCencel()
|
||||
}
|
||||
}}>取消</Button>
|
||||
|
||||
<Button loading={confirmLoading} type={"primary"} onClick={() => {
|
||||
if (parentRow?.BusinessProcess_State > 1000) {
|
||||
modalApproveFormRef?.current?.validateFields().then(() => {
|
||||
modalApproveFormRef?.current?.submit()
|
||||
})
|
||||
} else {
|
||||
if (shopData && shopData.length > 0) {
|
||||
modalFormRef?.current?.validateFields().then(() => {
|
||||
modalFormRef?.current?.submit()
|
||||
})
|
||||
} else {
|
||||
message.error("请选选择申请的商品!")
|
||||
return
|
||||
}
|
||||
}
|
||||
}}>确认</Button>
|
||||
</div>}
|
||||
onOk={() => {
|
||||
if (parentRow?.BusinessProcess_State > 1000) {
|
||||
modalApproveFormRef?.current?.validateFields().then(() => {
|
||||
modalApproveFormRef?.current?.submit()
|
||||
})
|
||||
} else {
|
||||
modalFormRef?.current?.validateFields().then(() => {
|
||||
modalFormRef?.current?.submit()
|
||||
})
|
||||
}
|
||||
}}
|
||||
>
|
||||
<ProForm
|
||||
// layout={'horizontal'}
|
||||
formRef={modalFormRef}
|
||||
submitter={false}
|
||||
preserve={false}
|
||||
request={async () => {
|
||||
if (parentRow?.BusinessApproval_ID) {
|
||||
const req: any = {
|
||||
BUSINESSAPPROVALId: parentRow?.BusinessApproval_ID,
|
||||
}
|
||||
const data = await handleGetBUSINESSAPPROVALDetail(req)
|
||||
console.log('datadatadata', data);
|
||||
setBUSINESSAPPROVALDETAIL(data.Result_Data)
|
||||
|
||||
let shopData: any = []
|
||||
|
||||
if (parentRow?.BusinessProcess_State === 9000) {
|
||||
shopData = await handleGetApprovalCommodityList({
|
||||
ProvinceCode: currentUser?.ProvinceCode,
|
||||
// CommodityId: currentUser?.ProvinceCode,
|
||||
BusinessApprovalId: parentRow?.BusinessApproval_ID,
|
||||
PageIndex: 1,
|
||||
PageSize: 999999,
|
||||
})
|
||||
} else {
|
||||
shopData = await handleGetCOMMODITYRUNNINGList({
|
||||
SearchParameter: {
|
||||
BUSINESSAPPROVAL_ID: parentRow?.BusinessApproval_ID,
|
||||
},
|
||||
PageIndex: 1,
|
||||
pageSize: 999999,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
console.log('shopDatashopDatashopDatashopData', shopData);
|
||||
|
||||
// setShopData(shopData.Result_Data.List)
|
||||
if (handleChangeShopData) {
|
||||
handleChangeShopData(shopData.Result_Data.List)
|
||||
}
|
||||
|
||||
return {
|
||||
reasonForApplication: data.Result_Data.BUSINESSAPPROVAL_DESC,
|
||||
ServerpartId: data.Result_Data.SERVERPART_ID,
|
||||
NextApproveStaffId: data.Result_Data.APPOVED_IDS
|
||||
}
|
||||
} else {
|
||||
return {}
|
||||
}
|
||||
}}
|
||||
onFinish={async (res) => {
|
||||
setConfirmLoading(true)
|
||||
let data: any = {}
|
||||
if (parentRow?.BusinessApproval_ID) {
|
||||
const req: any = {
|
||||
ProinstId: parentRow?.BusinessApproval_ID,
|
||||
ProinstName: res.reasonForApplication,
|
||||
UserId: currentUser?.ID,
|
||||
OperateType: "100100",
|
||||
ServerpartId: res.ServerpartId,
|
||||
NextApproveStaffId: res.NextApproveStaffId,
|
||||
NextApproveState: 2000,
|
||||
CommodityRunningList: shopData
|
||||
}
|
||||
data = await handleReapplyCommodityProInst(req)
|
||||
} else {
|
||||
const req: any = {
|
||||
ProinstName: res.reasonForApplication,
|
||||
UserId: currentUser?.ID,
|
||||
OperateType: "100100",
|
||||
ServerpartId: res.ServerpartId,
|
||||
NextApproveStaffId: res.NextApproveStaffId,
|
||||
NextApproveState: 2000,
|
||||
CommodityRunningList: shopData
|
||||
}
|
||||
data = await handleCreateCommodityProInst(req)
|
||||
console.log('dsaidjaskda', data);
|
||||
}
|
||||
setConfirmLoading(false)
|
||||
if (data.Result_Code === 100) {
|
||||
message.success(data.Result_Desc)
|
||||
if (handleCencel) {
|
||||
handleCencel()
|
||||
}
|
||||
|
||||
if (tableRef) {
|
||||
tableRef.current?.reload()
|
||||
}
|
||||
|
||||
} else {
|
||||
message.error(data.Result_Desc)
|
||||
}
|
||||
|
||||
|
||||
|
||||
}}
|
||||
>
|
||||
<Row gutter={8}>
|
||||
<Col span={24}>
|
||||
<ProFormTextArea
|
||||
label="申请原因"
|
||||
name="reasonForApplication"
|
||||
rules={[{
|
||||
required: true,
|
||||
message: "请输入申请原因!"
|
||||
}]}
|
||||
disabled={parentRow?.BusinessProcess_State > 1000 || (parentRow?.BusinessApproval_ID && parentRow?.ApproveStaff_ID !== currentUser?.ID)}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<ProFormSelect
|
||||
label="服务区"
|
||||
name="ServerpartId"
|
||||
rules={[{
|
||||
required: true,
|
||||
message: "请选择服务区!"
|
||||
}]}
|
||||
request={async () => {
|
||||
const ServerpartIdsTree = session.get('ServerpartIdsTree')
|
||||
return ServerpartIdsTree
|
||||
}}
|
||||
disabled={parentRow?.BusinessProcess_State > 1000 || (parentRow?.BusinessApproval_ID && parentRow?.ApproveStaff_ID !== currentUser?.ID)}
|
||||
fieldProps={{
|
||||
showSearch: true, // 启用搜索框
|
||||
filterOption: (inputValue: any, option: any) => {
|
||||
// 通过 label 搜索
|
||||
return option.label.toLowerCase().includes(inputValue.toLowerCase());
|
||||
}
|
||||
}}
|
||||
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12} style={{ display: parentRow?.BusinessProcess_State > 1000 && ApprovalType !== 0 ? "none" : "" }}>
|
||||
<ProFormSelect
|
||||
label="下一环节审批人"
|
||||
name="NextApproveStaffId"
|
||||
rules={[{
|
||||
required: true,
|
||||
message: "请选择下一环节审批人!"
|
||||
}]}
|
||||
request={async () => {
|
||||
const reqState: any = {
|
||||
SearchParameter: {
|
||||
PROVINCE_CODE: currentUser?.ProvinceCode,
|
||||
APPROVALROUTE_STATES: "",
|
||||
APPROVALROUTE_VALID: 1,
|
||||
OPERATION_TYPES: "100100",
|
||||
},
|
||||
PageIndex: 1,
|
||||
PageSize: 999999
|
||||
}
|
||||
const dataState = await handleGetAPPROVALROUTEList(reqState)
|
||||
if (dataState && dataState.length > 0) {
|
||||
let obj: any = {}
|
||||
// 下面的环节
|
||||
let nextList: any = []
|
||||
console.log('dataState', dataState);
|
||||
|
||||
dataState.forEach((item: any) => {
|
||||
if (item.APPROVALROUTE_STATE === 2000) {
|
||||
obj = item
|
||||
}
|
||||
if (item.APPROVALROUTE_STATE >= parentRow?.BusinessProcess_State) {
|
||||
if (item.APPROVALROUTE_STATE === parentRow?.BusinessProcess_State) {
|
||||
item.status = "process"
|
||||
}
|
||||
nextList.push(item)
|
||||
}
|
||||
})
|
||||
setNextStepsList(nextList)
|
||||
console.log('next', nextList);
|
||||
|
||||
let personTotal: number = obj.APPROVALSTAFF_ID.split(',').length || 0
|
||||
if (personTotal > 0) {
|
||||
let STAFFIDList: number[] = obj.APPROVALSTAFF_ID.split(',')
|
||||
let STAFFNAMEList: string[] = obj.APPROVALSTAFF_NAME.split(',')
|
||||
let list: any = []
|
||||
for (let i = 0; i < personTotal; i++) {
|
||||
list.push({ label: STAFFNAMEList[i], value: STAFFIDList[i] })
|
||||
}
|
||||
return list
|
||||
}
|
||||
}
|
||||
}}
|
||||
disabled={parentRow?.BusinessProcess_State > 1000 || (parentRow?.BusinessApproval_ID && parentRow?.ApproveStaff_ID !== currentUser?.ID)}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
</ProForm>
|
||||
{
|
||||
parentRow?.BusinessProcess_State > 1000 ?
|
||||
<ProForm
|
||||
// layout={'horizontal'}
|
||||
formRef={modalApproveFormRef}
|
||||
submitter={false}
|
||||
preserve={false}
|
||||
request={async () => {
|
||||
const reqState: any = {
|
||||
SearchParameter: {
|
||||
APPROVALROUTE_STATES: "",
|
||||
APPROVALROUTE_VALID: 1,
|
||||
OPERATION_TYPES: "100100",
|
||||
},
|
||||
PageIndex: 1,
|
||||
PageSize: 999999
|
||||
}
|
||||
const dataState = await handleGetAPPROVALROUTEList(reqState)
|
||||
console.log('dataStatedataStatedataState', dataState);
|
||||
let obj: any = {}
|
||||
let currentIndex: number = 0
|
||||
if (dataState && dataState.length > 0) {
|
||||
dataState.forEach((item: any, index: number) => {
|
||||
if (item.APPROVALROUTE_STATE === parentRow.BusinessProcess_State) {
|
||||
obj = item
|
||||
currentIndex = index
|
||||
}
|
||||
})
|
||||
}
|
||||
if (obj) {
|
||||
// 审批的时候 拿到当前状态 去找下一个状态
|
||||
if (ApprovalType === 1) {
|
||||
// 拿到当前状态的信息 判断下一状态 是不是结束了 结束了 就不显示 下一结算审批人 不是结束 就拿到下一流程的审批人
|
||||
setNextApproval(obj.NEXT_STATE)
|
||||
let nextObj: any = currentIndex + 1 <= dataState.length ? dataState[currentIndex + 1] : {}
|
||||
if (nextObj) {
|
||||
let personTotal: number = nextObj.APPROVALSTAFF_ID.split(',').length || 0
|
||||
if (personTotal > 0) {
|
||||
let STAFFIDList: number[] = nextObj.APPROVALSTAFF_ID.split(',')
|
||||
let STAFFNAMEList: string[] = nextObj.APPROVALSTAFF_NAME.split(',')
|
||||
let list: any = []
|
||||
for (let i = 0; i < personTotal; i++) {
|
||||
list.push({ label: STAFFNAMEList[i], value: STAFFIDList[i] })
|
||||
}
|
||||
setNextApprovalPerson(list)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 驳回的话 去找历史状态
|
||||
if (dataState && dataState.length > 0) {
|
||||
let list: any = []
|
||||
dataState.forEach((item: any, index: number) => {
|
||||
if (obj.APPROVALROUTE_STATE > item.APPROVALROUTE_STATE) {
|
||||
list.push({ label: item.APPROVALROUTE_NAME, value: item.APPROVALROUTE_STATE })
|
||||
}
|
||||
})
|
||||
setNextApprovalPerson(list)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
return {}
|
||||
}}
|
||||
onFinish={async (res) => {
|
||||
setAddApprovalLoading(true)
|
||||
setConfirmLoading(true)
|
||||
let data: any = {}
|
||||
|
||||
if (ApprovalType === 1) {
|
||||
// 审批
|
||||
const req: any = {
|
||||
businessApprovalId: parentRow?.BusinessApproval_ID,
|
||||
UserId: currentUser?.ID,
|
||||
ApproveInfo: res.ApproveInfo,
|
||||
nextApproveStaffId: res.nextApproveStaffId || "",
|
||||
nextApproveState: nextApproval || ""
|
||||
}
|
||||
|
||||
data = await handleApproveCommodityProInst(req)
|
||||
} else {
|
||||
// 驳回
|
||||
const req: any = {
|
||||
businessApprovalId: parentRow?.BusinessApproval_ID,
|
||||
UserId: currentUser?.ID,
|
||||
RejectInfo: res.ApproveInfo,
|
||||
nextApproveState: res.nextApproveState || ""
|
||||
}
|
||||
console.log('reqreqreqreq', req);
|
||||
|
||||
data = await handleRejectCommodityProInst(req)
|
||||
}
|
||||
setAddApprovalLoading(false)
|
||||
setConfirmLoading(false)
|
||||
console.log('datadatadata', data);
|
||||
if (data.Result_Code === 100) {
|
||||
message.success(data.Result_Desc)
|
||||
|
||||
// setShowApplyFor(false)
|
||||
// setCurrentRow(undefined)
|
||||
// setShopData([])
|
||||
// setShowDetailType(null)
|
||||
|
||||
// setApprovaType(0)
|
||||
if (handleCencel) {
|
||||
handleCencel()
|
||||
}
|
||||
|
||||
setBUSINESSAPPROVALDETAIL(undefined)
|
||||
// setApproveCurrentRow(undefined)
|
||||
// setApproveModal(false)
|
||||
setNextApproval(null)
|
||||
setNextApprovalPerson(null)
|
||||
// actionRef.current?.reload()
|
||||
if (tableRef) {
|
||||
tableRef.current?.reload()
|
||||
}
|
||||
} else {
|
||||
message.error(data.Result_Desc)
|
||||
}
|
||||
|
||||
}}
|
||||
>
|
||||
{
|
||||
ApprovalType === 1 ?
|
||||
<Row>
|
||||
{
|
||||
nextApproval === 9000 ? '' :
|
||||
<Col span={6}>
|
||||
<ProFormSelect
|
||||
label={"下一阶段审批人"}
|
||||
name={"nextApproveStaffId"}
|
||||
options={nextApprovalPerson}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: "请选择下一阶段审批人!"
|
||||
}
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
|
||||
}
|
||||
<Col span={24}>
|
||||
<ProFormTextArea
|
||||
label={"审批意见"}
|
||||
name={"ApproveInfo"}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: "请输入审批意见!"
|
||||
}
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
</Row> : ApprovalType === 2 ?
|
||||
<Row>
|
||||
<Col span={6}>
|
||||
<ProFormSelect
|
||||
label={"驳回状态"}
|
||||
name={"nextApproveState"}
|
||||
options={nextApprovalPerson}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: "请选择下一阶段审批人!"
|
||||
}
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
|
||||
<Col span={24}>
|
||||
<ProFormTextArea
|
||||
label={"驳回意见"}
|
||||
name={"ApproveInfo"}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: "请输入驳回意见!"
|
||||
}
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
</Row> : ""
|
||||
}
|
||||
</ProForm> : ""
|
||||
}
|
||||
|
||||
<ProTable
|
||||
search={false}
|
||||
options={false}
|
||||
pagination={false}
|
||||
columns={modalColumns}
|
||||
dataSource={shopData}
|
||||
bordered
|
||||
toolbar={{
|
||||
actions: [
|
||||
parentRow?.BusinessProcess_State > 1000 || (parentRow?.BusinessApproval_ID && parentRow?.ApproveStaff_ID !== currentUser?.ID) ? '' : <Button type={"primary"} onClick={() => {
|
||||
setShowAddShopModal(true)
|
||||
}}>
|
||||
新增商品
|
||||
</Button>
|
||||
]
|
||||
}}
|
||||
/>
|
||||
|
||||
{
|
||||
parentRow?.BusinessProcess_State > 1000 ?
|
||||
<Card title="流程进度" bordered className="ProcessProgress">
|
||||
<div style={{ width: '100%' }} className="ProcessProgressBox">
|
||||
<Steps
|
||||
size="small"
|
||||
className="multi-line-steps"
|
||||
direction="horizontal"
|
||||
progressDot={false}
|
||||
current={BUSINESSAPPROVALDETAIL?.approveList && BUSINESSAPPROVALDETAIL?.approveList.length ? BUSINESSAPPROVALDETAIL?.approveList.length : 0}
|
||||
>
|
||||
{
|
||||
BUSINESSAPPROVALDETAIL?.approveList && BUSINESSAPPROVALDETAIL?.approveList.length > 0 ?
|
||||
BUSINESSAPPROVALDETAIL?.approveList.map((item: any, index: number) => (
|
||||
<Step
|
||||
key={index}
|
||||
style={{ minWidth: 180, maxWidth: 220 }}
|
||||
status={"finish"}
|
||||
title={item.APPROVED_NAME}
|
||||
description={
|
||||
<div>
|
||||
<Tooltip title={`${item.STAFF_NAME || ''}${item.APPLYAPPROVE_INFO ? `:${item.APPLYAPPROVE_INFO}` : ''}`}>
|
||||
<p>{`${item.APPLYAPPROVE_DATE || ''}`}</p>
|
||||
</Tooltip>
|
||||
</div>}
|
||||
/>
|
||||
)) : ''
|
||||
}
|
||||
|
||||
{
|
||||
nextStepsList && nextStepsList.length > 0 ?
|
||||
nextStepsList.map((item: any, index: number) => (
|
||||
<Step
|
||||
key={index}
|
||||
style={{ minWidth: 180, maxWidth: 220 }}
|
||||
status={item.status === 'process' ? 'process' : 'wait'}
|
||||
title={item.APPROVALROUTE_NAME}
|
||||
/>
|
||||
)) : ''
|
||||
}
|
||||
</Steps>
|
||||
</div>
|
||||
</Card>
|
||||
: ''
|
||||
}
|
||||
</Modal >
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default connect(({ user, }: ConnectState) => ({
|
||||
currentUser: user.currentUser,
|
||||
}))(NewApplicationModal);
|
||||
File diff suppressed because it is too large
Load Diff
@ -1064,6 +1064,12 @@ export function formatTreeData(
|
||||
percentFields.forEach((fieldPath) => {
|
||||
const value = getNestedValue(newNode, fieldPath);
|
||||
if (value !== undefined) {
|
||||
// 如果值是null,设置为空字符串
|
||||
if (value === null) {
|
||||
setNestedValue(newNode, fieldPath, '');
|
||||
return;
|
||||
}
|
||||
|
||||
const currentValueStr = String(value);
|
||||
|
||||
// 如果值后面还没有百分号,则添加
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user