normal-order.ts 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  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. field: 'businessType',
  12. component: 'ApiSelect',
  13. componentProps: {
  14. api: fetchGetDictDataList,
  15. labelFeild: 'name',
  16. valueFeild: 'value',
  17. resultFeild: 'data.list',
  18. params: {
  19. typeCode: 'sys_business_type'
  20. }
  21. }
  22. },
  23. {
  24. label: '门店名称',
  25. component: 'ApiSelect',
  26. field: 'shopId',
  27. componentProps: {
  28. api: fetchGetStoreList,
  29. resultFeild: 'data.list',
  30. labelFeild: 'shopName',
  31. valueFeild: 'shopId'
  32. }
  33. },
  34. // {
  35. // label: '订单类型',
  36. // component: 'NSelect',
  37. // field: 'dvyType',
  38. // componentProps: {
  39. // options: [
  40. // {
  41. // label: '全部',
  42. // value: ''
  43. // },
  44. // {
  45. // label: '快递',
  46. // value: 1
  47. // },
  48. // {
  49. // label: '配送',
  50. // value: 3
  51. // }
  52. // ]
  53. // }
  54. // },
  55. // {
  56. // label: '父订单编号',
  57. // component: 'NInput',
  58. // field: 'parentOrderNumber'
  59. // },
  60. {
  61. label: '订单编号',
  62. component: 'NInput',
  63. field: 'orderNumber'
  64. },
  65. {
  66. label: '收货人姓名',
  67. component: 'NInput',
  68. field: 'consigneeName'
  69. },
  70. {
  71. label: '收货人电话',
  72. component: 'NInput',
  73. field: 'consigneeMobile'
  74. },
  75. // {
  76. // label: '售后状态',
  77. // component: 'NSelect',
  78. // field: 'refundStatus',
  79. // componentProps: {
  80. // options: [
  81. // {
  82. // label: '申请退款',
  83. // value: 1
  84. // },
  85. // {
  86. // label: '退款成功',
  87. // value: 2
  88. // },
  89. // {
  90. // label: '部分退款成功',
  91. // value: 3
  92. // },
  93. // {
  94. // label: '退款失败',
  95. // value: 4
  96. // }
  97. // ]
  98. // }
  99. // },
  100. {
  101. label: '下单时间',
  102. component: 'NDatePicker',
  103. field: 'createTime',
  104. componentProps: {
  105. type: 'datetimerange',
  106. defaultTime: ['00:00:00', '23:59:59']
  107. }
  108. }
  109. // {
  110. // field: 'userAttrType',
  111. // label: '人员属性',
  112. // component: 'dictSelect',
  113. // componentProps: {
  114. // dictCode: 'user_attr_type',
  115. // immediate: true
  116. // },
  117. // show: useAuth().hasAuth('user:attr:type')
  118. // }
  119. ];
  120. export enum orderStatusEnum {
  121. /**
  122. *
  123. * 待支付
  124. */
  125. WAIT_PAY = 0,
  126. /**
  127. * 待发货
  128. */
  129. WAIT_DELIVERY = 1,
  130. /**
  131. * 订单已接单(待拣货)
  132. */
  133. ORDER_ACCEPT = 20,
  134. /**
  135. * 订单待配送(拣货完成/自提类订单为待自提)
  136. */
  137. ORDER_WAIT_DELIVERY = 30,
  138. /**
  139. * 订单配送中
  140. */
  141. ORDER_DELIVERY = 40,
  142. /**
  143. * 订单取消待审核
  144. */
  145. ORDER_CANCEL_WAIT_AUDIT = 50,
  146. /**
  147. * 订单已取消
  148. */
  149. ORDER_CANCEL = 60,
  150. /**
  151. * 订单已送达
  152. */
  153. ORDER_ARRIVE = 70,
  154. /**
  155. * 订单已完成
  156. */
  157. ORDER_COMPLETE = 80
  158. }
  159. /**
  160. * 发货按钮显示状态
  161. */
  162. export const ShippingButton = [
  163. orderStatusEnum.WAIT_DELIVERY,
  164. orderStatusEnum.ORDER_ACCEPT,
  165. orderStatusEnum.ORDER_DELIVERY,
  166. orderStatusEnum.ORDER_WAIT_DELIVERY
  167. ];
  168. /**
  169. * // 0-待支付 1-待发货,20-订单已接单(待拣货),30-订单待配送(拣货完成/自提类订单为待自提),40-订单配送中
  170. // ,50-订单取消待审核,60-订单已取消,70-订单已送达,80-订单已完成
  171. */
  172. export const orderStatus = {
  173. [orderStatusEnum.WAIT_PAY]: '待支付',
  174. [orderStatusEnum.WAIT_DELIVERY]: '待发货',
  175. [orderStatusEnum.ORDER_ACCEPT]: '订单已接单(待拣货)',
  176. [orderStatusEnum.ORDER_WAIT_DELIVERY]: '订单待配送(拣货完成/自提类订单为待自提)',
  177. [orderStatusEnum.ORDER_DELIVERY]: '订单配送中',
  178. [orderStatusEnum.ORDER_CANCEL_WAIT_AUDIT]: '订单取消待审核',
  179. [orderStatusEnum.ORDER_CANCEL]: '订单已取消',
  180. [orderStatusEnum.ORDER_ARRIVE]: '订单已送达',
  181. [orderStatusEnum.ORDER_COMPLETE]: '订单已完成'
  182. };
  183. export enum yppStatusEnum {
  184. /**
  185. *
  186. * 待支付
  187. */
  188. WAIT_PAY = 0,
  189. /**
  190. * 已支付
  191. */
  192. WAIT_DELIVERY = 1,
  193. /**
  194. * 出票成功
  195. */
  196. SUCCESS = 4,
  197. /**
  198. * 出票失败(退款)
  199. */
  200. REFUND_FAIL = 7,
  201. /**
  202. * 超时未支付(取消)
  203. */
  204. TIMEOUT_CANCEL = 8
  205. }
  206. export const yppStatus = {
  207. [yppStatusEnum.WAIT_PAY]: '待支付',
  208. [yppStatusEnum.WAIT_DELIVERY]: '已支付',
  209. [yppStatusEnum.SUCCESS]: '出票成功',
  210. [yppStatusEnum.REFUND_FAIL]: '出票失败(退款)',
  211. [yppStatusEnum.TIMEOUT_CANCEL]: '超时未支付(取消)'
  212. };
  213. /**
  214. // 1:申请退款 2:退款成功 3:部分退款成功 4:退款失败
  215. *
  216. */
  217. export const refundStatus = {
  218. 1: '申请退款',
  219. 2: '退款成功',
  220. 3: '部分退款成功',
  221. 4: '退款失败'
  222. };
  223. /**
  224. *
  225. * 配送方式
  226. */
  227. export const dvyStatus = {
  228. 1: '快递',
  229. 2: '自提',
  230. 3: '即时配送'
  231. };
  232. export const orderColumns: NaiveUI.TableColumn<Api.delivery.OrderItemElement>[] = [
  233. {
  234. title: '商品',
  235. key: 'goods',
  236. width: 300,
  237. render: row => {
  238. const goodsNodes = [
  239. h(NImage, { src: row.pic, width: 80, height: 80 }),
  240. h('div', { class: 'ml-2 ' }, [
  241. h('div', { class: 'text-15px font-semibold' }, row.skuName),
  242. h('div', { class: 'text-gray' }, `规格:${row.spec || '--'}`)
  243. ])
  244. ];
  245. return h('div', { class: 'flex items-center' }, goodsNodes);
  246. }
  247. },
  248. {
  249. title: '单价(元)',
  250. key: 'price',
  251. width: 100
  252. },
  253. {
  254. title: '数量',
  255. key: 'prodCount',
  256. width: 250,
  257. render: row => {
  258. const nodes = [h('div', { class: 'mr-2' }, row.prodCount)];
  259. if (row.refundSuccessCount) {
  260. nodes.push(h(NTag, { class: 'ml2', type: 'success' }, () => `退款成功:${row.refundSuccessCount}`));
  261. }
  262. if (row.refundIngCount && !row.refundSuccessCount) {
  263. nodes.push(h(NTag, { class: 'ml2', type: 'error' }, () => `售后处理:${row.refundIngCount}`));
  264. }
  265. return h(NFlex, { align: 'center' }, () => nodes);
  266. }
  267. },
  268. {
  269. title: '小计/元',
  270. key: 'productTotalAmount',
  271. width: 100
  272. }
  273. ];
  274. export const deliveryInfo: FormSchema[] = [
  275. {
  276. label: '配送方式',
  277. component: 'NGradientText',
  278. field: 'dvyMethod',
  279. render() {
  280. return h('div', {}, '快递');
  281. }
  282. },
  283. {
  284. label: '收货人姓名',
  285. component: 'NGradientText',
  286. field: 'receiver',
  287. render({ model, field }) {
  288. return h('div', {}, model[field]);
  289. }
  290. },
  291. {
  292. label: '收货人手机号',
  293. component: 'NInput',
  294. field: 'mobile',
  295. render({ model, field }) {
  296. return h('div', {}, model[field]);
  297. }
  298. },
  299. {
  300. label: '收货地址',
  301. component: 'NInput',
  302. field: 'address',
  303. render({ model, field }) {
  304. return h('div', {}, model[field]);
  305. }
  306. }
  307. ];