Quellcode durchsuchen

提交陆运散货

caojunjie vor 3 Jahren
Ursprung
Commit
04f6df62ca

+ 9 - 0
src/components/fee-info/main.vue

@@ -504,6 +504,15 @@ export default {
             params.exchangeRate = data.receivableParities;
             this.$refs.feeCrud.rowCellAdd(params);
           });
+        }else if(this.optionType == "JK") {
+          getParities({
+            currency: "USD",
+            businesDate: dateFormat(new Date(), "yyyy-MM-dd") + " 00:00:00"
+          }).then(res => {
+            const data = res.data.data;
+            params.exchangeRate = data.receivableParities;
+            this.$refs.feeCrud.rowCellAdd(params);
+          });
         }
       }
     },

+ 5 - 0
src/components/trackPlayback.vue

@@ -5,6 +5,7 @@
       custom-class="dialog_two"
       :visible.sync="dialogVisible"
       lock-scroll
+      :before-close="handleClose"
       width="80%">
     <div id="container" v-if="dialogVisible"></div>
     <div class="input-card" style="right: 10.3%;bottom: 10.3%" v-if="this.lineArr.length>0">
@@ -47,6 +48,10 @@ export default {
     this.map && this.map.destroy();
   },
   methods:{
+    handleClose(done) {
+      this.dialogVisible = false
+      this.$emit('closeDialog')
+    },
     initMap() {
       this.map = new AMap.Map("container", {
         resizeEnable: true,

+ 185 - 64
src/views/landTransportation/bulkCargo/detailPage.vue

@@ -42,10 +42,10 @@
               size="small"
               v-if="goodsForm.status > 0"
               :disabled="
-            (this.roleName.indexOf('平台') !== -1
-            ||this.roleName.indexOf('经理') !== -1
-            ||this.roleName.indexOf('部门经理') !== -1
-            ||this.roleName.indexOf('总经理') !== -1) && !(this.roleName.indexOf('admin') !== -1)"
+            (roleName.indexOf('平台') !== -1
+            ||roleName.indexOf('经理') !== -1
+            ||roleName.indexOf('部门经理') !== -1
+            ||roleName.indexOf('总经理') !== -1) && !(roleName.indexOf('admin') !== -1)"
               @click="confirmChange"
           >变更
           </el-button>
@@ -63,16 +63,18 @@
               size="small"
               :loading="type"
               v-show="
-              (this.roleName.indexOf('客户') !== -1 && goodsForm.status < 2)
-            || (this.roleName.indexOf('车队') !== -1 && goodsForm.status === 2)
-            || (this.roleName.indexOf('司机') !== -1 && (goodsForm.status === 3||goodsForm.status === 6||goodsForm.status === 4))
-            || (this.roleName.indexOf('平台') !== -1
-            ||this.roleName.indexOf('经理') !== -1
-            ||this.roleName.indexOf('部门经理') !== -1
-            ||this.roleName.indexOf('总经理') !== -1)"
+              (roleName.indexOf('客户') !== -1 && goodsForm.status < 2)
+            || (roleName.indexOf('车队') !== -1 && goodsForm.status === 2)
+            || (roleName.indexOf('司机') !== -1 && (goodsForm.status === 3||goodsForm.status === 6||goodsForm.status === 4))
+            || (roleName.indexOf('平台') !== -1
+            ||roleName.indexOf('经理') !== -1
+            ||roleName.indexOf('部门经理') !== -1
+            ||roleName.indexOf('总经理') !== -1)"
               @click="modifyState"
           >
-            {{ goodsForm.status === 1 ? '调度' : goodsForm.status === 2 ? '派车' : goodsForm.status === 3 ? '受理' : goodsForm.status === 4 ? '确认完工' : goodsForm.status === 6 ? '确认到厂' : goodsForm.status === 7 ? '提箱' : '未知状态:' + goodsForm.status }}
+            {{
+              goodsForm.status === 1 ? '调度' : goodsForm.status === 2 ? '派车' : goodsForm.status === 3 ? '受理' : goodsForm.status === 4 ? '确认完工' : goodsForm.status === 6 ? '确认到厂' : goodsForm.status === 7 ? '提箱' : '未知状态:' + goodsForm.status
+            }}
           </el-button>
           <el-button
               type="warning"
@@ -428,7 +430,13 @@
                 @clear="clear(scope.row)"
                 @getCorpData="(row)=>{withAddress(row,scope)}">
               <template slot="slot">
-                <el-select :disabled="goodsForm.status !== 0" style="width: 100%;" filterable v-model="scope.row.corpId" size="small" placeholder="请选择">
+                <el-select
+                    :disabled="goodsForm.status !== 0"
+                    style="width: 100%;"
+                    filterable
+                    v-model="scope.row.corpId"
+                    size="small" placeholder="请选择"
+                    @change="withAddress({},scope,true)">
                   <el-option
                       v-for="item in corpList"
                       :key="item.id"
@@ -476,8 +484,7 @@
             width="180"
             label="货物体积">
           <template slot-scope="scope">
-            <el-input v-model="scope.row.volume" :disabled="goodsForm.status !== 0" size="small"
-                      placeholder="请输入内容"></el-input>
+            <el-input-number :controls="false" v-model="scope.row.volume" size="small" :disabled="goodsForm.status !== 0" placeholder="请输入内容" precision="2"></el-input-number>
           </template>
         </el-table-column>
         <el-table-column
@@ -646,7 +653,8 @@
                 @clear="clear(scope.row)"
                 @getCorpData="(row)=>{withAddressTwo(row,scope)}">
               <template slot="slot">
-                <el-select :disabled="goodsForm.status !== 0" style="width: 100%;" filterable v-model="scope.row.corpId" size="small" placeholder="请选择">
+                <el-select @change="withAddressTwo({},scope,true)" :disabled="goodsForm.status !== 0"
+                           style="width: 100%;" filterable v-model="scope.row.corpId" size="small" placeholder="请选择">
                   <el-option
                       v-for="item in corpList"
                       :key="item.id"
@@ -703,11 +711,7 @@
             width="180"
             label="货物体积">
           <template slot-scope="scope">
-            <el-input
-                v-model="scope.row.volume"
-                :disabled="goodsForm.status !== 0"
-                size="small"
-                placeholder="请输入内容"></el-input>
+            <el-input-number :controls="false" v-model="scope.row.volume" size="small" :disabled="goodsForm.status !== 0" placeholder="请输入内容" precision="2"></el-input-number>
           </template>
         </el-table-column>
         <el-table-column
@@ -827,11 +831,12 @@
       </avue-crud>
     </basic-container>
     </span>
-    <containerTitle title="杂费明细" v-if="this.roleName.indexOf('平台') !== -1 || this.roleName.indexOf('客户') !== -1"></containerTitle>
-    <basic-container v-if="this.roleName.indexOf('平台') !== -1 || this.roleName.indexOf('客户') !== -1">
+    <containerTitle title="杂费明细"
+                    v-if="roleName.indexOf('平台') !== -1 || this.roleName.indexOf('客户') !== -1"></containerTitle>
+    <basic-container v-if="roleName.indexOf('平台') !== -1 || roleName.indexOf('客户') !== -1">
       <el-tabs v-model="activeIndex" @tab-click="handleSelect">
         <el-tab-pane label="应收" name="1"></el-tab-pane>
-        <el-tab-pane label="应付" name="2" v-if="this.roleName.indexOf('平台') !== -1"></el-tab-pane>
+        <el-tab-pane label="应付" name="2" v-if="roleName.indexOf('平台') !== -1"></el-tab-pane>
       </el-tabs>
       <avue-crud
           v-if="activeIndex === '1'"
@@ -868,7 +873,7 @@
           <el-button
               type="text"
               size="small"
-              v-if="this.roleName.indexOf('平台') !== -1"
+              v-if="roleName.indexOf('平台') !== -1"
               :disabled="goodsForm.status === 5"
               :icon="row.$cellEdit?'el-icon-circle-plus-outline':'el-icon-edit'"
               @click="rowCell(row,index)"
@@ -877,7 +882,7 @@
           <el-button type="text"
                      icon="el-icon-delete"
                      size="small"
-                     v-if="this.roleName.indexOf('平台') !== -1"
+                     v-if="roleName.indexOf('平台') !== -1"
                      :disabled="goodsForm.status === 5"
                      @click="$refs.collection.rowDel(row,index)"
           >删除
@@ -894,7 +899,7 @@
           <el-button
               type="primary"
               icon="el-icon-plus"
-              v-if="this.roleName.indexOf('平台') !== -1"
+              v-if="roleName.indexOf('平台') !== -1"
               :disabled="goodsForm.status === 5"
               @click="addRowCollection"
               size="small">录入明细
@@ -1018,7 +1023,7 @@ import trackPlayback from "@/components/trackPlayback"
 import {fleetList, telephone} from "@/api/landTransportation";
 import {getDictionary} from "@/api/system/dictbiz";
 import {allCropList} from "@/api/basicData/customerInformation";
-
+// goodsOptionFormTwo
 export default {
   comments: {
     trackPlayback
@@ -1031,6 +1036,48 @@ export default {
       type: Boolean
     }
   },
+  watch: {
+    goodsForm: {
+      handler(newValue, oldValue) {
+        this.collectionOption.disabled = this.paymentOption.disabled = this.goodsForm.status === 5
+        if (this.roleName.indexOf('客户') !== -1 || this.roleName.indexOf('司机') !== -1){
+          this.goodsOptionFormTwo.disabled = true
+          this.findObject(this.goodsOptionFormTwo.column, "freightPay").display = false
+        } else {
+          if (this.goodsForm.status === 0) {
+            this.goodsOptionFormTwo.disabled = true
+          }else if (this.goodsForm.status === 1){
+            this.goodsOptionFormTwo.disabled = false
+            if (this.roleName.indexOf('平台') !== -1){
+              this.findObject(this.goodsOptionFormTwo.column, "fleetId").disabled = false
+              this.findObject(this.goodsOptionFormTwo.column, "plateNo").disabled = false
+              this.findObject(this.goodsOptionFormTwo.column, "driverId").disabled = false
+              this.findObject(this.goodsOptionFormTwo.column, "driverTel").disabled = false
+              this.findObject(this.goodsOptionFormTwo.column, "fleetVolum").disabled = false
+              this.findObject(this.goodsOptionFormTwo.column, "freightPay").disabled = false
+            }
+          }else if (this.goodsForm.status === 2){
+            this.goodsOptionFormTwo.disabled = false
+            if (this.roleName.indexOf('车队') !== -1){
+              this.findObject(this.goodsOptionFormTwo.column, "fleetId").disabled = true
+              this.findObject(this.goodsOptionFormTwo.column, "plateNo").disabled = false
+              this.findObject(this.goodsOptionFormTwo.column, "driverId").disabled = false
+              this.findObject(this.goodsOptionFormTwo.column, "driverTel").disabled = false
+              this.findObject(this.goodsOptionFormTwo.column, "fleetVolum").disabled = false
+              this.findObject(this.goodsOptionFormTwo.column, "freightPay").disabled = true
+            }
+          }else{
+            this.findObject(this.goodsOptionFormTwo.column, "fleetId").disabled = false
+            this.findObject(this.goodsOptionFormTwo.column, "plateNo").disabled = false
+            this.findObject(this.goodsOptionFormTwo.column, "driverId").disabled = false
+            this.findObject(this.goodsOptionFormTwo.column, "driverTel").disabled = false
+            this.findObject(this.goodsOptionFormTwo.column, "fleetVolum").disabled = false
+            this.findObject(this.goodsOptionFormTwo.column, "freightPay").disabled = false
+          }
+        }
+      }
+    }
+  },
   data() {
     return {
       returnButton: Boolean,
@@ -1444,6 +1491,7 @@ export default {
           }]
         }, {
           label: '运输方式',
+          disabled: true,
           prop: 'shippingMode',
           type: 'select',
           dicUrl: "/api/blade-system/dict-biz/dictionary?code=shipping_mode",
@@ -2074,7 +2122,7 @@ export default {
               }
             })
           }
-          this.goodsOptionFormTwo.disabled = this.goodsOptionForm.disabled = this.goodsOptionFormC.disabled = this.collectionOption.disabled = this.paymentOption.disabled = this.goodsForm.status !== 0
+          this.goodsOptionFormTwo.disabled = this.goodsOptionForm.disabled = this.goodsOptionFormC.disabled = this.goodsForm.status !== 0
           delete this.goodsForm.orderAddressList
           delete this.goodsForm.itemList
           delete this.goodsForm.orderFeeList
@@ -2188,6 +2236,26 @@ export default {
     } else {
       this.initData();
     }
+    this.findObject(this.collectionOption.column, "price").change = (data) => {
+      if (data.row.price && data.row.quantity) {
+        data.row.amount = Number(data.row.price) * Number(data.row.quantity)
+      }
+    }
+    this.findObject(this.collectionOption.column, "quantity").change = (data) => {
+      if (data.row.price && data.row.quantity) {
+        data.row.amount = Number(data.row.price) * Number(data.row.quantity)
+      }
+    }
+    this.findObject(this.paymentOption.column, "price").change = (data) => {
+      if (data.row.price && data.row.quantity) {
+        data.row.amount = Number(data.row.price) * Number(data.row.quantity)
+      }
+    }
+    this.findObject(this.paymentOption.column, "quantity").change = (data) => {
+      if (data.row.price && data.row.quantity) {
+        data.row.amount = Number(data.row.price) * Number(data.row.quantity)
+      }
+    }
     this.$refs.other.show = false
   },
   methods: {
@@ -2541,7 +2609,6 @@ export default {
               this.type = true
               let form = this.goodsForm
               delete this.goodsForm.status
-              form.status = 1
               delete form.orderItemList
               saveSaveList({
                 ...form,
@@ -2581,9 +2648,20 @@ export default {
       if (this.goodsForm.status == 3) value = 6
       if (this.goodsForm.status == 6) value = 4
       if (this.goodsForm.status == 4) value = 5
-      statusBulkLoad({id: this.goodsForm.id, status:value}).then(res => {
-        this.$message.success('操作成功');
-        this.refreshData(res.data.data)
+      this.type = true
+      saveSaveList({
+        ...this.goodsForm,
+        kind: '1',
+        loadingAddressList: this.tableData,
+        unloadedAddressList: this.tableDataTwo,
+        fileList: this.orderFilesList,
+        itemList: this.entrustList,
+        orderFeeList: this.collectionList.concat(this.paymentList)
+      }).then(res => {
+        statusBulkLoad({id: this.goodsForm.id, status: value}).then(res => {
+          this.$message.success('操作成功');
+          this.refreshData(res.data.data)
+        })
       })
     },
     //提交委托
@@ -2608,6 +2686,12 @@ export default {
             if (!this.tableDataTwo[item].corpId) return this.$message.error('请选择卸货地址第' + Number(Number(item) + 1) + '行货运地点');
           }
         }
+        if (this.tableDataTwo.length === 0) {
+          return this.$message.error('请选择卸货地址')
+        }
+        if (this.tableData.length === 0) {
+          return this.$message.error('请选择卸货地址')
+        }
         this.$refs['goodsFormE'].validate((valid, doneE) => {
           doneE()
           if (valid) {
@@ -2675,6 +2759,7 @@ export default {
           currency: '1',
           type: '1',
           $cellEdit: true,
+          corpId: this.goodsForm.corpId,
           plateNo: this.goodsForm.plateNo
         });
       } else {
@@ -2688,6 +2773,7 @@ export default {
           currency: '1',
           type: '2',
           $cellEdit: true,
+          corpId: this.goodsForm.corpId,
           plateNo: this.goodsForm.plateNo
         });
       } else {
@@ -2768,40 +2854,75 @@ export default {
       row.corpName = ''
     },
     //选择地址客户带出地址
-    withAddress(row, scope) {
-      console.log(row)
-      this.$set(this.tableData[scope.$index], 'contacts', row.attn)
-      this.$set(this.tableData[scope.$index], 'tel', row.tel)
-      this.$set(this.tableData[scope.$index], 'address', row.storageAddr)
-      // this.tableData[scope.$index].contacts = row.attn
-      // this.tableData[scope.$index].tel = row.tel
-      // this.tableData[scope.$index].address = row.storageAddr
-      if (!scope.row.key) scope.row.key = 0
-      this.$set(this.tableData[scope.$index], 'corpName', row.cname)
-      // this.tableData[scope.$index].corpName = row.cname
-      if (row.belongtoarea) {
-        addressList(row.belongtoarea.split(',')[0]).then(res => {
-          this.tableData[scope.$index].region = [res.data.data.provinceCode, res.data.data.parentId, res.data.data.districtCode]
-          scope.row.key++
-        })
+    withAddress(row, scope, type) {
+      if (type) {
+        for (let item of this.corpList) {
+          if (scope.row.corpId == item.id) {
+            this.$set(this.tableData[scope.$index], 'contacts', item.attn)
+            this.$set(this.tableData[scope.$index], 'tel', item.tel)
+            this.$set(this.tableData[scope.$index], 'address', item.storageAddr)
+            if (!scope.row.key) scope.row.key = 0
+            this.$set(this.tableData[scope.$index], 'corpName', item.cname)
+            if (item.belongtoarea) {
+              addressList(item.belongtoarea.split(',')[0]).then(res => {
+                this.tableData[scope.$index].region = [res.data.data.provinceCode, res.data.data.parentId, res.data.data.districtCode]
+                scope.row.key++
+              })
+            }
+          }
+        }
+      } else {
+        this.$set(this.tableData[scope.$index], 'contacts', row.attn)
+        this.$set(this.tableData[scope.$index], 'tel', row.tel)
+        this.$set(this.tableData[scope.$index], 'address', row.storageAddr)
+        if (!scope.row.key) scope.row.key = 0
+        this.$set(this.tableData[scope.$index], 'corpName', row.cname)
+        if (row.belongtoarea) {
+          addressList(row.belongtoarea.split(',')[0]).then(res => {
+            this.tableData[scope.$index].region = [res.data.data.provinceCode, res.data.data.parentId, res.data.data.districtCode]
+            scope.row.key++
+          })
+        }
       }
     },
     //选择地址客户带出地址
-    withAddressTwo(row, scope) {
-      this.$set(this.tableDataTwo[scope.$index], 'contacts', row.attn)
-      this.$set(this.tableDataTwo[scope.$index], 'tel', row.tel)
-      this.$set(this.tableDataTwo[scope.$index], 'address', row.storageAddr)
-      // this.tableData[scope.$index].contacts = row.attn
-      // this.tableData[scope.$index].tel = row.tel
-      // this.tableData[scope.$index].address = row.storageAddr
-      if (!scope.row.key) scope.row.key = 0
-      this.$set(this.tableDataTwo[scope.$index], 'corpName', row.cname)
-      // this.tableData[scope.$index].corpName = row.cname
-      if (row.belongtoarea) {
-        addressList(row.belongtoarea.split(',')[0]).then(res => {
-          this.tableDataTwo[scope.$index].region = [res.data.data.provinceCode, res.data.data.parentId, res.data.data.districtCode]
-          scope.row.key++
-        })
+    withAddressTwo(row, scope, type) {
+      if (type) {
+        for (let item of this.corpList) {
+          if (scope.row.corpId == item.id) {
+            this.$set(this.tableDataTwo[scope.$index], 'contacts', item.attn)
+            this.$set(this.tableDataTwo[scope.$index], 'tel', item.tel)
+            this.$set(this.tableDataTwo[scope.$index], 'address', item.storageAddr)
+            // this.tableData[scope.$index].contacts = row.attn
+            // this.tableData[scope.$index].tel = row.tel
+            // this.tableData[scope.$index].address = row.storageAddr
+            if (!scope.row.key) scope.row.key = 0
+            this.$set(this.tableDataTwo[scope.$index], 'corpName', item.cname)
+            // this.tableData[scope.$index].corpName = row.cname
+            if (item.belongtoarea) {
+              addressList(item.belongtoarea.split(',')[0]).then(res => {
+                this.tableDataTwo[scope.$index].region = [res.data.data.provinceCode, res.data.data.parentId, res.data.data.districtCode]
+                scope.row.key++
+              })
+            }
+          }
+        }
+      } else {
+        this.$set(this.tableDataTwo[scope.$index], 'contacts', row.attn)
+        this.$set(this.tableDataTwo[scope.$index], 'tel', row.tel)
+        this.$set(this.tableDataTwo[scope.$index], 'address', row.storageAddr)
+        // this.tableData[scope.$index].contacts = row.attn
+        // this.tableData[scope.$index].tel = row.tel
+        // this.tableData[scope.$index].address = row.storageAddr
+        if (!scope.row.key) scope.row.key = 0
+        this.$set(this.tableDataTwo[scope.$index], 'corpName', row.cname)
+        // this.tableData[scope.$index].corpName = row.cname
+        if (row.belongtoarea) {
+          addressList(row.belongtoarea.split(',')[0]).then(res => {
+            this.tableDataTwo[scope.$index].region = [res.data.data.provinceCode, res.data.data.parentId, res.data.data.districtCode]
+            scope.row.key++
+          })
+        }
       }
     },
     //自定义表头

+ 485 - 63
src/views/landTransportation/bulkCargo/index.vue

@@ -74,7 +74,7 @@
               </div>
             </div>
             <div class="divider"/>
-            <div class="content-item" @click="handleClick('4')">
+            <div class="content-item" @click="handleClick('4,6')">
               <div class="card">
                 <div class="card-title card-title5">
                 <span>
@@ -82,8 +82,8 @@
                 </span>
                 </div>
                 <div class="card-content">
-                  <span class="card-content-num" :class="activeName === '4'?'selected':''">{{ totalData.three }}</span>
-                  <span class="card-content-text" :class="activeName === '4'?'selected':''">未完工</span>
+                  <span class="card-content-num" :class="activeName === '4,6'?'selected':''">{{ totalData.three }}</span>
+                  <span class="card-content-text" :class="activeName === '4,6'?'selected':''">未完工</span>
                 </div>
               </div>
             </div>
@@ -107,7 +107,7 @@
     </basic-container>
     <basic-container v-show="show">
       <avue-crud
-          v-if="key>0"
+          :key="key"
           :table-loading="loading"
           :page.sync="page"
           :data="dataList"
@@ -127,6 +127,9 @@
           </el-button>
           <el-button type="info" :size="size" icon="el-icon-printer">报表打印</el-button>
         </template>
+        <template slot="plateNo" slot-scope="{row}" v-if="!row.$cellEdit">
+          <span class="el-button--text" style="cursor: pointer" @click="openTrack(row)">{{ row.plateNo }}</span>
+        </template>
         <template slot="corpNameSearch" slot-scope="{ row,index}">
           <crop-select
               v-model="row.corpId"
@@ -181,6 +184,15 @@
       </avue-crud>
     </basic-container>
     <detail-page v-if="!show" @backToList="backToList" :id="id" :home="home"></detail-page>
+    <el-dialog
+        title="实时位置"
+        append-to-body
+        custom-class="dialog_two"
+        :visible.sync="dialogVisible"
+        lock-scroll
+        width="80%">
+      <div id="container"></div>
+    </el-dialog>
   </div>
 </template>
 
@@ -189,6 +201,7 @@ import detailPage from './detailPage'
 import {removeDelegationList, selectInvoiceList, totalList} from "@/api/landTransportation/bulkCargo";
 import {getQueryString} from "@/util/util";
 import {businessStatisticsFrequency} from "@/api/wel";
+import {gaude, location} from "@/api/gaude";
 
 export default {
   name: "index",
@@ -198,6 +211,11 @@ export default {
   data() {
     return {
       id: '',
+      map: null,
+      infoWindow: null,
+      marker: null,
+      dialogVisible: false,
+      lineArr: [],
       activeName: '0',
       show: true,
       query: {},
@@ -213,7 +231,9 @@ export default {
       key: 0,
       totalData: {},
       option: {},
-      optionList: {
+      optionList:{},
+      //客户
+      optionListOne: {
         align: 'center',
         stripe: true,
         index: true,
@@ -228,6 +248,17 @@ export default {
         searchIndex: 2,
         selection: true,
         highlightCurrentRow: true,
+        showSummary: true,
+        summaryText: "合计",
+        sumColumnList: [{
+            name: 'freightCollect',
+            type: 'sum',
+            decimals: 2
+          },{
+          name: 'freightPay',
+          type: 'sum',
+          decimals: 2
+        }],
         column: [
           {
             label: '货运日期',
@@ -245,7 +276,8 @@ export default {
             label: '业务员',
             index: 2,
             width: 76,
-            prop: 'salesman',
+            prop: 'salesmanName',
+            searchProp: 'salesman',
             search: true,
             overHidden: true,
             filterable: true,
@@ -257,7 +289,8 @@ export default {
             }
           }, {
             label: '物流运输',
-            prop: 'dispatchDept',
+            prop: 'dispatchDeptName',
+            searchProp: 'dispatchDept',
             search: true,
             filterable: true,
             dicUrl: "/api/blade-system/dept/top-list?deptCategory=1",
@@ -267,37 +300,39 @@ export default {
               value: "id"
             },
             overHidden: true,
-            index: 2,
+            index: 3,
             width: 94
+          },{
+            label: '运输调度',
+            prop: 'dispatcherName',
+            overHidden: true,
+            index: 4,
+            width: 100,
+          }, {
+            label: '派车单号',
+            width: 140,
+            index: 5,
+            prop: 'dispatchNumber',
+            search: true,
           }, {
             label: '装货地址',
             prop: 'addressDetail',
-            index: 3,
+            index: 6,
             width: 132,
             search: true,
           }, {
             label: '卸货地址',
             prop: 'unloadingPlace',
-            index: 3,
+            index: 7,
             width: 132,
             search: true,
           }, {
-            label: '合同号',
-            prop: 'contractNo',
-            index: 4,
-            overHidden: true,
-            width: 140,
-            search: true,
-          }, {
-            label: '派车单号',
-            width: 140,
-            prop: 'dispatchNumber',
-            search: true,
-          }, {
             label: '车队',
             width: 100,
             index: 8,
-            prop: 'fleetId',
+            overHidden: true,
+            prop: 'fleetName',
+            searchProp: 'fleetId',
             type: 'select',
             cascader: ['plateNo'],
             dicUrl: "/api/blade-client/corpsdesc/list?size=1000&current=1&&corpType=CD",
@@ -309,41 +344,192 @@ export default {
             filterable: true,
             search: true,
           }, {
-            label: '车',
+            label: '车体积',
             width: 100,
-            index: 8,
-            prop: 'plateNo',
-            type: "select",
-            dicUrl: "/api/blade-client/land-vehicle/vehicle-list?fleetId={{key}}",
+            index: 9,
+            prop: 'fleetVolum'
+          },{
+            label: '货物体积',
+            width: 100,
+            index: 10,
+            prop: 'volumeSum'
+          }, {
+            label: '运费',
+            index: 11,
+            width: 86,
+            prop: 'freightCollect'
+          }, {
+            label: '状态',
+            prop: 'status',
+            index: 12,
+            dicUrl: "/api/blade-system/dict-biz/dictionary?code=land_order_status_two",
             props: {
-              label: "plateNo",
-              value: "plateNo"
+              label: "dictValue",
+              value: "dictKey"
             },
-            filterable: true,
+            dataType: "string",
+            type: 'select',
+            overHidden: true,
             search: true,
+            width: 140
           }, {
-            label: '司机',
+            label: '公司名称',
+            prop: 'corpName',
+            overHidden: true,
+            index: 13,
+            width: 112,
+            search: true,
+          }, {
+            label: '制单人',
+            prop: 'createUserName',
+            overHidden: true,
+            index: 14,
+            width: 80,
+          }, {
+            label: '制单日期',
+            overHidden: true,
+            prop: 'createTime',
+            type: "date",
+            searchRange: true,
+            defaultTime: ['00:00:00', '23:59:59'],
+            format: "yyyy-MM-dd HH:mm",
+            valueFormat: "yyyy-MM-dd HH:mm:ss",
+            index: 15,
+            width: 135,
+            search: true,
+          },{
+            label: '订单号',
+            prop: 'orderNo',
+            index: 16,
+            overHidden: true,
             width: 100,
-            index: 8,
-            prop: 'driverId',
+            search: true,
+          }]
+      },
+      //调度
+      optionListTwo:{
+        align: 'center',
+        stripe: true,
+        index: true,
+        menu: true,
+        menuWidth: 80,
+        addBtn: false,
+        editBtn: false,
+        delBtn: false,
+        height: "auto",
+        searchSpan: 8,
+        searchIcon: true,
+        searchIndex: 2,
+        selection: true,
+        highlightCurrentRow: true,
+        showSummary: true,
+        summaryText: "合计",
+        sumColumnList: [{
+          name: 'freightCollect',
+          type: 'sum',
+          decimals: 2
+        },{
+          name: 'freightPay',
+          type: 'sum',
+          decimals: 2
+        }],
+        column: [
+          {
+            label: '货运日期',
+            prop: 'arrivalTime',
+            overHidden: true,
+            type: "date",
+            searchRange: true,
+            defaultTime: ['00:00:00', '23:59:59'],
+            format: "yyyy-MM-dd HH:mm",
+            valueFormat: "yyyy-MM-dd HH:mm:ss",
+            index: 1,
+            width: 126,
+            search: true,
+          }, {
+            label: '业务员',
+            index: 2,
+            width: 76,
+            prop: 'salesmanName',
+            searchProp: 'salesman',
+            search: true,
+            overHidden: true,
             filterable: true,
             type: "select",
-            dicUrl: "/api/blade-client/land-driver/driver-list?plateNo={{key}}",
+            dicUrl: "/api/blade-user/userList?roleAlias=业务员",
             props: {
-              label: "name",
+              label: "realName",
               value: "id"
+            }
+          },{
+            label: '运输调度',
+            prop: 'dispatcherName',
+            overHidden: true,
+            index: 3,
+            width: 100,
+          }, {
+            label: '派车单号',
+            width: 140,
+            index: 4,
+            prop: 'dispatchNumber',
+            search: true,
+          }, {
+            label: '装货地址',
+            prop: 'addressDetail',
+            index: 5,
+            width: 132,
+            search: true,
+          }, {
+            label: '卸货地址',
+            prop: 'unloadingPlace',
+            index: 6,
+            width: 132,
+            search: true,
+          }, {
+            label: '车队',
+            width: 100,
+            index: 7,
+            overHidden: true,
+            prop: 'fleetName',
+            searchProp: 'fleetId',
+            type: 'select',
+            cascader: ['plateNo'],
+            dicUrl: "/api/blade-client/corpsdesc/list?size=1000&current=1&&corpType=CD",
+            props: {
+              label: "cname",
+              value: "id",
+              res: "data.records"
             },
+            filterable: true,
             search: true,
           }, {
-            label: '运费',
+            label: '车体积',
+            width: 100,
+            index: 8,
+            prop: 'fleetVolum'
+          },{
+            label: '货物体积',
+            width: 100,
             index: 9,
+            prop: 'volumeSum'
+          }, {
+            label: '运费',
+            index: 10,
             width: 86,
-            prop: 'freight'
+            prop: 'freightCollect'
           }, {
             label: '状态',
-            prop: 'itemStatusDetail',
+            prop: 'status',
             index: 11,
+            dicUrl: "/api/blade-system/dict-biz/dictionary?code=land_order_status_two",
+            props: {
+              label: "dictValue",
+              value: "dictKey"
+            },
+            dataType: "string",
+            type: 'select',
             overHidden: true,
+            search: true,
             width: 140
           }, {
             label: '公司名称',
@@ -353,17 +539,10 @@ export default {
             width: 112,
             search: true,
           }, {
-            label: '订单号',
-            prop: 'orderNo',
-            index: 13,
-            overHidden: true,
-            width: 100,
-            search: true,
-          }, {
             label: '制单人',
             prop: 'createUserName',
             overHidden: true,
-            index: 14,
+            index: 13,
             width: 80,
           }, {
             label: '制单日期',
@@ -374,19 +553,192 @@ export default {
             defaultTime: ['00:00:00', '23:59:59'],
             format: "yyyy-MM-dd HH:mm",
             valueFormat: "yyyy-MM-dd HH:mm:ss",
-            index: 15,
+            index: 14,
             width: 135,
             search: true,
-          }, {
-            label: '到厂日期',
+          },{
+            label: '订单号',
+            prop: 'orderNo',
+            index: 15,
+            overHidden: true,
+            width: 100,
+            search: true,
+          }]
+      },
+      optionListThree:{
+        align: 'center',
+        stripe: true,
+        index: true,
+        menu: true,
+        menuWidth: 80,
+        addBtn: false,
+        editBtn: false,
+        delBtn: false,
+        height: "auto",
+        searchSpan: 8,
+        searchIcon: true,
+        searchIndex: 2,
+        selection: true,
+        highlightCurrentRow: true,
+        showSummary: true,
+        summaryText: "合计",
+        sumColumnList: [{
+          name: 'freightCollect',
+          type: 'sum',
+          decimals: 2
+        },{
+          name: 'freightPay',
+          type: 'sum',
+          decimals: 2
+        }],
+        column: [
+          {
+            label: '货运日期',
+            prop: 'arrivalTime',
             overHidden: true,
-            prop: 'reachTime',
             type: "date",
+            searchRange: true,
             defaultTime: ['00:00:00', '23:59:59'],
             format: "yyyy-MM-dd HH:mm",
             valueFormat: "yyyy-MM-dd HH:mm:ss",
+            index: 1,
+            width: 126,
+            search: true,
+          }, {
+            label: '物流运输',
+            prop: 'dispatchDeptName',
+            searchProp: 'dispatchDept',
+            search: true,
+            filterable: true,
+            dicUrl: "/api/blade-system/dept/top-list?deptCategory=1",
+            type: "select",
+            props: {
+              label: "deptName",
+              value: "id"
+            },
+            overHidden: true,
+            index: 2,
+            width: 94
+          },{
+            label: '运输调度',
+            prop: 'dispatcherName',
+            overHidden: true,
+            index: 3,
+            width: 100,
+          }, {
+            label: '派车单号',
+            width: 140,
+            index: 4,
+            prop: 'dispatchNumber',
+            search: true,
+          }, {
+            label: '装货地址',
+            prop: 'addressDetail',
+            index: 5,
+            width: 132,
+            search: true,
+          }, {
+            label: '卸货地址',
+            prop: 'unloadingPlace',
+            index: 6,
+            width: 132,
+            search: true,
+          }, {
+            label: '车队',
+            width: 100,
+            index: 7,
+            overHidden: true,
+            prop: 'fleetName',
+            searchProp: 'fleetId',
+            type: 'select',
+            cascader: ['plateNo'],
+            dicUrl: "/api/blade-client/corpsdesc/list?size=1000&current=1&&corpType=CD",
+            props: {
+              label: "cname",
+              value: "id",
+              res: "data.records"
+            },
+            filterable: true,
+            search: true,
+          }, {
+            label: '车号',
+            width: 100,
+            index: 8,
+            prop: 'plateNo',
+            type: "select",
+            cascader: ['driverId'],
+            dicUrl: "/api/blade-client/land-vehicle/vehicle-list?fleetId={{key}}",
+            props: {
+              label: "plateNo",
+              value: "plateNo"
+            },
+            filterable: true,
+            search: true,
+          }, {
+            label: '司机',
+            width: 100,
+            index: 9,
+            prop: 'driverName',
+            searchProp: 'driverId',
+            filterable: true,
+            type: "select",
+            dicUrl: "/api/blade-client/land-driver/driver-list?plateNo={{key}}",
+            props: {
+              label: "name",
+              value: "id"
+            },
+            search: true,
+          }, {
+            label: '电话',
+            width: 160,
+            index: 10,
+            prop: 'tel'
+          }, {
+            label: '车体积',
+            width: 100,
+            index: 11,
+            prop: 'fleetVolum'
+          },{
+            label: '货物体积',
+            width: 100,
+            index: 12,
+            prop: 'volumeSum'
+          },
+          // {
+          //   label: '状态',
+          //   prop: 'status',
+          //   index: 13,
+          //   dicUrl: "/api/blade-system/dict-biz/dictionary?code=land_order_status_two",
+          //   props: {
+          //     label: "dictValue",
+          //     value: "dictKey"
+          //   },
+          //   dataType: "string",
+          //   type: 'select',
+          //   overHidden: true,
+          //   search: true,
+          //   width: 140
+          // },
+          {
+            label: '应付运费',
+            prop: 'freightPay',
+            overHidden: true,
+            width: 100,
+            index: 13,
+          },{
+            label: '备注',
+            index: 14,
+            overHidden: true,
+            width: 140,
+            prop: 'remarks',
+          },
+          {
+            label: '订单号',
+            prop: 'orderNo',
             index: 15,
-            width: 135,
+            overHidden: true,
+            width: 100,
+            search: true,
           }]
       },
       home: false,
@@ -403,6 +755,18 @@ export default {
     }
   },
   async created() {
+    // this.option = this.optionListOne
+    // this.option = this.optionListTwo
+    this.option = this.optionListThree
+    if (this.roleName.indexOf('客户') !== -1){
+      this.optionList = this.optionListOne
+    }else if (this.roleName.indexOf('平台') !== -1){
+      this.optionList = this.optionListTwo
+    }else if (this.roleName.indexOf('车队') !== -1){
+      this.optionList = this.optionListThree
+    }else {
+      this.optionList = this.optionListOne
+    }
     this.option = await this.getColumnData(this.getColumnName(85.7), this.optionList);
     this.key++
     let i = 0;
@@ -413,15 +777,6 @@ export default {
       this.option.menu = false
       this.option.header = false
     }
-    if (!(this.roleName.indexOf('客户') !== -1)) {
-      this.option.column.push({
-        label: '运输调度',
-        prop: 'dispatcherName',
-        overHidden: true,
-        index: 2,
-        width: 100,
-      })
-    }
     if (i % 3 !== 0) {
       const num = 3 - Number(i % 3)
       this.option.searchMenuSpan = num * 8;
@@ -441,9 +796,61 @@ export default {
     })
   },
   beforeDestroy() {
+    this.map && this.map.destroy();
     clearInterval(this.entrustTimer); //关闭
   },
   methods: {
+    openTrack(row) {
+      location({itemId: row.itemId, plateNo: row.plateNo, tenantId: '234557', color: '2'}).then(res => {
+        this.dialogVisible = true
+        let this_ = this
+        setTimeout(function () {
+          this_.initMap(res.data.data, row.plateNo);
+        }, 1000)
+      })
+    },
+    markerClick(e) {
+      this.infoWindow.setContent(e.target.content);
+      this.infoWindow.open(this.map, e.target.getPosition());
+    },
+    initMap(data, plateNo) {
+      console.log(data,plateNo)
+      this.map = new AMap.Map("container", {resizeEnable: true});
+      this.infoWindow = new AMap.InfoWindow({
+        ffset: new AMap.Pixel(0, -30),
+        offset: new AMap.Pixel(0, -30)
+      });
+      let icon = new AMap.Icon({
+        size: new AMap.Size(52, 26), // 图标尺寸
+        image: 'https://trade.tubaosoft.com/file/bladex/000000/1123598821738675201/che.png',
+        imageSize: new AMap.Size(52, 26), // 根据所设置的大小拉伸或压缩图片
+      });
+      this.marker = new AMap.Marker({
+        position: data.location,
+        map: this.map,
+        icon: icon,
+        markerMeta: new AMap.Size(28, 28),
+        offset: new AMap.Pixel(-26, -15),
+        autoRotation: true,
+        angle: -15
+      });
+      this.marker.content = '<div style="width: 300px;">'
+          + '<p style="font-size: 22px;font-weight: bold;background-color: #2d8cf0;color: #fff;">' + plateNo + '</p>'
+          + '<p style="padding: 5px 0"><span style="color: #a0a0a0">最后上报时间:</span>' + new Date(Number(data.time) + 8 * 60 * 60 * 1000).toJSON().split('T').join(' ').substr(0, 19) + '</p>'
+          + '<div style="width: 150px;float: left;">'
+          + '<p style="padding: 5px 0"><span style="color: #a0a0a0">车辆状态:</span>' + (data.speed > 0 ? '行驶中' : '停车') + '</p>'
+          + '</div>'
+          + '<div style="width: 150px;float: right;">'
+          + '<p style="padding: 5px 0"><span style="color: #a0a0a0">速度:</span>' + data.speed + 'km/h</p>'
+          + '</div>'
+          + '<p><span style="color: #a0a0a0">当前位置:</span>' + data.address + '</p>'
+          + '<p style="padding: 5px 0"><span style="color: #a0a0a0">经纬度:</span>' + data.location.join(',') + '</p>'
+          + '</div>'
+      this.infoWindow.open(this.map, this.map.getCenter());
+      this.marker.on('click', this.markerClick);
+      this.marker.emit('click', {target: this.marker});
+      this.map.setFitView();
+    },
     selectionChange(list) {
       this.selectionList = list
       // this.$message.success('选中的数据'+ JSON.stringify(list));
@@ -496,8 +903,8 @@ export default {
       let queryParams = {
         size: page.pageSize,
         current: page.currentPage,
-        itemStatus: this.activeName,
-        status: this.activeName,
+        // itemStatus: this.activeName,
+        statusIds: this.activeName,
         ...Object.assign(params, this.query)
       }
       this.loading = true;
@@ -723,4 +1130,19 @@ export default {
     }
   }
 }
+#container {
+  height: 80vh;
+  width: 100%;
+}
+::v-deep .el-dialog {
+  margin-top: 5vh !important;
+  margin-bottom: 0 !important;
+}
+::v-deep .amap-info-close {
+  right: 10px !important;
+  top: 12px !important;
+}
+::v-deep .amap-info-content {
+  padding: 5px 5px 5px 5px !important;
+}
 </style>

+ 4 - 2
src/views/wel/home/landTransportation/components/sales-trend.vue

@@ -7,7 +7,7 @@
                      @resetColumn="resetColumn"
                      @saveColumn="saveColumn">
             <template slot="menuLeft">
-              <span>今日业务详情(集装箱)</span>
+              <span>今日业务详情{{mold == 1?'(集装箱)':mold == 2?'(散货)':mold == 3?'(特种)':''}}</span>
             </template>
             <template slot="billNo" slot-scope="{row}">
                 <span class="el-button--text" style="cursor: pointer"
@@ -64,6 +64,7 @@ export default {
       roleName: localStorage.getItem("roleName").split(','),
       dialogVisible: false,
       loading: false,
+      mold:0,
       tableData: [],
       map: null,
       infoWindow: null,
@@ -515,7 +516,8 @@ export default {
     query(data) {
       this.getsalesTrend(data)
     },
-    getsalesTrend(data = {status: 0, mold: 0}) {
+    getsalesTrend(data = {status: 0, mold: 1}) {
+      this.mold = data.mold
       this.loading = true;
       active(data).then(res => {
         this.tableData = res.data.data