const qualityResultList = { 1: '合格', 2: '不合格' };
const disposalStatustList = { 0: '待处置', 1: '处置中', 2: '处置完成' };
export default {
  data() {
    return {
      infoList: [
        {
          label: '编码',
          prop: 'code',
          span: 6
        },
        {
          label: '产品名称',
          prop: 'productName',
          span: 6
        },
        {
          label: '产品编码',
          prop: 'productCode',
          span: 6
        },
        {
          label: '批次号',
          prop: 'batchNo',
          span: 6
        },
        {
          label: '规格',
          prop: 'specification',
          span: 6
        },
        {
          label: '型号',
          prop: 'modelType',
          span: 6
        },
        {
          label: '牌号',
          prop: 'brandNo',
          span: 6
        },
        {
          label: '计量类型',
          prop: 'inspectionStandardsName',
          span: 6
        },
        {
          label: '质检部门',
          prop: 'groupName',
          span: 6
        },
        {
          label: '质检人',
          prop: 'qualityName',
          span: 6
        },

        {
          label: '质检时间',
          prop: 'qualityTime',
          span: 6
        },
        {
          label: '工时(h)',
          prop: 'hours',
          span: 6
        },
        {
          label: '合格率',
          prop: 'qualificationRate',
          span: 6
        },
        {
          label: '不合格率',
          prop: 'noQualificationRate',
          span: 6
        },
        {
          label: '检验方式',
          prop: 'qualityModeName',
          span: 6
        },

        {
          label: '质检结果',
          prop: 'qualityResultsName',
          span: 6
        },
        {
          label: '总重量',
          prop: 'totalWeight',
          span: 6
        },
        {
          label: '总数量',
          prop: 'total',
          span: 6
        },
      ],
      disposeTypeMap: {
        1: '返工',
        2: '返修',
        3: '报废',
        4: '降级使用',
        5: '让步接收',
        6: '留样',
        7: '消耗',
        8: '回用/归批',
        9: '转试销',
        10: '退货'
      },
      tableColumns1: [
        {
          columnKey: 'index',
          label: '序号',
          type: 'index',
          width: 55,
          align: 'center',
          fixed: 'left'
        },
        {
          label: '编码',
          prop: 'categoryCode',
          width: 150,
          align: 'center',
          showOverflowTooltip: true
        },
        {
          label: '名称',
          prop: 'categoryName',
          width: '150',
          align: 'center',
          width: 120,
          showOverflowTooltip: true
        },
        {
          label: '批次号',
          prop: 'batchNo',
          align: 'center',
          width: 120,
          showOverflowTooltip: true
        },
        {
          label: '发货条码',
          prop: 'barcodes',
          align: 'center',
          showOverflowTooltip: true
        },
        {
          label: '包装编码',
          prop: 'packageNo',
          align: 'center',
          width: 120,
          showOverflowTooltip: true
        },
        { label: '包装数量', prop: 'packingQuantity', align: 'center' },
        { label: '包装单位', prop: 'packingUnit', align: 'center' },
        { label: '计量数量', prop: 'measureQuantity', align: 'center' },
        { label: '计量单位', prop: 'measureUnit', align: 'center' },
        {
          label: '物料代号',
          prop: 'materielDesignation',
          align: 'center',
          showOverflowTooltip: true
        },
        {
          label: '客户代号',
          prop: 'clientCode',
          align: 'center',
          showOverflowTooltip: true
        },
        {
          label: '供应商名称',
          prop: 'supplierName',
          align: 'center',
          width: 120,
          showOverflowTooltip: true
        },
        {
          label: '供应商代号',
          prop: 'supplierCode',
          align: 'center',
          width: '120',
          showOverflowTooltip: true
        },
        { label: '刻码', prop: 'engrave', align: 'center' },
        { label: '重量', prop: 'weight', align: 'center' },
        { label: '重量单位', prop: 'weightUnit', align: 'center' },
        {
          label: '仓库',
          prop: 'warehouseName',
          align: 'center',
          width: 120,
          showOverflowTooltip: true
        },
        { label: '货区', prop: 'areaName', align: 'center' },
        { label: '货架', prop: 'goodsShelfName', align: 'center' },
        { label: '货位', prop: 'goodsAllocationName', align: 'center' },
        {
          label: '生产日期',
          prop: 'productionDate',
          align: 'center',
          width: 120,
          showOverflowTooltip: true
        },
        {
          label: '采购日期',
          prop: 'purchaseDate',
          align: 'center',
          width: 120,
          showOverflowTooltip: true
        }
      ],
      tableColumns2: [
        {
          columnKey: 'index',
          label: '序号',
          type: 'index',
          width: 55,
          align: 'center',
          fixed: 'left'
        },
        {
          label: '样品编码',
          prop: 'sampleCode',
          width: '200',
          align: 'center',
          fixed: 'left',
          showOverflowTooltip: true
        },
        {
          label: '编码',
          prop: 'categoryCode',
          align: 'center',
          fixed: 'left',
          width: '150',
          showOverflowTooltip: true
        },
        {
          label: '名称',
          prop: 'categoryName',
          align: 'center',
          width: '150',
          showOverflowTooltip: true
        },
        {
          label: '批次号',
          prop: 'batchNo',
          align: 'center',
          showOverflowTooltip: true
        },
        {
          label: '发货条码',
          prop: 'barcodes',
          align: 'center',
          showOverflowTooltip: true
        },
        {
          label: '包装编码',
          prop: 'packageNo',
          align: 'center',
          width: '170',
          showOverflowTooltip: true
        },
        { label: '包装数量', prop: 'packingQuantity', align: 'center' },
        { label: '包装单位', prop: 'packingUnit', align: 'center' },
        { label: '计量数量', prop: 'measureQuantity', align: 'center' },
        { label: '计量单位', prop: 'measureUnit', align: 'center' },
        {
          label: '供应商名称',
          prop: 'supplierName',
          align: 'center',
          width: '120',
          showOverflowTooltip: true
        },
        {
          label: '供应商代号',
          prop: 'supplierCode',
          align: 'center',
          width: '120',
          showOverflowTooltip: true
        },
        {
          label: '物料代号',
          prop: 'materielDesignation',
          align: 'center',
          slot: 'materielDesignation',
          width: '120',
          showOverflowTooltip: true
        },
        {
          label: '客户代号',
          prop: 'clientCode',
          align: 'center',
          slot: 'clientCode',
          width: '120',
          showOverflowTooltip: true
        },
        {
          label: '刻码',
          prop: 'engrave',
          align: 'center',
          slot: 'engrave',
          width: '120',
          showOverflowTooltip: true
        },
        {
          label: '重量',
          prop: 'weight',
          align: 'center',
          slot: 'weight',
          width: '120'
        },
        {
          label: '重量单位',
          prop: 'weightUnit',
          align: 'center',
          width: 100
        },
        {
          label: '仓库',
          prop: 'warehouseName',
          align: 'center',
          width: 150,
          showOverflowTooltip: true
        },
        {
          label: '货区',
          prop: 'areaName',
          align: 'center',
          showOverflowTooltip: true
        },
        { label: '货架', prop: 'goodsShelfName', align: 'center' },
        { label: '货位', prop: 'goodsAllocationName', align: 'center' },
        {
          label: '生产日期',
          prop: 'productionDate',
          align: 'center',
          width: 150,
          showOverflowTooltip: true
        },
        {
          label: '采购日期',
          prop: 'purchaseDate',
          align: 'center',
          width: 150,
          showOverflowTooltip: true
        },
        {
          label: '处置状态',
          prop: 'disposeType',
          align: 'center',
          formatter: (_row) => {
            return this.disposeTypeMap[_row.disposeType] || '';
          }
        },
        {
          label: '处置时间',
          prop: 'disposeTime',
          align: 'center',
          showOverflowTooltip: true,
          width: 150
        },
        {
          label: '质检状态',
          prop: 'qualityStatus',
          align: 'center',
          formatter: (row) => {
            if (row.qualityStatus == 0) {
              return '未检';
            }
            if (row.qualityStatus == 1) {
              return '已检';
            }
            if (row.qualityStatus == 2) {
              return '待检';
            }
          }
        }
      ],
      tableColumns3: [
        {
          columnKey: 'index',
          label: '序号',
          type: 'index',
          width: 55,
          align: 'center',
          fixed: 'left'
        },
        {
          label: '质检方案编码',
          prop: 'qualitySchemeTemplateCode',
          align: 'center',
          showOverflowTooltip: true
        },
        {
          label: '质检方案名称',
          prop: 'qualitySchemeTemplateName',
          align: 'center',
          showOverflowTooltip: true
        },
        {
          label: '质检类型',
          prop: 'categoryLevelClassName',
          align: 'center',
          showOverflowTooltip: true
        },
        {
          label: '质检项编码',
          prop: 'inspectionCode',
          align: 'center',
          showOverflowTooltip: true
        },
        {
          label: '质检项名称',
          prop: 'inspectionName',
          align: 'center',
          showOverflowTooltip: true
        },
        {
          label: '工艺参数',
          prop: 'defaultValue',
          align: 'center',
          showOverflowTooltip: true,
          slot: 'defaultValue'
        }
      ],
      tableColumns4: [
        {
          type: 'index',
          columnKey: 'index',
          align: 'center',
          label: '序号',
          width: 55,
          showOverflowTooltip: true
        },
        {
          label: '样品编码',
          prop: 'sampleCode',
          minWidth: '150',
          align: 'center',
          showOverflowTooltip: true
        },
        {
          label: '物品编码',
          prop: 'categoryCode',
          minWidth: '150',
          align: 'center',
          showOverflowTooltip: true
        },
        {
          label: '物品名称',
          prop: 'categoryName',
          minWidth: '180',
          align: 'center',
          showOverflowTooltip: true
        },
        {
          prop: 'batchNo',
          label: '批次号',
          align: 'center',
          minWidth: '120',
          showOverflowTooltip: true
        },
        {
          label: '规格',
          prop: 'specification',
          width: '120',
          align: 'center',
          showOverflowTooltip: true
        },
        {
          label: '牌号',
          prop: 'brandNum',
          width: '120',
          align: 'center',
          showOverflowTooltip: true
        },
        {
          prop: 'modelType',
          label: '型号',
          align: 'center',
          width: '120',
          showOverflowTooltip: true
        },
        {
          prop: 'measureQuantity',
          label: '计量数量',
          align: 'center',
          width: '120',
          showOverflowTooltip: true
        },
        {
          prop: 'measureUnit',
          label: '计量单位',
          align: 'center',
          width: '120',
          showOverflowTooltip: true
        },

        {
          prop: 'weight',
          label: '重量',
          align: 'center',
          width: '120',
          showOverflowTooltip: true
        },
        {
          prop: 'weightUnit',
          label: '重量单位',
          align: 'center',
          width: '120',
          showOverflowTooltip: true
        },
        {
          prop: 'disposalStatus',
          label: '处置状态',
          align: 'center',
          width: '120',
          showOverflowTooltip: true,
          formatter: (row, column, cellValue) => {
            return disposalStatustList[cellValue ? cellValue : 0];
          }
        },
        {
          prop: 'disposeType',
          label: '处置类型',
          align: 'center',
          width: '120',
          showOverflowTooltip: true,
          formatter: (row, column, cellValue) => {
            return this.disposeTypeMap[cellValue];
          }
        },
        {
          prop: 'qualityResults',
          label: '质检结果',
          align: 'center',
          width: '120',
          showOverflowTooltip: true,
          formatter: (row, column, cellValue) => {
            return qualityResultList[cellValue];
          }
        }
      ],
      tableColumns5: [
        {
          columnKey: 'index',
          label: '序号',
          type: 'index',
          width: 55,
          align: 'center',
          showOverflowTooltip: true,
          fixed: 'left'
        },
        {
          label: '样品编码',
          prop: 'sampleCode',
          width: '150',
          align: 'center',
          showOverflowTooltip: true
        },
        {
          prop: 'categoryCode',
          label: '物品编码',
          width: '150',
          align: 'center',
          showOverflowTooltip: true
        },
        {
          prop: 'categoryName',
          label: '物品名称',
          width: '150',
          align: 'center',
          showOverflowTooltip: true
        },
        {
          label: '规格',
          prop: 'specification',
          width: '120',
          align: 'center',
          showOverflowTooltip: true
        },
        {
          prop: 'brandNum',
          label: '牌号',
          align: 'center'
        },
        {
          prop: 'modelType',
          label: '型号',
          align: 'center',
          width: '120',
          showOverflowTooltip: true
        },
        {
          prop: 'batchNo',
          label: '批次号',
          align: 'center',
          width: '120',
          showOverflowTooltip: true
        },
        {
          prop: 'weight',
          label: '重量',
          align: 'center',
          width: '120',
          showOverflowTooltip: true
        },
        {
          prop: 'weightUnit',
          label: '重量单位',
          align: 'center',
          width: '120',
          showOverflowTooltip: true
        },
        {
          prop: 'engrave',
          label: '刻码',
          align: 'center'
        },
        { label: '计量数量', prop: 'measureQuantity', align: 'center' },
        { label: '计量单位', prop: 'measureUnit', align: 'center' },
        {
          prop: 'produceRoutingName',
          label: '工艺路线',
          align: 'center'
        },
        {
          prop: 'produceTaskName',
          label: '工序',
          align: 'center'
        },
        {
          prop: 'unqualifiedReason',
          label: '原因',
          align: 'center'
        },
        {
          prop: 'disposeTime',
          label: '处置时间',
          align: 'center',
          width: '180',
          showOverflowTooltip: true
        },
        {
          prop: 'disposalStatus',
          label: '处置状态',
          align: 'center',
          width: '120',
          showOverflowTooltip: true,
          formatter: (row, column, cellValue) => {
            return disposalStatustList[cellValue ? cellValue : 0];
          }
        },
        {
          prop: 'disposeType',
          label: '处置类型',
          align: 'center',
          width: '120',
          showOverflowTooltip: true,
          formatter: (_row) => {
            return this.disposeTypeMap[_row.disposeType];
          }
        }
      ]
    };
  }
};
