| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933 |
- define([ 'ngResource'], function() {
- angular.module('PurcServices', [ 'ngResource'
- ]).factory('PurcOrder', ['$resource', function($resource) {
- return $resource('sale/orders/:id', {}, {
- setRead: {
- url: 'sale/orders/display',
- method: 'POST',
- params: {
- _state: 'read'
- }
- },
- setUnRead: {
- url: 'sale/orders/display',
- method: 'POST',
- params: {
- _state: 'unread'
- }
- },
- setTop: {
- url: 'sale/orders/display',
- method: 'POST',
- params: {
- _state: 'top'
- }
- },
- printCount: {
- url: 'sale/orders/printCount/:id',
- method: 'POST'
- }
- });
- }]).factory('PurcOrderItem', ['$resource', function($resource) {
- return $resource('sale/orders/items', {}, {
- getPurcAll: {
- url: 'sale/orders/items/purc',
- },
- getPurcTodo: {
- url: 'sale/orders/items/purc',
- params: {
- _state: 'todo'
- }
- },
- getPurcDone: {
- url: 'sale/orders/items/purc',
- params: {
- _state: 'done'
- }
- },
- getPurcEnd: {
- url: 'sale/orders/items/purc',
- params: {
- _state: 'end'
- }
- },
- getPurcWaiting: {
- url: 'sale/orders/items/purc',
- params: {
- _state: 'waiting'
- }
- },
- getTodo: {
- params: {
- _state: 'todo'
- }
- },
- getDone: {
- params: {
- _state: 'done'
- }
- },
- getEnd: {
- params: {
- _state: 'end'
- }
- },
- getWaiting: {
- params: {
- _state: 'waiting'
- }
- },
- replyByBatch: {
- url: 'sale/orders/items/reply',
- method: 'POST',
- headers: {
- 'Content-Type' : 'application/text;charset=UTF-8'
- }
- },
- reply: {
- url: 'sale/orders/items/:orderItemId/reply',
- method: 'POST',
- params: {
- orderItemId: 'orderItemId'
- }
- },
- getReply: {
- url: 'sale/orders/items/:orderItemId/reply',
- method: 'GET',
- isArray: true,
- params: {
- orderItemId: 'orderItemId'
- }
- }
- });
- }]).factory('PurcChange', ['$resource', function($resource) {
- return $resource('sale/changes/:id', {}, {
- getTodo: {
- params: {
- _state: 'todo'
- }
- },
- getDone: {
- params: {
- _state: 'done'
- }
- },
- reply: {
- url: 'sale/changes/:changeId/reply',
- method: 'POST',
- params: {
- changeId: 'changeId'
- }
- }
- });
- }]).factory('PurcInquiry', ['$resource', function($resource) {
- return $resource('sale/inquiry/:id', {}, {
- getAll: {
- isArray: true
- },
- getTodo: {
- params: {
- _state: 'todo'
- }
- },
- getDone: {
- params: {
- _state: 'done'
- }
- },
- getEnd: {
- params: {
- _state: 'end'
- }
- },
- reply: {
- url: 'sale/inquiry/items/:itemId/reply',
- method: 'POST',
- params: {
- itemId: 'itemId'
- }
- }, getItem: {
- url: 'sale/inquiry/items/:itemId',
- method: 'GET',
- params: {
- itemId: 'itemId'
- }
- }, saveItem: {
- url: 'sale/inquiry/items/:itemId',
- method: 'POST',
- params: {
- itemId: 'itemId'
- }
- }, getHistory: {
- url: 'sale/inquiry/items/:itemId/history',
- method: 'GET',
- params: {
- itemId: 'itemId'
- },
- isArray: true
- },
- getMessage: {
- url: 'sale/inquiry/messageList',
- isArray: true,
- method: 'GET'
- }
- });
- }]).factory('PurcTender', ['$resource', function($resource) {
- return $resource('tender', {}, {
- getMyAll: {
- url: 'tender/purc'
- },
- getMyDone: {
- url: 'tender/purc',
- params: {
- _state: 'done'
- }
- },
- getMyTodo: {
- url: 'tender/purc',
- params: {
- _state: 'todo'
- }
- },
- getMyWaiting: {
- url: 'tender/purc',
- params: {
- _state: 'waiting'
- }
- },
- getAll: {
- },
- getDone: {
- params: {
- _state: 'done'
- }
- },
- getWaiting: {
- params: {
- _state: 'waiting'
- }
- },
- getTodo: {
- params: {
- _state: 'todo'
- }
- },
- getEnd: {
- params: {
- _state: 'end'
- }
- },
- getOpenAll: {
- url: 'tender/open'
- },
- // getOpenDone: {
- // url: 'tender/open',
- // params: {
- // _state: 'done'
- // }
- // },
- // getOpenTodo: {
- // url: 'tender/open',
- // params: {
- // _state: 'todo'
- // }
- // },
- // getOpenEnd: {
- // url: 'tender/open',
- // params: {
- // _state: 'end'
- // }
- // },
- getOne: {
- url: 'tender/:id',
- method: 'GET',
- params: {
- id: 'id'
- }
- },
- addItems: {
- url: 'tender/addItems/:id',
- method: 'POST',
- params: {
- id: 'id'
- }
- },
- getVendorTenderItem: {
- url: 'tender/vendorTenderDetail/:vendUU/:id',
- method: 'GET',
- params: {
- vendUU: 'vendUU',
- id: 'id'
- }
- },
- // getItems: {
- // url: 'tender/items/:id',
- // method: 'GET',
- // params: {
- // id: 'id'
- // },
- // isArray: true
- // },
- save: {
- url: 'tender/save',
- method: 'POST'
- },
- publish: {
- url: 'tender/publish',
- method: 'POST'
- },
- reply: {
- url: 'tender/reply',
- method: 'POST'
- },
- decide: {
- url: 'tender/decide',
- method: 'POST'
- },
- deleteOne: {
- url: 'tender/delete/:id',
- method: 'DELETE',
- params: {
- id: 'id'
- }
- },
- publishSaved: {
- url: 'tender/publishSaved',
- method: 'POST'
- },
- updateSaved: {
- url: 'tender/updateSaved',
- method: 'POST'
- },
- removeAttach: {
- url: 'tender/removeAttach/:attachId',
- method: 'POST',
- params: {
- attachId: 'attachId'
- }
- },
- removeSaleTender: {
- url: 'tender/removeSaleTender',
- method: 'POST'
- },
- deleteProd: {
- url: 'tender/deleteProd/:tenderProdId',
- method: 'POST',
- params: {
- tenderProdId: 'tenderProdId'
- }
- }
- });
- }]).factory('PurcInquiryMould', ['$resource', function($resource) {
- return $resource('sale/mould/:id', {}, {
- getAll: {
-
- },
- getTodo: {
- params: {
- _state: 'todo'
- }
- },
- getDone: {
- params: {
- _state: 'done'
- }
- },
- getEnd: {
- params: {
- _state: 'end'
- }
- },
- getInvalid: {
- params: {
- _state: 'invalid'
- }
- },
- saveHistory: {
- url: 'sale/mould/:id/saveHistory',
- method: 'POST',
- params: {
- id: 'id'
- }
- },reply: {
- url: 'sale/mould/detail/:id/reply',
- method: 'POST',
- params: {
- id: 'id'
- }
- }, getItem: {
- url: 'sale/mould/:id',
- method: 'GET',
- params: {
- id: 'id'
- }
- }, saveItem: {
- url: 'sale/mould/detail/:id',
- method: 'POST',
- params: {
- id: 'id'
- }
- }, getHistory: {
- url: 'sale/mould/:id/history',
- method: 'GET',
- params: {
- id: 'id'
- }
- }
- });
- }]).factory('PurcNotice', ['$resource', function($resource) {
- return $resource('sale/notice/:id', {}, {
- getTodo: {
- params: {
- _state: 'todo'
- }
- },
- getDone: {
- params: {
- _state: 'done'
- }
- },
- getEnd: {
- params: {
- _state: 'end'
- }
- },
- getWaiting: {
- params: {
- _state: 'waiting'
- }
- },
- getSends: {
- url: 'sale/notice/:id/sendItems',
- method: 'GET',
- isArray: true
- },
- sendByBatch: {
- url: 'sale/notice/sendByBatch',
- method: 'POST'
- }
- });
- }]).factory('SaleSend', ['$resource', function($resource) {
- return $resource('sale/notice/sends/:id', {}, {
- getTodo: {
- params: {
- _state: 'todo'
- }
- },
- update: {
- url: 'sale/notice/sends/:id',
- method: 'POST'
- },
- getDone: {
- params: {
- _state: 'done'
- }
- },
- generateBarcodes :{
- url: 'sale/notice/generateBarcodes',
- method: 'POST'
- },
- getPrintBarcodes :{
- url: 'sale/notice/getPrintBarcodes',
- method: 'POST'
- },
- getPrintTemplate:{
- url: 'sale/notice/getPrintTemplate',
- method: 'GET'
- },
- getSPrintBarcode:{
- url: 'sale/notice/getSPrintBarcode',
- method: 'GET'
- },
- updatePrintStatus:{
- url: 'sale/notice/updatePrintStatus',
- method: 'POST'
- }
- });
- }]).factory('PurcForecast', ['$resource', function($resource) {
- return $resource('sale/forecast/:id', {}, {
- });
- }]).factory('PurcAccept', ['$resource', function($resource) {
- return $resource('sale/accept/:id', {}, {
- getAll: {}
- });
- }]).factory('PurcReturn', ['$resource', function($resource) {
- return $resource('sale/return/:id', {}, {
- getAll: {
-
- },
- getEnterpriseName: {
- url:"sale/return/:id/enname",
- method: "GET"
- }
- });
- }]).factory('PurcBadIn', ['$resource', function($resource) {
- return $resource('sale/badIn/:id', {}, {
- });
- }]).factory('PurcBadOut', ['$resource', function($resource) {
- return $resource('sale/badOut/:id', {}, {
- });
- }]).factory('PurcMRB', ['$resource', function($resource) {
- return $resource('sale/MRB/:id', {}, {
- });
- }]).factory('PurcSample', ['$resource', function($resource) {
- return $resource('sale/sample/:id', {}, {
- printCount: {
- url: 'sale/sample/printCount/:id',
- method: 'POST'
- },
- getSend: {
- url: 'sale/sample/:id/send',
- method: 'GET',
- params: {
- id: 'id'
- }
- },
- getTodo: {
- params: {
- _state: 'todo'
- }
- },
- getDone: {
- params: {
- _state: 'done'
- }
- }
- });
- }]).factory('PurcApproval', ['$resource', function($resource) {
- return $resource('sale/sample/approval/:id', {}, {
- getItem: {
- url: 'sale/sample/approval/:id',
- method: 'GET',
- }
- });
- }]).factory('PurcOrderItemHis', ['$resource', function($resource) {
- return $resource('sale/orders/history/items', {}, {
- getTodo: {
- params: {
- _state: 'todo'
- }
- },
- getEnd: {
- params: {
- _state: 'end'
- }
- },
- getReply: {
- url: 'sale/orders/history/items/:orderItemId/reply',
- method: 'GET',
- isArray: true,
- params: {
- orderItemId: 'orderItemId'
- }
- }
- });
- }]).factory('PurcChangeHis', ['$resource', function($resource) {
- return $resource('sale/changes/history/:id', {}, {
- getTodo: {
- params: {
- _state: 'todo'
- }
- }
- });
- }]).factory('PurcInquiryHis', ['$resource', function($resource) {
- return $resource('sale/inquiry/history/:id', {}, {
- getTodo: {
- params: {
- _state: 'todo'
- }
- },
- getItem: {
- url: 'sale/inquiry/history/items/:itemId',
- method: 'GET',
- params: {
- itemId: 'itemId'
- }
- },
- getHistory: {
- url: 'sale/inquiry/history/items/:itemId/history',
- method: 'GET',
- params: {
- itemId: 'itemId'
- },
- isArray: true
- }
- });
- }]).factory('PurcNoticeHis', ['$resource', function($resource) {
- return $resource('sale/notice/history/:id', {}, {
- getTodo: {
- params: {
- _state: 'todo'
- }
- },
- getDone: {
- params: {
- _state: 'done'
- }
- },
- getEnd: {
- params: {
- _state: 'end'
- }
- },
- getSends: {
- url: 'sale/notice/history/:id/sendItems',
- method: 'GET',
- isArray: true
- }
- });
- }]).factory('SaleStat', ['$resource', function($resource) {
- return $resource('sale/stat', {}, {
- day: {
- url: 'sale/stat/day',
- isArray: true
- },
- month: {
- url: 'sale/stat/month',
- isArray: true
- },
- year: {
- url: 'sale/stat/year',
- isArray: true
- },
- cust: {
- url: 'sale/stat/cust'
- },
- custMonth: {
- url: 'sale/stat/cust/month',
- isArray: true
- },
- custYear: {
- url: 'sale/stat/cust/year',
- isArray: true
- },
- seller: {
- url: 'sale/stat/seller'
- },
- sellerMonth: {
- url: 'sale/stat/seller/month',
- isArray: true
- },
- sellerYear: {
- url: 'sale/stat/seller/year',
- isArray: true
- }
- });
- }]).factory('SaleTruck', ['$resource', function($resource) {
- return $resource('sale/truck', {}, {
- save: {
- isArray: true,
- method: 'POST'
- },
- remove: {
- isArray: true,
- method: 'DELETE'
- },
- detail: {
- url: 'sale/truck/items',
- isArray: true
- }
- });
- }]).factory('Customer', ['$resource', function($resource){
- return $resource('vendor/customer/:id', {}, {});
- }]).factory('PagingRelease', ['$resource', function($resource){
- return $resource('api/paging', {}, {
- getTodo: {
- params: {
- _state: 'todo'
- }
- },
- getDone:{
- params: {
- _state: 'done'
- }
- },
- setRead:{
- url: 'api/paging/setRead',
- method: 'POST'
- }
- });
- }]).factory('Product', ['$resource', function($resource){
- return $resource('product', {}, {});
- }]).factory('Vendor', ['$resource', function($resource){
- return $resource('purc/vendor/:id', {}, {
- getServe: {
- // 调取使用uas系统的供应商信息
- url: 'purc/vendor/serve',
- isArray: true
- },
- getVendor: {
- url: 'vendor',
- },
- getVendorDetail: {
- url: 'vendor/:id',
- method: 'GET'
- },
- saveContact: {
- url: 'vendor/savecontact',
- method: 'POST'
- },
- contacts: {
- url: 'vendor/contacts/:venduu',
- method: 'GET',
- isArray: true
- },
- deleteContact: {
- url: 'vendor/deleteContact/:id',
- method: 'DELETE'
- },
- getSimilarVendors: {
- url: 'search/similarVendors',
- method: 'GET',
- isArray: true
- },
- saveCustContact: {
- url: 'vendor/saveCustomerContact',
- method: 'POST'
- },
- custContacts: {
- url: 'vendor/custContacts/:enuu',
- method: 'GET',
- isArray: true
- },
- getSimilarEnterprise: {
- url: 'search/similarEnterprise',
- method: 'GET',
- isArray: true
- },
- vendorInfo: {
- url: 'vendor/vendorInfo',
- method: 'GET'
- },
- enterpriseInfo: {
- url: 'account/enterprise/info/:bussinessCode',
- method: 'GET'
- }
- });
- }]).factory('Quotation', ['$resource', function($resource){
- return $resource('sale/quotation', {}, {
- getTodo: {
- params: {
- _state: 'todo'
- }
- },
- getDone: {
- params: {
- _state: 'done'
- }
- },
- save: {
- method: 'POST',
- isArray: false,
- headers: {
- 'Content-Type' : 'application/text;charset=UTF-8'
- }
- },
- getItem: {
- isArray: false,
- url: 'sale/quotation/item/:id'
- }
- });
- }]).factory('PurcOrderSave', ['$resource', function($resource){
- return $resource('sale/newOrder', {}, {
- save: {
- method: 'POST',
- isArray: false,
- headers: {
- 'Content-Type' : 'application/text;charset=UTF-8'
- }
- }
- });
- }]).factory('VendorInfo', ['$resource', function($resource){
- return $resource('purchase', {}, {
- getVendorInfo: {
- url: 'purchase/getVendorInfo',
- method: 'GET'
- },
- getProdInfo: {
- url: 'purchase/getProdInfo/:id',
- method: 'GET'
- },
- customerInfo: {
- url: 'purchase/customerInfo/:custuu',
- method: 'GET'
- },
- relieve: {
- url: 'purchase/relieve/:id',
- method: 'POST'
- },
- activeVend: {
- url: 'purchase/activeVend/:id',
- method: 'POST'
- },
- disableCust: {
- url: 'purchase/disableCust/:id',
- method: 'POST'
- },
- activeCust: {
- url: 'purchase/activeCust/:id',
- method: 'POST'
- }
- });
- }]).factory('ShipAddress', ['$resource', function($resource){
- return $resource('account/enterprise', {}, {
- saveAddress: {
- url: 'account/enterprise/saveShipAddress',
- method: 'POST'
- },
- shipAddList: {
- url: 'account/enterprise/shipAddList',
- method: 'GET',
- isArray: true
- },
- removeShipAddress: {
- url: 'account/enterprise/removeShipAddress/:id',
- method: 'DELETE'
- }
- });
- }]).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
- }
- })
- }]).factory('BrandActiveAPI', ['$resource', function($resource) {
- //对单个BrandActive对象操作
- return $resource('product/brand/:uuid', {}, {
- /*
- * get,根据uuid获得BrandActive
- */
- // 获取所有品牌的简要信息
- getSimpleInfo : {
- url : 'product/brand/Info',
- method : 'GET',
- isArray : true
- },
- // 分页获取简要信息
- getSimpleInfoPage: {
- url: 'product/brand/Info/ByPage',
- method: 'GET'
- },
- // 通过名称获取品牌
- findByName : {
- url: 'product/brand/ByName/:name',
- method: 'GET'
- }
- })
- }]).factory('ComponentActiveAPI', ['$resource', function($resource){
- return $resource('product/component', {},{
- //获取ComponentInfo的分页数据
- getInfoPage: {
- url: 'product/component/list',
- method: 'GET'
- },
- //根据uuid获取器件信息
- get: {
- url: 'product/component/:uuid',
- method: 'GET'
- },// 根据UUid获取单个器件的简要信息
- // 分页获取简要信息
- getInfo: {
- url: 'product/component/info',
- method: 'GET'
- }
- });
- }]).factory('PurchaseInquiry', ['$resource', function($resource){
- return $resource('purc/inquiry', {}, {
- getTodo: {
- params: {
- _state: 'todo'
- },
- method: 'GET'
- },
- getDone: {
- params: {
- _state: 'done'
- },
- method: 'GET'
- },
- getEnd: {
- params: {
- _state: 'end'
- },
- method: 'GET'
- },
- getAll: {
- method: 'GET'
- },
- getUnapply: {
- url: 'purc/inquiry/unapply',
- method: 'GET'
- },
- getSubmit: {
- url: 'purc/inquiry/submit',
- method: 'GET'
- },
- deleteById: {
- url: 'purc/inquiry/deleteById/:id',
- method: 'DELETE'
- },
- clearOrder: {
- url: 'purc/inquiry/clearOrder/:id',
- method: 'DELETE'
- },
- save: {
- url: 'purc/inquiry/save',
- method: 'POST'
- },
- detail: {
- url: 'purc/inquiry/detail/:id',
- method: 'GET'
- },
- submit: {
- url: 'purc/inquiry/saveAndSubmit',
- method: 'POST'
- },
- accept: {
- url: 'purc/inquiry/accept/:id',
- method: 'POST'
- },
- refuse: {
- url: 'purc/inquiry/refuse/:id',
- method: 'POST'
- },
- getAllDetail: {
- url: 'purc/inquiry/getAllDetail/:id',
- method: 'GET',
- isArray: true
- },
- submitUnapply: {
- url: 'purc/inquiry/submit/:id',
- method: 'POST'
- },
- saveAndSubmitWithoutVendor: {
- url: 'purc/inquiry/saveAndSubmitWithoutVendor',
- method: 'POST'
- },
- saveWithoutVendor: {
- url: 'purc/inquiry/saveWithoutVendor',
- method: 'POST'
- },
- publishInquiry: {
- url: 'purc/inquiry/pubishInquiry/:id',
- method: 'POST'
- },
- publicInquiryItem: {
- url: 'purc/inquiry/publicInquiryItem',
- method: 'GET'
- },
- inquiryItemDetail: {
- url: 'purc/inquiry/inquiryItem/:id',
- method: 'GET'
- },
- transtoInquiry: {
- url: 'purc/inquiry/transtoInquiry/:id',
- method: 'POST'
- }
- });
- }]);
- });
|