wmsOutInt.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <div>
  3. <seek-page :seekList="seekList" @search="search"></seek-page>
  4. <ele-pro-table
  5. ref="table"
  6. row-key="id"
  7. :columns="columns"
  8. :datasource="datasource"
  9. :cache-key="cacheKeyUrl"
  10. autoAmendPage
  11. >
  12. <template v-slot:action="{ row }">
  13. <el-link type="primary" :underline="false" @click="goToDetail(row)">
  14. 详情
  15. </el-link>
  16. </template>
  17. </ele-pro-table>
  18. </div>
  19. </template>
  20. <script>
  21. import dictMixins from '@/mixins/dictMixins';
  22. import tableColumnsMixin from '@/mixins/tableColumnsMixin';
  23. import { getPages } from '@/api/wms/index';
  24. import { sceneState } from '@/utils/dict/index';
  25. export default {
  26. mixins: [dictMixins, tableColumnsMixin],
  27. props: {
  28. tableQuery: {
  29. type: Object,
  30. default: () => {
  31. return {};
  32. }
  33. }
  34. },
  35. data() {
  36. return {
  37. sceneState,
  38. columns: [
  39. {
  40. width: 50,
  41. type: 'index',
  42. columnKey: 'index',
  43. align: 'center',
  44. label: '序号'
  45. },
  46. {
  47. prop: 'bizNo',
  48. label: '单号',
  49. align: 'center',
  50. minWidth: 110,
  51. showOverflowTooltip: true
  52. },
  53. {
  54. prop: 'warehouseName',
  55. label: '仓库名称',
  56. align: 'center',
  57. showOverflowTooltip: true,
  58. minWidth: 150
  59. },
  60. {
  61. prop: 'bizType',
  62. label: '入库类型',
  63. align: 'center',
  64. showOverflowTooltip: true,
  65. minWidth: 150,
  66. formatter: (row) => {
  67. for (const key in this.sceneState) {
  68. if (this.sceneState[key].code == row.bizType) {
  69. return this.sceneState[key].label;
  70. }
  71. }
  72. }
  73. },
  74. {
  75. prop: 'sourceBizNo',
  76. label: '来源单据',
  77. align: 'center',
  78. showOverflowTooltip: true,
  79. minWidth: 150
  80. },
  81. {
  82. prop: 'createUserName',
  83. label: '入库人',
  84. align: 'center',
  85. showOverflowTooltip: true,
  86. minWidth: 150
  87. },
  88. {
  89. prop: 'storageTime',
  90. label: '入库时间',
  91. align: 'center',
  92. showOverflowTooltip: true,
  93. minWidth: 150
  94. },
  95. {
  96. prop: 'outInStatus',
  97. label: '入库状态',
  98. align: 'center',
  99. showOverflowTooltip: true,
  100. minWidth: 150,
  101. formatter: (row) => {
  102. if (row.verifyStatus == 2) {
  103. switch (row.outInStatus) {
  104. case '1':
  105. return '预入库';
  106. case '2':
  107. return '部分入库';
  108. case '3':
  109. return '已入库';
  110. default:
  111. return '';
  112. }
  113. }
  114. }
  115. },
  116. {
  117. label: '操作',
  118. columnKey: 'action',
  119. slot: 'action',
  120. showOverflowTooltip: true,
  121. minWidth: 110,
  122. align: 'center',
  123. fixed: 'right'
  124. }
  125. ],
  126. cacheKeyUrl: 'mes-259231507-mwmsoutint-table'
  127. };
  128. },
  129. computed: {
  130. seekList() {
  131. return [
  132. {
  133. label: '工单编码:',
  134. value: 'workOrderCode',
  135. type: 'input',
  136. placeholder: '请输入'
  137. },
  138. {
  139. label: '入库时间',
  140. value: 'time',
  141. type: 'date',
  142. dateType: 'daterange',
  143. placeholder: '请输入'
  144. },
  145. {
  146. label: '入库单号',
  147. value: 'sourceBizNo',
  148. type: 'input',
  149. placeholder: '请输入'
  150. }
  151. ];
  152. }
  153. },
  154. methods: {
  155. // 刷新表格
  156. reload(where = {}) {
  157. this.$refs.table.reload({
  158. where,
  159. ...this.tableQuery
  160. });
  161. },
  162. /* 表格数据源 */
  163. datasource({ page, limit, where, order }) {
  164. // 参数
  165. const body = {
  166. ...where,
  167. ...order,
  168. pageNum: page,
  169. size: limit,
  170. ...this.tableQuery
  171. };
  172. return getPages(body);
  173. },
  174. search(where) {
  175. console.log('where', where);
  176. if (where.time) {
  177. where.startTime = where.time[0];
  178. where.endTime = where.time[1];
  179. }
  180. // 覆盖时间
  181. this.reload({ ...where, time: null });
  182. },
  183. goToDetail(row) {
  184. const path = `/page-wms/warehouseManagement/stockManagement/details?id=${row.id}&verifyStatus=${row.verifyStatus}`;
  185. window.history.pushState(null, '', path);
  186. }
  187. }
  188. };
  189. </script>
  190. <style></style>