admin.js 32 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597
  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. // 家庭管理
  37. export function getFamilyList(params) {
  38. return request({
  39. url: '/api/admin/families',
  40. method: 'post',
  41. data: params
  42. })
  43. }
  44. export function getFamilyDetail(id) {
  45. return request({
  46. url: `/api/admin/families/${id}`,
  47. method: 'post'
  48. })
  49. }
  50. export function updateFamily(id, data) {
  51. return request({
  52. url: `/api/admin/families/${id}/update`,
  53. method: 'post',
  54. data
  55. })
  56. }
  57. export function deleteFamily(id) {
  58. return request({
  59. url: `/api/admin/families/${id}/delete`,
  60. method: 'post'
  61. })
  62. }
  63. export function getFamilyMembers(id) {
  64. return request({
  65. url: `/api/admin/families/${id}/members`,
  66. method: 'post'
  67. })
  68. }
  69. // 任务模板管理
  70. export function getTaskTemplateList(params) {
  71. return request({
  72. url: '/api/admin/task-templates',
  73. method: 'post',
  74. data: params
  75. })
  76. }
  77. export function createTaskTemplate(data) {
  78. return request({
  79. url: '/api/admin/task-templates/create',
  80. method: 'post',
  81. data
  82. })
  83. }
  84. export function updateTaskTemplate(id, data) {
  85. return request({
  86. url: `/api/admin/task-templates/${id}/update`,
  87. method: 'post',
  88. data
  89. })
  90. }
  91. export function deleteTaskTemplate(id) {
  92. return request({
  93. url: `/api/admin/task-templates/${id}/delete`,
  94. method: 'post'
  95. })
  96. }
  97. // 孩子管理
  98. export function getChildrenList(params) {
  99. return request({
  100. url: '/api/admin/children',
  101. method: 'post',
  102. data: params
  103. })
  104. }
  105. export function getChildDetail(id) {
  106. return request({
  107. url: `/api/admin/children/${id}`,
  108. method: 'post'
  109. })
  110. }
  111. export function updateChild(id, data) {
  112. return request({
  113. url: `/api/admin/children/${id}/update`,
  114. method: 'post',
  115. data
  116. })
  117. }
  118. export function deleteChild(id) {
  119. return request({
  120. url: `/api/admin/children/${id}/delete`,
  121. method: 'post'
  122. })
  123. }
  124. export function adjustChildPoints(id, data) {
  125. return request({
  126. url: `/api/admin/children/${id}/adjust-points`,
  127. method: 'post',
  128. data
  129. })
  130. }
  131. // 任务管理
  132. export function getTasksList(params) {
  133. return request({
  134. url: '/api/admin/tasks',
  135. method: 'post',
  136. data: params
  137. })
  138. }
  139. export function getTaskStats() {
  140. return request({
  141. url: '/api/admin/tasks/stats',
  142. method: 'post'
  143. })
  144. }
  145. // 奖励管理
  146. export function getRewardsList(params) {
  147. return request({
  148. url: '/api/admin/rewards',
  149. method: 'post',
  150. data: params
  151. })
  152. }
  153. export function getRewardTemplates() {
  154. return request({
  155. url: '/api/admin/rewards/templates',
  156. method: 'post'
  157. })
  158. }
  159. export function createRewardTemplate(data) {
  160. return request({
  161. url: '/api/admin/rewards/create',
  162. method: 'post',
  163. data
  164. })
  165. }
  166. export function deleteRewardTemplate(id) {
  167. return request({
  168. url: `/api/admin/rewards/templates/${id}/delete`,
  169. method: 'post'
  170. })
  171. }
  172. export function updateRewardTemplate(id, data) {
  173. return request({
  174. url: `/api/admin/rewards/templates/${id}/update`,
  175. method: 'post',
  176. data
  177. })
  178. }
  179. export function approveReward(id, data) {
  180. return request({
  181. url: `/api/admin/rewards/${id}/approve`,
  182. method: 'post',
  183. data
  184. })
  185. }
  186. // 积分管理
  187. export function getPointsLogs(params) {
  188. return request({
  189. url: '/api/admin/points/logs',
  190. method: 'post',
  191. data: params
  192. })
  193. }
  194. export function getPointsStats() {
  195. return request({
  196. url: '/api/admin/points/stats',
  197. method: 'post'
  198. })
  199. }
  200. // ========== 心愿管理 API(新版) ==========
  201. // 获取心愿列表
  202. export function getWishesList(params) {
  203. return request({
  204. url: '/api/wishes/list',
  205. method: 'post',
  206. data: params
  207. })
  208. }
  209. // 获取待处理列表(家长)
  210. export function getPendingWishes(familyId) {
  211. return request({
  212. url: '/api/wishes/pending',
  213. method: 'post',
  214. data: { familyId }
  215. })
  216. }
  217. // 获取心愿详情
  218. export function getWishDetail(id) {
  219. return request({
  220. url: `/api/wishes/${id}`,
  221. method: 'post'
  222. })
  223. }
  224. // 家长定价
  225. export function setWishPrice(id, pointsRequired) {
  226. return request({
  227. url: `/api/wishes/${id}/set-price`,
  228. method: 'post',
  229. data: { pointsRequired }
  230. })
  231. }
  232. // 家长拒绝心愿
  233. export function rejectWish(id, reason) {
  234. return request({
  235. url: `/api/wishes/${id}/reject`,
  236. method: 'post',
  237. data: { reason }
  238. })
  239. }
  240. // 家长审批兑换
  241. export function approveWishExchange(id, approved, reason) {
  242. return request({
  243. url: `/api/wishes/${id}/approve-exchange`,
  244. method: 'post',
  245. data: { approved, reason }
  246. })
  247. }
  248. // 家长标记已购买
  249. export function markWishFulfilled(id) {
  250. return request({
  251. url: `/api/wishes/${id}/fulfill`,
  252. method: 'post'
  253. })
  254. }
  255. // 取消心愿
  256. export function deleteWish(id, reason) {
  257. return request({
  258. url: `/api/wishes/${id}/cancel`,
  259. method: 'post',
  260. data: { reason }
  261. })
  262. }
  263. // ========== 成长规划师相关 API ==========
  264. // 获取成长规划师关联的家庭列表
  265. export function getTeacherFamilies() {
  266. return request({
  267. url: '/api/admin/teacher/families',
  268. method: 'post'
  269. })
  270. }
  271. // 获取成长规划师发布的任务模板
  272. export function getTeacherTaskTemplates() {
  273. return request({
  274. url: '/api/admin/teacher/task-templates',
  275. method: 'post'
  276. })
  277. }
  278. // 成长规划师创建任务模板
  279. export function createTeacherTaskTemplate(data) {
  280. return request({
  281. url: '/api/admin/teacher/task-templates/create',
  282. method: 'post',
  283. data
  284. })
  285. }
  286. // 成长规划师删除任务模板
  287. export function deleteTeacherTaskTemplate(id) {
  288. return request({
  289. url: `/api/admin/teacher/task-templates/${id}/delete`,
  290. method: 'post'
  291. })
  292. }
  293. // 获取指定家庭的任务列表
  294. export function getTeacherFamilyTasks(familyId, params) {
  295. return request({
  296. url: `/api/admin/teacher/families/${familyId}/tasks`,
  297. method: 'post',
  298. data: params
  299. })
  300. }
  301. // 获取指定家庭的奖励列表
  302. export function getTeacherFamilyRewards(familyId, params) {
  303. return request({
  304. url: `/api/admin/teacher/families/${familyId}/rewards`,
  305. method: 'post',
  306. data: params
  307. })
  308. }
  309. // ========== 成长规划师审核 API ==========
  310. // 获取成长规划师审核列表
  311. export function getGuideApplications(params) {
  312. return request({
  313. url: '/api/admin/guide/applications',
  314. method: 'post',
  315. data: params
  316. })
  317. }
  318. // 通过成长规划师审核
  319. export function approveGuide(userId) {
  320. return request({
  321. url: `/api/admin/guide/approve/${userId}`,
  322. method: 'post'
  323. })
  324. }
  325. // 拒绝成长规划师审核
  326. export function rejectGuide(userId, reason) {
  327. return request({
  328. url: `/api/admin/guide/reject/${userId}`,
  329. method: 'post',
  330. data: { reason }
  331. })
  332. }
  333. // 获取营养师审核列表
  334. export function getNutritionistApplications(params) {
  335. return request({
  336. url: '/api/admin/nutritionist/applications',
  337. method: 'post',
  338. data: params
  339. })
  340. }
  341. // 通过营养师审核
  342. export function approveNutritionist(userId) {
  343. return request({
  344. url: `/api/admin/nutritionist/approve/${userId}`,
  345. method: 'post'
  346. })
  347. }
  348. // 拒绝营养师审核
  349. export function rejectNutritionist(userId, reason) {
  350. return request({
  351. url: `/api/admin/nutritionist/reject/${userId}`,
  352. method: 'post',
  353. data: { reason }
  354. })
  355. }
  356. // 获取待审核营养师数量
  357. export function getPendingNutritionistCount() {
  358. return request({
  359. url: '/api/admin/nutritionist/pending-count',
  360. method: 'post'
  361. })
  362. }
  363. // 获取待审核成长规划师数量
  364. export function getPendingGuideCount() {
  365. return request({
  366. url: '/api/admin/guide/pending-count',
  367. method: 'post'
  368. })
  369. }
  370. export function getPendingPackageCount() {
  371. return request({
  372. url: '/api/admin/package/pending-count',
  373. method: 'post'
  374. })
  375. }
  376. // 管理员个人信息
  377. export function updateAdminInfo(data) {
  378. return request({
  379. url: '/api/admin-auth/update-info',
  380. method: 'post',
  381. data
  382. })
  383. }
  384. // ========== 管理后台仪表盘汇总 API ==========
  385. export function getDashboardStats() {
  386. return request({
  387. url: '/api/stats/dashboard',
  388. method: 'post'
  389. })
  390. }
  391. export function getDashboardOverview() {
  392. return request({
  393. url: '/api/stats/overview',
  394. method: 'post'
  395. })
  396. }
  397. export function getRevenueStats() {
  398. return request({
  399. url: '/api/stats/revenue',
  400. method: 'post'
  401. })
  402. }
  403. export function getMembershipStats() {
  404. return request({
  405. url: '/api/stats/membership',
  406. method: 'post'
  407. })
  408. }
  409. export function getTrendStats() {
  410. return request({
  411. url: '/api/stats/trend',
  412. method: 'post',
  413. data: {}
  414. })
  415. }
  416. // ========== 商品管理 API ==========
  417. export function getProductList(params) {
  418. return request({
  419. url: '/api/admin/product/list',
  420. method: 'post',
  421. data: params
  422. })
  423. }
  424. export function reviewProduct(productId, data) {
  425. return request({
  426. url: '/api/admin/product/review',
  427. method: 'post',
  428. data: { productId, ...data }
  429. })
  430. }
  431. export function shelveProduct(productId, data) {
  432. return request({
  433. url: '/api/admin/product/shelve',
  434. method: 'post',
  435. data: { productId, ...data }
  436. })
  437. }
  438. export function getProduct(id) {
  439. return request({
  440. url: '/api/admin/product/detail',
  441. method: 'post',
  442. data: { productId: id }
  443. })
  444. }
  445. export function createProduct(data) {
  446. return request({
  447. url: '/api/admin/product/create',
  448. method: 'post',
  449. data
  450. })
  451. }
  452. export function updateProduct(data) {
  453. return request({
  454. url: '/api/admin/product/update',
  455. method: 'post',
  456. data
  457. })
  458. }
  459. export function deleteProduct(id) {
  460. return request({
  461. url: '/api/admin/product/delete',
  462. method: 'post',
  463. data: { productId: id }
  464. })
  465. }
  466. // ========== SKU 管理 API ==========
  467. export function getProductSkuList(productId) {
  468. return request({
  469. url: '/api/admin/product/sku/list',
  470. method: 'post',
  471. data: { productId }
  472. })
  473. }
  474. export function createProductSku(data) {
  475. return request({
  476. url: '/api/admin/product/sku/create',
  477. method: 'post',
  478. data
  479. })
  480. }
  481. export function updateProductSku(data) {
  482. return request({
  483. url: '/api/admin/product/sku/update',
  484. method: 'post',
  485. data
  486. })
  487. }
  488. export function deleteProductSku(id) {
  489. return request({
  490. url: '/api/admin/product/sku/delete',
  491. method: 'post',
  492. data: { id }
  493. })
  494. }
  495. // ========== 购买信息采集 API ==========
  496. export function getPredefinedPurchaseFields() {
  497. return request({
  498. url: '/api/admin/product/purchase_fields/predefined',
  499. method: 'post'
  500. })
  501. }
  502. export function getProductPurchaseFields(productId) {
  503. return request({
  504. url: '/api/admin/product/purchase_fields/list',
  505. method: 'post',
  506. data: { productId }
  507. })
  508. }
  509. export function saveProductPurchaseFields(productId, fields) {
  510. return request({
  511. url: '/api/admin/product/purchase_fields/save',
  512. method: 'post',
  513. data: { productId, fields }
  514. })
  515. }
  516. // ========== 分类管理 API ==========
  517. export function getCategoryTree(includeDisabled) {
  518. return request({
  519. url: '/api/admin/shop/category/tree',
  520. method: 'post',
  521. data: { includeDisabled }
  522. })
  523. }
  524. export function createCategory(data) {
  525. return request({
  526. url: '/api/admin/shop/category/create',
  527. method: 'post',
  528. data
  529. })
  530. }
  531. export function updateCategory(data) {
  532. return request({
  533. url: '/api/admin/shop/category/update',
  534. method: 'post',
  535. data
  536. })
  537. }
  538. export function deleteCategory(id) {
  539. return request({
  540. url: '/api/admin/shop/category/delete',
  541. method: 'post',
  542. data: { id }
  543. })
  544. }
  545. export function toggleCategory(id) {
  546. return request({
  547. url: '/api/admin/shop/category/toggle',
  548. method: 'post',
  549. data: { id }
  550. })
  551. }
  552. // ========== 订单管理 API ==========
  553. export function getOrderList(params) {
  554. return request({
  555. url: '/api/admin/product/order/list',
  556. method: 'post',
  557. data: params
  558. })
  559. }
  560. export function getOrderDetail(orderNo) {
  561. return request({
  562. url: '/api/admin/product/order/detail',
  563. method: 'post',
  564. data: { orderNo }
  565. })
  566. }
  567. export function shipOrder(orderNo, trackingNumber, expressCompany) {
  568. return request({
  569. url: '/api/admin/product/order/ship',
  570. method: 'post',
  571. data: { orderNo, trackingNumber, expressCompany }
  572. })
  573. }
  574. export function closeOrder(orderNo) {
  575. return request({
  576. url: '/api/admin/product/order/close',
  577. method: 'post',
  578. data: { orderNo }
  579. })
  580. }
  581. export function approveRefund(orderNo) {
  582. return request({
  583. url: '/api/admin/product/order/refund/approve',
  584. method: 'post',
  585. data: { orderNo }
  586. })
  587. }
  588. export function rejectRefund(orderNo, reason) {
  589. return request({
  590. url: '/api/admin/product/order/refund/reject',
  591. method: 'post',
  592. data: { orderNo, reason }
  593. })
  594. }
  595. // ========== 系统配置 API ==========
  596. export function getSysConfigList(params) {
  597. return request({
  598. url: '/api/admin/config/list',
  599. method: 'post',
  600. data: params
  601. })
  602. }
  603. export function createSysConfig(data) {
  604. return request({
  605. url: '/api/admin/config/update',
  606. method: 'post',
  607. data: { configKey: data.configKey, configValue: data.configValue }
  608. })
  609. }
  610. export function updateSysConfig(id, data) {
  611. return request({
  612. url: '/api/admin/config/update',
  613. method: 'post',
  614. data: { configKey: data.configKey, configValue: data.configValue }
  615. })
  616. }
  617. export function deleteSysConfig(id) {
  618. return request({
  619. url: `/api/admin/config/delete/${id}`,
  620. method: 'post'
  621. })
  622. }
  623. // ========== 佣金推荐系统 API ==========
  624. export function getWithdrawalList(params) {
  625. return request({
  626. url: '/api/admin/commission/withdrawals',
  627. method: 'post',
  628. data: params
  629. })
  630. }
  631. export function auditWithdrawal(requestId, status, remark) {
  632. return request({
  633. url: '/api/admin/commission/audit',
  634. method: 'post',
  635. data: { requestId, status, remark }
  636. })
  637. }
  638. export function updateProductProfitRate(productId, profitRate) {
  639. return request({
  640. url: '/api/admin/commission/update-profit-rate',
  641. method: 'post',
  642. data: { productId, profitRate }
  643. })
  644. }
  645. // ========== 星座配置管理 API ==========
  646. export function listZodiacConfigs() {
  647. return request({
  648. url: '/api/admin/zodiac-config/list',
  649. method: 'post'
  650. })
  651. }
  652. export function createZodiacConfig(data) {
  653. return request({
  654. url: '/api/admin/zodiac-config/create',
  655. method: 'post',
  656. data
  657. })
  658. }
  659. export function updateZodiacConfig(data) {
  660. return request({
  661. url: '/api/admin/zodiac-config/update',
  662. method: 'post',
  663. data
  664. })
  665. }
  666. export function deleteZodiacConfig(id) {
  667. return request({
  668. url: '/api/admin/zodiac-config/delete',
  669. method: 'post',
  670. data: { id }
  671. })
  672. }
  673. // ========== 八字配置管理 API ==========
  674. export function listBaziConfigs() {
  675. return request({
  676. url: '/api/admin/bazi-config/list',
  677. method: 'post'
  678. })
  679. }
  680. export function createBaziConfig(data) {
  681. return request({
  682. url: '/api/admin/bazi-config/create',
  683. method: 'post',
  684. data
  685. })
  686. }
  687. export function updateBaziConfig(data) {
  688. return request({
  689. url: '/api/admin/bazi-config/update',
  690. method: 'post',
  691. data
  692. })
  693. }
  694. export function deleteBaziConfig(id) {
  695. return request({
  696. url: '/api/admin/bazi-config/delete',
  697. method: 'post',
  698. data: { id }
  699. })
  700. }
  701. // ========== 血型配置管理 API ==========
  702. export function listBloodTypeConfigs() {
  703. return request({
  704. url: '/api/admin/blood-type-config/list',
  705. method: 'post'
  706. })
  707. }
  708. export function createBloodTypeConfig(data) {
  709. return request({
  710. url: '/api/admin/blood-type-config/create',
  711. method: 'post',
  712. data
  713. })
  714. }
  715. export function updateBloodTypeConfig(data) {
  716. return request({
  717. url: '/api/admin/blood-type-config/update',
  718. method: 'post',
  719. data
  720. })
  721. }
  722. export function deleteBloodTypeConfig(id) {
  723. return request({
  724. url: '/api/admin/blood-type-config/delete',
  725. method: 'post',
  726. data: { id }
  727. })
  728. }
  729. // ========== 服务器运行状态 ==========
  730. export function getSystemHealth() {
  731. return request({
  732. url: '/api/system/health',
  733. method: 'post'
  734. })
  735. }
  736. // 关系类型管理
  737. export function listRelationshipTypes() {
  738. return request({
  739. url: '/api/admin/relationship-type/list',
  740. method: 'post'
  741. })
  742. }
  743. export function saveRelationshipType(data) {
  744. return request({
  745. url: '/api/admin/relationship-type/save',
  746. method: 'post',
  747. data
  748. })
  749. }
  750. export function deleteRelationshipType(id) {
  751. return request({
  752. url: '/api/admin/relationship-type/delete',
  753. method: 'post',
  754. data: { id }
  755. })
  756. }
  757. // ========== 虚拟服务商团队管理 API ==========
  758. export function listVirtualTeams(params) {
  759. return request({
  760. url: '/api/admin/virtual-team/list',
  761. method: 'post',
  762. data: params
  763. })
  764. }
  765. export function createVirtualTeam(data) {
  766. return request({
  767. url: '/api/admin/virtual-team/create',
  768. method: 'post',
  769. data
  770. })
  771. }
  772. export function updateVirtualTeam(data) {
  773. return request({
  774. url: '/api/admin/virtual-team/update',
  775. method: 'post',
  776. data
  777. })
  778. }
  779. export function toggleVirtualTeam(id) {
  780. return request({
  781. url: '/api/admin/virtual-team/toggle',
  782. method: 'post',
  783. data: { id }
  784. })
  785. }
  786. export function getVirtualTeamMembers(systemId) {
  787. return request({
  788. url: '/api/admin/virtual-team/members',
  789. method: 'post',
  790. data: { systemId }
  791. })
  792. }
  793. export function addVirtualTeamMember(data) {
  794. return request({
  795. url: '/api/admin/virtual-team/add-member',
  796. method: 'post',
  797. data
  798. })
  799. }
  800. export function removeVirtualTeamMember(id) {
  801. return request({
  802. url: '/api/admin/virtual-team/remove-member',
  803. method: 'post',
  804. data: { id }
  805. })
  806. }
  807. export function updateVirtualTeamMember(data) {
  808. return request({
  809. url: '/api/admin/virtual-team/update-member',
  810. method: 'post',
  811. data
  812. })
  813. }
  814. export function getVirtualTeamTree(systemId) {
  815. return request({
  816. url: '/api/admin/virtual-team/tree',
  817. method: 'post',
  818. data: { systemId }
  819. })
  820. }
  821. export function searchUsers(params) {
  822. return request({
  823. url: '/api/admin/user/search',
  824. method: 'post',
  825. data: params
  826. })
  827. }
  828. // ========== 情绪告警管理 API ==========
  829. export function getEmotionAlertList(params) {
  830. return request({
  831. url: '/api/mind/alert/admin/list',
  832. method: 'post',
  833. data: params
  834. })
  835. }
  836. export function resolveEmotionAlert(alertId) {
  837. return request({
  838. url: '/api/mind/alert/resolve',
  839. method: 'post',
  840. data: { alertId, source: 'checkin' }
  841. })
  842. }
  843. // ========== 食材管理 API ==========
  844. export function getFoodList(params) {
  845. return request({
  846. url: '/api/admin/foods/list',
  847. method: 'post',
  848. data: params
  849. })
  850. }
  851. export function createFood(data) {
  852. return request({
  853. url: '/api/admin/foods/create',
  854. method: 'post',
  855. data
  856. })
  857. }
  858. export function updateFood(data) {
  859. return request({
  860. url: '/api/admin/foods/update',
  861. method: 'post',
  862. data
  863. })
  864. }
  865. export function deleteFood(id) {
  866. return request({
  867. url: '/api/admin/foods/delete',
  868. method: 'post',
  869. data: { id }
  870. })
  871. }
  872. export function getFoodDetail(id) {
  873. return request({
  874. url: '/api/admin/foods/detail',
  875. method: 'post',
  876. data: { id }
  877. })
  878. }
  879. export function saveFoodMonths(id, months) {
  880. return request({
  881. url: '/api/admin/foods/saveMonths',
  882. method: 'post',
  883. data: { id, months }
  884. })
  885. }
  886. // 供应商体系管理
  887. export function getSupplySystemList(params) {
  888. return request({
  889. url: '/api/admin/supply-system/list',
  890. method: 'post',
  891. data: params || {}
  892. })
  893. }
  894. export function getSupplySystemDetail(id) {
  895. return request({
  896. url: '/api/admin/supply-system/detail',
  897. method: 'post',
  898. data: { id }
  899. })
  900. }
  901. export function createSupplySystem(data) {
  902. return request({
  903. url: '/api/admin/supply-system/create',
  904. method: 'post',
  905. data
  906. })
  907. }
  908. export function updateSupplySystem(data) {
  909. return request({
  910. url: '/api/admin/supply-system/update',
  911. method: 'post',
  912. data
  913. })
  914. }
  915. export function toggleSupplySystemStatus(id) {
  916. return request({
  917. url: '/api/admin/supply-system/toggle-status',
  918. method: 'post',
  919. data: { id }
  920. })
  921. }
  922. export function listAllSupplySystems() {
  923. return request({
  924. url: '/api/admin/supply-system/list-all',
  925. method: 'post'
  926. })
  927. }
  928. export function getSupplySystemMembers(systemId) {
  929. return request({
  930. url: '/api/admin/supply-system/member/list',
  931. method: 'post',
  932. data: { systemId }
  933. })
  934. }
  935. export function addSupplySystemMember(systemId, userId) {
  936. return request({
  937. url: '/api/admin/supply-system/member/add',
  938. method: 'post',
  939. data: { systemId, userId }
  940. })
  941. }
  942. export function removeSupplySystemMember(memberId) {
  943. return request({
  944. url: '/api/admin/supply-system/member/remove',
  945. method: 'post',
  946. data: { memberId }
  947. })
  948. }
  949. export function changeSupplySystemMemberRole(memberId, role) {
  950. return request({
  951. url: '/api/admin/supply-system/member/change-role',
  952. method: 'post',
  953. data: { memberId, role }
  954. })
  955. }
  956. // ========== 供应商产品管理 API (supplier_admin) ==========
  957. export function getMySupplySystem() {
  958. return request({
  959. url: '/api/admin/supply-system/my-system',
  960. method: 'post'
  961. })
  962. }
  963. export function getSupplierProductList(params) {
  964. return request({
  965. url: '/api/admin/supplier/product/list',
  966. method: 'post',
  967. data: params
  968. })
  969. }
  970. export function createSupplierProduct(data) {
  971. return request({
  972. url: '/api/admin/supplier/product/create',
  973. method: 'post',
  974. data
  975. })
  976. }
  977. export function updateSupplierProduct(data) {
  978. return request({
  979. url: '/api/admin/supplier/product/update',
  980. method: 'post',
  981. data
  982. })
  983. }
  984. export function getSupplierProductDetail(id) {
  985. return request({
  986. url: '/api/admin/supplier/product/detail',
  987. method: 'post',
  988. data: { productId: id }
  989. })
  990. }
  991. export function deleteSupplierProduct(id) {
  992. return request({
  993. url: '/api/admin/supplier/product/delete',
  994. method: 'post',
  995. data: { productId: id }
  996. })
  997. }
  998. export function shelveSupplierProduct(productId, shelve) {
  999. return request({
  1000. url: '/api/admin/supplier/product/shelve',
  1001. method: 'post',
  1002. data: { productId, shelve }
  1003. })
  1004. }
  1005. // 结算管理
  1006. export function getSupplySettlementList(params) {
  1007. return request({
  1008. url: '/api/admin/supply-settlement/list',
  1009. method: 'post',
  1010. data: params || {}
  1011. })
  1012. }
  1013. export function getSupplySettlementDetail(id) {
  1014. return request({
  1015. url: '/api/admin/supply-settlement/detail',
  1016. method: 'post',
  1017. data: { id }
  1018. })
  1019. }
  1020. export function getSupplySettlementDetailItems(settlementId) {
  1021. return request({
  1022. url: '/api/admin/supply-settlement/detail-items',
  1023. method: 'post',
  1024. data: { settlementId }
  1025. })
  1026. }
  1027. export function createSupplySettlement(systemId, periodStart, periodEnd, remark) {
  1028. return request({
  1029. url: '/api/admin/supply-settlement/create',
  1030. method: 'post',
  1031. data: { systemId, periodStart, periodEnd, remark }
  1032. })
  1033. }
  1034. export function confirmSupplySettlement(id) {
  1035. return request({
  1036. url: '/api/admin/supply-settlement/confirm',
  1037. method: 'post',
  1038. data: { id }
  1039. })
  1040. }
  1041. // ========== 供应商管理 (supplier_admin) ==========
  1042. export function getSupplyManageList(params) {
  1043. return request({
  1044. url: '/api/admin/supply-manage/list',
  1045. method: 'post',
  1046. data: params
  1047. })
  1048. }
  1049. export function getSupplyManageDetail(params) {
  1050. return request({
  1051. url: '/api/admin/supply-manage/detail',
  1052. method: 'post',
  1053. data: params
  1054. })
  1055. }
  1056. export function createSupplyManage(params) {
  1057. return request({
  1058. url: '/api/admin/supply-manage/create',
  1059. method: 'post',
  1060. data: params
  1061. })
  1062. }
  1063. export function updateSupplyManage(params) {
  1064. return request({
  1065. url: '/api/admin/supply-manage/update',
  1066. method: 'post',
  1067. data: params
  1068. })
  1069. }
  1070. export function deleteSupplyManage(params) {
  1071. return request({
  1072. url: '/api/admin/supply-manage/delete',
  1073. method: 'post',
  1074. data: params
  1075. })
  1076. }
  1077. export function addSupplierRole(params) {
  1078. return request({
  1079. url: '/api/admin/supply-manage/add-role',
  1080. method: 'post',
  1081. data: params
  1082. })
  1083. }
  1084. export function removeSupplierRole(params) {
  1085. return request({
  1086. url: '/api/admin/supply-manage/remove-role',
  1087. method: 'post',
  1088. data: params
  1089. })
  1090. }
  1091. export function adjustSupplyTier(params) {
  1092. return request({
  1093. url: '/api/admin/supply-manage/adjust-tier',
  1094. method: 'post',
  1095. data: params
  1096. })
  1097. }
  1098. // 供应商层级关系管理
  1099. export function getSupplyHierarchyTree(systemId) {
  1100. return request({
  1101. url: '/api/admin/supply-hierarchy/tree',
  1102. method: 'post',
  1103. data: { systemId }
  1104. })
  1105. }
  1106. export function setSupplyHierarchy(data) {
  1107. return request({
  1108. url: '/api/admin/supply-hierarchy/set',
  1109. method: 'post',
  1110. data
  1111. })
  1112. }
  1113. export function removeSupplyHierarchy(data) {
  1114. return request({
  1115. url: '/api/admin/supply-hierarchy/remove',
  1116. method: 'post',
  1117. data
  1118. })
  1119. }
  1120. export function getSupplyHierarchyDirectChildren(data) {
  1121. return request({
  1122. url: '/api/admin/supply-hierarchy/direct-children',
  1123. method: 'post',
  1124. data
  1125. })
  1126. }
  1127. export function getSupplyHierarchyAllChildren(data) {
  1128. return request({
  1129. url: '/api/admin/supply-hierarchy/all-children',
  1130. method: 'post',
  1131. data
  1132. })
  1133. }
  1134. export function getSupplyHierarchyParent(data) {
  1135. return request({
  1136. url: '/api/admin/supply-hierarchy/parent',
  1137. method: 'post',
  1138. data
  1139. })
  1140. }
  1141. export function getSupplyHierarchyParentChain(data) {
  1142. return request({
  1143. url: '/api/admin/supply-hierarchy/parent-chain',
  1144. method: 'post',
  1145. data
  1146. })
  1147. }
  1148. export function getSupplyHierarchyMy(data) {
  1149. return request({
  1150. url: '/api/admin/supply-hierarchy/my',
  1151. method: 'post',
  1152. data
  1153. })
  1154. }
  1155. export function getSupplyHierarchyChangeRequests(data) {
  1156. return request({
  1157. url: '/api/admin/supply-hierarchy/change-requests',
  1158. method: 'post',
  1159. data
  1160. })
  1161. }
  1162. export function applySupplyHierarchyChange(data) {
  1163. return request({
  1164. url: '/api/admin/supply-hierarchy/change/apply',
  1165. method: 'post',
  1166. data
  1167. })
  1168. }
  1169. export function reviewSupplyHierarchyChange(data) {
  1170. return request({
  1171. url: '/api/admin/supply-hierarchy/change/review',
  1172. method: 'post',
  1173. data
  1174. })
  1175. }
  1176. // ========== 家庭会员订阅管理 API ==========
  1177. export function getSubscriptionList(params) {
  1178. return request({
  1179. url: '/api/admin/subscription/list',
  1180. method: 'post',
  1181. data: params
  1182. })
  1183. }
  1184. export function activateSubscription(data) {
  1185. return request({
  1186. url: '/api/admin/subscription/activate',
  1187. method: 'post',
  1188. data
  1189. })
  1190. }
  1191. export function cancelSubscriptionAdmin(data) {
  1192. return request({
  1193. url: '/api/admin/subscription/cancel',
  1194. method: 'post',
  1195. data
  1196. })
  1197. }
  1198. export function getBenefitConfig() {
  1199. return request({
  1200. url: '/api/admin/subscription/benefits',
  1201. method: 'post'
  1202. })
  1203. }
  1204. export function updateBenefitConfig(data) {
  1205. return request({
  1206. url: '/api/admin/subscription/benefits/update',
  1207. method: 'post',
  1208. data
  1209. })
  1210. }
  1211. // ========== 推广等级配置 API ==========
  1212. export function getPromotionTierList(params) {
  1213. return request({
  1214. url: '/api/admin/promotion/tier/list',
  1215. method: 'post',
  1216. data: params
  1217. })
  1218. }
  1219. export function adjustPromotionTier(data) {
  1220. return request({
  1221. url: '/api/admin/promotion/tier/adjust',
  1222. method: 'post',
  1223. data
  1224. })
  1225. }
  1226. // ========== 佣金/返利记录 API ==========
  1227. export function getCommissionRecords(params) {
  1228. return request({
  1229. url: '/api/admin/commission/records',
  1230. method: 'post',
  1231. data: params
  1232. })
  1233. }
  1234. export function settleCommission(data) {
  1235. return request({
  1236. url: '/api/admin/commission/settle',
  1237. method: 'post',
  1238. data
  1239. })
  1240. }
  1241. export function refundCommission(data) {
  1242. return request({
  1243. url: '/api/admin/commission/refund',
  1244. method: 'post',
  1245. data
  1246. })
  1247. }
  1248. // ========== 产品 P 点配置 API ==========
  1249. export function getProductPpointList(params) {
  1250. return request({
  1251. url: '/api/admin/product-ppoint/list',
  1252. method: 'post',
  1253. data: params
  1254. })
  1255. }
  1256. export function saveProductPpoint(data) {
  1257. return request({
  1258. url: '/api/admin/product-ppoint/save',
  1259. method: 'post',
  1260. data
  1261. })
  1262. }
  1263. export function deleteProductPpoint(data) {
  1264. return request({
  1265. url: '/api/admin/product-ppoint/delete',
  1266. method: 'post',
  1267. data
  1268. })
  1269. }
  1270. export function getProductPpointByProduct(data) {
  1271. return request({
  1272. url: '/api/admin/product-ppoint/by-product',
  1273. method: 'post',
  1274. data
  1275. })
  1276. }
  1277. // ========== 推广等级配置 (R0-R4) API ==========
  1278. export function getPromotionTierConfig() {
  1279. return request({
  1280. url: '/api/admin/promotion/config',
  1281. method: 'post'
  1282. })
  1283. }
  1284. export function updatePromotionTierConfig(data) {
  1285. return request({
  1286. url: '/api/admin/promotion/config/update',
  1287. method: 'post',
  1288. data
  1289. })
  1290. }
  1291. // ========== 待退款管理 API ==========
  1292. export function getPendingRefundList(params) {
  1293. return request({
  1294. url: '/api/admin/commission/refunds/pending',
  1295. method: 'post',
  1296. data: params
  1297. })
  1298. }
  1299. export function getPendingRefundSummary() {
  1300. return request({
  1301. url: '/api/admin/commission/refunds/summary',
  1302. method: 'post'
  1303. })
  1304. }
  1305. export function cancelPendingRefund(params) {
  1306. return request({
  1307. url: '/api/admin/commission/refunds/cancel',
  1308. method: 'post',
  1309. data: params
  1310. })
  1311. }
  1312. // ========== 佣金配置 API ==========
  1313. export function getCommissionConfig() {
  1314. return request({
  1315. url: '/api/admin/commission/config',
  1316. method: 'post'
  1317. })
  1318. }
  1319. export function updateCommissionConfig(data) {
  1320. return request({
  1321. url: '/api/admin/commission/config/update',
  1322. method: 'post',
  1323. data
  1324. })
  1325. }
  1326. // 电商供应商管理
  1327. export function getEcomSupplierList(params) {
  1328. return request({
  1329. url: '/api/admin/supplier/list',
  1330. method: 'post',
  1331. data: params
  1332. })
  1333. }
  1334. export function saveEcomSupplier(data) {
  1335. return request({
  1336. url: '/api/admin/supplier/save',
  1337. method: 'post',
  1338. data
  1339. })
  1340. }
  1341. export function updateEcomSupplier(data) {
  1342. return request({
  1343. url: '/api/admin/supplier/update',
  1344. method: 'post',
  1345. data
  1346. })
  1347. }
  1348. export function deleteEcomSupplier(id) {
  1349. return request({
  1350. url: '/api/admin/supplier/delete',
  1351. method: 'post',
  1352. data: { id }
  1353. })
  1354. }
  1355. // ===== 家庭收益管理 =====
  1356. export function getFamilyEarningsList() {
  1357. return request({
  1358. url: '/api/admin/earnings/families',
  1359. method: 'post',
  1360. data: {}
  1361. })
  1362. }
  1363. export function getFamilyEarningsDetail(familyId) {
  1364. return request({
  1365. url: '/api/admin/earnings/family/' + familyId + '/summary',
  1366. method: 'post',
  1367. data: { familyId: familyId }
  1368. })
  1369. }
  1370. export function getFamilyEarningsRecords(familyId, type) {
  1371. return request({
  1372. url: '/api/admin/earnings/family/' + familyId + '/records',
  1373. method: 'post',
  1374. data: { familyId: familyId, type: type || '' }
  1375. })
  1376. }