Commit 6718e7eb1038515ad22e104fd557b3cfb10e9866
1 parent
deed1a0c
feat: update
Showing
4 changed files
with
83 additions
and
14 deletions
.umirc.ts
@@ -13,9 +13,9 @@ export default defineConfig({ | @@ -13,9 +13,9 @@ export default defineConfig({ | ||
13 | }, | 13 | }, |
14 | proxy: { | 14 | proxy: { |
15 | '/api/': { | 15 | '/api/': { |
16 | - // target: 'http://localhost:8085/', | 16 | + target: 'http://localhost:8085/', |
17 | // target: 'http://192.168.1.6:8085/', | 17 | // target: 'http://192.168.1.6:8085/', |
18 | - target: 'http://39.108.227.113:8085/', | 18 | + // target: 'http://39.108.227.113:8085/', |
19 | changeOrigin: true, | 19 | changeOrigin: true, |
20 | pathRewrite: { '^/api': '' }, | 20 | pathRewrite: { '^/api': '' }, |
21 | }, | 21 | }, |
src/pages/Order/components/OrderDrawer.tsx
@@ -464,11 +464,11 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | @@ -464,11 +464,11 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | ||
464 | name="invoiceIdentificationNumber" | 464 | name="invoiceIdentificationNumber" |
465 | label="开票信息" | 465 | label="开票信息" |
466 | // disabled={mainInfoDisbled} | 466 | // disabled={mainInfoDisbled} |
467 | - hidden={invoicingStatus !== 'INVOICED'} | 467 | + hidden={invoicingStatus === 'UN_INVOICE'} |
468 | placeholder="请输入开票信息" | 468 | placeholder="请输入开票信息" |
469 | rules={[ | 469 | rules={[ |
470 | { | 470 | { |
471 | - required: invoicingStatus === 'INVOICED' ? true : false, | 471 | + required: invoicingStatus === 'UN_INVOICE' ? false : true, |
472 | message: '开票信息必填', | 472 | message: '开票信息必填', |
473 | }, | 473 | }, |
474 | ]} | 474 | ]} |
@@ -479,7 +479,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | @@ -479,7 +479,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | ||
479 | width="lg" | 479 | width="lg" |
480 | name="invoicingTime" | 480 | name="invoicingTime" |
481 | // disabled={mainInfoDisbled} | 481 | // disabled={mainInfoDisbled} |
482 | - hidden={invoicingStatus !== 'INVOICED'} | 482 | + hidden={invoicingStatus === 'UN_INVOICE'} |
483 | label="开票时间" | 483 | label="开票时间" |
484 | placeholder="请输入开票时间" | 484 | placeholder="请输入开票时间" |
485 | /> | 485 | /> |
@@ -491,13 +491,13 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | @@ -491,13 +491,13 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | ||
491 | name="bank" | 491 | name="bank" |
492 | label="开户银行" | 492 | label="开户银行" |
493 | // disabled={mainInfoDisbled} | 493 | // disabled={mainInfoDisbled} |
494 | - hidden={invoicingStatus !== 'INVOICED'} | 494 | + hidden={invoicingStatus === 'UN_INVOICE'} |
495 | placeholder="请输入开户银行" | 495 | placeholder="请输入开户银行" |
496 | /> | 496 | /> |
497 | <ProFormText | 497 | <ProFormText |
498 | width="lg" | 498 | width="lg" |
499 | name="bankAccountNumber" | 499 | name="bankAccountNumber" |
500 | - hidden={invoicingStatus !== 'INVOICED'} | 500 | + hidden={invoicingStatus === 'UN_INVOICE'} |
501 | label="银行账号" | 501 | label="银行账号" |
502 | // disabled={mainInfoDisbled} | 502 | // disabled={mainInfoDisbled} |
503 | placeholder="请输入银行账号" | 503 | placeholder="请输入银行账号" |
src/pages/Order/constant.ts
@@ -25,9 +25,49 @@ export const PRODUCT_BELONG_DEPARTMENT_OPTIONS = { | @@ -25,9 +25,49 @@ export const PRODUCT_BELONG_DEPARTMENT_OPTIONS = { | ||
25 | 25 | ||
26 | export const INVOCING_STATUS_OPTIONS = { | 26 | export const INVOCING_STATUS_OPTIONS = { |
27 | UN_INVOICE: '不需开票', | 27 | UN_INVOICE: '不需开票', |
28 | + SPECIALLY_INVOICED: '专票', | ||
29 | + COMMON_INVOICED: '普票', | ||
30 | +}; | ||
31 | + | ||
32 | +export const INVOCING_STATUS = { | ||
33 | + UN_INVOICE: '不需开票', | ||
34 | + SPECIALLY_INVOICED: '专票', | ||
35 | + COMMON_INVOICED: '普票', | ||
28 | INVOICED: '需要开票', | 36 | INVOICED: '需要开票', |
29 | }; | 37 | }; |
30 | 38 | ||
39 | +/** | ||
40 | + * 是否需要开票 | ||
41 | + * @param subOrder | ||
42 | + */ | ||
43 | +export const getNeedInvoicing = (subOrder: any) => { | ||
44 | + if (subOrder.invoicingTime !== undefined) { | ||
45 | + return '已开票'; | ||
46 | + } | ||
47 | + if (subOrder.invoicingStatus === 'UN_INVOICE') { | ||
48 | + return '不需开票'; | ||
49 | + } | ||
50 | + return '需要开票'; | ||
51 | +}; | ||
52 | + | ||
53 | +/** | ||
54 | + * 开砖专票还是普票 | ||
55 | + * @param subOrder | ||
56 | + * @returns | ||
57 | + */ | ||
58 | +export const getInvoicingType = (subOrder: any) => { | ||
59 | + let invoicingStatus = subOrder.invoicingStatus; | ||
60 | + if (invoicingStatus === 'SPECIALLY_INVOICED') { | ||
61 | + return '开专票'; | ||
62 | + } | ||
63 | + | ||
64 | + if (invoicingStatus === 'COMMON_INVOICED') { | ||
65 | + return '开普票'; | ||
66 | + } | ||
67 | + | ||
68 | + return undefined; | ||
69 | +}; | ||
70 | + | ||
31 | export const LOGISTICS_STATUS_OPTIONS = { | 71 | export const LOGISTICS_STATUS_OPTIONS = { |
32 | JINGDONG_LOGISTICS: '京东', | 72 | JINGDONG_LOGISTICS: '京东', |
33 | SF_EXPRESS: '顺丰', | 73 | SF_EXPRESS: '顺丰', |
src/pages/Order/index.tsx
@@ -47,13 +47,14 @@ import OrderDrawer from './components/OrderDrawer'; | @@ -47,13 +47,14 @@ import OrderDrawer from './components/OrderDrawer'; | ||
47 | import OrderNotesEditModal from './components/OrderNotesEditModal'; | 47 | import OrderNotesEditModal from './components/OrderNotesEditModal'; |
48 | import SubOrderComfirmReceiptImagesModal from './components/SubOrderComfirmReceiptImagesModal'; | 48 | import SubOrderComfirmReceiptImagesModal from './components/SubOrderComfirmReceiptImagesModal'; |
49 | import { | 49 | import { |
50 | - INVOCING_STATUS_OPTIONS, | ||
51 | MAIN_ORDER_COLUMNS, | 50 | MAIN_ORDER_COLUMNS, |
52 | ORDER_STATUS_OPTIONS, | 51 | ORDER_STATUS_OPTIONS, |
53 | PAYMENT_CHANNEL_OPTIONS, | 52 | PAYMENT_CHANNEL_OPTIONS, |
54 | PAYMENT_METHOD_OPTIONS, | 53 | PAYMENT_METHOD_OPTIONS, |
55 | PRODUCT_BELONG_DEPARTMENT_OPTIONS, | 54 | PRODUCT_BELONG_DEPARTMENT_OPTIONS, |
56 | TAGS_COLOR, | 55 | TAGS_COLOR, |
56 | + getInvoicingType, | ||
57 | + getNeedInvoicing, | ||
57 | } from './constant'; | 58 | } from './constant'; |
58 | import './index.less'; | 59 | import './index.less'; |
59 | import { OrderListItemType, OrderType } from './type.d'; | 60 | import { OrderListItemType, OrderType } from './type.d'; |
@@ -196,6 +197,7 @@ const OrderPage = () => { | @@ -196,6 +197,7 @@ const OrderPage = () => { | ||
196 | return ( | 197 | return ( |
197 | <Flex className="w-full border-b-indigo-500"> | 198 | <Flex className="w-full border-b-indigo-500"> |
198 | <Flex vertical className="w-[31%]" gap="small"> | 199 | <Flex vertical className="w-[31%]" gap="small"> |
200 | + {/* 商品名称 */} | ||
199 | <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> | 201 | <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> |
200 | <span className="text-black font-medium "> | 202 | <span className="text-black font-medium "> |
201 | {optRecord.productName} | 203 | {optRecord.productName} |
@@ -211,6 +213,7 @@ const OrderPage = () => { | @@ -211,6 +213,7 @@ const OrderPage = () => { | ||
211 | {optRecord.notes === undefined ? '暂无备注' : optRecord.notes} | 213 | {optRecord.notes === undefined ? '暂无备注' : optRecord.notes} |
212 | </span> | 214 | </span> |
213 | </div> | 215 | </div> |
216 | + {/* 编辑备注按钮 */} | ||
214 | <EditTwoTone | 217 | <EditTwoTone |
215 | onClick={() => { | 218 | onClick={() => { |
216 | setNotesEditVisible(true); | 219 | setNotesEditVisible(true); |
@@ -237,6 +240,7 @@ const OrderPage = () => { | @@ -237,6 +240,7 @@ const OrderPage = () => { | ||
237 | </div> | 240 | </div> |
238 | </Flex> | 241 | </Flex> |
239 | <Flex className="w-[10%]" vertical gap="small"> | 242 | <Flex className="w-[10%]" vertical gap="small"> |
243 | + {/* 支付方式 */} | ||
240 | <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> | 244 | <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> |
241 | <span className="text-slate-700"> | 245 | <span className="text-slate-700"> |
242 | {enumValueToLabel( | 246 | {enumValueToLabel( |
@@ -245,6 +249,7 @@ const OrderPage = () => { | @@ -245,6 +249,7 @@ const OrderPage = () => { | ||
245 | )} | 249 | )} |
246 | </span> | 250 | </span> |
247 | </div> | 251 | </div> |
252 | + {/* 支付渠道 */} | ||
248 | <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> | 253 | <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> |
249 | <span className="text-slate-700"> | 254 | <span className="text-slate-700"> |
250 | {enumValueToLabel( | 255 | {enumValueToLabel( |
@@ -255,6 +260,7 @@ const OrderPage = () => { | @@ -255,6 +260,7 @@ const OrderPage = () => { | ||
255 | </div> | 260 | </div> |
256 | </Flex> | 261 | </Flex> |
257 | <Flex className="w-[15%]" vertical gap="small"> | 262 | <Flex className="w-[15%]" vertical gap="small"> |
263 | + {/* 所属部门 */} | ||
258 | <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> | 264 | <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> |
259 | <span className="text-slate-700"> | 265 | <span className="text-slate-700"> |
260 | {enumValueToLabel( | 266 | {enumValueToLabel( |
@@ -263,21 +269,41 @@ const OrderPage = () => { | @@ -263,21 +269,41 @@ const OrderPage = () => { | ||
263 | )} | 269 | )} |
264 | </span> | 270 | </span> |
265 | </div> | 271 | </div> |
272 | + | ||
273 | + {/* 开票类型 */} | ||
274 | + <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> | ||
275 | + <span className="text-slate-700"> | ||
276 | + {getInvoicingType(optRecord)} | ||
277 | + </span> | ||
278 | + </div> | ||
266 | </Flex> | 279 | </Flex> |
280 | + | ||
267 | <Flex className="w-[10%]" vertical gap="small"> | 281 | <Flex className="w-[10%]" vertical gap="small"> |
282 | + {/* 开票状态 */} | ||
268 | <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> | 283 | <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> |
269 | - <Tag color={TAGS_COLOR.get(optRecord.invoicingStatus)}> | ||
270 | - {enumValueToLabel( | ||
271 | - optRecord.invoicingStatus, | ||
272 | - INVOCING_STATUS_OPTIONS, | ||
273 | - )} | 284 | + <Tag |
285 | + color={ | ||
286 | + optRecord.invoicingTime === undefined | ||
287 | + ? TAGS_COLOR.get(optRecord.invoicingStatus) | ||
288 | + : 'success' | ||
289 | + } | ||
290 | + > | ||
291 | + {getNeedInvoicing(optRecord)} | ||
274 | </Tag> | 292 | </Tag> |
275 | </div> | 293 | </div> |
294 | + {/* 订单状态 */} | ||
276 | <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> | 295 | <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> |
277 | <Tag color={TAGS_COLOR.get(optRecord.orderStatus)}> | 296 | <Tag color={TAGS_COLOR.get(optRecord.orderStatus)}> |
278 | {enumValueToLabel(optRecord.orderStatus, ORDER_STATUS_OPTIONS)} | 297 | {enumValueToLabel(optRecord.orderStatus, ORDER_STATUS_OPTIONS)} |
279 | </Tag> | 298 | </Tag> |
280 | </div> | 299 | </div> |
300 | + | ||
301 | + {/* 物流信息 */} | ||
302 | + <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> | ||
303 | + <Button type="link" size="small" className="px-0"> | ||
304 | + 物流信息 | ||
305 | + </Button> | ||
306 | + </div> | ||
281 | </Flex> | 307 | </Flex> |
282 | <Flex className="w-[18%]" wrap="wrap" gap="small"> | 308 | <Flex className="w-[18%]" wrap="wrap" gap="small"> |
283 | {optRecord.subPath.includes('sendProduct') ? ( | 309 | {optRecord.subPath.includes('sendProduct') ? ( |
@@ -806,7 +832,10 @@ const OrderPage = () => { | @@ -806,7 +832,10 @@ const OrderPage = () => { | ||
806 | title="确认作废?" | 832 | title="确认作废?" |
807 | text="作废" | 833 | text="作废" |
808 | onConfirm={async () => { | 834 | onConfirm={async () => { |
809 | - let body = { id: record.id }; | 835 | + let body = { |
836 | + ids: [record.id], | ||
837 | + checkIsMainOrderId: true, | ||
838 | + }; | ||
810 | const data = await postServiceOrderOrderCancel({ | 839 | const data = await postServiceOrderOrderCancel({ |
811 | data: body, | 840 | data: body, |
812 | }); | 841 | }); |