From 3d43ffa3152110b7823f9fa6320c08a6ae02358a Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周三, 10 9月 2025 11:15:40 +0800
Subject: [PATCH] 1、增加 堆垛机运行统计 2、增加po单空物料描述

---
 SiemensWarehouse/siemens2-site/src/views/stat/inventory/purchaseEmptyMaterialCode.vue |  308 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 308 insertions(+), 0 deletions(-)

diff --git a/SiemensWarehouse/siemens2-site/src/views/stat/inventory/purchaseEmptyMaterialCode.vue b/SiemensWarehouse/siemens2-site/src/views/stat/inventory/purchaseEmptyMaterialCode.vue
new file mode 100644
index 0000000..60cf044
--- /dev/null
+++ b/SiemensWarehouse/siemens2-site/src/views/stat/inventory/purchaseEmptyMaterialCode.vue
@@ -0,0 +1,308 @@
+锘�<template>
+  <!-- 闈㈠寘灞戝鑸尯 -->   
+  <div class="indexs">
+    <el-card>
+      <el-row>
+        <el-button type="success" plain @click="exportExcel" >瀵煎嚭Excel</el-button>
+        <el-input v-model="searchParam.PoCode" placeholder="PO鍗曞彿" class="search"></el-input>
+           <el-input v-model="searchParam.ProductName" placeholder="鐗╂枡鍚嶇О" class="search"></el-input>
+            <el-input v-model="searchParam.ItemNumber" placeholder="椤瑰彿" class="search"></el-input>
+            <el-date-picker
+            v-model="datatime"
+            size="large"
+            type="datetimerange"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            range-separator="鑷�"
+            start-placeholder="寮�濮嬫棩鏈�"
+            end-placeholder="缁撴潫鏃ユ湡"
+          >
+          </el-date-picker>
+            <el-button type="success" plain @click="find(1)" >鏌ヨ</el-button>
+             <el-button type="info" plain @click="reset" >閲嶇疆</el-button>
+      </el-row>
+      <!-- 鏄剧ず浜哄憳鍒楄〃 -->
+      <el-table ref= "table"  :max-height="tableHeight" :data="TakeStocklist" bottom= "10%" border stripe >
+        <el-table-column
+      type="selection"
+      width="55">
+    </el-table-column>
+        <el-table-column
+        label="搴忓彿"
+      type="index"
+      width="50">
+    </el-table-column>
+        <el-table-column label="PO鍗曞彿" prop="PoCode" width="200"></el-table-column>
+        <el-table-column label="鐗╂枡鍚嶇О" prop="ProductName" width="300" ></el-table-column>
+         <el-table-column label="椤瑰彿" prop="ItemNumber" width="300" ></el-table-column>
+        <el-table-column label="鏃堕棿" prop="CreateTime" width="170" :formatter="formatterDateTime" ></el-table-column>
+        <el-table-column label="澶囨敞" prop="Remark" width="120"></el-table-column>
+      </el-table>
+      <el-pagination
+        :current-page="queryInfo.pagenum"
+        :page-sizes="[5,10, 15, 20,50,100,1000,10000]"
+        :page-size="queryInfo.pagesize"
+        :total="total"
+        layout="total, sizes, prev, pager, next, jumper"
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+      >
+      </el-pagination>
+    </el-card>
+  
+  </div>
+</template>
+<script>
+import { parseTime,formatDate} from '@/utils'
+import { getThisWeekRange} from '@/utils/formatTime.js'
+
+export default {
+  data() {
+    return {
+      tableHeight:window.innerHeight-204,
+      searchParam: {
+        ProductName: null,
+        MaterialCode: null,
+        ItemNumber: null
+      },
+      queryInfo: {
+        // 褰撳墠椤�
+        pagenum: 1,
+        // 姣忛〉鏄剧ず澶氬皯鏉′俊鎭痵
+        pagesize: 10
+      },
+
+      TakeStocklist: [],
+      TakeStocklistAll: [],
+      total: 0,
+      datatime: '',
+      selectType: [
+        { value: '1', label: '鍑哄簱' }, { value: '2', label: '绉诲簱' }, { value: '3', label: '鏀惰揣' }, { value: '4', label: '鎸夊嚟璇侀��璐�' }],
+      selectTypeValue: '',
+      dialogFormVisible: false,
+      productList: [],
+      updateDate: null
+    }
+  },
+  created() {},
+  mounted() {
+    this.initTimeData();
+    this.find(1)
+  },
+  methods: {
+    initTimeData(){
+      this.datatime= '';
+      this.datatime= getThisWeekRange(30);//鍚敤浜�
+    },
+     // 鏃堕棿杞崲
+    formatterDateTime (row, column, cellValue, index) {
+      if (cellValue === null || cellValue === '') {
+        return ''
+      }
+      var NewDtime = new Date(cellValue)
+      return formatDate(NewDtime, 'yyyy-MM-dd hh:mm:ss')
+    },
+
+    // 鐩戝惉 pagesize 鏀瑰彉
+    handleSizeChange(newSizd) {
+      this.queryInfo.pagesize = newSizd
+      this.queryInfo.pagenum = 1
+      this.find(1)
+    },
+    // 鐩戝惉 椤电爜鍊兼敼鍙�
+    handleCurrentChange(newpage) {
+      this.queryInfo.pagenum = newpage
+
+      this.find(2)
+    },
+    userStatusChange(userinfo) {
+      console.log(userinfo)
+    },
+    getSummaries(param) {
+      const { columns, data } = param
+      const sums = []
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = '鍚堣'
+          return
+        }
+        if (index != 5) {
+          sums[index] = ''
+          return
+        }
+        const values = data.map(item => Number(item[column.property]))
+        if (!values.every(value => isNaN(value))) {
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr)
+            if (!isNaN(value)) {
+              return prev + curr
+            } else {
+              return prev
+            }
+          }, 0)
+          sums[index] += ' '
+        } else {
+          sums[index] = 'N/A'
+        }
+        sums[index] = Number(sums[index]).toFixed(2)
+      })
+
+      return sums
+    },
+    
+    formatJson(filterVal, jsonData) {
+      return jsonData.map(v =>
+        filterVal.map(j => {
+          if (j === 'CreateTime') {
+            return parseTime(v[j])
+          } 
+          else if (j === 'moveType') {
+            return this.setMoveTypeStr(v[j])
+          } 
+          else if (j === 'isFinish') {
+            return this.setIsFinishStr(v[j])
+          } else {
+            return v[j]
+          }
+        })
+      )
+    },
+    find(ischang = 1) {
+      if (ischang == 1) {
+        this.queryInfo.pagenum = 1
+      }
+      const url = '/api/task/queryPagePurchaseEmptyMaterialCode'
+      const params = {
+        search: this.searchParam,
+        queryInfo: this.queryInfo, //鍒嗛〉
+        positionTypeValue: this.selectTypeValue, //涓嬫媺妗嗙殑鍊�
+        datatime: this.datatime, //鏃ユ湡
+        alarmValue: 1
+      }
+      var callback = res => {
+        //debugger
+        if (res.result === true) {
+          res.data.forEach(item => {
+            item.moveType =this.setMoveTypeStr(item.moveType)
+             item.isFinish =this.setIsFinishStr(item.isFinish)
+          })
+
+          this.TakeStocklist = res.data
+          this.TakeStocklistAll = res.data2
+          this.total = res.countPrint
+        } else {
+          this.TakeStocklist = []
+          this.TakeStocklistAll = []
+          this.total = 0
+          return this.$message.success('褰撳墠鏉′欢 鏌ヤ笉鍒版暟鎹�!')
+        }
+      }
+      this.common.ajax(url, params, callback, true)
+    },
+    find_export(ischang = 1) {
+      if (ischang == 1) {
+        this.queryInfo.pagenum = 1
+      }
+      const url = '/api/task/queryPagePurchaseEmptyMaterialCode'
+      const params = {
+         IsLoadAllData:true,//鍔犺浇鍏ㄩ儴
+        search: this.searchParam,
+        queryInfo: this.queryInfo, //鍒嗛〉
+        positionTypeValue: this.selectTypeValue, //涓嬫媺妗嗙殑鍊�
+        datatime: this.datatime, //鏃ユ湡
+        alarmValue: 1
+      }
+      var callback = res => {
+        //debugger
+        if (res.result === true) {
+          res.data2.forEach(item => {
+            item.moveType =this.setMoveTypeStr(item.moveType)
+             item.isFinish =this.setIsFinishStr(item.isFinish)
+          })
+          this.TakeStocklistAll = res.data2
+          this.do_exportExcel()
+        } else {
+          this.TakeStocklistAll = []
+          return this.$message.success('褰撳墠鏉′欢 鏌ヤ笉鍒版暟鎹�!')
+        }
+      }
+      this.common.ajax(url, params, callback, true)
+    },
+    do_exportExcel() {
+      // import("@/vendor/Export2Excel")
+      this.downloadLoading = true
+      import('@/vendor/Export2Excel').then(excel => {
+        const tHeader = ['PO鍗曞彿', '鐗╂枡鍚嶇О', '椤瑰彿', '鏃堕棿','澶囨敞']
+        const filterVal = ['PoCode', 'ProductName', 'ItemNumber', 'CreateTime', 'Remark']
+        const data = this.formatJson(filterVal, this.TakeStocklistAll)
+        excel.export_json_to_excel({
+          header: tHeader,
+          data,
+          filename: 'PO鏄庣粏绌虹墿鏂欏彿淇℃伅'
+        })
+        this.downloadLoading = false
+      })
+    },
+      exportExcel() {
+      this.find_export(1)
+    },
+    setMoveTypeStr(moveType){
+        if (moveType === 1) return'鍑哄簱'
+        if (moveType === 2) return '绉诲簱'
+        if (moveType === 3) return '鏀惰揣'
+        if (moveType === 4) return '鎸夊嚟璇侀��璐�'
+        return ''
+    },
+    setIsFinishStr(isFinish){
+        if (isFinish === 1) {
+                return '宸插畬鎴�'               
+             }else{
+               return '鏈畬鎴�'
+             }
+    },
+    reset() {
+      this.searchParam.ProductName = null
+      this.searchParam.MaterialCode = null
+      this.searchParam.ItemNumber = null
+      this.selectTypeValue = ''
+      this.datatime = ''
+      this.initTimeData();//閲嶇疆鏃堕棿
+      this.find()
+    }
+  }
+}
+</script>
+<style lang="postcss" scoped>
+.el-table .el-pagination {
+  margin-top: 10px;
+  line-height: 30px;
+  margin-bottom: 0%;
+}
+.el-row {
+  text-align: left;
+}
+.selectValues {
+  width: 420px;
+}
+.search {
+  width: 200px;
+}
+.selectTypeValue {
+  width: 150px;
+}
+.el-card {
+  padding: 0%;
+  margin-bottom: 0%;
+    /* 84 = navbar + tags-view = 50 +34 */
+  max-height: calc(100vh - 104px);
+}
+thead .el-table-column--selection .cell {
+  display: none;
+}
+.el-scrollbar{
+    .el-scrollbar__bar.is-vertical {
+      opacity: 1;/* 鏀逛负0涓嶆樉绀烘粴鍔ㄦ潯*/
+      width:5;
+    }
+  }
+
+</style>

--
Gitblit v1.9.3