Purc.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933
  1. define([ 'ngResource'], function() {
  2. angular.module('PurcServices', [ 'ngResource'
  3. ]).factory('PurcOrder', ['$resource', function($resource) {
  4. return $resource('sale/orders/:id', {}, {
  5. setRead: {
  6. url: 'sale/orders/display',
  7. method: 'POST',
  8. params: {
  9. _state: 'read'
  10. }
  11. },
  12. setUnRead: {
  13. url: 'sale/orders/display',
  14. method: 'POST',
  15. params: {
  16. _state: 'unread'
  17. }
  18. },
  19. setTop: {
  20. url: 'sale/orders/display',
  21. method: 'POST',
  22. params: {
  23. _state: 'top'
  24. }
  25. },
  26. printCount: {
  27. url: 'sale/orders/printCount/:id',
  28. method: 'POST'
  29. }
  30. });
  31. }]).factory('PurcOrderItem', ['$resource', function($resource) {
  32. return $resource('sale/orders/items', {}, {
  33. getPurcAll: {
  34. url: 'sale/orders/items/purc',
  35. },
  36. getPurcTodo: {
  37. url: 'sale/orders/items/purc',
  38. params: {
  39. _state: 'todo'
  40. }
  41. },
  42. getPurcDone: {
  43. url: 'sale/orders/items/purc',
  44. params: {
  45. _state: 'done'
  46. }
  47. },
  48. getPurcEnd: {
  49. url: 'sale/orders/items/purc',
  50. params: {
  51. _state: 'end'
  52. }
  53. },
  54. getPurcWaiting: {
  55. url: 'sale/orders/items/purc',
  56. params: {
  57. _state: 'waiting'
  58. }
  59. },
  60. getTodo: {
  61. params: {
  62. _state: 'todo'
  63. }
  64. },
  65. getDone: {
  66. params: {
  67. _state: 'done'
  68. }
  69. },
  70. getEnd: {
  71. params: {
  72. _state: 'end'
  73. }
  74. },
  75. getWaiting: {
  76. params: {
  77. _state: 'waiting'
  78. }
  79. },
  80. replyByBatch: {
  81. url: 'sale/orders/items/reply',
  82. method: 'POST',
  83. headers: {
  84. 'Content-Type' : 'application/text;charset=UTF-8'
  85. }
  86. },
  87. reply: {
  88. url: 'sale/orders/items/:orderItemId/reply',
  89. method: 'POST',
  90. params: {
  91. orderItemId: 'orderItemId'
  92. }
  93. },
  94. getReply: {
  95. url: 'sale/orders/items/:orderItemId/reply',
  96. method: 'GET',
  97. isArray: true,
  98. params: {
  99. orderItemId: 'orderItemId'
  100. }
  101. }
  102. });
  103. }]).factory('PurcChange', ['$resource', function($resource) {
  104. return $resource('sale/changes/:id', {}, {
  105. getTodo: {
  106. params: {
  107. _state: 'todo'
  108. }
  109. },
  110. getDone: {
  111. params: {
  112. _state: 'done'
  113. }
  114. },
  115. reply: {
  116. url: 'sale/changes/:changeId/reply',
  117. method: 'POST',
  118. params: {
  119. changeId: 'changeId'
  120. }
  121. }
  122. });
  123. }]).factory('PurcInquiry', ['$resource', function($resource) {
  124. return $resource('sale/inquiry/:id', {}, {
  125. getAll: {
  126. isArray: true
  127. },
  128. getTodo: {
  129. params: {
  130. _state: 'todo'
  131. }
  132. },
  133. getDone: {
  134. params: {
  135. _state: 'done'
  136. }
  137. },
  138. getEnd: {
  139. params: {
  140. _state: 'end'
  141. }
  142. },
  143. reply: {
  144. url: 'sale/inquiry/items/:itemId/reply',
  145. method: 'POST',
  146. params: {
  147. itemId: 'itemId'
  148. }
  149. }, getItem: {
  150. url: 'sale/inquiry/items/:itemId',
  151. method: 'GET',
  152. params: {
  153. itemId: 'itemId'
  154. }
  155. }, saveItem: {
  156. url: 'sale/inquiry/items/:itemId',
  157. method: 'POST',
  158. params: {
  159. itemId: 'itemId'
  160. }
  161. }, getHistory: {
  162. url: 'sale/inquiry/items/:itemId/history',
  163. method: 'GET',
  164. params: {
  165. itemId: 'itemId'
  166. },
  167. isArray: true
  168. },
  169. getMessage: {
  170. url: 'sale/inquiry/messageList',
  171. isArray: true,
  172. method: 'GET'
  173. }
  174. });
  175. }]).factory('PurcTender', ['$resource', function($resource) {
  176. return $resource('tender', {}, {
  177. getMyAll: {
  178. url: 'tender/purc'
  179. },
  180. getMyDone: {
  181. url: 'tender/purc',
  182. params: {
  183. _state: 'done'
  184. }
  185. },
  186. getMyTodo: {
  187. url: 'tender/purc',
  188. params: {
  189. _state: 'todo'
  190. }
  191. },
  192. getMyWaiting: {
  193. url: 'tender/purc',
  194. params: {
  195. _state: 'waiting'
  196. }
  197. },
  198. getAll: {
  199. },
  200. getDone: {
  201. params: {
  202. _state: 'done'
  203. }
  204. },
  205. getWaiting: {
  206. params: {
  207. _state: 'waiting'
  208. }
  209. },
  210. getTodo: {
  211. params: {
  212. _state: 'todo'
  213. }
  214. },
  215. getEnd: {
  216. params: {
  217. _state: 'end'
  218. }
  219. },
  220. getOpenAll: {
  221. url: 'tender/open'
  222. },
  223. // getOpenDone: {
  224. // url: 'tender/open',
  225. // params: {
  226. // _state: 'done'
  227. // }
  228. // },
  229. // getOpenTodo: {
  230. // url: 'tender/open',
  231. // params: {
  232. // _state: 'todo'
  233. // }
  234. // },
  235. // getOpenEnd: {
  236. // url: 'tender/open',
  237. // params: {
  238. // _state: 'end'
  239. // }
  240. // },
  241. getOne: {
  242. url: 'tender/:id',
  243. method: 'GET',
  244. params: {
  245. id: 'id'
  246. }
  247. },
  248. addItems: {
  249. url: 'tender/addItems/:id',
  250. method: 'POST',
  251. params: {
  252. id: 'id'
  253. }
  254. },
  255. getVendorTenderItem: {
  256. url: 'tender/vendorTenderDetail/:vendUU/:id',
  257. method: 'GET',
  258. params: {
  259. vendUU: 'vendUU',
  260. id: 'id'
  261. }
  262. },
  263. // getItems: {
  264. // url: 'tender/items/:id',
  265. // method: 'GET',
  266. // params: {
  267. // id: 'id'
  268. // },
  269. // isArray: true
  270. // },
  271. save: {
  272. url: 'tender/save',
  273. method: 'POST'
  274. },
  275. publish: {
  276. url: 'tender/publish',
  277. method: 'POST'
  278. },
  279. reply: {
  280. url: 'tender/reply',
  281. method: 'POST'
  282. },
  283. decide: {
  284. url: 'tender/decide',
  285. method: 'POST'
  286. },
  287. deleteOne: {
  288. url: 'tender/delete/:id',
  289. method: 'DELETE',
  290. params: {
  291. id: 'id'
  292. }
  293. },
  294. publishSaved: {
  295. url: 'tender/publishSaved',
  296. method: 'POST'
  297. },
  298. updateSaved: {
  299. url: 'tender/updateSaved',
  300. method: 'POST'
  301. },
  302. removeAttach: {
  303. url: 'tender/removeAttach/:attachId',
  304. method: 'POST',
  305. params: {
  306. attachId: 'attachId'
  307. }
  308. },
  309. removeSaleTender: {
  310. url: 'tender/removeSaleTender',
  311. method: 'POST'
  312. },
  313. deleteProd: {
  314. url: 'tender/deleteProd/:tenderProdId',
  315. method: 'POST',
  316. params: {
  317. tenderProdId: 'tenderProdId'
  318. }
  319. }
  320. });
  321. }]).factory('PurcInquiryMould', ['$resource', function($resource) {
  322. return $resource('sale/mould/:id', {}, {
  323. getAll: {
  324. },
  325. getTodo: {
  326. params: {
  327. _state: 'todo'
  328. }
  329. },
  330. getDone: {
  331. params: {
  332. _state: 'done'
  333. }
  334. },
  335. getEnd: {
  336. params: {
  337. _state: 'end'
  338. }
  339. },
  340. getInvalid: {
  341. params: {
  342. _state: 'invalid'
  343. }
  344. },
  345. saveHistory: {
  346. url: 'sale/mould/:id/saveHistory',
  347. method: 'POST',
  348. params: {
  349. id: 'id'
  350. }
  351. },reply: {
  352. url: 'sale/mould/detail/:id/reply',
  353. method: 'POST',
  354. params: {
  355. id: 'id'
  356. }
  357. }, getItem: {
  358. url: 'sale/mould/:id',
  359. method: 'GET',
  360. params: {
  361. id: 'id'
  362. }
  363. }, saveItem: {
  364. url: 'sale/mould/detail/:id',
  365. method: 'POST',
  366. params: {
  367. id: 'id'
  368. }
  369. }, getHistory: {
  370. url: 'sale/mould/:id/history',
  371. method: 'GET',
  372. params: {
  373. id: 'id'
  374. }
  375. }
  376. });
  377. }]).factory('PurcNotice', ['$resource', function($resource) {
  378. return $resource('sale/notice/:id', {}, {
  379. getTodo: {
  380. params: {
  381. _state: 'todo'
  382. }
  383. },
  384. getDone: {
  385. params: {
  386. _state: 'done'
  387. }
  388. },
  389. getEnd: {
  390. params: {
  391. _state: 'end'
  392. }
  393. },
  394. getWaiting: {
  395. params: {
  396. _state: 'waiting'
  397. }
  398. },
  399. getSends: {
  400. url: 'sale/notice/:id/sendItems',
  401. method: 'GET',
  402. isArray: true
  403. },
  404. sendByBatch: {
  405. url: 'sale/notice/sendByBatch',
  406. method: 'POST'
  407. }
  408. });
  409. }]).factory('SaleSend', ['$resource', function($resource) {
  410. return $resource('sale/notice/sends/:id', {}, {
  411. getTodo: {
  412. params: {
  413. _state: 'todo'
  414. }
  415. },
  416. update: {
  417. url: 'sale/notice/sends/:id',
  418. method: 'POST'
  419. },
  420. getDone: {
  421. params: {
  422. _state: 'done'
  423. }
  424. },
  425. generateBarcodes :{
  426. url: 'sale/notice/generateBarcodes',
  427. method: 'POST'
  428. },
  429. getPrintBarcodes :{
  430. url: 'sale/notice/getPrintBarcodes',
  431. method: 'POST'
  432. },
  433. getPrintTemplate:{
  434. url: 'sale/notice/getPrintTemplate',
  435. method: 'GET'
  436. },
  437. getSPrintBarcode:{
  438. url: 'sale/notice/getSPrintBarcode',
  439. method: 'GET'
  440. },
  441. updatePrintStatus:{
  442. url: 'sale/notice/updatePrintStatus',
  443. method: 'POST'
  444. }
  445. });
  446. }]).factory('PurcForecast', ['$resource', function($resource) {
  447. return $resource('sale/forecast/:id', {}, {
  448. });
  449. }]).factory('PurcAccept', ['$resource', function($resource) {
  450. return $resource('sale/accept/:id', {}, {
  451. getAll: {}
  452. });
  453. }]).factory('PurcReturn', ['$resource', function($resource) {
  454. return $resource('sale/return/:id', {}, {
  455. getAll: {
  456. },
  457. getEnterpriseName: {
  458. url:"sale/return/:id/enname",
  459. method: "GET"
  460. }
  461. });
  462. }]).factory('PurcBadIn', ['$resource', function($resource) {
  463. return $resource('sale/badIn/:id', {}, {
  464. });
  465. }]).factory('PurcBadOut', ['$resource', function($resource) {
  466. return $resource('sale/badOut/:id', {}, {
  467. });
  468. }]).factory('PurcMRB', ['$resource', function($resource) {
  469. return $resource('sale/MRB/:id', {}, {
  470. });
  471. }]).factory('PurcSample', ['$resource', function($resource) {
  472. return $resource('sale/sample/:id', {}, {
  473. printCount: {
  474. url: 'sale/sample/printCount/:id',
  475. method: 'POST'
  476. },
  477. getSend: {
  478. url: 'sale/sample/:id/send',
  479. method: 'GET',
  480. params: {
  481. id: 'id'
  482. }
  483. },
  484. getTodo: {
  485. params: {
  486. _state: 'todo'
  487. }
  488. },
  489. getDone: {
  490. params: {
  491. _state: 'done'
  492. }
  493. }
  494. });
  495. }]).factory('PurcApproval', ['$resource', function($resource) {
  496. return $resource('sale/sample/approval/:id', {}, {
  497. getItem: {
  498. url: 'sale/sample/approval/:id',
  499. method: 'GET',
  500. }
  501. });
  502. }]).factory('PurcOrderItemHis', ['$resource', function($resource) {
  503. return $resource('sale/orders/history/items', {}, {
  504. getTodo: {
  505. params: {
  506. _state: 'todo'
  507. }
  508. },
  509. getEnd: {
  510. params: {
  511. _state: 'end'
  512. }
  513. },
  514. getReply: {
  515. url: 'sale/orders/history/items/:orderItemId/reply',
  516. method: 'GET',
  517. isArray: true,
  518. params: {
  519. orderItemId: 'orderItemId'
  520. }
  521. }
  522. });
  523. }]).factory('PurcChangeHis', ['$resource', function($resource) {
  524. return $resource('sale/changes/history/:id', {}, {
  525. getTodo: {
  526. params: {
  527. _state: 'todo'
  528. }
  529. }
  530. });
  531. }]).factory('PurcInquiryHis', ['$resource', function($resource) {
  532. return $resource('sale/inquiry/history/:id', {}, {
  533. getTodo: {
  534. params: {
  535. _state: 'todo'
  536. }
  537. },
  538. getItem: {
  539. url: 'sale/inquiry/history/items/:itemId',
  540. method: 'GET',
  541. params: {
  542. itemId: 'itemId'
  543. }
  544. },
  545. getHistory: {
  546. url: 'sale/inquiry/history/items/:itemId/history',
  547. method: 'GET',
  548. params: {
  549. itemId: 'itemId'
  550. },
  551. isArray: true
  552. }
  553. });
  554. }]).factory('PurcNoticeHis', ['$resource', function($resource) {
  555. return $resource('sale/notice/history/:id', {}, {
  556. getTodo: {
  557. params: {
  558. _state: 'todo'
  559. }
  560. },
  561. getDone: {
  562. params: {
  563. _state: 'done'
  564. }
  565. },
  566. getEnd: {
  567. params: {
  568. _state: 'end'
  569. }
  570. },
  571. getSends: {
  572. url: 'sale/notice/history/:id/sendItems',
  573. method: 'GET',
  574. isArray: true
  575. }
  576. });
  577. }]).factory('SaleStat', ['$resource', function($resource) {
  578. return $resource('sale/stat', {}, {
  579. day: {
  580. url: 'sale/stat/day',
  581. isArray: true
  582. },
  583. month: {
  584. url: 'sale/stat/month',
  585. isArray: true
  586. },
  587. year: {
  588. url: 'sale/stat/year',
  589. isArray: true
  590. },
  591. cust: {
  592. url: 'sale/stat/cust'
  593. },
  594. custMonth: {
  595. url: 'sale/stat/cust/month',
  596. isArray: true
  597. },
  598. custYear: {
  599. url: 'sale/stat/cust/year',
  600. isArray: true
  601. },
  602. seller: {
  603. url: 'sale/stat/seller'
  604. },
  605. sellerMonth: {
  606. url: 'sale/stat/seller/month',
  607. isArray: true
  608. },
  609. sellerYear: {
  610. url: 'sale/stat/seller/year',
  611. isArray: true
  612. }
  613. });
  614. }]).factory('SaleTruck', ['$resource', function($resource) {
  615. return $resource('sale/truck', {}, {
  616. save: {
  617. isArray: true,
  618. method: 'POST'
  619. },
  620. remove: {
  621. isArray: true,
  622. method: 'DELETE'
  623. },
  624. detail: {
  625. url: 'sale/truck/items',
  626. isArray: true
  627. }
  628. });
  629. }]).factory('Customer', ['$resource', function($resource){
  630. return $resource('vendor/customer/:id', {}, {});
  631. }]).factory('PagingRelease', ['$resource', function($resource){
  632. return $resource('api/paging', {}, {
  633. getTodo: {
  634. params: {
  635. _state: 'todo'
  636. }
  637. },
  638. getDone:{
  639. params: {
  640. _state: 'done'
  641. }
  642. },
  643. setRead:{
  644. url: 'api/paging/setRead',
  645. method: 'POST'
  646. }
  647. });
  648. }]).factory('Product', ['$resource', function($resource){
  649. return $resource('product', {}, {});
  650. }]).factory('Vendor', ['$resource', function($resource){
  651. return $resource('purc/vendor/:id', {}, {
  652. getServe: {
  653. // 调取使用uas系统的供应商信息
  654. url: 'purc/vendor/serve',
  655. isArray: true
  656. },
  657. getVendor: {
  658. url: 'vendor',
  659. },
  660. getVendorDetail: {
  661. url: 'vendor/:id',
  662. method: 'GET'
  663. },
  664. saveContact: {
  665. url: 'vendor/savecontact',
  666. method: 'POST'
  667. },
  668. contacts: {
  669. url: 'vendor/contacts/:venduu',
  670. method: 'GET',
  671. isArray: true
  672. },
  673. deleteContact: {
  674. url: 'vendor/deleteContact/:id',
  675. method: 'DELETE'
  676. },
  677. getSimilarVendors: {
  678. url: 'search/similarVendors',
  679. method: 'GET',
  680. isArray: true
  681. },
  682. saveCustContact: {
  683. url: 'vendor/saveCustomerContact',
  684. method: 'POST'
  685. },
  686. custContacts: {
  687. url: 'vendor/custContacts/:enuu',
  688. method: 'GET',
  689. isArray: true
  690. },
  691. getSimilarEnterprise: {
  692. url: 'search/similarEnterprise',
  693. method: 'GET',
  694. isArray: true
  695. },
  696. vendorInfo: {
  697. url: 'vendor/vendorInfo',
  698. method: 'GET'
  699. },
  700. enterpriseInfo: {
  701. url: 'account/enterprise/info/:bussinessCode',
  702. method: 'GET'
  703. }
  704. });
  705. }]).factory('Quotation', ['$resource', function($resource){
  706. return $resource('sale/quotation', {}, {
  707. getTodo: {
  708. params: {
  709. _state: 'todo'
  710. }
  711. },
  712. getDone: {
  713. params: {
  714. _state: 'done'
  715. }
  716. },
  717. save: {
  718. method: 'POST',
  719. isArray: false,
  720. headers: {
  721. 'Content-Type' : 'application/text;charset=UTF-8'
  722. }
  723. },
  724. getItem: {
  725. isArray: false,
  726. url: 'sale/quotation/item/:id'
  727. }
  728. });
  729. }]).factory('PurcOrderSave', ['$resource', function($resource){
  730. return $resource('sale/newOrder', {}, {
  731. save: {
  732. method: 'POST',
  733. isArray: false,
  734. headers: {
  735. 'Content-Type' : 'application/text;charset=UTF-8'
  736. }
  737. }
  738. });
  739. }]).factory('VendorInfo', ['$resource', function($resource){
  740. return $resource('purchase', {}, {
  741. getVendorInfo: {
  742. url: 'purchase/getVendorInfo',
  743. method: 'GET'
  744. },
  745. getProdInfo: {
  746. url: 'purchase/getProdInfo/:id',
  747. method: 'GET'
  748. },
  749. customerInfo: {
  750. url: 'purchase/customerInfo/:custuu',
  751. method: 'GET'
  752. },
  753. relieve: {
  754. url: 'purchase/relieve/:id',
  755. method: 'POST'
  756. },
  757. activeVend: {
  758. url: 'purchase/activeVend/:id',
  759. method: 'POST'
  760. },
  761. disableCust: {
  762. url: 'purchase/disableCust/:id',
  763. method: 'POST'
  764. },
  765. activeCust: {
  766. url: 'purchase/activeCust/:id',
  767. method: 'POST'
  768. }
  769. });
  770. }]).factory('ShipAddress', ['$resource', function($resource){
  771. return $resource('account/enterprise', {}, {
  772. saveAddress: {
  773. url: 'account/enterprise/saveShipAddress',
  774. method: 'POST'
  775. },
  776. shipAddList: {
  777. url: 'account/enterprise/shipAddList',
  778. method: 'GET',
  779. isArray: true
  780. },
  781. removeShipAddress: {
  782. url: 'account/enterprise/removeShipAddress/:id',
  783. method: 'DELETE'
  784. }
  785. });
  786. }]).factory('KindAPI', ['$resource', '$cacheFactory', function($resource, $cacheFactory) {
  787. var cache = $cacheFactory('KindAPI');
  788. return $resource ('product/kind', {}, {
  789. // 根据父级类目获取其子类目,不包含深层
  790. getChildren: {
  791. url: 'product/kind/:parentId/children',
  792. method: 'GET',
  793. isArray: true
  794. }
  795. })
  796. }]).factory('BrandActiveAPI', ['$resource', function($resource) {
  797. //对单个BrandActive对象操作
  798. return $resource('product/brand/:uuid', {}, {
  799. /*
  800. * get,根据uuid获得BrandActive
  801. */
  802. // 获取所有品牌的简要信息
  803. getSimpleInfo : {
  804. url : 'product/brand/Info',
  805. method : 'GET',
  806. isArray : true
  807. },
  808. // 分页获取简要信息
  809. getSimpleInfoPage: {
  810. url: 'product/brand/Info/ByPage',
  811. method: 'GET'
  812. },
  813. // 通过名称获取品牌
  814. findByName : {
  815. url: 'product/brand/ByName/:name',
  816. method: 'GET'
  817. }
  818. })
  819. }]).factory('ComponentActiveAPI', ['$resource', function($resource){
  820. return $resource('product/component', {},{
  821. //获取ComponentInfo的分页数据
  822. getInfoPage: {
  823. url: 'product/component/list',
  824. method: 'GET'
  825. },
  826. //根据uuid获取器件信息
  827. get: {
  828. url: 'product/component/:uuid',
  829. method: 'GET'
  830. },// 根据UUid获取单个器件的简要信息
  831. // 分页获取简要信息
  832. getInfo: {
  833. url: 'product/component/info',
  834. method: 'GET'
  835. }
  836. });
  837. }]).factory('PurchaseInquiry', ['$resource', function($resource){
  838. return $resource('purc/inquiry', {}, {
  839. getTodo: {
  840. params: {
  841. _state: 'todo'
  842. },
  843. method: 'GET'
  844. },
  845. getDone: {
  846. params: {
  847. _state: 'done'
  848. },
  849. method: 'GET'
  850. },
  851. getEnd: {
  852. params: {
  853. _state: 'end'
  854. },
  855. method: 'GET'
  856. },
  857. getAll: {
  858. method: 'GET'
  859. },
  860. getUnapply: {
  861. url: 'purc/inquiry/unapply',
  862. method: 'GET'
  863. },
  864. getSubmit: {
  865. url: 'purc/inquiry/submit',
  866. method: 'GET'
  867. },
  868. deleteById: {
  869. url: 'purc/inquiry/deleteById/:id',
  870. method: 'DELETE'
  871. },
  872. clearOrder: {
  873. url: 'purc/inquiry/clearOrder/:id',
  874. method: 'DELETE'
  875. },
  876. save: {
  877. url: 'purc/inquiry/save',
  878. method: 'POST'
  879. },
  880. detail: {
  881. url: 'purc/inquiry/detail/:id',
  882. method: 'GET'
  883. },
  884. submit: {
  885. url: 'purc/inquiry/saveAndSubmit',
  886. method: 'POST'
  887. },
  888. accept: {
  889. url: 'purc/inquiry/accept/:id',
  890. method: 'POST'
  891. },
  892. refuse: {
  893. url: 'purc/inquiry/refuse/:id',
  894. method: 'POST'
  895. },
  896. getAllDetail: {
  897. url: 'purc/inquiry/getAllDetail/:id',
  898. method: 'GET',
  899. isArray: true
  900. },
  901. submitUnapply: {
  902. url: 'purc/inquiry/submit/:id',
  903. method: 'POST'
  904. },
  905. saveAndSubmitWithoutVendor: {
  906. url: 'purc/inquiry/saveAndSubmitWithoutVendor',
  907. method: 'POST'
  908. },
  909. saveWithoutVendor: {
  910. url: 'purc/inquiry/saveWithoutVendor',
  911. method: 'POST'
  912. },
  913. publishInquiry: {
  914. url: 'purc/inquiry/pubishInquiry/:id',
  915. method: 'POST'
  916. },
  917. publicInquiryItem: {
  918. url: 'purc/inquiry/publicInquiryItem',
  919. method: 'GET'
  920. },
  921. inquiryItemDetail: {
  922. url: 'purc/inquiry/inquiryItem/:id',
  923. method: 'GET'
  924. },
  925. transtoInquiry: {
  926. url: 'purc/inquiry/transtoInquiry/:id',
  927. method: 'POST'
  928. }
  929. });
  930. }]);
  931. });