update
This commit is contained in:
parent
4c7c8707ab
commit
7fe7fe34e3
@ -320,7 +320,7 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
|
||||
list.push({ label: item.label, value: item.value })
|
||||
obj[item.value] = item.label
|
||||
})
|
||||
session.set('CCOMMODITYNATUREList', list);
|
||||
session.set('COMMODITYNATUREList', list);
|
||||
session.set('COMMODITYNATUREObj', obj);
|
||||
session.set('COMMODITYNATURETree', COMMODITYNATURE);
|
||||
}
|
||||
|
||||
@ -2,9 +2,9 @@
|
||||
import { connect } from "umi";
|
||||
import type { CurrentUser } from "umi";
|
||||
import type { ConnectState } from "@/models/connect";
|
||||
import React, { useRef, useState } from "react";
|
||||
import React, { useEffect, useRef, useState } from "react";
|
||||
import type { FormInstance } from "antd";
|
||||
import { Button, Col, message, Modal, Popconfirm, Row, Space, Spin, Tree } from "antd";
|
||||
import { Button, Card, Col, message, Modal, Popconfirm, Row, Space, Spin, Steps, Tooltip, Tree } from "antd";
|
||||
import type { ActionType } from "@ant-design/pro-table";
|
||||
import ProTable from "@ant-design/pro-table";
|
||||
import PageTitleBox from "@/components/PageTitleBox";
|
||||
@ -16,8 +16,11 @@ import { handleGetNestingCOMMODITYTYPETree, handleGetServerpartShopTrade } from
|
||||
import { handleGetUSERDEFINEDTYPEList } from "../userDefinedType/service";
|
||||
import useRequest from "@ahooksjs/use-request";
|
||||
import moment from 'moment'
|
||||
import { handleApproveCommodityProInst, handleCreateCommodityProInst, handleGetBUSINESSAPPROVALDetail, handleGetCOMMODITYRUNNINGList, handleRejectCommodityProInst } from "../ProductApprovalProcess/service";
|
||||
import { handleApproveCommodityProInst, handleCreateCommodityProInst, handleDeleteCOMMODITY_RUNNING, handleDeleteCommodityProInst, handleGetApprovalCommodityList, handleGetBUSINESSAPPROVALDetail, handleGetCOMMODITYRUNNINGList, handleReapplyCommodityProInst, handleRejectCommodityProInst } from "../ProductApprovalProcess/service";
|
||||
import './style.less'
|
||||
|
||||
|
||||
const { Step } = Steps
|
||||
const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
const { currentUser } = props
|
||||
const downloadBtnRef = useRef<any>()
|
||||
@ -31,8 +34,10 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
const [showApplyFor, setShowApplyFor] = useState<boolean>(false);
|
||||
// 显示新增商品的悬浮框
|
||||
const [showAddShopModal, setShowAddShopModal] = useState<boolean>(false);
|
||||
// 选择的当前商品行
|
||||
// 选择记录行的数据
|
||||
const [currentRow, setCurrentRow] = useState<any>()
|
||||
// 选择商品行的数据
|
||||
const [currentShopRow, setCurrentShopRow] = useState<any>()
|
||||
// 商品列表数据
|
||||
const [shopData, setShopData] = useState<any>()
|
||||
const [selectSERVERPARTID, setSelectSERVERPARTID] = useState<any>()
|
||||
@ -55,6 +60,12 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
const [ApprovalType, setApprovaType] = useState<number>(0)
|
||||
// 审批记录详情
|
||||
const [BUSINESSAPPROVALDETAIL, setBUSINESSAPPROVALDETAIL] = useState<any>()
|
||||
// 还有几个环节 拼在流程进度后面
|
||||
const [nextStepsList, setNextStepsList] = useState<any>()
|
||||
// 判断有无发起申请的权限
|
||||
const [InitiateApplication, setInitiateApplication] = useState<boolean>(false)
|
||||
// 显示类型
|
||||
const [showDetailType, setShowDetailType] = useState<any>()
|
||||
// 加载服务区树
|
||||
const { loading: treeLoading, data: treeViews } = useRequest(async () => {
|
||||
const req = {
|
||||
@ -67,6 +78,7 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
return data
|
||||
})
|
||||
|
||||
let statusList: string[] = ["0", "1000", "2000", "2010,2020,2030,2040,2050,2060,2070,2080,2090", "9000"]
|
||||
const columns: any = [
|
||||
{
|
||||
dataIndex: 'BusinessProcess_StateSearch',
|
||||
@ -75,12 +87,20 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInTable: true,
|
||||
// valueEnum: {
|
||||
// "0": "全部",
|
||||
// "2000": "待审核",
|
||||
// "2010,2020,2030,2040,2050,2060,2070,2080,2090": "审核中",
|
||||
// "9000": "已审结"
|
||||
// },
|
||||
valueEnum: {
|
||||
"0": "全部",
|
||||
"2000": "待审核",
|
||||
"2010,2020,2030,2040,2050,2060,2070,2080,2090": "审核中",
|
||||
"9000": "已审结"
|
||||
0: "全部",
|
||||
1: "待申请",
|
||||
2: "待审核",
|
||||
3: "审核中",
|
||||
4: "已审结"
|
||||
},
|
||||
initialValue: "0"
|
||||
},
|
||||
{
|
||||
dataIndex: 'BusinessProcess_Name',
|
||||
@ -121,15 +141,27 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
render: (_, record) => {
|
||||
return <a style={{
|
||||
color: record?.BusinessProcess_StateText === '待审核' ? '#1890ff' :
|
||||
record?.BusinessProcess_StateText === '审核中' ? 'rgb(250, 173, 20)' :
|
||||
record?.BusinessProcess_StateText === '已审结' ? 'red' : ""
|
||||
}} onClick={() => {
|
||||
console.log('recordrecordrecord', record);
|
||||
setShowDetailType('detail')
|
||||
setCurrentRow(record)
|
||||
setShowApplyFor(true)
|
||||
}}>{record?.BusinessProcess_StateText || "-"}</a>
|
||||
}
|
||||
},
|
||||
{
|
||||
dataIndex: 'Accept_Code',
|
||||
title: '业务类别',
|
||||
width: 200,
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
// {
|
||||
// dataIndex: 'Accept_Code',
|
||||
// title: '业务类别',
|
||||
// width: 200,
|
||||
// ellipsis: true,
|
||||
// align: 'center',
|
||||
// hideInSearch: true,
|
||||
// },
|
||||
{
|
||||
dataIndex: 'BusinessProcess_EndDate',
|
||||
title: '办结时间',
|
||||
@ -152,7 +184,7 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
valueType: 'option',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
width: 120,
|
||||
width: 180,
|
||||
fixed: "right",
|
||||
ellipsis: true,
|
||||
render: (_, record) => {
|
||||
@ -163,29 +195,61 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
{
|
||||
record?.BusinessProcess_State === 1000
|
||||
?
|
||||
<a onClick={() => {
|
||||
setShowApplyFor(true)
|
||||
setCurrentRow(record)
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</a> : ""
|
||||
<>
|
||||
<a onClick={() => {
|
||||
console.log('recordrecordrecord', record);
|
||||
|
||||
setCurrentRow(record)
|
||||
setShowApplyFor(true)
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</a>
|
||||
<Popconfirm
|
||||
title="确认删除该商品审批流程吗?"
|
||||
onConfirm={async () => {
|
||||
const req: any = {
|
||||
businessApprovalId: record?.BusinessApproval_ID,
|
||||
UserId: currentUser?.ID
|
||||
}
|
||||
const data = await handleDeleteCommodityProInst(req)
|
||||
if (data.Result_Code === 100) {
|
||||
message.success(data.Result_Desc)
|
||||
actionRef.current?.reload()
|
||||
} else {
|
||||
message.error(data.Result_Desc)
|
||||
}
|
||||
}}
|
||||
>
|
||||
<a>删除</a>
|
||||
</Popconfirm>
|
||||
</>
|
||||
: ""
|
||||
}
|
||||
{
|
||||
record?.BusinessProcess_State > 1000 ?
|
||||
<>
|
||||
<a onClick={() => {
|
||||
setApprovaType(1)
|
||||
setCurrentRow(record)
|
||||
// setApproveCurrentRow(record)
|
||||
// setApproveModal(true)
|
||||
setShowApplyFor(true)
|
||||
}}
|
||||
>
|
||||
审批
|
||||
</a>
|
||||
<a onClick={() => {
|
||||
setApprovaType(2)
|
||||
setCurrentRow(record)
|
||||
// setApproveCurrentRow(record)
|
||||
// setApproveModal(true)
|
||||
setShowApplyFor(true)
|
||||
}}>
|
||||
驳回
|
||||
</a>
|
||||
</> : ""
|
||||
}
|
||||
<a onClick={() => {
|
||||
setApprovaType(1)
|
||||
setApproveCurrentRow(record)
|
||||
setApproveModal(true)
|
||||
}}
|
||||
>
|
||||
审批
|
||||
</a>
|
||||
<a onClick={() => {
|
||||
setApprovaType(2)
|
||||
setApproveCurrentRow(record)
|
||||
setApproveModal(true)
|
||||
}}>
|
||||
驳回
|
||||
</a>
|
||||
</Space> : ""
|
||||
|
||||
);
|
||||
@ -249,31 +313,65 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
render: (_, record) => {
|
||||
return (
|
||||
<Space>
|
||||
<a
|
||||
onClick={() => {
|
||||
setCurrentRow(record)
|
||||
setShowAddShopModal(true)
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</a>
|
||||
<Popconfirm
|
||||
title="确认删除该商品管理列表信息吗?"
|
||||
onConfirm={async () => {
|
||||
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)
|
||||
}
|
||||
})
|
||||
setShopData(list)
|
||||
{
|
||||
currentRow?.BusinessProcess_State > 1000 || (currentRow?.BusinessApproval_ID && currentRow?.ApproveStaff_ID !== currentUser?.ID) ? '' :
|
||||
<>
|
||||
<a
|
||||
onClick={() => {
|
||||
setCurrentShopRow(record)
|
||||
setShowAddShopModal(true)
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</a>
|
||||
<Popconfirm
|
||||
title="确认删除该商品管理列表信息吗?"
|
||||
onConfirm={async () => {
|
||||
if (currentRow?.BusinessApproval_ID) {
|
||||
// 申请回到发起时候的真删
|
||||
const req: any = {
|
||||
COMMODITY_RUNNINGId: record?.COMMODITY_ID
|
||||
}
|
||||
const data = await handleDeleteCOMMODITY_RUNNING(req)
|
||||
console.log('datadatadatadata', data);
|
||||
actionRef.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)
|
||||
}
|
||||
})
|
||||
setShopData(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)
|
||||
}
|
||||
})
|
||||
setShopData(list)
|
||||
}
|
||||
}}
|
||||
>
|
||||
<a>删除</a>
|
||||
</Popconfirm>
|
||||
</>
|
||||
}
|
||||
|
||||
{
|
||||
currentRow?.BusinessProcess_State === 9000 ?
|
||||
<a onClick={() => {
|
||||
setCurrentShopRow(record)
|
||||
setShowAddShopModal(true)
|
||||
}}>详情</a>
|
||||
: ''
|
||||
}
|
||||
|
||||
}}
|
||||
>
|
||||
<a>删除</a>
|
||||
</Popconfirm>
|
||||
</Space>
|
||||
);
|
||||
},
|
||||
@ -315,6 +413,37 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
}
|
||||
|
||||
|
||||
useEffect(async () => {
|
||||
const req: any = {
|
||||
SearchParameter: {
|
||||
APPROVALROUTE_STATES: "",
|
||||
APPROVALROUTE_VALID: 1,
|
||||
OPERATION_TYPES: "100100",
|
||||
}
|
||||
}
|
||||
const data = await handleGetAPPROVALROUTEList(req)
|
||||
console.log('datadatadatadata', data);
|
||||
// 拿到发起申请的人
|
||||
let firstSetp: any = {}
|
||||
if (data && data.length > 0) {
|
||||
data.forEach((item: any) => {
|
||||
if (item.APPROVALROUTE_STATE === 1000) {
|
||||
firstSetp = item
|
||||
}
|
||||
})
|
||||
}
|
||||
// 判断当前用户 是否有新增权限
|
||||
let have: boolean = false
|
||||
let idList: any = firstSetp.APPROVALSTAFF_ID.split(',')
|
||||
console.log('idList', idList);
|
||||
|
||||
if (idList.indexOf(currentUser?.ID.toString()) !== -1) {
|
||||
have = true
|
||||
}
|
||||
setInitiateApplication(have)
|
||||
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div style={{ backgroundColor: '#fff', display: 'flex' }}>
|
||||
@ -341,7 +470,7 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
SearchParameter: {
|
||||
Operation_Type: 6,
|
||||
Accept_Code: "6-100100",
|
||||
BusinessProcess_StateSearch: params?.BusinessProcess_StateSearch === 0 ? '' : params?.BusinessProcess_StateSearch
|
||||
BusinessProcess_StateSearch: statusList[params?.BusinessProcess_StateSearch] === "0" ? '' : statusList[params?.BusinessProcess_StateSearch]
|
||||
},
|
||||
PageIndex: 1,
|
||||
PageSize: 999999
|
||||
@ -351,7 +480,7 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
if (data.data && data.data.length > 0) {
|
||||
data.data.forEach((item: any) => {
|
||||
if (item.BusinessProcess_State === 1000) {
|
||||
item.BusinessProcess_StateText = "待审核"
|
||||
item.BusinessProcess_StateText = "待发起"
|
||||
} else if (item.BusinessProcess_State === 2000) {
|
||||
item.BusinessProcess_StateText = "待审核"
|
||||
} else if (item.BusinessProcess_State > 2000 && item.BusinessProcess_State < 9000) {
|
||||
@ -368,11 +497,12 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
}}
|
||||
toolbar={{
|
||||
actions: [
|
||||
<Button type={"primary"} onClick={() => {
|
||||
setShowApplyFor(true)
|
||||
}}>
|
||||
新增商品申请
|
||||
</Button>
|
||||
InitiateApplication ?
|
||||
<Button type={"primary"} onClick={() => {
|
||||
setShowApplyFor(true)
|
||||
}}>
|
||||
新增商品申请
|
||||
</Button> : ""
|
||||
]
|
||||
}}
|
||||
/>
|
||||
@ -380,7 +510,7 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
</div>
|
||||
|
||||
{/* 审批的悬浮框 */}
|
||||
<Modal
|
||||
{/* <Modal
|
||||
width={"70%"}
|
||||
title={"审批"}
|
||||
open={approveModal}
|
||||
@ -566,12 +696,13 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
</Row> : ""
|
||||
}
|
||||
</ProForm>
|
||||
</Modal>
|
||||
</Modal> */}
|
||||
|
||||
{/* 新增申请的悬浮框 */}
|
||||
<Modal
|
||||
className="addProductModal"
|
||||
width={"70%"}
|
||||
title={"新增商品申请"}
|
||||
title={currentRow?.BusinessApproval_ID ? "商品申请详情" : "新增商品申请"}
|
||||
open={showApplyFor}
|
||||
destroyOnClose
|
||||
onCancel={() => {
|
||||
@ -579,12 +710,46 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
setCurrentRow(undefined)
|
||||
setShopData([])
|
||||
setBUSINESSAPPROVALDETAIL(undefined)
|
||||
}}
|
||||
onOk={() => {
|
||||
formRef?.current?.validateFields().then(() => {
|
||||
modalFormRef?.current?.submit()
|
||||
})
|
||||
setShowDetailType(null)
|
||||
|
||||
|
||||
setApprovaType(0)
|
||||
}}
|
||||
footer={showDetailType === 'detail' || !InitiateApplication || (currentRow?.BusinessApproval_ID && currentRow?.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={() => {
|
||||
setShowApplyFor(false)
|
||||
setCurrentRow(undefined)
|
||||
setShopData([])
|
||||
setBUSINESSAPPROVALDETAIL(undefined)
|
||||
setShowDetailType(null)
|
||||
|
||||
|
||||
setApprovaType(0)
|
||||
}}>取消</Button>
|
||||
|
||||
<Button type={"primary"} onClick={() => {
|
||||
if (currentRow?.BusinessProcess_State > 1000) {
|
||||
modalApproveFormRef?.current?.validateFields().then(() => {
|
||||
modalApproveFormRef?.current?.submit()
|
||||
})
|
||||
} else {
|
||||
modalFormRef?.current?.validateFields().then(() => {
|
||||
modalFormRef?.current?.submit()
|
||||
})
|
||||
}
|
||||
}}>确认</Button>
|
||||
</div>}
|
||||
onOk={() => {
|
||||
if (currentRow?.BusinessProcess_State > 1000) {
|
||||
modalApproveFormRef?.current?.validateFields().then(() => {
|
||||
modalApproveFormRef?.current?.submit()
|
||||
})
|
||||
} else {
|
||||
modalFormRef?.current?.validateFields().then(() => {
|
||||
modalFormRef?.current?.submit()
|
||||
})
|
||||
}
|
||||
}}
|
||||
>
|
||||
<ProForm
|
||||
@ -601,13 +766,27 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
console.log('datadatadata', data);
|
||||
setBUSINESSAPPROVALDETAIL(data.Result_Data)
|
||||
|
||||
const shopData = await handleGetCOMMODITYRUNNINGList({
|
||||
SearchParameter: {
|
||||
BUSINESSAPPROVAL_ID: currentRow?.BusinessApproval_ID,
|
||||
},
|
||||
PageIndex: 1,
|
||||
pageSize: 999999,
|
||||
})
|
||||
let shopData: any = []
|
||||
|
||||
if (currentRow?.BusinessProcess_State === 9000) {
|
||||
shopData = await handleGetApprovalCommodityList({
|
||||
ProvinceCode: currentUser?.ProvinceCode,
|
||||
// CommodityId: currentUser?.ProvinceCode,
|
||||
BusinessApprovalId: currentRow?.BusinessApproval_ID,
|
||||
PageIndex: 1,
|
||||
PageSize: 999999,
|
||||
})
|
||||
} else {
|
||||
shopData = await handleGetCOMMODITYRUNNINGList({
|
||||
SearchParameter: {
|
||||
BUSINESSAPPROVAL_ID: currentRow?.BusinessApproval_ID,
|
||||
},
|
||||
PageIndex: 1,
|
||||
pageSize: 999999,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
console.log('shopDatashopDatashopDatashopData', shopData);
|
||||
setShopData(shopData.Result_Data.List)
|
||||
return {
|
||||
@ -616,31 +795,54 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
NextApproveStaffId: data.Result_Data.APPOVED_IDS
|
||||
}
|
||||
} else {
|
||||
return false
|
||||
return {}
|
||||
}
|
||||
}}
|
||||
onFinish={async (res) => {
|
||||
const req: any = {
|
||||
ProinstName: res.reasonForApplication,
|
||||
UserId: currentUser?.ID,
|
||||
OperateType: "100100",
|
||||
ServerpartId: res.ServerpartId,
|
||||
NextApproveStaffId: res.NextApproveStaffId,
|
||||
NextApproveState: 2000,
|
||||
CommodityRunningList: shopData
|
||||
let data: any = {}
|
||||
if (currentRow?.BusinessApproval_ID) {
|
||||
const req: any = {
|
||||
ProinstId: currentRow?.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);
|
||||
}
|
||||
const data = await handleCreateCommodityProInst(req)
|
||||
console.log('dsaidjaskda', data);
|
||||
if (data.Result_Code === 100) {
|
||||
message.success(data.Result_Desc)
|
||||
// setShowApplyFor(false)
|
||||
// setCurrentRow(undefined)
|
||||
setShowApplyFor(false)
|
||||
setCurrentRow(undefined)
|
||||
setShopData([])
|
||||
setBUSINESSAPPROVALDETAIL(undefined)
|
||||
setShowDetailType(null)
|
||||
setApprovaType(0)
|
||||
actionRef.current?.reload()
|
||||
|
||||
} else {
|
||||
message.error(data.Result_Desc)
|
||||
}
|
||||
|
||||
|
||||
|
||||
}}
|
||||
>
|
||||
<Row gutter={8}>
|
||||
@ -652,6 +854,7 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
required: true,
|
||||
message: "请输入申请原因!"
|
||||
}]}
|
||||
disabled={currentRow?.BusinessProcess_State > 1000 || (currentRow?.BusinessApproval_ID && currentRow?.ApproveStaff_ID !== currentUser?.ID)}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
@ -679,9 +882,10 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
}
|
||||
return list
|
||||
}}
|
||||
disabled={currentRow?.BusinessProcess_State > 1000 || (currentRow?.BusinessApproval_ID && currentRow?.ApproveStaff_ID !== currentUser?.ID)}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Col span={12} style={{ display: currentRow?.BusinessProcess_State > 1000 && ApprovalType !== 0 ? "none" : "" }}>
|
||||
<ProFormSelect
|
||||
label="下一环节审批人"
|
||||
name="NextApproveStaffId"
|
||||
@ -702,13 +906,24 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
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 >= currentRow?.BusinessProcess_State) {
|
||||
if (item.APPROVALROUTE_STATE === currentRow?.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(',')
|
||||
@ -721,30 +936,268 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
}
|
||||
}
|
||||
}}
|
||||
disabled={currentRow?.BusinessProcess_State > 1000 || (currentRow?.BusinessApproval_ID && currentRow?.ApproveStaff_ID !== currentUser?.ID)}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
|
||||
<ProTable
|
||||
search={false}
|
||||
options={false}
|
||||
pagination={false}
|
||||
columns={modalColumns}
|
||||
dataSource={shopData}
|
||||
bordered
|
||||
toolbar={{
|
||||
actions: [
|
||||
<Button type={"primary"} onClick={() => {
|
||||
setShowAddShopModal(true)
|
||||
}}>
|
||||
新增商品
|
||||
</Button>
|
||||
]
|
||||
}}
|
||||
/>
|
||||
</ProForm>
|
||||
{
|
||||
currentRow?.BusinessProcess_State > 1000 ?
|
||||
<ProForm
|
||||
// layout={'horizontal'}
|
||||
formRef={modalApproveFormRef}
|
||||
submitter={false}
|
||||
preserve={false}
|
||||
request={async () => {
|
||||
console.log('approveCurrentRowapproveCurrentRowapproveCurrentRow', approveCurrentRow);
|
||||
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 === currentRow.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)
|
||||
let data: any = {}
|
||||
|
||||
if (ApprovalType === 1) {
|
||||
// 审批
|
||||
const req: any = {
|
||||
businessApprovalId: currentRow?.BusinessApproval_ID,
|
||||
UserId: currentUser?.ID,
|
||||
ApproveInfo: res.ApproveInfo,
|
||||
nextApproveStaffId: res.nextApproveStaffId || "",
|
||||
nextApproveState: nextApproval || ""
|
||||
}
|
||||
|
||||
data = await handleApproveCommodityProInst(req)
|
||||
} else {
|
||||
// 驳回
|
||||
const req: any = {
|
||||
businessApprovalId: currentRow?.BusinessApproval_ID,
|
||||
UserId: currentUser?.ID,
|
||||
RejectInfo: res.ApproveInfo,
|
||||
nextApproveState: res.nextApproveState || ""
|
||||
}
|
||||
console.log('reqreqreqreq', req);
|
||||
|
||||
data = await handleRejectCommodityProInst(req)
|
||||
}
|
||||
setAddApprovalLoading(false)
|
||||
console.log('datadatadata', data);
|
||||
if (data.Result_Code === 100) {
|
||||
message.success(data.Result_Desc)
|
||||
|
||||
setShowApplyFor(false)
|
||||
setCurrentRow(undefined)
|
||||
setShopData([])
|
||||
setBUSINESSAPPROVALDETAIL(undefined)
|
||||
setShowDetailType(null)
|
||||
|
||||
|
||||
// setApproveCurrentRow(undefined)
|
||||
// setApproveModal(false)
|
||||
setNextApproval(null)
|
||||
setNextApprovalPerson(null)
|
||||
setApprovaType(0)
|
||||
actionRef.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: [
|
||||
currentRow?.BusinessProcess_State > 1000 || (currentRow?.BusinessApproval_ID && currentRow?.ApproveStaff_ID !== currentUser?.ID) ? '' : <Button type={"primary"} onClick={() => {
|
||||
setShowAddShopModal(true)
|
||||
}}>
|
||||
新增商品
|
||||
</Button>
|
||||
]
|
||||
}}
|
||||
/>
|
||||
|
||||
{
|
||||
currentRow?.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}
|
||||
>
|
||||
{/* <Step
|
||||
style={{ minWidth: 180, maxWidth: 220 }}
|
||||
status={currentRow?.BusinessProcess_State > 1000 ? 'finish' : 'wait'}
|
||||
title="发起申请"
|
||||
description={
|
||||
<div>
|
||||
<Tooltip title={`${currentRow?.Staff_Name || ''}${currentRow?.BusinessProcess_Desc ? `:${currentRow?.BusinessProcess_Desc}` : ''}`}>
|
||||
<p>{`${currentRow?.BusinessProcess_StartDate || ''}`}</p>
|
||||
</Tooltip>
|
||||
</div>
|
||||
}
|
||||
/> */}
|
||||
{
|
||||
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>
|
||||
|
||||
{/* 新增商品的悬浮框 */}
|
||||
@ -753,43 +1206,66 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
width={1200}
|
||||
wrapClassName={'shopModal'}
|
||||
destroyOnClose
|
||||
title={currentRow ? '编辑商品' : '添加商品'}
|
||||
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) {
|
||||
newList.push(res)
|
||||
same = true
|
||||
newList.push({
|
||||
...item,
|
||||
...res
|
||||
})
|
||||
} else {
|
||||
newList.push(item)
|
||||
}
|
||||
})
|
||||
if (!same) {
|
||||
newList.push(res)
|
||||
}
|
||||
|
||||
} else {
|
||||
newList.push(res)
|
||||
}
|
||||
console.log('newList', newList);
|
||||
|
||||
|
||||
setShopData(newList)
|
||||
setShowAddShopModal(false)
|
||||
setCommodityList([])
|
||||
setCustomClassList([])
|
||||
setCurrentRow(undefined)
|
||||
setCurrentShopRow(undefined)
|
||||
})
|
||||
}}
|
||||
onCancel={() => {
|
||||
setShowAddShopModal(false)
|
||||
setCommodityList([])
|
||||
setCustomClassList([])
|
||||
setCurrentRow(undefined)
|
||||
setCurrentShopRow(undefined)
|
||||
}}
|
||||
>
|
||||
|
||||
<ProForm
|
||||
formRef={modalShopFormRef}
|
||||
submitter={false}
|
||||
initialValues={currentRow}
|
||||
initialValues={currentShopRow}
|
||||
request={async () => {
|
||||
// !currentShopRow?.COMMODITY_ID &&
|
||||
if (currentShopRow?.SERVERPART_ID) {
|
||||
await handleGetCommodity(currentShopRow?.SERVERPART_ID)
|
||||
}
|
||||
return { ...currentShopRow, BUSINESSTYPE: currentShopRow?.BUSINESSTYPE.toString() }
|
||||
}}
|
||||
disabled={currentRow?.BusinessProcess_State === 9000}
|
||||
>
|
||||
<div className={'modalTitle'}>商品基本信息</div>
|
||||
<Row gutter={16}>
|
||||
|
||||
@ -0,0 +1,16 @@
|
||||
.addProductModal {
|
||||
.ant-modal-content {
|
||||
.ant-modal-body {
|
||||
.ProcessProgress {
|
||||
.ant-card-body {
|
||||
.ProcessProgressBox {
|
||||
.multi-line-steps {
|
||||
flex-wrap: wrap !important;
|
||||
display: flex !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -6,7 +6,7 @@ import React, { useEffect, useRef, useState } from "react";
|
||||
import ProCard from "@ant-design/pro-card";
|
||||
import { MenuFoldOutlined } from "@ant-design/icons";
|
||||
import type { FormInstance } from "antd";
|
||||
import { Button, message, Space, Spin, Tree } from "antd";
|
||||
import { Button, Card, Col, message, Modal, Row, Space, Spin, Steps, Tooltip, Tree } from "antd";
|
||||
import useRequest from "@ahooksjs/use-request";
|
||||
import { getServerpartTree } from "@/services/options";
|
||||
import type { ActionType } from "@ant-design/pro-table";
|
||||
@ -16,11 +16,15 @@ import LeftSelectTree from "@/pages/reports/settlementAccount/component/leftSele
|
||||
import PageTitleBox from "@/components/PageTitleBox";
|
||||
import { handleGetExamineList } from "@/pages/examine/examineList/service";
|
||||
import { handleGetAPPROVALROUTEList } from "@/pages/Setting/serviceConfig/service";
|
||||
import ProForm, { ProFormSelect, ProFormTextArea } from "@ant-design/pro-form";
|
||||
import { handleGetApprovalCommodityList, handleGetBUSINESSAPPROVALDetail, handleGetCOMMODITYRUNNINGList } from "./service";
|
||||
import './style.less'
|
||||
|
||||
|
||||
const { Step } = Steps
|
||||
const ProductApprovalProcess: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
const { currentUser } = props
|
||||
const actionRef = useRef<ActionType>();
|
||||
const modalFormRef = useRef<FormInstance>();
|
||||
const formRef = useRef<FormInstance>();
|
||||
const [reqDetailList, setReqDetailList] = useState<any>(); // 合计项数据源
|
||||
const [printOut, setPrintOut] = useState<any>(); // 打印数据的内容
|
||||
@ -30,10 +34,27 @@ const ProductApprovalProcess: React.FC<{ currentUser: CurrentUser }> = (props) =
|
||||
const [currentExamine, setCurrentExamine] = useState<any>()
|
||||
// 判断当前用户是否有发起按钮
|
||||
const [currentShowInitiate, setCurrentShowInitiate] = useState<boolean>(false)
|
||||
// 选择的当前商品行
|
||||
const [currentRow, setCurrentRow] = useState<any>()
|
||||
// 新增商品申请
|
||||
const [showApplyFor, setShowApplyFor] = useState<boolean>(false);
|
||||
// 商品列表数据
|
||||
const [shopData, setShopData] = useState<any>()
|
||||
// 选中的行数据
|
||||
const [selectRowList, setSelectRowList] = useState<any>()
|
||||
// 选中的行
|
||||
const [selectedOrderRowKeys, setSelectedOrderRowKeys] = useState<any>()
|
||||
// 显示类型
|
||||
const [showDetailType, setShowDetailType] = useState<any>()
|
||||
// 审批记录详情
|
||||
const [BUSINESSAPPROVALDETAIL, setBUSINESSAPPROVALDETAIL] = useState<any>()
|
||||
// 还有几个环节 拼在流程进度后面
|
||||
const [nextStepsList, setNextStepsList] = useState<any>()
|
||||
|
||||
useEffect(async () => {
|
||||
await handleChangeType("6-100100")
|
||||
}, [])
|
||||
let statusList: string[] = ["0", "1000", "2000", "2010,2020,2030,2040,2050,2060,2070,2080,2090", "9000"]
|
||||
|
||||
const columns: any = [
|
||||
{
|
||||
@ -49,7 +70,7 @@ const ProductApprovalProcess: React.FC<{ currentUser: CurrentUser }> = (props) =
|
||||
"6-100200": "商品调价流程",
|
||||
"6-100210": "信息修改流程"
|
||||
},
|
||||
initialValue: "6-100100",
|
||||
initialValue: "0",
|
||||
},
|
||||
{
|
||||
dataIndex: 'BusinessProcess_StateSearch',
|
||||
@ -59,11 +80,13 @@ const ProductApprovalProcess: React.FC<{ currentUser: CurrentUser }> = (props) =
|
||||
align: 'center',
|
||||
hideInTable: true,
|
||||
valueEnum: {
|
||||
"0": "全部",
|
||||
"2000": "待审核",
|
||||
"2010,2020,2030,2040,2050,2060,2070,2080,2090": "审核中",
|
||||
"9000": "已审结"
|
||||
0: "全部",
|
||||
1: "待申请",
|
||||
2: "待审核",
|
||||
3: "审核中",
|
||||
4: "已审结"
|
||||
},
|
||||
initialValue: "0"
|
||||
},
|
||||
{
|
||||
dataIndex: 'BusinessProcess_Name',
|
||||
@ -72,6 +95,12 @@ const ProductApprovalProcess: React.FC<{ currentUser: CurrentUser }> = (props) =
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
render: (_, record) => {
|
||||
return <a onClick={() => {
|
||||
setCurrentRow(record)
|
||||
setShowApplyFor(true)
|
||||
}}>{record?.BusinessProcess_Name}</a>
|
||||
}
|
||||
},
|
||||
{
|
||||
dataIndex: 'Serverpart_Name',
|
||||
@ -104,6 +133,18 @@ const ProductApprovalProcess: React.FC<{ currentUser: CurrentUser }> = (props) =
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
render: (_, record) => {
|
||||
return <a style={{
|
||||
color: record?.BusinessProcess_StateText === '待审核' ? '#1890ff' :
|
||||
record?.BusinessProcess_StateText === '审核中' ? 'rgb(250, 173, 20)' :
|
||||
record?.BusinessProcess_StateText === '已审结' ? 'red' : ""
|
||||
}} onClick={() => {
|
||||
console.log('recordrecordrecord', record);
|
||||
setShowDetailType('detail')
|
||||
setCurrentRow(record)
|
||||
setShowApplyFor(true)
|
||||
}}>{record?.BusinessProcess_StateText || "-"}</a>
|
||||
}
|
||||
},
|
||||
{
|
||||
dataIndex: 'Accept_Code',
|
||||
@ -112,6 +153,12 @@ const ProductApprovalProcess: React.FC<{ currentUser: CurrentUser }> = (props) =
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
valueType: "select",
|
||||
valueEnum: {
|
||||
"6-100100": "新增商品审批",
|
||||
"6-100200": "商品调价审批",
|
||||
"6-100210": "商品信息修改审批"
|
||||
},
|
||||
},
|
||||
{
|
||||
dataIndex: 'BusinessProcess_EndDate',
|
||||
@ -131,6 +178,52 @@ const ProductApprovalProcess: React.FC<{ currentUser: CurrentUser }> = (props) =
|
||||
},
|
||||
]
|
||||
|
||||
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',
|
||||
},
|
||||
]
|
||||
|
||||
// 修改审批类型
|
||||
const handleChangeType = async (type: string) => {
|
||||
// 查出当前类型里面的流程数据
|
||||
@ -189,7 +282,7 @@ const ProductApprovalProcess: React.FC<{ currentUser: CurrentUser }> = (props) =
|
||||
SearchParameter: {
|
||||
Operation_Type: 6,
|
||||
Accept_Code: params?.searchType === "0" ? '' : params?.searchType,
|
||||
BusinessProcess_StateSearch: params?.BusinessProcess_StateSearch === 0 ? '' : params?.BusinessProcess_StateSearch
|
||||
BusinessProcess_StateSearch: statusList[params?.BusinessProcess_StateSearch] === "0" ? '' : statusList[params?.BusinessProcess_StateSearch]
|
||||
},
|
||||
PageIndex: 1,
|
||||
PageSize: 999999
|
||||
@ -198,7 +291,9 @@ const ProductApprovalProcess: React.FC<{ currentUser: CurrentUser }> = (props) =
|
||||
console.log('data', data)
|
||||
if (data.data && data.data.length > 0) {
|
||||
data.data.forEach((item: any) => {
|
||||
if (item.BusinessProcess_State === 2000) {
|
||||
if (item.BusinessProcess_State === 1000) {
|
||||
item.BusinessProcess_StateText = "待发起"
|
||||
} else if (item.BusinessProcess_State === 2000) {
|
||||
item.BusinessProcess_StateText = "待审核"
|
||||
} else if (item.BusinessProcess_State > 2000 && item.BusinessProcess_State < 9000) {
|
||||
item.BusinessProcess_StateText = "审核中"
|
||||
@ -219,6 +314,235 @@ const ProductApprovalProcess: React.FC<{ currentUser: CurrentUser }> = (props) =
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<Modal
|
||||
className="addProductModal"
|
||||
width={"70%"}
|
||||
title={currentRow?.BusinessApproval_ID ? "商品信息修改详情" : "新增商品信息修改申请"}
|
||||
open={showApplyFor}
|
||||
destroyOnClose
|
||||
onCancel={() => {
|
||||
setShowApplyFor(false)
|
||||
setCurrentRow(undefined)
|
||||
setShopData([])
|
||||
setSelectRowList([])
|
||||
setSelectedOrderRowKeys([])
|
||||
setShowDetailType(null)
|
||||
}}
|
||||
footer={false}
|
||||
>
|
||||
<ProForm
|
||||
// layout={'horizontal'}
|
||||
formRef={modalFormRef}
|
||||
submitter={false}
|
||||
preserve={false}
|
||||
request={async () => {
|
||||
if (currentRow?.BusinessApproval_ID) {
|
||||
const req: any = {
|
||||
BUSINESSAPPROVALId: currentRow?.BusinessApproval_ID,
|
||||
}
|
||||
const data = await handleGetBUSINESSAPPROVALDetail(req)
|
||||
console.log('datadatadata', data);
|
||||
setBUSINESSAPPROVALDETAIL(data.Result_Data)
|
||||
let shopData: any = []
|
||||
if (currentRow?.BusinessProcess_State === 9000) {
|
||||
shopData = await handleGetApprovalCommodityList({
|
||||
ProvinceCode: currentUser?.ProvinceCode,
|
||||
// CommodityId: currentUser?.ProvinceCode,
|
||||
BusinessApprovalId: currentRow?.BusinessApproval_ID,
|
||||
PageIndex: 1,
|
||||
PageSize: 999999,
|
||||
})
|
||||
} else {
|
||||
shopData = await handleGetCOMMODITYRUNNINGList({
|
||||
SearchParameter: {
|
||||
BUSINESSAPPROVAL_ID: currentRow?.BusinessApproval_ID,
|
||||
},
|
||||
PageIndex: 1,
|
||||
pageSize: 999999,
|
||||
})
|
||||
}
|
||||
setShopData(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 {}
|
||||
}
|
||||
}}
|
||||
|
||||
>
|
||||
<Row gutter={8}>
|
||||
<Col span={24}>
|
||||
<ProFormTextArea
|
||||
label="申请原因"
|
||||
name="reasonForApplication"
|
||||
rules={[{
|
||||
required: true,
|
||||
message: "请输入申请原因!"
|
||||
}]}
|
||||
disabled={currentRow?.BusinessProcess_State > 1000 || (currentRow?.BusinessApproval_ID && currentRow?.ApproveStaff_ID !== currentUser?.ID)}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<ProFormSelect
|
||||
label="服务区"
|
||||
name="ServerpartId"
|
||||
rules={[{
|
||||
required: true,
|
||||
message: "请选择服务区!"
|
||||
}]}
|
||||
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
|
||||
}}
|
||||
disabled={currentRow?.BusinessProcess_State > 1000 || (currentRow?.BusinessApproval_ID && currentRow?.ApproveStaff_ID !== currentUser?.ID)}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12} style={{ display: currentRow?.BusinessProcess_State > 1000 ? "none" : "" }}>
|
||||
<ProFormSelect
|
||||
label="下一环节审批人"
|
||||
name="NextApproveStaffId"
|
||||
rules={[{
|
||||
required: true,
|
||||
message: "请选择下一环节审批人!"
|
||||
}]}
|
||||
request={async () => {
|
||||
const reqState: any = {
|
||||
SearchParameter: {
|
||||
APPROVALROUTE_STATES: "",
|
||||
APPROVALROUTE_VALID: 1,
|
||||
OPERATION_TYPES: "100210",
|
||||
},
|
||||
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 >= currentRow?.BusinessProcess_State) {
|
||||
if (item.APPROVALROUTE_STATE === currentRow?.BusinessProcess_State) {
|
||||
item.status = "process"
|
||||
}
|
||||
nextList.push(item)
|
||||
}
|
||||
})
|
||||
|
||||
setNextStepsList(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={currentRow?.BusinessProcess_State > 1000 || (currentRow?.BusinessApproval_ID && currentRow?.ApproveStaff_ID !== currentUser?.ID)}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
</ProForm>
|
||||
|
||||
<ProTable
|
||||
search={false}
|
||||
options={false}
|
||||
pagination={false}
|
||||
columns={modalColumns}
|
||||
dataSource={shopData}
|
||||
bordered
|
||||
toolbar={{
|
||||
actions: [
|
||||
currentRow?.BusinessProcess_State > 1000 || (currentRow?.BusinessApproval_ID && currentRow?.ApproveStaff_ID !== currentUser?.ID) ? '' : <Button type={"primary"} onClick={() => {
|
||||
// 判断服务区是否已选择
|
||||
const values = modalFormRef.current?.getFieldsValue();
|
||||
if (!values?.ServerpartId) {
|
||||
message.error("请先选择服务区!");
|
||||
return;
|
||||
}
|
||||
setShowAddShopModal(true);
|
||||
}}>
|
||||
选择商品
|
||||
</Button>
|
||||
]
|
||||
}}
|
||||
/>
|
||||
|
||||
{
|
||||
currentRow?.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 >
|
||||
)
|
||||
}
|
||||
|
||||
@ -17,6 +17,23 @@ export async function handleCreateCommodityProInst(params?: any) {
|
||||
return data;
|
||||
}
|
||||
|
||||
// 重新发起审批流程
|
||||
export async function handleReapplyCommodityProInst(params?: any) {
|
||||
const data = await request('/BusinessProcess/ReapplyCommodityProInst', {
|
||||
method: 'POST',
|
||||
data: {
|
||||
...params,
|
||||
requestEncryption: true
|
||||
},
|
||||
})
|
||||
|
||||
if (data.Result_Code !== 100) {
|
||||
return data
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
// 审核服务区商品审批流程
|
||||
export async function handleApproveCommodityProInst(params?: any) {
|
||||
const data = await request('/BusinessProcess/ApproveCommodityProInst', {
|
||||
@ -80,3 +97,69 @@ export async function handleGetCOMMODITYRUNNINGList(params?: any) {
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
// 获取办结之后的商品
|
||||
export async function handleGetApprovalCommodityList(params?: any) {
|
||||
const data = await request('/Commodity/GetApprovalCommodityList', {
|
||||
method: 'POST',
|
||||
data: {
|
||||
...params,
|
||||
requestEncryption: true
|
||||
},
|
||||
})
|
||||
|
||||
if (data.Result_Code !== 100) {
|
||||
return data;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
// 删除商品审批流程
|
||||
export async function handleDeleteCommodityProInst(params?: any) {
|
||||
const data = await request('/BusinessProcess/DeleteCommodityProInst', {
|
||||
method: 'POST',
|
||||
data: {
|
||||
...params,
|
||||
requestEncryption: true
|
||||
},
|
||||
})
|
||||
|
||||
if (data.Result_Code !== 100) {
|
||||
return data;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
// 同步编辑申请流程时的商品
|
||||
export async function handleSynchroCOMMODITY_RUNNING(params?: any) {
|
||||
const data = await request('/Commodity/SynchroCOMMODITY_RUNNING', {
|
||||
method: 'POST',
|
||||
data: {
|
||||
...params,
|
||||
requestEncryption: true
|
||||
},
|
||||
})
|
||||
|
||||
if (data.Result_Code !== 100) {
|
||||
return data;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
// 删除审批过程中的商品
|
||||
export async function handleDeleteCOMMODITY_RUNNING(params?: any) {
|
||||
const data = await request('/Commodity/DeleteCOMMODITY_RUNNING', {
|
||||
method: 'POST',
|
||||
data: {
|
||||
...params,
|
||||
requestEncryption: true
|
||||
},
|
||||
})
|
||||
|
||||
if (data.Result_Code !== 100) {
|
||||
return data;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,16 @@
|
||||
.addProductModal {
|
||||
.ant-modal-content {
|
||||
.ant-modal-body {
|
||||
.ProcessProgress {
|
||||
.ant-card-body {
|
||||
.ProcessProgressBox {
|
||||
.multi-line-steps {
|
||||
flex-wrap: wrap !important;
|
||||
display: flex !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3,9 +3,9 @@
|
||||
import { connect } from "umi";
|
||||
import type { CurrentUser } from "umi";
|
||||
import type { ConnectState } from "@/models/connect";
|
||||
import React, { useRef, useState } from "react";
|
||||
import React, { useEffect, useRef, useState } from "react";
|
||||
import type { FormInstance } from "antd";
|
||||
import { Button, Col, message, Modal, Popconfirm, Row, Space, Spin, Tree } from "antd";
|
||||
import { Button, Card, Col, message, Modal, Popconfirm, Row, Space, Spin, Steps, Tooltip, Tree } from "antd";
|
||||
import type { ActionType } from "@ant-design/pro-table";
|
||||
import ProTable from "@ant-design/pro-table";
|
||||
import PageTitleBox from "@/components/PageTitleBox";
|
||||
@ -17,9 +17,11 @@ import { handleGetCommodityList, handleGetNestingCOMMODITYTYPETree, handleGetSer
|
||||
import { handleGetUSERDEFINEDTYPEList } from "../userDefinedType/service";
|
||||
import useRequest from "@ahooksjs/use-request";
|
||||
import moment from 'moment'
|
||||
import { handleApproveCommodityProInst, handleCreateCommodityProInst, handleRejectCommodityProInst } from "../ProductApprovalProcess/service";
|
||||
import { handleApproveCommodityProInst, handleCreateCommodityProInst, handleDeleteCOMMODITY_RUNNING, handleDeleteCommodityProInst, handleGetApprovalCommodityList, handleGetBUSINESSAPPROVALDetail, handleGetCOMMODITYRUNNINGList, handleReapplyCommodityProInst, handleRejectCommodityProInst } from "../ProductApprovalProcess/service";
|
||||
import session from "@/utils/session";
|
||||
import './style.less'
|
||||
|
||||
const { Step } = Steps
|
||||
const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
const { currentUser } = props
|
||||
const downloadBtnRef = useRef<any>()
|
||||
@ -66,6 +68,14 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
const [editSelectRow, setEditSelectRow] = useState<any>()
|
||||
// 新增申请的加载效果
|
||||
const [handleAddLoading, setHandleAddLoading] = useState<boolean>(false);
|
||||
// 审批记录详情
|
||||
const [BUSINESSAPPROVALDETAIL, setBUSINESSAPPROVALDETAIL] = useState<any>()
|
||||
// 还有几个环节 拼在流程进度后面
|
||||
const [nextStepsList, setNextStepsList] = useState<any>()
|
||||
// 判断有无发起申请的权限
|
||||
const [InitiateApplication, setInitiateApplication] = useState<boolean>(false)
|
||||
// 显示类型
|
||||
const [showDetailType, setShowDetailType] = useState<any>()
|
||||
|
||||
// 加载服务区树
|
||||
const { loading: treeLoading, data: treeViews } = useRequest(async () => {
|
||||
@ -100,6 +110,7 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
return obj
|
||||
})
|
||||
|
||||
let statusList: string[] = ["0", "1000", "2000", "2010,2020,2030,2040,2050,2060,2070,2080,2090", "9000"]
|
||||
const columns: any = [
|
||||
{
|
||||
dataIndex: 'BusinessProcess_StateSearch',
|
||||
@ -108,12 +119,20 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInTable: true,
|
||||
// valueEnum: {
|
||||
// "0": "全部",
|
||||
// "2000": "待审核",
|
||||
// "2010,2020,2030,2040,2050,2060,2070,2080,2090": "审核中",
|
||||
// "9000": "已审结"
|
||||
// },
|
||||
valueEnum: {
|
||||
"0": "全部",
|
||||
"2000": "待审核",
|
||||
"2010,2020,2030,2040,2050,2060,2070,2080,2090": "审核中",
|
||||
"9000": "已审结"
|
||||
0: "全部",
|
||||
1: "待申请",
|
||||
2: "待审核",
|
||||
3: "审核中",
|
||||
4: "已审结"
|
||||
},
|
||||
initialValue: "0"
|
||||
},
|
||||
{
|
||||
dataIndex: 'BusinessProcess_Name',
|
||||
@ -154,15 +173,27 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
render: (_, record) => {
|
||||
return <a style={{
|
||||
color: record?.BusinessProcess_StateText === '待审核' ? '#1890ff' :
|
||||
record?.BusinessProcess_StateText === '审核中' ? 'rgb(250, 173, 20)' :
|
||||
record?.BusinessProcess_StateText === '已审结' ? 'red' : ""
|
||||
}} onClick={() => {
|
||||
console.log('recordrecordrecord', record);
|
||||
setShowDetailType('detail')
|
||||
setCurrentRow(record)
|
||||
setShowApplyFor(true)
|
||||
}}>{record?.BusinessProcess_StateText || "-"}</a>
|
||||
}
|
||||
},
|
||||
{
|
||||
dataIndex: 'Accept_Code',
|
||||
title: '业务类别',
|
||||
width: 200,
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
// {
|
||||
// dataIndex: 'Accept_Code',
|
||||
// title: '业务类别',
|
||||
// width: 200,
|
||||
// ellipsis: true,
|
||||
// align: 'center',
|
||||
// hideInSearch: true,
|
||||
// },
|
||||
{
|
||||
dataIndex: 'BusinessProcess_EndDate',
|
||||
title: '办结时间',
|
||||
@ -185,7 +216,7 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
valueType: 'option',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
width: 120,
|
||||
width: 180,
|
||||
fixed: "right",
|
||||
ellipsis: true,
|
||||
render: (_, record) => {
|
||||
@ -193,21 +224,63 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
record?.ApproveStaff_ID === currentUser?.ID && record?.BusinessProcess_State !== 9000
|
||||
?
|
||||
<Space>
|
||||
<a onClick={() => {
|
||||
setApprovaType(1)
|
||||
setApproveCurrentRow(record)
|
||||
setApproveModal(true)
|
||||
}}
|
||||
>
|
||||
审批
|
||||
</a>
|
||||
<a onClick={() => {
|
||||
setApprovaType(2)
|
||||
setApproveCurrentRow(record)
|
||||
setApproveModal(true)
|
||||
}}>
|
||||
驳回
|
||||
</a>
|
||||
{
|
||||
record?.BusinessProcess_State === 1000
|
||||
?
|
||||
<>
|
||||
<a onClick={() => {
|
||||
setCurrentRow(record)
|
||||
setShowApplyFor(true)
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</a>
|
||||
<Popconfirm
|
||||
title="确认删除该商品审批流程吗?"
|
||||
onConfirm={async () => {
|
||||
const req: any = {
|
||||
businessApprovalId: record?.BusinessApproval_ID,
|
||||
UserId: currentUser?.ID
|
||||
}
|
||||
const data = await handleDeleteCommodityProInst(req)
|
||||
if (data.Result_Code === 100) {
|
||||
message.success(data.Result_Desc)
|
||||
actionRef.current?.reload()
|
||||
} else {
|
||||
message.error(data.Result_Desc)
|
||||
}
|
||||
}}
|
||||
>
|
||||
<a>删除</a>
|
||||
</Popconfirm>
|
||||
</>
|
||||
: ""
|
||||
}
|
||||
{
|
||||
record?.BusinessProcess_State > 1000 ?
|
||||
<>
|
||||
<a onClick={() => {
|
||||
setApprovaType(1)
|
||||
// setApproveCurrentRow(record)
|
||||
// setApproveModal(true)
|
||||
setCurrentRow(record)
|
||||
setShowApplyFor(true)
|
||||
}}
|
||||
>
|
||||
审批
|
||||
</a>
|
||||
<a onClick={() => {
|
||||
setApprovaType(2)
|
||||
// setApproveCurrentRow(record)
|
||||
// setApproveModal(true)
|
||||
setCurrentRow(record)
|
||||
setShowApplyFor(true)
|
||||
}}>
|
||||
驳回
|
||||
</a>
|
||||
</> : ""
|
||||
}
|
||||
|
||||
</Space> : ""
|
||||
|
||||
);
|
||||
@ -271,37 +344,70 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
render: (_, record) => {
|
||||
return (
|
||||
<Space>
|
||||
<a
|
||||
onClick={() => {
|
||||
let obj: any = {}
|
||||
if (shopData && shopData.length > 0) {
|
||||
obj = shopData.filter((item: any) => item.COMMODITY_ID === record?.COMMODITY_ID)[0]
|
||||
}
|
||||
console.log('shopData', shopData);
|
||||
console.log('obj', obj);
|
||||
{
|
||||
currentRow?.BusinessProcess_State > 1000 || (currentRow?.BusinessApproval_ID && currentRow?.ApproveStaff_ID !== currentUser?.ID) ? '' :
|
||||
<>
|
||||
<a
|
||||
onClick={() => {
|
||||
let obj: any = {}
|
||||
if (shopData && shopData.length > 0) {
|
||||
obj = shopData.filter((item: any) => item.COMMODITY_ID === record?.COMMODITY_ID)[0]
|
||||
}
|
||||
setEditSelectRow(obj)
|
||||
setEditShopModal(true)
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</a>
|
||||
<Popconfirm
|
||||
title="确认删除该商品管理列表信息吗?"
|
||||
onConfirm={async () => {
|
||||
if (currentRow?.BusinessApproval_ID) {
|
||||
// 申请回到发起时候的真删
|
||||
const req: any = {
|
||||
COMMODITY_RUNNINGId: record?.COMMODITY_ID
|
||||
}
|
||||
const data = await handleDeleteCOMMODITY_RUNNING(req)
|
||||
console.log('datadatadatadata', data);
|
||||
actionRef.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)
|
||||
}
|
||||
})
|
||||
setShopData(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)
|
||||
}
|
||||
})
|
||||
setShopData(list)
|
||||
}
|
||||
}}
|
||||
>
|
||||
<a>删除</a>
|
||||
</Popconfirm>
|
||||
</>
|
||||
}
|
||||
|
||||
setEditSelectRow(obj)
|
||||
setEditShopModal(true)
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</a>
|
||||
<Popconfirm
|
||||
title="确认删除该商品管理列表信息吗?"
|
||||
onConfirm={async () => {
|
||||
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)
|
||||
}
|
||||
})
|
||||
setShopData(list)
|
||||
}}
|
||||
>
|
||||
<a>删除</a>
|
||||
</Popconfirm>
|
||||
{
|
||||
currentRow?.BusinessProcess_State === 9000 ?
|
||||
<a onClick={() => {
|
||||
// setCurrentShopRow(record)
|
||||
// setShowAddShopModal(true)
|
||||
setEditSelectRow(record)
|
||||
setEditShopModal(true)
|
||||
}}>详情</a>
|
||||
: ''
|
||||
}
|
||||
</Space>
|
||||
);
|
||||
},
|
||||
@ -443,7 +549,36 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
console.log('data', data)
|
||||
}
|
||||
|
||||
useEffect(async () => {
|
||||
const req: any = {
|
||||
SearchParameter: {
|
||||
APPROVALROUTE_STATES: "",
|
||||
APPROVALROUTE_VALID: 1,
|
||||
OPERATION_TYPES: "100200",
|
||||
}
|
||||
}
|
||||
const data = await handleGetAPPROVALROUTEList(req)
|
||||
console.log('datadatadatadata', data);
|
||||
// 拿到发起申请的人
|
||||
let firstSetp: any = {}
|
||||
if (data && data.length > 0) {
|
||||
data.forEach((item: any) => {
|
||||
if (item.APPROVALROUTE_STATE === 1000) {
|
||||
firstSetp = item
|
||||
}
|
||||
})
|
||||
}
|
||||
// 判断当前用户 是否有新增权限
|
||||
let have: boolean = false
|
||||
let idList: any = firstSetp.APPROVALSTAFF_ID.split(',')
|
||||
console.log('idList', idList);
|
||||
|
||||
if (idList.indexOf(currentUser?.ID.toString()) !== -1) {
|
||||
have = true
|
||||
}
|
||||
setInitiateApplication(have)
|
||||
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div>
|
||||
@ -471,7 +606,7 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
SearchParameter: {
|
||||
Operation_Type: 6,
|
||||
Accept_Code: "6-100210",
|
||||
BusinessProcess_StateSearch: params?.BusinessProcess_StateSearch === 0 ? '' : params?.BusinessProcess_StateSearch
|
||||
BusinessProcess_StateSearch: statusList[params?.BusinessProcess_StateSearch] === "0" ? '' : statusList[params?.BusinessProcess_StateSearch]
|
||||
},
|
||||
PageIndex: 1,
|
||||
PageSize: 999999
|
||||
@ -481,7 +616,7 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
if (data.data && data.data.length > 0) {
|
||||
data.data.forEach((item: any) => {
|
||||
if (item.BusinessProcess_State === 1000) {
|
||||
item.BusinessProcess_StateText = "待审核"
|
||||
item.BusinessProcess_StateText = "待发起"
|
||||
} else if (item.BusinessProcess_State === 2000) {
|
||||
item.BusinessProcess_StateText = "待审核"
|
||||
} else if (item.BusinessProcess_State > 2000 && item.BusinessProcess_State < 9000) {
|
||||
@ -498,11 +633,12 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
}}
|
||||
toolbar={{
|
||||
actions: [
|
||||
<Button type={"primary"} onClick={() => {
|
||||
setShowApplyFor(true)
|
||||
}}>
|
||||
新增商品信息修改申请
|
||||
</Button>
|
||||
InitiateApplication ?
|
||||
<Button type={"primary"} onClick={() => {
|
||||
setShowApplyFor(true)
|
||||
}}>
|
||||
新增商品信息修改申请
|
||||
</Button> : ""
|
||||
]
|
||||
}}
|
||||
/>
|
||||
@ -510,7 +646,7 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
</div>
|
||||
|
||||
{/* 审批的悬浮框 */}
|
||||
<Modal
|
||||
{/* <Modal
|
||||
width={"70%"}
|
||||
title={"审批"}
|
||||
open={approveModal}
|
||||
@ -696,27 +832,56 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
</Row> : ""
|
||||
}
|
||||
</ProForm>
|
||||
</Modal>
|
||||
</Modal> */}
|
||||
|
||||
{/* 新增申请的悬浮框 */}
|
||||
<Modal
|
||||
className="addProductModal"
|
||||
width={"70%"}
|
||||
title={"新增商品信息修改申请"}
|
||||
title={currentRow?.BusinessApproval_ID ? "商品信息修改详情" : "新增商品信息修改申请"}
|
||||
open={showApplyFor}
|
||||
confirmLoading={handleAddLoading}
|
||||
destroyOnClose
|
||||
footer={showDetailType === 'detail' || !InitiateApplication || (currentRow?.BusinessApproval_ID && currentRow?.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={() => {
|
||||
setShowApplyFor(false)
|
||||
setCurrentRow(undefined)
|
||||
setShopData([])
|
||||
setSelectRowList([])
|
||||
setSelectedOrderRowKeys([])
|
||||
setShowDetailType(null)
|
||||
}}>取消</Button>
|
||||
|
||||
<Button type={"primary"} onClick={() => {
|
||||
if (currentRow?.BusinessProcess_State > 1000) {
|
||||
modalApproveFormRef?.current?.validateFields().then(() => {
|
||||
modalApproveFormRef?.current?.submit()
|
||||
})
|
||||
} else {
|
||||
modalFormRef?.current?.validateFields().then(() => {
|
||||
modalFormRef?.current?.submit()
|
||||
})
|
||||
}
|
||||
}}>确认</Button>
|
||||
</div>}
|
||||
onCancel={() => {
|
||||
setShowApplyFor(false)
|
||||
setCurrentRow(undefined)
|
||||
setShopData([])
|
||||
setSelectRowList([])
|
||||
setSelectedOrderRowKeys([])
|
||||
setShowDetailType(null)
|
||||
}}
|
||||
onOk={() => {
|
||||
formRef?.current?.validateFields().then(() => {
|
||||
modalFormRef?.current?.submit()
|
||||
})
|
||||
|
||||
if (currentRow?.BusinessProcess_State > 1000) {
|
||||
modalApproveFormRef?.current?.validateFields().then(() => {
|
||||
modalApproveFormRef?.current?.submit()
|
||||
})
|
||||
} else {
|
||||
modalFormRef?.current?.validateFields().then(() => {
|
||||
modalFormRef?.current?.submit()
|
||||
})
|
||||
}
|
||||
}}
|
||||
>
|
||||
<ProForm
|
||||
@ -724,6 +889,44 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
formRef={modalFormRef}
|
||||
submitter={false}
|
||||
preserve={false}
|
||||
request={async () => {
|
||||
if (currentRow?.BusinessApproval_ID) {
|
||||
const req: any = {
|
||||
BUSINESSAPPROVALId: currentRow?.BusinessApproval_ID,
|
||||
}
|
||||
const data = await handleGetBUSINESSAPPROVALDetail(req)
|
||||
console.log('datadatadata', data);
|
||||
setBUSINESSAPPROVALDETAIL(data.Result_Data)
|
||||
let shopData: any = []
|
||||
if (currentRow?.BusinessProcess_State === 9000) {
|
||||
shopData = await handleGetApprovalCommodityList({
|
||||
ProvinceCode: currentUser?.ProvinceCode,
|
||||
// CommodityId: currentUser?.ProvinceCode,
|
||||
BusinessApprovalId: currentRow?.BusinessApproval_ID,
|
||||
PageIndex: 1,
|
||||
PageSize: 999999,
|
||||
})
|
||||
} else {
|
||||
shopData = await handleGetCOMMODITYRUNNINGList({
|
||||
SearchParameter: {
|
||||
BUSINESSAPPROVAL_ID: currentRow?.BusinessApproval_ID,
|
||||
},
|
||||
PageIndex: 1,
|
||||
pageSize: 999999,
|
||||
})
|
||||
}
|
||||
console.log('shopDatashopDatashopDatashopData', shopData);
|
||||
setShopData(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) => {
|
||||
if (shopData && shopData.length > 0) {
|
||||
|
||||
@ -731,19 +934,37 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
message.error('请选择要修改的商品!')
|
||||
return
|
||||
}
|
||||
setHandleAddLoading(true)
|
||||
const req: any = {
|
||||
ProinstName: res.reasonForApplication,
|
||||
UserId: currentUser?.ID,
|
||||
OperateType: "100210",
|
||||
ServerpartId: res.ServerpartId,
|
||||
NextApproveStaffId: res.NextApproveStaffId,
|
||||
NextApproveState: 2000,
|
||||
CommodityRunningList: shopData
|
||||
}
|
||||
console.log('reqreq', req);
|
||||
|
||||
const data = await handleCreateCommodityProInst(req)
|
||||
let data: any = {}
|
||||
setHandleAddLoading(true)
|
||||
console.log('currentRowcurrentRowcurrentRow', currentRow);
|
||||
|
||||
if (currentRow?.BusinessApproval_ID) {
|
||||
const req: any = {
|
||||
ProinstId: currentRow?.BusinessApproval_ID,
|
||||
ProinstName: res.reasonForApplication,
|
||||
UserId: currentUser?.ID,
|
||||
OperateType: "100210",
|
||||
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: "100210",
|
||||
ServerpartId: res.ServerpartId,
|
||||
NextApproveStaffId: res.NextApproveStaffId,
|
||||
NextApproveState: 2000,
|
||||
CommodityRunningList: shopData
|
||||
}
|
||||
console.log('reqreq', req);
|
||||
|
||||
data = await handleCreateCommodityProInst(req)
|
||||
}
|
||||
setHandleAddLoading(false)
|
||||
console.log('dsaidjaskda', data);
|
||||
if (data.Result_Code === 100) {
|
||||
@ -754,11 +975,12 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
setShopData([])
|
||||
setSelectRowList([])
|
||||
setSelectedOrderRowKeys([])
|
||||
setShowDetailType(null)
|
||||
} else {
|
||||
message.error(data.Result_Desc)
|
||||
}
|
||||
|
||||
}}
|
||||
}
|
||||
}
|
||||
>
|
||||
<Row gutter={8}>
|
||||
<Col span={24}>
|
||||
@ -769,6 +991,7 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
required: true,
|
||||
message: "请输入申请原因!"
|
||||
}]}
|
||||
disabled={currentRow?.BusinessProcess_State > 1000 || (currentRow?.BusinessApproval_ID && currentRow?.ApproveStaff_ID !== currentUser?.ID)}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
@ -796,9 +1019,10 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
}
|
||||
return list
|
||||
}}
|
||||
disabled={currentRow?.BusinessProcess_State > 1000 || (currentRow?.BusinessApproval_ID && currentRow?.ApproveStaff_ID !== currentUser?.ID)}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Col span={12} style={{ display: currentRow?.BusinessProcess_State > 1000 && ApprovalType !== 0 ? "none" : "" }}>
|
||||
<ProFormSelect
|
||||
label="下一环节审批人"
|
||||
name="NextApproveStaffId"
|
||||
@ -819,13 +1043,24 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
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 >= currentRow?.BusinessProcess_State) {
|
||||
if (item.APPROVALROUTE_STATE === currentRow?.BusinessProcess_State) {
|
||||
item.status = "process"
|
||||
}
|
||||
nextList.push(item)
|
||||
}
|
||||
})
|
||||
|
||||
setNextStepsList(nextList)
|
||||
|
||||
let personTotal: number = obj.APPROVALSTAFF_ID.split(',').length || 0
|
||||
if (personTotal > 0) {
|
||||
let STAFFIDList: number[] = obj.APPROVALSTAFF_ID.split(',')
|
||||
@ -838,36 +1073,264 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
}
|
||||
}
|
||||
}}
|
||||
disabled={currentRow?.BusinessProcess_State > 1000 || (currentRow?.BusinessApproval_ID && currentRow?.ApproveStaff_ID !== currentUser?.ID)}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
|
||||
<ProTable
|
||||
search={false}
|
||||
options={false}
|
||||
pagination={false}
|
||||
columns={modalColumns}
|
||||
dataSource={shopData}
|
||||
bordered
|
||||
toolbar={{
|
||||
actions: [
|
||||
<Button type={"primary"} onClick={() => {
|
||||
// 判断服务区是否已选择
|
||||
const values = modalFormRef.current?.getFieldsValue();
|
||||
if (!values?.ServerpartId) {
|
||||
message.error("请先选择服务区!");
|
||||
return;
|
||||
}
|
||||
setShowAddShopModal(true);
|
||||
}}>
|
||||
选择商品
|
||||
</Button>
|
||||
]
|
||||
}}
|
||||
/>
|
||||
</ProForm>
|
||||
|
||||
</ProForm>
|
||||
{
|
||||
currentRow?.BusinessProcess_State > 1000 ?
|
||||
<ProForm
|
||||
// layout={'horizontal'}
|
||||
formRef={modalApproveFormRef}
|
||||
submitter={false}
|
||||
preserve={false}
|
||||
request={async () => {
|
||||
console.log('approveCurrentRowapproveCurrentRowapproveCurrentRow', currentRow);
|
||||
const reqState: any = {
|
||||
SearchParameter: {
|
||||
APPROVALROUTE_STATES: "",
|
||||
APPROVALROUTE_VALID: 1,
|
||||
OPERATION_TYPES: "100210",
|
||||
},
|
||||
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 === currentRow.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)
|
||||
let data: any = {}
|
||||
|
||||
if (ApprovalType === 1) {
|
||||
// 审批
|
||||
const req: any = {
|
||||
businessApprovalId: currentRow?.BusinessApproval_ID,
|
||||
UserId: currentUser?.ID,
|
||||
ApproveInfo: res.ApproveInfo,
|
||||
nextApproveStaffId: res.nextApproveStaffId || "",
|
||||
nextApproveState: nextApproval || ""
|
||||
}
|
||||
|
||||
data = await handleApproveCommodityProInst(req)
|
||||
} else {
|
||||
// 驳回
|
||||
const req: any = {
|
||||
businessApprovalId: currentRow?.BusinessApproval_ID,
|
||||
UserId: currentUser?.ID,
|
||||
RejectInfo: res.ApproveInfo,
|
||||
nextApproveState: res.nextApproveState || ""
|
||||
}
|
||||
console.log('reqreqreqreq', req);
|
||||
|
||||
data = await handleRejectCommodityProInst(req)
|
||||
}
|
||||
setAddApprovalLoading(false)
|
||||
console.log('datadatadata', data);
|
||||
if (data.Result_Code === 100) {
|
||||
message.success(data.Result_Desc)
|
||||
|
||||
setShowApplyFor(false)
|
||||
setCurrentRow(undefined)
|
||||
actionRef.current?.reload()
|
||||
setShopData([])
|
||||
setSelectRowList([])
|
||||
setSelectedOrderRowKeys([])
|
||||
|
||||
setApproveCurrentRow(undefined)
|
||||
setApproveModal(false)
|
||||
setNextApproval(null)
|
||||
setNextApprovalPerson(null)
|
||||
setApprovaType(0)
|
||||
actionRef.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: [
|
||||
currentRow?.BusinessProcess_State > 1000 || (currentRow?.BusinessApproval_ID && currentRow?.ApproveStaff_ID !== currentUser?.ID) ? '' : <Button type={"primary"} onClick={() => {
|
||||
// 判断服务区是否已选择
|
||||
const values = modalFormRef.current?.getFieldsValue();
|
||||
if (!values?.ServerpartId) {
|
||||
message.error("请先选择服务区!");
|
||||
return;
|
||||
}
|
||||
setShowAddShopModal(true);
|
||||
}}>
|
||||
选择商品
|
||||
</Button>
|
||||
]
|
||||
}}
|
||||
/>
|
||||
|
||||
{
|
||||
currentRow?.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>
|
||||
|
||||
{/* 选择商品 */}
|
||||
@ -880,8 +1343,6 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
onOk={() => {
|
||||
setShowAddShopModal(false)
|
||||
setShopData(selectRowList)
|
||||
console.log('selectRowListselectRowList', selectRowList);
|
||||
|
||||
}}
|
||||
onCancel={() => {
|
||||
setShowAddShopModal(false)
|
||||
@ -968,7 +1429,20 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
|
||||
<ProForm
|
||||
formRef={modalShopFormRef}
|
||||
submitter={false}
|
||||
initialValues={editSelectRow}
|
||||
request={async () => {
|
||||
// !currentShopRow?.COMMODITY_ID &&
|
||||
if (editSelectRow?.SERVERPART_ID) {
|
||||
await handleGetCommodity(editSelectRow?.SERVERPART_ID)
|
||||
}
|
||||
return { ...editSelectRow, BUSINESSTYPE: editSelectRow?.BUSINESSTYPE.toString(), COMMODITY_GRADE: Number(editSelectRow?.COMMODITY_GRADE) }
|
||||
}}
|
||||
disabled={currentRow?.BusinessProcess_State === 9000}
|
||||
// initialValues={editSelectRow ? {
|
||||
// ...editSelectRow,
|
||||
// COMMODITY_GRADE: Number(editSelectRow?.COMMODITY_GRADE)
|
||||
// } : {
|
||||
|
||||
// }}
|
||||
>
|
||||
<div className={'modalTitle'}>商品基本信息</div>
|
||||
<Row gutter={16}>
|
||||
|
||||
@ -0,0 +1,16 @@
|
||||
.addProductModal {
|
||||
.ant-modal-content {
|
||||
.ant-modal-body {
|
||||
.ProcessProgress {
|
||||
.ant-card-body {
|
||||
.ProcessProgressBox {
|
||||
.multi-line-steps {
|
||||
flex-wrap: wrap !important;
|
||||
display: flex !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3,9 +3,9 @@
|
||||
import { connect } from "umi";
|
||||
import type { CurrentUser } from "umi";
|
||||
import type { ConnectState } from "@/models/connect";
|
||||
import React, { useRef, useState } from "react";
|
||||
import React, { useEffect, useRef, useState } from "react";
|
||||
import type { FormInstance } from "antd";
|
||||
import { Button, Col, Input, message, Modal, Popconfirm, Row, Space, Spin, Tree } from "antd";
|
||||
import { Button, Card, Col, Input, message, Modal, Popconfirm, Row, Space, Spin, Steps, Tooltip, Tree } from "antd";
|
||||
import type { ActionType } from "@ant-design/pro-table";
|
||||
import ProTable from "@ant-design/pro-table";
|
||||
import PageTitleBox from "@/components/PageTitleBox";
|
||||
@ -17,9 +17,10 @@ import { handleGetCommodityList, handleGetNestingCOMMODITYTYPETree, handleGetSer
|
||||
import { handleGetUSERDEFINEDTYPEList } from "../userDefinedType/service";
|
||||
import useRequest from "@ahooksjs/use-request";
|
||||
import moment from 'moment'
|
||||
import { handleApproveCommodityProInst, handleCreateCommodityProInst, handleRejectCommodityProInst } from "../ProductApprovalProcess/service";
|
||||
import { handleApproveCommodityProInst, handleCreateCommodityProInst, handleDeleteCOMMODITY_RUNNING, handleDeleteCommodityProInst, handleGetApprovalCommodityList, handleGetBUSINESSAPPROVALDetail, handleGetCOMMODITYRUNNINGList, handleReapplyCommodityProInst, handleRejectCommodityProInst } from "../ProductApprovalProcess/service";
|
||||
import session from "@/utils/session";
|
||||
|
||||
import './style.less'
|
||||
const { Step } = Steps
|
||||
const ProductChangePriceApproval: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
const { currentUser } = props
|
||||
const downloadBtnRef = useRef<any>()
|
||||
@ -55,6 +56,14 @@ const ProductChangePriceApproval: React.FC<{ currentUser: CurrentUser }> = (prop
|
||||
const [ApprovalType, setApprovaType] = useState<number>(0)
|
||||
// 新增申请的加载效果
|
||||
const [addApprovalLoading, setAddApprovalLoading] = useState<boolean>(false);
|
||||
// 审批记录详情
|
||||
const [BUSINESSAPPROVALDETAIL, setBUSINESSAPPROVALDETAIL] = useState<any>()
|
||||
// 还有几个环节 拼在流程进度后面
|
||||
const [nextStepsList, setNextStepsList] = useState<any>()
|
||||
// 判断有无发起申请的权限
|
||||
const [InitiateApplication, setInitiateApplication] = useState<boolean>(false)
|
||||
// 显示类型
|
||||
const [showDetailType, setShowDetailType] = useState<any>()
|
||||
|
||||
const { loading: CommodityLoading, data: CommodityData } = useRequest(async () => {
|
||||
const data = await getFieldEnumTree({ FieldExplainField: 'CommodityTypeIds' })
|
||||
@ -76,7 +85,7 @@ const ProductChangePriceApproval: React.FC<{ currentUser: CurrentUser }> = (prop
|
||||
}
|
||||
return obj
|
||||
})
|
||||
|
||||
let statusList: string[] = ["0", "1000", "2000", "2010,2020,2030,2040,2050,2060,2070,2080,2090", "9000"]
|
||||
const columns: any = [
|
||||
{
|
||||
dataIndex: 'BusinessProcess_StateSearch',
|
||||
@ -85,12 +94,20 @@ const ProductChangePriceApproval: React.FC<{ currentUser: CurrentUser }> = (prop
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInTable: true,
|
||||
// valueEnum: {
|
||||
// "0": "全部",
|
||||
// "2000": "待审核",
|
||||
// "2010,2020,2030,2040,2050,2060,2070,2080,2090": "审核中",
|
||||
// "9000": "已审结"
|
||||
// },
|
||||
valueEnum: {
|
||||
"0": "全部",
|
||||
"2000": "待审核",
|
||||
"2010,2020,2030,2040,2050,2060,2070,2080,2090": "审核中",
|
||||
"9000": "已审结"
|
||||
0: "全部",
|
||||
1: "待申请",
|
||||
2: "待审核",
|
||||
3: "审核中",
|
||||
4: "已审结"
|
||||
},
|
||||
initialValue: "0"
|
||||
},
|
||||
{
|
||||
dataIndex: 'BusinessProcess_Name',
|
||||
@ -131,15 +148,27 @@ const ProductChangePriceApproval: React.FC<{ currentUser: CurrentUser }> = (prop
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
render: (_, record) => {
|
||||
return <a style={{
|
||||
color: record?.BusinessProcess_StateText === '待审核' ? '#1890ff' :
|
||||
record?.BusinessProcess_StateText === '审核中' ? 'rgb(250, 173, 20)' :
|
||||
record?.BusinessProcess_StateText === '已审结' ? 'red' : ""
|
||||
}} onClick={() => {
|
||||
console.log('recordrecordrecord', record);
|
||||
setShowDetailType('detail')
|
||||
setCurrentRow(record)
|
||||
setShowApplyFor(true)
|
||||
}}>{record?.BusinessProcess_StateText || "-"}</a>
|
||||
}
|
||||
},
|
||||
{
|
||||
dataIndex: 'Accept_Code',
|
||||
title: '业务类别',
|
||||
width: 200,
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
// {
|
||||
// dataIndex: 'Accept_Code',
|
||||
// title: '业务类别',
|
||||
// width: 200,
|
||||
// ellipsis: true,
|
||||
// align: 'center',
|
||||
// hideInSearch: true,
|
||||
// },
|
||||
{
|
||||
dataIndex: 'BusinessProcess_EndDate',
|
||||
title: '办结时间',
|
||||
@ -170,22 +199,65 @@ const ProductChangePriceApproval: React.FC<{ currentUser: CurrentUser }> = (prop
|
||||
record?.ApproveStaff_ID === currentUser?.ID && record?.BusinessProcess_State !== 9000
|
||||
?
|
||||
<Space>
|
||||
<a
|
||||
onClick={() => {
|
||||
setApprovaType(1)
|
||||
setApproveCurrentRow(record)
|
||||
setApproveModal(true)
|
||||
}}
|
||||
>
|
||||
审批
|
||||
</a>
|
||||
<a onClick={() => {
|
||||
setApprovaType(2)
|
||||
setApproveCurrentRow(record)
|
||||
setApproveModal(true)
|
||||
}}>
|
||||
驳回
|
||||
</a>
|
||||
{
|
||||
record?.BusinessProcess_State === 1000
|
||||
?
|
||||
<>
|
||||
<a onClick={() => {
|
||||
setCurrentRow(record)
|
||||
setShowApplyFor(true)
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</a>
|
||||
<Popconfirm
|
||||
title="确认删除该商品审批流程吗?"
|
||||
onConfirm={async () => {
|
||||
const req: any = {
|
||||
businessApprovalId: record?.BusinessApproval_ID,
|
||||
UserId: currentUser?.ID
|
||||
}
|
||||
const data = await handleDeleteCommodityProInst(req)
|
||||
if (data.Result_Code === 100) {
|
||||
message.success(data.Result_Desc)
|
||||
actionRef.current?.reload()
|
||||
} else {
|
||||
message.error(data.Result_Desc)
|
||||
}
|
||||
}}
|
||||
>
|
||||
<a>删除</a>
|
||||
</Popconfirm>
|
||||
</>
|
||||
: ""
|
||||
}
|
||||
{
|
||||
record?.BusinessProcess_State > 1000 ?
|
||||
<>
|
||||
<a
|
||||
onClick={() => {
|
||||
setApprovaType(1)
|
||||
// setApproveCurrentRow(record)
|
||||
// setApproveModal(true)
|
||||
|
||||
setCurrentRow(record)
|
||||
setShowApplyFor(true)
|
||||
}}
|
||||
>
|
||||
审批
|
||||
</a>
|
||||
<a onClick={() => {
|
||||
setApprovaType(2)
|
||||
// setApproveCurrentRow(record)
|
||||
// setApproveModal(true)
|
||||
|
||||
setCurrentRow(record)
|
||||
setShowApplyFor(true)
|
||||
}}>
|
||||
驳回
|
||||
</a>
|
||||
</> : ""
|
||||
}
|
||||
</Space> : ""
|
||||
);
|
||||
},
|
||||
@ -229,7 +301,7 @@ const ProductChangePriceApproval: React.FC<{ currentUser: CurrentUser }> = (prop
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
render: (_, record) => {
|
||||
return <Input value={record.newPrice} onChange={(e: any) => {
|
||||
return <Input value={record.newPrice} disabled={currentRow?.BusinessProcess_State > 1000 || (currentRow?.BusinessApproval_ID && currentRow?.ApproveStaff_ID !== currentUser?.ID)} onChange={(e: any) => {
|
||||
let oldData: any = JSON.parse(JSON.stringify(shopData))
|
||||
let list: any = []
|
||||
oldData.forEach((item: any) => {
|
||||
@ -255,33 +327,63 @@ const ProductChangePriceApproval: React.FC<{ currentUser: CurrentUser }> = (prop
|
||||
valueType: 'option',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
width: 120,
|
||||
width: 180,
|
||||
fixed: "right",
|
||||
ellipsis: true,
|
||||
render: (_, record) => {
|
||||
return (
|
||||
|
||||
<Space>
|
||||
<Popconfirm
|
||||
title="确认删除该商品管理列表信息吗?"
|
||||
onConfirm={async () => {
|
||||
console.log('record', record);
|
||||
let oldData: any = JSON.parse(JSON.stringify(shopData))
|
||||
let list: any = []
|
||||
let rowKeyList: number[] = []
|
||||
oldData.forEach((item: any) => {
|
||||
if (item.COMMODITY_ID !== record?.COMMODITY_ID) {
|
||||
list.push(item)
|
||||
rowKeyList.push(item.COMMODITY_ID)
|
||||
}
|
||||
})
|
||||
setShopData(list)
|
||||
setSelectRowList(list)
|
||||
setSelectedOrderRowKeys(rowKeyList)
|
||||
}}
|
||||
>
|
||||
<a>删除</a>
|
||||
</Popconfirm>
|
||||
{
|
||||
currentRow?.BusinessProcess_State > 1000 || (currentRow?.BusinessApproval_ID && currentRow?.ApproveStaff_ID !== currentUser?.ID) ? '' :
|
||||
<>
|
||||
<Popconfirm
|
||||
title="确认删除该商品管理列表信息吗?"
|
||||
onConfirm={async () => {
|
||||
|
||||
if (currentRow?.BusinessApproval_ID) {
|
||||
console.log('record', record);
|
||||
// 申请回到发起时候的真删
|
||||
const req: any = {
|
||||
COMMODITY_RUNNINGId: record?.COMMODITY_ID
|
||||
}
|
||||
const data = await handleDeleteCOMMODITY_RUNNING(req)
|
||||
console.log('datadatadatadata', data);
|
||||
actionRef.current?.reload()
|
||||
// 实现直接删除的效果
|
||||
console.log('record', record);
|
||||
let oldData: any = JSON.parse(JSON.stringify(shopData))
|
||||
let list: any = []
|
||||
let rowKeyList: number[] = []
|
||||
oldData.forEach((item: any) => {
|
||||
if (item.COMMODITY_ID !== record?.COMMODITY_ID) {
|
||||
list.push(item)
|
||||
rowKeyList.push(item.COMMODITY_ID)
|
||||
}
|
||||
})
|
||||
setShopData(list)
|
||||
setSelectRowList(list)
|
||||
setSelectedOrderRowKeys(rowKeyList)
|
||||
} else {
|
||||
console.log('record', record);
|
||||
let oldData: any = JSON.parse(JSON.stringify(shopData))
|
||||
let list: any = []
|
||||
let rowKeyList: number[] = []
|
||||
oldData.forEach((item: any) => {
|
||||
if (item.COMMODITY_ID !== record?.COMMODITY_ID) {
|
||||
list.push(item)
|
||||
rowKeyList.push(item.COMMODITY_ID)
|
||||
}
|
||||
})
|
||||
setShopData(list)
|
||||
setSelectRowList(list)
|
||||
setSelectedOrderRowKeys(rowKeyList)
|
||||
}
|
||||
}}
|
||||
>
|
||||
<a>删除</a>
|
||||
</Popconfirm>
|
||||
</>
|
||||
}
|
||||
</Space>
|
||||
);
|
||||
},
|
||||
@ -297,16 +399,16 @@ const ProductChangePriceApproval: React.FC<{ currentUser: CurrentUser }> = (prop
|
||||
hideInSearch: true,
|
||||
valueType: 'index'
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>服务区</div>,
|
||||
width: 150,
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
dataIndex: 'SERVERPART_NAME',
|
||||
hideInSearch: true,
|
||||
valueType: "select",
|
||||
valueEnum: ServerpartIdsList
|
||||
},
|
||||
// {
|
||||
// title: <div style={{ textAlign: 'center' }}>服务区</div>,
|
||||
// width: 150,
|
||||
// ellipsis: true,
|
||||
// align: 'center',
|
||||
// dataIndex: 'SERVERPART_NAME',
|
||||
// hideInSearch: true,
|
||||
// valueType: "select",
|
||||
// valueEnum: ServerpartIdsList
|
||||
// },
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>商品业态</div>,
|
||||
width: 120,
|
||||
@ -389,7 +491,36 @@ const ProductChangePriceApproval: React.FC<{ currentUser: CurrentUser }> = (prop
|
||||
}
|
||||
]
|
||||
|
||||
useEffect(async () => {
|
||||
const req: any = {
|
||||
SearchParameter: {
|
||||
APPROVALROUTE_STATES: "",
|
||||
APPROVALROUTE_VALID: 1,
|
||||
OPERATION_TYPES: "100200",
|
||||
}
|
||||
}
|
||||
const data = await handleGetAPPROVALROUTEList(req)
|
||||
console.log('datadatadatadata', data);
|
||||
// 拿到发起申请的人
|
||||
let firstSetp: any = {}
|
||||
if (data && data.length > 0) {
|
||||
data.forEach((item: any) => {
|
||||
if (item.APPROVALROUTE_STATE === 1000) {
|
||||
firstSetp = item
|
||||
}
|
||||
})
|
||||
}
|
||||
// 判断当前用户 是否有新增权限
|
||||
let have: boolean = false
|
||||
let idList: any = firstSetp.APPROVALSTAFF_ID.split(',')
|
||||
console.log('idList', idList);
|
||||
|
||||
if (idList.indexOf(currentUser?.ID.toString()) !== -1) {
|
||||
have = true
|
||||
}
|
||||
setInitiateApplication(have)
|
||||
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div>
|
||||
@ -417,7 +548,7 @@ const ProductChangePriceApproval: React.FC<{ currentUser: CurrentUser }> = (prop
|
||||
SearchParameter: {
|
||||
Operation_Type: 6,
|
||||
Accept_Code: "6-100200",
|
||||
BusinessProcess_StateSearch: params?.BusinessProcess_StateSearch === 0 ? '' : params?.BusinessProcess_StateSearch
|
||||
BusinessProcess_StateSearch: statusList[params?.BusinessProcess_StateSearch] === "0" ? '' : statusList[params?.BusinessProcess_StateSearch]
|
||||
},
|
||||
PageIndex: 1,
|
||||
PageSize: 999999
|
||||
@ -427,7 +558,7 @@ const ProductChangePriceApproval: React.FC<{ currentUser: CurrentUser }> = (prop
|
||||
if (data.data && data.data.length > 0) {
|
||||
data.data.forEach((item: any) => {
|
||||
if (item.BusinessProcess_State === 1000) {
|
||||
item.BusinessProcess_StateText = "待审核"
|
||||
item.BusinessProcess_StateText = "待申请"
|
||||
} else if (item.BusinessProcess_State === 2000) {
|
||||
item.BusinessProcess_StateText = "待审核"
|
||||
} else if (item.BusinessProcess_State > 2000 && item.BusinessProcess_State < 9000) {
|
||||
@ -444,11 +575,12 @@ const ProductChangePriceApproval: React.FC<{ currentUser: CurrentUser }> = (prop
|
||||
}}
|
||||
toolbar={{
|
||||
actions: [
|
||||
<Button type={"primary"} onClick={() => {
|
||||
setShowApplyFor(true)
|
||||
}}>
|
||||
新增商品调价申请
|
||||
</Button>
|
||||
InitiateApplication ?
|
||||
<Button type={"primary"} onClick={() => {
|
||||
setShowApplyFor(true)
|
||||
}}>
|
||||
新增商品调价申请
|
||||
</Button> : ""
|
||||
]
|
||||
}}
|
||||
/>
|
||||
@ -456,7 +588,7 @@ const ProductChangePriceApproval: React.FC<{ currentUser: CurrentUser }> = (prop
|
||||
</div>
|
||||
|
||||
{/* 审批的悬浮框 */}
|
||||
<Modal
|
||||
{/* <Modal
|
||||
width={"70%"}
|
||||
title={"审批"}
|
||||
open={approveModal}
|
||||
@ -642,12 +774,13 @@ const ProductChangePriceApproval: React.FC<{ currentUser: CurrentUser }> = (prop
|
||||
</Row> : ""
|
||||
}
|
||||
</ProForm>
|
||||
</Modal>
|
||||
</Modal> */}
|
||||
|
||||
{/* 新增申请的悬浮框 */}
|
||||
<Modal
|
||||
className="addProductModal"
|
||||
width={"70%"}
|
||||
title={"新增商品申请"}
|
||||
title={currentRow?.BusinessApproval_ID ? "商品申请详情" : "新增商品申请"}
|
||||
open={showApplyFor}
|
||||
destroyOnClose
|
||||
onCancel={() => {
|
||||
@ -656,36 +789,128 @@ const ProductChangePriceApproval: React.FC<{ currentUser: CurrentUser }> = (prop
|
||||
setSelectRowList([])
|
||||
setSelectedOrderRowKeys([])
|
||||
setShopData([])
|
||||
setShowDetailType(null)
|
||||
}}
|
||||
confirmLoading={showApplyForLoading}
|
||||
onOk={() => {
|
||||
// 判断表格里面的现价 是不是都已经输入了
|
||||
let allRight: boolean = true
|
||||
console.log('shopData', shopData);
|
||||
footer={showDetailType === 'detail' || !InitiateApplication || (currentRow?.BusinessApproval_ID && currentRow?.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={() => {
|
||||
setShowApplyFor(false)
|
||||
setCurrentRow(undefined)
|
||||
setSelectRowList([])
|
||||
setSelectedOrderRowKeys([])
|
||||
setShopData([])
|
||||
setShowDetailType(null)
|
||||
}}>取消</Button>
|
||||
|
||||
if (shopData && shopData.length > 0) {
|
||||
shopData.forEach((item: any) => {
|
||||
if (!item.newPrice) {
|
||||
allRight = false
|
||||
<Button type={"primary"} loading={showApplyForLoading} onClick={() => {
|
||||
if (currentRow?.BusinessProcess_State > 1000) {
|
||||
modalApproveFormRef?.current?.validateFields().then(() => {
|
||||
modalApproveFormRef?.current?.submit()
|
||||
})
|
||||
} else {
|
||||
// 判断表格里面的现价 是不是都已经输入了
|
||||
let allRight: boolean = true
|
||||
if (shopData && shopData.length > 0) {
|
||||
shopData.forEach((item: any) => {
|
||||
if (!item.newPrice) {
|
||||
allRight = false
|
||||
}
|
||||
})
|
||||
}
|
||||
if (!allRight) {
|
||||
message.error("请先完善表格数据!")
|
||||
return
|
||||
}
|
||||
formRef?.current?.validateFields().then(() => {
|
||||
modalFormRef?.current?.submit()
|
||||
})
|
||||
}
|
||||
}}>确认</Button>
|
||||
</div>}
|
||||
onOk={() => {
|
||||
if (currentRow?.BusinessProcess_State > 1000) {
|
||||
modalApproveFormRef?.current?.validateFields().then(() => {
|
||||
modalApproveFormRef?.current?.submit()
|
||||
})
|
||||
} else {
|
||||
// 判断表格里面的现价 是不是都已经输入了
|
||||
let allRight: boolean = true
|
||||
if (shopData && shopData.length > 0) {
|
||||
shopData.forEach((item: any) => {
|
||||
if (!item.newPrice) {
|
||||
allRight = false
|
||||
}
|
||||
})
|
||||
}
|
||||
if (!allRight) {
|
||||
message.error("请先完善表格数据!")
|
||||
return
|
||||
}
|
||||
formRef?.current?.validateFields().then(() => {
|
||||
modalFormRef?.current?.submit()
|
||||
})
|
||||
}
|
||||
if (!allRight) {
|
||||
message.error("请先完善表格数据!")
|
||||
return
|
||||
}
|
||||
|
||||
formRef?.current?.validateFields().then(() => {
|
||||
modalFormRef?.current?.submit()
|
||||
})
|
||||
|
||||
}}
|
||||
>
|
||||
|
||||
<ProForm
|
||||
// layout={'horizontal'}
|
||||
formRef={modalFormRef}
|
||||
submitter={false}
|
||||
preserve={false}
|
||||
request={async () => {
|
||||
console.log('currentRowcurrentRowdsada', currentRow);
|
||||
|
||||
if (currentRow?.BusinessApproval_ID) {
|
||||
const req: any = {
|
||||
BUSINESSAPPROVALId: currentRow?.BusinessApproval_ID,
|
||||
}
|
||||
const data = await handleGetBUSINESSAPPROVALDetail(req)
|
||||
console.log('datadatadata', data);
|
||||
setBUSINESSAPPROVALDETAIL(data.Result_Data)
|
||||
|
||||
let shopData: any = []
|
||||
if (currentRow?.BusinessProcess_State === 9000) {
|
||||
shopData = await handleGetApprovalCommodityList({
|
||||
ProvinceCode: currentUser?.ProvinceCode,
|
||||
// CommodityId: currentUser?.ProvinceCode,
|
||||
BusinessApprovalId: currentRow?.BusinessApproval_ID,
|
||||
PageIndex: 1,
|
||||
PageSize: 999999,
|
||||
})
|
||||
} else {
|
||||
shopData = await handleGetCOMMODITYRUNNINGList({
|
||||
SearchParameter: {
|
||||
BUSINESSAPPROVAL_ID: currentRow?.BusinessApproval_ID,
|
||||
},
|
||||
PageIndex: 1,
|
||||
pageSize: 999999,
|
||||
})
|
||||
}
|
||||
console.log('shopDatashopDatashopDatashopData', shopData);
|
||||
let shopList: any = shopData.Result_Data.List
|
||||
|
||||
let list: any = []
|
||||
if (shopList && shopList.length > 0) {
|
||||
shopList.forEach((item: any) => {
|
||||
let obj: any = JSON.parse(JSON.stringify(item))
|
||||
obj.newPrice = item.COMMODITY_CURRPRICE
|
||||
obj.COMMODITY_RETAILPRICE = item.COMMODITY_ORIPRICE
|
||||
obj.COMMODITY_CURRPRICE = item.COMMODITY_ORIPRICE
|
||||
obj.COMMODITY_ORIPRICE = null
|
||||
list.push(obj)
|
||||
})
|
||||
}
|
||||
setShopData(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) => {
|
||||
setShowApplyForLoading(true)
|
||||
let list: any = []
|
||||
@ -699,20 +924,35 @@ const ProductChangePriceApproval: React.FC<{ currentUser: CurrentUser }> = (prop
|
||||
list.push(obj)
|
||||
})
|
||||
}
|
||||
let data: any = {}
|
||||
if (currentRow?.BusinessApproval_ID) {
|
||||
const req: any = {
|
||||
ProinstId: currentRow?.BusinessApproval_ID,
|
||||
ProinstName: res.reasonForApplication,
|
||||
UserId: currentUser?.ID,
|
||||
OperateType: "100200",
|
||||
ServerpartId: res.ServerpartId,
|
||||
NextApproveStaffId: res.NextApproveStaffId,
|
||||
NextApproveState: 2000,
|
||||
CommodityRunningList: list
|
||||
}
|
||||
console.log('req', req);
|
||||
|
||||
data = await handleReapplyCommodityProInst(req)
|
||||
} else {
|
||||
const req: any = {
|
||||
ProinstName: res.reasonForApplication,
|
||||
UserId: currentUser?.ID,
|
||||
OperateType: "100200",
|
||||
ServerpartId: res.ServerpartId,
|
||||
NextApproveStaffId: res.NextApproveStaffId,
|
||||
NextApproveState: 2000,
|
||||
CommodityRunningList: list
|
||||
}
|
||||
console.log('req', req);
|
||||
|
||||
const req: any = {
|
||||
ProinstName: res.reasonForApplication,
|
||||
UserId: currentUser?.ID,
|
||||
OperateType: "100200",
|
||||
ServerpartId: res.ServerpartId,
|
||||
NextApproveStaffId: res.NextApproveStaffId,
|
||||
NextApproveState: 2000,
|
||||
CommodityRunningList: list
|
||||
data = await handleCreateCommodityProInst(req)
|
||||
}
|
||||
console.log('req', req);
|
||||
|
||||
const data = await handleCreateCommodityProInst(req)
|
||||
setShowApplyForLoading(false)
|
||||
console.log('dsaidjaskda', data);
|
||||
if (data.Result_Code === 100) {
|
||||
@ -727,7 +967,8 @@ const ProductChangePriceApproval: React.FC<{ currentUser: CurrentUser }> = (prop
|
||||
message.error(data.Result_Desc)
|
||||
}
|
||||
|
||||
}}
|
||||
}
|
||||
}
|
||||
>
|
||||
<Row gutter={8}>
|
||||
<Col span={24}>
|
||||
@ -738,6 +979,7 @@ const ProductChangePriceApproval: React.FC<{ currentUser: CurrentUser }> = (prop
|
||||
required: true,
|
||||
message: "请输入申请原因!"
|
||||
}]}
|
||||
disabled={currentRow?.BusinessProcess_State > 1000 || (currentRow?.BusinessApproval_ID && currentRow?.ApproveStaff_ID !== currentUser?.ID)}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
@ -765,9 +1007,10 @@ const ProductChangePriceApproval: React.FC<{ currentUser: CurrentUser }> = (prop
|
||||
}
|
||||
return list
|
||||
}}
|
||||
disabled={currentRow?.BusinessProcess_State > 1000 || (currentRow?.BusinessApproval_ID && currentRow?.ApproveStaff_ID !== currentUser?.ID)}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Col span={12} style={{ display: currentRow?.BusinessProcess_State > 1000 && ApprovalType !== 0 ? "none" : "" }}>
|
||||
<ProFormSelect
|
||||
label="下一环节审批人"
|
||||
name="NextApproveStaffId"
|
||||
@ -788,13 +1031,23 @@ const ProductChangePriceApproval: React.FC<{ currentUser: CurrentUser }> = (prop
|
||||
const dataState = await handleGetAPPROVALROUTEList(reqState)
|
||||
if (dataState && dataState.length > 0) {
|
||||
let obj: any = {}
|
||||
console.log('dataState', dataState);
|
||||
// 下面的环节
|
||||
let nextList: any = []
|
||||
|
||||
dataState.forEach((item: any) => {
|
||||
if (item.APPROVALROUTE_STATE === 2000) {
|
||||
obj = item
|
||||
}
|
||||
if (item.APPROVALROUTE_STATE >= currentRow?.BusinessProcess_State) {
|
||||
if (item.APPROVALROUTE_STATE === currentRow?.BusinessProcess_State) {
|
||||
item.status = "process"
|
||||
}
|
||||
nextList.push(item)
|
||||
}
|
||||
})
|
||||
|
||||
setNextStepsList(nextList)
|
||||
|
||||
let personTotal: number = obj.APPROVALSTAFF_ID.split(',').length || 0
|
||||
if (personTotal > 0) {
|
||||
let STAFFIDList: number[] = obj.APPROVALSTAFF_ID.split(',')
|
||||
@ -807,36 +1060,276 @@ const ProductChangePriceApproval: React.FC<{ currentUser: CurrentUser }> = (prop
|
||||
}
|
||||
}
|
||||
}}
|
||||
disabled={currentRow?.BusinessProcess_State > 1000 || (currentRow?.BusinessApproval_ID && currentRow?.ApproveStaff_ID !== currentUser?.ID)}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
|
||||
<ProTable
|
||||
search={false}
|
||||
options={false}
|
||||
pagination={false}
|
||||
columns={modalColumns}
|
||||
dataSource={shopData}
|
||||
bordered
|
||||
scroll={{ x: "100%", y: "500px" }}
|
||||
toolbar={{
|
||||
actions: [
|
||||
<Button type={"primary"} onClick={() => {
|
||||
// 判断服务区是否已选择
|
||||
const values = modalFormRef.current?.getFieldsValue();
|
||||
if (!values?.ServerpartId) {
|
||||
message.error("请先选择服务区!");
|
||||
return;
|
||||
}
|
||||
setShowAddShopModal(true);
|
||||
}}>
|
||||
选择商品
|
||||
</Button>
|
||||
]
|
||||
}}
|
||||
/>
|
||||
</ProForm>
|
||||
|
||||
{
|
||||
currentRow?.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: "100200",
|
||||
},
|
||||
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 === currentRow.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)
|
||||
let data: any = {}
|
||||
|
||||
if (ApprovalType === 1) {
|
||||
// 审批
|
||||
const req: any = {
|
||||
businessApprovalId: currentRow?.BusinessApproval_ID,
|
||||
UserId: currentUser?.ID,
|
||||
ApproveInfo: res.ApproveInfo,
|
||||
nextApproveStaffId: res.nextApproveStaffId || "",
|
||||
nextApproveState: nextApproval || ""
|
||||
}
|
||||
|
||||
data = await handleApproveCommodityProInst(req)
|
||||
} else {
|
||||
// 驳回
|
||||
const req: any = {
|
||||
businessApprovalId: currentRow?.BusinessApproval_ID,
|
||||
UserId: currentUser?.ID,
|
||||
RejectInfo: res.ApproveInfo,
|
||||
nextApproveState: res.nextApproveState || ""
|
||||
}
|
||||
console.log('reqreqreqreq', req);
|
||||
|
||||
data = await handleRejectCommodityProInst(req)
|
||||
}
|
||||
setAddApprovalLoading(false)
|
||||
console.log('datadatadata', data);
|
||||
if (data.Result_Code === 100) {
|
||||
message.success(data.Result_Desc)
|
||||
|
||||
setShowApplyFor(false)
|
||||
setCurrentRow(undefined)
|
||||
setSelectRowList([])
|
||||
setSelectedOrderRowKeys([])
|
||||
setShopData([])
|
||||
setShowDetailType(null)
|
||||
|
||||
|
||||
setApproveCurrentRow(undefined)
|
||||
setApproveModal(false)
|
||||
setNextApproval(null)
|
||||
setNextApprovalPerson(null)
|
||||
setApprovaType(0)
|
||||
actionRef.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
|
||||
scroll={{ x: "100%", y: "500px" }}
|
||||
toolbar={{
|
||||
actions: [
|
||||
currentRow?.BusinessProcess_State > 1000 || (currentRow?.BusinessApproval_ID && currentRow?.ApproveStaff_ID !== currentUser?.ID) ? '' : <Button type={"primary"} onClick={() => {
|
||||
// 判断服务区是否已选择
|
||||
const values = modalFormRef.current?.getFieldsValue();
|
||||
if (!values?.ServerpartId) {
|
||||
message.error("请先选择服务区!");
|
||||
return;
|
||||
}
|
||||
setShowAddShopModal(true);
|
||||
}}>
|
||||
选择商品
|
||||
</Button>
|
||||
]
|
||||
}}
|
||||
/>
|
||||
|
||||
{
|
||||
currentRow?.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}
|
||||
>
|
||||
{/* <Step
|
||||
style={{ minWidth: 180, maxWidth: 220 }}
|
||||
status={currentRow?.BusinessProcess_State > 1000 ? 'finish' : 'wait'}
|
||||
title="发起申请"
|
||||
description={
|
||||
<div>
|
||||
<Tooltip title={`${currentRow?.Staff_Name || ''}${currentRow?.BusinessProcess_Desc ? `:${currentRow?.BusinessProcess_Desc}` : ''}`}>
|
||||
<p>{`${currentRow?.BusinessProcess_StartDate || ''}`}</p>
|
||||
</Tooltip>
|
||||
</div>
|
||||
}
|
||||
/> */}
|
||||
{
|
||||
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>
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,16 @@
|
||||
.addProductModal {
|
||||
.ant-modal-content {
|
||||
.ant-modal-body {
|
||||
.ProcessProgress {
|
||||
.ant-card-body {
|
||||
.ProcessProgressBox {
|
||||
.multi-line-steps {
|
||||
flex-wrap: wrap !important;
|
||||
display: flex !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -19,13 +19,12 @@ import type { ConnectState } from '@/models/connect';
|
||||
import type { ActionType, ProColumns } from '@ant-design/pro-table';
|
||||
import type { ProDescriptionsItemProps } from '@ant-design/pro-descriptions';
|
||||
import type { FormInstance } from 'antd';
|
||||
import type { COMMODITYModel } from './data';
|
||||
|
||||
import { getFieldEnumTree, getFieldEnumName } from "@/services/options"; // 枚举的引用,没有使用可以删除
|
||||
import { getList, delcommodity, updatecommodity } from './service'; // 接口相关对象的引用
|
||||
import PageTitleBox from "@/components/PageTitleBox";
|
||||
import LeftSelectMallType from './component/LeftSelectMallType';
|
||||
import { handeDeleteCOMMODITY, handeGetCOMMODITY_MULTIList, handeGetCOMMODITYDetail, handeGetCOMMODITYList, handeSynchroCOMMODITY, handleGetBRANDList } from '../service';
|
||||
import { handeDeleteCOMMODITY, handeGetCOMMODITY_MULTIList, handeGetCOMMODITYDetail, handeGetCOMMODITYList, handeGetMERCHANTSList, handeGetRTCOMMODITY_MULTIList, handeSynchroCOMMODITY, handleGetBRANDList, handlGetUSERDEFINEDTYPEList } from '../service';
|
||||
import session from '@/utils/session';
|
||||
|
||||
|
||||
@ -33,7 +32,7 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
const { currentUser } = props
|
||||
const actionRef = useRef<ActionType>();
|
||||
const formRef = useRef<FormInstance>();
|
||||
const [currentRow, setCurrentRow] = useState<COMMODITYModel>();
|
||||
const [currentRow, setCurrentRow] = useState<any>();
|
||||
const [showDetail, setShowDetail] = useState<boolean>();
|
||||
const [modalVisible, handleModalVisible] = useState<boolean>();
|
||||
const [confirmLoading, handleConfirmLoading] = useState<boolean>(false) // 弹出框的内容表单是否在提交
|
||||
@ -56,16 +55,21 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
const COMMODITYGRADEList = session.get('COMMODITYGRADEList')
|
||||
// 在proform里面的品牌查询列表
|
||||
const [BRAND_NAMEList, setBRAND_NAMEList] = useState<any>()
|
||||
// 供货商户数据
|
||||
const [COMMODITYSUPPLIERLIST, setCOMMODITYSUPPLIERLIST] = useState<any>()
|
||||
// 拿到左侧树的数据
|
||||
const [leftTreeData, setLeftTreeData] = useState<any>()
|
||||
// 多规格
|
||||
const [showMoreSpecs, setShowMoreSpecs] = useState<boolean>(false)
|
||||
// 新增规格的 悬浮框
|
||||
const [showAddSpecsModal, setShowAddSpecsModal] = useState<boolean>(false)
|
||||
|
||||
|
||||
// 树相关的属性和方法
|
||||
const [selectedId, setSelectedId] = useState<string>()
|
||||
// 选择的规格内容
|
||||
const [selectedRowKeys, setSelectedRowKeys] = useState<any>()
|
||||
const [selectedRows, setSelectedRows] = useState<any>()
|
||||
|
||||
|
||||
|
||||
const onDraggaleStart = (event, uiData) => {
|
||||
const { clientWidth, clientHeight } = window.document.documentElement;
|
||||
@ -302,21 +306,21 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
valueType: 'index',
|
||||
},
|
||||
{
|
||||
dataIndex: '',
|
||||
dataIndex: 'USERDEFINEDTYPE_NAME',
|
||||
title: '规格分类',
|
||||
align: 'center',
|
||||
width: 150,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
dataIndex: '',
|
||||
dataIndex: 'COMMODITY_NAME',
|
||||
title: '规格名称',
|
||||
align: 'center',
|
||||
width: 200,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
dataIndex: '',
|
||||
dataIndex: 'supplier',
|
||||
title: '供应商',
|
||||
align: 'center',
|
||||
width: 200,
|
||||
@ -341,24 +345,40 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
req = {
|
||||
...currentRow,
|
||||
...res,
|
||||
BRAND_ID: res.BRAND_ID.split('-')[1],
|
||||
BRAND_NAME: res.BRAND_ID.split('-')[0],
|
||||
MERCHANTS_ID: res.MERCHANTS_ID.split('-')[1],
|
||||
MERCHANTS_NAME: res.MERCHANTS_ID.split('-')[0],
|
||||
OWNERUNIT_ID: currentUser?.OwnerUnitId,
|
||||
OWNERUNIT_NAME: currentUser?.OwnerUnitName,
|
||||
PROVINCE_CODE: currentUser?.ProvinceCode,
|
||||
OPERATE_PERSON: currentUser?.ID,
|
||||
COMMODITY_TYPE: 4000,
|
||||
COMMODITY_STATE: 1,
|
||||
OPERATE_TIME: moment().format('YYYY-MM-DD HH:mm:ss'),
|
||||
UPPER_DATE: res.UPPER_DATE && res.UPPER_DATE.length > 0 ? moment(res.UPPER_DATE[0]).format('YYYY-MM-DD HH:mm:ss') : "",
|
||||
OFF_DATE: res.UPPER_DATE && res.UPPER_DATE.length > 0 ? moment(res.UPPER_DATE[1]).format('YYYY-MM-DD HH:mm:ss') : "",
|
||||
}
|
||||
} else {
|
||||
req = {
|
||||
...res,
|
||||
BRAND_ID: res.BRAND_ID.split('-')[1],
|
||||
BRAND_NAME: res.BRAND_ID.split('-')[0],
|
||||
MERCHANTS_ID: res.MERCHANTS_ID.split('-')[1],
|
||||
MERCHANTS_NAME: res.MERCHANTS_ID.split('-')[0],
|
||||
OWNERUNIT_ID: currentUser?.OwnerUnitId,
|
||||
OWNERUNIT_NAME: currentUser?.OwnerUnitName,
|
||||
PROVINCE_CODE: currentUser?.ProvinceCode,
|
||||
OPERATE_PERSON: currentUser?.ID,
|
||||
COMMODITY_TYPE: 4000,
|
||||
COMMODITY_STATE: 1,
|
||||
OPERATE_TIME: moment().format('YYYY-MM-DD HH:mm:ss'),
|
||||
UPPER_DATE: res.UPPER_DATE && res.UPPER_DATE.length > 0 ? moment(res.UPPER_DATE[0]).format('YYYY-MM-DD HH:mm:ss') : "",
|
||||
OFF_DATE: res.UPPER_DATE && res.UPPER_DATE.length > 0 ? moment(res.UPPER_DATE[1]).format('YYYY-MM-DD HH:mm:ss') : "",
|
||||
}
|
||||
}
|
||||
console.log('reqreqreqreq', req);
|
||||
|
||||
const data = await handeSynchroCOMMODITY(req)
|
||||
handleConfirmLoading(false)
|
||||
if (data.Result_Code === 100) {
|
||||
@ -372,6 +392,31 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
}
|
||||
};
|
||||
|
||||
// 拿到类别列表里面得规格
|
||||
const collectItemsWithCommodityMultiId = (data: any, result = []) => {
|
||||
// 检查输入是否为数组
|
||||
if (!Array.isArray(data)) {
|
||||
return result;
|
||||
}
|
||||
|
||||
// 遍历数组中的每一项
|
||||
for (const item of data) {
|
||||
// 检查是否是对象且包含 COMMODITY_MULTI_ID 属性
|
||||
if (typeof item === 'object' && item !== null && 'COMMODITY_MULTI_ID' in item && item.COMMODITY_MULTI_ID) {
|
||||
result.push(item);
|
||||
}
|
||||
|
||||
// 递归检查所有可能包含子数组的属性
|
||||
for (const key in item) {
|
||||
if (Array.isArray(item[key])) {
|
||||
collectItemsWithCommodityMultiId(item[key], result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div style={{ backgroundColor: '#fff', display: 'flex' }}>
|
||||
@ -383,7 +428,7 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
paddingRight: 0
|
||||
}}>
|
||||
{/* 最外层的列表 */}
|
||||
<ProTable<COMMODITYModel>
|
||||
<ProTable
|
||||
scroll={{ x: "100%", y: 'calc(100vh - 370px)' }}
|
||||
rowKey={(record) => {
|
||||
return `${record?.COMMODITY_ID}`
|
||||
@ -405,7 +450,8 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
USERDEFINEDTYPE_IDS: selectedId,
|
||||
UPPER_STATE: params?.UPPER_STATE,
|
||||
DUTY_PARAGRAPH: params?.DUTY_PARAGRAPH === "-1" ? "" : params?.DUTY_PARAGRAPH,
|
||||
COMMODITY_TYPE: 4000
|
||||
COMMODITY_TYPE: 4000,
|
||||
COMMODITY_STATE: 1,
|
||||
},
|
||||
PageIndex: 1,
|
||||
PageSize: 999999,
|
||||
@ -454,27 +500,28 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
</div>
|
||||
{/* 添加商品的悬浮框 */}
|
||||
<Modal
|
||||
title={
|
||||
<div
|
||||
style={{
|
||||
width: '100%',
|
||||
cursor: 'move',
|
||||
}}
|
||||
onMouseOver={() => {
|
||||
if (disabled) {
|
||||
setDraggleDisabled(false)
|
||||
}
|
||||
}}
|
||||
onMouseOut={() => {
|
||||
setDraggleDisabled(true)
|
||||
}}
|
||||
title={currentRow ? '更新商品管理' : '新建商品管理'}
|
||||
// title={
|
||||
// <div
|
||||
// style={{
|
||||
// width: '100%',
|
||||
// cursor: 'move',
|
||||
// }}
|
||||
// onMouseOver={() => {
|
||||
// if (disabled) {
|
||||
// setDraggleDisabled(false)
|
||||
// }
|
||||
// }}
|
||||
// onMouseOut={() => {
|
||||
// setDraggleDisabled(true)
|
||||
// }}
|
||||
|
||||
onFocus={() => { }}
|
||||
onBlur={() => { }}
|
||||
>
|
||||
{currentRow ? '更新商品管理' : '新建商品管理'}
|
||||
</div>
|
||||
}
|
||||
// onFocus={() => { }}
|
||||
// onBlur={() => { }}
|
||||
// >
|
||||
// {currentRow ? '更新商品管理' : '新建商品管理'}
|
||||
// </div>
|
||||
// }
|
||||
destroyOnClose={true}
|
||||
width={'70%'}
|
||||
visible={modalVisible}
|
||||
@ -486,7 +533,7 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
onCancel={() => {
|
||||
handleConfirmLoading(false)
|
||||
handleModalVisible(false)
|
||||
setBRAND_NAMEList([])
|
||||
// setBRAND_NAMEList([])
|
||||
}}
|
||||
|
||||
footer={<div style={{ width: '100%', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
|
||||
@ -506,7 +553,7 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
handleModalVisible(false)
|
||||
setBRAND_NAMEList([])
|
||||
}}>取 消</Button>
|
||||
<Button type={"primary"} onClick={() => {
|
||||
<Button type={"primary"} loading={confirmLoading} onClick={() => {
|
||||
formRef?.current?.validateFields().then(() => {
|
||||
handleConfirmLoading(true)
|
||||
formRef?.current?.submit()
|
||||
@ -520,15 +567,15 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
formRef?.current?.submit()
|
||||
})
|
||||
}}
|
||||
modalRender={(modal) => {
|
||||
return <Draggable
|
||||
disabled={disabled}
|
||||
bounds={bounds}
|
||||
onStart={(event, uiData) => onDraggaleStart(event, uiData)}
|
||||
>
|
||||
<div ref={draggleRef}>{modal}</div>
|
||||
</Draggable>
|
||||
}}
|
||||
// modalRender={(modal) => {
|
||||
// return <Draggable
|
||||
// disabled={disabled}
|
||||
// bounds={bounds}
|
||||
// onStart={(event, uiData) => onDraggaleStart(event, uiData)}
|
||||
// >
|
||||
// <div ref={draggleRef}>{modal}</div>
|
||||
// </Draggable>
|
||||
// }}
|
||||
>
|
||||
<ProForm
|
||||
layout={'horizontal'}
|
||||
@ -536,23 +583,20 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
autoFocusFirstInput
|
||||
submitter={false}
|
||||
preserve={false}
|
||||
initialValues={currentRow}
|
||||
initialValues={currentRow ? currentRow : {
|
||||
OPERATE_PERSON: currentUser?.Name,
|
||||
UPPER_STATE: currentUser?.SupplierID ? 0 : ""
|
||||
}}
|
||||
onFinish={async (values) => {
|
||||
let newValue: COMMODITYModel = { ...values };
|
||||
let newValue: any = { ...values };
|
||||
if (currentRow) {
|
||||
// 编辑数据
|
||||
newValue = { ...values, COMMODITY_ID: currentRow.COMMODITY_ID };
|
||||
}
|
||||
// 如果有开关,要把开关的代码写进去
|
||||
const success = await handleAddUpdate(newValue as COMMODITYModel);
|
||||
await handleAddUpdate(newValue);
|
||||
|
||||
handleConfirmLoading(false)
|
||||
if (success) {
|
||||
if (actionRef.current) {
|
||||
actionRef.current.reload();
|
||||
}
|
||||
handleModalVisible(false);
|
||||
}
|
||||
handleModalVisible(false);
|
||||
}}
|
||||
>
|
||||
<Row gutter={8}>
|
||||
@ -587,6 +631,8 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
name="BRAND_ID"
|
||||
label="商品品牌"
|
||||
request={async () => {
|
||||
console.log('BRAND_NAMEListBRAND_NAMEListBRAND_NAMEList', BRAND_NAMEList);
|
||||
|
||||
if (BRAND_NAMEList && BRAND_NAMEList.length > 0) {
|
||||
return BRAND_NAMEList
|
||||
} else {
|
||||
@ -602,20 +648,23 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
SortStr: "BRAND_INDEX,OPERATE_DATE"
|
||||
}
|
||||
const data = await handleGetBRANDList(req)
|
||||
console.log('datadatadatadatadata', data);
|
||||
if (data.List && data.List.length > 0) {
|
||||
setBRAND_NAMEList(data.List)
|
||||
return data.List
|
||||
let list: any = []
|
||||
data.List.forEach((item: any) => {
|
||||
list.push({ label: item.BRAND_NAME, value: `${item.BRAND_NAME}-${item.BRAND_ID}` })
|
||||
})
|
||||
|
||||
setBRAND_NAMEList(list)
|
||||
return list
|
||||
}
|
||||
setBRAND_NAMEList([])
|
||||
return []
|
||||
}
|
||||
}}
|
||||
fieldProps={{
|
||||
fieldNames: {
|
||||
label: 'BRAND_NAME',
|
||||
value: 'BRAND_ID'
|
||||
},
|
||||
// fieldNames: {
|
||||
// label: 'BRAND_NAME',
|
||||
// value: 'BRAND_ID'
|
||||
// },
|
||||
showSearch: true,
|
||||
filterOption: (input, node) =>
|
||||
(node.BRAND_NAME || '').toLowerCase().includes(input.toLowerCase())
|
||||
@ -630,7 +679,7 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<ProFormTreeSelect
|
||||
name="USERDEFINEDTYPE_IDS"
|
||||
name="USERDEFINEDTYPE_ID"
|
||||
label="商品分类"
|
||||
request={async () => {
|
||||
return leftTreeData
|
||||
@ -648,15 +697,52 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<ProFormSelect
|
||||
name="COMMODITY_SUPPLIER"
|
||||
<ProFormTreeSelect
|
||||
name="MERCHANTS_ID"
|
||||
label="供货商户"
|
||||
request={async () => {
|
||||
if (COMMODITYSUPPLIERLIST && COMMODITYSUPPLIERLIST.length > 0) {
|
||||
return COMMODITYSUPPLIERLIST
|
||||
} else {
|
||||
const req = {
|
||||
searchParameter: {
|
||||
OWNERUNIT_ID: currentUser?.OwnerUnitId,
|
||||
PROVINCE_CODE: currentUser?.ProvinceCode,
|
||||
MERCHANTS_TYPE: ""
|
||||
},
|
||||
PageIndex: 1,
|
||||
PageSize: 999999,
|
||||
}
|
||||
const data = await handeGetMERCHANTSList(req);
|
||||
console.log('datadatadatadatadata', data);
|
||||
if (data.List && data.List.length > 0) {
|
||||
let list: any = []
|
||||
data.List.forEach((item: any) => {
|
||||
list.push({ label: item.MERCHANTS_NAME, value: `${item.MERCHANTS_NAME}-${item.MERCHANTS_ID}` })
|
||||
})
|
||||
setCOMMODITYSUPPLIERLIST(list)
|
||||
return list
|
||||
}
|
||||
setCOMMODITYSUPPLIERLIST([])
|
||||
return []
|
||||
}
|
||||
}}
|
||||
fieldProps={{
|
||||
// fieldNames: {
|
||||
// label: 'MERCHANTS_NAME',
|
||||
// value: 'MERCHANTS_ID'
|
||||
// },
|
||||
showSearch: true,
|
||||
filterTreeNode: (input, node) =>
|
||||
(node.MERCHANTS_NAME || '').toLowerCase().includes(input.toLowerCase())
|
||||
}}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: "请选择供货商户"
|
||||
}
|
||||
]}
|
||||
|
||||
/>
|
||||
</Col>
|
||||
<Divider orientation="left">商品信息</Divider>
|
||||
@ -798,7 +884,7 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
/>
|
||||
</Col>
|
||||
<Col span={6}>
|
||||
<ProFormMoney
|
||||
<ProFormDigit
|
||||
name="COMMODITY_POINT"
|
||||
label="兑换积分"
|
||||
/>
|
||||
@ -812,7 +898,7 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
/>
|
||||
</Col>
|
||||
<Col span={6}>
|
||||
<ProFormSelect
|
||||
<ProFormText
|
||||
name="DELIVER_AREA"
|
||||
label="配送区域"
|
||||
/>
|
||||
@ -833,8 +919,13 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
<Divider orientation="left">上架信息</Divider>
|
||||
<Col span={12}>
|
||||
<ProFormDateRangePicker
|
||||
width={'lg'}
|
||||
name="UPPER_DATE"
|
||||
label="上架时间"
|
||||
rules={[{
|
||||
required: true,
|
||||
message: "请选择上架时间!"
|
||||
}]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={6}>
|
||||
@ -879,6 +970,7 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
{ label: "未上架", value: 0 },
|
||||
{ label: "已上架", value: 1 },
|
||||
]}
|
||||
disabled={currentUser?.SupplierID ? true : false}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={6}>
|
||||
@ -888,6 +980,13 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
options={[
|
||||
{ label: "正式数据", value: 1 },
|
||||
{ label: "测试数据", value: 0 },
|
||||
{ label: "品诺数据", value: 2 },
|
||||
]}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: "请选择数据形式!"
|
||||
}
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
@ -895,6 +994,7 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
<ProFormText
|
||||
name="OPERATE_PERSON"
|
||||
label="操作人员"
|
||||
disabled
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
@ -939,6 +1039,7 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
const data = await handeGetCOMMODITY_MULTIList(req)
|
||||
console.log('多规格管理', data);
|
||||
|
||||
return selectedRows
|
||||
}}
|
||||
/>
|
||||
|
||||
@ -954,7 +1055,7 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
setShowAddSpecsModal(false)
|
||||
}}
|
||||
onOk={async () => { // 提交框内的数据
|
||||
|
||||
setShowAddSpecsModal(false)
|
||||
}}
|
||||
>
|
||||
<ProTable
|
||||
@ -962,18 +1063,38 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
||||
pagination={false}
|
||||
options={false}
|
||||
columns={addSpecsCoumns}
|
||||
scroll={{ x: "100%" }}
|
||||
scroll={{ x: "100%", y: '400px' }}
|
||||
rowKey={"COMMODITY_MULTI_ID"}
|
||||
rowSelection={{
|
||||
type: 'checkbox', // 多选,单选用 'radio'
|
||||
onChange: (selectedRowKeys, selectedRows) => {
|
||||
console.log(selectedRowKeys, selectedRows);
|
||||
setSelectedRowKeys(selectedRowKeys)
|
||||
setSelectedRows(selectedRows)
|
||||
},
|
||||
}}
|
||||
request={async () => {
|
||||
const req = {
|
||||
searchParameter: {
|
||||
OWNERUNIT_ID: currentUser?.OwnerUnitId,
|
||||
PROVINCE_CODE: "",
|
||||
GOODSTYPE: 6000,
|
||||
USERDEFINEDTYPE_STATE: 1
|
||||
},
|
||||
PageIndex: 1,
|
||||
PageSize: 999999,
|
||||
}
|
||||
const data = await handeGetCOMMODITY_MULTIList(req);
|
||||
console.log('datadatadatadata', data);
|
||||
let list = data.List
|
||||
if (list && list.length > 0) {
|
||||
return { data: list, success: true }
|
||||
}
|
||||
return { data: [], success: true }
|
||||
}}
|
||||
/>
|
||||
|
||||
</Modal>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@ -9,7 +9,7 @@ import Draggable from 'react-draggable';
|
||||
import SubMenu from "antd/lib/menu/SubMenu";
|
||||
import ProTable from '@ant-design/pro-table';
|
||||
import ProDescriptions from '@ant-design/pro-descriptions';
|
||||
import ProForm, { ProFormDatePicker, ProFormDateTimePicker, ProFormMoney, ProFormSelect, ProFormText, ProFormTextArea, ProFormUploadButton } from '@ant-design/pro-form';
|
||||
import ProForm, { ProFormDatePicker, ProFormDateTimePicker, ProFormDigit, ProFormMoney, ProFormSelect, ProFormText, ProFormTextArea, ProFormTreeSelect, ProFormUploadButton } from '@ant-design/pro-form';
|
||||
import { MenuFoldOutlined, PlusOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
|
||||
import { PageContainer } from '@ant-design/pro-layout';
|
||||
import { Button, Col, Drawer, message, Row, Popconfirm, Space, Image, Modal, Form, Switch, Upload, Tooltip, Descriptions, TreeSelect } from 'antd';
|
||||
@ -22,6 +22,8 @@ import type { FormInstance } from 'antd';
|
||||
|
||||
import { getFieldEnumTree, getFieldEnumName } from "@/services/options"; // 枚举的引用,没有使用可以删除
|
||||
import PageTitleBox from "@/components/PageTitleBox";
|
||||
import { handeDeleteCOMMODITY_MULTI, handeSynchroCOMMODITY_MULTI, handlDeleteUSERDEFINEDTYPE, handlGetUSERDEFINEDTYPEList, handlSynchroUSERDEFINEDTYPE } from '../service';
|
||||
import { render } from 'react-dom';
|
||||
|
||||
|
||||
const ProductSpecificationManage: React.FC<{ currentUser: CurrentUser | undefined }> = (props) => {
|
||||
@ -38,6 +40,10 @@ const ProductSpecificationManage: React.FC<{ currentUser: CurrentUser | undefine
|
||||
const [bounds, setBounds] = useState<{ left: number, right: number, top: number, bottom: number }>() // 移动的位置
|
||||
const [disabled, setDraggleDisabled] = useState<boolean>() // 是否拖动
|
||||
const draggleRef = React.createRef<any>()
|
||||
// 添加处理的类型 1 为类别 2 为 规格
|
||||
const [dataType, setDataType] = useState<number>(0)
|
||||
// 表格数据
|
||||
const [tableData, setTableData] = useState<any>()
|
||||
|
||||
const onDraggaleStart = (event, uiData) => {
|
||||
const { clientWidth, clientHeight } = window.document.documentElement;
|
||||
@ -55,59 +61,100 @@ const ProductSpecificationManage: React.FC<{ currentUser: CurrentUser | undefine
|
||||
|
||||
// 定义列表字段内容
|
||||
const columns: any = [
|
||||
{
|
||||
dataIndex: 'PROVINCE_CODE',
|
||||
title: '省份编码',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'COMMODITY_NAME',
|
||||
title: '商品名称',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'USERDEFINEDTYPE_NAME',
|
||||
title: '类别名称',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
width: 200,
|
||||
ellipsis: true,
|
||||
render: (_, record) => {
|
||||
return record?.COMMODITY_NAME || record?.USERDEFINEDTYPE_NAME || "-"
|
||||
}
|
||||
},
|
||||
{
|
||||
dataIndex: 'COMMODITY_STATE',
|
||||
title: '商品状态',
|
||||
dataIndex: 'USERDEFINEDTYPE_INDEX',
|
||||
title: '类别索引',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
width: 150,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'USERDEFINEDTYPE_STATE',
|
||||
title: '有效状态',
|
||||
align: 'center',
|
||||
width: 150,
|
||||
ellipsis: true,
|
||||
valueEnum: {
|
||||
"1": "有效",
|
||||
"0": "无效"
|
||||
},
|
||||
initialValue: "1",
|
||||
render: (_, record) => {
|
||||
return record?.COMMODITY_STATE === 1 || record?.USERDEFINEDTYPE_STATE === 1 ? '有效' : '无效'
|
||||
}
|
||||
},
|
||||
{
|
||||
dataIndex: 'USERDEFINEDTYPE_DATE',
|
||||
title: '添加时间',
|
||||
width: 200,
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
render: (_, record) => {
|
||||
return record?.USERDEFINEDTYPE_DATE ? moment(record?.USERDEFINEDTYPE_DATE).format('YYYY-MM-DD HH:mm:ss') : "-"
|
||||
}
|
||||
},
|
||||
{
|
||||
dataIndex: 'OPERATE_DATE',
|
||||
title: '操作时间',
|
||||
valueType: 'fromNow',
|
||||
width: 200,
|
||||
align: 'center',
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
render: (_, record) => {
|
||||
return record?.OPERATE_DATE ? moment(record?.OPERATE_DATE).format('YYYY-MM-DD HH:mm:ss') : "-"
|
||||
}
|
||||
},
|
||||
{
|
||||
dataIndex: 'COMMODITY_DESC',
|
||||
dataIndex: 'USERDEFINEDTYPE_DESC',
|
||||
title: '备注说明',
|
||||
width: 250,
|
||||
align: 'center',
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
render: (_, record) => {
|
||||
return record?.COMMODITY_DESC || record?.USERDEFINEDTYPE_DESC
|
||||
}
|
||||
},
|
||||
{
|
||||
dataIndex: 'STAFF_NAME',
|
||||
title: '操作员名称',
|
||||
width: 150,
|
||||
align: 'center',
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'option',
|
||||
title: '操作',
|
||||
width: 150,
|
||||
valueType: 'option',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
render: (_, record) => {
|
||||
return (
|
||||
<Space>
|
||||
<a
|
||||
onClick={() => {
|
||||
if (record?.COMMODITY_MULTI_ID) {
|
||||
setDataType(2)
|
||||
} else {
|
||||
setDataType(1)
|
||||
}
|
||||
console.log('recordrecord', record);
|
||||
|
||||
setCurrentRow({ ...record });
|
||||
handleModalVisible(true);
|
||||
}}
|
||||
@ -117,7 +164,11 @@ const ProductSpecificationManage: React.FC<{ currentUser: CurrentUser | undefine
|
||||
<Popconfirm
|
||||
title="确认删除该商品多规格列表信息吗?"
|
||||
onConfirm={async () => {
|
||||
await handelDelete(record.COMMODITY_MULTI_ID);
|
||||
if (record?.COMMODITY_MULTI_ID) {
|
||||
await handelDeleteSpecifications(record.COMMODITY_MULTI_ID);
|
||||
} else {
|
||||
await handelDelete(record.USERDEFINEDTYPE_ID);
|
||||
}
|
||||
}}
|
||||
>
|
||||
<a>删除</a>
|
||||
@ -128,53 +179,161 @@ const ProductSpecificationManage: React.FC<{ currentUser: CurrentUser | undefine
|
||||
},
|
||||
];
|
||||
|
||||
// const handelDelete = async (commodity_multiid: number) => {
|
||||
// const result = await delcommodity_multi({ commodity_multiid: commodity_multiid });
|
||||
|
||||
// if (result.Result_Code !== 100) {
|
||||
// message.error(`${result.Result_Desc}` || `${result.Result_Code}:删除失败`);
|
||||
// } else {
|
||||
// message.success('删除成功!');
|
||||
// actionRef.current?.reload()
|
||||
// }
|
||||
// };
|
||||
// 删除类别
|
||||
const handelDelete = async (id: number) => {
|
||||
const result = await handlDeleteUSERDEFINEDTYPE({ USERDEFINEDTYPEId: id });
|
||||
|
||||
// const handleAddUpdate = async (fields: COMMODITY_MULTIModel) => {
|
||||
// const hide = message.loading('正在提交...');
|
||||
if (result.Result_Code !== 100) {
|
||||
message.error(`${result.Result_Desc}` || `${result.Result_Code}:删除失败`);
|
||||
} else {
|
||||
message.success('删除成功!');
|
||||
actionRef.current?.reload()
|
||||
}
|
||||
};
|
||||
// 删除规格
|
||||
const handelDeleteSpecifications = async (id: any) => {
|
||||
const result = await handeDeleteCOMMODITY_MULTI({ COMMODITY_MULTIId: id });
|
||||
|
||||
// const result = await updatecommodity_multi(fields);
|
||||
// hide();
|
||||
// if (result.Result_Code !== 100) {
|
||||
// message.error(`${result.Result_Desc}` || `${result.Result_Code}:提交失败`);
|
||||
// return false;
|
||||
// }
|
||||
// return result.Result_Data ? result.Result_Data : true;
|
||||
// };
|
||||
if (result.Result_Code !== 100) {
|
||||
message.error(`${result.Result_Desc}` || `${result.Result_Code}:删除失败`);
|
||||
} else {
|
||||
message.success('删除成功!');
|
||||
actionRef.current?.reload()
|
||||
}
|
||||
}
|
||||
|
||||
// 同步类别
|
||||
const handleAddUpdate = async (res: any) => {
|
||||
let req: any = {}
|
||||
if (currentRow?.USERDEFINEDTYPE_ID) {
|
||||
req = {
|
||||
...currentRow,
|
||||
...res,
|
||||
GOODSTYPE: 6000,
|
||||
OPERATE_TIME: moment().format('YYYY-MM-DD HH:mm:ss'),
|
||||
STAFF_ID: currentUser?.ID,
|
||||
STAFF_NAME: currentUser?.Name
|
||||
}
|
||||
} else {
|
||||
req = {
|
||||
...res,
|
||||
GOODSTYPE: 6000,
|
||||
OPERATE_DATE: moment().format('YYYY-MM-DD HH:mm:ss'),
|
||||
STAFF_ID: currentUser?.ID,
|
||||
STAFF_NAME: currentUser?.Name,
|
||||
USERDEFINEDTYPE_DATE: moment().format('YYYY-MM-DD HH:mm:ss'),
|
||||
OWNERUNIT_ID: currentUser?.OwnerUnitId,
|
||||
PROVINCE_CODE: currentUser?.ProvinceCode
|
||||
}
|
||||
}
|
||||
console.log('reqreqreqreq', req);
|
||||
|
||||
const data = await handlSynchroUSERDEFINEDTYPE(req)
|
||||
handleConfirmLoading(false)
|
||||
if (data.Result_Code === 100) {
|
||||
message.success("新增成功!")
|
||||
setCurrentRow(undefined)
|
||||
formRef?.current?.resetFields()
|
||||
handleModalVisible(false)
|
||||
actionRef.current?.reload()
|
||||
} else {
|
||||
message.error(data.Result_Desc)
|
||||
}
|
||||
};
|
||||
|
||||
const handleAddUpdateSpecifications = async (res: any) => {
|
||||
console.log('res', res);
|
||||
|
||||
let req: any = {}
|
||||
if (currentRow?.COMMODITY_MULTI_ID) {
|
||||
req = {
|
||||
...currentRow,
|
||||
...res,
|
||||
OPERATE_TIME: moment().format('YYYY-MM-DD HH:mm:ss'),
|
||||
STAFF_ID: currentUser?.ID,
|
||||
STAFF_NAME: currentUser?.Name
|
||||
}
|
||||
} else {
|
||||
req = {
|
||||
...res,
|
||||
OPERATE_DATE: moment().format('YYYY-MM-DD HH:mm:ss'),
|
||||
STAFF_ID: currentUser?.ID,
|
||||
STAFF_NAME: currentUser?.Name,
|
||||
PROVINCE_CODE: currentUser?.ProvinceCode
|
||||
}
|
||||
}
|
||||
console.log('reqreqreqreq', req);
|
||||
|
||||
const data = await handeSynchroCOMMODITY_MULTI(req)
|
||||
handleConfirmLoading(false)
|
||||
if (data.Result_Code === 100) {
|
||||
message.success("新增成功!")
|
||||
setCurrentRow(undefined)
|
||||
formRef?.current?.resetFields()
|
||||
handleModalVisible(false)
|
||||
actionRef.current?.reload()
|
||||
} else {
|
||||
message.error(data.Result_Desc)
|
||||
}
|
||||
}
|
||||
|
||||
// 递归处理表格数据
|
||||
const transformMultiRuleToChildren = (data: any) => {
|
||||
if (!Array.isArray(data)) {
|
||||
return data;
|
||||
}
|
||||
return data.map(item => {
|
||||
// 创建新对象,避免修改原对象
|
||||
const newItem = { ...item };
|
||||
// 如果存在 MultiRuleList,则转换为 children
|
||||
if (newItem.MultiRuleList) {
|
||||
newItem.children = transformMultiRuleToChildren(newItem.MultiRuleList);
|
||||
// 如果需要保留原 MultiRuleList 可以注释下面这行
|
||||
// delete newItem.MultiRuleList;
|
||||
}
|
||||
// 递归处理其他可能的嵌套数组
|
||||
Object.keys(newItem).forEach(key => {
|
||||
if (Array.isArray(newItem[key]) && key !== 'children') {
|
||||
newItem[key] = transformMultiRuleToChildren(newItem[key]);
|
||||
}
|
||||
});
|
||||
return newItem;
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div style={{ backgroundColor: '#fff', display: 'flex' }}>
|
||||
<ProTable<COMMODITY_MULTIModel>
|
||||
style={{ height: 'calc(100vh - 135px)', background: '#fff' }}
|
||||
scroll={{ y: 'calc(100vh - 410px)' }}
|
||||
<ProTable
|
||||
scroll={{ x: "100%", y: 'calc(100vh - 410px)' }}
|
||||
rowKey={(record) => {
|
||||
return `${record?.COMMODITY_MULTI_ID}`
|
||||
return `${record?.USERDEFINEDTYPE_ID}-${record?.COMMODITY_MULTI_ID}`
|
||||
}}
|
||||
formRef={formRef}
|
||||
headerTitle={<PageTitleBox props={props} />} // 列表表头
|
||||
actionRef={actionRef}
|
||||
bordered
|
||||
search={{ span: 6, labelWidth: 'auto' }}
|
||||
pagination={false}
|
||||
// 请求数据
|
||||
request={async (params, sorter) => {
|
||||
|
||||
const searchWholeParams = {
|
||||
searchParameter: { ...params },
|
||||
sortstr: sortstr.length ? sortstr.toString() : "",
|
||||
pagesize: 999999
|
||||
const req = {
|
||||
OWNERUNIT_ID: currentUser?.OwnerUnitId,
|
||||
PROVINCE_CODE: "",
|
||||
GOODSTYPE: 6000,
|
||||
USERDEFINEDTYPE_STATE: params?.USERDEFINEDTYPE_STATE
|
||||
}
|
||||
setSearchParams(searchWholeParams)
|
||||
const data = await getList(searchWholeParams);
|
||||
return data;
|
||||
console.log('req', req);
|
||||
|
||||
const data = await handlGetUSERDEFINEDTYPEList(req);
|
||||
setTableData(data)
|
||||
if (data && data.length > 0) {
|
||||
let list: any = transformMultiRuleToChildren(data)
|
||||
console.log('listlistlistlist', list);
|
||||
return { data: list, success: true, total: data.length }
|
||||
}
|
||||
return { data: [], success: true }
|
||||
}}
|
||||
columns={columns}
|
||||
toolbar={{
|
||||
@ -185,10 +344,22 @@ const ProductSpecificationManage: React.FC<{ currentUser: CurrentUser | undefine
|
||||
icon={<PlusOutlined />}
|
||||
type="primary"
|
||||
onClick={() => {
|
||||
setDataType(1)
|
||||
handleModalVisible(true);
|
||||
}}
|
||||
>
|
||||
商品多规格
|
||||
新增类别
|
||||
</Button>,
|
||||
<Button
|
||||
key="new"
|
||||
icon={<PlusOutlined />}
|
||||
type="primary"
|
||||
onClick={() => {
|
||||
setDataType(2)
|
||||
handleModalVisible(true);
|
||||
}}
|
||||
>
|
||||
新增规格
|
||||
</Button>,
|
||||
],
|
||||
}}
|
||||
@ -213,7 +384,7 @@ const ProductSpecificationManage: React.FC<{ currentUser: CurrentUser | undefine
|
||||
onFocus={() => { }}
|
||||
onBlur={() => { }}
|
||||
>
|
||||
{currentRow ? '更新商品多规格' : '新建商品多规格'}
|
||||
{dataType === 1 ? currentRow ? '编辑商品类别' : '新建商品类别' : currentRow ? '编辑规格类型' : '新建规格类型'}
|
||||
</div>
|
||||
}
|
||||
destroyOnClose={true}
|
||||
@ -227,6 +398,7 @@ const ProductSpecificationManage: React.FC<{ currentUser: CurrentUser | undefine
|
||||
onCancel={() => {
|
||||
handleConfirmLoading(false)
|
||||
handleModalVisible(false)
|
||||
setDataType(0)
|
||||
}}
|
||||
|
||||
onOk={async () => { // 提交框内的数据
|
||||
@ -247,112 +419,190 @@ const ProductSpecificationManage: React.FC<{ currentUser: CurrentUser | undefine
|
||||
>
|
||||
<ProForm
|
||||
layout={'horizontal'}
|
||||
wrapperCol={{ span: 16 }} // 表单项 填写部分所占的栅格数
|
||||
labelCol={{ span: 6 }} // 表单项 标题所占的栅格数
|
||||
formRef={formRef}
|
||||
autoFocusFirstInput
|
||||
submitter={false}
|
||||
preserve={false}
|
||||
initialValues={currentRow}
|
||||
onFinish={async (values) => {
|
||||
let newValue: COMMODITY_MULTIModel = { ...values };
|
||||
if (currentRow) {
|
||||
// 编辑数据
|
||||
newValue = { ...values, COMMODITY_MULTI_ID: currentRow.COMMODITY_MULTI_ID };
|
||||
}
|
||||
// 如果有开关,要把开关的代码写进去
|
||||
const success = await handleAddUpdate(newValue as COMMODITY_MULTIModel);
|
||||
|
||||
handleConfirmLoading(false)
|
||||
if (success) {
|
||||
if (actionRef.current) {
|
||||
actionRef.current.reload();
|
||||
}
|
||||
handleModalVisible(false);
|
||||
// initialValues={currentRow}
|
||||
request={async () => {
|
||||
return currentRow ? {
|
||||
...currentRow,
|
||||
} : dataType === 1 ? {
|
||||
USERDEFINEDTYPE_STATE: 1
|
||||
} : {
|
||||
COMMODITY_STATE: 1
|
||||
}
|
||||
}}
|
||||
onFinish={async (values) => {
|
||||
let newValue: any = { ...values };
|
||||
if (currentRow) {
|
||||
// 编辑数据
|
||||
if (dataType === 1) {
|
||||
// 同步类别
|
||||
newValue = { ...values, USERDEFINEDTYPE_ID: currentRow?.USERDEFINEDTYPE_ID };
|
||||
} else if (dataType === 2) {
|
||||
// 同步规格
|
||||
newValue = { ...values, COMMODITY_MULTI_ID: currentRow?.COMMODITY_MULTI_ID };
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
console.log('dataTypedataTypedataTypedataType', dataType);
|
||||
|
||||
if (dataType === 1) {
|
||||
// 同步类别
|
||||
await handleAddUpdate(newValue);
|
||||
} else if (dataType === 2) {
|
||||
// 同步规格
|
||||
await handleAddUpdateSpecifications(newValue);
|
||||
}
|
||||
|
||||
handleConfirmLoading(false)
|
||||
}}
|
||||
>
|
||||
<Row>
|
||||
<Col span={12}>
|
||||
<ProFormMoney
|
||||
width="lg"
|
||||
fieldProps={{
|
||||
moneySymbol: false,
|
||||
}}
|
||||
name="PROVINCE_CODE"
|
||||
label="省份编码"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<ProFormText
|
||||
name="COMMODITY_NAME"
|
||||
label="商品名称"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<ProFormText
|
||||
name="USERDEFINEDTYPE_NAME"
|
||||
label="类别名称"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<ProFormSelect
|
||||
name="COMMODITY_STATE"
|
||||
label="商品状态"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<ProFormDatePicker
|
||||
name="OPERATE_DATE"
|
||||
label="操作时间"
|
||||
width="lg"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<ProFormTextArea
|
||||
name="COMMODITY_DESC"
|
||||
label="备注说明"
|
||||
labelCol={{ span: 3 }}
|
||||
wrapperCol={{ span: 20 }}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<ProFormText
|
||||
name="STAFF_NAME"
|
||||
label="操作员名称"
|
||||
/>
|
||||
</Col>
|
||||
<Col style={{ display: 'none' }}>
|
||||
<ProFormText
|
||||
name="COMMODITY_MULTI_ID"
|
||||
label="多规格内码"
|
||||
/>
|
||||
</Col>
|
||||
<Col style={{ display: 'none' }}>
|
||||
<ProFormText
|
||||
name="SERVERPART_ID"
|
||||
label="服务区内码"
|
||||
/>
|
||||
</Col>
|
||||
<Col style={{ display: 'none' }}>
|
||||
<ProFormText
|
||||
name="SERVERPARTSHOP_ID"
|
||||
label="门店内码"
|
||||
/>
|
||||
</Col>
|
||||
<Col style={{ display: 'none' }}>
|
||||
<ProFormText
|
||||
name="USERDEFINEDTYPE_ID"
|
||||
label="类别内码"
|
||||
/>
|
||||
</Col>
|
||||
<Col style={{ display: 'none' }}>
|
||||
<ProFormText
|
||||
name="STAFF_ID"
|
||||
label="操作员"
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
{
|
||||
dataType === 1 ?
|
||||
// 新增编辑类别
|
||||
<Row gutter={8}>
|
||||
<Col span={12}>
|
||||
<ProFormTreeSelect
|
||||
label={"上级类别"}
|
||||
name={"USERDEFINEDTYPE_PID"}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: "请选择上级类别!"
|
||||
}
|
||||
]}
|
||||
request={() => {
|
||||
let list: any = JSON.parse(JSON.stringify(tableData))
|
||||
list.unshift({ USERDEFINEDTYPE_NAME: "默认类别", USERDEFINEDTYPE_ID: "-1" })
|
||||
return list
|
||||
}}
|
||||
fieldProps={{
|
||||
fieldNames: {
|
||||
label: 'USERDEFINEDTYPE_NAME',
|
||||
value: 'USERDEFINEDTYPE_ID',
|
||||
children: 'MultiRuleList'
|
||||
},
|
||||
showSearch: true,
|
||||
filterTreeNode: (input, node) =>
|
||||
(node.USERDEFINEDTYPE_NAME || '').toLowerCase().includes(input.toLowerCase())
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<ProFormText
|
||||
name="USERDEFINEDTYPE_NAME"
|
||||
label="类别名称"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: "请输入类别名称!"
|
||||
}
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<ProFormDigit
|
||||
name="USERDEFINEDTYPE_INDEX"
|
||||
label="类别索引"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<ProFormSelect
|
||||
name="USERDEFINEDTYPE_STATE"
|
||||
label="有效状态"
|
||||
options={[{ label: "有效", value: 1 }, { label: "无效", value: 0 }]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<ProFormText
|
||||
name="STAFF_NAME"
|
||||
label="操作员名称"
|
||||
initialValue={currentUser?.Name}
|
||||
disabled
|
||||
/>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<ProFormTextArea
|
||||
name="USERDEFINEDTYPE_DESC"
|
||||
label="备注说明"
|
||||
/>
|
||||
</Col>
|
||||
</Row> :
|
||||
// 新增编辑规格
|
||||
<Row gutter={8}>
|
||||
<Col span={12}>
|
||||
<ProFormTreeSelect
|
||||
label={"类别名称"}
|
||||
name={"USERDEFINEDTYPE_ID"}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: "请选择上级类别!"
|
||||
}
|
||||
]}
|
||||
request={() => {
|
||||
let list: any = JSON.parse(JSON.stringify(tableData))
|
||||
list.unshift({ USERDEFINEDTYPE_NAME: "默认类别", USERDEFINEDTYPE_ID: "-1" })
|
||||
console.log('listlistlist', list);
|
||||
|
||||
return list
|
||||
}}
|
||||
fieldProps={{
|
||||
fieldNames: {
|
||||
label: 'USERDEFINEDTYPE_NAME',
|
||||
value: 'USERDEFINEDTYPE_ID',
|
||||
children: 'MultiRuleList'
|
||||
},
|
||||
showSearch: true,
|
||||
filterTreeNode: (input, node) =>
|
||||
(node.USERDEFINEDTYPE_NAME || '').toLowerCase().includes(input.toLowerCase()),
|
||||
onChange: (value, label, extra) => {
|
||||
// 设置label到表单
|
||||
formRef.current?.setFieldsValue({
|
||||
USERDEFINEDTYPE_NAME: label[0]
|
||||
});
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12} style={{ display: "none" }}>
|
||||
<ProFormText
|
||||
name="USERDEFINEDTYPE_NAME"
|
||||
label="规格名称"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<ProFormText
|
||||
name="COMMODITY_NAME"
|
||||
label="规格名称"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: "请输入类别名称!"
|
||||
}
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<ProFormSelect
|
||||
name="COMMODITY_STATE"
|
||||
label="有效状态"
|
||||
options={[{ label: "有效", value: 1 }, { label: "无效", value: 0 }]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<ProFormTextArea
|
||||
name="COMMODITY_DESC"
|
||||
label="备注说明"
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
}
|
||||
|
||||
</ProForm>
|
||||
</Modal>
|
||||
</div>
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
// 供应商分类
|
||||
|
||||
import React, { useRef, useState, Suspense } from 'react';
|
||||
import moment from 'moment'; // 时间相关引用,没有使用可以删除
|
||||
import numeral from "numeral"; // 数字相关引用,没有使用可以删除
|
||||
@ -22,7 +21,7 @@ import type { ProDescriptionsItemProps } from '@ant-design/pro-descriptions';
|
||||
import type { FormInstance } from 'antd';
|
||||
|
||||
import { getFieldEnumTree, getFieldEnumName } from "@/services/options"; // 枚举的引用,没有使用可以删除
|
||||
import { handlDeleteUSERDEFINEDTYPE, handlGetUSERDEFINEDTYPEList, handlSynchroUSERDEFINEDTYPE } from '../service';
|
||||
import { handlDeleteAUTOTYPE, handlDeleteUSERDEFINEDTYPE, handlGetNestingAUTOTYPEList, handlGetUSERDEFINEDTYPEList, handlSynchroAUTOTYPE, handlSynchroUSERDEFINEDTYPE } from '../service';
|
||||
import PageTitleBox from '@/components/PageTitleBox';
|
||||
import { uploadPicture } from '@/services/picture';
|
||||
import defaultIcon from '../../../assets/brand/defaultIcon.png'
|
||||
@ -91,22 +90,16 @@ const SupplierClassification: React.FC<{ currentUser: CurrentUser | undefined }>
|
||||
// hideInDescriptions: true,
|
||||
// },
|
||||
{
|
||||
dataIndex: 'USERDEFINEDTYPE_NAME',
|
||||
dataIndex: 'AUTOTYPE_NAME',
|
||||
title: '供应商名称',
|
||||
align: 'center',
|
||||
width: 300,
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
hideInDescriptions: true,
|
||||
render: (_, record) => {
|
||||
return <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'flex-start' }}>
|
||||
<img style={{ width: '30px', height: '30px', marginRight: '5px', borderRadius: '50%' }} src={record?.USERDEFINEDTYPE_ICO || defaultIcon} />
|
||||
<span style={{ width: '240px', display: "inline-block", whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', textAlign: 'left' }}>{record?.USERDEFINEDTYPE_NAME}</span>
|
||||
</div>
|
||||
}
|
||||
},
|
||||
{
|
||||
dataIndex: '',
|
||||
dataIndex: 'AUTOTYPE_CODE',
|
||||
title: '类别代码',
|
||||
align: 'center',
|
||||
width: 120,
|
||||
@ -114,7 +107,7 @@ const SupplierClassification: React.FC<{ currentUser: CurrentUser | undefined }>
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'USERDEFINEDTYPE_INDEX',
|
||||
dataIndex: 'AUTOTYPE_INDEX',
|
||||
title: '类别索引',
|
||||
align: 'center',
|
||||
width: 120,
|
||||
@ -122,7 +115,7 @@ const SupplierClassification: React.FC<{ currentUser: CurrentUser | undefined }>
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'USERDEFINEDTYPE_STATE',
|
||||
dataIndex: 'AUTOTYPE_VALID',
|
||||
title: '有效状态',
|
||||
align: 'center',
|
||||
width: 120,
|
||||
@ -166,14 +159,6 @@ const SupplierClassification: React.FC<{ currentUser: CurrentUser | undefined }>
|
||||
<Space>
|
||||
<a
|
||||
onClick={() => {
|
||||
console.log('recordrecordrecord', record);
|
||||
if (record?.USERDEFINEDTYPE_ICO) {
|
||||
setFileList([{
|
||||
name: "",
|
||||
url: record?.USERDEFINEDTYPE_ICO
|
||||
}])
|
||||
}
|
||||
|
||||
setCurrentRow({ ...record });
|
||||
handleModalVisible(true);
|
||||
}}
|
||||
@ -183,7 +168,7 @@ const SupplierClassification: React.FC<{ currentUser: CurrentUser | undefined }>
|
||||
<Popconfirm
|
||||
title="确认删除该商品自定义类别列表信息吗?"
|
||||
onConfirm={async () => {
|
||||
handelDelete(record.USERDEFINEDTYPE_ID);
|
||||
handelDelete(record.AUTOTYPE_ID);
|
||||
}}
|
||||
>
|
||||
<a>删除</a>
|
||||
@ -206,9 +191,9 @@ const SupplierClassification: React.FC<{ currentUser: CurrentUser | undefined }>
|
||||
// 删除商品类别
|
||||
const handelDelete = async (id: any) => {
|
||||
const req: any = {
|
||||
USERDEFINEDTYPEId: id
|
||||
AUTOTYPEId: id
|
||||
}
|
||||
const result = await handlDeleteUSERDEFINEDTYPE(req)
|
||||
const result = await handlDeleteAUTOTYPE(req)
|
||||
if (result.Result_Code !== 100) {
|
||||
message.error(`${result.Result_Desc}` || `${result.Result_Code}:删除失败`);
|
||||
} else {
|
||||
@ -220,15 +205,14 @@ const SupplierClassification: React.FC<{ currentUser: CurrentUser | undefined }>
|
||||
// 同步商品列表
|
||||
const handleAddUpdate = async (res: any) => {
|
||||
let req: any = {}
|
||||
if (currentRow?.USERDEFINEDTYPE_ID) {
|
||||
if (currentRow?.AUTOTYPE_ID) {
|
||||
req = {
|
||||
...currentRow,
|
||||
...res,
|
||||
GOODSTYPE: 1000,
|
||||
USERDEFINEDTYPE_ICO: fileList && fileList.length > 0 ? fileList[0].url : "",
|
||||
PRESALE_STARTTIME: res.PRESALE_TIME && res.PRESALE_TIME.length > 0 ? res.PRESALE_TIME[0] : "",
|
||||
PRESALE_ENDTIME: res.PRESALE_TIME && res.PRESALE_TIME.length > 0 ? res.PRESALE_TIME[1] : "",
|
||||
PROVINCE_CODE: currentUser?.ProvinceCode,
|
||||
AUTOTYPE_TYPEID: 4000,
|
||||
// PRESALE_STARTTIME: res.PRESALE_TIME && res.PRESALE_TIME.length > 0 ? res.PRESALE_TIME[0] : "",
|
||||
// PRESALE_ENDTIME: res.PRESALE_TIME && res.PRESALE_TIME.length > 0 ? res.PRESALE_TIME[1] : "",
|
||||
// PROVINCE_CODE: currentUser?.ProvinceCode,
|
||||
STAFF_ID: currentUser?.ID,
|
||||
STAFF_NAME: currentUser?.Name,
|
||||
OPERATE_DATE: moment().format('YYYY-MM-DD HH:mm:ss'),
|
||||
@ -236,18 +220,17 @@ const SupplierClassification: React.FC<{ currentUser: CurrentUser | undefined }>
|
||||
} else {
|
||||
req = {
|
||||
...res,
|
||||
GOODSTYPE: 1000,
|
||||
USERDEFINEDTYPE_ICO: fileList && fileList.length > 0 ? fileList[0].url : "",
|
||||
PRESALE_STARTTIME: res.PRESALE_TIME && res.PRESALE_TIME.length > 0 ? res.PRESALE_TIME[0] : "",
|
||||
PRESALE_ENDTIME: res.PRESALE_TIME && res.PRESALE_TIME.length > 0 ? res.PRESALE_TIME[1] : "",
|
||||
AUTOTYPE_TYPEID: 4000,
|
||||
// PRESALE_STARTTIME: res.PRESALE_TIME && res.PRESALE_TIME.length > 0 ? res.PRESALE_TIME[0] : "",
|
||||
// PRESALE_ENDTIME: res.PRESALE_TIME && res.PRESALE_TIME.length > 0 ? res.PRESALE_TIME[1] : "",
|
||||
PROVINCE_CODE: currentUser?.ProvinceCode,
|
||||
STAFF_ID: currentUser?.ID,
|
||||
STAFF_NAME: currentUser?.Name,
|
||||
OPERATE_DATE: moment().format('YYYY-MM-DD HH:mm:ss'),
|
||||
USERDEFINEDTYPE_DATE: moment().format('YYYY-MM-DD HH:mm:ss'),
|
||||
// USERDEFINEDTYPE_DATE: moment().format('YYYY-MM-DD HH:mm:ss'),
|
||||
}
|
||||
}
|
||||
const data = await handlSynchroUSERDEFINEDTYPE(req)
|
||||
const data = await handlSynchroAUTOTYPE(req)
|
||||
handleConfirmLoading(false)
|
||||
if (data.Result_Code === 100) {
|
||||
message.success("新增成功!")
|
||||
@ -271,7 +254,7 @@ const SupplierClassification: React.FC<{ currentUser: CurrentUser | undefined }>
|
||||
style={{ height: 'calc(100vh - 135px)', background: '#fff' }}
|
||||
scroll={{ y: 'calc(100vh - 410px)' }}
|
||||
rowKey={(record) => {
|
||||
return `${record?.USERDEFINEDTYPE_PID}-${record?.USERDEFINEDTYPE_ID}`
|
||||
return `${record?.USERDEFINEDTYPE_PID}-${record?.AUTOTYPE_ID}`
|
||||
}}
|
||||
formRef={formRef}
|
||||
headerTitle={<PageTitleBox props={props} />} // 列表表头
|
||||
@ -283,13 +266,13 @@ const SupplierClassification: React.FC<{ currentUser: CurrentUser | undefined }>
|
||||
const req = {
|
||||
OWNERUNIT_ID: currentUser?.OwnerUnitId,
|
||||
PROVINCE_CODE: "",
|
||||
GOODSTYPE: 1000,
|
||||
USERDEFINEDTYPE_STATE: params?.USERDEFINEDTYPE_STATE
|
||||
AUTOTYPE_TYPEID: 4000,
|
||||
AUTOTYPE_VALID: params?.AUTOTYPE_VALID
|
||||
// SearchKey: ""
|
||||
}
|
||||
console.log('reqreq', req);
|
||||
|
||||
const data = await handlGetUSERDEFINEDTYPEList(req);
|
||||
const data = await handlGetNestingAUTOTYPEList(req);
|
||||
console.log('datadatadatadatadata', data);
|
||||
if (data && data.length > 0) {
|
||||
setTypeTreeData(data)
|
||||
@ -391,20 +374,17 @@ const SupplierClassification: React.FC<{ currentUser: CurrentUser | undefined }>
|
||||
submitter={false}
|
||||
preserve={false}
|
||||
initialValues={currentRow ? currentRow : {
|
||||
USERDEFINEDTYPE_DATE: moment().format('YYYY-MM-DD HH:mm:ss'),
|
||||
OWNERUNIT_NAME: currentUser?.OwnerUnitName
|
||||
OPERATE_DATE: moment().format('YYYY-MM-DD HH:mm:ss'),
|
||||
OWNERUNIT_NAME: currentUser?.OwnerUnitName,
|
||||
AUTOTYPE_VALID: 1
|
||||
}}
|
||||
onFinish={async (values) => {
|
||||
let newValue = { ...values };
|
||||
if (currentRow) {
|
||||
// 编辑数据
|
||||
newValue = { ...values, USERDEFINEDTYPE_ID: currentRow.USERDEFINEDTYPE_ID };
|
||||
newValue = { ...values, AUTOTYPE_ID: currentRow.AUTOTYPE_ID };
|
||||
}
|
||||
|
||||
|
||||
console.log('fileListfileList', fileList);
|
||||
console.log('newValuenewValuenewValue', newValue);
|
||||
|
||||
// 如果有开关,要把开关的代码写进去
|
||||
await handleAddUpdate(newValue);
|
||||
|
||||
@ -415,38 +395,51 @@ const SupplierClassification: React.FC<{ currentUser: CurrentUser | undefined }>
|
||||
<Row gutter={8}>
|
||||
<Col span={12}>
|
||||
<ProFormTreeSelect
|
||||
name="USERDEFINEDTYPE_PID"
|
||||
name="AUTOTYPE_PID"
|
||||
label="上级类别"
|
||||
request={async () => {
|
||||
// 获取数据
|
||||
let list: any[] = [];
|
||||
if (typeTreeData && typeTreeData.length > 0) {
|
||||
let list: any = [{ USERDEFINEDTYPE_NAME: "默认类别", USERDEFINEDTYPE_ID: -1 }, ...typeTreeData]
|
||||
return list
|
||||
list = [{ AUTOTYPE_NAME: "默认类别", AUTOTYPE_ID: -1 }, ...typeTreeData];
|
||||
} else {
|
||||
const req = {
|
||||
OWNERUNIT_ID: currentUser?.OwnerUnitId,
|
||||
PROVINCE_CODE: "",
|
||||
GOODSTYPE: 1000,
|
||||
}
|
||||
};
|
||||
const data = await handlGetUSERDEFINEDTYPEList(req);
|
||||
console.log('datadatadatadatadata', data);
|
||||
if (data.List && data.List.length > 0) {
|
||||
data.List.unshirft({ USERDEFINEDTYPE_NAME: "默认类别", USERDEFINEDTYPE_ID: -1 })
|
||||
setTypeTreeData(data.List)
|
||||
return data.List
|
||||
data.List.unshift({ AUTOTYPE_NAME: "默认类别", AUTOTYPE_ID: -1 });
|
||||
setTypeTreeData(data.List);
|
||||
list = data.List;
|
||||
} else {
|
||||
return [{ USERDEFINEDTYPE_NAME: "默认类别", USERDEFINEDTYPE_ID: -1 }]
|
||||
list = [{ AUTOTYPE_NAME: "默认类别", AUTOTYPE_ID: -1 }];
|
||||
}
|
||||
}
|
||||
|
||||
// 递归禁用当前节点
|
||||
const disableCurrent = (nodes: any[]): any[] =>
|
||||
nodes.map(node => {
|
||||
const disabled = node.AUTOTYPE_ID === currentRow?.AUTOTYPE_ID;
|
||||
return {
|
||||
...node,
|
||||
disabled,
|
||||
children: node.children ? disableCurrent(node.children) : undefined,
|
||||
};
|
||||
});
|
||||
|
||||
return disableCurrent(list);
|
||||
}}
|
||||
fieldProps={{
|
||||
fieldNames: {
|
||||
label: 'USERDEFINEDTYPE_NAME',
|
||||
value: 'USERDEFINEDTYPE_ID',
|
||||
label: 'AUTOTYPE_NAME',
|
||||
value: 'AUTOTYPE_ID',
|
||||
children: 'children'
|
||||
},
|
||||
showSearch: true,
|
||||
filterTreeNode: (input, node) =>
|
||||
(node.USERDEFINEDTYPE_NAME || '').toLowerCase().includes(input.toLowerCase())
|
||||
(node.AUTOTYPE_NAME || '').toLowerCase().includes(input.toLowerCase())
|
||||
}}
|
||||
rules={[
|
||||
{
|
||||
@ -458,7 +451,7 @@ const SupplierClassification: React.FC<{ currentUser: CurrentUser | undefined }>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<ProFormText
|
||||
name="USERDEFINEDTYPE_NAME"
|
||||
name="AUTOTYPE_NAME"
|
||||
label="类别名称"
|
||||
rules={[
|
||||
{
|
||||
@ -470,7 +463,7 @@ const SupplierClassification: React.FC<{ currentUser: CurrentUser | undefined }>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<ProFormDigit
|
||||
name="USERDEFINEDTYPE_INDEX"
|
||||
name="AUTOTYPE_INDEX"
|
||||
label="类别索引"
|
||||
rules={[
|
||||
{
|
||||
@ -482,7 +475,7 @@ const SupplierClassification: React.FC<{ currentUser: CurrentUser | undefined }>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<ProFormSelect
|
||||
name="USERDEFINEDTYPE_STATE"
|
||||
name="AUTOTYPE_VALID"
|
||||
label="有效状态"
|
||||
options={[{ label: "有效", value: 1 }, { label: "无效", value: 0 }]}
|
||||
rules={[
|
||||
@ -496,7 +489,7 @@ const SupplierClassification: React.FC<{ currentUser: CurrentUser | undefined }>
|
||||
|
||||
<Col span={12}>
|
||||
<ProFormText
|
||||
name="USERDEFINEDTYPE_DATE"
|
||||
name="OPERATE_DATE"
|
||||
label="添加时间"
|
||||
disabled
|
||||
/>
|
||||
@ -510,7 +503,7 @@ const SupplierClassification: React.FC<{ currentUser: CurrentUser | undefined }>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<ProFormTextArea
|
||||
name="USERDEFINEDTYPE_DESC"
|
||||
name="AUTOTYPE_DESC"
|
||||
label="备注"
|
||||
/>
|
||||
</Col>
|
||||
|
||||
@ -11,7 +11,7 @@ import { getServerpartTree } from "@/services/options";
|
||||
import useRequest from "@ahooksjs/use-request";
|
||||
import './style.less'
|
||||
import { getMerchantShopTree } from "@/pages/Setting/Users/service";
|
||||
import { handlGetUSERDEFINEDTYPEList } from "../../service";
|
||||
import { handlGetNestingAUTOTYPEList, handlGetUSERDEFINEDTYPEList } from "../../service";
|
||||
|
||||
|
||||
type DetailProps = {
|
||||
@ -37,7 +37,25 @@ const LeftSelectMallType = ({ setSelectedId, reload, actionRef, currentUser, wid
|
||||
const [isShowAllInTree, setIsShowAllInTree] = useState<boolean>(false)
|
||||
// 加载服务区树
|
||||
const { loading: treeLoading, data: treeViews } = useRequest(async () => {
|
||||
const req = {
|
||||
OWNERUNIT_ID: currentUser?.OwnerUnitId,
|
||||
PROVINCE_CODE: "",
|
||||
AUTOTYPE_TYPEID: 4000,
|
||||
AUTOTYPE_VALID: 1
|
||||
}
|
||||
console.log('reqreq', req);
|
||||
|
||||
const data = await handlGetNestingAUTOTYPEList(req);
|
||||
console.log('datadatadatadatadata212', data);
|
||||
setTreeView(data)
|
||||
// 拿个类型的枚举
|
||||
if (data && data.length > 0) {
|
||||
let obj: any = {}
|
||||
data.forEach((item: any) => {
|
||||
obj[item.AUTOTYPE_CODE] = item.AUTOTYPE_NAME
|
||||
})
|
||||
setData(obj)
|
||||
}
|
||||
})
|
||||
// 显示服务区树搜索框
|
||||
const [showServiceSearchBox, setShowServiceSearchBox] = useState<boolean>(false)
|
||||
@ -193,13 +211,9 @@ const LeftSelectMallType = ({ setSelectedId, reload, actionRef, currentUser, wid
|
||||
// defaultExpandAll={isShowAllInTree ? false : true}
|
||||
// defaultExpandedKeys={isShowAllInTree ? treeShowRow && treeShowRow.length > 0 ? treeShowRow : ['0-0'] : []}
|
||||
onCheck={(checkedKeys: React.Key[] | any, info) => {
|
||||
console.log('checkedKeyscheckedKeyscheckedKeys', checkedKeys);
|
||||
console.log('infoinfoinfoinfoinfoinfo', info);
|
||||
|
||||
// 多选逻辑
|
||||
// const selectedIds = info.checkedNodes.filter((n: any) => n?.USERDEFINEDTYPE_PID !== -1)
|
||||
const selectedIds = info.checkedNodes.filter((n: any) => n?.USERDEFINEDTYPE_ID)
|
||||
console.log('selectedIdsselectedIds', selectedIds);
|
||||
setSelectedId(selectedIds.map((n: any) => n?.USERDEFINEDTYPE_ID)?.toString() || '')
|
||||
if (reload) {
|
||||
actionRef?.current?.reload()
|
||||
@ -209,8 +223,8 @@ const LeftSelectMallType = ({ setSelectedId, reload, actionRef, currentUser, wid
|
||||
}
|
||||
}}
|
||||
fieldNames={{
|
||||
title: "USERDEFINEDTYPE_NAME",
|
||||
key: "USERDEFINEDTYPE_ID"
|
||||
title: "AUTOTYPE_NAME",
|
||||
key: "AUTOTYPE_CODE"
|
||||
}}
|
||||
/> : ''}
|
||||
</ProCard>
|
||||
|
||||
@ -61,6 +61,8 @@ const SupplierMerchantManage: React.FC<{ currentUser: CurrentUser | undefined }>
|
||||
hideInSearch: true,
|
||||
width: 150,
|
||||
ellipsis: true,
|
||||
valueType: "select",
|
||||
valueEnum: leftTreeData
|
||||
},
|
||||
{
|
||||
dataIndex: 'MERCHANTS_NAME',
|
||||
@ -213,6 +215,7 @@ const SupplierMerchantManage: React.FC<{ currentUser: CurrentUser | undefined }>
|
||||
searchParameter: {
|
||||
OWNERUNIT_ID: currentUser?.OwnerUnitId,
|
||||
PROVINCE_CODE: currentUser?.ProvinceCode,
|
||||
MERCHANTS_TYPE: params?.MERCHANTS_TYPE ? params?.MERCHANTS_TYPE : ""
|
||||
},
|
||||
PageIndex: 1,
|
||||
PageSize: 999999,
|
||||
@ -224,6 +227,7 @@ const SupplierMerchantManage: React.FC<{ currentUser: CurrentUser | undefined }>
|
||||
}
|
||||
return { data: [], success: true }
|
||||
}}
|
||||
pagination={false}
|
||||
columns={columns}
|
||||
toolbar={{
|
||||
actions: [
|
||||
@ -338,6 +342,13 @@ const SupplierMerchantManage: React.FC<{ currentUser: CurrentUser | undefined }>
|
||||
<ProFormSelect
|
||||
name="MERCHANTS_TYPE"
|
||||
label="商户类型"
|
||||
request={() => {
|
||||
let list: any = []
|
||||
for (let key in leftTreeData) {
|
||||
list.push({ label: leftTreeData[key], value: key })
|
||||
}
|
||||
return list
|
||||
}}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
|
||||
@ -203,6 +203,42 @@ export async function handlDeleteBRAND(params: any) {
|
||||
return data
|
||||
}
|
||||
|
||||
// 获取供应商的分类列表 树形
|
||||
export async function handlGetNestingAUTOTYPEList(params: any) {
|
||||
const data = await requestEncryption(`/MemberBasic/GetNestingAUTOTYPEList`, {
|
||||
method: 'POST',
|
||||
data: { ...params, requestEncryption: true }
|
||||
})
|
||||
if (data.Result_Code !== 100) {
|
||||
return []
|
||||
}
|
||||
return wrapTreeNode(data.Result_Data.List)
|
||||
}
|
||||
|
||||
// 同步供应商信息
|
||||
export async function handlSynchroAUTOTYPE(params: any) {
|
||||
const data = await requestEncryption(`/MemberBasic/SynchroAUTOTYPE`, {
|
||||
method: 'POST',
|
||||
data: { ...params, requestEncryption: true }
|
||||
})
|
||||
if (data.Result_Code !== 100) {
|
||||
return []
|
||||
}
|
||||
return data
|
||||
}
|
||||
|
||||
// 删除供应商信息
|
||||
export async function handlDeleteAUTOTYPE(params: any) {
|
||||
const data = await requestEncryption(`/MemberBasic/DeleteAUTOTYPE`, {
|
||||
method: 'POST',
|
||||
data: { ...params, requestEncryption: true }
|
||||
})
|
||||
if (data.Result_Code !== 100) {
|
||||
return []
|
||||
}
|
||||
return data
|
||||
}
|
||||
|
||||
|
||||
// 获取商城分类管理(自定义类别的那个) 树形
|
||||
export async function handlGetUSERDEFINEDTYPEList(params: any) {
|
||||
@ -440,3 +476,41 @@ export async function handeDeleteSCENICAREA(params: any) {
|
||||
}
|
||||
return data
|
||||
}
|
||||
|
||||
// 同步规格
|
||||
export async function handeSynchroCOMMODITY_MULTI(params: any) {
|
||||
const data = await requestEncryption(`/MallBasic/SynchroCOMMODITY_MULTI`, {
|
||||
method: 'POST',
|
||||
data: { ...params, requestEncryption: true }
|
||||
})
|
||||
if (data.Result_Code !== 100) {
|
||||
return []
|
||||
}
|
||||
return data
|
||||
}
|
||||
|
||||
// 删除多规格
|
||||
export async function handeDeleteCOMMODITY_MULTI(params: any) {
|
||||
const data = await requestEncryption(`/MallBasic/DeleteCOMMODITY_MULTI`, {
|
||||
method: 'POST',
|
||||
data: { ...params, requestEncryption: true }
|
||||
})
|
||||
if (data.Result_Code !== 100) {
|
||||
return []
|
||||
}
|
||||
return data
|
||||
}
|
||||
|
||||
// 获取商品多规格关联表列表
|
||||
export async function handeGetRTCOMMODITY_MULTIList(params: any) {
|
||||
const data = await requestEncryption(`/MemberConfig/GetRTCOMMODITY_MULTIList`, {
|
||||
method: 'POST',
|
||||
data: { ...params, requestEncryption: true }
|
||||
})
|
||||
if (data.Result_Code !== 100) {
|
||||
return []
|
||||
}
|
||||
return data
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -104,7 +104,7 @@ requestEncryption.interceptors.request.use((url, opt: any) => {
|
||||
}
|
||||
} else {
|
||||
if ((url.indexOf('Synchro') > -1 || url.indexOf('Save') > -1) &&
|
||||
url.indexOf('Picture/SaveImgFile') === -1) {
|
||||
url.indexOf('Picture/SaveImgFile') === -1 && !requestEncryption) {
|
||||
options.data = {
|
||||
...options.data,
|
||||
STAFF_ID: currentUser.ID,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user