detailed.vue 12 KB

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