zx 3 years ago
parent
commit
d7e0ada1d8

+ 1 - 1
build/utils.js

@@ -19,8 +19,8 @@ const devPathSrc = path.resolve(__dirname, '../../../src'); // node_modules应
 // let devModules = ['index','appoint','sale','RMS','statisticalReport'];
 //let devModules = ['index','appoint','WMS'];
 // let devModules = ['index','statisticalReport']
+// let devModules = ['index','statisticalReport']
 let devModules = ['all']
-//let devModules = ['index','sale']
 // let devModules = ['index','SporadicManage','RMS','statisticalReport']
 // let devModules = ['index','inward','statisticalReport']
 //  let devModules = ['index','WMS','appoint','TMS','inward','statisticalReport','sale']

+ 4 - 6
src/views/statisticalReport/components/defendCapacity/getCapacityByDefend.vue

@@ -28,17 +28,15 @@
         :disabled="true"
         style="width: 100px"
       ></el-input>
-    </div>
-    <div
-      class="input_box"
-      style="width: 225px; margin-left: 30px; margin-top: 20px"
-    >
-      <el-input placeholder="请输入车牌号/出厂门岗" v-model="input" clearable>
+         <el-input placeholder="请输入车牌号/出厂门岗" v-model="input" style="width: 220px;margin-left: 1rem;" clearable>
       </el-input>
       <el-button type="primary" class="btn" @click="onclick">
         <i class="el-icon-search"></i>查询
       </el-button>
     </div>
+   
+   
+   
     <div class="table">
       <mergeRowTable
         ref="excelDom"

+ 173 - 0
src/views/statisticalReport/components/loadCapacityDetail/loadCapacityDetail.vue

@@ -0,0 +1,173 @@
+<template>
+  <!-- 装机计重明细查询 -->
+  <div class="loadCapacityDetail">
+    <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="onclickSearch">
+        <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="totalNumber" :disabled="true" style="width: 100px;"></el-input>
+      <span style="margin-left: 1rem;">合计车数:</span>
+      <el-input v-model="totalCapacity" :disabled="true" style="width: 100px;"></el-input>
+     
+       <el-input placeholder="请输入装机车牌号/可查询当天车辆数据" v-model="input" style="width: 220px;margin-left: 1rem;" clearable>
+      </el-input>
+         <el-button type="primary" class="btn" @click="onclickCapacity">
+        <i class="el-icon-search"></i>查询
+      </el-button>
+   
+    </div>
+    <div class="table">
+      <mergeRowTable ref="excelDom" v-bind.sync="option" @func="func"></mergeRowTable>
+    </div>
+  </div>
+</template>
+
+<script>
+import { sjTime } from "@/utils/sharedJsFile";
+import { getCookie } from "@/utils/util.js";
+export default {
+  data() {
+    return {
+      totalNumber: null,
+      totalCapacity: null,
+      startTime: null,
+      endTime: null,
+
+      input: "",
+      tableTitle: "装机计重明细报表",
+      option: {
+        // 表格请求数据的地址
+        requestUrl: "api/v1/tms/getLoaderForResultDetail?apiId=480",
+        comparison: "orderNumber",
+        columnIndexs: [0, 1, 2, 4, 5, 6],
+      },
+    };
+  },
+  created() {
+    if (
+      getCookie("orgCode") == "dagangadmin" ||
+      getCookie("orgCode") == "zidonghuabu"
+    ) {
+      this.option.requestUrl =
+        "/api/v1/tms/getLoaderForResultDetail?apiId=480&startTime=null&endTime=null&i=" +
+        new Date();
+    } else if (getCookie("orgCode") == "wuliuchuyunzhongxin") {
+      this.option.requestUrl =
+        "/api/v1/tms/getLoaderForResultDetail?apiId=480&orderType=13&startTime=null&endTime=null&i=" +
+        new Date();
+    } else {
+      this.option.requestUrl =
+        "/api/v1/tms/getLoaderForResultDetail?apiId=480&userId=" +
+        getCookie("orgCode") +
+        "&startTime=null&endTime=null&i=" +
+        new Date();
+    }
+  },
+  methods: {
+    func(res) {
+      console.log(res);
+      var resultNetWeightTotal = 0;
+      var currentCapacityTotal = 0;
+      res.list.forEach((e) => {
+        currentCapacityTotal++;
+        resultNetWeightTotal = resultNetWeightTotal + e.resultNetWeight;
+      });
+      this.totalNumber = resultNetWeightTotal.toFixed(2) + "t";
+      this.totalCapacity = currentCapacityTotal;
+    },
+    onclickCapacity() {
+      this.option.requestUrl =
+        "/api/v1/tms/getLoaderForResultDetail?apiId=480&con=" + this.input;
+    },
+    getRequestUrl() {
+      if (
+        getCookie("orgCode") == "dagangadmin" ||
+        getCookie("orgCode") == "zidonghuabu"
+      ) {
+        this.option.requestUrl =
+          "/api/v1/tms/getLoaderForResultDetail?apiId=480&startTime=null&endTime=null&i=" +
+          new Date();
+      } else if (getCookie("orgCode") == "wuliuchunyunzhongxin") {
+        this.option.requestUrl =
+          "/api/v1/tms/getLoaderForResultDetail?apiId=480&startTime=null&endTime=null&i=" +
+          new Date();
+      } else {
+        this.option.requestUrl =
+          "/api/v1/tms/getLoaderForResultDetail?apiId=480&userId=" +
+          getCookie("orgCode") +
+          "&startTime=null&endTime=null&i=" +
+          new Date();
+      }
+    },
+
+    // 添加开始结束时间筛选
+    onclickSearch() {
+      console.log("aaaa");
+      let startTime = null;
+      let endTime = null;
+      if (this.startTime) {
+        startTime = sjTime(this.startTime);
+        // console.log("startTime", startTime);
+      }
+      if (this.endTime) {
+        endTime = sjTime(this.endTime);
+        // console.log("endTime", endTime);
+      }
+      if (startTime && endTime) {
+        if (startTime < endTime) {
+          if (
+            getCookie("orgCode") == "dagangadmin" ||
+            getCookie("orgCode") == "zidonghuabu"
+          ) {
+            this.option.requestUrl =
+              "/api/v1/tms/getLoaderForResultDetail?apiId=480&startTime=" +
+              startTime +
+              "&endTime=" +
+              endTime +
+              "&i=" +
+              new Date();
+          } else if (getCookie("orgCode") == "wuliuchunyunzhongxin") {
+            this.option.requestUrl =
+              "/api/v1/tms/getLoaderForResultDetail?apiId=480&startTime=" +
+              startTime +
+              "&endTime=" +
+              endTime +
+              "&i=" +
+              new Date();
+          }
+        } else {
+          this.startTime = null;
+          this.endTime = null;
+          this.$message.warning("开始时间要比结束时间早");
+        }
+      } else {
+        this.getRequestUrl();
+      }
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.purchasFuelNewMonitor {
+  .frameCalculation {
+    width: 100%;
+    height: 100px;
+    display: flex;
+    align-items: center;
+    padding-left: 50px;
+    .el-date-editor {
+      margin: 20px;
+    }
+  }
+}
+</style>

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

@@ -27,6 +27,7 @@ import inwardSporadicReport from '../components/sporadicReport/inwardSporadicRep
 import getInstall from '../components/inwardReport/getInstall.vue'
 import getCapacityByDefend from '../components/defendCapacity/getCapacityByDefend.vue'
 import inwardAssemble from '../components/inwardAssemble/inwardAssemble.vue'
+import loadCapacityDetail from '../components/loadCapacityDetail/loadCapacityDetail.vue'
 Vue.use(Router)
 
 const constantRouterMap = [
@@ -57,7 +58,8 @@ const constantRouterMap = [
       {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: 'inwardAssemble', name: 'inwardAssemble', meta: {code: 'xtpzgl-yhgl'}, component: inwardAssemble}
+      {path: 'inwardAssemble', name: 'inwardAssemble', meta: {code: 'xtpzgl-yhgl'}, component: inwardAssemble},
+      {path: 'loadCapacityDetail', name: 'loadCapacityDetail', meta: {code: 'xtpzgl-yhgl'}, component: loadCapacityDetail}
     ]
   }
 ];