Browse Source

提交陆运

caojunjie 3 years ago
parent
commit
b903b866c9

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

@@ -55,3 +55,59 @@ 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
+    })
+}

+ 71 - 30
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="起止地信息"
@@ -91,11 +72,16 @@
           </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 +203,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: {
@@ -297,12 +289,12 @@ 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: '车队',
@@ -635,6 +627,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
@@ -644,14 +660,39 @@ export default {
       this.$refs.crudContact.rowCell(row, index)
       done()
     },
-    //箱信息指派
+    //箱信息调度
     designate(row){
-      this.$confirm('是否确定指派车队', '提示', {
+      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 = {

+ 115 - 11
src/views/landTransportation/driver/index.vue

@@ -6,17 +6,45 @@
                 :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} from "@/api/landTransportation";
 
 export default {
   name: "index",
@@ -34,12 +62,14 @@ export default {
       goodsList:[],
       goodsOptionCrud: {
         index:true,
-        cellBtn:true,
         addBtn:false,
-        addRowBtn:false,
+        delBtn:false,
+        cellBtn: false,
+        cancelBtn:false,
+        editBtn:false,
+        addRowBtn: false,
         searchMenuPosition:"right",
         searchMenuSpan:6,
-        delBtn:false,
         align:'center',
         height:"auto",
         showSummary: true,
@@ -57,13 +87,29 @@ export default {
             name: 'ctnQuantity',
             type: 'count'
           }],
-        column: [
-          {
-            label: '车队',
-            width: 200,
-            search:true,
-            prop: 'fleetName'
-          },{
+        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',
+          dicUrl: "/api/blade-client/corpsdesc/fleet-list",
+          props: {
+            label: "cname",
+            value: "id"
+          },
+          prop: 'fleetId'
+        },{
             label: '尺寸箱型',
             width: 100,
             search:true,
@@ -146,6 +192,64 @@ export default {
         this.loading = false;
       })
     },
+    //箱信息保存
+    rowSaveT(row, index, done, loading) {
+      this.$refs.crudContact.rowCell(row, index)
+      done()
+    },
+    //箱信息派车
+    designate(row){
+      this.$confirm('是否确定派车', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        acceptanceCollection(row).then(res=>{
+          this.$message.success('操作成功');
+          this.onLoad(this.page)
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消'
+        });
+      });
+    },
+    //取消派车
+    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>

+ 87 - 14
src/views/landTransportation/motorcadeDriver/index.vue

@@ -6,18 +6,32 @@
           :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>
+          {{row.status}}
+          <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,7 +39,7 @@
 </template>
 
 <script>
-import {driverQueryCollection} from "@/api/landTransportation";
+import {sendACarCollection, sendACarDispatchCollection, driverQueryCollection} from "@/api/landTransportation";
 
 export default {
   name: "index",
@@ -45,10 +59,12 @@ export default {
         align: 'center',
         menuAlign: 'center',
         index:true,
-        cellBtn:true,
         addBtn:false,
-        addRowBtn:false,
         delBtn:false,
+        cellBtn: false,
+        cancelBtn:false,
+        editBtn:false,
+        addRowBtn: false,
         searchMenuPosition:"right",
         searchMenuSpan:6,
         height:"auto",
@@ -71,12 +87,28 @@ export default {
             name: 'ctnQuantity',
             type: 'count'
           }],
-        column: [
-          {
+        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,
-            slot:true,
             search:true,
+            cell: true,
+            type: 'select',
+            dicUrl: "/api/blade-client/corpsdesc/fleet-list",
+            props: {
+              label: "cname",
+              value: "id"
+            },
             prop: 'fleetId'
           }, {
             label: '尺寸箱型',
@@ -154,6 +186,47 @@ export default {
         this.loading = false;
       })
     },
+    //箱信息保存
+    rowSaveT(row, index, done, loading) {
+      this.$refs.crudContact.rowCell(row, index)
+      done()
+    },
+    //箱信息派车
+    designate(row){
+      this.$confirm('是否确定派车', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        sendACarCollection(row).then(res=>{
+          this.$message.success('操作成功');
+          this.onLoad(this.page)
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消'
+        });
+      });
+    },
+    //取消派车
+    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>

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

@@ -369,7 +369,7 @@ export default {
         },{
           label: '所属公司',
           formslot: true,
-          prop: 'billNo'
+          prop: 'belongCompany'
         }, {
           label: '订单号',
           prop: 'id',

+ 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,