Explorar el Código

Merge branch 'dev' of http://git.echepei.com/caojunjie/Smart_platform_ui into dev

QuKatie hace 3 años
padre
commit
01a8e1ecd8

+ 63 - 0
src/api/landTransportation/index.js

@@ -55,3 +55,66 @@ export function driverQueryCollection(data) {
         params:data
     })
 }
+//调度箱信息
+export function dispatchCollection(data) {
+    return request({
+        url: '/api/blade-land/order-item/dispatch',
+        method: 'post',
+        data:data
+    })
+}
+//取消调度箱信息
+export function cancelDispatchCollection(data) {
+    return request({
+        url: '/api/blade-land/order-item/cancel-dispatch',
+        method: 'get',
+        params:data
+    })
+}
+//派车箱信息
+export function sendACarCollection(data) {
+    return request({
+        url: '/api/blade-land/order-item/send',
+        method: 'post',
+        data:data
+    })
+}
+//取消派车箱信息
+export function sendACarDispatchCollection(data) {
+    return request({
+        url: '/api/blade-land/order-item/cancel-send',
+        method: 'get',
+        params:data
+    })
+}
+//受理箱信息
+export function acceptanceCollection(data) {
+    return request({
+        url: '/api/blade-land/order-item/accept',
+        method: 'post',
+        data:data
+    })
+}
+//取消受理箱信息
+export function acceptanceDispatchCollection(data) {
+    return request({
+        url: '/api/blade-land/order-item/cancel-accept',
+        method: 'get',
+        params:data
+    })
+}
+//确认完工箱信息
+export function confirmCompletion(data) {
+    return request({
+        url: '/api/blade-land/order-item/finished',
+        method: 'get',
+        params:data
+    })
+}
+//获取车队司机信息
+export function fleetList() {
+    return request({
+        url: '/api/blade-client/land-vehicle/vehicle-list',
+        method: 'get'
+    })
+}

+ 91 - 40
src/views/landTransportation/dispatchingCars/detailPage.vue

@@ -10,25 +10,6 @@
         >返回列表
         </el-button>
       </div>
-      <div>
-        <el-button
-            class="el-button--small-yh add-customer-btn"
-            type="primary"
-            :disabled="disabled"
-            size="small"
-            style="margin-right: 70px;"
-            @click="editCustomer"
-        >提交
-        </el-button>
-        <el-button
-            class="el-button--small-yh add-customer-btn"
-            type="primary"
-            :disabled="disabled"
-            size="small"
-            @click="editCustomer"
-        >保存
-        </el-button>
-      </div>
     </div>
     <containerTitle
         title="起止地信息"
@@ -78,24 +59,32 @@
           ref="crudContact"
           :option="entrustOptionTwoT"
           @row-save="(row,done,loading)=>{rowSaveT(row,0,done,loading)}"
-          @row-update="rowSaveT">
-<!--        <template slot-scope="{type,size,row}" slot="menu">-->
-<!--          <el-button icon="el-icon-edit" :size="size" :type="type" @click="designate(row)">指派</el-button>-->
-<!--        </template>-->
+          @row-update="rowSaveWell">
+        <!--        <template slot-scope="{type,size,row}" slot="menu">-->
+        <!--          <el-button icon="el-icon-edit" :size="size" :type="type" @click="designate(row)">指派</el-button>-->
+        <!--        </template>-->
         <template slot-scope="{row,index}" slot="menu">
           <el-button
               type="text"
               size="small"
+              v-if="row.status===0"
               @click="rowSaveT(row,index)"
           >{{ row.$cellEdit ? '保 存' : '修 改' }}
           </el-button>
           <el-button
               size="small"
-              icon="el-icon-delete"
               type="text"
               @click="designate(row, index)"
-              v-if="!row.$cellEdit"
-          >指派</el-button>
+              v-if="row.status === 0"
+          >调 度
+          </el-button>
+          <el-button
+              size="small"
+              type="text"
+              @click="cancelDesignate(row, index)"
+              v-if="row.status===1"
+          >取消调度
+          </el-button>
         </template>
       </avue-crud>
     </basic-container>
@@ -217,7 +206,13 @@
 
 <script>
 import {getLazyTree} from "@/api/base/region";
-import {saveDelegationList, detailDelegationList, removeCollection} from "@/api/landTransportation";
+import {
+  saveDelegationList,
+  detailDelegationList,
+  removeCollection,
+  dispatchCollection,
+  cancelDispatchCollection
+} from "@/api/landTransportation";
 
 export default {
   props: {
@@ -268,8 +263,8 @@ export default {
         index: true,
         cellBtn: false,
         addBtn: false,
-        cancelBtn:false,
-        editBtn:false,
+        cancelBtn: false,
+        editBtn: false,
         addRowBtn: false,
         delBtn: false,
         showSummary: true,
@@ -297,14 +292,14 @@ export default {
             label: '状态',
             width: 200,
             type: 'select',
-            dicUrl: "/api/blade-client/corpsdesc/fleet-list",
+            dicUrl: "/api/blade-system/dict-biz/dictionary?code=land_order_status",
             props: {
-              label: "cname",
-              value: "id"
+              label: "dictValue",
+              value: "dictKey"
             },
-            cell: true,
+            dataType: "string",
             prop: 'status'
-          },{
+          }, {
             label: '车队',
             width: 200,
             type: 'select',
@@ -351,9 +346,14 @@ export default {
             cell: true,
             prop: 'landAmountC'
           }, {
-            label: '备注',
-            cell: true,
+            label: '委托备注',
             prop: 'remarks'
+          }, {
+            label: '车队备注',
+            prop: 'fleetRemarks'
+          }, {
+            label: '司机备注',
+            prop: 'driverRemarks'
           }
         ]
       },
@@ -635,6 +635,30 @@ export default {
     }
   },
   methods: {
+    //刷新数据
+    refreshData() {
+      detailDelegationList({id: this.id, kind: '2'}).then(res => {
+        this.goodsForm = res.data.data
+        this.tableData = res.data.data.orderAddressList
+        this.entrustList = res.data.data.orderItemList
+        this.goodsList = res.data.data.orderItemList
+        if (res.data.data.orderFeeList.length > 0) {
+          res.data.data.orderFeeList.forEach(item => {
+            if (item.type == 1) {
+              this.collectionList.push(item)
+            } else {
+              this.paymentList.push(item)
+            }
+          })
+        }
+        delete this.goodsForm.orderAddressList
+        delete this.goodsForm.orderItemList
+        delete this.goodsForm.orderFeeList
+        this.tableData.forEach(item => {
+          if (item.region) item.region = item.region.split(',')
+        })
+      })
+    },
     //切换收付费
     handleSelect(tab, event) {
       this.activeIndex = tab.name
@@ -642,16 +666,43 @@ export default {
     //箱信息保存
     rowSaveT(row, index, done, loading) {
       this.$refs.crudContact.rowCell(row, index)
+    },
+    rowSaveWell(row, index, done, loading) {
       done()
     },
-    //箱信息指派
-    designate(row){
-      this.$confirm('是否确定指派车队', '提示', {
+    //箱信息调度
+    designate(row) {
+      if (row.fleetId) {
+        this.$confirm('是否确定调度', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          dispatchCollection(row).then(res => {
+            this.$message.success('操作成功');
+            this.refreshData()
+          })
+        }).catch(() => {
+          this.$message({
+            type: 'info',
+            message: '已取消'
+          });
+        });
+      } else {
+        this.$message.warning('请选择车队');
+      }
+    },
+    //取消调度
+    cancelDesignate(row) {
+      this.$confirm('是否确定取消调度', '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        console.log('11111')
+        cancelDispatchCollection({id: row.id}).then(res => {
+          this.$message.success('操作成功');
+          this.refreshData()
+        })
       }).catch(() => {
         this.$message({
           type: 'info',

+ 85 - 5
src/views/landTransportation/dispatchingCars/index.vue

@@ -10,9 +10,9 @@
           @on-load="onLoad"
           @row-del="rowDel"
           @search-change="searchChange">
-        <template slot="menuLeft" slot-scope="{size}">
-          <el-button type="primary" :size="size" @click="rowSave">新增</el-button>
-        </template>
+<!--        <template slot="menuLeft" slot-scope="{size}">-->
+<!--          <el-button type="primary" :size="size" @click="rowSave">新增</el-button>-->
+<!--        </template>-->
         <template slot-scope="{row,index}" slot="menu">
           <el-button type="text"
                      icon="el-icon-edit"
@@ -56,18 +56,98 @@ export default {
         editBtn: false,
         delBtn:false,
         height:"auto",
+        searchSpan: 8,
+        searchIcon: true,
         column:[{
+          label: '状态',
+          prop: 'itemStatusDetail',
+          index: 1,
+          width: 140
+        }, {
           label: '订单号',
           prop: 'id',
           index: 1,
+          overHidden: true,
+          width: 160,
+          search: true,
+        }, {
+          label: '客户名称',
+          prop: 'corpName',
+          overHidden: true,
+          index: 1,
+          width: 140,
+          search: true,
+        }, {
+          label: '所属公司',
+          prop: 'corpName',
+          overHidden: true,
+          index: 1,
           width: 140,
-          cell: true,
+          search: true,
+        }, {
+          label: '提单号',
+          prop: 'billNo',
+          index: 1,
+          overHidden: true,
+          width: 140,
+          search: true,
+        }, {
+          label: '货物名称',
+          prop: 'goods',
+          overHidden: true,
+          index: 1,
+          width: 140,
+          search: true,
+        }, {
+          label: '路线',
+          prop: 'id',
           overHidden: true,
-          search:true,
+          index: 1,
+          width: 140,
+          search: true,
+        }, {
+          label: '场站',
+          prop: 'station',
+          overHidden: true,
+          index: 1,
+          width: 140,
+          search: true,
+        }, {
+          label: '到厂时间',
+          prop: 'arrivalTime',
+          overHidden: true,
+          index: 1,
+          width: 140,
+          search: true,
+        }, {
+          label: '工厂名称',
+          prop: 'factory',
+          overHidden: true,
+          index: 1,
+          width: 140,
+          search: true,
+        }, {
+          label: '制单日期',
+          overHidden: true,
+          prop: 'createTime',
+          index: 1,
+          width: 140,
+          search: true,
         }]
       }
     }
   },
+  created() {
+    let i = 0;
+    this.option.column.forEach(item => {
+      if (item.search) i++
+    })
+    if (i % 3 !== 0) {
+      const num = 3 - Number(i % 3)
+      this.option.searchMenuSpan = num * 8;
+      this.option.searchMenuPosition = "right";
+    }
+  },
   methods:{
     onLoad(page, params) {
       let queryParams = {

+ 213 - 92
src/views/landTransportation/driver/index.vue

@@ -1,133 +1,193 @@
 <template>
   <div>
     <basic-container>
-            <avue-crud
-                :data="goodsList"
-                :option="goodsOptionCrud"
-                :table-loading="loading"
-                :page.sync="page"
-                @on-load="onLoad"
-                @search-change="searchChange"
-                @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"
-                @row-update="rowSave">
-            </avue-crud>
+      <avue-crud
+          :data="goodsList"
+          :option="goodsOptionCrud"
+          :table-loading="loading"
+          :page.sync="page"
+          ref="crudContact"
+          @on-load="onLoad"
+          @search-change="searchChange"
+          @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"
+          @row-update="rowSave">
+        <template slot-scope="{row,index}" slot="menu">
+          <el-button
+              type="text"
+              size="small"
+              v-if="row.status === 2"
+              @click="rowSaveT(row,index)"
+          >{{ row.$cellEdit ? '保 存' : '修 改' }}
+          </el-button>
+          <el-button
+              size="small"
+              type="text"
+              @click="designate(row, index)"
+              v-if="row.status===2"
+          >受 理
+          </el-button>
+          <el-button
+              size="small"
+              type="text"
+              @click="cancelDesignate(row, index)"
+              v-if="row.status===3"
+          >取消受理
+          </el-button>
+          <el-button
+              size="small"
+              type="text"
+              @click="confirmCompletion(row, index)"
+              v-if="row.status === 3"
+          >确认完工
+          </el-button>
+        </template>
+      </avue-crud>
     </basic-container>
   </div>
 </template>
 
 <script>
-import {driverQueryCollection} from "@/api/landTransportation";
+import {
+  driverQueryCollection,
+  acceptanceCollection,
+  acceptanceDispatchCollection,
+  confirmCompletion,
+  fleetList
+} from "@/api/landTransportation";
 
 export default {
   name: "index",
-  data(){
-    return{
-      form:{},
-      loading:false,
+  data() {
+    return {
+      form: {},
+      loading: false,
       page: {
         pageSize: 10,
         currentPage: 1,
         total: 0,
-        pageSizes: [10,50,100,200,300]
+        pageSizes: [10, 50, 100, 200, 300]
       },
-      roleName:localStorage.getItem("roleName").split(',')[0],
-      goodsList:[],
+      roleName: localStorage.getItem("roleName").split(',')[0],
+      goodsList: [],
       goodsOptionCrud: {
-        index:true,
-        cellBtn:true,
-        addBtn:false,
-        addRowBtn:false,
-        searchMenuPosition:"right",
-        searchMenuSpan:6,
-        delBtn:false,
-        align:'center',
-        height:"auto",
+        index: true,
+        addBtn: false,
+        delBtn: false,
+        cellBtn: false,
+        cancelBtn: false,
+        editBtn: false,
+        addRowBtn: false,
+        searchMenuPosition: "right",
+        searchMenuSpan: 6,
+        align: 'center',
+        height: "auto",
         showSummary: true,
         summaryText: "合计",
         sumColumnList: [
           {
             name: 'landWeight',
             type: 'sum',
-            decimals:6
-          },{
+            decimals: 6
+          }, {
             name: 'landAmountC',
             type: 'sum',
-            decimals:2
-          },{
+            decimals: 2
+          }, {
             name: 'ctnQuantity',
             type: 'count'
           }],
-        column: [
-          {
-            label: '车队',
-            width: 200,
-            search:true,
-            prop: 'fleetName'
-          },{
-            label: '尺寸箱型',
-            width: 100,
-            search:true,
-            prop: 'ctnType'
-          },{
-            label: '箱量',
-            width: 50,
-            prop: 'ctnQuantity'
-          }, {
-            label: '重量',
-            width: 160,
-            prop: 'landWeight',
-            controls: false,
-            precision: 6,
-            type: 'number'
-          }, {
-            label: '车号',
-            width: 150,
-            cell: true,
-            prop: 'plateNo'
-          }, {
-            label: '司机',
-            width: 115,
-            search:true,
-            cell: true,
-            prop: 'driverId'
-          }, {
-            label: '电话',
-            width: 160,
-            cell: true,
-            prop: 'tel'
-          }, {
-            label: '箱号',
-            cell: true,
-            prop: 'ctnNo'
-          }, {
-            label: '陆运费(C)',
-            prop: 'landAmountC'
-          }, {
-            label: '是否派车',
-            cell: true,
-            prop: 'sex'
-          }, {
-            label: '备注',
-            cell: true,
-            prop: 'remarks'
+        column: [{
+          label: '状态',
+          width: 200,
+          type: 'select',
+          dicUrl: "/api/blade-system/dict-biz/dictionary?code=land_order_status",
+          props: {
+            label: "dictValue",
+            value: "dictKey"
+          },
+          dataType: "string",
+          prop: 'status'
+        }, {
+          label: '车队',
+          width: 200,
+          search: true,
+          type: 'select',
+          cascader: ['plateNo'],
+          dicUrl: "/api/blade-client/corpsdesc/fleet-list",
+          props: {
+            label: "cname",
+            value: "id"
+          },
+          prop: 'fleetId'
+        }, {
+          label: '尺寸箱型',
+          width: 100,
+          search: true,
+          prop: 'ctnType'
+        }, {
+          label: '箱量',
+          width: 50,
+          prop: 'ctnQuantity'
+        }, {
+          label: '重量',
+          width: 160,
+          prop: 'landWeight',
+          controls: false,
+          precision: 6,
+          type: 'number'
+        }, {
+          label: '车号',
+          width: 150,
+          prop: 'vehicleId',
+          type: 'select',
+          dicUrl: "/api/blade-client/land-vehicle/vehicle-list?fleetId={{key}}",
+          props: {
+            label: "plateNo",
+            value: "id"
           }
+        }, {
+          label: '司机',
+          width: 115,
+          search: true,
+          prop: 'driverName'
+        }, {
+          label: '电话',
+          width: 160,
+          prop: 'tel'
+        }, {
+          label: '箱号',
+          cell: true,
+          prop: 'ctnNo'
+        }, {
+          label: '陆运费(C)',
+          prop: 'landAmountC'
+        }, {
+          label: '委托备注',
+          prop: 'remarks'
+        }, {
+          label: '车队备注',
+          prop: 'fleetRemarks'
+        }, {
+          label: '司机备注',
+          cell: true,
+          prop: 'driverRemarks'
+        }
         ]
       },
     }
   },
-  methods:{
+  methods: {
     //箱信息保存
-    rowSave(row,index,done,loading) {
-      row.$cellEdit = false
+    rowSave(row, index, done, loading) {
       done()
     },
     //箱信息选择车队
-    getfleetIdT(data,row){
-      this.$set(row,'fleetName',data.cname)
+    getfleetIdT(data, row) {
+      this.$set(row, 'fleetName', data.cname)
     },
     //搜索
-    searchChange(params,done) {
-      this.onLoad(this.page,params)
+    searchChange(params, done) {
+      this.onLoad(this.page, params)
       done();
     },
     //查询
@@ -135,7 +195,7 @@ export default {
       let queryParams = {
         size: page.pageSize,
         current: page.currentPage,
-        tag:'4',
+        tag: '4',
         ...params
       }
       this.loading = true;
@@ -146,6 +206,67 @@ export default {
         this.loading = false;
       })
     },
+    //箱信息保存
+    rowSaveT(row, index, done, loading) {
+      this.$refs.crudContact.rowCell(row, index)
+    },
+    //箱信息派车
+    designate(row) {
+      if (row.fleetId) {
+        this.$confirm('是否确定派车', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          acceptanceCollection(row).then(res => {
+            this.$message.success('操作成功');
+            this.onLoad(this.page)
+          })
+        }).catch(() => {
+          this.$message({
+            type: 'info',
+            message: '已取消'
+          });
+        });
+      } else {
+        this.$message.warning('未选择车队,请选择');
+      }
+    },
+    //取消派车
+    cancelDesignate(row) {
+      this.$confirm('是否确定取消派车', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        acceptanceDispatchCollection({id: row.id}).then(res => {
+          this.$message.success('操作成功');
+          this.onLoad(this.page)
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消'
+        });
+      });
+    },
+    confirmCompletion() {
+      this.$confirm('是否确定完工', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        confirmCompletion({id: row.id}).then(res => {
+          this.$message.success('操作成功');
+          this.onLoad(this.page)
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消'
+        });
+      });
+    }
   }
 }
 </script>

+ 193 - 86
src/views/landTransportation/motorcadeDriver/index.vue

@@ -6,18 +6,33 @@
           :option="entrustOptionTwoT"
           :table-loading="loading"
           :page.sync="page"
+          ref="crudContact"
           @on-load="onLoad"
           @search-change="searchChange"
           @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"
           @row-update="rowSave">
-        <template slot="fleetId" slot-scope="{ row, index }">
-          <crop-select
-              v-if="row.$cellEdit"
-              v-model="row.fleetId"
-              :cropIndex="index"
-              @getCorpData="(data)=>{getfleetIdT(data,row)}"
-          ></crop-select>
-          <span v-else>{{ row.fleetName }}</span>
+        <template slot-scope="{row,index}" slot="menu">
+          <el-button
+              type="text"
+              size="small"
+              v-if="row.status===1"
+              @click="rowSaveT(row,index)"
+          >{{ row.$cellEdit ? '保 存' : '修 改' }}
+          </el-button>
+          <el-button
+              size="small"
+              type="text"
+              @click="designate(row, index)"
+              v-if="row.status===1"
+          >派 车
+          </el-button>
+          <el-button
+              size="small"
+              type="text"
+              @click="cancelDesignate(row, index)"
+              v-if="row.status===2"
+          >取消派车
+          </el-button>
         </template>
       </avue-crud>
     </basic-container>
@@ -25,117 +40,165 @@
 </template>
 
 <script>
-import {driverQueryCollection} from "@/api/landTransportation";
+import {
+  sendACarCollection,
+  sendACarDispatchCollection,
+  driverQueryCollection,
+  fleetList
+} from "@/api/landTransportation";
 
 export default {
   name: "index",
-  data(){
-    return{
-      form:{},
-      loading:false,
+  data() {
+    return {
+      form: {},
+      loading: false,
       page: {
         pageSize: 10,
         currentPage: 1,
         total: 0,
-        pageSizes: [10,50,100,200,300]
+        pageSizes: [10, 50, 100, 200, 300]
       },
-      roleName:localStorage.getItem("roleName").split(',')[0],
-      goodsList:[],
+      roleName: localStorage.getItem("roleName").split(',')[0],
+      goodsList: [],
       entrustOptionTwoT: {
         align: 'center',
         menuAlign: 'center',
-        index:true,
-        cellBtn:true,
-        addBtn:false,
-        addRowBtn:false,
-        delBtn:false,
-        searchMenuPosition:"right",
-        searchMenuSpan:6,
-        height:"auto",
+        index: true,
+        addBtn: false,
+        delBtn: false,
+        cellBtn: false,
+        cancelBtn: false,
+        editBtn: false,
+        addRowBtn: false,
+        searchMenuPosition: "right",
+        searchMenuSpan: 6,
+        height: "auto",
         showSummary: true,
         summaryText: "合计",
         sumColumnList: [
           {
             name: 'landWeight',
             type: 'sum',
-            decimals:6
-          },{
+            decimals: 6
+          }, {
             name: 'landAmountC',
             type: 'sum',
-            decimals:2
-          },{
+            decimals: 2
+          }, {
             name: 'landAmountD',
             type: 'sum',
-            decimals:2
-          },{
+            decimals: 2
+          }, {
             name: 'ctnQuantity',
             type: 'count'
           }],
-        column: [
-          {
-            label: '车队',
-            width: 200,
-            slot:true,
-            search:true,
-            prop: 'fleetId'
-          }, {
-            label: '尺寸箱型',
-            width: 100,
-            search:true,
-            prop: 'ctnType'
-          }, {
-            label: '箱量',
-            width: 50,
-            prop: 'ctnQuantity'
-          }, {
-            label: '重量',
-            width: 160,
-            prop: 'landWeight',
-            controls: false,
-            precision: 6,
-            type: 'number'
-          }, {
-            label: '车号',
-            width: 150,
-            prop: 'plateNo'
-          }, {
-            label: '司机',
-            width: 115,
-            search:true,
-            prop: 'driverId'
-          }, {
-            label: '电话',
-            width: 160,
-            prop: 'tel'
-          }, {
-            label: '陆运费(D)',
-            prop: 'landAmountD'
-          }, {
-            label: '陆运费(C)',
-            cell: true,
-            prop: 'landAmountC'
-          }, {
-            label: '备注',
-            cell: true,
-            prop: 'remarks'
-          }
+        column: [{
+          label: '状态',
+          width: 200,
+          type: 'select',
+          dicUrl: "/api/blade-system/dict-biz/dictionary?code=land_order_status",
+          props: {
+            label: "dictValue",
+            value: "dictKey"
+          },
+          dataType: "string",
+          prop: 'status'
+        }, {
+          label: '车队',
+          width: 200,
+          search: true,
+          type: 'select',
+          cascader: ['plateNo'],
+          dicUrl: "/api/blade-client/corpsdesc/fleet-list",
+          props: {
+            label: "cname",
+            value: "id"
+          },
+          prop: 'fleetId'
+        }, {
+          label: '尺寸箱型',
+          width: 100,
+          search: true,
+          prop: 'ctnType'
+        }, {
+          label: '箱量',
+          width: 50,
+          prop: 'ctnQuantity'
+        }, {
+          label: '重量',
+          width: 160,
+          prop: 'landWeight',
+          controls: false,
+          precision: 6,
+          type: 'number'
+        }, {
+          label: '车号',
+          width: 150,
+          cell: true,
+          prop: 'vehicleId',
+          type: 'select',
+          dicUrl: "/api/blade-client/land-vehicle/vehicle-list?fleetId={{key}}",
+          props: {
+            label: "plateNo",
+            value: "id"
+          },
+          change: (data) => {
+            console.log(data)
+            fleetList().then(res => {
+              for (let item in res.data.data) {
+                if (data.value === res.data.data[item].id) {
+                  this.goodsList[data.index].driverId = res.data.data[item].driverId
+                  this.goodsList[data.index].driverName = res.data.data[item].driverName
+                  this.goodsList[data.index].tel = res.data.data[item].tel
+                }
+              }
+            })
+          },
+        }, {
+          label: '司机',
+          width: 115,
+          search: true,
+          // prop: 'driverId'
+          prop: 'driverName'
+        }, {
+          label: '电话',
+          width: 160,
+          prop: 'tel'
+        }, {
+          label: '陆运费(D)',
+          prop: 'landAmountD'
+        }, {
+          label: '陆运费(C)',
+          cell: true,
+          prop: 'landAmountC'
+        }, {
+          label: '委托备注',
+          prop: 'remarks'
+        }, {
+          label: '车队备注',
+          cell: true,
+          prop: 'fleetRemarks'
+        }, {
+          label: '司机备注',
+          prop: 'driverRemarks'
+        }
         ]
       },
     }
   },
-  methods:{
+  methods: {
     //箱信息保存
-    rowSave(row,index,done,loading) {
-      row.$cellEdit = false
+    rowSave(row, index, done, loading) {
       done()
     },
     //箱信息选择车队
-    getfleetIdT(data,row){
-      this.$set(row,'fleetName',data.cname)
+    getfleetIdT(data, row) {
+      this.$set(row, 'fleetName', data.cname)
     },
     //搜索
-    searchChange(params,done) {
-      this.onLoad(this.page,params)
+    searchChange(params, done) {
+      this.onLoad(this.page, params)
       done();
     },
     //查询
@@ -143,7 +206,7 @@ export default {
       let queryParams = {
         size: page.pageSize,
         current: page.currentPage,
-        tag:'3',
+        tag: '3',
         ...params
       }
       this.loading = true;
@@ -154,6 +217,50 @@ export default {
         this.loading = false;
       })
     },
+    //箱信息保存
+    rowSaveT(row, index, done, loading) {
+      this.$refs.crudContact.rowCell(row, index)
+    },
+    //箱信息派车
+    designate(row) {
+      if (row.vehicleId) {
+        this.$confirm('是否确定派车', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          sendACarCollection(row).then(res => {
+            this.$message.success('操作成功');
+            this.onLoad(this.page)
+          })
+        }).catch(() => {
+          this.$message({
+            type: 'info',
+            message: '已取消'
+          });
+        });
+      } else {
+        this.$message.warning('未选择车号,请选择');
+      }
+    },
+    //取消派车
+    cancelDesignate(row) {
+      this.$confirm('是否确定取消派车', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        sendACarDispatchCollection({id: row.id}).then(res => {
+          this.$message.success('操作成功');
+          this.onLoad(this.page)
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消'
+        });
+      });
+    },
   }
 }
 </script>

+ 176 - 161
src/views/landTransportation/placeAnOrder/detailPage.vue

@@ -45,9 +45,10 @@
             v-if="goodsForm.status !== 1"
             width="40">
           <template slot-scope="scope">
-            <el-tooltip className="item" v-if="scope.$index === tableData.length-1" effect="dark" content="增加途径地址" placement="top">
+            <el-tooltip className="item" v-if="scope.$index === tableData.length-1" effect="dark" content="增加途径地址"
+                        placement="top">
               <el-button type="primary" icon="el-icon-plus" size="mini" circle @click="addAddress"
-              style="margin-right: 1.25rem;"></el-button>
+                         style="margin-right: 1.25rem;"></el-button>
             </el-tooltip>
           </template>
         </el-table-column>
@@ -65,7 +66,8 @@
             <span v-else>
               <el-button v-if="goodsForm.status === 1" type="success" size="mini" circle>途</el-button>
               <el-tooltip v-else class="item" effect="dark" content="删除" placement="right">
-                  <el-button type="danger" icon="el-icon-delete" size="mini" circle @click="deleteAddress(scope)"></el-button>
+                  <el-button type="danger" icon="el-icon-delete" size="mini" circle
+                             @click="deleteAddress(scope)"></el-button>
               </el-tooltip>
             </span>
           </template>
@@ -95,7 +97,8 @@
             align="center"
             label="详细地址">
           <template slot-scope="scope">
-            <el-input v-model="scope.row.address" :disabled="goodsForm.status === 1" size="small" placeholder="请输入内容"></el-input>
+            <el-input v-model="scope.row.address" :disabled="goodsForm.status === 1" size="small"
+                      placeholder="请输入内容"></el-input>
           </template>
         </el-table-column>
       </el-table>
@@ -130,6 +133,7 @@
       <avue-form :option="goodsOptionForm" v-model="goodsForm">
         <template slot-scope="scope" slot="corpId">
           <crop-select
+              :disabled="goodsForm.status === 1"
               v-model="goodsForm.corpId"
           ></crop-select>
         </template>
@@ -155,7 +159,7 @@
               v-model="row.corpId"
               @getCorpData="(data)=>{getfleetId(data,row)}"
           ></crop-select>
-          <span v-else>{{row.corpName}}</span>
+          <span v-else>{{ row.corpName }}</span>
         </template>
         <template slot-scope="{row}" slot="feeId">
           <breakdown-select
@@ -173,12 +177,14 @@
               size="small"
               :icon="row.$cellEdit?'el-icon-circle-plus-outline':'el-icon-edit'"
               @click="rowCell(row,index)"
-          >{{row.$cellEdit?'保存':'编辑'}}</el-button>
+          >{{ row.$cellEdit ? '保存' : '编辑' }}
+          </el-button>
           <el-button type="text"
                      icon="el-icon-delete"
                      size="small"
                      @click="$refs.collection.rowDel(row,index)"
-          >删除</el-button>
+          >删除
+          </el-button>
         </template>
         <template slot="menuLeft">
           <el-button type="primary" icon="el-icon-plus" @click="addRowCollection" size="small">录入明细</el-button>
@@ -199,7 +205,7 @@
               v-model="row.corpId"
               @getCorpData="(data)=>{getfleetId(data,row)}"
           ></crop-select>
-          <span v-else>{{row.corpName}}</span>
+          <span v-else>{{ row.corpName }}</span>
         </template>
         <template slot-scope="{row}" slot="feeId">
           <breakdown-select
@@ -217,12 +223,14 @@
               size="small"
               :icon="row.$cellEdit?'el-icon-circle-plus-outline':'el-icon-edit'"
               @click="paymentRowCell(row,index)"
-          >{{row.$cellEdit?'保存':'编辑'}}</el-button>
+          >{{ row.$cellEdit ? '保存' : '编辑' }}
+          </el-button>
           <el-button type="text"
                      icon="el-icon-delete"
                      size="small"
                      @click="$refs.payment.rowDel(row,index)"
-          >删除</el-button>
+          >删除
+          </el-button>
         </template>
         <template slot="menuLeft">
           <el-button type="primary" icon="el-icon-plus" @click="addRowPayment" size="small">录入明细</el-button>
@@ -240,7 +248,7 @@
 
 <script>
 import {getLazyTree} from "@/api/base/region";
-import {saveDelegationList, detailDelegationList,removeCollection,saveSaveList} from "@/api/landTransportation";
+import {saveDelegationList, detailDelegationList, removeCollection, saveSaveList} from "@/api/landTransportation";
 
 export default {
   props: {
@@ -250,21 +258,21 @@ export default {
   },
   data() {
     return {
-      activeIndex:'1',
+      activeIndex: '1',
       goodsForm: {},
-      orderFilesList:[],
-      roleName:localStorage.getItem("roleName").split(',')[0],
-      breakConfiguration:{
-        multipleChoices:false,
-        multiple:false,
-        disabled:false,
-        searchShow:true,
-        collapseTags:false,
-        clearable:true,
-        placeholder:'请点击右边按钮选择',
-        dicData:[]
+      orderFilesList: [],
+      roleName: localStorage.getItem("roleName").split(',')[0],
+      breakConfiguration: {
+        multipleChoices: false,
+        multiple: false,
+        disabled: false,
+        searchShow: true,
+        collapseTags: false,
+        clearable: true,
+        placeholder: '请点击右边按钮选择',
+        dicData: []
       },
-      advantageProjectData:[],
+      advantageProjectData: [],
       treeOption: {
         label: 'title',
         value: 'id',
@@ -288,92 +296,71 @@ export default {
       entrustOptionTwoT: {
         align: 'center',
         menuAlign: 'center',
-        index:true,
-        cellBtn:true,
-        addBtn:false,
-        addRowBtn:false,
-        delBtn:false,
+        index: true,
+        cellBtn: true,
+        addBtn: false,
+        addRowBtn: false,
+        delBtn: false,
         showSummary: true,
         summaryText: "合计",
         sumColumnList: [
           {
             name: 'landWeight',
             type: 'sum',
-            decimals:6
-          },{
+            decimals: 6
+          }, {
             name: 'landAmountC',
             type: 'sum',
-            decimals:2
-          },{
+            decimals: 2
+          }, {
             name: 'landAmountD',
             type: 'sum',
-            decimals:2
-          },{
+            decimals: 2
+          }, {
             name: 'ctnQuantity',
             type: 'count'
           }],
-        column: [
-          {
-            label: '车队',
-            width: 200,
-            slot:true,
-            prop: 'fleetId'
-          }, {
-            label: '尺寸箱型',
-            width: 100,
-            prop: 'ctnType'
-          }, {
-            label: '箱量',
-            width: 50,
-            prop: 'ctnQuantity'
-          }, {
-            label: '重量',
-            width: 160,
-            prop: 'landWeight',
-            controls: false,
-            precision: 6,
-            type: 'number'
-          }, {
-            label: '车号',
-            width: 150,
-            prop: 'plateNo'
-          }, {
-            label: '司机',
-            width: 115,
-            prop: 'driverId'
-          }, {
-            label: '电话',
-            width: 160,
-            prop: 'tel'
-          }, {
-            label: '陆运费(D)',
-            prop: 'landAmountD'
-          }, {
-            label: '陆运费(C)',
-            cell: true,
-            prop: 'landAmountC'
-          }, {
-            label: '备注',
-            cell: true,
-            prop: 'remarks'
-          }
+        column: [{
+          label: '尺寸箱型',
+          width: 100,
+          prop: 'ctnType'
+        }, {
+          label: '箱量',
+          width: 50,
+          prop: 'ctnQuantity'
+        }, {
+          label: '重量',
+          width: 160,
+          prop: 'landWeight',
+          controls: false,
+          precision: 6,
+          type: 'number'
+        }, {
+          label: '陆运费(D)',
+          prop: 'landAmountD'
+        }, {
+          label: '备注',
+          cell: true,
+          prop: 'remarks'
+        }
         ]
       },
       entrustList: [],
       goodsOptionForm: {
         menuBtn: false,
+        disabled: false,
         column: [{
           label: '客户名称',
           formslot: true,
           prop: 'corpId'
-        },{
+        }, {
           label: '所属公司',
           formslot: true,
-          prop: 'billNo'
+          prop: 'belongCompany'
         }, {
           label: '订单号',
           prop: 'id',
-          disabled:true
+          disabled: true
         }, {
           label: '提单号',
           prop: 'billNo'
@@ -401,7 +388,7 @@ export default {
       entrustOptionTwo: {
         align: 'center',
         menuAlign: 'center',
-        addBtnText:'录入箱信息',
+        addBtnText: '录入箱信息',
         index: true,
         cellBtn: true,
         addBtn: false,
@@ -412,22 +399,22 @@ export default {
           {
             name: 'landWeight',
             type: 'sum',
-            decimals:6
-          },{
+            decimals: 6
+          }, {
             name: 'landAmountD',
             type: 'sum',
-            decimals:2
-          },{
+            decimals: 2
+          }, {
             name: 'ctnQuantity',
             type: 'sum',
-            decimals:1
+            decimals: 1
           }],
         column: [{
           label: '尺寸箱型',
           cell: true,
           prop: 'ctnType',
           type: 'select',
-          width:100,
+          width: 100,
           dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxType",
           props: {
             label: "dictValue",
@@ -439,22 +426,22 @@ export default {
           prop: 'ctnQuantity',
           controls: false,
           precision: 0,
-          width:100,
+          width: 100,
           type: 'number'
         }, {
           label: '总重量(吨)',
           cell: true,
           prop: 'landWeight',
           controls: false,
-          width:200,
+          width: 200,
           precision: 6,
           type: 'number'
-        },{
+        }, {
           label: '陆运费(D)',
           cell: true,
           prop: 'landAmountD',
           controls: false,
-          width:200,
+          width: 200,
           precision: 2,
           type: 'number'
         }, {
@@ -469,35 +456,35 @@ export default {
         align: 'center',
         menuAlign: 'center',
         index: true,
-        cancelBtn:false,
-        editBtn:false,
-        delBtn:false,
-        cellBtn:false,
+        cancelBtn: false,
+        editBtn: false,
+        delBtn: false,
+        cellBtn: false,
         addBtn: false,
         addRowBtn: false,
         showSummary: true,
-        addBtnText:'录入明细',
+        addBtnText: '录入明细',
         summaryText: "合计",
         sumColumnList: [{
-            name: 'price',
-            type: 'sum',
-            decimals:2
-          },{
-            name: 'amount',
-            type: 'sum',
-            decimals:2
-          },{
-            name: 'quantity',
-            type: 'sum',
-            decimals:1
-          }],
+          name: 'price',
+          type: 'sum',
+          decimals: 2
+        }, {
+          name: 'amount',
+          type: 'sum',
+          decimals: 2
+        }, {
+          name: 'quantity',
+          type: 'sum',
+          decimals: 1
+        }],
         column: [{
           label: '客户名称',
-          slot:true,
+          slot: true,
           prop: 'corpId'
         }, {
           label: '费用名称',
-          slot:true,
+          slot: true,
           prop: 'feeId'
         }, {
           label: '计价单位',
@@ -543,35 +530,35 @@ export default {
         align: 'center',
         menuAlign: 'center',
         index: true,
-        cancelBtn:false,
-        editBtn:false,
-        delBtn:false,
-        cellBtn:false,
+        cancelBtn: false,
+        editBtn: false,
+        delBtn: false,
+        cellBtn: false,
         addBtn: false,
         addRowBtn: false,
         showSummary: true,
-        addBtnText:'录入明细',
+        addBtnText: '录入明细',
         summaryText: "合计",
         sumColumnList: [{
           name: 'price',
           type: 'sum',
-          decimals:2
-        },{
+          decimals: 2
+        }, {
           name: 'amount',
           type: 'sum',
-          decimals:2
-        },{
+          decimals: 2
+        }, {
           name: 'quantity',
           type: 'sum',
-          decimals:1
+          decimals: 1
         }],
         column: [{
           label: '客户名称',
-          slot:true,
+          slot: true,
           prop: 'corpId'
         }, {
           label: '费用名称',
-          slot:true,
+          slot: true,
           prop: 'feeId'
         }, {
           label: '计价单位',
@@ -615,64 +602,91 @@ export default {
     };
   },
   created() {
-    if (this.id){
+    if (this.id) {
       detailDelegationList({id: this.id, kind: '1'}).then(res => {
         this.goodsForm = res.data.data
         this.tableData = res.data.data.orderAddressList
         this.entrustList = res.data.data.orderItemList
         this.goodsList = res.data.data.orderItemList
-        if (res.data.data.orderFeeList.length > 0){
-          res.data.data.orderFeeList.forEach(item=>{
-            if (item.type == 1){
+        if (res.data.data.orderFeeList.length > 0) {
+          res.data.data.orderFeeList.forEach(item => {
+            if (item.type == 1) {
               this.collectionList.push(item)
-            }else {
+            } else {
               this.paymentList.push(item)
             }
           })
         }
+        this.goodsOptionForm.disabled = this.goodsForm.status === 1
         delete this.goodsForm.orderAddressList
         delete this.goodsForm.orderItemList
         delete this.goodsForm.orderFeeList
-        this.tableData.forEach(item=>{
+        this.tableData.forEach(item => {
           if (item.region) item.region = item.region.split(',')
         })
       })
-    }else {
+    } else {
       this.tableData = [{
-        region:[],
-        address:''
-      },{
-        region:[],
-        address:''
+        region: [],
+        address: ''
+      }, {
+        region: [],
+        address: ''
       }]
-      this.entrustList=[{$cellEdit:true}]
+      this.entrustList = [{$cellEdit: true}]
     }
   },
   methods: {
+    //刷新数据
+    refreshData() {
+      detailDelegationList({id: this.id, kind: '1'}).then(res => {
+        this.goodsForm = res.data.data
+        this.tableData = res.data.data.orderAddressList
+        this.entrustList = res.data.data.orderItemList
+        this.goodsList = res.data.data.orderItemList
+        if (res.data.data.orderFeeList.length > 0) {
+          res.data.data.orderFeeList.forEach(item => {
+            if (item.type == 1) {
+              this.collectionList.push(item)
+            } else {
+              this.paymentList.push(item)
+            }
+          })
+        }
+        this.goodsOptionForm.disabled = this.goodsForm.status === 1
+        delete this.goodsForm.orderAddressList
+        delete this.goodsForm.orderItemList
+        delete this.goodsForm.orderFeeList
+        this.tableData.forEach(item => {
+          if (item.region) item.region = item.region.split(',')
+        })
+      })
+    },
     //提交委托
-    submit(){
+    submit() {
       saveDelegationList({
-        id:this.goodsForm.id
+        id: this.goodsForm.id
       }).then(res => {
         this.$message.success('提交成功');
+        this.refreshData()
       })
     },
     //切换收付费
-    handleSelect(tab, event){
+    handleSelect(tab, event) {
       this.activeIndex = tab.name
     },
     //箱信息保存
-    rowSaveT(row,index,done,loading) {
+    rowSaveT(row, index, done, loading) {
       row.$cellEdit = false
       done()
     },
     //箱信息选择车队
-    getfleetIdT(data,row){
-      this.$set(row,'fleetName',data.cname)
+    getfleetIdT(data, row) {
+      this.$set(row, 'fleetName', data.cname)
     },
     //地址新增
     addAddress() {
-      this.tableData.splice(this.tableData.length-1,0,{leas:1111})
+      this.tableData.splice(this.tableData.length - 1, 0, {leas: 1111})
     },
     //返回主列表
     backToList() {
@@ -684,7 +698,7 @@ export default {
       this.tableData.splice(scope.$index, 1);
     },
     //箱信息保存
-    rowSave(row,index,done,loading) {
+    rowSave(row, index, done, loading) {
       row.$cellEdit = false
       done()
     },
@@ -720,34 +734,35 @@ export default {
         kind: '1',
         orderAddressList: data,
         orderItemList: this.entrustList,
-        orderFeeList:this.collectionList.concat(this.paymentList)
+        orderFeeList: this.collectionList.concat(this.paymentList)
       }).then(res => {
         this.$message.success('保存成功');
+        this.refreshData()
       })
     },
     //收费新增
-    addRowCollection(){
-      this.$refs.collection.rowCellAdd( {
-        currency:'1',
-        type:'1',
-        $cellEdit:true
+    addRowCollection() {
+      this.$refs.collection.rowCellAdd({
+        currency: '1',
+        type: '1',
+        $cellEdit: true
       });
     },
     //付费新增
-    addRowPayment(){
-      this.$refs.payment.rowCellAdd( {
-        currency:'1',
-        type:'2',
-        $cellEdit:true
+    addRowPayment() {
+      this.$refs.payment.rowCellAdd({
+        currency: '1',
+        type: '2',
+        $cellEdit: true
       });
     },
     //选择费用
-    selectValue(value,row){
-      this.$set(row,'feeName',value.cname)
+    selectValue(value, row) {
+      this.$set(row, 'feeName', value.cname)
     },
     //选择客户信息触发
-    getfleetId(data,row){
-      this.$set(row,'corpName',data.cname)
+    getfleetId(data, row) {
+      this.$set(row, 'corpName', data.cname)
     },
     //收款信息移除
     makeDel(row, index) {

+ 1 - 1
src/views/landTransportation/placeAnOrder/index.vue

@@ -176,7 +176,7 @@ export default {
           search: true,
         }, {
           label: '所属公司',
-          prop: 'corpName',
+          prop: 'belongCompany',
           overHidden: true,
           index: 1,
           width: 140,