detailDialog.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. <template>
  2. <div>
  3. <headerTitle title="委外单"></headerTitle>
  4. <ele-pro-table ref="table" :needPage="false" :columns="columns" :toolkit="[]" :datasource="list"
  5. row-key="id">
  6. <template v-slot:type="{ row }">
  7. <div v-if="row.type == 1">采购委外</div>
  8. <div v-if="row.type == 2">直接发货委外</div>
  9. <div v-if="row.type == 3">无采购委外</div>
  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. </ele-pro-table>
  28. </div>
  29. </template>
  30. <script>
  31. import { getFile } from '@/api/system/file';
  32. import {
  33. applyOutsource,
  34. } from '@/api/bpm/components/purchasingManage/outSourceSendCk';
  35. export default {
  36. components: {
  37. },
  38. props: {
  39. businessId: {
  40. default: ''
  41. }
  42. },
  43. data() {
  44. return {
  45. detailId: '',
  46. list: [],
  47. };
  48. },
  49. computed: {
  50. // 表格列配置
  51. columns() {
  52. return [
  53. {
  54. columnKey: 'index',
  55. label: '序号',
  56. type: 'index',
  57. width: 55,
  58. align: 'center',
  59. showOverflowTooltip: true,
  60. fixed: 'left'
  61. },
  62. {
  63. prop: 'code',
  64. label: '委外单编码',
  65. align: 'center'
  66. },
  67. {
  68. prop: 'name',
  69. label: '委外单名称',
  70. align: 'center'
  71. },
  72. {
  73. prop: 'workOrderCode',
  74. label: '工单编码',
  75. align: 'center'
  76. },
  77. {
  78. prop: 'taskName',
  79. label: '工序',
  80. align: 'center'
  81. },
  82. {
  83. prop: 'categoryCode',
  84. label: '物品Code',
  85. align: 'center'
  86. },
  87. {
  88. prop: 'categoryName',
  89. label: '名称',
  90. align: 'center'
  91. },
  92. {
  93. prop: 'totalCount',
  94. label: '委外数量',
  95. align: 'center'
  96. },
  97. {
  98. prop: 'totalWeight',
  99. label: '委外重量',
  100. align: 'center'
  101. },
  102. {
  103. slot: 'type',
  104. label: '委外类型',
  105. align: 'center'
  106. },
  107. {
  108. prop: 'remark',
  109. label: '备注',
  110. align: 'center'
  111. },
  112. {
  113. slot: 'requireDeliveryTime',
  114. label: '预计到货日期',
  115. align: 'center',
  116. minWidth: 70
  117. },
  118. {
  119. prop: 'produceRoutingName',
  120. label: '工艺路线',
  121. align: 'center',
  122. },
  123. {
  124. prop: 'warehouseName',
  125. label: '仓库',
  126. align: 'center',
  127. },
  128. {
  129. prop: 'createTime',
  130. label: '创建时间',
  131. align: 'center',
  132. minWidth: 70
  133. },
  134. {
  135. slot: 'status',
  136. label: '状态',
  137. align: 'center'
  138. },
  139. {
  140. label: '图片附件',
  141. slot: 'technicalDrawings',
  142. action: 'technicalDrawings',
  143. minWidth: 100,
  144. },
  145. {
  146. label: '附件',
  147. slot: 'files',
  148. action: 'files',
  149. minWidth: 100,
  150. },
  151. ];
  152. },
  153. clientEnvironmentId() {
  154. return this.$store.state.user.info.clientEnvironmentId;
  155. },
  156. },
  157. created() {
  158. this.getDetailData(this.businessId);
  159. },
  160. methods: {
  161. downloadFile(file) {
  162. getFile({ objectName: file.storePath }, file.name);
  163. },
  164. async getDetailData(id) {
  165. this.loading = true;
  166. const data = await applyOutsource(id);
  167. this.loading = false;
  168. if (data) {
  169. this.list = [ data ];
  170. }
  171. },
  172. handleDetails(row) {
  173. this.$refs.detailsRef.open(row)
  174. },
  175. }
  176. };
  177. </script>
  178. <style scoped lang="scss">
  179. .ele-dialog-form {
  180. .el-form-item {
  181. margin-bottom: 10px;
  182. }
  183. }
  184. .headbox {
  185. display: flex;
  186. justify-content: flex-start;
  187. align-items: center;
  188. .amount {
  189. font-size: 14px;
  190. font-weight: bold;
  191. margin-right: 20px;
  192. }
  193. }
  194. </style>