Blame view

src/pages/Order/constant.ts 11.8 KB
1
2
import { enumToProTableEnumValue } from '@/utils';
zhongnanhuang authored
3
4
export const COMFIR_RECEIPT_IMAGES_NUMBER = 3;
5
6
7
8
9
10
11
export const PAYMENT_CHANNEL_OPTIONS = {
  ALIPAY: '支付宝',
  WECHAT: '微信',
  BANK_TRANSFER: '银行转账',
};

export const PAYMENT_METHOD_OPTIONS = {
zhongnanhuang authored
12
  UNPAID: '未付款',
zhongnanhuang authored
13
14
  TAOBAO_ORDER_HAS_BEEN_PAID: '淘宝订单已付款',
  PAYMENT_IN_ADVANCE: '预付款',
zhongnanhuang authored
15
  WITHHOLDING_ADVANCE_DEPOSIT: '扣预存',
zhongnanhuang authored
16
17
  PLATFORM_SETTLEMENT: '平台结算',
  CASH_ON_DELIVERY: '货到付款',
18
19
20
21
22
23
24
25
26
27
};

export const PRODUCT_BELONG_DEPARTMENT_OPTIONS = {
  APPLICATION_PROJECT: '应用项目事业部门',
  TEST: '测试事业部门',
  CUSTOMIZATION: '定制化事业部门',
  EXPERIMENTAL_EQUIPMENT: '实验设备事业部门',
  EXPERIMENTAL_CONSUMABLES: '实验耗材事业部门',
};
zhongnanhuang authored
28
export const INVOCING_STATUS_OPTIONS_OLD = {
29
  UN_INVOICE: '不需开票',
zhongnanhuang authored
30
31
  SPECIALLY_INVOICED: '专票',
  COMMON_INVOICED: '普票',
zhongnanhuang authored
32
  INVOICED: '需要开票',
zhongnanhuang authored
33
34
};
zhongnanhuang authored
35
36
37
38
39
40
export const INVOCING_STATUS_OPTIONS = {
  UN_INVOICE: '不需开票',
  SPECIALLY_INVOICED: '专票',
  COMMON_INVOICED: '普票',
};
zhongnanhuang authored
41
42
43
44
export const INVOCING_STATUS = {
  UN_INVOICE: '不需开票',
  SPECIALLY_INVOICED: '专票',
  COMMON_INVOICED: '普票',
45
  INVOICED: '需要开票',
46
47
};
zhongnanhuang authored
48
/**
zhongnanhuang authored
49
50
51
52
53
54
55
56
57
58
59
60
 * 普通审核
 * 财务审核
 * 采购审核
 */
export const CHECK_TYPE = {
  NORMAL: 'NORMAL',
  FINALCIAL: 'FINALCIAL',
  PROCURE: 'PROCURE',
  SUPPLIER: 'SUPPLIER',
};

/**
zhongnanhuang authored
61
62
63
64
 * 是否需要开票
 * @param subOrder
 */
export const getNeedInvoicing = (subOrder: any) => {
zhongnanhuang authored
65
  if (subOrder.invoicingTime !== null && subOrder.invoicingTime !== undefined) {
zhongnanhuang authored
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
    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;
};
92
export const LOGISTICS_STATUS_OPTIONS = {
zhongnanhuang authored
93
94
  JINGDONG_LOGISTICS: '京东',
  SF_EXPRESS: '顺丰',
95
  DEBANG_LOGISTICS: '德邦物流',
zhongnanhuang authored
96
  OTHER_LOGISTICS: '其他物流方式',
97
98
99
100
};

export const ORDER_STATUS_OPTIONS = {
  UNAUDITED: '未审核',
zhongnanhuang authored
101
  FINANCE_PROCESS: '财务已审核',
102
  AUDITED: '已审核',
zhongnanhuang authored
103
104
  PROCURE_UN_PROCESS: '采购未审核',
  PROCURE_PROCESS: '采购已审核',
zhongnanhuang authored
105
106
  PROCURE_PROCESS_FOR_MINE: '采购待打印',
  PROCURE_WAIT_SHIP: '采购待发货',
zhongnanhuang authored
107
  SUPPLIER_WAIT_SHIP: '供应商待发货',
108
109
  WAIT_SHIP: '待发货',
  SHIPPED: '已发货',
zhongnanhuang authored
110
  CONFIRM_RECEIPT: '确认收货',
zhongnanhuang authored
111
  AUDIT_FAILED: '审核失败',
zhongnanhuang authored
112
113
  IN_AFTER_SALES: '售后中',
  AFTER_SALES_COMPLETION: '售后完成',
zhongnanhuang authored
114
  NO_NEED_SEND: '无需发货',
zhongnanhuang authored
115
  PROCURE_CONVERT_WAREHOUSE_KEEPER: '采购转仓库',
zhongnanhuang authored
116
117
118
119
120
121
122
};

export const AFTE_SALES_PLAN_OPTIONS = {
  RETURNS_OR_REFUNDS: '退货/退款',
  EXCHANGE_GOODS: '换货',
  FREE_ORDER: '免单',
  DISCOUNT: '折扣',
123
124
};
zhongnanhuang authored
125
126
127
128
129
export const FINANCIAL_STATUS_OPTIONS = {
  INVOICING: '已开票',
  UN_INVOICING: '取消开票',
};
130
export const AFTER_INVOICING_STATUS = {
131
  NOT_YET_INVOICED: '尚未开票',
132
  APPLY_FOR_INVOICING: '申请开票',
133
134
135
136
  PARTIAL_INVOICING: '部分开票',
  COMPLETE_INVOICING: '完全开票',
};
zhongnanhuang authored
137
138
139
export const TAGS_COLOR = new Map<string, string>([
  ['UN_INVOICE', 'success'],
  ['INVOICED', 'processing'],
zhongnanhuang authored
140
141
  ['SPECIALLY_INVOICED', 'processing'],
  ['COMMON_INVOICED', 'processing'],
zhongnanhuang authored
142
143
144
145
146
147
  ['AFTER_INVOICED', 'success'],
  ['UNAUDITED', 'warning'],
  ['AUDITED', 'processing'],
  ['WAIT_SHIP', 'processing'],
  ['SHIPPED', 'processing'],
  ['AUDIT_FAILED', 'error'],
zhongnanhuang authored
148
149
150
151
152
153
  ['CONFIRM_RECEIPT', 'processing'],
  ['FINANCE_PROCESS', 'processing'],
  ['PROCURE_UN_PROCESS', 'processing'],
  ['PROCURE_PROCESS', 'processing'],
  ['SUPPLIER_WAIT_SHIP', 'processing'],
  ['SUPPLIER_SHIPPED', 'processing'],
zhongnanhuang authored
154
155
156
  ['IN_AFTER_SALES', 'red'],
  ['AFTER_SALES_COMPLETION', 'red'],
  ['PROCURE_PROCESS_FOR_MINE', 'processing'],
zhongnanhuang authored
157
158
  ['PROCURE_WAIT_SHIP', 'processing'],
  ['NO_NEED_SEND', 'success'],
zhongnanhuang authored
159
  ['PROCURE_CONVERT_WAREHOUSE_KEEPER', 'processing'],
zhongnanhuang authored
160
161
162
]);

export const SALES_CODE_OPTIONS = [
zhongnanhuang authored
163
164
165
166
167
168
169
170
171
  { label: 'HQ_Linda', value: 'HQ_Linda' },
  { label: 'HQ-1_Rita', value: 'HQ-1_Rita' },
  { label: 'HQ-2_Lisa', value: 'HQ-2_Lisa' },
  { label: 'HQ-3_iris', value: 'HQ-3_iris' },
  { label: 'HQ-4_Lynn', value: 'HQ-4_Lynn' },
  { label: 'HQ-5_Jessica', value: 'HQ-5_Jessica' },
  { label: 'HQ-6_smile', value: 'HQ-6_smile' },
  { label: 'HQ-7_Yvonne', value: 'HQ-7_Yvonne' },
  { label: 'HQ-8_Daniel', value: 'HQ-8_Daniel' },
zhongnanhuang authored
172
  { label: 'HQ-9_Wendy', value: 'HQ-9_Wendy' },
zhongnanhuang authored
173
  { label: 'W_strong', value: 'W_strong' },
zhongnanhuang authored
174
  { label: 'W-1_Alice', value: 'W-1_Alice' },
zhongnanhuang authored
175
176
177
178
179
180
  { label: 'W-2_Demi', value: 'W-2_Demi' },
  { label: 'W-3_Nico', value: 'W-3_Nico' },
  { label: 'W-4_kk', value: 'W-4_kk' },
  { label: 'W-5_Alma', value: 'W-5_Alma' },
  { label: 'W-6_Dream', value: 'W-6_Dream' },
  { label: 'W-7_Aimee', value: 'W-7_Aimee' },
zhongnanhuang authored
181
182
183
184
  { label: 'XX_Tina', value: 'XX_Tina' },
  { label: 'XX-2_Vivi', value: 'XX-2_Vivi' },
  { label: 'XX-A1_Ada', value: 'XX-A1_Ada' },
  { label: 'XX-A2_Amy', value: 'XX-A2_Amy' },
zhongnanhuang authored
185
186
  { label: 'XX-N1_Nancy', value: 'XX-N1_Nancy' },
  { label: 'XX-N2_Sara', value: 'XX-N2_Sara' },
zhongnanhuang authored
187
188
189
  { label: 'XX-C_CC', value: 'XX-C_CC' },
  { label: 'XX-L1_Lucy', value: 'XX-L1_Lucy' },
  { label: 'XX-L2_Lulu', value: 'XX-L2_Lulu' },
zhongnanhuang authored
190
191
192
193
194
195
196
197
  { label: 'XX-P', value: 'XX-P' },
  { label: 'TB', value: 'TB' },
  { label: 'HCTB', value: 'HCTB' },
  { label: 'TBC', value: 'TBC' },
  { label: 'GW-3_iris', value: 'GW-3_iris' },
  { label: 'GW-4_Lynn', value: 'GW-4_Lynn' },
  { label: 'GW-6_smile', value: 'GW-6_smile' },
  { label: 'GW-7_Yvonne', value: 'GW-7_Yvonne' },
zhongnanhuang authored
198
  { label: 'GW-9_Wendy', value: 'GW-9_Wendy' },
zhongnanhuang authored
199
200
201
202
  { label: 'W-9_Jack', value: 'W-9_Jack' },
  { label: 'W-8_Andy', value: 'W-8_Andy' },
  { label: 'CQ_Peter', value: 'CQ_Peter' },
  { label: 'MA_A_Mao', value: 'MA_A_Mao' },
zhongnanhuang authored
203
204
  { label: 'CQ-2', value: 'CQ-2' },
  { label: 'JJ', value: 'JJ' },
zhongnanhuang authored
205
  { label: 'CQ-3', value: 'CQ-3' },
zhongnanhuang authored
206
207
];
zhongnanhuang authored
208
209
210
211
212
213
214
215
216
217
export const HISTORY_OPT_TYPE = new Map<string, string>([
  ['DELETE', '作废'],
  ['UPDATE', '编辑'],
  ['ADD', '创建'],
  ['SEND', '发货'],
  ['CHECK', '审核'],
  ['CONFIRM_RECEIPT', '确认收货'],
  ['PRINT_ORDER', '打印'],
  ['INVOICING', '财务开票'],
  ['EDIT_ORDER', '财务编辑'],
zhongnanhuang authored
218
  ['MODIFY_SEN_INFORMATION', '发货信息编辑'],
zhongnanhuang authored
219
  ['UN_INVOICING', '财务取消开票'],
zhongnanhuang authored
220
221
222
223
  ['FINANCE_CHECK_ORDER', '财务审核'],
  ['PROCURE_CHECK_ORDER', '采购审核'],
  ['SUPPLIER_PRINT', '供应商打印'],
  ['EXTERNAL_PROCUREMENT', '仓库操作外部采购子订单'],
zhongnanhuang authored
224
225
226
227
  ['APPLY_AFTER_SALES', '申请售后子订单'],
  ['AFTER_SALES_COMPLETION', '完成售后子订单'],
  ['PROCURE_PRINT', '采购打印子订单'],
  ['PROCURE_SEND', '采购发货子订单'],
zhongnanhuang authored
228
  ['NO_NEED_SEND', '不需要发货'],
zhongnanhuang authored
229
  ['PROCURE_CONVERT_WAREHOUSE_KEEPER', '采购转仓库'],
zhongnanhuang authored
230
231
]);
sanmu authored
232
233
234
235
236
237
238
239
240
241
export const MAIN_ORDER_COLUMNS = [
  {
    title: '订单列表',
    width: 120,
    dataIndex: 'name',
    search: false,
  },
  {
    title: '订单编号',
    dataIndex: 'id',
zhongnanhuang authored
242
    valueType: 'text',
sanmu authored
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
    hideInTable: true,
  },
  {
    title: '销售代表',
    dataIndex: 'salesCode',
    valueType: 'text',
    hideInTable: true,
  },
  {
    title: '收货人',
    dataIndex: 'customerName',
    valueType: 'text',
    hideInTable: true,
  },
  {
    title: '收货人联系电话',
    dataIndex: 'customerContactNumber',
    valueType: 'text',
    hideInTable: true,
  },
  {
    title: '单位',
    dataIndex: 'institution',
    valueType: 'text',
    hideInTable: true,
  },
  {
    title: '单位联系人',
    dataIndex: 'institutionContactName',
    valueType: 'text',
    hideInTable: true,
  },
  {
    title: '收货人地址',
    dataIndex: 'customerShippingAddress',
    valueType: 'text',
    hideInTable: true,
  },
  {
    title: '商品名称',
    dataIndex: 'productName',
    valueType: 'text',
    hideInTable: true,
  },
  {
zhongnanhuang authored
288
289
290
291
292
293
294
295
296
297
298
299
    title: '主订单备注',
    dataIndex: 'mainNotes',
    valueType: 'text',
    hideInTable: true,
  },
  {
    title: '子订单备注',
    dataIndex: 'subNotes',
    valueType: 'text',
    hideInTable: true,
  },
  {
sanmu authored
300
301
302
303
304
305
306
307
    title: '商品参数',
    dataIndex: 'parameters',
    valueType: 'text',
    hideInTable: true,
  },
  {
    title: '订单状态',
    dataIndex: 'orderStatus',
308
    valueType: 'select',
sanmu authored
309
    hideInTable: true,
310
    valueEnum: enumToProTableEnumValue(ORDER_STATUS_OPTIONS),
sanmu authored
311
312
313
  },
  {
    title: '支付方式',
zhongnanhuang authored
314
    dataIndex: 'paymentMethod',
315
    valueType: 'select',
sanmu authored
316
    hideInTable: true,
317
    valueEnum: enumToProTableEnumValue(PAYMENT_METHOD_OPTIONS),
sanmu authored
318
319
320
321
  },
  {
    title: '物流方式',
    dataIndex: 'logisticsMethod',
322
    valueType: 'select',
sanmu authored
323
    hideInTable: true,
324
    valueEnum: enumToProTableEnumValue(LOGISTICS_STATUS_OPTIONS),
sanmu authored
325
326
327
328
  },
  {
    title: '支付渠道',
    dataIndex: 'paymentChannel',
329
    valueType: 'select',
sanmu authored
330
    hideInTable: true,
331
    valueEnum: enumToProTableEnumValue(PAYMENT_CHANNEL_OPTIONS),
sanmu authored
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
  },
  {
    title: '银行名称',
    dataIndex: 'bank',
    valueType: 'text',
    hideInTable: true,
  },
  {
    title: '支付流水',
    dataIndex: 'paymentTransactionId',
    valueType: 'text',
    hideInTable: true,
  },
  {
    title: '所属部门',
    dataIndex: 'productBelongBusiness',
348
    valueType: 'select',
sanmu authored
349
    hideInTable: true,
350
    valueEnum: enumToProTableEnumValue(PRODUCT_BELONG_DEPARTMENT_OPTIONS),
sanmu authored
351
352
353
354
  },
  {
    title: '创建日期',
    dataIndex: 'createTime',
zhongnanhuang authored
355
    valueType: 'dateTimeRange',
sanmu authored
356
357
358
359
    hideInTable: true,
    search: {
      transform: (value) => {
        return {
360
          beginTime: value[0],
sanmu authored
361
362
363
364
365
366
          endTime: value[1],
        };
      },
    },
  },
  {
367
    title: '是否需要开票',
sanmu authored
368
    dataIndex: 'invoicingStatus',
369
    valueType: 'select',
sanmu authored
370
    hideInTable: true,
371
    valueEnum: enumToProTableEnumValue(INVOCING_STATUS_OPTIONS),
sanmu authored
372
373
  },
  {
374
    title: '开票状态',
375
376
377
378
379
380
    dataIndex: 'afterInvoicingStatus',
    valueType: 'select',
    hideInTable: true,
    valueEnum: enumToProTableEnumValue(AFTER_INVOICING_STATUS),
  },
  {
sanmu authored
381
382
383
384
385
386
387
    title: '开票日期',
    dataIndex: 'invoicingTime',
    valueType: 'dateRange',
    hideInTable: true,
    search: {
      transform: (value) => {
        return {
388
389
          invoicingBeginTime: value[0],
          invoicingEndTime: value[1],
sanmu authored
390
391
392
393
394
395
396
        };
      },
    },
  },
];

export const SUB_ORDER_COLUMNS = [
zhongnanhuang authored
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
  { title: 'ID', dataIndex: 'id', key: 'id', width: 80 },
  {
    title: '商品编码',
    dataIndex: 'productCode',
    key: 'productCode',
    width: 80,
  },
  {
    title: '商品名称',
    dataIndex: 'productName',
    key: 'productName',
    width: 80,
  },
  { title: '商品参数', dataIndex: 'parameters', key: 'parameters', width: 80 },
  { title: '商品数量', dataIndex: 'quantity', key: 'quantity', width: 80 },
sanmu authored
412
413
414
415
  {
    title: '子订单金额(¥)',
    dataIndex: 'subOrderPayment',
    key: 'subOrderPayment',
zhongnanhuang authored
416
    width: 80,
sanmu authored
417
418
  },
  {
zhongnanhuang authored
419
420
421
422
423
424
    title: '所属事业部',
    dataIndex: 'productBelongBusiness',
    key: 'productBelongBusiness',
    width: 80,
  },
  {
sanmu authored
425
426
427
    title: '支付方式',
    dataIndex: 'paymentMethod',
    key: 'paymentMethod',
zhongnanhuang authored
428
    width: 80,
sanmu authored
429
430
431
432
433
  },
  {
    title: '支付渠道',
    dataIndex: 'paymentChannel',
    key: 'paymentChannel',
zhongnanhuang authored
434
    width: 80,
sanmu authored
435
436
437
438
439
  },
  {
    title: '支付流水',
    dataIndex: 'paymentTransactionId',
    key: 'paymentTransactionId',
zhongnanhuang authored
440
    width: 80,
sanmu authored
441
442
443
444
445
  },
  {
    title: '物流方式',
    dataIndex: 'logisticsMethod',
    key: 'logisticsMethod',
zhongnanhuang authored
446
447
448
449
450
451
452
    width: 80,
  },
  {
    title: '物流单号',
    dataIndex: 'serialNumber',
    key: 'serialNumber',
    width: 80,
sanmu authored
453
454
455
456
457
458
  },
  {
    title: '开票状态',
    dataIndex: 'invoicingStatus',
    key: 'invoicingStatus',
    component: 'tag',
zhongnanhuang authored
459
    width: 80,
sanmu authored
460
461
462
463
464
465
  },
  {
    title: '订单状态',
    dataIndex: 'orderStatus',
    key: 'orderStatus',
    component: 'tag',
zhongnanhuang authored
466
    width: 80,
sanmu authored
467
468
  },
];