detailDialog.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. <template>
  2. <ele-modal
  3. custom-class="ele-dialog-form long-dialog-form"
  4. :centered="true"
  5. :visible.sync="visible"
  6. v-if="visible"
  7. title="详情"
  8. :append-to-body="true"
  9. :close-on-click-modal="false"
  10. :maxable="true"
  11. :resizable="true"
  12. width="70%"
  13. >
  14. <div class="switch">
  15. <div class="switch_left">
  16. <ul>
  17. <li
  18. v-for="item in tabOptions"
  19. :key="item.key"
  20. :class="{ active: activeComp == item.key }"
  21. @click="activeComp = item.key"
  22. >
  23. {{ item.name }}
  24. </li>
  25. </ul>
  26. </div>
  27. </div>
  28. <div v-show="activeComp === 'main'">
  29. <!-- <div class="row">主题: {{ form.businessName }}</div>
  30. <div class="row">提交人: {{ form.processInstance?.startUserNickname }}</div>
  31. <div class="row">提交时间: {{ form.createTime }}</div> -->
  32. <fm-generate-form
  33. v-if="Object.keys(form?.formJson || {}).length !== 0"
  34. :data="jsonData"
  35. :value="form.valueJson"
  36. :edit="false"
  37. ref="generateForm"
  38. >
  39. <template v-slot:blank_adopzrdd="scope">
  40. <div v-for="(item, index) in scope.model.blank_adopzrdd" :key="index">
  41. <div class="blank_adopzrdd">
  42. <span>{{ index + 1 }}报销事项:</span>
  43. <el-input
  44. v-model="scope.model.blank_adopzrdd[index].remark"
  45. type="textarea"
  46. style="width: calc(100% - 80px)"
  47. ></el-input>
  48. </div>
  49. <div class="blank_adopzrdd">
  50. <span>金额:</span>
  51. <el-input
  52. v-model="scope.model.blank_adopzrdd[index].price"
  53. type="number"
  54. style="width: calc(100% - 80px)"
  55. ></el-input>
  56. </div>
  57. </div>
  58. </template>
  59. <template v-slot:eom_contact="scope">
  60. <div class="eom_contact">
  61. <el-input
  62. v-model="scope.model.eom_contact.name"
  63. style="width: 100%"
  64. :disabled="view"
  65. ></el-input>
  66. </div>
  67. </template>
  68. <!-- 关联工单 -->
  69. <template v-slot:manage_workorder="scope">
  70. <div class="manage_workorder">
  71. <el-input
  72. v-model="scope.model.manage_workorder.code"
  73. style="width: 100%"
  74. :disabled="view"
  75. ></el-input>
  76. </div>
  77. </template>
  78. <!-- 差旅 -->
  79. <template v-slot:blank_business_component="scope">
  80. <businessComponent
  81. ref="blank_business_component"
  82. id="blank_business_component"
  83. :generateForm="$refs.generateForm"
  84. :info="scope.model"
  85. :view="view"
  86. ></businessComponent>
  87. </template>
  88. <!-- 印章使用 -->
  89. <template v-slot:blank_use_seal="scope">
  90. <useSealComponent
  91. ref="blank_use_seal"
  92. id="blank_use_seal"
  93. :generateForm="$refs.generateForm"
  94. :info="scope.model"
  95. :view="view"
  96. ></useSealComponent>
  97. </template>
  98. <!-- 资质使用 -->
  99. <template v-slot:blank_use_qualification="scope">
  100. <useQualificationComponent
  101. ref="blank_use_qualification"
  102. id="blank_use_qualification"
  103. :generateForm="$refs.generateForm"
  104. :info="scope.model"
  105. :view="view"
  106. ></useQualificationComponent>
  107. </template>
  108. <!-- 产品规格 -->
  109. <template v-slot:blank_product_specification="scope">
  110. <productSpecificationComponent
  111. ref="blank_product_specification"
  112. id="blank_product_specification"
  113. :generateForm="$refs.generateForm"
  114. :info="scope.model"
  115. :view="view"
  116. ></productSpecificationComponent>
  117. </template>
  118. <!-- 事件 -->
  119. <template v-slot:blank_event_component="scope">
  120. <eventComponent
  121. ref="blank_event_component"
  122. id="blank_event_component"
  123. :generateForm="$refs.generateForm"
  124. :info="scope.model"
  125. :view="view"
  126. ></eventComponent>
  127. </template>
  128. <!-- 补发 -->
  129. <template v-slot:blank_reissue_component="scope">
  130. <reissueComponent
  131. ref="blank_reissue_component"
  132. id="blank_reissue_component"
  133. :generateForm="$refs.generateForm"
  134. :info="scope.model"
  135. :view="view"
  136. ></reissueComponent>
  137. </template>
  138. </fm-generate-form>
  139. <async-biz-form-component
  140. v-else
  141. :businessId="form?.businessId"
  142. ref="bziRef"
  143. :isView="true"
  144. ></async-biz-form-component>
  145. </div>
  146. <bpmDetail
  147. v-if="activeComp === 'bpm' && form.processInstance.id"
  148. :id="form.processInstance.id"
  149. ></bpmDetail>
  150. <div slot="footer" class="footer">
  151. <el-button @click="visible = false">返回</el-button>
  152. </div>
  153. </ele-modal>
  154. </template>
  155. <script>
  156. import bpmDetail from '@/views/bpm/processInstance/detailNew.vue';
  157. import Vue from 'vue';
  158. import { getToken } from '@/utils/token-util';
  159. import businessComponent from '@/BIZComponents/processSubmitDialog/components/businessComponent.vue';
  160. import useSealComponent from '@/BIZComponents/processSubmitDialog/components/useSealComponent.vue';
  161. import useQualificationComponent from '@/BIZComponents/processSubmitDialog/components/useQualificationComponent.vue';
  162. import productSpecificationComponent from '@/BIZComponents/processSubmitDialog/components/productSpecificationComponent.vue';
  163. import eventComponent from '@/BIZComponents/processSubmitDialog/components/eventComponent.vue';
  164. import reissueComponent from '@/BIZComponents/processSubmitDialog/components/reissueComponent.vue';
  165. export default {
  166. components: {
  167. bpmDetail,
  168. businessComponent,
  169. useSealComponent,
  170. useQualificationComponent,
  171. productSpecificationComponent,
  172. eventComponent,
  173. reissueComponent
  174. },
  175. data() {
  176. return {
  177. activeComp: 'main',
  178. form: {
  179. processInstance: {}
  180. },
  181. tabOptions: [
  182. { key: 'main', name: '业务详情' },
  183. { key: 'bpm', name: '流程详情' }
  184. ],
  185. visible: false,
  186. jsonData: {}
  187. };
  188. },
  189. methods: {
  190. async open(row) {
  191. this.form = _.cloneDeep(row);
  192. if (this.form?.formJson?.makingJson) {
  193. this.jsonData = JSON.parse(this.form.formJson.makingJson);
  194. this.jsonData.config.dataSource &&
  195. this.jsonData.config.dataSource.forEach((item) => {
  196. item.headers = {
  197. Authorization: getToken()
  198. };
  199. });
  200. }
  201. this.activeComp = 'main';
  202. this.visible = true;
  203. console.log('this.form.pcViewRouter', this.form.pcViewRouter);
  204. Vue.component('async-biz-form-component', (resolve) => {
  205. require([`@/views${this.form.pcViewRouter}`], resolve);
  206. });
  207. },
  208. cancel() {
  209. this.$nextTick(() => {
  210. this.form = {};
  211. this.visible = false;
  212. });
  213. }
  214. }
  215. };
  216. </script>
  217. <style scoped lang="scss">
  218. .ele-dialog-form {
  219. .el-form-item {
  220. margin-bottom: 10px;
  221. }
  222. }
  223. .headbox {
  224. display: flex;
  225. justify-content: space-between;
  226. align-items: center;
  227. .amount {
  228. font-size: 14px;
  229. font-weight: bold;
  230. }
  231. }
  232. .blank_adopzrdd {
  233. display: flex;
  234. align-items: center;
  235. > span {
  236. display: inline-block;
  237. width: 80px;
  238. }
  239. margin-bottom: 10px;
  240. }
  241. .row {
  242. margin-bottom: 10px;
  243. margin-top: 10px;
  244. margin-left: 10px;
  245. }
  246. </style>