liyg 2 سال پیش
والد
کامیت
788401a884

+ 132 - 0
src/views/TMS/components/bmsship/threeSectionFeeDetails.vue

@@ -0,0 +1,132 @@
+<template>
+  <!-- 装船作业页面 -->
+  <div class="shipTransport">
+    <div class="top">
+      <el-input
+        class="el-input"
+        placeholder="请输入内容"
+        v-model="input"
+        clearable
+      >
+      </el-input>
+<!-- 
+       <el-date-picker v-model="startTime" type="datetime" placeholder="选择日期"></el-date-picker>
+      <span>至</span>
+      <el-date-picker v-model="endTime" type="datetime" placeholder="选择日期"></el-date-picker> -->
+
+      <el-button type="primary" class="btn" @click="onclick">
+        <i class="el-icon-search"></i>查询
+      </el-button>
+      <el-button type="primary" @click="refresh()">
+        <i class="el-icon-refresh"></i>刷新
+      </el-button>
+    </div>
+    <dilTable v-bind.sync="option">
+      <el-table-column fixed="right" label="操作" align="center" width="100">
+        <template slot-scope="scope">
+          <el-button @click="click(scope.row.resultId)" type="text" size="small"
+            >编辑</el-button
+          >
+          <!-- <el-button
+            type="text"
+            size="small"
+            @click="deleteclick(scope.row.resultId)"
+            >删除</el-button> -->
+        </template>
+      </el-table-column>
+    </dilTable>
+  </div>
+</template>
+
+<script>
+import { sjTime } from "@/utils/sharedJsFile";
+import { getCookie } from "@/utils/util.js";
+export default {
+  name: "homeworkPath",
+  data() {
+    return {
+      startTime: null,
+      endTime: null,
+      input: "",
+       startTime: null,
+      endTime: null,
+      option: {
+        // 表格请求数据的地址
+        requestUrl: "/api/v1/tms/getLoadShipList?apiId=63",
+      },
+    };
+  },
+  mounted() {},
+  methods: {
+    onclick() {
+      let startTime = null;
+      let endTime = null;
+      if (this.startTime) {
+        startTime = sjTime(this.startTime);
+      }
+      if (this.endTime) {
+        endTime = sjTime(this.endTime);
+      }
+      if(startTime && endTime && startTime < endTime){
+          this.option.requestUrl = "/api/v1/tms/getLoadShipList?apiId=63&con=" + this.input+
+                "&startTime=" +
+                startTime +
+                "&endTime=" +
+                endTime;
+      }else{
+          this.option.requestUrl = "/api/v1/tms/getLoadShipList?apiId=63&con=" + this.input;
+      }
+    },
+    click(resultId) {
+      console.log("aaa" + resultId);
+      this.$router.push("/updateThreeSectionFeeDetails/" + resultId);
+    },
+    addclick() {
+      this.$router.push("/addLoadShip/");
+    },
+    deleteclick(scope) {
+      let resultId = scope;
+      this.$confirm("是否删除", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+        center: true,
+      })
+        .then(() => {
+          this.axios.post("/api/v1/tms/deleteLoadShip/" + resultId).then(() => {
+            this.$message({
+              type: "success",
+              message: "删除成功!",
+            });
+            this.option.requestUrl =
+              "/api/v1/tms/getLoadShipList?apiId=63&i=" + new Date();
+          });
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "取消删除!",
+          });
+        });
+    },
+    refresh() {
+      this.$router.go(0);
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.shipTransport {
+  .top {
+    padding: 1.25rem 0.375rem;
+    .el-input {
+      width: 20%;
+      margin-right: 40rpx;
+    }
+    .btn {
+      width: 5.5%;
+      margin-left: 0.25rem;
+    }
+  }
+}
+</style>

+ 283 - 0
src/views/TMS/components/bmsship/updateThreeSectionFeeDetails.vue

@@ -0,0 +1,283 @@
+<template>
+  <!-- 修改位置作业 -->
+    <div class="shipTransport">
+    <page-title>返回</page-title>
+    <div class="form">
+      <div class="form_box">
+        <dil-form :formId="136" v-model="form1" ref="from1"></dil-form>
+        <el-form :inline="true">
+          <el-form-item label="水运单价">
+            <el-input type="number" placeholder="水运单价" v-model="form1.waterUnitPrice" disabled
+            ></el-input>
+          </el-form-item> 
+          <el-form-item label="是否拼装" >
+            <el-radio v-model="form1.isNeedAssemble" label="否" style="margin-left :10px">否</el-radio>
+            <el-radio v-model="form1.isNeedAssemble" label="是">是</el-radio>
+          </el-form-item>
+          <el-form-item label="水分检测费">
+             <el-input type="number" placeholder="水分检测费" v-model="form1.resultInspectionFees"></el-input>
+          </el-form-item>
+          <el-form-item label="计划日期">
+            <el-date-picker
+            v-model="form1.planDate"
+            type="datetime"
+            placeholder="计划日期">
+            </el-date-picker>
+          </el-form-item>
+          <el-form-item label="预计放货日期">
+            <el-date-picker
+            v-model="form1.planDeliveryDate"
+            type="datetime"
+            placeholder="预计放货日期">
+            </el-date-picker>
+          </el-form-item>
+          <el-form-item label="含水率">
+             <el-input type="number" placeholder="含水率" v-model="form1.resultMoistureContent"
+             @change="pipeiContarct"></el-input>
+          </el-form-item>
+          <el-form-item label="合同水分值">
+             <el-input
+             type="number"
+              placeholder=""
+              v-model="form1.contractMoistureValue"
+              :disabled="true"
+            ></el-input>
+          </el-form-item>
+          <el-form-item label="水分吨位">
+            <el-input
+            type="number"
+              placeholder=""
+              v-model="form1.moistureTonnage"
+              :disabled="true"
+            ></el-input>
+          </el-form-item>
+        </el-form> 
+      </div> 
+    </div>
+    <!-- 确定和取消 -->
+    <div class="button_box">
+      <el-button type="primary" @click="makeSure">确认</el-button>
+      <el-button @click="onClickCancel">返回</el-button>
+    </div>
+  </div>
+</template>
+
+<script>
+import PageTitle from "@/components/Page/Title";
+import { sjTime } from "@/utils/sharedJsFile";
+import { getCookie } from "@/utils/util.js";
+export default {
+  components: { PageTitle },
+ data(){
+     return {
+      form1: {},
+      waterQualiyResultId:null,
+      outWharyResultId:null,
+      unitPrices:[]
+  }
+ },
+  mounted() {
+    this.information();
+  },
+  watch:{
+    "form1.resultOutPortTime":{
+      handler(newVal,oldVal){
+        this.findUnitPrice();
+      },
+      deep: true,
+      immediate: true
+    },
+    "form1.isNeedAssemble":{
+      handler(newVal,oldVal){
+        this.isNeedAssemble();
+      },
+      deep: true,
+      immediate: true
+    }
+  },
+  methods: {
+    getUnitPrice(){
+      this.axios
+            .post("/api/v1/rms/selectbmsshipContractPriceList?apiId=500")
+            .then((res) => {
+                this.unitPrices=res.data.data.list;
+        }).then(()=>{
+            this.findUnitPrice();
+        });
+    },
+    findUnitPrice(){
+        console.log("form1",this.form1);
+      if(this.form1.sendPortId && this.form1.resultOutPortTime){
+          let contract=this.unitPrices.find(item=>
+          item.portId==this.form1.sendPortId
+          && sjTime(this.form1.resultOutPortTime)>=sjTime(item.startTime)
+          && sjTime(this.form1.resultOutPortTime)<=sjTime(item.endTime));
+          if(contract){
+             this.form1.waterUnitPrice=contract.unitPrice;
+             this.form1.unitPriceId=contract.resultId;
+             console.log("contract:",contract);
+             this.$forceUpdate();
+          }
+      }else{
+        console.log("null");
+      }
+    },
+    isNeedAssemble(){
+        if(this.form1.isNeedAssemble){
+            if(this.form1.isNeedAssemble=="是" && this.form1.sendPortId!=this.form1.startPortId){
+                this.form1.resultInspectionFees=4000;
+            }else{
+                this.form1.resultInspectionFees=2000;
+            }
+        }else{
+            console.log("是否拼装为空");
+        }
+    },
+    information() {
+      //编辑位置作业
+      this.axios
+        .post("/api/v1/tms/getLoadShip/" + this.$route.params.resultId)
+        .then((res) => {
+          res.data.data.forEach((e) => {
+            this.form1 = e;
+            this.waterQualiyResultId=e.waterQualiyResultId;
+            this.outWharyResultId=e.outWharyResultId;
+            console.log("form1:",e);
+          });
+        }).then(()=>{
+            this.getUnitPrice();
+        });
+    },
+    handleCheckedCitiesChange(value) {
+      console.log(value);
+    },
+    // 返回
+    onClickCancel() {
+      this.$router.go(-1);
+    },
+    currentRadioChange(row) {
+      this.aaaa = row;
+    },
+    pipeiContarct() {
+      if (
+        this.form1.resultMoistureContent >= 0
+      ) {
+        let map = {
+          batchInfactoryId: this.form1.batchId,
+          resultMoistureContent: this.form1.resultMoistureContent,
+          resultActualInstallations:this.form1.resultActualInstallations,
+        };
+        this.axios
+          .post("/api/v1/tms/getMoistureAndInstallations", map)
+          .then(res => {
+            if (res.data.code == 200) {
+              console.log("res:",res);
+              this.form1.contractMoistureValue = res.data.data.purchaseContractMoisture;
+              this.form1.moistureTonnage = res.data.data.resultWaterTonnage;
+              this.$forceUpdate();
+            } else {
+              this.$message.warning(res.data.data);
+            }
+          });
+      }
+    },
+    // 确认
+    makeSure() {
+      let mapVal = {
+        resultId: this.$route.params.resultId,
+        waterQualiyResultId:this.waterQualiyResultId,
+        resultActualInstallations: this.form1.resultActualInstallations,
+        outWharyResultId:this.outWharyResultId,
+        // rwarehouseMaterialId: this.form1.rwarehouseMaterialId,
+        resultArrivalPortTime: sjTime(
+          this.form1.resultArrivalPortTime
+        ),
+        resultOutPortTime: sjTime(
+          this.form1.resultOutPortTime
+        ),
+        resultLoadShipDate: sjTime(
+          this.form1.resultLoadShipDate
+        ),
+        resultIsClear: this.form1.resultIsClear,
+        resultOutPortName:this.form1.resultOutPortName,
+        planDate:sjTime(this.form1.planDate),
+        planDeliveryDate:sjTime(this.form1.planDeliveryDate),
+        isNeedAssemble:this.form1.isNeedAssemble,
+        resultInspectionFees:this.form1.resultInspectionFees,
+        moistureTonnage:this.form1.moistureTonnage,
+        waterUnitPrice:this.form1.waterUnitPrice,
+        unitPriceId:this.form1.unitPriceId,
+        resultHeavyWeight:this.form1.resultHeavyWeight,
+        resultMoistureContent:this.form1.resultMoistureContent,
+        userId:getCookie("userId")
+      };
+              //判断放货数量是否为数字
+       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;
+    
+    console.log("map:",mapVal);
+      this.axios
+        .post(
+          "/api/v1/tms/updateThreeSectionDetails",
+          mapVal
+        )
+        .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{
+    display: flex;
+    .form_box{
+      width: 320px;
+      margin-left: 35%;
+      margin-top: 30px;
+      margin-right: 20px;
+      .el-form{
+        .preview-group{
+          .el-form-item{
+            .el-form-item__label{
+              display: inline-block;
+              width: 70px !important;
+            }
+            .el-form-item__content{
+              .el-select{
+                width: 250px;
+              }
+              .el-input{
+                width: 250px;
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  .button_box{
+    margin-left: 45%;
+  }
+}
+</style>

+ 3 - 0
src/views/TMS/components/importedShip/addLoadShip.vue

@@ -117,6 +117,8 @@ export default {
           && sjTime(this.form.resultOutWharyTime)<=sjTime(item.endTime));
           if(contract){
              this.form.waterUnitPrice=contract.unitPrice;
+             this.form.unitPriceId=contract.resultId;
+             console.log("contract:",contract);
           }
       }
     },
@@ -173,6 +175,7 @@ export default {
         contractMoistureValue: this.contractMoistureValue,
         moistureTonnage: this.moistureTonnage,
         waterUnitPrice:this.form.waterUnitPrice,
+        unitPriceId:this.form.unitPriceId,
         //isNeedAssemble:this.form.isNeedAssemble,
         userId: getCookie("userId"),
       };

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

@@ -228,11 +228,13 @@ import editDomesticTrainFee from "../components/bmstrain/editDomesticTrainFee.vu
 import threeSectionHandleFee from "../components/bmsship/threeSectionHandleFee.vue";
 import addThreeSectionHandleFee from "../components/bmsship/addThreeSectionHandleFee.vue";
 import editThreeSectionHandleFee from "../components/bmsship/editThreeSectionHandleFee.vue";
-import threeSectionFee from "../components/bmsship/threeSectionFee.vue";
+import threeSectionFee from "../components/bmsship/threeSectionFee.vue";    
 import addThreeSectionFee from "../components/bmsship/addThreeSectionFee.vue";
 import editThreeSectionFee from "../components/bmsship/editThreeSectionFee.vue";
 import moistureDetection from "../components/bmsship/moistureDetection.vue";
 import addMoistureDetection from "../components/bmsship/addMoistureDetection.vue";
+import threeSectionFeeDetails from "../components/bmsship/threeSectionFeeDetails.vue";
+import updateThreeSectionFeeDetails from "../components/bmsship/updateThreeSectionFeeDetails.vue";   
 Vue.use(Router);
 
 const constantRouterMap = [
@@ -1464,7 +1466,18 @@ const constantRouterMap = [
         name: "moistureDetection",
         meta: { code: "xtpzgl-jggl" },
         component: moistureDetection
-      }
+      },{
+        path: "threeSectionFeeDetails",
+        name: "threeSectionFeeDetails",
+        meta: { code: "xtpzgl-jggl" },
+        component: threeSectionFeeDetails
+      },
+      {
+        path: "updateThreeSectionFeeDetails/:resultId",
+        name: "updateThreeSectionFeeDetails",
+        meta: { code: "xtpzgl-jggl" },
+        component: updateThreeSectionFeeDetails
+      },
     ]
   }
 ];