detailDialog.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. <template>
  2. <div>
  3. <headerTitle title="委外入库申请单"></headerTitle>
  4. <!-- 数据表格 -->
  5. <ele-pro-table ref="table" :columns="columns" row-key="id" cache-key="outsourcedWarehousing">
  6. <template v-slot:requireDeliveryTime="{ row }">
  7. <span v-if="row.deliveryMethod == 1">{{ row.requireDeliveryTime }}</span>
  8. <el-link v-if="row.deliveryMethod == 2" type="primary" :underline="false"
  9. @click.native="handleMethod(row)">分批时间</el-link>
  10. </template>
  11. <template v-slot:status="{ row }">
  12. <el-tag>{{ row.status == 1 ? '已发布' : '未发布' }}</el-tag>
  13. </template>
  14. <template v-slot:technicalDrawings="{ row }">
  15. <div v-if="row.technicalDrawings && row.technicalDrawings?.length">
  16. <el-link v-for="link in row.technicalDrawings" :key="link.id" type="primary" :underline="false"
  17. @click="downloadFile(link)">
  18. {{ link.name }}</el-link>
  19. </div>
  20. </template>
  21. <template v-slot:files="{ row }">
  22. <div v-if="row.files && row.files?.length">
  23. <el-link v-for="link in row.files" :key="link.id" type="primary" :underline="false" @click="downloadFile(link)">
  24. {{ link.name }}</el-link>
  25. </div>
  26. </template>
  27. <template v-slot:action="{ row }">
  28. <el-link type="primary" :underline="false" @click="handleDetails(row)">
  29. 详情
  30. </el-link>
  31. </template>
  32. </ele-pro-table>
  33. <detail ref="detailsRef"></detail>
  34. <timeDialog ref="timeDialogRef"></timeDialog>
  35. </div>
  36. </template>
  37. <script>
  38. import { getById } from '@/api/bpm/components/outsourcedWarehousing/index';
  39. import Detail from './components/details.vue';
  40. import timeDialog from './components/timeDialog.vue'
  41. import { getFile } from "@/api/system/file";
  42. export default {
  43. components: {
  44. Detail,
  45. timeDialog
  46. },
  47. props: {
  48. businessId: {
  49. default: ''
  50. }
  51. },
  52. mixins: [],
  53. data() {
  54. return {
  55. visible: false,
  56. // 表格列配置
  57. columns: [
  58. {
  59. columnKey: 'index',
  60. label: '序号',
  61. type: 'index',
  62. width: 55,
  63. align: 'center',
  64. showOverflowTooltip: true,
  65. fixed: 'left'
  66. },
  67. {
  68. prop: 'code',
  69. label: '委外单编码',
  70. align: 'center'
  71. },
  72. {
  73. prop: 'name',
  74. label: '委外单名称',
  75. align: 'center'
  76. },
  77. {
  78. prop: 'workOrderCode',
  79. label: '工单编码',
  80. align: 'center'
  81. },
  82. {
  83. prop: 'taskName',
  84. label: '工序',
  85. align: 'center'
  86. },
  87. {
  88. prop: 'totalCount',
  89. label: '委外数量',
  90. align: 'center'
  91. },
  92. {
  93. prop: 'totalWeight',
  94. label: '委外重量',
  95. align: 'center'
  96. },
  97. {
  98. prop: 'remark',
  99. label: '备注',
  100. align: 'center'
  101. },
  102. {
  103. slot: 'requireDeliveryTime',
  104. label: '预计到货日期',
  105. align: 'center',
  106. minWidth: 70
  107. },
  108. {
  109. prop: 'createTime',
  110. label: '创建时间',
  111. align: 'center',
  112. minWidth: 70
  113. },
  114. {
  115. slot: 'status',
  116. label: '状态',
  117. align: 'center'
  118. },
  119. {
  120. label: '图片附件',
  121. slot: 'technicalDrawings',
  122. action: 'technicalDrawings',
  123. minWidth: 100,
  124. },
  125. {
  126. label: '附件',
  127. slot: 'files',
  128. action: 'files',
  129. minWidth: 100,
  130. },
  131. {
  132. columnKey: 'action',
  133. label: '操作',
  134. width: 140,
  135. align: 'center',
  136. resizable: false,
  137. fixed: 'right',
  138. slot: 'action',
  139. showOverflowTooltip: true
  140. }
  141. ],
  142. rules: {},
  143. };
  144. },
  145. created() {
  146. this.getDetailData(this.businessId);
  147. },
  148. methods: {
  149. downloadFile(file) {
  150. getFile({ objectName: file.storePath }, file.name);
  151. },
  152. async getDetailData(id) {
  153. this.loading = true;
  154. const res = await getById(id);
  155. this.loading = false;
  156. if (res) {
  157. this.$refs.table.setData([res]);
  158. this.$nextTick(() => {
  159. this.$refs.table.toggleRowExpansionAll()
  160. this.$forceUpdate()
  161. })
  162. }
  163. },
  164. handleDetails(row) {
  165. this.$refs.detailsRef.open(row)
  166. },
  167. handleMethod(row) {
  168. this.$refs.timeDialogRef.open(row, 'details')
  169. },
  170. }
  171. };
  172. </script>
  173. <style lang="scss" scoped>
  174. :deep(.el-table__expanded-cell) {
  175. padding-bottom: 30px !important;
  176. border-bottom: 12px solid #CCFFCC !important;
  177. }
  178. </style>