charles
2024-08-06 5ecb7958c96d3f0b6d47b79aff7eb306c2cf690f
src/components/makepager/TableCommonView.vue
@@ -102,6 +102,10 @@
export default {
  name: "TableCommonView",
  props: {
      warehouseId:{
        type:Number,
        default:0
      },
    tableList: {
      type: Object,
      default: () => {
@@ -219,12 +223,20 @@
    },
    // 单选行相关
    tableRowClassName({ row }) {
      if (Object.keys(this.selectClassRow).length > 0) {
        if (row.id == this.selectClassRow.id) {
          return "onSelect"
        if(this.$route.query.workType!=1){
            if(Object.keys(this.selectClassRow).length>0&&this.selectClassRow.location){
                if(this.selectClassRow.id==row.id&&this.selectClassRow.location.warehouseId==row.location.warehouseId&&row.location.name==this.selectClassRow.location.name){
                    return "onSelect";
                }
            }
        } else{
            if (Object.keys(this.selectClassRow).length > 0) {
                if (row.id == this.selectClassRow.id) {
                    return "onSelect"
                }
            }
        }
      }
      this.$emit("tableRowClassName", row)
      this.$emit("tableRowClassName", row);
    },
    timeAgo(val) {
      return timeago(val)
@@ -241,7 +253,7 @@
          }
          this.tableList.countcol.forEach((countcols) => {
            if (column.label === countcols) {
              const values = data.map((item) => Number(item[column.property]))
              const values = (data||[]).map((item) => Number(item[column.property]))
              if (!values.every((value) => isNaN(value))) {
                sums[index] = values.reduce((prev, curr) => {
                  const value = Number(curr)
@@ -269,11 +281,21 @@
      if(this.name=='product'){
        prop='productId'
      }
      let list = this.selectBoxList.map((item) => item[prop])
      if (list.findIndex((v) => v == row.id) == -1) {
        return true
      } else {
        return false
      if(this.$route.query.workType!=1){
         const flag= this.selectBoxList.some(item=>{
             if(item.location){
                 return item[prop]==row.id&&item.location.warehouseId==row.location.warehouseId&&item.location.name==row.location.name;
             }
            return false;
         })
          return !flag;
      }else{
          let list = (this.selectBoxList||[]).map((item) => item[prop])
          if (list.findIndex((v) => v == row.id) == -1) {
              return true
          } else {
              return false
          }
      }
    }
  }
@@ -413,6 +435,7 @@
  .el-table__cell.is-right {
    text-align: right !important;
  }
  .el-table::before{ width: 0px; }
}
.overSpread1 {
  width: 100%;