operationTemplate.js 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. import * as API from '@/api'
  2. // 引入mockjs
  3. const Mock = require('mockjs')
  4. /**
  5. * 作业流程模板信息
  6. */
  7. // 列表
  8. Mock.mock(API.DMMS_GET_OPERATION_TEMPLATE_LIST + '?pageIndex=1&pageSize=10', () => {
  9. return {
  10. code: 200,
  11. msg: 'Succeed!',
  12. body: {
  13. data: [
  14. {
  15. operatingTemplId: '1',
  16. operationTemplateCode: '1',
  17. operationTemplateName: '测试模板',
  18. status: '1',
  19. statusName: '启用',
  20. createUser: '田军',
  21. createTime: '2018-08-20',
  22. createDept: '研发部门'
  23. },
  24. {
  25. operatingTemplId: '2',
  26. operationTemplateCode: 'xxxx',
  27. operationTemplateName: 'xxxx',
  28. status: '2',
  29. statusName: 'xxxx',
  30. createUser: 'xxxx',
  31. createTime: 'xxxx',
  32. createDept: 'xxxx'
  33. },
  34. {
  35. operatingTemplId: '3',
  36. operationTemplateCode: 'xxxx',
  37. operationTemplateName: 'xxxx',
  38. status: '3',
  39. statusName: 'xxxx',
  40. createUser: 'xxxx',
  41. createTime: 'xxxx',
  42. createDept: 'xxxx'
  43. }
  44. ]
  45. }
  46. }
  47. }
  48. )
  49. // 获取一条数据
  50. Mock.mock(API.DMMS_ALL_OPERATION_TEMPLATE + '?operatingTemplId=1', () => {
  51. return {
  52. code: 200,
  53. msg: 'Succeed!',
  54. body: {
  55. data: {
  56. 'operatingTemplId': '1',
  57. operationTemplateCode: '1',
  58. operationTemplateName: '测试模板',
  59. status: 1,
  60. statusName: '启用',
  61. createUser: '田军',
  62. createTime: '2018-08-20',
  63. createDept: '研发部门',
  64. tickets: [
  65. {
  66. 'content': '作业内容1',
  67. 'order': 1
  68. },
  69. {
  70. 'content': '作业内容2',
  71. 'order': 2
  72. }
  73. ]
  74. }
  75. }
  76. }
  77. }
  78. )
  79. // 编辑
  80. const data = {
  81. operating_id: '1'
  82. }
  83. Mock.mock(API.DMMS_ALL_OPERATION_TEMPLATE, 'put', data, () => {
  84. return {
  85. code: 200,
  86. msg: 'Succeed!',
  87. body: {
  88. data: {
  89. operating_id: '1',
  90. operating_content: 'xxxx',
  91. operating_type_code: '装船',
  92. create_time: '2008',
  93. create_id: 'tj'
  94. }
  95. }
  96. }
  97. }
  98. )
  99. // 删除