yangfeng
2023-09-06 29b5ffe318b8ab32865ebebedd865ea2aa3f6c7e
src/components/makepager/CommonFormTableView.vue
@@ -1,12 +1,20 @@
<template>
  <div class="page-view">
    <el-form ref="form" :model="tableList" :show-message="false" label-position="right"
    >
      <el-table :data="tableList.tableData" style="width: 100%"
    <el-form ref="form" :model="tableList" :show-message="false" label-position="right">
      <el-table
        :data="tableList.tableData"
        style="width: 100%"
      :show-summary="showSummary.show"
      :summary-method="getSummaries"
      :span-method="arraySpanMethod">
        <el-table-column type="index" v-if="tableList.tableColumn.length>0" label="编号" width="50" align="center"></el-table-column>
        :span-method="arraySpanMethod"
      >
        <el-table-column
          type="index"
          v-if="tableList.tableColumn.length > 0"
          label="编号"
          width="50"
          align="center"
        ></el-table-column>
        <el-table-column
          v-for="(item, i) in tableList.tableColumn"
          :key="i"
@@ -47,7 +55,7 @@
                  v-model="scope.row[item.prop]"
                  :fetch-suggestions="querySearchAsync"
                  value-key="name"
                  style='width:calc(100% - 70px)'
                  style="width: calc(100% - 70px)"
                  size="mini"
                  @select="
                    (val) => {
@@ -170,7 +178,7 @@
    },
    sign:{
      type:String,
      default:''
      default: ""
    },
    productTableList: {
      type: Object,
@@ -201,7 +209,7 @@
    recalculateShow: {
      type: [Boolean],
      defalut: true
    },
    }
  },
  data() {
    return {
@@ -229,7 +237,7 @@
  methods: {
    // 产品名称
    async getProductList() {
      let fn = this.sign == "purchase" ? getProductList : getProductListFromGrpc;
      let fn = this.sign == "purchase" ? getProductList : getProductListFromGrpc
      await fn({
        page: 1,
        pageSize: 100
@@ -298,7 +306,7 @@
        }
        if (column.property === "total") {
          this.total = sums[index]
          this.$emit('getSummaries',this.total)
          this.$emit("getSummaries", this.total)
        }
      })
      return sums
@@ -431,8 +439,7 @@
          }
        })
        
        console.log(this.tableList.tableData,'=====chanp')
        console.log(this.tableList.tableData, "=====chanp")
      }
    },
    // 清除已选择用户
@@ -464,12 +471,11 @@
    },
    deleteClient(row,scope){
      if(this.tableList.tableData.length==1){
        this.$message.error('至少保留一条,不能刪除了!')
        return true;
        this.$message.error("至少保留一条,不能刪除了!")
        return true
      }
      this.tableList.tableData.splice(scope.$index,1)
    },
    }
  }
}
</script>