admin.js 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873
  1. // +----------------------------------------------------------------------
  2. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  3. // +----------------------------------------------------------------------
  4. // | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
  5. // +----------------------------------------------------------------------
  6. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  7. // +----------------------------------------------------------------------
  8. // | Author: CRMEB Team <admin@crmeb.com>
  9. // +----------------------------------------------------------------------
  10. import request from "@/utils/request.js";
  11. /**
  12. * 统计数据
  13. */
  14. export function getStatisticsInfo() {
  15. return request.get("admin/order/statistics", {}, {
  16. login: true
  17. });
  18. }
  19. /**
  20. * 订单月统计
  21. */
  22. export function getStatisticsMonth(where) {
  23. return request.get("admin/order/data", where, {
  24. login: true
  25. });
  26. }
  27. /**
  28. * 订单月统计
  29. */
  30. export function getAdminOrderList(where) {
  31. return request.get("admin/order/list", where, {
  32. login: true
  33. });
  34. }
  35. /**
  36. * 门店中心-订单统计
  37. */
  38. export function getStoreOrderList(where) {
  39. return request.get("store/order/list", where, {
  40. login: true
  41. });
  42. }
  43. /**
  44. * 平台-提醒发货
  45. */
  46. export function getDelivery(id) {
  47. return request.get(`admin/order/delivery/remind/${id}`,{
  48. login: true
  49. });
  50. }
  51. /**
  52. * 订单改价
  53. */
  54. export function setAdminOrderPrice(data) {
  55. return request.post("admin/order/price", data, {
  56. login: true
  57. });
  58. }
  59. /**
  60. * 门店中心-订单改价
  61. */
  62. export function setStoreOrderPrice(data) {
  63. return request.post("store/order/price", data, {
  64. login: true
  65. });
  66. }
  67. /**
  68. * 订单备注
  69. */
  70. export function setAdminOrderRemark(data) {
  71. return request.post("admin/order/remark", data, {
  72. login: true
  73. });
  74. }
  75. /**
  76. * 门店-订单备注
  77. */
  78. export function setStoreOrderRemark(data) {
  79. return request.post("admin/order/remark", data, {
  80. login: true
  81. });
  82. }
  83. /**
  84. * 订单备注(退款)
  85. */
  86. export function setAdminRefundRemark(data) {
  87. return request.post("admin/refund_order/remark", data, {
  88. login: true
  89. });
  90. }
  91. /**
  92. * 门店-订单备注(退款)
  93. */
  94. export function setStoreRefundRemark(data) {
  95. return request.post("admin/refund_order/remark", data, {
  96. login: true
  97. });
  98. }
  99. /**
  100. * 订单详情
  101. */
  102. export function getAdminOrderDetail(orderId) {
  103. return request.get("admin/order/detail/" + orderId, {}, {
  104. login: true
  105. });
  106. }
  107. /**
  108. * 门店-订单详情
  109. */
  110. export function getStoreOrderDetail(orderId) {
  111. return request.get("store/order/detail/" + orderId, {}, {
  112. login: true
  113. });
  114. }
  115. /**
  116. * 订单详情(退款)
  117. */
  118. export function getAdminRefundDetail(orderId) {
  119. return request.get("admin/refund_order/detail/" + orderId, {}, {
  120. login: true
  121. });
  122. }
  123. /**
  124. * 门店-订单详情(退款)
  125. */
  126. export function getStoreRefundDetail(orderId) {
  127. return request.get("store/refund_order/detail/" + orderId, {}, {
  128. login: true
  129. });
  130. }
  131. /**
  132. * 订单发货信息获取
  133. */
  134. export function getAdminOrderDelivery(orderId) {
  135. return request.get(
  136. "admin/order/delivery/gain/" + orderId, {}, {
  137. login: true
  138. }
  139. );
  140. }
  141. /**
  142. * 门店中心-订单发货信息获取
  143. */
  144. export function getStoreOrderDelivery(orderId) {
  145. return request.get(
  146. "store/order/delivery/gain/" + orderId, {}, {
  147. login: true
  148. }
  149. );
  150. }
  151. /**
  152. * 订单发货保存
  153. */
  154. export function setAdminOrderDelivery(id, data) {
  155. return request.post("admin/order/delivery/keep/" + id, data, {
  156. login: true
  157. });
  158. }
  159. /**
  160. * 门店-订单发货保存
  161. */
  162. export function setStoreOrderDelivery(id, data) {
  163. return request.post("store/order/delivery/keep/" + id, data, {
  164. login: true
  165. });
  166. }
  167. /**
  168. * 订单统计图
  169. */
  170. export function getStatisticsTime(data) {
  171. return request.get("admin/order/time", data, {
  172. login: true
  173. });
  174. }
  175. /**
  176. * 线下付款订单确认付款
  177. */
  178. export function setOfflinePay(data) {
  179. return request.post("admin/order/offline", data, {
  180. login: true
  181. });
  182. }
  183. /**
  184. * 门店中心-线下付款订单确认付款
  185. */
  186. export function setStoreOfflinePay(data) {
  187. return request.post("store/order/offline", data, {
  188. login: true
  189. });
  190. }
  191. /**
  192. * 订单确认退款
  193. */
  194. export function setOrderRefund(data) {
  195. return request.post("admin/order/refund", data, {
  196. login: true
  197. });
  198. }
  199. /**
  200. * 门店中心 - 订单确认退款
  201. */
  202. export function setStoreOrderRefund(data) {
  203. return request.post("store/order/refund", data, {
  204. login: true
  205. });
  206. }
  207. /**
  208. * 获取快递公司
  209. * @returns {*}
  210. */
  211. export function getLogistics(data) {
  212. return request.get("logistics", data, {
  213. login: false
  214. });
  215. }
  216. /**
  217. * 订单核销
  218. * @returns {*}
  219. */
  220. export function orderVerific(code, auth) {
  221. return request.post("admin/order/order_verific", {
  222. code,
  223. auth,
  224. });
  225. }
  226. /**
  227. * 门店-订单核销
  228. * @returns {*}
  229. */
  230. export function storeOrderVerific(code, auth) {
  231. return request.post("store/order/order_verific", {
  232. code,
  233. auth,
  234. });
  235. }
  236. /**
  237. * 获取物流公司模板
  238. * @returns {*}
  239. */
  240. export function orderExportTemp(data) {
  241. return request.get("admin/order/export_temp", data);
  242. }
  243. /**
  244. * 门店-获取物流公司模板
  245. * @returns {*}
  246. */
  247. export function storeOrderExportTemp(data) {
  248. return request.get("store/order/export_temp", data);
  249. }
  250. /**
  251. * 获取订单打印默认配置
  252. * @returns {*}
  253. */
  254. export function orderDeliveryInfo() {
  255. return request.get("admin/order/delivery_info");
  256. }
  257. /**
  258. * 门店-获取订单打印默认配置
  259. * @returns {*}
  260. */
  261. export function storeOrderDeliveryInfo() {
  262. return request.get("store/order/delivery_info");
  263. }
  264. /**
  265. * 配送员列表
  266. * @returns {*}
  267. */
  268. export function orderOrderDelivery() {
  269. return request.get("admin/order/delivery");
  270. }
  271. /**
  272. * 门店-配送员列表
  273. * @returns {*}
  274. */
  275. export function storeOrderDelivery() {
  276. return request.get("store/order/delivery");
  277. }
  278. // 门店
  279. /**
  280. * 店员用户信息
  281. */
  282. export function userInfo() {
  283. return request.get("store/staff/info");
  284. }
  285. /**
  286. * 工作台-今日销售额统计
  287. */
  288. export function staffStaging(data) {
  289. return request.get("store/staff/staging",data);
  290. }
  291. /**
  292. * 工作台-数据统计
  293. */
  294. export function statisticsMenuApi(data) {
  295. return request.get("store/staff/statistics",data);
  296. }
  297. /**
  298. * 门店中心-订单统计
  299. */
  300. export function orderInfo(data) {
  301. return request.get("store/order/statistics",data);
  302. }
  303. /**
  304. * 门店中心-详细数据列表
  305. */
  306. export function getListApi(data) {
  307. return request.get("store/order/data",data);
  308. }
  309. /**
  310. * 门店中心-数据详情-列表
  311. */
  312. export function getStatisticsListApi(type,data) {
  313. return request.get("store/staff/data/"+type,data);
  314. }
  315. /**
  316. * 配送员-获取用户信息
  317. */
  318. export function deliveryInfo(id) {
  319. return request.get("store/delivery/info");
  320. }
  321. /**
  322. * 配送员-获取配送统计数据
  323. */
  324. export function deliveryStatistics(data) {
  325. return request.get("store/delivery/statistics",data);
  326. }
  327. /**
  328. * 配送员-获取配送统计数据列表
  329. */
  330. export function deliveryList(data) {
  331. return request.get("store/delivery/data",data);
  332. }
  333. /**
  334. * 配送员-获取订单列表数据列表
  335. */
  336. export function deliveryOrderList(data) {
  337. return request.get("store/delivery/order",data);
  338. }
  339. /**
  340. * 门店中心-订单取消、删除
  341. */
  342. export function OrderDel(id) {
  343. return request.delete("store/order/del/"+id);
  344. }
  345. /**
  346. * 门店中心-订单取消、取消
  347. */
  348. export function OrderCancel(id) {
  349. return request.post("store/order/cancel/"+id);
  350. }
  351. /**
  352. * 配送员-扫码核销获取订单信息
  353. */
  354. export function orderWriteoffInfo(type,data) {
  355. return request.get("store/order/writeoff_info/"+type,data);
  356. }
  357. /**
  358. * 代客下单-购物车删除
  359. */
  360. export function adminCartDel(uid,data) {
  361. return request.delete(`admin/order/cart/del/${uid}`,data);
  362. }
  363. /**
  364. * 代客下单-修改购物车数量
  365. */
  366. export function adminCartNum(uid,data) {
  367. return request.post(`admin/order/cart/num/${uid}`,data);
  368. }
  369. /**
  370. * 配送员-核销订单获取商品信息 (门店平台一个接口)
  371. */
  372. export function orderCartInfo(data) {
  373. return request.post("store/order/cart_info",data);
  374. }
  375. /**
  376. * 配送员-订单核销 (门店平台一个接口)
  377. */
  378. export function orderWriteoff(data) {
  379. return request.post("store/order/writeoff",data);
  380. }
  381. /**
  382. * 统计管理-获取订单可拆分商品列表
  383. */
  384. export function orderSplitInfo(id) {
  385. return request.get("admin/order/split_cart_info/"+id);
  386. }
  387. /**
  388. * 门店-统计管理-获取订单可拆分商品列表
  389. */
  390. export function storeOrderSplitInfo(id) {
  391. return request.get("store/order/split_cart_info/"+id);
  392. }
  393. /**
  394. * 统计管理-提交
  395. */
  396. export function orderSplitDelivery(id,data) {
  397. return request.put("admin/order/split_delivery/"+id,data);
  398. }
  399. /**
  400. * 门店-统计管理-提交
  401. */
  402. export function storeOrderSplitDelivery(id,data) {
  403. return request.put("store/order/split_delivery/"+id,data);
  404. }
  405. /**
  406. * 统计管理-退货退款
  407. */
  408. export function orderRefundAgree(id) {
  409. return request.post("admin/order/refund_agree/"+id);
  410. }
  411. /**
  412. * 门店中心-退货退款
  413. */
  414. export function storeOrderRefundAgree(id) {
  415. return request.post("store/order/refund_agree/"+id);
  416. }
  417. /**
  418. * 门店中心-获取订单可拆分商品列表
  419. */
  420. export function storeSplitInfo(id) {
  421. return request.get("store/order/split_cart_info/"+id);
  422. }
  423. /**
  424. * 门店中心-提交
  425. */
  426. export function storeSplitDelivery(id,data) {
  427. return request.put("store/order/split_delivery/"+id,data);
  428. }
  429. /**
  430. * 门店中心-退货退款
  431. */
  432. export function storeRefundAgree(id) {
  433. return request.post("store/order/refund_agree/"+id);
  434. }
  435. /**
  436. * 平台-退款列表
  437. */
  438. export function adminRefundList(data) {
  439. return request.get("admin/refund_order/list",data);
  440. }
  441. /**
  442. * 门店中心-退款列表
  443. */
  444. export function storeRefundList(data) {
  445. return request.get("store/refund_order/list",data);
  446. }
  447. /**
  448. * 平台-商品列表
  449. */
  450. export function adminProductList(data) {
  451. return request.get("admin/product/admin_list",data);
  452. }
  453. /**
  454. * 门店-商品列表
  455. */
  456. export function storeProductList(data) {
  457. return request.get("store/product/admin_list",data);
  458. }
  459. /**
  460. * 平台-商品列表-上下架
  461. */
  462. export function productSetShow(data) {
  463. return request.post('admin/product/set_show',data);
  464. }
  465. /**
  466. * 门店-商品列表-上下架
  467. */
  468. export function storeProductSetShow(data) {
  469. return request.post('store/product/set_show',data);
  470. }
  471. /**
  472. * 平台-商品列表-标签
  473. */
  474. export function getProductLabel() {
  475. return request.get('admin/product/product_label');
  476. }
  477. /**
  478. * 门店-商品列表-标签
  479. */
  480. export function storeProductLabel() {
  481. return request.get('store/product/product_label');
  482. }
  483. /**
  484. * 平台-商品列表-提交标签/分类
  485. */
  486. export function postBatchProcess(data) {
  487. return request.post('admin/product/batch_process',data);
  488. }
  489. /**
  490. * 门店-商品列表-提交标签/分类
  491. */
  492. export function storeBatchProcess(data) {
  493. return request.post('store/product/batch_process',data);
  494. }
  495. /**
  496. * 平台-商品列表-修改库存价格
  497. */
  498. export function postUpdateAttrs(id,data) {
  499. return request.post(`admin/product/update_attrs/${id}`,data);
  500. }
  501. /**
  502. * 门店-商品列表-修改库存价格
  503. */
  504. export function postStoreUpdateAttrs(id,data) {
  505. return request.post(`store/product/update_attrs/${id}`,data);
  506. }
  507. /**
  508. * 平台-商品列表-获取规格
  509. */
  510. export function getGetAttrs(id) {
  511. return request.get(`admin/product/get_attr/${id}`);
  512. }
  513. /**
  514. * 门店-商品列表-获取规格
  515. */
  516. export function getStoreGetAttrs(id) {
  517. return request.get(`store/product/get_attr/${id}`);
  518. }
  519. /**
  520. * 平台-商品列表-获取分类
  521. */
  522. export function getCategory() {
  523. return request.get(`admin/product/category`);
  524. }
  525. /**
  526. * 门店-商品列表-获取分类
  527. */
  528. export function getStoreCategory() {
  529. return request.get(`store/product/category`);
  530. }
  531. /**
  532. * 平台-用户列表
  533. */
  534. export function getUserList(data) {
  535. return request.get(`admin/user/list`,data);
  536. }
  537. /**
  538. * 门店-用户列表
  539. */
  540. export function getStoreUserList(data) {
  541. return request.get(`store/user/list`,data);
  542. }
  543. /**
  544. * 平台-修改余额、积分
  545. */
  546. export function postUserUpdateOther(uid,data) {
  547. return request.post(`admin/user/update_other/${uid}`,data);
  548. }
  549. /**
  550. * 平台-分组列表
  551. */
  552. export function getGroupList() {
  553. return request.get(`admin/user/group/list`);
  554. }
  555. /**
  556. * 平台-门店列表
  557. */
  558. export function getStoreGroupList() {
  559. return request.get(`store/user/group/list`);
  560. }
  561. /**
  562. * 平台-修改用户信息
  563. */
  564. export function postUserUpdate(data) {
  565. return request.post(`admin/user/update`,data);
  566. }
  567. /**
  568. * 平台-优惠券
  569. */
  570. export function getUserCoupon(data) {
  571. return request.get(`admin/user/coupon/grant`,data);
  572. }
  573. /**
  574. * 平台-用户标签
  575. */
  576. export function getUserLabel() {
  577. return request.get(`admin/user/label/0`);
  578. }
  579. /**
  580. * 门店-用户标签
  581. */
  582. export function getStoreUserLabel() {
  583. return request.get(`store/user/label/0`);
  584. }
  585. /**
  586. * 平台-等级列表
  587. */
  588. export function getLevelList() {
  589. return request.get(`admin/user/level/list`);
  590. }
  591. /**
  592. * 门店-等级列表
  593. */
  594. export function getStoreLevelList() {
  595. return request.get(`store/user/level/list`);
  596. }
  597. /**
  598. * 平台-用户详情
  599. */
  600. export function getUserInfo(uid) {
  601. return request.get(`admin/user/info/${uid}`);
  602. }
  603. /**
  604. * 门店-用户详情
  605. */
  606. export function getStoreUserInfo(uid) {
  607. return request.get(`store/user/info/${uid}`);
  608. }
  609. /**
  610. * 代客下单-用户列表
  611. */
  612. export function adminUserList(data) {
  613. return request.get("admin/user/list",data);
  614. }
  615. /**
  616. * 代客下单-商品分类
  617. */
  618. export function adminCategory() {
  619. return request.get("admin/product/category");
  620. }
  621. /**
  622. * 代客下单-商品列表
  623. */
  624. export function adminProList(data) {
  625. return request.get("admin/product/list",data);
  626. }
  627. /**
  628. * 代客下单-加入购物车
  629. */
  630. export function adminCartAdd(uid,data) {
  631. return request.post(`admin/order/cart/add/${uid}`,data);
  632. }
  633. /**
  634. * 代客下单-购物车列表
  635. */
  636. export function adminCartList(uid,data) {
  637. return request.get(`admin/order/cart/${uid}`,data);
  638. }
  639. /**
  640. * 代客下单-用户地址列表
  641. */
  642. export function adminUserAddressList(uid,data) {
  643. return request.get(`admin/user/address/list/${uid}`,data);
  644. }
  645. /**
  646. * 代客下单-订单确认
  647. */
  648. export function orderConfirm(uid,data) {
  649. return request.post(`admin/order/confirm/${uid}`,data);
  650. }
  651. /**
  652. * 代客下单-订单计算
  653. */
  654. export function postOrderComputed(key,uid,data) {
  655. return request.post(`admin/order/computed/${key}/${uid}`,data);
  656. }
  657. /**
  658. * 代客下单-获取用户可使用优惠券列表
  659. */
  660. export function getCouponsOrderPrice(uid,data) {
  661. return request.get(`admin/order/coupons/${uid}`,data);
  662. }
  663. /**
  664. * 代客下单-订单查创建
  665. */
  666. export function orderCreate(key,uid,data) {
  667. return request.post(`admin/order/create/${key}/${uid}`,data);
  668. }
  669. /**
  670. * 代客下单-订单收银台
  671. */
  672. export function getCashierApi(uid,data) {
  673. return request.post(`admin/order/pay/${uid}`,data);
  674. }
  675. /**
  676. * 代客下单-轮询获取订单支付状态
  677. */
  678. export function getPayStatusApi(data) {
  679. return request.get(`admin/order/pay/status`,data);
  680. }
  681. /**
  682. * 代客下单-下单订单记录
  683. */
  684. export function adminOrderRecordList(data) {
  685. return request.get(`admin/order/place/list`,data);
  686. }
  687. /**
  688. * 工作台折线图数据统计
  689. */
  690. export function getOrderChart(data) {
  691. return request.get('admin/order/time/chart', data);
  692. }
  693. /**
  694. * 门店工作台折线图数据统计
  695. */
  696. export function getStoreChart(type,data) {
  697. return request.get(`store/staff/chart/${type}`, data);
  698. }
  699. /**
  700. * 工作台待发货等数据
  701. */
  702. export function getOrderStaging() {
  703. return request.get('admin/order/staging');
  704. }
  705. /**
  706. * 工作台今日订单数等数据
  707. */
  708. export function getOrderTime(data) {
  709. return request.get('admin/order/time', data);
  710. }
  711. /**
  712. * 拆单退款
  713. * @param {Object} id
  714. * @param {Object} data
  715. */
  716. export function openRefund(id, data) {
  717. return request.post(`admin/order/open/refund/${id}`,data);
  718. }
  719. /**
  720. * 核销订单商品列表
  721. * @param {Object} data
  722. */
  723. export function offOrderInfo(data) {
  724. return request.post(`admin/order/info`,data);
  725. }
  726. /**
  727. * 核销订单
  728. * @param {Object} order_id
  729. * @param {Object} data
  730. */
  731. export function orderWirteOff(order_id, data) {
  732. return request.post(`admin/order/wirteoff/${order_id}`,data);
  733. }
  734. /**
  735. * 订单核销记录
  736. * @param {Object} id
  737. * @param {Object} data
  738. */
  739. export function orderWirteOffRecords(id, data) {
  740. return request.post(`admin/order/writeoff/records/${id}`, data);
  741. }
  742. /**
  743. * 门店-订单核销记录
  744. * @param {Object} id
  745. * @param {Object} data
  746. */
  747. export function storeWirteOffRecords(id, data) {
  748. return request.post(`store/order/writeoff/records/${id}`, data);
  749. }
  750. /**
  751. * 确认订单详情(是否显示快递配送)
  752. * @param {Object} data
  753. */
  754. export function check_shipping(data) {
  755. return request.post(`admin/order/check_shipping`, data);
  756. }