Jelajahi Sumber

fix:存放位置可视化调整分页,关闭销毁组件

zhangjingyuan 2 tahun lalu
induk
melakukan
466c3032da

+ 6 - 5
src/views/component/weiZhiChangGui.vue

@@ -3,7 +3,7 @@
     <div @click="clickBtn" style="cursor: pointer;">
       <div>点击视图选择位置</div>
     </div>
-    <el-dialog title="仓库可视化" :visible.sync="ifshow" width="100%" :append-to-body="true" fullscreen center :lock-scroll="false"> 
+    <el-dialog title="仓库可视化" v-if="ifshow" :visible.sync="ifshow" width="100%" :append-to-body="true" :show-close ='false' fullscreen center :lock-scroll="false" :destroy-on-close="true"> 
       <div class="selectArea">
         <div @click="close" class="close-content">
           <i class="el-icon-close"></i>
@@ -62,7 +62,7 @@
                             <p>存放数量:{{ it.num || '/'}}</p>
                             <p>存放位置:{{ it.wei_zhi_ || it.cun_fang_wei_zhi_ }}</p>
                             <div style="text-align: left;">
-                              <div slot="footer" class="dialog-footer" style="width:100px;display: inline-block;vertical-align: top;" @click="chakan($event,it,)">详细信息查看</div>
+                              <div slot="footer" class="dialog-footer" style="display: inline-block;vertical-align: top;" @click="chakan($event,it,)"><i  class="el-icon-thumb"></i>点击查看详细信息</div>
                               <!-- <span style="width: 115px; display: inline-block; white-space: break-spaces;text-align: left;">{{ it.huo_hao_ || "空" }} </span> -->
                             </div>
                           </div>
@@ -76,7 +76,7 @@
           </div>
         </div>
       </div>
-      <el-dialog width="70%" :title="innertitle" :visible.sync="innerVisible"  :append-to-body="true"  @close="clossBack">
+      <el-dialog width="70%" :title="innertitle" :visible.sync="innerVisible"  :append-to-body="true"  @close="clossBack" :destroy-on-close="true">
         <div class="inner-dialog-content">
           <template>
             <el-table :data="tableData" border style="width: 100%;height: 70vh;overflow: hidden;" :show-overflow-tooltip="true">
@@ -232,6 +232,7 @@ export default {
     },
     close() {
       this.ifshow = false;
+      this.innerVisible = false
     },
     clossBack(){
       this.pageSize = 10;
@@ -636,7 +637,7 @@ p {
             cursor: pointer;
             // width: 170px;
             // height: 80px;
-            padding: 6px 12px;
+            padding: 10px 10px;
             border-radius: 5px;
             background: #e6a23c;
             margin-left: 12px;
@@ -665,7 +666,7 @@ p {
             .bottom-dsc {
               width: 100%;
               font-size: 18px;
-              height: 42px;
+              height: 18px;
               line-height: 60px;
               margin-top: 20px;
               // color: #fbe8ff;

+ 42 - 5
src/views/component/wuliaoPosition.vue

@@ -105,7 +105,7 @@
                             <p>存放数量:{{ it.num || '/'}}</p>
                             <p>存放位置:{{ it.wei_zhi_ || it.cun_fang_wei_zhi_ }}</p>
                             <div style="text-align: left;">
-                              <div slot="footer" class="dialog-footer" style="width:100px;display: inline-block;vertical-align: top;" @click="chakan($event,it)">详细信息查看</div>
+                              <div slot="footer" class="dialog-footer" style="display: inline-block;vertical-align: top;" @click="chakan($event,it)"><i class="el-icon-thumb"></i>点击查看详细信息</div>
                               <!-- <span style="width: 115px; display: inline-block; white-space: break-spaces;text-align: left;">{{ it.huo_hao_ || "空" }} </span> -->
                             </div>
                           </div>
@@ -147,7 +147,7 @@
           </div>
         </div>
       </div>
-      <el-dialog width="70%" :title="innertitle" :visible.sync="innerVisible" append-to-body>
+      <el-dialog width="70%" :title="innertitle" :visible.sync="innerVisible" append-to-body @close="clossBack">
         <div style="height: 70vh;padding: 20px;">
           <template>
             <el-table :data="tableData" border style="width: 100%">
@@ -176,6 +176,19 @@
               </el-table-column>
             </el-table>
           </template>
+          <template>
+            <div class="block">
+              <el-pagination
+              @size-change="handleSizeChange"
+              @current-change="handleCurrentChange"
+              :current-page="currentPage"
+              :page-sizes="[10, 15, 20]"
+              :page-size="pageSize"
+              layout="total, sizes, prev, pager, next, jumper"
+              :total="total">
+            </el-pagination>
+          </div>
+        </template>
         </div>
     </el-dialog>
     </div>
@@ -219,6 +232,11 @@ export default {
       tableData: [],
       innertitle:'',
       innerVisible: false,
+      currentPage: 1,
+      total: 0,
+      pageSize: 10,
+      currenEvent:'',
+      currentValue:''
     };
   },
   props: {
@@ -289,6 +307,10 @@ export default {
     close() {
       this.ifshow = !this.ifshow;
     },
+    clossBack(){
+      this.pageSize = 10;
+      this.currentPage =1;
+    },
     firstLoadQuyu(cang_ku) {
       let sqlString = `select distinct qu_yu_,cun_chu_tiao_jian from t_ck where cang_ku_ming_chen = '${cang_ku}' order by qu_yu_ asc`;
       var this_ = this;
@@ -484,16 +506,31 @@ export default {
         });
         return
       }
+      this.currenEvent = event;
+      this.currentValue = value;
       this.innerVisible = true;
       let cang_ku_ming_chen = this.formInline.cang_ku_ming_chen_value;
       this.innertitle = `${cang_ku_ming_chen} ${value.cun_fang_wei_zhi_}明细`
-      let sql = `select * from t_mjwlgl where cang_ku_ming_chen = '${cang_ku_ming_chen}'and cun_fang_wei_zhi_ = '${value.cun_fang_wei_zhi_}' and ku_cun_liang_ != '0'`;
+      let sql = `select * from t_mjwlgl where cang_ku_ming_chen = '${cang_ku_ming_chen}'and cun_fang_wei_zhi_ = '${value.cun_fang_wei_zhi_}' and ku_cun_liang_ != '0' limit ${(this.currentPage -1) * this.pageSize},${this.pageSize}`;
       let data = [];
       await curdPost("sql", sql).then((res) => {
         data = res.variables.data;
       });
+      this.total = value.num
       this.tableData = data
     },
+    handleSizeChange(val) {
+        console.log(`每页 ${val} 条`);
+        this.pageSize = val;
+        this.currentPage = 1;
+        this.chakan(this.currenEvent,this.currentValue)
+    },
+    handleCurrentChange(val) {
+      console.log(`当前页: ${val}`);
+      // this.pageSize = val;
+      this.currentPage = val;
+      this.chakan(this.currenEvent,this.currentValue)
+    }
   },
   watch: {
     //监控仓库名称变化 触发第一次加载数据
@@ -686,7 +723,7 @@ p {
               cursor: pointer;
               // width: 170px;
               // height: 80px;
-              padding: 6px 6px;
+              padding: 10px 10px;
               border-radius: 5px;
               // background: #e6a23c;
               margin-left: 12px;
@@ -715,7 +752,7 @@ p {
               .bottom-dsc {
                 width: 100%;
                 font-size: 18px;
-                height: 42px;
+                height: 18px;
                 line-height: 60px;
                 margin-top: 20px;
                 // color: #fbe8ff;