zx 2 年之前
父节点
当前提交
88adc2f432
共有 1 个文件被更改,包括 39 次插入33 次删除
  1. 39 33
      src/views/inward/components/offsetSteel/saleSteelTruckOrder/saleTruckOrder.vue

+ 39 - 33
src/views/inward/components/offsetSteel/saleSteelTruckOrder/saleTruckOrder.vue

@@ -133,58 +133,58 @@
           </template>
         </el-table-column>
         <el-table-column
-          prop="capacityNo"
-          column-key="capacityNo"
-          label="车牌号"
+          prop="lineName"
+          column-key="lineName"
+          label="路线"
           align="center"
           width="250px"
           fixed
         >
+          <!-- 选择路线 -->
           <template slot-scope="scope">
             <el-autocomplete
               style="width: 120px"
-              v-model="scope.row.capacityNo"
-              :fetch-suggestions="querySearch"
-              placeholder="请输入车牌号"
-              @select="handleSelect(scope.row, scope.$index)"
-              :disabled="scope.row.isCapacityShow != 1"
-            ></el-autocomplete>
+              v-model="scope.row.lineName"
+              :fetch-suggestions="querySearchLineName"
+              placeholder="请选择路线"
+              @select="handleSelectLine(scope.row, scope.$index)"
+              :disabled="scope.row.isLineName != 1"
+            >
+            </el-autocomplete>
             <el-button
-              @click="updateCapacity(scope.row)"
+              @click="updateLine(scope.row)"
               type="primary"
-              v-if="scope.row.isCapacityShow == 1"
+              v-if="scope.row.isLineName == 1"
               >提交</el-button
             >
           </template>
         </el-table-column>
         <el-table-column
-          prop="lineName"
-          column-key="lineName"
-          label="路线"
+          prop="capacityNo"
+          column-key="capacityNo"
+          label="车牌号"
           align="center"
           width="250px"
           fixed
         >
-          <!-- 选择路线 -->
           <template slot-scope="scope">
             <el-autocomplete
               style="width: 120px"
-              v-model="scope.row.lineName"
-              :fetch-suggestions="querySearchLineName"
-              placeholder="请选择路线"
-              @select="handleSelectLine(scope.row, scope.$index)"
-              :disabled="scope.row.isLineName != 1"
-            >
-            
-            </el-autocomplete>
+              v-model="scope.row.capacityNo"
+              :fetch-suggestions="querySearch"
+              placeholder="请输入车牌号"
+              @select="handleSelect(scope.row, scope.$index)"
+              :disabled="scope.row.isCapacityShow != 1"
+            ></el-autocomplete>
             <el-button
-              @click="updateLine(scope.row)"
+              @click="updateCapacity(scope.row)"
               type="primary"
-              v-if="scope.row.isLineName == 1"
+              v-if="scope.row.isCapacityShow == 1"
               >提交</el-button
             >
           </template>
         </el-table-column>
+
         <el-table-column
           prop="materialName"
           label="物资名称"
@@ -488,7 +488,7 @@ export default {
           value: "车牌号",
           lable: "车牌号",
         },
-         {
+        {
           value: "路线",
           lable: "路线",
         },
@@ -503,7 +503,7 @@ export default {
       capacityList: [],
       carrierList: [],
       // 线路
-      LineList:[],
+      LineList: [],
       tableData: [],
       spanArr: [],
       pos: 0,
@@ -642,7 +642,7 @@ export default {
         this.$set(row, "isCapacityShow", 1);
         this.clickIndex = row.group;
       }
-      if (column.property == "LineName") {
+      if (column.property == "lineName") {
         this.$set(row, "isLineName", 1);
         this.clickIndex = row.group;
       }
@@ -725,7 +725,7 @@ export default {
     createFilterLine(queryString) {
       return (restaurants) => {
         return (
-          restaurants.lineName.toLowerCase().indexOf(queryString.toLowerCase()) >
+          restaurants.value.toLowerCase().indexOf(queryString.toLowerCase()) >
           -1
         );
       };
@@ -756,7 +756,7 @@ export default {
               var results = queryString
                 ? restaurants.filter(this.createFilter(queryString))
                 : restaurants;
-                console.log("res",+results);
+              // console.log("res",+results);
               // 调用 callback 返回建议列表的数据
               cb(results);
             }
@@ -780,16 +780,21 @@ export default {
       });
     },
 
-  // 线路弹出层
-  handleSelectLine(row, index) {
+    // 线路弹出层
+    handleSelectLine(row, index) {
       this.capacityList.forEach((item) => {
         if (item.lineName === row.lineName) {
-          console("item",item);
           row.newLineId = item.lineId;
         }
       });
     },
 
+    // 更新线路
+    updateLine(row) {
+      row.lineId = this.lineId;
+      console.log("this.lineId" +this.lineId);
+    },
+
     updateCapacity(row) {
       if (row.newsCapacityId == null) {
         this.$message.warning("请先注册车牌号或者选中弹出后再提交!");
@@ -836,6 +841,7 @@ export default {
           }
         });
         // row.lineId = this.lineSpelling[i];
+
         row.driverTel = row.capacityTel;
         row.capacityNumber = row.capacityNo;
         let arr = [];