detailDialog.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <ele-modal
  3. custom-class="ele-dialog-form long-dialog-form"
  4. :centered="true"
  5. :visible.sync="visible"
  6. title="详情"
  7. :append-to-body="true"
  8. :close-on-click-modal="false"
  9. :maxable="true"
  10. :resizable="true"
  11. width="70%"
  12. >
  13. <div class="switch">
  14. <div class="switch_left">
  15. <ul>
  16. <li
  17. v-for="item in tabOptions"
  18. :key="item.key"
  19. :class="{ active: activeComp == item.key }"
  20. @click="activeComp = item.key"
  21. >
  22. {{ item.name }}
  23. </li>
  24. </ul>
  25. </div>
  26. </div>
  27. <div v-show="activeComp === 'main'">
  28. <fm-generate-form
  29. v-if="Object.keys(form?.formJson || {}).length !== 0"
  30. :data="jsonData"
  31. :value="form.valueJson"
  32. :edit="false"
  33. ref="generateForm"
  34. >
  35. <template v-slot:blank_adopzrdd="scope">
  36. <div v-for="(item, index) in scope.model.blank_adopzrdd" :key="index">
  37. <div class="blank_adopzrdd">
  38. <span>{{ index + 1 }}报销事项:</span>
  39. <el-input
  40. v-model="scope.model.blank_adopzrdd[index].remark"
  41. type="textarea"
  42. style="width: calc(100% - 80px)"
  43. ></el-input>
  44. </div>
  45. <div class="blank_adopzrdd">
  46. <span>金额:</span>
  47. <el-input
  48. v-model="scope.model.blank_adopzrdd[index].price"
  49. type="number"
  50. style="width: calc(100% - 80px)"
  51. ></el-input>
  52. </div>
  53. </div>
  54. </template>
  55. </fm-generate-form>
  56. <async-biz-form-component
  57. v-else
  58. :businessId="form?.businessId"
  59. ref="bziRef"
  60. :isView="true"
  61. ></async-biz-form-component>
  62. </div>
  63. <bpmDetail
  64. v-if="activeComp === 'bpm' && form.processInstance.id"
  65. :id="form.processInstance.id"
  66. ></bpmDetail>
  67. <div slot="footer" class="footer">
  68. <el-button @click="visible = false">返回</el-button>
  69. </div>
  70. </ele-modal>
  71. </template>
  72. <script>
  73. import bpmDetail from '@/views/bpm/processInstance/detailNew.vue';
  74. import Vue from 'vue';
  75. import { getToken } from '@/utils/token-util';
  76. export default {
  77. components: {
  78. bpmDetail
  79. },
  80. data() {
  81. return {
  82. activeComp: 'main',
  83. form: {
  84. processInstance: {}
  85. },
  86. tabOptions: [
  87. { key: 'main', name: '业务详情' },
  88. { key: 'bpm', name: '流程详情' }
  89. ],
  90. visible: false,
  91. jsonData: {}
  92. };
  93. },
  94. methods: {
  95. async open(row) {
  96. this.form = _.cloneDeep(row);
  97. if (this.form?.formJson?.makingJson) {
  98. this.jsonData = JSON.parse(this.form.formJson.makingJson);
  99. this.jsonData.config.dataSource &&
  100. this.jsonData.config.dataSource.forEach((item) => {
  101. item.headers = {
  102. Authorization: getToken()
  103. };
  104. });
  105. }
  106. this.activeComp = 'main';
  107. this.visible = true;
  108. Vue.component('async-biz-form-component', (resolve) => {
  109. require([`@/views${this.form.pcViewRouter}`], resolve);
  110. });
  111. },
  112. cancel() {
  113. this.$nextTick(() => {
  114. this.form = {};
  115. this.visible = false;
  116. });
  117. }
  118. }
  119. };
  120. </script>
  121. <style scoped lang="scss">
  122. .ele-dialog-form {
  123. .el-form-item {
  124. margin-bottom: 10px;
  125. }
  126. }
  127. .headbox {
  128. display: flex;
  129. justify-content: space-between;
  130. align-items: center;
  131. .amount {
  132. font-size: 14px;
  133. font-weight: bold;
  134. }
  135. }
  136. .blank_adopzrdd {
  137. display: flex;
  138. align-items: center;
  139. > span {
  140. display: inline-block;
  141. width: 80px;
  142. }
  143. margin-bottom: 10px;
  144. }
  145. </style>