BaseInfo.js 10 KB

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