Преглед на файлове

修改拼装车统计报表

zx преди 3 години
родител
ревизия
939a78181e
променени са 3 файла, в които са добавени 105 реда и са изтрити 5 реда
  1. 2 3
      config/index.js
  2. 100 0
      src/views/statisticalReport/components/inwardAssemble/inwardAssemble.vue
  3. 3 2
      src/views/statisticalReport/router/index.js

+ 2 - 3
config/index.js

@@ -64,15 +64,14 @@ let proxyTable = {
   },
   // 所有数据的请求域名地址
   "/api/v1": {
-    target: "http://172.16.33.166:8080",
-    // target: "http://192.168.1.114:8019",
+    target: "http://localhost:8080",
     ws: true,
     pathRewrite: {
       "^/api/v1": "/api/v1"
     }
   },
   "/views/api/v1": {
-    target: "http://172.16.33.166:8080",
+    target: "http://localhost:8080",
     pathRewrite: {
       "^/views/api/v1": "/api/v1"
     }

+ 100 - 0
src/views/statisticalReport/components/inwardAssemble/inwardAssemble.vue

@@ -0,0 +1,100 @@
+<template>
+  <div class="purchasFuelNewMonitor">
+    <div class="frameCalculation">
+      <span>皮重时间:</span>
+      <el-date-picker
+        v-model="startTime"
+        type="datetime"
+        placeholder="选择日期"
+      >
+      </el-date-picker>
+      <span>至</span>
+      <el-date-picker
+        v-model="endTime"
+        type="datetime"
+        placeholder="选择日期"
+      >
+      </el-date-picker>
+      <el-button type="primary" class="btn" @click="onclick">
+        <i class="el-icon-search"></i>查询
+      </el-button>
+      <el-button type="primary" @click="exportData()"><i class="el-icon-download"></i>导出(Excel)</el-button>   
+      <span style="margin-left: 1rem;">合计车数:</span>
+      <el-input v-model="totalCapacity" :disabled="true" style="width: 100px;"></el-input>
+    </div>
+    <div class="table">
+      <dilTable ref="excelDom" v-bind.sync="option" @func="func"></dilTable>
+    </div>
+  </div>
+</template>
+
+<script>
+import { sjTime } from '@/utils/sharedJsFile';
+export default {
+  data() {
+    return {   
+      totalCapacity:null,
+      option: {
+        requestUrl: "",
+      },
+      startTime: null,
+      endTime: null,
+      tableTitle:'拼装车内转统计报表'
+    };
+  }, 
+  created(){
+          this.option.requestUrl = '/api/v1/tms/getInwardReportForAssemble?apiId=477&startTime=null&endTime=null&i=' +new Date()
+  },
+  methods: {
+    func(res){
+        // console.log(res.list)     
+        var currentCapacityTotal = 0
+        res.list.forEach(e => {
+          currentCapacityTotal = currentCapacityTotal+e.number       
+        });
+        this.totalCapacity = currentCapacityTotal;
+    },
+    getRequestUrl(){
+        this.option.requestUrl = '/api/v1/tms/getInwardReportForAssemble?apiId=477&startTime=null&endTime=null&i=' +new Date();
+     
+    },
+    onclick() {
+      let startTime = null;
+      let endTime = null;
+      if(this.startTime){
+        startTime = sjTime(this.startTime);
+      }
+      if(this.endTime){
+        endTime = sjTime(this.endTime);
+      }
+      if(startTime && endTime){
+        if(startTime < endTime){
+          this.option.requestUrl = '/api/v1/tms/getInwardReportForAssemble?apiId=477' + "&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date(); 
+        }else{
+          this.startTime = null;
+          this.endTime = null;
+          this.$message.warning('开始时间要比结束时间早')
+        }
+      }else{
+        console.log(startTime && endTime)
+        this.getRequestUrl()
+      }
+    },
+  },
+};
+</script>
+
+<style lang="scss">
+.purchasFuelNewMonitor {
+  .frameCalculation {
+    width: 100%;
+    height: 100px;
+    display: flex;
+    align-items: center;
+    padding-left: 50px;
+    .el-date-editor{
+      margin: 20px;
+    }
+  }
+}
+</style>

+ 3 - 2
src/views/statisticalReport/router/index.js

@@ -26,7 +26,7 @@ import purchaseMineral from '../components/purachaseMineral.vue'
 import inwardSporadicReport from '../components/sporadicReport/inwardSporadicReport.vue'
 import getInstall from '../components/inwardReport/getInstall.vue'
 import getCapacityByDefend from '../components/defendCapacity/getCapacityByDefend.vue'
-
+import inwardAssemble from '../components/inwardAssemble/inwardAssemble.vue'
 Vue.use(Router)
 
 const constantRouterMap = [
@@ -56,7 +56,8 @@ const constantRouterMap = [
       {path: 'purchaseMineral', name: 'purchaseMineral', meta: {code: 'xtpzgl-yhgl'}, component: purchaseMineral},
       {path: 'inwardSporadicReport', name: 'inwardSporadicReport', meta: {code: 'xtpzgl-yhgl'}, component: inwardSporadicReport},
       {path: 'getInstall', name: 'getInstall', meta: {code: 'xtpzgl-yhgl'}, component: getInstall},
-      {path: 'getCapacityByDefend', name: 'getCapacityByDefend', meta: {code: 'xtpzgl-yhgl'}, component: getCapacityByDefend}
+      {path: 'getCapacityByDefend', name: 'getCapacityByDefend', meta: {code: 'xtpzgl-yhgl'}, component: getCapacityByDefend},
+      {path: 'inwardAssemble', name: 'inwardAssemble', meta: {code: 'xtpzgl-yhgl'}, component: inwardAssemble}
     ]
   }
 ];