selfDetailed.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. <template>
  2. <div>
  3. <ele-modal
  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. :maxable="true"
  11. width="80%"
  12. >
  13. <div class="tableZ_box">
  14. <div class="row">
  15. <div class="col">
  16. <div class="name">领料时间</div>
  17. <div class="content">{{ dataObj.createTime }}</div>
  18. </div>
  19. <div class="col">
  20. <div class="name">领料单号</div>
  21. <div class="content">{{ dataObj.code }}</div>
  22. </div>
  23. <div class="col">
  24. <div class="name">领料人</div>
  25. <div class="content">{{ dataObj.executorName }}</div>
  26. </div>
  27. <div class="col">
  28. <div class="name">类型</div>
  29. <div class="content" v-if="dataObj.type == 1">自建领料</div>
  30. <div class="content" v-if="dataObj.type == 2">工单领料</div>
  31. <div class="content" v-if="dataObj.type == 3">委外领料</div>
  32. </div>
  33. </div>
  34. </div>
  35. <ele-pro-table
  36. ref="table"
  37. :columns="columns"
  38. max-height="320px"
  39. :datasource="dataObj.detailList"
  40. cache-key="detailed"
  41. highlight-current-row
  42. :need-page="false"
  43. >
  44. <template v-slot:empty>
  45. <div class="empty">暂无领料数据</div>
  46. </template>
  47. <template v-slot:index="{ row, $index }">
  48. {{ $index + 1 }} <el-tag>{{ row.rootCategoryLevelName }}</el-tag>
  49. </template>
  50. <template v-slot:demandQuantity="{ row }">
  51. {{ row.demandQuantity }} {{ row.unit }}
  52. </template>
  53. <template v-slot:specification="{ row }">
  54. {{ row.specification ? row.specification : row.specifications }}
  55. </template>
  56. <template v-slot:action="{ row, $index }">
  57. <el-link
  58. type="text"
  59. @click="outboundDetails(row, $index)"
  60. v-if="dataObj.status == 2"
  61. >出库详情</el-link
  62. >
  63. </template>
  64. </ele-pro-table>
  65. <div class="card_box" v-if="outboundDetailList.length != 0">
  66. <div class="rx-bc">
  67. <div class="item_box rx-bc">
  68. <div class="time">出库单详情 </div>
  69. </div>
  70. </div>
  71. <ele-pro-table
  72. ref="table"
  73. :columns="columnsTwo"
  74. max-height="320px"
  75. :datasource="outboundDetailList"
  76. cache-key="detailed"
  77. highlight-current-row
  78. :need-page="false"
  79. >
  80. <template v-slot:empty>
  81. <div class="empty">暂无领料数据</div>
  82. </template>
  83. <template v-slot:index="{ row, $index }">
  84. {{ $index + 1 }}
  85. </template>
  86. <template v-slot:status="{ row }">
  87. <el-tag>已出库</el-tag>
  88. </template>
  89. <!-- <template v-slot:action="{ row, $index }">
  90. <el-link
  91. type="text"
  92. @click="outboundDetails(row, $index)"
  93. v-if="dataObj.status == 2"
  94. >出库详情</el-link
  95. >
  96. </template> -->
  97. </ele-pro-table>
  98. </div>
  99. </ele-modal>
  100. <outboundDetail ref="outboundDetailRef" />
  101. </div>
  102. </template>
  103. <script>
  104. import outboundDetail from '@/views/produce/components/picking/outboundDetail.vue';
  105. import { getOutboundDetail } from '@/api/produce/picking.js';
  106. export default {
  107. components: { outboundDetail },
  108. props: {
  109. detailedObj: {}
  110. },
  111. data() {
  112. return {
  113. visible: true,
  114. dataObj: null,
  115. outboundDetailList: []
  116. };
  117. },
  118. computed: {
  119. // 表格列配置
  120. columns() {
  121. return [
  122. {
  123. columnKey: 'index',
  124. label: '序号',
  125. type: 'index',
  126. width: 120,
  127. align: 'center',
  128. showOverflowTooltip: true,
  129. slot: 'index'
  130. },
  131. {
  132. width: 100,
  133. prop: 'batchNo',
  134. label: '批次号',
  135. slot: 'batchNo',
  136. align: 'center'
  137. },
  138. {
  139. prop: 'categoryCode',
  140. label: '编码',
  141. align: 'center',
  142. showOverflowTooltip: true
  143. },
  144. {
  145. prop: 'categoryName',
  146. label: '名称',
  147. align: 'center',
  148. showOverflowTooltip: true
  149. },
  150. {
  151. prop: 'demandQuantity',
  152. label: '数量',
  153. align: 'center',
  154. slot: 'demandQuantity',
  155. showOverflowTooltip: true
  156. },
  157. {
  158. prop: 'warehouseName',
  159. label: '领料仓库',
  160. align: 'center',
  161. showOverflowTooltip: true
  162. },
  163. {
  164. prop: 'warehouseLeaderName',
  165. label: '审核人',
  166. align: 'center',
  167. showOverflowTooltip: true
  168. },
  169. {
  170. prop: 'brandNo',
  171. label: '牌号',
  172. align: 'center',
  173. showOverflowTooltip: true
  174. },
  175. {
  176. prop: 'model',
  177. label: '型号',
  178. align: 'center',
  179. showOverflowTooltip: true
  180. },
  181. {
  182. prop: 'specification',
  183. label: '规格',
  184. align: 'center',
  185. slot: 'specification',
  186. showOverflowTooltip: true
  187. },
  188. {
  189. prop: 'action',
  190. label: '操作',
  191. align: 'center',
  192. fixed: 'right',
  193. slot: 'action',
  194. resizable: false,
  195. showOverflowTooltip: true
  196. }
  197. ];
  198. },
  199. columnsTwo() {
  200. let columnsVersion = this.columnsVersion;
  201. return [
  202. ...[
  203. {
  204. width: 55,
  205. type: 'index',
  206. columnKey: 'index',
  207. align: 'center',
  208. label: '序号',
  209. fixed: 'left'
  210. },
  211. {
  212. minWidth: 120,
  213. prop: 'categoryCode',
  214. label: '编码',
  215. align: 'center',
  216. fixed: 'left',
  217. showOverflowTooltip: true
  218. },
  219. {
  220. width: 100,
  221. prop: 'batchNo',
  222. label: '批次号',
  223. slot: 'batchNo',
  224. align: 'center'
  225. },
  226. {
  227. minWidth: 140,
  228. prop: 'name',
  229. label: '名称',
  230. align: 'center',
  231. showOverflowTooltip: true
  232. },
  233. {
  234. width: 150,
  235. prop: 'feedQuantity',
  236. label: '数量',
  237. slot: 'feedQuantity',
  238. align: 'center'
  239. },
  240. {
  241. width: 150,
  242. prop: 'unit',
  243. label: '单位',
  244. slot: 'unit',
  245. align: 'center'
  246. },
  247. {
  248. width: 150,
  249. prop: 'modelType',
  250. label: '型号',
  251. slot: 'modelType',
  252. align: 'center',
  253. showOverflowTooltip: true
  254. },
  255. {
  256. width: 150,
  257. prop: 'specification',
  258. label: '规格',
  259. align: 'center',
  260. showOverflowTooltip: true
  261. },
  262. {
  263. width: 150,
  264. prop: 'brandNum',
  265. label: '牌号',
  266. slot: 'brandNum',
  267. align: 'center',
  268. showOverflowTooltip: true
  269. },
  270. {
  271. width: 150,
  272. prop: 'supplierName',
  273. label: '供应商',
  274. align: 'center',
  275. showOverflowTooltip: true
  276. },
  277. {
  278. width: 150,
  279. prop: 'status',
  280. label: '状态',
  281. slot: 'status',
  282. align: 'center',
  283. showOverflowTooltip: true
  284. }
  285. ]
  286. ];
  287. }
  288. },
  289. methods: {
  290. handleClose() {
  291. this.$emit('detailedClose');
  292. },
  293. outboundDetails(item, index) {
  294. this.$refs.outboundDetailRef.open(item);
  295. },
  296. async getOutboundDetailList() {
  297. await getOutboundDetail({
  298. pickOrderId: this.dataObj.id
  299. }).then((res) => {
  300. this.outboundDetailList = res;
  301. });
  302. }
  303. },
  304. created() {
  305. let obj = JSON.parse(this.detailedObj);
  306. console.log(obj, 'obj');
  307. this.dataObj = obj;
  308. this.getOutboundDetailList();
  309. }
  310. };
  311. </script>
  312. <style lang="scss" scoped>
  313. .tableZ_box {
  314. border: 1px solid #e3e5e5;
  315. margin: 6px 0;
  316. &:last-child {
  317. border-bottom: none;
  318. }
  319. .row {
  320. width: 100%;
  321. display: flex;
  322. }
  323. .col {
  324. width: calc(100% / 5);
  325. display: flex;
  326. align-items: center;
  327. // min-width: 200px;
  328. min-height: 32px;
  329. border-bottom: 1px solid #e3e5e5;
  330. border-right: 1px solid #e3e5e5;
  331. &:last-child {
  332. border-right: none;
  333. }
  334. .name {
  335. display: flex;
  336. align-items: center;
  337. padding: 4px;
  338. width: 60px;
  339. height: 100%;
  340. background-color: #d0e4d5;
  341. color: #000;
  342. }
  343. .content {
  344. padding: 4px 6px;
  345. color: #000;
  346. }
  347. }
  348. .pd6 {
  349. padding: 0 6px;
  350. }
  351. }
  352. .tableZ_box {
  353. .col {
  354. width: calc(100% / 3);
  355. }
  356. }
  357. .tag_box {
  358. span {
  359. display: inline-block;
  360. padding: 2px 4px;
  361. background: #e6f7ff;
  362. margin: 0 4px;
  363. }
  364. }
  365. .time {
  366. color: #157a2c;
  367. font-family: PingFang HK;
  368. font-size: 14px;
  369. font-style: normal;
  370. font-weight: 500;
  371. margin-left: 8px;
  372. }
  373. </style>