Browse Source

提交陆运

caojunjie 3 years ago
parent
commit
57dc3cedc6

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

@@ -118,3 +118,10 @@ export function fleetList() {
         method: 'get'
     })
 }
+//获取省市区
+export function addressList(name) {
+    return request({
+        url: '/api/blade-system/region/detail?districtName='+name,
+        method: 'get'
+    })
+}

+ 3 - 12
src/components/upload/index.vue

@@ -218,10 +218,7 @@ export default {
      * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
      * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
      */
-    this.option = await this.getColumnData(
-      this.getColumnName(this.enumerationValue),
-      this.originalOptions
-    );
+    this.option = await this.getColumnData(this.getColumnName(this.enumerationValue),this.originalOptions);
   },
   methods: {
     //自定义列保存
@@ -231,10 +228,7 @@ export default {
        * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
        * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
        */
-      const inSave = await this.saveColumnData(
-        this.getColumnName(this.enumerationValue),
-        this.option
-      );
+      const inSave = await this.saveColumnData(this.getColumnName(this.enumerationValue),this.option);
       if (inSave) {
         this.$message.success("保存成功");
         //关闭窗口
@@ -244,10 +238,7 @@ export default {
     //自定义列重置
     async resetColumn() {
       this.option = this.originalOptions;
-      const inSave = await this.delColumnData(
-        this.getColumnName(this.enumerationValue),
-        this.originalOptions
-      );
+      const inSave = await this.delColumnData(this.getColumnName(this.enumerationValue),this.originalOptions);
       if (inSave) {
         this.$message.success("重置成功");
         this.$refs.crud.$refs.dialogColumn.columnBox = false;

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

@@ -290,6 +290,18 @@ const columnName = [{
   {
     code: 84,
     name: '经销商(D)附件'
+  },{
+    code: 85,
+    name: '委托'
+  },{
+    code: 86,
+    name: '派车'
+  },{
+    code: 87,
+    name: '车队'
+  },{
+    code: 88,
+    name: '司机'
   },
 ]
 export const getColumnName = (key) => {

+ 30 - 0
src/router/views/index.js

@@ -1097,4 +1097,34 @@ export default [{
       component: () => import( /* webpackChunkName: "views" */ '@/views/dealer/purchase/index')
     }]
   },
+  //陆运委托
+  {
+    path: '/landTransportation/placeAnOrder/index',
+    component: Layout,
+    hidden: true,
+    children: [{
+      path: '/landTransportation/placeAnOrder/index',
+      name: '委托',
+      meta: {
+        i18n: '/landTransportation/placeAnOrder/index',
+        keepAlive: true,
+      },
+      component: () => import( /* webpackChunkName: "views" */ '@/views/landTransportation/placeAnOrder/index')
+    }]
+  },
+  //派车
+  {
+    path: '/landTransportation/dispatchingCars/index',
+    component: Layout,
+    hidden: true,
+    children: [{
+      path: '/landTransportation/dispatchingCars/index',
+      name: '派车',
+      meta: {
+        i18n: '/landTransportation/dispatchingCars/index',
+        keepAlive: true,
+      },
+      component: () => import( /* webpackChunkName: "views" */ '@/views/landTransportation/dispatchingCars/index')
+    }]
+  },
 ]

+ 1 - 4
src/views/businessManagement/salesOrder/index.vue

@@ -522,10 +522,7 @@ export default {
     },
     async resetColumn() {
       this.option = option;
-      const inSave = await this.delColumnData(
-        this.getColumnName(14),
-        option
-      );
+      const inSave = await this.delColumnData(this.getColumnName(14),option);
       if (inSave) {
         this.$nextTick(() => {
           this.$refs.crud.doLayout()

+ 7 - 0
src/views/landTransportation/dispatchingCars/detailPage.vue

@@ -28,6 +28,13 @@
             width="60">
         </el-table-column>
         <el-table-column
+            property="corpName"
+            label="发货工厂"
+            align="center"
+            show-overflow-tooltip
+            width="280">
+        </el-table-column>
+        <el-table-column
             property="province"
             label="省市区"
             align="center"

+ 72 - 8
src/views/landTransportation/dispatchingCars/index.vue

@@ -9,19 +9,27 @@
           :option="option"
           @on-load="onLoad"
           @row-del="rowDel"
+          @resetColumn="resetColumn"
+          @saveColumn="saveColumn"
+          @search-criteria-switch="searchCriteriaSwitch"
           @search-change="searchChange">
 <!--        <template slot="menuLeft" slot-scope="{size}">-->
 <!--          <el-button type="primary" :size="size" @click="rowSave">新增</el-button>-->
 <!--        </template>-->
+        <template slot="corpNameSearch" slot-scope="{ row,index}">
+          <crop-select
+              v-model="row.corpId"
+          ></crop-select>
+        </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>
+<!--          <el-button type="text"-->
+<!--                     icon="el-icon-delete"-->
+<!--                     size="small"-->
+<!--                     @click.stop="$refs.crud.rowDel(row,index)">删除</el-button>-->
         </template>
       </avue-crud>
     </basic-container>
@@ -49,7 +57,8 @@ export default {
         total: 0,
         pageSizes: [10,50,100,200,300]
       },
-      option:{
+      option:{},
+      optionList:{
         align:'center',
         index: true,
         addBtn: false,
@@ -116,6 +125,11 @@ export default {
           label: '到厂时间',
           prop: 'arrivalTime',
           overHidden: true,
+          type: "date",
+          searchRange: true,
+          defaultTime:['00:00:00', '23:59:59'],
+          format: "yyyy-MM-dd HH:mm:ss",
+          valueFormat: "yyyy-MM-dd HH:mm:ss",
           index: 1,
           width: 140,
           search: true,
@@ -130,6 +144,11 @@ export default {
           label: '制单日期',
           overHidden: true,
           prop: 'createTime',
+          type: "date",
+          searchRange: true,
+          defaultTime:['00:00:00', '23:59:59'],
+          format: "yyyy-MM-dd HH:mm:ss",
+          valueFormat: "yyyy-MM-dd HH:mm:ss",
           index: 1,
           width: 140,
           search: true,
@@ -137,7 +156,8 @@ export default {
       }
     }
   },
-  created() {
+  async created() {
+    this.option = await this.getColumnData(this.getColumnName(86),this.optionList);
     let i = 0;
     this.option.column.forEach(item => {
       if (item.search) i++
@@ -149,6 +169,38 @@ export default {
     }
   },
   methods:{
+    //自定义列保存
+    async saveColumn() {
+      /**
+       * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
+       * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
+       * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
+       */
+      const inSave = await this.saveColumnData(this.getColumnName(86),this.option);
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    //自定义列重置
+    async resetColumn() {
+      this.option = this.optionList;
+      const inSave = await this.delColumnData(this.getColumnName(86),this.optionList);
+      if (inSave) {
+        this.$message.success("重置成功");
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    // 获得高度
+    searchCriteriaSwitch(type) {
+      if (type) {
+        this.option.height = this.option.height - 138
+      } else {
+        this.option.height = this.option.height + 138
+      }
+      this.$refs.crud.getTableHeight()
+    },
     onLoad(page, params) {
       let queryParams = {
         size: page.pageSize,
@@ -160,13 +212,25 @@ export default {
       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) {
+      let data = params
+      if (params.arrivalTime){
+        data.beginArrivalTime = params.arrivalTime[0]
+        data.endArrivalTime = params.arrivalTime[1]
+      }
+      if (params.createTime){
+        data.beginCrateTime = params.createTime[0]
+        data.endCrateTime = params.createTime[1]
+      }
+      delete data.arrivalTime
+      delete data.createTime
+      this.onLoad(this.page, data)
       done();
     },
     //列表删除

+ 57 - 6
src/views/landTransportation/placeAnOrder/detailPage.vue

@@ -79,6 +79,18 @@
             width="60">
         </el-table-column>
         <el-table-column
+            property="corpId"
+            label="发货工厂"
+            align="center"
+            width="280">
+          <template slot-scope="scope">
+            <crop-select
+                :disabled="goodsForm.status === 1"
+                v-model="scope.row.corpId"
+                @getCorpData="(row)=>{withAddress(row,scope)}"/>
+          </template>
+        </el-table-column>
+        <el-table-column
             property="province"
             label="省市区"
             align="center"
@@ -87,9 +99,10 @@
             <el-cascader
                 size="small"
                 style="width: 100%;"
+                :key="scope.row.key"
                 :disabled="goodsForm.status === 1"
-                v-model="scope.row.region"
-                :props="treeOption"></el-cascader>
+                :props="treeOption"
+                v-model="scope.row.region"></el-cascader>
           </template>
         </el-table-column>
         <el-table-column
@@ -136,7 +149,6 @@
               :disabled="goodsForm.status === 1"
               v-model="goodsForm.corpId"
               @getCorpData="getCorpData"
-
           ></crop-select>
         </template>
       </avue-form>
@@ -250,7 +262,13 @@
 
 <script>
 import {getLazyTree} from "@/api/base/region";
-import {saveDelegationList, detailDelegationList, removeCollection, saveSaveList} from "@/api/landTransportation";
+import {
+  saveDelegationList,
+  detailDelegationList,
+  removeCollection,
+  saveSaveList,
+  addressList
+} from "@/api/landTransportation";
 
 export default {
   props: {
@@ -262,6 +280,7 @@ export default {
     return {
       activeIndex: '1',
       goodsForm: {},
+      modelKey:1,
       orderFilesList: [],
       roleName: localStorage.getItem("roleName").split(',')[0],
       breakConfiguration: {
@@ -728,7 +747,8 @@ export default {
     //保存
     editCustomer() {
       let data = JSON.parse(JSON.stringify(this.tableData))
-      data.forEach(item => {
+      data.forEach((item,index) => {
+        item.sort = index+1
         if (item.region.length !== 0) item.region = item.region.join(',')
       })
       saveSaveList({
@@ -739,7 +759,12 @@ export default {
         orderFeeList: this.collectionList.concat(this.paymentList)
       }).then(res => {
         this.$message.success('保存成功');
-        this.refreshData()
+        if (!this.goodsForm.id){
+          this.goodsForm = {}
+          this.$emit('backToList')
+        }else {
+          this.refreshData()
+        }
       })
     },
     //收费新增
@@ -802,6 +827,32 @@ export default {
     getCorpData(row) {
       this.goodsForm.belongCompany = row.belongCompany
     },
+    //选择地址客户带出地址
+    withAddress(row,scope){
+      if (!scope.row.key) scope.row.key = 0
+      this.tableData[scope.$index].corpName = row.cname
+      this.tableData[scope.$index].address = row.attn
+      if (row.tel) {
+        if (!row.attn){
+          this.tableData[scope.$index].address += row.tel
+        }else {
+          this.tableData[scope.$index].address += '—' + row.tel
+        }
+      }
+      if (row.storageAddr){
+        if (!row.tel && !row.attn){
+          this.tableData[scope.$index].address += row.storageAddr
+        }else {
+          this.tableData[scope.$index].address += '—' + row.storageAddr
+        }
+      }
+      if (row.belongtoarea){
+        addressList(row.belongtoarea).then(res=>{
+          this.tableData[scope.$index].region = [res.data.data.provinceCode,res.data.data.parentId,res.data.data.districtCode]
+          scope.row.key++
+        })
+      }
+    },
     //自定义表头
     renderHeader(h) {
       return (

+ 95 - 36
src/views/landTransportation/placeAnOrder/index.vue

@@ -72,7 +72,8 @@
                   <span class="card-content-text">未完工</span>
                 </div>
               </div>
-            </div><div class="divider"/>
+            </div>
+            <div class="divider"/>
             <div class="content-item" @click="handleClick('4')">
               <div class="card">
                 <div class="card-title card-title6">
@@ -97,6 +98,8 @@
           :option="option"
           @on-load="onLoad"
           @row-del="rowDel"
+          @resetColumn="resetColumn"
+          @saveColumn="saveColumn"
           @search-criteria-switch="searchCriteriaSwitch"
           @search-change="searchChange">
         <template slot="menuLeft" slot-scope="{size}">
@@ -104,6 +107,11 @@
           <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="corpNameSearch" slot-scope="{ row,index}">
+          <crop-select
+              v-model="row.corpId"
+          ></crop-select>
+        </template>
         <template slot-scope="{row,index}" slot="menu">
           <el-button type="text"
                      icon="el-icon-edit"
@@ -113,6 +121,7 @@
           <el-button type="text"
                      icon="el-icon-delete"
                      size="small"
+                     v-if="row.status < 1"
                      @click.stop="$refs.crud.rowDel(row,index)">删除
           </el-button>
         </template>
@@ -145,7 +154,8 @@ export default {
         total: 0,
         pageSizes: [10, 50, 100, 200, 300]
       },
-      option: {
+      option: {},
+      optionList: {
         align: 'center',
         index: true,
         addBtn: false,
@@ -163,7 +173,7 @@ export default {
         }, {
           label: '订单号',
           prop: 'id',
-          index: 1,
+          index: 2,
           overHidden: true,
           width: 160,
           search: true,
@@ -171,20 +181,20 @@ export default {
           label: '客户名称',
           prop: 'corpName',
           overHidden: true,
-          index: 1,
+          index: 3,
           width: 140,
           search: true,
         }, {
           label: '所属公司',
           prop: 'belongCompany',
           overHidden: true,
-          index: 1,
+          index: 4,
           width: 140,
           search: true,
         }, {
           label: '提单号',
           prop: 'billNo',
-          index: 1,
+          index: 5,
           overHidden: true,
           width: 140,
           search: true,
@@ -192,49 +202,62 @@ export default {
           label: '货物名称',
           prop: 'goods',
           overHidden: true,
-          index: 1,
+          index: 6,
           width: 140,
           search: true,
         }, {
           label: '路线',
           prop: 'id',
           overHidden: true,
-          index: 1,
+          index: 7,
           width: 140,
           search: true,
         }, {
           label: '场站',
           prop: 'station',
           overHidden: true,
-          index: 1,
-          width: 140,
-          search: true,
-        }, {
-          label: '到厂时间',
-          prop: 'arrivalTime',
-          overHidden: true,
-          index: 1,
+          index: 8,
           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,
-        }]
+        },
+          {
+            label: '到厂时间',
+            prop: 'arrivalTime',
+            overHidden: true,
+            type: "date",
+            searchRange: true,
+            unlinkPanels: true,
+            defaultTime: ['00:00:00', '23:59:59'],
+            format: "yyyy-MM-dd HH:mm:ss",
+            valueFormat: "yyyy-MM-dd HH:mm:ss",
+            index: 9,
+            width: 140,
+            search: true,
+          }, {
+            label: '工厂名称',
+            prop: 'factory',
+            overHidden: true,
+            index: 10,
+            width: 140,
+            search: true,
+          }, {
+            label: '制单日期',
+            overHidden: true,
+            prop: 'createTime',
+            type: "date",
+            searchRange: true,
+            defaultTime: ['00:00:00', '23:59:59'],
+            format: "yyyy-MM-dd HH:mm:ss",
+            valueFormat: "yyyy-MM-dd HH:mm:ss",
+            index: 11,
+            width: 140,
+            search: true,
+          }]
       }
     }
   },
-  created() {
+  async created() {
+    this.option = await this.getColumnData(this.getColumnName(85), this.optionList);
     let i = 0;
     this.option.column.forEach(item => {
       if (item.search) i++
@@ -246,12 +269,35 @@ export default {
     }
   },
   methods: {
+    //自定义列保存
+    async saveColumn() {
+      /**
+       * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
+       * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
+       * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
+       */
+      const inSave = await this.saveColumnData(this.getColumnName(85), this.option);
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    //自定义列重置
+    async resetColumn() {
+      this.option = this.optionList;
+      const inSave = await this.delColumnData(this.getColumnName(85), this.optionList);
+      if (inSave) {
+        this.$message.success("重置成功");
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
     // 获得高度
     searchCriteriaSwitch(type) {
       if (type) {
-        this.option.height = this.option.height - 240
+        this.option.height = this.option.height - 138
       } else {
-        this.option.height = this.option.height + 240
+        this.option.height = this.option.height + 138
       }
       this.$refs.crud.getTableHeight()
     },
@@ -272,14 +318,25 @@ export default {
       selectInvoiceList(queryParams).then(res => {
         this.dataList = res.data.data.records
         this.page.total = res.data.data.total
-        this.option.height = window.innerHeight - 240;
+        this.option.height = window.innerHeight - 370;
       }).finally(() => {
         this.loading = false;
       })
     },
     //搜索
     searchChange(params, done) {
-      this.onLoad(this.page, params)
+      let data = params
+      if (params.arrivalTime) {
+        data.beginArrivalTime = params.arrivalTime[0]
+        data.endArrivalTime = params.arrivalTime[1]
+      }
+      if (params.createTime) {
+        data.beginCrateTime = params.createTime[0]
+        data.endCrateTime = params.createTime[1]
+      }
+      delete data.arrivalTime
+      delete data.createTime
+      this.onLoad(this.page, data)
       done();
     },
     //列表删除
@@ -428,10 +485,12 @@ export default {
         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);