From 9ae5cf6edf1a2acb2a4283eaa35c0c3fa6f13eba Mon Sep 17 00:00:00 2001
From: wuyouming666 <2265557248@qq.com>
Date: 星期四, 18 七月 2024 10:19:06 +0800
Subject: [PATCH] 原片仓储任务查询

---
 UI-Project/src/views/GlassStorage/MaterialRackManagement.vue |  383 ++++++++++++++++++++++++++++++++----------------------
 1 files changed, 224 insertions(+), 159 deletions(-)

diff --git a/UI-Project/src/views/GlassStorage/MaterialRackManagement.vue b/UI-Project/src/views/GlassStorage/MaterialRackManagement.vue
index 830f6d8..421e064 100644
--- a/UI-Project/src/views/GlassStorage/MaterialRackManagement.vue
+++ b/UI-Project/src/views/GlassStorage/MaterialRackManagement.vue
@@ -5,8 +5,9 @@
 
 <!-- 宸︿晶鎸夐挳缁� -->
 <div >
+  <el-button type="success" size="mini"  @click="storage()">鍘熺墖浠撳偍璇︽儏</el-button>
   <el-button type="success" size="mini" @click="handleInbound()">鍏ュ簱</el-button>
-  <el-button type="success" size="mini" @click="handleInbound()">鍚婅浣嶅叆搴�</el-button>
+  <el-button type="success" size="mini" >鍚婅浣嶅叆搴�</el-button>
  
 </div>
 
@@ -20,9 +21,9 @@
 </el-form-item>
 
 </div>
-
+<el-dialog v-model="Hidden" top="10vh" width="80%"  >
       <el-table
-        :data="tableData"
+        :data="tableData" v-model="dialogVisible3"
        
         style="width: 98%; height: 200px"
         @selection-change="handleSelectionChange"
@@ -47,25 +48,39 @@
   min-width="80"
   prop="shelf_status"
 >
-  <template #default="scope">
-    <el-tag :type="getTagType(scope.row.shelf_status)">
-      {{ scope.row.shelf_status === 1 ? '鍚敤' : '鏈惎鐢�' }}
-    </el-tag>
-  </template>
+<template #default="scope">
+        <el-tag :type="getTagType(scope.row.shelf_status)" @click="toggleStatus(scope.row)">
+          {{ scope.row.shelf_status === 1 ? '鍚敤' : '鏈惎鐢�' }}
+        </el-tag>
+      </template>
 </el-table-column>
 
         <!-- 鎿嶄綔鍒� -->
-        <el-table-column label="鎿嶄綔" width="350">
+        <el-table-column label="鎿嶄綔" width="250">
           <template #default="{ row }">
             <el-button type="primary" size="mini" @click="edithandleRowClick(row)">淇敼</el-button>
             <el-button type="danger" size="mini" @click="handleDelete(row)">鍒犻櫎</el-button>
             <el-button type="warning" size="mini" @click="handleCheckout(row)">鍑哄簱</el-button>
-            <el-button type="success" size="mini" @click="addglass()">娣诲姞鍘熺墖</el-button>
+            <!-- <el-button type="success" size="mini" @click="addglass()">娣诲姞鍘熺墖</el-button> -->
           </template>
         </el-table-column>
-      </el-table>
 
-      <el-table
+        
+      </el-table>
+      <el-pagination
+        v-if="totalItems > 0"
+        background
+        layout="prev, pager, next"
+        :total="totalItems"
+        :page-size="pageSize"
+        @current-change="handleCurrentChange"
+      ></el-pagination>
+
+      
+  </el-dialog>
+
+
+  <el-table
     :data="tasktableData"
     style="width: 98%; height: 150px"
     @selection-change="handleSelectionChange"
@@ -104,16 +119,25 @@
     <el-table-column label="鎿嶄綔" width="350">
       <template #default="{ row }">
         <el-button type="primary" size="mini" @click="handleRestart(row)">閲嶆柊寮�濮�</el-button>
-        <el-button type="danger" size="mini" @click="handleDelete(row)">鍒犻櫎浠诲姟</el-button>
+        <el-button type="danger" size="mini" @click="handleDeletetask(row)">鍒犻櫎浠诲姟</el-button>
         <el-button type="success" size="mini" @click="handleComplete(row)">浠诲姟瀹屾垚</el-button>
       </template>
     </el-table-column>
   </el-table>
-
     </el-card>
 
-    <div ref="chart" id="chart" style="width: 100%; height: 250px;"></div>
- 
+
+
+
+   
+    <div class="img-ypcc" >
+
+
+      <div class="img-car1" :style="'z-index:999;left:397px;top:205px;position:absolute;'">
+      <div v-show="cellshow1" style="margin-top:10px;width:200px;height:5px;background-color:#409EFF;"></div>
+    </div>
+   
+    </div>
    
     <!-- 鍏ュ簱瀵硅瘽妗� -->
     <el-dialog
@@ -175,19 +199,19 @@
       </el-form-item>
 
       <el-form-item label="闀垮害">
-        <el-input v-model="formData.wid" required style="width: 250px; font-size: 20px" @focus="clearInput('wid')"></el-input>
+        <el-input v-model="formData.width" required style="width: 250px; font-size: 20px" @focus="clearInput('wid')"></el-input>
       </el-form-item>
 
       <el-form-item label="楂樺害">
-        <el-input v-model="formData.heig" required style="width: 250px; font-size: 20px" @focus="clearInput('heig')"></el-input>
+        <el-input v-model="formData.height" required style="width: 250px; font-size: 20px" @focus="clearInput('heig')"></el-input>
       </el-form-item>
 
       <el-form-item label="鍘氬害">
-        <el-input v-model="formData.thinkness" required style="width: 250px; font-size: 20px" @focus="clearInput('thinkness')"></el-input>
+        <el-input v-model="formData.thickness" required style="width: 250px; font-size: 20px" @focus="clearInput('thinkness')"></el-input>
       </el-form-item>
 
       <el-form-item label="鏁伴噺">
-        <el-input-number v-model="formData.num" required :min="0" :max="9000" style="width: 250px; font-size: 20px" @focus="clearInput('num')"></el-input-number>
+        <el-input-number v-model="formData.quantity" required :min="0" :max="9000" style="width: 250px; font-size: 20px" @focus="clearInput('num')"></el-input-number>
       </el-form-item>
     </el-form>
 
@@ -198,23 +222,31 @@
   </el-dialog>
 
   <el-dialog title="缂栬緫" v-model="editdialogVisible" width="30%" @close="edithandleDialogClose">
-      <el-form :model="editForm" ref="editForm" label-width="80px">
+      <el-form :model="editForm" ref="editFormRef" label-width="80px">
         <el-form-item label="鏁伴噺">
           <el-input v-model="editForm.quantity"></el-input>
         </el-form-item>
         <el-form-item label="鎵规鍙�">
           <el-input v-model="editForm.batchnumber"></el-input>
         </el-form-item>
+        <el-form-item label="闀垮害">
+          <el-input v-model="editForm.length"></el-input>
+        </el-form-item>
+        <el-form-item label="楂樺害">
+          <el-input v-model="editForm.height"></el-input>
+        </el-form-item>
+        <el-form-item label="鍘氬害">
+          <el-input v-model="editForm.thickness"></el-input>
+        </el-form-item>
       </el-form>
 
-      <div slot="footer" class="dialog-footer">
+      <div  class="dialog-footer">
         <el-button @click="editdialogVisible = false">鍙栨秷</el-button>
         <el-button type="primary" @click="editsaveEdit">淇濆瓨</el-button>
       </div>
     </el-dialog>
 
 
-    <!-- <div ref="chart" id="chart" style="width: 100%; height: 400px;"></div> -->
   </div>
 </template>
 
@@ -224,67 +256,26 @@
 <script setup>
 import { ref, onMounted, onBeforeUnmount } from 'vue'; // 瀵煎叆 Vue 3 鐨勬ā鍧�
 import * as echarts from 'echarts';
+import { ElMessage, ElMessageBox } from 'element-plus'
+import {tableData} from '@/stores/tableData.js';
+
 
 
     const loading = ref(false);
-    const tableData = ref([
-    {
-        location: '1',
-        type: 'Type A',
-        length: '100',
-        height: '50',
-        thickness: '10',
-        quantity: '5',
-        entry_time: '2024-06-19',
-        batchnumber:"444",
-        shelf_status: 1
-      },
-      {
-        location: '2',
-        type: 'Type B',
-        length: '120',
-        height: '60',
-        thickness: '12',
-        quantity: '10',
-        entry_time: '2024-06-18',
-        batchnumber:"444",
-        shelf_status: 0
-      },
-      {
-        location: '3',
-        type: 'Type B',
-        length: '120',
-        height: '60',
-        thickness: '12',
-        quantity: '10',
-        entry_time: '2024-06-18',
-        batchnumber:"444",
-        shelf_status: 1
-      },
-      {
-        location: '4',
-        type: 'Type B',
-        length: '120',
-        height: '60',
-        thickness: '12',
-        quantity: '10',
-        entry_time: '2024-06-18',
-        batchnumber:"444",
-        shelf_status: 1
-      },
-      {
-        location: '5',
-        type: 'Type B',
-        length: '120',
-        height: '60',
-        thickness: '12',
-        quantity: '10',
-        entry_time: '2024-06-18',
-        batchnumber:"444",
-        shelf_status: 1
-      }
-      // Add more data as needed
-    ]);
+   
+
+    const Hidden = ref(false)
+
+
+    const totalItems = ref(0);
+    totalItems.value = 10;
+    const pageSize = 10;
+    let currentPage = ref(1);
+    const handleCurrentChange = (val) => {
+
+      currentPage.value = val;
+      
+    };
 
    const getTagType2 =(status) => {
       switch (status) {
@@ -305,6 +296,12 @@
       return status === 1 ? 'success' : 'danger';
       // 鏍规嵁鐘舵�佸�煎喅瀹氭爣绛剧被鍨嬶紝杩欓噷鍋囪鐘舵�佷负1鏃朵负鎴愬姛锛堢豢鑹诧級锛屽惁鍒欎负澶辫触锛堢孩鑹诧級
     }
+
+    const toggleStatus = (row) => {
+      // 鍒囨崲鏂欐灦鐘舵�佺殑閫昏緫
+      row.shelf_status = 1 - row.shelf_status; // Toggle between 0 and 1
+      // 姝ゅ鍙互娣诲姞淇濆瓨鐘舵�佺殑閫昏緫锛屾瘮濡傝皟鐢� API 鏇存柊鏁版嵁
+    };
 
    const tasktableData=ref([
 
@@ -342,17 +339,48 @@
     });
 
    
+    const handleDelete = (row) => {
+  // 浣跨敤 Element UI 鐨� MessageBox.confirm 鏂规硶杩涜浜屾纭
+  ElMessageBox.confirm('纭畾瑕佹墽琛屽垹闄ゆ搷浣滃悧锛�', '纭鍒犻櫎', {
+    confirmButtonText: '纭',
+    cancelButtonText: '鍙栨秷',
+    type: 'warning',
+  }).then(() => {
+    // 鐐瑰嚮纭鎸夐挳鐨勫洖璋冿紝鎵ц鍑哄簱鎿嶄綔
+    console.log('鎵ц鍒犻櫎鎿嶄綔', row);
+  }).catch(() => {
+    // 鐐瑰嚮鍙栨秷鎸夐挳鐨勫洖璋冿紝涓嶆墽琛屼换浣曟搷浣�
+    console.log('鍙栨秷鍒犻櫎鎿嶄綔');
+  });
+};
 
     
     const handleCheckout = (row) => {
-      // 澶勭悊鍑哄簱閫昏緫
-      console.log('Checkout:', row);
-    };
+  // 浣跨敤 Element UI 鐨� MessageBox.confirm 鏂规硶杩涜浜屾纭
+  ElMessageBox.confirm('纭畾瑕佹墽琛屽嚭搴撴搷浣滃悧锛�', '纭鍑哄簱', {
+    confirmButtonText: '纭',
+    cancelButtonText: '鍙栨秷',
+    type: 'warning',
+  }).then(() => {
+    // 鐐瑰嚮纭鎸夐挳鐨勫洖璋冿紝鎵ц鍑哄簱鎿嶄綔
+    console.log('鎵ц鍑哄簱鎿嶄綔', row);
+  }).catch(() => {
+    // 鐐瑰嚮鍙栨秷鎸夐挳鐨勫洖璋冿紝涓嶆墽琛屼换浣曟搷浣�
+    console.log('鍙栨秷鍑哄簱鎿嶄綔');
+  });
+};
+
 
     const handleInbound = () => {
       // 鎵撳紑鍏ュ簱瀵硅瘽妗�
       dialogVisible.value = true;
     };
+
+    const storage = () => {
+      // 鎵撳紑鍏ュ簱瀵硅瘽妗�
+      Hidden.value = true;
+    };
+    
 
     const handleCloseDialog = () => {
       // 鍏抽棴瀵硅瘽妗嗘椂閲嶇疆琛ㄥ崟鏁版嵁
@@ -419,15 +447,23 @@
     const editdialogVisible = ref(false);
     const editForm = ref({
       quantity: '',
-      batchnumber: ''
+      batchnumber: '',
+      length:'',
+      height:'',
+      thickness:''
     });
+    const editFormRef = ref(null);
     let currentRow = ref(null);
 
     // 澶勭悊琛岀偣鍑讳簨浠�
     const edithandleRowClick = (row) => {
       currentRow.value = row;
-      editForm.value.quantity = row.quantity;
+      console.log(row)
+      editForm.value.quantity = row.quantity.toString();
       editForm.value.batchnumber = row.batchnumber;
+      editForm.value.length = row.length;
+      editForm.value.height = row.height;
+      editForm.value.thickness = row.thickness;
       editdialogVisible.value = true;
       console.log(editForm.value)
     };
@@ -448,89 +484,93 @@
     const edithandleDialogClose = () => {
       editForm.value.quantity = '';
       editForm.value.batchnumber = '';
+      editForm.value.width = '';
+      editForm.value.height = '';
+      editForm.value.thickness = '';
+  
+
       currentRow.value = null;
     };
 
 
-    let chartInstance = null;
 
-onMounted(() => {
-  // Initialize the chart
-  chartInstance = echarts.init(document.getElementById('chart'));
 
-  // Simulated data for demonstration
-  const chartData = {
-    labels: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'],
-    datasets: [
-      { name: '浣跨敤鎯呭喌缁熻', data: [{ remaining: 4, total: 5 }, { remaining: 9, total: 10 }, { remaining: 0, total: 30 }, { remaining: 0, total: 10 },{ remaining: 4, total: 5 }] }
-    ]
-  };
 
-  const options = {
-    tooltip: {
-      trigger: 'axis',
-      axisPointer: {
-        type: 'shadow'
-      }
-    },
-    legend: {
-      data: ['浣跨敤鎯呭喌缁熻']
-    },
-    xAxis: {
-      type: 'category',
-      data: chartData.labels
-    },
-    yAxis: {
-      type: 'value'
-    },
-    series: chartData.datasets.map(item => ({
-      name: item.name,
-      type: 'bar',
-      stack: '鎬婚噺',
-      label: {
-        show: true,
-        position: 'inside',
-        formatter: '{c}%'
-      },
-      data: item.data.map(dataItem => ({
-        value: (dataItem.remaining / dataItem.total * 100).toFixed(2), // 璁$畻鍓╀綑閲忓崰姣旓紝淇濈暀涓や綅灏忔暟
-        remaining: dataItem.remaining,
-        total: dataItem.total,
-        itemStyle: {
-          color: getColorByRemaining(dataItem.remaining, dataItem.total)
-        }
-      }))
-    }))
-  };
+    
 
-  function getColorByRemaining(remaining, total) {
-    // 鏍规嵁鍓╀綑閲忎笌鎬婚噺鐨勬瘮渚嬶紝璁剧疆涓嶅悓鐨勯鑹查�昏緫
-    const percentage = remaining / total;
-    if (percentage >= 0.8) {
-      return '#FF6666'; // Red
-    } else if (percentage >= 0.5) {
-      return '#FFCC66'; // Yellow
-    } else {
-      return '#66CC66'; // Green
-    }
-  }
 
-  // Set options and render chart
-  if (chartInstance) {
-    chartInstance.setOption(options);
-  }
-});
-
-onBeforeUnmount(() => {
-  if (chartInstance) {
-    chartInstance.dispose();
-    chartInstance = null;
-  }
-});
-
-const handleSelectionChange = (selection) => {
-  console.log('Selection changed:', selection);
+    const handleRestart = (row) => {
+  // 浣跨敤 Element UI 鐨� MessageBox.confirm 鏂规硶杩涜浜屾纭
+  ElMessageBox.confirm('纭畾瑕佹墽琛岄噸鏂板紑濮嬫搷浣滃悧锛�', '纭閲嶆柊寮�濮�', {
+    confirmButtonText: '纭',
+    cancelButtonText: '鍙栨秷',
+    type: 'warning',
+  }).then(() => {
+    // 鐐瑰嚮纭鎸夐挳鐨勫洖璋�
+    console.log('鎵ц閲嶆柊寮�濮嬫搷浣�', row);
+  }).catch(() => {
+    // 鐐瑰嚮鍙栨秷鎸夐挳鐨勫洖璋冿紝涓嶆墽琛屼换浣曟搷浣�
+    console.log('鍙栨秷閲嶆柊寮�濮嬫搷浣�');
+  });
 };
+
+
+const handleDeletetask = (row) => {
+  // 浣跨敤 Element UI 鐨� MessageBox.confirm 鏂规硶杩涜浜屾纭
+  ElMessageBox.confirm('纭畾瑕佹墽琛屽垹闄や换鍔℃搷浣滃悧锛�', '纭鍒犻櫎浠诲姟', {
+    confirmButtonText: '纭',
+    cancelButtonText: '鍙栨秷',
+    type: 'warning',
+  }).then(() => {
+    // 鐐瑰嚮纭鎸夐挳鐨勫洖璋�
+    console.log('鎵ц鍒犻櫎浠诲姟鎿嶄綔', row);
+  }).catch(() => {
+    // 鐐瑰嚮鍙栨秷鎸夐挳鐨勫洖璋冿紝涓嶆墽琛屼换浣曟搷浣�
+    console.log('鍙栨秷鍒犻櫎浠诲姟鎿嶄綔');
+  });
+};
+
+
+
+const handleComplete = (row) => {
+  // 浣跨敤 Element UI 鐨� MessageBox.confirm 鏂规硶杩涜浜屾纭
+  ElMessageBox.confirm('纭畾瑕佹墽琛屼换鍔″畬鎴愭搷浣滃悧锛�', '纭浠诲姟瀹屾垚', {
+    confirmButtonText: '纭',
+    cancelButtonText: '鍙栨秷',
+    type: 'warning',
+  }).then(() => {
+    // 鐐瑰嚮纭鎸夐挳鐨勫洖璋�
+    console.log('鎵ц浠诲姟瀹屾垚鎿嶄綔', row);
+  }).catch(() => {
+    // 鐐瑰嚮鍙栨秷鎸夐挳鐨勫洖璋冿紝涓嶆墽琛屼换浣曟搷浣�
+    console.log('鍙栨秷浠诲姟瀹屾垚鎿嶄綔');
+  });
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+
 
 </script>
 
@@ -550,7 +590,32 @@
 
 
 
+.img-ypcc{
+  margin-left: 80px;
+  background-image:url('../../assets/ypcc.png');
+  background-repeat: no-repeat;
+    background-attachment: local;
+    min-height: 600px;
+    width: 1400px;
+    max-width: 100%;
+    background-size: 1400px 600px;
+    overflow: hidden;
+    position:relative;
+    margin-top:0px
+}
 
+.img-car1{
+  background-image:url('../../assets/ypccche.png');
+  position: absolute;
+  background-repeat: no-repeat;
+    background-attachment: local;
+    min-height: 400px;
+    width: 200px;
+    max-width: 100%;
+    background-size: 200px 170px;
+    overflow: hidden;
+    position:relative
+}
 
 .custom-dialog {
   max-height: 90vh; /* 鏈�澶ч珮搴︿负瑙嗗彛楂樺害鐨�90% */

--
Gitblit v1.8.0