details.vue 7.2 KB

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