소스 검색

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

luobang 2 년 전
부모
커밋
f43fc3bbd4

+ 8 - 88
src/views/TMS/components/importedMine/addWagonLoad.vue

@@ -2,19 +2,6 @@
   <!-- 万州港-达州新增装车1 -->
   <div class="addWagonLoad">
     <page-title>返回</page-title>
-    <!-- <div class="cp">
-      <span >车皮号:</span>
-      <el-upload style="margin: 8px;"
-          class="upload-excel"
-          action=""
-          :on-change="importExcel"
-          :show-file-list="false"
-          accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
-          :auto-upload="false">
-          <el-button  type="primary">导入</el-button>
-      </el-upload>
-      <span >当前导入数量:{{tableData.length}}</span>
-    </div> -->
     <div class="tempTable">
       <div class="search" style="display:flex;margin: 10px;">
         <el-input
@@ -101,66 +88,6 @@
         </el-table>
       </div>
     </div>
-    <!-- <div class="importedTable" style="height:300px;overflow:scroll;">
-      <el-table
-        highlight-current-row
-        :data="tableData"
-        :row-style="{height:'40px'}"
-        style="width: 100%,font-size: 20px"
-        id="domesticTable">
-        <el-table-column
-        type="index"
-        width="50"
-        prop="number"
-        label="序号"
-        align="center"
-        fixed="left"
-        :resizable="false">
-        </el-table-column>
-        <el-table-column
-        align="center"
-          prop="productName"
-          label="品  名"
-          width="240px">
-        </el-table-column>
-        <el-table-column
-        align="center"
-          prop="mineral"
-          label="矿种"
-          width="100px">
-        </el-table-column>
-        <el-table-column
-        align="center"
-          prop="wagonNo"
-          label="车号"
-          width="180px">
-        </el-table-column>
-        <el-table-column
-        align="center"
-          prop="unloadPoint"
-          label="卸货地点"
-          width="180px">
-        </el-table-column>
-        <el-table-column
-        align="center"
-          prop="sendStation"
-          label="发站"
-          width="180px">
-        </el-table-column>
-        <el-table-column
-        align="center"
-        width="180px"
-          prop="arrivalStation"
-          label="到站">
-        </el-table-column>
-         <el-table-column
-         align="center"
-        width="180px"
-          prop="weight"
-          label="标重">
-        </el-table-column>
-      </el-table>
-    </div> -->
     <div class="right" 
     style="margin-top:10px
            float:right;">
@@ -187,18 +114,6 @@
                     <el-select filterable  v-model="arrivalStationId">
                         <el-option v-for="item in arrivalStations" :value="item.arrivalId" :key="item.arrivalId" :label="item.arrivalName"></el-option>
                     </el-select>
-                    <!-- <el-autocomplete
-                      class="inline-input"
-                      v-model="toTheStation"
-                      :fetch-suggestions="querySearchToTheStation"
-                      placeholder="请输入到站名称"
-                      :trigger-on-focus="false"
-                      @select="handleSelectToTheStation"
-                    >
-                      <template slot-scope="{ item }">
-                        <div class="name">{{ item.arrivalName }}</div>
-                      </template>
-                    </el-autocomplete> -->
                   </el-form-item>
                </div>
           </el-form>
@@ -207,7 +122,7 @@
         </div>
         <div class="button-box">
           <el-button @click="cancel">取消</el-button>
-          <el-button type="primary" :loading="isLoading" @click="makeSure">确定</el-button>
+          <el-button type="primary" :loading="isLoading" :disabled="!isSend" @click="makeSure">确定</el-button>
         </div>
     </div>
   </div>
@@ -221,6 +136,7 @@ export default {
   components: { PageTitle },
   data() {
     return {
+      isSend:false,
       isLoading:false,
       list: [],
       form1: {
@@ -269,6 +185,7 @@ export default {
   methods: {
     findWagon(){
       this.tableDataReal=[];
+      this.isSend=true;
       this.tableData.forEach((item)=>{
         if(item.foreignShipName.includes(this.input) || item.wagonNo.includes(this.input)){
           this.tableDataReal.push(item);
@@ -604,16 +521,19 @@ export default {
         });
         that.tableDataReal=tableData;
         if(tableData.length<=0){
-          that.$confirm('查询不到相关车皮!')
+          that.$confirm('查询不到相关车皮!请联系万州港相关人员!')
           .then(_ => {
+            that.isSend=false;
             done();
           });
         }else if(tableData.length<importData.length){
-           that.$confirm("共"+(importData.length-tableData.length)+"条车皮查询失败!")
+           that.$confirm("共"+(importData.length-tableData.length)+"条车皮查询失败!请联系万州港相关人员!")
           .then(_ => {
+            that.isSend=false;
             done();
           });
         }else{
+          that.isSend=true;
           that.$message({
             message: "查询成功!",
             type: "success",

+ 15 - 5
src/views/TMS/components/importedMine/addWagonloadCopy.vue

@@ -86,7 +86,7 @@
           align="center"
           prop="makeDate"
           label="制票日期"
-          width="120px"
+          width="170px"
         >
         </el-table-column>
         <el-table-column
@@ -121,7 +121,7 @@
            float:right;"
     >
       <div class="form">
-        <div class="form_box" style="">
+        <div class="form_box_addWagonLoad" style="">
           <el-form>
             <div class="preview-group">
               <el-form-item label="发站:">
@@ -627,7 +627,7 @@ export default {
             //表格数据
             let temp = {
               number: row["序号"],
-              makeDate: row["制票日期"],
+              makeDate:that.formatDate(row["制票日期"]) ,
               materialName: row["品名"],
               wagonNo: row["车皮号"]+"",
               mineral: row["矿种"],
@@ -662,6 +662,17 @@ export default {
           tempTable.toggleRowSelection(row);
        }
     },
+    formatDate(numb, format) {
+      const time = new Date((numb - 1) * 24 * 3600000 + 1)
+      time.setYear(time.getFullYear() - 70)
+      const year = time.getFullYear() + ''
+      const month = time.getMonth() + 1 + ''
+      const date = time.getDate() + ''
+      if (format && format.length === 1) {
+        return year + format + month + format + date
+      }
+      return year + '年' + (month < 10 ? '0' + month : month)+ '月' + (date < 10 ? '0' + date : date) + '日'
+    }
   }
 };
 </script>
@@ -785,9 +796,8 @@ export default {
   }
   .form {
     display: flex;
-    .form_box {
+    .form_box_addWagonLoad {
       width: 340px;
-      margin-left:10px;
       .el-form {
         .preview-group {
           .el-form-item {

+ 81 - 16
src/views/TMS/components/importedMine/outBoundWagon.vue

@@ -2,15 +2,38 @@
   <!-- 出库 -->
   <div class="homeworkPath">
     <div class="top">
-      <el-input placeholder="请输入内容" v-model="input" clearable> </el-input>
-
+      <el-input placeholder="请输入内容" v-model="input" clearable style="width:200px"> </el-input>
+      <el-date-picker style="margin: 10px;width:250px" v-model="startTime" type="datetime" placeholder="起始日期"></el-date-picker>
+      <el-date-picker style="margin: 10px;width:250px" 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" class="btn" @click="insert"> 出库 </el-button>
+      <el-button type="primary" @click="exportData()" ><i class="el-icon-download"></i>导出(Excel)</el-button>
     </div>
     <el-tabs v-model="activeName" @tab-click="handleClick">
-      <mergeRowTable v-bind.sync="option1" ref="table">
+      <el-tab-pane label="全部" name="first">
+        <mergeRowTable v-bind.sync="option1" ref="excelDom" @func="calculate">
+        <el-table-column fixed="right" label="操作" width="50">
+          <template slot-scope="scope">
+            <el-button
+              @click="click(scope.row.resultId)"
+              type="text"
+              size="small"
+              :disabled="scope.row.isEdit!=1"
+              >修改</el-button
+            >
+            <!-- <el-button
+            type="text"
+            size="small"
+            @click="deleteclick(scope.row.resultId)"
+            >删除</el-button > -->
+          </template>
+        </el-table-column>
+      </mergeRowTable>
+      </el-tab-pane>
+      <el-tab-pane label="待计量" name="second">
+        <mergeRowTable v-bind.sync="option1" ref="excelDom">
         <el-table-column fixed="right" label="操作" width="50">
           <template slot-scope="scope">
             <el-button
@@ -28,12 +51,18 @@
           </template>
         </el-table-column>
       </mergeRowTable>
+      </el-tab-pane>
     </el-tabs>
+    <div class="count"  style="margin-right:50px;font-size:18px;">
+      <div style="display:flex;flex-direction:row-reverse">总车数:{{dataTabel.length}}</div>
+      <div style="display:flex;flex-direction:row-reverse">标重总吨位:{{sum}}</div>
+    </div>
   </div>
 </template>
 
 <script>
 import { getCookie } from "@/utils/util.js";
+import { sjTime } from "@/utils/sharedJsFile";
 export default {
   name: "inplantTMS",
   data() {
@@ -47,34 +76,70 @@ export default {
         comparison: "resultNumber",
         columnIndexs: [0, 1, 2, 3, 4, 5],
       },
+      startTime: null,
+      endTime: null,
+      tableTitle: "港口出库表",
+      dataTabel:[],
+      sum:0,
     };
   },
   filters: {},
+  mounted(){
+    this.onclick();
+  },
   methods: {
     onclick() {
       if (this.activeName == "first") {
-        this.option1.requestUrl =
-          "/api/v1/wmsh/getUnLockPortStock?apiId=494&con=" + this.input;
+        if(this.checkSEDate()==true){
+          this.option1.requestUrl =
+          "/api/v1/wmsh/getUnLockPortStock?apiId=494&con=" + this.input
+          +"&activeName="+this.activeName
+          +"&startTime="+sjTime(this.startTime)
+          +"&endTime="+sjTime(this.endTime);
+        }else{
+          this.option1.requestUrl =
+          "/api/v1/wmsh/getUnLockPortStock?apiId=494&con=" + this.input
+           +"&activeName="+this.activeName;
+        }
+      }else if(this.activeName == "second"){
+        if(this.checkSEDate()==true){
+          this.option1.requestUrl =
+          "/api/v1/wmsh/getUnLockPortStock?apiId=494&con=" + this.input
+           +"&activeName="+this.activeName
+           +"&startTime="+sjTime(this.startTime)
+          +"&endTime="+sjTime(this.endTime);
+        }else{
+          this.option1.requestUrl =
+          "/api/v1/wmsh/getUnLockPortStock?apiId=494&con=" + this.input
+          +"&activeName="+this.activeName;
+        }
       }
     },
     insert() {
       this.$router.push("/addWagonLoadCopy");
     },
     handleClick(tab, event) {
-      console.log(tab, event);
+      this.onclick();
     },
     click(resultId) {
-      console.log("res",getCookie("orgCode"));
-      if (
-        getCookie("orgCode") == "yuanliaogongsi" ||
-        getCookie("orgCode") == "dagangadmin"
-      ) {
-       this.$router.push("/editOutBoundWagon/" + resultId);
-      
-      } else {
-          this.$message.warning("权限不足,请联系部门管理员!");
-        }
+      this.$router.push("/editOutBoundWagon/" + resultId);
     },
+    //起止时间校验
+    checkSEDate(){
+      if(this.startTime && this.endTime && this.startTime<=this.endTime){
+          return true;
+      }else{
+         return false;
+      }
+    },
+    calculate(res){
+      console.log("res",res);
+      this.dataTabel=res.list;
+      this.sum=0
+      this.dataTabel.forEach(item => {
+        this.sum+=item.weight;
+      });
+    }
   },
 };
 </script>

+ 2 - 2
src/views/sale/components/offSiteTransportation/checkGPS.vue

@@ -508,11 +508,11 @@ export default {
         .then(res => {
           if (res.data.data == "-1") {
             this.$message.error("运输订单未关闭,自提车辆无权查看!");
-          } else if (res.data.data.startAndEndRoutes != "") {
+          } else if (res.data.data.startAndEndRoutes) {
             that.listPath = res.data.data.startAndEndRoutes;
             that.initMap([105.602725, 37.076636]);
           } else {
-            this.$message.error("车辆没有开启GPS");
+            this.$message.error("车辆没有开启GPS或尚未注册!");
           }
         });
     },

+ 53 - 9
src/views/statisticalReport/components/ShipWorkReport.vue

@@ -27,18 +27,12 @@
              <el-table
           ref="loadTable"
           highlight-current-row
+          border
           :data="loadTable"
+          :span-method="objectSpanMethod"
           :row-style="{height:'40px'}"
           style="width: 100%;font-size: 18px">
           <el-table-column
-          type="index"
-          width="50"
-          label="编号"
-          align="center"
-          fixed="left"
-          :resizable="false">
-          </el-table-column>
-          <el-table-column
           align="center"
             prop="materialName"
             label="物资名"
@@ -65,6 +59,7 @@
            <el-table
           ref="unLoadTable"
           highlight-current-row
+          border
           :data="unLoadTable"
           :row-style="{height:'40px'}"
           style="width: 100%;font-size: 18px">
@@ -110,6 +105,8 @@ export default {
             startTime:null,
             endTime:null
         },
+        spanArr: [], // 用于存放需要合并的行的个数
+        spanIndex: 0, // 记录spanArr数组的下标
       
     };
   },
@@ -120,12 +117,29 @@ export default {
   methods: {
     //查询装车数据
     searchLoadData(){
+      //时间校验
       if(this.map.startTime && this.map.endTime){
+        if(this.map.startTime>=this.map.endTime){
+            this.$message({
+                message:"结束日期必须大于起始日期!",
+                type:"warning",
+                duration:2000
+            });
+            return;
+        }
         this.map.startTime=sjTime(this.map.startTime);
         this.map.endTime=sjTime(this.map.endTime);
+      }else if((this.map.startTime && !this.map.endTime) || (!this.map.startTime && this.map.endTime)){
+        this.$message({
+            message:"起止日期错误!",
+            type:"warning",
+            duration:2000
+        });
+        return;
       }
       this.axios.post('/api/v1/tms/getLoadData',this.map).then((res)=>{
         if(res.data.code == "200"){
+          this.getSpanArr(res.data.data);
           this.loadTable=res.data.data;
           this.count=0;
           this.loadTable.forEach((item)=>{
@@ -151,7 +165,37 @@ export default {
           });
         }
       })
-    }
+    },
+    //处理数据,得到合并数组
+    getSpanArr(data) {
+        this.spanArr=[];
+        for (let i = 0; i < data.length; i++) {
+            if (i == 0) {
+                this.spanArr.push(1);
+                this.spanIndex = 0;
+            } else {
+                // 判断当前行与前一行内容是否相同
+                if (data[i].materialName == data[i - 1].materialName) {
+                    this.spanArr[this.spanIndex] += 1; // 相同的话,当前下标所代表的值加一,例如:第一列的前三行可合并
+                    this.spanArr.push(0);// 记录完毕后,再往数组里添加一个元素0,作为下一次合并的初始值
+                } else {
+                    this.spanArr.push(1); // 否则,依旧是一行
+                    this.spanIndex = i;
+                }
+            }
+        }
+    },
+     //合并
+    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
+        if (columnIndex === 0) {
+            const _row = this.spanArr[rowIndex]; // 行数
+            const _col = _row > 0 ? 1 : 0; // 列数
+            return {
+                rowspan: _row,
+                colspan: _col
+            };
+        }
+    },
   },
 };
 </script>

+ 244 - 0
src/views/statisticalReport/components/dowmShipDynamicTable.vue

@@ -0,0 +1,244 @@
+<template>
+  <!-- 万州港作业报表 -->
+  <div class="dowmShipDynamicTable">
+    <div style="height:100%;width:100%">
+      <div class="search" style="display:flex;margin: 10px;">
+        <el-input
+          placeholder="请输入"
+          v-model="map.input"
+          style="margin: 10px; width:10%"
+          clearable
+        ></el-input>
+       <el-date-picker style="margin: 10px;" v-model="map.startTime" type="datetime" placeholder="起始日期"></el-date-picker>
+      <el-date-picker style="margin: 10px;" v-model="map.endTime" type="datetime" placeholder="结束日期"></el-date-picker>
+        <el-button
+          type="primary"
+          class="btn"
+          @click="getTableData()"
+          style="margin: 10px;"
+        >
+          <i class="el-icon-search"></i>查询
+        </el-button>
+      </div>
+      <!-- 下游港口船舶动态表 -->
+      <div class="loadData" style="height:500px;margin-left:5px">
+        <!-- <div style="font-size:16px;color:red">港口装车数据:共{{count}}车</div> -->
+        <div class="loadTable" style="height:500px;overflow:scroll;">
+        <el-table
+          ref="loadTable"
+          highlight-current-row
+          empty-text="请查询数据"
+          border
+          show-summary
+          :summary-method="getSummaries"
+          :span-method="objectSpanMethod"
+          :data="tableData"
+          :row-style="{height:'40px'}"
+          style="width: 100%;font-size: 18px">
+          <el-table-column
+          align="center"
+            prop="portName"
+            label="放货港口"
+            width="100px">
+          </el-table-column>
+          <el-table-column
+          align="center"
+            prop="productName"
+            label="品种/数量/放货日期"
+            width="380px">
+          </el-table-column>
+          <el-table-column
+          align="center"
+            prop="gmTonnage"
+            label="港口库存"
+            width="100px">
+          </el-table-column>
+          <el-table-column
+          align="center"
+            prop="capacityNumber"
+            label="船名"
+            width="100px">
+          </el-table-column>
+           <el-table-column
+          align="center"
+            prop="instructPlannedLoading"
+            label="计划吨位"
+            width="100px">
+          </el-table-column>
+           <el-table-column
+          align="center"
+          prop="shipDynamic"
+            label="船舶动态"
+            width="250px">
+            <template slot-scope="scope">
+                <el-input v-model="scope.row.shipDynamic"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column
+          align="center"
+            label="装船(吨)"
+            prop="loadDetails"
+            width="250px">
+            <template slot-scope="scope">
+            <el-input v-model="scope.row.loadDetails"></el-input>
+            </template>
+          </el-table-column>
+           <el-table-column fixed="right" label="操作" align="center" width="50">
+            <template slot-scope="scope">
+                <el-button @click="updateDynamic(scope.row)" type="text" size="small">保存</el-button>
+            </template>
+      </el-table-column>
+        </el-table>
+        </div >
+      </div>
+    </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 {
+        tableData:[],
+        spanArr: [], // 用于存放需要合并的行的个数
+        spanIndex: 0, // 记录spanArr数组的下标
+        map:{
+            input:"",
+            startTime:null,
+            endTime:null
+        },
+    };
+  },
+  mounted(){
+    //this.getTableData();
+  },
+  methods: {
+    //查询表格数据
+    getTableData(){
+      console.log("map",this.map);
+      //时间校验
+      if(this.map.startTime && this.map.endTime){
+        if(this.map.startTime>=this.map.endTime){
+            this.$message({
+                message:"结束日期必须大于起始日期!",
+                type:"warning",
+                duration:2000
+            });
+            return;
+        }
+        this.map.startTime=sjTime(this.map.startTime);
+        this.map.endTime=sjTime(this.map.endTime);
+      }else if((this.map.startTime && !this.map.endTime) || (!this.map.startTime && this.map.endTime)){
+        this.$message({
+            message:"起止日期错误!",
+            type:"warning",
+            duration:2000
+        });
+        return;
+      }
+      //发送请求
+      this.axios.post('/api/v1/tms/getDownShipDynamaics',this.map).then((res)=>{
+        if(res.data.code == "200"){
+            this.getSpanArr(res.data.data);//先得到合并数组
+            return Promise.resolve(res);
+        }else {
+          this.$message({
+              type: "error",
+              message: res.data.data,
+          });
+        }
+      }).then((res)=>{
+        //再给表格赋值
+        this.tableData=res.data.data;
+      });
+    },
+    updateDynamic(row){
+        console.log("row:",row);
+        if(!row.instructionsCapacityId){
+             this.$message.warning("无法保存,请先操作装船指令!");
+             return;
+        }
+        this.axios.post('/api/v1/tms/updateInstructionsCapacity',row).then((res)=>{
+            if(res.data.code == "200"){
+                this.$message.success("保存成功!");
+                this.getTableData();
+            }else {
+                this.$message({
+                    type: "error",
+                    message: res.data.data,
+                });
+            }
+        });
+    },
+    getSummaries(param) {
+        console.log("param",param);
+        const { columns, data } = param;
+        const sums = [];
+        columns.forEach((column, index) => {
+          if (index === 0) {
+            sums[index] = '合计';
+            return;
+          }
+          if (index === 3 || index===5) {
+            sums[index] = '';
+            return;
+          }
+          const values = data.map(item => Number(item[column.property]));
+          if (!values.every(value => isNaN(value))) {
+            sums[index] = values.reduce((prev, curr) => {
+              const value = Number(curr);
+              if (!isNaN(value)) {
+                return new BigNumber(prev).plus(curr).toNumber();
+              } else {
+                return prev;
+              }
+            }, 0);
+          } else {
+            sums[index] = '';
+          }
+        });
+        return sums;
+    },
+    //处理数据,得到合并数组
+    getSpanArr(data) {
+        this.spanArr=[];
+        for (let i = 0; i < data.length; i++) {
+            if (i == 0) {
+                this.spanArr.push(1);
+                this.spanIndex = 0;
+            } else {
+                // 判断当前行与前一行内容是否相同
+                if (data[i].portName == data[i - 1].portName) {
+                    this.spanArr[this.spanIndex] += 1; // 相同的话,当前下标所代表的值加一,例如:第一列的前三行可合并
+                    this.spanArr.push(0);// 记录完毕后,再往数组里添加一个元素0,作为下一次合并的初始值
+                } else {
+                    this.spanArr.push(1); // 否则,依旧是一行
+                    this.spanIndex = i;
+                }
+            }
+        }
+        console.log("spanArr",this.spanArr);
+    },
+    //合并
+    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
+        if (columnIndex === 0) {
+            const _row = this.spanArr[rowIndex]; // 行数
+            const _col = _row > 0 ? 1 : 0; // 列数
+            return {
+                rowspan: _row,
+                colspan: _col
+            };
+        }
+    },
+  },
+};
+</script>
+<style lang='scss'>
+
+</style>
+

+ 7 - 0
src/views/statisticalReport/router/index.js

@@ -8,6 +8,7 @@ import main from "@/components/main.vue";
 // 系统配置管理
 import ShipDynamicTable from "../components/Ship_dynamic_table.vue";
 import ShipWorkReport from "../components/ShipWorkReport.vue";
+import dowmShipDynamicTable from "../components/dowmShipDynamicTable.vue";
 import purchaseAccessoriesMonitor from "../components/purchaseAccessoriesMonitor.vue";
 import purchasFuelOldMonitor from "../components/purchasFuelMonitor/purchasFuelOldMonitor.vue";
 import purchasFuelNewMonitor from "../components/purchasFuelMonitor/purchasFuelNewMonitor.vue";
@@ -65,6 +66,12 @@ const constantRouterMap = [
         meta: { code: "xtpzgl-yhgl" },
         component: ShipWorkReport
       },
+      {
+        path: "dowmShipDynamicTable",
+        name: "dowmShipDynamicTable",
+        meta: { code: "xtpzgl-yhgl" },
+        component: dowmShipDynamicTable
+      },
       {
         path: "purchaseAccessoriesMonitor",
         name: "purchaseAccessoriesMonitor",