admin.js 27 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358
  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}`,
  19. method: 'put',
  20. data
  21. })
  22. }
  23. export function deleteUser(id) {
  24. return request({
  25. url: `/api/admin/users/${id}`,
  26. method: 'delete'
  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}`,
  53. method: 'put',
  54. data
  55. })
  56. }
  57. export function deleteFamily(id) {
  58. return request({
  59. url: `/api/admin/families/${id}`,
  60. method: 'delete'
  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}`,
  87. method: 'put',
  88. data
  89. })
  90. }
  91. export function deleteTaskTemplate(id) {
  92. return request({
  93. url: `/api/admin/task-templates/${id}`,
  94. method: 'delete'
  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}`,
  114. method: 'put',
  115. data
  116. })
  117. }
  118. export function deleteChild(id) {
  119. return request({
  120. url: `/api/admin/children/${id}`,
  121. method: 'delete'
  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}`,
  169. method: 'delete'
  170. })
  171. }
  172. export function updateRewardTemplate(id, data) {
  173. return request({
  174. url: `/api/admin/rewards/templates/${id}`,
  175. method: 'put',
  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',
  205. method: 'get',
  206. params
  207. })
  208. }
  209. // 获取待处理列表(家长)
  210. export function getPendingWishes(familyId) {
  211. return request({
  212. url: '/api/wishes/pending',
  213. method: 'get',
  214. params: { familyId }
  215. })
  216. }
  217. // 获取心愿详情
  218. export function getWishDetail(id) {
  219. return request({
  220. url: `/api/wishes/${id}`,
  221. method: 'get'
  222. })
  223. }
  224. // 家长定价
  225. export function setWishPrice(id, pointsRequired) {
  226. return request({
  227. url: `/api/wishes/${id}/set-price`,
  228. method: 'put',
  229. data: { pointsRequired }
  230. })
  231. }
  232. // 家长拒绝心愿
  233. export function rejectWish(id, reason) {
  234. return request({
  235. url: `/api/wishes/${id}/reject`,
  236. method: 'put',
  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: 'put',
  245. data: { approved, reason }
  246. })
  247. }
  248. // 家长标记已购买
  249. export function markWishFulfilled(id) {
  250. return request({
  251. url: `/api/wishes/${id}/fulfill`,
  252. method: 'put'
  253. })
  254. }
  255. // 取消心愿
  256. export function deleteWish(id, reason) {
  257. return request({
  258. url: `/api/wishes/${id}`,
  259. method: 'delete',
  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}`,
  290. method: 'delete'
  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 getPendingGuideCount() {
  335. return request({
  336. url: '/api/admin/guide/pending-count',
  337. method: 'post'
  338. })
  339. }
  340. export function getPendingPackageCount() {
  341. return request({
  342. url: '/api/admin/package/pending-count',
  343. method: 'post'
  344. })
  345. }
  346. // 管理员个人信息
  347. export function updateAdminInfo(data) {
  348. return request({
  349. url: '/api/admin-auth/update-info',
  350. method: 'post',
  351. data
  352. })
  353. }
  354. // ========== 管理后台仪表盘汇总 API ==========
  355. export function getDashboardStats() {
  356. return request({
  357. url: '/api/stats/dashboard',
  358. method: 'post'
  359. })
  360. }
  361. export function getDashboardOverview() {
  362. return request({
  363. url: '/api/stats/overview',
  364. method: 'post'
  365. })
  366. }
  367. export function getRevenueStats() {
  368. return request({
  369. url: '/api/stats/revenue',
  370. method: 'post'
  371. })
  372. }
  373. export function getMembershipStats() {
  374. return request({
  375. url: '/api/stats/membership',
  376. method: 'post'
  377. })
  378. }
  379. export function getTrendStats() {
  380. return request({
  381. url: '/api/stats/trend',
  382. method: 'post',
  383. data: {}
  384. })
  385. }
  386. // ========== 商品管理 API ==========
  387. export function getProductList(params) {
  388. return request({
  389. url: '/api/admin/product/list',
  390. method: 'post',
  391. data: params
  392. })
  393. }
  394. export function reviewProduct(productId, data) {
  395. return request({
  396. url: '/api/admin/product/review',
  397. method: 'post',
  398. data: { productId, ...data }
  399. })
  400. }
  401. export function shelveProduct(productId, data) {
  402. return request({
  403. url: '/api/admin/product/shelve',
  404. method: 'post',
  405. data: { productId, ...data }
  406. })
  407. }
  408. export function getProduct(id) {
  409. return request({
  410. url: '/api/admin/product/detail',
  411. method: 'post',
  412. data: { productId: id }
  413. })
  414. }
  415. export function createProduct(data) {
  416. return request({
  417. url: '/api/admin/product/create',
  418. method: 'post',
  419. data
  420. })
  421. }
  422. export function updateProduct(data) {
  423. return request({
  424. url: '/api/admin/product/update',
  425. method: 'post',
  426. data
  427. })
  428. }
  429. export function deleteProduct(id) {
  430. return request({
  431. url: '/api/admin/product/delete',
  432. method: 'post',
  433. data: { productId: id }
  434. })
  435. }
  436. // ========== SKU 管理 API ==========
  437. export function getProductSkuList(productId) {
  438. return request({
  439. url: '/api/admin/product/sku/list',
  440. method: 'post',
  441. data: { productId }
  442. })
  443. }
  444. export function createProductSku(data) {
  445. return request({
  446. url: '/api/admin/product/sku/create',
  447. method: 'post',
  448. data
  449. })
  450. }
  451. export function updateProductSku(data) {
  452. return request({
  453. url: '/api/admin/product/sku/update',
  454. method: 'post',
  455. data
  456. })
  457. }
  458. export function deleteProductSku(id) {
  459. return request({
  460. url: '/api/admin/product/sku/delete',
  461. method: 'post',
  462. data: { id }
  463. })
  464. }
  465. // ========== 购买信息采集 API ==========
  466. export function getPredefinedPurchaseFields() {
  467. return request({
  468. url: '/api/admin/product/purchase_fields/predefined',
  469. method: 'post'
  470. })
  471. }
  472. export function getProductPurchaseFields(productId) {
  473. return request({
  474. url: '/api/admin/product/purchase_fields/list',
  475. method: 'post',
  476. data: { productId }
  477. })
  478. }
  479. export function saveProductPurchaseFields(productId, fields) {
  480. return request({
  481. url: '/api/admin/product/purchase_fields/save',
  482. method: 'post',
  483. data: { productId, fields }
  484. })
  485. }
  486. // ========== 分类管理 API ==========
  487. export function getCategoryTree(includeDisabled) {
  488. return request({
  489. url: '/api/admin/shop/category/tree',
  490. method: 'post',
  491. data: { includeDisabled }
  492. })
  493. }
  494. export function createCategory(data) {
  495. return request({
  496. url: '/api/admin/shop/category/create',
  497. method: 'post',
  498. data
  499. })
  500. }
  501. export function updateCategory(data) {
  502. return request({
  503. url: '/api/admin/shop/category/update',
  504. method: 'post',
  505. data
  506. })
  507. }
  508. export function deleteCategory(id) {
  509. return request({
  510. url: '/api/admin/shop/category/delete',
  511. method: 'post',
  512. data: { id }
  513. })
  514. }
  515. export function toggleCategory(id) {
  516. return request({
  517. url: '/api/admin/shop/category/toggle',
  518. method: 'post',
  519. data: { id }
  520. })
  521. }
  522. // ========== 订单管理 API ==========
  523. export function getOrderList(params) {
  524. return request({
  525. url: '/api/admin/product/order/list',
  526. method: 'post',
  527. data: params
  528. })
  529. }
  530. export function getOrderDetail(orderNo) {
  531. return request({
  532. url: '/api/admin/product/order/detail',
  533. method: 'post',
  534. data: { orderNo }
  535. })
  536. }
  537. export function shipOrder(orderNo, trackingNumber, expressCompany) {
  538. return request({
  539. url: '/api/admin/product/order/ship',
  540. method: 'post',
  541. data: { orderNo, trackingNumber, expressCompany }
  542. })
  543. }
  544. export function closeOrder(orderNo) {
  545. return request({
  546. url: '/api/admin/product/order/close',
  547. method: 'post',
  548. data: { orderNo }
  549. })
  550. }
  551. export function approveRefund(orderNo) {
  552. return request({
  553. url: '/api/admin/product/order/refund/approve',
  554. method: 'post',
  555. data: { orderNo }
  556. })
  557. }
  558. export function rejectRefund(orderNo, reason) {
  559. return request({
  560. url: '/api/admin/product/order/refund/reject',
  561. method: 'post',
  562. data: { orderNo, reason }
  563. })
  564. }
  565. // ========== 系统配置 API ==========
  566. export function getSysConfigList(params) {
  567. return request({
  568. url: '/api/admin/config/list',
  569. method: 'post',
  570. data: params
  571. })
  572. }
  573. export function createSysConfig(data) {
  574. return request({
  575. url: '/api/admin/config/update',
  576. method: 'post',
  577. data: { configKey: data.configKey, configValue: data.configValue }
  578. })
  579. }
  580. export function updateSysConfig(id, data) {
  581. return request({
  582. url: '/api/admin/config/update',
  583. method: 'post',
  584. data: { configKey: data.configKey, configValue: data.configValue }
  585. })
  586. }
  587. export function deleteSysConfig(id) {
  588. return request({
  589. url: `/api/admin/config/delete/${id}`,
  590. method: 'delete'
  591. })
  592. }
  593. // ========== 分佣裂变系统 API ==========
  594. export function getWithdrawalList(params) {
  595. return request({
  596. url: '/api/admin/commission/withdrawals',
  597. method: 'post',
  598. data: params
  599. })
  600. }
  601. export function auditWithdrawal(requestId, status, remark) {
  602. return request({
  603. url: '/api/admin/commission/audit',
  604. method: 'post',
  605. data: { requestId, status, remark }
  606. })
  607. }
  608. export function updateProductProfitRate(productId, profitRate) {
  609. return request({
  610. url: '/api/admin/commission/update-profit-rate',
  611. method: 'post',
  612. data: { productId, profitRate }
  613. })
  614. }
  615. // ========== 教育体系管理 API ==========
  616. export function getEducationSystems() {
  617. return request({
  618. url: '/api/admin/education-systems/list',
  619. method: 'post'
  620. })
  621. }
  622. export function getAllEducationSystems() {
  623. return request({
  624. url: '/api/admin/education-systems/all',
  625. method: 'post'
  626. })
  627. }
  628. export function createEducationSystem(data) {
  629. return request({
  630. url: '/api/admin/education-systems/create',
  631. method: 'post',
  632. data
  633. })
  634. }
  635. export function updateEducationSystem(data) {
  636. return request({
  637. url: '/api/admin/education-systems/update',
  638. method: 'post',
  639. data
  640. })
  641. }
  642. export function deleteEducationSystem(id) {
  643. return request({
  644. url: '/api/admin/education-systems/delete',
  645. method: 'post',
  646. data: { id }
  647. })
  648. }
  649. // ========== 星座配置管理 API ==========
  650. export function listZodiacConfigs() {
  651. return request({
  652. url: '/api/admin/zodiac-config/list',
  653. method: 'post'
  654. })
  655. }
  656. export function createZodiacConfig(data) {
  657. return request({
  658. url: '/api/admin/zodiac-config/create',
  659. method: 'post',
  660. data
  661. })
  662. }
  663. export function updateZodiacConfig(data) {
  664. return request({
  665. url: '/api/admin/zodiac-config/update',
  666. method: 'post',
  667. data
  668. })
  669. }
  670. export function deleteZodiacConfig(id) {
  671. return request({
  672. url: '/api/admin/zodiac-config/delete',
  673. method: 'post',
  674. data: { id }
  675. })
  676. }
  677. // ========== 八字配置管理 API ==========
  678. export function listBaziConfigs() {
  679. return request({
  680. url: '/api/admin/bazi-config/list',
  681. method: 'post'
  682. })
  683. }
  684. export function createBaziConfig(data) {
  685. return request({
  686. url: '/api/admin/bazi-config/create',
  687. method: 'post',
  688. data
  689. })
  690. }
  691. export function updateBaziConfig(data) {
  692. return request({
  693. url: '/api/admin/bazi-config/update',
  694. method: 'post',
  695. data
  696. })
  697. }
  698. export function deleteBaziConfig(id) {
  699. return request({
  700. url: '/api/admin/bazi-config/delete',
  701. method: 'post',
  702. data: { id }
  703. })
  704. }
  705. // ========== 血型配置管理 API ==========
  706. export function listBloodTypeConfigs() {
  707. return request({
  708. url: '/api/admin/blood-type-config/list',
  709. method: 'post'
  710. })
  711. }
  712. export function createBloodTypeConfig(data) {
  713. return request({
  714. url: '/api/admin/blood-type-config/create',
  715. method: 'post',
  716. data
  717. })
  718. }
  719. export function updateBloodTypeConfig(data) {
  720. return request({
  721. url: '/api/admin/blood-type-config/update',
  722. method: 'post',
  723. data
  724. })
  725. }
  726. export function deleteBloodTypeConfig(id) {
  727. return request({
  728. url: '/api/admin/blood-type-config/delete',
  729. method: 'post',
  730. data: { id }
  731. })
  732. }
  733. // ========== 服务器运行状态 ==========
  734. export function getSystemHealth() {
  735. return request({
  736. url: '/api/system/health',
  737. method: 'post'
  738. })
  739. }
  740. // 关系类型管理
  741. export function listRelationshipTypes() {
  742. return request({
  743. url: '/api/admin/relationship-type/list',
  744. method: 'post'
  745. })
  746. }
  747. export function saveRelationshipType(data) {
  748. return request({
  749. url: '/api/admin/relationship-type/save',
  750. method: 'post',
  751. data
  752. })
  753. }
  754. export function deleteRelationshipType(id) {
  755. return request({
  756. url: '/api/admin/relationship-type/delete',
  757. method: 'post',
  758. data: { id }
  759. })
  760. }
  761. // ========== 虚拟服务商团队管理 API ==========
  762. export function listVirtualTeams(params) {
  763. return request({
  764. url: '/api/admin/virtual-team/list',
  765. method: 'post',
  766. data: params
  767. })
  768. }
  769. export function createVirtualTeam(data) {
  770. return request({
  771. url: '/api/admin/virtual-team/create',
  772. method: 'post',
  773. data
  774. })
  775. }
  776. export function updateVirtualTeam(data) {
  777. return request({
  778. url: '/api/admin/virtual-team/update',
  779. method: 'post',
  780. data
  781. })
  782. }
  783. export function toggleVirtualTeam(id) {
  784. return request({
  785. url: '/api/admin/virtual-team/toggle',
  786. method: 'post',
  787. data: { id }
  788. })
  789. }
  790. export function getVirtualTeamMembers(systemId) {
  791. return request({
  792. url: '/api/admin/virtual-team/members',
  793. method: 'post',
  794. data: { systemId }
  795. })
  796. }
  797. export function addVirtualTeamMember(data) {
  798. return request({
  799. url: '/api/admin/virtual-team/add-member',
  800. method: 'post',
  801. data
  802. })
  803. }
  804. export function removeVirtualTeamMember(id) {
  805. return request({
  806. url: '/api/admin/virtual-team/remove-member',
  807. method: 'post',
  808. data: { id }
  809. })
  810. }
  811. export function updateVirtualTeamMember(data) {
  812. return request({
  813. url: '/api/admin/virtual-team/update-member',
  814. method: 'post',
  815. data
  816. })
  817. }
  818. export function getVirtualTeamTree(systemId) {
  819. return request({
  820. url: '/api/admin/virtual-team/tree',
  821. method: 'post',
  822. data: { systemId }
  823. })
  824. }
  825. export function searchUsers(params) {
  826. return request({
  827. url: '/api/admin/user/search',
  828. method: 'post',
  829. data: params
  830. })
  831. }
  832. // ========== 情绪告警管理 API ==========
  833. export function getEmotionAlertList(params) {
  834. return request({
  835. url: '/api/mind/alert/admin/list',
  836. method: 'post',
  837. data: params
  838. })
  839. }
  840. export function resolveEmotionAlert(alertId) {
  841. return request({
  842. url: '/api/mind/alert/resolve',
  843. method: 'post',
  844. data: { alertId, source: 'checkin' }
  845. })
  846. }
  847. // ========== 食材管理 API ==========
  848. export function getFoodList(params) {
  849. return request({
  850. url: '/api/admin/foods/list',
  851. method: 'post',
  852. data: params
  853. })
  854. }
  855. export function createFood(data) {
  856. return request({
  857. url: '/api/admin/foods/create',
  858. method: 'post',
  859. data
  860. })
  861. }
  862. export function updateFood(data) {
  863. return request({
  864. url: '/api/admin/foods/update',
  865. method: 'post',
  866. data
  867. })
  868. }
  869. export function deleteFood(id) {
  870. return request({
  871. url: '/api/admin/foods/delete',
  872. method: 'post',
  873. data: { id }
  874. })
  875. }
  876. export function getFoodDetail(id) {
  877. return request({
  878. url: '/api/admin/foods/detail',
  879. method: 'post',
  880. data: { id }
  881. })
  882. }
  883. export function saveFoodMonths(id, months) {
  884. return request({
  885. url: '/api/admin/foods/saveMonths',
  886. method: 'post',
  887. data: { id, months }
  888. })
  889. }
  890. // 供应商体系管理
  891. export function getSupplySystemList(params) {
  892. return request({
  893. url: '/api/admin/supply-system/list',
  894. method: 'post',
  895. data: params || {}
  896. })
  897. }
  898. export function getSupplySystemDetail(id) {
  899. return request({
  900. url: '/api/admin/supply-system/detail',
  901. method: 'post',
  902. data: { id }
  903. })
  904. }
  905. export function createSupplySystem(data) {
  906. return request({
  907. url: '/api/admin/supply-system/create',
  908. method: 'post',
  909. data
  910. })
  911. }
  912. export function updateSupplySystem(data) {
  913. return request({
  914. url: '/api/admin/supply-system/update',
  915. method: 'post',
  916. data
  917. })
  918. }
  919. export function toggleSupplySystemStatus(id) {
  920. return request({
  921. url: '/api/admin/supply-system/toggle-status',
  922. method: 'post',
  923. data: { id }
  924. })
  925. }
  926. export function listAllSupplySystems() {
  927. return request({
  928. url: '/api/admin/supply-system/list-all',
  929. method: 'post'
  930. })
  931. }
  932. export function getSupplySystemMembers(systemId) {
  933. return request({
  934. url: '/api/admin/supply-system/member/list',
  935. method: 'post',
  936. data: { systemId }
  937. })
  938. }
  939. export function addSupplySystemMember(systemId, userId) {
  940. return request({
  941. url: '/api/admin/supply-system/member/add',
  942. method: 'post',
  943. data: { systemId, userId }
  944. })
  945. }
  946. export function removeSupplySystemMember(memberId) {
  947. return request({
  948. url: '/api/admin/supply-system/member/remove',
  949. method: 'post',
  950. data: { memberId }
  951. })
  952. }
  953. export function changeSupplySystemMemberRole(memberId, role) {
  954. return request({
  955. url: '/api/admin/supply-system/member/change-role',
  956. method: 'post',
  957. data: { memberId, role }
  958. })
  959. }
  960. // 结算管理
  961. export function getSupplySettlementList(params) {
  962. return request({
  963. url: '/api/admin/supply-settlement/list',
  964. method: 'post',
  965. data: params || {}
  966. })
  967. }
  968. export function getSupplySettlementDetail(id) {
  969. return request({
  970. url: '/api/admin/supply-settlement/detail',
  971. method: 'post',
  972. data: { id }
  973. })
  974. }
  975. export function getSupplySettlementDetailItems(settlementId) {
  976. return request({
  977. url: '/api/admin/supply-settlement/detail-items',
  978. method: 'post',
  979. data: { settlementId }
  980. })
  981. }
  982. export function createSupplySettlement(systemId, periodStart, periodEnd, remark) {
  983. return request({
  984. url: '/api/admin/supply-settlement/create',
  985. method: 'post',
  986. data: { systemId, periodStart, periodEnd, remark }
  987. })
  988. }
  989. export function confirmSupplySettlement(id) {
  990. return request({
  991. url: '/api/admin/supply-settlement/confirm',
  992. method: 'post',
  993. data: { id }
  994. })
  995. }
  996. // ========== 供应商管理 (supplier_admin) ==========
  997. export function getSupplyManageList(params) {
  998. return request({
  999. url: '/api/admin/supply-manage/list',
  1000. method: 'post',
  1001. data: params
  1002. })
  1003. }
  1004. export function getSupplyManageDetail(params) {
  1005. return request({
  1006. url: '/api/admin/supply-manage/detail',
  1007. method: 'post',
  1008. data: params
  1009. })
  1010. }
  1011. export function createSupplyManage(params) {
  1012. return request({
  1013. url: '/api/admin/supply-manage/create',
  1014. method: 'post',
  1015. data: params
  1016. })
  1017. }
  1018. export function updateSupplyManage(params) {
  1019. return request({
  1020. url: '/api/admin/supply-manage/update',
  1021. method: 'post',
  1022. data: params
  1023. })
  1024. }
  1025. export function deleteSupplyManage(params) {
  1026. return request({
  1027. url: '/api/admin/supply-manage/delete',
  1028. method: 'post',
  1029. data: params
  1030. })
  1031. }
  1032. export function addSupplierRole(params) {
  1033. return request({
  1034. url: '/api/admin/supply-manage/add-role',
  1035. method: 'post',
  1036. data: params
  1037. })
  1038. }
  1039. export function removeSupplierRole(params) {
  1040. return request({
  1041. url: '/api/admin/supply-manage/remove-role',
  1042. method: 'post',
  1043. data: params
  1044. })
  1045. }
  1046. export function adjustSupplyTier(params) {
  1047. return request({
  1048. url: '/api/admin/supply-manage/adjust-tier',
  1049. method: 'post',
  1050. data: params
  1051. })
  1052. }
  1053. // ========== 家庭会员订阅管理 API ==========
  1054. export function getSubscriptionList(params) {
  1055. return request({
  1056. url: '/api/admin/subscription/list',
  1057. method: 'post',
  1058. data: params
  1059. })
  1060. }
  1061. export function activateSubscription(data) {
  1062. return request({
  1063. url: '/api/admin/subscription/activate',
  1064. method: 'post',
  1065. data
  1066. })
  1067. }
  1068. export function cancelSubscriptionAdmin(data) {
  1069. return request({
  1070. url: '/api/admin/subscription/cancel',
  1071. method: 'post',
  1072. data
  1073. })
  1074. }
  1075. export function getBenefitConfig() {
  1076. return request({
  1077. url: '/api/admin/subscription/benefits',
  1078. method: 'get'
  1079. })
  1080. }
  1081. export function updateBenefitConfig(data) {
  1082. return request({
  1083. url: '/api/admin/subscription/benefits/update',
  1084. method: 'post',
  1085. data
  1086. })
  1087. }
  1088. // ========== 推广等级配置 API ==========
  1089. export function getPromotionTierList(params) {
  1090. return request({
  1091. url: '/api/admin/promotion/tier/list',
  1092. method: 'post',
  1093. data: params
  1094. })
  1095. }
  1096. export function adjustPromotionTier(data) {
  1097. return request({
  1098. url: '/api/admin/promotion/tier/adjust',
  1099. method: 'post',
  1100. data
  1101. })
  1102. }
  1103. // ========== 佣金/分润记录 API ==========
  1104. export function getCommissionRecords(params) {
  1105. return request({
  1106. url: '/api/admin/commission/records',
  1107. method: 'post',
  1108. data: params
  1109. })
  1110. }
  1111. export function settleCommission(data) {
  1112. return request({
  1113. url: '/api/admin/commission/settle',
  1114. method: 'post',
  1115. data
  1116. })
  1117. }
  1118. export function refundCommission(data) {
  1119. return request({
  1120. url: '/api/admin/commission/refund',
  1121. method: 'post',
  1122. data
  1123. })
  1124. }
  1125. // ========== 产品 P 点配置 API ==========
  1126. export function getPpointProductList(params) {
  1127. return request({
  1128. url: '/api/admin/ppoint/products',
  1129. method: 'post',
  1130. data: params
  1131. })
  1132. }
  1133. export function updateProductPpoint(data) {
  1134. return request({
  1135. url: '/api/admin/ppoint/update',
  1136. method: 'post',
  1137. data
  1138. })
  1139. }
  1140. // ========== 推广等级配置 (R0-R4) API ==========
  1141. export function getPromotionTierConfig() {
  1142. return request({
  1143. url: '/api/admin/promotion/config',
  1144. method: 'get'
  1145. })
  1146. }
  1147. export function updatePromotionTierConfig(data) {
  1148. return request({
  1149. url: '/api/admin/promotion/config/update',
  1150. method: 'post',
  1151. data
  1152. })
  1153. }
  1154. // ========== 佣金配置 API ==========
  1155. export function getCommissionConfig() {
  1156. return request({
  1157. url: '/api/admin/commission/config',
  1158. method: 'get'
  1159. })
  1160. }
  1161. export function updateCommissionConfig(data) {
  1162. return request({
  1163. url: '/api/admin/commission/config/update',
  1164. method: 'post',
  1165. data
  1166. })
  1167. }