index.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. <template>
  2. <div class="ele-body">
  3. <el-card shadow="never">
  4. <search ref="search" @search="reload"></search>
  5. <ele-pro-table
  6. ref="table"
  7. :columns="columns"
  8. :datasource="datasource"
  9. :pageSize="20"
  10. :pageSizes="[20, 40, 60, 80, 100]"
  11. @columns-change="handleColumnChange"
  12. :cache-key="cacheKeyUrl"
  13. >
  14. <!-- 表头工具栏 -->
  15. <template v-slot:toolbar> </template>
  16. <template v-slot:code="{ row }">
  17. <el-link type="primary" :underline="false">
  18. {{ row.code }}
  19. </el-link>
  20. </template>
  21. </ele-pro-table>
  22. </el-card>
  23. </div>
  24. </template>
  25. <script>
  26. import search from './components/search.vue';
  27. import { getSampleSmallWhole } from '@/api/samplemanagement';
  28. import dictMixins from '@/mixins/dictMixins';
  29. import tabMixins from '@/mixins/tableColumnsMixin';
  30. export default {
  31. mixins: [dictMixins, tabMixins],
  32. components: {
  33. search
  34. },
  35. data() {
  36. return {
  37. cacheKeyUrl: 'qms-c2e9664a-sample-whole',
  38. columns: [
  39. {
  40. type: 'index',
  41. columnKey: 'index',
  42. align: 'center',
  43. label: '序号',
  44. width: 55,
  45. showOverflowTooltip: true
  46. },
  47. {
  48. label: '样品编码',
  49. prop: 'sampleCode',
  50. width: '150',
  51. align: 'center',
  52. showOverflowTooltip: true,
  53. slot: 'sampleCode'
  54. },
  55. {
  56. label: '编码',
  57. prop: 'categoryCode',
  58. width: '150',
  59. align: 'center',
  60. showOverflowTooltip: true,
  61. slot: 'categoryCode'
  62. },
  63. {
  64. label: '名称',
  65. prop: 'categoryName',
  66. width: '150',
  67. align: 'center',
  68. showOverflowTooltip: true
  69. },
  70. {
  71. label: '批次号',
  72. prop: 'batchNo',
  73. align: 'center',
  74. showOverflowTooltip: true
  75. },
  76. {
  77. label: '发货条码',
  78. prop: 'barcodes',
  79. align: 'center',
  80. showOverflowTooltip: true
  81. },
  82. {
  83. label: '包装编码',
  84. prop: 'packageNo',
  85. align: 'center',
  86. showOverflowTooltip: true
  87. },
  88. {
  89. label: '包装数量',
  90. prop: 'packingQuantity',
  91. align: 'center',
  92. showOverflowTooltip: true
  93. },
  94. {
  95. label: '包装单位',
  96. prop: 'packingUnit',
  97. align: 'center',
  98. showOverflowTooltip: true
  99. },
  100. {
  101. label: '计量数量',
  102. prop: 'measureQuantity',
  103. align: 'center',
  104. showOverflowTooltip: true
  105. },
  106. {
  107. label: '计量单位',
  108. prop: 'measureUnit',
  109. align: 'center',
  110. showOverflowTooltip: true
  111. },
  112. {
  113. label: '物料代号',
  114. prop: 'materielDesignation',
  115. align: 'center',
  116. showOverflowTooltip: true
  117. },
  118. {
  119. label: '客户代号',
  120. prop: 'clientCode',
  121. align: 'center',
  122. showOverflowTooltip: true
  123. },
  124. {
  125. label: '刻码',
  126. prop: 'engrave',
  127. align: 'center',
  128. showOverflowTooltip: true
  129. },
  130. {
  131. label: '仓库',
  132. prop: 'warehouseName',
  133. align: 'center',
  134. showOverflowTooltip: true
  135. },
  136. {
  137. label: '货区',
  138. prop: 'areaName',
  139. align: 'center',
  140. showOverflowTooltip: true
  141. },
  142. {
  143. label: '货架',
  144. prop: 'goodsShelfName',
  145. align: 'center',
  146. showOverflowTooltip: true
  147. },
  148. {
  149. label: '货位',
  150. prop: 'goodsAllocationName',
  151. align: 'center',
  152. showOverflowTooltip: true
  153. },
  154. {
  155. label: '生产日期',
  156. prop: 'productionDate',
  157. align: 'center',
  158. showOverflowTooltip: true
  159. },
  160. {
  161. label: '采购日期',
  162. prop: 'purchaseDate',
  163. align: 'center',
  164. showOverflowTooltip: true
  165. },
  166. {
  167. label: '重量',
  168. prop: 'weight',
  169. align: 'center',
  170. showOverflowTooltip: true,
  171. fixed: 'right'
  172. },
  173. {
  174. label: '重量单位',
  175. prop: 'weightUnit',
  176. align: 'center',
  177. showOverflowTooltip: true,
  178. fixed: 'right'
  179. },
  180. {
  181. label: '处置状态',
  182. prop: 'disposalStatus',
  183. align: 'center',
  184. showOverflowTooltip: true,
  185. fixed: 'right',
  186. formatter: (row, column, cellValue) => {
  187. return cellValue == 1
  188. ? '返工'
  189. : cellValue == 2
  190. ? '返修'
  191. : cellValue == 3
  192. ? '报废'
  193. : cellValue == 4
  194. ? '降级使用'
  195. : cellValue == 5
  196. ? '让步接收'
  197. : cellValue == 6
  198. ? '留样'
  199. : cellValue == 7
  200. ? '消耗'
  201. : cellValue == 8
  202. ? '回用'
  203. : '';
  204. }
  205. },
  206. {
  207. label: '处置时间',
  208. prop: 'disposeTime',
  209. align: 'center',
  210. showOverflowTooltip: true,
  211. fixed: 'right'
  212. },
  213. {
  214. label: '检测状态',
  215. prop: 'qualityStatus',
  216. align: 'center',
  217. showOverflowTooltip: true,
  218. fixed: 'right',
  219. formatter: (row, column, cellValue) => {
  220. return cellValue == 0
  221. ? '未检'
  222. : cellValue == 1
  223. ? '已检'
  224. : cellValue == 2
  225. ? '待检'
  226. : '';
  227. }
  228. },
  229. {
  230. label: '检测结果',
  231. prop: 'qualityResults',
  232. align: 'center',
  233. showOverflowTooltip: true,
  234. fixed: 'right',
  235. formatter: (row, column, cellValue) => {
  236. return cellValue == 1 ? '合格' : cellValue == 2 ? '不合格' : '';
  237. }
  238. }
  239. ]
  240. };
  241. },
  242. created() {
  243. // this.requestDict('取样类型');
  244. },
  245. methods: {
  246. datasource({ page, where, limit }) {
  247. where.conditionType = 1;
  248. return getSampleSmallWhole({
  249. ...where,
  250. pageNum: page,
  251. size: limit
  252. });
  253. },
  254. reload(where) {
  255. this.$refs.table.reload({ page: 1, where });
  256. }
  257. }
  258. };
  259. </script>