qushaowei
2023-08-30 fd019c06c025ff7871d77c679d2b61680daf0b4d
src/views/spare/modules/sparePartInventory/SparePart2List.vue
@@ -58,6 +58,15 @@
        @click="searchReset"
        icon="reload"
      >重置</a-button>
      <a-upload
        name="file"
        :showUploadList="false"
        :multiple="false"
        :headers="tokenHeader"
        :action="importExcelUrl"
        @change="handleImportExcel">
        <a-button type="primary" icon="import">导入</a-button>
      </a-upload>
    </div>
    <a-table
@@ -73,6 +82,7 @@
      @change="handleTableChange"
      :scroll="{ x: 'calc(1500px + 50%)', y: 900 }"
      :customRow="clickThenSelect"
      :rowClassName="tableRowClass"
    >
    </a-table>
@@ -178,25 +188,25 @@
          dataIndex: 'constructorId_dictText',
        },
        {
          title: '主单位',
          title: '单位',
          align: "center",
          dataIndex: 'mainUnitId_dictText',
        },
        {
      /*   {
          title: '辅单位',
          align: "center",
          dataIndex: 'auxiliaryUnitId_dictText',
        },
        }, */
        {
          title: '总主数量',
          title: '总数量',
          align: "center",
          dataIndex: 'totalMainQuantity',
        },
        {
       /*  {
          title: '总辅数量',
          align: "center",
          dataIndex: 'totalAuxiliaryQuantity',
        },
        }, */
        {
          title: '有效期',
          align: "center",
@@ -230,6 +240,7 @@
      ],
      url: {
        list: "/spare/sparePart/sparePartInventoryList",
        importExcelUrl:'/spare/SparesPartInventory/importExcel'
      },
      //新增、编辑、删除、批量删除操作改变数据后刷新关联的组件的监听属性
      alterFlag: "",
@@ -272,11 +283,13 @@
    //禁用状态样式
    tableRowClass(record, index) {
      if (record.status != "1") {
        return "frozenRowClass";
      }
      return "";
    },
        if (record.totalMainQuantity < record.inventoryLowerLimit) {
          return 'error'
        }else if(record.totalMainQuantity > record.inventoryUpperLimit){
          return 'yellow'
        }
      },
    searchReset() {
      this.queryParam = {};
      if (this.nodeSelected.key != -1) {
@@ -319,7 +332,7 @@
  }
}
</script>
<style>
<style  lang="less" >
@import '~@assets/less/common.less';
.frozenRowClass {
@@ -331,7 +344,16 @@
.error {
  color: red;
}
.yellow {
  color: yellow;
}
.fontweight {
  font-weight: bold;
}
.ant-table-tbody .red {
    background-color: red !important
  }
</style>