DetailAudit.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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.auditName }}</detail-list-item>
  12. <detail-list-item term="状态">{{ BaseTool.Object.getField(this.statusMap,model.status) }}</detail-list-item>
  13. <detail-list-item term="申请人">{{ model.createdUserName }}</detail-list-item>
  14. <detail-list-item term="申请日期">{{ model.createdTime }}</detail-list-item>
  15. </detail-list>
  16. <detail-list v-show="sbInfoAllocate" title="设备调拨" :col="2">
  17. <detail-list-item term="单号">{{ model.no }}</detail-list-item>
  18. <detail-list-item term="标题">{{ model.title }}</detail-list-item>
  19. <detail-list-item term="申请部门">{{ model.currentDeptName }}</detail-list-item>
  20. <detail-list-item term="目标部门">{{ model.targetDeptName }}</detail-list-item>
  21. <detail-list-item term="开始时间">{{ model.startTime }}</detail-list-item>
  22. <detail-list-item term="结束时间">{{ model.endTime }}</detail-list-item>
  23. <detail-list-item term="备注">{{ model.dataRemark }}</detail-list-item>
  24. </detail-list>
  25. <detail-list v-show="sbInfoAllocate" title="设备调拨详情" :col="2" v-for="(item, index) in sbInfos" :key="index">
  26. <detail-list-item term="设备名称">{{ item.name }}</detail-list-item>
  27. <detail-list-item term="设备编号">{{ item.no }}</detail-list-item>
  28. <detail-list-item term="设备类型">{{ item.typeName }}</detail-list-item>
  29. <detail-list-item term="生成厂商">{{ item.producerName }}</detail-list-item>
  30. </detail-list>
  31. <detail-list v-show="sbInfoStop" title="设备停用" :col="2">
  32. <detail-list-item term="单号">{{ model.no }}</detail-list-item>
  33. <detail-list-item term="设备名称">{{ model.sbName }}</detail-list-item>
  34. <detail-list-item term="维修单">{{ model.repairId }}</detail-list-item>
  35. <detail-list-item term="停用日期">{{ model.stopDate }}</detail-list-item>
  36. <detail-list-item term="停用原因">{{ model.reason }}</detail-list-item>
  37. <detail-list-item term="备注">{{ model.dataRemark }}</detail-list-item>
  38. </detail-list>
  39. <detail-list v-show="sbInfoScrap" title="设备报废" :col="2">
  40. <detail-list-item term="单号">{{ model.no }}</detail-list-item>
  41. <detail-list-item term="设备名称">{{ model.sbName }}</detail-list-item>
  42. <detail-list-item term="设备编号">{{ model.sbNo }}</detail-list-item>
  43. <detail-list-item term="报废原因">{{ model.reason }}</detail-list-item>
  44. <detail-list-item term="备注">{{ model.dataRemark }}</detail-list-item>
  45. </detail-list>
  46. <detail-list v-show="storeInfo" title="" :col="2">
  47. <detail-list-item term="单号">{{ model.outNo }}</detail-list-item>
  48. <detail-list-item term="成本归属">{{ model.feeFrom }}</detail-list-item>
  49. <detail-list-item term="项目名称">{{ model.projectName }}</detail-list-item>
  50. <detail-list-item term="仓库名称">{{ model.storeName }}</detail-list-item>
  51. </detail-list>
  52. <title-divider v-show="storeInfo" title="备件明细" width="90px"></title-divider>
  53. <a-table
  54. v-if="storeInfo"
  55. bordered
  56. :data-source="model.detailList"
  57. :columns="columns"
  58. tableLayout="auto"
  59. rowKey="cbatch">
  60. </a-table>
  61. <history ref="history" :audit="audit" @ok="handleCancel"></history>
  62. </a-card>
  63. </template>
  64. <script>
  65. import DetailList from '@/components/tools/DetailList'
  66. import History from '@/views/activiti/History'
  67. const DetailListItem = DetailList.Item
  68. export default {
  69. name: 'SbScrapFormDetail',
  70. components: {
  71. DetailList,
  72. DetailListItem,
  73. History
  74. },
  75. props: {
  76. audit: {
  77. type: Boolean,
  78. default: true
  79. }
  80. },
  81. data () {
  82. return {
  83. confirmLoading: false,
  84. mdl: {},
  85. modalTitle: null,
  86. sbInfoAllocate: false,
  87. sbInfoStop: false,
  88. sbInfoScrap: false,
  89. visible: false,
  90. storeInfo: false,
  91. // 下拉框map
  92. statusMap: {},
  93. task: {},
  94. model: {
  95. 'auditName': null,
  96. 'remark': null,
  97. 'status': null,
  98. 'createdUserName': null,
  99. 'createdTime': null,
  100. 'dataRemark': null,
  101. 'startTime': null,
  102. 'endTime': null,
  103. 'currentDeptName': null,
  104. 'targetDeptName': null,
  105. 'title': null,
  106. 'reason': null,
  107. 'stopDate': null,
  108. 'sbName': null,
  109. 'repairId': null,
  110. 'no': null,
  111. 'sbNo': null
  112. },
  113. sbInfos: [],
  114. columns: [
  115. {
  116. title: '序号',
  117. dataIndex: 'index',
  118. customRender: (text, record, index) => {
  119. return index + 1
  120. }
  121. },
  122. {
  123. title: '备件名称',
  124. dataIndex: 'spareName'
  125. },
  126. {
  127. title: '编号',
  128. dataIndex: 'no'
  129. },
  130. {
  131. title: '规格',
  132. dataIndex: 'ggxh'
  133. },
  134. {
  135. title: '仓库',
  136. dataIndex: 'storeName'
  137. },
  138. {
  139. title: '批次',
  140. dataIndex: 'cbatch'
  141. },
  142. {
  143. title: '申请数量',
  144. dataIndex: 'num',
  145. width: 150
  146. },
  147. {
  148. title: '实际数量',
  149. dataIndex: 'realNum',
  150. width: 150
  151. }
  152. ]
  153. }
  154. },
  155. created () {
  156. // 下拉框map
  157. this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.ACTIVITI_FORM_STATUS)
  158. },
  159. methods: {
  160. base (record, model) {
  161. this.visible = true
  162. this.modalTitle = '详情'
  163. this.task = record
  164. this.model = record
  165. this.model.no = model.no
  166. this.model.auditName = this.DictCache.VALUE.SB_INFO_AUDIT_MODEL_NAME[record.remark]
  167. if (record.remark === this.DictCache.VALUE.CUSTOM_TEMPLATE_SB_REMARK.SB_ALLOCATE_FORM) {
  168. this.sbInfoAllocate = true
  169. this.sbInfos = JSON.parse(model.sbInfos)
  170. } else if (record.remark === this.DictCache.VALUE.CUSTOM_TEMPLATE_SB_REMARK.SB_SCRAP_FORM) {
  171. this.sbInfoScrap = true
  172. } else if (record.remark === this.DictCache.VALUE.CUSTOM_TEMPLATE_SB_REMARK.SB_STOP_FORM) {
  173. this.sbInfoStop = true
  174. } else if (record.remark === this.DictCache.VALUE.CUSTOM_TEMPLATE_SB_REMARK.OUT_STORE_BACK) {
  175. this.storeInfo = true
  176. }
  177. if (record.targetId === undefined) {
  178. model.id = record.id // 将targetId赋给model,带入history,用作提交
  179. } else {
  180. model.id = record.targetId // 将targetId赋给model,带入history,用作提交
  181. }
  182. const modal = this.$refs.history
  183. model.auditModelKey = record.remark
  184. modal.base(model, this.task.taskId)
  185. },
  186. handleCancel () {
  187. this.visible = false
  188. this.confirmLoading = false
  189. this.$emit('ok')
  190. },
  191. sbIdhandleDetail () {
  192. const text = this.$router.resolve({
  193. name: 'SbInfo',
  194. query: { id: this.model.sbId }
  195. })
  196. // 打开一个新的页面
  197. window.open(text.href, '_blank')
  198. }
  199. }
  200. }
  201. </script>