“linengliang”
2023-10-18 83830b509d3cce2dba0be3fdbc6f4db054b78d74
src/views/eam/modules/equipmentCalibrationOrder/EquipmentPrecisionParametersList.vue
@@ -1,16 +1,18 @@
<template>
  <a-card :bordered="false">
  <a-card :bordered="false" :class="'cust-erp-sub-tab'">
    <div>
      <a-table
        ref="table"
        size="middle"
        bordered
        size="middle"
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination=false
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange"
        class="j-table-force-nowrap"
        :scroll="{x:true}"
      >
        <!-- :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" -->
@@ -34,106 +36,98 @@
    Tooltip,
    JEllipsis,
  },
  props:{
    calibrationOrderId:{
        type:String,
        default:'',
        required:false
    }
  },
    watch:{
      calibrationOrderId:{
        immediate: true,
        handler(val) {
          if(!this.calibrationOrderId){
            this.clearList()
          }else{
            this.queryParam['calibrationOrderId'] = val;
            this.queryParam['delFlag'] = 0;
            this.loadData(1);
          }
        }
      }
    },
  data() {
    return {
      description: '精度参数',
      disableMixinCreated:true,
      ipagination:{
          current: 1,
          pageSize: 5,
          pageSizeOptions: ['5', '10', '50'],
          showTotal: (total, range) => {
            return range[0] + "-" + range[1] + " 共" + total + "条"
          },
          showQuickJumper: true,
          showSizeChanger: true,
          total: 0
      },
      // 表头
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 60,
          align: "center",
          customRender: function (t, r, index) {
            return parseInt(index) + 1;
          }
        },
        {
          title: '精度参数编码',
          dataIndex: 'num',
          align: "center",
        },
        {
          title: '精度参数名称',
          dataIndex: 'name',
          align: "center",
        },
        {
          title: '计量单位',
          dataIndex: 'unitName',
          align: "center",
        },
        {
          title: '上限值',
          dataIndex: 'upperLimit',
          align: "center",
        },
        {
          title: '下限值',
          dataIndex: 'lowerLimit',
          align: "center",
        },
        {
          title: '检定结果',
          dataIndex: 'calibrationItemResult',
          align: "center",
        },
        {
          title: '判定结果',
          dataIndex: 'judgmentResult',
          align: "center",
        },
          {
            title: '#',
            dataIndex:'sort',
            width:100,
            align:"center",
          },
          {
            title:'检验项目名称',
            align:"center",
            dataIndex: 'name',
            width:200
          },
          {
            title:'位置',
            align:"center",
            dataIndex: 'precisionParametersUda1',
            width:200
          },
          {
            title:'允差(mm)',
            align:"center",
            dataIndex: 'tolerance',
            width:200
          },
          {
            title:'实测值',
            align:"center",
            dataIndex: 'actualValue',
            width:200
          },
      ],
      url: {
        list: "/eam/calibrationOrderDetail/getCalibrationOrderDetailList",
        list: "/eam/calibrationOrder/listByMainId",
      },
      calibrationOrderId: '',
    }
  },
  watch: {
    calibrationOrderId() {
      this.queryParam = {};
      this.queryParam.calibrationOrderId = this.calibrationOrderId;
      this.loadData(1);
  methods: {
    clearList(){
        this.dataSource=[]
        this.selectedRowKeys=[]
        this.ipagination.current = 1
    },
  },
  methods: {
    loadData(arg) {
      if (!this.url.list) {
        this.$message.error("请设置url.list属性!")
        return
  computed: {
      importExcelUrl(){
        return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`;
      }
      if (arg === 1) {
        this.ipagination.current = 1;
      }
      var params = this.getQueryParams();//查询条件
      if (this.calibrationOrderId == '') {
        params.calibrationOrderId = '-1';
      }
      this.loading = true;
      getAction(this.url.list, params).then((res) => {
        if (res.success) {
          this.dataSource = res.result.records || res.result;
          if (res.result.total) {
            this.ipagination.total = res.result.total;
          } else {
            this.ipagination.total = 0;
          }
        } else {
          this.$message.warning(res.message)
        }
      }).finally(() => {
        this.loading = false
      })
    },
  },
}
</script>
<style scoped>
@import '~@assets/less/common.less';
/deep/ .frozenRowClass {
 .frozenRowClass {
  color: #c9c9c9;
}
.success {