product.js 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828
  1. // +----------------------------------------------------------------------
  2. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  3. // +----------------------------------------------------------------------
  4. // | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
  5. // +----------------------------------------------------------------------
  6. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  7. // +----------------------------------------------------------------------
  8. // | Author: CRMEB Team <admin@crmeb.com>
  9. // +----------------------------------------------------------------------
  10. import request from '@/plugins/request';
  11. /*
  12. * 获取商品表单头数量;
  13. * */
  14. export function getGoodHeade(data) {
  15. return request({
  16. url: 'product/product/type_header',
  17. method: 'get',
  18. params: data
  19. });
  20. }
  21. /*
  22. * 获取商品表单头数量;
  23. * */
  24. export function getGoodsCategory(data) {
  25. return request({
  26. url: '/goods/goods_category',
  27. method: 'get',
  28. params: data
  29. });
  30. }
  31. /**
  32. * @description 商品管理-- 列表
  33. */
  34. export function getGoods(params) {
  35. return request({
  36. url: 'product/product',
  37. method: 'get',
  38. params
  39. });
  40. }
  41. /**
  42. * @description 商品管理-- 上下架
  43. */
  44. export function PostgoodsIsShow(id, isShow) {
  45. return request({
  46. url: `product/product/set_show/${id}/${isShow}`,
  47. method: 'put'
  48. });
  49. }
  50. /**
  51. * @description 商品属性 -- 批量上下架
  52. * @param {Object} param data {Object} 传值对象
  53. */
  54. export function productShowApi(data) {
  55. return request({
  56. url: `product/product/product_show`,
  57. method: 'put',
  58. data
  59. });
  60. }
  61. /**
  62. * @description 商品属性 -- 批量下架
  63. * @param {Object} param data {Object} 传值对象
  64. */
  65. export function productUnshowApi(data) {
  66. return request({
  67. url: `product/product/product_unshow`,
  68. method: 'put',
  69. data
  70. });
  71. }
  72. /**
  73. * @description 商品列表 -- 批量添加配送方式
  74. * @param {Object} param data {Object} 传值对象
  75. */
  76. export function setDeliveryType(data) {
  77. return request({
  78. url: `product/product/setDeliveryType`,
  79. method: 'put',
  80. data
  81. });
  82. }
  83. /**
  84. * @description 商品管理-- 审核
  85. */
  86. export function productReviewApi(id) {
  87. return request({
  88. url: `/product/product/verify/${id}`,
  89. method: 'get'
  90. });
  91. }
  92. /**
  93. * @description 商品管理-- 强制下架
  94. */
  95. export function forcedRemovalApi(id) {
  96. return request({
  97. url: `/product/product/remove/${id}`,
  98. method: 'get'
  99. });
  100. }
  101. /**
  102. * @description 商品管理-- 分类
  103. */
  104. export function treeListApi(type) {
  105. return request({
  106. url: `product/category/tree/${type}`,
  107. method: 'get'
  108. });
  109. }
  110. /**
  111. * @description 商品管理-- 详情
  112. */
  113. export function productInfoApi(id) {
  114. return request({
  115. url: `product/product/${id}`,
  116. method: 'get'
  117. });
  118. }
  119. /**
  120. * @description 商品管理-- 提交
  121. */
  122. export function productAddApi(data) {
  123. return request({
  124. url: `product/product/${data.id}`,
  125. method: 'POST',
  126. data
  127. });
  128. }
  129. /**
  130. * @description 商品分类 -- 列表
  131. * @param {Object} param params {Object} 传值参数
  132. */
  133. export function productListApi(params) {
  134. return request({
  135. url: 'product/category',
  136. method: 'get',
  137. params
  138. });
  139. }
  140. /**
  141. * @description 商品分类 -- 添加表单
  142. * @param {Object} param params {Object} 传值参数
  143. */
  144. export function productCreateApi() {
  145. return request({
  146. url: 'product/category/create',
  147. method: 'get'
  148. });
  149. }
  150. /**
  151. * @description 商品分类 -- 编辑表单
  152. * @param {Object} param params {Object} 传值参数
  153. */
  154. export function productEditApi(id) {
  155. return request({
  156. url: `product/category/${id}`,
  157. method: 'get'
  158. });
  159. }
  160. /**
  161. * @description 商品分类 -- 修改状态
  162. * @param {Object} param params {Object} 传值参数
  163. */
  164. export function setShowApi(data) {
  165. return request({
  166. url: `product/category/set_show/${data.id}/${data.is_show}`,
  167. method: 'PUT'
  168. });
  169. }
  170. /**
  171. * @description 选择商品 -- 列表
  172. */
  173. export function changeListApi(params) {
  174. return request({
  175. url: `product/product/list`,
  176. method: 'GET',
  177. params
  178. });
  179. }
  180. /**
  181. * @description 选择商品 -- 列表-标签
  182. */
  183. export function allLabelApi(params) {
  184. return request({
  185. url: `product/all_label`,
  186. method: 'get',
  187. params
  188. });
  189. }
  190. /**
  191. * @description 商品评论 -- 列表
  192. * @param {Object} param params {Object} 传值参数
  193. */
  194. export function replyListApi(params) {
  195. return request({
  196. url: `product/reply`,
  197. method: 'get',
  198. params
  199. });
  200. }
  201. /**
  202. * @description 商品评论 -- 回复
  203. * @param {Object} param data {Object} 传值参数
  204. */
  205. export function setReplyApi(data, id) {
  206. return request({
  207. url: `product/reply/set_reply/${id}`,
  208. method: 'PUT',
  209. data
  210. });
  211. }
  212. /**
  213. * @description 获取复制商品配置
  214. */
  215. export function copyConfigApi() {
  216. return request({
  217. url: `product/copy_config`,
  218. method: 'get'
  219. })
  220. }
  221. /**
  222. * @description 商品管理 -- 获取京东、淘宝商品数据
  223. * @param {Object} param data {Object} 传值参数
  224. */
  225. export function crawlFromApi(data) {
  226. return request({
  227. url: `product/copy`,
  228. method: 'POST',
  229. data
  230. });
  231. }
  232. /**
  233. * @description 商品管理 -- 京东、淘宝商品数据提交
  234. * @param {Object} param data {Object} 传值参数
  235. */
  236. export function crawlSaveApi(data) {
  237. return request({
  238. url: `product/crawl/save`,
  239. method: 'POST',
  240. data
  241. });
  242. }
  243. /**
  244. * @description 商品管理 -- 生成属性
  245. * @param {Object} param data {Object} 传值参数
  246. */
  247. export function generateAttrApi(data, id, type) {
  248. return request({
  249. url: `product/generate_attr/${id}/${type}`,
  250. method: 'POST',
  251. data
  252. });
  253. }
  254. /**
  255. * @description 商品属性 -- 列表
  256. * @param {Object} param params {Object} 传值参数
  257. */
  258. export function ruleListApi(params) {
  259. return request({
  260. url: `product/product/rule`,
  261. method: 'GET',
  262. params
  263. });
  264. }
  265. /**
  266. * @description 商品属性 -- 添加
  267. * @param {Number} param id {Number} 属性id
  268. * @param {Object} param data {Object} 传值参数
  269. */
  270. export function ruleAddApi(data, id) {
  271. return request({
  272. url: `product/product/rule/${id}`,
  273. method: 'POST',
  274. data
  275. });
  276. }
  277. /**
  278. * @description 商品属性 -- 详情
  279. * @param {Number} param id {Number} 属性id
  280. */
  281. export function ruleInfoApi(id) {
  282. return request({
  283. url: `product/product/rule/${id}`,
  284. method: 'get'
  285. });
  286. }
  287. /**
  288. * @description 商品评价 -- 虚拟评价
  289. * @id--产品id;
  290. */
  291. export function fictitiousReply(id) {
  292. return request({
  293. url: `product/reply/fictitious_reply/${id}`,
  294. method: 'get'
  295. });
  296. }
  297. /**
  298. * @description 商品属性 -- 获取规则属性模板
  299. */
  300. export function productGetRuleApi() {
  301. return request({
  302. url: `product/product/get_rule`,
  303. method: 'get'
  304. });
  305. }
  306. /**
  307. * @description 商品 -- 获取运费模板
  308. */
  309. export function productGetTemplateApi(data) {
  310. return request({
  311. url: `product/product/get_template`,
  312. method: 'get',
  313. params: data
  314. });
  315. }
  316. /**
  317. * @description 获取上传参数
  318. */
  319. export function productGetTempKeysApi(data) {
  320. return request({
  321. url: `product/product/get_temp_keys`,
  322. method: 'get',
  323. params: data,
  324. });
  325. }
  326. /**
  327. * @description 商铺产品 -- 导出
  328. */
  329. export function storeProductApi(data) {
  330. return request({
  331. url: `export/storeProduct`,
  332. method: 'get',
  333. params: data
  334. });
  335. }
  336. /**
  337. * @description 添加商品 -- 检测活动存在
  338. */
  339. export function checkActivityApi(id) {
  340. return request({
  341. url: `product/product/check_activity/${id}`,
  342. method: 'get'
  343. });
  344. }
  345. /**
  346. * @description 商品添加编辑-- 用户标签
  347. */
  348. export function labelListApi() {
  349. return request({
  350. url: 'user/user_label',
  351. method: 'get'
  352. });
  353. }
  354. /**
  355. * @description 商品分类-- cascader
  356. */
  357. export function cascaderListApi(type) {
  358. return request({
  359. url: `product/category/cascader_list/${type}`,
  360. method: 'get'
  361. });
  362. }
  363. /**
  364. * @description 商品管理-- 临时保存
  365. */
  366. export function productCache() {
  367. return request({
  368. url: 'product/cache',
  369. method: 'get'
  370. });
  371. }
  372. /**
  373. * @description 商品管理-- 取消临时保存
  374. */
  375. export function cacheDelete() {
  376. return request({
  377. url: 'product/cache',
  378. method: 'delete'
  379. });
  380. }
  381. /**
  382. * @description 商品管理-- 取消临时保存
  383. */
  384. export function getProductAttr(id) {
  385. return request({
  386. url: 'product/product/get_attr/' + id,
  387. method: 'get'
  388. });
  389. }
  390. /**
  391. * @description 商品管理-- 关联用户标签
  392. */
  393. export function productUserLabel() {
  394. return request({
  395. url: 'product/user_label',
  396. method: 'get'
  397. });
  398. }
  399. /**
  400. * @description 添加商品-- 商品标签
  401. */
  402. export function productStoreLabel() {
  403. return request({
  404. url: 'product/product_label',
  405. method: 'get'
  406. });
  407. }
  408. /**
  409. * @description 添加商品-- 商品标签
  410. */
  411. export function productAllEnsure() {
  412. return request({
  413. url: 'product/all_ensure',
  414. method: 'get'
  415. });
  416. }
  417. /**
  418. * @description 添加商品-- 添加商品标签
  419. */
  420. export function productLabelAdd() {
  421. return request({
  422. url: 'product/label/form',
  423. method: 'get'
  424. });
  425. }
  426. /**
  427. * @description 添加商品-- 添加商品参数
  428. */
  429. export function productAllSpecs() {
  430. return request({
  431. url: 'product/all_specs',
  432. method: 'get'
  433. });
  434. }
  435. /**
  436. * @description 商品管理-- 添加品牌-获取上级分类
  437. */
  438. export function brandCascader() {
  439. return request({
  440. url: 'product/brand/cascader_list',
  441. method: 'get'
  442. });
  443. }
  444. /**
  445. * @description 商品管理-- 提交添加品牌
  446. */
  447. export function productBrand(data) {
  448. return request({
  449. url: 'product/brand',
  450. method: 'POST',
  451. data
  452. });
  453. }
  454. /**
  455. * @description 商品管理-- 提交添加品牌
  456. */
  457. export function productBrandlist(data) {
  458. return request({
  459. url: 'product/brand',
  460. method: 'get',
  461. params: data
  462. });
  463. }
  464. /**
  465. * @description 商品管理-- 提交编辑品牌
  466. */
  467. export function productBrandrev(id,data) {
  468. return request({
  469. url: `product/brand/${id}`,
  470. method: 'put',
  471. data
  472. });
  473. }
  474. /**
  475. * @description 商品管理-- 修改品牌状态
  476. */
  477. export function productBrandShow(id,show) {
  478. return request({
  479. url: `product/brand/set_show/${id}/${show}`,
  480. method: 'put'
  481. });
  482. }
  483. /**
  484. * @description 商品管理-- 添加商品品牌列表
  485. */
  486. export function brandList() {
  487. return request({
  488. url: `product/brand/cascader_list/2`,
  489. method: 'get'
  490. });
  491. }
  492. /**
  493. *商品列表-获取商品规格
  494. */
  495. export function productAttrsApi(id) {
  496. return request({
  497. url: `product/product/attrs/${id}`,
  498. method: 'get'
  499. });
  500. }
  501. /**
  502. *商品列表-提交商品规格库存
  503. */
  504. export function productSaveStocksApi(data,id) {
  505. return request({
  506. url: `product/product/saveStocks/${id}`,
  507. method: 'PUT',
  508. data
  509. });
  510. }
  511. /**
  512. *添加商品-获取所有商品单位列表
  513. */
  514. export function productAllUnit(id) {
  515. return request({
  516. url: `product/get_all_unit`,
  517. method: 'get'
  518. });
  519. }
  520. /**
  521. *添加商品-商品单位添加表单
  522. */
  523. export function productUnitCreate(id) {
  524. return request({
  525. url: `product/unit/create`,
  526. method: 'get'
  527. });
  528. }
  529. /**
  530. * @description 商品添加编辑-- 获取上传视频类型
  531. */
  532. export function uploadType () {
  533. return request({
  534. url: 'file/upload_type',
  535. method: 'get'
  536. })
  537. }
  538. /**
  539. * @description 商品添加编辑-- 商品单位列表
  540. */
  541. export function productUnit (data) {
  542. return request({
  543. url: 'product/unit',
  544. method: 'get',
  545. params: data
  546. })
  547. }
  548. /**
  549. * @description 商品添加编辑-- 编辑单位
  550. */
  551. export function productUnitEdit(id) {
  552. return request({
  553. url: `product/unit/${id}/edit`,
  554. method: 'get'
  555. })
  556. }
  557. /**
  558. * @description 商品添加编辑-- 倒入卡密
  559. */
  560. export function importCard (data) {
  561. return request({
  562. url: 'product/product/import_card',
  563. method: 'get',
  564. params: data
  565. })
  566. }
  567. /**
  568. * @description 商品添加编辑-- 下载卡密
  569. */
  570. export function exportProductCard (data) {
  571. return request({
  572. url: 'export/storeProductCardTemplate',
  573. method: 'get'
  574. })
  575. }
  576. /**
  577. * @description 商品标签组-- 添加
  578. */
  579. export function labelCateCreate () {
  580. return request({
  581. url: 'product/label_cate/create',
  582. method: 'get'
  583. })
  584. }
  585. /**
  586. * @description 商品标签组-- 列表
  587. */
  588. export function productLabelCate (data) {
  589. return request({
  590. url: 'product/label_cate',
  591. method: 'get',
  592. params: data
  593. })
  594. }
  595. /**
  596. * @description 商品标签组-- 编辑
  597. */
  598. export function productLabelEdit(id) {
  599. return request({
  600. url: `product/label_cate/${id}/edit`,
  601. method: 'get'
  602. })
  603. }
  604. /**
  605. * @description 商品标签-- 保存标签
  606. */
  607. export function productLabel(data) {
  608. return request({
  609. url: `product/label/${data.id}`,
  610. method: 'post',
  611. data
  612. })
  613. }
  614. /**
  615. * @description 商品服务保障- 添加
  616. */
  617. export function productEnsureCreate() {
  618. return request({
  619. url: `product/ensure/create`,
  620. method: 'get',
  621. })
  622. }
  623. /**
  624. * @description 商品保障服务-- 列表
  625. */
  626. export function productEnsure (data) {
  627. return request({
  628. url: 'product/ensure',
  629. method: 'get',
  630. params: data
  631. })
  632. }
  633. /**
  634. * @description 商品保障服务-- 编辑
  635. */
  636. export function productEnsureEdit(id) {
  637. return request({
  638. url: `product/ensure/${id}/edit`,
  639. method: 'get'
  640. })
  641. }
  642. /**
  643. * @description 商品保障服务--是否显示
  644. */
  645. export function ensureSetShow(data) {
  646. return request({
  647. url: `product/ensure/set_show/${data.id}/${data.is_show}`,
  648. method: 'put'
  649. })
  650. }
  651. /**
  652. * @description 商品参数-- 编辑
  653. */
  654. export function productSpecs(data) {
  655. return request({
  656. url: `product/specs/${data.id}`,
  657. method: 'post',
  658. data
  659. })
  660. }
  661. /**
  662. * @description 商品参数-- 列表
  663. */
  664. export function productSpecsList (data) {
  665. return request({
  666. url: 'product/specs',
  667. method: 'get',
  668. params: data
  669. })
  670. }
  671. /**
  672. * @description 商品参数-- 获取单个商品参数模版信息
  673. */
  674. export function productSpecsInfo (id) {
  675. return request({
  676. url: `product/specs/${id}`,
  677. method: 'get'
  678. })
  679. }
  680. /**
  681. * @description 商品评价-- 回复评价列表
  682. */
  683. export function productReplycomment (data,id) {
  684. return request({
  685. url: `product/reply/comment/${id}`,
  686. method: 'get',
  687. params: data
  688. })
  689. }
  690. /**
  691. * @description 商品评价-- 保存管理员回复
  692. */
  693. export function productReplySave (data,replyId,id) {
  694. return request({
  695. url: `product/reply/save_comment/${replyId}/${id}`,
  696. method: 'post',
  697. data:data
  698. })
  699. }
  700. /**
  701. * @description 保存云端视频附件记录
  702. * @param {String} param ids {String}
  703. */
  704. export function videoAttachment (data) {
  705. return request({
  706. url: 'file/video_attachment',
  707. method: 'post',
  708. data
  709. });
  710. }
  711. /**
  712. * 添加虚拟评论
  713. * @param {*} data
  714. * @returns
  715. */
  716. export function saveFictitiousReply(data) {
  717. return request({
  718. url: 'product/reply/save_fictitious_reply',
  719. method: 'post',
  720. data
  721. });
  722. }
  723. /**
  724. * 商品批量操作
  725. * @param {*} data
  726. * @returns
  727. */
  728. export function batchProcess(data) {
  729. return request({
  730. url: 'product/batch_process',
  731. method: 'post',
  732. data
  733. });
  734. }
  735. /**
  736. * diy系统表单列表(全部)
  737. * @param {*} type
  738. * @returns
  739. */
  740. export function allSystemForm() {
  741. return request({
  742. url: `/system/form/all_system_form`,
  743. method: 'get'
  744. });
  745. }