update
This commit is contained in:
parent
ad597dcc99
commit
4c7c8707ab
@ -438,6 +438,30 @@ export default [
|
||||
name: 'setUserDefinedType',
|
||||
component: './reports/productControl/setUserDefinedType',
|
||||
},
|
||||
{
|
||||
path: 'ProductApprovalProcess',
|
||||
name: 'ProductApprovalProcess',
|
||||
component: './reports/productControl/ProductApprovalProcess',
|
||||
},
|
||||
// 新增商品流程
|
||||
{
|
||||
path: 'NewProductApproval',
|
||||
name: 'NewProductApproval',
|
||||
component: './reports/productControl/NewProductApproval',
|
||||
},
|
||||
// 商品调价审批
|
||||
{
|
||||
path: 'ProductChangePriceApproval',
|
||||
name: 'ProductChangePriceApproval',
|
||||
component: './reports/productControl/ProductChangePriceApproval',
|
||||
},
|
||||
// 商品信息修改审批
|
||||
{
|
||||
path: 'ProductChangeInfoApproval',
|
||||
name: 'ProductChangeInfoApproval',
|
||||
component: './reports/productControl/ProductChangeInfoApproval',
|
||||
},
|
||||
|
||||
{
|
||||
path: 'highwayHeadlines',
|
||||
name: 'highwayHeadlines',
|
||||
@ -963,6 +987,12 @@ export default [
|
||||
name: 'serverpartInfo',
|
||||
component: './travelMember/serverpartInfo/index'
|
||||
},
|
||||
// 景区信息配置
|
||||
{
|
||||
path: 'scenicSpotConfig',
|
||||
name: 'scenicSpotConfig',
|
||||
component: './travelMember/scenicSpotConfig/index'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@ -205,6 +205,36 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
|
||||
// 拿到所有枚举的方法
|
||||
const handleGetAllFieldEnum = async () => {
|
||||
|
||||
// 景区状态
|
||||
getFieldEnumTree({ FieldExplainField: 'BUSINESSSTATE' }).then((BUSINESSSTATE: any) => {
|
||||
if (BUSINESSSTATE && BUSINESSSTATE.length > 0) {
|
||||
const obj: any = {}
|
||||
const list: any = []
|
||||
BUSINESSSTATE.forEach((item: any) => {
|
||||
list.push({ label: item.label, value: item.value })
|
||||
obj[item.value] = item.label
|
||||
})
|
||||
session.set('BUSINESSSTATEList', list);
|
||||
session.set('BUSINESSSTATEObj', obj);
|
||||
session.set('BUSINESSSTATETree', BUSINESSSTATE);
|
||||
}
|
||||
})
|
||||
|
||||
// 景区类型
|
||||
getFieldEnumTree({ FieldExplainField: 'SCENICAREA_TYPE' }).then((SCENICAREATYPE: any) => {
|
||||
if (SCENICAREATYPE && SCENICAREATYPE.length > 0) {
|
||||
const obj: any = {}
|
||||
const list: any = []
|
||||
SCENICAREATYPE.forEach((item: any) => {
|
||||
list.push({ label: item.label, value: item.value })
|
||||
obj[item.value] = item.label
|
||||
})
|
||||
session.set('SCENICAREATYPEList', list);
|
||||
session.set('SCENICAREATYPEObj', obj);
|
||||
session.set('SCENICAREATYPETree', SCENICAREATYPE);
|
||||
}
|
||||
})
|
||||
|
||||
// 承载情况
|
||||
getFieldEnumTree({ FieldExplainField: 'LOAD_BEARING' }).then((LOADBEARING: any) => {
|
||||
if (LOADBEARING && LOADBEARING.length > 0) {
|
||||
|
||||
1164
src/pages/reports/productControl/NewProductApproval/index.tsx
Normal file
1164
src/pages/reports/productControl/NewProductApproval/index.tsx
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,228 @@
|
||||
// 商品审批流程
|
||||
import { connect } from "umi";
|
||||
import type { CurrentUser } from "umi";
|
||||
import type { ConnectState } from "@/models/connect";
|
||||
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 useRequest from "@ahooksjs/use-request";
|
||||
import { getServerpartTree } from "@/services/options";
|
||||
import type { ActionType } from "@ant-design/pro-table";
|
||||
import ProTable from "@ant-design/pro-table";
|
||||
import ReactHTMLTableToExcel from "react-html-table-to-excel";
|
||||
import LeftSelectTree from "@/pages/reports/settlementAccount/component/leftSelectTree";
|
||||
import PageTitleBox from "@/components/PageTitleBox";
|
||||
import { handleGetExamineList } from "@/pages/examine/examineList/service";
|
||||
import { handleGetAPPROVALROUTEList } from "@/pages/Setting/serviceConfig/service";
|
||||
|
||||
|
||||
const ProductApprovalProcess: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
const { currentUser } = props
|
||||
const actionRef = useRef<ActionType>();
|
||||
const formRef = useRef<FormInstance>();
|
||||
const [reqDetailList, setReqDetailList] = useState<any>(); // 合计项数据源
|
||||
const [printOut, setPrintOut] = useState<any>(); // 打印数据的内容
|
||||
// 审批类型数据
|
||||
const [searchTypeData, setSearchTypeData] = useState<any>()
|
||||
// 当前业务审批的枚举
|
||||
const [currentExamine, setCurrentExamine] = useState<any>()
|
||||
// 判断当前用户是否有发起按钮
|
||||
const [currentShowInitiate, setCurrentShowInitiate] = useState<boolean>(false)
|
||||
|
||||
useEffect(async () => {
|
||||
await handleChangeType("6-100100")
|
||||
}, [])
|
||||
|
||||
const columns: any = [
|
||||
{
|
||||
dataIndex: 'searchType',
|
||||
title: '审批类型',
|
||||
width: 200,
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInTable: true,
|
||||
valueEnum: {
|
||||
"0": "全部",
|
||||
"6-100100": "新增商品流程",
|
||||
"6-100200": "商品调价流程",
|
||||
"6-100210": "信息修改流程"
|
||||
},
|
||||
initialValue: "6-100100",
|
||||
},
|
||||
{
|
||||
dataIndex: 'BusinessProcess_StateSearch',
|
||||
title: '流程状态',
|
||||
width: 200,
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInTable: true,
|
||||
valueEnum: {
|
||||
"0": "全部",
|
||||
"2000": "待审核",
|
||||
"2010,2020,2030,2040,2050,2060,2070,2080,2090": "审核中",
|
||||
"9000": "已审结"
|
||||
},
|
||||
},
|
||||
{
|
||||
dataIndex: 'BusinessProcess_Name',
|
||||
title: '业务名称',
|
||||
width: 300,
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'Serverpart_Name',
|
||||
title: '服务区名称',
|
||||
width: 200,
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'ServerpartShop_Name',
|
||||
title: '门店名称',
|
||||
width: 200,
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'ApproveStaff_Name',
|
||||
title: '待审核人',
|
||||
width: 200,
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'BusinessProcess_StateText',
|
||||
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: '办结时间',
|
||||
width: 200,
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'BusinessProcess_StartDate',
|
||||
title: '流程开始',
|
||||
width: 200,
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
]
|
||||
|
||||
// 修改审批类型
|
||||
const handleChangeType = async (type: string) => {
|
||||
// 查出当前类型里面的流程数据
|
||||
const reqState: any = {
|
||||
SearchParameter: {
|
||||
APPROVALROUTE_STATES: "",
|
||||
APPROVALROUTE_VALID: 1,
|
||||
OPERATION_TYPES: type
|
||||
},
|
||||
PageIndex: 1,
|
||||
PageSize: 999999
|
||||
}
|
||||
const dataState = await handleGetAPPROVALROUTEList(reqState)
|
||||
console.log('fdsjkafjslk', dataState);
|
||||
setSearchTypeData(dataState)
|
||||
|
||||
// 业务状态的枚举
|
||||
let statusObj: any = {}
|
||||
if (dataState && dataState.length > 0) {
|
||||
dataState.forEach((item: any) => {
|
||||
statusObj[item.APPROVALROUTE_STATE] = item.APPROVALROUTE_NAME
|
||||
})
|
||||
}
|
||||
setCurrentExamine(statusObj)
|
||||
}
|
||||
|
||||
return (
|
||||
<div ref={(el) => {
|
||||
// 打印报表
|
||||
if (!reqDetailList || reqDetailList.length === 0) return;
|
||||
setPrintOut(el);
|
||||
}} >
|
||||
|
||||
<div style={{ backgroundColor: '#fff', display: 'flex' }}>
|
||||
<div style={{
|
||||
width: "100%",
|
||||
paddingTop: 0,
|
||||
paddingBottom: 0,
|
||||
paddingRight: 0
|
||||
}}>
|
||||
<ProTable
|
||||
actionRef={actionRef}
|
||||
formRef={formRef}
|
||||
columns={columns}
|
||||
bordered
|
||||
expandable={{
|
||||
expandRowByClick: true
|
||||
}}
|
||||
scroll={{ x: "100%", y: "calc(100vh - 410px)" }}
|
||||
headerTitle={<PageTitleBox props={props} />} // 列表表头
|
||||
search={{ span: 6 }}
|
||||
request={async (params) => {
|
||||
|
||||
const req: any = {
|
||||
QueryType: 0,
|
||||
SearchParameter: {
|
||||
Operation_Type: 6,
|
||||
Accept_Code: params?.searchType === "0" ? '' : params?.searchType,
|
||||
BusinessProcess_StateSearch: params?.BusinessProcess_StateSearch === 0 ? '' : params?.BusinessProcess_StateSearch
|
||||
},
|
||||
PageIndex: 1,
|
||||
PageSize: 999999
|
||||
}
|
||||
const data = await handleGetExamineList(req)
|
||||
console.log('data', data)
|
||||
if (data.data && data.data.length > 0) {
|
||||
data.data.forEach((item: any) => {
|
||||
if (item.BusinessProcess_State === 2000) {
|
||||
item.BusinessProcess_StateText = "待审核"
|
||||
} else if (item.BusinessProcess_State > 2000 && item.BusinessProcess_State < 9000) {
|
||||
item.BusinessProcess_StateText = "审核中"
|
||||
} else if (item.BusinessProcess_State = 9000) {
|
||||
item.BusinessProcess_StateText = "已审结"
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
return { data: data.data, success: true, total: data.data.length }
|
||||
}
|
||||
return { data: [], success: true }
|
||||
}}
|
||||
toolbar={{
|
||||
actions: [
|
||||
]
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div >
|
||||
)
|
||||
}
|
||||
|
||||
export default connect(({ user }: ConnectState) => ({
|
||||
currentUser: user.currentUser
|
||||
}))(ProductApprovalProcess);
|
||||
@ -0,0 +1,82 @@
|
||||
// 获取商户应收账款列表
|
||||
import request from '@/utils/request';
|
||||
|
||||
// 创建服务区商品审批流程
|
||||
export async function handleCreateCommodityProInst(params?: any) {
|
||||
const data = await request('/BusinessProcess/CreateCommodityProInst', {
|
||||
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', {
|
||||
method: 'POST',
|
||||
data: {
|
||||
...params,
|
||||
requestEncryption: true
|
||||
},
|
||||
})
|
||||
|
||||
if (data.Result_Code !== 100) {
|
||||
return data;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
// 驳回服务区商品审批流程
|
||||
export async function handleRejectCommodityProInst(params?: any) {
|
||||
const data = await request('/BusinessProcess/RejectCommodityProInst', {
|
||||
method: 'POST',
|
||||
data: {
|
||||
...params,
|
||||
requestEncryption: true
|
||||
},
|
||||
})
|
||||
|
||||
if (data.Result_Code !== 100) {
|
||||
return data;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
// 审批流程详情
|
||||
export async function handleGetBUSINESSAPPROVALDetail(params?: any) {
|
||||
const data = await request('/BusinessProcess/GetBUSINESSAPPROVALDetail', {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
|
||||
},
|
||||
})
|
||||
|
||||
if (data.Result_Code !== 100) {
|
||||
return data;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
// 获取审批流程里面的商品
|
||||
export async function handleGetCOMMODITYRUNNINGList(params?: any) {
|
||||
const data = await request('/Commodity/GetCOMMODITY_RUNNINGList', {
|
||||
method: 'POST',
|
||||
data: {
|
||||
...params,
|
||||
requestEncryption: true
|
||||
},
|
||||
})
|
||||
|
||||
if (data.Result_Code !== 100) {
|
||||
return data;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
1349
src/pages/reports/productControl/ProductChangeInfoApproval/index.tsx
Normal file
1349
src/pages/reports/productControl/ProductChangeInfoApproval/index.tsx
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,904 @@
|
||||
// 商品调价审批
|
||||
// 新增商品审批
|
||||
import { connect } from "umi";
|
||||
import type { CurrentUser } from "umi";
|
||||
import type { ConnectState } from "@/models/connect";
|
||||
import React, { useRef, useState } from "react";
|
||||
import type { FormInstance } from "antd";
|
||||
import { Button, Col, Input, message, Modal, Popconfirm, Row, Space, Spin, Tree } from "antd";
|
||||
import type { ActionType } from "@ant-design/pro-table";
|
||||
import ProTable from "@ant-design/pro-table";
|
||||
import PageTitleBox from "@/components/PageTitleBox";
|
||||
import { handleGetExamineList } from "@/pages/examine/examineList/service";
|
||||
import ProForm, { ProFormDateTimePicker, ProFormDigit, ProFormSelect, ProFormText, ProFormTextArea, ProFormTreeSelect } from "@ant-design/pro-form";
|
||||
import { getFieldEnum, getFieldEnumTree, getServerpartTree } from "@/services/options";
|
||||
import { handleGetAPPROVALROUTEList } from "@/pages/Setting/serviceConfig/service";
|
||||
import { handleGetCommodityList, handleGetNestingCOMMODITYTYPETree, handleGetServerpartShopTrade } from "../commodityInfo/service";
|
||||
import { handleGetUSERDEFINEDTYPEList } from "../userDefinedType/service";
|
||||
import useRequest from "@ahooksjs/use-request";
|
||||
import moment from 'moment'
|
||||
import { handleApproveCommodityProInst, handleCreateCommodityProInst, handleRejectCommodityProInst } from "../ProductApprovalProcess/service";
|
||||
import session from "@/utils/session";
|
||||
|
||||
const ProductChangePriceApproval: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
const { currentUser } = props
|
||||
const downloadBtnRef = useRef<any>()
|
||||
const actionRef = useRef<ActionType>();
|
||||
const formRef = useRef<FormInstance>();
|
||||
const modalFormRef = useRef<FormInstance>();
|
||||
const modalShopFormRef = useRef<FormInstance>();
|
||||
const modalApproveFormRef = useRef<FormInstance>();
|
||||
const ServerpartIdsList = session.get('ServerpartIdsList')
|
||||
|
||||
// 新增商品申请
|
||||
const [showApplyFor, setShowApplyFor] = useState<boolean>(false);
|
||||
const [showApplyForLoading, setShowApplyForLoading] = useState<boolean>(false);
|
||||
// 显示新增商品的悬浮框
|
||||
const [showAddShopModal, setShowAddShopModal] = useState<boolean>(false);
|
||||
// 选择的当前商品行
|
||||
const [currentRow, setCurrentRow] = useState<any>()
|
||||
// 商品列表数据
|
||||
const [shopData, setShopData] = useState<any>()
|
||||
// 审批的悬浮框
|
||||
const [approveModal, setApproveModal] = useState<boolean>(false);
|
||||
// 点击审批的行数据
|
||||
const [approveCurrentRow, setApproveCurrentRow] = useState<any>()
|
||||
// 下一个审批流程
|
||||
const [nextApproval, setNextApproval] = useState<any>()
|
||||
// 下一审批流程的审批人
|
||||
const [nextApprovalPerson, setNextApprovalPerson] = useState<any>()
|
||||
// 选中的行数据
|
||||
const [selectRowList, setSelectRowList] = useState<any>()
|
||||
// 选中的行
|
||||
const [selectedOrderRowKeys, setSelectedOrderRowKeys] = useState<any>()
|
||||
// 审批还是驳回 1 审批 2 驳回
|
||||
const [ApprovalType, setApprovaType] = useState<number>(0)
|
||||
// 新增申请的加载效果
|
||||
const [addApprovalLoading, setAddApprovalLoading] = useState<boolean>(false);
|
||||
|
||||
const { loading: CommodityLoading, data: CommodityData } = useRequest(async () => {
|
||||
const data = await getFieldEnumTree({ FieldExplainField: 'CommodityTypeIds' })
|
||||
const obj: any = {}
|
||||
if (data && data.length > 0) {
|
||||
data.forEach((item: any) => {
|
||||
obj[item.value] = item.label
|
||||
if (item.children && item.children.length > 0) {
|
||||
item.children.forEach((subItem: any) => {
|
||||
obj[subItem.value] = subItem.label
|
||||
if (subItem.children && subItem.children.length > 0) {
|
||||
subItem.children.forEach((thirdItem: any) => {
|
||||
obj[thirdItem.value] = thirdItem.label
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
return obj
|
||||
})
|
||||
|
||||
const columns: any = [
|
||||
{
|
||||
dataIndex: 'BusinessProcess_StateSearch',
|
||||
title: '流程状态',
|
||||
width: 200,
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInTable: true,
|
||||
valueEnum: {
|
||||
"0": "全部",
|
||||
"2000": "待审核",
|
||||
"2010,2020,2030,2040,2050,2060,2070,2080,2090": "审核中",
|
||||
"9000": "已审结"
|
||||
},
|
||||
},
|
||||
{
|
||||
dataIndex: 'BusinessProcess_Name',
|
||||
title: '业务名称',
|
||||
width: 300,
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'Serverpart_Name',
|
||||
title: '服务区名称',
|
||||
width: 200,
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'ServerpartShop_Name',
|
||||
title: '门店名称',
|
||||
width: 200,
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'ApproveStaff_Name',
|
||||
title: '待审核人',
|
||||
width: 200,
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'BusinessProcess_StateText',
|
||||
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: '办结时间',
|
||||
width: 200,
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'BusinessProcess_StartDate',
|
||||
title: '流程开始',
|
||||
width: 200,
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'option',
|
||||
title: '操作',
|
||||
valueType: 'option',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
width: 120,
|
||||
fixed: "right",
|
||||
ellipsis: true,
|
||||
render: (_, record) => {
|
||||
return (
|
||||
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>
|
||||
</Space> : ""
|
||||
);
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
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_CURRPRICE",
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: "现价",
|
||||
width: 150,
|
||||
dataIndex: "newPrice",
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
render: (_, record) => {
|
||||
return <Input value={record.newPrice} onChange={(e: any) => {
|
||||
let oldData: any = JSON.parse(JSON.stringify(shopData))
|
||||
let list: any = []
|
||||
oldData.forEach((item: any) => {
|
||||
if (item.COMMODITY_ID === record?.COMMODITY_ID) {
|
||||
item.newPrice = e.target.value
|
||||
}
|
||||
list.push(item)
|
||||
})
|
||||
setShopData(list)
|
||||
}} />
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "单位",
|
||||
width: 150,
|
||||
dataIndex: "COMMODITY_UNIT",
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
dataIndex: 'option',
|
||||
title: '操作',
|
||||
valueType: 'option',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
width: 120,
|
||||
fixed: "right",
|
||||
ellipsis: true,
|
||||
render: (_, record) => {
|
||||
return (
|
||||
|
||||
<Space>
|
||||
<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>
|
||||
</Space>
|
||||
);
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
// 选择商品的表格结构
|
||||
const selectShopColumns: any = [
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>序号</div>,
|
||||
width: 70,
|
||||
dataIndex: 'index',
|
||||
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: 120,
|
||||
ellipsis: true,
|
||||
dataIndex: 'BUSINESSTYPE',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
valueType: 'select',
|
||||
request: async () => {
|
||||
return await getFieldEnum({ FieldExplainField: 'BUSINESSTYPE', sessionName: 'SHOPTRADE', notformate: true })
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>商品类型</div>,
|
||||
width: 120,
|
||||
ellipsis: true,
|
||||
dataIndex: 'COMMODITY_TYPE',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
valueEnum: CommodityData
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>商品名称</div>,
|
||||
width: 200,
|
||||
ellipsis: true,
|
||||
align: 'left',
|
||||
dataIndex: 'COMMODITY_NAME',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>商品条码</div>,
|
||||
width: 150,
|
||||
ellipsis: true,
|
||||
align: 'left',
|
||||
dataIndex: 'COMMODITY_BARCODE',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>零售价</div>,
|
||||
width: 70,
|
||||
ellipsis: true,
|
||||
align: 'right',
|
||||
dataIndex: 'COMMODITY_RETAILPRICE',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>进货价</div>,
|
||||
width: 70,
|
||||
ellipsis: true,
|
||||
align: 'right',
|
||||
dataIndex: 'COMMODITY_PURCHASEPRICE',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>商品单位</div>,
|
||||
width: 80,
|
||||
ellipsis: true,
|
||||
align: 'right',
|
||||
dataIndex: 'COMMODITY_UNIT',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>状态</div>,
|
||||
width: 100,
|
||||
ellipsis: true,
|
||||
dataIndex: 'COMMODITY_STATE',
|
||||
hideInSearch: true,
|
||||
align: 'center',
|
||||
valueType: 'select',
|
||||
valueEnum: { 0: { text: '无效', status: 'error' }, 1: { text: '有效', status: 'success' }, 2: { text: '不可选', status: 'default' } },
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>审核时间</div>,
|
||||
width: 150,
|
||||
align: 'center',
|
||||
ellipsis: true,
|
||||
dataIndex: 'OPERATE_DATE',
|
||||
hideInSearch: true,
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div style={{ backgroundColor: '#fff', display: 'flex' }}>
|
||||
<div style={{
|
||||
width: '100%',
|
||||
paddingTop: 0,
|
||||
paddingBottom: 0,
|
||||
paddingRight: 0
|
||||
}}>
|
||||
<ProTable
|
||||
actionRef={actionRef}
|
||||
formRef={formRef}
|
||||
columns={columns}
|
||||
bordered
|
||||
expandable={{
|
||||
expandRowByClick: true
|
||||
}}
|
||||
scroll={{ x: "100%", y: "calc(100vh - 410px)" }}
|
||||
headerTitle={<PageTitleBox props={props} />} // 列表表头
|
||||
search={{ span: 6 }}
|
||||
request={async (params) => {
|
||||
const req: any = {
|
||||
QueryType: 0,
|
||||
SearchParameter: {
|
||||
Operation_Type: 6,
|
||||
Accept_Code: "6-100200",
|
||||
BusinessProcess_StateSearch: params?.BusinessProcess_StateSearch === 0 ? '' : params?.BusinessProcess_StateSearch
|
||||
},
|
||||
PageIndex: 1,
|
||||
PageSize: 999999
|
||||
}
|
||||
const data = await handleGetExamineList(req)
|
||||
console.log('data', data)
|
||||
if (data.data && data.data.length > 0) {
|
||||
data.data.forEach((item: any) => {
|
||||
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 = "审核中"
|
||||
} else if (item.BusinessProcess_State = 9000) {
|
||||
item.BusinessProcess_StateText = "已审结"
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
return { data: data.data, success: true, total: data.data.length }
|
||||
}
|
||||
return { data: [], success: true }
|
||||
}}
|
||||
toolbar={{
|
||||
actions: [
|
||||
<Button type={"primary"} onClick={() => {
|
||||
setShowApplyFor(true)
|
||||
}}>
|
||||
新增商品调价申请
|
||||
</Button>
|
||||
]
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 审批的悬浮框 */}
|
||||
<Modal
|
||||
width={"70%"}
|
||||
title={"审批"}
|
||||
open={approveModal}
|
||||
confirmLoading={addApprovalLoading}
|
||||
destroyOnClose
|
||||
onCancel={() => {
|
||||
setApproveCurrentRow(undefined)
|
||||
setApproveModal(false)
|
||||
setApprovaType(0)
|
||||
}}
|
||||
onOk={() => {
|
||||
modalApproveFormRef?.current?.validateFields().then(() => {
|
||||
modalApproveFormRef?.current?.submit()
|
||||
})
|
||||
}}
|
||||
>
|
||||
<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: "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 === approveCurrentRow.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: approveCurrentRow?.BusinessApproval_ID,
|
||||
UserId: currentUser?.ID,
|
||||
ApproveInfo: res.ApproveInfo,
|
||||
nextApproveStaffId: res.nextApproveStaffId || "",
|
||||
nextApproveState: nextApproval || ""
|
||||
}
|
||||
|
||||
data = await handleApproveCommodityProInst(req)
|
||||
} else {
|
||||
// 驳回
|
||||
const req: any = {
|
||||
businessApprovalId: approveCurrentRow?.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)
|
||||
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>
|
||||
</Modal>
|
||||
|
||||
{/* 新增申请的悬浮框 */}
|
||||
<Modal
|
||||
width={"70%"}
|
||||
title={"新增商品申请"}
|
||||
open={showApplyFor}
|
||||
destroyOnClose
|
||||
onCancel={() => {
|
||||
setShowApplyFor(false)
|
||||
setCurrentRow(undefined)
|
||||
setSelectRowList([])
|
||||
setSelectedOrderRowKeys([])
|
||||
setShopData([])
|
||||
}}
|
||||
confirmLoading={showApplyForLoading}
|
||||
onOk={() => {
|
||||
// 判断表格里面的现价 是不是都已经输入了
|
||||
let allRight: boolean = true
|
||||
console.log('shopData', shopData);
|
||||
|
||||
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()
|
||||
})
|
||||
|
||||
}}
|
||||
>
|
||||
<ProForm
|
||||
// layout={'horizontal'}
|
||||
formRef={modalFormRef}
|
||||
submitter={false}
|
||||
preserve={false}
|
||||
onFinish={async (res) => {
|
||||
setShowApplyForLoading(true)
|
||||
let list: any = []
|
||||
if (shopData && shopData.length > 0) {
|
||||
shopData.forEach((item: any) => {
|
||||
let obj: any = JSON.parse(JSON.stringify(item))
|
||||
let oldPrice = JSON.parse(JSON.stringify(obj.COMMODITY_RETAILPRICE))
|
||||
obj.COMMODITY_ORIPRICE = oldPrice
|
||||
obj.COMMODITY_RETAILPRICE = item.newPrice
|
||||
obj.COMMODITY_CURRPRICE = item.newPrice
|
||||
list.push(obj)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
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 data = await handleCreateCommodityProInst(req)
|
||||
setShowApplyForLoading(false)
|
||||
console.log('dsaidjaskda', data);
|
||||
if (data.Result_Code === 100) {
|
||||
message.success(data.Result_Desc)
|
||||
setShowApplyFor(false)
|
||||
setCurrentRow(undefined)
|
||||
actionRef.current?.reload()
|
||||
setSelectRowList([])
|
||||
setSelectedOrderRowKeys([])
|
||||
setShopData([])
|
||||
} else {
|
||||
message.error(data.Result_Desc)
|
||||
}
|
||||
|
||||
}}
|
||||
>
|
||||
<Row gutter={8}>
|
||||
<Col span={24}>
|
||||
<ProFormTextArea
|
||||
label="申请原因"
|
||||
name="reasonForApplication"
|
||||
rules={[{
|
||||
required: true,
|
||||
message: "请输入申请原因!"
|
||||
}]}
|
||||
/>
|
||||
</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
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<ProFormSelect
|
||||
label="下一环节审批人"
|
||||
name="NextApproveStaffId"
|
||||
rules={[{
|
||||
required: true,
|
||||
message: "请选择下一环节审批人!"
|
||||
}]}
|
||||
request={async () => {
|
||||
const reqState: any = {
|
||||
SearchParameter: {
|
||||
APPROVALROUTE_STATES: "",
|
||||
APPROVALROUTE_VALID: 1,
|
||||
OPERATION_TYPES: "100200",
|
||||
},
|
||||
PageIndex: 1,
|
||||
PageSize: 999999
|
||||
}
|
||||
const dataState = await handleGetAPPROVALROUTEList(reqState)
|
||||
if (dataState && dataState.length > 0) {
|
||||
let obj: any = {}
|
||||
console.log('dataState', dataState);
|
||||
|
||||
dataState.forEach((item: any) => {
|
||||
if (item.APPROVALROUTE_STATE === 2000) {
|
||||
obj = item
|
||||
}
|
||||
})
|
||||
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
|
||||
}
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</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>
|
||||
</Modal>
|
||||
|
||||
|
||||
{/* 选择商品的悬浮框 */}
|
||||
<Modal
|
||||
open={showAddShopModal}
|
||||
width={1200}
|
||||
wrapClassName={'shopModal'}
|
||||
destroyOnClose
|
||||
title={"选择商品"}
|
||||
onOk={() => {
|
||||
setShowAddShopModal(false)
|
||||
setShopData(selectRowList)
|
||||
}}
|
||||
onCancel={() => {
|
||||
setShowAddShopModal(false)
|
||||
}}
|
||||
>
|
||||
<ProTable
|
||||
search={false}
|
||||
options={false}
|
||||
scroll={{ x: "100%", y: "500px" }}
|
||||
bordered
|
||||
rowKey={"COMMODITY_ID"}
|
||||
request={async () => {
|
||||
let formRes = modalFormRef.current?.getFieldsValue()
|
||||
const req: any = {
|
||||
SearchType: 3,
|
||||
ProvinceCode: currentUser?.ProvinceCode,
|
||||
// CommodityTypeId: currenMenu,
|
||||
CommodityState: 1,
|
||||
ServerpartID: formRes?.ServerpartId,
|
||||
PageIndex: 1,
|
||||
PageSize: 999999,
|
||||
SortStr: "OPERATE_DATE desc"
|
||||
// PageSize: 20
|
||||
}
|
||||
const data = await handleGetCommodityList(req)
|
||||
console.log('shdasidh', data);
|
||||
if (data.List && data.List.length > 0) {
|
||||
return { data: data.List, success: true, total: data.TotalCount }
|
||||
}
|
||||
return { data: [], success: true }
|
||||
}}
|
||||
columns={selectShopColumns}
|
||||
rowSelection={{
|
||||
type: 'checkbox',
|
||||
selectedRowKeys: selectedOrderRowKeys,
|
||||
onChange: (selectedRowKeys: any, selectedRows: any) => {
|
||||
console.log('selectedRowKeysselectedRowKeys', selectedRowKeys);
|
||||
console.log('selectedRowsselectedRowsselectedRows', selectedRows);
|
||||
|
||||
setSelectRowList(selectedRows)
|
||||
setSelectedOrderRowKeys(selectedRowKeys)
|
||||
},
|
||||
}}
|
||||
/>
|
||||
</Modal>
|
||||
</div >
|
||||
)
|
||||
}
|
||||
|
||||
export default connect(({ user }: ConnectState) => ({
|
||||
currentUser: user.currentUser
|
||||
}))(ProductChangePriceApproval);
|
||||
670
src/pages/travelMember/scenicSpotConfig/index.tsx
Normal file
670
src/pages/travelMember/scenicSpotConfig/index.tsx
Normal file
@ -0,0 +1,670 @@
|
||||
// 景区信息配置
|
||||
import React, { useRef, useState, Suspense } from 'react';
|
||||
import moment from 'moment'; // 时间相关引用,没有使用可以删除
|
||||
import numeral from "numeral"; // 数字相关引用,没有使用可以删除
|
||||
import { connect } from 'umi';
|
||||
|
||||
import useRequest from '@ahooksjs/use-request'; // 请求数据的引用
|
||||
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, ProFormDigit, ProFormMoney, ProFormSelect, ProFormText, ProFormTextArea, 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';
|
||||
|
||||
import type { CurrentUser } from "umi";
|
||||
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 { getFieldEnumTree, getFieldEnumName } from "@/services/options"; // 枚举的引用,没有使用可以删除
|
||||
import PageTitleBox from "@/components/PageTitleBox";
|
||||
import { handeDeleteSCENICAREA, handeGetSCENICAREAList, handeSynchroSCENICAREA } from '../service';
|
||||
import session from '@/utils/session';
|
||||
import { deletePicture, uploadPicture } from '@/services/picture';
|
||||
|
||||
|
||||
const beforeUpload = (file: any) => {
|
||||
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
|
||||
if (!isJpgOrPng) {
|
||||
message.error('请上传JPEG、jpg、png格式的图片文件!');
|
||||
}
|
||||
const isLt2M = file.size / 1024 / 1024 < 5;
|
||||
if (!isLt2M) {
|
||||
message.error('图片大小不超过 5MB!');
|
||||
}
|
||||
return isJpgOrPng && isLt2M;
|
||||
}
|
||||
|
||||
const scenicSpotConfig: React.FC<{ currentUser: CurrentUser | undefined }> = (props) => {
|
||||
const { currentUser } = props
|
||||
const { confirm } = Modal;
|
||||
const actionRef = useRef<ActionType>();
|
||||
const formRef = useRef<FormInstance>();
|
||||
const [currentRow, setCurrentRow] = useState<any>();
|
||||
const [showDetail, setShowDetail] = useState<boolean>();
|
||||
const [modalVisible, handleModalVisible] = useState<boolean>();
|
||||
const [confirmLoading, handleConfirmLoading] = useState<boolean>(false) // 弹出框的内容表单是否在提交
|
||||
const [searchParams, setSearchParams] = useState<any>();
|
||||
|
||||
// 弹出框拖动效果
|
||||
const [bounds, setBounds] = useState<{ left: number, right: number, top: number, bottom: number }>() // 移动的位置
|
||||
const [disabled, setDraggleDisabled] = useState<boolean>() // 是否拖动
|
||||
const draggleRef = React.createRef<any>()
|
||||
|
||||
const onDraggaleStart = (event, uiData) => {
|
||||
const { clientWidth, clientHeight } = window.document.documentElement;
|
||||
const targetRect = draggleRef.current?.getBoundingClientRect();
|
||||
if (!targetRect) {
|
||||
return;
|
||||
}
|
||||
setBounds({
|
||||
left: -targetRect.left + uiData.x,
|
||||
right: clientWidth - (targetRect.right - uiData.x),
|
||||
top: -targetRect.top + uiData.y,
|
||||
bottom: clientHeight - (targetRect.bottom - uiData.y),
|
||||
});
|
||||
};
|
||||
|
||||
// 景区类型的枚举
|
||||
let SCENICAREATYPEObj = session.get('SCENICAREATYPEObj')
|
||||
let SCENICAREATYPEList = session.get('SCENICAREATYPEList')
|
||||
// 景区状态的枚举
|
||||
let BUSINESSSTATEObj = session.get('BUSINESSSTATEObj')
|
||||
let BUSINESSSTATEList = session.get('BUSINESSSTATEList')
|
||||
|
||||
|
||||
// 文件列表
|
||||
const [fileList, setFileList] = useState<any>([])
|
||||
const [imagePreviewVisible, setImagePreviewVisible] = useState<boolean>(false) // 预览图片
|
||||
|
||||
|
||||
// 定义列表字段内容
|
||||
const columns: any = [
|
||||
{
|
||||
dataIndex: 'SCENICAREA_NAME',
|
||||
title: '景区名称',
|
||||
width: 200,
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
hideInDescriptions: true,
|
||||
fixed: "left",
|
||||
},
|
||||
{
|
||||
dataIndex: 'SCENICAREA_TYPE',
|
||||
title: '景区类型',
|
||||
width: 120,
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
valueType: "select",
|
||||
valueEnum: SCENICAREATYPEObj
|
||||
},
|
||||
{
|
||||
dataIndex: 'SCENICAREA_LOCATION',
|
||||
title: '景区位置',
|
||||
width: 200,
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'SCENICAREA_FACILITY',
|
||||
title: '景区设施',
|
||||
width: 150,
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'SCENICAREA_INFO',
|
||||
title: '景区简介',
|
||||
width: 300,
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'SCENICAREA_OPENHOURS',
|
||||
title: '开放时间',
|
||||
width: 180,
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'TICKET_PRICE',
|
||||
title: '门票价格',
|
||||
width: 120,
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'SCENICAREA_LEVEL',
|
||||
title: '景区等级',
|
||||
width: 120,
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'SCENICAREA_SCORE',
|
||||
title: '景区评分',
|
||||
width: 120,
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'SCENICAREA_EVALUATENUM',
|
||||
title: '评价条数',
|
||||
width: 120,
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'SCENICAREA_PHONE',
|
||||
title: '联系电话',
|
||||
width: 150,
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'SCENICAREA_STATE',
|
||||
title: '景区状态',
|
||||
width: 120,
|
||||
ellipsis: true,
|
||||
valueType: 'select',
|
||||
align: 'center',
|
||||
valueEnum: BUSINESSSTATEObj,
|
||||
initialValue: "1000"
|
||||
},
|
||||
{
|
||||
dataIndex: 'OPERATE_DATE',
|
||||
title: '修改时间',
|
||||
width: 180,
|
||||
ellipsis: true,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
render: (_, record) => {
|
||||
return record?.OPERATE_DATE ? moment(record?.OPERATE_DATE).format('YYYY-MM-DD HH:mm:ss') : "-"
|
||||
}
|
||||
},
|
||||
{
|
||||
dataIndex: 'option',
|
||||
title: '操作',
|
||||
width: 120,
|
||||
ellipsis: true,
|
||||
valueType: 'option',
|
||||
hideInSearch: true,
|
||||
align: 'center',
|
||||
fixed: "right",
|
||||
render: (_, record) => {
|
||||
return (
|
||||
<Space>
|
||||
<a
|
||||
onClick={() => {
|
||||
let imgList: any = []
|
||||
if (record?.ImageList && record?.ImageList.length > 0) {
|
||||
record?.ImageList.forEach((item: any) => {
|
||||
let obj = JSON.parse(JSON.stringify(item))
|
||||
obj.url = obj.ImageUrl
|
||||
obj.name = obj.ImageName
|
||||
obj.uid = item.ImageId
|
||||
obj.status = 'done'
|
||||
imgList.push(obj)
|
||||
})
|
||||
}
|
||||
setCurrentRow({
|
||||
...record,
|
||||
SCENICAREA_Image: imgList
|
||||
});
|
||||
setFileList(imgList);
|
||||
handleModalVisible(true);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</a>
|
||||
<Popconfirm
|
||||
title="确认删除该景区信息列表信息吗?"
|
||||
onConfirm={async () => {
|
||||
await handelDelete(record.SCENICAREA_ID);
|
||||
}}
|
||||
>
|
||||
<a>删除</a>
|
||||
</Popconfirm>
|
||||
</Space >
|
||||
);
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
// 预览上传后的图片
|
||||
const handlePreview = async () => {
|
||||
setFileList(fileList)
|
||||
setImagePreviewVisible(true)
|
||||
};
|
||||
const handleChangePreview = (val: any) => {
|
||||
setImagePreviewVisible(val)
|
||||
}
|
||||
|
||||
const handelDelete = async (scenicareaid: number) => {
|
||||
const result = await handeDeleteSCENICAREA({ SCENICAREAId: scenicareaid });
|
||||
|
||||
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 = {}
|
||||
let imgList: any = []
|
||||
if (fileList && fileList.length > 0) {
|
||||
fileList.forEach((item: any) => {
|
||||
imgList.push({
|
||||
ImageName: item.name,
|
||||
ImageUrl: item.url
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
if (currentRow?.USERDEFINEDTYPE_ID) {
|
||||
req = {
|
||||
...currentRow,
|
||||
...res,
|
||||
// ImageList: imgList,
|
||||
PROVINCE_CODE: currentUser?.ProvinceCode,
|
||||
STAFF_ID: currentUser?.ID,
|
||||
STAFF_NAME: currentUser?.Name,
|
||||
OPERATE_DATE: moment().format('YYYY-MM-DD HH:mm:ss'),
|
||||
}
|
||||
} else {
|
||||
req = {
|
||||
...res,
|
||||
// ImageList: imgList,
|
||||
PROVINCE_CODE: currentUser?.ProvinceCode,
|
||||
STAFF_ID: currentUser?.ID,
|
||||
STAFF_NAME: currentUser?.Name,
|
||||
OPERATE_DATE: moment().format('YYYY-MM-DD HH:mm:ss'),
|
||||
}
|
||||
}
|
||||
const data = await handeSynchroSCENICAREA(req)
|
||||
console.log('datadatadatadata', data);
|
||||
|
||||
handleConfirmLoading(false)
|
||||
if (data.Result_Code === 100) {
|
||||
if (res.SCENICAREA_Image && res.SCENICAREA_Image.length > 0) {
|
||||
const formData = new FormData();
|
||||
res.SCENICAREA_Image.forEach((file: any) => {
|
||||
formData.append('files[]', file.originFileObj);
|
||||
formData.append('ImageName', typeof file !== 'string' ? file?.name : '');
|
||||
});
|
||||
formData.append('TableId', data.Result_Data.SCENICAREA_ID);
|
||||
formData.append('TableType', '1305');
|
||||
|
||||
console.log('formData', formData);
|
||||
await uploadPicture(formData)
|
||||
}
|
||||
message.success("新增成功!")
|
||||
setCurrentRow(undefined)
|
||||
formRef?.current?.resetFields()
|
||||
handleModalVisible(false)
|
||||
actionRef.current?.reload()
|
||||
setFileList([])
|
||||
} else {
|
||||
message.error(data.Result_Desc)
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div style={{
|
||||
width: "100%",
|
||||
paddingTop: 0,
|
||||
paddingBottom: 0,
|
||||
paddingRight: 0,
|
||||
background: "#fff"
|
||||
}}>
|
||||
<ProTable
|
||||
scroll={{ x: "100%", y: 'calc(100vh - 410px)' }}
|
||||
rowKey={(record) => {
|
||||
return `${record?.SCENICAREA_ID}`
|
||||
}}
|
||||
formRef={formRef}
|
||||
headerTitle={<PageTitleBox props={props} />} // 列表表头
|
||||
actionRef={actionRef}
|
||||
search={{ span: 6, labelWidth: 'auto' }}
|
||||
bordered
|
||||
// 请求数据
|
||||
request={async (params, sorter) => {
|
||||
const req = {
|
||||
searchParameter: {
|
||||
PROVINCE_CODES: currentUser?.ProvinceCode,
|
||||
SCENICAREA_TYPES: params?.SCENICAREA_TYPE,
|
||||
SCENICAREA_STATES: params?.SCENICAREA_STATE,
|
||||
},
|
||||
PageIndex: 1,
|
||||
PageSize: 999999,
|
||||
}
|
||||
const data = await handeGetSCENICAREAList(req);
|
||||
console.log('datadatadatadatadata', data);
|
||||
if (data.List && data.List.length > 0) {
|
||||
return { data: data.List, success: true, total: data.TotalCount }
|
||||
}
|
||||
return { data: [], success: true }
|
||||
}}
|
||||
columns={columns}
|
||||
toolbar={{
|
||||
actions: [
|
||||
// 新增按钮
|
||||
<Button
|
||||
key="new"
|
||||
icon={<PlusOutlined />}
|
||||
type="primary"
|
||||
onClick={() => {
|
||||
handleModalVisible(true);
|
||||
}}
|
||||
>
|
||||
景区信息
|
||||
</Button>,
|
||||
],
|
||||
}}
|
||||
/>
|
||||
|
||||
|
||||
{/* 图片预览组件 */}
|
||||
{fileList && fileList.length > 0 && <div style={{ display: 'none' }}>
|
||||
<Image.PreviewGroup
|
||||
preview={{
|
||||
visible: imagePreviewVisible,
|
||||
onVisibleChange: vis => {
|
||||
handleChangePreview(vis)
|
||||
}
|
||||
}}>
|
||||
{
|
||||
fileList.map((n) => <Image src={n.url} key={n.url} />)
|
||||
}
|
||||
</Image.PreviewGroup>
|
||||
</div>}
|
||||
|
||||
<Modal
|
||||
title={
|
||||
<div
|
||||
style={{
|
||||
width: '100%',
|
||||
cursor: 'move',
|
||||
}}
|
||||
onMouseOver={() => {
|
||||
if (disabled) {
|
||||
setDraggleDisabled(false)
|
||||
}
|
||||
}}
|
||||
onMouseOut={() => {
|
||||
setDraggleDisabled(true)
|
||||
}}
|
||||
|
||||
onFocus={() => { }}
|
||||
onBlur={() => { }}
|
||||
>
|
||||
{currentRow ? '更新景区信息' : '新建景区信息'}
|
||||
</div>
|
||||
}
|
||||
destroyOnClose={true}
|
||||
width={900}
|
||||
visible={modalVisible}
|
||||
confirmLoading={confirmLoading}
|
||||
afterClose={() => {
|
||||
formRef.current?.resetFields();
|
||||
setCurrentRow(undefined);
|
||||
}}
|
||||
onCancel={() => {
|
||||
handleConfirmLoading(false)
|
||||
handleModalVisible(false)
|
||||
setFileList([])
|
||||
}}
|
||||
|
||||
onOk={async () => { // 提交框内的数据
|
||||
formRef?.current?.validateFields().then(() => {
|
||||
handleConfirmLoading(true)
|
||||
formRef?.current?.submit()
|
||||
})
|
||||
}}
|
||||
modalRender={(modal) => {
|
||||
return <Draggable
|
||||
disabled={disabled}
|
||||
bounds={bounds}
|
||||
onStart={(event, uiData) => onDraggaleStart(event, uiData)}
|
||||
>
|
||||
<div ref={draggleRef}>{modal}</div>
|
||||
</Draggable>
|
||||
}}
|
||||
>
|
||||
<ProForm
|
||||
layout={'horizontal'}
|
||||
formRef={formRef}
|
||||
autoFocusFirstInput
|
||||
submitter={false}
|
||||
preserve={false}
|
||||
initialValues={currentRow ? {
|
||||
...currentRow,
|
||||
SCENICAREA_Image: currentRow?.ImageList
|
||||
} : {
|
||||
SCENICAREA_STATE: 1000
|
||||
}}
|
||||
onFinish={async (values) => {
|
||||
let newValue = { ...values };
|
||||
if (currentRow) {
|
||||
// 编辑数据
|
||||
newValue = { ...values, SCENICAREA_ID: currentRow.SCENICAREA_ID };
|
||||
}
|
||||
// 如果有开关,要把开关的代码写进去
|
||||
await handleAddUpdate(newValue);
|
||||
|
||||
handleConfirmLoading(false)
|
||||
handleModalVisible(false);
|
||||
}}
|
||||
>
|
||||
<Row gutter={8}>
|
||||
<Col span={12}>
|
||||
<ProFormSelect
|
||||
name="SCENICAREA_TYPE"
|
||||
label="景区类型"
|
||||
options={SCENICAREATYPEList}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: "请选择景区类型!"
|
||||
}
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<ProFormText
|
||||
name="SCENICAREA_NAME"
|
||||
label="景区名称"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: "请输入景区名称!"
|
||||
}
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<ProFormText
|
||||
name="SCENICAREA_LOCATION"
|
||||
label="景区地址"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<ProFormDigit
|
||||
name="SCENICAREA_X"
|
||||
label="景区经度"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: "请输入景区经度!"
|
||||
}
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<ProFormDigit
|
||||
name="SCENICAREA_Y"
|
||||
label="景区纬度"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: "请输入景区纬度!"
|
||||
}
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<ProFormText
|
||||
name="SCENICAREA_FACILITY"
|
||||
label="景区设施"
|
||||
/>
|
||||
</Col>
|
||||
|
||||
<Col span={12}>
|
||||
<ProFormText
|
||||
name="SCENICAREA_OPENHOURS"
|
||||
label="开放时间"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<ProFormDigit
|
||||
name="TICKET_PRICE"
|
||||
label="门票价格"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<ProFormText
|
||||
name="SCENICAREA_LEVEL"
|
||||
label="景区等级"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<ProFormDigit
|
||||
name="SCENICAREA_SCORE"
|
||||
label="景区评分"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<ProFormDigit
|
||||
name="SCENICAREA_EVALUATENUM"
|
||||
label="评价条数"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<ProFormText
|
||||
name="SCENICAREA_PHONE"
|
||||
label="联系电话"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<ProFormText
|
||||
name="SCENICAREA_EMAIL"
|
||||
label="联系邮箱"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<ProFormText
|
||||
name="SCENICAREA_WEBSITE"
|
||||
label="官方网站"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<ProFormSelect
|
||||
name="SCENICAREA_STATE"
|
||||
label="景区状态"
|
||||
options={BUSINESSSTATEList}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: "请选择景区状态!"
|
||||
}
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<ProFormUploadButton
|
||||
name="SCENICAREA_Image"
|
||||
label="景区图片"
|
||||
listType="picture-card"
|
||||
accept="image/*"
|
||||
fieldProps={{
|
||||
beforeUpload,
|
||||
onPreview: handlePreview,
|
||||
fileList: fileList, // 绑定 fileList
|
||||
onChange: async (info: any) => {
|
||||
console.log('info', info);
|
||||
console.log('fileList', fileList);
|
||||
if (info.file.status === 'removed') {
|
||||
const index = fileList.findIndex(n => n.uid === info.file.uid);
|
||||
confirm({
|
||||
title: '确认删除该文件吗?',
|
||||
icon: <ExclamationCircleOutlined />,
|
||||
async onOk() {
|
||||
if (info.file.ImageId) {
|
||||
const deleteLoading = message.loading('正在删除...')
|
||||
const success = await deletePicture(info.file?.ImagePath, info.file?.uid, '', '5000')
|
||||
deleteLoading()
|
||||
|
||||
if (success) {
|
||||
const files = [...fileList]
|
||||
files.splice(index, 1)
|
||||
setFileList(files)
|
||||
message.success("删除成功")
|
||||
actionRef.current?.reload()
|
||||
}
|
||||
else {
|
||||
message.error("删除失败")
|
||||
}
|
||||
} else {
|
||||
const files = [...fileList];
|
||||
files.splice(index, 1);
|
||||
setFileList(files);
|
||||
}
|
||||
},
|
||||
onCancel() {
|
||||
},
|
||||
});
|
||||
} else {
|
||||
setFileList(info.fileList)
|
||||
}
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<ProFormTextArea
|
||||
name="SCENICAREA_INFO"
|
||||
label="景区简介"
|
||||
/>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<ProFormTextArea
|
||||
name="SCENICAREA_DESC"
|
||||
label="备注说明"
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
</ProForm>
|
||||
</Modal>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
export default connect(({ user }: ConnectState) => ({
|
||||
currentUser: user.currentUser
|
||||
}))(scenicSpotConfig);
|
||||
@ -403,3 +403,40 @@ export async function handeDeleteMALLCOMMENT(params: any) {
|
||||
}
|
||||
return data
|
||||
}
|
||||
|
||||
|
||||
// 获得景区列表
|
||||
export async function handeGetSCENICAREAList(params: any) {
|
||||
const data = await requestEncryption(`/WisdomServerpart/GetSCENICAREAList`, {
|
||||
method: 'POST',
|
||||
data: { ...params, requestEncryption: true }
|
||||
})
|
||||
if (data.Result_Code !== 100) {
|
||||
return []
|
||||
}
|
||||
return data.Result_Data
|
||||
}
|
||||
|
||||
// 同步景区列表
|
||||
export async function handeSynchroSCENICAREA(params: any) {
|
||||
const data = await requestEncryption(`/WisdomServerpart/SynchroSCENICAREA`, {
|
||||
method: 'POST',
|
||||
data: { ...params, requestEncryption: true }
|
||||
})
|
||||
if (data.Result_Code !== 100) {
|
||||
return []
|
||||
}
|
||||
return data
|
||||
}
|
||||
|
||||
// 删除景区
|
||||
export async function handeDeleteSCENICAREA(params: any) {
|
||||
const data = await requestEncryption(`/WisdomServerpart/DeleteSCENICAREA`, {
|
||||
method: 'POST',
|
||||
data: { ...params, requestEncryption: true }
|
||||
})
|
||||
if (data.Result_Code !== 100) {
|
||||
return []
|
||||
}
|
||||
return data
|
||||
}
|
||||
@ -8,6 +8,7 @@ import moment from 'moment';
|
||||
import session from './session';
|
||||
import type { CurrentUser } from '@/models/user';
|
||||
import { SynchroBEHAVIORRECORD } from '@/services/user';
|
||||
import { encryptAES } from './handleAes';
|
||||
|
||||
const codeMessage: Record<number, string> = {
|
||||
200: '服务器成功返回请求的数据。',
|
||||
@ -146,7 +147,12 @@ request.interceptors.request.use((url, opt: any) => {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (options && options.data && options.data.requestEncryption) {
|
||||
options.data = {
|
||||
name: "",
|
||||
value: encryptAES(JSON.stringify(options.data))
|
||||
}
|
||||
}
|
||||
}
|
||||
return {
|
||||
// url: url.indexOf('handler_ajax.ashx')>-1 ?`https://user.eshangtech.com${url}`: `http://47.96.233.105/EShangApiMain${url}`,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user