admin.js 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775
  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. export function copyProduct(id) {
  467. return request({
  468. url: '/api/admin/product/copy',
  469. method: 'post',
  470. data: { productId: id }
  471. })
  472. }
  473. export function getGrowthArchiveProduct(productId) {
  474. return request({
  475. url: '/api/admin/growth-archive-product/detail',
  476. method: 'post',
  477. data: { productId }
  478. })
  479. }
  480. export function saveGrowthArchiveProduct(data) {
  481. return request({
  482. url: '/api/admin/growth-archive-product/save',
  483. method: 'post',
  484. data
  485. })
  486. }
  487. // ========== SKU 管理 API ==========
  488. export function getProductSkuList(productId) {
  489. return request({
  490. url: '/api/admin/product/sku/list',
  491. method: 'post',
  492. data: { productId }
  493. })
  494. }
  495. export function createProductSku(data) {
  496. return request({
  497. url: '/api/admin/product/sku/create',
  498. method: 'post',
  499. data
  500. })
  501. }
  502. export function updateProductSku(data) {
  503. return request({
  504. url: '/api/admin/product/sku/update',
  505. method: 'post',
  506. data
  507. })
  508. }
  509. export function deleteProductSku(id) {
  510. return request({
  511. url: '/api/admin/product/sku/delete',
  512. method: 'post',
  513. data: { id }
  514. })
  515. }
  516. // ========== 购买信息采集 API ==========
  517. export function getPredefinedPurchaseFields() {
  518. return request({
  519. url: '/api/admin/product/purchase_fields/predefined',
  520. method: 'post'
  521. })
  522. }
  523. export function getProductPurchaseFields(productId) {
  524. return request({
  525. url: '/api/admin/product/purchase_fields/list',
  526. method: 'post',
  527. data: { productId }
  528. })
  529. }
  530. export function saveProductPurchaseFields(productId, fields) {
  531. return request({
  532. url: '/api/admin/product/purchase_fields/save',
  533. method: 'post',
  534. data: { productId, fields }
  535. })
  536. }
  537. export function saveProductGiftRule(productId, status, levelCode) {
  538. return request({
  539. url: '/api/admin/product-gift-rule/save',
  540. method: 'post',
  541. data: { productId, status, levelCode }
  542. })
  543. }
  544. export function listProductGiftRules(productId) {
  545. return request({
  546. url: '/api/admin/product-gift-rule/list',
  547. method: 'post',
  548. data: { productId }
  549. })
  550. }
  551. export function listMembershipLevels() {
  552. return request({
  553. url: '/api/membership/levels',
  554. method: 'post'
  555. })
  556. }
  557. // ========== 分类管理 API ==========
  558. export function getCategoryTree(includeDisabled) {
  559. return request({
  560. url: '/api/admin/shop/category/tree',
  561. method: 'post',
  562. data: { includeDisabled }
  563. })
  564. }
  565. export function createCategory(data) {
  566. return request({
  567. url: '/api/admin/shop/category/create',
  568. method: 'post',
  569. data
  570. })
  571. }
  572. export function updateCategory(data) {
  573. return request({
  574. url: '/api/admin/shop/category/update',
  575. method: 'post',
  576. data
  577. })
  578. }
  579. export function deleteCategory(id) {
  580. return request({
  581. url: '/api/admin/shop/category/delete',
  582. method: 'post',
  583. data: { id }
  584. })
  585. }
  586. export function toggleCategory(id) {
  587. return request({
  588. url: '/api/admin/shop/category/toggle',
  589. method: 'post',
  590. data: { id }
  591. })
  592. }
  593. // ========== 订单管理 API ==========
  594. export function getOrderList(params) {
  595. return request({
  596. url: '/api/admin/product/order/list',
  597. method: 'post',
  598. data: params
  599. })
  600. }
  601. export function getOrderDetail(orderNo) {
  602. return request({
  603. url: '/api/admin/product/order/detail',
  604. method: 'post',
  605. data: { orderNo }
  606. })
  607. }
  608. export function shipOrder(orderNo, trackingNumber, expressCompany) {
  609. return request({
  610. url: '/api/admin/product/order/ship',
  611. method: 'post',
  612. data: { orderNo, trackingNumber, expressCompany }
  613. })
  614. }
  615. export function closeOrder(orderNo) {
  616. return request({
  617. url: '/api/admin/product/order/close',
  618. method: 'post',
  619. data: { orderNo }
  620. })
  621. }
  622. export function approveRefund(orderNo) {
  623. return request({
  624. url: '/api/admin/product/order/refund/approve',
  625. method: 'post',
  626. data: { orderNo }
  627. })
  628. }
  629. export function rejectRefund(orderNo, reason) {
  630. return request({
  631. url: '/api/admin/product/order/refund/reject',
  632. method: 'post',
  633. data: { orderNo, reason }
  634. })
  635. }
  636. // ========== 系统配置 API ==========
  637. export function getSysConfigList(params) {
  638. return request({
  639. url: '/api/admin/config/list',
  640. method: 'post',
  641. data: params
  642. })
  643. }
  644. export function createSysConfig(data) {
  645. return request({
  646. url: '/api/admin/config/update',
  647. method: 'post',
  648. data: { configKey: data.configKey, configValue: data.configValue }
  649. })
  650. }
  651. export function updateSysConfig(id, data) {
  652. return request({
  653. url: '/api/admin/config/update',
  654. method: 'post',
  655. data: { configKey: data.configKey, configValue: data.configValue }
  656. })
  657. }
  658. export function deleteSysConfig(id) {
  659. return request({
  660. url: `/api/admin/config/delete/${id}`,
  661. method: 'post'
  662. })
  663. }
  664. // ========== 佣金推荐系统 API ==========
  665. export function getWithdrawalList(params) {
  666. return request({
  667. url: '/api/admin/commission/withdrawals',
  668. method: 'post',
  669. data: params
  670. })
  671. }
  672. export function auditWithdrawal(requestId, status, remark) {
  673. return request({
  674. url: '/api/admin/commission/audit',
  675. method: 'post',
  676. data: { requestId, status, remark }
  677. })
  678. }
  679. export function updateProductProfitRate(productId, profitRate) {
  680. return request({
  681. url: '/api/admin/commission/update-profit-rate',
  682. method: 'post',
  683. data: { productId, profitRate }
  684. })
  685. }
  686. // ========== 星座配置管理 API ==========
  687. export function listZodiacConfigs() {
  688. return request({
  689. url: '/api/admin/zodiac-config/list',
  690. method: 'post'
  691. })
  692. }
  693. export function createZodiacConfig(data) {
  694. return request({
  695. url: '/api/admin/zodiac-config/create',
  696. method: 'post',
  697. data
  698. })
  699. }
  700. export function updateZodiacConfig(data) {
  701. return request({
  702. url: '/api/admin/zodiac-config/update',
  703. method: 'post',
  704. data
  705. })
  706. }
  707. export function deleteZodiacConfig(id) {
  708. return request({
  709. url: '/api/admin/zodiac-config/delete',
  710. method: 'post',
  711. data: { id }
  712. })
  713. }
  714. // ========== 八字配置管理 API ==========
  715. export function listBaziConfigs() {
  716. return request({
  717. url: '/api/admin/bazi-config/list',
  718. method: 'post'
  719. })
  720. }
  721. export function createBaziConfig(data) {
  722. return request({
  723. url: '/api/admin/bazi-config/create',
  724. method: 'post',
  725. data
  726. })
  727. }
  728. export function updateBaziConfig(data) {
  729. return request({
  730. url: '/api/admin/bazi-config/update',
  731. method: 'post',
  732. data
  733. })
  734. }
  735. export function deleteBaziConfig(id) {
  736. return request({
  737. url: '/api/admin/bazi-config/delete',
  738. method: 'post',
  739. data: { id }
  740. })
  741. }
  742. // ========== 血型配置管理 API ==========
  743. export function listBloodTypeConfigs() {
  744. return request({
  745. url: '/api/admin/blood-type-config/list',
  746. method: 'post'
  747. })
  748. }
  749. export function createBloodTypeConfig(data) {
  750. return request({
  751. url: '/api/admin/blood-type-config/create',
  752. method: 'post',
  753. data
  754. })
  755. }
  756. export function updateBloodTypeConfig(data) {
  757. return request({
  758. url: '/api/admin/blood-type-config/update',
  759. method: 'post',
  760. data
  761. })
  762. }
  763. export function deleteBloodTypeConfig(id) {
  764. return request({
  765. url: '/api/admin/blood-type-config/delete',
  766. method: 'post',
  767. data: { id }
  768. })
  769. }
  770. // ========== 服务器运行状态 ==========
  771. export function getSystemHealth() {
  772. return request({
  773. url: '/api/system/health',
  774. method: 'post'
  775. })
  776. }
  777. // ========== 虚拟服务商团队管理 API ==========
  778. export function listVirtualTeams(params) {
  779. return request({
  780. url: '/api/admin/virtual-team/list',
  781. method: 'post',
  782. data: params
  783. })
  784. }
  785. export function createVirtualTeam(data) {
  786. return request({
  787. url: '/api/admin/virtual-team/create',
  788. method: 'post',
  789. data
  790. })
  791. }
  792. export function updateVirtualTeam(data) {
  793. return request({
  794. url: '/api/admin/virtual-team/update',
  795. method: 'post',
  796. data
  797. })
  798. }
  799. export function toggleVirtualTeam(id) {
  800. return request({
  801. url: '/api/admin/virtual-team/toggle',
  802. method: 'post',
  803. data: { id }
  804. })
  805. }
  806. export function getVirtualTeamMembers(systemId) {
  807. return request({
  808. url: '/api/admin/virtual-team/members',
  809. method: 'post',
  810. data: { systemId }
  811. })
  812. }
  813. export function addVirtualTeamMember(data) {
  814. return request({
  815. url: '/api/admin/virtual-team/add-member',
  816. method: 'post',
  817. data
  818. })
  819. }
  820. export function removeVirtualTeamMember(id) {
  821. return request({
  822. url: '/api/admin/virtual-team/remove-member',
  823. method: 'post',
  824. data: { id }
  825. })
  826. }
  827. export function updateVirtualTeamMember(data) {
  828. return request({
  829. url: '/api/admin/virtual-team/update-member',
  830. method: 'post',
  831. data
  832. })
  833. }
  834. export function getVirtualTeamTree(systemId) {
  835. return request({
  836. url: '/api/admin/virtual-team/tree',
  837. method: 'post',
  838. data: { systemId }
  839. })
  840. }
  841. export function searchUsers(params) {
  842. return request({
  843. url: '/api/admin/user/search',
  844. method: 'post',
  845. data: params
  846. })
  847. }
  848. // ========== 情绪告警管理 API ==========
  849. export function getEmotionAlertList(params) {
  850. return request({
  851. url: '/api/mind/alert/admin/list',
  852. method: 'post',
  853. data: params
  854. })
  855. }
  856. export function resolveEmotionAlert(alertId) {
  857. return request({
  858. url: '/api/mind/alert/resolve',
  859. method: 'post',
  860. data: { alertId, source: 'checkin' }
  861. })
  862. }
  863. // ========== 食材管理 API ==========
  864. export function getFoodList(params) {
  865. return request({
  866. url: '/api/admin/foods/list',
  867. method: 'post',
  868. data: params
  869. })
  870. }
  871. export function createFood(data) {
  872. return request({
  873. url: '/api/admin/foods/create',
  874. method: 'post',
  875. data
  876. })
  877. }
  878. export function updateFood(data) {
  879. return request({
  880. url: '/api/admin/foods/update',
  881. method: 'post',
  882. data
  883. })
  884. }
  885. export function deleteFood(id) {
  886. return request({
  887. url: '/api/admin/foods/delete',
  888. method: 'post',
  889. data: { id }
  890. })
  891. }
  892. export function getFoodDetail(id) {
  893. return request({
  894. url: '/api/admin/foods/detail',
  895. method: 'post',
  896. data: { id }
  897. })
  898. }
  899. export function saveFoodMonths(id, months) {
  900. return request({
  901. url: '/api/admin/foods/saveMonths',
  902. method: 'post',
  903. data: { id, months }
  904. })
  905. }
  906. // 供应商体系管理
  907. export function getSupplySystemList(params) {
  908. return request({
  909. url: '/api/admin/supply-system/list',
  910. method: 'post',
  911. data: params || {}
  912. })
  913. }
  914. export function getSupplySystemDetail(id) {
  915. return request({
  916. url: '/api/admin/supply-system/detail',
  917. method: 'post',
  918. data: { id }
  919. })
  920. }
  921. export function createSupplySystem(data) {
  922. return request({
  923. url: '/api/admin/supply-system/create',
  924. method: 'post',
  925. data
  926. })
  927. }
  928. export function updateSupplySystem(data) {
  929. return request({
  930. url: '/api/admin/supply-system/update',
  931. method: 'post',
  932. data
  933. })
  934. }
  935. export function toggleSupplySystemStatus(id) {
  936. return request({
  937. url: '/api/admin/supply-system/toggle-status',
  938. method: 'post',
  939. data: { id }
  940. })
  941. }
  942. export function listAllSupplySystems() {
  943. return request({
  944. url: '/api/admin/supply-system/list-all',
  945. method: 'post'
  946. })
  947. }
  948. export function getSupplySystemMembers(systemId) {
  949. return request({
  950. url: '/api/admin/supply-system/member/list',
  951. method: 'post',
  952. data: { systemId }
  953. })
  954. }
  955. export function addSupplySystemMember(systemId, userId) {
  956. return request({
  957. url: '/api/admin/supply-system/member/add',
  958. method: 'post',
  959. data: { systemId, userId }
  960. })
  961. }
  962. export function removeSupplySystemMember(memberId) {
  963. return request({
  964. url: '/api/admin/supply-system/member/remove',
  965. method: 'post',
  966. data: { memberId }
  967. })
  968. }
  969. export function changeSupplySystemMemberRole(memberId, role) {
  970. return request({
  971. url: '/api/admin/supply-system/member/change-role',
  972. method: 'post',
  973. data: { memberId, role }
  974. })
  975. }
  976. // ========== 供应商产品管理 API (supplier_admin) ==========
  977. export function getMySupplySystem() {
  978. return request({
  979. url: '/api/admin/supply-system/my-system',
  980. method: 'post'
  981. })
  982. }
  983. export function getSupplierProductList(params) {
  984. return request({
  985. url: '/api/admin/supplier/product/list',
  986. method: 'post',
  987. data: params
  988. })
  989. }
  990. export function createSupplierProduct(data) {
  991. return request({
  992. url: '/api/admin/supplier/product/create',
  993. method: 'post',
  994. data
  995. })
  996. }
  997. export function updateSupplierProduct(data) {
  998. return request({
  999. url: '/api/admin/supplier/product/update',
  1000. method: 'post',
  1001. data
  1002. })
  1003. }
  1004. export function getSupplierProductDetail(id) {
  1005. return request({
  1006. url: '/api/admin/supplier/product/detail',
  1007. method: 'post',
  1008. data: { productId: id }
  1009. })
  1010. }
  1011. export function deleteSupplierProduct(id) {
  1012. return request({
  1013. url: '/api/admin/supplier/product/delete',
  1014. method: 'post',
  1015. data: { productId: id }
  1016. })
  1017. }
  1018. export function shelveSupplierProduct(productId, shelve) {
  1019. return request({
  1020. url: '/api/admin/supplier/product/shelve',
  1021. method: 'post',
  1022. data: { productId, shelve }
  1023. })
  1024. }
  1025. // 结算管理
  1026. export function getSupplySettlementList(params) {
  1027. return request({
  1028. url: '/api/admin/supply-settlement/list',
  1029. method: 'post',
  1030. data: params || {}
  1031. })
  1032. }
  1033. export function getSupplySettlementDetail(id) {
  1034. return request({
  1035. url: '/api/admin/supply-settlement/detail',
  1036. method: 'post',
  1037. data: { id }
  1038. })
  1039. }
  1040. export function getSupplySettlementDetailItems(settlementId) {
  1041. return request({
  1042. url: '/api/admin/supply-settlement/detail-items',
  1043. method: 'post',
  1044. data: { settlementId }
  1045. })
  1046. }
  1047. export function createSupplySettlement(systemId, periodStart, periodEnd, remark) {
  1048. return request({
  1049. url: '/api/admin/supply-settlement/create',
  1050. method: 'post',
  1051. data: { systemId, periodStart, periodEnd, remark }
  1052. })
  1053. }
  1054. export function confirmSupplySettlement(id) {
  1055. return request({
  1056. url: '/api/admin/supply-settlement/confirm',
  1057. method: 'post',
  1058. data: { id }
  1059. })
  1060. }
  1061. // ========== 供应商管理 (supplier_admin) ==========
  1062. export function getSupplyManageList(params) {
  1063. return request({
  1064. url: '/api/admin/supply-manage/list',
  1065. method: 'post',
  1066. data: params
  1067. })
  1068. }
  1069. export function getSupplyManageDetail(params) {
  1070. return request({
  1071. url: '/api/admin/supply-manage/detail',
  1072. method: 'post',
  1073. data: params
  1074. })
  1075. }
  1076. export function createSupplyManage(params) {
  1077. return request({
  1078. url: '/api/admin/supply-manage/create',
  1079. method: 'post',
  1080. data: params
  1081. })
  1082. }
  1083. export function updateSupplyManage(params) {
  1084. return request({
  1085. url: '/api/admin/supply-manage/update',
  1086. method: 'post',
  1087. data: params
  1088. })
  1089. }
  1090. export function deleteSupplyManage(params) {
  1091. return request({
  1092. url: '/api/admin/supply-manage/delete',
  1093. method: 'post',
  1094. data: params
  1095. })
  1096. }
  1097. export function addSupplierRole(params) {
  1098. return request({
  1099. url: '/api/admin/supply-manage/add-role',
  1100. method: 'post',
  1101. data: params
  1102. })
  1103. }
  1104. export function removeSupplierRole(params) {
  1105. return request({
  1106. url: '/api/admin/supply-manage/remove-role',
  1107. method: 'post',
  1108. data: params
  1109. })
  1110. }
  1111. export function adjustSupplyTier(params) {
  1112. return request({
  1113. url: '/api/admin/supply-manage/adjust-tier',
  1114. method: 'post',
  1115. data: params
  1116. })
  1117. }
  1118. // 供应商层级关系管理
  1119. export function getSupplyHierarchyTree(systemId) {
  1120. return request({
  1121. url: '/api/admin/supply-hierarchy/tree',
  1122. method: 'post',
  1123. data: { systemId }
  1124. })
  1125. }
  1126. export function setSupplyHierarchy(data) {
  1127. return request({
  1128. url: '/api/admin/supply-hierarchy/set',
  1129. method: 'post',
  1130. data
  1131. })
  1132. }
  1133. export function removeSupplyHierarchy(data) {
  1134. return request({
  1135. url: '/api/admin/supply-hierarchy/remove',
  1136. method: 'post',
  1137. data
  1138. })
  1139. }
  1140. export function getSupplyHierarchyDirectChildren(data) {
  1141. return request({
  1142. url: '/api/admin/supply-hierarchy/direct-children',
  1143. method: 'post',
  1144. data
  1145. })
  1146. }
  1147. export function getSupplyHierarchyAllChildren(data) {
  1148. return request({
  1149. url: '/api/admin/supply-hierarchy/all-children',
  1150. method: 'post',
  1151. data
  1152. })
  1153. }
  1154. export function getSupplyHierarchyParent(data) {
  1155. return request({
  1156. url: '/api/admin/supply-hierarchy/parent',
  1157. method: 'post',
  1158. data
  1159. })
  1160. }
  1161. export function getSupplyHierarchyParentChain(data) {
  1162. return request({
  1163. url: '/api/admin/supply-hierarchy/parent-chain',
  1164. method: 'post',
  1165. data
  1166. })
  1167. }
  1168. export function getSupplyHierarchyMy(data) {
  1169. return request({
  1170. url: '/api/admin/supply-hierarchy/my',
  1171. method: 'post',
  1172. data
  1173. })
  1174. }
  1175. export function getSupplyHierarchyChangeRequests(data) {
  1176. return request({
  1177. url: '/api/admin/supply-hierarchy/change-requests',
  1178. method: 'post',
  1179. data
  1180. })
  1181. }
  1182. export function applySupplyHierarchyChange(data) {
  1183. return request({
  1184. url: '/api/admin/supply-hierarchy/change/apply',
  1185. method: 'post',
  1186. data
  1187. })
  1188. }
  1189. export function reviewSupplyHierarchyChange(data) {
  1190. return request({
  1191. url: '/api/admin/supply-hierarchy/change/review',
  1192. method: 'post',
  1193. data
  1194. })
  1195. }
  1196. // ========== 家庭会员订阅管理 API ==========
  1197. export function getSubscriptionList(params) {
  1198. return request({
  1199. url: '/api/admin/subscription/list',
  1200. method: 'post',
  1201. data: params
  1202. })
  1203. }
  1204. export function activateSubscription(data) {
  1205. return request({
  1206. url: '/api/admin/subscription/activate',
  1207. method: 'post',
  1208. data
  1209. })
  1210. }
  1211. export function cancelSubscriptionAdmin(data) {
  1212. return request({
  1213. url: '/api/admin/subscription/cancel',
  1214. method: 'post',
  1215. data
  1216. })
  1217. }
  1218. export function getBenefitConfig() {
  1219. return request({
  1220. url: '/api/admin/subscription/benefits',
  1221. method: 'post'
  1222. })
  1223. }
  1224. export function updateBenefitConfig(data) {
  1225. return request({
  1226. url: '/api/admin/subscription/benefits/update',
  1227. method: 'post',
  1228. data
  1229. })
  1230. }
  1231. // ========== 推广等级配置 API ==========
  1232. export function getPromotionTierList(params) {
  1233. return request({
  1234. url: '/api/admin/promotion/tier/list',
  1235. method: 'post',
  1236. data: params
  1237. })
  1238. }
  1239. export function adjustPromotionTier(data) {
  1240. return request({
  1241. url: '/api/admin/promotion/tier/adjust',
  1242. method: 'post',
  1243. data
  1244. })
  1245. }
  1246. // ========== 佣金/返利记录 API ==========
  1247. export function getCommissionRecords(params) {
  1248. return request({
  1249. url: '/api/admin/commission/records',
  1250. method: 'post',
  1251. data: params
  1252. })
  1253. }
  1254. export function settleCommission(data) {
  1255. return request({
  1256. url: '/api/admin/commission/settle',
  1257. method: 'post',
  1258. data
  1259. })
  1260. }
  1261. export function refundCommission(data) {
  1262. return request({
  1263. url: '/api/admin/commission/refund',
  1264. method: 'post',
  1265. data
  1266. })
  1267. }
  1268. // ========== 产品 P 点配置 API ==========
  1269. export function getProductPpointList(params) {
  1270. return request({
  1271. url: '/api/admin/product-ppoint/list',
  1272. method: 'post',
  1273. data: params
  1274. })
  1275. }
  1276. export function saveProductPpoint(data) {
  1277. return request({
  1278. url: '/api/admin/product-ppoint/save',
  1279. method: 'post',
  1280. data
  1281. })
  1282. }
  1283. export function deleteProductPpoint(data) {
  1284. return request({
  1285. url: '/api/admin/product-ppoint/delete',
  1286. method: 'post',
  1287. data
  1288. })
  1289. }
  1290. export function getProductPpointByProduct(data) {
  1291. return request({
  1292. url: '/api/admin/product-ppoint/by-product',
  1293. method: 'post',
  1294. data
  1295. })
  1296. }
  1297. // ========== 推广等级配置 (R0-R4) API ==========
  1298. export function getPromotionTierConfig() {
  1299. return request({
  1300. url: '/api/admin/promotion/config',
  1301. method: 'post'
  1302. })
  1303. }
  1304. export function updatePromotionTierConfig(data) {
  1305. return request({
  1306. url: '/api/admin/promotion/config/update',
  1307. method: 'post',
  1308. data
  1309. })
  1310. }
  1311. // ========== 待退款管理 API ==========
  1312. export function getPendingRefundList(params) {
  1313. return request({
  1314. url: '/api/admin/commission/refunds/pending',
  1315. method: 'post',
  1316. data: params
  1317. })
  1318. }
  1319. export function getPendingRefundSummary() {
  1320. return request({
  1321. url: '/api/admin/commission/refunds/summary',
  1322. method: 'post'
  1323. })
  1324. }
  1325. export function cancelPendingRefund(params) {
  1326. return request({
  1327. url: '/api/admin/commission/refunds/cancel',
  1328. method: 'post',
  1329. data: params
  1330. })
  1331. }
  1332. // ========== 佣金配置 API ==========
  1333. export function getCommissionConfig() {
  1334. return request({
  1335. url: '/api/admin/commission/config',
  1336. method: 'post'
  1337. })
  1338. }
  1339. export function updateCommissionConfig(data) {
  1340. return request({
  1341. url: '/api/admin/commission/config/update',
  1342. method: 'post',
  1343. data
  1344. })
  1345. }
  1346. // 电商供应商管理
  1347. export function getEcomSupplierList(params) {
  1348. return request({
  1349. url: '/api/admin/supplier/list',
  1350. method: 'post',
  1351. data: params
  1352. })
  1353. }
  1354. export function saveEcomSupplier(data) {
  1355. return request({
  1356. url: '/api/admin/supplier/save',
  1357. method: 'post',
  1358. data
  1359. })
  1360. }
  1361. export function updateEcomSupplier(data) {
  1362. return request({
  1363. url: '/api/admin/supplier/update',
  1364. method: 'post',
  1365. data
  1366. })
  1367. }
  1368. export function deleteEcomSupplier(id) {
  1369. return request({
  1370. url: '/api/admin/supplier/delete',
  1371. method: 'post',
  1372. data: { id }
  1373. })
  1374. }
  1375. // ===== 家庭收益管理 =====
  1376. export function getFamilyEarningsList() {
  1377. return request({
  1378. url: '/api/admin/earnings/families',
  1379. method: 'post',
  1380. data: {}
  1381. })
  1382. }
  1383. export function getFamilyEarningsDetail(familyId) {
  1384. return request({
  1385. url: '/api/admin/earnings/family/' + familyId + '/summary',
  1386. method: 'post',
  1387. data: { familyId: familyId }
  1388. })
  1389. }
  1390. export function getFamilyEarningsRecords(familyId, type) {
  1391. return request({
  1392. url: '/api/admin/earnings/family/' + familyId + '/records',
  1393. method: 'post',
  1394. data: { familyId: familyId, type: type || '' }
  1395. })
  1396. }
  1397. // ===== 测评待分配规划师 =====
  1398. export function getPendingAssessmentList(params) {
  1399. return request({
  1400. url: '/api/admin/assessment/pending-list',
  1401. method: 'post',
  1402. data: params || {}
  1403. })
  1404. }
  1405. export function getAvailableGuides() {
  1406. return request({
  1407. url: '/api/admin/assessment/available-guides',
  1408. method: 'post',
  1409. data: {}
  1410. })
  1411. }
  1412. export function assignGuide(appointmentId, guideId) {
  1413. return request({
  1414. url: '/api/admin/assessment/assign-guide',
  1415. method: 'post',
  1416. data: { appointmentId, guideId }
  1417. })
  1418. }
  1419. // ===== 测评订单管理 =====
  1420. export function getAssessmentOrderList(params) {
  1421. return request({
  1422. url: '/api/admin/assessment/orders',
  1423. method: 'post',
  1424. data: params || {}
  1425. })
  1426. }
  1427. export function changeAssessmentGuide(orderId, guideId) {
  1428. return request({
  1429. url: '/api/admin/assessment/change-guide',
  1430. method: 'post',
  1431. data: { orderId, guideId }
  1432. })
  1433. }
  1434. // ========== 库存管理 API ==========
  1435. export function createInboundOrder(data) {
  1436. return request({
  1437. url: '/api/admin/inventory/inbound/create',
  1438. method: 'post',
  1439. data
  1440. })
  1441. }
  1442. export function getInboundOrderList(params) {
  1443. return request({
  1444. url: '/api/admin/inventory/inbound/list',
  1445. method: 'post',
  1446. data: params
  1447. })
  1448. }
  1449. export function getInboundOrderDetail(id) {
  1450. return request({
  1451. url: '/api/admin/inventory/inbound/detail',
  1452. method: 'post',
  1453. data: { id }
  1454. })
  1455. }
  1456. export function confirmInbound(id) {
  1457. return request({
  1458. url: '/api/admin/inventory/inbound/confirm',
  1459. method: 'post',
  1460. data: { id }
  1461. })
  1462. }
  1463. export function cancelInbound(id) {
  1464. return request({
  1465. url: '/api/admin/inventory/inbound/cancel',
  1466. method: 'post',
  1467. data: { id }
  1468. })
  1469. }
  1470. export function getInventoryTransactions(params) {
  1471. return request({
  1472. url: '/api/admin/inventory/transactions/list',
  1473. method: 'post',
  1474. data: params
  1475. })
  1476. }
  1477. export function createCountingRecord(data) {
  1478. return request({
  1479. url: '/api/admin/inventory/counting/create',
  1480. method: 'post',
  1481. data
  1482. })
  1483. }
  1484. export function confirmCounting(id) {
  1485. return request({
  1486. url: '/api/admin/inventory/counting/confirm',
  1487. method: 'post',
  1488. data: { id }
  1489. })
  1490. }
  1491. export function getCountingList(params) {
  1492. return request({
  1493. url: '/api/admin/inventory/counting/list',
  1494. method: 'post',
  1495. data: params
  1496. })
  1497. }
  1498. export function getStockAlerts() {
  1499. return request({
  1500. url: '/api/admin/inventory/alert/list',
  1501. method: 'post'
  1502. })
  1503. }
  1504. export function getProductStock(productId) {
  1505. return request({
  1506. url: '/api/admin/inventory/product/stock',
  1507. method: 'post',
  1508. data: { productId }
  1509. })
  1510. }
  1511. export function saveBundleItems(bundleProductId, items) {
  1512. return request({
  1513. url: '/api/admin/inventory/bundle/items',
  1514. method: 'post',
  1515. data: { bundleProductId, items }
  1516. })
  1517. }
  1518. export function getBundleItems(bundleProductId) {
  1519. return request({
  1520. url: '/api/admin/inventory/bundle/items/list',
  1521. method: 'post',
  1522. data: { bundleProductId }
  1523. })
  1524. }
  1525. export function checkBundleStock(bundleProductId, quantity) {
  1526. return request({
  1527. url: '/api/admin/inventory/bundle/check-stock',
  1528. method: 'post',
  1529. data: { bundleProductId, quantity }
  1530. })
  1531. }