Kaynağa Gözat

Merge branch 'master' of https://git.steerinfo.com/DAL-DAZHOU/icore-pass

luobang 2 yıl önce
ebeveyn
işleme
5388b3dd50

+ 1 - 1
src/views/statisticalReport/components/salesLogisticsStatistics/saleSteelReports.vue

@@ -3078,7 +3078,7 @@ export default {
             that.pathOption.orderNumber = row.orderNo
             that.pathOption.capacityNumber = row.capacityNo
             that.pathOption.startPointName = '达钢集团小东门'
-            that.pathOption.endPointName = row.arrivalAddress
+            that.pathOption.endPointName = row.receiptAddress
             that.value7 = true
             if (row.orderStatus == '已完成') {
               that.pathOption.statusCode = '位置'

+ 257 - 0
src/views/statisticalReport/components/salesLogisticsStatistics/yawnReport.vue

@@ -0,0 +1,257 @@
+<template>
+  <!-- 万州港装船作业报表 -->
+  <div  style="width:100%;">
+    <div style="height:100%;width:100%">
+      <div  style="display:flex;margin: 10px;">
+        <!-- <el-input
+          placeholder="请输入"
+          v-model="map.input"
+          style="margin: 10px; width:10%"
+          clearable
+        ></el-input> -->
+       <el-date-picker style="margin: 10px;" v-model="map.startTime" type="datetime" placeholder="起始日期"></el-date-picker>
+      <el-date-picker style="margin: 10px;" v-model="map.endTime" type="datetime" placeholder="结束日期"></el-date-picker>
+        <el-button
+          type="primary"
+          class="btn"
+          @click="search"
+          style="margin: 10px;"
+        >
+          <i class="el-icon-search"></i>查询
+        </el-button>
+        <el-button
+          type="primary"
+          class="btn"
+          @click="exportToExcel('钢材欠运力报表.xlsx')"
+          style="margin: 10px;"
+        >
+          <i class="el-icon-download"></i>导出excel
+        </el-button>
+      </div>
+
+      <!-- 装车出库详情 -->
+      <div ref="yawnReport" style="width:100%;height:500px;float:left;margin-left:5px">
+        <div  style="height:500px;width:100%;overflow:scroll;">
+             <el-table
+          ref="yawnReportData"
+          highlight-current-row
+          border
+          fit
+          :data="yawnReportData"
+          :span-method="objectSpanMethod"
+          :row-style="{height:'40px'}"
+          style="width: 100%;font-size: 18px">
+          <el-table-column
+          align="center"
+            prop="target"
+            label="方向">
+          </el-table-column>
+          <el-table-column
+          align="center"
+            prop="carrierName"
+            label="承运商">
+          </el-table-column>
+          <el-table-column
+          align="center"
+            prop="planNum"
+            label="下达计划">
+          </el-table-column>
+          <el-table-column
+          align="center"
+            prop="quxiaoNum"
+            label="取消计划">
+          </el-table-column>
+          <el-table-column
+          align="center"
+            prop="orderNum"
+            label="已派计划">
+          </el-table-column>
+          <el-table-column
+          align="center"
+            prop="notSendNum"
+            label="未派车数">
+          </el-table-column>
+          <el-table-column
+          align="center"
+            prop="notEnNum"
+            label="未进厂数">
+          </el-table-column>
+          <el-table-column
+          align="center"
+            prop="EnNum"
+            label="进厂待装数">
+          </el-table-column>
+           <el-table-column
+          align="center"
+            prop="percent"
+            label="派车率">
+          </el-table-column>
+          <el-table-column
+          align="center"
+            prop="numGong"
+            label="工厂">
+          </el-table-column>
+          <el-table-column
+          align="center"
+            prop="numCang"
+            label="库房">
+          </el-table-column>
+        </el-table>
+        </div >
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import PageTitle from "@/components/Page/Title";
+import { sjTime } from "@/utils/sharedJsFile";
+import FileSaver from "file-saver";
+import BigNumber from "bignumber.js";
+export default {
+  components: { PageTitle },
+  data() {
+    return {
+        count:0,
+        yawnReportData:[],
+        map:{
+            input:"",
+            startTime:null,
+            endTime:null
+        },
+        spanArr: [], // 用于存放需要合并的行的个数
+        spanIndex: 0, // 记录spanArr数组的下标
+      
+    };
+  },
+  created(){
+    let endTime=new Date();
+    endTime.setHours(8);
+    endTime.setMinutes(0);
+    endTime.setSeconds(0);
+    let startTime=new Date(endTime.getTime()-1000*60*60*24);
+    this.map.startTime=startTime;
+    this.map.endTime=endTime;
+  },
+  mounted(){
+    this.search();
+  },
+  methods: {
+    //查询装车数据
+    search(){
+      //时间校验
+      if(this.map.startTime && this.map.endTime){
+        if(this.map.startTime>=this.map.endTime){
+            this.$message({
+                message:"结束日期必须大于起始日期!",
+                type:"warning",
+                duration:2000
+            });
+            return;
+        }
+        this.map.startTime=sjTime(this.map.startTime);
+        this.map.endTime=sjTime(this.map.endTime);
+      }else{
+        this.$message({
+            message:"起止日期错误!",
+            type:"warning",
+            duration:2000
+        });
+        return;
+      }
+      this.axios.post('/api/v1/tms/yawnReport',this.map).then((res)=>{
+        if(res.data.code == "200"){
+          this.getSpanArr(res.data.data);
+          this.yawnReportData=res.data.data;
+        }else {
+          this.$message({
+              type: "error", 
+              message: res.data.data,
+          });
+        }
+      })
+    },
+    //处理数据,得到合并数组
+    getSpanArr(data) {
+        this.spanArr=[];
+        for (let i = 0; i < data.length; i++) {
+            if (i == 0) {
+                this.spanArr.push(1);
+                this.spanIndex = 0;
+            } else {
+                // 判断当前行与前一行内容是否相同
+                if (data[i].target == data[i - 1].target) {
+                    this.spanArr[this.spanIndex] += 1; // 相同的话,当前下标所代表的值加一,例如:第一列的前三行可合并
+                    this.spanArr.push(0);// 记录完毕后,再往数组里添加一个元素0,作为下一次合并的初始值
+                } else {
+                    this.spanArr.push(1); // 否则,依旧是一行
+                    this.spanIndex = i;
+                }
+            }
+        }
+    },
+     //合并
+    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
+        if (columnIndex === 0) {
+            const _row = this.spanArr[rowIndex]; // 行数
+            const _col = _row > 0 ? 1 : 0; // 列数
+            return {
+                rowspan: _row,
+                colspan: _col
+            };
+        }
+    },
+    exportToExcel(tableTitle) {
+        let tables = this.$refs.yawnReport;
+        let table_book = XLSX.utils.table_to_book(tables);
+        var table_write = XLSX.write(table_book, {
+            bookType: "xlsx",
+            bookSST: true,
+            type: "array"
+        });
+        try {
+            FileSaver.saveAs(
+                new Blob([table_write], { type: "application/octet-stream" }),
+                tableTitle
+            );
+        } catch (e) {
+            if (typeof console !== "undefined") console.log(e, table_write);
+        }
+        return table_write;
+    },
+     getSummaries(param) {
+        console.log("param",param);
+        const { columns, data } = param;
+        const sums = [];
+        columns.forEach((column, index) => {
+          if (index === 0) {
+            sums[index] = '合计';
+            return;
+          }
+          if (index === 1 ) {
+            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 new BigNumber(prev).plus(curr).toNumber();
+              } else {
+                return prev;
+              }
+            }, 0);
+          } else {
+            sums[index] = '';
+          }
+        });
+        return sums;
+    },
+  },
+};
+</script>
+<style lang='scss'>
+
+</style>
+

+ 12 - 0
src/views/statisticalReport/router/index.js

@@ -87,6 +87,10 @@ const steelTransportReport = () =>
   import('../components/salesLogisticsStatistics/steelTransportReport.vue')
 Vue.use(Router)
 
+const yawnReport = () =>
+  import('../components/salesLogisticsStatistics/yawnReport.vue')
+Vue.use(Router)
+
 const constantRouterMap = [
   {
     path: '/',
@@ -339,6 +343,14 @@ const constantRouterMap = [
           code: 'xtpzgl-yhgl'
         },
         component: steelTransportReport
+      },
+      {
+        path: 'yawnReport',
+        name: 'yawnReport',
+        meta: {
+          code: 'xtpzgl-yhgl'
+        },
+        component: yawnReport
       }
     ]
   }