Browse Source

修改进口矿样式

zx 3 năm trước cách đây
mục cha
commit
dcae8a53a9

+ 1 - 1
build/utils.js

@@ -23,7 +23,7 @@ let devModules = ['all']
 // let devModules = ['index','sale']
 // let devModules = ['index','SporadicManage','RMS','statisticalReport']
 // let devModules = ['index','inward','statisticalReport']
-//  let devModules = ['index','WMS','sale','TMS','inward','SporadicManage']
+//  let devModules = ['index','WMS','appoint','TMS','inward','SporadicManage']
 // let devModules = ['index','SporadicManage','TMS','statisticalReport','RMS'];
 // let devModules = ['index','RMS'];
 if (pathSrc.indexOf('node_modules') > -1) {

+ 1 - 1
src/views/TMS/components/importedShip/addBargeShip.vue

@@ -65,7 +65,7 @@ export default {
         ),
         bargeBackLocation: this.form.bargeBackLocation,
       };
-      console.log(mapVal);
+    
        if (
       mapVal.smallCapacityId==null||
       mapVal.bargeSmallshipLoadWeight==null||

+ 16 - 4
src/views/TMS/components/importedShip/addLoadShip.vue

@@ -75,8 +75,19 @@ export default {
         resultMemo: this.form.resultMemo,
         userId:getCookie("userId")
       };
-      console.log(mapVal);
-      console.log(this.rowMap)
+           //判断放货数量是否为数字
+       function isNumber() {
+        var value = mapVal.resultActualInstallations;
+        //验证是否为数字
+        var patrn = /^(-)?\d+(\.\d+)?$/;
+        if (patrn.exec(value) == null || value == "") {
+          return false;
+        } else {
+          return true;
+        }
+      }
+      var val=this.value;
+    
       if (
       mapVal.resultActualInstallations==null||
      // mapVal.portId==null||
@@ -88,6 +99,7 @@ export default {
       mapVal.resultOutWharyName==null||
       mapVal.resultOutWharyTime==null
       ) this.$message.error("存在空值!");
+      else if(isNumber(val)) this.$message.warning("实装数量必须为数字!")
       else
       this.axios
         .post(
@@ -98,8 +110,8 @@ export default {
           }
         )
         .then((res) => {
-          console.log("返回成功了")
-          console.log(res)
+          // console.log("返回成功了")
+          // console.log(res)
           if (res.data.code == 200) {
             this.$message({
               type: "success",

+ 49 - 50
src/views/TMS/components/importedShip/addShipLocation.vue

@@ -8,20 +8,22 @@
     </div>
     <div>
       <div class="form-box" style="margin-left: 5rem">
-        <el-form ><dil-form :formId="127" v-model="form"></dil-form>
-        <el-button type="primary" @click="makeSure">新增位置作业</el-button>
+        <el-form
+          ><dil-form :formId="127" v-model="form"></dil-form>
+          <el-button type="primary" @click="makeSure">新增位置作业</el-button>
         </el-form>
       </div>
     </div>
-     <div class="main">
+    <div class="main">
       <span class="text">位置作业新增</span>
       <span class="a"></span>
     </div>
-     <div class="top">
+    <div class="top">
       <el-input placeholder="请输入内容" v-model="input" clearable> </el-input>
-      <el-button type="primary" class="btn" @click="onclick()">
-        <i class="el-icon-search"></i>查询
-      </el-button>   
+           
+      <el-button type="primary" class="btn" @click="onclick()">
+                <i class="el-icon-search"></i>查询      
+      </el-button>
     </div>
     <dilTable v-bind.sync="option" @radio-change="currentRadioChange">
     </dilTable>
@@ -35,7 +37,7 @@ export default {
   components: { PageTitle },
   data() {
     return {
-      input:'',
+      input: "",
       restaurants: [],
       state: "",
       form: {},
@@ -44,78 +46,75 @@ export default {
         requestUrl: "/api/v1/tms/getCapacityList?apiId=138",
         // 控制显示当选列
         selectionType: "radio",
-        shipLocationMap:{},
+        shipLocationMap: {},
       },
     };
   },
-  mounted() {
-  },
+  mounted() {},
   methods: {
     currentRadioChange(row) {
-      this.shipLocationMap=row
+      this.shipLocationMap = row;
       console.log(row);
     },
     // 新增
     makeSure() {
       let mapVal = {
         locationValue: this.form.locationValue,
-        locationRouteTime: sjTime(
-          this.form.locationRouteTime
-        ),
+        locationRouteTime: sjTime(this.form.locationRouteTime),
         locationStatus: this.form.locationStatus,
         locationMemo: this.form.locationMemo,
       };
-      console.log(mapVal);
-      if (mapVal.locationValue==null||
-      mapVal.locationRouteTime==null||
-      mapVal.locationStatus==null||
-      mapVal.locationMemo==null
-      ) this.$message.error("存在空值!");
+
+
+      if (
+        mapVal.locationValue == null ||
+        mapVal.locationRouteTime == null ||
+        mapVal.locationStatus == null ||
+        mapVal.locationMemo == null
+      )
+        this.$message.error("存在空值!");
+    
       else
-      this.axios
-        .post(
-          "/api/v1/tms/addShipLocation",
-          {
+        this.axios
+          .post("/api/v1/tms/addShipLocation", {
             mapVal: mapVal,
-            shipLocationMap: this.shipLocationMap
-          }
-        )
-        .then((res) => {
-          if (res.data.code == 200) {
-            this.$message({
-              type: "success",
-              message: "新增成功!",
-            });
-            // this.$refs.table.refreshData();
-            this.$router.go(-1);
-          } else {
-            this.$message.error("新增失败!");
-          }
-          this.$refs['table'].resetField();
-        });
+            shipLocationMap: this.shipLocationMap,
+          })
+          .then((res) => {
+            if (res.data.code == 200) {
+              this.$message({
+                type: "success",
+                message: "新增成功!",
+              });
+              // this.$refs.table.refreshData();
+              this.$router.go(-1);
+            } else {
+              this.$message.error("新增失败!");
+            }
+            this.$refs["table"].resetField();
+          });
     },
     loadAll() {
-      return [
-
-      ];
+      return [];
     },
     handleSelect(item) {
       console.log(item);
     },
     onclick() {
-      this.option.requestUrl = "/api/v1/tms/getCapacityList?apiId=138&con=" + this.input
+      this.option.requestUrl =
+        "/api/v1/tms/getCapacityList?apiId=138&con=" + this.input;
     },
   },
 };
 </script>
 <style lang='scss' scoped>
-.homeworkPath{
-  .main{
+.homeworkPath {
+  .main {
     margin-bottom: 0.125rem;
   }
-  .button-ins{
-    margin: 0 50rem; 
-    text-align: center
+  .button-ins {
+    margin: 0 50rem;
+    text-align: center;
   }
   .top {
     margin: 0 auto;

+ 108 - 73
src/views/TMS/components/importedShip/addShipmentInstructions.vue

@@ -4,11 +4,11 @@
     <page-title>返回</page-title>
     <div class="form">
       <div class="form_box">
-          <dil-form :formId="114" v-model="form1" ref="from1"></dil-form>
+        <dil-form :formId="114" v-model="form1" ref="from1"></dil-form>
       </div>
       <div class="liulan">
-          <el-button type="primary" class="btn" @click="onDrawer">浏览</el-button>
-      </div>     
+        <el-button type="primary" class="btn" @click="onDrawer">浏览</el-button>
+      </div>
     </div>
     <!-- 确定和取消 -->
     <div class="button_box">
@@ -22,79 +22,114 @@
       :before-close="handleClose"
       size="35%"
     >
-      <el-input placeholder="请输入内容" v-model="input"  style="margin-top:10px;margin-left:20px;width:250px" clearable> </el-input>
-      <el-button type="primary" class="btn" @click="onclick()"  style="margin-bottom:15px">
+      <el-input
+        placeholder="请输入内容"
+        v-model="input"
+        style="margin-top: 10px; margin-left: 20px; width: 250px"
+        clearable
+      >
+      </el-input>
+      <el-button
+        type="primary"
+        class="btn"
+        @click="onclick()"
+        style="margin-bottom: 15px"
+      >
         <i class="el-icon-search"></i>查询
       </el-button>
-    <dilTable v-bind.sync="options" @radio-change="currentRadioChange1" ></dilTable>
+      <dilTable
+        v-bind.sync="options"
+        @radio-change="currentRadioChange1"
+      ></dilTable>
     </el-drawer>
   </div>
 </template>
 
 <script>
 import PageTitle from "@/components/Page/Title";
-import { sjTime,isNumber } from "@/utils/sharedJsFile";
+import { sjTime, isNumber } from "@/utils/sharedJsFile";
 export default {
   components: { PageTitle },
   data() {
     return {
-      drawer:false,
-      direction:"rtl",
-      input:'',
-      options:{
-        requestUrl:"/api/v1/tms/getBatchListForAttorney?apiId=383",
-        selectionType:"radio",
-        maplist:[]
+      drawer: false,
+      direction: "rtl",
+      input: "",
+      options: {
+        requestUrl: "/api/v1/tms/getBatchListForAttorney?apiId=383",
+        selectionType: "radio",
+        maplist: [],
       },
       form1: {},
       value: undefined,
+      batchId:"",
     };
   },
   mounted() {},
   methods: {
-    onDrawer(){
-        this.drawer = true
+    onDrawer() {
+      this.drawer = true;
     },
-    onclick(){
-        this.options.requestUrl = "/api/v1/tms/getBatchList?apiId=383&con=" + this.input
+    onclick() {
+      this.options.requestUrl =
+        "/api/v1/tms/getBatchList?apiId=383&con=" + this.input;
     },
-    currentRadioChange1(selection){
-        this.maplist = selection
-        this.form1 = {
-          batchId:selection.resultForeignShipName + selection.materialName
-                 }
+    currentRadioChange1(selection) {
+      this.maplist = selection;
+      this.form1 = {
+        batchId: selection.resultForeignShipName + selection.materialName,
+      };
     },
-    handleClose(done){
-        done();
+    handleClose(done) {
+      done();
     },
     // 确定
     makeSure() {
+         if (this.batchId == "" || this.batchId == undefined) {
+        this.$message.warning("请选择批次号");
+        return;
+      }
       let omsshipShipmentInstructions = {
         batchId: this.maplist.batchId,
         instructionsTotalTonnage: this.form1.instructionsTotalTonnage,
-        instructionTime: sjTime(
-          this.form1.instructionTime
-        ),
+        instructionTime: sjTime(this.form1.instructionTime),
       };
-      console.log(
-        omsshipShipmentInstructions
-      );
+   
+      //判断合计吨位是否为数字
+      function isNumber() {
+        var value = omsshipShipmentInstructions.instructionsTotalTonnage;
+        //验证是否为数字
+        var patrn = /^(-)?\d+(\.\d+)?$/;
+        if (patrn.exec(value) == null || value == "") {
+          return false;
+        } else {
+          return true;
+        }
+      }
+      var val = this.value;
+
       if (
-      omsshipShipmentInstructions.batchId==null||
-      omsshipShipmentInstructions.instructionsTotalTonnage==null||
-      omsshipShipmentInstructions.instructionTime==null
-      ) this.$message.error("存在空值!");
+        omsshipShipmentInstructions.batchId == null ||
+        omsshipShipmentInstructions.instructionsTotalTonnage == null ||
+        omsshipShipmentInstructions.instructionTime == null
+      )
+        this.$message.error("存在空值!");
+      else if (!isNumber(val)) this.$message.warning("合计吨位请填写数字");
       else
-      this.axios
-        .post(
-          "/api/v1/tms/addShipmentInstructions",
-          omsshipShipmentInstructions
-        )
-        .then((res) => {
-          // console.log(res);
-          // console.log(this.form4);
-          this.$router.go(-1);
-        });
+        this.axios
+          .post(
+            "/api/v1/tms/addShipmentInstructions",
+            omsshipShipmentInstructions
+          )
+          .then((res) => {
+            if (res.data.code == "200") {
+              this.$message({
+                type: "success",
+                message: "新增成功",
+              });
+            }
+            this.$router.go(-1);
+          });
     },
     // 取消
     cancel() {
@@ -105,26 +140,26 @@ export default {
 </script>
 
 <style lang="scss">
-.shipTransport{
-  .form{
+.shipTransport {
+  .form {
     display: flex;
-    .form_box{
+    .form_box {
       width: 320px;
       margin-left: 35%;
       margin-top: 30px;
       margin-right: 20px;
-      .el-form{
-        .preview-group{
-          .el-form-item{
-            .el-form-item__label{
+      .el-form {
+        .preview-group {
+          .el-form-item {
+            .el-form-item__label {
               display: inline-block;
               width: 70px !important;
             }
-            .el-form-item__content{
-              .el-select{
+            .el-form-item__content {
+              .el-select {
                 width: 250px;
               }
-              .el-input{
+              .el-input {
                 width: 250px;
               }
             }
@@ -133,25 +168,25 @@ export default {
       }
     }
   }
-  .liulan{
-      width: 120px;
-      margin-top: 30px;
-      .el-button{
-        width: 100px !important;
-        margin: auto;
-      }
-      .btn{
-        margin-top: 0px;
-      }
-      .btn1{
-        margin-top: 13px;
-      }
-      .btn2{
-        margin-top: 67px;
-      }
+  .liulan {
+    width: 120px;
+    margin-top: 30px;
+    .el-button {
+      width: 100px !important;
+      margin: auto;
+    }
+    .btn {
+      margin-top: 0px;
+    }
+    .btn1 {
+      margin-top: 13px;
+    }
+    .btn2 {
+      margin-top: 67px;
+    }
   }
-  .button_box{
-    margin-left: 45%;
+  .button_box {
+    margin-left: 42.5%;
   }
 }
 </style>

+ 73 - 43
src/views/TMS/components/importedShip/instructionsCapacity.vue

@@ -50,7 +50,7 @@ export default {
       restaurants: [],
       state: "",
       form: {},
-      capacityIds:"",
+      capacityIds: "",
       option: {
         // 表格请求数据的地址
         requestUrl:
@@ -61,21 +61,20 @@ export default {
   },
   methods: {
     onInput() {
-      this.axios.post(
-        "/api/v1/tms/getShipNameList?state="+this.state,
-      )
-      .then((res) => {
-        var values=[];
-        if(res.data.code == "0"){
-          res.data.data.forEach(element => {
-            values.push({
-              value:element.capacityName,
-              capacityId:element.capacityId
-            })
-          });
-        }
-        this.restaurants=values;
-      });
+      this.axios
+        .post("/api/v1/tms/getShipNameList?state=" + this.state)
+        .then((res) => {
+          var values = [];
+          if (res.data.code == "0") {
+            res.data.data.forEach((element) => {
+              values.push({
+                value: element.capacityName,
+                capacityId: element.capacityId,
+              });
+            });
+          }
+          this.restaurants = values;
+        });
     },
     querySearch(queryString, cb) {
       var results = queryString
@@ -92,35 +91,62 @@ export default {
         );
       };
     },
-    handleSelect(item){
-      this.capacityIds=item.capacityId
-      console.log("capacityIds",this.capacityIds)
+    handleSelect(item) {
+      this.capacityIds = item.capacityId;
+      console.log("capacityIds", this.capacityIds);
     },
-    
+
     // 新增
-    
     makeSure() {
       let omsshipInstructionsCapacity = {
-        instructionsId: this.$route.params.instructionsId,
-        state:this.state,
-        capacityName:this.state,
-        capacityIds: this.capacityIds,
-        instructionPlannedLoading: this.form.instructionPlannedLoading,
-        instructionsShipPosition: this.form.instructionsShipPosition,
-        instructionContactInf: this.form.instructionContactInf,
-        instructionsCapacityStatus: this.form.instructionsCapacityStatus,
-        instructionEsarrivalTime: sjTime(this.form.instructionEsarrivalTime),
-      };
-      console.log(omsshipInstructionsCapacity);
-      if (
-        omsshipInstructionsCapacity.state == null ||
-        omsshipInstructionsCapacity.instructionPlannedLoading == null ||
-        omsshipInstructionsCapacity.instructionsShipPosition == null ||
-        omsshipInstructionsCapacity.instructionContactInf == null ||
-        omsshipInstructionsCapacity.instructionsCapacityStatus == null ||
-        omsshipInstructionsCapacity.instructionEsarrivalTime == null
-      )
+        instructionsId: this.$route.params.instructionsId,
+        state: this.state,
+        capacityName: this.state,
+        capacityIds: this.capacityIds,
+        instructionPlannedLoading: this.form.instructionPlannedLoading,
+        instructionsShipPosition: this.form.instructionsShipPosition,
+        instructionContactInf: this.form.instructionContactInf,
+        instructionsCapacityStatus: this.form.instructionsCapacityStatus,
+        instructionEsarrivalTime: sjTime(this.form.instructionEsarrivalTime),
+      };
+      //判断是否为电话号码
+      function isTelePhone() {
+        var value2 = omsshipInstructionsCapacity.instructionContactInf;
+        //验证是否为数字
+        var patrn = /^1[3-9]\d{9}$/;
+        // var patrn2 = /^(\d{3,4}-)?\d{7,8}$/;
+        if (patrn.exec(value2) == null || value2 == "") {
+          return false;
+        } else {
+          return true;
+        }
+      }
+
+      //判断放货数量是否为数字
+      function isNumber() {
+        var value = omsshipInstructionsCapacity.instructionPlannedLoading;
+        //验证是否为数字
+        var patrn = /^(-)?\d+(\.\d+)?$/;
+        if (patrn.exec(value) == null || value == "") {
+          return false;
+        } else {
+          return true;
+        }
+      }
+      var val = this.value;
+      var val2 = this.value2;
+      if (
+        omsshipInstructionsCapacity.state == null ||
+        omsshipInstructionsCapacity.instructionPlannedLoading == null ||
+        omsshipInstructionsCapacity.instructionsShipPosition == null ||
+        omsshipInstructionsCapacity.instructionContactInf == null ||
+        omsshipInstructionsCapacity.instructionsCapacityStatus == null ||
+        omsshipInstructionsCapacity.instructionEsarrivalTime == null ||
+        omsshipInstructionsCapacity.capacityName == null
+      )
         this.$message.error("存在空值!");
+      else if (!isNumber(val)) this.$message.warning("计划装载吨位必须为数字");
+      else if (!isTelePhone(val2)) this.$message.warning("联系方式格式错误");
       else
         this.axios
           .post(
@@ -134,7 +160,11 @@ export default {
                 message: "新增成功!",
               });
               // this.$refs.table.refreshData();
-              this.option.requestUrl = "/api/v1/tms/getCapacities?apiId=76&instructionsId=" + this.$route.params.instructionsId + "&i=" + new Date();
+              this.option.requestUrl =
+                "/api/v1/tms/getCapacities?apiId=76&instructionsId=" +
+                this.$route.params.instructionsId +
+                "&i=" +
+                new Date();
               // this.$router.go(this.option);
             } else {
               this.$message.error("新增失败!");
@@ -181,12 +211,12 @@ export default {
 </script>
 <style lang='scss'>
 .homeworkPath {
-  .shipName{
+  .shipName {
     display: flex;
     justify-content: center;
     align-items: center;
     margin-top: 1.25rem;
-    .text{
+    .text {
       width: 6.25rem;
       text-align: right;
       padding-right: 0.9375rem;

+ 1 - 0
src/views/TMS/components/importedShip/loadShip.vue

@@ -48,6 +48,7 @@ export default {
       // this.option.requestUrl = "/api/v1/tms/getLoadShipList?apiId=63&con=" + this.input;
     },
     click(resultId) {
+      console.log("aaa" +resultId)
       this.$router.push("/updateLoadShip/" + resultId);
     },
     addclick() {

+ 62 - 41
src/views/TMS/components/importedShip/updateShipmentInstructions.vue

@@ -4,8 +4,8 @@
     <page-title>返回</page-title>
     <div class="form">
       <div class="form_box">
-          <dil-form :formId="114" v-model="form1" ref="from1"></dil-form>
-      </div> 
+        <dil-form :formId="114" v-model="form1" ref="from1"></dil-form>
+      </div>
     </div>
     <!-- 确定和取消 -->
     <div class="button_box">
@@ -20,11 +20,11 @@ import PageTitle from "@/components/Page/Title";
 import { sjTime } from "@/utils/sharedJsFile";
 export default {
   components: { PageTitle },
- data(){
-     return {
+  data() {
+    return {
       form1: {},
-  }
- },
+    };
+  },
   mounted() {
     this.information();
   },
@@ -32,13 +32,13 @@ export default {
     information() {
       //编辑装船指令
       this.axios
-        .post("/api/v1/tms/getShipmentInstructions/" + this.$route.params.instructionsId)
+        .post(
+          "/api/v1/tms/getShipmentInstructions/" +
+            this.$route.params.instructionsId
+        )
         .then((res) => {
           res.data.data.forEach((e) => {
             this.form1 = e;
-            // console.log(e);
-            // console.log(this.form1);
-            // console.log(this.$route.params.loadingId);
           });
         });
     },
@@ -55,54 +55,75 @@ export default {
     // 确认
     onClickConfirm() {
       let omsshipShipmentInstructions = {
-        shipmentInstructionsId:this.$route.params.instructionsId,
+        shipmentInstructionsId: this.$route.params.instructionsId,
         // batchId: this.form1.batchId,
         instructionsTotalTonnage: this.form1.instructionsTotalTonnage,
-        instructionTime: sjTime(
-          this.form1.instructionTime
-        ),
+        instructionTime: sjTime(this.form1.instructionTime),
       };
-      this.axios
-        .post("/api/v1/tms/updateShipmentInstructions",
-          omsshipShipmentInstructions)
-        .then((res) => {
-          if (res.data.code == 200) {
-            this.$message({
-              type: "success",
-              message: "修改成功!",
-            });
-            // this.$refs.table.refreshData();
-            this.$router.go(-1);
-          } else {
-            this.$message.error("修改失败!");
-          }
-          this.$refs['table'].resetField();
-        });
+
+      //判断合计吨位是否为数字
+      function isNumber() {
+        var value = omsshipShipmentInstructions.instructionsTotalTonnage;
+        //验证是否为数字
+        var patrn = /^(-)?\d+(\.\d+)?$/;
+        if (patrn.exec(value) == null || value == "") {
+          return false;
+        } else {
+          return true;
+        }
+      }
+      var val = this.value;
+      console.log(omsshipShipmentInstructions);
+      if (
+        omsshipShipmentInstructions.instructionsTotalTonnage == null ||
+        omsshipShipmentInstructions.instructionTime==null
+      )
+        this.$message.error("存在空值!");
+      else if (!isNumber(val)) this.$message.warning("合计吨位请填写数字");
+      else
+        this.axios
+          .post(
+            "/api/v1/tms/updateShipmentInstructions",
+            omsshipShipmentInstructions
+          )
+          .then((res) => {
+            if (res.data.code == 200) {
+              this.$message({
+                type: "success",
+                message: "修改成功!",
+              });
+              // this.$refs.table.refreshData();
+              this.$router.go(-1);
+            } else {
+              this.$message.error("修改失败!");
+            }
+            this.$refs["table"].resetField();
+          });
     },
   },
 };
 </script>
 <style lang="scss">
-.shipTransport{
-  .form{
+.shipTransport {
+  .form {
     display: flex;
-    .form_box{
+    .form_box {
       width: 320px;
       margin-left: 35%;
       margin-top: 30px;
       margin-right: 20px;
-      .el-form{
-        .preview-group{
-          .el-form-item{
-            .el-form-item__label{
+      .el-form {
+        .preview-group {
+          .el-form-item {
+            .el-form-item__label {
               display: inline-block;
               width: 70px !important;
             }
-            .el-form-item__content{
-              .el-select{
+            .el-form-item__content {
+              .el-select {
                 width: 250px;
               }
-              .el-input{
+              .el-input {
                 width: 250px;
               }
             }
@@ -111,7 +132,7 @@ export default {
       }
     }
   }
-  .button_box{
+  .button_box {
     margin-left: 45%;
   }
 }

+ 2 - 0
src/views/TMS/router/index.js

@@ -137,6 +137,7 @@ import updateShipLocation from '../components/importedShip/updateShipLocation'
 import updateShipmentInstructions from '../components/importedShip/updateShipmentInstructions'
 import updateUnloadShip from '../components/importedShip/updateUnloadShip.vue'
 import updateWaterQuality from '../components/importedShip/updateWaterQuality.vue'
+import updateLoadShip from '../components/importedShip/updateLoadShip.vue'
 import waterQuality from '../components/importedShip/waterQuality.vue'
 
 import assignmentPlan from '../components/importedTruck/assignmentPlan.vue'
@@ -345,6 +346,7 @@ const constantRouterMap = [
       {path: 'updateUnloadShip/:resultId', name: 'updateUnloadShip', meta: {code: 'xtpzgl-yhgl'}, component: updateUnloadShip},
       {path: 'updateWaterQuality/:resultId', name: 'updateWaterQuality', meta: {code: 'xtpzgl-yhgl'}, component: updateWaterQuality},
       {path: 'waterQuality', name: 'waterQuality', meta: {code: 'xtpzgl-yhgl'}, component: waterQuality},
+      {path: 'updateLoadShip/:resultId', name: 'updateLoadShip', meta: {code: 'xtpzgl-yhgl'}, component: updateLoadShip},
 
       {path: 'assignmentPlan', name: 'assignmentPlan', meta: {code: 'xtpzgl-yhgl'}, component: assignmentPlan},
       {path: 'breakdownPlan', name: 'breakdownPlan', meta: {code: 'xtpzgl-yhgl'}, component: breakdownPlan},

+ 32 - 1
src/views/appoint/components/ship/addCargoResult.vue

@@ -105,6 +105,7 @@ export default {
       },
     };
   },
+  
   mounted() {},
   methods: {
     currentRadioChange() {
@@ -126,6 +127,9 @@ export default {
     currentRadioChange3(selection) {
       (this.second2.mapList3 = selection), (this.receiver = selection.pierName);
     },
+    
+
+
 
     // 确定git
     makeSure() {
@@ -153,7 +157,32 @@ export default {
         materialId: this.second.mapList1.materialId,
         userId:getCookie("userId")
       };
-      console.log(AmsshipCargoTransferResult)
+       //判断放货数量是否为数字
+       function isNumber() {
+        var value = AmsshipCargoTransferResult.resultNumberOfLoans;
+        //验证是否为数字
+        var patrn = /^(-)?\d+(\.\d+)?$/;
+        if (patrn.exec(value) == null || value == "") {
+          return false;
+        } else {
+          return true;
+        }
+      }
+      //判断是否为电话号码
+       function isTelePhone() {
+        var value2 = AmsshipCargoTransferResult.resultTelephoneFax;
+        //验证是否为数字
+        var patrn  = /^1[3-9]\d{9}$/;
+        // var patrn2 = /^(\d{3,4}-)?\d{7,8}$/;
+        if (patrn.exec(value2) == null || value2 == "") {
+          return false;
+        } else {
+          return true;
+        }
+      }
+      //电话号码赋值
+      var val2=this.value2;
+      var val = this.value;
       if (
         AmsshipCargoTransferResult.foreignShipName == null ||
         AmsshipCargoTransferResult.resultNumberOfLoans == null ||
@@ -161,6 +190,8 @@ export default {
         AmsshipCargoTransferResult.resultTelephoneFax == null
       )
         this.$message.error("存在空值!");
+          else if (!isNumber(val)) this.$message.warning("放货数量必须为数字");
+            else if (!isTelePhone(val2)) this.$message.warning("电话号码或传真格式不正确");  
       else
         this.axios
           .post(

+ 76 - 43
src/views/appoint/components/ship/addDeliveryAttorney.vue

@@ -4,11 +4,11 @@
     <page-title>返回</page-title>
     <div class="form">
       <div class="form_box">
-          <dil-form :formId="113" v-model="form1" ref="from1"></dil-form>
+        <dil-form :formId="113" v-model="form1" ref="from1"></dil-form>
       </div>
       <div class="liulan">
-          <el-button type="primary" class="btn" @click="onDrawer">浏览</el-button>
-      </div>     
+        <el-button type="primary" class="btn" @click="onDrawer">浏览</el-button>
+      </div>
     </div>
     <!-- 确定和取消 -->
     <div class="button_box">
@@ -25,7 +25,7 @@
       <el-input
         placeholder="请输入内容"
         v-model="input"
-        style="margin-top: 10px; margin-left: 20px; width:250px"
+        style="margin-top: 10px; margin-left: 20px; width: 250px"
         clearable
       >
       </el-input>
@@ -46,7 +46,7 @@
 </template>
 <script>
 import PageTitle from "@/components/Page/Title";
-import { sjTime,isNumber } from "@/utils/sharedJsFile";
+import { sjTime, isNumber } from "@/utils/sharedJsFile";
 import { getCookie } from "@/utils/util.js";
 export default {
   components: { PageTitle },
@@ -60,9 +60,15 @@ export default {
         selectionType: "radio",
         maplist: [],
       },
-      batchIds:"",
+      batchIds: "",
       form1: {},
       value: undefined,
+      value2: undefined,
+    };
+  },
+  created() {
+    this.form1 = {
+      downSwimPortId: 1,
     };
   },
   mounted() {},
@@ -81,15 +87,14 @@ export default {
       this.form1 = {
         batchId: radio.resultForeignShipName + radio.materialName,
       };
-      this.batchIds = radio.batchId
+      this.batchIds = radio.batchId;
     },
     // 确定
     makeSure() {
-      console.log("批次号"+this.batchIds)
       // 判断用户是否输入了批次号
-      if(this.batchIds==""||this.batchIds==undefined){
-        this.$message.warning("请选择批次号")
-        return
+      if (this.batchIds == "" || this.batchIds == undefined) {
+        this.$message.warning("请选择批次号");
+        return;
       }
       let AmsshipDeliveryAttorney = {
         downSwimPortId: this.form1.downSwimPortId,
@@ -101,18 +106,47 @@ export default {
         noticeId: this.form1.noticeId,
         portId: this.form1.portId,
         attorneyPickupContactPerson: this.form1.attorneyPickupContactPerson,
-        userId:getCookie("userId"),
+        userId: getCookie("userId"),
         // resultMemo: this.form1.resultMemo,
       };
-      console.log(AmsshipDeliveryAttorney)
+      //身份证校验
+       function checkCardNo() {
+        var value3 = AmsshipDeliveryAttorney.attorenyPickupIdcard;
+        //验证是否为数字
+        var patrn = /^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/;
+        // var patrn2 = /^(\d{3,4}-)?\d{7,8}$/;
+        if (patrn.exec(value3) == null || value3 == "") {
+          return false;
+        } else {
+          return true;
+        }
+      }
+
+      //判断是否为电话号码
+      function isTelePhone() {
+        var value2 = AmsshipDeliveryAttorney.attorneyContactTelephone;
+        //验证是否为数字
+        var patrn = /^1[3-9]\d{9}$/;
+        // var patrn2 = /^(\d{3,4}-)?\d{7,8}$/;
+        if (patrn.exec(value2) == null || value2 == "") {
+          return false;
+        } else {
+          return true;
+        }
+      }
+      var val2 = this.value2;
+      var val3 = this.value3;
+
       if (
         // AmsshipDeliveryAttorney.attorneyId==null||
         // AmsshipDeliveryAttorney.downSwimPortId == null ||
-        // AmsshipDeliveryAttorney.attorenyPickupIdcard == null ||
-        // AmsshipDeliveryAttorney.attorneyContactTelephone == null ||
+        AmsshipDeliveryAttorney.attorenyPickupIdcard == null ||
+        AmsshipDeliveryAttorney.attorneyContactTelephone == null ||
         AmsshipDeliveryAttorney.attorneyPickupContactPerson == null
       )
         this.$message.error("存在空值,请核实以后再提交");
+      else if (!isTelePhone(val2)) this.$message.warning("联系电话格式不正确");
+       else if (!checkCardNo(val3)) this.$message.warning("请输入正确的身份证格式");
       else
         this.axios
           .post(
@@ -131,26 +165,26 @@ export default {
 };
 </script>
 <style lang='scss'>
-.shipTransport{
-  .form{
+.shipTransport {
+  .form {
     display: flex;
-    .form_box{
+    .form_box {
       width: 320px;
       margin-left: 35%;
       margin-top: 30px;
       margin-right: 20px;
-      .el-form{
-        .preview-group{
-          .el-form-item{
-            .el-form-item__label{
+      .el-form {
+        .preview-group {
+          .el-form-item {
+            .el-form-item__label {
               display: inline-block;
               width: 70px !important;
             }
-            .el-form-item__content{
-              .el-select{
+            .el-form-item__content {
+              .el-select {
                 width: 250px;
               }
-              .el-input{
+              .el-input {
                 width: 250px;
               }
             }
@@ -159,27 +193,26 @@ export default {
       }
     }
   }
-  .liulan{
-      width: 120px;
-      margin-top: 30px;
-      .el-button{
-        width: 100px !important;
-        margin: auto;
-      }
-      .btn{
-        margin-top: 0px;
-      }
-      .btn1{
-        margin-top: 13px;
-      }
-      .btn2{
-        margin-top: 67px;
-      }
+  .liulan {
+    width: 120px;
+    margin-top: 30px;
+    .el-button {
+      width: 100px !important;
+      margin: auto;
+    }
+    .btn {
+      margin-top: 0px;
+    }
+    .btn1 {
+      margin-top: 13px;
+    }
+    .btn2 {
+      margin-top: 67px;
+    }
   }
-  .button_box{
+  .button_box {
     margin-left: 45%;
   }
 }
-
 </style>
 

+ 174 - 94
src/views/appoint/components/ship/addDeliveryNotice.vue

@@ -4,11 +4,16 @@
     <page-title>返回</page-title>
     <div class="form">
       <div class="form_box">
-          <dil-form :formId="112" v-model="form1" ref="from1" @change="onchange"></dil-form>
+        <dil-form
+          :formId="112"
+          v-model="form1"
+          ref="from1"
+          @change="onchange"
+        ></dil-form>
       </div>
       <div class="liulan">
-          <el-button type="primary" class="btn" @click="onDrawer">浏览</el-button>
-      </div>     
+        <el-button type="primary" class="btn" @click="onDrawer">浏览</el-button>
+      </div>
     </div>
     <!-- 确定和取消 -->
     <div class="button_box">
@@ -22,100 +27,175 @@
       :before-close="handleClose"
       size="50%"
     >
-      <el-input placeholder="请输入内容" v-model="input"  style="margin-top:10px;margin-left:20px;width:250px" clearable> </el-input>
-      <el-button type="primary" class="btn" @click="onclick()"  style="margin-bottom:15px">
+      <el-input
+        placeholder="请输入内容"
+        v-model="input"
+        style="margin-top: 10px; margin-left: 20px; width: 250px"
+        clearable
+      >
+      </el-input>
+      <el-button
+        type="primary"
+        class="btn"
+        @click="onclick()"
+        style="margin-bottom: 15px"
+      >
         <i class="el-icon-search"></i>查询
       </el-button>
-    <dilTable v-bind.sync="options" @radio-change="currentRadioChange1" ></dilTable>
+      <dilTable
+        v-bind.sync="options"
+        @radio-change="currentRadioChange1"
+      ></dilTable>
     </el-drawer>
   </div>
 </template>
 
 <script>
 import PageTitle from "@/components/Page/Title";
-import { sjTime,isNumber } from "@/utils/sharedJsFile";
+import { sjTime, isNumber } from "@/utils/sharedJsFile";
 import { getCookie } from "@/utils/util.js";
 export default {
   components: { PageTitle },
   data() {
     return {
-      input:'',
-      drawer:false,
-      direction:"rtl",
-      batchId:"",
+      input: "",
+      drawer: false,
+      direction: "rtl",
+      batchId: "",
       form1: {},
-      options:{
-        requestUrl:"/api/v1/tms/getBatchListForAttorney?apiId=375",
-        selectionType:"radio",
-        maplist:[]
+      options: {
+        requestUrl: "/api/v1/tms/getBatchListForAttorney?apiId=375",
+        selectionType: "radio",
+        maplist: [],
       },
       value: undefined,
+      value2: undefined,
+      value4: undefined,
+      value5: undefined,
+      value6: undefined,
+      value7: undefined,
+      value8: undefined,
     };
   },
   mounted() {},
   methods: {
-    onDrawer(){
-        this.drawer = true
-    },
-    onchange(val){
-     
+    onDrawer() {
+      this.drawer = true;
     },
-    onclick(){
-        this.options.requestUrl = "/api/v1/tms/getBatchList?apiId=375&con=" + this.input
+    onchange(val) {},
+    onclick() {
+      this.options.requestUrl =
+        "/api/v1/tms/getBatchList?apiId=375&con=" + this.input;
     },
-    currentRadioChange1(selection){
-        this.maplist = selection
-        this.form1 = { batchId:selection.resultForeignShipName + selection.materialName}
-        this.batchId = selection.batchId;
+    currentRadioChange1(selection) {
+      this.maplist = selection;
+      this.form1 = {
+        batchId: selection.resultForeignShipName + selection.materialName,
+      };
+      this.batchId = selection.batchId;
     },
-    handleClose(done){
-        done();
+    handleClose(done) {
+      done();
     },
-     makeSure() {
+    makeSure() {
       // 判断批次号选择是否为空
-      if(this.batchId==""||this.batchId==undefined){
-        this.$message.warning("请选择批次号")
-        return
+      if (this.batchId == "" || this.batchId == undefined) {
+        this.$message.warning("请选择批次号");
+        return;
       }
       let map = {
-       carrierId:this.form1.carrierId,
-       requesterGroupId:this.form1.requesterGroupId,
-       noticeCommerceMethod:this.form1.noticeCommerceMethod,
-       noticeHandoverMethod:this.form1.noticeHandoverMethod,
-       portId:this.form1.portId,
-       noticePortConstructionFee:this.form1.noticePortConstructionFee,
-       noticeDeliveryTime:sjTime(this.form1.noticeDeliveryTime),
-       noticePileFreeDays:this.form1.noticePileFreeDays,
-       batchId:this.batchId,
-       purchaseContractUnitPrice:this.form1.purchaseContractUnitPrice,
-       purchaseContractMoisture:this.form1.purchaseContractMoisture,
-       purchaseContractQualityindex:this.form1.purchaseContractQualityindex,
-       //微元素含量
-       tfeContent:this.form1.tfeContent,
-       silicaContent:this.form1.silicaContent,
-       aluminaContent:this.form1.aluminaContent,
-       phosphorusContent:this.form1.phosphorusContent,
-       manganeseContent:this.form1.manganeseContent,
-       userId:getCookie("userId")
-       
+        carrierId: this.form1.carrierId,
+        requesterGroupId: this.form1.requesterGroupId,
+        noticeCommerceMethod: this.form1.noticeCommerceMethod,
+        noticeHandoverMethod: this.form1.noticeHandoverMethod,
+        portId: this.form1.portId,
+        noticePortConstructionFee: this.form1.noticePortConstructionFee,
+        noticeDeliveryTime: sjTime(this.form1.noticeDeliveryTime),
+        noticePileFreeDays: this.form1.noticePileFreeDays,
+        batchId: this.batchId,
+        purchaseContractUnitPrice: this.form1.purchaseContractUnitPrice,
+        purchaseContractMoisture: this.form1.purchaseContractMoisture,
+        //微元素含量
+        tfeContent: this.form1.tfeContent,
+        silicaContent: this.form1.silicaContent,
+        aluminaContent: this.form1.aluminaContent,
+        phosphorusContent: this.form1.phosphorusContent,
+        manganeseContent: this.form1.manganeseContent,
+        userId: getCookie("userId"),
       };
-      console.log(map)
+
+      //判断放货数量是否为数字
+      function isNumber() {
+        var value = map.noticePileFreeDays;
+        var value2 = map.purchaseContractUnitPrice;
+        var value4 = map.tfeContent;
+        var value5 = map.silicaContent;
+        var value6 = map.aluminaContent;
+        var value7 = map.phosphorusContent;
+        var value8 = map.manganeseContent;
+        //验证是否为数字
+        var patrn = /^(-)?\d+(\.\d+)?$/;
+        if (patrn.exec(value) == null || value == "") {
+          return false;
+        } else if (patrn.exec(value2) == null || value2 == "") {
+          return false;
+        } else if (patrn.exec(value4) == null || value4 == "") {
+          return false;
+        } else if (patrn.exec(value5) == null || value5 == "") {
+          return false;
+        } else if (patrn.exec(value6) == null || value6 == "") {
+          return false;
+        } else if (patrn.exec(value7) == null || value7 == "") {
+          return false;
+        } else if (patrn.exec(value8) == null || value8 == "") {
+          return false;
+        } else {
+          return true;
+        }
+      }
+      //定义变量
+      var val = this.value;
+      var val2 = this.value2;
+      var val4 = this.value4;
+      var val5 = this.value5;
+      var val6 = this.value6;
+      var val7 = this.value7;
+      var val8 = this.value8;
       if (
-        // AmsshipDeliveryAttorney.attorneyId==null||
-        // AmsshipDeliveryAttorney.downSwimPortId==null||
-        // AmsshipDeliveryAttorney.attorenyPickupIdcard==null||
-        // AmsshipDeliveryAttorney.attorneyContactTelephone==null||
-        // AmsshipDeliveryAttorney.attorneyTime==null||
-        // AmsshipDeliveryAttorney.attorneyPdffile==null
-        map.noticeHandoverMethod==null
-      ) this.$message.error("存在空值!");
+        map.noticeCommerceMethod == null ||
+        map.noticeHandoverMethod == null ||
+        map.noticePortConstructionFee == null ||
+        map.noticeDeliveryTime == null ||
+        map.noticePileFreeDays == null ||
+        map.purchaseContractUnitPrice == null ||
+        map.purchaseContractMoisture == null ||
+        map.tfeContent == null ||
+        map.silicaContent == null ||
+        map.aluminaContent == null ||
+        map.phosphorusContent == null ||
+        map.manganeseContent == null
+      )
+        this.$message.error("存在空值!");
+      else if (!isNumber(val)) this.$message.warning("免堆天数必须为数字");
+      else if (!isNumber(val2)) this.$message.warning("单价必须为数字");
+      else if (!isNumber(val4)) this.$message.warning("TFe含量必须为数字");
+      else if (!isNumber(val5)) this.$message.warning("二氧化硅含量必须为数字");
+      else if (!isNumber(val6)) this.$message.warning("氧化铝含量必须为数字");
+      else if (!isNumber(val7)) this.$message.warning("磷含量必须为数字");
+      else if (!isNumber(val8)) this.$message.warning("锰含量必须为数字");
       else
-      this.axios
-        .post(
-          "/api/v1/tms/insertDeliveryNotice",
-           map
-        )
-        .then((res) => {
+        this.axios.post("/api/v1/tms/insertDeliveryNotice", map).then((res) => {
+          if (res.data.code == 200) {
+            // this.$router.push("/ship/cargoResult");
+            this.$message({
+              type: "success",
+              message: "新增成功",
+            });
+          } else {
+            this.$message({
+              message: res.data.data,
+            });
+          }
           this.$router.go(-1);
         });
     },
@@ -127,26 +207,26 @@ export default {
 };
 </script>
 <style lang='scss'>
-.shipTransport{
-  .form{
+.shipTransport {
+  .form {
     display: flex;
-    .form_box{
+    .form_box {
       width: 320px;
       margin-left: 35%;
       margin-top: 30px;
       margin-right: 20px;
-      .el-form{
-        .preview-group{
-          .el-form-item{
-            .el-form-item__label{
+      .el-form {
+        .preview-group {
+          .el-form-item {
+            .el-form-item__label {
               display: inline-block;
               width: 70px !important;
             }
-            .el-form-item__content{
-              .el-select{
+            .el-form-item__content {
+              .el-select {
                 width: 250px;
               }
-              .el-input{
+              .el-input {
                 width: 250px;
               }
             }
@@ -155,24 +235,24 @@ export default {
       }
     }
   }
-  .liulan{
-      width: 120px;
-      margin-top: 30px;
-      .el-button{
-        width: 100px !important;
-        margin: auto;
-      }
-      .btn{
-        margin-top: 0px;
-      }
-      .btn1{
-        margin-top: 13px;
-      }
-      .btn2{
-        margin-top: 67px;
-      }
+  .liulan {
+    width: 120px;
+    margin-top: 30px;
+    .el-button {
+      width: 100px !important;
+      margin: auto;
+    }
+    .btn {
+      margin-top: 0px;
+    }
+    .btn1 {
+      margin-top: 13px;
+    }
+    .btn2 {
+      margin-top: 67px;
+    }
   }
-  .button_box{
+  .button_box {
     margin-left: 45%;
   }
 }

+ 2 - 2
src/views/appoint/components/ship/attorneytext.vue

@@ -89,9 +89,9 @@
         <el-button class="buttn"  type="primary" @click="getPdf()">
             <i class="el-icon-download">{{"\xa0\xa0"}}</i>导出(pdf)
         </el-button>
-        <el-button class="buttn"  type="primary" v-print="'#pdfDom'" @click="backScan()">
+        <!-- <el-button class="buttn"  type="primary" v-print="'#pdfDom'" @click="backScan()">
             <i class="el-icon-printer">{{"\xa0\xa0"}}</i>打印
-        </el-button>
+        </el-button> -->
       </div>
   </div>
 </template>

+ 1 - 1
src/views/appoint/components/ship/cargoResult.vue

@@ -44,7 +44,7 @@ export default {
 
   methods: {
     onclick() {
-      console.log(this.input)
+      // console.log(this.input)
       this.option.requestUrl = "/api/v1/tms/getAmsshipCargoTranferResultList?apiId=66&con=" + this.input;
     },
     addClick() {

+ 18 - 42
src/views/appoint/components/ship/deliveryAttorney.vue

@@ -79,10 +79,9 @@ export default {
   name: "homeworkPath",
   data() {
     return {
-      // restaurants: [],
       input: "",
       activeName: "first",
-      amsShipDeliveryList: {},
+      attorneyId: null,
       option1: {
         // 表格请求数据的地址
         requestUrl:
@@ -92,44 +91,20 @@ export default {
         // 表格请求数据的地址
         requestUrl:
           "/api/v1/tms/getAmsshipDeliveryAttroneyList?apiId=73&status=1",
-        selectionType: "select",
-        amsShipList: [],
+        selectionType: "radio",
+        amsShipDeliveryList: {},
       },
     };
   },
 
   methods: {
-    // querySearch(queryString, cb) {
-    //   var restaurants = this.restaurants;
-    //   var results = queryString
-    //     ? restaurants.filter(this.createFilter(queryString))
-    //     : restaurants;
-    //   cb(results);
-    // },
-    // createFilter(queryString) {
-    //   return (restaurant) => {
-    //     return (
-    //       restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) ===
-    //       0
-    //     );
-    //   };
-    // },
     // 将所有数据送到新增提货委托书
-    makeSure() {
-      // let amsShipDeliveryList={
-      //   amsShipDeliveryList=this.amsShipDeliveryList
-      // }
-    },
-    // 通过事件显示生成提货委托书按钮
+    handleClick(tab, event) {},
+    onclick() {},
+    makeSure() {},
     currentSelectionChange(selection) {
       this.amsShipDeliveryList = selection;
-    },
-    handleClick(tab, event) {
-      console.log(tab, event);
-    },
-    onclick() {
-      // this.option.requestUrl =
-      //   "/api/v1/tms/getAmsshipDeliveryAttroneyList?apiId=73&con=" + this.input;
+      this.attorneyId = selection.attorneyId;
     },
     click(pathId) {
       this.$router.push("/path/addDeliveryNotice/" + pathId);
@@ -138,18 +113,19 @@ export default {
       this.$router.push("/addDeliveryAttorney/");
     },
     // 生成提货委托书
-    addPick(){
-      // console.log("enter")
-      // console.log(this.amsShipDeliveryList);
-      let amsShipDeliveryNameList={
-        amsShipDeliveryNameList:this.amsShipDeliveryList
-        
+    addPick() {
+      if (this.amsShipDeliveryList.length == 0||this.amsShipDeliveryList==null) {
+        this.$message.warning("请勾选已下发的提货委托,方可生成提货委托书");
+        return;
+      } else {
+        let amsShipDeliveryNameList = {
+          amsShipDeliveryNameList: this.amsShipDeliveryList,
+        };
+        let test = encodeURIComponent(JSON.stringify(amsShipDeliveryNameList));
+        this.$router.push("/attorneytext/" + test);
       }
-      // console.log(amsShipDeliveryNameList)
-      let test = encodeURIComponent(JSON.stringify(amsShipDeliveryNameList))
-      console.log("test   "+test)
-      this.$router.push("/attorneytext/"+test);
     },
+    //修改
     modifyClick(attorneyId) {
       this.$router.push("/modifyDeliveryAttroney/" + attorneyId);
     },

+ 42 - 15
src/views/appoint/components/ship/modifyCargoResult.vue

@@ -3,11 +3,11 @@
   <div class="shipTransport">
     <page-title>返回</page-title>
     <!-- 物资 -->
-      <div class="mofrom">
+      <!-- <div class="mofrom">
         <span class="motext">物资</span>
         <el-input class="moinput" v-model="materialName" disabled> </el-input>
         <el-button class="mobutton" type="primary" @click="ondrawer(1)">浏览</el-button>
-      </div>
+      </div> -->
       <div class="mofrom">
         <span class="motext">收货人</span>
         <el-input class="moinput" v-model="receiver" disabled> </el-input>
@@ -130,7 +130,7 @@ export default {
       (this.second2.mapList3 = selection), (this.receiver = selection.pierName);
     },
     information() {
-      //编辑请车作业
+      //编辑货权转移
       this.axios
         .post("/api/v1/tms/selectByCargoTranferResultId/" + this.$route.params.cargoTransferResultId)
         .then((res) => {
@@ -138,15 +138,6 @@ export default {
           this.form1 = res.data.data
           this.materialName = res.data.data.materialName;
           this.receiver = res.data.data.receiver;
-          // res.data.data.forEach((e) => {
-          //   console.log(e)
-          //   this.form1 = e;
-            // this.materialName = e.materialName;
-            // this.receiver = e.receiver;
-          //   console.log(e);
-          //   console.log(this.form1);
-          //   console.log(this.$route.params.pathId);
-          // });
         });
     },
     // 确认
@@ -154,16 +145,52 @@ export default {
       let AmsshipCargoTransferResult = {
         cargoTransferResultId: this.$route.params.cargoTransferResultId,
         carrierId: this.form1.carrierId,
-        groupId: this.form1.groupId,
-     
+        groupId: this.form1.groupId,     
         resultTelephoneFax: this.form1.resultTelephoneFax,
         resultContactPerson:this.form1.resultContactPerson,
         batchId:this.form1.batchId,
         resultNumberOfLoans: this.form1.resultNumberOfLoans,
         resultFreignForwardingInfo: this.form1.resultFreignForwardingInfo,
         resultMemo: this.form1.resultMemo,
+        foreignShipName: this.form1.foreignShipName,
+        materialId: this.second.mapList1.materialId,
       };
-      this.axios
+         //判断放货数量是否为数字
+       function isNumber() {
+        var value = AmsshipCargoTransferResult.resultNumberOfLoans;
+        //验证是否为数字
+        var patrn = /^(-)?\d+(\.\d+)?$/;
+        if (patrn.exec(value) == null || value == "") {
+          return false;
+        } else {
+          return true;
+        }
+      }
+      //判断是否为电话号码
+       function isTelePhone() {
+        var value2 = AmsshipCargoTransferResult.resultTelephoneFax;
+        //验证是否为数字
+        var patrn  = /^1[3-9]\d{9}$/;
+        // var patrn2 = /^(\d{3,4}-)?\d{7,8}$/;
+        if (patrn.exec(value2) == null || value2 == "") {
+          return false;
+        } else {
+          return true;
+        }
+      }
+      //电话号码赋值
+      var val2=this.value2;
+      var val = this.value;
+       if (
+        AmsshipCargoTransferResult.foreignShipName == null ||
+        AmsshipCargoTransferResult.resultNumberOfLoans == null ||
+        AmsshipCargoTransferResult.resultContactPerson == null ||
+        AmsshipCargoTransferResult.resultTelephoneFax == null
+      )
+        this.$message.error("存在空值!");
+          else if (!isNumber(val)) this.$message.warning("放货数量必须为数字");
+            else if (!isTelePhone(val2)) this.$message.warning("电话号码或传真格式不正确");  
+      else this.axios
         .post("/api/v1/tms/editCargoTransferResult" ,
          AmsshipCargoTransferResult
         )

+ 79 - 36
src/views/appoint/components/ship/modifyDeliveryAttroney.vue

@@ -4,8 +4,8 @@
     <page-title>返回</page-title>
     <div class="form">
       <div class="form_box">
-          <dil-form :formId="113" v-model="form1"></dil-form>
-      </div>        
+        <dil-form :formId="113" v-model="form1"></dil-form>
+      </div>
     </div>
     <!-- 确定和取消 -->
     <div class="button_box">
@@ -17,14 +17,16 @@
 
 <script>
 import PageTitle from "@/components/Page/Title";
-import { sjTime } from '../../../ADMINISTRATORS/app';
+import { sjTime } from "../../../ADMINISTRATORS/app";
 export default {
   components: { PageTitle },
-    data(){
-          return {
-          form1: {},
-        }
-    },
+  data() {
+    return {
+      form1: {},
+      value2: undefined,
+      value3: undefined,
+    };
+  },
   mounted() {
     this.information();
   },
@@ -32,63 +34,104 @@ export default {
     information() {
       //编辑请车作业
       this.axios
-        .post("/api/v1/tms/getDeliveryAttorneyId/" + this.$route.params.attorneyId)
+        .post(
+          "/api/v1/tms/getDeliveryAttorneyId/" + this.$route.params.attorneyId
+        )
         .then((res) => {
           res.data.data.forEach((e) => {
             this.form1 = e;
           });
         });
     },
-     // 返回
+    // 返回
     onClickCancel() {
       this.$router.go(-1);
     },
-     // 确认
+    // 确认
     onClickConfirm() {
       let AmsshipDeliveryAttorney = {
         resultId: this.$route.params.attorneyId,
         portId: this.form1.portId,
-        attorneyContactTelephone:this.form1.attorneyContactTelephone,
-        attorenyPickupIdcard:this.form1.attorenyPickupIdcard,
-        attorneyPickupContactPerson:this.form1.attorneyPickupContactPerson,
-        downSwimPortId:this.form1.downSwimPortId,
-        attorneyTime:sjTime(this.form1.attorneyTime),
+        attorneyContactTelephone: this.form1.attorneyContactTelephone,
+        attorenyPickupIdcard: this.form1.attorenyPickupIdcard,
+        attorneyPickupContactPerson: this.form1.attorneyPickupContactPerson,
+        downSwimPortId: this.form1.downSwimPortId,
+        attorneyTime: sjTime(this.form1.attorneyTime),
       };
-      this.axios
-        .post("/api/v1/tms/editDeliveryAttroney",AmsshipDeliveryAttorney
-        )
-        .then(() => {
-          this.$message({
-            type: "success",  
-            message: "修改成功!",
+
+      //身份证校验
+      function checkCardNo() {
+        var value3 = AmsshipDeliveryAttorney.attorenyPickupIdcard;
+        //验证是否为数字
+        var patrn =
+          /^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/;
+        if (patrn.exec(value3) == null || value3 == "") {
+          return false;
+        } else {
+          return true;
+        }
+      }
+
+      //判断是否为电话号码
+      function isTelePhone() {
+        var value2 = AmsshipDeliveryAttorney.attorneyContactTelephone;
+        //验证是否为数字
+        var patrn = /^1[3-9]\d{9}$/;
+        // var patrn2 = /^(\d{3,4}-)?\d{7,8}$/;
+        if (patrn.exec(value2) == null || value2 == "") {
+          return false;
+        } else {
+          return true;
+        }
+      }
+      var val2 = this.value2;
+      var val3 = this.value3;
+      if (
+        AmsshipDeliveryAttorney.attorneyTime == null ||
+        AmsshipDeliveryAttorney.attorenyPickupIdcard == null ||
+        AmsshipDeliveryAttorney.attorneyContactTelephone == null ||
+        AmsshipDeliveryAttorney.attorneyPickupContactPerson == null
+      )
+        this.$message.error("存在空值,请核实以后再提交");
+      else if (!isTelePhone(val2)) this.$message.warning("联系电话格式不正确");
+      else if (!checkCardNo(val3)) this.$message.warning("请输入正确的身份证格式");
+      else
+        this.axios
+          .post("/api/v1/tms/editDeliveryAttroney", AmsshipDeliveryAttorney)
+          .then((res) => {
+            if (res.data.code == 200) {
+              this.$message({
+                type: "success",
+                message: "修改成功!",
+              });
+            }
+            this.$router.go(-1);
           });
-          this.$router.go(-1);
-        });
     },
   },
 };
 </script>
 <style lang="scss">
-.shipTransport{
-  .form{
+.shipTransport {
+  .form {
     display: flex;
-    .form_box{
+    .form_box {
       width: 320px;
       margin-left: 35%;
       margin-top: 30px;
       margin-right: 20px;
-      .el-form{
-        .preview-group{
-          .el-form-item{
-            .el-form-item__label{
+      .el-form {
+        .preview-group {
+          .el-form-item {
+            .el-form-item__label {
               display: inline-block;
               width: 70px !important;
             }
-            .el-form-item__content{
-              .el-select{
+            .el-form-item__content {
+              .el-select {
                 width: 250px;
               }
-              .el-input{
+              .el-input {
                 width: 250px;
               }
             }
@@ -97,7 +140,7 @@ export default {
       }
     }
   }
-  .button_box{
+  .button_box {
     margin-left: 45%;
   }
 }