DetailAudit.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <a-card :bordered="false" v-show="visible" class="card" :title="modalTitle">
  3. <a-row :gutter="48" slot="extra">
  4. <a-col :md="48" :sm="48">
  5. <span class="table-page-search-submitButtons" style="float: right">
  6. <a-button style="margin-left: 8px" type="default" @click="handleCancel()">返回</a-button>
  7. </span>
  8. </a-col>
  9. </a-row>
  10. <detail-list title="" :col="2">
  11. <detail-list-item term="单号">{{ model.no }}</detail-list-item>
  12. <detail-list-item term="设备Id"><a @click="sbIdhandleDetail">{{ model.sbId }}</a></detail-list-item>
  13. <detail-list-item term="设备编号">{{ model.sbNo }}</detail-list-item>
  14. <detail-list-item term="设备名称">{{ model.sbName }}</detail-list-item>
  15. <detail-list-item term="报废原因">{{ model.reason }}</detail-list-item>
  16. <detail-list-item term="备注">{{ model.remark }}</detail-list-item>
  17. <detail-list-item term="状态">{{ BaseTool.Object.getField(this.statusMap,model.status) }}</detail-list-item>
  18. <detail-list-item term="申请人">{{ model.applyUserId }}</detail-list-item>
  19. <detail-list-item term="创建日期">{{ model.createdTime }}</detail-list-item>
  20. <detail-list-item term="更新日期">{{ model.updateTime }}</detail-list-item>
  21. </detail-list>
  22. <history ref="history" :audit="audit" :ok="handleCancel"></history>
  23. <!-- <history
  24. :audit="audit"
  25. :target-id="task.targetId"
  26. :process-instance-id="task.processInstanceId"
  27. :task-id="task.taskId"
  28. :ok="handleCancel"></history>-->
  29. </a-card>
  30. </template>
  31. <script>
  32. import DetailList from '@/components/tools/DetailList'
  33. import History from '@/views/activiti/History'
  34. const DetailListItem = DetailList.Item
  35. export default {
  36. name: 'SbScrapFormDetail',
  37. components: {
  38. DetailList,
  39. DetailListItem,
  40. History
  41. },
  42. props: {
  43. audit: {
  44. type: Boolean,
  45. default: true
  46. }
  47. },
  48. data () {
  49. return {
  50. confirmLoading: false,
  51. mdl: {},
  52. modalTitle: null,
  53. visible: false,
  54. // 下拉框map
  55. statusMap: {},
  56. task: {},
  57. model: {
  58. 'no': null,
  59. 'sbId': null,
  60. 'sbNo': null,
  61. 'sbName': null,
  62. 'reason': null,
  63. 'remark': null,
  64. 'processInstanceId': null,
  65. 'status': null,
  66. 'applyUserId': null,
  67. 'applyUserName': null,
  68. 'createdUserId': null,
  69. 'updateUserId': null,
  70. 'updateUserName': null,
  71. 'updateTime': null
  72. }
  73. }
  74. },
  75. created () {
  76. // 下拉框map
  77. this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.ACTIVITI_FORM_STATUS)
  78. },
  79. methods: {
  80. base (record, model) {
  81. console.log(record)
  82. console.log(model)
  83. this.visible = true
  84. this.modalTitle = '详情'
  85. this.task = record
  86. this.model = model
  87. model.id = record.targetId // 将targetId赋给model,带入history,用作提交
  88. const modal = this.$refs.history
  89. modal.base(model, this.task.taskId)
  90. },
  91. handleCancel () {
  92. this.visible = false
  93. this.confirmLoading = false
  94. this.$emit('ok')
  95. },
  96. sbIdhandleDetail () {
  97. const text = this.$router.resolve({
  98. name: 'SbInfo',
  99. query: { id: this.model.sbId }
  100. })
  101. // 打开一个新的页面
  102. window.open(text.href, '_blank')
  103. }
  104. }
  105. }
  106. </script>