Forráskód Böngészése

Merge branch 'master' of https://git.steerinfo.com/DAL-DAZHOU/icore-pass

luobang 2 éve
szülő
commit
26b3c273fe

+ 25 - 4
src/views/inward/components/truckOrder/purInwardTruckOrder.vue

@@ -6,9 +6,15 @@
       <el-button type="primary" class="btn" @click="onclick">
         <i class="el-icon-search"></i>查询
       </el-button>
-      <el-button type="primary" @click="Insert" v-if="activeName == 'first'">
-        <i class="el-icon-plus"></i>新增
-      </el-button>
+      <el-badge  
+      :value="addPlanCount"
+      class="item"
+      v-if="activeName == 'first'"
+      style="margin-left:10px">
+        <el-button type="primary" @click="Insert" v-if="activeName == 'first'">
+          <i class="el-icon-plus"></i>新增
+        </el-button>
+      </el-badge>
     </div>
     <el-dialog
       title="车辆信息"
@@ -133,9 +139,11 @@ export default {
       //多选的选中的订单id
       selectionList: [],
       //区别点击的是添加运力,还是修改
-      index: null
+      index: null,
       // wssUrl: "wss:wl.dasteel.cn:32322/websocket/socketServer",
       // actiones: { username: "湘M99999" } //传入后台的数据
+      addPlanCount:0,
+      timer:null,
     };
   },
   created() {
@@ -184,7 +192,20 @@ export default {
     }
     // this.initWebSocket();
   },
+  mounted(){
+    this.getAddPlan();
+    this.timer=setInterval(this.getAddPlan, 10000);
+  },
+  beforeDestroy(){
+    clearInterval(this.timer);
+  },
   methods: {
+    getAddPlan() {
+      this.axios.post( "/api/v1/ams/getPurRequirementList?apiId=431&requirementStatus=1&enableStatus=1&planStatus=2&pageNum=1&pageSize=10").then(res => {
+        console.log("data:",res.data.data);
+        this.addPlanCount = res.data.data.total;
+      });
+    },
     //建立websocket连接
     initWebSocket() {
       //试图调用websocket

+ 52 - 2
src/views/statisticalReport/components/dowmShipDynamicTable.vue

@@ -62,7 +62,7 @@
           </el-table-column>
            <el-table-column
           align="center"
-            prop="instructPlannedLoading"
+            prop="planLoadTon"
             label="计划吨位"
             width="100px">
           </el-table-column>
@@ -108,6 +108,10 @@ export default {
         tableData:[],
         spanArr: [], // 用于存放需要合并的行的个数
         spanIndex: 0, // 记录spanArr数组的下标
+        spanArr2: [], // 用于存放需要合并的行的个数
+        spanIndex2: 0, // 记录spanArr数组的下标
+        spanArr3:[],
+        spanIndex:0,
         map:{
             input:"",
             startTime:null,
@@ -189,6 +193,16 @@ export default {
             sums[index] = '';
             return;
           }
+          if(index === 2){
+            let sum=new BigNumber(0);
+            data.forEach((row,rowIndex)=>{
+              if(rowIndex ==0 || row.gmId !=  data[rowIndex-1].gmId){
+                sum=sum.plus(row.gmTonnage);
+              }
+            })
+            sums[index] = sum.toNumber();
+            return; 
+          }
           const values = data.map(item => Number(item[column.property]));
           if (!values.every(value => isNaN(value))) {
             sums[index] = values.reduce((prev, curr) => {
@@ -208,12 +222,18 @@ export default {
     //处理数据,得到合并数组
     getSpanArr(data) {
         this.spanArr=[];
+        this.spanArr2=[];
+        this.spanArr3=[];
         for (let i = 0; i < data.length; i++) {
             if (i == 0) {
                 this.spanArr.push(1);
+                this.spanArr2.push(1);
+                this.spanArr3.push(1);
                 this.spanIndex = 0;
+                this.spanIndex2 = 0;
+                this.spanIndex3 = 0;
             } else {
-                // 判断当前行与前一行内容是否相同
+                // 判断当前行与前一行内容是否相同:港口名
                 if (data[i].portName == data[i - 1].portName) {
                     this.spanArr[this.spanIndex] += 1; // 相同的话,当前下标所代表的值加一,例如:第一列的前三行可合并
                     this.spanArr.push(0);// 记录完毕后,再往数组里添加一个元素0,作为下一次合并的初始值
@@ -221,6 +241,22 @@ export default {
                     this.spanArr.push(1); // 否则,依旧是一行
                     this.spanIndex = i;
                 }
+                // 判断当前行与前一行内容是否相同:发货通知
+                if (data[i].productName == data[i - 1].productName) {
+                    this.spanArr2[this.spanIndex2] += 1; // 相同的话,当前下标所代表的值加一,例如:第一列的前三行可合并
+                    this.spanArr2.push(0);// 记录完毕后,再往数组里添加一个元素0,作为下一次合并的初始值
+                } else {
+                    this.spanArr2.push(1); // 否则,依旧是一行
+                    this.spanIndex2 = i;
+                }
+                // 判断当前行与前一行内容是否相同:港口库存
+                if (data[i].gmId == data[i - 1].gmId) {
+                    this.spanArr3[this.spanIndex3] += 1; // 相同的话,当前下标所代表的值加一,例如:第一列的前三行可合并
+                    this.spanArr3.push(0);// 记录完毕后,再往数组里添加一个元素0,作为下一次合并的初始值
+                } else {
+                    this.spanArr3.push(1); // 否则,依旧是一行
+                    this.spanIndex3 = i;
+                }
             }
         }
         console.log("spanArr",this.spanArr);
@@ -234,6 +270,20 @@ export default {
                 rowspan: _row,
                 colspan: _col
             };
+        }else if(columnIndex === 1){
+            const _row = this.spanArr2[rowIndex]; // 行数
+            const _col = _row > 0 ? 1 : 0; // 列数
+            return {
+                rowspan: _row,
+                colspan: _col
+            };
+        }else if(columnIndex === 2){
+            const _row = this.spanArr3[rowIndex]; // 行数
+            const _col = _row > 0 ? 1 : 0; // 列数
+            return {
+                rowspan: _row,
+                colspan: _col
+            };
         }
     },
   },