BaseInfo.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474
  1. define(['ngResource'], function() {
  2. angular.module('ProductServices', [ 'ngResource']).factory('GetProductInfo', ['$resource', function($resource) {
  3. return $resource('product/baseInfo/info/search', {}, {
  4. getSaleProduct: {
  5. url: 'product/baseInfo/:id/info',
  6. method: 'GET'
  7. },
  8. getPurcProduct: {
  9. url: 'purcProduct/:id/info',
  10. method: 'GET'
  11. },
  12. getOne : {
  13. url : "product/baseInfo/:id",
  14. method : 'GET'
  15. },
  16. getAll : {
  17. isArray : false
  18. },
  19. getStandard: {
  20. params: {
  21. _state: 'standard'
  22. }
  23. },
  24. getNonstandard: {
  25. params: {
  26. _state: 'nonstandard'
  27. }
  28. },
  29. uploadByBatch : {
  30. url : "product/baseInfo/uploadByBatch",
  31. method : 'GET',
  32. },
  33. addNewProd : {
  34. url: "product/baseInfo/edit/addNewProduct",
  35. method : 'POST'
  36. },
  37. update : {
  38. url: "product/baseInfo/edit/updateProdInfo",
  39. method : 'POST'
  40. },
  41. deleteById : {
  42. url: "product/baseInfo/edit/delete",
  43. method : 'POST'
  44. },
  45. deletePurcById : {
  46. url: "purcProduct/edit/delete",
  47. method : 'POST'
  48. },
  49. getAllPartners : {
  50. url : "product/baseInfo/getAllPartners",
  51. method : 'GET',
  52. isArray : true
  53. },
  54. addCust : {
  55. url : "product/baseInfo/addCust",
  56. method : 'POST',
  57. isArray: false,
  58. headers: {
  59. 'Content-Type' : 'application/text;charset=UTF-8'
  60. }
  61. },
  62. addSupplier : {
  63. url: "product/baseInfo/addSupplier",
  64. method : 'POST',
  65. isArray: false,
  66. headers: {
  67. 'Content-Type' : 'application/text;charset=UTF-8'
  68. }
  69. },
  70. businessGroups: {
  71. url: "product/baseInfo/enterbusinessGroups",
  72. method : 'GET',
  73. headers: {
  74. 'Content-Type' : 'application/text;charset=UTF-8'
  75. }
  76. },
  77. getAttach: {
  78. url: "product/baseInfo/getAttach/:id",
  79. method: 'GET',
  80. },
  81. toggle: {
  82. url: 'product/baseInfo/edit/toggle/:status',
  83. method: 'POST'
  84. },
  85. setRead:{
  86. url: 'product/baseInfo/setRead',
  87. method: 'POST'
  88. },
  89. getUnreadIds:{
  90. url: 'product/baseInfo/getUnreadIds',
  91. method: 'GET'
  92. },
  93. getUnreadCount:{
  94. url: 'product/baseInfo/unread',
  95. method: 'GET'
  96. },
  97. exportXls: {
  98. url: 'product/baseInfo/xls/permission',
  99. method: 'GET'
  100. },
  101. matchbytype: {
  102. url: 'product/baseInfo/edit/matchbytype/:type',
  103. method: 'POST'
  104. }
  105. })
  106. }]).factory('GetProductInfoNewest', ['$resource', function($resource) {
  107. return $resource('product/baseInfo/info/nosearch', {}, {
  108. getAll : {
  109. isArray : false
  110. },
  111. getStandard: {
  112. params: {
  113. _state: 'standard'
  114. }
  115. },
  116. getNonstandard: {
  117. params: {
  118. _state: 'nonstandard'
  119. }
  120. },
  121. setRead:{
  122. url: 'product/baseInfo/setRead',
  123. method: 'POST'
  124. },
  125. getUnreadIds:{
  126. url: 'product/baseInfo/getUnreadIds',
  127. method: 'GET'
  128. },
  129. getUnreadCount:{
  130. url: 'product/baseInfo/unread',
  131. method: 'GET'
  132. }
  133. })
  134. }]).factory('ComponentActive', ['$resource', function($resource) {
  135. //获取ComponentActive的分页数据
  136. return $resource('api/product/component/:uuid', {}, {
  137. /*
  138. * get 获ComponentsActive的分页数据,根据uuid获得ComponentActive
  139. */
  140. //根据kindid获得ComponentsActiveSimpleInfo的分页数据
  141. getSimpleInfo : {
  142. url : 'api/product/component/simpleInfo',
  143. method : 'GET'
  144. },
  145. // 根据UUid获取单个器件的简要信息
  146. getSimpleInfoByUuid: {
  147. url: 'api/product/component/Info/:uuid',
  148. method: 'GET'
  149. },
  150. // 根据原厂型号(code)获得ComponentActive
  151. getByCode : {
  152. url : 'api/product/component/byCode/:code',
  153. method : 'GET',
  154. isArray : true
  155. },
  156. // 禁用ComponentActive
  157. disable : {
  158. url : 'product/component/:uuid/disable',
  159. method : 'PUT'
  160. },
  161. // 根据UUid 获取列表
  162. getByUuid: {
  163. url : 'api/product/component/byUuid',
  164. method : 'GET',
  165. isArray : true
  166. },
  167. //根据批次号获取器件信息
  168. getByBatchCode: {
  169. url : 'product/component/:batchCode/detail',
  170. method : 'GET'
  171. },//根据原厂型号和品牌获取器件信息
  172. getByCodeAndBrandId: {
  173. url: 'product/component/codeAndBrandId/:code',
  174. method: 'GET',
  175. isArray: true
  176. },//根据原厂型号和类目获取器件信息
  177. getByCodeAndKindId: {
  178. url: 'product/component/codeAndKindId/:code',
  179. method: 'GET',
  180. isArray: true
  181. },
  182. /*样品*/
  183. getProofCompon: {
  184. url: 'api/product/component/list/proofing',
  185. method: 'GET'
  186. },
  187. hasSamples: {
  188. url: 'api/product/component/proofing/hasSample',
  189. method: 'POST'
  190. },
  191. recommendProofing: {
  192. url: 'api/product/component/:qty/recommend/proofing',
  193. method: 'GET',
  194. isArray: true
  195. },
  196. /*现货*/
  197. getOriginalCompon: {
  198. url: 'api/product/component/list/original',
  199. method: 'GET'
  200. },
  201. recommendOriginal: {
  202. url: 'api/product/component/:qty/recommend/original',
  203. method: 'GET',
  204. isArray: true
  205. },
  206. // 根据类目id获取封装规格
  207. getPackagingByKindid: {
  208. url: 'product/component/packaging/:kindid',
  209. method: 'GET',
  210. isArray: true
  211. },
  212. // 批量修改器件类目
  213. moveCmp: {
  214. url: 'product/component/moveCmp',
  215. method: 'PUT',
  216. isArray : true
  217. },
  218. //根据类目id获取器件列表
  219. getComponentsByKindid: {
  220. url: 'product/component/cmplist/:kindId',
  221. method: 'GET'
  222. }
  223. })
  224. }]).factory('KindAPI', ['$resource', '$cacheFactory', function($resource, $cacheFactory) {
  225. var cache = $cacheFactory('KindAPI');
  226. return $resource ('product/kind', {}, {
  227. // 根据父级类目获取其子类目,不包含深层
  228. getChildren: {
  229. url: 'product/kind/:parentId/children',
  230. method: 'GET',
  231. isArray: true
  232. },
  233. // 获取父级分类的所有子分类,含深层
  234. getAllChildren: {
  235. url: 'product/kind/:parentId/children_all',
  236. method: 'GET',
  237. isArray: true
  238. },
  239. // 获取子类目的所有父类目(含每级类目的兄弟类目),返回逐级向下的类目数组
  240. getParentsWithBothers: {
  241. url: 'product/kind/:childId/parentsWithBothers',
  242. method: 'GET',
  243. isArray: true
  244. },
  245. // 获取子类目的所有父类目,返回逐级向下的类目数组
  246. getParents: {
  247. url: 'product/kind/:childId/parents',
  248. method: 'GET',
  249. isArray: true
  250. },
  251. // 获取分类的所有属性,包括存在的值选项
  252. getPropertiesValues: {
  253. url: 'product/kind/:kindId/properties/values',
  254. method: 'GET',
  255. isArray: true
  256. },
  257. // 获取分类的所有属性,不含值选项
  258. getProperties: {
  259. url: 'product/kind/:kindId/properties',
  260. method: 'GET',
  261. isArray: true
  262. },
  263. // 获取类目下器件的所属品牌列表
  264. getBrands: {
  265. url: 'product/kind/:kindId/brands',
  266. methos: 'GTE',
  267. isArray: true
  268. },
  269. // 获取类目下主要属性存在的值选项
  270. getPropertyOptions: {
  271. url: 'product/kind/:kindId/propertyOptions',
  272. method: 'GET',
  273. isArray: true
  274. },
  275. // 根据kindid获取一页ComponentGoods
  276. getCompGoodsByKindid: {
  277. url: 'product/product/getCompGoodsByKindid',
  278. method: 'GET'
  279. },
  280. // 根据keyword获取一页ComponentGoods
  281. getCompGoodsBySearch: {
  282. url: 'product/component/search/compGoods',
  283. method: 'GET'
  284. },
  285. // 根据kindid获取类目属性
  286. getKindProperties: {
  287. url: 'product/kind/:kindId/kindProperties',
  288. method: 'GET',
  289. isArray: true
  290. }
  291. })
  292. }]).factory('EnterpriseList', ['$resource', function($resource) {
  293. return $resource('product/baseInfo/enterprise', {}, {
  294. getAll: {
  295. isArray : false
  296. },
  297. })
  298. }]).factory('getAccountUserSpace', ['$resource', function($resource) {
  299. return $resource('product/baseInfo/getUserSpaceDetails', {}, {
  300. getAll: {
  301. isArray: false
  302. },
  303. getDone: {
  304. url: 'product/baseInfo/getUserSpaceDetails/done',
  305. method: 'GET'
  306. },
  307. })
  308. }]).factory('AddPartner', ['$resource', function($resource) {
  309. return $resource('addpartner', {}, {
  310. addPartner: {
  311. url: 'addpartner/request/nameAndBusCode',
  312. method : 'POST',
  313. },
  314. agreeRequest: {
  315. url: 'addpartner/agree/:id',
  316. method: 'POST'
  317. },
  318. refuseRequest: {
  319. url: 'addpartner/refuse/:id',
  320. method: 'POST'
  321. },
  322. reapply: {
  323. url: 'addpartner/reapply/:id',
  324. method: 'POST'
  325. },
  326. addSupplier: {
  327. url: 'addpartner/addSupplier/:businessCode',
  328. method: 'POST'
  329. },
  330. addServicer: {
  331. url: 'addpartner/addServicer/:businessCode',
  332. method: 'POST'
  333. },
  334. addCust: {
  335. url: 'addpartner/addCust/:businessCode',
  336. method: 'POST'
  337. }
  338. })
  339. }]).factory('AddPartnerMyMessage', ['$resource', function($resource) {
  340. return $resource('addpartner/message', {}, {
  341. getAllMessage: {
  342. url: 'addpartner/message',
  343. },
  344. getMessageTodo: {
  345. url: 'addpartner/message',
  346. params: {
  347. _state: 'todo'
  348. }
  349. },
  350. getMessageDone: {
  351. url: 'addpartner/message',
  352. params: {
  353. _state: 'done'
  354. }
  355. },
  356. getMessageEnd: {
  357. url: 'addpartner/message',
  358. params: {
  359. _state: 'end'
  360. }
  361. }
  362. })
  363. }]).factory('AddPartnerMyRequest', ['$resource', function($resource) {
  364. return $resource('addpartner/request', {}, {
  365. getAllRequest: {
  366. url: 'addpartner/request'
  367. },
  368. getRequestTodo: {
  369. url: 'addpartner/request',
  370. params: {
  371. _state: 'todo'
  372. }
  373. },
  374. getRequestDone: {
  375. url: 'addpartner/request',
  376. params: {
  377. _state: 'done'
  378. }
  379. },
  380. getRequestEnd: {
  381. url: 'addpartner/request',
  382. params: {
  383. _state: 'end'
  384. }
  385. },
  386. requestAmount: {
  387. url: 'addpartner/requestamount',
  388. method: 'GET'
  389. }
  390. })
  391. }]).factory('addtoCart', ['$resource', function($resource) {
  392. return $resource('product/baseInfo/addtoCart', {}, {
  393. save: {
  394. method: 'POST',
  395. isArray: false,
  396. headers: {
  397. 'Content-Type' : 'application/text;charset=UTF-8'
  398. }
  399. },
  400. })
  401. }]).factory('LinktoAccount', ['$resource', function($resource) {
  402. return $resource('B2BtoAccountUrlController', {}, {
  403. getAccountEnList: {
  404. url: "B2BtoAccountUrlController/account/manageUrl.action",
  405. }
  406. })
  407. }]).factory('newPurcOrder', ['$resource', function($resource) {
  408. return $resource('product/baseInfo/newPurcOrder', {}, {
  409. save: {
  410. method: 'POST',
  411. isArray: false,
  412. headers: {
  413. 'Content-Type' : 'application/text;charset=UTF-8'
  414. }
  415. },
  416. method: {
  417. url: 'paymethod/method',
  418. method: 'GET'
  419. }
  420. })
  421. }]).factory('SearchProd', ['$resource', function($resource) {
  422. return $resource('product/baseInfo/SearchProd', {}, {
  423. getAll : {
  424. isArray: false,
  425. }
  426. })
  427. }]).factory('InvitationRecord', ['$resource', function($resource) {
  428. return $resource('invitationrecord', {}, {
  429. invite: {
  430. url: 'invitationrecord/invite',
  431. method: 'POST'
  432. },
  433. records: {
  434. url: 'invitationrecord/records',
  435. method: 'GET'
  436. },
  437. getRecordsByEn: {
  438. url: 'invitationrecord/recordsByEn',
  439. method: 'GET'
  440. },
  441. getActiveRecordsByEn: {
  442. url: 'invitationrecord/activeRecordsByEn',
  443. method: 'GET'
  444. },
  445. enterpriseList: {
  446. url: 'invitationrecord/enterpriseList/:name',
  447. method: 'GET',
  448. isArray: true
  449. },
  450. reInvite: {
  451. url: 'invitationrecord/reInvite/:id',
  452. method: 'POST'
  453. },
  454. getRecordById: {
  455. url: 'invitationrecord/record/:id',
  456. method: 'GET'
  457. },
  458. /**
  459. * 获取邀请链接
  460. */
  461. getInviteUrl: {
  462. url: 'invitationrecord/inviteUrl',
  463. method: 'GET'
  464. },
  465. /**
  466. * 添加合作伙伴
  467. */
  468. addPart: {
  469. url: 'invitationrecord/addPart',
  470. method: 'POST'
  471. }
  472. })
  473. }]);
  474. });