companyInfo.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. import request from '@/utils/request'
  2. import constant from '@/constant'
  3. function list(obj) {
  4. var formData = new FormData();
  5. for(var key in obj){
  6. formData.append(key,obj[key]);
  7. }
  8. return request.post(constant.serverUrl + "/base/companyInfo/list",formData);
  9. }
  10. function pageList(formData) {
  11. return request.post(constant.serverUrl + "/base/companyInfo/pageList", formData);
  12. }
  13. function loadChildren(formData) {
  14. return request.post(constant.serverUrl + "/base/companyInfo/children",formData);
  15. }
  16. function create() {
  17. return request.get(constant.serverUrl + "/base/companyInfo/create");
  18. }
  19. function edit(id) {
  20. return request.get(constant.serverUrl + "/base/companyInfo/edit/" + id);
  21. }
  22. function add(formModel) {
  23. return request.post(constant.serverUrl + "/base/companyInfo/add", formModel, {
  24. headers: {
  25. "Content-Type": "application/json"
  26. }
  27. });
  28. }
  29. function update(formModel) {
  30. return request.post(constant.serverUrl + "/base/companyInfo/update", formModel, {
  31. headers: {
  32. "Content-Type": "application/json"
  33. }
  34. });
  35. }
  36. function remove(id) {
  37. return request.post(constant.serverUrl + "/base/companyInfo/delete/" + id);
  38. }
  39. function batchRemove(idList) {
  40. return request.post(constant.serverUrl + "/base/companyInfo/batchDelete", idList, {
  41. headers: {
  42. "Content-Type": "application/json"
  43. }
  44. });
  45. }
  46. function queryBindDeviceList(formData) {
  47. var objData = {};
  48. formData.forEach((value, key) => objData[key] = value);
  49. return request.get(constant.serverUrl + "/base/companyInfo/queryBindDeviceList", {
  50. params: objData,
  51. headers: {
  52. "Content-Type": "application/json"
  53. }
  54. });
  55. }
  56. function bindDevice(formData) {
  57. return request.post(constant.serverUrl + "/base/companyInfo/bindDevice", formData);
  58. }
  59. function unbindDevice(formData) {
  60. return request.post(constant.serverUrl + "/base/companyInfo/unbindDevice", formData);
  61. }
  62. function treeList() {
  63. return request.post(constant.serverUrl + "/base/companyInfo/treeList");
  64. }
  65. function isOpenMobilePayment(formData) {
  66. return request.post(constant.serverUrl + "/base/companyInfo/isOpenMobilePayment",formData);
  67. }
  68. export default {
  69. list, create, edit, add, update, remove, batchRemove, pageList, queryBindDeviceList,
  70. bindDevice, unbindDevice,loadChildren,treeList,isOpenMobilePayment
  71. }