This commit is contained in:
ylj20011123 2025-12-07 09:16:30 +08:00
parent 113e6795f9
commit a5e49cfab8
2 changed files with 39 additions and 42 deletions

View File

@ -303,7 +303,6 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
// <Space> // <Space>
// <a // <a
// onClick={() => { // onClick={() => {
// console.log('recordrecordrecord', record);
// setCurrentRow({ ...record }); // setCurrentRow({ ...record });
// handleModalVisible(true); // handleModalVisible(true);
@ -443,7 +442,6 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
<Popconfirm <Popconfirm
title="确认删除该商品规格嘛?" title="确认删除该商品规格嘛?"
onConfirm={async () => { onConfirm={async () => {
console.log('recordrecordrecord', record);
const data = await handeDeleteRTCOMMODITY_MULTI({ RTCOMMODITY_MULTIId: record?.RTCOMMODITY_MULTI_ID }) const data = await handeDeleteRTCOMMODITY_MULTI({ RTCOMMODITY_MULTIId: record?.RTCOMMODITY_MULTI_ID })
if (data.Result_Code !== 100) { if (data.Result_Code !== 100) {
message.error(`${data.Result_Desc}` || `${data.Result_Code}:删除失败`); message.error(`${data.Result_Desc}` || `${data.Result_Code}:删除失败`);
@ -549,7 +547,6 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
] ]
obj[item.USERDEFINEDTYPE_ID] = childrenTypeList obj[item.USERDEFINEDTYPE_ID] = childrenTypeList
}) })
console.log('objobjobjobj', obj);
for (let key in obj) { for (let key in obj) {
if (obj[key].indexOf(Number(currentRow?.USERDEFINEDTYPE_ID)) !== -1) { if (obj[key].indexOf(Number(currentRow?.USERDEFINEDTYPE_ID)) !== -1) {
@ -558,8 +555,6 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
} }
} }
console.log('resPidresPidresPidresPid', resPid);
handlecsyncWeChatGetMallGoodsInfo({ appId: 'wxee018fb96955552a', userdefinedTypeId: resPid }) handlecsyncWeChatGetMallGoodsInfo({ appId: 'wxee018fb96955552a', userdefinedTypeId: resPid })
} }
}; };
@ -614,7 +609,6 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
WECHATAPPSIGN_NAME: "彩云驿出行" WECHATAPPSIGN_NAME: "彩云驿出行"
} }
} }
console.log('reqreqreqreq', req);
const data = await handeSynchroCOMMODITY(req) const data = await handeSynchroCOMMODITY(req)
handleConfirmLoading(false) handleConfirmLoading(false)
@ -668,8 +662,6 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
] ]
obj[item.USERDEFINEDTYPE_ID] = childrenTypeList obj[item.USERDEFINEDTYPE_ID] = childrenTypeList
}) })
console.log('objobjobjobj', obj);
console.log('datadatadatadata', data);
for (let key in obj) { for (let key in obj) {
if (obj[key].indexOf(Number(data.Result_Data?.USERDEFINEDTYPE_ID)) !== -1) { if (obj[key].indexOf(Number(data.Result_Data?.USERDEFINEDTYPE_ID)) !== -1) {
@ -678,8 +670,6 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
} }
} }
console.log('resPidresPidresPidresPid', resPid);
handlecsyncWeChatGetMallGoodsInfo({ appId: 'wxee018fb96955552a', userdefinedTypeId: resPid }) handlecsyncWeChatGetMallGoodsInfo({ appId: 'wxee018fb96955552a', userdefinedTypeId: resPid })
} else { } else {
message.error(data.Result_Desc) message.error(data.Result_Desc)
@ -700,7 +690,6 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
formData.append('imageType', "1000"); formData.append('imageType', "1000");
formData.append('TableType', "1207"); formData.append('TableType', "1207");
console.log('formData', formData);
let res = await uploadAHYDPicture(formData) let res = await uploadAHYDPicture(formData)
} }
@ -715,7 +704,6 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
formData.append('imageType', "2000"); formData.append('imageType', "2000");
formData.append('TableType', "1207"); formData.append('TableType', "1207");
console.log('formData', formData);
let res = await uploadAHYDPicture(formData) let res = await uploadAHYDPicture(formData)
} }
@ -730,7 +718,6 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
formData.append('imageType', "5000"); formData.append('imageType', "5000");
formData.append('TableType', "1207"); formData.append('TableType', "1207");
console.log('formData', formData);
let res = await uploadAHYDPicture(formData) let res = await uploadAHYDPicture(formData)
} }
} }
@ -791,7 +778,6 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
// 设置税率 // 设置税率
const handleSetTaxRate = async () => { const handleSetTaxRate = async () => {
if (selectShopRowKey && selectShopRowKey.length > 0) { if (selectShopRowKey && selectShopRowKey.length > 0) {
console.log('selectShopRowKeyselectShopRowKeyselectShopRowKey', selectShopRowKey);
setShowRateModal(true) setShowRateModal(true)
} else { } else {
message.error('请先选择商品!') message.error('请先选择商品!')
@ -872,7 +858,6 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
const data = await handeGetCOMMODITYList(req); const data = await handeGetCOMMODITYList(req);
setCurrentSearchText(params?.searchText || "") setCurrentSearchText(params?.searchText || "")
console.log('datadatadatadatadata', data);
handleSetlogSave(`点击查询按钮`) handleSetlogSave(`点击查询按钮`)
setSelectShopRowKey([]) setSelectShopRowKey([])
if (data.List && data.List.length > 0) { if (data.List && data.List.length > 0) {
@ -936,7 +921,6 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
type: 'checkbox', type: 'checkbox',
selectedRowKeys: selectShopRowKey, selectedRowKeys: selectShopRowKey,
onChange: (rowKeys, rowDetail) => { onChange: (rowKeys, rowDetail) => {
console.log('rowKeysrowKeysrowKeys', rowKeys);
setSelectShopRowKey(rowKeys) setSelectShopRowKey(rowKeys)
}, },
}} }}
@ -1070,7 +1054,6 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
UPPER_STATE: currentRow?.UPPER_STATE, UPPER_STATE: currentRow?.UPPER_STATE,
DATAFORMAT: currentRow?.DATAFORMAT, DATAFORMAT: currentRow?.DATAFORMAT,
} }
console.log('oldFormRes', oldFormRes);
const names = [ const names = [
"COMMODITY_NAME", "COMMODITY_NATURE", "BRAND_ID", "USERDEFINEDTYPE_ID", "MERCHANTS_ID", "COMMODITY_NAME", "COMMODITY_NATURE", "BRAND_ID", "USERDEFINEDTYPE_ID", "MERCHANTS_ID",
@ -1081,7 +1064,6 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
"UPPER_DATE", "LIMIT_TOTALCOUNT", "LIMIT_DAILYCOUNT", "WECHATAPPSIGN_ID", "UPPER_STATE", "DATAFORMAT" "UPPER_DATE", "LIMIT_TOTALCOUNT", "LIMIT_DAILYCOUNT", "WECHATAPPSIGN_ID", "UPPER_STATE", "DATAFORMAT"
]; ];
let newFormRes: any = formRef.current?.getFieldsValue(names) let newFormRes: any = formRef.current?.getFieldsValue(names)
console.log('newFormResnewFormResnewFormRes', newFormRes);
if (isEqual(normalize(oldFormRes), normalize(newFormRes))) { if (isEqual(normalize(oldFormRes), normalize(newFormRes))) {
message.error('与原商品一致,无法另存为!') message.error('与原商品一致,无法另存为!')
@ -1285,7 +1267,6 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
}) })
setBRAND_NAMEList(list) setBRAND_NAMEList(list)
console.log('品牌列表', list);
return list return list
} }
@ -1314,7 +1295,6 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
name="USERDEFINEDTYPE_ID" name="USERDEFINEDTYPE_ID"
label="商品分类" label="商品分类"
request={async () => { request={async () => {
console.log('leftTreeDataleftTreeDataleftTreeData', leftTreeData);
return leftTreeData return leftTreeData
}} }}
@ -1329,6 +1309,12 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
filterTreeNode: (input, node) => filterTreeNode: (input, node) =>
(node.USERDEFINEDTYPE_NAME || '').toLowerCase().includes(input.toLowerCase()) (node.USERDEFINEDTYPE_NAME || '').toLowerCase().includes(input.toLowerCase())
}} }}
rules={[
{
required: true,
message: '请选择商品分类!'
}
]}
/> />
</Col> </Col>
<Col span={12}> <Col span={12}>
@ -1349,7 +1335,6 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
PageSize: 999999, PageSize: 999999,
} }
const data = await handeGetMERCHANTSList(req); const data = await handeGetMERCHANTSList(req);
console.log('datadatadatadatadata', data);
if (data.List && data.List.length > 0) { if (data.List && data.List.length > 0) {
let list: any = [] let list: any = []
data.List.forEach((item: any) => { data.List.forEach((item: any) => {
@ -1374,7 +1359,7 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
rules={[ rules={[
{ {
required: true, required: true,
message: "请选择供货商户" message: "请选择供货商户"
} }
]} ]}
disabled={currentUser?.UserPattern === 4000} disabled={currentUser?.UserPattern === 4000}
@ -1873,7 +1858,6 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
setSpecsData([]) setSpecsData([])
}} }}
onOk={async () => { // 提交框内的数据 onOk={async () => { // 提交框内的数据
console.log('specsDataspecsData', specsData);
// 判断表格数据是不是都填了 // 判断表格数据是不是都填了
let isAllOk: boolean = true let isAllOk: boolean = true
if (specsData && specsData.length > 0) { if (specsData && specsData.length > 0) {
@ -1908,10 +1892,8 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
const req: any = { const req: any = {
list: list list: list
} }
console.log('reqreqreq', req);
const data = await handeSynchroRTCOMMODITYMULTIList(req) const data = await handeSynchroRTCOMMODITYMULTIList(req)
console.log('datadatadatadata', data);
if (data.Result_Code === 100) { if (data.Result_Code === 100) {
message.success("同步成功!") message.success("同步成功!")
setShowMoreSpecs(false) setShowMoreSpecs(false)
@ -1944,7 +1926,6 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
}} }}
dataSource={specsData} dataSource={specsData}
request={async () => { request={async () => {
console.log('currentRowcurrentRowcurrentRow', currentRow);
const req: any = { const req: any = {
searchParameter: { searchParameter: {
@ -1957,7 +1938,6 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
SortStr: "COMMODITY_MULTI_ID" SortStr: "COMMODITY_MULTI_ID"
} }
const data = await handeGetRTCOMMODITY_MULTIList(req) const data = await handeGetRTCOMMODITY_MULTIList(req)
console.log('多规格管理', data);
if (data.List && data.List.length > 0) { if (data.List && data.List.length > 0) {
setSpecsData(data.List) setSpecsData(data.List)
// return { data: data.List, success: true, total: data.TotalCount } // return { data: data.List, success: true, total: data.TotalCount }
@ -1983,8 +1963,6 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
}} }}
onOk={async () => { // 提交框内的数据 onOk={async () => { // 提交框内的数据
setShowAddSpecsModal(false) setShowAddSpecsModal(false)
console.log('specsDataspecsDataspecsData', specsData);
console.log('selectedRowsselectedRowsselectedRows', selectedRows);
let list: any = JSON.parse(JSON.stringify(specsData)) let list: any = JSON.parse(JSON.stringify(specsData))
// list = list.concat(selectedRows) // list = list.concat(selectedRows)
if (selectedRows && selectedRows.length > 0) { if (selectedRows && selectedRows.length > 0) {
@ -2032,7 +2010,6 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
}, },
} }
const data = await handeGetCOMMODITY_MULTIList(req); const data = await handeGetCOMMODITY_MULTIList(req);
console.log('datadatadatadata', data);
let list = data.List let list = data.List
if (list && list.length > 0) { if (list && list.length > 0) {
return { data: list, success: true } return { data: list, success: true }
@ -2131,7 +2108,6 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
}} }}
onOk={async () => { // 提交框内的数据 onOk={async () => { // 提交框内的数据
let res: any = associatedCouponsModalRef.current let res: any = associatedCouponsModalRef.current
console.log('resdada', res);
// setRelevanceCouponList(res.couponList) // setRelevanceCouponList(res.couponList)
formRef.current?.setFieldsValue({ relevanceCoupon: res.selectShopRowKey.map(Number) }) formRef.current?.setFieldsValue({ relevanceCoupon: res.selectShopRowKey.map(Number) })

View File

@ -1,14 +1,10 @@
// 供应商分类 // 供应商分类
import React, { useRef, useState, Suspense } from 'react'; import React, { useRef, useState, Suspense } from 'react';
import moment from 'moment'; // 时间相关引用,没有使用可以删除 import moment from 'moment'; // 时间相关引用,没有使用可以删除
import numeral from "numeral"; // 数字相关引用,没有使用可以删除
import { connect } from 'umi'; import { connect } from 'umi';
import useRequest from '@ahooksjs/use-request'; // 请求数据的引用
import Draggable from 'react-draggable'; import Draggable from 'react-draggable';
import SubMenu from "antd/lib/menu/SubMenu";
import ProTable from '@ant-design/pro-table'; import ProTable from '@ant-design/pro-table';
import ProDescriptions from '@ant-design/pro-descriptions';
import ProForm, { ProFormDatePicker, ProFormDateTimePicker, ProFormDateTimeRangePicker, ProFormDigit, ProFormMoney, ProFormSelect, ProFormText, ProFormTextArea, ProFormTreeSelect, ProFormUploadButton } from '@ant-design/pro-form'; import ProForm, { ProFormDatePicker, ProFormDateTimePicker, ProFormDateTimeRangePicker, ProFormDigit, ProFormMoney, ProFormSelect, ProFormText, ProFormTextArea, ProFormTreeSelect, ProFormUploadButton } from '@ant-design/pro-form';
import { MenuFoldOutlined, PlusOutlined, ExclamationCircleOutlined } from '@ant-design/icons'; import { MenuFoldOutlined, PlusOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
import { PageContainer } from '@ant-design/pro-layout'; import { PageContainer } from '@ant-design/pro-layout';
@ -17,14 +13,10 @@ import { Button, Col, Drawer, message, Row, Popconfirm, Space, Image, Modal, For
import type { CurrentUser } from "umi"; import type { CurrentUser } from "umi";
import type { ConnectState } from '@/models/connect'; import type { ConnectState } from '@/models/connect';
import type { ActionType, ProColumns } from '@ant-design/pro-table'; import type { ActionType, ProColumns } from '@ant-design/pro-table';
import type { ProDescriptionsItemProps } from '@ant-design/pro-descriptions';
import type { FormInstance } from 'antd'; import type { FormInstance } from 'antd';
import { getFieldEnumTree, getFieldEnumName } from "@/services/options"; // 枚举的引用,没有使用可以删除
import { handlDeleteAUTOTYPE, handlDeleteUSERDEFINEDTYPE, handlGetNestingAUTOTYPEList, handlGetUSERDEFINEDTYPEList, handlSynchroAUTOTYPE, handlSynchroUSERDEFINEDTYPE } from '../service'; import { handlDeleteAUTOTYPE, handlDeleteUSERDEFINEDTYPE, handlGetNestingAUTOTYPEList, handlGetUSERDEFINEDTYPEList, handlSynchroAUTOTYPE, handlSynchroUSERDEFINEDTYPE } from '../service';
import PageTitleBox from '@/components/PageTitleBox'; import PageTitleBox from '@/components/PageTitleBox';
import { uploadPicture } from '@/services/picture';
import defaultIcon from '../../../assets/brand/defaultIcon.png'
import ModalFooter from '../scenicSpotConfig/component/modalFooter'; import ModalFooter from '../scenicSpotConfig/component/modalFooter';
import { handleSetlogSave } from '@/utils/format'; import { handleSetlogSave } from '@/utils/format';
@ -48,10 +40,8 @@ const SupplierClassification: React.FC<{ currentUser: CurrentUser | undefined }>
const actionRef = useRef<ActionType>(); const actionRef = useRef<ActionType>();
const formRef = useRef<FormInstance>(); const formRef = useRef<FormInstance>();
const [currentRow, setCurrentRow] = useState<any>(); const [currentRow, setCurrentRow] = useState<any>();
const [showDetail, setShowDetail] = useState<boolean>();
const [modalVisible, handleModalVisible] = useState<boolean>(); const [modalVisible, handleModalVisible] = useState<boolean>();
const [confirmLoading, handleConfirmLoading] = useState<boolean>(false) // 弹出框的内容表单是否在提交 const [confirmLoading, handleConfirmLoading] = useState<boolean>(false) // 弹出框的内容表单是否在提交
const [searchParams, setSearchParams] = useState<any>();
// 分类的树形结构数据 // 分类的树形结构数据
const [typeTreeData, setTypeTreeData] = useState<any>() const [typeTreeData, setTypeTreeData] = useState<any>()
// 表单里面的是否预售 // 表单里面的是否预售
@ -268,6 +258,30 @@ const SupplierClassification: React.FC<{ currentUser: CurrentUser | undefined }>
} }
} }
// 找出对应的id 在第几层的方法
const findLevelById = (tree: any, targetId: any, level = 0) => {
for (const node of tree) {
// 找到当前节点
if (node.AUTOTYPE_ID === targetId) {
return level;
}
// 递归查找子节点
if (node.children && node.children.length > 0) {
const childLevel: any = findLevelById(node.children, targetId, level + 1);
if (childLevel !== -1) {
return childLevel;
}
}
}
if (targetId === -1) {
return -1
}
return 0; // 暂时返回 -1用来区分未找到
}
return ( return (
<PageContainer header={{ <PageContainer header={{
title: '', title: '',
@ -429,10 +443,17 @@ const SupplierClassification: React.FC<{ currentUser: CurrentUser | undefined }>
}} }}
onFinish={async (values) => { onFinish={async (values) => {
let newValue = { ...values }; let newValue = { ...values };
// 领导叫你别加 他自己加 2025-12-02
// const level = findLevelById(typeTreeData, newValue.AUTOTYPE_PID)
// console.log('typeTreeDatatypeTreeDatatypeTreeData', typeTreeData);
if (currentRow) { if (currentRow) {
// 编辑数据 // 编辑数据
newValue = { ...values, AUTOTYPE_ID: currentRow.AUTOTYPE_ID }; newValue = { ...values, AUTOTYPE_ID: currentRow.AUTOTYPE_ID };
//, AUTOTYPE_LEVEL: level + 1
} }
// else {
// newValue = { ...values, AUTOTYPE_LEVEL: level + 1 };
// }
// 如果有开关,要把开关的代码写进去 // 如果有开关,要把开关的代码写进去
await handleAddUpdate(newValue); await handleAddUpdate(newValue);
@ -457,7 +478,7 @@ const SupplierClassification: React.FC<{ currentUser: CurrentUser | undefined }>
PROVINCE_CODE: "", PROVINCE_CODE: "",
GOODSTYPE: 1000, GOODSTYPE: 1000,
}; };
const data = await handlGetUSERDEFINEDTYPEList(req); let data = await handlGetUSERDEFINEDTYPEList(req);
if (data.List && data.List.length > 0) { if (data.List && data.List.length > 0) {
data.List.unshift({ AUTOTYPE_NAME: "默认类别", AUTOTYPE_ID: -1 }); data.List.unshift({ AUTOTYPE_NAME: "默认类别", AUTOTYPE_ID: -1 });
setTypeTreeData(data.List); setTypeTreeData(data.List);