Delivery.ts 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. import HttpAxios from '@/utils/axios'
  2. const base = import.meta.env.VITE_API_HOST
  3. const baseUrl = `${base}/main_new_version.php`
  4. /**
  5. * Select Country
  6. */
  7. export const getDeliveryCountry = (params: any, config: any) => {
  8. return HttpAxios.post(
  9. `${baseUrl}`,
  10. {
  11. action: 'destination_delivery_load',
  12. operate: 'country',
  13. ...params
  14. },
  15. config
  16. )
  17. }
  18. /**
  19. * 选择了国家后的station list
  20. */
  21. export const getDeliveryStation = (params: any, config: any) => {
  22. return HttpAxios.post(
  23. `${baseUrl}`,
  24. {
  25. action: 'destination_delivery_load',
  26. operate: 'station',
  27. ...params
  28. },
  29. config
  30. )
  31. }
  32. /**
  33. * KLN employee account List
  34. */
  35. export const getKLNEmployeeList = (params: any, config: any) => {
  36. return HttpAxios.post(
  37. `${baseUrl}`,
  38. {
  39. action: 'destination_delivery_load',
  40. operate: 'employee_account',
  41. ...params
  42. },
  43. config
  44. )
  45. }
  46. /**
  47. * Port List
  48. */
  49. export const getPortList = (params: any, config: any) => {
  50. return HttpAxios.post(
  51. `${baseUrl}`,
  52. {
  53. action: 'destination_delivery_load',
  54. operate: 'ports',
  55. ...params
  56. },
  57. config
  58. )
  59. }
  60. /**
  61. * Carrier List
  62. */
  63. export const getCarrierList = (params: any, config: any) => {
  64. return HttpAxios.post(
  65. `${baseUrl}`,
  66. {
  67. action: 'destination_delivery_load',
  68. operate: 'carrier',
  69. ...params
  70. },
  71. config
  72. )
  73. }
  74. /**
  75. * Save rule
  76. */
  77. export const handelSaveRule = (params: any, config: any) => {
  78. return HttpAxios.post(
  79. `${baseUrl}`,
  80. {
  81. action: 'destination_delivery_config',
  82. operate: 'save',
  83. ...params
  84. },
  85. config
  86. )
  87. }
  88. /**
  89. * Configuration table list
  90. */
  91. export const getConfigurationList = (params: any, config: any) => {
  92. return HttpAxios.post(
  93. `${baseUrl}`,
  94. {
  95. action: 'destination_delivery_config',
  96. operate: 'search',
  97. ...params
  98. },
  99. config
  100. )
  101. }
  102. /**
  103. * delete Configuration table list
  104. */
  105. export const deleteConfigurationList = (params: any, config: any) => {
  106. return HttpAxios.post(
  107. `${baseUrl}`,
  108. {
  109. action: 'destination_delivery_config',
  110. operate: 'delete',
  111. ...params
  112. },
  113. config
  114. )
  115. }
  116. /**
  117. * Create New Rule页面初始化
  118. */
  119. export const InitCreateRule = (params: any, config: any) => {
  120. return HttpAxios.post(
  121. `${baseUrl}`,
  122. {
  123. action: 'destination_delivery_config',
  124. operate: 'add',
  125. ...params
  126. },
  127. config
  128. )
  129. }
  130. /**
  131. * Create New Booking页面初始化
  132. */
  133. export const InitCreateBooking = (params: any, config: any) => {
  134. return HttpAxios.post(
  135. `${baseUrl}`,
  136. {
  137. action: 'destination_delivery_booking',
  138. operate: 'add',
  139. ...params
  140. },
  141. config
  142. )
  143. }
  144. /**
  145. * Create New Booking表格column
  146. */
  147. export const BookingTableColumn = (params: any, config: any) => {
  148. return HttpAxios.post(
  149. `${baseUrl}`,
  150. {
  151. action: 'destination_delivery_booking',
  152. operate: 'destination_delivery_shipment_search',
  153. ...params
  154. },
  155. config
  156. )
  157. }
  158. /**
  159. * Create New Booking查询表格data
  160. */
  161. export const BookingTableSearch = (params: any, config: any) => {
  162. return HttpAxios.post(
  163. `${baseUrl}`,
  164. {
  165. action: 'destination_delivery_booking',
  166. operate: 'search_shipment',
  167. ...params
  168. },
  169. config
  170. )
  171. }
  172. /**
  173. * 根据选择的list获取address book
  174. */
  175. export const getAddressBookList = (params: any, config: any) => {
  176. return HttpAxios.post(
  177. `${baseUrl}`,
  178. {
  179. action: 'destination_delivery_load',
  180. operate: 'manage_address',
  181. ...params
  182. },
  183. config
  184. )
  185. }
  186. /**
  187. * 保存booking
  188. */
  189. export const SaveBookingList = (params: any, config: any) => {
  190. return HttpAxios.post(
  191. `${baseUrl}`,
  192. {
  193. action: 'destination_delivery_booking',
  194. operate: 'save',
  195. ...params
  196. },
  197. config
  198. )
  199. }
  200. /**
  201. * 获取delivery booking表格数据
  202. */
  203. export const getDeliveryBookingTableColumn = (params: any, config: any) => {
  204. return HttpAxios.post(
  205. `${baseUrl}`,
  206. {
  207. action: 'destination_delivery_booking',
  208. operate: 'destination_delivery_search',
  209. ...params
  210. },
  211. config
  212. )
  213. }
  214. /**
  215. * 获取delivery booking表格数据
  216. */
  217. export const getDeliveryBookingTableData = (params: any, config: any) => {
  218. return HttpAxios.post(
  219. `${baseUrl}`,
  220. {
  221. action: 'destination_delivery_booking',
  222. operate: 'search',
  223. ...params
  224. },
  225. config
  226. )
  227. }
  228. /**
  229. * 获取delivery booking dialog详情
  230. */
  231. export const getDeliveryBookingDialogData = (params: any, config: any) => {
  232. return HttpAxios.post(
  233. `${baseUrl}`,
  234. {
  235. action: 'destination_delivery_booking',
  236. operate: 'view_detail',
  237. ...params
  238. },
  239. config
  240. )
  241. }
  242. /**
  243. * delivery_booking 邮件留言Save
  244. */
  245. export const saveDliveryBookingEmail = (params: any, config: any) => {
  246. return HttpAxios.post(
  247. `${baseUrl}`,
  248. {
  249. action: 'destination_delivery_booking',
  250. operate: 'email_message_board',
  251. ...params
  252. },
  253. config
  254. )
  255. }
  256. /**
  257. * 审核delivery_booking
  258. */
  259. export const reviewDliveryBooking = (params: any, config: any) => {
  260. return HttpAxios.post(
  261. `${baseUrl}`,
  262. {
  263. action: 'destination_delivery_booking',
  264. operate: 'review',
  265. ...params
  266. },
  267. config
  268. )
  269. }
  270. /**
  271. * Address List自动补全
  272. */
  273. export const getAddressCountryCityData = (params: any, config: any) => {
  274. return HttpAxios.post(
  275. `${baseUrl}`,
  276. {
  277. action: 'destination_delivery_load',
  278. operate: 'country_city_load',
  279. ...params
  280. },
  281. config
  282. )
  283. }