Przeglądaj źródła

Merge branch 'purchaseDev' of http://172.16.100.139/new-business/drp-web into purchaseDev

002390 1 rok temu
rodzic
commit
efc0dd33fe

+ 3 - 0
src/components/PopDialog/index.vue

@@ -36,6 +36,9 @@
               <el-table-column prop="model" header-align="center" align="center" sortable="custom" min-width="90"
                 label="型号">
               </el-table-column>
+              <el-table-column prop="manufacturerIdName" header-align="center" align="center" sortable="custom" min-width="90"
+                label="生产厂家">
+              </el-table-column>
             </el-table>
 
             <el-pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle"

+ 99 - 52
src/views/WMS/historical-route/index.vue

@@ -112,7 +112,6 @@
           width: "100%",
           height: "400px"
         }, //图表样式
-        position: [],
         //运输信息表单数据
         tableData1: [],
         //运输信息表单数据准备
@@ -136,7 +135,6 @@
           startTime: "",
           endTime: ""
         },
-        //线
         option: {},
         //表单各值
         maxT: 0,
@@ -152,13 +150,13 @@
     mounted() {
       //DOM初始化完成进行地图初始化
       this.initMap();
-      // this.initEcharts();
-      // this.windowSize();
     },
     created() {
       //把传参中的保温箱转换成数组
       this.carMessage = this.$route.query;
-      this.carMessage.boxCode = this.$route.query.boxCode.split(',');
+      if (this.carMessage.boxCode != null) {
+        this.carMessage.boxCode = this.$route.query.boxCode.split(',');
+      }
       //当结束时间为空时,默认为当前时间
       if (this.carMessage.endTime == '' || this.carMessage.endTime == null) {
         this.carMessage.endTime = this.formatDateTime(this.getCurrentTime(), 'yyyy-MM-dd HH:mm:ss');
@@ -167,10 +165,6 @@
       this.handleGeocodeRepo(this.carMessage);
     },
     methods: {
-      handleClick(tab, event) {
-        console.log(tab, event);
-        this.handleGeocodeRepo(this.carMessage);
-      },
       //通过传参查询数据
       handleGeocodeRepo(data) {
         historyApi.queryAddress(data).then(res => {
@@ -198,18 +192,24 @@
               }
             }
             console.log(latitudeLongitude, 'latitudeLongitude')
-            //车辆温度数组
+            //计算各值
+            this.calculate(res.data);
+            //对订单温湿度列表进行赋值
+            this.assignmentTable1(res.data);
+            //提取探头种类数量
+            let probeSum = [];
+            let probe = [];
             for (let i = 0; i < latitudeLongitude.length; i++) {
-              this.temperatureData.push(latitudeLongitude[i].temperature);
+              probeSum[i] = latitudeLongitude[i].measuringPointAddr;
             }
-            // console.log(path, 'path')
-            // console.log(this.temperatureData, 'temperatureData')
+            probe = Array.from(new Set(probeSum));
+            console.log(probe, 'probe');
+            //车辆温度数组
+            let c, d;
             this.initEcharts();
-            //筛选保温箱的数组
-            console.log(this.carMessage.boxCode, 'this.carMessage.boxCode')
-            for (let i = 0; i < this.carMessage.boxCode.length; i++) {
-              let boxForm = {
-                name: this.carMessage.boxCode[i],
+            for (let i = 0; i < probe.length; i++) {
+              let carForm = {
+                name: this.carMessage.plateNumber + '/' + probe[i],
                 data: [],
                 type: "line",
                 smooth: true,
@@ -222,36 +222,80 @@
                 },
               }
               // count = 0;
-              for (let j = 0; j < res.data.length; j++) {
-                if (boxForm.name == res.data[j].measuringPointName) {
-                  boxForm.data[j] = res.data[j].temperature;
+              for (let j = 0; j < latitudeLongitude.length; j++) {
+                if (carForm.name.indexOf(latitudeLongitude[j].measuringPointAddr) != -1) {
+                  c = latitudeLongitude[j].hisDate;
+                  d = latitudeLongitude[j].temperature;
+                  carForm.data.push([c, d]);
                 }
               }
-              this.option.series.push(boxForm);
-              this.option.legend.data.push(boxForm.name);
+              this.option.series.push(carForm);
+              this.option.legend.data.push(carForm.name);
+              console.log(this.option.series, 'this.option.series');
             }
-            //计算各值
-            this.calculate(res.data);
-            //对订单温湿度列表进行赋值
-            this.assignmentTable1(res.data);
+            // console.log(path, 'path')
+            console.log(this.temperatureData, 'temperatureData')
+            //筛选保温箱的数组
+            console.log(this.carMessage.boxCode, 'this.carMessage.boxCode')
+            if (this.carMessage.boxCode != null) {
+              let e, f;
+              for (let i = 0; i < this.carMessage.boxCode.length; i++) {
+                let boxForm = {
+                  name: this.carMessage.boxCode[i],
+                  data: [],
+                  type: "line",
+                  smooth: true,
+                  label: {
+                    show: true,
+                    position: "top",
+                    textStyle: {
+                      fontSize: 12
+                    }
+                  },
+                }
+                // count = 0;
+                for (let j = 0; j < res.data.length; j++) {
+                  if (boxForm.name == res.data[j].measuringPointName) {
+                    e = res.data[j].hisDate;
+                    f = res.data[j].temperature;
+                    boxForm.data.push([e, f]);
+                  }
+                }
+                this.option.series.push(boxForm);
+                this.option.legend.data.push(boxForm.name);
+                console.log(this.option.series, 'this.option.series');
+              }
+            }
+            // 如果车辆温度数组为空,则其它数组前移一位
+            for (;;) {
+              if (this.option.series[0].data.length == 0) {
+                for (let i = 0; i < this.option.series.length - 1; i++) {
+                  this.option.series[i] = this.option.series[i + 1];
+                  this.option.legend.data[i] = this.option.legend.data[i + 1];
+                }
+                this.option.series[this.option.series.length - 1] = '';
+                this.option.legend.data[this.option.series.length - 1] = '';
+              }
+              if (this.option.series[0].data.length != 0) {
+                break;
+              }
+            }
+            console.log(this.option, 'this.option');
+            this.windowSize();
             //对基础数据进行赋值
             this.basicData.billCode = this.carMessage.billCode;
             this.basicData.plateNumber = this.carMessage.plateNumber;
             this.basicData.startTime = res.data[0].hisDate;
             this.basicData.endTime = res.data[res.data.length - 1].hisDate;
             //基本地图加载
-            var map, route;
-            map = new AMap.Map("container", {
-              resizeEnable: true
-            });
-            map.plugin("AMap.DragRoute", function () {
-              route = new AMap.DragRoute(map, path, AMap.DrivingPolicy.LEAST_FEE); //构造拖拽导航类
-              route.search(); //查询导航路径并开启拖拽导航
-            });
-            this.windowSize();
+            this.loadMap(path);
           }
         })
       },
+      handleClick(tab, event) {
+        console.log(tab, event);
+        this.handleGeocodeRepo(this.carMessage);
+      },
       //地图初始化
       initMap() {
         AMapLoader.load({
@@ -271,6 +315,17 @@
             console.log(e)
           })
       },
+      //基本地图加载
+      loadMap(path) {
+        var map, route;
+        map = new AMap.Map("container", {
+          resizeEnable: true
+        });
+        map.plugin("AMap.DragRoute", function () {
+          route = new AMap.DragRoute(map, path, AMap.DrivingPolicy.LEAST_FEE); //构造拖拽导航类
+          route.search(); //查询导航路径并开启拖拽导航
+        });
+      },
       //图表属性赋值
       initEcharts() {
         this.option = {
@@ -288,7 +343,7 @@
             data: this.xData
           },
           legend: { // 图例
-            data: ["车辆温度"],
+            data: [],
             // bottom: "0%"
           },
           yAxis: {},
@@ -304,20 +359,8 @@
               zoomOnMouseWheel: 'true', //如何触发缩放。可选值为:true:表示不按任何功能键,鼠标滚轮能触发缩放。false:表示鼠标滚轮不能触发缩放。'shift':表示按住 shift 和鼠标滚轮能触发缩放。'ctrl':表示按住 ctrl 和鼠标滚轮能触发缩放。'alt':表示按住 alt 和鼠标滚轮能触发缩放。
             },
           ],
-          series: [{
-            name: "车辆温度",
-            data: this.temperatureData,
-            type: "line",
-            smooth: true,
-            label: {
-              show: true,
-              position: "top",
-              textStyle: {
-                fontSize: 12
-              }
-            },
-          }],
-        };
+          series: [],
+        }
       },
       //渲染图表
       windowSize() {
@@ -336,9 +379,10 @@
         this.minH = array[0].humidity;
         this.aggT = 0;
         this.aggH = 0;
+        let x = [];
         for (let i = 0; i < array.length; i++) {
           //对X轴的时间进行赋值
-          this.xData[i] = array[i].hisDate;
+          x[i] = array[i].hisDate;
           //对Y轴的温度进行赋值
           // this.temperatureData[i] = array[i].temperature;
           //温度最大值
@@ -361,6 +405,9 @@
           this.aggT += parseFloat(array[i].temperature);
           this.aggH += parseFloat(array[i].humidity);
         }
+        //x轴时间去重
+        this.xData = Array.from(new Set(x));
+        // console.log(this.xData, 'this.xData')
         //温湿度平均值
         this.avgT = this.aggT / array.length;
         this.avgH = this.aggH / array.length;

+ 2 - 3
src/views/purchase/DemandSummary/index.vue

@@ -261,8 +261,8 @@
           :checkbox-config="{trigger:'row', highlight: true, range: true}"
           :column-config="{resizable: true}"
         >
-          <vxe-column type="checkbox" width="50" fixed="left"/>
-          <vxe-column show-header-overflow show-overflow  title="序号" type="seq" align="center" width="50px" fixed="left"/>
+          <vxe-column type="checkbox" width="50"/>
+          <vxe-column show-header-overflow show-overflow  title="序号" type="seq" align="center" width="50px"/>
           <!-- <vxe-column show-header-overflow show-overflow title="行号" align="center" field="rowNo"/> -->
           <vxe-column show-header-overflow show-overflow title="行状态" align="center" field="status" width="50px" :formatter="hangStatus"/>
           <vxe-column show-header-overflow show-overflow title="最终采购量" align="center" field="finalBuyQty" width="80px">
@@ -370,7 +370,6 @@
           <!-- <vxe-column show-header-overflow show-overflow title="需求单位" align="center" field="demandUnit"/> -->
           <vxe-column show-header-overflow show-overflow title="采购经理审核人" align="center" field="puManagerAuditor" width="120px"/>
           <vxe-column
-          fixed="right"
           title="操作"
           align="center"
           width="50"

+ 2 - 2
src/views/purchase/workSpace/index.vue

@@ -53,7 +53,7 @@
         <!-- <el-table-column type="selection" width="55" /> -->
         <el-table-column label="序号" type="index" align="center" width="50px"/>
         <el-table-column show-overflow-tooltip label="标题" align="center" prop="docSubject"/>
-        <el-table-column show-overflow-tooltip label="创建人" align="center" prop="docCreate"/>
+        <el-table-column show-overflow-tooltip label="创建人" align="center" prop="docCreate" width="100px"/>
         <el-table-column
           fixed="right"
           label="操作"
@@ -270,7 +270,7 @@ export default {
           {label: '生产厂家/代理人',  prop: 'manufacturerName', width: 150},
           {label: '含税单价',  prop: 'taxPrice', width: 80, 
             formatter: function(row, column, cellValue, index) {
-              return row.taxPrice ? parseFloat(row.taxPrice).toFixed(2) : '0.00'
+              return row.taxPrice ? parseFloat(row.taxPrice).toFixed(5) : '0.00'
             },
           },
           {label: '最近价格',  prop: 'recentlyPrice', width: 80},