huk 3 anos atrás
pai
commit
d673452c9d

+ 92 - 34
src/views/TMS/components/purchaseChemicalMaterials/transportationReservationAdd.vue

@@ -1,6 +1,6 @@
-//采购化工材料运输预约新增
 <template>
-  <div id="transportationReservationAdd">
+  <!-- 新增运输作业页面 -->
+  <div id="contractDetails">
     <page-title>运输预约</page-title>
 
     <div class="material from">
@@ -29,6 +29,12 @@
       <el-input class="input" v-model="lineName" disabled> </el-input>
       <el-button type="primary" @click="ondrawer(5)">浏览</el-button>
     </div>
+    <div class="lineId from">
+      <span class="text">采购订单号:</span>
+      <el-input class="input" v-model="purchaseOrderNo" disabled> </el-input>
+      <el-button type="primary" @click="ondrawer(6)" v-if="materialId && supplierId">浏览</el-button>
+      <span v-else class="span"></span>
+    </div>
     <div class="orderType from">
       <span class="text">订单类别:</span>
       <el-select
@@ -58,6 +64,14 @@
         >
       </div>
     </div>
+    <div class="lineId from">
+      <span class="text">该批车辆是否一车多趟:</span>
+      <el-switch
+        v-model="isMoreTrips"
+        active-text="是"
+        inactive-text="否">
+      </el-switch>
+    </div>
     <div class="truckListTable">
       <el-table
         :data="selectionList"
@@ -112,40 +126,46 @@
           style="margin-top: 10px; margin-right: 10px; width: 250px"
           clearable
         ></el-input>
-        <el-button type="primary" class="btn" @click="onclick(a)">
+        <el-button type="primary" class="btn" @click="onclick">
           <i class="el-icon-search"></i>查询
         </el-button>
       </div>
-      <div v-show="a == 1">
+      <div v-show="onDrawerNumber == 1">
         <dilTable
           v-bind.sync="frist"
           @radio-change="currentRadioChange1"
         ></dilTable>
       </div>
-      <div v-show="a == 2">
+      <div v-show="onDrawerNumber == 2">
         <dilTable
           v-bind.sync="secend"
           @radio-change="currentRadioChange2"
         ></dilTable>
       </div>
-      <div v-show="a == 3">
+      <div v-show="onDrawerNumber == 3">
         <dilTable
           v-bind.sync="third"
           @selection-change="currentRadioChange3"
         ></dilTable>
       </div>
-      <div v-show="a == 4">
+      <div v-show="onDrawerNumber == 4">
         <dilTable
           v-bind.sync="unloadPoint"
           @radio-change="currentRadioChange4"
         ></dilTable>
       </div>
-      <div v-show="a == 5">
+      <div v-show="onDrawerNumber == 5">
         <dilTable
           v-bind.sync="line"
           @radio-change="currentRadioChange5"
         ></dilTable>
       </div>
+      <div v-show="onDrawerNumber == 6">
+        <dilTable
+          v-bind.sync="purchaseOrder"
+          @radio-change="currentRadioChange6"
+        ></dilTable>
+      </div>
     </el-drawer>
     <div class="button_box">
       <el-button @click="onClickCancel">返回</el-button>
@@ -161,6 +181,9 @@ export default {
   components: { PageTitle },
   data() {
     return {
+      //采购订单号
+      purchaseOrderNo:'',
+      isMoreTrips:false,
       //订单类别
       orderTypeList: [
         {
@@ -220,7 +243,7 @@ export default {
       unloadPointName: "",
       //订单类别
       orderType: null,
-      a: 1,
+      onDrawerNumber: 1,
       direction: "rtl",
       input: "",
       frist: {
@@ -247,8 +270,19 @@ export default {
         requestUrl: "/api/v1/rms/getAllLineDesk?apiId=249&lineType=3",
         selectionType: "radio",
       },
+      purchaseOrder:{
+        requestUrl: "/api/v1/ams/getPurchaseOrderList?apiId=81",
+        selectionType: "radio",
+      }
     };
   },
+  watch: {
+    drawer(val) {
+      if (!val) {
+        this.input = null;
+      }
+    },
+  },
   created() {
     if (getCookie("orgCode") == "chengyunshang") {
       this.third.requestUrl =
@@ -286,13 +320,14 @@ export default {
               });
               this.form1 = [];
             } else {
+              console.log();
               this.remark = res.data.data.remark;
               this.purchaseOrderId = res.data.data.purchaseOrderId;
-              this.form1 = { purchaseOrderNo: res.data.data.purchaseOrderNo };
+              this.purchaseOrderNo=res.data.data.purchaseOrderNo;
               if (res.data.data.receiveUnitId == 1) {
-                this.orderType = 17;
+                this.orderType = 6;
               } else {
-                this.orderType = 18;
+                this.orderType = 7;
               }
             }
           } else {
@@ -301,18 +336,18 @@ export default {
         });
       }
     },
-    onclick(a) {
-      if (a == 1) {
+    onclick() {
+      if (this.onDrawerNumber == 1) {
         this.frist.requestUrl =
           "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050&index=" +
           this.input;
-      } else if (a == 2) {
+      } else if (this.onDrawerNumber == 2) {
         this.secend.requestUrl =
           "/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId=" +
           this.materialId +
           "&index=" +
           this.input;
-      } else if (a == 3) {
+      } else if (this.onDrawerNumber == 3) {
         //判断是否是承运商查询车辆
         if (getCookie("orgCode") == "chengyunshang") {
           this.third.requestUrl =
@@ -327,33 +362,46 @@ export default {
             "&index=" +
             this.input;
         }
-      } else if (a == 4) {
+      } else if (this.onDrawerNumber == 4) {
         this.unloadPoint.requestUrl =
           "/api/v1/uc/getUnloadingMesByLike?apiId=347&index=" + this.input;
-      } else if (a == 5) {
+      } else if (this.onDrawerNumber == 5) {
         this.option.requestUrl =
           "/api/v1/rms/getAllLineDesk?apiId=249&lineType=3&con=" + this.input;
+      }else if (this.onDrawerNumber == 6) {
+        console.log("caig")
+        this.purchaseOrder.requestUrl =
+          "/api/v1/ams/getPurchaseOrderList?apiId=81&con=" + this.input+"&i="+new Date();
       }
     },
     ondrawer(num) {
-      this.input = null;
       this.drawer = true;
-      this.a = num;
-      if(num == 1){
-        this.frist.requestUrl = "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050&i="+new Date();
-      }else if (num == 2) {
-        this.secend.requestUrl = "/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId=" + this.materialId +"&i=" +new Date();
-      }else if(num == 3){
+      this.onDrawerNumber = num;
+      if (num == 2) {
+        this.secend.requestUrl =
+          "/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId=" +
+          this.materialId;
+      } else if (num == 3) {
         //判断是否是承运商查询车辆
         if (getCookie("orgCode") == "chengyunshang") {
-          this.third.requestUrl = "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" + getCookie("userId") + "&i=" + new Date();
+          this.third.requestUrl =
+            "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" +
+            getCookie("userId") +
+            "&i=" + new Date();
         } else {
-          this.third.requestUrl = "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" + null + "&i="+new Date(); 
+          this.third.requestUrl =
+            "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" +
+            null  + "&i=" + new Date();
         }
-      }else if(num == 4){
-        this.unloadPoint.requestUrl = "/api/v1/uc/getUnloadingMesByLike?apiId=347&i=" + new Date();
-      }else if(num == 5){
-        this.option.requestUrl = "/api/v1/rms/getAllLineDesk?apiId=249&lineType=3&i=" + new Date();
+      } else if (num == 4) {
+        this.unloadPoint.requestUrl =
+          "/api/v1/uc/getUnloadingMesByLike?apiId=347&i=" + new Date();
+      } else if (num == 5) {
+        this.option.requestUrl =
+          "/api/v1/rms/getAllLineDesk?apiId=249&lineType=3&i=" + new Date();
+      }else if (num == 6) {
+        this.purchaseOrder.requestUrl =
+        "/api/v1/ams/getPurchaseOrderList?apiId=81&i=" + new Date();
       }
     },
     // 返回
@@ -378,6 +426,10 @@ export default {
       this.lineName = selection.lineName;
       this.lineId = selection.lineId;
     },
+    currentRadioChange6(selection) {
+      this.purchaseOrderNo = selection.purchaseOrderNo;
+      this.purchaseOrderId = selection.purchaseOrderId;
+    },
     currentRadioChange3(selection) {
       this.selectionList = [];
       this.selectionList = selection;
@@ -469,6 +521,7 @@ export default {
           driverCapacityIdList: this.selectionList,
           orderType: this.orderType,
           lineId: this.lineId,
+          isMoreTrips:this.isMoreTrips,
         };
         console.log(map, map);
         this.axios.post("/api/v1/oms/addPurOrder", map).then((res) => {
@@ -477,16 +530,16 @@ export default {
               message: "添加成功!",
               type: "success",
             });
-            this.$router.push("/transportationReservation");
+            this.$router.push("/transportReserveRan");
           }
-        }); 
+        });
       }
     },
   },
 };
 </script>
 <style lang="scss">
-.transportationReservationAdd {
+.contractDetails {
   width: 100%;
 }
 .from {
@@ -521,6 +574,11 @@ export default {
     width: 250px;
     margin-right: 20px;
   }
+  .span{
+    display: inline-block;
+    width: 70px;
+    height: 1px;
+  }
 }
 .material {
   display: flex;

+ 12 - 30
src/views/statisticalReport/components/salesLogisticsStatistics/transportationPerformance.vue

@@ -1,19 +1,14 @@
 <template>
   <div class="purchasFuelNewMonitor">
     <div class="frameCalculation">
-      <span>进厂时间:</span>
+      <span>计毛时间:</span>
       <el-date-picker
-        v-model="startTime"
-        type="date"
-        placeholder="选择日期"
-      >
-      </el-date-picker>
-      <span>至</span>
-      <el-date-picker
-        v-model="endTime"
-        type="date"
-        placeholder="选择日期"
-      >
+        v-model="Time"
+        :editable="true"
+        type="datetimerange"
+        range-separator="至"
+        start-placeholder="开始日期"
+        end-placeholder="结束日期">
       </el-date-picker>
       <el-button type="primary" class="btn" @click="onclick">
         <i class="el-icon-search"></i>查询
@@ -37,8 +32,7 @@ export default {
       option: {
         requestUrl: "/api/v1/tms/getAllSaleReport?apiId=423&startTime=null&endTime=null&i=" +new Date(),
       },
-      startTime: null,
-      endTime: null,
+      Time:'',
       tableTitle:'销售统计报表'
     };
   },
@@ -49,23 +43,11 @@ export default {
     onclick() {
       let startTime = null;
       let endTime = null;
-      if(this.startTime){
-        startTime = sjTime(this.startTime);
-      }
-      if(this.endTime){
-        endTime = sjTime(this.endTime);
-      }
-      if(startTime && endTime){
-        if(startTime < endTime){
-          this.option.requestUrl = "/api/v1/tms/getAllSaleReport?apiId=423&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date();
-        }else{
-          this.startTime = null;
-          this.endTime = null;
-          this.$message.warning('开始时间要比结束时间早')
-        }
-      }else{
-        this.option.requestUrl = "/api/v1/tms/getAllSaleReport?apiId=423&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date();
+      if(this.Time != null){
+        startTime = sjTime(this.Time[0]);
+        endTime = sjTime(this.Time[1]);
       }
+      this.option.requestUrl = "/api/v1/tms/getAllSaleReport?apiId=423&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date();
     },
   },
 };