| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408 |
- define(['ngResource'], function() {
- angular.module('ProductServices', [ 'ngResource']).factory('GetProductInfo', ['$resource', function($resource) {
- return $resource('product/baseInfo', {}, {
- getOne : {
- url : "product/baseInfo/:id",
- method : 'GET'
- },
- getAll : {
- isArray : false
- },
- getStandard: {
- params: {
- _state: 'standard'
- }
- },
- getNonstandard: {
- params: {
- _state: 'nonstandard'
- }
- },
- uploadByBatch : {
- url : "product/baseInfo/uploadByBatch",
- method : 'GET',
- },
- addNewProd : {
- url: "product/baseInfo/addNewProduct",
- method : 'POST'
- },
- update : {
- url: "product/baseInfo/updateProdInfo",
- method : 'POST'
- },
- deleteById : {
- url: "product/baseInfo/delete/:id",
- method : 'DELETE'
- },
- getAllPartners : {
- url : "product/baseInfo/getAllPartners",
- method : 'GET',
- isArray : true
- },
- addCust : {
- url : "product/baseInfo/addCust",
- method : 'POST',
- isArray: false,
- headers: {
- 'Content-Type' : 'application/text;charset=UTF-8'
- }
- },
- addSupplier : {
- url: "product/baseInfo/addSupplier",
- method : 'POST',
- isArray: false,
- headers: {
- 'Content-Type' : 'application/text;charset=UTF-8'
- }
- },
- businessGroups: {
- url: "product/baseInfo/enterbusinessGroups",
- method : 'GET',
- headers: {
- 'Content-Type' : 'application/text;charset=UTF-8'
- }
- },
- getAttach: {
- url: "product/baseInfo/getAttach/:id",
- method: 'GET',
- },
- toggle: {
- url: 'product/baseInfo/toggle/:status',
- method: 'POST'
- }
- })
- }]).factory('GetProductInfoNewest', ['$resource', function($resource) {
- return $resource('product/baseInfo/info', {}, {
- getAll : {
- isArray : false
- },
- getStandard: {
- params: {
- _state: 'standard'
- }
- },
- getNonstandard: {
- params: {
- _state: 'nonstandard'
- }
- }
- })
- }]).factory('ComponentActive', ['$resource', function($resource) {
- //获取ComponentActive的分页数据
- return $resource('api/product/component/:uuid', {}, {
- /*
- * get 获ComponentsActive的分页数据,根据uuid获得ComponentActive
- */
- //根据kindid获得ComponentsActiveSimpleInfo的分页数据
- getSimpleInfo : {
- url : 'api/product/component/simpleInfo',
- method : 'GET'
- },
- // 根据UUid获取单个器件的简要信息
- getSimpleInfoByUuid: {
- url: 'api/product/component/Info/:uuid',
- method: 'GET'
- },
- // 根据原厂型号(code)获得ComponentActive
- getByCode : {
- url : 'api/product/component/byCode/:code',
- method : 'GET',
- isArray : true
- },
- // 禁用ComponentActive
- disable : {
- url : 'product/component/:uuid/disable',
- method : 'PUT'
- },
- // 根据UUid 获取列表
- getByUuid: {
- url : 'api/product/component/byUuid',
- method : 'GET',
- isArray : true
- },
- //根据批次号获取器件信息
- getByBatchCode: {
- url : 'product/component/:batchCode/detail',
- method : 'GET'
- },//根据原厂型号和品牌获取器件信息
- getByCodeAndBrandId: {
- url: 'product/component/codeAndBrandId/:code',
- method: 'GET',
- isArray: true
- },//根据原厂型号和类目获取器件信息
- getByCodeAndKindId: {
- url: 'product/component/codeAndKindId/:code',
- method: 'GET',
- isArray: true
- },
- /*样品*/
- getProofCompon: {
- url: 'api/product/component/list/proofing',
- method: 'GET'
- },
- hasSamples: {
- url: 'api/product/component/proofing/hasSample',
- method: 'POST'
- },
- recommendProofing: {
- url: 'api/product/component/:qty/recommend/proofing',
- method: 'GET',
- isArray: true
- },
- /*现货*/
- getOriginalCompon: {
- url: 'api/product/component/list/original',
- method: 'GET'
- },
- recommendOriginal: {
- url: 'api/product/component/:qty/recommend/original',
- method: 'GET',
- isArray: true
- },
- // 根据类目id获取封装规格
- getPackagingByKindid: {
- url: 'product/component/packaging/:kindid',
- method: 'GET',
- isArray: true
- },
- // 批量修改器件类目
- moveCmp: {
- url: 'product/component/moveCmp',
- method: 'PUT',
- isArray : true
- },
- //根据类目id获取器件列表
- getComponentsByKindid: {
- url: 'product/component/cmplist/:kindId',
- method: 'GET'
- }
- })
- }]).factory('KindAPI', ['$resource', '$cacheFactory', function($resource, $cacheFactory) {
- var cache = $cacheFactory('KindAPI');
- return $resource ('product/kind', {}, {
- // 根据父级类目获取其子类目,不包含深层
- getChildren: {
- url: 'product/kind/:parentId/children',
- method: 'GET',
- isArray: true
- },
- // 获取父级分类的所有子分类,含深层
- getAllChildren: {
- url: 'product/kind/:parentId/children_all',
- method: 'GET',
- isArray: true
- },
- // 获取子类目的所有父类目(含每级类目的兄弟类目),返回逐级向下的类目数组
- getParentsWithBothers: {
- url: 'product/kind/:childId/parentsWithBothers',
- method: 'GET',
- isArray: true
- },
- // 获取子类目的所有父类目,返回逐级向下的类目数组
- getParents: {
- url: 'product/kind/:childId/parents',
- method: 'GET',
- isArray: true
- },
- // 获取分类的所有属性,包括存在的值选项
- getPropertiesValues: {
- url: 'product/kind/:kindId/properties/values',
- method: 'GET',
- isArray: true
- },
- // 获取分类的所有属性,不含值选项
- getProperties: {
- url: 'product/kind/:kindId/properties',
- method: 'GET',
- isArray: true
- },
- // 获取类目下器件的所属品牌列表
- getBrands: {
- url: 'product/kind/:kindId/brands',
- methos: 'GTE',
- isArray: true
- },
- // 获取类目下主要属性存在的值选项
- getPropertyOptions: {
- url: 'product/kind/:kindId/propertyOptions',
- method: 'GET',
- isArray: true
- },
- // 根据kindid获取一页ComponentGoods
- getCompGoodsByKindid: {
- url: 'product/product/getCompGoodsByKindid',
- method: 'GET'
- },
- // 根据keyword获取一页ComponentGoods
- getCompGoodsBySearch: {
- url: 'product/component/search/compGoods',
- method: 'GET'
- },
- // 根据kindid获取类目属性
- getKindProperties: {
- url: 'product/kind/:kindId/kindProperties',
- method: 'GET',
- isArray: true
- }
- })
- }]).factory('EnterpriseList', ['$resource', function($resource) {
- return $resource('product/baseInfo/enterprise', {}, {
- getAll: {
- isArray : false
- },
- })
- }]).factory('getAccountUserSpace', ['$resource', function($resource) {
- return $resource('product/baseInfo/getUserSpaceDetails', {}, {
- getAll: {
- isArray: false
- }
- })
- }]).factory('AddPartner', ['$resource', function($resource) {
- return $resource('addpartner', {}, {
- addPartner: {
- url: 'addpartner/request/nameAndBusCode',
- method : 'POST',
- },
- agreeRequest: {
- url: 'addpartner/agree/:id',
- method: 'POST'
- },
- refuseRequest: {
- url: 'addpartner/refuse/:id',
- method: 'POST'
- },
- reapply: {
- url: 'addpartner/reapply/:id',
- method: 'POST'
- },
- addSupplier: {
- url: 'addpartner/addSupplier/:businessCode',
- method: 'POST'
- },
- addCust: {
- url: 'addpartner/addCust/:businessCode',
- method: 'POST'
- }
- })
- }]).factory('AddPartnerMyMessage', ['$resource', function($resource) {
- return $resource('addpartner/message', {}, {
- getAllMessage: {
- url: 'addpartner/message',
- },
- getMessageTodo: {
- url: 'addpartner/message',
- params: {
- _state: 'todo'
- }
- },
- getMessageDone: {
- url: 'addpartner/message',
- params: {
- _state: 'done'
- }
- },
- getMessageEnd: {
- url: 'addpartner/message',
- params: {
- _state: 'end'
- }
- }
- })
- }]).factory('AddPartnerMyRequest', ['$resource', function($resource) {
- return $resource('addpartner/request', {}, {
- getAllRequest: {
- url: 'addpartner/request'
- },
- getRequestTodo: {
- url: 'addpartner/request',
- params: {
- _state: 'todo'
- }
- },
- getRequestDone: {
- url: 'addpartner/request',
- params: {
- _state: 'done'
- }
- },
- getRequestEnd: {
- url: 'addpartner/request',
- params: {
- _state: 'end'
- }
- },
- requestAmount: {
- url: 'addpartner/requestamount',
- method: 'GET'
- }
- })
- }]).factory('addtoCart', ['$resource', function($resource) {
- return $resource('product/baseInfo/addtoCart', {}, {
- save: {
- method: 'POST',
- isArray: false,
- headers: {
- 'Content-Type' : 'application/text;charset=UTF-8'
- }
- },
- })
- }]).factory('LinktoAccount', ['$resource', function($resource) {
- return $resource('B2BtoAccountUrlController', {}, {
- getAccountEnList: {
- url: "B2BtoAccountUrlController/account/manageUrl.action",
- }
- })
- }]).factory('newPurcOrder', ['$resource', function($resource) {
- return $resource('product/baseInfo/newPurcOrder', {}, {
- save: {
- method: 'POST',
- isArray: false,
- headers: {
- 'Content-Type' : 'application/text;charset=UTF-8'
- }
- },
- method: {
- url: 'paymethod/method',
- method: 'GET'
- }
- })
- }]).factory('SearchProd', ['$resource', function($resource) {
- return $resource('product/baseInfo/SearchProd', {}, {
- getAll : {
- isArray: false,
- }
- })
- }]).factory('InvitationRecord', ['$resource', function($resource) {
- return $resource('invitationrecord', {}, {
- invite: {
- url: 'invitationrecord/invite',
- method: 'POST'
- },
- records: {
- url: 'invitationrecord/records',
- method: 'GET'
- },
- getRecordsByEn: {
- url: 'invitationrecord/recordsByEn',
- method: 'GET'
- },
- getActiveRecordsByEn: {
- url: 'invitationrecord/activeRecordsByEn',
- method: 'GET'
- },
- enterpriseList: {
- url: 'invitationrecord/enterpriseList/:name',
- method: 'GET',
- isArray: true
- },
- reInvite: {
- url: 'invitationrecord/reInvite/:id',
- method: 'POST'
- },
- getRecordById: {
- url: 'invitationrecord/record/:id',
- method: 'GET'
- }
- })
- }]);
- });
|