vue 弹窗 模板

html 复制代码
<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>
    
html 复制代码
      <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">

效果

html 复制代码
 onReturnDataByReceiptSelected(selected){}
     
相关推荐
计算机-秋大田9 分钟前
基于微信小程序的培训机构客户管理系统设计与实现(LW+源码+讲解)
java·vue.js·spring boot·后端·微信小程序·小程序·课程设计
NoneCoder26 分钟前
JavaScript系列(54)--性能优化技术详解
开发语言·javascript·性能优化
城沐小巷1 小时前
springboot+vue+uniapp的校园二手交易小程序
vue.js·spring boot·uni-app
软件工程师文艺2 小时前
Three.js实现3D动态心形与粒子背景的数学与代码映射解析
开发语言·javascript·3d
zimoyin2 小时前
Kotlin/Js Kotlin 编译为 JS (尝试)
开发语言·javascript·kotlin
计算机-秋大田2 小时前
基于微信小程序的居住证申报系统设计与实现(LW+源码+讲解)
java·vue.js·spring boot·后端·微信小程序·小程序·课程设计
小王不会写code3 小时前
vue项目搭建
vue.js
摘星小杨4 小时前
前端中map和foreach的相同和却别
开发语言·前端·javascript
计算机-秋大田12 小时前
基于微信小程序的私家车位共享系统设计与实现(LW+源码+讲解)
java·vue.js·spring boot·后端·微信小程序·小程序·课程设计