index.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. <template>
  2. <div class="ele-body">
  3. <el-card shadow="never" v-loading="loading">
  4. <search @search="reload" ref="searchRef"> </search>
  5. <!-- 数据表格 -->
  6. <ele-pro-table
  7. ref="table"
  8. :columns="columns"
  9. :datasource="datasource"
  10. cache-key="warehouseIndex"
  11. :pageSize="20"
  12. :height="tableHeight"
  13. @fullscreen-change="fullscreenChange"
  14. >
  15. <template v-slot:code="{ row }">
  16. <el-link type="primary" :underline="false" @click="details(row)">
  17. {{ row.code }}
  18. </el-link>
  19. </template>
  20. <template v-slot:totalCount="{ row }">
  21. {{ row.totalCount }} {{ row.measuringUnit }}
  22. </template>
  23. <template v-slot:totalPackage="{ row }">
  24. {{ row.totalPackage
  25. }}{{
  26. row.detailList.length != 0 ? row.detailList[0].packingUnit : ''
  27. }}
  28. </template>
  29. <template v-slot:totalWeight="{ row }">
  30. {{ row.totalWeight }} {{ row.weightUnit }}
  31. </template>
  32. <template v-slot:approvalStatus="{ row }">
  33. <span :class="{ 'ele-text-success': row.approvalStatus == 2 }">
  34. {{ statusFormatter(row.approvalStatus) }}
  35. </span>
  36. </template>
  37. <template v-slot:action="{ row }">
  38. <el-link
  39. type="primary"
  40. v-if="row.approvalStatus == 0"
  41. :underline="false"
  42. @click="storage(row)"
  43. >
  44. 入库
  45. </el-link>
  46. <el-link
  47. type="primary"
  48. :underline="false"
  49. @click="handleFlow(row)"
  50. v-if="row.approvalStatus != 0"
  51. >
  52. 流程
  53. </el-link>
  54. <!-- <el-link type="primary" :underline="false" @click="details(row)">
  55. 详情
  56. </el-link> -->
  57. </template>
  58. </ele-pro-table>
  59. </el-card>
  60. <tgDetails ref="tgDetailsRefs"></tgDetails>
  61. <flow ref="flowRef"></flow>
  62. <storage inboundType="2" ref="storageRefs" @success="reload"></storage>
  63. </div>
  64. </template>
  65. <script>
  66. import { getList } from '@/api/warehousing/index.js';
  67. import search from './components/search.vue';
  68. import tgDetails from './components/tgDetails.vue';
  69. import storage from './storageComponents/storage.vue';
  70. import flow from '@/views/materialReturn/components/flow.vue';
  71. export default {
  72. components: {
  73. search,
  74. tgDetails,
  75. storage,
  76. flow
  77. },
  78. data() {
  79. return {
  80. loading: false,
  81. statusOpt: [
  82. { label: '未提交', value: 0 },
  83. { label: '审核中', value: 1 },
  84. { label: '审核通过', value: 2 },
  85. { label: '审核不通过', value: 3 }
  86. ],
  87. tableHeight: 'calc(100vh - 300px)'
  88. };
  89. },
  90. computed: {
  91. // 表格列配置
  92. columns() {
  93. return [
  94. {
  95. columnKey: 'index',
  96. label: '序号',
  97. type: 'index',
  98. width: 55,
  99. align: 'center',
  100. showOverflowTooltip: true,
  101. fixed: 'left'
  102. },
  103. {
  104. prop: 'code',
  105. slot: 'code',
  106. label: '编码',
  107. align: 'center',
  108. minWidth: 110,
  109. showOverflowTooltip: true
  110. },
  111. {
  112. prop: 'categoryCode',
  113. label: '物品编码',
  114. align: 'center',
  115. minWidth: 110,
  116. showOverflowTooltip: true
  117. },
  118. {
  119. prop: 'workOrderCode',
  120. label: '工单编码',
  121. align: 'center',
  122. minWidth: 110,
  123. showOverflowTooltip: true
  124. },
  125. {
  126. prop: 'warehouseName',
  127. label: '仓库名称 ',
  128. align: 'center',
  129. showOverflowTooltip: true
  130. },
  131. {
  132. prop: 'categoryLevelName',
  133. label: '物品分类',
  134. align: 'center',
  135. showOverflowTooltip: true
  136. },
  137. {
  138. prop: 'categoryName',
  139. label: '名称',
  140. align: 'center',
  141. showOverflowTooltip: true
  142. },
  143. {
  144. label: '批次号',
  145. prop: 'batchNo',
  146. width: '90',
  147. showOverflowTooltip: true
  148. },
  149. {
  150. label: '型号',
  151. prop: 'modelType',
  152. width: '150',
  153. showOverflowTooltip: true
  154. },
  155. {
  156. label: '规格',
  157. prop: 'specification',
  158. width: '150',
  159. showOverflowTooltip: true
  160. },
  161. {
  162. label: '牌号',
  163. prop: 'brandNum',
  164. width: '50',
  165. showOverflowTooltip: true
  166. },
  167. {
  168. prop: 'totalCount',
  169. slot: 'totalCount',
  170. label: '总数量',
  171. align: 'center',
  172. showOverflowTooltip: true
  173. },
  174. {
  175. prop: 'totalPackage',
  176. slot: 'totalPackage',
  177. label: '总包装',
  178. align: 'center',
  179. showOverflowTooltip: true
  180. },
  181. {
  182. prop: 'totalWeight',
  183. slot: 'totalWeight',
  184. label: '总重量',
  185. align: 'center',
  186. showOverflowTooltip: true
  187. },
  188. {
  189. prop: 'colorKey',
  190. label: '颜色',
  191. align: 'center',
  192. showOverflowTooltip: true,
  193. minWidth: 110
  194. },
  195. {
  196. prop: 'modelKey',
  197. label: '机型',
  198. align: 'center',
  199. showOverflowTooltip: true,
  200. minWidth: 110
  201. },
  202. {
  203. prop: 'produceRoutingName',
  204. label: '工艺路线',
  205. align: 'center',
  206. showOverflowTooltip: true
  207. },
  208. {
  209. prop: 'salesCode',
  210. label: '销售订单编码',
  211. align: 'center',
  212. width: 110,
  213. showOverflowTooltip: true
  214. },
  215. {
  216. prop: 'type',
  217. label: '入库类型',
  218. align: 'center',
  219. showOverflowTooltip: true,
  220. formatter: (row, column, cellValue) => {
  221. return cellValue == 1
  222. ? '生产入库'
  223. : cellValue == 8
  224. ? '委外入库'
  225. : cellValue == 3
  226. ? '退料入库'
  227. : '';
  228. }
  229. },
  230. {
  231. prop: 'approvalUserName',
  232. label: '审核人',
  233. align: 'center',
  234. showOverflowTooltip: true
  235. },
  236. {
  237. prop: 'executorName',
  238. label: '执行人',
  239. align: 'center',
  240. showOverflowTooltip: true
  241. },
  242. {
  243. prop: 'createTime',
  244. label: '创建时间',
  245. align: 'center',
  246. showOverflowTooltip: true,
  247. minWidth: 110
  248. },
  249. {
  250. prop: 'approvalStatus',
  251. slot: 'approvalStatus',
  252. label: '状态',
  253. align: 'center',
  254. showOverflowTooltip: true
  255. },
  256. {
  257. columnKey: 'action',
  258. label: '操作',
  259. width: 120,
  260. align: 'center',
  261. resizable: false,
  262. fixed: 'right',
  263. slot: 'action',
  264. showOverflowTooltip: true
  265. }
  266. ];
  267. }
  268. },
  269. created() {},
  270. methods: {
  271. statusFormatter(status) {
  272. const obj = this.statusOpt.find((i) => i.value == status);
  273. return obj && obj.label;
  274. },
  275. /* 表格数据源 */
  276. datasource({ page, limit, where }) {
  277. return getList({
  278. pageNum: page,
  279. size: limit,
  280. ...where
  281. });
  282. },
  283. details(row) {
  284. this.$refs.tgDetailsRefs.open(row);
  285. },
  286. storage(row) {
  287. // let data = JSON.parse(JSON.stringify(row))
  288. // data.detailList.forEach(item=>{
  289. // if(data.categoryName.includes('砌块')||data.categoryName.includes('板材')){
  290. // item.packingCount=item.packingCount
  291. // }
  292. // })
  293. this.$refs.storageRefs.pickerSuccess(row);
  294. },
  295. handleFlow(row) {
  296. if (!row.processInstanceId) {
  297. return this.$message.warning('暂无流程图');
  298. }
  299. this.$refs.flowRef.open(row.processInstanceId);
  300. },
  301. /* 刷新表格 */
  302. reload(where) {
  303. this.$nextTick(() => {
  304. this.$refs.table.reload({ page: 1, where });
  305. });
  306. },
  307. fullscreenChange(fullscreen) {
  308. if (fullscreen) {
  309. this.tableHeight = 'calc(100vh - 120px)';
  310. } else {
  311. this.tableHeight = 'calc(100vh - 300px)';
  312. }
  313. }
  314. }
  315. };
  316. </script>
  317. <style lang="scss" scoped></style>