index.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  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 ref="table" :columns="columns" :datasource="datasource">
  7. <template v-slot:totalCount="{ row }">
  8. {{ row.totalCount }} {{ row.measuringUnit }}
  9. </template>
  10. <template v-slot:totalPackage="{ row }">
  11. {{ row.totalPackage }}
  12. </template>
  13. <template v-slot:totalWeight="{ row }">
  14. {{ row.totalWeight }} {{ row.weightUnit }}
  15. </template>
  16. <template v-slot:approvalStatus="{ row }">
  17. <span :class="{ 'ele-text-danger': row.approvalStatus == 2 }">
  18. {{ statusFormatter(row.approvalStatus) }}
  19. </span>
  20. </template>
  21. <template v-slot:action="{ row }">
  22. <el-link
  23. type="primary"
  24. v-if="row.approvalStatus == 0 || row.approvalStatus == 3"
  25. :underline="false"
  26. @click="storage(row)"
  27. >
  28. 入库
  29. </el-link>
  30. <el-link type="primary" :underline="false" @click="details(row)">
  31. 详情
  32. </el-link>
  33. </template>
  34. </ele-pro-table>
  35. </el-card>
  36. <tgDetails ref="tgDetailsRefs"></tgDetails>
  37. <storage inboundType="2" ref="storageRefs" @success="reload"></storage>
  38. </div>
  39. </template>
  40. <script>
  41. import { getList } from '@/api/warehousing/index.js';
  42. import search from './components/search.vue';
  43. import tgDetails from './components/tgDetails.vue';
  44. import storage from './storageComponents/storage.vue';
  45. export default {
  46. components: {
  47. search,
  48. tgDetails,
  49. storage
  50. },
  51. data() {
  52. return {
  53. loading: false,
  54. statusOpt: [
  55. { label: '未提交', value: 0 },
  56. { label: '审核中', value: 1 },
  57. { label: '审核通过', value: 2 },
  58. { label: '审核不通过', value: 3 }
  59. ]
  60. };
  61. },
  62. computed: {
  63. // 表格列配置
  64. columns() {
  65. return [
  66. {
  67. columnKey: 'index',
  68. label: '序号',
  69. type: 'index',
  70. width: 55,
  71. align: 'center',
  72. showOverflowTooltip: true,
  73. fixed: 'left'
  74. },
  75. {
  76. prop: 'code',
  77. label: '编码',
  78. align: 'center',
  79. minWidth: 110,
  80. showOverflowTooltip: true
  81. },
  82. {
  83. prop: 'workOrderCode',
  84. label: '工单编码',
  85. align: 'center',
  86. minWidth: 110,
  87. showOverflowTooltip: true
  88. },
  89. {
  90. prop: 'warehouseName',
  91. label: '仓库名称 ',
  92. align: 'center',
  93. showOverflowTooltip: true
  94. },
  95. {
  96. prop: 'categoryLevelName',
  97. label: '物品分类',
  98. align: 'center',
  99. showOverflowTooltip: true
  100. },
  101. {
  102. prop: 'categoryName',
  103. label: '名称',
  104. align: 'center',
  105. showOverflowTooltip: true
  106. },
  107. {
  108. label: '批次号',
  109. prop: 'batchNo',
  110. width: '90',
  111. showOverflowTooltip: true
  112. },
  113. {
  114. label: '型号',
  115. prop: 'modelType',
  116. width: '150',
  117. showOverflowTooltip: true
  118. },
  119. {
  120. label: '规格',
  121. prop: 'specification',
  122. width: '150',
  123. showOverflowTooltip: true
  124. },
  125. {
  126. label: '牌号',
  127. prop: 'brandNum',
  128. width: '50',
  129. showOverflowTooltip: true
  130. },
  131. {
  132. slot: 'totalCount',
  133. label: '总数量',
  134. align: 'center',
  135. showOverflowTooltip: true
  136. },
  137. {
  138. slot: 'totalPackage',
  139. label: '总包装',
  140. align: 'center',
  141. showOverflowTooltip: true
  142. },
  143. {
  144. slot: 'totalWeight',
  145. label: '总重量',
  146. align: 'center',
  147. showOverflowTooltip: true
  148. },
  149. {
  150. prop: 'type',
  151. label: '入库类型',
  152. align: 'center',
  153. showOverflowTooltip: true,
  154. formatter: (row, column, cellValue) => {
  155. return cellValue == 1
  156. ? '生产入库'
  157. : cellValue == 8
  158. ? '委外入库'
  159. : '';
  160. }
  161. },
  162. {
  163. prop: 'approvalUserName',
  164. label: '审核人',
  165. align: 'center',
  166. showOverflowTooltip: true
  167. },
  168. {
  169. prop: 'createTime',
  170. label: '创建时间',
  171. align: 'center',
  172. showOverflowTooltip: true,
  173. minWidth: 110
  174. },
  175. {
  176. slot: 'approvalStatus',
  177. label: '状态',
  178. align: 'center',
  179. showOverflowTooltip: true
  180. },
  181. {
  182. columnKey: 'action',
  183. label: '操作',
  184. width: 120,
  185. align: 'center',
  186. resizable: false,
  187. fixed: 'right',
  188. slot: 'action',
  189. showOverflowTooltip: true
  190. }
  191. ];
  192. }
  193. },
  194. created() {},
  195. methods: {
  196. statusFormatter(status) {
  197. const obj = this.statusOpt.find((i) => i.value == status);
  198. return obj && obj.label;
  199. },
  200. /* 表格数据源 */
  201. datasource({ page, limit, where }) {
  202. return getList({
  203. pageNum: page,
  204. size: limit,
  205. ...where
  206. });
  207. },
  208. details(row) {
  209. this.$refs.tgDetailsRefs.open(row);
  210. },
  211. storage(row) {
  212. // let data = JSON.parse(JSON.stringify(row))
  213. // data.detailList.forEach(item=>{
  214. // if(data.categoryName.includes('砌块')||data.categoryName.includes('板材')){
  215. // item.packingCount=item.packingCount
  216. // }
  217. // })
  218. this.$refs.storageRefs.pickerSuccess(row);
  219. },
  220. /* 刷新表格 */
  221. reload(where) {
  222. this.$nextTick(() => {
  223. this.$refs.table.reload({ page: 1, where });
  224. });
  225. }
  226. }
  227. };
  228. </script>
  229. <style lang="scss" scoped></style>