yangfeng
2023-08-22 68410e197705df3298fb92213e657ac9ff9ede97
src/components/makepager/CommonFormTableView.vue
@@ -46,7 +46,6 @@
                v-else-if="item.productName"
                label=" "
                :prop="'tableData.' + scope.$index + '.' + item.prop"
                :rules="[{ required: item.isRequird ? true : false, message: '产品名称不能为空' }]"
              >
                <div class="custom-name">
                  <el-autocomplete
@@ -130,7 +129,9 @@
      <el-button size="small" type="primary" @click="add">新增</el-button>
      <!-- <el-button size="small" type="primary" disabled>导入明细</el-button> -->
      <el-button size="small" type="primary" @click="empty">清空</el-button>
      <el-button size="small" type="primary" @click="recalculate">重算</el-button>
      <el-button size="small" type="primary" @click="recalculate" :disabled="isRecalculate ? false : true"
        >重算</el-button
      >
    </div>
    <div v-if="showSummary.total || showSummary.refundable" style="height: 42px; line-height: 42px">
      <el-row :gutter="10">
@@ -199,12 +200,18 @@
        title: "",
        infomation: {}
      },
      productIndex: 0
      productIndex: 0,
      isRecalculate: true
    }
  },
  created() {
    this.getProductList()
    this.tableList = this.productTableList
    if (this.tableList.tableData.length === 1 && this.tableList.tableData[0].name === "") {
      this.isRecalculate = false
    } else {
      this.isRecalculate = true
    }
  },
  computed: {},
  methods: {
@@ -256,7 +263,7 @@
          sums[index] = "小计:"
          return
        }
        const title = ["#"]
        const title = ["#", "产品名称"]
        // 去除某些不需要计算的数据
        if (title.includes(column.label)) {
          sums[index] = ""
@@ -323,6 +330,7 @@
    },
    // 清空
    empty() {
      this.isRecalculate = false
      this.$emit("emptyProductClick")
    },
    // 重算
@@ -334,6 +342,9 @@
      })
        .then(() => {
          this.$emit("recalculateProductClick")
          this.tableList.tableData.map((ite) => {
            ite.total = ite.amount ? ite.amount * ite.price : 1 * ite.price
          })
        })
        .catch(() => {})
    },
@@ -350,6 +361,7 @@
    },
    handleSelectClient(item, prop, row) {
      // this.clientId = item.id
      this.isRecalculate = true
      console.log(item, prop, row)
      this.tableList.tableData.map((ite) => {
        if (ite.name === item.name) {
@@ -369,6 +381,7 @@
    selClient(item) {
      console.log(item)
      console.log(this.tableList.tableData)
      this.isRecalculate = true
      // this.editConfig.infomation.client_name = row.name
      this.tableList.tableData.map((ite, index) => {
        if (index === this.productIndex) {