details.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  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="6">
  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="6">
  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="6">
  25. <el-form-item label="委外发起工序:" prop="taskName">
  26. <el-input v-model="row.taskName" disabled />
  27. </el-form-item>
  28. </el-col>
  29. <el-col :span="6">
  30. <el-form-item label="委外工序:" prop="taskNames">
  31. <el-input v-model="row.taskNames" disabled />
  32. </el-form-item>
  33. </el-col>
  34. <el-col :span="6">
  35. <el-form-item label="工单编码:" prop="factoriesName">
  36. <el-input v-model="row.workOrderCode" style="width: 100%" disabled>
  37. </el-input>
  38. </el-form-item>
  39. </el-col>
  40. <el-col :span="6">
  41. <el-form-item label="预计到货日期:" prop="factoriesName">
  42. <el-input
  43. v-model="row.requireDeliveryTime"
  44. style="width: 100%"
  45. disabled
  46. >
  47. </el-input>
  48. </el-form-item>
  49. </el-col>
  50. <el-col :span="6">
  51. <el-form-item label="创建时间:" prop="factoriesName">
  52. <el-input v-model="row.createTime" style="width: 100%" disabled>
  53. </el-input>
  54. </el-form-item>
  55. </el-col>
  56. <el-col :span="6">
  57. <el-form-item label="状态:" prop="status">
  58. <el-tag>{{
  59. row.status == 0 ? '未提交' : row.status == 1 ? '已提交' : '已发布'
  60. }}</el-tag>
  61. </el-form-item>
  62. </el-col>
  63. </el-row>
  64. </el-form>
  65. <!-- 数据表格 -->
  66. <ele-pro-table
  67. ref="table"
  68. v-if="detailType == 1"
  69. :columns="columns"
  70. :datasource="row.detailList"
  71. cache-key="detailsTable"
  72. height="calc(100vh - 350px)"
  73. >
  74. <template v-slot:totalCount="{ row }">
  75. {{ row.totalCount }}{{ row.measuringUnit }}
  76. </template>
  77. <template v-slot:sourceType="{ row }">
  78. <el-tag v-if="row.sourceType == 1" size="mini" type="success"
  79. >物品清单</el-tag
  80. >
  81. <el-tag v-if="row.sourceType == 2" size="mini" type="warning"
  82. >带料清单</el-tag
  83. >
  84. <el-tag v-if="row.sourceType == 3" size="mini" type="danger"
  85. >产出清单</el-tag
  86. >
  87. </template>
  88. </ele-pro-table>
  89. <ele-pro-table
  90. ref="table2"
  91. v-if="detailType == 2"
  92. :datasource="row.detailList"
  93. :columns="columns2"
  94. cache-key="detailsTable2"
  95. height="calc(100vh - 350px)"
  96. >
  97. <template v-slot:totalCount="{ row }">
  98. {{ row.totalCount }}{{ row.measuringUnit }}
  99. </template>
  100. <template v-slot:totalWeight="{ row }">
  101. {{ row.totalWeight }}{{ row.weightUnit }}
  102. </template>
  103. <template v-slot:sourceType="{ row }">
  104. <el-tag v-if="row.sourceType == 1" size="mini" type="success"
  105. >物品清单</el-tag
  106. >
  107. <el-tag v-if="row.sourceType == 2" size="mini" type="warning"
  108. >带料清单</el-tag
  109. >
  110. <el-tag v-if="row.sourceType == 3" size="mini" type="danger"
  111. >产出清单</el-tag
  112. >
  113. </template>
  114. </ele-pro-table>
  115. </el-dialog>
  116. </template>
  117. <script>
  118. export default {
  119. components: {},
  120. data() {
  121. return {
  122. visible: false,
  123. detailTitle: null,
  124. row: {},
  125. detailType: ''
  126. };
  127. },
  128. computed: {
  129. // 表格列配置
  130. columns() {
  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. showOverflowTooltip: true
  146. },
  147. {
  148. prop: 'categoryName',
  149. label: '名称',
  150. align: 'center',
  151. showOverflowTooltip: true
  152. },
  153. {
  154. prop: 'sourceType',
  155. slot: 'sourceType',
  156. label: '类型',
  157. align: 'center',
  158. showOverflowTooltip: true
  159. },
  160. {
  161. prop: 'brandNum',
  162. label: '牌号',
  163. align: 'center',
  164. showOverflowTooltip: true
  165. },
  166. {
  167. prop: 'specification',
  168. label: '规格',
  169. align: 'center',
  170. showOverflowTooltip: true
  171. },
  172. {
  173. prop: 'modelType',
  174. label: '型号',
  175. align: 'center',
  176. showOverflowTooltip: true
  177. },
  178. {
  179. slot: 'totalCount',
  180. label: '数量',
  181. align: 'center',
  182. showOverflowTooltip: true
  183. }
  184. ];
  185. },
  186. columns2() {
  187. return [
  188. {
  189. columnKey: 'index',
  190. label: '序号',
  191. type: 'index',
  192. width: 55,
  193. align: 'center',
  194. showOverflowTooltip: true,
  195. fixed: 'left'
  196. },
  197. {
  198. prop: 'categoryCode',
  199. label: '编码',
  200. align: 'center',
  201. showOverflowTooltip: true
  202. },
  203. {
  204. prop: 'categoryName',
  205. label: '名称',
  206. align: 'center',
  207. showOverflowTooltip: true
  208. },
  209. {
  210. prop: 'sourceType',
  211. slot: 'sourceType',
  212. label: '类型',
  213. align: 'center',
  214. showOverflowTooltip: true
  215. },
  216. {
  217. prop: 'brandNum',
  218. label: '牌号',
  219. align: 'center',
  220. showOverflowTooltip: true
  221. },
  222. {
  223. prop: 'modelType',
  224. label: '型号',
  225. align: 'center',
  226. showOverflowTooltip: true
  227. },
  228. {
  229. prop: 'specification',
  230. label: '规格',
  231. align: 'center',
  232. showOverflowTooltip: true
  233. },
  234. {
  235. label: '物料代号',
  236. prop: 'extInfo.materielCode',
  237. align: 'center',
  238. showOverflowTooltip: true
  239. },
  240. {
  241. label: '客户代号',
  242. prop: 'extInfo.clientCode',
  243. align: 'center',
  244. showOverflowTooltip: true
  245. },
  246. {
  247. label: '刻码',
  248. prop: 'extInfo.engrave',
  249. align: 'center',
  250. showOverflowTooltip: true
  251. },
  252. {
  253. label: '重量',
  254. prop: 'totalWeight',
  255. slot: 'totalWeight',
  256. align: 'center',
  257. showOverflowTooltip: true
  258. },
  259. {
  260. slot: 'totalCount',
  261. label: '数量',
  262. align: 'center',
  263. showOverflowTooltip: true
  264. }
  265. ];
  266. },
  267. clientEnvironmentId() {
  268. return this.$store.state.user.info.clientEnvironmentId;
  269. }
  270. },
  271. watch: {},
  272. methods: {
  273. open(row) {
  274. this.visible = true;
  275. // if (row.detailTitle == 1) {
  276. // this.detailType = 1;
  277. // this.$nextTick(() => {
  278. // this.$refs.table.setData([...row.detailList]);
  279. // });
  280. // } else if (row.detailTitle == 2) {
  281. // this.detailType = 2;
  282. // this.$nextTick(() => {
  283. // this.$refs.table2.setData([...row.detailList]);
  284. // });
  285. // }
  286. if (row.detailType == 1) {
  287. this.detailType = 1;
  288. // this.$nextTick(() => {
  289. // this.$refs.table.setData([...row.detailList]);
  290. // });
  291. } else if (row.detailType == 2) {
  292. this.detailType = 2;
  293. // this.$nextTick(() => {
  294. // this.$refs.table2.setData([...row.detailList]);
  295. // });
  296. }
  297. console.log(row, 'row 123');
  298. this.row = row;
  299. },
  300. handleClose() {
  301. this.visible = false;
  302. }
  303. }
  304. };
  305. </script>
  306. <style lang="scss" scoped></style>