Browse Source

修改预留作业

luobang 2 years ago
parent
commit
176afc48db

+ 48 - 0
src/components/DilCommonUI/packages/table/src/table.vue

@@ -21,6 +21,8 @@
       element-loading-spinner="el-icon-loading"
       :isHeigth="isHeigth"
       :shiyHeigth="shiyHeigth"
+      :summary-method="getSummaries"
+      :show-summary="isshowSummary"
     >
       <!-- 多选列 -->
       <el-table-column
@@ -124,6 +126,14 @@ export default {
     shiyHeigth: {
       default: null
     },
+    isshowSummary: {
+      default: false
+    },
+    showSummaryList: {
+      default() {
+        return [];
+      }
+    },
     isHeigth: {
       default: false
     },
@@ -266,6 +276,44 @@ export default {
     },
     toggleRowExpansion(row, expanded) {
       this.$refs.mainTable.toggleRowExpansion(row, expanded);
+    },
+    //合计
+    //表尾合计行
+    getSummaries(param) {
+      console.log(param);
+      const { columns, data } = param;
+      console.log("columns");
+      console.log(columns);
+      console.log("data");
+      console.log(data);
+      const sums = [];
+      columns.forEach((column, index) => {
+        //如果索引值为0,则展示‘合计’
+        if (index === 0) {
+          sums[index] = "合计";
+          return;
+        }
+        console.log(column);
+        if (this.showSummaryList.includes(column.property)) {
+          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";
+          }
+        }
+        //遍历数组,找到符合条件的列
+      });
+
+      return sums;
     }
   }
 };

+ 2 - 3
src/views/WMS/components/steel/bar1_steel/bar1_steel_inbound.vue

@@ -1,6 +1,6 @@
 //入库
 <template>
-  <div class="steel_inbound">
+  <div class="steel_inbound01">
     <div class="sache">
       <el-form :inline="true">
         <el-form-item>
@@ -26,7 +26,6 @@
         <el-form-item>
           <span class="text">物资类型</span>
           <el-autocomplete
-            class="inputStyle"
             v-model="inputText"
             :fetch-suggestions="querySearch"
             placeholder="请输入内容"
@@ -194,7 +193,7 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-.steel_inbound {
+.steel_inbound01 {
   .sache {
     margin-left: 20px;
     margin-top: 20px;

+ 122 - 97
src/views/WMS/components/steel/bar1_steel/bar1_steel_inboundStatistics.vue

@@ -3,7 +3,11 @@
   <div class="steel_inboundStatistics">
     <div class="sache">
       <span>入库时间:</span>
-      <el-date-picker v-model="startTime" type="datetime" placeholder="选择日期">
+      <el-date-picker
+        v-model="startTime"
+        type="datetime"
+        placeholder="选择日期"
+      >
       </el-date-picker>
       <span>至</span>
       <el-date-picker v-model="endTime" type="datetime" placeholder="选择日期">
@@ -17,18 +21,23 @@
       <el-button type="primary" class="btn" @click="onclick">
         <i class="el-icon-search"></i>查询
       </el-button>
-      <el-col :span="3" v-html="'\u2003'"/>
+      <el-col :span="3" v-html="'\u2003'" />
       <span>生产总件数</span>
       <el-input
         placeholder="请输入内容"
         v-model="input3"
-        :disabled="true" class="inputs" style="width:10%">
+        :disabled="true"
+        class="inputs"
+        style="width:10%"
+      >
       </el-input>
       <span>生产总重量</span>
       <el-input
         placeholder="请输入内容"
         v-model="input4"
-        :disabled="true" style="width:10%">
+        :disabled="true"
+        style="width:10%"
+      >
       </el-input>
     </div>
     <div class="table">
@@ -40,51 +49,51 @@
 
 <script>
 import { sjTime } from "@/utils/sharedJsFile";
-import { getCookie } from '@/utils/util.js';
+import { getCookie } from "@/utils/util.js";
 export default {
-  data(){
-    return{
-      rowClassName({row, rowIndex}) {
+  data() {
+    return {
+      rowClassName({ row, rowIndex }) {
         if (rowIndex === 0) {
-          return 'success-row';
+          return "success-row";
         }
-        return '';
+        return "";
       },
-      input1: '',
-      input2: '',
-      input3: '',
-      input4: '',
-      input5: '',
-      inputText:"",
+      input1: "",
+      input2: "",
+      input3: "",
+      input4: "",
+      input5: "",
+      inputText: "",
       startTime: null,
       endTime: null,
       region: "0",
-      options:{
+      options: {
         // first请求数据的地址
-        requestUrl: "/api/v1/wms/getWmsInboundResultStatistics?apiId=445&warehouseId="+1,
+        requestUrl:
+          "/api/v1/wms/getWmsInboundResultStatistics?apiId=445&warehouseId=" + 1
         // selectionType: "select",
         // mapList: [],
-      },
-    }
+      }
+    };
   },
-  created(){
-    console.log(this.options.data)
+  created() {
+    console.log(this.options.data);
   },
-  methods:{
-    func(res){
+  methods: {
+    func(res) {
       // console.log(res.list[0])
       // this.input1 = this.input1 + e.furnaceNumber1,
       let num1 = 0;
       let num2 = 0;
       res.list.forEach(e => {
-        console.log(e)
-        console.log(e.count)
-        console.log(e.weight)
-        num1 = num1 + e.count,
-        num2 = num2 + e.weight
+        console.log(e);
+        console.log(e.count);
+        console.log(e.weight);
+        (num1 = num1 + e.count), (num2 = num2 + e.weight);
       });
       this.input3 = num1;
-      this.input4 = num2;
+      this.input4 = (num2 / 1000).toFixed(3);
       // this.input1 = res.list[0].furnaceNumber1,
       // this.input2 = res.list[0].materialName,
       // this.input3 = res.list[0].count,
@@ -95,53 +104,60 @@ export default {
     //   	this.$router.push("/inboundDetails/" + scope.row.inboundId)
     // },
     // 获取当前月份的最后一天
-    getdaysinmonth(year,month){
-      month = parseInt(month,10)+1;
+    getdaysinmonth(year, month) {
+      month = parseInt(month, 10) + 1;
       let days = 0;
-      month = month -1;
-      console.log("othermonth"+month)
-      console.log("otheryear"+year);
+      month = month - 1;
+      console.log("othermonth" + month);
+      console.log("otheryear" + year);
       // 根据月份获取对应的天数
-      if(month == 2){
-        days = year % 4 == 0?29:28;
-      }else if(month == 1||month == 3||month == 5||month == 7||month == 8||month == 10||month == 12){
+      if (month == 2) {
+        days = year % 4 == 0 ? 29 : 28;
+      } else if (
+        month == 1 ||
+        month == 3 ||
+        month == 5 ||
+        month == 7 ||
+        month == 8 ||
+        month == 10 ||
+        month == 12
+      ) {
         days = 31;
-      }else{
+      } else {
         days = 30;
       }
-      console.log("otherdays"+days)
+      console.log("otherdays" + days);
       return days;
     },
-    onclick(){
-
+    onclick() {
       let startTime = null;
       let endTime = null;
       // 判断用户有没有班次,有班次则提供默认时间
-      if(this.region!=null){
-        let date =null;
-        let date2 =null;
+      if (this.region != null) {
+        let date = null;
+        let date2 = null;
         let year = null;
-        let month =null;
+        let month = null;
         let day = null;
         let year2 = null;
-        let month2 =null;
+        let month2 = null;
         let day2 = null;
         // 判断当前日期输入框中是否选择了时间,并且开始日期和结束日期是否是同一天
-        if(this.startTime!=null){
-            date = this.startTime;
-            // 判断当前开始时间是标准时间还是字符串时间
-            
-           year = date.getFullYear(); // 年
+        if (this.startTime != null) {
+          date = this.startTime;
+          // 判断当前开始时间是标准时间还是字符串时间
+
+          year = date.getFullYear(); // 年
           month = date.getMonth() + 1; // 月
-          day = date.getDate(); // 日 
+          day = date.getDate(); // 日
         }
-        if(this.endTime!=null){
-           date2 = this.endTime;
-           year2 = date2.getFullYear(); // 年
+        if (this.endTime != null) {
+          date2 = this.endTime;
+          year2 = date2.getFullYear(); // 年
           month2 = date2.getMonth() + 1; // 月
           day2 = date2.getDate(); // 日 // 日
         }
-        if(this.startTime==null&&this.endTime==null){
+        if (this.startTime == null && this.endTime == null) {
           // 获取当前的日期时间
           date = new Date();
           year = date.getFullYear(); // 年
@@ -149,50 +165,53 @@ export default {
           day = date.getDate(); // 日
         }
         // 判断开始日期和结束日期是否是同一天
-        if(!(year==year2&&month==month2&&day==day2)&&(this.startTime!=null||this.endTime!=null)&&this.region==null){
+        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";
+        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.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";
           // 判断开始日期和结束日期是否跨月份了
-          if(month!=month2){
-            month = parseInt(month)-1
+          if (month != month2) {
+            month = parseInt(month) - 1;
             // 获取前一个月份的最后一天
-            day = this.$options.methods.getdaysinmonth(year,month)
-          }else{
+            day = this.$options.methods.getdaysinmonth(year, month);
+          } else {
             // 将开始时间减一
-            day =parseInt(day)-1;
+            day = parseInt(day) - 1;
           }
-          this.startTime = year+"-"+month+"-"+day+" "+"23:30:00";
+          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+"结束时间")
+        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{
+        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);
+          startTime = sjTime(this.startTime);
         }
         if (this.endTime) {
           endTime = sjTime(this.endTime);
@@ -201,11 +220,19 @@ export default {
       if (startTime && endTime) {
         if (startTime < endTime) {
           // if(getCookie("orgCode") == "dagangadmin" || getCookie("orgCode") == "zidonghuabu"){
-          this.options.requestUrl = "/api/v1/wms/getWmsInboundResultStatistics?apiId=445&warehouseId="+1+"&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date();
+          this.options.requestUrl =
+            "/api/v1/wms/getWmsInboundResultStatistics?apiId=445&warehouseId=" +
+            1 +
+            "&startTime=" +
+            startTime +
+            "&endTime=" +
+            endTime +
+            "&i=" +
+            new Date();
           // }else if(getCookie("orgCode") == "wuliuchuyunzhongxin"){
-          // this.options.requestUrl = "/api/v1/wms/getWmsInboundResultStatistics?apiId=445&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=445&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;
@@ -213,19 +240,19 @@ export default {
           this.$message.warning("开始时间要比结束时间早");
         }
       } else {
-        this.getRequestUrl()
+        this.getRequestUrl();
       }
     },
     selectionChange(selection) {
       this.options.mapList = selection;
-    },
+    }
   }
-}
+};
 </script>
 
 <style lang="scss" scoped>
 .steel_inboundStatistics {
-  .sache{
+  .sache {
     height: 5rem;
     display: flex;
     align-items: center;
@@ -241,8 +268,6 @@ export default {
     display: flex;
     justify-content: center;
     align-items: center;
-
   }
 }
-
-</style>
+</style>

+ 8 - 2
src/views/WMS/components/steel/bar1_steel/inboundEas01.vue

@@ -16,7 +16,12 @@
       </el-button>
     </div>
     <div class="table">
-      <dilTable v-bind.sync="options" ref="table">
+      <dilTable
+        v-bind.sync="options"
+        ref="table"
+        :showSummaryList="showSummaryList"
+        :isshowSummary="true"
+      >
         <el-table-column label="操作" width="120px">
           <template slot-scope="scope">
             <el-button type="text" @click="crtlZ(scope.row)">撤销</el-button>
@@ -40,7 +45,8 @@ export default {
         requestUrl: "/api/v1/wms/getInboundEasInfo?apiId=510&warehouseId=" + 1
         // selectionType: "select",
         // mapList: [],
-      }
+      },
+      showSummaryList: ["theroticalWeight", "materialNum", "actuallyWeight"]
     };
   },
   methods: {

+ 2 - 3
src/views/WMS/components/steel/bar2_steel/bar2_steel_inbound.vue

@@ -1,6 +1,6 @@
 //入库
 <template>
-  <div class="steel_inbound">
+  <div class="steel_inbound02">
     <div class="sache">
       <el-form :inline="true">
         <el-form-item>
@@ -26,7 +26,6 @@
         <el-form-item>
           <span class="text">物资类型</span>
           <el-autocomplete
-            class="inputStyle"
             v-model="inputText"
             :fetch-suggestions="querySearch"
             placeholder="请输入内容"
@@ -186,7 +185,7 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-.steel_inbound {
+.steel_inbound02 {
   .sache {
     margin-left: 20px;
     margin-top: 20px;

+ 122 - 97
src/views/WMS/components/steel/bar2_steel/bar2_steel_inboundStatistics.vue

@@ -3,7 +3,11 @@
   <div class="steel_inboundStatistics">
     <div class="sache">
       <span>入库时间:</span>
-      <el-date-picker v-model="startTime" type="datetime" placeholder="选择日期">
+      <el-date-picker
+        v-model="startTime"
+        type="datetime"
+        placeholder="选择日期"
+      >
       </el-date-picker>
       <span>至</span>
       <el-date-picker v-model="endTime" type="datetime" placeholder="选择日期">
@@ -17,18 +21,23 @@
       <el-button type="primary" class="btn" @click="onclick">
         <i class="el-icon-search"></i>查询
       </el-button>
-      <el-col :span="3" v-html="'\u2003'"/>
+      <el-col :span="3" v-html="'\u2003'" />
       <span>生产总件数</span>
       <el-input
         placeholder="请输入内容"
         v-model="input3"
-        :disabled="true" class="inputs" style="width:10%">
+        :disabled="true"
+        class="inputs"
+        style="width:10%"
+      >
       </el-input>
       <span>生产总重量</span>
       <el-input
         placeholder="请输入内容"
         v-model="input4"
-        :disabled="true" style="width:10%">
+        :disabled="true"
+        style="width:10%"
+      >
       </el-input>
     </div>
     <div class="table">
@@ -40,51 +49,51 @@
 
 <script>
 import { sjTime } from "@/utils/sharedJsFile";
-import { getCookie } from '@/utils/util.js';
+import { getCookie } from "@/utils/util.js";
 export default {
-  data(){
-    return{
-      rowClassName({row, rowIndex}) {
+  data() {
+    return {
+      rowClassName({ row, rowIndex }) {
         if (rowIndex === 0) {
-          return 'success-row';
+          return "success-row";
         }
-        return '';
+        return "";
       },
-      input1: '',
-      input2: '',
-      input3: '',
-      input4: '',
-      input5: '',
-      inputText:"",
+      input1: "",
+      input2: "",
+      input3: "",
+      input4: "",
+      input5: "",
+      inputText: "",
       startTime: null,
       endTime: null,
       region: "0",
-      options:{
+      options: {
         // first请求数据的地址
-        requestUrl: "/api/v1/wms/getWmsInboundResultStatistics?apiId=445&warehouseId="+2,
+        requestUrl:
+          "/api/v1/wms/getWmsInboundResultStatistics?apiId=445&warehouseId=" + 2
         // selectionType: "select",
         // mapList: [],
-      },
-    }
+      }
+    };
   },
-  created(){
-    console.log(this.options.data)
+  created() {
+    console.log(this.options.data);
   },
-  methods:{
-    func(res){
+  methods: {
+    func(res) {
       // console.log(res.list[0])
       // this.input1 = this.input1 + e.furnaceNumber1,
       let num1 = 0;
       let num2 = 0;
       res.list.forEach(e => {
-        console.log(e)
-        console.log(e.count)
-        console.log(e.weight)
-        num1 = num1 + e.count,
-        num2 = num2 + e.weight
+        console.log(e);
+        console.log(e.count);
+        console.log(e.weight);
+        (num1 = num1 + e.count), (num2 = num2 + e.weight);
       });
       this.input3 = num1;
-      this.input4 = num2;
+      this.input4 = (num2 / 1000).toFixed(3);
       // this.input1 = res.list[0].furnaceNumber1,
       // this.input2 = res.list[0].materialName,
       // this.input3 = res.list[0].count,
@@ -95,53 +104,60 @@ export default {
     //   	this.$router.push("/inboundDetails/" + scope.row.inboundId)
     // },
     // 获取当前月份的最后一天
-    getdaysinmonth(year,month){
-      month = parseInt(month,10)+1;
+    getdaysinmonth(year, month) {
+      month = parseInt(month, 10) + 1;
       let days = 0;
-      month = month -1;
-      console.log("othermonth"+month)
-      console.log("otheryear"+year);
+      month = month - 1;
+      console.log("othermonth" + month);
+      console.log("otheryear" + year);
       // 根据月份获取对应的天数
-      if(month == 2){
-        days = year % 4 == 0?29:28;
-      }else if(month == 1||month == 3||month == 5||month == 7||month == 8||month == 10||month == 12){
+      if (month == 2) {
+        days = year % 4 == 0 ? 29 : 28;
+      } else if (
+        month == 1 ||
+        month == 3 ||
+        month == 5 ||
+        month == 7 ||
+        month == 8 ||
+        month == 10 ||
+        month == 12
+      ) {
         days = 31;
-      }else{
+      } else {
         days = 30;
       }
-      console.log("otherdays"+days)
+      console.log("otherdays" + days);
       return days;
     },
-    onclick(){
-
+    onclick() {
       let startTime = null;
       let endTime = null;
       // 判断用户有没有班次,有班次则提供默认时间
-      if(this.region!=null){
-        let date =null;
-        let date2 =null;
+      if (this.region != null) {
+        let date = null;
+        let date2 = null;
         let year = null;
-        let month =null;
+        let month = null;
         let day = null;
         let year2 = null;
-        let month2 =null;
+        let month2 = null;
         let day2 = null;
         // 判断当前日期输入框中是否选择了时间,并且开始日期和结束日期是否是同一天
-        if(this.startTime!=null){
-            date = this.startTime;
-            // 判断当前开始时间是标准时间还是字符串时间
-            
-           year = date.getFullYear(); // 年
+        if (this.startTime != null) {
+          date = this.startTime;
+          // 判断当前开始时间是标准时间还是字符串时间
+
+          year = date.getFullYear(); // 年
           month = date.getMonth() + 1; // 月
-          day = date.getDate(); // 日 
+          day = date.getDate(); // 日
         }
-        if(this.endTime!=null){
-           date2 = this.endTime;
-           year2 = date2.getFullYear(); // 年
+        if (this.endTime != null) {
+          date2 = this.endTime;
+          year2 = date2.getFullYear(); // 年
           month2 = date2.getMonth() + 1; // 月
           day2 = date2.getDate(); // 日 // 日
         }
-        if(this.startTime==null&&this.endTime==null){
+        if (this.startTime == null && this.endTime == null) {
           // 获取当前的日期时间
           date = new Date();
           year = date.getFullYear(); // 年
@@ -149,50 +165,53 @@ export default {
           day = date.getDate(); // 日
         }
         // 判断开始日期和结束日期是否是同一天
-        if(!(year==year2&&month==month2&&day==day2)&&(this.startTime!=null||this.endTime!=null)&&this.region==null){
+        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";
+        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.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";
           // 判断开始日期和结束日期是否跨月份了
-          if(month!=month2){
-            month = parseInt(month)-1
+          if (month != month2) {
+            month = parseInt(month) - 1;
             // 获取前一个月份的最后一天
-            day = this.$options.methods.getdaysinmonth(year,month)
-          }else{
+            day = this.$options.methods.getdaysinmonth(year, month);
+          } else {
             // 将开始时间减一
-            day =parseInt(day)-1;
+            day = parseInt(day) - 1;
           }
-          this.startTime = year+"-"+month+"-"+day+" "+"23:30:00";
+          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+"结束时间")
+        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{
+        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);
+          startTime = sjTime(this.startTime);
         }
         if (this.endTime) {
           endTime = sjTime(this.endTime);
@@ -201,11 +220,19 @@ export default {
       if (startTime && endTime) {
         if (startTime < endTime) {
           // if(getCookie("orgCode") == "dagangadmin" || getCookie("orgCode") == "zidonghuabu"){
-          this.options.requestUrl = "/api/v1/wms/getWmsInboundResultStatistics?apiId=445&warehouseId="+2+"&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date();
+          this.options.requestUrl =
+            "/api/v1/wms/getWmsInboundResultStatistics?apiId=445&warehouseId=" +
+            2 +
+            "&startTime=" +
+            startTime +
+            "&endTime=" +
+            endTime +
+            "&i=" +
+            new Date();
           // }else if(getCookie("orgCode") == "wuliuchuyunzhongxin"){
-          // this.options.requestUrl = "/api/v1/wms/getWmsInboundResultStatistics?apiId=445&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=445&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;
@@ -213,19 +240,19 @@ export default {
           this.$message.warning("开始时间要比结束时间早");
         }
       } else {
-        this.getRequestUrl()
+        this.getRequestUrl();
       }
     },
     selectionChange(selection) {
       this.options.mapList = selection;
-    },
+    }
   }
-}
+};
 </script>
 
 <style lang="scss" scoped>
 .steel_inboundStatistics {
-  .sache{
+  .sache {
     height: 5rem;
     display: flex;
     align-items: center;
@@ -241,8 +268,6 @@ export default {
     display: flex;
     justify-content: center;
     align-items: center;
-
   }
 }
-
-</style>
+</style>

+ 8 - 2
src/views/WMS/components/steel/bar2_steel/inboundEas02.vue

@@ -16,7 +16,12 @@
       </el-button>
     </div>
     <div class="table">
-      <dilTable v-bind.sync="options" ref="table">
+      <dilTable
+        v-bind.sync="options"
+        ref="table"
+        :showSummaryList="showSummaryList"
+        :isshowSummary="true"
+      >
         <el-table-column label="操作" width="120px">
           <template slot-scope="scope">
             <el-button type="text" @click="crtlZ(scope.row)">撤销</el-button>
@@ -40,7 +45,8 @@ export default {
         requestUrl: "/api/v1/wms/getInboundEasInfo?apiId=510&warehouseId=" + 2
         // selectionType: "select",
         // mapList: [],
-      }
+      },
+      showSummaryList: ["theroticalWeight", "materialNum", "actuallyWeight"]
     };
   },
   methods: {

+ 8 - 2
src/views/WMS/components/steel/inboundEas03.vue

@@ -16,7 +16,12 @@
       </el-button>
     </div>
     <div class="table">
-      <dilTable v-bind.sync="options" ref="table">
+      <dilTable
+        v-bind.sync="options"
+        ref="table"
+        :showSummaryList="showSummaryList"
+        :isshowSummary="true"
+      >
         <el-table-column label="操作" width="120px">
           <template slot-scope="scope"
             ><el-button type="text" @click="crtlZ(scope.row)"
@@ -42,7 +47,8 @@ export default {
         requestUrl: "/api/v1/wms/getInboundEasInfo?apiId=510&warehouseId=" + 3
         // selectionType: "select",
         // mapList: [],
-      }
+      },
+      showSummaryList: ["theroticalWeight", "materialNum", "actuallyWeight"]
     };
   },
   methods: {

+ 2 - 3
src/views/WMS/components/steel/steel_inbound.vue

@@ -1,6 +1,6 @@
 //入库转预留
 <template>
-  <div class="steel_inbound">
+  <div class="steel_inbound03">
     <div class="sache">
       <el-form :inline="true">
         <el-form-item>
@@ -26,7 +26,6 @@
         <el-form-item>
           <span class="text">物资类型</span>
           <el-autocomplete
-            class="inputStyle"
             v-model="inputText"
             :fetch-suggestions="querySearch"
             placeholder="请输入内容"
@@ -190,7 +189,7 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-.steel_inbound {
+.steel_inbound03 {
   .sache {
     margin-left: 20px;
     margin-top: 20px;

+ 145 - 118
src/views/WMS/components/steel/steel_inboundStatistics.vue

@@ -3,7 +3,11 @@
   <div class="steel_inboundStatistics">
     <div class="sache">
       <span class="text">入库时间:</span>
-      <el-date-picker v-model="startTime" type="datetime" placeholder="选择日期">
+      <el-date-picker
+        v-model="startTime"
+        type="datetime"
+        placeholder="选择日期"
+      >
       </el-date-picker>
       <span class="text1">至</span>
       <el-date-picker v-model="endTime" type="datetime" placeholder="选择日期">
@@ -17,18 +21,23 @@
       <el-button type="primary" class="btn" @click="onclick">
         <i class="el-icon-search"></i>查询
       </el-button>
-      <el-col :span="3" v-html="'\u2003'"/>
+      <el-col :span="3" v-html="'\u2003'" />
       <span class="text">生产总件数</span>
       <el-input
         placeholder="请输入内容"
         v-model="input3"
-        :disabled="true" class="inputs" style="width:10%">
+        :disabled="true"
+        class="inputs"
+        style="width:10%"
+      >
       </el-input>
       <span class="text">生产总重量</span>
       <el-input
         placeholder="请输入内容"
         v-model="input4"
-        :disabled="true" style="width:10%">
+        :disabled="true"
+        style="width:10%"
+      >
       </el-input>
     </div>
     <div class="table">
@@ -40,51 +49,52 @@
 
 <script>
 import { sjTime } from "@/utils/sharedJsFile";
-import { getCookie } from '@/utils/util.js';
+import { getCookie } from "@/utils/util.js";
 export default {
-  data(){
-    return{
-      rowClassName({row, rowIndex}) {
+  data() {
+    return {
+      rowClassName({ row, rowIndex }) {
         if (rowIndex === 0) {
-          return 'success-row';
+          return "success-row";
         }
-        return '';
+        return "";
       },
-      input1: '',
-      input2: '',
-      input3: '',
-      input4: '',
-      input5: '',
-      inputText:"",
+      input1: "",
+      input2: "",
+      input3: "",
+      input4: "",
+      input5: "",
+      inputText: "",
       startTime: null,
       endTime: null,
       region: "0",
-      options:{
+      options: {
         // first请求数据的地址
-        requestUrl: "/api/v1/wms/getWmsInboundResultStatistics?apiId=445&warehouseId="+3,
+        requestUrl:
+          "/api/v1/wms/getWmsInboundResultStatistics?apiId=445&warehouseId=" + 3
         // selectionType: "select",
         // mapList: [],
-      },
-    }
+      }
+    };
   },
-  created(){
-    console.log(this.options.data)
+  created() {
+    console.log(this.options.data);
   },
-  methods:{
-    func(res){
+  methods: {
+    func(res) {
       // console.log(res.list[0])
       // this.input1 = this.input1 + e.furnaceNumber1,
       let num1 = 0;
       let num2 = 0;
       res.list.forEach(e => {
-        console.log(e)
-        console.log(e.count)
-        console.log(e.weight)
-        num1 = num1 + e.count,
-        num2 = num2 + e.weight
+        console.log(e);
+        console.log(e.count);
+        console.log(e.weight);
+        num1 = num1 + e.count;
+        num2 = num2 + e.weight;
       });
       this.input3 = num1;
-      this.input4 = num2;
+      this.input4 = (num2 / 1000).toFixed(3);
       // this.input1 = res.list[0].furnaceNumber1,
       // this.input2 = res.list[0].materialName,
       // this.input3 = res.list[0].count,
@@ -95,53 +105,60 @@ export default {
     //   	this.$router.push("/inboundDetails/" + scope.row.inboundId)
     // },
     // 获取当前月份的最后一天
-    getdaysinmonth(year,month){
-      month = parseInt(month,10)+1;
+    getdaysinmonth(year, month) {
+      month = parseInt(month, 10) + 1;
       let days = 0;
-      month = month -1;
-      console.log("othermonth"+month)
-      console.log("otheryear"+year);
+      month = month - 1;
+      console.log("othermonth" + month);
+      console.log("otheryear" + year);
       // 根据月份获取对应的天数
-      if(month == 2){
-        days = year % 4 == 0?29:28;
-      }else if(month == 1||month == 3||month == 5||month == 7||month == 8||month == 10||month == 12){
+      if (month == 2) {
+        days = year % 4 == 0 ? 29 : 28;
+      } else if (
+        month == 1 ||
+        month == 3 ||
+        month == 5 ||
+        month == 7 ||
+        month == 8 ||
+        month == 10 ||
+        month == 12
+      ) {
         days = 31;
-      }else{
+      } else {
         days = 30;
       }
-      console.log("otherdays"+days)
+      console.log("otherdays" + days);
       return days;
     },
-    onclick(){
-
+    onclick() {
       let startTime = null;
       let endTime = null;
       // 判断用户有没有班次,有班次则提供默认时间
-      if(this.region!=null){
-        let date =null;
-        let date2 =null;
+      if (this.region != null) {
+        let date = null;
+        let date2 = null;
         let year = null;
-        let month =null;
+        let month = null;
         let day = null;
         let year2 = null;
-        let month2 =null;
+        let month2 = null;
         let day2 = null;
         // 判断当前日期输入框中是否选择了时间,并且开始日期和结束日期是否是同一天
-        if(this.startTime!=null){
-            date = this.startTime;
-            // 判断当前开始时间是标准时间还是字符串时间
-            
-           year = date.getFullYear(); // 年
+        if (this.startTime != null) {
+          date = this.startTime;
+          // 判断当前开始时间是标准时间还是字符串时间
+
+          year = date.getFullYear(); // 年
           month = date.getMonth() + 1; // 月
-          day = date.getDate(); // 日 
+          day = date.getDate(); // 日
         }
-        if(this.endTime!=null){
-           date2 = this.endTime;
-           year2 = date2.getFullYear(); // 年
+        if (this.endTime != null) {
+          date2 = this.endTime;
+          year2 = date2.getFullYear(); // 年
           month2 = date2.getMonth() + 1; // 月
           day2 = date2.getDate(); // 日 // 日
         }
-        if(this.startTime==null&&this.endTime==null){
+        if (this.startTime == null && this.endTime == null) {
           // 获取当前的日期时间
           date = new Date();
           year = date.getFullYear(); // 年
@@ -149,50 +166,53 @@ export default {
           day = date.getDate(); // 日
         }
         // 判断开始日期和结束日期是否是同一天
-        if(!(year==year2&&month==month2&&day==day2)&&(this.startTime!=null||this.endTime!=null)&&this.region==null){
+        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";
+        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.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";
           // 判断开始日期和结束日期是否跨月份了
-          if(month!=month2){
-            month = parseInt(month)-1
+          if (month != month2) {
+            month = parseInt(month) - 1;
             // 获取前一个月份的最后一天
-            day = this.$options.methods.getdaysinmonth(year,month)
-          }else{
+            day = this.$options.methods.getdaysinmonth(year, month);
+          } else {
             // 将开始时间减一
-            day =parseInt(day)-1;
+            day = parseInt(day) - 1;
           }
-          this.startTime = year+"-"+month+"-"+day+" "+"23:30:00";
+          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+"结束时间")
+        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{
+        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);
+          startTime = sjTime(this.startTime);
         }
         if (this.endTime) {
           endTime = sjTime(this.endTime);
@@ -201,11 +221,19 @@ export default {
       if (startTime && endTime) {
         if (startTime < endTime) {
           // if(getCookie("orgCode") == "dagangadmin" || getCookie("orgCode") == "zidonghuabu"){
-          this.options.requestUrl = "/api/v1/wms/getWmsInboundResultStatistics?apiId=445&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=445&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=445&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;
@@ -216,42 +244,41 @@ export default {
     },
     selectionChange(selection) {
       this.options.mapList = selection;
-    },
+    }
   }
-}
+};
 </script>
 
 <style lang="scss" scoped>
 .steel_inboundStatistics {
-    margin-top: 30px;
-    margin-left: 20px;
-    .sache{
-      display: flex;
-      margin-bottom: 10px;
-      padding-right: 10px;
-      .text {
-        text-align: left;
-        line-height: 40px;
-        width: 70px;
-      }
-      .text1 {
-        text-align: left;
-        line-height: 40px;
-      }
-      .el-date-editor {
-        margin-right: 5px;
-        margin-left: 5px;
-      }
-      .btn {
-        margin-left: 10px;
-      }
-      .el-select {
+  margin-top: 30px;
+  margin-left: 20px;
+  .sache {
+    display: flex;
+    margin-bottom: 10px;
+    padding-right: 10px;
+    .text {
+      text-align: left;
+      line-height: 40px;
+      width: 70px;
+    }
+    .text1 {
+      text-align: left;
+      line-height: 40px;
+    }
+    .el-date-editor {
+      margin-right: 5px;
+      margin-left: 5px;
+    }
+    .btn {
+      margin-left: 10px;
+    }
+    .el-select {
       width: 100%;
       .el-input__inner {
         width: 150px;
       }
     }
-    }
+  }
 }
-
-</style>
+</style>

+ 45 - 0
src/views/inward/components/truckOrder/purInwardTruckOrder.vue

@@ -134,6 +134,8 @@ export default {
       selectionList: [],
       //区别点击的是添加运力,还是修改
       index: null
+      // wssUrl: "wss:wl.dasteel.cn:32322/websocket/socketServer",
+      // actiones: { username: "湘M99999" } //传入后台的数据
     };
   },
   created() {
@@ -180,8 +182,51 @@ export default {
       this.dispatched.requestUrl =
         "/api/v1/ams/getPurRequirementList?apiId=431&requirementStatus=1&planStatus=3";
     }
+    // this.initWebSocket();
   },
   methods: {
+    //建立websocket连接
+    initWebSocket() {
+      //试图调用websocket
+      //初始化weosocket
+      const wssUrl = this.wssUrl;
+      this.websock = new WebSocket(wssUrl);
+      this.websock.onmessage = this.websocketonmessage;
+      this.websock.onopen = this.websocketonopen;
+      this.websock.onerror = this.websocketonerror;
+      // this.websock.onclose = this.websocketclose;
+    },
+    //发送数据
+    websocketonopen() {
+      this.websocketsend();
+    },
+    //接收数据
+    websocketonmessage(e) {
+      console.log("收到信息");
+      let data = e.data;
+      console.log(data);
+      let websocketKey = data.messageContent;
+      let userName = "湘M99999";
+      let message =
+        "{'messageContent': '" +
+        websocketKey +
+        ":" +
+        userName +
+        "','messageType':1,'receivePerson': 'app','sendPerson': 'self'}";
+      this.websocketsend(message);
+    },
+    //连接建立失败重连
+    websocketonerror() {
+      this.initWebSocket();
+    },
+    //发送数据
+    websocketsend(message) {
+      this.websock.send({ message, async success() {} });
+    },
+    //关闭连接
+    websocketclose(e) {
+      console.log("断开连接", e);
+    },
     continueDispatch(scope) {
       this.$router.push("/addPurInwardOrderCon/" + scope.row.planId);
     },