detailed.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504
  1. <template>
  2. <div>
  3. <!-- <el-dialog
  4. title="领料列表"
  5. :visible.sync="visible"
  6. :before-close="handleClose"
  7. :close-on-click-modal="false"
  8. :close-on-press-escape="false"
  9. append-to-body
  10. width="80%"
  11. > -->
  12. <ele-modal
  13. title="领料列表"
  14. :visible.sync="visible"
  15. v-if="visible"
  16. :before-close="handleClose"
  17. :close-on-click-modal="false"
  18. :maxable="true"
  19. :close-on-press-escape="false"
  20. id="formId"
  21. append-to-body
  22. width="80%"
  23. @update:fullscreen="fullscreen"
  24. :fullscreen="isFullscreen"
  25. :height="dialogDynamicHeight"
  26. >
  27. <div class="tableZ_box">
  28. <div class="row">
  29. <div class="col">
  30. <div class="name">领料时间</div>
  31. <div class="content">{{ dataObj.createTime }}</div>
  32. </div>
  33. <div class="col">
  34. <div class="name">领料单号</div>
  35. <div class="content">{{ dataObj.code }}</div>
  36. </div>
  37. <div class="col">
  38. <div class="name">领料人</div>
  39. <div class="content">{{ dataObj.executorName }}</div>
  40. </div>
  41. </div>
  42. </div>
  43. <div v-for="(item, index) in dataObj.orderInfoList" :key="index">
  44. <ele-pro-table
  45. ref="table"
  46. :columns="columns"
  47. max-height="320px"
  48. :datasource="item.arr"
  49. cache-key="detailed"
  50. highlight-current-row
  51. :need-page="false"
  52. v-if="item.bomDetailDTOS.length > 0 || item.instanceList.length > 0"
  53. >
  54. <template v-slot:toolbar>
  55. <div class="c_title"> 工单编号: {{ item.code }} </div>
  56. </template>
  57. <template v-slot:empty>
  58. <div class="empty">暂无领料数据</div>
  59. </template>
  60. <template v-slot:index="{ row, $index }">
  61. {{ $index + 1 }}
  62. </template>
  63. <template v-slot:rootCategoryLevelName="{ row, $index }">
  64. <el-tag>{{ row.rootCategoryLevelName }}</el-tag>
  65. </template>
  66. <template v-slot:warehouseLeaderName="{ row }">
  67. <span style="color: #faad14"> {{ row.warehouseLeaderName }} </span>
  68. </template>
  69. <template v-slot:demandQuantity="{ row }">
  70. {{ row.demandQuantity }} {{ row.unit }}
  71. </template>
  72. <!-- 操作列 -->
  73. <template v-slot:action="{ row, $index }">
  74. <el-link
  75. type="text"
  76. @click="outboundDetails(row, $index)"
  77. v-if="dataObj.status == 2"
  78. >出库详情</el-link
  79. >
  80. </template>
  81. </ele-pro-table>
  82. </div>
  83. <div class="card_box" v-if="outboundDetailList.length != 0">
  84. <div class="rx-bc">
  85. <div class="item_box rx-bc">
  86. <div class="time">出库单详情 </div>
  87. </div>
  88. </div>
  89. <ele-pro-table
  90. ref="table"
  91. :columns="columnsTwo"
  92. max-height="320px"
  93. :datasource="outboundDetailList"
  94. cache-key="detailed"
  95. highlight-current-row
  96. :need-page="false"
  97. >
  98. <template v-slot:empty>
  99. <div class="empty">暂无领料数据</div>
  100. </template>
  101. <template v-slot:index="{ row, $index }">
  102. {{ $index + 1 }}
  103. </template>
  104. <template v-slot:status="{ row }">
  105. <el-tag>已出库</el-tag>
  106. </template>
  107. <template v-slot:weight="{ row, $index }">
  108. <span>{{ row.weight || 0 }}{{ row.weightUnit }}</span>
  109. </template>
  110. <!-- <template v-slot:action="{ row, $index }">
  111. <el-link
  112. type="text"
  113. @click="outboundDetails(row, $index)"
  114. v-if="dataObj.status == 2"
  115. >出库详情</el-link
  116. >
  117. </template> -->
  118. </ele-pro-table>
  119. </div>
  120. <!-- </el-dialog> -->
  121. </ele-modal>
  122. <outboundDetail ref="outboundDetailRef" />
  123. </div>
  124. </template>
  125. <script>
  126. import outboundDetail from './outboundDetail.vue';
  127. import { getOutboundDetail } from '@/api/produce/picking.js';
  128. export default {
  129. components: { outboundDetail },
  130. props: {
  131. detailedObj: {}
  132. },
  133. data() {
  134. return {
  135. visible: true,
  136. dataObj: null,
  137. outboundDetailList: [],
  138. isFullscreen: false,
  139. tabalHeight: 300
  140. };
  141. },
  142. computed: {
  143. // 表格列配置
  144. columns() {
  145. return [
  146. {
  147. columnKey: 'index',
  148. label: '序号',
  149. type: 'index',
  150. width: 120,
  151. align: 'center',
  152. showOverflowTooltip: true,
  153. slot: 'index'
  154. },
  155. {
  156. width: 120,
  157. prop: 'batchNo',
  158. slot: 'batchNo',
  159. label: '批次号',
  160. align: 'center',
  161. showOverflowTooltip: true
  162. },
  163. {
  164. prop: 'rootCategoryLevelName',
  165. label: '领料类型',
  166. align: 'center',
  167. showOverflowTooltip: true
  168. },
  169. {
  170. prop: 'categoryCode',
  171. label: '编码',
  172. align: 'center',
  173. showOverflowTooltip: true
  174. },
  175. {
  176. prop: 'categoryName',
  177. label: '名称',
  178. align: 'center',
  179. minWidth: 150,
  180. showOverflowTooltip: true
  181. },
  182. {
  183. prop: 'taskName',
  184. label: '工序名称',
  185. align: 'center',
  186. minWidth: 150,
  187. showOverflowTooltip: true
  188. },
  189. {
  190. prop: 'demandQuantity',
  191. label: '数量',
  192. align: 'center',
  193. slot: 'demandQuantity',
  194. showOverflowTooltip: true
  195. },
  196. {
  197. prop: 'warehouseName',
  198. label: '领料仓库',
  199. align: 'center',
  200. showOverflowTooltip: true
  201. },
  202. {
  203. prop: 'warehouseLeaderName',
  204. slot: 'warehouseLeaderName',
  205. label: '审核人',
  206. align: 'center',
  207. showOverflowTooltip: true
  208. },
  209. {
  210. prop: 'brandNo',
  211. label: '牌号',
  212. align: 'center',
  213. showOverflowTooltip: true
  214. },
  215. {
  216. prop: 'model',
  217. label: '型号',
  218. align: 'center',
  219. showOverflowTooltip: true
  220. },
  221. {
  222. prop: 'specification',
  223. label: '规格',
  224. align: 'center',
  225. showOverflowTooltip: true
  226. },
  227. {
  228. prop: 'action',
  229. label: '操作',
  230. align: 'center',
  231. fixed: 'right',
  232. slot: 'action',
  233. resizable: false,
  234. showOverflowTooltip: true
  235. }
  236. ];
  237. },
  238. taskObj() {
  239. return this.$store.state.user.taskObj;
  240. },
  241. columnsTwo() {
  242. let columnsVersion = this.columnsVersion;
  243. return [
  244. ...[
  245. {
  246. width: 55,
  247. type: 'index',
  248. columnKey: 'index',
  249. align: 'center',
  250. label: '序号',
  251. fixed: 'left'
  252. },
  253. {
  254. minWidth: 120,
  255. prop: 'categoryCode',
  256. label: '编码',
  257. align: 'center',
  258. fixed: 'left',
  259. showOverflowTooltip: true
  260. },
  261. {
  262. width: 100,
  263. prop: 'batchNo',
  264. label: '批次号',
  265. slot: 'batchNo',
  266. align: 'center'
  267. },
  268. {
  269. minWidth: 140,
  270. prop: 'name',
  271. label: '名称',
  272. align: 'center',
  273. showOverflowTooltip: true
  274. },
  275. {
  276. width: 150,
  277. prop: 'feedQuantity',
  278. label: '数量',
  279. slot: 'feedQuantity',
  280. align: 'center'
  281. },
  282. {
  283. width: 150,
  284. prop: 'unit',
  285. label: '单位',
  286. slot: 'unit',
  287. align: 'center'
  288. },
  289. {
  290. prop: 'weight',
  291. slot: 'weight',
  292. label: '重量',
  293. width: 120,
  294. align: 'center',
  295. showOverflowTooltip: true
  296. },
  297. {
  298. width: 150,
  299. prop: 'modelType',
  300. label: '型号',
  301. slot: 'modelType',
  302. align: 'center',
  303. showOverflowTooltip: true
  304. },
  305. {
  306. width: 150,
  307. prop: 'specification',
  308. label: '规格',
  309. slot: 'specification',
  310. align: 'center',
  311. showOverflowTooltip: true
  312. },
  313. {
  314. width: 150,
  315. prop: 'brandNum',
  316. label: '牌号',
  317. slot: 'brandNum',
  318. align: 'center',
  319. showOverflowTooltip: true
  320. },
  321. {
  322. width: 150,
  323. prop: 'status',
  324. label: '状态',
  325. slot: 'status',
  326. align: 'center',
  327. showOverflowTooltip: true
  328. }
  329. ]
  330. ];
  331. },
  332. dialogDynamicHeight() {
  333. if (this.isFullscreen) {
  334. // 全屏时,高度为窗口高度
  335. console.log(window.innerHeight + 'px', '全屏高度');
  336. this.tabalHeight = window.innerHeight - 200;
  337. return window.innerHeight + 'px';
  338. } else {
  339. this.tabalHeight = 300;
  340. return '500px';
  341. }
  342. }
  343. },
  344. methods: {
  345. handleClose() {
  346. this.$emit('detailedClose');
  347. },
  348. outboundDetails(item, index) {
  349. console.log(item, index, 'item, index');
  350. this.$refs.outboundDetailRef.open(item);
  351. },
  352. async getOutboundDetailList() {
  353. await getOutboundDetail({
  354. pickOrderId: this.dataObj.id
  355. }).then((res) => {
  356. this.outboundDetailList = res;
  357. });
  358. },
  359. fullscreen() {
  360. this.isFullscreen = !this.isFullscreen;
  361. }
  362. },
  363. created() {
  364. let obj = JSON.parse(this.detailedObj);
  365. obj.orderInfoList.forEach((o) => {
  366. let _arr = [];
  367. _arr = [...o.bomDetailDTOS, ...o.instanceList];
  368. _arr = _arr.sort(
  369. (a, b) => a.rootCategoryLevelId - b.rootCategoryLevelId
  370. );
  371. o['arr'] = _arr;
  372. });
  373. this.dataObj = obj;
  374. this.getOutboundDetailList();
  375. }
  376. };
  377. </script>
  378. <style lang="scss" scoped>
  379. .tableZ_box {
  380. border: 1px solid #e3e5e5;
  381. margin: 6px 0;
  382. &:last-child {
  383. border-bottom: none;
  384. }
  385. .row {
  386. width: 100%;
  387. display: flex;
  388. }
  389. .col {
  390. width: calc(100% / 5);
  391. display: flex;
  392. align-items: center;
  393. min-width: 200px;
  394. min-height: 32px;
  395. border-bottom: 1px solid #e3e5e5;
  396. border-right: 1px solid #e3e5e5;
  397. &:last-child {
  398. border-right: none;
  399. }
  400. .name {
  401. display: flex;
  402. align-items: center;
  403. padding: 4px;
  404. width: 80px;
  405. height: 100%;
  406. background-color: #d0e4d5;
  407. color: #000;
  408. }
  409. .content {
  410. padding: 4px 6px;
  411. color: #000;
  412. }
  413. }
  414. .pd6 {
  415. padding: 0 6px;
  416. }
  417. }
  418. .tableZ_box {
  419. .col {
  420. width: calc(100% / 3);
  421. }
  422. }
  423. .tag_box {
  424. span {
  425. display: inline-block;
  426. padding: 2px 4px;
  427. background: #e6f7ff;
  428. margin: 0 4px;
  429. }
  430. }
  431. .rx-bc {
  432. display: flex;
  433. align-items: center;
  434. justify-content: space-between;
  435. margin-top: 10px;
  436. }
  437. .item_box {
  438. margin-top: 5px;
  439. margin-bottom: 6px;
  440. padding: 0 10px;
  441. .round {
  442. width: 20px;
  443. height: 20px;
  444. line-height: 20px;
  445. border-radius: 50%;
  446. background: #157a2c;
  447. color: #fff;
  448. text-align: center;
  449. font-size: 12px;
  450. }
  451. .time {
  452. color: #157a2c;
  453. font-family: PingFang HK;
  454. font-size: 14px;
  455. font-style: normal;
  456. font-weight: 500;
  457. margin-left: 8px;
  458. }
  459. }
  460. </style>