normal-order.ts 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. import { h } from 'vue';
  2. import { NFlex, NImage, NTag } from 'naive-ui';
  3. // import { fetchGetAllStoreList } from '@/service/api/goods/desk-category';
  4. import { fetchGetStoreList } from '@/service/api/xsb-manage/store-info';
  5. // import { fetchGetDictDataList } from '@/service/api/system-manage';
  6. // import { useAuth } from '@/hooks/business/auth';
  7. import type { FormSchema } from '@/components/zt/Form/types/form';
  8. export const SearchForm: FormSchema[] = [
  9. {
  10. label: '门店名称',
  11. component: 'ApiSelect',
  12. field: 'shopId',
  13. componentProps: {
  14. api: fetchGetStoreList,
  15. resultFeild: 'data.list',
  16. labelFeild: 'shopName',
  17. valueFeild: 'shopId'
  18. }
  19. },
  20. {
  21. label: '订单编号',
  22. component: 'NInput',
  23. field: 'orderNumber'
  24. },
  25. {
  26. label: '订单类型',
  27. component: 'NSelect',
  28. field: 'djkOrderType',
  29. componentProps: {
  30. options: [
  31. {
  32. label: '正常订单',
  33. value: 0
  34. },
  35. {
  36. label: '福利订单',
  37. value: 1
  38. }
  39. ]
  40. }
  41. },
  42. {
  43. label: '客户姓名',
  44. component: 'NInput',
  45. field: 'consigneeName'
  46. },
  47. {
  48. label: '客户电话',
  49. component: 'NInput',
  50. field: 'consigneeMobile'
  51. },
  52. {
  53. label: '用户电话',
  54. component: 'NInput',
  55. field: 'memberMobile'
  56. },
  57. {
  58. label: '下单时间',
  59. component: 'NDatePicker',
  60. field: 'createTime',
  61. componentProps: {
  62. type: 'datetimerange',
  63. defaultTime: ['00:00:00', '23:59:59']
  64. }
  65. }
  66. // {
  67. // field: 'userAttrType',
  68. // label: '人员属性',
  69. // component: 'dictSelect',
  70. // componentProps: {
  71. // dictCode: 'user_attr_type',
  72. // immediate: true
  73. // },
  74. // show: useAuth().hasAuth('user:attr:type')
  75. // }
  76. ];
  77. export enum orderStatusEnum {
  78. /**
  79. *
  80. * 待支付
  81. */
  82. WAIT_PAY = 0,
  83. /**
  84. * 待发货
  85. */
  86. WAIT_DELIVERY = 1,
  87. /**
  88. * 订单已接单(待拣货)
  89. */
  90. ORDER_ACCEPT = 20,
  91. /**
  92. * 订单待配送(拣货完成/自提类订单为待自提)
  93. */
  94. ORDER_WAIT_DELIVERY = 30,
  95. /**
  96. * 订单配送中
  97. */
  98. ORDER_DELIVERY = 40,
  99. /**
  100. * 订单取消待审核
  101. */
  102. ORDER_CANCEL_WAIT_AUDIT = 50,
  103. /**
  104. * 订单已取消
  105. */
  106. ORDER_CANCEL = 60,
  107. /**
  108. * 订单已退款
  109. */
  110. ORDER_REFUNDED = 61,
  111. /**
  112. * 订单已过期
  113. */
  114. ORDER_EXPIRED = 62,
  115. /**
  116. * 订单已送达
  117. */
  118. ORDER_ARRIVE = 70,
  119. /**
  120. * 订单已完成
  121. */
  122. ORDER_COMPLETE = 80
  123. }
  124. /**
  125. * 发货按钮显示状态
  126. */
  127. export const ShippingButton = [
  128. orderStatusEnum.WAIT_DELIVERY,
  129. orderStatusEnum.ORDER_ACCEPT,
  130. orderStatusEnum.ORDER_DELIVERY,
  131. orderStatusEnum.ORDER_WAIT_DELIVERY
  132. ];
  133. /**
  134. * // 0-待支付 1-待发货,20-订单已接单(待拣货),30-订单待配送(拣货完成/自提类订单为待自提),40-订单配送中
  135. // ,50-订单取消待审核,60-订单已取消,70-订单已送达,80-订单已完成
  136. */
  137. export const orderStatus = {
  138. [orderStatusEnum.WAIT_PAY]: '待支付',
  139. [orderStatusEnum.WAIT_DELIVERY]: '待发货',
  140. [orderStatusEnum.ORDER_ACCEPT]: '订单已接单(待拣货)',
  141. [orderStatusEnum.ORDER_WAIT_DELIVERY]: '订单待配送(拣货完成/自提类订单为待自提)',
  142. [orderStatusEnum.ORDER_DELIVERY]: '订单配送中',
  143. [orderStatusEnum.ORDER_CANCEL_WAIT_AUDIT]: '订单取消待审核',
  144. [orderStatusEnum.ORDER_CANCEL]: '订单已取消',
  145. [orderStatusEnum.ORDER_ARRIVE]: '订单已送达',
  146. [orderStatusEnum.ORDER_COMPLETE]: '订单已完成'
  147. };
  148. export const DJKOrderStatus = {
  149. [orderStatusEnum.WAIT_PAY]: '待支付',
  150. [orderStatusEnum.ORDER_ACCEPT]: '待使用',
  151. [orderStatusEnum.ORDER_CANCEL]: '已取消',
  152. [orderStatusEnum.ORDER_REFUNDED]: '已退款',
  153. [orderStatusEnum.ORDER_EXPIRED]: '已过期',
  154. [orderStatusEnum.ORDER_COMPLETE]: '已核销'
  155. };
  156. export enum yppStatusEnum {
  157. /**
  158. *
  159. * 待支付
  160. */
  161. WAIT_PAY = 0,
  162. /**
  163. * 已支付
  164. */
  165. WAIT_DELIVERY = 1,
  166. /**
  167. * 出票成功
  168. */
  169. SUCCESS = 4,
  170. /**
  171. * 出票失败(退款)
  172. */
  173. REFUND_FAIL = 7,
  174. /**
  175. * 超时未支付(取消)
  176. */
  177. TIMEOUT_CANCEL = 8
  178. }
  179. export const yppStatus = {
  180. [yppStatusEnum.WAIT_PAY]: '待支付',
  181. [yppStatusEnum.WAIT_DELIVERY]: '已支付',
  182. [yppStatusEnum.SUCCESS]: '出票成功',
  183. [yppStatusEnum.REFUND_FAIL]: '出票失败(退款)',
  184. [yppStatusEnum.TIMEOUT_CANCEL]: '超时未支付(取消)'
  185. };
  186. /**
  187. // 1:申请退款 2:退款成功 3:部分退款成功 4:退款失败
  188. *
  189. */
  190. export const refundStatus = {
  191. 1: '申请退款',
  192. 2: '退款成功',
  193. 3: '部分退款成功',
  194. 4: '退款失败'
  195. };
  196. /**
  197. *
  198. * 配送方式
  199. */
  200. export const dvyStatus = {
  201. 1: '快递',
  202. 2: '自提',
  203. 3: '即时配送'
  204. };
  205. export const orderColumns: NaiveUI.TableColumn<Api.delivery.OrderItemElement>[] = [
  206. {
  207. title: '商品',
  208. key: 'goods',
  209. width: 300,
  210. render: row => {
  211. const goodsNodes = [
  212. h(NImage, { src: row.pic, width: 80, height: 80 }),
  213. h('div', { class: 'ml-2 ' }, [
  214. h('div', { class: 'text-15px font-semibold' }, row.skuName),
  215. h('div', { class: 'text-gray' }, `规格:${row.spec || '--'}`)
  216. ])
  217. ];
  218. return h('div', { class: 'flex items-center' }, goodsNodes);
  219. }
  220. },
  221. {
  222. title: '单价(元)',
  223. key: 'price',
  224. width: 100
  225. },
  226. {
  227. title: '数量',
  228. key: 'prodCount',
  229. width: 250,
  230. render: row => {
  231. const nodes = [h('div', { class: 'mr-2' }, row.prodCount)];
  232. if (row.refundSuccessCount) {
  233. nodes.push(h(NTag, { class: 'ml2', type: 'success' }, () => `退款成功:${row.refundSuccessCount}`));
  234. }
  235. if (row.refundIngCount && !row.refundSuccessCount) {
  236. nodes.push(h(NTag, { class: 'ml2', type: 'error' }, () => `售后处理:${row.refundIngCount}`));
  237. }
  238. return h(NFlex, { align: 'center' }, () => nodes);
  239. }
  240. },
  241. {
  242. title: '小计/元',
  243. key: 'productTotalAmount',
  244. width: 100
  245. }
  246. ];
  247. export const orderDJKColumns: NaiveUI.TableColumn<Api.delivery.OrderItemElement>[] = [
  248. {
  249. title: '商品',
  250. key: 'goods',
  251. width: 300,
  252. render: row => {
  253. const goodsNodes = [
  254. h(NImage, { src: row.goodsImg, width: 80, height: 80 }),
  255. h('div', { class: 'ml-2 ' }, [
  256. h('div', { class: 'text-15px font-semibold' }, row.skuName),
  257. h('div', { class: 'text-gray' }, `规格:${row.spec || '--'}`)
  258. ])
  259. ];
  260. return h('div', { class: 'flex items-center' }, goodsNodes);
  261. }
  262. },
  263. {
  264. title: '单价(元)',
  265. key: 'price',
  266. width: 100
  267. },
  268. {
  269. title: '数量',
  270. key: 'goodsNum',
  271. width: 250,
  272. render: row => {
  273. const nodes = [h('div', { class: 'mr-2' }, row.goodsNum)];
  274. if (row.refundSuccessCount) {
  275. nodes.push(h(NTag, { class: 'ml2', type: 'success' }, () => `退款成功:${row.refundSuccessCount}`));
  276. }
  277. if (row.refundIngCount && !row.refundSuccessCount) {
  278. nodes.push(h(NTag, { class: 'ml2', type: 'error' }, () => `售后处理:${row.refundIngCount}`));
  279. }
  280. return h(NFlex, { align: 'center' }, () => nodes);
  281. }
  282. },
  283. {
  284. title: '小计/元',
  285. key: 'productTotalAmount',
  286. width: 100,
  287. render: (row: any) => {
  288. return h('div', {}, (row.goodsNum * 1000 * (row.price * 1000)) / 1000);
  289. }
  290. }
  291. ];
  292. export const orderDJKLogColumns: NaiveUI.TableColumn<Api.delivery.OrderItemElement>[] = [
  293. {
  294. title: '时间',
  295. key: 'createTime'
  296. },
  297. {
  298. title: '操作',
  299. key: 'operation'
  300. },
  301. {
  302. title: '操作员',
  303. key: 'operator'
  304. },
  305. {
  306. title: '备注',
  307. key: 'remark'
  308. }
  309. ];
  310. export const deliveryInfo: FormSchema[] = [
  311. {
  312. label: '配送方式',
  313. component: 'NGradientText',
  314. field: 'dvyMethod',
  315. render() {
  316. return h('div', {}, '快递');
  317. }
  318. },
  319. {
  320. label: '收货人姓名',
  321. component: 'NGradientText',
  322. field: 'receiver',
  323. render({ model, field }) {
  324. return h('div', {}, model[field]);
  325. }
  326. },
  327. {
  328. label: '收货人手机号',
  329. component: 'NInput',
  330. field: 'mobile',
  331. render({ model, field }) {
  332. return h('div', {}, model[field]);
  333. }
  334. },
  335. {
  336. label: '收货地址',
  337. component: 'NInput',
  338. field: 'address',
  339. render({ model, field }) {
  340. return h('div', {}, model[field]);
  341. }
  342. }
  343. ];
  344. /**
  345. * 0:用户手动停止充电;1:客户归属地运营商平台停止充电;2:BMS停止充电;3:充电机设备故障;4:连接器断开;其它:自定义
  346. */
  347. export const chargeMethod = [
  348. '用户手动停止充电',
  349. '客户归属地运营商平台停止充电',
  350. 'BMS停止充电',
  351. '充电机设备故障',
  352. '连接器断开',
  353. '其它'
  354. ];
  355. export const businessType = {
  356. XSB: '星闪豹',
  357. CD: '充电',
  358. DYY: '电影演出',
  359. DJK: '大健康',
  360. XNSP: '虚拟商品',
  361. JY: '加油',
  362. CZ: '充值',
  363. GQ: '过期',
  364. TKGQ: '退款过期',
  365. TK: '退款'
  366. };