Commit 6718e7eb1038515ad22e104fd557b3cfb10e9866

Authored by zhongnanhuang
1 parent deed1a0c

feat: update

.umirc.ts
... ... @@ -13,9 +13,9 @@ export default defineConfig({
13 13 },
14 14 proxy: {
15 15 '/api/': {
16   - // target: 'http://localhost:8085/',
  16 + target: 'http://localhost:8085/',
17 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 19 changeOrigin: true,
20 20 pathRewrite: { '^/api': '' },
21 21 },
... ...
src/pages/Order/components/OrderDrawer.tsx
... ... @@ -464,11 +464,11 @@ export default ({ onClose, data, subOrders, orderOptType }) => {
464 464 name="invoiceIdentificationNumber"
465 465 label="开票信息"
466 466 // disabled={mainInfoDisbled}
467   - hidden={invoicingStatus !== 'INVOICED'}
  467 + hidden={invoicingStatus === 'UN_INVOICE'}
468 468 placeholder="请输入开票信息"
469 469 rules={[
470 470 {
471   - required: invoicingStatus === 'INVOICED' ? true : false,
  471 + required: invoicingStatus === 'UN_INVOICE' ? false : true,
472 472 message: '开票信息必填',
473 473 },
474 474 ]}
... ... @@ -479,7 +479,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => {
479 479 width="lg"
480 480 name="invoicingTime"
481 481 // disabled={mainInfoDisbled}
482   - hidden={invoicingStatus !== 'INVOICED'}
  482 + hidden={invoicingStatus === 'UN_INVOICE'}
483 483 label="开票时间"
484 484 placeholder="请输入开票时间"
485 485 />
... ... @@ -491,13 +491,13 @@ export default ({ onClose, data, subOrders, orderOptType }) => {
491 491 name="bank"
492 492 label="开户银行"
493 493 // disabled={mainInfoDisbled}
494   - hidden={invoicingStatus !== 'INVOICED'}
  494 + hidden={invoicingStatus === 'UN_INVOICE'}
495 495 placeholder="请输入开户银行"
496 496 />
497 497 <ProFormText
498 498 width="lg"
499 499 name="bankAccountNumber"
500   - hidden={invoicingStatus !== 'INVOICED'}
  500 + hidden={invoicingStatus === 'UN_INVOICE'}
501 501 label="银行账号"
502 502 // disabled={mainInfoDisbled}
503 503 placeholder="请输入银行账号"
... ...
src/pages/Order/constant.ts
... ... @@ -25,9 +25,49 @@ export const PRODUCT_BELONG_DEPARTMENT_OPTIONS = {
25 25  
26 26 export const INVOCING_STATUS_OPTIONS = {
27 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 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 71 export const LOGISTICS_STATUS_OPTIONS = {
32 72 JINGDONG_LOGISTICS: '京东',
33 73 SF_EXPRESS: '顺丰',
... ...
src/pages/Order/index.tsx
... ... @@ -47,13 +47,14 @@ import OrderDrawer from &#39;./components/OrderDrawer&#39;;
47 47 import OrderNotesEditModal from './components/OrderNotesEditModal';
48 48 import SubOrderComfirmReceiptImagesModal from './components/SubOrderComfirmReceiptImagesModal';
49 49 import {
50   - INVOCING_STATUS_OPTIONS,
51 50 MAIN_ORDER_COLUMNS,
52 51 ORDER_STATUS_OPTIONS,
53 52 PAYMENT_CHANNEL_OPTIONS,
54 53 PAYMENT_METHOD_OPTIONS,
55 54 PRODUCT_BELONG_DEPARTMENT_OPTIONS,
56 55 TAGS_COLOR,
  56 + getInvoicingType,
  57 + getNeedInvoicing,
57 58 } from './constant';
58 59 import './index.less';
59 60 import { OrderListItemType, OrderType } from './type.d';
... ... @@ -196,6 +197,7 @@ const OrderPage = () =&gt; {
196 197 return (
197 198 <Flex className="w-full border-b-indigo-500">
198 199 <Flex vertical className="w-[31%]" gap="small">
  200 + {/* 商品名称 */}
199 201 <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis">
200 202 <span className="text-black font-medium ">
201 203 {optRecord.productName}
... ... @@ -211,6 +213,7 @@ const OrderPage = () =&gt; {
211 213 {optRecord.notes === undefined ? '暂无备注' : optRecord.notes}
212 214 </span>
213 215 </div>
  216 + {/* 编辑备注按钮 */}
214 217 <EditTwoTone
215 218 onClick={() => {
216 219 setNotesEditVisible(true);
... ... @@ -237,6 +240,7 @@ const OrderPage = () =&gt; {
237 240 </div>
238 241 </Flex>
239 242 <Flex className="w-[10%]" vertical gap="small">
  243 + {/* 支付方式 */}
240 244 <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis">
241 245 <span className="text-slate-700">
242 246 {enumValueToLabel(
... ... @@ -245,6 +249,7 @@ const OrderPage = () =&gt; {
245 249 )}
246 250 </span>
247 251 </div>
  252 + {/* 支付渠道 */}
248 253 <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis">
249 254 <span className="text-slate-700">
250 255 {enumValueToLabel(
... ... @@ -255,6 +260,7 @@ const OrderPage = () =&gt; {
255 260 </div>
256 261 </Flex>
257 262 <Flex className="w-[15%]" vertical gap="small">
  263 + {/* 所属部门 */}
258 264 <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis">
259 265 <span className="text-slate-700">
260 266 {enumValueToLabel(
... ... @@ -263,21 +269,41 @@ const OrderPage = () =&gt; {
263 269 )}
264 270 </span>
265 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 279 </Flex>
  280 +
267 281 <Flex className="w-[10%]" vertical gap="small">
  282 + {/* 开票状态 */}
268 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 292 </Tag>
275 293 </div>
  294 + {/* 订单状态 */}
276 295 <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis">
277 296 <Tag color={TAGS_COLOR.get(optRecord.orderStatus)}>
278 297 {enumValueToLabel(optRecord.orderStatus, ORDER_STATUS_OPTIONS)}
279 298 </Tag>
280 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 307 </Flex>
282 308 <Flex className="w-[18%]" wrap="wrap" gap="small">
283 309 {optRecord.subPath.includes('sendProduct') ? (
... ... @@ -806,7 +832,10 @@ const OrderPage = () =&gt; {
806 832 title="确认作废?"
807 833 text="作废"
808 834 onConfirm={async () => {
809   - let body = { id: record.id };
  835 + let body = {
  836 + ids: [record.id],
  837 + checkIsMainOrderId: true,
  838 + };
810 839 const data = await postServiceOrderOrderCancel({
811 840 data: body,
812 841 });
... ...