Selaa lähdekoodia

修改内转钢材到异地库

liyg 2 vuotta sitten
vanhempi
commit
31739ddc65

+ 47 - 16
src/views/inward/components/offsetSteel/saleSteelTruckOrder/saleTruckPreview.vue

@@ -119,18 +119,18 @@
               :trigger-on-focus="false"
               @select="handleSelectConsignee"
               style="width: 300px"
-              :disabled="scope.row.isConsigneeDisable != 1"
+              :disabled="true"
             >
+<!-- 上方写死不允许修改,右边是原来的修改 :disabled="scope.row.isConsigneeDisable != 1" -->
               <template slot-scope="{ item }">
                 <div class="name">{{ item.consigneeCompanyName }}</div>
               </template>
             </el-autocomplete>
-            <el-button
+            <!-- <el-button
               @click="updateConsignnee(scope.row)"
               type="primary"
               v-if="scope.row.isConsigneeDisable == 1"
-              >提交</el-button
-            >
+              >提交</el-button> -->
           </template>
         </el-table-column>
         <el-table-column
@@ -154,8 +154,7 @@
               @click="updateTruckCarrier(scope.row)"
               type="primary"
               v-if="scope.row.isCarrierShow == 1"
-              >提交</el-button
-            >
+              >提交</el-button>
           </template>
         </el-table-column>
 
@@ -173,6 +172,7 @@
               filterable
               v-model="scope.row.sendStationId"
               @change="updateSendStation($event, scope.row)"
+              disabled
             >
               <el-option
                 v-for="item in sendStations"
@@ -285,7 +285,7 @@
             >
           </template>
         </el-table-column>
-        <el-table-column
+        <!-- <el-table-column
           prop="addressPlace"
           label="收货地址"
           :width="flexColumnWidth('addressPlace', tableData, 'max')"
@@ -304,7 +304,7 @@
               >选择</el-button
             >
           </template>
-        </el-table-column>
+        </el-table-column> -->
         <el-table-column prop="orderStatus" label="运单状态" align="center">
         </el-table-column>
         <el-table-column prop="grossWeight" label="毛重"> </el-table-column>
@@ -387,7 +387,7 @@
           width="100px"
         >
         </el-table-column>
-        <el-table-column
+        <!-- <el-table-column
           label="操作"
           fixed="right"
           width="120px"
@@ -422,7 +422,7 @@
               >关闭车辆</el-button
             >
           </template>
-        </el-table-column>
+        </el-table-column> -->
         <!-- <el-table-column
           label="操作"
           fixed="right"
@@ -590,7 +590,7 @@ export default {
       a: 1,
       isCellClick: 0,
       columnIndexs: [
-        1, 2, 3, 4, 7, 8, 14, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
+        1, 2, 3, 4,  14, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
         29, 31,
       ],
       //钢材多拼车辆线路ID
@@ -650,10 +650,11 @@ export default {
   methods: {
     updateConsignnee(row) {
       if(!this.consigneeId){
-          this.message({
+          this.$message({
             message:"请先选择承运商",
             type:"warning"
           });
+          return;
       }
       let map={
         consigneeId:this.consigneeId,
@@ -793,6 +794,7 @@ export default {
         if (item.carrierName == row.carrierName) {
           row.newCarrierId = item.carrierId;
           row.carrierId = item.carrierId;
+          row.carrierIds=item.carrierId;
         }
       });
     },
@@ -983,6 +985,7 @@ export default {
           spinner: "el-icon-loading",
           background: "rgba(0, 0, 0, 0.7)",
         });
+        console.log("updateCapacityRow:",row);
         this.axios
           .post("/api/v1/ams/updateCapacityNumberInFactory", row)
           .then((res) => {
@@ -1010,14 +1013,27 @@ export default {
         row.capacityNumber = row.capacityNo;
         let arr = [];
         arr.push(row);
+        let map = {
+          sendStationId: row.sendStationId,
+          saleOrderId: row.saleOrderId,
+          mapList: arr,
+        };
+        console.log("map", map);
+        if(!map.saleOrderId ||
+        !map.sendStationId||
+        !map.mapList){
+          this.$message.warning("数据异常,请确认已选发站");
+          return;
+        }
+        console.log("map:",map);
         const loading = this.$loading({
           lock: true,
-          text: "正在变更车牌号",
+          text: "正在派车",
           spinner: "el-icon-loading",
           background: "rgba(0, 0, 0, 0.7)",
         });
         this.axios
-          .post("/api/v1/ams/dispatchSteelOrder", arr)
+          .post("/api/v1/ams/dispatchInwardTruckOrderBySale", map)
           .then((res) => {
             if (res.data.code == "200") {
               this.$message.success("派车成功!");
@@ -1064,9 +1080,15 @@ export default {
         mapList: this.selection,
       };
       console.log("map", map);
+      if(!map.saleOrderId ||
+      !map.sendStationId||
+      !map.mapList){
+        this.$message.warning("数据异常,请确认已选发站");
+        return;
+      }
       const loading = this.$loading({
         lock: true,
-        text: "正在变更车牌号",
+        text: "正在派车",
         spinner: "el-icon-loading",
         background: "rgba(0, 0, 0, 0.7)",
       });
@@ -1174,6 +1196,7 @@ export default {
         this.getSteelReport();
         return;
       }
+      console.log("carrierIdRow:",row);
       if (row.carrierIds != 0) {
         const loading = this.$loading({
           lock: true,
@@ -1365,7 +1388,7 @@ export default {
           this.pos = 0;
         } else {
           // 判断当前元素与上一个元素是否相同
-          if (data[i].saleOrderId === data[i - 1].saleOrderMaterialId) {
+          if (data[i].saleOrderId === data[i - 1].saleOrderId) {
             this.spanArr[this.pos] += 1;
             data[i].group = data[i - 1].group;
             this.spanArr.push(0);
@@ -1650,6 +1673,14 @@ export default {
             type: "warning",
           });
           return;
+        }else if(
+           !selection[0].sendStationId
+        ){
+          this.$message({
+            message: "无法生成多拼,请先选择发站",
+            type: "warning",
+          });
+          return;
         }
         this.dialogTableVisible = true;
         this.selection = selection;