liyg 2 年之前
父节点
当前提交
d2bc4ea6ee
共有 1 个文件被更改,包括 15 次插入6 次删除
  1. 15 6
      src/views/inward/components/offsetSteel/saleSteelTruckOrder/platformStockInfo.vue

+ 15 - 6
src/views/inward/components/offsetSteel/saleSteelTruckOrder/platformStockInfo.vue

@@ -71,7 +71,7 @@
         border
         border
         stripe
         stripe
         style="width: 100%; margin-top: 20px"
         style="width: 100%; margin-top: 20px"
-        max-height="800px"
+        max-height="500px"
         :row-style="{ height: '30px' }"
         :row-style="{ height: '30px' }"
         :cell-style="{ fontWeight: '700' }"
         :cell-style="{ fontWeight: '700' }"
         :summary-method="getSummaries"
         :summary-method="getSummaries"
@@ -250,6 +250,7 @@
           <template slot-scope="scope">
           <template slot-scope="scope">
             <el-input
             <el-input
               v-model.number="scope.row.wagonBillWeight"
               v-model.number="scope.row.wagonBillWeight"
+              @change="mergeChange(scope.row)"
               placeholder="计费吨位"
               placeholder="计费吨位"
             >
             >
             </el-input>
             </el-input>
@@ -284,7 +285,7 @@
           width="150px"
           width="150px"
         >
         >
         </el-table-column>
         </el-table-column>
-        <el-table-column label="操作" align="center" width="150px">
+        <el-table-column label="操作" align="center" width="150px" prop="operation">
           <template slot-scope="scope">
           <template slot-scope="scope">
             <el-button type="text" @click="operate(scope.row)">保存</el-button>
             <el-button type="text" @click="operate(scope.row)">保存</el-button>
           </template>
           </template>
@@ -334,7 +335,7 @@ export default {
       operateName: "编辑",
       operateName: "编辑",
       unloadPointList: [],
       unloadPointList: [],
       spanArr: [],
       spanArr: [],
-      mergeList: [""]
+      mergeList: ["wagonNo","wagonBillWeight","OutStation"]
     };
     };
   },
   },
   created() {
   created() {
@@ -425,6 +426,13 @@ export default {
         );
         );
       };
       };
     },
     },
+    //修改合并行同步
+    mergeChange(row){
+      let index=this.tableData.indexOf(row);
+      for(let i=index;i<this.tableData.length && row.wagonNo==this.tableData[i].wagonNo && row.OutStation==this.tableData[i].OutStation;i++){
+        this.tableData[i].wagonBillWeight=row.wagonBillWeight;
+      }
+    },
     operate(row) {
     operate(row) {
       row.personnelSsoId = getCookie("userId");
       row.personnelSsoId = getCookie("userId");
       if (
       if (
@@ -500,7 +508,7 @@ export default {
         .then(res => {
         .then(res => {
           this.tableData = res.data.data;
           this.tableData = res.data.data;
           this.showSummariesPosition();
           this.showSummariesPosition();
-          this.getSpanArr();
+          this.getSpanArr(this.tableData);
         });
         });
     },
     },
     //获取后台数据
     //获取后台数据
@@ -513,7 +521,7 @@ export default {
         .then(res => {
         .then(res => {
           console.log(res.data.data);
           console.log(res.data.data);
           this.tableData = res.data.data;
           this.tableData = res.data.data;
-          this.getSpanArr();
+          this.getSpanArr(this.tableData);
           this.showSummariesPosition();
           this.showSummariesPosition();
         });
         });
     },
     },
@@ -585,7 +593,8 @@ export default {
           this.pos = 0;
           this.pos = 0;
         } else {
         } else {
           // 判断当前元素与上一个元素是否相同
           // 判断当前元素与上一个元素是否相同
-          if (data[i].trainOrderId === data[i - 1].trainOrderId) {
+          if (data[i].wagonNo === data[i - 1].wagonNo
+          && data[i].OutStation === data[i - 1].OutStation) {
             this.spanArr[this.pos] += 1;
             this.spanArr[this.pos] += 1;
             data[i].group = data[i - 1].group;
             data[i].group = data[i - 1].group;
             this.spanArr.push(0);
             this.spanArr.push(0);