diff --git a/.umirc.ts b/.umirc.ts index 8185830..1ad1482 100644 --- a/.umirc.ts +++ b/.umirc.ts @@ -13,9 +13,9 @@ export default defineConfig({ }, proxy: { '/api/': { - // target: 'http://localhost:8085/', + target: 'http://localhost:8085/', // target: 'http://192.168.1.6:8085/', - target: 'http://39.108.227.113:8085/', + // target: 'http://39.108.227.113:8085/', changeOrigin: true, pathRewrite: { '^/api': '' }, }, diff --git a/src/pages/Order/components/OrderDrawer.tsx b/src/pages/Order/components/OrderDrawer.tsx index 9ce8255..0f576b0 100644 --- a/src/pages/Order/components/OrderDrawer.tsx +++ b/src/pages/Order/components/OrderDrawer.tsx @@ -464,11 +464,11 @@ export default ({ onClose, data, subOrders, orderOptType }) => { name="invoiceIdentificationNumber" label="开票信息" // disabled={mainInfoDisbled} - hidden={invoicingStatus !== 'INVOICED'} + hidden={invoicingStatus === 'UN_INVOICE'} placeholder="请输入开票信息" rules={[ { - required: invoicingStatus === 'INVOICED' ? true : false, + required: invoicingStatus === 'UN_INVOICE' ? false : true, message: '开票信息必填', }, ]} @@ -479,7 +479,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => { width="lg" name="invoicingTime" // disabled={mainInfoDisbled} - hidden={invoicingStatus !== 'INVOICED'} + hidden={invoicingStatus === 'UN_INVOICE'} label="开票时间" placeholder="请输入开票时间" /> @@ -491,13 +491,13 @@ export default ({ onClose, data, subOrders, orderOptType }) => { name="bank" label="开户银行" // disabled={mainInfoDisbled} - hidden={invoicingStatus !== 'INVOICED'} + hidden={invoicingStatus === 'UN_INVOICE'} placeholder="请输入开户银行" /> <ProFormText width="lg" name="bankAccountNumber" - hidden={invoicingStatus !== 'INVOICED'} + hidden={invoicingStatus === 'UN_INVOICE'} label="银行账号" // disabled={mainInfoDisbled} placeholder="请输入银行账号" diff --git a/src/pages/Order/constant.ts b/src/pages/Order/constant.ts index 79fb96f..c22e95e 100644 --- a/src/pages/Order/constant.ts +++ b/src/pages/Order/constant.ts @@ -25,9 +25,49 @@ export const PRODUCT_BELONG_DEPARTMENT_OPTIONS = { export const INVOCING_STATUS_OPTIONS = { UN_INVOICE: '不需开票', + SPECIALLY_INVOICED: '专票', + COMMON_INVOICED: '普票', +}; + +export const INVOCING_STATUS = { + UN_INVOICE: '不需开票', + SPECIALLY_INVOICED: '专票', + COMMON_INVOICED: '普票', INVOICED: '需要开票', }; +/** + * 是否需要开票 + * @param subOrder + */ +export const getNeedInvoicing = (subOrder: any) => { + if (subOrder.invoicingTime !== undefined) { + return '已开票'; + } + if (subOrder.invoicingStatus === 'UN_INVOICE') { + return '不需开票'; + } + return '需要开票'; +}; + +/** + * 开砖专票还是普票 + * @param subOrder + * @returns + */ +export const getInvoicingType = (subOrder: any) => { + let invoicingStatus = subOrder.invoicingStatus; + if (invoicingStatus === 'SPECIALLY_INVOICED') { + return '开专票'; + } + + if (invoicingStatus === 'COMMON_INVOICED') { + return '开普票'; + } + + return undefined; +}; + export const LOGISTICS_STATUS_OPTIONS = { JINGDONG_LOGISTICS: '京东', SF_EXPRESS: '顺丰', diff --git a/src/pages/Order/index.tsx b/src/pages/Order/index.tsx index 53c6576..11b6078 100644 --- a/src/pages/Order/index.tsx +++ b/src/pages/Order/index.tsx @@ -47,13 +47,14 @@ import OrderDrawer from './components/OrderDrawer'; import OrderNotesEditModal from './components/OrderNotesEditModal'; import SubOrderComfirmReceiptImagesModal from './components/SubOrderComfirmReceiptImagesModal'; import { - INVOCING_STATUS_OPTIONS, MAIN_ORDER_COLUMNS, ORDER_STATUS_OPTIONS, PAYMENT_CHANNEL_OPTIONS, PAYMENT_METHOD_OPTIONS, PRODUCT_BELONG_DEPARTMENT_OPTIONS, TAGS_COLOR, + getInvoicingType, + getNeedInvoicing, } from './constant'; import './index.less'; import { OrderListItemType, OrderType } from './type.d'; @@ -196,6 +197,7 @@ const OrderPage = () => { return ( <Flex className="w-full border-b-indigo-500"> <Flex vertical className="w-[31%]" gap="small"> + {/* 商品名称 */} <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> <span className="text-black font-medium "> {optRecord.productName} @@ -211,6 +213,7 @@ const OrderPage = () => { {optRecord.notes === undefined ? '暂无备注' : optRecord.notes} </span> </div> + {/* 编辑备注按钮 */} <EditTwoTone onClick={() => { setNotesEditVisible(true); @@ -237,6 +240,7 @@ const OrderPage = () => { </div> </Flex> <Flex className="w-[10%]" vertical gap="small"> + {/* 支付方式 */} <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> <span className="text-slate-700"> {enumValueToLabel( @@ -245,6 +249,7 @@ const OrderPage = () => { )} </span> </div> + {/* 支付渠道 */} <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> <span className="text-slate-700"> {enumValueToLabel( @@ -255,6 +260,7 @@ const OrderPage = () => { </div> </Flex> <Flex className="w-[15%]" vertical gap="small"> + {/* 所属部门 */} <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> <span className="text-slate-700"> {enumValueToLabel( @@ -263,21 +269,41 @@ const OrderPage = () => { )} </span> </div> + + {/* 开票类型 */} + <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> + <span className="text-slate-700"> + {getInvoicingType(optRecord)} + </span> + </div> </Flex> + <Flex className="w-[10%]" vertical gap="small"> + {/* 开票状态 */} <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> - <Tag color={TAGS_COLOR.get(optRecord.invoicingStatus)}> - {enumValueToLabel( - optRecord.invoicingStatus, - INVOCING_STATUS_OPTIONS, - )} + <Tag + color={ + optRecord.invoicingTime === undefined + ? TAGS_COLOR.get(optRecord.invoicingStatus) + : 'success' + } + > + {getNeedInvoicing(optRecord)} </Tag> </div> + {/* 订单状态 */} <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> <Tag color={TAGS_COLOR.get(optRecord.orderStatus)}> {enumValueToLabel(optRecord.orderStatus, ORDER_STATUS_OPTIONS)} </Tag> </div> + + {/* 物流信息 */} + <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> + <Button type="link" size="small" className="px-0"> + 物流信息 + </Button> + </div> </Flex> <Flex className="w-[18%]" wrap="wrap" gap="small"> {optRecord.subPath.includes('sendProduct') ? ( @@ -806,7 +832,10 @@ const OrderPage = () => { title="确认作废?" text="作废" onConfirm={async () => { - let body = { id: record.id }; + let body = { + ids: [record.id], + checkIsMainOrderId: true, + }; const data = await postServiceOrderOrderCancel({ data: body, });