浏览代码

Merge branch 'master' of http://47.100.3.209:3000/gdc/yiliangyiyun-pc

ccj 2 年之前
父节点
当前提交
34739c6f2e

+ 3 - 1
src/api/V2/transport/index.js

@@ -66,4 +66,6 @@ export const API_GET_CARNUMBER= '/driverCarInfo/selectAllCarNumber'
 // 通过车牌号查找司机
 export const API_GET_DRIVERINFO='/driverViewInfo/selectDriverViewList'
 // 发起人撤回
-export const API_SPONSOR_WITHDRAW ='/newWorkflow/api/stopInstance'
+export const API_SPONSOR_WITHDRAW ='/newWorkflow/api/stopInstance'
+// 历史司机车队数据
+export const API_GET_HISTORICALCARS ='/tranProcessInfo/selectHistoricalCars'

+ 6 - 3
src/model/transport/index.js

@@ -36,7 +36,8 @@ import {
     API_POST_AUTOMOBILE_TRANPRICE_CAR,
     API_GET_CARNUMBER,
     API_GET_DRIVERINFO,
-    API_SPONSOR_WITHDRAW
+    API_SPONSOR_WITHDRAW,
+    API_GET_HISTORICALCARS
 } from '@/api/V2/transport'
 // 司机列表
 export const selectDriver = appRx.get(API_GET_TRAN_DRIVERINFO, errorCatcher, errorHandle, filter)
@@ -104,5 +105,7 @@ export const importApplFileUrl = appRx.get(API_GET_IMPORT, errorCatcher, errorHa
 export const getcarNumber = appRx.get(API_GET_CARNUMBER, errorCatcher, errorHandle, filter)
 // 根据车牌号查找司机
 export const getdriverinfo = appRx.get(API_GET_DRIVERINFO, errorCatcher, errorHandle, filter)
-	// 发起人撤回
-    export const sponsorWithdraw = appRx.post(API_SPONSOR_WITHDRAW, errorCatcher, errorHandle, filter)
+// 发起人撤回
+export const sponsorWithdraw = appRx.post(API_SPONSOR_WITHDRAW, errorCatcher, errorHandle, filter)
+// 历史司机车队
+export const gethistorycars = appRx.get(API_GET_HISTORICALCARS, errorCatcher, errorHandle, filter)

+ 16 - 0
src/views/tranManagement/component/routers/route.js

@@ -206,6 +206,22 @@ const tranManagementRouter = {
       },
       hidden: true
     },
+    //汽车调度历史
+    {
+      path: 'vehicleDispatching/historycar',
+      component: () =>
+        import(/* webpackChunkName: "applDetail" */ '@/views/tranManagement/tranManagementVehicleDispatchinghistory'),
+      name: 'vehicleDispatchinghistorycar',
+      meta: {
+        title: 'tranManagementVehicleDispatching',
+        shortcutEntrance: 'transportationTask',
+        module: 'tranManager.vehicleDispatching.car',
+        permissicon: [],
+        keepAlive: true,
+        _title:'汽车调度'
+      },
+      hidden: true
+    },
     //查看派车详情
     {
       path: 'vehicleDispatching/view',

+ 110 - 79
src/views/tranManagement/tranManagementVehicleDispatching.vue

@@ -6,6 +6,8 @@
         <h2 class="bg-left title">汽车调度</h2>
       </el-col>
       <el-col :span="4" class="bg-right">
+        <el-button class="bg-bottom" type="primary" size="small" @click="history()">历史司机车队
+        </el-button>
         <el-button class="bg-bottom" type="primary" size="small" @click="revert()"><img width="6" height="10"
             style="vertical-align: bottom; margin-right: 3px" src="../../../public/img/lujing.png" alt="" />返回
         </el-button>
@@ -355,12 +357,14 @@
     },
     computed: {
       total: function() {
-        if (this.deptBudgetList.tranCarInfoList.length > 0) {
+        
+        if (this.deptBudgetList.tranCarInfoList1&&this.deptBudgetList.tranCarInfoList1.length > 0&&this.deptBudgetList.tranCarInfoList&&this.deptBudgetList.tranCarInfoList.length > 0) {
+          var arr=this.deptBudgetList.tranCarInfoList.concat(this.deptBudgetList.tranCarInfoList1)
           var maxStorage = 0
-          for (var i = 0; i < this.deptBudgetList.tranCarInfoList.length; i++) {
-            if(this.deptBudgetList.tranCarInfoList[i].loadWeight){
+          for (var i = 0; i < arr.length; i++) {
+            if(arr[i].loadWeight){
               maxStorage += Number(
-                this.deptBudgetList.tranCarInfoList[i].loadWeight
+                arr[i].loadWeight
               )
             }
             
@@ -369,24 +373,24 @@
         }
       },
       teamlist: function() {
-        if (this.deptBudgetList.tranCarInfoList.length > 0) {
+        if (this.deptBudgetList.tranCarInfoList1&&this.deptBudgetList.tranCarInfoList1.length > 0) {
           var arr = []
-          for (var i = 0; i < this.deptBudgetList.tranCarInfoList.length; i++) {
-            if(this.deptBudgetList.tranCarInfoList[i].fleetFlag==1){
-              this.deptBudgetList.tranCarInfoList[i].tranCarIndex=i
-              arr.push(this.deptBudgetList.tranCarInfoList[i])
+          for (var i = 0; i < this.deptBudgetList.tranCarInfoList1.length; i++) {
+            if(this.deptBudgetList.tranCarInfoList1[i].fleetFlag==1){
+              this.deptBudgetList.tranCarInfoList1[i].tranCarIndex=i
+              arr.push(this.deptBudgetList.tranCarInfoList1[i])
             }
           }
           return arr
         }
       },
       driverlist: function() {
-        if (this.deptBudgetList.tranCarInfoList.length > 0) {
+        if (this.deptBudgetList.tranCarInfoList1&&this.deptBudgetList.tranCarInfoList1.length > 0) {
           var arr = []
-          for (var i = 0; i < this.deptBudgetList.tranCarInfoList.length; i++) {
-            if(this.deptBudgetList.tranCarInfoList[i].fleetFlag==0){
-              this.deptBudgetList.tranCarInfoList[i].tranCarIndex=i
-              arr.push(this.deptBudgetList.tranCarInfoList[i])
+          for (var i = 0; i < this.deptBudgetList.tranCarInfoList1.length; i++) {
+            if(this.deptBudgetList.tranCarInfoList1[i].fleetFlag==0){
+              this.deptBudgetList.tranCarInfoList1[i].tranCarIndex=i
+              arr.push(this.deptBudgetList.tranCarInfoList1[i])
             }
           }
           return arr
@@ -394,6 +398,11 @@
       },
     },
     methods: {
+      history(){
+        this.$router.push({name:'vehicleDispatchinghistorycar',query: {
+            id: this.$route.query.id,
+          },})
+      },
       withdraw() {
       this.$confirm(`撤回成功后,可再次提交,确定撤回该单价吗?`, {
         cancelButtonText: '取消',
@@ -413,14 +422,14 @@
       pricetypechange(e){
         console.log(e)
         this.deptBudgetList.billingMethod=e
-        if (this.deptBudgetList.tranCarInfoList.length > 0) {
-          for (var i = 0; i < this.deptBudgetList.tranCarInfoList.length; i++) {
-           if(!this.deptBudgetList.tranCarInfoList[i].id){
-             this.deptBudgetList.tranCarInfoList[i].billingMethod=e
+        if (this.deptBudgetList.tranCarInfoList1.length > 0) {
+          for (var i = 0; i < this.deptBudgetList.tranCarInfoList1.length; i++) {
+           if(!this.deptBudgetList.tranCarInfoList1[i].id){
+             this.deptBudgetList.tranCarInfoList1[i].billingMethod=e
              if(e==1){
-               this.deptBudgetList.tranCarInfoList[i].tranPrice=this.deptBudgetList.tranPrice
+               this.deptBudgetList.tranCarInfoList1[i].tranPrice=this.deptBudgetList.tranPrice
              }else{
-               this.deptBudgetList.tranCarInfoList[i].tranPrice=this.deptBudgetList.tranPriceCar
+               this.deptBudgetList.tranCarInfoList1[i].tranPrice=this.deptBudgetList.tranPriceCar
              }
            }
           }
@@ -441,27 +450,27 @@
       del(index, row,status) {
         if (row.status == null) {
           if(status==1){
-            if (this.deptBudgetList.tranCarInfoList.length > 1) {
-              for (let i = 0; i < this.deptBudgetList.tranCarInfoList.length; i++) {
-                console.log(this.deptBudgetList.tranCarInfoList[i])
-                if(this.deptBudgetList.tranCarInfoList[i].index){
-                  if(this.deptBudgetList.tranCarInfoList[i].index==row.index){
-                    this.deptBudgetList.tranCarInfoList.splice(i, 1)
+            if (this.deptBudgetList.tranCarInfoList1.length > 1) {
+              for (let i = 0; i < this.deptBudgetList.tranCarInfoList1.length; i++) {
+                console.log(this.deptBudgetList.tranCarInfoList1[i])
+                if(this.deptBudgetList.tranCarInfoList1[i].index){
+                  if(this.deptBudgetList.tranCarInfoList1[i].index==row.index){
+                    this.deptBudgetList.tranCarInfoList1.splice(i, 1)
                   }
                 }
               }
             }
           }else{
-            if (this.deptBudgetList.tranCarInfoList.length > 1) {
-              this.deptBudgetList.tranCarInfoList.splice(index, 1)
-              for (let i = index; i < this.deptBudgetList.tranCarInfoList.length; i++) {
-                let number = Number(this.deptBudgetList.tranCarInfoList[i].tranCarNo.split('C')[1]) - 1
+            if (this.deptBudgetList.tranCarInfoList1.length > 1) {
+              this.deptBudgetList.tranCarInfoList1.splice(index, 1)
+              for (let i = index; i < this.deptBudgetList.tranCarInfoList1.length; i++) {
+                let number = Number(this.deptBudgetList.tranCarInfoList1[i].tranCarNo.split('C')[1]) - 1
                 if (number < 10) {
-                  this.deptBudgetList.tranCarInfoList[i].tranCarNo = 'C00' + number
+                  this.deptBudgetList.tranCarInfoList1[i].tranCarNo = 'C00' + number
                 } else if (number < 100) {
-                  this.deptBudgetList.tranCarInfoList[i].tranCarNo = 'C0' + number
+                  this.deptBudgetList.tranCarInfoList1[i].tranCarNo = 'C0' + number
                 } else {
-                  this.deptBudgetList.tranCarInfoList[i].tranCarNo = 'C' + number
+                  this.deptBudgetList.tranCarInfoList1[i].tranCarNo = 'C' + number
                 }
               }
             }
@@ -479,8 +488,8 @@
               .toPromise()
               .then((response) => {
                 this.$message.success('删除成功')
-                if (this.deptBudgetList.tranCarInfoList.length > 1) {
-                  this.deptBudgetList.tranCarInfoList.splice(index, 1)
+                if (this.deptBudgetList.tranCarInfoList1.length > 1) {
+                  this.deptBudgetList.tranCarInfoList1.splice(index, 1)
                 }
                 this.getList()
               })
@@ -495,10 +504,10 @@
               type: 'warning',
             })
           } else {
-              this.deptBudgetList.tranCarInfoList.push({
+              this.deptBudgetList.tranCarInfoList1.push({
                 fleetName:'',
                 fleetFlag:1,
-                index:this.deptBudgetList.tranCarInfoList.length,
+                index:this.deptBudgetList.tranCarInfoList1.length,
                 billingMethod:this.pricetype,
                 tranPrice:this.deptBudgetList.tranPrice,
                 tranType: '1',
@@ -511,10 +520,10 @@
               type: 'warning',
             })
           } else {
-              this.deptBudgetList.tranCarInfoList.push({
+              this.deptBudgetList.tranCarInfoList1.push({
                 fleetName:'',
                 fleetFlag:1,
-                index:this.deptBudgetList.tranCarInfoList.length,
+                index:this.deptBudgetList.tranCarInfoList1.length,
                 billingMethod:this.pricetype,
                 tranPrice:this.deptBudgetList.tranPriceCar,
                 tranType: '1',
@@ -533,8 +542,9 @@
           } else {
             var tmp1 = 'C00'
             this.deptBudgetList.count++
-            if (this.deptBudgetList.tranCarInfoList.length < 10) {
-              this.deptBudgetList.tranCarInfoList.push({
+            if (this.deptBudgetList.tranCarInfoList1.length < 10) {
+              console.log()
+              this.deptBudgetList.tranCarInfoList1.push({
                 driverName: '',
                 driverPhone: '',
                 carLength: 0,
@@ -549,14 +559,14 @@
                 tranPriceCar:this.deptBudgetList.tranPriceCar,
                 billingMethod:this.pricetype,
                 // tranCarNo: tmp1+(this.deptBudgetList.count),
-                tranCarNo: 'C00' + (this.deptBudgetList.tranCarInfoList.length + 1),
+                tranCarNo: 'C00' + (this.deptBudgetList.tranCarInfoList.length+this.deptBudgetList.tranCarInfoList1.length+1),
                 tranPrice: this.deptBudgetList.tranPrice
               })
-            } else if (this.deptBudgetList.tranCarInfoList.length < 100 && this.deptBudgetList.tranCarInfoList.length >=
+            } else if (this.deptBudgetList.tranCarInfoList1.length < 100 && this.deptBudgetList.tranCarInfoList1.length >=
               10) {
               tmp1 = 'C0'
               this.deptBudgetList.count++
-              this.deptBudgetList.tranCarInfoList.push({
+              this.deptBudgetList.tranCarInfoList1.push({
                 driverName: '',
                 driverPhone: '',
                 carLength: 0,
@@ -571,10 +581,10 @@
                 tranPriceCar:this.deptBudgetList.tranPriceCar,
                 billingMethod:this.pricetype,
                 // tranCarNo: tmp1+(this.deptBudgetList.count),
-                tranCarNo: 'C0' + (this.deptBudgetList.tranCarInfoList.length + 1),
+                tranCarNo: 'C0' + (this.deptBudgetList.tranCarInfoList.length+this.deptBudgetList.tranCarInfoList1.length+1),
                 tranPrice: this.deptBudgetList.tranPrice
               })
-            } else if (this.deptBudgetList.tranCarInfoList.length < 1000 && this.deptBudgetList.tranCarInfoList.length >=
+            } else if (this.deptBudgetList.tranCarInfoList1.length < 1000 && this.deptBudgetList.tranCarInfoList1.length >=
               100) {
               tmp1 = 'C'
               this.deptBudgetList.count++
@@ -593,7 +603,7 @@
                 billingMethod:this.pricetype,
                 tranPriceCar:this.deptBudgetList.tranPriceCar,
                 // tranCarNo: tmp1+(this.deptBudgetList.count),
-                tranCarNo: 'C' + (this.deptBudgetList.tranCarInfoList.length + 1),
+                tranCarNo: 'C' + (this.deptBudgetList.tranCarInfoList.length+this.deptBudgetList.tranCarInfoList1.length+1),
                 tranPrice: this.deptBudgetList.tranPrice
               })
             }
@@ -623,7 +633,7 @@
                 tranPriceCar:this.deptBudgetList.tranPriceCar,
                 billingMethod:this.pricetype,
                 // tranCarNo: tmp1+(this.deptBudgetList.count),
-                tranCarNo: 'C00' + (this.deptBudgetList.tranCarInfoList.length + 1),
+                tranCarNo: 'C00' + (this.deptBudgetList.tranCarInfoList.length+this.deptBudgetList.tranCarInfoList1.length+1),
                 tranPrice: this.deptBudgetList.tranPrice
               })
             } else if (this.deptBudgetList.tranCarInfoList.length < 100 && this.deptBudgetList.tranCarInfoList.length >=
@@ -645,7 +655,7 @@
                 tranPriceCar:this.deptBudgetList.tranPriceCar,
                 billingMethod:this.pricetype,
                 // tranCarNo: tmp1+(this.deptBudgetList.count),
-                tranCarNo: 'C0' + (this.deptBudgetList.tranCarInfoList.length + 1),
+                tranCarNo: 'C0' + (this.deptBudgetList.tranCarInfoList.length+this.deptBudgetList.tranCarInfoList1.length+1),
                 tranPrice: this.deptBudgetList.tranPrice
               })
             } else if (this.deptBudgetList.tranCarInfoList.length < 1000 && this.deptBudgetList.tranCarInfoList.length >=
@@ -667,7 +677,7 @@
                 billingMethod:this.pricetype,
                 tranPriceCar:this.deptBudgetList.tranPriceCar,
                 // tranCarNo: tmp1+(this.deptBudgetList.count),
-                tranCarNo: 'C' + (this.deptBudgetList.tranCarInfoList.length + 1),
+                tranCarNo: 'C' + (this.deptBudgetList.tranCarInfoList.length+this.deptBudgetList.tranCarInfoList1.length+1),
                 tranPrice: this.deptBudgetList.tranPrice
               })
             }
@@ -781,22 +791,22 @@
           })
           return
         } else {
-          for (var i = this.index; i < this.deptBudgetList.tranCarInfoList.length; i++) {
-            if (!this.deptBudgetList.tranCarInfoList[i].driver&&this.deptBudgetList.tranCarInfoList[i].fleetFlag==0) {
+          for (var i = this.index; i < this.deptBudgetList.tranCarInfoList1.length; i++) {
+            if (!this.deptBudgetList.tranCarInfoList1[i].driver&&this.deptBudgetList.tranCarInfoList1[i].fleetFlag==0) {
               this.$message({
                 message: '姓名不能为空!',
                 type: 'warning',
               })
               return
             }
-            if (!this.deptBudgetList.tranCarInfoList[i].fleetName&&this.deptBudgetList.tranCarInfoList[i].fleetFlag==1) {
+            if (!this.deptBudgetList.tranCarInfoList1[i].fleetName&&this.deptBudgetList.tranCarInfoList1[i].fleetFlag==1) {
               this.$message({
                 message: '车队名称不能为空!',
                 type: 'warning',
               })
               return
             }
-            if (this.deptBudgetList.tranCarInfoList[i].fleetName&&this.deptBudgetList.tranCarInfoList[i].fleetName.length<1&&this.deptBudgetList.tranCarInfoList[i].fleetFlag==1||this.deptBudgetList.tranCarInfoList[i].fleetName&&this.deptBudgetList.tranCarInfoList[i].fleetName.length>10&&this.deptBudgetList.tranCarInfoList[i].fleetFlag==1) {
+            if (this.deptBudgetList.tranCarInfoList1[i].fleetName&&this.deptBudgetList.tranCarInfoList1[i].fleetName.length<1&&this.deptBudgetList.tranCarInfoList1[i].fleetFlag==1||this.deptBudgetList.tranCarInfoList1[i].fleetName&&this.deptBudgetList.tranCarInfoList1[i].fleetName.length>10&&this.deptBudgetList.tranCarInfoList1[i].fleetFlag==1) {
               this.$message({
                 message: '车队名称1-10个字!',
                 type: 'warning',
@@ -804,7 +814,7 @@
               return
             }
             for (var j = 0; j < this.carList.length; j++) {
-              if (this.carList[j].driverName == this.deptBudgetList.tranCarInfoList[i].driver && this.carList[j]
+              if (this.carList[j].driverName == this.deptBudgetList.tranCarInfoList1[i].driver && this.carList[j]
                 .disableStatusFlag == 1) {
                 this.$message({
                   message: this.deptBudgetList.tranCarInfoList[i].driver + '该司机已被禁用!',
@@ -828,7 +838,7 @@
                   tranCarInfo.tranPrice = this.deptBudgetList.tranPrice
                   tranCarInfo.infoId = this.deptBudgetList.infoId
                   tranCarInfo.billingMethod=this.pricetype
-                  tranCarInfo.tranCarInfoList = this.deptBudgetList.tranCarInfoList
+                  tranCarInfo.tranCarInfoList = this.deptBudgetList.tranCarInfoList.concat(this.deptBudgetList.tranCarInfoList1)
                   dispatchCat(tranCarInfo)
                     .toPromise()
                     .then((response) => {
@@ -876,6 +886,27 @@
             if (this.deptBudgetList.tranPriceIng == 0) {
               this.deptBudgetList.tranPriceIng = ''
             }
+            var carno='0000'
+            if (this.deptBudgetList.tranCarInfoList) {
+              var len=carno+Number(this.deptBudgetList.tranCarInfoList.length+1)
+              carno='C'+(len.substring(len.length-3))
+            }
+            this.deptBudgetList.tranCarInfoList1 = [{
+                driverName: '',
+                driverPhone: '',
+                carLength: 0,
+                carLengthKey: '',
+                loadWeight: null,
+                carModel: '',
+                carModelKey: '',
+                carNumber: '',
+                disabled: false,
+                fleetFlag:0,
+                tranType: '1',
+                tranCarNo: carno,
+                billingMethod:1,
+                tranPrice: this.deptBudgetList.tranPrice
+              }, ]
             if (this.deptBudgetList.tranCarInfoList.length == 0) {
               this.deptBudgetList.tranCarInfoList = [{
                 driverName: '',
@@ -914,29 +945,29 @@
       carchange(val, index) {
         for (var i = 0; i < this.carList.length; i++) {
           if (this.carList[i].driverName == val) {
-            this.deptBudgetList.tranCarInfoList[index].driverPhone =
+            this.deptBudgetList.tranCarInfoList1[index].driverPhone =
               this.carList[i].driverPhone
             arrange({
                 id: this.carList[i].id
               })
               .toPromise()
               .then((response) => {
-                console.log(index,this.deptBudgetList.tranCarInfoList)
-                this.deptBudgetList.tranCarInfoList[index].carNo =
+                console.log(index,this.deptBudgetList.tranCarInfoList1)
+                this.deptBudgetList.tranCarInfoList1[index].carNo =
                   response.carNumber
                 if (response.carLoad != null) {
-                  this.deptBudgetList.tranCarInfoList[index].loadWeight =
+                  this.deptBudgetList.tranCarInfoList1[index].loadWeight =
                     response.carLoad
                 } else {
-                  this.deptBudgetList.tranCarInfoList[index].loadWeight = 0
+                  this.deptBudgetList.tranCarInfoList1[index].loadWeight = 0
                 }
-                this.deptBudgetList.tranCarInfoList[index].carModel =
+                this.deptBudgetList.tranCarInfoList1[index].carModel =
                   response.carModel
-                this.deptBudgetList.tranCarInfoList[index].carLength =
+                this.deptBudgetList.tranCarInfoList1[index].carLength =
                   response.carLength
-                this.deptBudgetList.tranCarInfoList[index].carLengthKey =
+                this.deptBudgetList.tranCarInfoList1[index].carLengthKey =
                   response.carLengthKey
-                this.deptBudgetList.tranCarInfoList[index].carModelKey =
+                this.deptBudgetList.tranCarInfoList1[index].carModelKey =
                   response.carModelKey
                   this.$forceUpdate()
               })
@@ -951,18 +982,18 @@
           if (this.carNoList[i].carNumber == val) {
             console.log(this.carNoList[i])
             if (this.carNoList[i].carLoad != null) {
-                  this.deptBudgetList.tranCarInfoList[index].loadWeight =
+                  this.deptBudgetList.tranCarInfoList1[index].loadWeight =
                   this.carNoList[i].carLoad
                 } else {
-                  this.deptBudgetList.tranCarInfoList[index].loadWeight = 0
+                  this.deptBudgetList.tranCarInfoList1[index].loadWeight = 0
                 }
-                this.deptBudgetList.tranCarInfoList[index].carModel =
+                this.deptBudgetList.tranCarInfoList1[index].carModel =
                 this.carNoList[i].carModel
-                this.deptBudgetList.tranCarInfoList[index].carLength =
+                this.deptBudgetList.tranCarInfoList1[index].carLength =
                 this.carNoList[i].carLength
-                this.deptBudgetList.tranCarInfoList[index].carLengthKey =
+                this.deptBudgetList.tranCarInfoList1[index].carLengthKey =
                 this.carNoList[i].carLengthKey
-                this.deptBudgetList.tranCarInfoList[index].carModelKey =
+                this.deptBudgetList.tranCarInfoList1[index].carModelKey =
                 this.carNoList[i].carModelKey
             getdriverinfo({
               carNumber: this.carNoList[i].carNumber
@@ -978,7 +1009,7 @@
       phonechange(val, index) {
         for (var i = 0; i < this.carList.length; i++) {
           if (this.carList[i].driverPhone == val) {
-            this.deptBudgetList.tranCarInfoList[index].driver =
+            this.deptBudgetList.tranCarInfoList1[index].driver =
               this.carList[i].driverName
             arrange({
                 id: this.carList[i].id
@@ -986,21 +1017,21 @@
               .toPromise()
               .then((response) => {
                 console.log(this, response)
-                this.deptBudgetList.tranCarInfoList[index].carNo =
+                this.deptBudgetList.tranCarInfoList1[index].carNo =
                   response.carNumber
                 if (response.carLoad != null) {
-                  this.deptBudgetList.tranCarInfoList[index].loadWeight =
+                  this.deptBudgetList.tranCarInfoList1[index].loadWeight =
                     response.carLoad
                 } else {
-                  this.deptBudgetList.tranCarInfoList[index].loadWeight = 0
+                  this.deptBudgetList.tranCarInfoList1[index].loadWeight = 0
                 }
-                this.deptBudgetList.tranCarInfoList[index].carModel =
+                this.deptBudgetList.tranCarInfoList1[index].carModel =
                   response.carModel
-                this.deptBudgetList.tranCarInfoList[index].carLength =
+                this.deptBudgetList.tranCarInfoList1[index].carLength =
                   response.carLength
-                this.deptBudgetList.tranCarInfoList[index].carLengthKey =
+                this.deptBudgetList.tranCarInfoList1[index].carLengthKey =
                   response.carLengthKey
-                this.deptBudgetList.tranCarInfoList[index].carModelKey =
+                this.deptBudgetList.tranCarInfoList1[index].carModelKey =
                   response.carModelKey
               })
           }

+ 632 - 0
src/views/tranManagement/tranManagementVehicleDispatchinghistory.vue

@@ -0,0 +1,632 @@
+// 汽车调度派车
+<template>
+  <div class="container">
+    <el-row>
+      <el-col :span="20">
+        <h2 class="bg-left title">汽车调度历史</h2>
+      </el-col>
+      <el-col :span="4" class="bg-right">
+       
+        <el-button class="bg-bottom" type="primary" size="small" @click="revert()"><img width="6" height="10"
+            style="vertical-align: bottom; margin-right: 3px" src="../../../public/img/lujing.png" alt="" />返回
+        </el-button>
+      </el-col>
+    </el-row>
+    <div class="center">
+      <el-form ref="deptBudgetList"  label-width="110px">
+        <div class="basicInformation">
+          <div class="content3" v-for="(item, index) in driverlist" :key="item.id">
+            <div class="content3-item1">
+              <div>
+                <span style="margin-left: 30px;font-weight: 600;">司机-{{ index + 1 }}</span>
+                <span class="noservice" v-show="item.status == '未装车'">{{
+                     item.status
+                   }}</span>
+                <span class="service" v-show="item.status == '已装车'">{{
+                     item.status
+                   }}</span>
+                <span class="serviced" v-show="item.status == '已送达'">{{
+                     item.status
+                   }}</span>
+              </div>
+              <el-col :span="8">
+
+                <el-form-item label="姓名:" span="1" prop="driverName" label-width="125px">
+                  <el-select ref="driverSelect" v-show="!item.temporaryDriverFlag" @visible-change="clearBlur"
+                    v-model="item.driver" filterable clearable placeholder="请选择司机" class="row-item" @change="
+                             (val) => {
+                               carchange(val, item.tranCarIndex)
+                             }
+                           ">
+                    <el-option v-for="(items) in carList" :key="items.id" :label="items.driverName"
+                      :value="items.driverName" />
+                  </el-select>
+                  <span v-show="
+                             item.temporaryDriverFlag == 0 ||
+                             item.temporaryDriverFlag == 1
+                           ">{{ item.driver }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="司机电话:" span="1" prop="impurity" label-width="125px">
+                  <el-select v-show="!item.temporaryDriverFlag" v-model="item.driverPhone" placeholder="请选择司机电话"
+                    filterable clearable class="row-item" @change="
+                               (val) => {
+                                 phonechange(val, item.tranCarIndex)
+                               }
+                             ">
+                    <el-option v-for="(items) in carList" :key="items.id" :label="items.driverPhone"
+                      :value="items.driverPhone" />
+                  </el-select>
+                  <span v-show="
+                               item.temporaryDriverFlag == 0 ||
+                               item.temporaryDriverFlag == 1
+                             ">{{ item.driverPhone }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="车牌号:" span="1" prop="carNo" label-width="125px">
+                  <el-select v-if="!item.id" v-model="item.carNo" placeholder="请选择车牌号"
+                    filterable clearable @clear="clear" class="row-item" @change="
+                               (val) => {
+                                 carNochange(val, item.tranCarIndex)
+                               }
+                             ">
+                    <el-option v-for="(items) in carNoList" :key="items.id" :label="items.carNumber"
+                      :value="items.carNumber" />
+                  </el-select>
+                  <span v-else>{{ item.carNo }}</span>
+                  <!-- <el-input :disabled="readonly" v-model="item.carNo" placeholder="" maxlength="120" size="small" /> -->
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="派车编号:" span="1" prop="carModel" label-width="125px">
+                  <el-input v-if="!readonly" v-model="item.tranCarNo" maxlength="120" size="small" />
+                  <span v-else>{{item.tranCarNo}}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="箱号:" span="1" prop="carModel" label-width="125px">
+                  <el-input v-if="item.status == '已装车'||item.status == '已送达'" :disabled="readonly" v-model="item.caseNo"
+                    maxlength="120" size="small" />
+                  <el-input v-else v-model="item.caseNo" placeholder="请输入箱号" maxlength="120" size="small" />
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="封号:" span="1" prop="carModel" label-width="125px">
+                  <el-input v-if="item.status == '已装车'||item.status == '已送达'" v-model="item.titleNo" placeholder=""
+                    :disabled="readonly" maxlength="120" size="small" />
+                  <el-input v-model="item.titleNo" placeholder="请输入封号" v-else maxlength="120" size="small" />
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="车型:" span="1" prop="carModel" label-width="125px">
+                  <el-input :disabled="readonly" v-model="item.carModel" placeholder="" maxlength="120" size="small" />
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+
+                <el-form-item label="车长:" span="1" prop="carLength" label-width="125px">
+                  <el-input :disabled="readonly" v-model="item.carLength" placeholder="" maxlength="120" size="small" />
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="载重(吨):" span="1" prop="loadWeight" label-width="125px">
+                  <el-input :disabled="readonly" v-model="item.loadWeight" placeholder="" maxlength="120"
+                    size="small" />
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item v-if='item.billingMethod==1' label="运输单价(元/吨):" span="1" prop="carModel" label-width="125px">
+                  <el-input :disabled="readonly" v-model="item.tranPrice" size="small" />
+                </el-form-item>
+                <el-form-item v-else label="运输单价(元/车):" span="1" prop="carModel" label-width="125px">
+                  <el-input :disabled="readonly" v-model="item.tranPrice" size="small" />
+                </el-form-item>
+              </el-col>
+              <span v-if="item.status == '未装车'||item.temporaryDriverFlag!=0" width="22" height="22" class="del"
+                @click="del(index, item,0)" src="../../../public/img/del.png" alt="">×</span>
+            </div>
+
+
+          </div>
+          <div class="contentitem" v-for="(item, index) in teamlist" :key="'team'+index">
+            <div class="content3-item1">
+              <el-col :span="8">
+                <!-- <span style="margin-left: 30px;font-weight: 600;">车队-{{ index + 1 }}</span> -->
+                 <el-form-item  :label="'车队-'+(index + 1 )" span="1" prop="carModel" label-width="125px">
+                  <el-input :disabled="item.id?true:false" v-model="item.fleetName" size="small" />
+                </el-form-item>
+              </el-col>
+              
+              <el-col :span="8">
+                <el-form-item v-if='item.billingMethod==1' label="运输单价(元/吨):" span="1" prop="carModel" label-width="125px">
+                  <el-input :disabled="readonly" v-model="item.tranPrice" size="small" />
+                </el-form-item>
+                <el-form-item v-else label="运输单价(元/车):" span="1" prop="carModel" label-width="125px">
+                  <el-input :disabled="readonly" v-model="item.tranPrice" size="small" />
+                </el-form-item>
+              </el-col>
+              <span v-if="!item.id" width="22" height="22" class="del"
+                @click="del(index, item,1)" src="../../../public/img/del.png" alt="">×</span>
+            </div>
+          </div>
+          <div style="text-align: right; color: #8890b1; font-size: 16px">
+            共{{ total }}
+          </div>
+          <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
+        :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper"
+        :total="deptBudgetTotal">
+      </el-pagination>
+          <div style="text-align: right; padding: 10px">
+            <el-button class="bg-bottom-up" type="primary" size="small" @click="revert()">关闭</el-button>
+          </div>
+        </div>
+      </el-form>
+    </div>
+  </div>
+</template>
+<script>
+  import Pagination from '@/components/Pagination'
+  import WsUpload from '@/components/WsUpload'
+  import {
+    seeCat,
+    nameXiala,
+    arrange,
+    dispatchCat,
+    delhaulagestage,
+    setUpTranPrice,
+    setUpTranPriceCar,
+    getcarNumber,
+    getdriverinfo,
+    sponsorWithdraw,
+    gethistorycars
+  } from '@/model/transport/index'
+  // import { dayjs, fmoney, EventBus } from 'base-core-lib'
+  import {
+    dayjs,
+    EventBus
+  } from 'base-core-lib'
+  export default {
+    name: 'viewSpareMoney',
+    components: {
+      WsUpload,
+      Pagination,
+    },
+    watch: {
+      // vesselId(val) {
+      //   this.getList()
+      // },
+      isShow(val) {
+        this.showType = val
+      },
+    },
+    data() {
+      return {
+        fhaddress: '',
+        shaddress: '',
+        // 是否显示
+        showType: true,
+        deptBudgetTotal: 0,
+        currentPage: 1,
+        pageSize: 10,
+        pricetype:'1',
+        searchType: 1,
+        startDate: null,
+        endDate: null,
+        carList: [],
+        carNoList:[],
+        // 提交类型
+        readonly: true,
+        tranPriceApprove: {},
+        carList1:[],
+        size: 10,
+        compId: localStorage.getItem('ws-pf_compId'),
+        deptBudgetList: {
+          tranCarInfoList: [],
+        },
+        pickerBeginDateBefore: {
+          disabledDate: (time) => {
+            return time.getTime() > Date.now()
+          },
+        },
+        accessoryTFs: false,
+        index: 0,
+      }
+    },
+    activated() {
+      this.getList()
+    },
+    computed: {
+      
+      total: function() {
+        if (this.deptBudgetList.records&&this.deptBudgetList.records.length > 0) {
+          var maxStorage = 0
+          for (var i = 0; i < this.deptBudgetList.records.length; i++) {
+            if(this.deptBudgetList.records[i].loadWeight){
+              maxStorage += Number(
+                this.deptBudgetList.records[i].loadWeight
+              )
+            }
+            
+          }
+          return maxStorage
+        }
+      },
+      teamlist: function() {
+        if (this.deptBudgetList.records&&this.deptBudgetList.records.length > 0) {
+          var arr = []
+          for (var i = 0; i < this.deptBudgetList.records.length; i++) {
+            if(this.deptBudgetList.records[i].fleetFlag==1){
+              this.deptBudgetList.records[i].tranCarIndex=i
+              arr.push(this.deptBudgetList.records[i])
+            }
+          }
+          return arr
+        }
+      },
+      driverlist: function() {
+        if (this.deptBudgetList.records&&this.deptBudgetList.records.length > 0) {
+          var arr = []
+          for (var i = 0; i < this.deptBudgetList.records.length; i++) {
+            if(this.deptBudgetList.records[i].fleetFlag==0){
+              this.deptBudgetList.records[i].tranCarIndex=i
+              arr.push(this.deptBudgetList.records[i])
+            }
+          }
+          return arr
+        }
+      },
+    },
+    methods: {
+      clearBlur(e) {
+        let k = this.$refs.driverSelect
+        if (!e) {
+          for (let i = 0; i < k.length; i++) {
+            k[i].blur()
+          }
+        }
+      },
+      handleSizeChange(val) {
+        console.log(`每页 ${val} 条`)
+        this.pageSize = val
+        this.getList()
+      },
+      handleCurrentChange(val) {
+        this.currentPage = val
+        console.log(`当前页: ${val}`)
+        this.getList()
+      },
+      //返回按钮
+      revert() {
+        this.$router.go(-1)
+      },
+      del(index, row,status) {
+        if (row.status == null) {
+          if(status==1){
+            if (this.deptBudgetList.tranCarInfoList1.length > 1) {
+              for (let i = 0; i < this.deptBudgetList.tranCarInfoList1.length; i++) {
+                console.log(this.deptBudgetList.tranCarInfoList1[i])
+                if(this.deptBudgetList.tranCarInfoList1[i].index){
+                  if(this.deptBudgetList.tranCarInfoList1[i].index==row.index){
+                    this.deptBudgetList.tranCarInfoList1.splice(i, 1)
+                  }
+                }
+              }
+            }
+          }else{
+            if (this.deptBudgetList.tranCarInfoList1.length > 1) {
+              this.deptBudgetList.tranCarInfoList1.splice(index, 1)
+              for (let i = index; i < this.deptBudgetList.tranCarInfoList1.length; i++) {
+                let number = Number(this.deptBudgetList.tranCarInfoList1[i].tranCarNo.split('C')[1]) - 1
+                if (number < 10) {
+                  this.deptBudgetList.tranCarInfoList1[i].tranCarNo = 'C00' + number
+                } else if (number < 100) {
+                  this.deptBudgetList.tranCarInfoList1[i].tranCarNo = 'C0' + number
+                } else {
+                  this.deptBudgetList.tranCarInfoList1[i].tranCarNo = 'C' + number
+                }
+              }
+            }
+          }
+          
+        } else {
+          this.$confirm('派车信息删除后不可恢复,是否确定删除?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning',
+          }).then(() => {
+            delhaulagestage({
+                id: row.id
+              })
+              .toPromise()
+              .then((response) => {
+                this.$message.success('删除成功')
+                if (this.deptBudgetList.tranCarInfoList1.length > 1) {
+                  this.deptBudgetList.tranCarInfoList1.splice(index, 1)
+                }
+                this.getList()
+              })
+          })
+        }
+      },
+
+      //审核
+      examine(status) {
+        
+        
+        this.$prompt('运输单价审核', {
+          cancelButtonText: '取消',
+          confirmButtonText: '确定',
+          inputValue: status==1?this.deptBudgetList.tranPriceIng:this.deptBudgetList.tranPriceIngCar
+        }).then(({
+          value
+        }) => {
+          var tranProcessInfo = {}
+          tranProcessInfo.reviewer = localStorage.getItem('ws-pf_roleName') +
+            localStorage.getItem('ws-pf_staffName')
+          tranProcessInfo.id = this.deptBudgetList.id
+          tranProcessInfo.flag = '2'
+          tranProcessInfo.tranTypeKey = 1
+          tranProcessInfo.billingMethod= this.deptBudgetList.billingMethod
+          if(this.deptBudgetList.billingMethod==2){
+             tranProcessInfo.tranPriceIngCar=value
+              setUpTranPriceCar(tranProcessInfo)
+              .toPromise()
+              .then((response) => {
+                this.$message.success('提交成功')
+                this.getList()
+              })
+            }else{
+              tranProcessInfo.tranPriceIng = value
+              setUpTranPrice(tranProcessInfo)
+                .toPromise()
+                .then((response) => {
+                  this.$message.success('审核成功')
+                  this.getList()
+                });
+            }
+        }).catch(() => {
+          this.$message.warning(
+            '取消审核'
+          );
+        });
+      },
+     
+      handleClose() {
+        this.accessoryTFs = false
+      },
+
+      getList() {
+        gethistorycars({
+          processId: this.$route.query.id,
+          currentPage: this.currentPage,
+          pageSize: this.pageSize,
+          })
+          .toPromise()
+          .then((response) => {
+            if (response.records.length > 0) {
+              this.index = response.records.length
+              for (var i = 0; i < response.records.length; i++) {
+                response.records[i].disabled = true
+              }
+            }
+            this.deptBudgetTotal=response.total
+            this.deptBudgetList=response
+          })
+        nameXiala({
+            compId: this.compId
+          })
+          .toPromise()
+          .then((response) => {
+            this.carList = response
+            this.carList1 = response
+          })
+          getcarNumber({
+            compId: this.compId
+          })
+          .toPromise()
+          .then((response) => {
+            this.carNoList = response
+          })
+      },
+      carchange(val, index) {
+        for (var i = 0; i < this.carList.length; i++) {
+          if (this.carList[i].driverName == val) {
+            this.deptBudgetList.tranCarInfoList1[index].driverPhone =
+              this.carList[i].driverPhone
+            arrange({
+                id: this.carList[i].id
+              })
+              .toPromise()
+              .then((response) => {
+                console.log(index,this.deptBudgetList.tranCarInfoList1)
+                this.deptBudgetList.tranCarInfoList1[index].carNo =
+                  response.carNumber
+                if (response.carLoad != null) {
+                  this.deptBudgetList.tranCarInfoList1[index].loadWeight =
+                    response.carLoad
+                } else {
+                  this.deptBudgetList.tranCarInfoList1[index].loadWeight = 0
+                }
+                this.deptBudgetList.tranCarInfoList1[index].carModel =
+                  response.carModel
+                this.deptBudgetList.tranCarInfoList1[index].carLength =
+                  response.carLength
+                this.deptBudgetList.tranCarInfoList1[index].carLengthKey =
+                  response.carLengthKey
+                this.deptBudgetList.tranCarInfoList1[index].carModelKey =
+                  response.carModelKey
+                  this.$forceUpdate()
+              })
+          }
+        }
+      },
+      clear(){
+        this.carList=this.carList1
+      },
+      carNochange(val,index){
+        for (var i = 0; i < this.carNoList.length; i++) {
+          if (this.carNoList[i].carNumber == val) {
+            console.log(this.carNoList[i])
+            if (this.carNoList[i].carLoad != null) {
+                  this.deptBudgetList.tranCarInfoList1[index].loadWeight =
+                  this.carNoList[i].carLoad
+                } else {
+                  this.deptBudgetList.tranCarInfoList1[index].loadWeight = 0
+                }
+                this.deptBudgetList.tranCarInfoList1[index].carModel =
+                this.carNoList[i].carModel
+                this.deptBudgetList.tranCarInfoList1[index].carLength =
+                this.carNoList[i].carLength
+                this.deptBudgetList.tranCarInfoList1[index].carLengthKey =
+                this.carNoList[i].carLengthKey
+                this.deptBudgetList.tranCarInfoList1[index].carModelKey =
+                this.carNoList[i].carModelKey
+            getdriverinfo({
+              carNumber: this.carNoList[i].carNumber
+              })
+              .toPromise()
+              .then((response) => {
+                this.carList=response
+                
+              })
+          }
+        }
+      },
+      phonechange(val, index) {
+        for (var i = 0; i < this.carList.length; i++) {
+          if (this.carList[i].driverPhone == val) {
+            this.deptBudgetList.tranCarInfoList1[index].driver =
+              this.carList[i].driverName
+            arrange({
+                id: this.carList[i].id
+              })
+              .toPromise()
+              .then((response) => {
+                console.log(this, response)
+                this.deptBudgetList.tranCarInfoList1[index].carNo =
+                  response.carNumber
+                if (response.carLoad != null) {
+                  this.deptBudgetList.tranCarInfoList1[index].loadWeight =
+                    response.carLoad
+                } else {
+                  this.deptBudgetList.tranCarInfoList1[index].loadWeight = 0
+                }
+                this.deptBudgetList.tranCarInfoList1[index].carModel =
+                  response.carModel
+                this.deptBudgetList.tranCarInfoList1[index].carLength =
+                  response.carLength
+                this.deptBudgetList.tranCarInfoList1[index].carLengthKey =
+                  response.carLengthKey
+                this.deptBudgetList.tranCarInfoList1[index].carModelKey =
+                  response.carModelKey
+              })
+          }
+        }
+      },
+    },
+  }
+</script>
+<style lang="scss" scoped>
+
+  /deep/.el-form-item--small.el-form-item {
+    margin-bottom: 0px
+  }
+
+  .input-item-margin {
+    margin-right: 20px;
+  }
+
+  .row-item {
+    width: 100%;
+  }
+
+  .bg-right {
+    text-align: right;
+    padding: 16px 20px;
+  }
+
+  .center {
+    margin: 0 auto;
+    width: 70%;
+  }
+
+  //蓝标
+  .small-title {
+    position: relative;
+    padding: 10px;
+    font-weight: 600;
+  }
+
+  //小标题文字
+  .small-title::before {
+    position: absolute;
+    content: '';
+    display: block;
+    background: #5473e8;
+    width: 4px;
+    height: 14px;
+    left: 0px;
+    top: 16px;
+    padding: 4px 2px;
+  }
+
+  .bg-left {
+    padding-left: 30px;
+  }
+
+  .title::before {
+    content: '';
+    display: inline-block;
+    width: 5px;
+    height: 30px;
+    background: #5473e8;
+    position: absolute;
+    left: 0;
+  }
+
+  .myTest {
+    display: flex;
+    margin-bottom: 20px;
+    // background: green;
+    padding-left: 20px;
+    align-items: center;
+    width: 999px;
+  }
+
+  .myTest .el-form-item {
+    width: 33.333%;
+  }
+
+  .content3 ,.contentitem{
+    width: calc(100% + 20px);
+
+    .content3-item1 {
+      position: relative;
+      background: #F5F7FA;
+      border: 1px solid #E4E7ED;
+      border-radius: 5px;
+      height: 200px;
+      width: 100%;
+      padding: 10px 20px 0 0;
+      margin-top: 20px;
+    }
+  }
+.contentitem{
+    .content3-item1 {
+      height: 90px;
+    }
+}
+
+
+  .del {
+    position: absolute;
+    right: 4px;
+    top: 0px;
+    cursor: pointer;
+    font-size: 20px;
+    width: 16px;
+    height: 10px;
+  }
+</style>