Quellcode durchsuchen

修改入库统计

胡半仙 vor 3 Jahren
Ursprung
Commit
4c1c6926f7

+ 2 - 2
build/utils.js

@@ -15,9 +15,9 @@ const devPathSrc = path.resolve(__dirname, '../../../src'); // node_modules应
 // ['index','appoint','configManager','homepage','inward','queue','RMS','sale','serviceManager','SporadicManage'
 //       统计报表       组织机构/系统管理 采购  仓储
 //  'statisticalReport','systemConfig','TMS','WMS','workFlow']
-let devModules = ['all']
+// let devModules = ['all']
 // let devModules = ['index','SporadicManage','TMS','statisticalReport','RMS'];
-// let devModules = ['index','appoint','TMS','WMS'];
+let devModules = ['index','appoint','TMS','WMS'];
 if (pathSrc.indexOf('node_modules') > -1) {
     devModules = require('../../../cors.js').devModules;
 }

+ 2 - 1
config/index.js

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

+ 55 - 12
src/views/WMS/components/steel/steel_inboundReal.vue

@@ -9,6 +9,7 @@
       <el-date-picker v-model="endTime" type="datetime" placeholder="选择日期">
       </el-date-picker>
       <el-select v-model="region" placeholder="请选择班次">
+        <el-option label="不选择班次" value="0"></el-option>
         <el-option label="早班" value="1"></el-option>
         <el-option label="中班" value="2"></el-option>
         <el-option label="晚班" value="3"></el-option>
@@ -43,7 +44,7 @@ export default {
       inputText:"",
       startTime: null,
       endTime: null,
-      region: '',
+      region: "0",
       options:{
         // first请求数据的地址
         requestUrl: "/api/v1/wms/getWmsInboundResults?apiId=371",
@@ -62,13 +63,51 @@ export default {
       
       // 判断用户有没有班次,有班次则提供默认时间
       if(this.region!=null){
-        // 获取当前的日期时间
-        let date = new Date();
-        let year = date.getFullYear(); // 年
-        let month = date.getMonth() + 1; // 月
-        let day = date.getDate(); // 日
+        let date =null;
+        let date2 =null;
+        let year = null;
+        let month =null;
+        let day = null;
+        let year2 = null;
+        let month2 =null;
+        let day2 = null;
+        // 判断当前日期输入框中是否选择了时间,并且开始日期和结束日期是否是同一天
+        if(this.startTime!=null){
+            date = this.startTime;
+            // 判断当前开始时间是标准时间还是字符串时间
+            
+           year = date.getFullYear(); // 年
+          month = date.getMonth() + 1; // 月
+          day = date.getDate(); // 日 
+        }
+        if(this.endTime!=null){
+           date2 = this.endTime;
+           year2 = date2.getFullYear(); // 年
+          month2 = date2.getMonth() + 1; // 月
+          day2 = date2.getDate(); // 日 // 日
+        }
+        if(this.startTime==null&&this.endTime==null){
+          // 获取当前的日期时间
+          date = new Date();
+          year = date.getFullYear(); // 年
+          month = date.getMonth() + 1; // 月
+          day = date.getDate(); // 日
+        }
+        // 判断开始日期和结束日期是否是同一天
+        if(!(year==year2&&month==month2&&day==day2)&&(this.startTime!=null||this.endTime!=null)&&this.region==null){
+          // 当不是同一天的时候,直接弹窗警告
+          this.startTime = null;
+          this.endTime = null;
+          this.$message.warning("开始日期和结束日期不是同一天");
+        }
         // 判断当前用户选择的具体班次
-        if(this.region == 1){
+        if(this.region == 0){
+          this.startTime = year+"-"+month+"-"+day+" "+"00:00:00";
+          // 将结束时间加一
+          day =parseInt(day) + 1;
+          this.endTime = year+"-"+month+"-"+day+" "+"00:00:00";
+          
+        }else if(this.region == 1){
           this.startTime = year+"-"+month+"-"+day+" "+"07:30:00";
           this.endTime = year+"-"+month+"-"+day+" "+"15:30:00";
         }else if(this.region == 2){
@@ -77,14 +116,18 @@ export default {
         }else if(this.region == 3){
           this.endTime = year+"-"+month+"-"+day+" "+"07:30:00";
           // 将开始时间减一
-          day =day-1;
+          day =parseInt(day)-1;
           this.startTime = year+"-"+month+"-"+day+" "+"23:30:00";
         }
+        this.startTime = new Date(this.startTime)
+        this.endTime = new Date(this.endTime)
+          console.log(this.startTime+"开始时间")
+          console.log(this.endTime+"结束时间")
         // 将拼接好的日期转换为时间戳
-        startTime = Date.parse(new Date(this.startTime))
-        endTime = Date.parse(new Date(this.endTime))
-        console.log(startTime)
-        console.log(endTime)
+        startTime = Date.parse(this.startTime)
+        endTime = Date.parse(this.endTime)
+        console.log(startTime+"开始时间2")
+        console.log(endTime+"结束时间2")
       }else{
         if (this.startTime) {
         startTime = sjTime(this.startTime);

+ 85 - 9
src/views/WMS/components/steel/steel_inboundStatistics.vue

@@ -1,4 +1,4 @@
-//入库
+//入库统计
 <template>
   <div class="steel_inbound">
     <div class="sache">
@@ -14,6 +14,12 @@
       <span>至</span>
       <el-date-picker v-model="endTime" type="datetime" placeholder="选择日期">
       </el-date-picker>
+      <el-select v-model="region" placeholder="请选择班次">
+        <el-option label="不选择班次" value="0"></el-option>
+        <el-option label="早班" value="1"></el-option>
+        <el-option label="中班" value="2"></el-option>
+        <el-option label="晚班" value="3"></el-option>
+      </el-select>
       <el-button type="primary" class="btn" @click="onclick">
         <i class="el-icon-search"></i>查询
       </el-button>
@@ -41,9 +47,10 @@ export default {
       inputText:"",
       startTime: null,
       endTime: null,
+      region: "0",
       options:{
         // first请求数据的地址
-        requestUrl: "/api/v1/wms/getWmsInboundResultStatistics?apiId=371&warehouseId="+3,
+        requestUrl: "/api/v1/wms/getWmsInboundResultStatistics?apiId=445&warehouseId="+3,
         // selectionType: "select",
         // mapList: [],
       },
@@ -57,20 +64,89 @@ export default {
 
       let startTime = null;
       let endTime = null;
-      if (this.startTime) {
+      // 判断用户有没有班次,有班次则提供默认时间
+      if(this.region!=null){
+        let date =null;
+        let date2 =null;
+        let year = null;
+        let month =null;
+        let day = null;
+        let year2 = null;
+        let month2 =null;
+        let day2 = null;
+        // 判断当前日期输入框中是否选择了时间,并且开始日期和结束日期是否是同一天
+        if(this.startTime!=null){
+            date = this.startTime;
+            // 判断当前开始时间是标准时间还是字符串时间
+            
+           year = date.getFullYear(); // 年
+          month = date.getMonth() + 1; // 月
+          day = date.getDate(); // 日 
+        }
+        if(this.endTime!=null){
+           date2 = this.endTime;
+           year2 = date2.getFullYear(); // 年
+          month2 = date2.getMonth() + 1; // 月
+          day2 = date2.getDate(); // 日 // 日
+        }
+        if(this.startTime==null&&this.endTime==null){
+          // 获取当前的日期时间
+          date = new Date();
+          year = date.getFullYear(); // 年
+          month = date.getMonth() + 1; // 月
+          day = date.getDate(); // 日
+        }
+        // 判断开始日期和结束日期是否是同一天
+        if(!(year==year2&&month==month2&&day==day2)&&(this.startTime!=null||this.endTime!=null)&&this.region==null){
+          // 当不是同一天的时候,直接弹窗警告
+          this.startTime = null;
+          this.endTime = null;
+          this.$message.warning("开始日期和结束日期不是同一天");
+        }
+        // 判断当前用户选择的具体班次
+        if(this.region == 0){
+          this.startTime = year+"-"+month+"-"+day+" "+"00:00:00";
+          // 将结束时间加一
+          day =parseInt(day) + 1;
+          this.endTime = year+"-"+month+"-"+day+" "+"00:00:00";
+          
+        }else if(this.region == 1){
+          this.startTime = year+"-"+month+"-"+day+" "+"07:30:00";
+          this.endTime = year+"-"+month+"-"+day+" "+"15:30:00";
+        }else if(this.region == 2){
+          this.startTime = year+"-"+month+"-"+day+" "+"15:30:00";
+          this.endTime = year+"-"+month+"-"+day+" "+"23:30:00";
+        }else if(this.region == 3){
+          this.endTime = year+"-"+month+"-"+day+" "+"07:30:00";
+          // 将开始时间减一
+          day =parseInt(day)-1;
+          this.startTime = year+"-"+month+"-"+day+" "+"23:30:00";
+        }
+        this.startTime = new Date(this.startTime)
+        this.endTime = new Date(this.endTime)
+          console.log(this.startTime+"开始时间")
+          console.log(this.endTime+"结束时间")
+        // 将拼接好的日期转换为时间戳
+        startTime = Date.parse(this.startTime)
+        endTime = Date.parse(this.endTime)
+        console.log(startTime+"开始时间2")
+        console.log(endTime+"结束时间2")
+      }else{
+        if (this.startTime) {
         startTime = sjTime(this.startTime);
-      }
-      if (this.endTime) {
-        endTime = sjTime(this.endTime);
+        }
+        if (this.endTime) {
+          endTime = sjTime(this.endTime);
+        }
       }
       if (startTime && endTime) {
         if (startTime < endTime) {
           if(getCookie("orgCode") == "dagangadmin" || getCookie("orgCode") == "zidonghuabu"){
-          this.options.requestUrl = "/api/v1/wms/getWmsInboundResultStatistics?apiId=371&warehouseId="+3+"&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date();
+          this.options.requestUrl = "/api/v1/wms/getWmsInboundResultStatistics?apiId=445&warehouseId="+3+"&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date();
           }else if(getCookie("orgCode") == "wuliuchuyunzhongxin"){
-          this.options.requestUrl = "/api/v1/wms/getWmsInboundResultStatistics?apiId=371&warehouseId="+3+"&orderType=13&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date(); 
+          this.options.requestUrl = "/api/v1/wms/getWmsInboundResultStatistics?apiId=445&warehouseId="+3+"&orderType=13&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date(); 
           }else{
-          this.options.requestUrl = '/api/v1/wms/getWmsInboundResultStatistics?apiId=371&warehouseId="+3+"&userId=' + getCookie("orgCode") +"&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date(); 
+          this.options.requestUrl = '/api/v1/wms/getWmsInboundResultStatistics?apiId=445&warehouseId="+3+"&userId=' + getCookie("orgCode") +"&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date(); 
           }
         } else {
           this.startTime = null;

+ 3 - 0
src/views/WMS/router/index.js

@@ -41,6 +41,8 @@ import steel_checkWarehouse from '../components/steel/checkWarehouse.vue'
 import steel_addCheckWarehouse from '../components/steel/addCheckWarehouse.vue'
 import addSteelInbound from '../components/steel/addSteelInbound.vue'
 import addSteelReserved from '../components/steel/addSteelReserved.vue'
+import steel_inboundStatistics from '../components/steel/steel_inboundStatistics.vue'
+
 Vue.use(Router)
 const constantRouterMap = [
 	{
@@ -86,6 +88,7 @@ const constantRouterMap = [
 		{path: 'steel_addCheckWarehouse', name: 'steel_addCheckWarehouse', meta: {code: 'xtpzgl-yhgl'}, component: steel_addCheckWarehouse},
 		{path: 'addSteelInbound', name: 'addSteelInbound', meta: {code: 'xtpzgl-yhgl'}, component: addSteelInbound},
 		{path: 'addSteelReserved', name: 'addSteelReserved', meta: {code: 'xtpzgl-yhgl'}, component: addSteelReserved},
+		{path: 'steel_inboundStatistics', name: 'steel_inboundStatistics', meta: {code: 'xtpzgl-yhgl'}, component: steel_inboundStatistics},
 	  ]
 	}
   ];