Browse Source

Merge branch 'master' of https://git.steerinfo.com/DAL-DAZHOU/icore-pass

luobang 2 years ago
parent
commit
490dccf8a1

+ 328 - 0
src/views/TMS/components/bmsship/addThreeSectionHandleFee.vue

@@ -0,0 +1,328 @@
+<template>
+  <!-- 添加三程船装卸费4-->
+  <div class="addWagonLoad">
+    <PageTitle>返回</PageTitle>
+    <div class="form-box">
+      <!-- <dil-form :formId="271" v-model="form1" ref="from1"></dil-form> -->
+      <el-form v-model="form">
+        <div class="searchSelect">
+            <span class="text">批次</span>
+            <el-input class="input" v-model="batchName" disabled> </el-input>
+            <el-button class="button" type="primary" @click="ondrawer(5)">浏览</el-button>
+        </div>
+        <div class="searchSelect">
+            <span class="text">单价</span>
+            <el-input class="input" v-model="form.unitPrice" disabled  @change="calculate"> </el-input>
+            <el-button class="button" type="primary" @click="ondrawer(6)">浏览</el-button>
+        </div>
+        <div class="preview-group">
+          <el-form-item label="实装吨位">
+              <el-input v-model="form.realTonnage" type="number"  @change="calculate"></el-input>
+          </el-form-item>
+          <el-form-item label="水运费用">
+              <el-input v-model="form.fee" type="number" disabled></el-input>
+          </el-form-item>
+            <el-form-item label="开票日期">
+                <el-date-picker
+                  v-model="form.makeTime"
+                  type="datetime"
+                  placeholder="选择日期">
+              </el-date-picker>
+          </el-form-item>
+          <el-form-item label="上传水运单图片">
+              <el-upload
+                  class="upload-demo"
+                  style="width: 270px"
+                  ref="upload1"
+                  accept=".pdf , .jpg, .png, .jpeg, .tif, .gif, .pcx, .tga, .exif, .fpx, .svg , .bmp"
+                  action="/api/v1/bms/uploadBmsshipOrder"
+                  :before-upload="beforeUpload"
+                  :multiple="false"
+                  list-type="picture"
+                  :show-file-list="false"
+                  :on-success="handleAvatarSuccess"
+                  :on-error="onError(1)">
+                  <el-input
+                      class="shippingCertificate"
+                      style="width: 270px; display: flex"
+                      placeholder="上传水运单图片(必填项)"
+                      v-model="form.image"
+                      disabled
+                  >
+                  </el-input>
+                  <el-button
+                      size="small"
+                      type="primary"
+                      style="
+                      width: 115px;
+                      height: 35px;
+                      margin-left: 275px;
+                      margin-top: -35px;
+                      display: flex;
+                      "
+                      @click="upCLick(1)">
+                      点击上传附件</el-button
+                  >
+              </el-upload>
+          </el-form-item>
+        </div>
+     </el-form>
+    </div>
+    <!-- 模态框 -->
+    <el-drawer
+      :visible.sync="drawer"
+      :direction="direction"
+      :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(a)"
+        style="margin-bottom: 15px">
+        <i class="el-icon-search"></i>查询
+      </el-button>
+      <div v-show="a == 5">
+        <dilTable
+          v-bind.sync="batchOption"
+          @radio-change="batchChange"
+        ></dilTable>
+      </div>
+      <div v-show="a == 6">
+        <dilTable
+          v-bind.sync="contractPriceOption"
+          @radio-change="priceChange"
+        ></dilTable>
+      </div>
+    </el-drawer>
+    <!-- 底部按钮 -->
+    <div class="button-box">
+      <el-button @click="cancel">取消</el-button>
+      <el-button type="primary" @click="makeSure" :loading="isLoading">确定</el-button>
+    </div>
+  </div>
+</template>
+
+<script>
+import PageTitle from "@/components/Page/Title";
+import { sjTime } from "@/utils/sharedJsFile";
+import { getCookie } from "@/utils/util.js";
+import {BigNumber} from 'bignumber.js';
+export default {
+  components: { PageTitle },
+  data() {
+    return {
+      form: {},
+      portId:null,
+      ports:[],
+      isLoading:false,
+      drawer: false,
+      direction: "rtl",
+      a:0,
+      input:null,
+      batchId:null,
+      purchaseOrderId:null,
+      batchName:null,
+      cargoPictureUrl: "",
+      batchOption: {
+        requestUrl: "/api/v1/uc/selectPurchaseOrderForShip?apiId=502",
+        selectionType: "radio",
+        map: [],
+      },
+      contractPriceOption: {
+        requestUrl: "/api/v1/rms/selectbmsshipContractPriceList?apiId=500",
+        selectionType: "radio",
+        map: [],
+      }
+    };
+  },
+  mounted() {
+    //this.getPorts();
+  },
+  methods: {
+    //右侧选中框
+    ondrawer(num) {
+      this.drawer = true;
+      this.a = num;
+      // 清空当前输入框中的数据
+      this.input = "";
+    },
+    handleClose(done) {
+      done();
+    },
+    onclick(a) {
+        if(a==5){
+            this.batchOption.requestUrl =
+            "/api/v1/uc/selectPurchaseOrderForShip?apiId=502&con=" + this.input;
+        }else if(a==6){
+            this.contractPriceOption.requestUrl =
+            "/api/v1/rms/selectbmsshipContractPriceList?apiId=500&con=" + this.input;
+        }
+    },
+    //修改选中
+    batchChange(selection) {
+        console.log(selection);
+        this.batchId=selection.batchId;
+        this.purchaseOrderId=selection.purchaseOrderId;
+        this.batchName =selection.materialName + selection.resultForeignShipName;
+    },
+    priceChange(selection){
+        this.form.unitPriceId = selection.resultId;
+        this.form.unitPrice = selection.unitPrice;
+        this.calculate();
+    },
+    //计算水运费
+    calculate(){
+        console.log("能否计算水运费:",this.form.realTonnage && this.form.unitPrice);
+        if(this.form.realTonnage && this.form.unitPrice){
+           let fee = new BigNumber(this.form.realTonnage);
+           this.$set(this.form,'fee',fee.multipliedBy(this.form.unitPrice).toNumber())
+           console.log(this.form.fee);
+        }
+    },
+    makeSure() {
+      //this.isLoading=true;
+      let map={
+        batchId:this.batchId,
+        purchaseOrderId:this.purchaseOrderId,
+        unitPrice:this.form.unitPrice,
+        unitPriceId:this.form.unitPriceId,
+        realTonnage:this.form.realTonnage,
+        fee:this.form.fee,
+        makeTime: sjTime(this.form.makeTime),
+        image:this.form.image,
+        feeType:4,
+        userId:getCookie("userId")
+      }
+      console.log(map);
+      if(map.batchId==null ||
+       map.purchaseOrderId==null ||
+       map.unitPrice==null ||
+       map.unitPriceId==null ||
+       map.realTonnage==null ||
+       map.fee==null ||
+       map.makeTime==null ||
+       map.image==null || map.image==''
+       ){
+        this.$message.error("存在空值!");
+        this.isLoading=false;
+      }else{
+         this.axios.post("/api/v1/bms/addPortHandlingFeeSecond",map).then(res => {
+          if (res.data.code == 200) {
+            this.$message({
+              type: "success",
+              message: "新增成功!"
+            });
+            this.cancel();
+          } else {
+            this.$message.error(res.data.data);
+          }
+        }).then(()=>{
+          this.isLoading=false;
+        });
+      }
+       
+    },
+    // 取消
+    cancel() {
+      this.$router.go(-1);
+    },
+    //查询港口id
+    getPorts(){
+        this.axios.post("/api/v1/rms/getPortName?index=").then(res => {
+          if (res.data.code == 200) {
+            this.ports=res.data.data;
+            console.log(this.ports);
+          } else {
+            this.$message.error(res.data.data);
+          }
+        });
+    },
+    beforeUpload(file) {
+      this.upBool = true;
+      const isLt2M = file.size < 1024 * 1024 * 0.5;
+      if (!isLt2M) {
+        this.$message.error("上传文件大小不能超过500kb!");
+      } else {
+        let size = file.size / 1024;
+        let _URL = window.URL || window.webkitURL;
+        let img = new Image();
+        img.src = _URL.createObjectURL(file);
+      }
+      return isLt2M;
+    },
+    onError(err) {
+      if (this.upBool) {
+        if (this.num == 1) {
+          this.form.image = null;
+          this.$message.error("上传失败");
+        }
+      }
+    },
+    handleAvatarSuccess(res, file) {
+      if (res.code) {
+        this.upBool = false;
+        if (this.num == 1) {
+          this.form.image = res.data;
+        }
+        this.$message.success("上传成功");
+      }
+    },
+    upCLick(val) {
+      this.num = val;
+    },
+  }
+};
+</script>
+<style lang="scss">
+.searchSelect {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    margin: 5px;
+    .text {
+    width: 40px;
+    }
+    .input {
+    width: 200px;
+    }
+    .button {
+    margin-left: 6px;
+    }
+}
+.button-box {
+  display: flex;
+  justify-content: center;
+  margin: 20px;
+  .el-button {
+    width: 80px;
+    margin: 10px;
+  }
+}
+.form-box {
+  display: flex;
+  justify-content: center;
+  .el-form-item {
+    display: flex;
+    justify-content: center;
+    .el-form-item__label {
+      display: flex;
+      align-items: center;
+    }
+    .el-form-item__content {
+      .el-input {
+        .el-input__inner {
+          width: 250px;
+        }
+      }
+    }
+  }
+}
+</style>

+ 1 - 1
src/views/TMS/components/bmsship/addTwoSectionFee.vue

@@ -218,7 +218,7 @@ export default {
           if (res.data.code == 200) {
             this.$message({
               type: "success",
-              message: "修改成功!"
+              message: "新增成功!"
             });
             this.cancel();
           } else {

+ 1 - 1
src/views/TMS/components/bmsship/addTwoSectionHandleFee.vue

@@ -218,7 +218,7 @@ export default {
           if (res.data.code == 200) {
             this.$message({
               type: "success",
-              message: "修改成功!"
+              message: "新增成功!"
             });
             this.cancel();
           } else {

+ 350 - 0
src/views/TMS/components/bmsship/editThreeSectionHandleFee.vue

@@ -0,0 +1,350 @@
+<template>
+  <!-- 修改三程船装卸费4-->
+  <div class="addWagonLoad">
+    <PageTitle>返回</PageTitle>
+    <div class="form-box">
+      <!-- <dil-form :formId="271" v-model="form1" ref="from1"></dil-form> -->
+   
+      <el-form v-model="form">
+        <div class="searchSelect">
+            <span class="text">批次</span>
+            <el-input class="input" v-model="batchName" disabled> </el-input>
+            <el-button class="button" type="primary" @click="ondrawer(5)">浏览</el-button>
+        </div>
+         <div class="searchSelect">
+            <span class="text">单价</span>
+            <el-input class="input" v-model="form.unitPrice" disabled  @change="calculate"> </el-input>
+            <el-button class="button" type="primary" @click="ondrawer(6)">浏览</el-button>
+        </div>
+          <div class="preview-group">
+             <el-form-item label="实装吨位">
+                <el-input v-model="form.realTonnage" type="number"  @change="calculate"></el-input>
+            </el-form-item>
+            <el-form-item label="水运费用">
+                <el-input v-model="form.fee" type="number"  disabled></el-input>
+            </el-form-item>
+             <el-form-item label="开票日期">
+                 <el-date-picker
+                    v-model="form.makeTime"
+                    type="datetime"
+                    placeholder="选择日期">
+                </el-date-picker>
+            </el-form-item>
+            <el-form-item label="上传水运单图片">
+                <el-upload
+                    class="upload-demo"
+                    style="width: 270px"
+                    ref="upload1"
+                    accept=".pdf , .jpg, .png, .jpeg, .tif, .gif, .pcx, .tga, .exif, .fpx, .svg , .bmp"
+                    action="/api/v1/bms/uploadBmsshipOrder"
+                    :before-upload="beforeUpload"
+                    :multiple="false"
+                    list-type="picture"
+                    :show-file-list="false"
+                    :on-success="handleAvatarSuccess"
+                    :on-error="onError(1)">
+                    <el-input
+                        class="shippingCertificate"
+                        style="width: 270px; display: flex"
+                        placeholder="上传水运单图片(必填项)"
+                        v-model="form.image"
+                        disabled
+                    >
+                    </el-input>
+                    <el-button
+                        size="small"
+                        type="primary"
+                        style="
+                        width: 115px;
+                        height: 35px;
+                        margin-left: 275px;
+                        margin-top: -35px;
+                        display: flex;
+                        "
+                        @click="upCLick(1)">
+                        点击上传附件</el-button
+                    >
+                </el-upload>
+            </el-form-item>
+          </div>
+     </el-form>
+    </div>
+    <!-- 模态框 -->
+    <el-drawer
+      :visible.sync="drawer"
+      :direction="direction"
+      :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(a)"
+        style="margin-bottom: 15px">
+        <i class="el-icon-search"></i>查询
+      </el-button>
+      <div v-show="a == 5">
+        <dilTable
+          v-bind.sync="batchOption"
+          @radio-change="batchChange"
+        ></dilTable>
+      </div>
+      <div v-show="a == 6">
+        <dilTable
+          v-bind.sync="contractPriceOption"
+          @radio-change="priceChange"
+        ></dilTable>
+      </div>
+    </el-drawer>
+    <!-- 底部按钮 -->
+    <div class="button-box">
+      <el-button @click="cancel">取消</el-button>
+      <el-button type="primary" @click="makeSure" :loading="isLoading">确定</el-button>
+    </div>
+  </div>
+</template>
+
+<script>
+import PageTitle from "@/components/Page/Title";
+import { sjTime } from "@/utils/sharedJsFile";
+import { getCookie } from "@/utils/util.js";
+import {BigNumber} from 'bignumber.js';
+export default {
+  components: { PageTitle },
+  data() {
+    return {
+      form: {},
+      portId:null,
+      ports:[],
+      isLoading:false,
+      drawer: false,
+      direction: "rtl",
+      a:0,
+      input:null,
+      batchId:null,
+      purchaseOrderId:null,
+      batchName:null,
+      cargoPictureUrl: "",
+      batchOption: {
+        requestUrl: "/api/v1/uc/selectPurchaseOrderForShip?apiId=502",
+        selectionType: "radio",
+        map: [],
+      },
+      contractPriceOption: {
+        requestUrl: "/api/v1/rms/selectbmsshipContractPriceList?apiId=500",
+        selectionType: "radio",
+        map: [],
+      }
+    };
+  },
+  mounted() {
+    //this.getPorts();
+    this.information();
+  },
+  methods: {
+    information() {
+      //编辑车皮装车作业
+      this.axios
+        .post(
+          "/api/v1/bms/getBmsshipFee/" + this.$route.params.resultId
+        )
+        .then((res) => {
+          res.data.data.forEach((e) => {
+            console.log(e);
+            this.form = e;
+            this.batchName=e.batchName;
+            this.batchId=e.batchId;
+            this.purchaseOrderId=e.purchaseOrderId;
+          });
+        });
+    },
+    //右侧选中框
+    ondrawer(num) {
+      this.drawer = true;
+      this.a = num;
+      // 清空当前输入框中的数据
+      this.input = "";
+    },
+    handleClose(done) {
+      done();
+    },
+    onclick(a) {
+        if(a==5){
+            this.batchOption.requestUrl =
+            "/api/v1/uc/selectPurchaseOrderForShip?apiId=502&con=" + this.input;
+        }else if(a==6){
+            this.contractPriceOption.requestUrl =
+            "api/v1/rms/selectbmsshipContractPriceList?apiId=500&con=" + this.input;
+        }
+    },
+    //修改选中
+    batchChange(selection) {
+        this.batchId=selection.batchId;
+        this.purchaseOrderId=selection.purchaseOrderId;
+        console.log("before",this.batchName);
+        this.batchName =selection.materialName + selection.resultForeignShipName;
+        console.log("before",this.batchName);
+        console.log("batch",selection);
+    },
+    priceChange(selection){
+        this.form.unitPriceId = selection.resultId;
+        this.form.unitPrice = selection.unitPrice;
+        console.log("unitPrice:",selection);
+        this.calculate();
+    },
+    //计算水运费
+    calculate(){
+        console.log("能否计算水运费:",this.form.realTonnage && this.form.unitPrice);
+        if(this.form.realTonnage && this.form.unitPrice){
+           let fee = new BigNumber(this.form.realTonnage);
+           this.$set(this.form,'fee',fee.multipliedBy(this.form.unitPrice).toNumber())
+           console.log(this.form.fee);
+        }
+    },
+    makeSure() {
+      this.isLoading=true;
+      let map={
+        resultId:this.form.resultId,
+        batchId:this.batchId,
+        purchaseOrderId:this.purchaseOrderId,
+        unitPrice:this.form.unitPrice,
+        unitPriceId:this.form.unitPriceId,
+        realTonnage:this.form.realTonnage,
+        fee:this.form.fee,
+        makeTime:sjTime(this.form.makeTime),
+        image:this.form.image,
+        feeType:4,
+        userId:getCookie("userId")
+      }
+      console.log(map);
+      if(
+       map.unitPrice==null ||
+       map.realTonnage==null ||
+       map.fee==null ||
+       map.makeTime==null ||
+       map.image==null || map.image==''
+       ){
+        this.$message.error("存在空值!");
+        this.isLoading=false;
+      }else{
+         map.startTime = sjTime(this.form.startTime);
+         map.endTime = sjTime(this.form.endTime);
+         this.axios.post("/api/v1/bms/updatePortHandlingFee",map).then(res => {
+          if (res.data.code == 0) {
+            this.$message({
+              type: "success",
+              message: "修改成功!"
+            });
+            this.cancel();
+          } else {
+            this.$message.error(res.data.data);
+          }
+        }).then(()=>{
+          this.isLoading=false;
+        });
+      }
+       
+    },
+    // 取消
+    cancel() {
+      this.$router.go(-1);
+    },
+    //查询港口id
+    getPorts(){
+        this.axios.post("/api/v1/rms/getPortName?index=").then(res => {
+          if (res.data.code == 200) {
+            this.ports=res.data.data;
+            console.log(this.ports);
+          } else {
+            this.$message.error(res.data.data);
+          }
+        });
+    },
+    beforeUpload(file) {
+      this.upBool = true;
+      const isLt2M = file.size < 1024 * 1024 * 0.5;
+      if (!isLt2M) {
+        this.$message.error("上传文件大小不能超过500kb!");
+      } else {
+        let size = file.size / 1024;
+        let _URL = window.URL || window.webkitURL;
+        let img = new Image();
+        img.src = _URL.createObjectURL(file);
+      }
+      return isLt2M;
+    },
+    onError(err) {
+      if (this.upBool) {
+        if (this.num == 1) {
+          this.form.image = null;
+          this.$message.error("上传失败");
+        }
+      }
+    },
+    handleAvatarSuccess(res, file) {
+      if (res.code) {
+        this.upBool = false;
+        if (this.num == 1) {
+         this.form.image = res.data;
+        }
+        this.$message.success("上传成功");
+      }
+    },
+    upCLick(val) {
+      this.num = val;
+    },
+  }
+};
+</script>
+<style lang="scss">
+.searchSelect {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    margin: 5px;
+    .text {
+    width: 40px;
+    }
+    .input {
+    width: 200px;
+    }
+    .button {
+    margin-left: 6px;
+    }
+}
+.button-box {
+  display: flex;
+  justify-content: center;
+  margin: 20px;
+  .el-button {
+    width: 80px;
+    margin: 10px;
+  }
+}
+.form-box {
+  display: flex;
+  justify-content: center;
+  .el-form-item {
+    display: flex;
+    justify-content: center;
+    .el-form-item__label {
+      display: flex;
+      align-items: center;
+    }
+    .el-form-item__content {
+      .el-input {
+        .el-input__inner {
+          width: 250px;
+        }
+      }
+    }
+  }
+}
+</style>

+ 133 - 0
src/views/TMS/components/bmsship/threeSectionHandleFee.vue

@@ -0,0 +1,133 @@
+<template>
+    <!-- 三程船装卸费3 -->
+  <div class="contract_price">
+    <div class="sache">
+      <el-input placeholder="请输入内容" v-model="inputText" 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="toInsert">
+        <i class="el-icon-plus"></i>新增
+      </el-button>
+    </div>
+    <div class="table">
+      <dilTable v-bind.sync="options">
+        <el-table-column fixed="right" label="操作" width="100">
+          <template slot-scope="scope">
+            <el-button type="text" size="small" @click="update(scope)">
+              修改
+            </el-button>
+            <el-button type="text" size="mini" @click="deleteOne(scope)">
+              删除
+            </el-button>
+            <el-button @click="toPhotoClick(scope.row.resultId)" type="text" size="small">
+              水运单图片
+            </el-button>
+          </template>
+        </el-table-column>
+      </dilTable>
+    </div>
+    <vxe-modal width="549px" height="731px" v-model="isShow" show-footer>
+      <div class="demo-image__preview">
+        <el-image
+          style=" height:731px;text-align:center"
+          :src="src"
+          :preview-src-list="srcList">
+        </el-image>
+      </div>
+    </vxe-modal>
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      inputText: "",
+      isShow:false,
+      options: {
+        // first请求数据的地址
+        requestUrl: "/api/v1/bms/selectPortFeeSecondList?apiId=501&feeType=4",
+      },
+    };
+  },
+  methods: {
+    //查询
+    onclick() {
+      this.options.requestUrl =
+        "/api/v1/bms/selectPortFeeSecondList?apiId=501&feeType=4&con=" + this.inputText;
+    },
+    //新增
+    toInsert() {
+      this.$router.push("/addThreeSectionHandleFee");
+    },
+    update(scope) {
+      console.log(scope.row.resultId);
+      this.$router.push("/editThreeSectionHandleFee/" + scope.row.resultId);
+    },
+    showCarrier(scope) {
+      console.log(scope.row.resultId);
+      this.$router.push("/showThreeSectionFee/" + scope.row.resultId);
+    },
+    deleteOne(scope) {
+      this.$confirm("是否删除", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+        center: true,
+      })
+        .then(() => {
+          let map={
+            resultId:scope.row.resultId
+          }
+          this.axios
+            .post("/api/v1/bms/deletePortHandlingFeeSecond/"+scope.row.resultId)
+            .then((res) => {
+              if (res.data.code == 200) {
+                this.$message({
+                  type: "success",
+                  message: "删除成功!",
+                });
+                this.$router.go(0);
+              } else {
+                this.$message({
+                  message: "删除失败",
+                  type: "warning",
+                });
+              }
+            });
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "删除操作已取消!",
+          });
+        });
+    },
+    toPhotoClick(resultId) {
+      this.axios
+        .post("/api/v1/bms/downloadBmsshipOrder?resultId=" + resultId)
+        .then(res => {
+          console.log("res",res.data.data);
+          this.srcList = [];
+          this.src = res.data.data;
+          this.isShow = true;
+          this.srcList.push(res.data.data);
+        });
+    },
+  },
+};
+</script>
+
+<style lang="scss" scode>
+.contract_price{
+  .sache {
+    padding: 1.25rem 0.375rem;
+    .el-input {
+      width: 20%;
+      margin-right: 1.25rem;
+    }
+  }
+}
+</style>

+ 65 - 3
src/views/TMS/components/domesticMine/entrustMine.vue

@@ -21,7 +21,10 @@
       <el-button type="primary" class="btn" @click="onclick">
         <i class="el-icon-search"></i>查询
       </el-button>
-      <el-button type="primary" @click="exportData()">
+      <!-- <el-button type="primary" @click="exportData()">
+        <i class="el-icon-download"></i>导出(Excel)
+      </el-button> -->
+      <el-button type="primary" @click="exportExcel">
         <i class="el-icon-download"></i>导出(Excel)
       </el-button>
        <el-button type="primary" @click="refresh()">
@@ -32,7 +35,6 @@
     <el-tabs v-model="activeName" @tab-click="handleClick">
       <el-tab-pane label="待计量" name="first">
         <dilTable
-          ref="excelDom"
           v-bind.sync="option"
           @selection-change="selectionChange"
         >
@@ -40,7 +42,7 @@
       </el-tab-pane>
       <el-tab-pane label="已计量" name="second">
         <dilTable
-          ref="excelDom"
+          ref="weighted"
           v-bind.sync="option2"
           @selection-change="selectionChange2"
         >
@@ -166,6 +168,66 @@ export default {
     },
     refresh(){
       this.$router.go(0);
+    },
+    exportExcel(){
+      if(this.selectionListMap2.length<=0){
+         this.$message({
+          message: "请先勾选数据!",
+          type: "warning"
+        });
+        return;
+      }
+      //创建工作簿对象
+      let wb = XLSX.utils.book_new();
+      //数据
+      let sheetData = [
+        ['卸车明细表'],
+        ['序号','发站','到站','发货日期','到货日期','卸货地点','品名','矿种','计费吨位','车号','计量吨位','计费吨位合计']
+      ];
+      let totalRealWeight=new bignumber(0);
+      let totalWeight=0;
+      this.selectionListMap2.forEach((selection)=>{
+          totalRealWeight=totalRealWeight.plus(selection.resultNetWeight);
+          totalWeight+=selection.resultBillableTonnage;
+          let arr=[
+            selection.ROW_ID,
+            selection.sendStationName,
+            selection.arrivalStationName,
+            selection.sendDate,
+            selection.arrivalDate,
+            selection.resultForeignShipName,
+            selection.supplierName+selection.materialName,
+            null,
+            selection.resultBillableTonnage,
+            selection.resultWagonNo,
+          ]
+          sheetData.push(arr);
+      });
+      console.log("totalReal:",totalRealWeight.toNumber());
+      console.log("total:",totalWeight);
+      sheetData[2].push(totalRealWeight.toNumber());
+      sheetData[2].push(totalWeight);
+      console.log("sheetData",sheetData);
+      //把数据转化成excel的页
+      let sheet = XLSX.utils.aoa_to_sheet(sheetData);
+      //合并单元格 
+      sheet['!merges'] = [
+          {
+              s: { c: 0, r: 0 },// 合并开始位置 c:列位置 r:表示行位置
+              e: { c: 11, r: 0 } // 合并结束位置 
+          },
+          {
+              s: { c: 10, r: 2 },// 合并开始位置 c:列位置 r:表示行位置
+              e: { c: 10, r: sheetData.length-1 } // 合并结束位置 
+          },
+          {
+              s: { c: 11, r: 2 },// 合并开始位置 c:列位置 r:表示行位置
+              e: { c: 11, r: sheetData.length-1 } // 合并结束位置 
+          }
+      ]
+      //把这一页加入excel
+      XLSX.utils.book_append_sheet(wb, sheet, "第一页");
+      XLSX.writeFile(wb, '计量作业.xlsx');
     }
   },
 };

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

@@ -225,6 +225,9 @@ import editImportedTrainFee from "../components/bmstrain/editImportedTrainFee.vu
 import domesticTrainFee from "../components/bmstrain/domesticTrainFee.vue"
 import addDomesticTrainFee from "../components/bmstrain/addDomesticTrainFee.vue"
 import editDomesticTrainFee from "../components/bmstrain/editDomesticTrainFee.vue"
+import threeSectionHandleFee from "../components/bmsship/threeSectionHandleFee.vue";
+import addThreeSectionHandleFee from "../components/bmsship/addThreeSectionHandleFee.vue";
+import editThreeSectionHandleFee from "../components/bmsship/editThreeSectionHandleFee.vue";
 
 Vue.use(Router);
 
@@ -1406,6 +1409,23 @@ const constantRouterMap = [
         meta: { code: "xtpzgl-jggl" },
         component: editDomesticTrainFee
       },
+      {
+        path: "threeSectionHandleFee",
+        name: "threeSectionHandleFee",
+        meta: { code: "xtpzgl-jggl" },
+        component: threeSectionHandleFee
+      }, 
+      {
+        path: "addThreeSectionHandleFee",
+        name: "addThreeSectionHandleFee",
+        meta: { code: "xtpzgl-jggl" },
+        component: addThreeSectionHandleFee
+      }, {
+        path: "editThreeSectionHandleFee/:resultId",
+        name: "editThreeSectionHandleFee",
+        meta: { code: "xtpzgl-jggl" },
+        component: editThreeSectionHandleFee
+      },
 
     ]
   }

+ 4 - 1
src/views/appoint/components/ship/addDeliveryNotice.vue

@@ -411,6 +411,7 @@ export default {
         materialTypeId: this.second3.mapList4.materialTypeId,
         isNeedPortDisCharge: this.form1.isNeedPortDisCharge,
         isNeedPortFee: this.form1.isNeedPortFee,
+        isNeedBonded: this.form1.isNeedBonded,
         cargoPictureUrl: this.cargoPictureUrl,
         userId: getCookie("userId"),
       };
@@ -436,7 +437,8 @@ export default {
         map.groupId == null ||
         map.inFactoryShipName == null ||
         map.isNeedPortDisCharge == null ||
-        map.isNeedPortFee == null
+        map.isNeedPortFee == null ||
+        map.isNeedBonded == null
         // map.foreignShipName==null||
         // map.materialId==null
       ) {
@@ -540,6 +542,7 @@ export default {
               message: res.data.data,
             });
           }
+        }).then(()=>{
           this.isLoading=false;
         });
     },

+ 1 - 13
src/views/appoint/components/ship/modifyDeliveryNotice.vue

@@ -382,22 +382,10 @@ export default {
         materialTypeId: this.second3.mapList4.materialTypeId,
         isNeedPortDisCharge: this.form1.isNeedPortDisCharge,
         isNeedPortFee: this.form1.isNeedPortFee,
+        isNeedBonded: this.form1.isNeedBonded,
         cargoPictureUrl: this.cargoPictureUrl,
         userId: getCookie("userId"),
       };
-
-      if (this.second2.mapList3.length == 0) {
-        this.$message.warning("请选择收货人");
-        return;
-      }
-      if (this.second3.mapList4.length == 0) {
-        this.$message.warning("请选择物资品类");
-        return;
-      }
-      if (this.second5.mapList5.length == 0) {
-        this.$message.warning("请选择批次");
-        return;
-      }
       //判断是否为电话号码
       function isTelePhone() {
         var value2 = map.resultTelephoneFax;

File diff suppressed because it is too large
+ 0 - 1
static/lib/XLSX/xlsx.core.min.js


Some files were not shown because too many files changed in this diff