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

vue 弹窗 模板

<template>
    <el-dialog
      title="选择批号"
      :visible.sync="showFlag"
      width="800px"
      append-to-body
      :destroy-on-close="true"
      @open="handleOpen"
    >
      <el-form :model="queryParams" ref="queryForm" :inline="true">
        <el-form-item label="规格" prop="specs">
          <el-input v-model="queryParams.specs" placeholder="请输入规格" clearable size="small"/>
        </el-form-item>
    
        <el-form-item label="品名" prop="itemInfo_ItemName">
          <el-input v-model="queryParams.itemInfo_ItemName" placeholder="请输入料品名称" clearable size="small"/>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
          <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
        </el-form-item>
      </el-form>
  
      <el-table 
        v-loading="loading" 
        :data="binList" 
        @selection-change="handleSelectionChange"
        @row-dblclick="handleRowDbClick">
        <el-table-column type="selection" width="55" />
        <el-table-column label="行号" align="center" prop="docLineNo" />
        <el-table-column label="品名" align="center" prop="itemInfo_ItemName" />
        <el-table-column label="规格" align="center" prop="specs" />
        <el-table-column label="可退货数量" align="center" prop="applyQtyTU1" />
        <el-table-column label="批号" align="center" prop="lotInfo_LotCode" />
        <el-table-column label="番号" align="center" prop="seiBanCode" />
      </el-table>
  
      <pagination
        v-show="total>0"
        :total="total"
        :page.sync="queryParams.pageNum"
        :limit.sync="queryParams.pageSize"
        @pagination="getList"
      />
  
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="confirmSelect">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </template>
  
  <script>

  import {   getListReturnDataByReceipt3 } from "@/api/mes/xs/salesreturnreceipt";



  export default {
    name: "BinSelect",
    data() {
      return {
        docLineRemainingQty: new Map(),
        showFlag: false,
        loading: false,
        selectedRows: [],
        total: 0,
        binList: [],
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          docNo:null,
          itemInfo_ItemName: null, //料品名称
          specs:null, //规格
          // applyQtyTU1:null, //可退货数量
          // lotInfo_LotCode:null, //批号
          // seiBanCode:null, //番号
        }
      };
    },
    methods: {
      handleOpen() {
        console.log('Dialog opened, showFlag:', this.showFlag);
      },
      getList() {
        this.loading = true;
      
        getListReturnDataByReceipt3(this.queryParams).then(response => {
          this.binList = response.rows;
          this.binList.forEach(item => {
            const remainingQty = this.docLineRemainingQty.get(item.itemInfo_ItemCode) || 0;
            item.applyQtyTU1 = remainingQty; // Assign the remaining quantity to the item
          });
          console.log(this.binList);
          this.total = response.total;
          this.loading = false;
        });
      },
      handleQuery() {
        this.queryParams.pageNum = 1;
        this.getList();
      },
      resetQuery() {
        this.resetForm("queryForm");
        this.handleQuery();
      },
      handleSelectionChange(selection) {
        this.selectedRows = selection;
      },
      handleRowDbClick(row) {
        if (this.$refs.table) {
            this.$refs.table.toggleRowSelection(row);
        } else {
            console.error("表格引用未定义");
        }
      },
      confirmSelect() {
        if (this.selectedRows.length > 0) {
          this.$emit('onSelected', this.selectedRows);
          this.cancel();
        } else {
          this.$message.warning('请至少选择一条数据');
        }
      },
      cancel() {
        this.showFlag = false;
        this.selectedRows = [];
      }
    }
  };
  </script>
    
      <el-col :span="1.5">
            <el-button 
                type="primary" 
                icon="el-icon-plus" 
                size="mini" 
                @click="handleQueryReturnDataByReceipt"
                :disabled="!form.returnOrderId"
                v-hasPermi="['mes/xs:salesreturnreceipt:add']"
            >配件选择</el-button>
          </el-col>
          <ReturnDataByReceipt ref="ReturnDataByReceipt" @onSelected="onReturnDataByReceiptSelected" :size="'large'"></ReturnDataByReceipt>
         
          <el-col :span="1.5">

效果

 onReturnDataByReceiptSelected(selected){}
     


http://www.kler.cn/a/534364.html

相关文章:

  • 云原生周刊:K8s引领潮流
  • SpringBoot+SpringDataJPA项目中使用EntityManager执行复杂SQL
  • 力扣-哈希表-454 四数相加Ⅱ
  • DeepSeek+Ollama+AnythingLLM 本地部署完全指南,打造专属知识库
  • 每日Attention学习19——Convolutional Multi-Focal Attention
  • 数据结构之栈和队列(超详解)
  • 人工智能|本地部署|ollama+chatbox快速Windows10下部署(初级篇)
  • 深度剖析 Veo2 工具:解锁 AI 视频创作新境界
  • RabbitMQ 可靠性投递
  • 理解 C 与 C++ 中的 const 常量与数组大小的关系
  • 【C++】STL——list的使用
  • 【数据结构】链表应用1
  • java中反射(Reflection)的4个作用
  • [Python人工智能] 四十九.PyTorch入门 (4)利用基础模块构建神经网络并实现分类预测
  • 我的鸿蒙学习之旅:探索万物互联的新宇宙
  • 产品经理的人工智能课 02 - 自然语言处理
  • 穷举vs暴搜vs深搜vs回溯vs剪枝系列一>黄金矿工
  • 移动机器人规划控制入门与实践:基于navigation2 学习笔记(一)
  • 【Uniapp-Vue3】从uniCloud中获取数据
  • Vue全流程--Vue2组件的理解第二部分
  • Docker深度解析:Docker Compose
  • 巧用 DeepSeek,让 Excel 数据处理更高效
  • Springboot项目编写测试单元步骤
  • 北大AGI与具身智能评估新范式!Tong测试:基于动态具身物理和社会互动的评估标准
  • 【go语言】protobuf 和 grpc
  • mixin