Browse Source

Merge remote-tracking branch 'origin/dev' into dev

lichao 3 years ago
parent
commit
a2ea43ea79

+ 14 - 0
src/api/landTransportation/car.js

@@ -26,3 +26,17 @@ export function carRemove(params) {
     params
   })
 }
+// 查询明细
+export function detailDelegationList(data) {
+  return request({
+    url: '/api/blade-client/land-vehicle/detail?id='+data,
+    method: 'get'
+  })
+}
+//删除附件
+export function removeFile(data) {
+  return request({
+    url: '/api/blade-client/common-file/remove?ids='+data,
+    method: 'POST'
+  })
+}

+ 40 - 0
src/api/landTransportation/driver.js

@@ -0,0 +1,40 @@
+import request from '@/router/axios';
+
+// 列表查询
+export function selectInvoiceList(data) {
+    return request({
+        url: '/api/blade-client/land-driver/list',
+        method: 'get',
+        params: data
+    })
+}
+// 列表单条删除
+export function removeDelegationList(data) {
+    return request({
+        url: '/api/blade-client/land-driver/remove',
+        method: 'post',
+        params: data
+    })
+}
+// 单据新增修改
+export function saveDelegationList(data) {
+    return request({
+        url: '/api/blade-client/land-driver/submit',
+        method: 'post',
+        data: data
+    })
+}
+// 查询明细
+export function detailDelegationList(data) {
+    return request({
+        url: '/api/blade-client/land-driver/detail?id='+data,
+        method: 'get'
+    })
+}
+//删除附件
+export function removeFile(data) {
+    return request({
+        url: '/api/blade-client/common-file/remove?ids='+data,
+        method: 'POST'
+    })
+}

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

@@ -8,3 +8,50 @@ export function selectInvoiceList(data) {
         params: data
     })
 }
+// 列表单条删除
+export function removeDelegationList(data) {
+    return request({
+        url: '/api/blade-land/order/remove',
+        method: 'post',
+        params: data
+    })
+}
+// 单据新增修改
+export function saveDelegationList(data) {
+    return request({
+        url: '/api/blade-land/order/submit',
+        method: 'post',
+        data: data
+    })
+}
+// 单据新增修改
+export function saveSaveList(data) {
+    return request({
+        url: '/api/blade-land/order/save',
+        method: 'post',
+        data: data
+    })
+}
+// 单据新增
+export function detailDelegationList(data) {
+    return request({
+        url: '/api/blade-land/order/detail',
+        method: 'get',
+        params:data
+    })
+}
+// 单据新增
+export function removeCollection(data) {
+    return request({
+        url: '/api/blade-land/orderfee/remove?ids='+data,
+        method: 'post'
+    })
+}
+//司机查询
+export function driverQueryCollection(data) {
+    return request({
+        url: '/api/blade-land/order-item/list',
+        method: 'get',
+        params:data
+    })
+}

+ 256 - 13
src/views/basicData/landTransportation/driverInformation/index.vue

@@ -1,112 +1,355 @@
 <template>
 <div>
   <basic-container>
-    <avue-crud :data="dataList" :option="option"></avue-crud>
+    <avue-crud
+        ref="crud"
+        :data="dataList"
+        :option="option"
+        v-model="form"
+        :table-loading="loading"
+        :page.sync="page"
+        @on-load="onLoad"
+        @row-del="rowDel"
+        @search-change="searchChange"
+        @row-update="rowUpdate"
+        :before-open="beforeOpen"
+        @search-criteria-switch="searchCriteriaSwitch"
+        @row-save="rowSave">
+      <template slot="urlForm" slot-scope="{ row }">
+        <el-input
+            placeholder="文件地址"
+            size="small"
+            v-if="row.$cellEdit"
+            v-model="row.url"
+            class="input-with-select">
+          <el-button size="small" type="primary" slot="prepend" @click="download(row)">查看</el-button>
+          <el-upload
+              class="upload-demo"
+              :show-file-list="false"
+              slot="append"
+              :action="action"
+              :headers="headers"
+              :on-success="(response)=>{onSuccessTwo(response,row)}"
+              :multiple="false">
+            <el-button size="small" type="primary">上传</el-button>
+          </el-upload>
+        </el-input>
+        <span v-else>{{ row.url }}</span>
+      </template>
+      <template slot-scope="scope" slot="fleetIdForm">
+        <crop-select v-model="form.fleetId"/>
+      </template>
+      <template slot-scope="scope" slot="fleetIdSearch">
+        <crop-select v-model="form.fleetId"/>
+      </template>
+      <template slot-scope="{type,size}" slot="menu">
+        <el-button icon="el-icon-check" :size="size" :type="type">创建用户</el-button>
+      </template>
+    </avue-crud>
   </basic-container>
 </div>
 </template>
 
 <script>
+import {getToken} from "@/util/auth";
+import {
+  saveDelegationList,
+  removeDelegationList,
+  selectInvoiceList,
+  detailDelegationList, removeFile
+} from "@/api/landTransportation/driver";
 export default {
   name: "index",
   data(){
     return{
+      form:{},
       dataList:[],
+      loading:false,
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0,
+        pageSizes: [10,50,100,200,300]
+      },
+      action: "/api/blade-resource/oss/endpoint/put-file",
+      headers: { "Blade-Auth": "Bearer " + getToken() },
       option:{
         align:'center',
+        dialogWidth:'85%',
         index: true,
+        searchIcon: true,
+        searchIndex: 2,
+        searchLabelWidth:100,
+        searchSpan:8,
         column:[{
           label: '司机姓名',
-          prop: 'fileName',
+          prop: 'name',
           index: 1,
           width: 140,
+          span: 8,
           cell: true,
           overHidden: true,
           search:true,
         },{
           label: '身份证号',
-          prop: 'fileName',
+          prop: 'idCard',
           index: 1,
           width: 140,
+          span: 8,
           cell: true,
           overHidden: true,
           search:true,
         },{
-          label: '准假车型',
-          prop: 'fileName',
+          label: '准车型',
+          prop: 'permitModel',
           index: 1,
           width: 140,
+          span: 8,
           cell: true,
           overHidden: true,
           search:true,
         },{
           label: '电话',
-          prop: 'fileName',
+          prop: 'tel',
           index: 1,
           width: 140,
+          span: 8,
           cell: true,
           overHidden: true,
           search:true,
         },{
           label: '所属车队',
-          prop: 'fileName',
+          prop: 'fleetId',
           index: 1,
           width: 140,
+          span: 8,
           cell: true,
           overHidden: true,
           search:true,
         },{
           label: '性别',
-          prop: 'fileName',
+          prop: 'sex',
           index: 1,
           width: 140,
+          span: 8,
           cell: true,
           overHidden: true,
           search:true,
+          type: 'select',
+          dicUrl: "/api/blade-system/dict-biz/dictionary?code=sex",
+          props: {
+            label: "dictValue",
+            value: "dictValue"
+          }
         },{
           label: '驾驶证有效期',
-          prop: 'fileName',
+          prop: 'driveExpire',
+          type: "date",
+          format: 'yyyy-MM-dd',
+          valueFormat: 'yyyy-MM-dd',
           index: 1,
           width: 140,
+          span: 8,
           cell: true,
           overHidden: true,
           search:true,
         },{
           label: '资格证证件号',
-          prop: 'fileName',
+          prop: 'qualifiedNo',
           index: 1,
           width: 140,
+          span: 8,
           cell: true,
           overHidden: true,
           search:true,
         },{
           label: '资格证有效期',
-          prop: 'fileName',
+          prop: 'qualifiedExpire',
+          type: "date",
+          format: 'yyyy-MM-dd',
+          valueFormat: 'yyyy-MM-dd',
           index: 1,
           width: 140,
+          span: 8,
           cell: true,
           overHidden: true,
           search:true,
         },{
           label: '押运证证件号',
-          prop: 'fileName',
+          prop: 'escortNo',
           index: 1,
           width: 140,
+          span: 8,
           cell: true,
           overHidden: true,
           search:true,
         },{
           label: '押运证有效期',
-          prop: 'fileName',
+          prop: 'escortExpire',
+          type: "date",
+          format: 'yyyy-MM-dd',
+          valueFormat: 'yyyy-MM-dd',
           index: 1,
           width: 140,
+          span: 8,
           cell: true,
           overHidden: true,
           search:true,
+        },{
+          label: '附件',
+          prop: 'fileList',
+          type: 'dynamic',
+          span:24,
+          hide:true,
+          showColumn:false,
+          children: {
+            align: 'center',
+            headerAlign: 'center',
+            rowAdd:(done)=>{
+              // this.$message.success('新增回调');
+              done()
+            },
+            rowDel:(row,done)=>{
+              if (row.id) {
+                removeFile(row.id).then(res=>{
+                  done();
+                })
+              }else {
+                done();
+              }
+            },
+            column: [{
+              width: 200,
+              label: '文件名称',
+              prop: "fileName",
+              formslot: true
+            }, {
+              width: 360,
+              label: '文件地址',
+              prop: "url"
+            }, {
+              width: 200,
+              label: '文件属性',
+              type: "select",
+              dicUrl: "/api/blade-system/dict-biz/dictionary?code=file_type",
+              props: {
+                label: "dictValue",
+                value: "dictValue"
+              }
+            }, {
+              label: '备注',
+              prop: "remarks",
+            }]
+          }
         }]
       }
     }
   },
+  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:{
+    // 获得高度
+    searchCriteriaSwitch(type){
+      if (type){
+        this.option.height = this.option.height - 138
+      }else {
+        this.option.height = this.option.height + 138
+      }
+      this.$refs.crud.getTableHeight()
+    },
+    //附件上传成功
+    onSuccessTwo(response,row){
+      row.url = response.data.link
+      row.fileName = response.data.originalName
+    },
+    //下载附件
+    download(row){
+      if (row.url){
+        window.open(row.url)
+      }else {
+        this.$message.warning('无附件,请上传附件后再查看');
+      }
+    },
+    //新增
+    rowSave(row,done,loading){
+      console.log(row)
+      saveDelegationList(row).then(res=>{
+        this.$message.success('保存成功');
+        this.onLoad(this.page)
+        done()
+      }, error => {
+        window.console.log(error);
+        loading();
+      })
+    },
+    //点击行编辑时查看
+    beforeOpen(done,type){
+      detailDelegationList(this.form.id).then(res=>{
+        this.form = res.data.data
+        done()
+      })
+    },
+    //修改
+    rowUpdate(row,index,done,loading){
+      saveDelegationList(row).then(res=>{
+        this.$message.success('保存成功');
+        this.onLoad(this.page)
+        loading();
+        // done()
+      }, error => {
+        window.console.log(error);
+        loading();
+      })
+    },
+    //检索
+    onLoad(page, params) {
+      let queryParams = {
+        size: page.pageSize,
+        current: page.currentPage,
+        ...params
+      }
+      this.loading = true;
+      selectInvoiceList(queryParams).then(res => {
+        this.dataList = res.data.data.records
+        this.page.total = res.data.data.total
+        this.option.height = window.innerHeight - 240;
+      }).finally(() => {
+        this.loading = false;
+      })
+    },
+    //搜索
+    searchChange(params,done) {
+      this.onLoad(this.page,params)
+      done();
+    },
+    //列表删除
+    rowDel(row){
+      this.$confirm('此操作将永久删除该单据, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        removeDelegationList({ids:row.id}).then(res=>{
+          this.$message.success('删除成功');
+          this.onLoad(this.page)
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消删除'
+        });
+      });
+    },
+  }
 }
 </script>
 

+ 20 - 3
src/views/basicData/landTransportation/vehicleInformation/index.vue

@@ -14,6 +14,7 @@
         @row-update="rowUpdate"
         @row-del="rowDel"
         @search-change="searchChange"
+        :before-open="beforeOpen"
         @search-reset="searchReset"
         @refresh-change="refreshChange"
         @current-change="currentChange"
@@ -57,7 +58,7 @@
 </template>
 
 <script>
-import { getCarList, carSubmit, carRemove } from "@/api/landTransportation/car";
+import { getCarList, carSubmit, carRemove ,detailDelegationList,removeFile} from "@/api/landTransportation/car";
 import {getToken} from '@/util/auth';
 
 export default {
@@ -66,9 +67,11 @@ export default {
     return{
       dataList:[],
       option:{
+        dialogWidth:'85%',
         searchIcon: true,
         searchIndex: 2,
         searchMenuSpan: 24,
+        searchLabelWidth:100,
         align:'center',
         index: true,
         column:[{
@@ -317,6 +320,13 @@ export default {
               done()
             },
             rowDel:(row,done)=>{
+              if (row.id) {
+                removeFile(row.id).then(res=>{
+                  done();
+                })
+              }else {
+                done();
+              }
               // this.$message.success('删除回调'+JSON.stringify(row));
               done();
             },
@@ -371,12 +381,19 @@ export default {
     }
   },
   methods: {
+    //点击行编辑时查看
+    beforeOpen(done,type){
+      detailDelegationList(this.form.id).then(res=>{
+        this.form = res.data.data
+        done()
+      })
+    },
     // 获得高度
     searchCriteriaSwitch(type){
       if (type){
-        this.option.height = this.option.height - 390
+        this.option.height = this.option.height - 322
       }else {
-        this.option.height = this.option.height + 390
+        this.option.height = this.option.height + 322
       }
       this.$refs.crud.getTableHeight()
     },

+ 631 - 226
src/views/landTransportation/dispatchingCars/detailPage.vue

@@ -10,26 +10,29 @@
         >返回列表
         </el-button>
       </div>
-      <el-button
-          class="el-button--small-yh add-customer-btn"
-          type="primary"
-          :disabled="disabled"
-          size="small"
-          @click="editCustomer"
-      >保存
-      </el-button>
+      <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="基础资料" style="margin-top: 50px"></containerTitle>
-    <basic-container>
-      <avue-form v-model="form" :option="basicsOption">
-        <template slot-scope="scope" slot="corpId">
-          <crop-select
-              v-model="form.corpId"
-          ></crop-select>
-        </template>
-      </avue-form>
-    </basic-container>
-    <containerTitle title="起止地信息"></containerTitle>
+    <containerTitle
+        title="起止地信息"
+        style="margin-top: 50px"></containerTitle>
     <basic-container>
       <el-table
           ref="singleTable"
@@ -38,343 +41,745 @@
           :header-cell-style="{color:'#000',background:'#fafafa'}"
           style="width: 100%">
         <el-table-column
-            property="date"
-            align="center"
-            width="40"
-            :render-header="renderHeader">
-          <template slot-scope="scope">
-            <el-tooltip class="item" effect="dark" content="删除" placement="right">
-              <el-button type="danger" icon="el-icon-delete" size="mini" circle @click="deleteAddress(scope)"></el-button>
-            </el-tooltip>
-          </template>
-        </el-table-column>
-        <el-table-column
             type="index"
             label="序号"
             align="center"
             width="60">
         </el-table-column>
         <el-table-column
-            property="date"
-            label="省份"
-            align="center"
-            width="120">
-          <template slot-scope="scope">
-            <el-select v-model="scope.row.date" filterable size="small" placeholder="请选择">
-              <el-option label="北京" value="1"></el-option>
-              <el-option label="山东" value="2"></el-option>
-              <el-option label="天津" value="3"></el-option>
-            </el-select>
-          </template>
-        </el-table-column>
-        <el-table-column
-            property="name"
-            label="城市"
-            align="center"
-            width="120">
-          <template slot-scope="scope">
-            <el-select v-model="scope.row.name" filterable size="small" placeholder="请选择">
-              <el-option label="测试城市0" value="1"></el-option>
-              <el-option label="测试城市1" value="2"></el-option>
-              <el-option label="测试城市2" value="3"></el-option>
-            </el-select>
-          </template>
-        </el-table-column>
-        <el-table-column
-            property="address"
+            property="province"
+            label="省市区"
             align="center"
-            width="160"
-            label="区/县">
+            width="280">
           <template slot-scope="scope">
-            <el-select v-model="scope.row.name" filterable size="small" placeholder="请选择">
-              <el-option label="测试城市0" value="1"></el-option>
-              <el-option label="测试城市1" value="2"></el-option>
-              <el-option label="测试城市2" value="3"></el-option>
-            </el-select>
+            <el-cascader
+                size="small"
+                style="width: 100%;"
+                v-model="scope.row.region"
+                disabled
+                :props="treeOption"></el-cascader>
           </template>
         </el-table-column>
         <el-table-column
             property="address"
             align="center"
+            show-overflow-tooltip
             label="详细地址">
-          <template slot-scope="scope">
-            <el-input v-model="scope.row.address" size="small" placeholder="请输入内容"></el-input>
-          </template>
+          <!--          <template slot-scope="scope">-->
+          <!--            <el-input v-model="scope.row.address" size="small" placeholder="请输入内容"></el-input>-->
+          <!--          </template>-->
         </el-table-column>
       </el-table>
     </basic-container>
     <containerTitle title="箱信息"></containerTitle>
     <basic-container>
-      <avue-crud :data="entrustList" :option="entrustOptionTwo"></avue-crud>
-    </basic-container>
-    <containerTitle title="车队箱信息"></containerTitle>
-    <basic-container>
-      <avue-crud :data="goodsList" :option="goodsOptionCrud"></avue-crud>
-    </basic-container>
-    <containerTitle title="收款信息"></containerTitle>
-    <basic-container>
-      <avue-crud :data="collectionList" :option="collectionOption"></avue-crud>
+      <avue-crud
+          :data="entrustList"
+          ref="crudContact"
+          :option="entrustOptionTwoT"
+          @row-save="(row,done,loading)=>{rowSaveT(row,0,done,loading)}"
+          @row-update="rowSaveT">
+<!--        <template slot-scope="{type,size,row}" slot="menu">-->
+<!--          <el-button icon="el-icon-edit" :size="size" :type="type" @click="designate(row)">指派</el-button>-->
+<!--        </template>-->
+        <template slot-scope="{row,index}" slot="menu">
+          <el-button
+              type="text"
+              size="small"
+              @click="rowSaveT(row,index)"
+          >{{ row.$cellEdit ? '保 存' : '修 改' }}
+          </el-button>
+          <el-button
+              size="small"
+              icon="el-icon-delete"
+              type="text"
+              @click="designate(row, index)"
+              v-if="!row.$cellEdit"
+          >指派</el-button>
+        </template>
+      </avue-crud>
     </basic-container>
-    <containerTitle title="付款信息"></containerTitle>
+    <containerTitle title="货物信息"></containerTitle>
     <basic-container>
-      <avue-crud :data="paymentList" :option="paymentOption"></avue-crud>
+      <avue-form :option="goodsOptionForm" v-model="goodsForm">
+        <template slot-scope="scope" slot="corpId">
+          <crop-select
+              v-model="goodsForm.corpId"
+              disabled
+          ></crop-select>
+        </template>
+      </avue-form>
     </basic-container>
+    <span>
+  <!--    <containerTitle title="费用明细"></containerTitle>-->
+      <!--    <basic-container>-->
+      <!--      <el-tabs v-model="activeIndex" @tab-click="handleSelect">-->
+      <!--        <el-tab-pane label="应收" name="1"></el-tab-pane>-->
+      <!--        <el-tab-pane label="应付" name="2"></el-tab-pane>-->
+      <!--      </el-tabs>-->
+      <!--      <avue-crud-->
+      <!--          v-if="activeIndex === '1'"-->
+      <!--          :data="collectionList"-->
+      <!--          :option="collectionOption"-->
+      <!--          ref="collection"-->
+      <!--          @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"-->
+      <!--          @row-update="rowSave"-->
+      <!--          @row-del="makeDel">-->
+      <!--        <template slot-scope="{row}" slot="corpId">-->
+      <!--          <crop-select-->
+      <!--              v-if="row.$cellEdit"-->
+      <!--              v-model="row.corpId"-->
+      <!--              @getCorpData="(data)=>{getfleetId(data,row)}"-->
+      <!--          ></crop-select>-->
+      <!--          <span v-else>{{row.corpName}}</span>-->
+      <!--        </template>-->
+      <!--        <template slot-scope="{row}" slot="feeId">-->
+      <!--          <breakdown-select-->
+      <!--              v-if="row.$cellEdit"-->
+      <!--              v-model="row.feeId"-->
+      <!--              @selectValue="(value) => selectValue(value,row)"-->
+      <!--              :configuration="breakConfiguration"-->
+      <!--          >-->
+      <!--          </breakdown-select>-->
+      <!--          <span v-else>{{ row.feeName }}</span>-->
+      <!--        </template>-->
+      <!--        <template slot-scope="{row,index}" slot="menu">-->
+      <!--          <el-button-->
+      <!--              type="text"-->
+      <!--              size="small"-->
+      <!--              :icon="row.$cellEdit?'el-icon-circle-plus-outline':'el-icon-edit'"-->
+      <!--              @click="rowCell(row,index)"-->
+      <!--          >{{row.$cellEdit?'保存':'编辑'}}</el-button>-->
+      <!--          <el-button type="text"-->
+      <!--                     icon="el-icon-delete"-->
+      <!--                     size="small"-->
+      <!--                     @click="$refs.collection.rowDel(row,index)"-->
+      <!--          >删除</el-button>-->
+      <!--        </template>-->
+      <!--        <template slot="menuLeft">-->
+      <!--          <el-button type="primary" icon="el-icon-plus" @click="addRowCollection" size="small">录入明细</el-button>-->
+      <!--        </template>-->
+      <!--      </avue-crud>-->
+      <!--      <avue-crud-->
+      <!--          v-if="activeIndex === '2'"-->
+      <!--          :data="paymentList"-->
+      <!--          :option="paymentOption"-->
+      <!--          ref="payment"-->
+      <!--          @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"-->
+      <!--          @row-update="rowSave"-->
+      <!--          @row-del="feeDel"-->
+      <!--      >-->
+      <!--        <template slot-scope="{row}" slot="corpId">-->
+      <!--          <crop-select-->
+      <!--              v-if="row.$cellEdit"-->
+      <!--              v-model="row.corpId"-->
+      <!--              @getCorpData="(data)=>{getfleetId(data,row)}"-->
+      <!--          ></crop-select>-->
+      <!--          <span v-else>{{row.corpName}}</span>-->
+      <!--        </template>-->
+      <!--        <template slot-scope="{row}" slot="feeId">-->
+      <!--          <breakdown-select-->
+      <!--              v-if="row.$cellEdit"-->
+      <!--              v-model="row.feeId"-->
+      <!--              @selectValue="(value) => selectValue(value,row)"-->
+      <!--              :configuration="breakConfiguration"-->
+      <!--          >-->
+      <!--          </breakdown-select>-->
+      <!--          <span v-else>{{ row.feeName }}</span>-->
+      <!--        </template>-->
+      <!--        <template slot-scope="{row,index}" slot="menu">-->
+      <!--          <el-button-->
+      <!--              type="text"-->
+      <!--              size="small"-->
+      <!--              :icon="row.$cellEdit?'el-icon-circle-plus-outline':'el-icon-edit'"-->
+      <!--              @click="paymentRowCell(row,index)"-->
+      <!--          >{{row.$cellEdit?'保存':'编辑'}}</el-button>-->
+      <!--          <el-button type="text"-->
+      <!--                     icon="el-icon-delete"-->
+      <!--                     size="small"-->
+      <!--                     @click="$refs.payment.rowDel(row,index)"-->
+      <!--          >删除</el-button>-->
+      <!--        </template>-->
+      <!--        <template slot="menuLeft">-->
+      <!--          <el-button type="primary" icon="el-icon-plus" @click="addRowPayment" size="small">录入明细</el-button>-->
+      <!--        </template>-->
+      <!--      </avue-crud>-->
+      <!--    </basic-container>-->
+</span>
+    <containerTitle title="上传附件"></containerTitle>
+    <c-upload
+        typeUpload="CD"
+        :data="orderFilesList"
+        :enumerationValue="76"
+    ></c-upload>
   </div>
 </template>
 
 <script>
+import {getLazyTree} from "@/api/base/region";
+import {saveDelegationList, detailDelegationList, removeCollection} from "@/api/landTransportation";
+
 export default {
+  props: {
+    id: {
+      type: String
+    }
+  },
   data() {
     return {
-      form: {},
-      basicsOption: {
-        menuBtn:false,
-        column: [
-          {
-            label: "客户名称",
-            span: 8,
-            prop: "corpId"
-          },{
-            label: '联系人',
-            span: 8,
-            prop: 'name'
-          },{
-            label: '订单号',
-            span: 8,
-            prop: 'name'
-          }
-        ]
+      activeIndex: '1',
+      goodsForm: {},
+      orderFilesList: [],
+      roleName: localStorage.getItem("roleName").split(',')[0],
+      breakConfiguration: {
+        multipleChoices: false,
+        multiple: false,
+        disabled: false,
+        searchShow: true,
+        collapseTags: false,
+        clearable: true,
+        placeholder: '请点击右边按钮选择',
+        dicData: []
       },
-      tableData: [{
-        date: '2016-05-02',
-        name: '王小虎',
-        address: '上海市普陀区金沙江路 1518 弄'
-      }, {
-        date: '2016-05-02',
-        name: '王小虎',
-        address: '上海市普陀区金沙江路 1518 弄'
-      }],
-      entrustList: [],
-      goodsList:[],
-      goodsOptionCrud: {
-        index:true,
-        cellBtn:true,
-        addBtn:false,
-        addRowBtn:true,
+      advantageProjectData: [],
+      treeOption: {
+        label: 'title',
+        value: 'id',
+        lazy: true,
+        lazyLoad(node, resolve) {
+          const parentId = node.level === 0 ? '00' : node.data.id;
+          getLazyTree(parentId).then(res => {
+            resolve(
+                res.data.data.map(item => {
+                  return {
+                    ...item,
+                    leaf: !item.hasChildren
+                  };
+                })
+            );
+          });
+        }
+      },
+      tableData: [],
+      entrustListT: [],
+      entrustOptionTwoT: {
+        align: 'center',
+        menuAlign: 'center',
+        index: true,
+        cellBtn: false,
+        addBtn: false,
+        cancelBtn:false,
+        editBtn:false,
+        addRowBtn: false,
+        delBtn: false,
+        showSummary: true,
+        // editBtn:false,
+        summaryText: "合计",
+        sumColumnList: [
+          {
+            name: 'landWeight',
+            type: 'sum',
+            decimals: 6
+          }, {
+            name: 'landAmountC',
+            type: 'sum',
+            decimals: 2
+          }, {
+            name: 'landAmountD',
+            type: 'sum',
+            decimals: 2
+          }, {
+            name: 'ctnQuantity',
+            type: 'count'
+          }],
         column: [
           {
-            label: '车队',
+            label: '状态',
+            width: 200,
+            type: 'select',
+            dicUrl: "/api/blade-client/corpsdesc/fleet-list",
+            props: {
+              label: "cname",
+              value: "id"
+            },
             cell: true,
-            prop: 'name'
+            prop: 'status'
           },{
-            label: '尺寸箱型',
+            label: '车队',
+            width: 200,
+            type: 'select',
+            dicUrl: "/api/blade-client/corpsdesc/fleet-list",
+            props: {
+              label: "cname",
+              value: "id"
+            },
             cell: true,
-            prop: 'sex'
-          },{
+            prop: 'fleetId'
+          }, {
+            label: '尺寸箱型',
+            width: 100,
+            slot: true,
+            prop: 'ctnType'
+          }, {
             label: '箱量',
-            cell: true,
-            prop: 'sex'
+            width: 50,
+            prop: 'ctnQuantity'
           }, {
             label: '重量',
-            cell: true,
-            prop: 'sex'
+            width: 160,
+            prop: 'landWeight',
+            controls: false,
+            precision: 6,
+            type: 'number'
           }, {
             label: '车号',
-            cell: true,
-            prop: 'sex'
+            width: 150,
+            prop: 'plateNo'
           }, {
             label: '司机',
-            cell: true,
-            prop: 'sex'
+            width: 115,
+            prop: 'driverId'
           }, {
             label: '电话',
-            cell: true,
-            prop: 'sex'
-          }, {
-            label: '箱号',
-            cell: true,
-            prop: 'sex'
-          }, {
-            label: '陆运费',
-            cell: true,
-            prop: 'sex'
+            width: 160,
+            prop: 'tel'
           }, {
-            label: '陆运费',
-            cell: true,
-            prop: 'sex'
+            label: '陆运费(D)',
+            prop: 'landAmountD'
           }, {
-            label: '是否派车',
+            label: '陆运费(C)',
             cell: true,
-            prop: 'sex'
+            prop: 'landAmountC'
           }, {
             label: '备注',
             cell: true,
-            prop: 'sex'
+            prop: 'remarks'
           }
         ]
       },
+      entrustList: [],
+      goodsOptionForm: {
+        menuBtn: false,
+        disabled: true,
+        column: [{
+          label: '客户名称',
+          formslot: true,
+          prop: 'corpId'
+        }, {
+          label: '订单号',
+          prop: 'id',
+          disabled: true
+        }, {
+          label: '提单号',
+          prop: 'billNo'
+        }, {
+          label: '场站',
+          prop: 'station'
+        }, {
+          label: '到厂时间',
+          type: "datetime",
+          format: 'yyyy-MM-dd HH:mm:ss',
+          valueFormat: 'yyyy-MM-dd HH:mm:ss',
+          prop: 'arrivalTime'
+        }, {
+          label: '工厂名称',
+          prop: 'factory'
+        }, {
+          label: '货物名称',
+          prop: 'goods'
+        }, {
+          label: '备注',
+          prop: 'remarks'
+        }
+        ]
+      },
       entrustOptionTwo: {
         align: 'center',
         menuAlign: 'center',
-        index:true,
-        cellBtn:true,
-        addBtn:false,
-        addRowBtn:true,
-        column: [
+        addBtnText: '录入箱信息',
+        index: true,
+        cellBtn: true,
+        addBtn: false,
+        addRowBtn: true,
+        showSummary: true,
+        summaryText: "合计",
+        sumColumnList: [
           {
-            label: '车队',
-            cell: true,
-            prop: 'name'
-          }, {
-            label: '尺寸箱形',
-            cell: true,
-            prop: 'sex'
-          }, {
-            label: '箱量',
-            cell: true,
-            prop: 'sex'
-          }, {
-            label: '重量',
-            cell: true,
-            prop: 'sex'
-          }, {
-            label: '车号',
-            cell: true,
-            prop: 'sex'
-          }, {
-            label: '司机',
-            cell: true,
-            prop: 'sex'
-          }, {
-            label: '电话',
-            cell: true,
-            prop: 'sex'
-          }, {
-            label: '陆运费(D)',
-            cell: true,
-            prop: 'sex'
-          }, {
-            label: '陆运费(C)',
-            cell: true,
-            prop: 'sex'
+            name: 'landWeight',
+            type: 'sum',
+            decimals: 6
           }, {
-            label: '指派车队',
-            cell: true,
-            prop: 'sex'
+            name: 'landAmountD',
+            type: 'sum',
+            decimals: 2
           }, {
-            label: '备注',
-            cell: true,
-            prop: 'sex'
+            name: 'ctnQuantity',
+            type: 'sum',
+            decimals: 1
+          }],
+        column: [{
+          label: '尺寸箱型',
+          cell: true,
+          prop: 'ctnType',
+          type: 'select',
+          width: 100,
+          dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxType",
+          props: {
+            label: "dictValue",
+            value: "dictKey"
           }
+        }, {
+          label: '箱量',
+          cell: true,
+          prop: 'ctnQuantity',
+          controls: false,
+          precision: 0,
+          width: 100,
+          type: 'number'
+        }, {
+          label: '总重量(吨)',
+          cell: true,
+          prop: 'landWeight',
+          controls: false,
+          width: 200,
+          precision: 6,
+          type: 'number'
+        }, {
+          label: '陆运费(D)',
+          cell: true,
+          prop: 'landAmountD',
+          controls: false,
+          width: 200,
+          precision: 2,
+          type: 'number'
+        }, {
+          label: '备注',
+          cell: true,
+          prop: 'remarks'
+        }
         ]
       },
-      collectionList:[],
+      collectionList: [],
       collectionOption: {
         align: 'center',
         menuAlign: 'center',
-        index:true,
-        cellBtn:true,
-        addBtn:false,
-        addRowBtn:true,
-        column: [ {
+        index: true,
+        cancelBtn: false,
+        editBtn: false,
+        delBtn: false,
+        cellBtn: false,
+        addBtn: false,
+        addRowBtn: false,
+        showSummary: true,
+        addBtnText: '录入明细',
+        summaryText: "合计",
+        sumColumnList: [{
+          name: 'price',
+          type: 'sum',
+          decimals: 2
+        }, {
+          name: 'amount',
+          type: 'sum',
+          decimals: 2
+        }, {
+          name: 'quantity',
+          type: 'sum',
+          decimals: 1
+        }],
+        column: [{
           label: '客户名称',
-          cell: true,
-          prop: 'sex'
+          slot: true,
+          prop: 'corpId'
         }, {
           label: '费用名称',
-          cell: true,
-          prop: 'sex'
+          slot: true,
+          prop: 'feeId'
         }, {
           label: '计价单位',
           cell: true,
-          prop: 'sex'
+          prop: 'unit',
+          type: "select",
+          dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit",
+          props: {
+            label: "dictValue",
+            value: "dictKey"
+          }
         }, {
           label: '数量',
           cell: true,
-          prop: 'sex'
+          prop: 'quantity'
         }, {
           label: '单价',
           cell: true,
-          prop: 'sex'
+          prop: 'price'
         }, {
           label: '金额',
           cell: true,
-          prop: 'sex'
+          prop: 'amount'
         }, {
           label: '税率(默认6)',
           cell: true,
-          prop: 'sex'
+          prop: 'taxRate'
         }, {
-          label: '币别(默认RMB)',
+          label: '币别',
           cell: true,
-          prop: 'sex'
+          prop: 'currency',
+          type: "select",
+          dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
+          props: {
+            label: "dictValue",
+            value: "dictKey"
+          },
         }
         ]
       },
-      paymentList:[],
+      paymentList: [],
       paymentOption: {
         align: 'center',
         menuAlign: 'center',
-        index:true,
-        cellBtn:true,
-        addBtn:false,
-        addRowBtn:true,
-        column: [ {
+        index: true,
+        cancelBtn: false,
+        editBtn: false,
+        delBtn: false,
+        cellBtn: false,
+        addBtn: false,
+        addRowBtn: false,
+        showSummary: true,
+        addBtnText: '录入明细',
+        summaryText: "合计",
+        sumColumnList: [{
+          name: 'price',
+          type: 'sum',
+          decimals: 2
+        }, {
+          name: 'amount',
+          type: 'sum',
+          decimals: 2
+        }, {
+          name: 'quantity',
+          type: 'sum',
+          decimals: 1
+        }],
+        column: [{
           label: '客户名称',
-          cell: true,
-          prop: 'sex'
+          slot: true,
+          prop: 'corpId'
         }, {
           label: '费用名称',
-          cell: true,
-          prop: 'sex'
+          slot: true,
+          prop: 'feeId'
         }, {
           label: '计价单位',
           cell: true,
-          prop: 'sex'
+          prop: 'unit',
+          type: "select",
+          dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit",
+          props: {
+            label: "dictValue",
+            value: "dictKey"
+          }
         }, {
           label: '数量',
           cell: true,
-          prop: 'sex'
+          prop: 'quantity'
         }, {
           label: '单价',
           cell: true,
-          prop: 'sex'
+          prop: 'price'
         }, {
           label: '金额',
           cell: true,
-          prop: 'sex'
+          prop: 'amount'
         }, {
           label: '税率(默认6)',
           cell: true,
-          prop: 'sex'
+          prop: 'taxRate'
         }, {
           label: '币别(默认RMB)',
           cell: true,
-          prop: 'sex'
+          prop: 'currency',
+          type: "select",
+          dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
+          props: {
+            label: "dictValue",
+            value: "dictKey"
+          },
         }
         ]
       }
     };
   },
+  created() {
+    if (this.id) {
+      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(',')
+        })
+      })
+    }
+  },
   methods: {
+    //切换收付费
+    handleSelect(tab, event) {
+      this.activeIndex = tab.name
+    },
+    //箱信息保存
+    rowSaveT(row, index, done, loading) {
+      this.$refs.crudContact.rowCell(row, index)
+      done()
+    },
+    //箱信息指派
+    designate(row){
+      this.$confirm('是否确定指派车队', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        console.log('11111')
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消'
+        });
+      });
+    },
+    //箱信息选择车队
+    getfleetIdT(data, row) {
+      this.$set(row, 'fleetName', data.cname)
+    },
     //地址新增
-    addAddress(){
-      this.tableData.push({})
+    addAddress() {
+      this.tableData.splice(this.tableData.length - 1, 0, {leas: 1111})
     },
     //返回主列表
-    backToList(){
+    backToList() {
       this.$emit('backToList')
     },
     //删除途径地址
-    deleteAddress(scope){
+    deleteAddress(scope) {
       this.tableData.splice(scope.$index, 1);
     },
+    //箱信息保存
+    rowSave(row, index, done, loading) {
+      row.$cellEdit = false
+      done()
+    },
+    rowCell(row, index) {
+      this.$refs.collection.rowCell(row, index)
+    },
+    paymentRowCell(row, index) {
+      this.$refs.payment.rowCell(row, index)
+    },
+    //箱信息移除
+    rowDel(row, index) {
+      this.$confirm('此操作将永久删除该单据, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.entrustList.splice(index, 1);
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消删除'
+        });
+      });
+    },
+    //保存
+    editCustomer() {
+      let data = JSON.parse(JSON.stringify(this.tableData))
+      data.forEach(item => {
+        if (item.region.length !== 0) item.region = item.region.join(',')
+      })
+      saveDelegationList({
+        ...this.goodsForm,
+        kind: '2',
+        orderAddressList: data,
+        orderItemList: this.entrustList,
+        orderFeeList: this.collectionList.concat(this.paymentList)
+      }).then(res => {
+        this.$message.success('保存成功');
+      })
+    },
+    //收费新增
+    addRowCollection() {
+      this.$refs.collection.rowCellAdd({
+        currency: '1',
+        type: '1',
+        $cellEdit: true
+      });
+    },
+    //付费新增
+    addRowPayment() {
+      this.$refs.payment.rowCellAdd({
+        currency: '1',
+        type: '2',
+        $cellEdit: true
+      });
+    },
+    //选择费用
+    selectValue(value, row) {
+      this.$set(row, 'feeName', value.cname)
+    },
+    //选择客户信息触发
+    getfleetId(data, row) {
+      this.$set(row, 'corpName', data.cname)
+    },
+    //收款信息移除
+    makeDel(row, index) {
+      this.$confirm('此操作将永久删除该单据, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        if (row.id) removeCollection(row.id)
+        this.collectionList.splice(index, 1);
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消删除'
+        });
+      });
+    },
+    //付款信息移除
+    feeDel(row, index) {
+      this.$confirm('此操作将永久删除该单据, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        if (row.id) removeCollection(row.id)
+        this.paymentList.splice(index, 1);
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消删除'
+        });
+      });
+    },
     //自定义表头
     renderHeader(h) {
-      return(
+      return (
           <div>
             <el-tooltip className="item" effect="dark" content="增加途径地址" placement="top">
-              <el-button type="primary" icon="el-icon-plus" size="mini" circle onClick={()=>this.addAddress()} style="margin-right: 1.25rem;"></el-button>
+              <el-button type="primary" icon="el-icon-plus" size="mini" circle onClick={() => this.addAddress()}
+                         style="margin-right: 1.25rem;"></el-button>
             </el-tooltip>
           </div>
       )

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

@@ -1,18 +1,37 @@
 <template>
   <div>
     <basic-container v-if="show">
-      <avue-crud :data="dataList" ref="crud" :option="option">
+      <avue-crud
+          :table-loading="loading"
+          :data="dataList"
+          :page.sync="page"
+          ref="crud"
+          :option="option"
+          @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-scope="{row,index}" slot="menu">
+          <el-button type="text"
+                     icon="el-icon-edit"
+                     size="small"
+                     @click.stop="rowCell(row,index)">编辑</el-button>
+          <el-button type="text"
+                     icon="el-icon-delete"
+                     size="small"
+                     @click.stop="$refs.crud.rowDel(row,index)">删除</el-button>
+        </template>
       </avue-crud>
     </basic-container>
-    <detail-page v-else @backToList="backToList"></detail-page>
+    <detail-page v-else @backToList="backToList" :id="id"></detail-page>
   </div>
 </template>
 
 <script>
 import detailPage from './detailPage'
+import {removeDelegationList, selectInvoiceList} from "@/api/landTransportation";
 export default {
   name: "index",
   components: {
@@ -20,27 +39,80 @@ export default {
   },
   data(){
     return{
+      id:'',
       show:true,
-      dataList:[
-        {fileName:'222222222'}
-      ],
+      loading:false,
+      dataList:[],
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0,
+        pageSizes: [10,50,100,200,300]
+      },
       option:{
         align:'center',
         index: true,
         addBtn: false,
+        editBtn: false,
+        delBtn:false,
+        height:"auto",
         column:[{
-            label: '订单号',
-            prop: 'fileName',
-            index: 1,
-            width: 140,
-            cell: true,
-            overHidden: true,
-            search:true,
-          }]
+          label: '订单号',
+          prop: 'id',
+          index: 1,
+          width: 140,
+          cell: true,
+          overHidden: true,
+          search:true,
+        }]
       }
     }
   },
   methods:{
+    onLoad(page, params) {
+      let queryParams = {
+        size: page.pageSize,
+        current: page.currentPage,
+        kind: '2',
+        ...params
+      }
+      this.loading = true;
+      selectInvoiceList(queryParams).then(res => {
+        this.dataList = res.data.data.records
+        this.page.total = res.data.data.total
+      }).finally(() => {
+        this.loading = false;
+      })
+    },
+    //搜索
+    searchChange(params,done) {
+      this.onLoad(this.page,params)
+      done();
+    },
+    //列表删除
+    rowDel(row){
+      this.$confirm('此操作将永久删除该单据, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        removeDelegationList({ids:row.id}).then(res=>{
+          this.$message.success('删除成功');
+          this.onLoad(this.page)
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消删除'
+        });
+      });
+    },
+    //行编辑
+    rowCell(row,index){
+      console.log(row.id)
+      this.id = row.id
+      this.show = false
+    },
     rowSave(){
       this.show = false
     },

+ 155 - 0
src/views/landTransportation/driver/index.vue

@@ -0,0 +1,155 @@
+<template>
+  <div>
+    <basic-container>
+            <avue-crud
+                :data="goodsList"
+                :option="goodsOptionCrud"
+                :table-loading="loading"
+                :page.sync="page"
+                @on-load="onLoad"
+                @search-change="searchChange"
+                @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"
+                @row-update="rowSave">
+            </avue-crud>
+    </basic-container>
+  </div>
+</template>
+
+<script>
+import {driverQueryCollection} from "@/api/landTransportation";
+
+export default {
+  name: "index",
+  data(){
+    return{
+      form:{},
+      loading:false,
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0,
+        pageSizes: [10,50,100,200,300]
+      },
+      roleName:localStorage.getItem("roleName").split(',')[0],
+      goodsList:[],
+      goodsOptionCrud: {
+        index:true,
+        cellBtn:true,
+        addBtn:false,
+        addRowBtn:false,
+        searchMenuPosition:"right",
+        searchMenuSpan:6,
+        delBtn:false,
+        align:'center',
+        height:"auto",
+        showSummary: true,
+        summaryText: "合计",
+        sumColumnList: [
+          {
+            name: 'landWeight',
+            type: 'sum',
+            decimals:6
+          },{
+            name: 'landAmountC',
+            type: 'sum',
+            decimals:2
+          },{
+            name: 'ctnQuantity',
+            type: 'count'
+          }],
+        column: [
+          {
+            label: '车队',
+            width: 200,
+            search:true,
+            prop: 'fleetName'
+          },{
+            label: '尺寸箱型',
+            width: 100,
+            search:true,
+            prop: 'ctnType'
+          },{
+            label: '箱量',
+            width: 50,
+            prop: 'ctnQuantity'
+          }, {
+            label: '重量',
+            width: 160,
+            prop: 'landWeight',
+            controls: false,
+            precision: 6,
+            type: 'number'
+          }, {
+            label: '车号',
+            width: 150,
+            cell: true,
+            prop: 'plateNo'
+          }, {
+            label: '司机',
+            width: 115,
+            search:true,
+            cell: true,
+            prop: 'driverId'
+          }, {
+            label: '电话',
+            width: 160,
+            cell: true,
+            prop: 'tel'
+          }, {
+            label: '箱号',
+            cell: true,
+            prop: 'ctnNo'
+          }, {
+            label: '陆运费(C)',
+            prop: 'landAmountC'
+          }, {
+            label: '是否派车',
+            cell: true,
+            prop: 'sex'
+          }, {
+            label: '备注',
+            cell: true,
+            prop: 'remarks'
+          }
+        ]
+      },
+    }
+  },
+  methods:{
+    //箱信息保存
+    rowSave(row,index,done,loading) {
+      row.$cellEdit = false
+      done()
+    },
+    //箱信息选择车队
+    getfleetIdT(data,row){
+      this.$set(row,'fleetName',data.cname)
+    },
+    //搜索
+    searchChange(params,done) {
+      this.onLoad(this.page,params)
+      done();
+    },
+    //查询
+    onLoad(page, params) {
+      let queryParams = {
+        size: page.pageSize,
+        current: page.currentPage,
+        tag:'4',
+        ...params
+      }
+      this.loading = true;
+      driverQueryCollection(queryParams).then(res => {
+        this.goodsList = res.data.data.records
+        this.page.total = res.data.data.total
+      }).finally(() => {
+        this.loading = false;
+      })
+    },
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 163 - 0
src/views/landTransportation/motorcadeDriver/index.vue

@@ -0,0 +1,163 @@
+<template>
+  <div>
+    <basic-container>
+      <avue-crud
+          :data="goodsList"
+          :option="entrustOptionTwoT"
+          :table-loading="loading"
+          :page.sync="page"
+          @on-load="onLoad"
+          @search-change="searchChange"
+          @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"
+          @row-update="rowSave">
+        <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>
+      </avue-crud>
+    </basic-container>
+  </div>
+</template>
+
+<script>
+import {driverQueryCollection} from "@/api/landTransportation";
+
+export default {
+  name: "index",
+  data(){
+    return{
+      form:{},
+      loading:false,
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0,
+        pageSizes: [10,50,100,200,300]
+      },
+      roleName:localStorage.getItem("roleName").split(',')[0],
+      goodsList:[],
+      entrustOptionTwoT: {
+        align: 'center',
+        menuAlign: 'center',
+        index:true,
+        cellBtn:true,
+        addBtn:false,
+        addRowBtn:false,
+        delBtn:false,
+        searchMenuPosition:"right",
+        searchMenuSpan:6,
+        height:"auto",
+        showSummary: true,
+        summaryText: "合计",
+        sumColumnList: [
+          {
+            name: 'landWeight',
+            type: 'sum',
+            decimals:6
+          },{
+            name: 'landAmountC',
+            type: 'sum',
+            decimals:2
+          },{
+            name: 'landAmountD',
+            type: 'sum',
+            decimals:2
+          },{
+            name: 'ctnQuantity',
+            type: 'count'
+          }],
+        column: [
+          {
+            label: '车队',
+            width: 200,
+            slot:true,
+            search:true,
+            prop: 'fleetId'
+          }, {
+            label: '尺寸箱型',
+            width: 100,
+            search:true,
+            prop: 'ctnType'
+          }, {
+            label: '箱量',
+            width: 50,
+            prop: 'ctnQuantity'
+          }, {
+            label: '重量',
+            width: 160,
+            prop: 'landWeight',
+            controls: false,
+            precision: 6,
+            type: 'number'
+          }, {
+            label: '车号',
+            width: 150,
+            prop: 'plateNo'
+          }, {
+            label: '司机',
+            width: 115,
+            search:true,
+            prop: 'driverId'
+          }, {
+            label: '电话',
+            width: 160,
+            prop: 'tel'
+          }, {
+            label: '陆运费(D)',
+            prop: 'landAmountD'
+          }, {
+            label: '陆运费(C)',
+            cell: true,
+            prop: 'landAmountC'
+          }, {
+            label: '备注',
+            cell: true,
+            prop: 'remarks'
+          }
+        ]
+      },
+    }
+  },
+  methods:{
+    //箱信息保存
+    rowSave(row,index,done,loading) {
+      row.$cellEdit = false
+      done()
+    },
+    //箱信息选择车队
+    getfleetIdT(data,row){
+      this.$set(row,'fleetName',data.cname)
+    },
+    //搜索
+    searchChange(params,done) {
+      this.onLoad(this.page,params)
+      done();
+    },
+    //查询
+    onLoad(page, params) {
+      let queryParams = {
+        size: page.pageSize,
+        current: page.currentPage,
+        tag:'3',
+        ...params
+      }
+      this.loading = true;
+      driverQueryCollection(queryParams).then(res => {
+        this.goodsList = res.data.data.records
+        this.page.total = res.data.data.total
+      }).finally(() => {
+        this.loading = false;
+      })
+    },
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 600 - 113
src/views/landTransportation/placeAnOrder/detailPage.vue

@@ -10,16 +10,29 @@
         >返回列表
         </el-button>
       </div>
-      <el-button
-          class="el-button--small-yh add-customer-btn"
-          type="primary"
-          :disabled="disabled"
-          size="small"
-          @click="editCustomer"
-      >保存
-      </el-button>
+      <div>
+        <el-button
+            class="el-button--small-yh add-customer-btn"
+            type="primary"
+            :disabled="goodsForm.status === 1 || !goodsForm.id"
+            size="small"
+            style="margin-right: 70px;"
+            @click="submit"
+        >提交
+        </el-button>
+        <el-button
+            class="el-button--small-yh add-customer-btn"
+            type="primary"
+            :disabled="goodsForm.status === 1"
+            size="small"
+            @click="editCustomer"
+        >保存
+        </el-button>
+      </div>
     </div>
-    <containerTitle title="起止地信息" style="margin-top: 50px"></containerTitle>
+    <containerTitle
+        title="起止地信息"
+        style="margin-top: 50px"></containerTitle>
     <basic-container>
       <el-table
           ref="singleTable"
@@ -28,17 +41,36 @@
           :header-cell-style="{color:'#000',background:'#fafafa'}"
           style="width: 100%">
         <el-table-column
-            property="date"
             align="center"
-            width="40"
-            :render-header="renderHeader">
+            v-if="goodsForm.status !== 1"
+            width="40">
           <template slot-scope="scope">
-            <el-tooltip class="item" effect="dark" content="删除" placement="right">
-              <el-button type="danger" icon="el-icon-delete" size="mini" circle @click="deleteAddress(scope)"></el-button>
+            <el-tooltip className="item" v-if="scope.$index === tableData.length-1" effect="dark" content="增加途径地址" placement="top">
+              <el-button type="primary" icon="el-icon-plus" size="mini" circle @click="addAddress"
+              style="margin-right: 1.25rem;"></el-button>
             </el-tooltip>
           </template>
         </el-table-column>
         <el-table-column
+            property="date"
+            align="center"
+            width="40">
+          <template slot-scope="scope">
+            <span v-if="scope.$index == 0">
+              <el-button type="primary" size="mini" circle>起</el-button>
+            </span>
+            <span v-else-if="scope.$index === tableData.length-1">
+              <el-button type="success" size="mini" circle>止</el-button>
+            </span>
+            <span v-else>
+              <el-button v-if="goodsForm.status === 1" type="success" size="mini" circle>途</el-button>
+              <el-tooltip v-else class="item" effect="dark" content="删除" placement="right">
+                  <el-button type="danger" icon="el-icon-delete" size="mini" circle @click="deleteAddress(scope)"></el-button>
+              </el-tooltip>
+            </span>
+          </template>
+        </el-table-column>
+        <el-table-column
             type="index"
             label="序号"
             align="center"
@@ -53,6 +85,7 @@
             <el-cascader
                 size="small"
                 style="width: 100%;"
+                :disabled="goodsForm.status === 1"
                 v-model="scope.row.region"
                 :props="treeOption"></el-cascader>
           </template>
@@ -62,14 +95,35 @@
             align="center"
             label="详细地址">
           <template slot-scope="scope">
-            <el-input v-model="scope.row.address" 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>
     </basic-container>
     <containerTitle title="箱信息"></containerTitle>
-    <basic-container>
-      <avue-crud :data="entrustList" :option="entrustOptionTwo"></avue-crud>
+    <basic-container v-if="goodsForm.status === 0 || !goodsForm.status">
+      <avue-crud :data="entrustList"
+                 :option="entrustOptionTwo"
+                 @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"
+                 @row-update="rowSave"
+                 @row-del="rowDel"></avue-crud>
+    </basic-container>
+    <basic-container v-if="goodsForm.status !== 0 && goodsForm.status">
+      <avue-crud
+          :data="entrustList"
+          :option="entrustOptionTwoT"
+          @row-save="(row,done,loading)=>{rowSaveT(row,0,done,loading)}"
+          @row-update="rowSaveT">
+        <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>
+      </avue-crud>
     </basic-container>
     <containerTitle title="货物信息"></containerTitle>
     <basic-container>
@@ -81,33 +135,143 @@
         </template>
       </avue-form>
     </basic-container>
-    <containerTitle title="收款信息"></containerTitle>
-    <basic-container>
-      <avue-crud :data="collectionList" :option="collectionOption"></avue-crud>
-    </basic-container>
-    <containerTitle title="付款信息"></containerTitle>
+    <containerTitle title="费用明细"></containerTitle>
     <basic-container>
-      <avue-crud :data="paymentList" :option="paymentOption"></avue-crud>
+      <el-tabs v-model="activeIndex" @tab-click="handleSelect">
+        <el-tab-pane label="应收" name="1"></el-tab-pane>
+        <el-tab-pane label="应付" name="2"></el-tab-pane>
+      </el-tabs>
+      <avue-crud
+          v-if="activeIndex === '1'"
+          :data="collectionList"
+          :option="collectionOption"
+          ref="collection"
+          @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"
+          @row-update="rowSave"
+          @row-del="makeDel">
+        <template slot-scope="{row}" slot="corpId">
+          <crop-select
+              v-if="row.$cellEdit"
+              v-model="row.corpId"
+              @getCorpData="(data)=>{getfleetId(data,row)}"
+          ></crop-select>
+          <span v-else>{{row.corpName}}</span>
+        </template>
+        <template slot-scope="{row}" slot="feeId">
+          <breakdown-select
+              v-if="row.$cellEdit"
+              v-model="row.feeId"
+              @selectValue="(value) => selectValue(value,row)"
+              :configuration="breakConfiguration"
+          >
+          </breakdown-select>
+          <span v-else>{{ row.feeName }}</span>
+        </template>
+        <template slot-scope="{row,index}" slot="menu">
+          <el-button
+              type="text"
+              size="small"
+              :icon="row.$cellEdit?'el-icon-circle-plus-outline':'el-icon-edit'"
+              @click="rowCell(row,index)"
+          >{{row.$cellEdit?'保存':'编辑'}}</el-button>
+          <el-button type="text"
+                     icon="el-icon-delete"
+                     size="small"
+                     @click="$refs.collection.rowDel(row,index)"
+          >删除</el-button>
+        </template>
+        <template slot="menuLeft">
+          <el-button type="primary" icon="el-icon-plus" @click="addRowCollection" size="small">录入明细</el-button>
+        </template>
+      </avue-crud>
+      <avue-crud
+          v-if="activeIndex === '2'"
+          :data="paymentList"
+          :option="paymentOption"
+          ref="payment"
+          @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"
+          @row-update="rowSave"
+          @row-del="feeDel"
+      >
+        <template slot-scope="{row}" slot="corpId">
+          <crop-select
+              v-if="row.$cellEdit"
+              v-model="row.corpId"
+              @getCorpData="(data)=>{getfleetId(data,row)}"
+          ></crop-select>
+          <span v-else>{{row.corpName}}</span>
+        </template>
+        <template slot-scope="{row}" slot="feeId">
+          <breakdown-select
+              v-if="row.$cellEdit"
+              v-model="row.feeId"
+              @selectValue="(value) => selectValue(value,row)"
+              :configuration="breakConfiguration"
+          >
+          </breakdown-select>
+          <span v-else>{{ row.feeName }}</span>
+        </template>
+        <template slot-scope="{row,index}" slot="menu">
+          <el-button
+              type="text"
+              size="small"
+              :icon="row.$cellEdit?'el-icon-circle-plus-outline':'el-icon-edit'"
+              @click="paymentRowCell(row,index)"
+          >{{row.$cellEdit?'保存':'编辑'}}</el-button>
+          <el-button type="text"
+                     icon="el-icon-delete"
+                     size="small"
+                     @click="$refs.payment.rowDel(row,index)"
+          >删除</el-button>
+        </template>
+        <template slot="menuLeft">
+          <el-button type="primary" icon="el-icon-plus" @click="addRowPayment" size="small">录入明细</el-button>
+        </template>
+      </avue-crud>
     </basic-container>
+    <containerTitle title="上传附件"></containerTitle>
+    <c-upload
+        typeUpload="CD"
+        :data="orderFilesList"
+        :enumerationValue="76"
+    ></c-upload>
   </div>
 </template>
 
 <script>
 import {getLazyTree} from "@/api/base/region";
-let id = 0;
+import {saveDelegationList, detailDelegationList,removeCollection,saveSaveList} from "@/api/landTransportation";
+
 export default {
+  props: {
+    id: {
+      type: String
+    }
+  },
   data() {
     return {
-      provinceList:[],//省
+      activeIndex:'1',
       goodsForm: {},
+      orderFilesList:[],
+      roleName:localStorage.getItem("roleName").split(',')[0],
+      breakConfiguration:{
+        multipleChoices:false,
+        multiple:false,
+        disabled:false,
+        searchShow:true,
+        collapseTags:false,
+        clearable:true,
+        placeholder:'请点击右边按钮选择',
+        dicData:[]
+      },
+      advantageProjectData:[],
       treeOption: {
         label: 'title',
         value: 'id',
         lazy: true,
-        lazyLoad (node, resolve) {
+        lazyLoad(node, resolve) {
           const parentId = node.level === 0 ? '00' : node.data.id;
           getLazyTree(parentId).then(res => {
-            console.log(res)
             resolve(
                 res.data.data.map(item => {
                   return {
@@ -120,187 +284,510 @@ export default {
         }
       },
       tableData: [],
-      entrustList: [],
-      goodsOptionForm: {
-        menuBtn:false,
-        column: [{
-          label: '客户名称',
-          formslot:true,
-          prop: 'corpId'
-          },{
-            label: '订单号',
-            prop: 'id'
-          },{
-            label: '提单号',
-            prop: 'billNo'
-          }, {
-            label: '场站',
-            prop: 'station'
-          }, {
-            label: '到厂时间',
-            prop: 'arrivalTime'
-          }, {
-            label: '工厂名称',
-            prop: 'factory'
-          }, {
-            label: '货物名称',
-            prop: 'goods'
-          }, {
-            label: '备注',
-            prop: 'remarks'
-          }
-        ]
-      },
-      entrustOptionTwo: {
+      entrustListT: [],
+      entrustOptionTwoT: {
         align: 'center',
         menuAlign: 'center',
         index:true,
         cellBtn:true,
         addBtn:false,
-        addRowBtn:true,
-        column: [ {
+        addRowBtn:false,
+        delBtn:false,
+        showSummary: true,
+        summaryText: "合计",
+        sumColumnList: [
+          {
+            name: 'landWeight',
+            type: 'sum',
+            decimals:6
+          },{
+            name: 'landAmountC',
+            type: 'sum',
+            decimals:2
+          },{
+            name: 'landAmountD',
+            type: 'sum',
+            decimals:2
+          },{
+            name: 'ctnQuantity',
+            type: 'count'
+          }],
+        column: [
+          {
+            label: '车队',
+            width: 200,
+            slot:true,
+            prop: 'fleetId'
+          }, {
             label: '尺寸箱型',
-            cell: true,
+            width: 100,
             prop: 'ctnType'
           }, {
             label: '箱量',
-            cell: true,
+            width: 50,
             prop: 'ctnQuantity'
           }, {
-            label: '总重量(吨)',
-            cell: true,
-            prop: 'landWeight'
+            label: '重量',
+            width: 160,
+            prop: 'landWeight',
+            controls: false,
+            precision: 6,
+            type: 'number'
           }, {
-            label: '陆运费(C)',
-            cell: true,
-            prop: 'landAmountC'
+            label: '车号',
+            width: 150,
+            prop: 'plateNo'
+          }, {
+            label: '司机',
+            width: 115,
+            prop: 'driverId'
+          }, {
+            label: '电话',
+            width: 160,
+            prop: 'tel'
           }, {
             label: '陆运费(D)',
-            cell: true,
             prop: 'landAmountD'
           }, {
+            label: '陆运费(C)',
+            cell: true,
+            prop: 'landAmountC'
+          }, {
             label: '备注',
             cell: true,
             prop: 'remarks'
           }
         ]
       },
-      collectionList:[],
+      entrustList: [],
+      goodsOptionForm: {
+        menuBtn: false,
+        column: [{
+          label: '客户名称',
+          formslot: true,
+          prop: 'corpId'
+        },{
+          label: '所属公司',
+          formslot: true,
+          prop: 'billNo'
+        }, {
+          label: '订单号',
+          prop: 'id',
+          disabled:true
+        }, {
+          label: '提单号',
+          prop: 'billNo'
+        }, {
+          label: '场站',
+          prop: 'station'
+        }, {
+          label: '到厂时间',
+          type: "datetime",
+          format: 'yyyy-MM-dd HH:mm:ss',
+          valueFormat: 'yyyy-MM-dd HH:mm:ss',
+          prop: 'arrivalTime'
+        }, {
+          label: '工厂名称',
+          prop: 'factory'
+        }, {
+          label: '货物名称',
+          prop: 'goods'
+        }, {
+          label: '备注',
+          prop: 'remarks'
+        }
+        ]
+      },
+      entrustOptionTwo: {
+        align: 'center',
+        menuAlign: 'center',
+        addBtnText:'录入箱信息',
+        index: true,
+        cellBtn: true,
+        addBtn: false,
+        addRowBtn: true,
+        showSummary: true,
+        summaryText: "合计",
+        sumColumnList: [
+          {
+            name: 'landWeight',
+            type: 'sum',
+            decimals:6
+          },{
+            name: 'landAmountD',
+            type: 'sum',
+            decimals:2
+          },{
+            name: 'ctnQuantity',
+            type: 'sum',
+            decimals:1
+          }],
+        column: [{
+          label: '尺寸箱型',
+          cell: true,
+          prop: 'ctnType',
+          type: 'select',
+          width:100,
+          dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxType",
+          props: {
+            label: "dictValue",
+            value: "dictKey"
+          }
+        }, {
+          label: '箱量',
+          cell: true,
+          prop: 'ctnQuantity',
+          controls: false,
+          precision: 0,
+          width:100,
+          type: 'number'
+        }, {
+          label: '总重量(吨)',
+          cell: true,
+          prop: 'landWeight',
+          controls: false,
+          width:200,
+          precision: 6,
+          type: 'number'
+        },{
+          label: '陆运费(D)',
+          cell: true,
+          prop: 'landAmountD',
+          controls: false,
+          width:200,
+          precision: 2,
+          type: 'number'
+        }, {
+          label: '备注',
+          cell: true,
+          prop: 'remarks'
+        }
+        ]
+      },
+      collectionList: [],
       collectionOption: {
         align: 'center',
         menuAlign: 'center',
-        index:true,
-        cellBtn:true,
-        addBtn:false,
-        addRowBtn:true,
-        column: [ {
+        index: true,
+        cancelBtn:false,
+        editBtn:false,
+        delBtn:false,
+        cellBtn:false,
+        addBtn: false,
+        addRowBtn: false,
+        showSummary: true,
+        addBtnText:'录入明细',
+        summaryText: "合计",
+        sumColumnList: [{
+            name: 'price',
+            type: 'sum',
+            decimals:2
+          },{
+            name: 'amount',
+            type: 'sum',
+            decimals:2
+          },{
+            name: 'quantity',
+            type: 'sum',
+            decimals:1
+          }],
+        column: [{
           label: '客户名称',
-          cell: true,
-          prop: 'sex'
+          slot:true,
+          prop: 'corpId'
         }, {
           label: '费用名称',
-          cell: true,
-          prop: 'sex'
+          slot:true,
+          prop: 'feeId'
         }, {
           label: '计价单位',
           cell: true,
-          prop: 'sex'
+          prop: 'unit',
+          type: "select",
+          dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit",
+          props: {
+            label: "dictValue",
+            value: "dictKey"
+          }
         }, {
           label: '数量',
           cell: true,
-          prop: 'sex'
+          prop: 'quantity'
         }, {
           label: '单价',
           cell: true,
-          prop: 'sex'
+          prop: 'price'
         }, {
           label: '金额',
           cell: true,
-          prop: 'sex'
+          prop: 'amount'
         }, {
           label: '税率(默认6)',
           cell: true,
-          prop: 'sex'
+          prop: 'taxRate'
         }, {
-          label: '币别(默认RMB)',
+          label: '币别',
           cell: true,
-          prop: 'sex'
+          prop: 'currency',
+          type: "select",
+          dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
+          props: {
+            label: "dictValue",
+            value: "dictKey"
+          },
         }
         ]
       },
-      paymentList:[],
+      paymentList: [],
       paymentOption: {
         align: 'center',
         menuAlign: 'center',
-        index:true,
-        cellBtn:true,
-        addBtn:false,
-        addRowBtn:true,
-        column: [ {
+        index: true,
+        cancelBtn:false,
+        editBtn:false,
+        delBtn:false,
+        cellBtn:false,
+        addBtn: false,
+        addRowBtn: false,
+        showSummary: true,
+        addBtnText:'录入明细',
+        summaryText: "合计",
+        sumColumnList: [{
+          name: 'price',
+          type: 'sum',
+          decimals:2
+        },{
+          name: 'amount',
+          type: 'sum',
+          decimals:2
+        },{
+          name: 'quantity',
+          type: 'sum',
+          decimals:1
+        }],
+        column: [{
           label: '客户名称',
-          cell: true,
-          prop: 'sex'
+          slot:true,
+          prop: 'corpId'
         }, {
           label: '费用名称',
-          cell: true,
-          prop: 'sex'
+          slot:true,
+          prop: 'feeId'
         }, {
           label: '计价单位',
           cell: true,
-          prop: 'sex'
+          prop: 'unit',
+          type: "select",
+          dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit",
+          props: {
+            label: "dictValue",
+            value: "dictKey"
+          }
         }, {
           label: '数量',
           cell: true,
-          prop: 'sex'
+          prop: 'quantity'
         }, {
           label: '单价',
           cell: true,
-          prop: 'sex'
+          prop: 'price'
         }, {
           label: '金额',
           cell: true,
-          prop: 'sex'
+          prop: 'amount'
         }, {
           label: '税率(默认6)',
           cell: true,
-          prop: 'sex'
+          prop: 'taxRate'
         }, {
           label: '币别(默认RMB)',
           cell: true,
-          prop: 'sex'
+          prop: 'currency',
+          type: "select",
+          dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
+          props: {
+            label: "dictValue",
+            value: "dictKey"
+          },
         }
         ]
       }
     };
   },
   created() {
-    this.queryAddress('00')
+    if (this.id){
+      detailDelegationList({id: this.id, kind: '1'}).then(res => {
+        this.goodsForm = res.data.data
+        this.tableData = res.data.data.orderAddressList
+        this.entrustList = res.data.data.orderItemList
+        this.goodsList = res.data.data.orderItemList
+        if (res.data.data.orderFeeList.length > 0){
+          res.data.data.orderFeeList.forEach(item=>{
+            if (item.type == 1){
+              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(',')
+        })
+      })
+    }else {
+      this.tableData = [{
+        region:[],
+        address:''
+      },{
+        region:[],
+        address:''
+      }]
+      this.entrustList=[{$cellEdit:true}]
+    }
   },
   methods: {
-    //查询省市区
-    queryAddress(value,type){
-      getLazyTree().then(res=>{
-          this.provinceList = res.data.data
+    //提交委托
+    submit(){
+      saveDelegationList({
+        id:this.goodsForm.id
+      }).then(res => {
+        this.$message.success('提交成功');
       })
     },
+    //切换收付费
+    handleSelect(tab, event){
+      this.activeIndex = tab.name
+    },
+    //箱信息保存
+    rowSaveT(row,index,done,loading) {
+      row.$cellEdit = false
+      done()
+    },
+    //箱信息选择车队
+    getfleetIdT(data,row){
+      this.$set(row,'fleetName',data.cname)
+    },
     //地址新增
-    addAddress(){
-      this.tableData.push({})
+    addAddress() {
+      this.tableData.splice(this.tableData.length-1,0,{leas:1111})
     },
     //返回主列表
     backToList() {
+      this.goodsForm = {}
       this.$emit('backToList')
     },
     //删除途径地址
-    deleteAddress(scope){
+    deleteAddress(scope) {
       this.tableData.splice(scope.$index, 1);
     },
+    //箱信息保存
+    rowSave(row,index,done,loading) {
+      row.$cellEdit = false
+      done()
+    },
+    rowCell(row, index) {
+      this.$refs.collection.rowCell(row, index)
+    },
+    paymentRowCell(row, index) {
+      this.$refs.payment.rowCell(row, index)
+    },
+    //箱信息移除
+    rowDel(row, index) {
+      this.$confirm('此操作将永久删除该单据, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.entrustList.splice(index, 1);
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消删除'
+        });
+      });
+    },
+    //保存
+    editCustomer() {
+      let data = JSON.parse(JSON.stringify(this.tableData))
+      data.forEach(item => {
+        if (item.region.length !== 0) item.region = item.region.join(',')
+      })
+      saveSaveList({
+        ...this.goodsForm,
+        kind: '1',
+        orderAddressList: data,
+        orderItemList: this.entrustList,
+        orderFeeList:this.collectionList.concat(this.paymentList)
+      }).then(res => {
+        this.$message.success('保存成功');
+      })
+    },
+    //收费新增
+    addRowCollection(){
+      this.$refs.collection.rowCellAdd( {
+        currency:'1',
+        type:'1',
+        $cellEdit:true
+      });
+    },
+    //付费新增
+    addRowPayment(){
+      this.$refs.payment.rowCellAdd( {
+        currency:'1',
+        type:'2',
+        $cellEdit:true
+      });
+    },
+    //选择费用
+    selectValue(value,row){
+      this.$set(row,'feeName',value.cname)
+    },
+    //选择客户信息触发
+    getfleetId(data,row){
+      this.$set(row,'corpName',data.cname)
+    },
+    //收款信息移除
+    makeDel(row, index) {
+      this.$confirm('此操作将永久删除该单据, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        if (row.id) removeCollection(row.id)
+        this.collectionList.splice(index, 1);
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消删除'
+        });
+      });
+    },
+    //付款信息移除
+    feeDel(row, index) {
+      this.$confirm('此操作将永久删除该单据, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        if (row.id) removeCollection(row.id)
+        this.paymentList.splice(index, 1);
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消删除'
+        });
+      });
+    },
     //自定义表头
     renderHeader(h) {
-      return(
+      return (
           <div>
             <el-tooltip className="item" effect="dark" content="增加途径地址" placement="top">
-              <el-button type="primary" icon="el-icon-plus" size="mini" circle onClick={()=>this.addAddress()} style="margin-right: 1.25rem;"></el-button>
+              <el-button type="primary" icon="el-icon-plus" size="mini" circle onClick={() => this.addAddress()}
+                         style="margin-right: 1.25rem;"></el-button>
             </el-tooltip>
           </div>
       )

+ 394 - 31
src/views/landTransportation/placeAnOrder/index.vue

@@ -1,94 +1,457 @@
 <template>
   <div>
     <basic-container v-if="show">
-      <avue-crud :table-loading="loading" :data="dataList" :page.sync="page" ref="crud" :option="option" @on-load="onLoad" @search-change="searchChange">
+      <div class="home-container">
+        <div style="display: flex;justify-content: center;">
+          <div class="content">
+            <div class="content-item" @click="handleClick('')">
+              <div class="card">
+                <div class="card-title card-title1">
+                <span>
+                  全
+                </span>
+                </div>
+                <div class="card-content">
+                  <span class="card-content-num">1</span>
+                  <span class="card-content-text">全部订单</span>
+                </div>
+              </div>
+            </div>
+            <div class="divider"/>
+            <div class="content-item" @click="handleClick('0')">
+              <div class="card">
+                <div class="card-title card-title2">
+                <span>
+                  未
+                </span>
+                </div>
+                <div class="card-content">
+                  <span class="card-content-num">1</span>
+                  <span class="card-content-text">未调度</span>
+                </div>
+              </div>
+            </div>
+            <div class="divider"/>
+            <div class="content-item" @click="handleClick('1')">
+              <div class="card">
+                <div class="card-title card-title3">
+                <span>
+                  派
+                </span>
+                </div>
+                <div class="card-content">
+                  <span class="card-content-num">1</span>
+                  <span class="card-content-text">未派车</span>
+                </div>
+              </div>
+            </div>
+            <div class="divider"/>
+            <div class="content-item" @click="handleClick('2')">
+              <div class="card">
+                <div class="card-title card-title4">
+                <span>
+                  受
+                </span>
+                </div>
+                <div class="card-content">
+                  <span class="card-content-num">1</span>
+                  <span class="card-content-text">未受理</span>
+                </div>
+              </div>
+            </div>
+            <div class="divider"/>
+            <div class="content-item" @click="handleClick('3')">
+              <div class="card">
+                <div class="card-title card-title5">
+                <span>
+                  完
+                </span>
+                </div>
+                <div class="card-content">
+                  <span class="card-content-num">1</span>
+                  <span class="card-content-text">未完工</span>
+                </div>
+              </div>
+            </div><div class="divider"/>
+            <div class="content-item" @click="handleClick('4')">
+              <div class="card">
+                <div class="card-title card-title6">
+                    <span>
+                      工
+                    </span>
+                </div>
+                <div class="card-content">
+                  <span class="card-content-num">1</span>
+                  <span class="card-content-text">工单关闭</span>
+                </div>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+      <avue-crud
+          :table-loading="loading"
+          :page.sync="page"
+          :data="dataList"
+          ref="crud"
+          :option="option"
+          @on-load="onLoad"
+          @row-del="rowDel"
+          @search-criteria-switch="searchCriteriaSwitch"
+          @search-change="searchChange">
         <template slot="menuLeft" slot-scope="{size}">
-          <el-button type="primary" :size="size" @click="rowSave">新增</el-button>
+          <el-button type="primary" :size="size" @click="rowSave">创建单据</el-button>
+          <el-button type="success" :size="size" @click="rowSave">复制单据</el-button>
+          <el-button type="info" :size="size" icon="el-icon-printer" @click="rowSave">报表</el-button>
         </template>
         <template slot-scope="{row,index}" slot="menu">
           <el-button type="text"
                      icon="el-icon-edit"
                      size="small"
-                     @click.stop="$refs.crud.rowEdit(row,index)">编辑</el-button>
+                     @click.stop="rowCell(row,index)">编辑
+          </el-button>
           <el-button type="text"
                      icon="el-icon-delete"
                      size="small"
-                     @click.stop="$refs.crud.rowDelete(row,index)">删除</el-button>
+                     @click.stop="$refs.crud.rowDel(row,index)">删除
+          </el-button>
         </template>
       </avue-crud>
     </basic-container>
-    <detail-page v-else @backToList="backToList"></detail-page>
+    <detail-page v-else @backToList="backToList" :id="id"></detail-page>
   </div>
 </template>
 
 <script>
 import detailPage from './detailPage'
-import {selectInvoiceList} from "@/api/landTransportation";
+import {removeDelegationList, selectInvoiceList} from "@/api/landTransportation";
+import {getQueryString} from "@/util/util";
+
 export default {
   name: "index",
   components: {
     detailPage
   },
-  data(){
-    return{
-      show:true,
-      loading:false,
-      dataList:[],
+  data() {
+    return {
+      id: '',
+      activeName: null,
+      show: true,
+      dataList: [],
+      loading: false,
       page: {
         pageSize: 10,
         currentPage: 1,
         total: 0,
-        pageSizes: [10,50,100,200,300]
+        pageSizes: [10, 50, 100, 200, 300]
       },
-      option:{
-        align:'center',
+      option: {
+        align: 'center',
         index: true,
         addBtn: false,
         editBtn: false,
-        delBtn:false,
-        height:"auto",
-        column:[{
-            label: '订单号',
-            prop: 'id',
-            index: 1,
-            width: 140,
-            cell: true,
-            overHidden: true,
-            search:true,
-          }]
+        delBtn: false,
+        height: "auto",
+        searchSpan: 8,
+        searchIcon: true,
+        searchIndex: 2,
+        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,
+          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,
+          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,
+        }]
       }
     }
   },
-  methods:{
+  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: {
+    // 获得高度
+    searchCriteriaSwitch(type) {
+      if (type) {
+        this.option.height = this.option.height - 240
+      } else {
+        this.option.height = this.option.height + 240
+      }
+      this.$refs.crud.getTableHeight()
+    },
+    //切换订单状态
+    handleClick(tab) {
+      this.activeName = tab
+      this.onLoad(this.page)
+    },
     onLoad(page, params) {
       let queryParams = {
         size: page.pageSize,
         current: page.currentPage,
+        itemStatus: this.activeName,
+        kind: '1',
         ...params
       }
       this.loading = true;
       selectInvoiceList(queryParams).then(res => {
         this.dataList = res.data.data.records
         this.page.total = res.data.data.total
+        this.option.height = window.innerHeight - 240;
       }).finally(() => {
         this.loading = false;
       })
     },
     //搜索
-    searchChange(params,done) {
-      this.onLoad(this.page,params)
+    searchChange(params, done) {
+      this.onLoad(this.page, params)
       done();
     },
-    rowSave(){
+    //列表删除
+    rowDel(row) {
+      this.$confirm('此操作将永久删除该单据, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        removeDelegationList({ids: row.id}).then(res => {
+          this.$message.success('删除成功');
+          this.onLoad(this.page)
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消删除'
+        });
+      });
+    },
+    //行编辑
+    rowCell(row, index) {
+      console.log(localStorage.getItem("roleName").split(','))
+      this.id = row.id
+      this.show = false
+    },
+    rowSave() {
       this.show = false
     },
-    backToList(){
+    backToList() {
+      this.id = ''
       this.show = true
     }
   }
 }
 </script>
 
-<style scoped>
+<style lang="scss" scoped>
+.home-container {
+  padding: 0px 5px 5px 5px;
+  box-sizing: border-box;
+  height: 100%;
+
+  ::v-deep .el-card__body {
+    padding: 10px 15px;
+    font-size: 14px;
+  }
+
+  &__card {
+    width: 100%;
+    height: 100%;
+  }
+
+  .title {
+    display: flex;
+    justify-content: space-between;
+
+    .right {
+      display: flex;
+      align-items: center;
+
+      &_but {
+        margin-right: 10px;
+        border: 1px solid #409eff;
+        width: 80px;
+        border-radius: 3px;
+        display: flex;
+
+        &_left {
+          width: 40px;
+          text-align: center;
+          color: #409eff;
+          cursor: pointer;
+        }
+
+        &_right {
+          width: 40px;
+          text-align: center;
+          color: #409eff;
+          cursor: pointer;
+        }
+
+        &_active {
+          color: #fff;
+          background-color: #409eff;
+        }
+      }
+    }
+  }
+}
+
+.content {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  height: 15vh;
+  width: 80vw;
 
+  .divider {
+    display: block;
+    height: 0px;
+    width: 100%;
+    border-top: 1px dashed #dcdfe6;
+  }
+
+  &-item {
+    margin-left: 1vw;
+
+    .card {
+      width: 130px;
+      display: flex;
+      align-items: center;
+
+      &-title {
+        width: 40px;
+        height: 40px;
+        text-align: center;
+        border-radius: 50%;
+        font-size: 20px;
+        font-weight: 600;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+
+        span {
+          line-height: 20px;
+        }
+      }
+
+      &-title1 {
+        color: #037fe1;
+        background-color: rgba(3, 127, 225, 0.15);
+      }
+
+      &-title2 {
+        color: #ffa21e;
+        background-color: rgba(255, 162, 30, 0.15);
+      }
+
+      &-title3 {
+        color: #fb5b60;
+        background-color: rgba(251, 91, 96, 0.15);
+      }
+
+      &-title4 {
+        color: #42bc6f;
+        background-color: rgba(66, 188, 111, 0.15);
+      }
+      &-title5 {
+        color: #14cde1;
+        background-color: rgba(52, 149, 161, 0.15);
+      }
+      &-title6 {
+        color: rgba(4, 66, 31, 0.63);
+        background-color: rgba(66, 188, 111, 0.15);
+      }
+
+      &-content {
+        padding-left: 1vw;
+        display: flex;
+        flex-direction: column;
+
+        &-num {
+          font-size: 20px;
+          font-weight: 600;
+        }
+
+        &-text {
+          color: #909399;
+        }
+      }
+    }
+  }
+}
 </style>