diff --git a/dist.zip b/dist.zip index 81c4453..8468042 100644 Binary files a/dist.zip and b/dist.zip differ diff --git a/package.json b/package.json index 7a268b2..0b3d113 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ant-design-pro", - "version": "4.5.111", + "version": "4.5.121", "private": true, "description": "An out-of-box UI solution for enterprise applications", "scripts": { diff --git a/src/pages/travelMember/BookingMealOrder/components/orderDetailModal.tsx b/src/pages/travelMember/BookingMealOrder/components/orderDetailModal.tsx index 41008ac..4062a98 100644 --- a/src/pages/travelMember/BookingMealOrder/components/orderDetailModal.tsx +++ b/src/pages/travelMember/BookingMealOrder/components/orderDetailModal.tsx @@ -187,7 +187,7 @@ const OrderDetailModal = ({ modalVisible, handleCloseModal, currentRow, detailTy return } const req: any = { - SaleBillChildId: currentRow?.SALEBILL_CHILD_ID, + SaleBillChildId: currentRow?.SALEBILL_CHILD_ID || currentRow?.OrderChildId, SaleBillId: currentRow?.SALEBILL_ID, TrackingInfo: str || "" } @@ -213,7 +213,7 @@ const OrderDetailModal = ({ modalVisible, handleCloseModal, currentRow, detailTy // 订单删除 const handleGetDeleteOrder = async () => { const req: any = { - SaleBillChildId: currentRow?.SALEBILL_CHILD_ID || "", + SaleBillChildId: currentRow?.SALEBILL_CHILD_ID || currentRow?.OrderChildId || "", SaleBillId: currentRow?.SALEBILL_ID, } handleConfirmLoading(true) @@ -277,7 +277,7 @@ const OrderDetailModal = ({ modalVisible, handleCloseModal, currentRow, detailTy return } const req: any = { - SaleBillChildId: currentRow?.SALEBILL_CHILD_ID, + SaleBillChildId: currentRow?.SALEBILL_CHILD_ID || currentRow?.OrderChildId, SaleBillId: currentRow?.SALEBILL_ID, TrackingInfo: str || "" } @@ -385,21 +385,21 @@ const OrderDetailModal = ({ modalVisible, handleCloseModal, currentRow, detailTy submitter={false} request={async () => { console.log('currentRow', currentRow); - if (currentRow?.SALEBILL_ID) { + if (currentRow?.SALEBILL_ID || currentRow?.OrderId) { const req: any = { - SALEBILLId: currentRow?.SALEBILL_ID + SALEBILLId: currentRow?.SALEBILL_ID || currentRow?.OrderId } const data = await handeGetSALEBILLDetail(req) // 查地址信息 const addressData = await handeGetSALEADDRESSList({ searchParameter: { - SALEBILL_ID: currentRow?.SALEBILL_ID + SALEBILL_ID: currentRow?.SALEBILL_ID || currentRow?.OrderId }, PageIndex: 1, PageSize: 10, }) console.log('dasdas44444', addressData); - let addressObj: any = addressData[0] + let addressObj: any = addressData.List[0] // 物流公司和快递单号的回显 if (currentRow?.TABLE_NUMBER) { @@ -421,17 +421,29 @@ const OrderDetailModal = ({ modalVisible, handleCloseModal, currentRow, detailTy } } - return { + console.log('32131', { ...data, - ORDER_PERSON: addressObj?.USER_NAME || "", + ORDER_PERSON: currentRow?.AddressInfo ? `${currentRow?.AddressInfo.USER_NAME}${currentRow?.AddressInfo?.MOBILEPHONE ? `【${currentRow?.AddressInfo?.MOBILEPHONE}】` : ""}` || "" : "", ORDER_ADDRESS: `${addressObj?.ADDRESS || ""}${addressObj?.DOORPLATE || ""}`, CURRENT_POINT: currentRow?.CURRENT_POINT || "", - ORDER_DATE: currentRow?.ORDER_DATE ? moment(currentRow?.ORDER_DATE).format('YYYY-MM-DD HH:mm:ss') : '' + ORDER_DATE: currentRow?.ORDER_DATE ? moment(currentRow?.ORDER_DATE).format('YYYY-MM-DD HH:mm:ss') : '', + CHANNEL_TYPE: currentRow?.CHANNEL_TYPE || "", + }); + + + return { + ...data, + ORDER_PERSON: currentRow?.AddressInfo ? `${currentRow?.AddressInfo.USER_NAME}${currentRow?.AddressInfo?.MOBILEPHONE ? `【${currentRow?.AddressInfo?.MOBILEPHONE}】` : ""}` || "" : "", + ORDER_ADDRESS: `${addressObj?.ADDRESS || ""}${addressObj?.DOORPLATE || ""}`, + CURRENT_POINT: currentRow?.CURRENT_POINT || "", + ORDER_DATE: currentRow?.ORDER_DATE ? moment(currentRow?.ORDER_DATE).format('YYYY-MM-DD HH:mm:ss') : '', + CHANNEL_TYPE: currentRow?.CHANNEL_TYPE || "", + TAKE_TYPE: data.TAKE_TYPE === 1000 ? "自提" : data.TAKE_TYPE === 3000 ? '免发货' : '邮寄' } } else { const req: any = { searchParameter: { - SALEBILL_CODE: currentRow?.TICKET_CODE + SALEBILL_CODE: currentRow?.TICKET_CODE || currentRow?.OrderId }, PageIndex: 1, PageSize: 1, @@ -441,14 +453,14 @@ const OrderDetailModal = ({ modalVisible, handleCloseModal, currentRow, detailTy if (data.List && data.List.length > 0) { let obj: any = data.List[0] const req: any = { - SALEBILLId: obj?.SALEBILL_ID + SALEBILLId: obj?.SALEBILL_ID || currentRow?.OrderId } const res = await handeGetSALEBILLDetail(req) console.log('dasdas33333', res); // 查地址信息 const addressData = await handeGetSALEADDRESSList({ searchParameter: { - SALEBILL_ID: obj?.SALEBILL_ID + SALEBILL_ID: obj?.SALEBILL_ID || currentRow?.OrderId }, PageIndex: 1, PageSize: 10, @@ -457,16 +469,19 @@ const OrderDetailModal = ({ modalVisible, handleCloseModal, currentRow, detailTy let addressObj: any = addressData.List && addressData.List.length > 0 ? addressData.List[0] : {} console.log('dmsakldmas', { ...res, - ORDER_PERSON: addressObj?.USER_NAME || "", + ORDER_PERSON: currentRow?.AddressInfo ? `${currentRow?.AddressInfo.USER_NAME}${currentRow?.AddressInfo?.MOBILEPHONE ? `【${currentRow?.AddressInfo?.MOBILEPHONE}】` : ""}` || "" : "", ORDER_ADDRESS: `${addressObj?.ADDRESS || ""}${addressObj?.DOORPLATE || ""}`, + CHANNEL_TYPE: currentRow?.CHANNEL_TYPE || "", }); return { ...res, - ORDER_PERSON: addressObj?.USER_NAME || "", + ORDER_PERSON: currentRow?.AddressInfo ? `${currentRow?.AddressInfo.USER_NAME}${currentRow?.AddressInfo?.MOBILEPHONE ? `【${currentRow?.AddressInfo?.MOBILEPHONE}】` : ""}` || "" : "", ORDER_ADDRESS: `${addressObj?.ADDRESS || ""}${addressObj?.DOORPLATE || ""}`, CURRENT_POINT: currentRow?.CURRENT_POINT || "", - ORDER_DATE: res?.ORDER_DATE ? moment(res?.ORDER_DATE).format('YYYY-MM-DD HH:mm:ss') : '' + ORDER_DATE: res?.ORDER_DATE ? moment(res?.ORDER_DATE).format('YYYY-MM-DD HH:mm:ss') : '', + CHANNEL_TYPE: currentRow?.CHANNEL_TYPE || "", + TAKE_TYPE: res.TAKE_TYPE === 1000 ? "自提" : res.TAKE_TYPE === 3000 ? '免发货' : '邮寄' } } else { message.error('当前订单数据异常,请联系管理员!') @@ -660,8 +675,8 @@ const OrderDetailModal = ({ modalVisible, handleCloseModal, currentRow, detailTy + + + + { showShipment ? @@ -829,7 +853,7 @@ const OrderDetailModal = ({ modalVisible, handleCloseModal, currentRow, detailTy let SALEBILL_ID: string = '' console.log('currentRowcurrentRow', currentRow); - if (!currentRow?.SALEBILL_ID) { + if (!currentRow?.SALEBILL_ID && !currentRow?.OrderId) { const req: any = { searchParameter: { SALEBILL_CODE: currentRow?.TICKET_CODE @@ -840,7 +864,7 @@ const OrderDetailModal = ({ modalVisible, handleCloseModal, currentRow, detailTy const data = await handeGetSALEBILLList(req) console.log('dasdas', data); let obj: any = data.List && data.List.length > 0 ? data.List[0] : null - SALEBILL_ID = obj.SALEBILL_ID + SALEBILL_ID = obj.SALEBILL_ID || currentRow?.OrderId setOrderDetail(obj) modalRef.current?.setFieldsValue({ @@ -865,7 +889,8 @@ const OrderDetailModal = ({ modalVisible, handleCloseModal, currentRow, detailTy const req: any = { searchParameter: { - SALEBILL_ID: currentRow?.SALEBILL_ID || SALEBILL_ID + SALEBILL_ID: currentRow?.SALEBILL_ID || currentRow?.OrderId || SALEBILL_ID, + SALEBILL_CHILD_ID: currentRow?.SALEBILL_CHILD_ID || currentRow?.OrderChildId }, PageIndex: 1, PageSize: 999999, @@ -873,7 +898,7 @@ const OrderDetailModal = ({ modalVisible, handleCloseModal, currentRow, detailTy const data = await handeGetSALEDETAILList(req) console.log('datadatadata', data); if (data.List && data.List.length > 0) { - if (currentRow?.SALEBILL_ID) { + if (currentRow?.SALEBILL_ID || currentRow?.OrderId) { let TOTAL_COUNTSUM: number = 0 let ORDER_AMOUNTSUM: number = 0 data.List.forEach((item: any) => { diff --git a/src/pages/travelMember/MallClassificationManage/index.tsx b/src/pages/travelMember/MallClassificationManage/index.tsx index 4b18f93..1b8c6c6 100644 --- a/src/pages/travelMember/MallClassificationManage/index.tsx +++ b/src/pages/travelMember/MallClassificationManage/index.tsx @@ -29,6 +29,7 @@ import ModalFooter from '../scenicSpotConfig/component/modalFooter'; import { handleSetlogSave } from '@/utils/format'; import { highlightText } from '@/utils/highlightText'; import { handlecsyncWeChatGetMallGoodsInfo, handlesyncWeChatGetMallGoodsType } from '@/pages/operatingMerchants/service'; +import './style.less' const beforeUpload = (file: any) => { @@ -157,19 +158,19 @@ const MallClassificationManage: React.FC<{ currentUser: CurrentUser | undefined // }, // initialValue: "1" // }, - // { - // dataIndex: 'SCANCODE_ORDER', - // title: '上架状态', - // align: 'center', - // width: 120, - // ellipsis: true, - // valueType: "select", - // valueEnum: { - // "1": "上架", - // "0": "下架" - // }, - // initialValue: "1" - // }, + { + dataIndex: 'SCANCODE_ORDER', + title: '上架状态', + align: 'center', + width: 120, + ellipsis: true, + valueType: "select", + valueEnum: { + "1": "上架", + "0": "下架" + }, + initialValue: "1" + }, { dataIndex: "PRESALE_TYPE", title: "是否预售", @@ -183,6 +184,20 @@ const MallClassificationManage: React.FC<{ currentUser: CurrentUser | undefined "1": "是" } }, + { + dataIndex: "SERVERPARTSHOP_ID", + title: "小程序是否显示", + align: 'center', + hideInSearch: true, + width: 120, + ellipsis: true, + valueType: "select", + valueEnum: { + "1": "精选商城", + "2": "工会商城", + "0": "不显示" + } + }, // { // dataIndex: 'OWNERUNIT_NAME', // title: '业主单位', @@ -274,7 +289,7 @@ const MallClassificationManage: React.FC<{ currentUser: CurrentUser | undefined req = { ...currentRow, ...res, - SCANCODE_ORDER: 1, + // SCANCODE_ORDER: 1, USERDEFINEDTYPE_STATE: 1, GOODSTYPE: 4000, USERDEFINEDTYPE_ICO: fileList && fileList.length > 0 ? fileList[0].url : "", @@ -292,7 +307,7 @@ const MallClassificationManage: React.FC<{ currentUser: CurrentUser | undefined req = { ...res, GOODSTYPE: 4000, - SCANCODE_ORDER: 1, + // SCANCODE_ORDER: 1, USERDEFINEDTYPE_STATE: 1, USERDEFINEDTYPE_ICO: fileList && fileList.length > 0 ? fileList[0].url : "", PRESALE_STARTTIME: res.PRESALE_TIME && res.PRESALE_TIME.length > 0 ? res.PRESALE_TIME[0] : "", @@ -338,19 +353,24 @@ const MallClassificationManage: React.FC<{ currentUser: CurrentUser | undefined rowKey={(record) => { return `${record?.USERDEFINEDTYPE_PID}-${record?.USERDEFINEDTYPE_ID}` }} + className='USERDEFINEDTYPETable' formRef={formRef} headerTitle={} // 列表表头 actionRef={actionRef} search={{ span: 6, labelWidth: 'auto' }} bordered + rowClassName={(record) => { + return record?.SCANCODE_ORDER !== 1 ? 'garyRow' : '' + }} // 请求数据 request={async (params, sorter) => { const req = { OWNERUNIT_ID: currentUser?.OwnerUnitId, PROVINCE_CODE: "", GOODSTYPE: 4000, - // USERDEFINEDTYPE_STATE: params?.SCANCODE_ORDER, USERDEFINEDTYPE_STATE: 1, + SCANCODE_ORDER: params?.SCANCODE_ORDER, + // USERDEFINEDTYPE_STATE: 1, SearchKey: params?.searchText || "" } const data = await handlGetUSERDEFINEDTYPEList(req); @@ -579,13 +599,13 @@ const MallClassificationManage: React.FC<{ currentUser: CurrentUser | undefined ]} /> - {/* + - */} + {/* : "" } + { + !currentRow?.USERDEFINEDTYPE_PID || currentRow?.USERDEFINEDTYPE_PID === -1 ? + + + : "" + } + + + + + + + + - - - - - - - - - (false) const [printIndex, setPrintIndex] = useState(new Date().getTime()) + // 会员列表 + const [userList, setUserList] = useState() + // 控制显示的字段 + const [columnsState, setColumnsState] = useState({ + MEMBERSHIP_TARGET: { show: false }, + MEMBERSHIP_POINT: { show: false }, + MEMBERGROWTH_VALUE: { show: false }, + }) + const onDraggaleStart = (event, uiData) => { const { clientWidth, clientHeight } = window.document.documentElement; @@ -164,12 +173,15 @@ const MallOrderManage: React.FC<{ currentUser: CurrentUser, isComponent?: boolea } }, { - title: "收货人员", - dataIndex: "ORDER_PERSON", - width: 150, + title: "会员姓名", + dataIndex: "ORDERPERSON", + width: 200, hideInSearch: true, ellipsis: true, align: "center", + render: (_, record) => { + return `${record?.ORDER_PERSON || ""}${record?.ORDER_PERSONTEL ? `【${record?.ORDER_PERSONTEL}】` : ""}` + } }, { title: '会员标签', @@ -207,83 +219,26 @@ const MallOrderManage: React.FC<{ currentUser: CurrentUser, isComponent?: boolea } }, { - title: "联系电话", - dataIndex: "ORDER_PERSONTEL", + title: "收货人员", + dataIndex: "AddressInfoPerson", width: 150, hideInSearch: true, ellipsis: true, align: "center", - }, - { - dataIndex: 'SALEBILL_CODE', - title: '订单编号', - align: 'center', - hideInSearch: true, - width: 200, - ellipsis: true, render: (_, record) => { - return record?.SALEBILL_CODE ? { - console.log('recordrecordrecordrecord', record); - setCurrentRow(record); - handleModalVisible(true) - handleSetlogSave(`查询【${record?.ORDER_PERSON}】编号【${record?.SALEBILL_CODE}】的订单`) - }}> - {/* {record?.SALEBILL_CODE} */} - {highlightText(record?.SALEBILL_CODE, currentSearchText)} - : "-" + return record?.AddressInfo ? record?.AddressInfo.USER_NAME || "" : "" } }, { - title: "订单时间", - dataIndex: "ORDER_DATE", - width: 180, + title: "联系电话", + dataIndex: "AddressInfoPersonMOBILEPHONE", + width: 150, hideInSearch: true, ellipsis: true, align: "center", render: (_, record) => { - return record?.ORDER_DATE ? moment(record?.ORDER_DATE).format('YYYY-MM-DD HH:mm:ss') : "-" - }, - sorter: (a, b) => new Date(a.ORDER_DATE).getTime() - new Date(b.ORDER_DATE).getTime(), - defaultSortOrder: 'descend', - }, - { - title: "订单状态", - dataIndex: "SALEBILL_STATE", - width: 120, - hideInSearch: true, - ellipsis: true, - valueType: "select", - valueEnum: { - "0": "全部", - "1005": "订单待支付", - "1010": "订单待发货", - "2010": "订单已发货", - "3000": "订单已完成", - "8000": "退款申请中", - "8900": "订单已退款", - "9000": "订单已关闭", - "9999": "订单已撤销" - }, - align: "center", - sorter: (a, b) => a.SALEBILL_STATE - b.SALEBILL_STATE - }, - { - title: "获得积分", - dataIndex: "MEMBERSHIP_POINT", - width: 120, - hideInSearch: true, - ellipsis: true, - align: "center", - sorter: (a, b) => a.MEMBERSHIP_POINT - b.MEMBERSHIP_POINT - }, - { - title: "获得成长值", - dataIndex: "MEMBERGROWTH_VALUE", - width: 120, - hideInSearch: true, - ellipsis: true, - align: "center", - sorter: (a, b) => a.MEMBERGROWTH_VALUE - b.MEMBERGROWTH_VALUE + return record?.AddressInfo ? record?.AddressInfo.MOBILEPHONE || "" : "" + } }, { title: "购买的商品", @@ -293,7 +248,12 @@ const MallOrderManage: React.FC<{ currentUser: CurrentUser, isComponent?: boolea ellipsis: true, align: "center", render: (_, record) => { - return highlightText(record?.COMMODITY_NAME, currentSearchText) + return { + console.log('recordrecordrecordrecord', record); + setCurrentRow(record); + handleModalVisible(true) + handleSetlogSave(`查询【${record?.ORDER_PERSON}】编号【${record?.SALEBILL_CODE}】的订单`) + }}>{highlightText(record?.COMMODITY_NAME, currentSearchText)} } }, { @@ -314,6 +274,33 @@ const MallOrderManage: React.FC<{ currentUser: CurrentUser, isComponent?: boolea align: "center", sorter: (a, b) => a.PAY_AMOUNT - b.PAY_AMOUNT }, + { + title: "工会积分", + dataIndex: "BALANCE_PAYMENT", + width: 120, + hideInSearch: true, + ellipsis: true, + align: "center", + sorter: (a, b) => a.BALANCE_PAYMENT - b.BALANCE_PAYMENT + }, + { + title: "获得积分", + dataIndex: "MEMBERSHIP_POINT", + width: 120, + hideInSearch: true, + ellipsis: true, + align: "center", + sorter: (a, b) => a.MEMBERSHIP_POINT - b.MEMBERSHIP_POINT + }, + { + title: "获得成长值", + dataIndex: "MEMBERGROWTH_VALUE", + width: 120, + hideInSearch: true, + ellipsis: true, + align: "center", + sorter: (a, b) => a.MEMBERGROWTH_VALUE - b.MEMBERGROWTH_VALUE + }, { title: "订单类型", dataIndex: "SALEBILL_TYPE", @@ -335,85 +322,194 @@ const MallOrderManage: React.FC<{ currentUser: CurrentUser, isComponent?: boolea }, { title: "支付方式", - dataIndex: "PAY_METHOD", - valueType: "select", - valueEnum: { - "0": "全部", - "支付宝": "支付宝", - "微信": "微信", - "积分兑换": "积分兑换", - "余额支付": "余额支付", - }, + dataIndex: "CHANNEL_TYPE", + // valueType: "select", + // valueEnum: { + // "0": "全部", + // "支付宝": "支付宝", + // "微信": "微信", + // "积分兑换": "积分兑换", + // "余额支付": "余额支付", + // }, width: 120, - hideInSearch: true, + // hideInSearch: true, ellipsis: true, align: "center", }, { - title: '会员标签', - dataIndex: "MEMBERSHIP_TARGET", - valueType: 'treeSelect', - request: async () => { - const req = { - AUTOTYPE_TYPEID: '2000', - AUTOTYPE_PID: "", - OWNERUNIT_ID: currentUser?.OwnerUnitId, - AUTOTYPE_VALID: 1, - SearchKey: "" - } - const data = await handeGetNestingAUTOTYPEList(req); - console.log('datadatadatadatadata', data); - return data + title: "订单时间", + dataIndex: "ORDER_DATE", + width: 180, + hideInSearch: true, + ellipsis: true, + align: "center", + render: (_, record) => { + return record?.ORDER_DATE ? moment(record?.ORDER_DATE).format('YYYY-MM-DD HH:mm:ss') : "-" }, + sorter: (a, b) => new Date(a.ORDER_DATE).getTime() - new Date(b.ORDER_DATE).getTime(), + defaultSortOrder: 'descend', + }, + { + dataIndex: 'SALEBILL_CODE', + title: '订单编号', + align: 'center', + hideInSearch: true, + width: 200, + ellipsis: true, + render: (_, record) => { + return record?.SALEBILL_CODE ? { + console.log('recordrecordrecordrecord', record); + setCurrentRow(record); + handleModalVisible(true) + handleSetlogSave(`查询【${record?.ORDER_PERSON}】编号【${record?.SALEBILL_CODE}】的订单`) + }}> + {/* {record?.SALEBILL_CODE} */} + {highlightText(record?.SALEBILL_CODE, currentSearchText)} + : "-" + } + }, + { + title: "订单状态", + dataIndex: "SALEBILL_STATE", + width: 120, + hideInSearch: true, + ellipsis: true, + valueType: "select", + valueEnum: { + "0": "全部", + "1005": "订单待支付", + "1010": "订单待发货", + "2010": "订单已发货", + "3000": "订单已完成", + "8000": "退款申请中", + "8900": "订单已退款", + "9000": "订单已关闭", + "9999": "订单已撤销" + }, + align: "center", + sorter: (a, b) => a.SALEBILL_STATE - b.SALEBILL_STATE + }, + // { + // title: '会员标签', + // dataIndex: "MEMBERSHIP_TARGET", + // valueType: 'treeSelect', + // request: async () => { + // const req = { + // AUTOTYPE_TYPEID: '2000', + // AUTOTYPE_PID: "", + // OWNERUNIT_ID: currentUser?.OwnerUnitId, + // AUTOTYPE_VALID: 1, + // SearchKey: "" + // } + // const data = await handeGetNestingAUTOTYPEList(req); + // console.log('datadatadatadatadata', data); + // return data + // }, + // hideInTable: true, + // fieldProps: { + // multiple: true, + // allowClear: true, + // showSearch: true, + // filterTreeNode: (input, node) => { + // // ✅ 输入时根据 AUTOTYPE_NAME 模糊匹配 + // return node?.AUTOTYPE_NAME?.toLowerCase()?.includes(input.toLowerCase()); + // }, + // treeDefaultExpandAll: true, + // fieldNames: { + // label: 'AUTOTYPE_NAME', + // value: 'AUTOTYPE_ID', + // } + // } + // }, + // { + // title: '供应商', + // dataIndex: "MERCHANTS_IDS", + // valueType: 'select', + // request: async () => { + // const req = { + // searchParameter: { + // OWNERUNIT_ID: currentUser?.OwnerUnitId, + // PROVINCE_CODE: currentUser?.ProvinceCode, + // MERCHANTS_TYPE: "" + // }, + // PageIndex: 1, + // PageSize: 999999, + // } + // const data = await handeGetMERCHANTSList(req); + // return data.List + // }, + // hideInTable: true, + // fieldProps: { + // allowClear: true, + // showSearch: true, + // filterTreeNode: (input, node) => { + // // ✅ 输入时根据 AUTOTYPE_NAME 模糊匹配 + // return node?.MERCHANTS_NAME?.toLowerCase()?.includes(input.toLowerCase()); + // }, + // treeDefaultExpandAll: true, + // fieldNames: { + // label: 'MERCHANTS_NAME', + // value: 'MERCHANTS_ID', + // }, + // disabled: currentUser?.UserPattern === 4000 + // }, + // initialValue: currentUser?.UserPattern === 4000 ? currentUser?.SupplierID : "" + // }, + { + title: '单位名称', + dataIndex: "COMPANY_IDS", + valueType: 'select', hideInTable: true, + hideInSearch: currentUser?.UserPattern === 4000, + request: async () => { + const req: any = { + SearchParameter: { + OWNERUNIT_ID: "911", + COMPANY_STATE: 1000 + }, + PageIndex: 1, + PageSize: 999999 + } + const data = await handeGetCOMPANYList(req) + console.log('datadata', data); + let list: any = [] + if (data && data.length > 0) { + data.forEach((item: any) => { + list.push({ label: item.COMPANY_NAME, value: item.COMPANY_ID }) + }) + } + return list + }, fieldProps: { - multiple: true, + onChange: (e: any) => { + console.log('eeeeee', e); + setUserList([]) + formRef.current?.setFieldsValue({ INTERNALMEMBERSHIP_IDS: "" }) + handleGetUserList(e) + }, allowClear: true, showSearch: true, filterTreeNode: (input, node) => { // ✅ 输入时根据 AUTOTYPE_NAME 模糊匹配 - return node?.AUTOTYPE_NAME?.toLowerCase()?.includes(input.toLowerCase()); - }, - treeDefaultExpandAll: true, - fieldNames: { - label: 'AUTOTYPE_NAME', - value: 'AUTOTYPE_ID', + return node?.label?.toLowerCase()?.includes(input.toLowerCase()); } } }, { - title: '供应商', - dataIndex: "MERCHANTS_IDS", + title: '会员姓名', + dataIndex: "INTERNALMEMBERSHIP_IDS", valueType: 'select', - request: async () => { - const req = { - searchParameter: { - OWNERUNIT_ID: currentUser?.OwnerUnitId, - PROVINCE_CODE: currentUser?.ProvinceCode, - MERCHANTS_TYPE: "" - }, - PageIndex: 1, - PageSize: 999999, - } - const data = await handeGetMERCHANTSList(req); - return data.List - }, + hideInSearch: currentUser?.UserPattern === 4000, hideInTable: true, fieldProps: { + options: userList, allowClear: true, showSearch: true, filterTreeNode: (input, node) => { // ✅ 输入时根据 AUTOTYPE_NAME 模糊匹配 - return node?.MERCHANTS_NAME?.toLowerCase()?.includes(input.toLowerCase()); - }, - treeDefaultExpandAll: true, - fieldNames: { - label: 'MERCHANTS_NAME', - value: 'MERCHANTS_ID', - }, - disabled: currentUser?.UserPattern === 4000 - }, - initialValue: currentUser?.UserPattern === 4000 ? currentUser?.SupplierID : "" + return node?.label?.toLowerCase()?.includes(input.toLowerCase()); + } + } }, // { // title: "订单编号", @@ -700,6 +796,27 @@ const MallOrderManage: React.FC<{ currentUser: CurrentUser, isComponent?: boolea tempTable.remove() // 防止重复打印一个内容 } + // 拿到会员列表 + const handleGetUserList = async (e: any) => { + const req: any = { + SearchParameter: { + MEMBERSHIP_COMPANYS: e, + MEMBERSHIP_STATES: 1 + }, + PageIndex: 1, + PageSize: 999999 + } + const data = await handeGetMEMBERSHIPVIPList(req) + console.log('会员', data); + let list: any = [] + if (data && data.length > 0) { + data.forEach((item: any) => { + list.push({ label: item.MEMBERSHIP_NAME, value: item.MEMBERSHIP_ID }) + }) + } + setUserList(list) + } + return (
{ @@ -782,7 +899,9 @@ const MallOrderManage: React.FC<{ currentUser: CurrentUser, isComponent?: boolea SearchKeyValue: params?.searchText || "", MERCHANTS_IDS: params?.MERCHANTS_IDS || "", MEMBERSHIP_TARGET: params?.MEMBERSHIP_TARGET && params?.MEMBERSHIP_TARGET.length > 0 ? params?.MEMBERSHIP_TARGET.toString() : "", - PAYMETHOD: params?.PAYMETHOD || "" + PAYMETHOD: params?.PAYMETHOD || "", + COMPANY_IDS: params?.COMPANY_IDS || "", + INTERNALMEMBERSHIP_IDS: params?.INTERNALMEMBERSHIP_IDS || "", // MERCHANTS_IDS: currentUser?.SupplierID }, PageIndex: 1, @@ -859,6 +978,12 @@ const MallOrderManage: React.FC<{ currentUser: CurrentUser, isComponent?: boolea // }}>导出财务结算Excel ] }} + columnsState={{ + value: columnsState, + onChange: (value) => { + setColumnsState(value) + } + }} />
diff --git a/src/pages/travelMember/OrderAfterSalesManage/index.tsx b/src/pages/travelMember/OrderAfterSalesManage/index.tsx index b20d41a..9de0843 100644 --- a/src/pages/travelMember/OrderAfterSalesManage/index.tsx +++ b/src/pages/travelMember/OrderAfterSalesManage/index.tsx @@ -8,7 +8,7 @@ import type { ActionType } from "@ant-design/pro-table"; import ProTable from "@ant-design/pro-table"; import PageTitleBox from "@/components/PageTitleBox"; import moment from 'moment' -import { handeGetSALEBILLList, handeGetSaleBillWholeList, handeGetSALEDETAILList, handeWeChatRefundApply, handeWeRevokeRefundApply } from "../service"; +import { handeGetSALEBILLList, handeGetSaleBillWholeList, handeGetSALEDETAILList, handeRefundInternalBill, handeWeChatRefundApply, handeWeRevokeRefundApply } from "../service"; import Draggable from "react-draggable"; import ProForm, { ProFormSelect, ProFormText } from "@ant-design/pro-form"; import orderIcon from '@/assets/detail/orderIcon.png' @@ -47,6 +47,13 @@ const OrderAfterSalesManage: React.FC<{ currentUser: CurrentUser }> = (props) => }; // 当前查询的文字 const [currentSearchText, setCurrentSearchText] = useState('') + // 订单状态的枚举值 + const SALEBILL_STATEOBJ: any = { + 8000: "退款申请中", + 8020: "退款审核中", + 8900: "订单已退款", + 9000: "订单已关闭", + } const columns: any = [ @@ -130,6 +137,8 @@ const OrderAfterSalesManage: React.FC<{ currentUser: CurrentUser }> = (props) => align: "center", render: (_, record) => { return record?.SALEBILL_CODE ? { + console.log('recordrecord', record); + setCurrentRow(record); handleModalVisible(true) handleSetlogSave(`查询【${record?.ORDER_PERSON}】编码为${record?.SALEBILL_CODE}的订单`) @@ -164,6 +173,11 @@ const OrderAfterSalesManage: React.FC<{ currentUser: CurrentUser }> = (props) => "9000": "订单已关闭", }, align: "center", + render: (_, record) => { + return + {SALEBILL_STATEOBJ && record?.SALEBILL_STATE ? SALEBILL_STATEOBJ[record?.SALEBILL_STATE] : ""} + + } }, { title: "退款金额", @@ -273,19 +287,29 @@ const OrderAfterSalesManage: React.FC<{ currentUser: CurrentUser }> = (props) => // 同意退款 const handleGetAgreeToRefund = async () => { console.log('currentRowcurrentRowcurrentRow', currentRow); - const req: any = { - mchid: "1672298991", - serial_no: "5BA7C0F427FC042DB5BF299E35B373D5EFCECD35", - mobileOrderCode: "", - saleBillCode: currentRow?.TABLE_NUMBER, - refundBillCode: currentRow?.SALEBILL_CODE, - refundReason: currentRow?.SALEBILL_DESC || "", - orderAmount: currentRow?.PAY_AMOUNT, - refundAmount: currentRow?.PAY_AMOUNT, - provinceCode: "530000" + let req: any = {} + let data: any = {} + if (currentRow?.OriSALEBILL_TYPE) { + req = { + saleBillId: currentRow?.SALEBILL_ID || "", + } + data = await handeRefundInternalBill(req) + } else { + req = { + mchid: "1672298991", + serial_no: "5BA7C0F427FC042DB5BF299E35B373D5EFCECD35", + mobileOrderCode: "", + saleBillCode: currentRow?.TABLE_NUMBER, + refundBillCode: currentRow?.SALEBILL_CODE, + refundReason: currentRow?.SALEBILL_DESC || "", + orderAmount: currentRow?.PAY_AMOUNT, + refundAmount: currentRow?.PAY_AMOUNT, + provinceCode: "530000" + } + console.log('reqreq', req); + data = await handeWeChatRefundApply(req) } - console.log('reqreq', req); - const data = await handeWeChatRefundApply(req) + if (data.Result_Code === 100) { message.success('退款成功!') handleConfirmLoading(false) @@ -473,6 +497,7 @@ const OrderAfterSalesManage: React.FC<{ currentUser: CurrentUser }> = (props) => submitter={false} initialValues={currentRow ? { ...currentRow, + orderPerson: `${currentRow?.ORDER_PERSON || ""}${currentRow?.ORDER_PERSONTEL ? `【${currentRow?.ORDER_PERSONTEL}】` : ""}`, ORDER_DATE: currentRow?.ORDER_DATE ? moment(currentRow?.ORDER_DATE).format('YYYY-MM-DD HH:mm:ss') : '' } : {}} > @@ -610,6 +635,14 @@ const OrderAfterSalesManage: React.FC<{ currentUser: CurrentUser }> = (props) => ]} /> + + + {/* = (prop }, initialValue: "1" }, + { + dataIndex: "COMMODITY_NATURE", + title: "商品性质", + align: 'center', + hideInTable: true, + valueType: "select", + request: async () => { + if (COMMODITYNATUREList && COMMODITYNATUREList.length > 0) { + if (currentUser?.UserPattern === 4000) { + COMMODITYNATUREList.forEach((item: any) => { + if (item.label === '工会商城' || item.label === '实物商品') { + } else { + item.disabled = true + } + }) + } + return COMMODITYNATUREList + } else { + const COMMODITYNATURE = await getFieldEnumTree({ FieldExplainField: 'COMMODITY_NATURE', FieldEnumStatus: true }) + if (COMMODITYNATURE && COMMODITYNATURE.length > 0) { + const obj: any = {} + const list: any = [] + COMMODITYNATURE.forEach((item: any) => { + list.push({ label: item.label, value: item.value }) + obj[item.value] = item.label + }) + session.set('COMMODITYNATUREList', list); + session.set('COMMODITYNATUREObj', obj); + session.set('COMMODITYNATURETree', COMMODITYNATURE); + + if (currentUser?.UserPattern === 4000) { + list.forEach((item: any) => { + if (item.label === '工会商城' || item.label === '实物商品') { + } else { + item.disabled = true + } + }) + } + return list + } + return [] + } + } + }, + { + dataIndex: "MERCHANTS_ID", + title: "供货商户", + align: 'center', + hideInTable: true, + hideInSearch: currentUser?.UserPattern === 4000, + valueType: "select", + request: async () => { + if (COMMODITYSUPPLIERLIST && COMMODITYSUPPLIERLIST.length > 0) { + return COMMODITYSUPPLIERLIST + } else { + const req = { + searchParameter: { + OWNERUNIT_ID: currentUser?.OwnerUnitId, + PROVINCE_CODE: currentUser?.ProvinceCode, + MERCHANTS_TYPE: "", + MERCHANTS_STATE: 1 + }, + PageIndex: 1, + PageSize: 999999, + } + const data = await handeGetMERCHANTSList(req); + 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 [] + } + } + }, + { + dataIndex: "PAY_METHOD", + title: "消费模式", + align: 'center', + hideInTable: true, + valueType: "select", + request: async () => { + if (PAYMETHODList && PAYMETHODList.length > 0) { + return PAYMETHODList + } else { + const PAYMETHOD = await getFieldEnumTree({ FieldExplainField: 'PAY_METHOD' }) + if (PAYMETHOD && PAYMETHOD.length > 0) { + const obj: any = {} + const list: any = [] + PAYMETHOD.forEach((item: any) => { + list.push({ label: item.label, value: item.value }) + obj[item.value] = item.label + }) + session.set('PAYMETHODList', list); + session.set('PAYMETHODObj', obj); + session.set('PAYMETHODTree', PAYMETHOD); + return list + } + return [] + } + } + }, { dataIndex: 'MERCHANTS_NAME', title: '商户名称', @@ -807,6 +913,9 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop } + console.log('isComboisCombo', isCombo); + console.log('isClickAddisClickAdd', isClickAdd); + let req: any = {} if (currentRow?.USERDEFINEDTYPE_ID && type !== 'saveAs') { @@ -1175,7 +1284,7 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop bordered headerTitle={} // 列表表头 actionRef={actionRef} - search={{ span: 6, labelWidth: 'auto' }} + search={{ span: 6, labelWidth: 'auto', defaultCollapsed: false }} // 请求数据 request={async (params, sorter) => { if (!selectedId) { @@ -1190,7 +1299,9 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop DUTY_PARAGRAPH: params?.DUTY_PARAGRAPH === "-1" ? "" : params?.DUTY_PARAGRAPH, COMMODITY_TYPE: 4000, COMMODITY_STATE: 1, - MERCHANTS_ID: currentUser?.SupplierID + COMMODITY_NATURE: params?.COMMODITY_NATURE || "", + PAY_METHOD: params?.PAY_METHOD || "", + MERCHANTS_ID: currentUser?.UserPattern !== 4000 ? params?.MERCHANTS_ID ? params?.MERCHANTS_ID.split('-')[1] : "" : currentUser?.SupplierID }, keyWord: { @@ -1379,7 +1490,7 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop setComboCommodityDetail([]) // setBRAND_NAMEList([]) }} - footer={
+ footer={currentUser?.UserPattern === 4000 && currentRow?.UPPER_STATE === 1 ? '' :