Pārlūkot izejas kodu

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

QuKatie 3 gadi atpakaļ
vecāks
revīzija
92cc2af4c1

+ 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',
+        params: 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'
+    })
+}

+ 1 - 1
src/components/finance/config/option.json

@@ -159,7 +159,7 @@
     },
     {
       "label": "商品名称",
-      "prop": "cname",
+      "prop": "goodName",
       "overHidden": true,
       "index": 12,
       "value": 0,

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

@@ -295,13 +295,22 @@ const columnName = [{
     name: '委托'
   },{
     code: 86,
-    name: '派车'
+    name: '调度'
   },{
     code: 87,
-    name: '车'
+    name: '车'
   },{
     code: 88,
-    name: '司机'
+    name: '跟踪'
+  },{
+    code: 89,
+    name: '事务采购申请商品明细'
+  },{
+    code: 90,
+    name: '事务采购商品弹窗'
+  },{
+    code: 91,
+    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: {

+ 58 - 8
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">
@@ -124,6 +124,24 @@
               disabled
           ></crop-select>
         </template>
+        <template slot-scope="scope" slot="agentId">
+          <crop-select
+              :disabled="goodsForm.status === 1"
+              v-model="goodsForm.agentId"
+          ></crop-select>
+        </template>
+        <template slot-scope="scope" slot="polId">
+          <port-info
+              v-model="goodsForm.polId"
+              :disabled="goodsForm.status === 1"
+          />
+        </template>
+        <template slot-scope="scope" slot="podId">
+          <port-info
+              v-model="goodsForm.polId"
+              :disabled="goodsForm.status === 1"
+          />
+        </template>
       </avue-form>
     </basic-container>
     <span>
@@ -312,7 +330,8 @@ export default {
             decimals: 2
           }, {
             name: 'ctnQuantity',
-            type: 'count'
+            type: 'sum',
+            decimals: 0
           }],
         column: [
           {
@@ -367,10 +386,10 @@ export default {
             width: 160,
             prop: 'tel'
           }, {
-            label: '陆运费(D)',
+            label: '应收陆运费',
             prop: 'landAmountD'
           }, {
-            label: '陆运费(C)',
+            label: '应付陆运费',
             cell: true,
             prop: 'landAmountC'
           }, {
@@ -389,13 +408,23 @@ export default {
       goodsOptionForm: {
         menuBtn: false,
         disabled: true,
+        span: 8,
         column: [{
           label: '客户名称',
           formslot: true,
           prop: 'corpId'
         }, {
+          label: '所属公司',
+          formslot: true,
+          prop: 'belongCompany',
+          rules: [{
+            required: true,
+            message: " ",
+            trigger: "blur"
+          }],
+        }, {
           label: '订单号',
-          prop: 'id',
+          prop: 'orderNo',
           disabled: true
         }, {
           label: '提单号',
@@ -410,12 +439,33 @@ export default {
           valueFormat: 'yyyy-MM-dd HH:mm:ss',
           prop: 'arrivalTime'
         }, {
-          label: '工厂名称',
+          label: '船名航次',
           prop: 'factory'
         }, {
           label: '货物名称',
           prop: 'goods'
+        },{
+          label: '订舱代理',
+          prop: 'agentId'
         }, {
+          label: '起运港',
+          prop: 'polId'
+        },{
+          label: '目的港',
+          prop: 'podId'
+        },{
+          label: '开船日期',
+          prop: 'etd',
+          type: 'date'
+        },{
+          label: '截关日期',
+          prop: 'etc',
+          type: 'date'
+        },{
+          label: '截单日期',
+          prop: 'siCutoffDate',
+          type: 'date'
+        },{
           label: '备注',
           prop: 'remarks'
         }
@@ -443,7 +493,7 @@ export default {
           }, {
             name: 'ctnQuantity',
             type: 'sum',
-            decimals: 1
+            decimals: 7
           }],
         column: [{
           label: '尺寸箱型',
@@ -473,7 +523,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>

+ 130 - 42
src/views/landTransportation/placeAnOrder/detailPage.vue

@@ -14,16 +14,25 @@
         <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"
+            :disabled="goodsForm.status === 1 || type"
             size="small"
             @click="editCustomer"
         >保存
@@ -82,6 +91,7 @@
             property="corpId"
             label="发货工厂"
             align="center"
+            :render-header="customTitle"
             width="280">
           <template slot-scope="scope">
             <crop-select
@@ -108,10 +118,10 @@
         <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"
-                      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>
@@ -122,7 +132,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 +165,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">
@@ -150,8 +173,27 @@
               :disabled="goodsForm.status === 1"
               v-model="goodsForm.corpId"
               @getCorpData="getCorpData"
+              :corpType="'KH'"
+          ></crop-select>
+        </template>
+        <template slot-scope="scope" slot="agentId">
+          <crop-select
+              :disabled="goodsForm.status === 1"
+              v-model="goodsForm.agentId"
           ></crop-select>
         </template>
+        <template slot-scope="scope" slot="polId">
+          <port-info
+              v-model="goodsForm.polId"
+              :disabled="goodsForm.status === 1"
+          />
+        </template>
+        <template slot-scope="scope" slot="podId">
+          <port-info
+              v-model="goodsForm.podId"
+              :disabled="goodsForm.status === 1"
+          />
+        </template>
       </avue-form>
     </basic-container>
     <containerTitle title="费用明细"></containerTitle>
@@ -268,7 +310,7 @@ import {
   detailDelegationList,
   removeCollection,
   saveSaveList,
-  addressList
+  addressList, cancelSubmission
 } from "@/api/landTransportation";
 
 export default {
@@ -280,6 +322,7 @@ export default {
   data() {
     return {
       activeIndex: '1',
+      type:false,
       goodsForm: {},
       modelKey: 1,
       orderFilesList: [],
@@ -359,7 +402,7 @@ export default {
           precision: 6,
           type: 'number'
         }, {
-          label: '陆运费(D)',
+          label: '应收陆运费',
           prop: 'landAmountD'
         }, {
           label: '备注',
@@ -372,6 +415,7 @@ export default {
       goodsOptionForm: {
         menuBtn: false,
         disabled: false,
+        span: 8,
         column: [{
           label: '客户名称',
           formslot: true,
@@ -386,13 +430,13 @@ export default {
           formslot: true,
           prop: 'belongCompany',
           rules: [{
-            required: true,
+            required: false,
             message: " ",
             trigger: "blur"
           }],
         }, {
           label: '订单号',
-          prop: 'id',
+          prop: 'orderNo',
           disabled: true
         }, {
           label: '提单号',
@@ -406,7 +450,7 @@ export default {
           label: '场站',
           prop: 'station',
           rules: [{
-            required: true,
+            required: false,
             message: " ",
             trigger: "blur"
           }],
@@ -425,7 +469,7 @@ export default {
           label: '船名航次',
           prop: 'factory',
           rules: [{
-            required: true,
+            required: false,
             message: " ",
             trigger: "blur"
           }],
@@ -433,15 +477,35 @@ export default {
           label: '货物名称',
           prop: 'goods',
           rules: [{
-            required: true,
+            required: false,
             message: " ",
             trigger: "blur"
           }],
         }, {
+          label: '订舱代理',
+          prop: 'agentId'
+        }, {
+          label: '起运港',
+          prop: 'polId'
+        },{
+          label: '目的港',
+          prop: 'podId'
+        },{
+          label: '开船日期',
+          prop: 'etd',
+          type: 'date'
+        },{
+          label: '截关日期',
+          prop: 'etc',
+          type: 'date'
+        },{
+          label: '截单日期',
+          prop: 'siCutoffDate',
+          type: 'date'
+        }, {
           label: '备注',
           prop: 'remarks'
-        }
-        ]
+        }]
       },
       entrustOptionTwo: {
         align: 'center',
@@ -468,6 +532,7 @@ export default {
             decimals: 0
           }],
         column: [{
+          // label: '尺寸箱型',
           label: '尺寸箱型',
           cell: true,
           prop: 'ctnType',
@@ -485,8 +550,8 @@ export default {
           controls: false,
           precision: 0,
           width: 100,
-          maxRows:999,
-          minRows:1,
+          maxRows: 999,
+          minRows: 1,
           type: 'number'
         }, {
           label: '总重量(吨)',
@@ -497,7 +562,7 @@ export default {
           precision: 6,
           type: 'number'
         }, {
-          label: '陆运费(D)',
+          label: '应收陆运费',
           cell: true,
           prop: 'landAmountD',
           controls: false,
@@ -704,6 +769,8 @@ export default {
         this.entrustList = res.data.data.orderItemList
         this.goodsList = res.data.data.orderItemList
         if (res.data.data.orderFeeList.length > 0) {
+          this.collectionList = []
+          this.paymentList = []
           res.data.data.orderFeeList.forEach(item => {
             if (item.type == 1) {
               this.collectionList.push(item)
@@ -719,16 +786,26 @@ export default {
         this.tableData.forEach(item => {
           if (item.region) item.region = item.region.split(',')
         })
+        this.type = false
       })
     },
     //提交委托
-    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) {
@@ -784,18 +861,21 @@ export default {
     },
     //保存
     editCustomer() {
-      this.$refs['goodsForm'].validate((valid,done) => {done()})
-      for (let item in this.tableData){
-        if (!this.tableData[item].corpId) return this.$message.error('请选择第'+ Number(Number(item)+1) +'行发货工厂');
-        if (!this.tableData[item].address) return this.$message.error('请输入第'+ Number(Number(item)+1) +'行详细地址');
+      this.$refs['goodsForm'].validate((valid, done) => {
+        done()
+      })
+      for (let item in this.tableData) {
+        if (!this.tableData[item].corpId) return this.$message.error('请选择第' + Number(Number(item) + 1) + '行发货工厂');
+        if (!this.tableData[item].address) return this.$message.error('请输入第' + Number(Number(item) + 1) + '行详细地址');
       }
-      for (let item in this.entrustList){
-        if (!this.entrustList[item].ctnType) return this.$message.error('请选择第'+ Number(Number(item)+1) +'行尺寸箱型');
-        if (!this.entrustList[item].ctnQuantity) return this.$message.error('请输入第'+ Number(Number(item)+1) +'行箱量');
-        if (!this.entrustList[item].landWeight) return this.$message.error('请输入第'+ Number(Number(item)+1) +'行总重量');
-        if (!this.entrustList[item].landAmountD) return this.$message.error('请输入第'+ Number(Number(item)+1) +'陆运费');
+      for (let item in this.entrustList) {
+        if (!this.entrustList[item].ctnType) return this.$message.error('请选择第' + Number(Number(item) + 1) + '行尺寸箱型');
+        if (!this.entrustList[item].ctnQuantity) return this.$message.error('请输入第' + Number(Number(item) + 1) + '行箱量');
+        if (!this.entrustList[item].landWeight) return this.$message.error('请输入第' + Number(Number(item) + 1) + '行总重量');
+        if (!this.entrustList[item].landAmountD) return this.$message.error('请输入第' + Number(Number(item) + 1) + '陆运费');
       }
-      this.$refs['goodsForm'].validate((valid,done) => {
+      if (this.entrustList.length === 0) return this.$message.error('箱信息不能为空')
+      this.$refs['goodsForm'].validate((valid, done) => {
         done();
         if (valid) {
           let data = JSON.parse(JSON.stringify(this.tableData))
@@ -803,6 +883,7 @@ export default {
             item.sort = index + 1
             if (item.region.length !== 0) item.region = item.region.join(',')
           })
+          this.type = true
           saveSaveList({
             ...this.goodsForm,
             kind: '1',
@@ -811,13 +892,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 {
@@ -905,7 +985,7 @@ export default {
         }
       }
       if (row.belongtoarea) {
-        addressList(row.belongtoarea).then(res => {
+        addressList(row.belongtoarea.split(',')[0]).then(res => {
           this.tableData[scope.$index].region = [res.data.data.provinceCode, res.data.data.parentId, res.data.data.districtCode]
           scope.row.key++
         })
@@ -921,10 +1001,18 @@ export default {
             </el-tooltip>
           </div>
       )
+    },
+    //自定义表头
+    customTitle(h, {column, $index}) {
+      let text = column.label
+      return (
+          <div>
+            {{text}}<span style="color:#F56C6C">*</span>
+          </div>
+      )
     }
   }
 }
 </script>
 <style scoped>
-
 </style>

+ 7 - 7
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,
@@ -413,7 +413,7 @@ export default {
     },
     //行编辑
     rowCell(row, index) {
-      console.log(localStorage.getItem("roleName").split(','))
+      // console.log(localStorage.getItem("roleName").split(','))
       this.id = row.id
       this.show = false
     },
@@ -425,7 +425,7 @@ export default {
       this.show = true
     },
     ToBreak (val) {
-      return val.replace('\n', '<br/>')
+      if (val)return val.replace('\n', '<br/>')
     }
   }
 }