index.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  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: 'workOrderCode',
  77. label: '工单编码',
  78. align: 'center',
  79. minWidth: 110
  80. },
  81. {
  82. prop: 'warehouseName',
  83. label: '仓库名称 ',
  84. align: 'center'
  85. },
  86. {
  87. prop: 'categoryLevelName',
  88. label: '物品分类',
  89. align: 'center'
  90. },
  91. {
  92. prop: 'categoryName',
  93. label: '名称',
  94. align: 'center'
  95. },
  96. { label: '型号', prop: 'modelType', width: '150' },
  97. { label: '规格', prop: 'specification', width: '150' },
  98. { label: '牌号', prop: 'brandNum', width: '50' },
  99. {
  100. slot: 'totalCount',
  101. label: '总数量',
  102. align: 'center'
  103. },
  104. {
  105. slot: 'totalPackage',
  106. label: '总包装',
  107. align: 'center'
  108. },
  109. {
  110. slot: 'totalWeight',
  111. label: '总重量',
  112. align: 'center'
  113. },
  114. {
  115. prop: 'type',
  116. label: '入库类型',
  117. align: 'center',
  118. formatter: (row, column, cellValue) => {
  119. return cellValue==1?'生产入库':""
  120. }
  121. },
  122. {
  123. prop: 'approvalUserName',
  124. label: '审核人',
  125. align: 'center'
  126. },
  127. {
  128. prop: 'createTime',
  129. label: '创建时间',
  130. align: 'center',
  131. showOverflowTooltip: true,
  132. minWidth: 110
  133. },
  134. {
  135. slot: 'approvalStatus',
  136. label: '状态',
  137. align: 'center'
  138. },
  139. {
  140. columnKey: 'action',
  141. label: '操作',
  142. width: 120,
  143. align: 'center',
  144. resizable: false,
  145. fixed: 'right',
  146. slot: 'action',
  147. showOverflowTooltip: true
  148. }
  149. ];
  150. }
  151. },
  152. created() {},
  153. methods: {
  154. statusFormatter(status) {
  155. const obj = this.statusOpt.find((i) => i.value == status);
  156. return obj && obj.label;
  157. },
  158. /* 表格数据源 */
  159. datasource({ page, limit, where }) {
  160. return getList({
  161. pageNum: page,
  162. size: limit,
  163. ...where
  164. });
  165. },
  166. details(row) {
  167. this.$refs.tgDetailsRefs.open(row);
  168. },
  169. storage(row) {
  170. // let data = JSON.parse(JSON.stringify(row))
  171. // data.detailList.forEach(item=>{
  172. // if(data.categoryName.includes('砌块')||data.categoryName.includes('板材')){
  173. // item.packingCount=item.packingCount
  174. // }
  175. // })
  176. this.$refs.storageRefs.pickerSuccess(row);
  177. },
  178. /* 刷新表格 */
  179. reload(where) {
  180. this.$nextTick(() => {
  181. this.$refs.table.reload({ page: 1, where });
  182. });
  183. }
  184. }
  185. };
  186. </script>
  187. <style lang="scss" scoped></style>