SynchronousMaintenanceForm.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <template>
  2. <div>
  3. <Navbar title="同步界面" :is-go-back="true" />
  4. <div class="flex-header">
  5. <div class="form-inline">
  6. <div class="form-group">
  7. <a-button type="primary" @click="startSync">同步保养表单信息</a-button>
  8. </div>
  9. <div class="form-group">
  10. <a-button type="primary" @click="start">同步机台</a-button>
  11. </div>
  12. <div class="form-group">
  13. <a-button type="primary" @click="start1">同步行事历</a-button>
  14. </div>
  15. </div>
  16. </div>
  17. <Loading v-if="loading" />
  18. </div>
  19. </template>
  20. <script>
  21. import Common from '../common/Common.js';
  22. import {
  23. SqlApi,
  24. } from 'pc-component-v3';
  25. import {
  26. Notify,
  27. } from 'pc-component-v3';
  28. import MaintenanceSheetResource from '../api/pad/MaintenanceSheetResource.js';
  29. import MachineMaintenanceSheetResource from '../api/pad/MachineMaintenanceSheetResource.js';
  30. import MaintenancePlanResource from '../api/pad/MaintenancePlanResource.js';
  31. import CalendarResource from '../api/pad/CalendarResource.js';
  32. export default {
  33. components: {
  34. MaintenanceSheetResource,
  35. MachineMaintenanceSheetResource,
  36. CalendarResource,
  37. MaintenancePlanResource,
  38. },
  39. data: function() {
  40. return {
  41. loading: false,
  42. };
  43. },
  44. mounted: function() {
  45. },
  46. methods: {
  47. /**
  48. * 开始同步
  49. */
  50. startSync: function() {
  51. var _self = this;
  52. _self.loading = true;
  53. MaintenanceSheetResource.synchronousMaintenanceForm().then(successData => {
  54. console.log(successData);
  55. _self.loading = false;
  56. }, errorData => {
  57. _self.loading = false;
  58. Common.processException(errorData);
  59. });
  60. },
  61. /**
  62. * 开始同步机台与表单关系
  63. */
  64. start: function() {
  65. var _self = this;
  66. _self.loading = true;
  67. MachineMaintenanceSheetResource.synchronousMachineMaintenanceForm().then(successData => {
  68. console.log(successData);
  69. _self.loading = false;
  70. }, errorData => {
  71. _self.loading = false;
  72. Common.processException(errorData);
  73. });
  74. },
  75. /**
  76. * 开始同步行事历
  77. */
  78. start1: function() {
  79. var _self = this;
  80. _self.loading = true;
  81. CalendarResource.syncCalendar().then(successData => {
  82. console.log(successData);
  83. _self.loading = false;
  84. }, errorData => {
  85. _self.loading = false;
  86. Common.processException(errorData);
  87. });
  88. },
  89. },
  90. };
  91. </script>
  92. <style scoped>
  93. .flex-container {
  94. display: flex;
  95. /* 垂直*/
  96. flex-direction: column;
  97. width: 100%;
  98. /*视口被均分为100单位的vh 占据整个窗口,扣掉顶部topNav的距离后,计算得到container的高度*/
  99. height: calc(100vh - 150px);
  100. }
  101. .flex-content {
  102. flex: 1;
  103. overflow: scroll;
  104. width: 100%;
  105. height: 0;
  106. }
  107. .fixed-table {
  108. table-layout: fixed;
  109. width: 800px !important;
  110. min-width: 800px !important;
  111. }
  112. table.fixed-table tr {
  113. height: 40px;
  114. }
  115. table.fixed-table th,
  116. table.fixed-table td {
  117. overflow: hidden;
  118. white-space: nowrap;
  119. text-overflow: ellipsis;
  120. }
  121. .flex-header {
  122. height: 80px;
  123. /*放大缩小比例为0 */
  124. flex: 0 0 100px;
  125. }
  126. .flex-footer {
  127. margin-top: 0.8em;
  128. height: 35px;
  129. /*放大缩小比例为0 */
  130. flex: 0 0 35px;
  131. }
  132. .form-inline .form-group button {
  133. width: 250px;
  134. text-align: center;
  135. margin: 30px;
  136. }
  137. .form-inline .form-group label {
  138. width: 100px;
  139. text-align: right;
  140. padding-right: 5px;
  141. }
  142. .form-inline .form-group input,
  143. .form-inline .form-group select {
  144. width: 200px;
  145. }
  146. .file-image-div {
  147. width: 150px;
  148. height: 120px;
  149. text-align: center;
  150. }
  151. .my-icon {
  152. font-size: 100px !important;
  153. padding: 10px;
  154. }
  155. .attachment-label {
  156. overflow: hidden;
  157. white-space: nowrap;
  158. text-overflow: ellipsis;
  159. font-size: small;
  160. max-width: 150px;
  161. }
  162. .attachment-label:hover {
  163. text-overflow: inherit;
  164. overflow: visible;
  165. }
  166. </style>