wmsOutInt.vue 4.2 KB

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