wmsOutInt.vue 5.0 KB

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