luobang 2 years ago
parent
commit
ecb211626d

+ 12 - 19
src/views/TMS/components/importedShip/addUnloadShip.vue

@@ -17,7 +17,7 @@
         <dil-form :formId="121" v-model="form"></dil-form>
       </div>
     </div>
-    <div class="button_box">
+    <div class="button_box_unloadShip">
       <el-button type="primary" :loading="isLoading" @click="makeSure"
         >新增卸船作业</el-button
       >
@@ -89,32 +89,25 @@ export default {
         return
       }
       if (
-        this.form.resultEndTime != null &&
-        this.form.resultEndTime != 'undefined' &&
-        typeof this.form.resultEndTime != 'undefined' &&
-        this.form.resultEndTime != 'null'
+        !this.form.resultArrivalDate ||
+        !this.form.resultStartTime ||
+        !this.form.resultEndTime ||
+        !this.form.resultStatus
       ) {
-        this.unloadShipMes()
+        this.$message.warning("请填写时间信息!");
+        this.isLoading = false
+        return;
       }
       let resultArrivalDate = null
       let resultStartTime = null
       let resultEndTime = null
-      if (
-        typeof this.form.resultArrivalDate != 'undefined' &&
-        this.form.resultArrivalDate != null
-      ) {
+      if ( !this.form.resultArrivalDate ) {
         resultArrivalDate = sjTime(this.form.resultArrivalDate)
       }
-      if (
-        typeof this.form.resultStartTime != 'undefined' &&
-        this.form.resultStartTime != null
-      ) {
+      if (!this.form.resultStartTime) {
         resultStartTime = sjTime(this.form.resultStartTime)
       }
-      if (
-        typeof this.form.resultEndTime != 'undefined' &&
-        this.form.resultEndTime != null
-      ) {
+      if (!this.form.resultEndTime) {
         resultEndTime = sjTime(this.form.resultEndTime)
       }
       let mapVal = {
@@ -188,7 +181,7 @@ export default {
       margin-right: 1.25rem;
     }
   }
-  .button_box {
+  .button_box_unloadShip {
     margin-left: 45%;
     width: 160px;
   }

+ 13 - 0
src/views/appoint/components/ship/addDeliveryAttorney.vue

@@ -234,6 +234,19 @@ export default {
         userId: getCookie("userId"),
         // resultMemo: this.form1.resultMemo,
       };
+      //校验下游港口,不能为万州港
+      try {
+        let downSwim=this.carriers.find(e=>{
+          return e.id==this.downSwimPortId
+        })
+        if(downSwim.label=='万州港'){
+          this.$message.warning("提货单位不能是万州港!");
+          this.isLoading=false;
+          return;
+        }
+      } catch (error) {
+        
+      }
       console.log(AmsshipDeliveryAttorney);
       //身份证校验
       function checkCardNo() {

+ 12 - 1
src/views/appoint/components/ship/modifyDeliveryAttroney.vue

@@ -145,7 +145,18 @@ export default {
         carrierId:this.carrierId,
         requesterGroupId:this.form1.requesterGroupId
       };
-
+      //校验下游港口,不能为万州港
+      try {
+        let downSwim=this.carriers.find(e=>{
+          return e.id==this.downSwimPortId
+        })
+        if(downSwim.label=='万州港'){
+          this.$message.warning("提货单位不能是万州港!");
+          return;
+        }
+      } catch (error) {
+        
+      }
       //身份证校验
       function checkCardNo() {
         var value3 = AmsshipDeliveryAttorney.attorenyPickupIdcard;

+ 70 - 50
src/views/sale/components/transportFreight/saleTruckSettlement/bmsTruckDetailsOrderNew.vue

@@ -1217,7 +1217,7 @@ export default {
             this.$refs.tableRef.clearSelection()
             //重置未结算详单表单信息
             // this.operation(this.steelMap)
-            this.getSteelReport()
+            this.loadNewData()
             this.dialogFormVisible = false
           } else {
             this.$message.error('修改失败:'+res.data.data)
@@ -1254,7 +1254,7 @@ export default {
                   this.$refs.tableRef.clearSelection()
                   this.$message.success('修改详单单价和地址成功!')
                   // this.operation(this.steelMap)
-                  this.getSteelReport()
+                  this.loadNewData()
                   this.dialogFormVisible = false
                 }else {
                   this.$message.error('修改失败:'+res.data.data)
@@ -2699,18 +2699,18 @@ export default {
         .then(res => {
           this.tableData = res.data.data
           //遍历保留两位小数
-          this.tableData.forEach(e=>{
-              try {
-                  if(e.priceValue){
-                    e.priceValue=e.priceValue.toFixed(2);
-                  }
-                  if(e.detailsAmount){
-                    e.detailsAmount=e.detailsAmount.toFixed(2);
-                  }
-              } catch (error) {
+          // this.tableData.forEach(e=>{
+          //     try {
+          //         if(e.priceValue){
+          //           e.priceValue=e.priceValue.toFixed(2);
+          //         }
+          //         if(e.detailsAmount){
+          //           e.detailsAmount=e.detailsAmount.toFixed(2);
+          //         }
+          //     } catch (error) {
                   
-              }
-          })
+          //     }
+          // })
           this.totalHeight += this.itemHeight
           this.visibleList = res.data.data
           console.log(this.visibleList);
@@ -2746,18 +2746,18 @@ export default {
         .then(res => {
           this.tableData1 = res.data.data
           //遍历保留两位小数
-          this.tableData1.forEach(e=>{
-              try {
-                  if(e.priceValue){
-                    e.priceValue=e.priceValue.toFixed(2);
-                  }
-                  if(e.detailsAmount){
-                    e.detailsAmount=e.detailsAmount.toFixed(2);
-                  }
-              } catch (error) {
+          // this.tableData1.forEach(e=>{
+          //     try {
+          //         if(e.priceValue){
+          //           e.priceValue=e.priceValue.toFixed(2);
+          //         }
+          //         if(e.detailsAmount){
+          //           e.detailsAmount=e.detailsAmount.toFixed(2);
+          //         }
+          //     } catch (error) {
                   
-              }
-          })
+          //     }
+          // })
           this.totalHeight += this.itemHeight
           this.visibleList1 = res.data.data
           console.log(this.visibleList1, 'this.visibleList1')
@@ -2771,6 +2771,52 @@ export default {
     refresh() {
       this.getSteelReport()
     },
+    //仅仅更新变更数据
+    loadNewData(){
+      const loading = this.$loading({
+        lock: true,
+        text: '正在更新数据,请稍候',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      })
+      let startTime = null
+      let endTime = null
+      if (this.startTime && this.endTime) {
+        startTime = sjTime(this.startTime)
+        endTime = sjTime(this.endTime)
+      }
+      let map= {
+        saleOrderMaterialIds:this.visibleList.map(e=>{
+          return e.saleOrderMaterialId
+        })
+      }
+      console.log("map:",map);
+      this.axios
+        .post(
+          '/api/v1/tms/getSaleSteelReportNew?startTime=' +
+            startTime +
+            '&endTime=' +
+            endTime,
+            map
+        )
+        .then(res => {
+          //遍历旧数组
+          this.visibleList.forEach(e1=>{
+            //遍历新数组
+            let temp = res.data.data.find(e2=>{
+              return e1.saleOrderMaterialId==e2.saleOrderMaterialId
+            })
+            //赋值
+            e1.priceValue=temp.priceValue;
+            e1.detailsAmount=temp.detailsAmount;
+            e1.actualAddress=temp.actualAddress;
+          })
+          loading.close();
+        })
+        .catch(() => {
+          loading.close()
+        })
+    },
     //获取钢材统计报表
     getSteelReport() {
       const loading = this.$loading({
@@ -2851,19 +2897,6 @@ export default {
         )
         .then(res => {
           this.tableData = res.data.data
-          //遍历保留两位小数
-          this.tableData.forEach(e=>{
-              try {
-                  if(e.priceValue){
-                    e.priceValue=e.priceValue.toFixed(2);
-                  }
-                  if(e.detailsAmount){
-                    e.detailsAmount=e.detailsAmount.toFixed(2);
-                  }
-              } catch (error) {
-                  
-              }
-          })
           this.totalHeight += this.itemHeight
           this.visibleList = []
           this.visibleList = this.tableData.slice(
@@ -2903,19 +2936,6 @@ export default {
         )
         .then(res => {
           this.tableData1 = res.data.data
-          //遍历保留两位小数
-          this.tableData1.forEach(e=>{
-              try {
-                  if(e.priceValue){
-                    e.priceValue=e.priceValue.toFixed(2);
-                  }
-                  if(e.detailsAmount){
-                    e.detailsAmount=e.detailsAmount.toFixed(2);
-                  }
-              } catch (error) {
-                  
-              }
-          })
           this.totalHeight += this.itemHeight
           this.visibleList1 = []
           this.visibleList1 = this.tableData1.slice(