admin.js 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152
  1. import request from '@/utils/request'
  2. // 用户管理
  3. export function getUserList(params) {
  4. return request({
  5. url: '/api/admin/users',
  6. method: 'post',
  7. data: params
  8. })
  9. }
  10. export function getUserDetail(id) {
  11. return request({
  12. url: `/api/admin/users/${id}`,
  13. method: 'post'
  14. })
  15. }
  16. export function updateUser(id, data) {
  17. return request({
  18. url: `/api/admin/users/${id}/update`,
  19. method: 'post',
  20. data
  21. })
  22. }
  23. export function deleteUser(id) {
  24. return request({
  25. url: `/api/admin/users/${id}/delete`,
  26. method: 'post'
  27. })
  28. }
  29. export function resetUserPassword(id, password) {
  30. return request({
  31. url: `/api/admin/users/${id}/reset-password`,
  32. method: 'post',
  33. data: { password }
  34. })
  35. }
  36. // ========== 商品配送与履约 API ==========
  37. export function vendorConfirmOrder(orderNo) {
  38. return request({
  39. url: '/api/product/order/vendor-confirm',
  40. method: 'post',
  41. data: { orderNo }
  42. })
  43. }
  44. // ===== 线上服务配置(批量接口,路由 /api/product/delivery-config/*)=====
  45. export function listDeliveryServicePersons(productId) {
  46. return request({
  47. url: '/api/product/delivery-config/service-person/list',
  48. method: 'post',
  49. data: { productId }
  50. })
  51. }
  52. export function saveDeliveryServicePersons(productId, persons) {
  53. return request({
  54. url: '/api/product/delivery-config/service-person/save',
  55. method: 'post',
  56. data: { productId, persons }
  57. })
  58. }
  59. export function listDeliveryOnlineSlots(productId) {
  60. return request({
  61. url: '/api/product/delivery-config/online-slot/list',
  62. method: 'post',
  63. data: { productId }
  64. })
  65. }
  66. export function saveDeliveryOnlineSlots(productId, slots) {
  67. return request({
  68. url: '/api/product/delivery-config/online-slot/save',
  69. method: 'post',
  70. data: { productId, slots }
  71. })
  72. }
  73. // 家庭管理
  74. export function getFamilyList(params) {
  75. return request({
  76. url: '/api/admin/families',
  77. method: 'post',
  78. data: params
  79. })
  80. }
  81. export function getFamilyDetail(id) {
  82. return request({
  83. url: `/api/admin/families/${id}`,
  84. method: 'post'
  85. })
  86. }
  87. export function updateFamily(id, data) {
  88. return request({
  89. url: `/api/admin/families/${id}/update`,
  90. method: 'post',
  91. data
  92. })
  93. }
  94. export function deleteFamily(id) {
  95. return request({
  96. url: `/api/admin/families/${id}/delete`,
  97. method: 'post'
  98. })
  99. }
  100. export function getFamilyMembers(id) {
  101. return request({
  102. url: `/api/admin/families/${id}/members`,
  103. method: 'post'
  104. })
  105. }
  106. export function setMemberAdminRole(familyId, memberId, isAdmin) {
  107. return request({
  108. url: `/api/admin/families/${familyId}/members/set-admin`,
  109. method: 'post',
  110. data: { memberId, isAdmin }
  111. })
  112. }
  113. // 任务模板管理
  114. export function getTaskTemplateList(params) {
  115. return request({
  116. url: '/api/admin/task-templates',
  117. method: 'post',
  118. data: params
  119. })
  120. }
  121. export function createTaskTemplate(data) {
  122. return request({
  123. url: '/api/admin/task-templates/create',
  124. method: 'post',
  125. data
  126. })
  127. }
  128. export function updateTaskTemplate(id, data) {
  129. return request({
  130. url: `/api/admin/task-templates/${id}/update`,
  131. method: 'post',
  132. data
  133. })
  134. }
  135. export function deleteTaskTemplate(id) {
  136. return request({
  137. url: `/api/admin/task-templates/${id}/delete`,
  138. method: 'post'
  139. })
  140. }
  141. // 孩子管理
  142. export function getChildrenList(params) {
  143. return request({
  144. url: '/api/admin/children',
  145. method: 'post',
  146. data: params
  147. })
  148. }
  149. export function getChildDetail(id) {
  150. return request({
  151. url: `/api/admin/children/${id}`,
  152. method: 'post'
  153. })
  154. }
  155. export function updateChild(id, data) {
  156. return request({
  157. url: `/api/admin/children/${id}/update`,
  158. method: 'post',
  159. data
  160. })
  161. }
  162. export function deleteChild(id) {
  163. return request({
  164. url: `/api/admin/children/${id}/delete`,
  165. method: 'post'
  166. })
  167. }
  168. export function adjustChildPoints(id, data) {
  169. return request({
  170. url: `/api/admin/children/${id}/adjust-points`,
  171. method: 'post',
  172. data
  173. })
  174. }
  175. // 任务管理
  176. export function getTasksList(params) {
  177. return request({
  178. url: '/api/admin/tasks',
  179. method: 'post',
  180. data: params
  181. })
  182. }
  183. export function getTaskStats() {
  184. return request({
  185. url: '/api/admin/tasks/stats',
  186. method: 'post'
  187. })
  188. }
  189. export function getPendingReviewTasks(params) {
  190. return request({
  191. url: '/api/admin/tasks/pending-review',
  192. method: 'post',
  193. data: params || {}
  194. })
  195. }
  196. export function reviewAdminTask(taskId, data) {
  197. return request({
  198. url: `/api/admin/tasks/${taskId}/review`,
  199. method: 'post',
  200. data
  201. })
  202. }
  203. // 奖励管理
  204. export function getRewardsList(params) {
  205. return request({
  206. url: '/api/admin/rewards',
  207. method: 'post',
  208. data: params
  209. })
  210. }
  211. export function getRewardTemplates() {
  212. return request({
  213. url: '/api/admin/rewards/templates',
  214. method: 'post'
  215. })
  216. }
  217. export function createRewardTemplate(data) {
  218. return request({
  219. url: '/api/admin/rewards/create',
  220. method: 'post',
  221. data
  222. })
  223. }
  224. export function deleteRewardTemplate(id) {
  225. return request({
  226. url: `/api/admin/rewards/templates/${id}/delete`,
  227. method: 'post'
  228. })
  229. }
  230. export function updateRewardTemplate(id, data) {
  231. return request({
  232. url: `/api/admin/rewards/templates/${id}/update`,
  233. method: 'post',
  234. data
  235. })
  236. }
  237. export function approveReward(id, data) {
  238. return request({
  239. url: `/api/admin/rewards/${id}/approve`,
  240. method: 'post',
  241. data
  242. })
  243. }
  244. // 积分管理
  245. export function getPointsLogs(params) {
  246. return request({
  247. url: '/api/admin/points/logs',
  248. method: 'post',
  249. data: params
  250. })
  251. }
  252. export function getPointsStats() {
  253. return request({
  254. url: '/api/admin/points/stats',
  255. method: 'post'
  256. })
  257. }
  258. // ========== 心愿管理 API(新版) ==========
  259. // 获取心愿列表
  260. export function getWishesList(params) {
  261. return request({
  262. url: '/api/wishes/list',
  263. method: 'post',
  264. data: params
  265. })
  266. }
  267. // 获取待处理列表(家长)
  268. export function getPendingWishes(familyId) {
  269. return request({
  270. url: '/api/wishes/pending',
  271. method: 'post',
  272. data: { familyId }
  273. })
  274. }
  275. // 获取心愿详情
  276. export function getWishDetail(id) {
  277. return request({
  278. url: `/api/wishes/${id}`,
  279. method: 'post'
  280. })
  281. }
  282. // 家长定价
  283. export function setWishPrice(id, pointsRequired) {
  284. return request({
  285. url: `/api/wishes/${id}/set-price`,
  286. method: 'post',
  287. data: { pointsRequired }
  288. })
  289. }
  290. // 家长拒绝心愿
  291. export function rejectWish(id, reason) {
  292. return request({
  293. url: `/api/wishes/${id}/reject`,
  294. method: 'post',
  295. data: { reason }
  296. })
  297. }
  298. // 家长审批兑换
  299. export function approveWishExchange(id, approved, reason) {
  300. return request({
  301. url: `/api/wishes/${id}/approve-exchange`,
  302. method: 'post',
  303. data: { approved, reason }
  304. })
  305. }
  306. // 家长标记已购买
  307. export function markWishFulfilled(id) {
  308. return request({
  309. url: `/api/wishes/${id}/fulfill`,
  310. method: 'post'
  311. })
  312. }
  313. // 取消心愿
  314. export function deleteWish(id, reason) {
  315. return request({
  316. url: `/api/wishes/${id}/cancel`,
  317. method: 'post',
  318. data: { reason }
  319. })
  320. }
  321. // ========== 成长规划师相关 API ==========
  322. // 获取成长规划师关联的家庭列表
  323. export function getTeacherFamilies() {
  324. return request({
  325. url: '/api/admin/teacher/families',
  326. method: 'post'
  327. })
  328. }
  329. // 获取成长规划师发布的任务模板
  330. export function getTeacherTaskTemplates() {
  331. return request({
  332. url: '/api/admin/teacher/task-templates',
  333. method: 'post'
  334. })
  335. }
  336. // 成长规划师创建任务模板
  337. export function createTeacherTaskTemplate(data) {
  338. return request({
  339. url: '/api/admin/teacher/task-templates/create',
  340. method: 'post',
  341. data
  342. })
  343. }
  344. // 成长规划师删除任务模板
  345. export function deleteTeacherTaskTemplate(id) {
  346. return request({
  347. url: `/api/admin/teacher/task-templates/${id}/delete`,
  348. method: 'post'
  349. })
  350. }
  351. // 获取指定家庭的任务列表
  352. export function getTeacherFamilyTasks(familyId, params) {
  353. return request({
  354. url: `/api/admin/teacher/families/${familyId}/tasks`,
  355. method: 'post',
  356. data: params
  357. })
  358. }
  359. // 获取指定家庭的奖励列表
  360. export function getTeacherFamilyRewards(familyId, params) {
  361. return request({
  362. url: `/api/admin/teacher/families/${familyId}/rewards`,
  363. method: 'post',
  364. data: params
  365. })
  366. }
  367. // ========== 成长规划师审核 API ==========
  368. // 获取成长规划师审核列表
  369. export function getGuideApplications(params) {
  370. return request({
  371. url: '/api/admin/guide/applications',
  372. method: 'post',
  373. data: params
  374. })
  375. }
  376. // 通过成长规划师审核
  377. export function approveGuide(userId) {
  378. return request({
  379. url: `/api/admin/guide/approve/${userId}`,
  380. method: 'post'
  381. })
  382. }
  383. // 拒绝成长规划师审核
  384. export function rejectGuide(userId, reason) {
  385. return request({
  386. url: `/api/admin/guide/reject/${userId}`,
  387. method: 'post',
  388. data: { reason }
  389. })
  390. }
  391. // 获取营养师审核列表
  392. export function getNutritionistApplications(params) {
  393. return request({
  394. url: '/api/admin/nutritionist/applications',
  395. method: 'post',
  396. data: params
  397. })
  398. }
  399. // 通过营养师审核
  400. export function approveNutritionist(userId) {
  401. return request({
  402. url: `/api/admin/nutritionist/approve/${userId}`,
  403. method: 'post'
  404. })
  405. }
  406. // 拒绝营养师审核
  407. export function rejectNutritionist(userId, reason) {
  408. return request({
  409. url: `/api/admin/nutritionist/reject/${userId}`,
  410. method: 'post',
  411. data: { reason }
  412. })
  413. }
  414. // 获取待审核营养师数量
  415. export function getPendingNutritionistCount() {
  416. return request({
  417. url: '/api/admin/nutritionist/pending-count',
  418. method: 'post'
  419. })
  420. }
  421. // 获取待审核成长规划师数量
  422. export function getPendingGuideCount() {
  423. return request({
  424. url: '/api/admin/guide/pending-count',
  425. method: 'post'
  426. })
  427. }
  428. export function getPendingPackageCount() {
  429. return request({
  430. url: '/api/admin/package/pending-count',
  431. method: 'post'
  432. })
  433. }
  434. // 管理员个人信息
  435. export function updateAdminInfo(data) {
  436. return request({
  437. url: '/api/admin-auth/update-info',
  438. method: 'post',
  439. data
  440. })
  441. }
  442. // ========== 管理后台仪表盘汇总 API ==========
  443. export function getDashboardStats() {
  444. return request({
  445. url: '/api/stats/dashboard',
  446. method: 'post'
  447. })
  448. }
  449. export function getDashboardOverview() {
  450. return request({
  451. url: '/api/stats/overview',
  452. method: 'post'
  453. })
  454. }
  455. export function getRevenueStats() {
  456. return request({
  457. url: '/api/stats/revenue',
  458. method: 'post'
  459. })
  460. }
  461. export function getMembershipStats() {
  462. return request({
  463. url: '/api/stats/membership',
  464. method: 'post'
  465. })
  466. }
  467. export function getTrendStats() {
  468. return request({
  469. url: '/api/stats/trend',
  470. method: 'post',
  471. data: {}
  472. })
  473. }
  474. // ========== 商品管理 API ==========
  475. export function getProductList(params) {
  476. return request({
  477. url: '/api/admin/product/list',
  478. method: 'post',
  479. data: params
  480. })
  481. }
  482. export function reviewProduct(productId, data) {
  483. return request({
  484. url: '/api/admin/product/review',
  485. method: 'post',
  486. data: { productId, ...data }
  487. })
  488. }
  489. export function shelveProduct(productId, data) {
  490. return request({
  491. url: '/api/admin/product/shelve',
  492. method: 'post',
  493. data: { productId, ...data }
  494. })
  495. }
  496. export function getProduct(id) {
  497. return request({
  498. url: '/api/admin/product/detail',
  499. method: 'post',
  500. data: { productId: id }
  501. })
  502. }
  503. export function createProduct(data) {
  504. return request({
  505. url: '/api/admin/product/create',
  506. method: 'post',
  507. data
  508. })
  509. }
  510. export function updateProduct(data) {
  511. return request({
  512. url: '/api/admin/product/update',
  513. method: 'post',
  514. data
  515. })
  516. }
  517. export function deleteProduct(id) {
  518. return request({
  519. url: '/api/admin/product/delete',
  520. method: 'post',
  521. data: { productId: id }
  522. })
  523. }
  524. export function copyProduct(id) {
  525. return request({
  526. url: '/api/admin/product/copy',
  527. method: 'post',
  528. data: { productId: id }
  529. })
  530. }
  531. export function getGrowthArchiveProduct(productId) {
  532. return request({
  533. url: '/api/admin/growth-archive-product/detail',
  534. method: 'post',
  535. data: { productId }
  536. })
  537. }
  538. export function saveGrowthArchiveProduct(data) {
  539. return request({
  540. url: '/api/admin/growth-archive-product/save',
  541. method: 'post',
  542. data
  543. })
  544. }
  545. // ========== SKU 管理 API ==========
  546. export function getProductSkuList(productId) {
  547. return request({
  548. url: '/api/admin/product/sku/list',
  549. method: 'post',
  550. data: { productId }
  551. })
  552. }
  553. export function createProductSku(data) {
  554. return request({
  555. url: '/api/admin/product/sku/create',
  556. method: 'post',
  557. data
  558. })
  559. }
  560. export function updateProductSku(data) {
  561. return request({
  562. url: '/api/admin/product/sku/update',
  563. method: 'post',
  564. data
  565. })
  566. }
  567. export function linkedProductList(params) {
  568. return request({
  569. url: '/api/admin/product/linked/list',
  570. method: 'post',
  571. data: params
  572. })
  573. }
  574. export function deleteProductSku(id) {
  575. return request({
  576. url: '/api/admin/product/sku/delete',
  577. method: 'post',
  578. data: { id }
  579. })
  580. }
  581. // ========== 购买信息采集 API ==========
  582. export function getPredefinedPurchaseFields() {
  583. return request({
  584. url: '/api/admin/product/purchase_fields/predefined',
  585. method: 'post'
  586. })
  587. }
  588. export function getProductPurchaseFields(productId) {
  589. return request({
  590. url: '/api/admin/product/purchase_fields/list',
  591. method: 'post',
  592. data: { productId }
  593. })
  594. }
  595. export function saveProductPurchaseFields(productId, fields) {
  596. return request({
  597. url: '/api/admin/product/purchase_fields/save',
  598. method: 'post',
  599. data: { productId, fields }
  600. })
  601. }
  602. export function saveProductGiftRule(productId, status, levelCode) {
  603. return request({
  604. url: '/api/admin/product-gift-rule/save',
  605. method: 'post',
  606. data: { productId, status, levelCode }
  607. })
  608. }
  609. export function listProductGiftRules(productId) {
  610. return request({
  611. url: '/api/admin/product-gift-rule/list',
  612. method: 'post',
  613. data: { productId }
  614. })
  615. }
  616. export function saveProductGift(data) {
  617. return request({
  618. url: '/api/admin/product-gift/save',
  619. method: 'post',
  620. data
  621. })
  622. }
  623. export function getProductGiftList(productId) {
  624. return request({
  625. url: '/api/admin/product-gift/list',
  626. method: 'post',
  627. data: { productId }
  628. })
  629. }
  630. export function listMembershipLevels() {
  631. return request({
  632. url: '/api/membership/levels',
  633. method: 'post'
  634. })
  635. }
  636. export function updateMembershipLevel(data) {
  637. return request({
  638. url: '/api/admin/membership/level/update',
  639. method: 'post',
  640. data
  641. })
  642. }
  643. export function updateMembershipUser(data) {
  644. return request({
  645. url: '/api/admin/membership/user-update',
  646. method: 'post',
  647. data
  648. })
  649. }
  650. // ========== 分类管理 API ==========
  651. export function getCategoryTree(includeDisabled) {
  652. return request({
  653. url: '/api/admin/shop/category/tree',
  654. method: 'post',
  655. data: { includeDisabled }
  656. })
  657. }
  658. export function createCategory(data) {
  659. return request({
  660. url: '/api/admin/shop/category/create',
  661. method: 'post',
  662. data
  663. })
  664. }
  665. export function updateCategory(data) {
  666. return request({
  667. url: '/api/admin/shop/category/update',
  668. method: 'post',
  669. data
  670. })
  671. }
  672. export function deleteCategory(id) {
  673. return request({
  674. url: '/api/admin/shop/category/delete',
  675. method: 'post',
  676. data: { id }
  677. })
  678. }
  679. export function toggleCategory(id) {
  680. return request({
  681. url: '/api/admin/shop/category/toggle',
  682. method: 'post',
  683. data: { id }
  684. })
  685. }
  686. // ========== 订单管理 API ==========
  687. export function getOrderList(params) {
  688. return request({
  689. url: '/api/admin/product/order/list',
  690. method: 'post',
  691. data: params
  692. })
  693. }
  694. export function getOrderDetail(orderNo) {
  695. return request({
  696. url: '/api/admin/product/order/detail',
  697. method: 'post',
  698. data: { orderNo }
  699. })
  700. }
  701. export function shipOrder(orderNo, trackingNumber, expressCompany, extra) {
  702. return request({
  703. url: '/api/admin/product/order/ship',
  704. method: 'post',
  705. data: { orderNo, trackingNumber, expressCompany, ...extra }
  706. })
  707. }
  708. export function closeOrder(orderNo) {
  709. return request({
  710. url: '/api/admin/product/order/close',
  711. method: 'post',
  712. data: { orderNo }
  713. })
  714. }
  715. export function approveRefund(orderNo) {
  716. return request({
  717. url: '/api/admin/product/order/refund/approve',
  718. method: 'post',
  719. data: { orderNo }
  720. })
  721. }
  722. export function rejectRefund(orderNo, reason) {
  723. return request({
  724. url: '/api/admin/product/order/refund/reject',
  725. method: 'post',
  726. data: { orderNo, reason }
  727. })
  728. }
  729. // ========== 系统配置 API ==========
  730. export function getSysConfigList(params) {
  731. return request({
  732. url: '/api/admin/config/list',
  733. method: 'post',
  734. data: params
  735. })
  736. }
  737. export function createSysConfig(data) {
  738. return request({
  739. url: '/api/admin/config/update',
  740. method: 'post',
  741. data: { configKey: data.configKey, configValue: data.configValue }
  742. })
  743. }
  744. export function updateSysConfig(id, data) {
  745. return request({
  746. url: '/api/admin/config/update',
  747. method: 'post',
  748. data: { configKey: data.configKey, configValue: data.configValue }
  749. })
  750. }
  751. export function deleteSysConfig(id) {
  752. return request({
  753. url: `/api/admin/config/delete/${id}`,
  754. method: 'post'
  755. })
  756. }
  757. // ========== 通关解锁关卡配置 API ==========
  758. export function getUnlockGateList(params) {
  759. return request({
  760. url: '/api/admin/unlock-gates/list',
  761. method: 'post',
  762. data: params || {}
  763. })
  764. }
  765. export function saveUnlockGate(data) {
  766. return request({
  767. url: '/api/admin/unlock-gates/save',
  768. method: 'post',
  769. data
  770. })
  771. }
  772. export function deleteUnlockGate(id) {
  773. return request({
  774. url: '/api/admin/unlock-gates/delete',
  775. method: 'post',
  776. data: { id }
  777. })
  778. }
  779. export function sortUnlockGates(sortList) {
  780. return request({
  781. url: '/api/admin/unlock-gates/sort',
  782. method: 'post',
  783. data: sortList
  784. })
  785. }
  786. export function toggleUnlockGate(id, enabled) {
  787. return request({
  788. url: '/api/admin/unlock-gates/toggle',
  789. method: 'post',
  790. data: { id, enabled }
  791. })
  792. }
  793. export function resetFamilyGates(familyId) {
  794. return request({
  795. url: '/api/admin/unlock-gates/reset-family',
  796. method: 'post',
  797. data: { familyId }
  798. })
  799. }
  800. export function getFamilyGateProgress(familyId) {
  801. return request({
  802. url: '/api/admin/unlock-gates/family-progress',
  803. method: 'post',
  804. data: { familyId }
  805. })
  806. }
  807. // ========== 佣金推荐系统 API ==========
  808. export function getWithdrawalList(params) {
  809. return request({
  810. url: '/api/admin/commission/withdrawals',
  811. method: 'post',
  812. data: params
  813. })
  814. }
  815. export function auditWithdrawal(requestId, status, remark) {
  816. return request({
  817. url: '/api/admin/commission/audit',
  818. method: 'post',
  819. data: { requestId, status, remark }
  820. })
  821. }
  822. export function updateProductProfitRate(productId, profitRate) {
  823. return request({
  824. url: '/api/admin/commission/update-profit-rate',
  825. method: 'post',
  826. data: { productId, profitRate }
  827. })
  828. }
  829. // ========== 星座配置管理 API ==========
  830. export function listZodiacConfigs() {
  831. return request({
  832. url: '/api/admin/zodiac-config/list',
  833. method: 'post'
  834. })
  835. }
  836. export function createZodiacConfig(data) {
  837. return request({
  838. url: '/api/admin/zodiac-config/create',
  839. method: 'post',
  840. data
  841. })
  842. }
  843. export function updateZodiacConfig(data) {
  844. return request({
  845. url: '/api/admin/zodiac-config/update',
  846. method: 'post',
  847. data
  848. })
  849. }
  850. export function deleteZodiacConfig(id) {
  851. return request({
  852. url: '/api/admin/zodiac-config/delete',
  853. method: 'post',
  854. data: { id }
  855. })
  856. }
  857. // ========== 先天画像来源权重配置 API ==========
  858. export function listInnatePortraitConfigs() {
  859. return request({
  860. url: '/api/admin/innate-portrait-config/list',
  861. method: 'post'
  862. })
  863. }
  864. export function updateInnatePortraitConfig(data) {
  865. return request({
  866. url: '/api/admin/innate-portrait-config/update',
  867. method: 'post',
  868. data
  869. })
  870. }
  871. export function invalidateInnatePortraitScores() {
  872. return request({
  873. url: '/api/admin/innate-portrait-config/invalidate',
  874. method: 'post'
  875. })
  876. }
  877. // ========== 数字能量详细配置 API ==========
  878. export function listNumSoulDetailConfigs(data) {
  879. return request({
  880. url: '/api/admin/numsoul-detail-config/list',
  881. method: 'post',
  882. data
  883. })
  884. }
  885. export function createNumSoulDetailConfig(data) {
  886. return request({
  887. url: '/api/admin/numsoul-detail-config/create',
  888. method: 'post',
  889. data
  890. })
  891. }
  892. export function updateNumSoulDetailConfig(data) {
  893. return request({
  894. url: '/api/admin/numsoul-detail-config/update',
  895. method: 'post',
  896. data
  897. })
  898. }
  899. export function deleteNumSoulDetailConfig(id) {
  900. return request({
  901. url: '/api/admin/numsoul-detail-config/delete',
  902. method: 'post',
  903. data: { id }
  904. })
  905. }
  906. // ========== 八字配置管理 API ==========
  907. export function listBaziConfigs() {
  908. return request({
  909. url: '/api/admin/bazi-config/list',
  910. method: 'post'
  911. })
  912. }
  913. export function createBaziConfig(data) {
  914. return request({
  915. url: '/api/admin/bazi-config/create',
  916. method: 'post',
  917. data
  918. })
  919. }
  920. export function updateBaziConfig(data) {
  921. return request({
  922. url: '/api/admin/bazi-config/update',
  923. method: 'post',
  924. data
  925. })
  926. }
  927. export function deleteBaziConfig(id) {
  928. return request({
  929. url: '/api/admin/bazi-config/delete',
  930. method: 'post',
  931. data: { id }
  932. })
  933. }
  934. // ========== 血型配置管理 API ==========
  935. export function listBloodTypeConfigs() {
  936. return request({
  937. url: '/api/admin/blood-type-config/list',
  938. method: 'post'
  939. })
  940. }
  941. export function createBloodTypeConfig(data) {
  942. return request({
  943. url: '/api/admin/blood-type-config/create',
  944. method: 'post',
  945. data
  946. })
  947. }
  948. export function updateBloodTypeConfig(data) {
  949. return request({
  950. url: '/api/admin/blood-type-config/update',
  951. method: 'post',
  952. data
  953. })
  954. }
  955. export function deleteBloodTypeConfig(id) {
  956. return request({
  957. url: '/api/admin/blood-type-config/delete',
  958. method: 'post',
  959. data: { id }
  960. })
  961. }
  962. // ========== 服务器运行状态 ==========
  963. export function getSystemHealth() {
  964. return request({
  965. url: '/api/system/health',
  966. method: 'post'
  967. })
  968. }
  969. // ========== 虚拟服务商团队管理 API ==========
  970. export function listVirtualTeams(params) {
  971. return request({
  972. url: '/api/admin/virtual-team/list',
  973. method: 'post',
  974. data: params
  975. })
  976. }
  977. export function createVirtualTeam(data) {
  978. return request({
  979. url: '/api/admin/virtual-team/create',
  980. method: 'post',
  981. data
  982. })
  983. }
  984. export function updateVirtualTeam(data) {
  985. return request({
  986. url: '/api/admin/virtual-team/update',
  987. method: 'post',
  988. data
  989. })
  990. }
  991. export function toggleVirtualTeam(id) {
  992. return request({
  993. url: '/api/admin/virtual-team/toggle',
  994. method: 'post',
  995. data: { id }
  996. })
  997. }
  998. export function getVirtualTeamMembers(systemId) {
  999. return request({
  1000. url: '/api/admin/virtual-team/members',
  1001. method: 'post',
  1002. data: { systemId }
  1003. })
  1004. }
  1005. export function addVirtualTeamMember(data) {
  1006. return request({
  1007. url: '/api/admin/virtual-team/add-member',
  1008. method: 'post',
  1009. data
  1010. })
  1011. }
  1012. export function removeVirtualTeamMember(id) {
  1013. return request({
  1014. url: '/api/admin/virtual-team/remove-member',
  1015. method: 'post',
  1016. data: { id }
  1017. })
  1018. }
  1019. export function updateVirtualTeamMember(data) {
  1020. return request({
  1021. url: '/api/admin/virtual-team/update-member',
  1022. method: 'post',
  1023. data
  1024. })
  1025. }
  1026. export function getVirtualTeamTree(systemId) {
  1027. return request({
  1028. url: '/api/admin/virtual-team/tree',
  1029. method: 'post',
  1030. data: { systemId }
  1031. })
  1032. }
  1033. export function searchUsers(params) {
  1034. return request({
  1035. url: '/api/admin/user/search',
  1036. method: 'post',
  1037. data: params
  1038. })
  1039. }
  1040. // ========== 情绪告警管理 API ==========
  1041. export function getEmotionAlertList(params) {
  1042. return request({
  1043. url: '/api/mind/alert/admin/list',
  1044. method: 'post',
  1045. data: params
  1046. })
  1047. }
  1048. export function resolveEmotionAlert(alertId) {
  1049. return request({
  1050. url: '/api/mind/alert/resolve',
  1051. method: 'post',
  1052. data: { alertId, source: 'checkin' }
  1053. })
  1054. }
  1055. // ========== 食材管理 API ==========
  1056. export function getFoodList(params) {
  1057. return request({
  1058. url: '/api/admin/foods/list',
  1059. method: 'post',
  1060. data: params
  1061. })
  1062. }
  1063. export function createFood(data) {
  1064. return request({
  1065. url: '/api/admin/foods/create',
  1066. method: 'post',
  1067. data
  1068. })
  1069. }
  1070. export function updateFood(data) {
  1071. return request({
  1072. url: '/api/admin/foods/update',
  1073. method: 'post',
  1074. data
  1075. })
  1076. }
  1077. export function deleteFood(id) {
  1078. return request({
  1079. url: '/api/admin/foods/delete',
  1080. method: 'post',
  1081. data: { id }
  1082. })
  1083. }
  1084. export function getFoodDetail(id) {
  1085. return request({
  1086. url: '/api/admin/foods/detail',
  1087. method: 'post',
  1088. data: { id }
  1089. })
  1090. }
  1091. export function saveFoodMonths(id, months) {
  1092. return request({
  1093. url: '/api/admin/foods/saveMonths',
  1094. method: 'post',
  1095. data: { id, months }
  1096. })
  1097. }
  1098. // 供应商体系管理
  1099. export function getSupplySystemList(params) {
  1100. return request({
  1101. url: '/api/admin/supply-system/list',
  1102. method: 'post',
  1103. data: params || {}
  1104. })
  1105. }
  1106. export function getSupplySystemDetail(id) {
  1107. return request({
  1108. url: '/api/admin/supply-system/detail',
  1109. method: 'post',
  1110. data: { id }
  1111. })
  1112. }
  1113. export function createSupplySystem(data) {
  1114. return request({
  1115. url: '/api/admin/supply-system/create',
  1116. method: 'post',
  1117. data
  1118. })
  1119. }
  1120. export function updateSupplySystem(data) {
  1121. return request({
  1122. url: '/api/admin/supply-system/update',
  1123. method: 'post',
  1124. data
  1125. })
  1126. }
  1127. export function toggleSupplySystemStatus(id) {
  1128. return request({
  1129. url: '/api/admin/supply-system/toggle-status',
  1130. method: 'post',
  1131. data: { id }
  1132. })
  1133. }
  1134. export function listAllSupplySystems() {
  1135. return request({
  1136. url: '/api/admin/supply-system/list-all',
  1137. method: 'post'
  1138. })
  1139. }
  1140. export function getSupplySystemMembers(systemId) {
  1141. return request({
  1142. url: '/api/admin/supply-system/member/list',
  1143. method: 'post',
  1144. data: { systemId }
  1145. })
  1146. }
  1147. export function addSupplySystemMember(systemId, userId) {
  1148. return request({
  1149. url: '/api/admin/supply-system/member/add',
  1150. method: 'post',
  1151. data: { systemId, userId }
  1152. })
  1153. }
  1154. export function removeSupplySystemMember(memberId) {
  1155. return request({
  1156. url: '/api/admin/supply-system/member/remove',
  1157. method: 'post',
  1158. data: { memberId }
  1159. })
  1160. }
  1161. export function changeSupplySystemMemberRole(memberId, role) {
  1162. return request({
  1163. url: '/api/admin/supply-system/member/change-role',
  1164. method: 'post',
  1165. data: { memberId, role }
  1166. })
  1167. }
  1168. // ========== 供应商产品管理 API (supplier_admin) ==========
  1169. export function getMySupplySystem() {
  1170. return request({
  1171. url: '/api/admin/supply-system/my-system',
  1172. method: 'post'
  1173. })
  1174. }
  1175. export function getSupplierProductList(params) {
  1176. return request({
  1177. url: '/api/admin/supplier/product/list',
  1178. method: 'post',
  1179. data: params
  1180. })
  1181. }
  1182. export function createSupplierProduct(data) {
  1183. return request({
  1184. url: '/api/admin/supplier/product/create',
  1185. method: 'post',
  1186. data
  1187. })
  1188. }
  1189. export function updateSupplierProduct(data) {
  1190. return request({
  1191. url: '/api/admin/supplier/product/update',
  1192. method: 'post',
  1193. data
  1194. })
  1195. }
  1196. export function getSupplierProductDetail(id) {
  1197. return request({
  1198. url: '/api/admin/supplier/product/detail',
  1199. method: 'post',
  1200. data: { productId: id }
  1201. })
  1202. }
  1203. export function deleteSupplierProduct(id) {
  1204. return request({
  1205. url: '/api/admin/supplier/product/delete',
  1206. method: 'post',
  1207. data: { productId: id }
  1208. })
  1209. }
  1210. export function shelveSupplierProduct(productId, shelve) {
  1211. return request({
  1212. url: '/api/admin/supplier/product/shelve',
  1213. method: 'post',
  1214. data: { productId, shelve }
  1215. })
  1216. }
  1217. // 结算管理
  1218. export function getSupplySettlementList(params) {
  1219. return request({
  1220. url: '/api/admin/supply-settlement/list',
  1221. method: 'post',
  1222. data: params || {}
  1223. })
  1224. }
  1225. export function getSupplySettlementDetail(id) {
  1226. return request({
  1227. url: '/api/admin/supply-settlement/detail',
  1228. method: 'post',
  1229. data: { id }
  1230. })
  1231. }
  1232. export function getSupplySettlementDetailItems(settlementId) {
  1233. return request({
  1234. url: '/api/admin/supply-settlement/detail-items',
  1235. method: 'post',
  1236. data: { settlementId }
  1237. })
  1238. }
  1239. export function createSupplySettlement(systemId, periodStart, periodEnd, remark) {
  1240. return request({
  1241. url: '/api/admin/supply-settlement/create',
  1242. method: 'post',
  1243. data: { systemId, periodStart, periodEnd, remark }
  1244. })
  1245. }
  1246. export function confirmSupplySettlement(id) {
  1247. return request({
  1248. url: '/api/admin/supply-settlement/confirm',
  1249. method: 'post',
  1250. data: { id }
  1251. })
  1252. }
  1253. // ========== 供应商管理 (supplier_admin) ==========
  1254. export function getSupplyManageList(params) {
  1255. return request({
  1256. url: '/api/admin/supply-manage/list',
  1257. method: 'post',
  1258. data: params
  1259. })
  1260. }
  1261. export function getSupplyManageDetail(params) {
  1262. return request({
  1263. url: '/api/admin/supply-manage/detail',
  1264. method: 'post',
  1265. data: params
  1266. })
  1267. }
  1268. export function createSupplyManage(params) {
  1269. return request({
  1270. url: '/api/admin/supply-manage/create',
  1271. method: 'post',
  1272. data: params
  1273. })
  1274. }
  1275. export function updateSupplyManage(params) {
  1276. return request({
  1277. url: '/api/admin/supply-manage/update',
  1278. method: 'post',
  1279. data: params
  1280. })
  1281. }
  1282. export function deleteSupplyManage(params) {
  1283. return request({
  1284. url: '/api/admin/supply-manage/delete',
  1285. method: 'post',
  1286. data: params
  1287. })
  1288. }
  1289. export function addSupplierRole(params) {
  1290. return request({
  1291. url: '/api/admin/supply-manage/add-role',
  1292. method: 'post',
  1293. data: params
  1294. })
  1295. }
  1296. export function removeSupplierRole(params) {
  1297. return request({
  1298. url: '/api/admin/supply-manage/remove-role',
  1299. method: 'post',
  1300. data: params
  1301. })
  1302. }
  1303. export function adjustSupplyTier(params) {
  1304. return request({
  1305. url: '/api/admin/supply-manage/adjust-tier',
  1306. method: 'post',
  1307. data: params
  1308. })
  1309. }
  1310. // 供应商层级关系管理
  1311. export function getSupplyHierarchyTree(systemId) {
  1312. return request({
  1313. url: '/api/admin/supply-hierarchy/tree',
  1314. method: 'post',
  1315. data: { systemId }
  1316. })
  1317. }
  1318. export function setSupplyHierarchy(data) {
  1319. return request({
  1320. url: '/api/admin/supply-hierarchy/set',
  1321. method: 'post',
  1322. data
  1323. })
  1324. }
  1325. export function removeSupplyHierarchy(data) {
  1326. return request({
  1327. url: '/api/admin/supply-hierarchy/remove',
  1328. method: 'post',
  1329. data
  1330. })
  1331. }
  1332. export function getSupplyHierarchyDirectChildren(data) {
  1333. return request({
  1334. url: '/api/admin/supply-hierarchy/direct-children',
  1335. method: 'post',
  1336. data
  1337. })
  1338. }
  1339. export function getSupplyHierarchyAllChildren(data) {
  1340. return request({
  1341. url: '/api/admin/supply-hierarchy/all-children',
  1342. method: 'post',
  1343. data
  1344. })
  1345. }
  1346. export function getSupplyHierarchyParent(data) {
  1347. return request({
  1348. url: '/api/admin/supply-hierarchy/parent',
  1349. method: 'post',
  1350. data
  1351. })
  1352. }
  1353. export function getSupplyHierarchyParentChain(data) {
  1354. return request({
  1355. url: '/api/admin/supply-hierarchy/parent-chain',
  1356. method: 'post',
  1357. data
  1358. })
  1359. }
  1360. export function getSupplyHierarchyMy(data) {
  1361. return request({
  1362. url: '/api/admin/supply-hierarchy/my',
  1363. method: 'post',
  1364. data
  1365. })
  1366. }
  1367. export function getSupplyHierarchyChangeRequests(data) {
  1368. return request({
  1369. url: '/api/admin/supply-hierarchy/change-requests',
  1370. method: 'post',
  1371. data
  1372. })
  1373. }
  1374. export function applySupplyHierarchyChange(data) {
  1375. return request({
  1376. url: '/api/admin/supply-hierarchy/change/apply',
  1377. method: 'post',
  1378. data
  1379. })
  1380. }
  1381. export function reviewSupplyHierarchyChange(data) {
  1382. return request({
  1383. url: '/api/admin/supply-hierarchy/change/review',
  1384. method: 'post',
  1385. data
  1386. })
  1387. }
  1388. // ========== 家庭会员订阅管理 API ==========
  1389. export function getSubscriptionList(params) {
  1390. return request({
  1391. url: '/api/admin/subscription/list',
  1392. method: 'post',
  1393. data: params
  1394. })
  1395. }
  1396. export function activateSubscription(data) {
  1397. return request({
  1398. url: '/api/admin/subscription/activate',
  1399. method: 'post',
  1400. data
  1401. })
  1402. }
  1403. export function cancelSubscriptionAdmin(data) {
  1404. return request({
  1405. url: '/api/admin/subscription/cancel',
  1406. method: 'post',
  1407. data
  1408. })
  1409. }
  1410. export function getBenefitConfig() {
  1411. return request({
  1412. url: '/api/admin/subscription/benefits',
  1413. method: 'post'
  1414. })
  1415. }
  1416. export function updateBenefitConfig(data) {
  1417. return request({
  1418. url: '/api/admin/subscription/benefits/update',
  1419. method: 'post',
  1420. data
  1421. })
  1422. }
  1423. // ========== 推广等级配置 API ==========
  1424. export function getPromotionTierList(params) {
  1425. return request({
  1426. url: '/api/admin/promotion/tier/list',
  1427. method: 'post',
  1428. data: params
  1429. })
  1430. }
  1431. export function adjustPromotionTier(data) {
  1432. return request({
  1433. url: '/api/admin/promotion/tier/adjust',
  1434. method: 'post',
  1435. data
  1436. })
  1437. }
  1438. // ========== 佣金/返利记录 API ==========
  1439. export function getCommissionRecords(params) {
  1440. return request({
  1441. url: '/api/admin/commission/records',
  1442. method: 'post',
  1443. data: params
  1444. })
  1445. }
  1446. export function settleCommission(data) {
  1447. return request({
  1448. url: '/api/admin/commission/settle',
  1449. method: 'post',
  1450. data
  1451. })
  1452. }
  1453. export function refundCommission(data) {
  1454. return request({
  1455. url: '/api/admin/commission/refund',
  1456. method: 'post',
  1457. data
  1458. })
  1459. }
  1460. // ========== 产品 P 点配置 API ==========
  1461. export function getProductPpointList(params) {
  1462. return request({
  1463. url: '/api/admin/product-ppoint/list',
  1464. method: 'post',
  1465. data: params
  1466. })
  1467. }
  1468. export function saveProductPpoint(data) {
  1469. return request({
  1470. url: '/api/admin/product-ppoint/save',
  1471. method: 'post',
  1472. data
  1473. })
  1474. }
  1475. export function deleteProductPpoint(data) {
  1476. return request({
  1477. url: '/api/admin/product-ppoint/delete',
  1478. method: 'post',
  1479. data
  1480. })
  1481. }
  1482. export function getProductPpointByProduct(data) {
  1483. return request({
  1484. url: '/api/admin/product-ppoint/by-product',
  1485. method: 'post',
  1486. data
  1487. })
  1488. }
  1489. // ========== 推广等级配置 (R0-R4) API ==========
  1490. export function getPromotionTierConfig() {
  1491. return request({
  1492. url: '/api/admin/promotion/config',
  1493. method: 'post'
  1494. })
  1495. }
  1496. export function updatePromotionTierConfig(data) {
  1497. return request({
  1498. url: '/api/admin/promotion/config/update',
  1499. method: 'post',
  1500. data
  1501. })
  1502. }
  1503. // ========== 待退款管理 API ==========
  1504. export function getPendingRefundList(params) {
  1505. return request({
  1506. url: '/api/admin/commission/refunds/pending',
  1507. method: 'post',
  1508. data: params
  1509. })
  1510. }
  1511. export function getPendingRefundSummary() {
  1512. return request({
  1513. url: '/api/admin/commission/refunds/summary',
  1514. method: 'post'
  1515. })
  1516. }
  1517. export function cancelPendingRefund(params) {
  1518. return request({
  1519. url: '/api/admin/commission/refunds/cancel',
  1520. method: 'post',
  1521. data: params
  1522. })
  1523. }
  1524. // ========== 佣金配置 API ==========
  1525. export function getCommissionConfig() {
  1526. return request({
  1527. url: '/api/admin/commission/config',
  1528. method: 'post'
  1529. })
  1530. }
  1531. export function updateCommissionConfig(data) {
  1532. return request({
  1533. url: '/api/admin/commission/config/update',
  1534. method: 'post',
  1535. data
  1536. })
  1537. }
  1538. // 电商供应商管理
  1539. export function getEcomSupplierList(params) {
  1540. return request({
  1541. url: '/api/admin/supplier/list',
  1542. method: 'post',
  1543. data: params
  1544. })
  1545. }
  1546. export function saveEcomSupplier(data) {
  1547. return request({
  1548. url: '/api/admin/supplier/save',
  1549. method: 'post',
  1550. data
  1551. })
  1552. }
  1553. export function updateEcomSupplier(data) {
  1554. return request({
  1555. url: '/api/admin/supplier/update',
  1556. method: 'post',
  1557. data
  1558. })
  1559. }
  1560. export function deleteEcomSupplier(id) {
  1561. return request({
  1562. url: '/api/admin/supplier/delete',
  1563. method: 'post',
  1564. data: { id }
  1565. })
  1566. }
  1567. export function getAllSuppliers() {
  1568. return request({
  1569. url: '/api/admin/supplier/all',
  1570. method: 'post'
  1571. })
  1572. }
  1573. // ===== 家庭收益管理 =====
  1574. export function getFamilyEarningsList() {
  1575. return request({
  1576. url: '/api/admin/earnings/families',
  1577. method: 'post',
  1578. data: {}
  1579. })
  1580. }
  1581. export function getFamilyEarningsDetail(familyId) {
  1582. return request({
  1583. url: '/api/admin/earnings/family/' + familyId + '/summary',
  1584. method: 'post',
  1585. data: { familyId: familyId }
  1586. })
  1587. }
  1588. export function getFamilyEarningsRecords(familyId, type) {
  1589. return request({
  1590. url: '/api/admin/earnings/family/' + familyId + '/records',
  1591. method: 'post',
  1592. data: { familyId: familyId, type: type || '' }
  1593. })
  1594. }
  1595. // ===== 测评待分配规划师 =====
  1596. export function getPendingAssessmentList(params) {
  1597. return request({
  1598. url: '/api/admin/assessment/pending-list',
  1599. method: 'post',
  1600. data: params || {}
  1601. })
  1602. }
  1603. export function getAvailableGuides() {
  1604. return request({
  1605. url: '/api/admin/assessment/available-guides',
  1606. method: 'post',
  1607. data: {}
  1608. })
  1609. }
  1610. export function assignGuide(appointmentId, guideId) {
  1611. return request({
  1612. url: '/api/admin/assessment/assign-guide',
  1613. method: 'post',
  1614. data: { appointmentId, guideId }
  1615. })
  1616. }
  1617. // ===== 测评订单管理 =====
  1618. export function getAssessmentOrderList(params) {
  1619. return request({
  1620. url: '/api/admin/assessment/orders',
  1621. method: 'post',
  1622. data: params || {}
  1623. })
  1624. }
  1625. export function changeAssessmentGuide(orderId, guideId) {
  1626. return request({
  1627. url: '/api/admin/assessment/change-guide',
  1628. method: 'post',
  1629. data: { orderId, guideId }
  1630. })
  1631. }
  1632. // ========== 库存管理 API ==========
  1633. export function createInboundOrder(data) {
  1634. return request({
  1635. url: '/api/admin/inventory/inbound/create',
  1636. method: 'post',
  1637. data
  1638. })
  1639. }
  1640. export function getInboundOrderList(params) {
  1641. return request({
  1642. url: '/api/admin/inventory/inbound/list',
  1643. method: 'post',
  1644. data: params
  1645. })
  1646. }
  1647. export function getInboundOrderDetail(id) {
  1648. return request({
  1649. url: '/api/admin/inventory/inbound/detail',
  1650. method: 'post',
  1651. data: { id }
  1652. })
  1653. }
  1654. export function confirmInbound(id) {
  1655. return request({
  1656. url: '/api/admin/inventory/inbound/confirm',
  1657. method: 'post',
  1658. data: { id }
  1659. })
  1660. }
  1661. export function cancelInbound(id) {
  1662. return request({
  1663. url: '/api/admin/inventory/inbound/cancel',
  1664. method: 'post',
  1665. data: { id }
  1666. })
  1667. }
  1668. export function getInventoryTransactions(params) {
  1669. return request({
  1670. url: '/api/admin/inventory/transactions/list',
  1671. method: 'post',
  1672. data: params
  1673. })
  1674. }
  1675. export function createCountingRecord(data) {
  1676. return request({
  1677. url: '/api/admin/inventory/counting/create',
  1678. method: 'post',
  1679. data
  1680. })
  1681. }
  1682. export function confirmCounting(id) {
  1683. return request({
  1684. url: '/api/admin/inventory/counting/confirm',
  1685. method: 'post',
  1686. data: { id }
  1687. })
  1688. }
  1689. export function getCountingList(params) {
  1690. return request({
  1691. url: '/api/admin/inventory/counting/list',
  1692. method: 'post',
  1693. data: params
  1694. })
  1695. }
  1696. export function getStockAlerts() {
  1697. return request({
  1698. url: '/api/admin/inventory/alert/list',
  1699. method: 'post'
  1700. })
  1701. }
  1702. export function getProductStock(productId) {
  1703. return request({
  1704. url: '/api/admin/inventory/product/stock',
  1705. method: 'post',
  1706. data: { productId }
  1707. })
  1708. }
  1709. export function saveBundleItems(bundleProductId, items) {
  1710. return request({
  1711. url: '/api/admin/inventory/bundle/items',
  1712. method: 'post',
  1713. data: { bundleProductId, items }
  1714. })
  1715. }
  1716. export function getBundleItems(bundleProductId) {
  1717. return request({
  1718. url: '/api/admin/inventory/bundle/items/list',
  1719. method: 'post',
  1720. data: { bundleProductId }
  1721. })
  1722. }
  1723. export function checkBundleStock(bundleProductId, quantity) {
  1724. return request({
  1725. url: '/api/admin/inventory/bundle/check-stock',
  1726. method: 'post',
  1727. data: { bundleProductId, quantity }
  1728. })
  1729. }
  1730. export function createManualOutbound(data) {
  1731. return request({
  1732. url: '/api/admin/inventory/outbound/create',
  1733. method: 'post',
  1734. data
  1735. })
  1736. }
  1737. export function getManualOutboundList(params) {
  1738. return request({
  1739. url: '/api/admin/inventory/outbound/list',
  1740. method: 'post',
  1741. data: params
  1742. })
  1743. }
  1744. export function getFamilyMemberList(params) {
  1745. return request({
  1746. url: '/api/family/member/list',
  1747. method: 'post',
  1748. data: params
  1749. })
  1750. }
  1751. export function updateOrderExpress(data) {
  1752. return request({
  1753. url: '/api/admin/product/order/update-express',
  1754. method: 'post',
  1755. data
  1756. })
  1757. }
  1758. // ========== 健康报告代上传 ==========
  1759. export function proxyParseReport(data) {
  1760. const formData = new FormData()
  1761. formData.append('file', data.file)
  1762. formData.append('familyId', data.familyId)
  1763. if (data.subjectId) formData.append('subjectId', data.subjectId)
  1764. if (data.note) formData.append('note', data.note)
  1765. return request({
  1766. url: '/api/health/report/proxy-parse',
  1767. method: 'post',
  1768. data: formData,
  1769. headers: { 'Content-Type': 'multipart/form-data' }
  1770. })
  1771. }
  1772. export function proxyConfirmReport(data) {
  1773. return request({
  1774. url: '/api/health/report/proxy-confirm',
  1775. method: 'post',
  1776. data
  1777. })
  1778. }
  1779. export function listHealthReports(params) {
  1780. return request({
  1781. url: '/api/health/report/list',
  1782. method: 'post',
  1783. data: params
  1784. })
  1785. }
  1786. export function getHealthReportDetail(reportId) {
  1787. return request({
  1788. url: '/api/health/report/detail',
  1789. method: 'post',
  1790. data: { reportId }
  1791. })
  1792. }
  1793. export function archiveReport(reportId) {
  1794. return request({
  1795. url: '/api/health/report/archive',
  1796. method: 'post',
  1797. data: { reportId }
  1798. })
  1799. }
  1800. export function archiveReportsBatch(reportIds) {
  1801. return request({
  1802. url: '/api/health/report/archive-batch',
  1803. method: 'post',
  1804. data: { reportIds }
  1805. })
  1806. }
  1807. export function editHealthReport(data) {
  1808. return request({
  1809. url: '/api/health/report/edit',
  1810. method: 'post',
  1811. data
  1812. })
  1813. }
  1814. // ===== CF值(平台积分)管理 =====
  1815. export function getCfValueBalance(data) {
  1816. return request({
  1817. url: '/api/admin/cf-value/balance',
  1818. method: 'post',
  1819. data
  1820. })
  1821. }
  1822. export function getCfValueLogs(data) {
  1823. return request({
  1824. url: '/api/admin/cf-value/logs',
  1825. method: 'post',
  1826. data
  1827. })
  1828. }
  1829. export function getCfValueAllBalances(data) {
  1830. return request({
  1831. url: '/api/admin/cf-value/all-balances',
  1832. method: 'post',
  1833. data
  1834. })
  1835. }
  1836. // 获取已入驻的服务商列表(用于商品编辑下拉选择)
  1837. export function getApprovedGuides() {
  1838. return request({
  1839. url: '/api/admin/guide/guides/approved',
  1840. method: 'post'
  1841. })
  1842. }
  1843. // 用户画像管理
  1844. export function getProfile(memberId) {
  1845. return request({
  1846. url: '/api/admin/profile/get',
  1847. method: 'post',
  1848. data: { memberId }
  1849. })
  1850. }
  1851. export function getProfileTrend(memberId, days) {
  1852. return request({
  1853. url: '/api/admin/profile/trend',
  1854. method: 'post',
  1855. data: { memberId, days: days || 30 }
  1856. })
  1857. }