Переглянути джерело

修复计划日期的选中时间

pm 8 місяців тому
батько
коміт
c836ed5d70

+ 10 - 0
src/api/mes/statisticians/index.js

@@ -59,3 +59,13 @@ export function getHomePage(query){
     params:query
   })
 }
+//物资盘点接口 /dev-api/iscs/statistics-api/getMaterialInventory
+export function getMaterialInventory(query){
+  return request({
+    url: '/iscs/statistics-api/getMaterialInventory',
+    method: 'get',
+    params:{
+      type:query
+    }
+  })
+}

+ 29 - 29
src/views/mes/material/inspectionplan/index.vue

@@ -591,35 +591,35 @@ export default {
         disabledDate(time) {
           return time.getTime() < Date.now() - 8.64e7
         },
-        shortcuts: [
-          {
-            text: '最近一周',
-            onClick(picker) {
-              const end = new Date()
-              const start = new Date()
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
-              picker.$emit('pick', [start, end])
-            }
-          },
-          {
-            text: '最近一个月',
-            onClick(picker) {
-              const end = new Date()
-              const start = new Date()
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
-              picker.$emit('pick', [start, end])
-            }
-          },
-          {
-            text: '最近三个月',
-            onClick(picker) {
-              const end = new Date()
-              const start = new Date()
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
-              picker.$emit('pick', [start, end])
-            }
-          }
-        ]
+        // shortcuts: [
+        //   {
+        //     text: '最近一周',
+        //     onClick(picker) {
+        //       const end = new Date()
+        //       const start = new Date()
+        //       start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
+        //       picker.$emit('pick', [start, end])
+        //     }
+        //   },
+        //   {
+        //     text: '最近一个月',
+        //     onClick(picker) {
+        //       const end = new Date()
+        //       const start = new Date()
+        //       start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
+        //       picker.$emit('pick', [start, end])
+        //     }
+        //   },
+        //   {
+        //     text: '最近三个月',
+        //     onClick(picker) {
+        //       const end = new Date()
+        //       const start = new Date()
+        //       start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
+        //       picker.$emit('pick', [start, end])
+        //     }
+        //   }
+        // ]
       },
       visibleSelect: false,//控制查询
       planDateOptions: null

+ 1 - 2
src/views/mes/material/instructions/index.vue

@@ -264,7 +264,6 @@
 
     </el-dialog>
 
-    <!--  说明上传-->
     <el-dialog
       :title="upload.title"
       :visible.sync="upload.open"
@@ -459,7 +458,7 @@ export default {
     },
     // 文件上传成功处理
     handleFileSuccess(response, file, fileList) {
-      // console.log(response,file, fileList,'文件上传成功回返')
+      console.log(response,file, fileList,'文件上传成功回返')
       this.form.fileUrl = response.url;
       this.upload.open = false;
       this.upload.isUploading = false;

+ 112 - 0
src/views/mes/material/inventory/index.vue

@@ -0,0 +1,112 @@
+<template>
+  <div>
+    <!-- Tab部分 使用 el-radio-group -->
+    <el-radio-group v-model="currentTab" style="margin: 5px">
+      <el-radio-button
+        v-for="tab in tabs"
+        :key="tab.dictValue"
+        :label="tab.dictValue">
+        {{ tab.dictLabel }}
+      </el-radio-button>
+    </el-radio-group>
+
+    <!-- 表格部分 -->
+    <div class="table-container">
+      <table>
+        <thead>
+        <tr>
+          <th>物资类型</th>
+          <th v-for="cabinet in cabinets" :key="cabinet.cabinetId">{{ cabinet.cabinetName }}</th>
+        </tr>
+        </thead>
+        <tbody>
+        <tr v-for="(materialType, index) in materialTypes" :key="index">
+          <td>
+            <img :src="materialType.materialsTypeIcon" alt="Material Icon" width="50" height="50" />
+            {{ materialType.materialsTypeName }}
+          </td>
+          <td v-for="cabinet in cabinets" :key="cabinet.cabinetId">
+            {{ getCellData(materialType.materialsTypeId, cabinet.cabinetId) }}
+          </td>
+        </tr>
+        </tbody>
+      </table>
+    </div>
+  </div>
+</template>
+
+<script>
+import { getMaterialInventory } from '@/api/mes/statisticians'
+import { getDicts } from '@/api/system/dict/data'
+
+export default {
+  dicts:["Inventory_type"],
+  data() {
+    return {
+      currentTab: '0', // 当前选中的Tab
+      tabs: [],
+      tableData:[],//各个物资柜数据
+    };
+  },
+  computed: {
+    cabinets() {
+      return this.tableData;
+    },
+    materialTypes() {
+      // 假设我们只取第一个物资柜的所有物资类型
+      if (this.tableData.length > 0) {
+        return this.tableData[0].materialsTypeVOList;
+      }
+      return [];
+    }
+  },
+  mounted() {
+
+    this.getList();
+  },
+  methods: {
+    getList(){
+      getDicts('Inventory_type').then((res) => {
+        this.tabs=res.data
+      })
+      getMaterialInventory(this.currentTab).then(response => {
+        console.log(response,'物资盘点');
+        this.tableData=response.data
+
+      })
+    },
+    getCellData(materialTypeId, cabinetId) {
+      const cabinet = this.tableData.find(c => c.cabinetId === cabinetId);
+      if (cabinet) {
+        const materialType = cabinet.materialsTypeVOList.find(m => m.materialsTypeId === materialTypeId);
+        if (materialType) {
+          return materialType.number;
+        }
+      }
+      return 0;
+    }
+  }
+};
+</script>
+
+<style scoped>
+.table-container {
+  width: 100%;
+  overflow-x: auto;
+}
+
+table {
+  width: 100%;
+  border-collapse: collapse;
+}
+
+th, td {
+  border: 1px solid #ddd;
+  padding: 8px;
+  text-align: left;
+}
+
+th {
+  background-color: #f2f2f2;
+}
+</style>