wmsOutInt.vue 5.2 KB

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