gjy 3 năm trước cách đây
mục cha
commit
2c38fa65fd

+ 9 - 4
src/views/houseSelfCollect/settlement.vue

@@ -502,12 +502,17 @@ export default {
             this.paymentList.qualityInspectionManagement.weightDeduction=this.paymentList.qualityInspectionManagement.weightDeduction.toFixed(2)
             this.paymentList.base=(100-this.paymentList.qualityInspectionManagement.weightDeduction)/100
             this.paymentList.base = this.paymentList.base.toFixed(3)
-            this.paymentList.pureWeight=this.paymentList.base*this.paymentList.weighingManagement.netWeight
-            this.paymentList.pureWeight =  this.paymentList.pureWeight.toFixed(2)
+            if(this.paymentList.type=='潮粮'){
+              this.paymentList.pureWeight=this.paymentList.base*this.paymentList.weighingManagement.netWeight
+              this.paymentList.pureWeight =  this.paymentList.pureWeight.toFixed(2)
+            }
+            
           }
           else{
-            this.paymentList.pureWeight=this.paymentList.weighingManagement.netWeight * (100 - this.paymentList.param)/100
-            this.paymentList.pureWeight =  this.paymentList.pureWeight.toFixed(2)
+            if(this.paymentList.type=='潮粮'){
+              this.paymentList.pureWeight=this.paymentList.weighingManagement.netWeight * (100 - this.paymentList.param)/100
+              this.paymentList.pureWeight =  this.paymentList.pureWeight.toFixed(2)
+            }
           }
           if(!this.paymentList.dryGrainPrice){
             this.paymentList.dryGrainPrice=this.paymentList.qualityInspectionManagement.tidalGrainPrice/this.paymentList.base

+ 39 - 1
src/views/warehouse/costmanagement.vue

@@ -52,6 +52,7 @@
       <el-table
         class="wenzi"
         :data="warehouseList"
+        :span-method="arraySpanMethod"
         style="width: 100%; margin-top: 20px"
         height="780"
       >
@@ -187,6 +188,42 @@ export default {
     this.showType = this.isShow
   },
   methods: {
+    arraySpanMethod(obj){
+			if (obj.columnIndex === 1 ) {
+				// 二维数组存储的数据 取出
+				var _row = this.spanArr[obj.rowIndex]
+				var _col = _row > 0 ? 1 : 0
+				return {
+					rowspan: _row,
+					colspan: _col
+				}
+			} else {
+				return false
+			}
+    },
+    getSpanArr:function(data) {
+			var vm = this;
+			vm.spanArr = [];
+			vm.pos = 0;
+			data.forEach(function(item, index){
+				//判断是否是第一项
+				if (index === 0) {
+					vm.spanArr.push(1);
+					vm.pos = 0;
+				} else {
+					//不是第一项时,就根据标识去存储
+					if (data[index].warehouseName === data[index - 1].warehouseName ) {
+						// 查找到符合条件的数据时每次要把之前存储的数据+1
+						vm.spanArr[vm.pos] += 1;
+						vm.spanArr.push(0);
+					} else {
+						// 没有符合的数据时,要记住当前的index
+						vm.spanArr.push(1);
+						vm.pos = index
+					}
+				}
+			});
+		},
     changeradio(e) {
       this.selectWarehouse()
     },
@@ -257,7 +294,7 @@ export default {
       this.getList()
     },
     handleCurrentChange(val) {
-      this.currentPage = val
+      this.currectPage = val
       console.log(`当前页: ${val}`)
       this.getList()
     },
@@ -319,6 +356,7 @@ export default {
             }
             
           }
+          this.getSpanArr(arr)
           this.warehouseList = arr
           this.deptBudgetTotal=response.total
         })