Tiroble 3 年之前
父節點
當前提交
d4d31abe9b

+ 2 - 2
build/utils.js

@@ -15,11 +15,11 @@ const devPathSrc = path.resolve(__dirname, '../../../src'); // node_modules应
 // ['index','appoint','configManager','homepage',''inward,'queue','RMS','sale','serviceManager','SporadicManage'
 //       统计报表       组织机构/系统管理 采购  仓储
 //  'statisticalReport','systemConfig','TMS','WMS','workFlow']
-//  let devModules = ['all']
+ let devModules = ['all']
 // let devModules = ['index','appoint','sale','RMS','statisticalReport'];
 // let devModules = ['index','appoint','WMS'];
 // let devModules = ['index','inward','ADMINISTRATORS']
-let devModules = ['index','sale']
+// let devModules = ['index','sale']
 // let devModules = ['index','SporadicManage','RMS','statisticalReport']
 // let devModules = ['index','inward','statisticalReport']
 //  let devModules = ['index','WMS','sale','TMS','inward','SporadicManage']

+ 2 - 1
src/components/DilCommonUI/index.js

@@ -1,7 +1,8 @@
 import Table from "./packages/table/index.js";
 import Form from "./packages/form/index.js";
+import MergeRowTable from "./packages/mergeRowTable/index.js";
 
-const components = [Table, Form];
+const components = [Table, Form, MergeRowTable];
 
 const install = function(Vue) {
   components.forEach(component => {

+ 7 - 0
src/components/DilCommonUI/packages/mergeRowTable/index.js

@@ -0,0 +1,7 @@
+import MergeRowTable from "./src/mergeRowTable.vue";
+
+MergeRowTable.install = function(Vue) {
+  Vue.component(MergeRowTable.name, MergeRowTable);
+};
+
+export default MergeRowTable;

+ 407 - 0
src/components/DilCommonUI/packages/mergeRowTable/src/mergeRowTable.js

@@ -0,0 +1,407 @@
+import Sortablejs from "sortablejs";
+export default {
+  data() {
+    return {
+      // 等数据渲染完了再显示
+      isShow: false,
+      // 自己 请求体 参数
+      dataRequestQuery: {},
+      // 自己的表数据
+      dataTabel: [],
+      // 自己的表头数据
+      dataColumnData: [],
+      // 拖拽的表头数据
+      dataDropColumn: [],
+      // 自己的数据总条数
+      dataTotal: 0,
+      // 自己的当前页面数
+      dataCurrentPage: 1,
+      // 自己的每页显示条目个数
+      dataPageSize: 10,
+      // 保存表格所有页面所选中的数据
+      dataRadioId: [],
+      // 保存表格单选的数据 保存数据的id
+      dataRadioId: "",
+      // 合并数组
+      spanArr:[],
+
+    };
+  },
+  created() {
+    if(this.isHeigth){
+      window.addEventListener('resize',this.getHeight)
+      this.getHeight();
+    }
+    
+    this.dataCurrentPage = this.currentPage;
+    this.dataPageSize = this.pageSize;
+    this.requestData();
+  },
+  mounted() {
+    //行拖拽
+    // this.rowDrop();
+    //列拖拽
+    // this.columnDrop();
+  },
+  methods: {
+
+    //记录每一行的合并数
+    getSpanArr(data) {
+      //每次调用方法初始化
+      this.spanArr = [];
+      for (var i = 0; i < data.length; i++) {
+        if (i === 0) {
+          this.spanArr.push(1);
+          this.pos = 0;
+        } else {
+          // 判断当前元素与上一个元素是否相同
+          console.log(this.comparison)
+          if (data[i][this.comparison] === data[i - 1][this.comparison]) {
+            this.spanArr[this.pos] += 1;
+            this.spanArr.push(0);
+          } else {
+            this.spanArr.push(1);
+            this.pos = i;
+          }
+        }
+      }
+    },
+    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
+      console.log("this.columnIndexs")
+      console.log(this.columnIndexs)
+      console.log("this.columnIndexs")
+    
+      if (
+        this.columnIndexs.indexOf(columnIndex)!=-1
+      ) {
+        const _row = this.spanArr[rowIndex];
+        const _col = _row > 0 ? 1 : 0;
+        return {
+          rowspan: _row,
+          colspan: _col
+        };
+      }
+    },
+    getHeight(){
+      this.height = window.innerHeight - this.shiyHeigth;
+      console.log(this.height);
+    },
+    //计算合计列
+    getSummaries(columns,data) {
+      const sums = [];
+      columns.forEach((column, index) => {
+       const values = data.map(item => Number(item[column.property]));
+           if (column.property =='resultNetWeight' ) {
+            sums[index] = values.reduce((prev, curr) => {
+             const value = Number(curr);
+             if (!isNaN(value)) {
+               return prev + curr;
+             } else {
+               return prev;
+             }
+            }, 0);
+            console.log(sums )
+            sums[index];
+           }
+      });
+      // console.log("净重:" + sums)
+      return sums
+      },
+    // 通过请求获取数据
+    requestData(options) {
+      let pageNum = undefined;
+      let pageSize = undefined;
+      
+      if (options) {
+        pageNum = options.pageNum;
+        pageSize = options.pageSize;
+      }
+      
+      if (this.requestUrl) {
+        // 处理请求地址逻辑
+        let url;
+        if (this.requestUrl.indexOf("//") > -1) {
+          url = this.requestUrl;
+        } else {
+          url = this.requestUrl;
+        }
+        // 判断是否需要在请求体中放入参数
+        if(this.requestQuery){
+          this.dataRequestQuery=this.requestQuery;
+          // console.log(this.dataRequestQuery.resultBreakId)
+        }
+        let data = undefined;
+        for (const key in this.dataRequestQuery) {
+          const val = this.dataRequestQuery[key];
+          console.log(val)
+          if (val||val==0) {
+            if (!data) data = {};
+            data[key] = val;
+          }
+        }
+        //判断是否是带分页查询
+        if(this.isKuang){
+          // 发送请求
+          this.axios
+          .post(url, data, {
+            // 请求地址 中
+            params: {
+              pageNum: 1,
+              pageSize: pageSize || this.dataPageSize
+            }
+          })
+          .then(response => {
+            let d = response.data.data;
+            this.dataTabel = d.list;
+            this.dataTotal = d.total;
+            this.getSpanArr(this.dataTabel);
+            //执行成功的回调
+            this.$emit('func',response.data.data);
+            this.refreshColumnData(d.columnData);
+            this.isShow = true;
+          });
+        }else{
+          // 发送请求
+          this.axios
+            .post(url, data, {
+              // 请求地址 中
+              params: {
+                pageNum: pageNum || this.dataCurrentPage,
+                pageSize: pageSize || this.dataPageSize
+              }
+            })
+            .then(response => {
+              let d = response.data.data;
+              this.dataTabel = d.list;
+              this.dataTotal = d.total;
+              this.getSpanArr(this.dataTabel);
+              //执行成功的回调
+              this.$emit('func',response.data.data);
+              this.refreshColumnData(d.columnData);
+              this.isShow = true;
+            });
+        }
+      } else {
+        console.warn("requestUrl 参数不能为 null");
+      }
+    },
+    // 刷新表头显示数据
+    refreshColumnData(columnData) {
+      // 表头只赋值一次(在查出全部数据的情况下才只赋值一次)
+      console.log("biaof")
+      console.log(this.dataColumnData.length)
+      if (this.dataColumnData.length > 0){
+          return;
+      } 
+      // 如果前端有写表头,则加在后端表头前面
+      
+      const d = this.columnData.concat(columnData);
+      // 把操作列拼接到最后一列
+      this.dataColumnData = d;
+      this.dataDropColumn = [].concat(this.dataColumnData);
+    },
+    // 排序回调
+    sortChange({ column, prop, order }) {
+      // column : 列的数据
+      // prop : 排序字段参数名
+      // order : 排序方式 (ascending:升序;descending:降序;null:无)
+
+      // 前端排序
+      // const sort = {
+      //   ascending: (a, b) => {
+      //     a[prop] = this.getString(a[prop]);
+      //     b[prop] = this.getString(b[prop]);
+      //     return a[prop].localeCompare(b[prop] || "", 'zh-CN');
+      //   },
+      //   descending: (a, b) => {
+      //     a[prop] = this.getString(a[prop]);
+      //     b[prop] = this.getString(b[prop]);
+      //     return b[prop].localeCompare(a[prop] || "", 'zh-CN')
+      //   },
+      // };
+      // this.dataTabel.sort(sort[order]);
+      // 前端排序
+
+      // 后端排序
+      let s = {
+        ascending: "asc",
+        descending: "desc"
+      };
+
+      let value = {
+        orderType: s[order] || undefined,
+        orderField: order ? prop : undefined
+      };
+
+      this.setDataRequestQuery(value);
+    },
+    // 更新请求参数
+    setDataRequestQuery(value) {
+      console.log(value);
+      let q = this.dataRequestQuery;
+      for (const key in value) {
+        q[key] = value[key];
+      }
+      this.requestData(q);
+      this.$emit("update:requestQuery", q);
+      this.dataRequestQuery = q;
+    },
+    // 格式化字符串
+    getString(str) {
+      if (str != null && str != undefined && str.toString) {
+        return str.toString();
+      } else {
+        return str || "";
+      }
+    },
+    // 当某一行被点击时会触发该事件
+    rowClick(row, column, event) {
+      if (this.selectionType == "radio") {
+        if (this.dataRadioId == row.ROW_ID) {
+          this.dataRadioId = "";
+          row = {};
+        } else {
+          this.dataRadioId = row.ROW_ID;
+        }
+        this.$emit("radio-change", row);
+      }
+    },
+    // 多选的选中行改变回调
+    selectionChange(selection) {
+      // this.dataSelection = selection;
+      // 将多选中的数据抛出
+      this.$emit("selection-change", selection);
+    },
+    // 当表格的筛选条件发生变化的时候会触发该事件,
+    // 参数的值是一个对象,对象的 key 是 column 的 columnKey,对应的 value 为用户选择的筛选条件的数组。
+    filterChange(filters) {
+      let value = {};
+      for (const key in filters) {
+        value[key] = filters[key].length > 0 ? filters[key] : undefined;
+      }
+      // 每次筛选时,都默认将页面改为第一页,避免数据过少时,显示没有数据
+      this.currentChange(1, false);
+      this.setDataRequestQuery(value);
+    },
+    // 行拖拽
+    rowDrop() {
+      const tbody = document.querySelector(".el-table__body-wrapper tbody");
+      const _this = this;
+      Sortablejs.create(tbody, {
+        onEnd({ newIndex, oldIndex }) {
+          const currRow = _this.dataTabel.splice(oldIndex, 1)[0];
+          _this.dataTabel.splice(newIndex, 0, currRow);
+        }
+      });
+    },
+    // 列拖拽
+    columnDrop() {
+      const wrapperTr = document.querySelector(".el-table__header-wrapper tr");
+      this.sortablejs = Sortablejs.create(wrapperTr, {
+        animation: 180,
+        delay: 0,
+        handle: ".allowDrag",
+        onEnd: evt => {
+          // 因为序号列和单多选列不在数组中,所以需要进行偏移计算
+          const offset = this.dragColumnOffset;
+          evt.oldIndex -= offset;
+          evt.newIndex -= offset;
+          // 换列
+          const oldItem = this.dataDropColumn[evt.oldIndex];
+          this.dataDropColumn.splice(evt.oldIndex, 1);
+          this.dataDropColumn.splice(evt.newIndex, 0, oldItem);
+        }
+      });
+    },
+    // current-page 改变时会触发
+    currentChange(val, isRequest = true) {
+      if (isRequest) {
+        this.requestData({ pageNum: val });
+      }
+      // 最后通知父节点页面改变
+      this.dataCurrentPage = val;
+      this.$emit("update:current-page", val);
+    },
+    // pageSize 改变时会触发
+    sizeChange(val) {
+      this.dataPageSize = val;
+      this.requestData({});
+      this.$emit("update:size-change", val);
+    }
+  },
+  computed: {
+    // 计算是否使用排序功能
+    dataSortable() {
+      return function (item) {
+        if (item.template) {
+          return false;
+        } else if (item.sortable) {
+          return item.sortable;
+        } else {
+          return this.sortable;
+        }
+      };
+    },
+    // 计算每列的最小宽度
+    dataColumnMinWidth() {
+      return function (item) {
+        let mw = 0;
+        if (this.dataSortable(item)) {
+          // 如果使用排序功能
+          mw += 30;
+        }
+
+        if (item.filters && item.filters.length > 0) {
+          mw += 20;
+        }
+        if (item.label) {
+          mw += item.label.toString().length * 30;
+        }
+        return mw;
+      };
+    },
+    // 计算拖拽列的偏移差
+    dragColumnOffset() {
+      let o = 0;
+      if (this.showIndex) {
+        o++;
+      }
+      if (this.selectionType != "") {
+        o++;
+      }
+      return o;
+    }
+  },
+  watch: {
+    requestQuery: {
+      deep: true,
+      handler(val, oldVal) {
+        let q = this.dataRequestQuery;
+        for (const key in val) {
+          q[key] = val[key] ? val[key] : undefined;
+        }
+        this.setDataRequestQuery(q);
+      }
+    },
+  },
+  // 注册组件
+  components: {
+    // 代理组件
+    componentProxy: {
+      props: {
+        html: {
+          default: ""
+        },
+        scope: {
+          default() {
+            return {};
+          }
+        }
+      },
+      template: ``,
+      created() {
+        this.$options.template = this.html;
+      }
+    }
+  }
+};

+ 292 - 0
src/components/DilCommonUI/packages/mergeRowTable/src/mergeRowTable.vue

@@ -0,0 +1,292 @@
+<template>
+  <div class="st-base-table" v-show="isShow">
+    <!-- 表格主体 -->
+    <el-table
+      ref="mainTable"
+      :data="dataTabel"
+      row-key="ROW_ID"
+      :stripe="stripe"
+      :border="border"
+      :cell-class-name="cellClassName"
+      :height="height"
+      :highlight-current-row="highlightCurrentRow"
+      style="width:100%"
+      :span-method="objectSpanMethod"
+      @sort-change="sortChange"
+      @selection-change="selectionChange"
+      @filter-change="filterChange"
+      @row-click="rowClick"
+      @row-dblclick="rowDbClick"
+      v-loading="loading"
+      element-loading-text="玩命加载中"
+      element-loading-spinner="el-icon-loading"
+      :isHeigth="isHeigth"
+      :shiyHeigth="shiyHeigth"
+    >
+      <!-- 多选列 -->
+      <el-table-column
+        v-if="selectionType == 'select'"
+        type="selection"
+        width="50"
+        align="center"
+        fixed="left"
+        :reserve-selection="reserveSelection"
+        :resizable="false"
+      >
+      </el-table-column>
+
+      <!-- 单选 -->
+      <el-table-column
+        v-if="selectionType == 'radio'"
+        width="50"
+        align="center"
+        label="单选"
+        fixed="left"
+        :resizable="false"
+      >
+        <template slot-scope="scope">
+          <el-radio
+            :value="dataRadioId"
+            :label="scope.row.ROW_ID"
+            @click.native.prevent.stop="rowClick(scope.row)"
+          >
+            {{ "" }}
+          </el-radio>
+        </template>
+      </el-table-column>
+
+      <!-- 序号 -->
+      <el-table-column
+        v-if="showIndex"
+        type="index"
+        width="50"
+        label="序号"
+        align="center"
+        fixed="left"
+        :resizable="false"
+      >
+      </el-table-column>
+
+      <!-- 表格列 -->
+      <el-table-column
+        v-for="(item, index) in dataColumnData"
+        :key="item.data_id || 'auto_' + index"
+        v-bind="item"
+        :column-key="dataDropColumn[index].prop"
+        :align="item.align || align"
+        :sortable="dataSortable(item)"
+        :show-overflow-tooltip="item.showOverflowTooltip || showOverflowTooltip"
+        :min-width="item['min-width'] || dataColumnMinWidth(item)"
+        :class-name="item['class-name'] || 'allowDrag'"
+      >
+        <!-- 表格每行的内容 -->
+        <div slot-scope="scope">
+          <!-- 功能位置 -->
+          <component-proxy
+            v-if="item.template"
+            :html="item.template"
+            :scope="scope"
+            v-on="$listeners"
+          >
+          </component-proxy>
+
+          <!-- 文本位置 -->
+          <template v-else>
+            {{ dataTabel[scope.$index][dataDropColumn[index].prop] }}
+          </template>
+        </div>
+      </el-table-column>
+
+      <!-- 默认插槽 -->
+      <slot></slot>
+    </el-table>
+
+    <!-- 分页器 -->
+    <el-pagination
+      v-if="isPagination"
+      :layout="layout"
+      :current-page="dataCurrentPage"
+      :page-sizes="pageSizes"
+      :page-size="dataPageSize"
+      :total="dataTotal"
+      @current-change="currentChange"
+      @size-change="sizeChange"
+    >
+    </el-pagination>
+  </div>
+</template>
+
+<script>
+import table from "./mergeRowTable.js";
+export default {
+  name: "MergeRowTable",
+  extends: table,
+  props: {
+    // 合并行下标
+    columnIndexs:{
+     default: []
+    },
+    //比对字段
+    comparison:{
+      default: ""
+    },
+    shiyHeigth: {
+      default: null
+    },
+    isHeigth: {
+      default: false
+    },
+    drawer: {
+      default: false
+    },
+    //判断是否带分页查询
+    isKuang: {
+      default: false
+    },
+    // 请求地址
+    requestUrl: {
+      default: ""
+    },
+    // 请求参数 请求体中的参数
+    requestQuery: {
+      default() {
+        return {};
+      }
+    },
+    // 表头数据
+    columnData: {
+      default() {
+        return [];
+      }
+    },
+    // 是否显示序号
+    showIndex: {
+      default: true
+    },
+    // 是否显示选择框
+    // radio : 显示单选框
+    // select : 显示多选框
+    selectionType: {
+      default: ""
+    },
+    // 是否在数据翻页后保留之前选中的数据(需指定 row-key)
+    reserveSelection: {
+      default: true
+    },
+    // 是否为斑马纹 table
+    stripe: {
+      default: true
+    },
+    // Table 的高度,默认为自动高度。
+    // 如果 height 为 number 类型,单位 px;
+    // 如果 height 为 string 类型,则这个高度会设置为 Table 的 style.height 的值,Table 的高度会受控于外部样式。
+    height: {
+      default: null
+    },
+    // Table 的最大高度。合法的值为数字或者单位为 px 的高度。
+    //sdada
+    maxHeight: {
+      default: null
+    },
+    // 是否启用排序
+    sortable: {
+      default: "custom"
+    },
+    // 对齐方式 left/center/right
+    align: {
+      default: "center"
+    },
+    // 是否带有纵向边框
+    border: {
+      default: true
+    },
+    // 是否要高亮当前行
+    highlightCurrentRow: {
+      default: false
+    },
+    // 当内容过长被隐藏时显示 tooltip
+    showOverflowTooltip: {
+      default: true
+    },
+    // 行的 className 的回调方法,也可以使用字符串为所有行设置一个固定的 className。
+    rowClassName: {
+      default() {
+        return ({ row, rowIndex }) => "";
+      }
+    },
+    // 单元格的 className 的回调方法,也可以使用字符串为所有单元格设置一个固定的 className。
+    cellClassName: {
+      default() {
+        return ({ row, rowIndex }) => "";
+      }
+    },
+    loading: {
+      default: false
+    },
+    // 是否启用分页器
+    isPagination: {
+      default: true
+    },
+    // 当前页数,支持 .sync 修饰符
+    currentPage: {
+      default: 1
+    },
+    // 每页显示个数选择器的选项设置
+    pageSizes: {
+      default() {
+        return [10, 20, 50, 100, 200, 1000, 50000];
+      }
+    },
+    // 每页显示条目个数,支持 .sync 修饰符
+    pageSize: {
+      default: 10
+    },
+    //组件布局,子组件名用逗号分隔
+    layout: {
+      default: "total, prev, pager, next, sizes, jumper"
+    }
+  },
+  watch: {
+    requestUrl() {
+      this.refreshData();
+    },
+    drawer(val) {
+      if (val) {
+        this.dataRadioId = null;
+      }
+    }
+  },
+  methods: {
+    // 刷新表格数据
+    refreshData() {
+      this.requestData();
+      // 多选表格清空用户的选择
+      this.$refs.mainTable.clearSelection();
+    },
+    rowDbClick(row) {
+      console.log(row);
+      console.log("我被双击了");
+      this.$emit("rowDbClick", row);
+    },
+    toggleRowExpansion(row, expanded) {
+      this.$refs.mainTable.toggleRowExpansion(row, expanded);
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+@media print {
+  .el-pagination {
+    display: none;
+  }
+}
+/deep/.el-table .success-row {
+  background: #fff !important;
+  color: #f56c6c;
+  height: 44px;
+  line-height: 46px;
+  font-size: 22px;
+  font-weight: 700;
+}
+</style>

+ 6 - 20
src/components/DilCommonUI/packages/table/src/table.vue

@@ -15,6 +15,7 @@
       @selection-change="selectionChange"
       @filter-change="filterChange"
       @row-click="rowClick"
+      @row-dblclick="rowDbClick"
       v-loading="loading"
       element-loading-text="玩命加载中"
       element-loading-spinner="el-icon-loading"
@@ -245,11 +246,6 @@ export default {
         this.dataRadioId = null;
       }
     }
-    // dataTabel: function() {
-    //   this.$nextTick(function() {
-    //     this.$refs.mainTable.setCurrentRow(this.dataTabel[0])
-    //   })
-    // }
   },
   methods: {
     // 刷新表格数据
@@ -258,24 +254,14 @@ export default {
       // 多选表格清空用户的选择
       this.$refs.mainTable.clearSelection();
     },
+    rowDbClick(row) {
+      console.log(row);
+      console.log("我被双击了");
+      this.$emit("rowDbClick", row);
+    },
     toggleRowExpansion(row, expanded) {
       this.$refs.mainTable.toggleRowExpansion(row, expanded);
     }
-    // objectSpanMethod({ row, column, rowIndex, columnIndex }) {
-    //     if (columnIndex === 0) {
-    //       if (rowIndex % 2 === 0) {
-    //         return {
-    //           rowspan: 2,
-    //           colspan: 1
-    //         };
-    //       } else {
-    //         return {
-    //           rowspan: 0,
-    //           colspan: 0
-    //         };
-    //       }
-    //     }
-    //   }
   }
 };
 </script>

+ 45 - 32
src/views/appoint/components/saleContract/addSaleOrder.vue

@@ -477,12 +477,12 @@
       <el-form :inline="true" style="margin-top: 0.5rem;">
         <el-form-item>
           <label class="el-form-item__label" style="width: auto;"
-            >物资名称</label
+            >物资名称/型号</label
           >
         </el-form-item>
         <el-form-item>
           <el-input
-            placeholder="请输入内容"
+            placeholder="请输入物资名称或型号"
             v-model="materialNameText"
             clearable
           ></el-input>
@@ -498,16 +498,6 @@
             ><template slot="prepend">Φ</template></el-input
           >
         </el-form-item>
-        <el-form-item>
-          <label class="el-form-item__label" style="width: auto;">型号</label>
-        </el-form-item>
-        <el-form-item>
-          <el-input
-            placeholder="请输入内容"
-            v-model="materialModelText"
-            clearable
-          ></el-input>
-        </el-form-item>
         <el-button
           type="primary"
           class="btn"
@@ -521,7 +511,11 @@
       </el-form>
       <div class="tablecls">
         <!-- 查询所有的物资 -->
-        <dilTable v-bind.sync="option" @selection-change="selectionChange">
+        <dilTable
+          v-bind.sync="option"
+          @selection-change="selectionChange"
+          @rowDbClick="rowDbClick"
+        >
         </dilTable>
       </div>
     </el-drawer>
@@ -531,12 +525,12 @@
       <el-form :inline="true" style="margin-top: 0.5rem;">
         <el-form-item>
           <label class="el-form-item__label" style="width: auto;"
-            >物资名称</label
+            >物资名称/型号</label
           >
         </el-form-item>
         <el-form-item>
           <el-input
-            placeholder="请输入内容"
+            placeholder="请输入物资名称或型号"
             v-model="materialNameText"
             clearable
           ></el-input>
@@ -552,16 +546,6 @@
             ><template slot="prepend">Φ</template></el-input
           >
         </el-form-item>
-        <el-form-item>
-          <label class="el-form-item__label" style="width: auto;">型号</label>
-        </el-form-item>
-        <el-form-item>
-          <el-input
-            placeholder="请输入内容"
-            v-model="materialModelText"
-            clearable
-          ></el-input>
-        </el-form-item>
         <el-button
           type="primary"
           class="btn"
@@ -914,6 +898,11 @@ export default {
     this.getAllsaleMan();
   },
   methods: {
+    rowDbClick(row) {
+      this.materialList1 = [];
+      this.materialList1.push(row);
+      this.makeSureMaterial();
+    },
     //获取所有的业务员数据
     getAllsaleMan() {
       this.axios.get("/api/v1/uc/getSalerList").then(res => {
@@ -995,6 +984,25 @@ export default {
         .then(res => {
           this.remarks = res.data.data;
         });
+      this.axios
+        .post(
+          "/api/v1/ams/matchingAddressRecently?receiveId=" + this.consigneeId
+        )
+        .then(res => {
+          console.log("匹配收货地址");
+          console.log(res);
+          const place = res.data.data;
+          console.log(place);
+          this.saleShipperAddressName =
+            place[0].addressProvince +
+            place[0].addressDistrict +
+            place[0].addressTown +
+            place[0].place;
+          this.saleShipperAddressId = place[0].shipperAddressId;
+          this.place1 = place[0].place;
+          this.saleMan = place[0].salerId;
+          this.saleOrderConsigneeTel = place[0].saleOrderConsigneeTel;
+        });
     },
     //以下是收货单位边输边查搜索
     querySearchConsignee(queryString, cb) {
@@ -1036,6 +1044,8 @@ export default {
       } else {
         this.option.requestUrl =
           "/api/v1/uc/getSteelMaterial?apiId=244&i=" + new Date();
+        this.materialNameText = null;
+        this.materialSpecificationText = null;
         this.table1 = true;
       }
     },
@@ -1154,6 +1164,7 @@ export default {
     },
     //添加物资到订单
     addMaterialToSaleOrder() {
+      debugger;
       if (this.materialList.length == 0) {
         this.$message.warning("请至少为这一车添加一个物资!");
       } else if (!this.saleShipperAddressName && this.values == "no") {
@@ -1229,6 +1240,8 @@ export default {
       this.option1.requestUrl =
         "/api/v1/uc/getSteelMaterial?apiId=244&i=" + new Date();
       this.drawer = true;
+      this.materialNameText = null;
+      this.materialSpecificationText = null;
       this.isOpenDrawer = 1;
       this.indexChangeMaterial = index;
     },
@@ -1477,21 +1490,22 @@ export default {
           "/api/v1/uc/getSteelMaterial?apiId=244&materialNameText=" +
           this.materialNameText +
           "&materialSpecificationText=" +
-          this.materialSpecificationText +
-          "&materialModelText=" +
-          this.materialModelText;
+          this.materialSpecificationText;
       } else {
         this.option1.requestUrl =
           "/api/v1/uc/getSteelMaterial?apiId=244&materialNameText=" +
           this.materialNameText +
           "&materialSpecificationText=" +
-          this.materialSpecificationText +
-          "&materialModelText=" +
-          this.materialModelText;
+          this.materialSpecificationText;
       }
     },
     // 确定
     makeSure() {
+      console.log(this.selectionList.length);
+      if (this.selectionList.length == 0) {
+        this.$message.warning("请先填写具体信息");
+        return;
+      }
       //获取是否自提字段
       this.options.forEach(e => {
         if (this.values == e.values) {
@@ -1567,7 +1581,6 @@ export default {
         saleRemark: this.remarks,
         mapList: mapList
       };
-      debugger;
       console.log(mapValue);
       //所有列件数都填写
       if (orderPlanWeightAllFill == 0) {

+ 13 - 16
src/views/appoint/components/saleContract/addSaleOrderSteelSendCarrier.vue

@@ -57,7 +57,7 @@
                   :fetch-suggestions="querySearch"
                   placeholder="(必填)"
                   :trigger-on-focus="false"
-                  @select="handleSelect"
+                  @select="handleSelect(scope.row, scope.$index)"
                   @blur="checkRelationship(scope.$index)"
                   @change="batchUpdateValue(scope.row, scope.$index)"
                 ></el-autocomplete>
@@ -181,6 +181,7 @@ export default {
       carrierNameOptions: [],
       //当前车序号物资
       selectionList: [],
+      driverTel1: null,
       //是否可发送请求
       canSend: 1,
       tableTop: [
@@ -425,22 +426,17 @@ export default {
       }
     },
     //车牌号弹出层
-    handleSelect(item) {
-      console.log("item");
-      // let mapValue = {
-      //   capacityNumber:item.capacityNumber,
-      //   carrierId:this.receiveCarrierId,
-      //   carrierName:this.receiveCarrierName
-      // }
-      // this.axios
-      // .post("/api/v1/uc/isInCapacityCarrier", mapValue)
-      // .then((res)=>{
-      //   if(res.data.code=="201"){
-      //     this.bindRelationship(mapValue);
-      //   }
-      // });
+    handleSelect(row, index) {
+      console.log(index);
+      this.axios
+        .post(
+          "/api/v1/ams/matchingDriverTelRecently?capacityNumber=" +
+            row.capacityNumber
+        )
+        .then(res => {
+          row.driverTel = res.data.data;
+        });
     },
-
     //以下是车牌号边输边查搜索
     querySearch(queryString, cb) {
       this.axios
@@ -538,6 +534,7 @@ export default {
     batchUpdateValue(row, index) {
       for (var i = index; i < this.spanArr[index] + index; i++) {
         this.selectionList[i].capacityNumber = row.capacityNumber;
+        this.selectionList[i].driverTel = this.driverTel1;
       }
     },
     //初始化线路

+ 133 - 110
src/views/appoint/components/saleContract/saleOrderCoproduct.vue

@@ -15,8 +15,12 @@
     </div>
     <el-tabs v-model="activeName" @tab-click="handleClick">
       <!-- 已审批 -->
-       <el-tab-pane label="已审批" name="four">
-        <dilTable v-bind.sync="option4" @selection-change="selectionChange" ref="table">
+      <el-tab-pane label="已审批" name="four">
+        <dilTable
+          v-bind.sync="option4"
+          @selection-change="selectionChange"
+          ref="table"
+        >
           <el-table-column fixed="right" label="操作" width="200">
             <template slot-scope="scope">
               <el-button
@@ -34,28 +38,26 @@
             </template>
           </el-table-column>
           <!-- 物资详情抽屉 -->
-        <el-table-column type="expand" width="1">
-          <template slot-scope="props">
-            <el-form label-position="center" inline class="demo-table-expand">
-              <div v-if="false">{{ props }}</div>
-              <div>
-                <el-table :data="tableData" border >
-                  <el-table-column
-                    v-for="(item, i) in tableHead"
-                    :key="i"
-                    :prop="item.prop"
-                    :label="item.label"
-                    :width="item.width"
-                  ></el-table-column>
-                </el-table>
-              </div>
-            </el-form>
-          </template>
-        </el-table-column>
-
+          <el-table-column type="expand" width="1">
+            <template slot-scope="props">
+              <el-form label-position="center" inline class="demo-table-expand">
+                <div v-if="false">{{ props }}</div>
+                <div>
+                  <el-table :data="tableData" border>
+                    <el-table-column
+                      v-for="(item, i) in tableHead"
+                      :key="i"
+                      :prop="item.prop"
+                      :label="item.label"
+                      :width="item.width"
+                    ></el-table-column>
+                  </el-table>
+                </div>
+              </el-form>
+            </template>
+          </el-table-column>
         </dilTable>
       </el-tab-pane>
-      
     </el-tabs>
     <!-- 承运商模态框 -->
     <el-drawer
@@ -65,16 +67,30 @@
       size="40%"
       :show-close="false"
     >
-      <el-input placeholder="请输入内容" v-model="index"  
-      style="margin-top: 10px; margin-left: 20px;width:250px" clearable> </el-input
-      ><el-button type="primary" class="btn" @click="onclickCarrier" style="margin-left: 4px;">
+      <el-input
+        placeholder="请输入内容"
+        v-model="index"
+        style="margin-top: 10px; margin-left: 20px;width:250px"
+        clearable
+      >
+      </el-input
+      ><el-button
+        type="primary"
+        class="btn"
+        @click="onclickCarrier"
+        style="margin-left: 4px;"
+      >
         <i class="el-icon-search"></i>查询
       </el-button>
       <!-- <el-button @click="open">取消</el-button> -->
       <el-button type="primary" @click="selectMakeSure">确定</el-button>
       <div class="tablecls">
         <!-- 查询所有的承运商 -->
-        <dilTable v-bind.sync="carrier" @radio-change="currentRadioChange" :drawer="drawer">
+        <dilTable
+          v-bind.sync="carrier"
+          @radio-change="currentRadioChange"
+          :drawer="drawer"
+        >
         </dilTable>
       </div>
     </el-drawer>
@@ -93,31 +109,28 @@ export default {
       carrierName: null,
       option: {
         // 表格请求数据的地址
-        requestUrl:
-          "/api/v1/ams/getSaleOrderInfoes?apiId=408",
+        requestUrl: "/api/v1/ams/getSaleOrderInfoes?apiId=408"
       },
       option2: {
         // 表格请求数据的地址
-        requestUrl:
-          "/api/v1/ams/getSaleOrderReportedes?apiId=408",
+        requestUrl: "/api/v1/ams/getSaleOrderReportedes?apiId=408"
       },
       option3: {
         // 表格请求数据的地址
-        requestUrl:
-          "/api/v1/ams/getAmsSaleOrderApprovedes?apiId=409",
+        requestUrl: "/api/v1/ams/getAmsSaleOrderApprovedes?apiId=409"
       },
       option4: {
         // 表格请求数据的地址
         requestUrl:
           "/api/v1/ams/getSaleOrderListBySaleCompanyes?apiId=409&shipperId=1",
-          selectionType: "select",
+        selectionType: "select"
       },
       carrier: {
-					requestUrl: "",
-					selectionType: "radio",
-			},
+        requestUrl: "",
+        selectionType: "radio"
+      },
       mapList: [],
-      mapItemList:[],
+      mapItemList: [],
       //记录旧的row对象 (销售公司已审批)
       oldRow: "",
       //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态 (销售公司已审批)
@@ -138,23 +151,23 @@ export default {
         {
           prop: "materialName",
           label: "物资名称",
-          width: 150,
+          width: 150
         },
         {
           prop: "specificationModel",
           label: "规格型号",
-          width: 150,
+          width: 150
         },
         {
           prop: "materialNumber",
           label: "物资件数",
-          width: 100,
+          width: 100
         },
         {
           prop: "materialWeight",
           label: "物资重量",
-          width: 100,
-        },
+          width: 100
+        }
       ],
       //(销售公司已审批)
       tableData: [],
@@ -163,86 +176,99 @@ export default {
       //(已上报)
       tableData2: [],
       //(未上报)
-      tableData3: [],
+      tableData3: []
     };
   },
   methods: {
-    refresh(){
+    refresh() {
       this.$router.go(0);
     },
     handleClick(tab, event) {
       console.log(tab, event);
     },
     onclick() {
-      if(this.activeName == "first"){
-        this.option.requestUrl = "/api/v1/ams/getSaleOrderInfoes?apiId=408&con="+this.input;
-      }else if(this.activeName == "second"){
-        this.option2.requestUrl = "/api/v1/ams/getSaleOrderReportedes?apiId=408&con="+this.input;      
-      }else if(this.activeName == "four"){
-        this.option4.requestUrl = "/api/v1/ams/getSaleOrderListBySaleCompanyes?apiId=409&shipperId=1&con="+this.input;      
+      if (this.activeName == "first") {
+        this.option.requestUrl =
+          "/api/v1/ams/getSaleOrderInfoes?apiId=408&con=" + this.input;
+      } else if (this.activeName == "second") {
+        this.option2.requestUrl =
+          "/api/v1/ams/getSaleOrderReportedes?apiId=408&con=" + this.input;
+      } else if (this.activeName == "four") {
+        this.option4.requestUrl =
+          "/api/v1/ams/getSaleOrderListBySaleCompanyes?apiId=409&shipperId=1&con=" +
+          this.input;
       }
     },
     //模糊查询承运商
-    onclickCarrier(){
+    onclickCarrier() {
       this.carrier.requestUrl =
-      "/api/v1/uc/getCarrierListByLike?apiId=412&index=" + this.index + "&i=" + new Date();
+        "/api/v1/uc/getCarrierListByLike?apiId=412&index=" +
+        this.index +
+        "&i=" +
+        new Date();
     },
     selectionChange(selection) {
+      this.mapList = [];
       this.mapList = selection;
     },
     currentRadioChange(row) {
-			this.carrierId = row.carrierId,
-      this.carrierName= row.carrierName
-		},
-    empower(){
-      if(this.mapList.length==0){
+      (this.carrierId = row.carrierId), (this.carrierName = row.carrierName);
+    },
+    empower() {
+      if (this.mapList.length == 0) {
         this.$message.warning("请先选择至少一个销售订单");
-      }else{
-        this.carrier.requestUrl = "/api/v1/uc/getCarrierListByLike?apiId=412&i="+new Date();
+      } else {
+        this.carrier.requestUrl =
+          "/api/v1/uc/getCarrierListByLike?apiId=412&i=" + new Date();
         this.drawer = true;
-      }  
+      }
     },
-    selectMakeSure(){
+    selectMakeSure() {
       this.index = null;
       this.drawer = false;
-      this.$confirm("是否确认授权选中的销售订单给承运商:("+this.carrierName+")", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-        center: true,
-      })
+      this.$confirm(
+        "是否确认授权选中的销售订单给承运商:(" + this.carrierName + ")",
+        "提示",
+        {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+          center: true
+        }
+      )
         .then(() => {
-          this.mapList.forEach((item) => {
-          //初始化mapItem
-          var mapItem={
-                  //销售订单id
-                  saleOrderId : 0,
-              };
-          mapItem.saleOrderId=item.saleOrderId;
-          this.mapItemList.push(mapItem);
+          this.mapList.forEach(item => {
+            //初始化mapItem
+            var mapItem = {
+              //销售订单id
+              saleOrderId: 0
+            };
+            mapItem.saleOrderId = item.saleOrderId;
+            this.mapItemList = [];
+            this.mapItemList.push(mapItem);
           });
-           //初始化传递的参数
+          //初始化传递的参数
           let mapValue = {
-            saleOrderIds : this.mapItemList,
-            carrierId : this.carrierId
-          }
+            saleOrderIds: this.mapItemList,
+            carrierId: this.carrierId
+          };
           this.axios
-            .post(
-              "/api/v1/ams/saleOrderEmpowerCarrier",mapValue
-            ).then((res) => {
-              if(res.data.code=='0'){
-                this.$message({ type: "success",message: "授权成功!",});
-                this.option4.requestUrl = "/api/v1/ams/getSaleOrderListBySaleCompanyes?apiId=409&shipperId=1&i="+new Date();
+            .post("/api/v1/ams/saleOrderEmpowerCarrier", mapValue)
+            .then(res => {
+              if (res.data.code == "0") {
+                this.$message({ type: "success", message: "授权成功!" });
+                this.option4.requestUrl =
+                  "/api/v1/ams/getSaleOrderListBySaleCompanyes?apiId=409&shipperId=1&i=" +
+                  new Date();
               }
             });
         })
         .catch(() => {
           this.$message({
             type: "info",
-            message: "取消授权!",
+            message: "取消授权!"
           });
         });
-      
     },
     seeclick(saleOrderId) {
       this.$router.push("/saleOrderDetail/" + saleOrderId);
@@ -250,7 +276,7 @@ export default {
     click(saleOrderId) {
       this.$router.push("/editSaleOrder/" + saleOrderId);
     },
-    coproductSendClick(saleOrderId){
+    coproductSendClick(saleOrderId) {
       this.$router.push("/addSaleOrderCoproductSend/" + saleOrderId);
     },
     // -------查看物资详情 (已审批)
@@ -278,8 +304,8 @@ export default {
       this.oldRow = row;
       // 根据销售订单id查询物资信息
       this.axios
-        .post("/api/v1/ams/getSaleMaterialList?saleOrderId=" +row.saleOrderId)
-        .then((res) => {
+        .post("/api/v1/ams/getSaleMaterialList?saleOrderId=" + row.saleOrderId)
+        .then(res => {
           this.tableData = res.data.data;
         });
     },
@@ -309,8 +335,8 @@ export default {
       this.oldRow1 = row;
       // 根据销售订单id查询物资信息
       this.axios
-        .post("/api/v1/ams/getSaleMaterialList?saleOrderId=" +row.saleOrderId)
-        .then((res) => {
+        .post("/api/v1/ams/getSaleMaterialList?saleOrderId=" + row.saleOrderId)
+        .then(res => {
           this.tableData1 = res.data.data;
         });
     },
@@ -340,8 +366,8 @@ export default {
       this.oldRow2 = row;
       // 根据销售订单id查询物资信息
       this.axios
-        .post("/api/v1/ams/getSaleMaterialList?saleOrderId=" +row.saleOrderId)
-        .then((res) => {
+        .post("/api/v1/ams/getSaleMaterialList?saleOrderId=" + row.saleOrderId)
+        .then(res => {
           this.tableData2 = res.data.data;
         });
     },
@@ -371,8 +397,8 @@ export default {
       this.oldRow3 = row;
       // 根据销售订单id查询物资信息
       this.axios
-        .post("/api/v1/ams/getSaleMaterialList?saleOrderId=" +row.saleOrderId)
-        .then((res) => {
+        .post("/api/v1/ams/getSaleMaterialList?saleOrderId=" + row.saleOrderId)
+        .then(res => {
           this.tableData3 = res.data.data;
         });
     },
@@ -383,18 +409,15 @@ export default {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning",
-        center: true,
+        center: true
       })
         .then(() => {
           this.$message({
             type: "success",
-            message: "上传成功!",
+            message: "上传成功!"
           });
           this.axios
-            .post(
-              "/api/v1/ams/uploadSaleOrder?saleOrderId=" +
-                saleOrderId
-            )
+            .post("/api/v1/ams/uploadSaleOrder?saleOrderId=" + saleOrderId)
             .then(() => {
               this.$router.go(0);
             });
@@ -402,7 +425,7 @@ export default {
         .catch(() => {
           this.$message({
             type: "info",
-            message: "取消上传!",
+            message: "取消上传!"
           });
         });
     },
@@ -413,12 +436,12 @@ export default {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning",
-        center: true,
+        center: true
       })
         .then(() => {
           this.$message({
             type: "success",
-            message: "删除成功!",
+            message: "删除成功!"
           });
           this.axios
             .post(
@@ -432,14 +455,14 @@ export default {
         .catch(() => {
           this.$message({
             type: "info",
-            message: "取消删除!",
+            message: "取消删除!"
           });
         });
-    },
-  },
+    }
+  }
 };
 </script>
-<style lang='scss' scoped>
+<style lang="scss" scoped>
 .salePlan {
   .top {
     padding: 1.25rem 0.375rem;
@@ -449,4 +472,4 @@ export default {
     }
   }
 }
-</style>
+</style>

+ 7 - 8
src/views/inward/components/truckOrder/addPurInwardOrder.vue

@@ -201,7 +201,7 @@ export default {
         },
         {
           value: 15,
-          label: "采购内转(老区专线-老区)"
+          label: "拼装车皮进厂(老区专线-老区)"
         },
         {
           value: 16,
@@ -273,13 +273,12 @@ export default {
         this.$message.error("未勾选计划");
         this.disabled = false;
         return;
-      } else if (
-        this.lineId == null &&
-        (this.orderType != 15 || this.orderType != 16)
-      ) {
-        this.$message.error("未选择路线");
-        this.disabled = false;
-        return;
+      } else if (this.lineId == null) {
+        if (this.orderType == 10 || this.orderType == 20) {
+          this.$message.error("未选择路线");
+          this.disabled = false;
+          return;
+        }
       } else if (this.selectionList.length == 0) {
         this.$message.error("未选择车辆");
         this.disabled = false;

+ 6 - 3
src/views/queue/components/qmsEnFacotory/queueFApply.vue

@@ -18,7 +18,6 @@
       <el-table
         :data="tableData"
         :span-method="objectSpanMethod"
-        :stripe="true"
         fit
         border
         style="width: 100%; margin-top: 20px"
@@ -30,7 +29,11 @@
           label="序号"
           fixed
         ></el-table-column>
-        <el-table-column prop="orderNumber" label="运输订单号">
+        <el-table-column
+          prop="orderNumber"
+          label="运输订单号"
+          show-overflow-tooltip="true"
+        >
         </el-table-column>
         <el-table-column prop="capacityNumber" label="车牌号">
         </el-table-column>
@@ -86,7 +89,7 @@ export default {
           this.pos = 0;
         } else {
           // 判断当前元素与上一个元素是否相同
-          if (data[i].cxh === data[i - 1].cxh) {
+          if (data[i].orderNumber === data[i - 1].orderNumber) {
             this.spanArr[this.pos] += 1;
             this.spanArr.push(0);
           } else {

+ 2 - 3
src/views/queue/components/qmsEnFacotory/queueFCancel.vue

@@ -21,8 +21,7 @@
       <el-table
         :data="tableData"
         :span-method="objectSpanMethod"
-        :stripe="true"
-        fit
+        :fit="true"
         border
         style="width: 100%; margin-top: 20px"
         max-height="250px"
@@ -92,7 +91,7 @@ export default {
           this.pos = 0;
         } else {
           // 判断当前元素与上一个元素是否相同
-          if (data[i].cxh === data[i - 1].cxh) {
+          if (data[i].orderNumber === data[i - 1].orderNumber) {
             this.spanArr[this.pos] += 1;
             this.spanArr.push(0);
           } else {

+ 2 - 3
src/views/queue/components/qmsEnFacotory/queueFEnd.vue

@@ -18,8 +18,7 @@
       <el-table
         :data="tableData"
         :span-method="objectSpanMethod"
-        :stripe="true"
-        fit
+        :fit="true"
         border
         style="width: 100%; margin-top: 20px"
         max-height="250px"
@@ -81,7 +80,7 @@ export default {
           this.pos = 0;
         } else {
           // 判断当前元素与上一个元素是否相同
-          if (data[i].cxh === data[i - 1].cxh) {
+          if (data[i].orderNumber === data[i - 1].orderNumber) {
             this.spanArr[this.pos] += 1;
             this.spanArr.push(0);
           } else {

+ 66 - 38
src/views/queue/components/qmsEnFacotory/queueFStart.vue

@@ -68,16 +68,6 @@
             ><template slot="prepend">Φ</template></el-input
           >
         </el-form-item>
-        <el-form-item>
-          <label class="el-form-item__label" style="width: auto;">型号</label>
-        </el-form-item>
-        <el-form-item>
-          <el-input
-            placeholder="请输入内容"
-            v-model="materialModelText"
-            clearable
-          ></el-input>
-        </el-form-item>
         <el-button
           type="primary"
           class="btn"
@@ -91,17 +81,49 @@
       </el-form>
       <div class="tablecls">
         <!-- 查询所有的物资 -->
-        <dilTable v-bind.sync="optionMa" @selection-change="selectionChange2">
+        <dilTable
+          v-bind.sync="optionMa"
+          @selection-change="selectionChange2"
+          @rowDbClick="rowDbClick"
+        >
         </dilTable>
       </div>
     </el-drawer>
     <div class="tabs">
       <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
         <el-tab-pane label="单拼车辆排队链表" name="first">
-          <dilTable v-bind.sync="option1" @selection-change="selectionChange">
-            <el-table-column fixed="right" label="操作" width="280">
+          <el-table
+            :data="tableData1"
+            border
+            style="width: 100%; margin-top: 20px"
+            @selection-change="handleSelectionChange"
+            max-height="500px"
+          >
+            <el-table-column type="selection" width="55"></el-table-column>
+            <el-table-column type="index" width="50"> </el-table-column>
+            <el-table-column prop="capacityNumber" label="车牌号" fit>
+            </el-table-column>
+            <el-table-column prop="resultStartTime" label="排队开始时间">
+            </el-table-column>
+            <el-table-column
+              prop="listNodeOrder"
+              label="序号"
+            ></el-table-column>
+            <el-table-column prop="materialName" label="物资名称">
+            </el-table-column>
+            <el-table-column prop="materialSpecification" label="物资规格">
+            </el-table-column>
+            <el-table-column prop="materialModel" label="物资型号">
+            </el-table-column>
+            <el-table-column prop="materialNumber" label="物资件数">
+            </el-table-column>
+            <el-table-column prop="driverTel" label="司机电话号码">
+            </el-table-column>
+            <el-table-column prop="sureTime" label="可进厂确认时间">
+            </el-table-column>
+            <el-table-column label="装货点" width="100">
               <template slot-scope="scope">
-                <el-select size="mini" fixed="right" v-model="scope.row.id">
+                <el-select size="mini" v-model="scope.row.id">
                   <el-option
                     v-for="item in option"
                     :key="item.id"
@@ -110,12 +132,16 @@
                   >
                   </el-option>
                 </el-select>
+              </template>
+            </el-table-column>
+            <el-table-column fixed="right" label="操作" width="100">
+              <template slot-scope="scope">
                 <el-button type="text" size="mini" @click="updateBill(scope)">
                   修改提货单
                 </el-button>
               </template>
             </el-table-column>
-          </dilTable>
+          </el-table>
         </el-tab-pane>
         <el-tab-pane label="多拼车辆排队链表" name="second">
           <el-table
@@ -183,7 +209,7 @@ export default {
       inputText: "",
       option1: {
         // 表格请求数据的地址
-        requestUrl: "/api/v1/qms/getQueueListByQueueUp?apiId=473&isSpelling=0",
+        requestUrl: "",
         selectionType: "select"
       },
       optionMa: {
@@ -194,6 +220,7 @@ export default {
       },
       activeName: "first",
       tableData: [],
+      tableData1: [],
       //存放每一行记录的合并数
       spanArr: [],
       maplist: [],
@@ -212,23 +239,26 @@ export default {
     };
   },
   watch: {
-    activeName() {
-      console.log(this.activeName);
-    }
+    activeName() {}
   },
   mounted() {
     this.infomation();
+    this.getSpellingArray();
+    this.getNoSpellingArray();
   },
   methods: {
+    rowDbClick(row) {
+      this.materialList = [];
+      this.materialList.push(row);
+      this.makeSureMaterial();
+    },
     //物资模态框查询
     onclickMaterial1() {
       this.optionMa.requestUrl =
         "/api/v1/uc/getSteelMaterial?apiId=244&materialNameText=" +
         this.materialNameText +
         "&materialSpecificationText=" +
-        this.materialSpecificationText +
-        "&materialModelText=" +
-        this.materialModelText;
+        this.materialSpecificationText;
     },
     onclickMaterial() {
       this.table1 = true;
@@ -256,9 +286,11 @@ export default {
       this.materialList = [];
       this.materialList1 = [];
       if (this.activeName == "first") {
-        (this.option1.requestUrl =
-          "/api/v1/qms/getQueueListByQueueUp?apiId=473&isSpelling=0"),
-          map;
+        this.axios
+          .post("/api/v1/qms/getQueueListByQueueUp?isSpelling=0", map)
+          .then(res => {
+            this.tableData1 = res.data.data;
+          });
       } else {
         this.axios
           .post("/api/v1/qms/getQueueListByQueueUp?apiId=473&isSpelling=1", map)
@@ -285,7 +317,7 @@ export default {
           this.pos = 0;
         } else {
           // 判断当前元素与上一个元素是否相同
-          if (data[i].capacityNumber === data[i - 1].capacityNumber) {
+          if (data[i].resultTotalId === data[i - 1].resultTotalId) {
             this.spanArr[this.pos] += 1;
             this.spanArr.push(0);
           } else {
@@ -316,13 +348,18 @@ export default {
     },
     handleClick() {
       if (this.activeName == "first") {
-        this.option1.requestUrl =
-          "/api/v1/qms/getQueueListByQueueUp?apiId=473&isSpelling=0&i=" +
-          new Date();
+        this.getNoSpellingArray();
       } else {
         this.getSpellingArray();
       }
     },
+    getNoSpellingArray() {
+      this.axios
+        .post("/api/v1/qms/getQueueListByQueueUp?isSpelling=0&i=" + new Date())
+        .then(res => {
+          this.tableData1 = res.data.data;
+        });
+    },
     getSpellingArray() {
       this.axios
         .post(
@@ -335,9 +372,6 @@ export default {
           this.getSpanArr(this.tableData);
         });
     },
-    allowEnfactory(scope) {
-      console.log(scope);
-    },
     onclick() {
       if (this.activeName == "first") {
         this.option1.requestUrl =
@@ -363,11 +397,6 @@ export default {
       this.maplist = [];
       this.maplist = selection;
     },
-    selectionChange(selection) {
-      this.maplist = [];
-      console.log(selection);
-      this.maplist = selection;
-    },
     updateBill(scope) {
       console.log(scope.row.capacityId);
       this.$router.push(
@@ -392,7 +421,6 @@ export default {
         }
         this.filterArr(this.maplist[i].resultId);
       }
-      debugger;
       var filterArr2 = [];
       this.filterArr1.forEach(e => {
         if (filterArr2.indexOf(e) === -1) {

+ 0 - 1
src/views/sale/app.js

@@ -23,7 +23,6 @@ import 'vxe-table/lib/style.css'
 Vue.use(VXETable)
 Vue.prototype.$XModal = VXETable.modal
 
-
 import AMap from 'vue-amap';
 window._AMapSecurityConfig = {
   securityJsCode:'6a75ec7300ae4ba9f385d1bb452ffd21',

+ 779 - 666
src/views/sale/components/offSiteTransportation/checkGPS.vue

@@ -1,725 +1,838 @@
 <template>
-    <div class="container">
-        <div id="amap-container"></div>
-         <div class="controller">
-             <div class="in_transit_information">
-                <span class="item_details">车牌号:</span> <el-input style="width: 100px;" class="inputStyle" v-model="carNumber"> </el-input>
-             </div>
-             <div class="in_transit_information2">
-                <span class="item_details">时间段:</span>
-                <el-date-picker
-                class="date_picker_style"
-                v-model="time"
-                @change="changeTime"
-                type="datetimerange"
-                format="yyyy-MM-dd HH:mm:ss"
-                range-separator="至"
-                start-placeholder="开始日期"
-                end-placeholder="结束日期">
-                </el-date-picker>
-                <el-button type="primary" class="searchstyle" @click="initData">查询</el-button>
-             </div>
-             <div class="driving_information">  
-                <span class="item_details2">时间:{{runRoute.gtm}}</span>
-                <br/>
-                <span class="item_details2" >车速:{{runRoute.spd}}千米/小时</span>
-                <br/>
-             </div>
-              <div class="map-control">
-                <!--播放暂停按钮-->
-                进度:
-                <Icon v-if="!isPlay" class="play-icon play"  type="ios-play" @click="isPlay=true;play();"/>
-                <Icon v-else class="play-icon pause" type="ios-pause" @click="isPlay=false;stop();navgControl('pause')"/>
-                <Icon class="play-icon quickly"  type="ios-play" @click="addProgress()"/>
-                <div class="mySlider"><Slider class="map-slider" v-model="sliderVal" :tip-format="hideFormat" :step="0.0001"></Slider></div>
-                <!--速度-->
-                <div class="mySlider2"><el-slider v-model="speedVal" show-input></el-slider></div>
-            </div>
-            <div class="in_transit_information3" v-if="listPath.length>0">
-                <span class="item_details">停车时长:</span>
-                <el-select style="width:100px" @change="changeParkingTime" v-model="parkingTime" placeholder="停车">
-                <el-option
-                v-for="item in parkingOptions"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value">
-                </el-option>
-                </el-select>
-            </div>
-            <div class="in_transit_information3" v-if="listPath.length>0">
-                <span class="item_details">离线时长:</span>
-                <el-select style="width:100px" @change="changeLeaveTime" v-model="leaveTime" placeholder="离线">
-                <el-option
-                v-for="item in parkingOptions"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value">
-                </el-option>
-                </el-select>
-            </div>
-         </div>
+  <div class="container">
+    <div id="amap-container"></div>
+    <div class="controller">
+      <div class="in_transit_information">
+        <span class="item_details">车牌号:</span>
+        <el-input
+          style="width: 100px;"
+          class="inputStyle"
+          v-model="carNumber"
+          clearable
+        >
+        </el-input>
+      </div>
+      <div class="in_transit_information2">
+        <span class="item_details">时间段:</span>
+        <el-date-picker
+          class="date_picker_style"
+          v-model="time"
+          @change="changeTime"
+          type="datetimerange"
+          format="yyyy-MM-dd HH:mm:ss"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+        >
+        </el-date-picker>
+        <el-button type="primary" class="searchstyle" @click="initData"
+          >查询</el-button
+        >
+      </div>
+      <div class="driving_information">
+        <span class="item_details2">时间:{{ runRoute.gtm }}</span>
+        <br />
+        <span class="item_details2">车速:{{ runRoute.spd }}千米/小时</span>
+        <br />
+      </div>
+      <div class="map-control">
+        <!--播放暂停按钮-->
+        进度:
+        <Icon
+          v-if="!isPlay"
+          class="play-icon play"
+          type="ios-play"
+          @click="
+            isPlay = true;
+            play();
+          "
+        />
+        <Icon
+          v-else
+          class="play-icon pause"
+          type="ios-pause"
+          @click="
+            isPlay = false;
+            stop();
+            navgControl('pause');
+          "
+        />
+        <Icon
+          class="play-icon quickly"
+          type="ios-play"
+          @click="addProgress()"
+        />
+        <div class="mySlider">
+          <Slider
+            class="map-slider"
+            v-model="sliderVal"
+            :tip-format="hideFormat"
+            :step="0.0001"
+          ></Slider>
+        </div>
+        <!--速度-->
+        <div class="mySlider2">
+          <el-slider v-model="speedVal" show-input></el-slider>
+        </div>
+      </div>
+      <div class="in_transit_information3" v-if="listPath.length > 0">
+        <span class="item_details">停车时长:</span>
+        <el-select
+          style="width:100px"
+          @change="changeParkingTime"
+          v-model="parkingTime"
+          placeholder="停车"
+        >
+          <el-option
+            v-for="item in parkingOptions"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          >
+          </el-option>
+        </el-select>
+      </div>
+      <div class="in_transit_information3" v-if="listPath.length > 0">
+        <span class="item_details">离线时长:</span>
+        <el-select
+          style="width:100px"
+          @change="changeLeaveTime"
+          v-model="leaveTime"
+          placeholder="离线"
+        >
+          <el-option
+            v-for="item in parkingOptions"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          >
+          </el-option>
+        </el-select>
+      </div>
     </div>
+  </div>
 </template>
 <script>
-import { shallowRef } from '@vue/reactivity'
-import { lazyAMapApiLoaderInstance } from 'vue-amap';
-import { sjTime,stringToDate } from "@/utils/sharedJsFile";
-import Slider from './slider.vue'
-Vue.use(Slider)
-import Vue from 'vue';
+import { shallowRef } from "@vue/reactivity";
+import { lazyAMapApiLoaderInstance } from "vue-amap";
+import { sjTime, stringToDate } from "@/utils/sharedJsFile";
+import Slider from "./slider.vue";
+Vue.use(Slider);
+import Vue from "vue";
 export default {
-    name: "PathView",
-    setup(){
-        const map = shallowRef(null);
-        return{
-            map,
+  name: "PathView",
+  setup() {
+    const map = shallowRef(null);
+    return {
+      map
+    };
+  },
+  watch: {
+    speedVal: {
+      deep: true,
+      handler(val, oldVal) {
+        let that = this;
+        if (that.pathNavigator != null) {
+          that.pathNavigator.setSpeed(100 * val);
         }
-    },
-     watch:{
-        speedVal:{
-            deep: true,
-            handler(val, oldVal) {
-                let that=this;
-                 if(that.pathNavigator!=null){
-                    that.pathNavigator.setSpeed(100*val)
-                }
-            }
-        }
-    },
-    data() {
-        return {
-        //一、 查询相关
-            //选择时间区间
-            time:[],
-            //查询车牌号
-            carNumber:"",
-            //选择停车时长
-            parkingTime:null,
-            //停车时长选择区间
-            parkingOptions: [{
-                value: 600000,
-                label: '10分钟'
-                }, {
-                value: 1200000,
-                label: '20分钟'
-                }, {
-                value: 1800000,
-                label: '30分钟'
-                }, {
-                value: 2400000,
-                label: '40分钟'
-                }, {
-                value: 3000000,
-                label: '50分钟'
-                }
-                , {
-                value: 3600000,
-                label: '60分钟'
-                }
-            ],
-            //选择离线时长
-            leaveTime:null,
-            //离线时长选择区间
-            leaveOptions: [{
-                value: 600000,
-                label: '10分钟'
-                }, {
-                value: 1200000,
-                label: '20分钟'
-                }, {
-                value: 1800000,
-                label: '30分钟'
-                }, {
-                value: 2400000,
-                label: '40分钟'
-                }, {
-                value: 3000000,
-                label: '50分钟'
-                }
-                , {
-                value: 3600000,
-                label: '60分钟'
-                }
-            ],
-        //二、 展示相关
-            //离线图标
-            leaveMark:[],
-            //停车图标
-            parkMark:[],
-            //开始地址
-            startPointName:"",
-            //结束地址
-            endPointName:"",
-            //小车行驶当前点所在的位置
-            runRoute:
-            {
-                //正北方向夹角  
-                agl: "0",
-                //当前的时间
-                gtm: "0",
-                //海拔
-                hgt: "0",
-                //进度
-                lat: "0", 
-                //纬度
-                lon: "0",
-                //累计行驶距离(是车辆GPS安装开始到现在的距离,如果你想要查询范围内的行驶距离,用开始的累计距离和结束点累计距离相减)
-                mil: "0",
-                //这个时间的速度
-                spd: "0"
-            },
-            //小车行驶当前点下标
-            point:"",
-        //三、 播放相关
-            //是否暂停
-            isPlay:true,
-            //播放进度值
-            sliderVal:0,
-            //播放速度值
-            speedVal:10,
-        //四、组件相关
-            //自定义窗体信息
-            // ctmarkes:{
-            //     lat:"33.015888071433764",
-            //     lon : "115.96995235868168",
-            //     title:"豫SE8888",
-            //     details:"安徽省阜阳市颍东区阜阳舜岳水泥公司,西北方向,155.1米"
-            // },
-        //五、返回值相关
-            //返回值集合
-            listPath:[],
-        //六、地图组件相关值
-            //创建轨迹
-            pathSimplifierIns:{},
-            //巡回器
-            pathNavigator:{},
-            //初始化巡回器速度
-            speed:1000,   
-            //地图解析
-            geocoder:null,
-        };
-    },
-    created(){
-      
-    },
-    mounted() {
-        
-    },
-    methods: {
-    
-        //停车时间改变
-        changeParkingTime(){
-            let that=this;
-            //清除之前的停车点
-            that.hideParkingMark();
-            //计算时间的点
-            let calculationPoint=null;
-            that.listPath[0].runRoute.forEach(function(item,indexOf){      
-                if(indexOf+1<that.listPath[0].runRoute.length){
-                    //判断calculationPoint是否为空,如果是空的说明当前没有在计算停车时间
-                    if(calculationPoint==null&&item.spd=='0.0'){
-                        calculationPoint=item
-                    } else if(calculationPoint!=null&&item.spd!='0.0'){
-                        let beforeTime=that.stringToDate(calculationPoint.gtm)
-                        let item2=that.listPath[0].runRoute[indexOf];
-                        let afterTime=that.stringToDate(item2.gtm);
-                        let second=afterTime-beforeTime;
-                        if(second>that.parkingTime){
-                             let message='停车:'+second/60000;
-                             that.initParkingMarkes(20,35,require('@/assets/img/start.png'),calculationPoint.lon,calculationPoint.lat,message.split('.')[0]+"分钟");
-                        }
-                        calculationPoint=null;
-                    }
-                }
-            });
-        },
-        //停车所有离线图标
-        hideParkingMark(){
-            let that=this;
-            that.parkMark.forEach(function(item,indexOf){    
-                item.hide();
-            });
-        },
-        //离线时间改变时获得超过时间的点信息
-        changeLeaveTime(){
-            let that=this;
-            //关闭所有图标
-            that.hideLeaveMark();
-            that.listPath[0].runRoute.forEach(function(item,indexOf){      
-                if(indexOf+1<that.listPath[0].runRoute.length){
-                    let beforeTime=that.stringToDate(item.gtm)
-                    let item2=that.listPath[0].runRoute[indexOf+1];
-                    let afterTime=that.stringToDate(item2.gtm);
-                    let second=afterTime-beforeTime;
-                    if(second>that.leaveTime){
-                        let message='离线:'+second/60000;
-                        that.initLeaveMarkes(20,35,require('@/assets/img/start.png'),item2.lon,item2.lat,message.split('.')[0]+"分钟");
-                    }
-                }
-            });
+      }
+    }
+  },
+  data() {
+    return {
+      //一、 查询相关
+      //选择时间区间
+      time: [],
+      //查询车牌号
+      carNumber: "",
+      //选择停车时长
+      parkingTime: null,
+      //停车时长选择区间
+      parkingOptions: [
+        {
+          value: 600000,
+          label: "10分钟"
         },
-        //关闭所有离线图标
-        hideLeaveMark(){
-            let that=this;
-            that.leaveMark.forEach(function(item,indexOf){    
-                item.hide();
-            });
+        {
+          value: 1200000,
+          label: "20分钟"
         },
-        //字符串转为Date
-        stringToDate(dateString){
-            let dateStr=dateString.replace('年','-').replace('月','-').replace('日','');   
-            return Date.parse(dateStr);
+        {
+          value: 1800000,
+          label: "30分钟"
         },
-        //校验查询时间
-        changeTime(){
-            let that=this;
-            console.log((that.time[1]-that.time[0])-(86400000*3))
-            if((that.time[1]-that.time[0])>86400000*3){
-                 this.$message.error('时间查询范围不能超过3天');
-                 that.time=[];
-            }
+        {
+          value: 2400000,
+          label: "40分钟"
         },
-        //启动
-        play(){
-            let that =this;
-            that.pathNavigator.resume();
+        {
+          value: 3000000,
+          label: "50分钟"
         },
-        //停止
-        stop(){
-            let that =this;
-            that.pathNavigator.pause();
+        {
+          value: 3600000,
+          label: "60分钟"
+        }
+      ],
+      //选择离线时长
+      leaveTime: null,
+      //离线时长选择区间
+      leaveOptions: [
+        {
+          value: 600000,
+          label: "10分钟"
         },
-        //添加进度
-        addProgress(){
-            let that =this;
-            let increment=(that.listPath[0].runPath.length*0.1)
-            that.pathNavigator.start(((that.point+increment)%that.listPath[0].runPath.length))
+        {
+          value: 1200000,
+          label: "20分钟"
         },
-        //进度监听
-        hideFormat(value){
-            let that=this;
-            that.sliderVal=value;
+        {
+          value: 1800000,
+          label: "30分钟"
         },
-        //获得开始地址
-        getStartPointName(lnglatXY){
-            let that=this;
-            console.log("start",that.geocoder)
-            that.geocoder.getAddress(lnglatXY, function(status, result) {
-                if (status === 'complete' && result.info === 'OK') {
-                    that.startPointName = result.regeocode.formattedAddress;
-                }
-            });  
+        {
+          value: 2400000,
+          label: "40分钟"
         },
-         //获得结束地址
-        getEndPointName(lnglatXY){
-            let that=this;
-            that.geocoder.getAddress(lnglatXY, function(status, result) {
-                if (status === 'complete' && result.info === 'OK') {
-                    that.endPointName = result.regeocode.formattedAddress;
-                    that.initCustomMarkes(that.carNumber+"("+that.listPath[0].miled+")","起点:"+that.startPointName+"<br/>"+"终点:"+that.endPointName,lnglatXY[0],lnglatXY[1])
-                }
-            });  
+        {
+          value: 3000000,
+          label: "50分钟"
         },
-        //初始化数据
-        initData(){
-            let that=this;
-            that.listPath=[];
-            if(that.carNumber==""){
-                this.$message.error('车牌号不能为空!');
-                return;
-            }
-            if(that.time==[]){
-                 this.$message.error('请选择时间');
+        {
+          value: 3600000,
+          label: "60分钟"
+        }
+      ],
+      //二、 展示相关
+      //离线图标
+      leaveMark: [],
+      //停车图标
+      parkMark: [],
+      //开始地址
+      startPointName: "",
+      //结束地址
+      endPointName: "",
+      //小车行驶当前点所在的位置
+      runRoute: {
+        //正北方向夹角
+        agl: "0",
+        //当前的时间
+        gtm: "0",
+        //海拔
+        hgt: "0",
+        //进度
+        lat: "0",
+        //纬度
+        lon: "0",
+        //累计行驶距离(是车辆GPS安装开始到现在的距离,如果你想要查询范围内的行驶距离,用开始的累计距离和结束点累计距离相减)
+        mil: "0",
+        //这个时间的速度
+        spd: "0"
+      },
+      //小车行驶当前点下标
+      point: "",
+      //三、 播放相关
+      //是否暂停
+      isPlay: true,
+      //播放进度值
+      sliderVal: 0,
+      //播放速度值
+      speedVal: 10,
+      //四、组件相关
+      //自定义窗体信息
+      // ctmarkes:{
+      //     lat:"33.015888071433764",
+      //     lon : "115.96995235868168",
+      //     title:"豫SE8888",
+      //     details:"安徽省阜阳市颍东区阜阳舜岳水泥公司,西北方向,155.1米"
+      // },
+      //五、返回值相关
+      //返回值集合
+      listPath: [],
+      //六、地图组件相关值
+      //创建轨迹
+      pathSimplifierIns: {},
+      //巡回器
+      pathNavigator: {},
+      //初始化巡回器速度
+      speed: 1000,
+      //地图解析
+      geocoder: null
+    };
+  },
+  created() {},
+  mounted() {},
+  methods: {
+    //停车时间改变
+    changeParkingTime() {
+      let that = this;
+      //清除之前的停车点
+      that.hideParkingMark();
+      //计算时间的点
+      let calculationPoint = null;
+      that.listPath[0].runRoute.forEach(function(item, indexOf) {
+        if (indexOf + 1 < that.listPath[0].runRoute.length) {
+          //判断calculationPoint是否为空,如果是空的说明当前没有在计算停车时间
+          if (calculationPoint == null && item.spd == "0.0") {
+            calculationPoint = item;
+          } else if (calculationPoint != null && item.spd != "0.0") {
+            let beforeTime = that.stringToDate(calculationPoint.gtm);
+            let item2 = that.listPath[0].runRoute[indexOf];
+            let afterTime = that.stringToDate(item2.gtm);
+            let second = afterTime - beforeTime;
+            if (second > that.parkingTime) {
+              let message = "停车:" + second / 60000;
+              that.initParkingMarkes(
+                20,
+                35,
+                require("@/assets/img/start.png"),
+                calculationPoint.lon,
+                calculationPoint.lat,
+                message.split(".")[0] + "分钟"
+              );
             }
-            that.axios.post("/api/v1/otms/fullPathVisualizationByCarNumber",{
-                "capacityNumber":that.carNumber,
-                "startTime":that.formatDate(that.time[0],"yyyy-MM-dd hh:mm:ss"),
-                "endTime":that.formatDate(that.time[1],"yyyy-MM-dd hh:mm:ss"),
-            }).then((res) => {
-                 if(res.data.startAndEndRoutes!=''){
-                     that.listPath=res.data.startAndEndRoutes;
-                    that.initMap();
-                 }else{
-                     this.$message.error('车辆没有开启GPS');
-                 }
-            });
-        },
-        //初始化地图
-        initMap(){
-            lazyAMapApiLoaderInstance.load().then(() => {
-                let that=this;
-                that.map = new AMap.Map("amap-container",{  //设置地图容器id
-                    viewMode:"2D",    //是否为2D地图模式
-                    zoom:10,           //初始化地图级别
-                    center:[105.602725,37.076636], //初始化地图中心点位置
-                });
-                //初始化
-                that.initGeocoder();
-                //初始化巡航轨迹和巡航器
-                that.initPathSimplifier();
-                //初始化起点、当前点、当前点
-                that.initThreeMarker();
-                //初始化当前点标记
-                //that.initCustomMarkes(that.carNumber+"("+that.listPath[0].miled+")",that.listPath[0].currentPointName,that.listPath[0].currentPoint.lon,that.listPath[0].currentPoint.lat)
-                //that.initEndline();
-                
-            });
-        },
-        //结束点
-        initEndline(){
-            let that=this;
-            that.initPolyline(that.listPath[0].estimatePath,"#FF0000");
-        },
-        //创建起点终点当前点
-        initThreeMarker(){
-            let that=this;
-            that.listPath.forEach((element,index) => {
-                 //起点名称
-                that.getStartPointName([element.startPoint.lon,element.startPoint.lat])
-               
-                
-                //开始标记点
-                if(element.startPoint.lon!=''&&element.startPoint.lat!=''){
-                   
-                    that.initMarkes(20,35,require('@/assets/img/start.png'),element.startPoint.lon,element.startPoint.lat,'起点');
-                }
-                //结束标记点
-                if(element.endPoint!={}&&element.endPoint!=''&&element.endPoint!=null){
-                    // that.initMarkes(20,35,require('@/assets/img/end.png'),element.endPoint.lon,element.endPoint.lat,'终点');
-                     //终点名称
-                    that.getEndPointName([element.endPoint.lon,element.endPoint.lat]);
-                }else{
-                    // that.initMarkes(20,35,require('@/assets/img/end.png'),element.runRoute[element.runRoute.length-1].lon,element.runRoute[element.runRoute.length-1].lat,'终点');
-                     //终点名称
-                    that.getEndPointName([element.runRoute[element.runRoute.length-1].lon,element.runRoute[element.runRoute.length-1].lat])
-                }
-               
-            });
-           
-        },
-        //初始化窗体
-        initCustomMarkes(title,details,lon,lat){
-             let that=this;
-            //自定义窗体内容
-            var content = [
-                "<div  style='top:1px;width: 180px; background-color: rgba(0, 0, 0, 1);' ><font color='white'>"+title+"</font>",
-                "<div style='background-color:rgba(255, 255, 255, 0.5);'><font color='white'>"+details+"</font></div></div>",
-            ];
-            // 创建 infoWindow 实例	
-            var infoWindow = new AMap.InfoWindow({
-                content: content.join("<br>")  //传入 dom 对象,或者 html 字符串
-            });
-            // 打开信息窗体
-            infoWindow.open(that.map,[lon,lat]);
-        },
-        //初始化预计轨迹
-        initPolyline(path,color){
-            let that=this;
-             //预计轨迹
-            var endLine = new AMap.Polyline({
-                map:that.map,//地图组件
-                path: path,//预计轨迹
-                isOutline: true,
-                outlineColor: color,//轨迹颜色
-                borderWeight: 0,
-                strokeColor: "#FF0000", 
-                strokeOpacity: 1,
-                strokeWeight: 5,
-                // 折线样式还支持 'dashed'
-                strokeStyle: "solid",
-                // strokeStyle是dashed时有效
-                strokeDasharray: [10, 5],
-                lineJoin: 'round',
-                lineCap: 'round',
-                zIndex: 50,
-            })
-            that.map.setFitView([[ endLine ]])
-        },
-        initParkingMarkes(weight,height,image,lon,lat,title){
-            let that=this;
-            //图标标记点
-            let pointicon = new AMap.Icon({
-                size: new AMap.Size(weight, height), // 图标尺寸
-                image: image, // Icon的图像
-                imageOffset: new AMap.Pixel(0,0), // 图像相对展示区域的偏移量,适于雪碧图等
-                imageSize: new AMap.Size(weight, height) // 根据所设置的大小拉伸或压缩图片
-            });
-            // 创建一个 Marker 实例:
-            var pointmarker = new AMap.Marker({
-                position: new AMap.LngLat(lon, lat),   // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
-                icon: pointicon, 
-                title: title
-            });
-            that.parkMark.push(pointmarker)
-            // 将创建的点标记添加到已有的地图实例:
-            that.map.add(pointmarker);
-        },
-        //创建离线和停车的标记
-        initLeaveMarkes(weight,height,image,lon,lat,title){
-            let that=this;
-            //图标标记点
-            let pointicon = new AMap.Icon({
-                size: new AMap.Size(weight, height), // 图标尺寸
-                image: image, // Icon的图像
-                imageOffset: new AMap.Pixel(0,0), // 图像相对展示区域的偏移量,适于雪碧图等
-                imageSize: new AMap.Size(weight, height) // 根据所设置的大小拉伸或压缩图片
-            });
-            // 创建一个 Marker 实例:
-            var pointmarker = new AMap.Marker({
-                position: new AMap.LngLat(lon, lat),   // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
-                icon: pointicon, 
-                title: title
-            });
-            that.leaveMark.push(pointmarker)
-            // 将创建的点标记添加到已有的地图实例:
-            that.map.add(pointmarker);
-        },
-        //创建简单的标记
-        initMarkes(weight,height,image,lon,lat,title){
-            let that=this;
-            //图标标记点
-            let pointicon = new AMap.Icon({
-                size: new AMap.Size(weight, height), // 图标尺寸
-                image: image, // Icon的图像
-                imageOffset: new AMap.Pixel(0,0), // 图像相对展示区域的偏移量,适于雪碧图等
-                imageSize: new AMap.Size(weight, height) // 根据所设置的大小拉伸或压缩图片
-            });
-            // 创建一个 Marker 实例:
-            var pointmarker = new AMap.Marker({
-                position: new AMap.LngLat(lon, lat),   // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
-                icon: pointicon, 
-                title: title
-            });
-            // 将创建的点标记添加到已有的地图实例:
-            that.map.add(pointmarker);
-        },
-        //创建轨迹和巡航器
-        initPathSimplifier() {
-            let that=this;
-            // ...你的操作
-            new AMapUI.load(['ui/misc/PathSimplifier'], (PathSimplifier) => {
-                if (!PathSimplifier.supportCanvas) {
-                    alert('当前环境不支持 Canvas!')
-                    return
-                }
-                //创建轨迹和巡航器
-                // 创建组件实例
-                that.pathSimplifierIns = new PathSimplifier({
-                    map: that.map,
-                    zIndex: 100, // 图层叠加顺序
-                    data: that.listPath, // 巡航路径
-                    // 获取巡航路径中的路径坐标数组
-                    getPath: (pathData, pathIndex) => {
-                        return pathData.runPath;
-                    },
-                    //鼠标悬浮停时显示消息
-                    getHoverTitle: function(pathData, pathIndex, pointIndex) {
-                        //返回鼠标悬停时显示的信息
-                        if (pointIndex >= 0) {
-                            if(pathData.runRoute[pointIndex].gtm!=='undefined'){
-                                 //鼠标悬停在某个轨迹节点上
-                                return pathData.runRoute[pointIndex].gtm + ',速度'+ pathData.runRoute[pointIndex].spd+'千米/小时';
-                            }
-                        }
-                    },
-                    //设置轨迹样式
-                    renderOptions: {
-                        //轨迹线的样式
-                        pathLineStyle: {
-                            strokeStyle: 'black',//路径颜色
-                            lineWidth: 6,
-                            dirArrowStyle: true
-                        }
-                    }
-                })
-                // 创建巡航器
-                that.pathNavigator = that.pathSimplifierIns.createPathNavigator(0, {
-                    loop: true, // 是否循环
-                    speed: that.speed ,// 速度(km/h)
-                    pathNavigatorStyle: {
-                        width: 20,//车辆图片宽度
-                        height: 40,//车辆图片高度
-                        content:PathSimplifier.Render.Canvas.getImageContent( require('@/assets/img/smallcar.png'), onload, onerror),//车辆图片
-                        strokeStyle: null,
-                        fillStyle: null
-                    }
-                })
-                //开启巡航
-                that.pathNavigator.start()
-                
-                //开始事件监听
-                that.pathNavigator.on("start resume", function() {
-                });
-
-                //暂停事件监听
-                that.pathNavigator.on("stop pause", function() {
-                });
+            calculationPoint = null;
+          }
+        }
+      });
+    },
+    //停车所有离线图标
+    hideParkingMark() {
+      let that = this;
+      that.parkMark.forEach(function(item, indexOf) {
+        item.hide();
+      });
+    },
+    //离线时间改变时获得超过时间的点信息
+    changeLeaveTime() {
+      let that = this;
+      //关闭所有图标
+      that.hideLeaveMark();
+      that.listPath[0].runRoute.forEach(function(item, indexOf) {
+        if (indexOf + 1 < that.listPath[0].runRoute.length) {
+          let beforeTime = that.stringToDate(item.gtm);
+          let item2 = that.listPath[0].runRoute[indexOf + 1];
+          let afterTime = that.stringToDate(item2.gtm);
+          let second = afterTime - beforeTime;
+          if (second > that.leaveTime) {
+            let message = "离线:" + second / 60000;
+            that.initLeaveMarkes(
+              20,
+              35,
+              require("@/assets/img/start.png"),
+              item2.lon,
+              item2.lat,
+              message.split(".")[0] + "分钟"
+            );
+          }
+        }
+      });
+    },
+    //关闭所有离线图标
+    hideLeaveMark() {
+      let that = this;
+      that.leaveMark.forEach(function(item, indexOf) {
+        item.hide();
+      });
+    },
+    //字符串转为Date
+    stringToDate(dateString) {
+      let dateStr = dateString
+        .replace("年", "-")
+        .replace("月", "-")
+        .replace("日", "");
+      return Date.parse(dateStr);
+    },
+    //校验查询时间
+    changeTime() {
+      let that = this;
+      console.log(that.time[1] - that.time[0] - 86400000 * 3);
+      if (that.time[1] - that.time[0] > 86400000 * 3) {
+        this.$message.error("时间查询范围不能超过3天");
+        that.time = [];
+      }
+    },
+    //启动
+    play() {
+      let that = this;
+      that.pathNavigator.resume();
+    },
+    //停止
+    stop() {
+      let that = this;
+      that.pathNavigator.pause();
+    },
+    //添加进度
+    addProgress() {
+      let that = this;
+      let increment = that.listPath[0].runPath.length * 0.1;
+      that.pathNavigator.start(
+        (that.point + increment) % that.listPath[0].runPath.length
+      );
+    },
+    //进度监听
+    hideFormat(value) {
+      let that = this;
+      that.sliderVal = value;
+    },
+    //获得开始地址
+    getStartPointName(lnglatXY) {
+      let that = this;
+      console.log("start", that.geocoder);
+      that.geocoder.getAddress(lnglatXY, function(status, result) {
+        if (status === "complete" && result.info === "OK") {
+          that.startPointName = result.regeocode.formattedAddress;
+        }
+      });
+    },
+    //获得结束地址
+    getEndPointName(lnglatXY) {
+      let that = this;
+      that.geocoder.getAddress(lnglatXY, function(status, result) {
+        if (status === "complete" && result.info === "OK") {
+          that.endPointName = result.regeocode.formattedAddress;
+          that.initCustomMarkes(
+            that.carNumber + "(" + that.listPath[0].miled + ")",
+            "起点:" +
+              that.startPointName +
+              "<br/>" +
+              "终点:" +
+              that.endPointName,
+            lnglatXY[0],
+            lnglatXY[1]
+          );
+        }
+      });
+    },
+    //初始化数据
+    initData() {
+      let that = this;
+      that.listPath = [];
+      if (that.carNumber == "") {
+        this.$message.error("车牌号不能为空!");
+        return;
+      }
+      if (that.time == []) {
+        this.$message.error("请选择时间");
+      }
+      that.axios
+        .post("/api/v1/otms/fullPathVisualizationByCarNumber", {
+          capacityNumber: that.carNumber,
+          startTime: that.formatDate(that.time[0], "yyyy-MM-dd hh:mm:ss"),
+          endTime: that.formatDate(that.time[1], "yyyy-MM-dd hh:mm:ss")
+        })
+        .then(res => {
+          if (res.data.startAndEndRoutes != "") {
+            that.listPath = res.data.startAndEndRoutes;
+            that.initMap();
+          } else {
+            this.$message.error("车辆没有开启GPS");
+          }
+        });
+    },
+    //初始化地图
+    initMap() {
+      lazyAMapApiLoaderInstance.load().then(() => {
+        let that = this;
+        that.map = new AMap.Map("amap-container", {
+          //设置地图容器id
+          viewMode: "2D", //是否为2D地图模式
+          zoom: 10, //初始化地图级别
+          center: [105.602725, 37.076636] //初始化地图中心点位置
+        });
+        //初始化
+        that.initGeocoder();
+        //初始化巡航轨迹和巡航器
+        that.initPathSimplifier();
+        //初始化起点、当前点、当前点
+        that.initThreeMarker();
+        //初始化当前点标记
+        //that.initCustomMarkes(that.carNumber+"("+that.listPath[0].miled+")",that.listPath[0].currentPointName,that.listPath[0].currentPoint.lon,that.listPath[0].currentPoint.lat)
+        //that.initEndline();
+      });
+    },
+    //结束点
+    initEndline() {
+      let that = this;
+      that.initPolyline(that.listPath[0].estimatePath, "#FF0000");
+    },
+    //创建起点终点当前点
+    initThreeMarker() {
+      let that = this;
+      that.listPath.forEach((element, index) => {
+        //起点名称
+        that.getStartPointName([
+          element.startPoint.lon,
+          element.startPoint.lat
+        ]);
 
-                //移动事件监听
-                that.pathNavigator.on('move', function (data,value) {
-                    that.updateLable(value)
-                });
-            })
-        },
-        //实时展示
-        updateLable(value){
-            let that=this;
-            that.point=value.dataItem.pointIndex;
-            that.runRoute=value.dataItem.pathData.runRoute[that.point];
-            that.sliderVal=(value.dataItem.pointIndex/value.dataItem.pathData.runRoute.length)*100;
-        },
-        //逆解码函数
-        initGeocoder(){
-            let that=this;
-            console.log("initGeocoder") ;
-            AMap.plugin('AMap.Geocoder',function(){   
-                that.geocoder = new AMap.Geocoder({
-                    radius: 1000,
-                    extensions: "all"
-                });  
-                
-                console.log(that.geocoder)    
-            })    
-        },
-        //时间格式转换
-        formatDate (date, fmt) {
-            if (/(y+)/.test(fmt)) {
-                fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
-            }
-            let o = {
-                'M+': date.getMonth() + 1,
-                'd+': date.getDate(),
-                "h+": date.getHours(),
-                "m+": date.getMinutes(),
-                "s+": date.getSeconds(),
+        //开始标记点
+        if (element.startPoint.lon != "" && element.startPoint.lat != "") {
+          that.initMarkes(
+            20,
+            35,
+            require("@/assets/img/start.png"),
+            element.startPoint.lon,
+            element.startPoint.lat,
+            "起点"
+          );
+        }
+        //结束标记点
+        if (
+          element.endPoint != {} &&
+          element.endPoint != "" &&
+          element.endPoint != null
+        ) {
+          // that.initMarkes(20,35,require('@/assets/img/end.png'),element.endPoint.lon,element.endPoint.lat,'终点');
+          //终点名称
+          that.getEndPointName([element.endPoint.lon, element.endPoint.lat]);
+        } else {
+          // that.initMarkes(20,35,require('@/assets/img/end.png'),element.runRoute[element.runRoute.length-1].lon,element.runRoute[element.runRoute.length-1].lat,'终点');
+          //终点名称
+          that.getEndPointName([
+            element.runRoute[element.runRoute.length - 1].lon,
+            element.runRoute[element.runRoute.length - 1].lat
+          ]);
+        }
+      });
+    },
+    //初始化窗体
+    initCustomMarkes(title, details, lon, lat) {
+      let that = this;
+      //自定义窗体内容
+      var content = [
+        "<div  style='top:1px;width: 180px; background-color: rgba(0, 0, 0, 1);' ><font color='white'>" +
+          title +
+          "</font>",
+        "<div style='background-color:rgba(255, 255, 255, 0.5);'><font color='white'>" +
+          details +
+          "</font></div></div>"
+      ];
+      // 创建 infoWindow 实例
+      var infoWindow = new AMap.InfoWindow({
+        content: content.join("<br>") //传入 dom 对象,或者 html 字符串
+      });
+      // 打开信息窗体
+      infoWindow.open(that.map, [lon, lat]);
+    },
+    //初始化预计轨迹
+    initPolyline(path, color) {
+      let that = this;
+      //预计轨迹
+      var endLine = new AMap.Polyline({
+        map: that.map, //地图组件
+        path: path, //预计轨迹
+        isOutline: true,
+        outlineColor: color, //轨迹颜色
+        borderWeight: 0,
+        strokeColor: "#FF0000",
+        strokeOpacity: 1,
+        strokeWeight: 5,
+        // 折线样式还支持 'dashed'
+        strokeStyle: "solid",
+        // strokeStyle是dashed时有效
+        strokeDasharray: [10, 5],
+        lineJoin: "round",
+        lineCap: "round",
+        zIndex: 50
+      });
+      that.map.setFitView([[endLine]]);
+    },
+    initParkingMarkes(weight, height, image, lon, lat, title) {
+      let that = this;
+      //图标标记点
+      let pointicon = new AMap.Icon({
+        size: new AMap.Size(weight, height), // 图标尺寸
+        image: image, // Icon的图像
+        imageOffset: new AMap.Pixel(0, 0), // 图像相对展示区域的偏移量,适于雪碧图等
+        imageSize: new AMap.Size(weight, height) // 根据所设置的大小拉伸或压缩图片
+      });
+      // 创建一个 Marker 实例:
+      var pointmarker = new AMap.Marker({
+        position: new AMap.LngLat(lon, lat), // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
+        icon: pointicon,
+        title: title
+      });
+      that.parkMark.push(pointmarker);
+      // 将创建的点标记添加到已有的地图实例:
+      that.map.add(pointmarker);
+    },
+    //创建离线和停车的标记
+    initLeaveMarkes(weight, height, image, lon, lat, title) {
+      let that = this;
+      //图标标记点
+      let pointicon = new AMap.Icon({
+        size: new AMap.Size(weight, height), // 图标尺寸
+        image: image, // Icon的图像
+        imageOffset: new AMap.Pixel(0, 0), // 图像相对展示区域的偏移量,适于雪碧图等
+        imageSize: new AMap.Size(weight, height) // 根据所设置的大小拉伸或压缩图片
+      });
+      // 创建一个 Marker 实例:
+      var pointmarker = new AMap.Marker({
+        position: new AMap.LngLat(lon, lat), // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
+        icon: pointicon,
+        title: title
+      });
+      that.leaveMark.push(pointmarker);
+      // 将创建的点标记添加到已有的地图实例:
+      that.map.add(pointmarker);
+    },
+    //创建简单的标记
+    initMarkes(weight, height, image, lon, lat, title) {
+      let that = this;
+      //图标标记点
+      let pointicon = new AMap.Icon({
+        size: new AMap.Size(weight, height), // 图标尺寸
+        image: image, // Icon的图像
+        imageOffset: new AMap.Pixel(0, 0), // 图像相对展示区域的偏移量,适于雪碧图等
+        imageSize: new AMap.Size(weight, height) // 根据所设置的大小拉伸或压缩图片
+      });
+      // 创建一个 Marker 实例:
+      var pointmarker = new AMap.Marker({
+        position: new AMap.LngLat(lon, lat), // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
+        icon: pointicon,
+        title: title
+      });
+      // 将创建的点标记添加到已有的地图实例:
+      that.map.add(pointmarker);
+    },
+    //创建轨迹和巡航器
+    initPathSimplifier() {
+      let that = this;
+      // ...你的操作
+      new AMapUI.load(["ui/misc/PathSimplifier"], PathSimplifier => {
+        if (!PathSimplifier.supportCanvas) {
+          alert("当前环境不支持 Canvas!");
+          return;
+        }
+        //创建轨迹和巡航器
+        // 创建组件实例
+        that.pathSimplifierIns = new PathSimplifier({
+          map: that.map,
+          zIndex: 100, // 图层叠加顺序
+          data: that.listPath, // 巡航路径
+          // 获取巡航路径中的路径坐标数组
+          getPath: (pathData, pathIndex) => {
+            return pathData.runPath;
+          },
+          //鼠标悬浮停时显示消息
+          getHoverTitle: function(pathData, pathIndex, pointIndex) {
+            //返回鼠标悬停时显示的信息
+            if (pointIndex >= 0) {
+              if (pathData.runRoute[pointIndex].gtm !== "undefined") {
+                //鼠标悬停在某个轨迹节点上
+                return (
+                  pathData.runRoute[pointIndex].gtm +
+                  ",速度" +
+                  pathData.runRoute[pointIndex].spd +
+                  "千米/小时"
+                );
+              }
             }
-            for (let k in o) {
-                if (new RegExp(`(${k})`).test(fmt)) {
-                    let str = o[k] + ''
-                    fmt = fmt.replace(RegExp.$1, RegExp.$1.length === 1 ? str : ('00' + str).substr(str.length))
-                }
+          },
+          //设置轨迹样式
+          renderOptions: {
+            //轨迹线的样式
+            pathLineStyle: {
+              strokeStyle: "black", //路径颜色
+              lineWidth: 6,
+              dirArrowStyle: true
             }
-            return fmt
-        },         
+          }
+        });
+        // 创建巡航器
+        that.pathNavigator = that.pathSimplifierIns.createPathNavigator(0, {
+          loop: true, // 是否循环
+          speed: that.speed, // 速度(km/h)
+          pathNavigatorStyle: {
+            width: 20, //车辆图片宽度
+            height: 40, //车辆图片高度
+            content: PathSimplifier.Render.Canvas.getImageContent(
+              require("@/assets/img/smallcar.png"),
+              onload,
+              onerror
+            ), //车辆图片
+            strokeStyle: null,
+            fillStyle: null
+          }
+        });
+        //开启巡航
+        that.pathNavigator.start();
+
+        //开始事件监听
+        that.pathNavigator.on("start resume", function() {});
+
+        //暂停事件监听
+        that.pathNavigator.on("stop pause", function() {});
+
+        //移动事件监听
+        that.pathNavigator.on("move", function(data, value) {
+          that.updateLable(value);
+        });
+      });
+    },
+    //实时展示
+    updateLable(value) {
+      let that = this;
+      that.point = value.dataItem.pointIndex;
+      that.runRoute = value.dataItem.pathData.runRoute[that.point];
+      that.sliderVal =
+        (value.dataItem.pointIndex / value.dataItem.pathData.runRoute.length) *
+        100;
+    },
+    //逆解码函数
+    initGeocoder() {
+      let that = this;
+      console.log("initGeocoder");
+      AMap.plugin("AMap.Geocoder", function() {
+        that.geocoder = new AMap.Geocoder({
+          radius: 1000,
+          extensions: "all"
+        });
+
+        console.log(that.geocoder);
+      });
+    },
+    //时间格式转换
+    formatDate(date, fmt) {
+      if (/(y+)/.test(fmt)) {
+        fmt = fmt.replace(
+          RegExp.$1,
+          (date.getFullYear() + "").substr(4 - RegExp.$1.length)
+        );
+      }
+      let o = {
+        "M+": date.getMonth() + 1,
+        "d+": date.getDate(),
+        "h+": date.getHours(),
+        "m+": date.getMinutes(),
+        "s+": date.getSeconds()
+      };
+      for (let k in o) {
+        if (new RegExp(`(${k})`).test(fmt)) {
+          let str = o[k] + "";
+          fmt = fmt.replace(
+            RegExp.$1,
+            RegExp.$1.length === 1 ? str : ("00" + str).substr(str.length)
+          );
+        }
+      }
+      return fmt;
     }
+  }
 };
 </script>
 <style>
-.inputStyle{
-    position: absolute;
-    width: 200px;
-    left: 50px;
+.inputStyle {
+  position: absolute;
+  width: 200px;
+  left: 50px;
 }
 
-.controller{
-    width: 100%; height: 70px;
-    background: white;
-   position: absolute;z-index:99;top:0;left:0;
-   
+.controller {
+  width: 100%;
+  height: 70px;
+  background: white;
+  position: absolute;
+  z-index: 99;
+  top: 0;
+  left: 0;
 }
-.in_transit_information{
-   
-    width: 200px;
-    float: left;
-     height: 40px;
+.in_transit_information {
+  width: 200px;
+  float: left;
+  height: 40px;
 }
-.in_transit_information3{
-    float: right;
-    height: 40px;
-    width: 180px;
+.in_transit_information3 {
+  float: right;
+  height: 40px;
+  width: 180px;
 }
 .in_transit_information2 {
-   
-    height: 40px;
-    float: left;
-    width: 580px;
+  height: 40px;
+  float: left;
+  width: 580px;
 }
-.container{
-    width: 100%;
-	height: 100%;
-    
+.container {
+  width: 100%;
+  height: 100%;
 }
 span.item_details2 {
-    position: relative;
-    top: 20px;
+  position: relative;
+  top: 20px;
 }
-.date_picker_style{
-    position: relative;
-    left: 50px;
+.date_picker_style {
+  position: relative;
+  left: 50px;
 }
 .item_details {
-    position: relative;
-    top: 5px;
-    height: 0px;
-    left: 0px;
+  position: relative;
+  top: 5px;
+  height: 0px;
+  left: 0px;
 }
 #amap-container {
-    position: relative;
-	width: 100%;
-	height: 100%;
-	overflow: hidden;
-	margin: 0;
-	font-family: "微软雅黑";
+  position: relative;
+  width: 100%;
+  height: 100%;
+  overflow: hidden;
+  margin: 0;
+  font-family: "微软雅黑";
 }
 
-
 /* 进度条 */
 .mySlider {
-
-    width: 150px;
-    height: 20px;
-    display: inline-block;
-    position: relative;
-    left: 32px;
+  width: 150px;
+  height: 20px;
+  display: inline-block;
+  position: relative;
+  left: 32px;
 }
 /* 进度条 */
 .mySlider2 {
-
-    width: 400px;
-    height: 20px;
-    display: inline-block;
-    position: relative;
-    left: 32px;
+  width: 400px;
+  height: 20px;
+  display: inline-block;
+  position: relative;
+  left: 32px;
 }
 .play {
-    position: relative;
-    left: 28px;
+  position: relative;
+  left: 28px;
 }
-.quickly
-{
-    float: right;
-    position: relative;
-    left: -20px;
-    top: 10px;
+.quickly {
+  float: right;
+  position: relative;
+  left: -20px;
+  top: 10px;
 }
 .pause {
-    position: relative;
-    left: 28px;
+  position: relative;
+  left: 28px;
 }
-.passed-time{
-    position: relative;
-    left: 5px;
+.passed-time {
+  position: relative;
+  left: 5px;
 }
-.end-time{
-    position: relative;
-    left: 5px;
+.end-time {
+  position: relative;
+  left: 5px;
 }
 .map-times {
-    position: relative;
-    width: 40px;
+  position: relative;
+  width: 40px;
 }
-.searchstyle{
-     position: relative;
-    left: 5px;
+.searchstyle {
+  position: relative;
+  left: 5px;
 }
-.map-control{
-     float: left;
-     width: 270px;
+.map-control {
+  float: left;
+  width: 270px;
 }
 .driving_information {
-    height: 40px;
-    width: 240px;
-     float: left;
-     top: 0px;
+  height: 40px;
+  width: 240px;
+  float: left;
 }
-</style>
+</style>

+ 56 - 6
src/views/sale/components/offSiteTransportation/inTransit.vue

@@ -51,7 +51,7 @@
     <!-- 执行中 -->
 <el-tabs v-model="activeName" >
     <el-tab-pane label="执行中" name="first">
-    <dilTable ref="tab" v-bind.sync="option">
+    <mergeRowTable ref="tab" v-bind.sync="option">
       <el-table-column fixed="right" label="操作" width="110">
         <template slot-scope="scope">
           <el-button @click="click(scope.row)" type="text" size="small" style="font-size: 17px"
@@ -59,22 +59,22 @@
           >
         </template>
       </el-table-column>
-    </dilTable>
+    </mergeRowTable>
     </el-tab-pane>
     <!-- 已结束 -->
       <el-tab-pane label="已结束" name="second">
-        <dilTable ref="tab2" v-bind.sync="option2">
+        <mergeRowTable ref="tab2" v-bind.sync="option2">
          <el-table-column fixed="right" label="操作" width="220">
         <template slot-scope="scope">
           <el-button @click="historyclick(scope.row)" type="text" size="small" style="font-size: 17px">历史轨迹</el-button>
           <!-- <el-button @click="allDistanceclick(scope.row.orderNumber)" type="text" size="small" style="font-size: 17px">总距离</el-button> -->
         </template>
       </el-table-column>
-        </dilTable>
+        </mergeRowTable>
       </el-tab-pane>
       <!-- 有异常 -->
       <el-tab-pane label="有异常" name="third">
-        <dilTable ref="tab3" v-bind.sync="option3">
+        <mergeRowTable ref="tab3" :span-method="objectSpanMethod" v-bind.sync="option3">
          <el-table-column fixed="right" label="操作" width="220">
         <template slot-scope="scope">
            <el-button @click="click(scope.row)" type="text" size="small" style="font-size: 17px"
@@ -83,7 +83,7 @@
           <el-button @click="inTransitAlarmclick(scope.row.orderNumber)" type="text" size="small" style="font-size: 17px">运输报警</el-button>
         </template>
       </el-table-column>
-        </dilTable>
+        </mergeRowTable>
       </el-tab-pane>
     </el-tabs>
     <div style="height: 100%">
@@ -184,10 +184,14 @@ export default {
       option: {       
         // 表格请求数据的地址
         requestUrl: "/api/v1/otms/getInTransitTransportation?apiId=468",
+        comparison:"orderNumber",
+        columnIndexs:[2,1,5,6,7,8,12],  
       },
        option2: {
         // 表格请求数据的地址
         requestUrl: "/api/v1/otms/getFinishTruckOrderInfo?apiId=468",
+        comparison:"orderNumber",
+        columnIndexs:[2,1,5,6,7,8,12],
       },
       optionAlarm:{
         requestUrl: "",
@@ -207,7 +211,10 @@ export default {
        option3: {
         // 表格请求数据的地址
         requestUrl: "/api/v1/otms/getHaveAbnormalTruckOrderInfo?apiId=468",
+        comparison:"orderNumber",
+        columnIndexs:[2,1,5,6,7,8,12],
       }
+      
     };
   },
   mounted() {
@@ -217,6 +224,47 @@ export default {
     
   },
   methods: {
+     //记录每一行的合并数
+    getSpanArr(data) {
+      //每次调用方法初始化
+      this.spanArr = [];
+      for (var i = 0; i < data.length; i++) {
+        if (i === 0) {
+          this.spanArr.push(1);
+          this.pos = 0;
+        } else {
+          // 判断当前元素与上一个元素是否相同
+          if (data[i].orderNumber === data[i - 1].orderNumber) {
+            this.spanArr[this.pos] += 1;
+            this.spanArr.push(0);
+          } else {
+            this.spanArr.push(1);
+            this.pos = i;
+          }
+        }
+      }
+    },
+    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
+      if (
+        columnIndex == 0 ||
+        columnIndex == 1 ||
+        columnIndex == 7 ||
+        columnIndex == 8 ||
+        columnIndex == 9 ||
+        columnIndex == 10 ||
+        columnIndex == 11 ||
+        columnIndex == 12 ||
+        columnIndex == 13 ||
+        columnIndex == 14
+      ) {
+        const _row = this.spanArr[rowIndex];
+        const _col = _row > 0 ? 1 : 0;
+        return {
+          rowspan: _row,
+          colspan: _col
+        };
+      }
+    },
     showPathView(data){
       this.dialogVisible=!this.dialogVisible;
       this.selectOrderNumber=data.orderNumber;
@@ -315,6 +363,8 @@ export default {
   
       if(this.activeName=="first"){
       //改变执行中条件
+      console.log(this.$refs.tab)
+      console.log("this.$refs.tab")
       this.$refs.tab.setDataRequestQuery({"startTime":sjTime(this.dateValue[0]),
                       "endTime": sjTime(this.dateValue[1]),
                       "materialNames": this.inputValue,

+ 5 - 5
src/views/sale/components/offSiteTransportation/mapTest.vue

@@ -8,7 +8,7 @@
                  <label class="item_details">收货地址:{{endPointName}}</label>
                  <br/>
              </div>
-             <div class="driving_information">  
+             <div class="driving_information2">  
                 <label class="item_details">时间:{{runRoute.gtm}}</label>
                 <br/>
                 <label class="item_details">车速:{{runRoute.spd}}千米/小时</label>
@@ -254,9 +254,9 @@ export default {
         },
         //defualt数据
         defaultDate(){
-            let that=this;
-            that.pathNavigator.start(that.listPath[0].runPath.length)
-            that.pathNavigator.pause();
+            // let that=this;
+            // that.pathNavigator.start(that.listPath[0].runPath.length)
+            // that.pathNavigator.pause();
             
         },
         //初始化地图
@@ -460,7 +460,7 @@ export default {
 	margin: 0;
 	font-family: "微软雅黑";
 }
-.driving_information {
+.driving_information2 {
     position: relative;
     top: 50px;
 }

+ 156 - 233
src/views/sale/components/transport_excute/tms-offsite/arrivalResult.vue

@@ -1,6 +1,6 @@
 <template>
   <!-- 抵达页面 -->
-   <div class="purchasFuelNewMonitor">
+  <div class="purchasFuelNewMonitor">
     <div class="frameCalculation">
       <span>抵达时间:</span>
       <el-date-picker
@@ -10,99 +10,59 @@
       >
       </el-date-picker>
       <span>至</span>
-      <el-date-picker
-        v-model="endTime"
-        type="datetime"
-        placeholder="选择日期"
-      >
+      <el-date-picker v-model="endTime" type="datetime" placeholder="选择日期">
       </el-date-picker>
-        <el-input
-        placeholder="请输入内容"
-        v-model="input"
-        clearable>
-      </el-input>
+      <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>
     </div>
     <div class="table">
-       <el-table
-         @filter-change="filterChange"
-         :data="dataTabel"
-         :span-method="objectSpanMethod"
+      <el-table
+        @filter-change="filterChange"
+        :data="dataTabel"
+        :span-method="objectSpanMethod"
         border
-        style="width: 100%; margin-top: 20px">
-        <el-table-column
-          prop="orderNumber"
-          label="运输订单号">
-        </el-table-column>
-        <el-table-column
-          prop="capacityNumber"
-          label="车牌号">
-        </el-table-column>
-        <el-table-column
-          prop="materialName"
-          label="物资名称">
-        </el-table-column>
-        <el-table-column
-          prop="materialSpecification"
-          label="规格">
+        style="width: 100%; margin-top: 20px"
+      >
+        <el-table-column prop="orderNumber" label="运输订单号">
         </el-table-column>
-        <el-table-column
-          prop="materialModel"
-          label="型号">
+        <el-table-column prop="capacityNumber" label="车牌号">
         </el-table-column>
-        <el-table-column
-          prop="resultNetWeight"
-          label="净重">
+        <el-table-column prop="materialName" label="物资名称">
         </el-table-column>
-        <el-table-column
-          prop="resultGrossWeightTime"
-          label="净重时间">
+        <el-table-column prop="materialSpecification" label="规格">
         </el-table-column>
-        <el-table-column
-          prop="resultOutGateTime"
-          label="出厂时间">
+        <el-table-column prop="materialModel" label="型号"> </el-table-column>
+        <el-table-column prop="resultNetWeight" label="净重"> </el-table-column>
+        <el-table-column prop="resultGrossWeightTime" label="净重时间">
         </el-table-column>
-        <el-table-column
-          prop="outGatepostName"
-          label="出厂门岗">
+        <el-table-column prop="resultOutGateTime" label="出厂时间">
         </el-table-column>
-        <el-table-column
-          prop="carrierName"
-          label="承运商名称">
+        <el-table-column prop="outGatepostName" label="出厂门岗">
         </el-table-column>
-        <el-table-column
-          prop="deliveryAddress"
-          label="详细收货地址">
+        <el-table-column prop="carrierName" label="承运商名称">
         </el-table-column>
-        <el-table-column
-          prop="receiveName"
-          label="客户名称">
+        <el-table-column prop="deliveryAddress" label="详细收货地址">
         </el-table-column>
-        <el-table-column
-          prop="resultArrivalAddress"
-          label="抵达收货点的地址">
+        <el-table-column prop="receiveName" label="客户名称"> </el-table-column>
+        <el-table-column prop="resultArrivalAddress" label="抵达收货点的地址">
         </el-table-column>
-        <el-table-column
-          prop="insertTime"
-          label="抵达作业时间">
+        <el-table-column prop="insertTime" label="抵达作业时间">
         </el-table-column>
         <el-table-column fixed="right" label="照片游览">
-          <template slot-scope="scope">
-            <el-button @click="toPhotoClick(scope.row.orderNumber)" type="text" size="small" style="font-size: 6px">
-                抵达满货照片</el-button>
-          </template>
-      </el-table-column>
+          <template slot-scope="scope">
+            <el-button
+              @click="toPhotoClick(scope.row.orderNumber)"
+              type="text"
+              size="small"
+              style="font-size: 6px"
+            >
+              抵达满货照片</el-button
+            >
+          </template>
+        </el-table-column>
       </el-table>
-      <!-- <dilTable ref="excelDom" v-bind.sync="option" >
-          <el-table-column fixed="right" label="照片游览" width="120">
-          <template slot-scope="scope">
-            <el-button @click="toPhotoClick(scope.row.orderNumber)" type="text" size="small" style="font-size: 6px">
-                抵达满货照片</el-button>
-          </template>
-      </el-table-column>
-      </dilTable> -->
     </div>
     <!-- 分页器 -->
     <el-pagination
@@ -116,127 +76,101 @@
       @size-change="sizeChange"
     >
     </el-pagination>
-     <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>
+    <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>
-import { sjTime } from '@/utils/sharedJsFile';
+import { sjTime } from "@/utils/sharedJsFile";
 export default {
   name: "homeworkPath",
   data() {
     return {
-      spanArr:[],
-      dataTabel:[],
+      spanArr: [],
+      dataTabel: [],
       // 自己的数据总条数
       dataTotal: 0,
       // 自己的每页显示条目个数
       dataPageSize: 10,
       // 每页显示个数选择器的选项设置
       pageSizes: [10, 20, 50, 100, 200, 1000, 50000],
-      layout:  "total, prev, pager, next, sizes, jumper",
+      layout: "total, prev, pager, next, sizes, jumper",
       // 自己的当前页面数
       dataCurrentPage: 1,
       // 是否启用分页器
       isPagination: true,
       restaurants: [],
-      srcList:[],
-      dataColumnData:[],
-      columnData:[],
-      src:"",
-      isShow:false,
+      srcList: [],
+      dataColumnData: [],
+      columnData: [],
+      src: "",
+      isShow: false,
       input: "",
       startTime: null,
       endTime: null,
       // 表格请求数据的地址
       requestUrl: "/api/v1/otms/getArrivalResult?apiId=470",
-      beforeRow:0,
-      thatrowspan:1,
+      beforeRow: 0,
+      thatrowspan: 1,
       option: {
-        pageSize:10,
-        pageNum:1,
-      },
+        pageSize: 10,
+        pageNum: 1
+      }
     };
   },
-  mounted(){
-    this.requestData(this.option)
-  },
-  created(){
-   
+  mounted() {
+    this.requestData(this.option);
   },
+  created() {},
   methods: {
-    // //记录每一行的合并数
-    // getSpanArr(data) {
-    //   //每次调用方法初始化
-    //   this.spanArr = [];
-    //   for (var i = 0; i < data.length; i++) {
-    //     if (i === 0) {
-    //       this.spanArr.push(1);
-    //       this.pos = 0;
-    //     } else {
-    //       // 判断当前元素与上一个元素是否相同
-    //       if (data[i].cxh === data[i - 1].cxh) {
-    //         this.spanArr[this.pos] += 1;
-    //         this.spanArr.push(0);
-    //       } else {
-    //         this.spanArr.push(1);
-    //         this.pos = i;
-    //       }
-    //     }
-    //   }
-    // },
-    // objectSpanMethod({ row, column, rowIndex, columnIndex }) {
-    //   if (
-    //     columnIndex!=2||columnIndex!=3||columnIndex!=4||columnIndex!=5
-    //   ) {
-    //     const _row = this.spanArr[rowIndex];
-    //     const _col = _row > 0 ? 1 : 0;
-    //     return {
-    //       rowspan: _row,
-    //       colspan: _col
-    //     };
-    //   }
-    // },
-     objectSpanMethod({ row, column, rowIndex, columnIndex }) {
-       let that=this;
-       if(columnIndex==2||columnIndex==3||columnIndex==4||columnIndex==5){
-            return {
-              rowspan: 1,
-              colspan: 1
-            };
-         }else{
-           console.log(row >=that.beforeRow)
-           if(row >=that.beforeRow){
-             
-             if((that.dataTabel[rowIndex+1].orderNumber==row.orderNumber)){
-               for(let i=0;i<that.dataTabel.length-(rowIndex+1);i++){
-                  if((that.dataTabel[rowIndex+1+i].orderNumber==row.orderNumber)){
-                      that.thatrowspan++;
-                      that.beforeRow=rowIndex+1+i;
-                  }else{
-                    let myrowspan=that.thatrowspan;
-                    that.thatrowspan=1;
-                    return {
-                      rowspan: myrowspan,
-                      colspan: 1
-                    };  
-                  }
-               }
-             }
-           }else{
-              return {
-                rowspan: 0,
-                colspan: 0
-            };
-         }
+    //记录每一行的合并数
+    getSpanArr(data) {
+      //每次调用方法初始化
+      this.spanArr = [];
+      for (var i = 0; i < data.length; i++) {
+        if (i === 0) {
+          this.spanArr.push(1);
+          this.pos = 0;
+        } else {
+          // 判断当前元素与上一个元素是否相同
+          if (data[i].orderNumber === data[i - 1].orderNumber) {
+            this.spanArr[this.pos] += 1;
+            this.spanArr.push(0);
+          } else {
+            this.spanArr.push(1);
+            this.pos = i;
+          }
+        }
+      }
+    },
+    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
+      if (
+        columnIndex == 0 ||
+        columnIndex == 1 ||
+        columnIndex == 7 ||
+        columnIndex == 8 ||
+        columnIndex == 9 ||
+        columnIndex == 10 ||
+        columnIndex == 11 ||
+        columnIndex == 12 ||
+        columnIndex == 13 ||
+        columnIndex == 14
+      ) {
+        const _row = this.spanArr[rowIndex];
+        const _col = _row > 0 ? 1 : 0;
+        return {
+          rowspan: _row,
+          colspan: _col
+        };
       }
     },
     // 参数的值是一个对象,对象的 key 是 column 的 columnKey,对应的 value 为用户选择的筛选条件的数组。
@@ -264,16 +198,16 @@ export default {
       this.requestData({});
       this.$emit("update:size-change", val);
     },
-     // 通过请求获取数据
+    // 通过请求获取数据
     requestData(options) {
       let pageNum = undefined;
       let pageSize = undefined;
-      
+
       if (options) {
         pageNum = options.pageNum;
         pageSize = options.pageSize;
       }
-      console.log(this.requestUrl)
+      console.log(this.requestUrl);
       if (this.requestUrl) {
         // 处理请求地址逻辑
         let url;
@@ -283,44 +217,40 @@ export default {
           url = this.requestUrl;
         }
         // 判断是否需要在请求体中放入参数
-        if(this.requestQuery){
-          this.dataRequestQuery=this.requestQuery;
+        if (this.requestQuery) {
+          this.dataRequestQuery = this.requestQuery;
           // console.log(this.dataRequestQuery.resultBreakId)
         }
         let data = undefined;
         for (const key in this.dataRequestQuery) {
           const val = this.dataRequestQuery[key];
-          console.log(val)
-          if (val||val==0) {
+          console.log(val);
+          if (val || val == 0) {
             if (!data) data = {};
             data[key] = val;
           }
         }
         //判断是否是带分页查询
-        if(this.isKuang){
-          console.log("AAAAAAAAAAAAAAAAAAAAA")
+        if (this.isKuang) {
           // 发送请求
           this.axios
-          .post(url, data, {
-            // 请求地址 中
-            params: {
-              pageNum: 1,
-              pageSize: pageSize || this.dataPageSize
-            }
-          })
-          .then(response => {
-            let d = response.data.data;
-            this.dataTabel = d.list;
-            this.spanArr(this.dataTabel)
-            this.dataTotal = d.total;
-            console.log(this.dataTabel)
-            console.log("this.dataTabe")
-            //执行成功的回调
-            this.$emit('func',response.data.data);
-            this.refreshColumnData(d.columnData);
-          });
-        }else{
-           console.log("BBBBBBBBBBBBBBBBBBBBBBBBB")
+            .post(url, data, {
+              // 请求地址 中
+              params: {
+                pageNum: 1,
+                pageSize: pageSize || this.dataPageSize
+              }
+            })
+            .then(response => {
+              let d = response.data.data;
+              this.dataTabel = d.list;
+              this.getSpanArr(this.dataTabel);
+              this.dataTotal = d.total;
+              //执行成功的回调
+              this.$emit("func", response.data.data);
+              this.refreshColumnData(d.columnData);
+            });
+        } else {
           // 发送请求
           this.axios
             .post(url, data, {
@@ -333,13 +263,10 @@ export default {
             .then(response => {
               let d = response.data.data;
               this.dataTabel = d.list;
-              this.dataTotal = d.total; response
-              console.log(response)
-              console.log(this.dataTabel)
-              
-              console.log("this.dataTabe")
+              this.dataTotal = d.total;
+              this.getSpanArr(this.dataTabel);
               //执行成功的回调
-              this.$emit('func',response.data.data);
+              this.$emit("func", response.data.data);
               this.refreshColumnData(d.columnData);
             });
         }
@@ -350,60 +277,56 @@ export default {
     // 刷新表头显示数据
     refreshColumnData(columnData) {
       // 表头只赋值一次(在查出全部数据的情况下才只赋值一次)
-      if (this.dataColumnData.length > 0){
-          return;
-      } 
-      console.log(columnData)
-      console.log("columnData")
+      if (this.dataColumnData.length > 0) {
+        return;
+      }
       // 如果前端有写表头,则加在后端表头前面
-       const d = this.columnData.concat(columnData);
+      const d = this.columnData.concat(columnData);
       // 把操作列拼接到最后一列
-       this.dataColumnData = d;
-       this.dataDropColumn = [].concat(this.dataColumnData);
+      this.dataColumnData = d;
+      this.dataDropColumn = [].concat(this.dataColumnData);
     },
-     toPhotoClick(orderNumber){
-      this.axios
-       .post("/api/v1/otms/getArrivalPhoto?orderNumber="+orderNumber)
-       .then((res)=>{
-          this.srcList=[];
-          this.src=res.data.data;
-          this.isShow=true;
-          this.srcList.push(res.data.data);
-       });
-       
-    },
-    photo(scope){
-      console.log(scope.row.orderNumber)
-    
+    toPhotoClick(orderNumber) {
+      this.axios
+        .post("/api/v1/otms/getArrivalPhoto?orderNumber=" + orderNumber)
+        .then(res => {
+          this.srcList = [];
+          this.src = res.data.data;
+          this.isShow = true;
+          this.srcList.push(res.data.data);
+        });
+    },
+    photo(scope) {
+      console.log(scope.row.orderNumber);
     },
     onclick() {
       let startTime = null;
       let endTime = null;
-      if(this.startTime){
+      if (this.startTime) {
         startTime = sjTime(this.startTime);
       }
-      if(this.endTime){
+      if (this.endTime) {
         endTime = sjTime(this.endTime);
       }
       if(startTime && endTime){
         if(startTime < endTime){
-          this.requestUrl = '/api/v1/otms/getArrivalResult?apiId=470"' + "&startTime=" + startTime + "&endTime=" + endTime + "&i="+"&con="+this.input; 
+          this.requestUrl = '/api/v1/otms/getArrivalResult?apiId=470' + "&startTime=" + startTime + "&endTime=" + endTime + "&i="+new Date()+"&con="+this.input; 
           this.requestData(this.option)
         }else{
           this.startTime = null;
           this.endTime = null;
-          this.$message.warning('开始时间要比结束时间早')
+          this.$message.warning("开始时间要比结束时间早");
         }
       }else{
         console.log(startTime && endTime)
-         this.requestUrl = '/api/v1/otms/getArrivalResult?apiId=470"' + "&startTime=" + startTime + "&endTime=" + endTime + "&i="+"&con="+this.input; 
+         this.requestUrl = '/api/v1/otms/getArrivalResult?apiId=470' + "&startTime=" + startTime + "&endTime=" + endTime + "&i="+new Date()+"&con="+this.input; 
         this.requestData(this.option)
       }
-    },
-   }
+    }
+  }
 };
 </script>
-<style lang='scss' scoped>
+<style lang="scss" scoped>
 .purchasFuelNewMonitor {
   .frameCalculation {
     width: 100%;
@@ -411,7 +334,7 @@ export default {
     display: flex;
     align-items: center;
     padding-left: 50px;
-    .el-date-editor{
+    .el-date-editor {
       margin: 20px;
     }
     .el-input {
@@ -420,4 +343,4 @@ export default {
     }
   }
 }
-</style>
+</style>

+ 239 - 14
src/views/sale/components/transport_excute/tms-offsite/receiptResult.vue

@@ -30,15 +30,64 @@
       </el-button> -->
     </div>
     <div class="table">
-      <dilTable ref="excelDom" v-bind.sync="option" >
-       <el-table-column fixed="right" label="照片游览" width="120">
-          <template slot-scope="scope">
-            <el-button @click="toPhotoClick(scope.row.orderNumber)" type="text" size="small" style="font-size: 6px">
-                签收照片</el-button>
-          </template>
-      </el-table-column>
-      </dilTable>
+      <el-table
+        @filter-change="filterChange"
+        :data="dataTabel"
+        :span-method="objectSpanMethod"
+        border
+        style="width: 100%; margin-top: 20px"
+      >
+        <el-table-column prop="orderNumber" label="运输订单号">
+        </el-table-column>
+        <el-table-column prop="capacityNumber" label="车牌号">
+        </el-table-column>
+        <el-table-column prop="materialName" label="物资名称">
+        </el-table-column>
+        <el-table-column prop="materialSpecification" label="规格">
+        </el-table-column>
+        <el-table-column prop="materialModel" label="型号"> </el-table-column>
+        <el-table-column prop="resultNetWeight" label="净重"> </el-table-column>
+        <el-table-column prop="resultGrossWeightTime" label="净重时间">
+        </el-table-column>
+        <el-table-column prop="resultOutGateTime" label="出厂时间">
+        </el-table-column>
+        <el-table-column prop="outGatepostName" label="出厂门岗">
+        </el-table-column>
+        <el-table-column prop="carrierName" label="承运商名称">
+        </el-table-column>
+        <el-table-column prop="deliveryAddress" label="详细收货地址">
+        </el-table-column>
+        <el-table-column prop="receiveName" label="客户名称"> </el-table-column>
+        <el-table-column prop="resultArrivalAddress" label="抵达收货点的地址">
+        </el-table-column>
+        <el-table-column prop="insertTime" label="抵达作业时间">
+        </el-table-column>
+        <el-table-column fixed="right" label="照片游览">
+          <template slot-scope="scope">
+            <el-button
+              @click="toPhotoClick(scope.row.orderNumber)"
+              type="text"
+              size="small"
+              style="font-size: 6px"
+            >
+              抵达满货照片</el-button
+            >
+          </template>
+        </el-table-column>
+      </el-table>
     </div>
+    <!-- 分页器 -->
+    <el-pagination
+      v-if="isPagination"
+      :layout="layout"
+      :current-page="dataCurrentPage"
+      :page-sizes="pageSizes"
+      :page-size="dataPageSize"
+      :total="dataTotal"
+      @current-change="currentChange"
+      @size-change="sizeChange"
+    >
+    </el-pagination>
      <vxe-modal width="549px" height="731px" v-model="isShow" show-footer>
         <div class="demo-image__preview">
           <el-image 
@@ -57,6 +106,19 @@ export default {
   name: "homeworkPath",
   data() {
     return {
+       spanArr: [],
+      dataTabel: [],
+      // 自己的数据总条数
+      dataTotal: 0,
+      // 自己的每页显示条目个数
+      dataPageSize: 10,
+      // 每页显示个数选择器的选项设置
+      pageSizes: [10, 20, 50, 100, 200, 1000, 50000],
+      layout: "total, prev, pager, next, sizes, jumper",
+      // 自己的当前页面数
+      dataCurrentPage: 1,
+      // 是否启用分页器
+      isPagination: true,
       restaurants: [],
       input: "",
       srcList:[],
@@ -64,16 +126,177 @@ export default {
        isShow:false,
       startTime: null,
       endTime: null,
+      // 表格请求数据的地址
+      requestUrl: "/api/v1/otms/getReceiptResult?apiId=470",
+      beforeRow: 0,
+      thatrowspan: 1,
       option: {
-        // 表格请求数据的地址
-        requestUrl: "/api/v1/otms/getReceiptResult?apiId=470",
-      },
+        pageSize: 10,
+        pageNum: 1
+      }
     };
+  },
+   mounted() {
+    this.requestData(this.option);
   },
   created(){
    
   },
   methods: {
+     //记录每一行的合并数
+    getSpanArr(data) {
+      //每次调用方法初始化
+      this.spanArr = [];
+      for (var i = 0; i < data.length; i++) {
+        if (i === 0) {
+          this.spanArr.push(1);
+          this.pos = 0;
+        } else {
+          // 判断当前元素与上一个元素是否相同
+          if (data[i].orderNumber === data[i - 1].orderNumber) {
+            this.spanArr[this.pos] += 1;
+            this.spanArr.push(0);
+          } else {
+            this.spanArr.push(1);
+            this.pos = i;
+          }
+        }
+      }
+    },
+    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
+      if (
+        columnIndex == 0 ||
+        columnIndex == 1 ||
+        columnIndex == 7 ||
+        columnIndex == 8 ||
+        columnIndex == 9 ||
+        columnIndex == 10 ||
+        columnIndex == 11 ||
+        columnIndex == 12 ||
+        columnIndex == 13 ||
+        columnIndex == 14
+      ) {
+        const _row = this.spanArr[rowIndex];
+        const _col = _row > 0 ? 1 : 0;
+        return {
+          rowspan: _row,
+          colspan: _col
+        };
+      }
+    },
+    // 参数的值是一个对象,对象的 key 是 column 的 columnKey,对应的 value 为用户选择的筛选条件的数组。
+    filterChange(filters) {
+      let value = {};
+      for (const key in filters) {
+        value[key] = filters[key].length > 0 ? filters[key] : undefined;
+      }
+      // 每次筛选时,都默认将页面改为第一页,避免数据过少时,显示没有数据
+      this.currentChange(1, false);
+      this.setDataRequestQuery(value);
+    },
+    // current-page 改变时会触发
+    currentChange(val, isRequest = true) {
+      if (isRequest) {
+        this.requestData({ pageNum: val });
+      }
+      // 最后通知父节点页面改变
+      this.dataCurrentPage = val;
+      this.$emit("update:current-page", val);
+    },
+    // pageSize 改变时会触发
+    sizeChange(val) {
+      this.dataPageSize = val;
+      this.requestData({});
+      this.$emit("update:size-change", val);
+    },
+    // 通过请求获取数据
+    requestData(options) {
+      let pageNum = undefined;
+      let pageSize = undefined;
+
+      if (options) {
+        pageNum = options.pageNum;
+        pageSize = options.pageSize;
+      }
+      console.log(this.requestUrl);
+      if (this.requestUrl) {
+        // 处理请求地址逻辑
+        let url;
+        if (this.requestUrl.indexOf("//") > -1) {
+          url = this.requestUrl;
+        } else {
+          url = this.requestUrl;
+        }
+        // 判断是否需要在请求体中放入参数
+        if (this.requestQuery) {
+          this.dataRequestQuery = this.requestQuery;
+          // console.log(this.dataRequestQuery.resultBreakId)
+        }
+        let data = undefined;
+        for (const key in this.dataRequestQuery) {
+          const val = this.dataRequestQuery[key];
+          console.log(val);
+          if (val || val == 0) {
+            if (!data) data = {};
+            data[key] = val;
+          }
+        }
+        //判断是否是带分页查询
+        if (this.isKuang) {
+          // 发送请求
+          this.axios
+            .post(url, data, {
+              // 请求地址 中
+              params: {
+                pageNum: 1,
+                pageSize: pageSize || this.dataPageSize
+              }
+            })
+            .then(response => {
+              let d = response.data.data;
+              this.dataTabel = d.list;
+              this.getSpanArr(this.dataTabel);
+              this.dataTotal = d.total;
+              //执行成功的回调
+              this.$emit("func", response.data.data);
+              this.refreshColumnData(d.columnData);
+            });
+        } else {
+          // 发送请求
+          this.axios
+            .post(url, data, {
+              // 请求地址 中
+              params: {
+                pageNum: pageNum || this.dataCurrentPage,
+                pageSize: pageSize || this.dataPageSize
+              }
+            })
+            .then(response => {
+              let d = response.data.data;
+              this.dataTabel = d.list;
+              this.dataTotal = d.total;
+              this.getSpanArr(this.dataTabel);
+              //执行成功的回调
+              this.$emit("func", response.data.data);
+              this.refreshColumnData(d.columnData);
+            });
+        }
+      } else {
+        console.warn("requestUrl 参数不能为 null");
+      }
+    },
+    // 刷新表头显示数据
+    refreshColumnData(columnData) {
+      // 表头只赋值一次(在查出全部数据的情况下才只赋值一次)
+      if (this.dataColumnData.length > 0) {
+        return;
+      }
+      // 如果前端有写表头,则加在后端表头前面
+      const d = this.columnData.concat(columnData);
+      // 把操作列拼接到最后一列
+      this.dataColumnData = d;
+      this.dataDropColumn = [].concat(this.dataColumnData);
+    },
      toPhotoClick(orderNumber){
       this.axios
        .post("/api/v1/otms/getReceivingPhotoByUrl?orderNumber="+orderNumber)
@@ -101,15 +324,17 @@ export default {
       }
       if(startTime && endTime){
         if(startTime < endTime){
-          this.option.requestUrl = '/api/v1/tms/getReceiptResult?apiId=471' + "&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date()+"&con="+this.input; 
-        }else{
+          this.requestUrl = '/api/v1/tms/getReceiptResult?apiId=471' + "&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date()+"&con="+this.input; 
+           this.requestData(this.option);
+       }else{
           this.startTime = null;
           this.endTime = null;
           this.$message.warning('开始时间要比结束时间早')
         }
       }else{
         console.log(startTime && endTime)
-         this.option.requestUrl = '/api/v1/tms/getReceivingResult?apiId=471' + "&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date()+"&con="+this.input; 
+         this.requestUrl = '/api/v1/tms/getReceivingResult?apiId=471' + "&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date()+"&con="+this.input; 
+        this.requestData(this.option);
       }
     },
    }