index.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <div class="ele-body">
  3. <el-card shadow="never">
  4. <search ref="search" @search="reload"></search>
  5. <ele-pro-table ref="table" :columns="columns" :datasource="datasource" :pageSize="20"
  6. :pageSizes="[20, 30, 40, 50, 100]">
  7. <!-- 表头工具栏 -->
  8. <template v-slot:toolbar>
  9. </template>
  10. <template v-slot:sampleCode="{ row }">
  11. <el-link type="primary" :underline="false">
  12. {{ row.sampleCode }}
  13. </el-link>
  14. </template>
  15. </ele-pro-table>
  16. </el-card>
  17. </div>
  18. </template>
  19. <script>
  20. import search from './components/search.vue';
  21. import { getQualitySampleList } from '@/api/samplemanagement';
  22. import dictMixins from '@/mixins/dictMixins';
  23. export default {
  24. mixins: [dictMixins],
  25. components: {
  26. search
  27. },
  28. data() {
  29. return {
  30. columns: [
  31. { type: 'index', columnKey: 'index', align: 'center', label: '序号', width: 55, showOverflowTooltip: true, fixed: 'left' },
  32. { label: '样品编码', prop: 'sampleCode', width: 120, showOverflowTooltip: true, align: 'center', fixed: 'left' },
  33. { label: '编码', prop: 'categoryCode', width: 120, showOverflowTooltip: true, align: 'center', fixed: 'left' },
  34. { label: '名称', prop: 'categoryName', width: 120, showOverflowTooltip: true, align: 'center' },
  35. { label: '批次号', prop: 'batchNo', align: 'center', width: 100, showOverflowTooltip: true },
  36. { label: '发货条码', prop: 'barcodes', align: 'center', width: 120, showOverflowTooltip: true },
  37. { label: '包装编码', prop: 'packageNo', align: 'center', width: 120, showOverflowTooltip: true },
  38. { label: '包装单位', prop: 'packingUnit', align: 'center', width: 100, showOverflowTooltip: true },
  39. { label: '计量数量', prop: 'measureQuantity', align: 'center', width: 100, showOverflowTooltip: true },
  40. { label: '计量单位', prop: 'measureUnit', align: 'center', width: 100, showOverflowTooltip: true },
  41. { label: '供应商名称', prop: 'supplierName', align: 'center', width: 120, showOverflowTooltip: true },
  42. { label: '供应商代号', prop: 'supplierCode', align: 'center', width: 120, showOverflowTooltip: true },
  43. { label: '物料代号', prop: 'materielDesignation', align: 'center', slot: 'materielDesignation', width: 100, showOverflowTooltip: true },
  44. { label: '客户代号', prop: 'clientCode', align: 'center', slot: 'clientCode', width: 100, showOverflowTooltip: true },
  45. { label: '刻码', prop: 'engrave', align: 'center', slot: 'engrave', showOverflowTooltip: true },
  46. { label: '重量', prop: 'weight', align: 'center', slot: 'weight', showOverflowTooltip: true },
  47. { label: '重量单位', prop: 'weightUnit', align: 'center', showOverflowTooltip: true },
  48. { label: '仓库', prop: 'warehouseName', align: 'center', width: 100, showOverflowTooltip: true },
  49. { label: '货区', prop: 'areaName', align: 'center', showOverflowTooltip: true },
  50. { label: '货架', prop: 'goodsShelfName', align: 'center', showOverflowTooltip: true },
  51. { label: '货位', prop: 'goodsAllocationName', align: 'center', showOverflowTooltip: true },
  52. { label: '生产日期', prop: 'productionDate', align: 'center', showOverflowTooltip: true },
  53. { label: '采购日期', prop: 'purchaseDate', align: 'center', showOverflowTooltip: true },
  54. {
  55. label: '处置状态', prop: 'disposalStatus', align: 'center', formatter: (row, column, cellValue) => {
  56. return cellValue == 7 ? '消耗' : '';
  57. }
  58. },
  59. { label: '处置时间', prop: 'disposeTime', align: 'center', width: 100, showOverflowTooltip: true },
  60. {
  61. label: '质检状态', prop: 'qualityStatus', align: 'center', formatter: (row, column, cellValue) => {
  62. return cellValue == 0 ? '未检' : cellValue == 1 ? '已检' : cellValue == 2 ? '待检' : '';
  63. }
  64. },
  65. {
  66. label: '质检结果', prop: 'qualityResults', align: 'center', formatter: (row, column, cellValue) => {
  67. return cellValue == 1 ? '合格' : cellValue == 2 ? '不合格' : '';
  68. }
  69. },
  70. ]
  71. };
  72. },
  73. created() {
  74. // this.requestDict('取样类型');
  75. },
  76. methods: {
  77. datasource({ page, where, limit }) {
  78. where.disposalStatus = 7;
  79. return getQualitySampleList({
  80. ...where,
  81. pageNum: page,
  82. size: limit
  83. });
  84. },
  85. reload(where) {
  86. this.$refs.table.reload({ page: 1, where });
  87. },
  88. processingMethod(type, row) {
  89. this.$router.push({
  90. path: '/sample/samplemanagement/components/edit',
  91. query: {
  92. type: type,
  93. qualityWorkOrderId: row.qualityWorkOrderId || '',
  94. id: row.id || '',
  95. qualityType: row.qualityType || ''
  96. }
  97. });
  98. // this.$refs.edit.open(type, row)
  99. },
  100. }
  101. };
  102. </script>