admin.js 40 KB

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