当前位置: 首页 > news >正文

table表格中使用el-popover 无效问题解决

实例只针对单个的按钮管用在表格里每一列都有el-popover相当于是v-for遍历了 所以我们在触发按钮的时候并不是单个的触发某一个 

主要执行 代码

  <el-popover placement="left" :ref="`popover-${scope.$index}`">   动态绑定了ref

关闭弹窗  执行deltaskList

  <el-table-column align="center" label="操作" fixed="right" width="300px">
          <!-- v-buttonShow="5010403" -->
          <template slot-scope="scope">

            <el-popover placement="left" :ref="`popover-${scope.$index}`">
              <div style="border-bottom: 1px solid #ebeef5; margin-bottom: 10px; padding-bottom: 6px">设置账期</div>
              <div style="display: flex; flex-direction: column">
                仅记录账期,并不会影响出账流程~
                <el-select
                  v-model="setAccountVal"
                  clearable
                  filterable
                  placeholder="请选择结算方式"
                  style="width: 260px; margin-top: 15px"
                  size="small"
                >
                  <el-option
                    v-for="(item, index) in paymentTermsList"
                    :key="index"
                    :label="item.name"
                    :value="item.value"
                  >
                  </el-option>
                </el-select>
              </div>
              <div style="text-align: right; margin: 0px; margin-top: 15px">
                <el-button type="text" @click="deltaskList(scope.$index)">取消 </el-button>
                <el-button size="small" type="primary" @click="popConfirmSub(scope.$index)">确定 </el-button>
              </div>
              <el-button
                style="margin-left: 10px"
                slot="reference"
                type="text"
                v-if="mode == '0'"
                @click="setAccountBtn(scope.row)"
                >设置账期</el-button
              >
            </el-popover>
          </template>
        </el-table-column>




    // 设置账期
    setAccountBtn (row, index) {
      let findItem = this.paymentTermsList.find((item) => item.name === row.paymentTerms)
      this.setAccountVal = findItem.value
      this.setAccountBtnRow = row
    },

    // 确定
    async popConfirmSub (index) {
      if (this.setAccountVal === '') return this.$message.error('请选择账期')
      await newFranchiseeCustomerPaymentTermsEdit({
        orgOwner: this.setAccountBtnRow.orgOwner,
        paymentTerms: this.setAccountVal
      })
      this.$message.success('操作成功')
      this.deltaskList(index)
      this.querySubmit(1)
    },

    // 取消
    deltaskList (index) {
      this.$refs[`popover-${index}`].doClose()
    }

http://www.dtcms.com/a/6032.html

相关文章:

  • 双括号初始化
  • 体元法--体积计算
  • Java多线程<三>常见的多线程设计模式
  • Eureka工作原理超详细讲解介绍
  • 【Java期末】学生成绩管理系统
  • 构建健康游戏环境:DFA算法在敏感词过滤的应用
  • 阿里云30个公共云地域、89个可用区、5个金融云和政务云地域
  • Android 实现 Slots 游戏旋转效果
  • 大华主动注册协议介绍
  • MAC 中多显示器的设置(Parallels Desktop)
  • Spring Boot日志配置
  • 2023年TIOBE指数TOP50的编程语言写“Hello World!”
  • 前缀和算法 -- 寻找数组的中心坐标
  • 杰发科技AC7840——EEPROM初探
  • Linux系统管理命令---- at 命令
  • 用贪心算法编程求解任务安排问题
  • 数据库中关于DML的理解
  • uni-app模版(扩展插件)
  • 炼丹学习笔记1---openPCDet训练配置参数含义介绍
  • Java单词排序
  • swift-碰到的问题
  • Github 2024-01-03 开源项目日报 Top10
  • 【Mybatis】深入学习MyBatis:高级特性与Spring整合
  • 【Pytorch】学习记录分享9——PyTorch新闻数据集文本分类任务实战
  • 【教学类-43-14】 20240103 (4宫格数独:正确版:576套) 不重复的基础模板数量:576套
  • 工作中redis相关知识总结
  • Javaweb之Mybatis的基础操作的详细解析
  • Docker安装Superset
  • CUMT--Java复习--核心类
  • 影子价格 Shadow Price