details.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. <template>
  2. <el-dialog title="详情" :visible.sync="visible" :before-close="handleClose" :close-on-click-modal="false"
  3. :close-on-press-escape="false" append-to-body width="80%">
  4. <el-form ref="form" label-width="100px" class="create-form"
  5. >
  6. <headerTitle title="基本信息" style="margin-top: 15px"></headerTitle>
  7. <el-row :gutter="15">
  8. <el-col :span="8">
  9. <el-form-item label="委外单编码:" prop="code">
  10. <el-input v-model="row.code" disabled />
  11. </el-form-item>
  12. </el-col>
  13. <el-col :span="8">
  14. <el-form-item label="委外单名称:" prop="name">
  15. <el-input v-model="row.name" disabled />
  16. </el-form-item>
  17. </el-col>
  18. <el-col :span="8">
  19. <el-form-item label="工单编码:" prop="factoriesName">
  20. <el-input v-model="row.workOrderCode" style="width: 100%" disabled>
  21. </el-input>
  22. </el-form-item>
  23. </el-col>
  24. <el-col :span="8">
  25. <el-form-item label="预计到货日期:" prop="factoriesName">
  26. <el-input v-model="row.requireDeliveryTime" style="width: 100%" disabled>
  27. </el-input>
  28. </el-form-item>
  29. </el-col>
  30. <el-col :span="8">
  31. <el-form-item label="创建时间:" prop="factoriesName">
  32. <el-input v-model="row.createTime" style="width: 100%" disabled>
  33. </el-input>
  34. </el-form-item>
  35. </el-col>
  36. <el-col :span="8">
  37. <el-form-item label="工序:" prop="status">
  38. <el-tag>{{ row.status == 1 ? '已发布' : '未发布' }}</el-tag>
  39. </el-form-item>
  40. </el-col>
  41. </el-row>
  42. </el-form>
  43. <!-- 数据表格 -->
  44. <ele-pro-table ref="table" v-if="detailType == 1" :columns="columns" cache-key="detailsTable"
  45. height="calc(100vh - 350px)">
  46. <template v-slot:totalCount="{ row }">
  47. {{ row.totalCount }}{{ row.measuringUnit }}
  48. </template>
  49. <template v-slot:sourceType="{ row }">
  50. <el-tag v-if="row.sourceType == 1" size="mini" type="success">物品清单</el-tag>
  51. <el-tag v-if="row.sourceType == 2" size="mini" type="warning">带料清单</el-tag>
  52. <el-tag v-if="row.sourceType == 3" size="mini" type="danger">产出清单</el-tag>
  53. </template>
  54. </ele-pro-table>
  55. <ele-pro-table ref="table2" v-if="detailType == 2" :columns="columns2" cache-key="detailsTable2"
  56. height="calc(100vh - 350px)">
  57. <template v-slot:totalCount="{ row }">
  58. {{ row.totalCount }}{{ row.measuringUnit }}
  59. </template>
  60. <template v-slot:sourceType="{ row }">
  61. <el-tag v-if="row.sourceType == 1" size="mini" type="success">物品清单</el-tag>
  62. <el-tag v-if="row.sourceType == 2" size="mini" type="warning">带料清单</el-tag>
  63. <el-tag v-if="row.sourceType == 3" size="mini" type="danger">产出清单</el-tag>
  64. </template>
  65. </ele-pro-table>
  66. </el-dialog>
  67. </template>
  68. <script>
  69. export default {
  70. components: {
  71. },
  72. data() {
  73. return {
  74. visible: false,
  75. detailType: null,
  76. row:{}
  77. }
  78. },
  79. computed: {
  80. // 表格列配置
  81. columns() {
  82. return [
  83. {
  84. columnKey: 'index',
  85. label: '序号',
  86. type: 'index',
  87. width: 55,
  88. align: 'center',
  89. showOverflowTooltip: true,
  90. fixed: 'left'
  91. },
  92. {
  93. prop: 'categoryCode',
  94. label: '编码',
  95. align: 'center'
  96. },
  97. {
  98. prop: 'categoryName',
  99. label: '名称',
  100. align: 'center'
  101. },
  102. {
  103. prop: 'sourceType',
  104. slot: 'sourceType',
  105. label: '类型',
  106. align: 'center'
  107. },
  108. {
  109. prop: 'brandNum',
  110. label: '牌号',
  111. align: 'center'
  112. },
  113. {
  114. prop: 'specification',
  115. label: '规格',
  116. align: 'center'
  117. },
  118. {
  119. prop: 'modelType',
  120. label: '型号',
  121. align: 'center'
  122. },
  123. {
  124. slot: 'totalCount',
  125. label: '数量',
  126. align: 'center'
  127. },
  128. ];
  129. },
  130. columns2() {
  131. return [
  132. {
  133. columnKey: 'index',
  134. label: '序号',
  135. type: 'index',
  136. width: 55,
  137. align: 'center',
  138. showOverflowTooltip: true,
  139. fixed: 'left'
  140. },
  141. {
  142. prop: 'categoryCode',
  143. label: '编码',
  144. align: 'center'
  145. },
  146. {
  147. prop: 'categoryName',
  148. label: '名称',
  149. align: 'center'
  150. },
  151. {
  152. prop: 'sourceType',
  153. slot: 'sourceType',
  154. label: '类型',
  155. align: 'center'
  156. },
  157. {
  158. prop: 'brandNum',
  159. label: '牌号',
  160. align: 'center'
  161. },
  162. {
  163. prop: 'modelType',
  164. label: '型号',
  165. align: 'center'
  166. },
  167. {
  168. prop: 'specification',
  169. label: '规格',
  170. align: 'center'
  171. },
  172. {
  173. label: '物料代号',
  174. prop: 'extInfo.materielCode',
  175. align: 'center'
  176. },
  177. {
  178. label: '客户代号',
  179. prop: 'extInfo.clientCode',
  180. align: 'center'
  181. },
  182. {
  183. label: '刻码',
  184. prop: 'extInfo.engrave',
  185. align: 'center'
  186. },
  187. {
  188. label: '重量',
  189. prop: 'extInfo.newWeight',
  190. align: 'center'
  191. },
  192. {
  193. slot: 'totalCount',
  194. label: '数量',
  195. align: 'center'
  196. },
  197. ];
  198. },
  199. clientEnvironmentId() {
  200. return this.$store.state.user.info.clientEnvironmentId;
  201. },
  202. },
  203. watch: {
  204. },
  205. methods: {
  206. open(row) {
  207. this.visible = true
  208. if (row.detailType == 1) {
  209. this.detailType = 1
  210. this.$nextTick(() => {
  211. this.$refs.table.setData([...row.detailList]);
  212. })
  213. } else if (row.detailType == 2) {
  214. this.detailType = 2
  215. this.$nextTick(() => {
  216. this.$refs.table2.setData([...row.detailList]);
  217. })
  218. }
  219. this.row = row;
  220. },
  221. handleClose() {
  222. this.visible = false
  223. },
  224. }
  225. }
  226. </script>
  227. <style lang="scss" scoped></style>