Browse Source

修改陆运

caojunjie 3 years ago
parent
commit
34da7be3b7

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

@@ -24,6 +24,14 @@ export function saveDelegationList(data) {
         data: data
     })
 }
+// 单据取消提交
+export function cancelSubmission(data) {
+    return request({
+        url: '/api/blade-land/order/revoke',
+        method: 'get',
+        data: data
+    })
+}
 // 单据新增修改
 export function saveSaveList(data) {
     return request({
@@ -147,3 +155,10 @@ export function fleetDriverSave(data) {
         data:data
     })
 }
+//获取电话信息
+export function telephone(key) {
+    return request({
+        url: '/api/blade-client/land-driver/driver-list',
+        method: 'get'
+    })
+}

+ 3 - 3
src/enums/column-name.js

@@ -295,13 +295,13 @@ const columnName = [{
     name: '委托'
   },{
     code: 86,
-    name: '派车'
+    name: '调度'
   },{
     code: 87,
-    name: '车'
+    name: '车'
   },{
     code: 88,
-    name: '司机'
+    name: '跟踪'
   },
 ]
 export const getColumnName = (key) => {

+ 1 - 1
src/router/views/index.js

@@ -1119,7 +1119,7 @@ export default [{
     hidden: true,
     children: [{
       path: '/landTransportation/dispatchingCars/index',
-      name: '派车',
+      name: '调度',
       meta: {
         i18n: '/landTransportation/dispatchingCars/index',
         keepAlive: true,

+ 38 - 11
src/views/basicData/landTransportation/vehicleInformation/index.vue

@@ -77,6 +77,7 @@ export default {
         searchIcon: true,
         searchIndex: 2,
         searchMenuSpan: 24,
+        stripe:true,
         searchLabelWidth: 100,
         align: 'center',
         index: true,
@@ -115,6 +116,12 @@ export default {
           search: true,
           span: 8,
           searchSpan: 8,
+          type: 'select',
+          dicUrl: "/api/blade-client/land-driver/driver-list?vehicleId={{key}}",
+          props: {
+            label: "name",
+            value: "id"
+          },
         }, {
           label: '挂车号',
           prop: 'trailerNo',
@@ -321,6 +328,7 @@ export default {
             span: 24,
             children: {
               align: 'center',
+              stripe:true,
               headerAlign: 'center',
               rowAdd: (done) => {
                 // this.$message.success('新增回调');
@@ -334,8 +342,6 @@ export default {
                 } else {
                   done();
                 }
-                // this.$message.success('删除回调'+JSON.stringify(row));
-                done();
               },
               column: [{
                 width: 200,
@@ -361,15 +367,36 @@ export default {
               }]
             }
           },
-          // {
-          //   label: '司机变更记录',
-          //   prop: 'vehicleChangeList',
-          //   type: 'dynamic',
-          //   hide: true,
-          //   showColumn: false,
-          //   span: 24,
-          //   column: []
-          // }
+          {
+            label: '司机变更记录',
+            prop: 'vehicleChangeList',
+            type: 'dynamic',
+            span: 24,
+            hide: true,
+            showColumn: false,
+            children: {
+              align: 'center',
+              headerAlign: 'center',
+              addBtn:false,
+              stripe:true,
+              delBtn:false,
+              cellBtn:false,
+              column: [
+                {
+                  label: '司机名',
+                  prop: "driverName",
+                  cell:false
+                },{
+                  label: '变更人',
+                  prop: "changeUserName",
+                  cell:false
+                }, {
+                  label: '变更日期',
+                  prop: "changeTime",
+                  cell:false
+                }]
+            }
+          }
         ]
       },
       page: {

+ 5 - 5
src/views/landTransportation/dispatchingCars/detailPage.vue

@@ -115,7 +115,7 @@
         </template>
       </avue-crud>
     </basic-container>
-    <containerTitle title="货物信息"></containerTitle>
+    <containerTitle title="委托信息"></containerTitle>
     <basic-container>
       <avue-form :option="goodsOptionForm" v-model="goodsForm">
         <template slot-scope="scope" slot="corpId">
@@ -367,10 +367,10 @@ export default {
             width: 160,
             prop: 'tel'
           }, {
-            label: '陆运费(D)',
+            label: '应收陆运费',
             prop: 'landAmountD'
           }, {
-            label: '陆运费(C)',
+            label: '应付陆运费',
             cell: true,
             prop: 'landAmountC'
           }, {
@@ -395,7 +395,7 @@ export default {
           prop: 'corpId'
         }, {
           label: '订单号',
-          prop: 'id',
+          prop: 'orderNo',
           disabled: true
         }, {
           label: '提单号',
@@ -473,7 +473,7 @@ export default {
           precision: 6,
           type: 'number'
         }, {
-          label: '陆运费(D)',
+          label: '应收陆运费',
           cell: true,
           prop: 'landAmountD',
           controls: false,

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

@@ -90,8 +90,8 @@
         <template slot="corpName" slot-scope="{row,index}">
           <span class="el-button--text" style="cursor: pointer" @click.stop="rowCell(row,index)">{{ row.corpName }}</span>
         </template>
-        <template slot="id" slot-scope="{row,index}">
-          <span class="el-button--text" style="cursor: pointer" @click.stop="rowCell(row,index)">{{ row.id }}</span>
+        <template slot="orderNo" slot-scope="{row,index}">
+          <span class="el-button--text" style="cursor: pointer" @click.stop="rowCell(row,index)">{{ row.orderNo }}</span>
         </template>
       </avue-crud>
     </basic-container>
@@ -144,7 +144,7 @@ export default {
             width: 140
           }, {
             label: '订单号',
-            prop: 'id',
+            prop: 'orderNo',
             index: 2,
             overHidden: true,
             width: 160,
@@ -198,7 +198,7 @@ export default {
             width: 140,
             search: true,
           }, {
-            label: '车队受理箱量',
+            label: '受理箱量',
             prop: 'sendCtnDetail',
             overHidden: true,
             index: 10,
@@ -363,7 +363,7 @@ export default {
       this.onLoad(this.page)
     },
     ToBreak (val) {
-      return val.replace('\n', '<br/>')
+      if (val)return val.replace('\n', '<br/>')
     }
   }
 }

+ 146 - 6
src/views/landTransportation/driver/index.vue

@@ -63,15 +63,18 @@
         </div>
       </div>
     </basic-container>
-    <basic-container>
+    <basic-container v-if="key>0">
       <avue-crud
           :data="goodsList"
           :option="goodsOptionCrud"
           :table-loading="loading"
           :page.sync="page"
-          ref="crudContact"
+          ref="crud"
           @on-load="onLoad"
+          @resetColumn="resetColumn"
+          @saveColumn="saveColumn"
           @search-change="searchChange"
+          @search-criteria-switch="searchCriteriaSwitch"
           @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"
           @row-update="rowSave">
         <template slot-scope="{row,index}" slot="menu">
@@ -104,6 +107,12 @@
           >确认完工
           </el-button>
         </template>
+        <template slot="addressDetail" slot-scope="{ row,index}">
+          <el-tooltip class="item" effect="dark" placement="top">
+            <div v-html="ToBreak(row.addressDetail)" slot="content"></div>
+            <div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{row.addressDetail}}</div>
+          </el-tooltip>
+        </template>
       </avue-crud>
     </basic-container>
   </div>
@@ -122,6 +131,7 @@ export default {
   name: "index",
   data() {
     return {
+      key:0,
       form: {},
       loading: false,
       activeName:'',
@@ -133,7 +143,8 @@ export default {
       },
       roleName: localStorage.getItem("roleName").split(',')[0],
       goodsList: [],
-      goodsOptionCrud: {
+      goodsOptionCrud:{},
+      optionList: {
         stripe:true,
         index: true,
         addBtn: false,
@@ -142,6 +153,9 @@ export default {
         cancelBtn: false,
         editBtn: false,
         addRowBtn: false,
+        searchIcon: true,
+        searchIndex: 2,
+        searchSpan: 8,
         searchMenuPosition: "right",
         searchMenuSpan: 6,
         align: 'center',
@@ -186,12 +200,38 @@ export default {
             value: "id"
           },
           prop: 'fleetId'
+        },{
+          label: '提单号',
+          width: 100,
+          index: 3,
+          search: true,
+          overHidden: true,
+          prop: 'billNo'
+        },{
+          label: '货物名称',
+          overHidden: true,
+          width: 160,
+          search: true,
+          index: 9,
+          prop: 'goods'
+        },{
+          label: '路线',
+          index: 14,
+          width: 160,
+          search: true,
+          prop: 'addressDetail'
         }, {
           label: '尺寸箱型',
           width: 100,
           search: true,
           overHidden: true,
-          prop: 'ctnType'
+          prop: 'ctnType',
+          type: 'select',
+          dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxType",
+          props: {
+            label: "dictValue",
+            value: "dictValue"
+          },
         }, {
           label: '箱量',
           width: 50,
@@ -210,6 +250,7 @@ export default {
           prop: 'vehicleId',
           overHidden: true,
           type: 'select',
+          search: true,
           dicUrl: "/api/blade-client/land-vehicle/vehicle-list?fleetId={{key}}",
           props: {
             label: "plateNo",
@@ -220,18 +261,64 @@ export default {
           width: 115,
           search: true,
           overHidden: true,
-          prop: 'driverName'
+          prop: 'driverId',
+          type: 'select',
+          dicUrl: "/api/blade-client/land-driver/driver-list?vehicleId={{key}}",
+          props: {
+            label: "name",
+            value: "id"
+          },
         }, {
           label: '电话',
           width: 160,
           overHidden: true,
+          search: true,
           prop: 'tel'
         }, {
           label: '箱号',
           cell: true,
           overHidden: true,
+          search: true,
           prop: 'ctnNo'
         }, {
+          label: '场站',
+          prop: 'station',
+          overHidden: true,
+          index: 10,
+          width: 140,
+          search: true,
+        },{
+          label: '船名航次',
+          prop: 'factory',
+          overHidden: true,
+          index: 13,
+          width: 140,
+          search: true,
+        },{
+          label: '到厂时间',
+          prop: 'arrivalTime',
+          overHidden: true,
+          type: "date",
+          searchRange: true,
+          defaultTime: ['00:00:00', '23:59:59'],
+          format: "yyyy-MM-dd HH:mm:ss",
+          valueFormat: "yyyy-MM-dd HH:mm:ss",
+          index: 11,
+          width: 140,
+          search: true,
+        },{
+          label: '制单日期',
+          overHidden: true,
+          prop: 'createTime',
+          type: "date",
+          searchRange: true,
+          defaultTime: ['00:00:00', '23:59:59'],
+          format: "yyyy-MM-dd HH:mm:ss",
+          valueFormat: "yyyy-MM-dd HH:mm:ss",
+          index: 12,
+          width: 140,
+          search: true,
+        }, {
           label: '陆运费(C)',
           overHidden: true,
           prop: 'landAmountC'
@@ -254,7 +341,56 @@ export default {
       totalData:{}
     }
   },
+  async created() {
+    this.goodsOptionCrud = await this.getColumnData(this.getColumnName(88), this.optionList);
+    this.key++
+    this.getWorkDicts("order_status").then(res => {
+      this.findObject(this.goodsOptionCrud.column, "status").dicData =
+          res.data.data;
+    });
+    let i = 0;
+    this.goodsOptionCrud.column.forEach(item => {
+      if (item.search) i++
+    })
+    if (i % 3 !== 0) {
+      const num = 3 - Number(i % 3)
+      this.goodsOptionCrud.searchMenuSpan = num * 8;
+      this.goodsOptionCrud.searchMenuPosition = "right";
+    }
+  },
   methods: {
+    //自定义列保存
+    async saveColumn() {
+      /**
+       * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
+       * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
+       * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
+       */
+      const inSave = await this.saveColumnData(this.getColumnName(88), this.goodsOptionCrud);
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    //自定义列重置
+    async resetColumn() {
+      this.goodsOptionCrud = this.optionList;
+      const inSave = await this.delColumnData(this.getColumnName(88), this.optionList);
+      if (inSave) {
+        this.$message.success("重置成功");
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    // 获得高度
+    searchCriteriaSwitch(type) {
+      if (type) {
+        this.goodsOptionCrud.height = this.goodsOptionCrud.height - 184
+      } else {
+        this.goodsOptionCrud.height = this.goodsOptionCrud.height + 184
+      }
+      this.$refs.crud.getTableHeight()
+    },
     //箱信息保存
     rowSave(row, index, done, loading) {
       done()
@@ -288,6 +424,7 @@ export default {
       driverQueryCollection(queryParams).then(res => {
         this.goodsList = res.data.data.records
         this.page.total = res.data.data.total
+        this.goodsOptionCrud.height = window.innerHeight - 345;
       }).finally(() => {
         this.loading = false;
       })
@@ -299,7 +436,7 @@ export default {
           this.$message.success("保存成功");
         })
       }
-      this.$refs.crudContact.rowCell(row, index)
+      this.$refs.crud.rowCell(row, index)
     },
     //箱信息派车
     designate(row) {
@@ -357,6 +494,9 @@ export default {
           message: '已取消'
         });
       });
+    },
+    ToBreak (val) {
+      if (val)return val.replace('\n', '<br/>')
     }
   }
 }

+ 180 - 25
src/views/landTransportation/motorcadeDriver/index.vue

@@ -77,15 +77,18 @@
         </div>
       </div>
     </basic-container>
-    <basic-container>
+    <basic-container v-if="key>0">
       <avue-crud
           :data="goodsList"
           :option="entrustOptionTwoT"
           :table-loading="loading"
           :page.sync="page"
-          ref="crudContact"
+          ref="crud"
           @on-load="onLoad"
+          @resetColumn="resetColumn"
+          @saveColumn="saveColumn"
           @search-change="searchChange"
+          @search-criteria-switch="searchCriteriaSwitch"
           @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"
           @row-update="rowSave">
         <template slot-scope="{row,index}" slot="menu">
@@ -111,6 +114,12 @@
           >取消派车
           </el-button>
         </template>
+        <template slot="addressDetail" slot-scope="{ row,index}">
+          <el-tooltip class="item" effect="dark" placement="top">
+            <div v-html="ToBreak(row.addressDetail)" slot="content"></div>
+            <div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{row.addressDetail}}</div>
+          </el-tooltip>
+        </template>
       </avue-crud>
     </basic-container>
   </div>
@@ -123,13 +132,14 @@ import {
   driverQueryCollection,
   fleetList,
   motorcadeDriver,
-  fleetDriverSave
+  fleetDriverSave, telephone
 } from "@/api/landTransportation";
 
 export default {
   name: "index",
   data() {
     return {
+      key:0,
       form: {},
       loading: false,
       page: {
@@ -140,7 +150,8 @@ export default {
       },
       roleName: localStorage.getItem("roleName").split(',')[0],
       goodsList: [],
-      entrustOptionTwoT: {
+      entrustOptionTwoT: {},
+      optionList: {
         stripe: true,
         align: 'center',
         menuAlign: 'center',
@@ -151,8 +162,9 @@ export default {
         cancelBtn: false,
         editBtn: false,
         addRowBtn: false,
-        searchMenuPosition: "right",
-        searchMenuSpan: 6,
+        searchIcon: true,
+        searchIndex: 2,
+        searchSpan: 8,
         height: "auto",
         showSummary: true,
         summaryText: "合计",
@@ -178,6 +190,7 @@ export default {
           overHidden: true,
           width: 200,
           type: 'select',
+          index: 1,
           dicUrl: "/api/blade-system/dict-biz/dictionary?code=land_order_status",
           props: {
             label: "dictValue",
@@ -189,6 +202,7 @@ export default {
           label: '车队',
           width: 200,
           search: true,
+          index: 2,
           type: 'select',
           cascader: ['plateNo'],
           overHidden: true,
@@ -201,12 +215,27 @@ export default {
         }, {
           label: '尺寸箱型',
           width: 100,
+          index: 3,
           search: true,
           overHidden: true,
-          prop: 'ctnType'
+          prop: 'ctnType',
+          type: 'select',
+          dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxType",
+          props: {
+            label: "dictValue",
+            value: "dictValue"
+          },
+        }, {
+          label: '提单号',
+          width: 100,
+          index: 3,
+          search: true,
+          overHidden: true,
+          prop: 'billNo'
         }, {
           label: '箱量',
           width: 50,
+          index: 4,
           overHidden: true,
           prop: 'ctnQuantity'
         }, {
@@ -215,15 +244,18 @@ export default {
           prop: 'landWeight',
           controls: false,
           overHidden: true,
+          index: 5,
           precision: 6,
           type: 'number'
         }, {
           label: '车号',
           width: 150,
           cell: true,
+          search: true,
+          index: 6,
           prop: 'vehicleId',
           overHidden: true,
-          filterable:true,
+          filterable: true,
           cascader: ['driverId'],
           type: 'select',
           dicUrl: "/api/blade-client/land-vehicle/vehicle-list?fleetId={{key}}",
@@ -232,7 +264,6 @@ export default {
             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) {
@@ -250,7 +281,8 @@ export default {
           // prop: 'driverId'
           overHidden: true,
           cell: true,
-          filterable:true,
+          filterable: true,
+          index: 7,
           prop: 'driverId',
           type: 'select',
           dicUrl: "/api/blade-client/land-driver/driver-list?vehicleId={{key}}",
@@ -258,42 +290,161 @@ export default {
             label: "name",
             value: "id"
           },
+          change: (data) => {
+            telephone().then(res => {
+              for (let item in res.data.data) {
+                if (data.value === res.data.data[item].id) {
+                  this.goodsList[data.index].tel = res.data.data[item].tel
+                }
+              }
+            })
+          }
         }, {
           label: '电话',
           overHidden: true,
           width: 160,
+          search: true,
           cell: true,
+          index: 8,
           prop: 'tel'
         }, {
-          label: '陆运费(D)',
+          label: '货物名称',
           overHidden: true,
-          prop: 'landAmountD'
+          width: 160,
+          search: true,
+          index: 9,
+          prop: 'goods'
         }, {
-          label: '陆运费(C)',
+          label: '箱号',
           overHidden: true,
-          cell: true,
-          prop: 'landAmountC'
+          width: 160,
+          search: true,
+          prop: 'ctnNo'
         }, {
-          label: '委托备注',
+          label: '场站',
+          prop: 'station',
           overHidden: true,
-          prop: 'remarks'
+          index: 10,
+          width: 140,
+          search: true,
         }, {
-          label: '车队备注',
-          cell: true,
+          label: '到厂时间',
+          prop: 'arrivalTime',
           overHidden: true,
-          prop: 'fleetRemarks'
+          type: "date",
+          searchRange: true,
+          defaultTime: ['00:00:00', '23:59:59'],
+          format: "yyyy-MM-dd HH:mm:ss",
+          valueFormat: "yyyy-MM-dd HH:mm:ss",
+          index: 11,
+          width: 140,
+          search: true,
         }, {
-          label: '司机备注',
+          label: '制单日期',
           overHidden: true,
-          prop: 'driverRemarks'
-        }
+          prop: 'createTime',
+          type: "date",
+          searchRange: true,
+          defaultTime: ['00:00:00', '23:59:59'],
+          format: "yyyy-MM-dd HH:mm:ss",
+          valueFormat: "yyyy-MM-dd HH:mm:ss",
+          index: 12,
+          width: 140,
+          search: true,
+        }, {
+          label: '船名航次',
+          prop: 'factory',
+          overHidden: true,
+          index: 13,
+          width: 140,
+          search: true,
+        }, {
+          label: '路线',
+          index: 14,
+          width: 160,
+          search: true,
+          prop: 'addressDetail'
+        },
+          // {
+          //   label: '陆运费(D)',
+          //   overHidden: true,
+          //   prop: 'landAmountD'
+          // },
+          {
+            label: '陆运费(C)',
+            overHidden: true,
+            index: 15,
+            cell: true,
+            prop: 'landAmountC'
+          }, {
+            label: '委托备注',
+            overHidden: true,
+            index: 16,
+            prop: 'remarks'
+          }, {
+            label: '车队备注',
+            cell: true,
+            index: 17,
+            overHidden: true,
+            prop: 'fleetRemarks'
+          }, {
+            label: '司机备注',
+            overHidden: true,
+            index: 8,
+            prop: 'driverRemarks'
+          }
         ]
       },
       totalData: {},
       activeName: ''
     }
   },
+  async created() {
+    this.entrustOptionTwoT = await this.getColumnData(this.getColumnName(87), this.optionList);
+    this.key++
+    let i = 0;
+    this.entrustOptionTwoT.column.forEach(item => {
+      if (item.search) i++
+    })
+    if (i % 3 !== 0) {
+      const num = 3 - Number(i % 3)
+      this.entrustOptionTwoT.searchMenuSpan = num * 8;
+      this.entrustOptionTwoT.searchMenuPosition = "right";
+    }
+  },
   methods: {
+    //自定义列保存
+    async saveColumn() {
+      /**
+       * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
+       * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
+       * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
+       */
+      const inSave = await this.saveColumnData(this.getColumnName(87), this.entrustOptionTwoT);
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    //自定义列重置
+    async resetColumn() {
+      this.entrustOptionTwoT = this.optionList;
+      const inSave = await this.delColumnData(this.getColumnName(87), this.optionList);
+      if (inSave) {
+        this.$message.success("重置成功");
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    // 获得高度
+    searchCriteriaSwitch(type) {
+      if (type) {
+        this.entrustOptionTwoT.height = this.entrustOptionTwoT.height - 184
+      } else {
+        this.entrustOptionTwoT.height = this.entrustOptionTwoT.height + 184
+      }
+      this.$refs.crud.getTableHeight()
+    },
     //箱信息保存
     rowSave(row, index, done, loading) {
       done()
@@ -323,6 +474,7 @@ export default {
       driverQueryCollection(queryParams).then(res => {
         this.goodsList = res.data.data.records
         this.page.total = res.data.data.total
+        this.entrustOptionTwoT.height = window.innerHeight - 365;
       }).finally(() => {
         this.loading = false;
       })
@@ -330,11 +482,11 @@ export default {
     //箱信息保存
     rowSaveT(row, index, done, loading) {
       if (row.$cellEdit) {
-        fleetDriverSave(row).then(res=>{
+        fleetDriverSave(row).then(res => {
           this.$message.success("保存成功");
         })
       }
-      this.$refs.crudContact.rowCell(row, index)
+      this.$refs.crud.rowCell(row, index)
     },
     //切换订单状态
     handleClick(tab) {
@@ -381,6 +533,9 @@ export default {
         });
       });
     },
+    ToBreak (val) {
+      if (val)return val.replace('\n', '<br/>')
+    }
   }
 }
 </script>

+ 65 - 22
src/views/landTransportation/placeAnOrder/detailPage.vue

@@ -14,14 +14,23 @@
         <el-button
             class="el-button--small-yh add-customer-btn"
             type="success"
-            :disabled="goodsForm.status === 1 || !goodsForm.id"
+            v-if="goodsForm.status === 0"
             size="small"
             style="margin-right: 70px;"
-            @click="submit"
+            @click="submit(true)"
         >提交
         </el-button>
         <el-button
             class="el-button--small-yh add-customer-btn"
+            type="success"
+            v-if="goodsForm.status === 1"
+            size="small"
+            style="margin-right: 70px;"
+            @click="submit(false)"
+        >取消提交
+        </el-button>
+        <el-button
+            class="el-button--small-yh add-customer-btn"
             type="primary"
             :disabled="goodsForm.status === 1"
             size="small"
@@ -82,6 +91,7 @@
             property="corpId"
             label="发货工厂"
             align="center"
+            :render-header="customTitle"
             width="280">
           <template slot-scope="scope">
             <crop-select
@@ -94,6 +104,7 @@
             property="province"
             label="省市区"
             align="center"
+            :render-header="customTitle"
             width="280">
           <template slot-scope="scope">
             <el-cascader
@@ -108,6 +119,7 @@
         <el-table-column
             property="address"
             align="center"
+            :render-header="customTitle"
             label="详细地址">
           <template slot-scope="scope">
             <el-input v-model="scope.row.address" :disabled="goodsForm.status === 1" size="small"
@@ -122,7 +134,20 @@
                  :option="entrustOptionTwo"
                  @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"
                  @row-update="rowSave"
-                 @row-del="rowDel"></avue-crud>
+                 @row-del="rowDel">
+        <template slot="ctnTypeHeader" slot-scope="{column}">
+          {{column.label}}<span style="color:#F56C6C">*</span>
+        </template>
+        <template slot="ctnQuantityHeader" slot-scope="{column}">
+          {{column.label}}<span style="color:#F56C6C">*</span>
+        </template>
+        <template slot="landWeightHeader" slot-scope="{column}">
+          {{column.label}}<span style="color:#F56C6C">*</span>
+        </template>
+        <template slot="landAmountDHeader" slot-scope="{column}">
+          {{column.label}}<span style="color:#F56C6C">*</span>
+        </template>
+      </avue-crud>
     </basic-container>
     <basic-container v-if="goodsForm.status !== 0 && goodsForm.status">
       <avue-crud
@@ -142,7 +167,7 @@
         </template>
       </avue-crud>
     </basic-container>
-    <containerTitle title="货物信息"></containerTitle>
+    <containerTitle title="委托信息"></containerTitle>
     <basic-container>
       <avue-form :option="goodsOptionForm" ref="goodsForm" v-model="goodsForm">
         <template slot-scope="scope" slot="corpId">
@@ -268,7 +293,7 @@ import {
   detailDelegationList,
   removeCollection,
   saveSaveList,
-  addressList
+  addressList, cancelSubmission
 } from "@/api/landTransportation";
 
 export default {
@@ -359,7 +384,7 @@ export default {
           precision: 6,
           type: 'number'
         }, {
-          label: '陆运费(D)',
+          label: '应收陆运费',
           prop: 'landAmountD'
         }, {
           label: '备注',
@@ -392,7 +417,7 @@ export default {
           }],
         }, {
           label: '订单号',
-          prop: 'id',
+          prop: 'orderNo',
           disabled: true
         }, {
           label: '提单号',
@@ -406,7 +431,7 @@ export default {
           label: '场站',
           prop: 'station',
           rules: [{
-            required: true,
+            required: false,
             message: " ",
             trigger: "blur"
           }],
@@ -425,7 +450,7 @@ export default {
           label: '船名航次',
           prop: 'factory',
           rules: [{
-            required: true,
+            required: false,
             message: " ",
             trigger: "blur"
           }],
@@ -433,7 +458,7 @@ export default {
           label: '货物名称',
           prop: 'goods',
           rules: [{
-            required: true,
+            required: false,
             message: " ",
             trigger: "blur"
           }],
@@ -468,6 +493,7 @@ export default {
             decimals: 0
           }],
         column: [{
+          // label: '尺寸箱型',
           label: '尺寸箱型',
           cell: true,
           prop: 'ctnType',
@@ -497,7 +523,7 @@ export default {
           precision: 6,
           type: 'number'
         }, {
-          label: '陆运费(D)',
+          label: '应收陆运费',
           cell: true,
           prop: 'landAmountD',
           controls: false,
@@ -722,13 +748,22 @@ export default {
       })
     },
     //提交委托
-    submit() {
-      saveDelegationList({
-        id: this.goodsForm.id
-      }).then(res => {
-        this.$message.success('提交成功');
-        this.refreshData()
-      })
+    submit(type) {
+      if (type){
+        saveDelegationList({
+          id: this.goodsForm.id
+        }).then(res => {
+          this.$message.success('提交成功');
+          this.refreshData()
+        })
+      }else {
+        cancelSubmission({
+          id: this.goodsForm.id
+        }).then(res => {
+          this.$message.success('取消成功');
+          this.refreshData()
+        })
+      }
     },
     //切换收付费
     handleSelect(tab, event) {
@@ -811,13 +846,12 @@ export default {
             orderFeeList: this.collectionList.concat(this.paymentList)
           }).then(res => {
             this.$message.success('保存成功');
-            // this.$refs.goodsForm.submitData()
             this.goodsForm = {}
             if (!this.goodsForm.id) {
-              // this.id = res.data.data
-              // this.refreshData()
+              this.id = res.data.data
+              this.refreshData()
             } else {
-              // this.refreshData()
+              this.refreshData()
             }
           })
         } else {
@@ -921,6 +955,15 @@ export default {
             </el-tooltip>
           </div>
       )
+    },
+    //自定义表头
+    customTitle(h, { column, $index }) {
+      let text = column.label
+      return (
+          <div>
+            {{text}}<span style="color:#F56C6C">*</span>
+          </div>
+      )
     }
   }
 }

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

@@ -150,8 +150,8 @@
         <template slot="corpName" slot-scope="{row,index}">
           <span class="el-button--text" style="cursor: pointer" @click.stop="rowCell(row,index)">{{row.corpName}}</span>
         </template>
-        <template slot="id" slot-scope="{row,index}">
-          <span class="el-button--text" style="cursor: pointer" @click.stop="rowCell(row,index)">{{row.id}}</span>
+        <template slot="orderNo" slot-scope="{row,index}">
+          <span class="el-button--text" style="cursor: pointer" @click.stop="rowCell(row,index)">{{row.orderNo}}</span>
         </template>
       </avue-crud>
     </basic-container>
@@ -203,9 +203,9 @@ export default {
             index: 1,
             overHidden: true,
             width: 140
-          }, {
+          },{
             label: '订单号',
-            prop: 'id',
+            prop: 'orderNo',
             index: 2,
             overHidden: true,
             width: 160,
@@ -259,7 +259,7 @@ export default {
             width: 140,
             search: true,
           },{
-            label: '车队受理箱量',
+            label: '受理箱量',
             prop: 'sendCtnDetail',
             overHidden: true,
             index: 10,
@@ -425,7 +425,7 @@ export default {
       this.show = true
     },
     ToBreak (val) {
-      return val.replace('\n', '<br/>')
+      if (val)return val.replace('\n', '<br/>')
     }
   }
 }