Pārlūkot izejas kodu

新增陆运台账

caojunjie 3 gadi atpakaļ
vecāks
revīzija
4a814bb612

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

@@ -327,6 +327,9 @@ const columnName = [{
     code: 88,
     name: '跟踪'
   },{
+    code: 88.1,
+    name: '陆运台账'
+  },{
     code: 89,
     name: '事务采购申请商品明细'
   },{

+ 831 - 0
src/views/landTransportation/reportAnalysis/index.vue

@@ -0,0 +1,831 @@
+<template>
+  <div>
+    <basic-container v-if="key>0">
+      <avue-crud
+          :data="goodsList"
+          :option="goodsOptionCrud"
+          :table-loading="loading"
+          :page.sync="page"
+          ref="crud"
+          @on-load="onLoad"
+          @resetColumn="resetColumn"
+          @saveColumn="saveColumn"
+          @search-change="searchChange"
+          @search-criteria-switch="searchCriteriaSwitch"
+          @row-save="(row,done,loading)=>{rowSave(row,0,done,loading)}"
+          @row-update="rowSave">
+        <template slot-scope="{row}" slot="fleetId">
+          <span>{{ row.fleetName }}</span>
+        </template>
+        <template slot-scope="{row}" slot="fleetIdSearch">
+          <crop-select
+              v-model="row.fleetId"
+              corpType="CD"
+          ></crop-select>
+        </template>
+        <template slot-scope="{row,index}" slot="menu">
+          <el-button
+              type="text"
+              size="small"
+              v-if="row.status === 2"
+              @click="rowSaveT(row,index)"
+          >{{ row.$cellEdit ? '保 存' : '修 改' }}
+          </el-button>
+          <el-button
+              size="small"
+              type="text"
+              @click="designate(row, index)"
+              v-if="row.status===2"
+          >受 理
+          </el-button>
+          <el-button
+              size="small"
+              type="text"
+              @click="cancelDesignate(row, index)"
+              v-if="row.status===3"
+          >取消受理
+          </el-button>
+          <el-button
+              size="small"
+              type="text"
+              @click="confirmCompletion(row, index)"
+              v-if="row.status === 3"
+          >确认完工
+          </el-button>
+          <el-button
+              size="small"
+              type="text"
+              @click="annexOpen(row, index)"
+          >附 件
+          </el-button>
+        </template>
+        <template slot="addressDetail" slot-scope="{ row,index}">
+          <el-tooltip class="item" effect="dark" placement="top">
+            <div v-html="ToBreak(row.addressDetail)" slot="content"></div>
+            <div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{row.addressDetail}}</div>
+          </el-tooltip>
+        </template>
+      </avue-crud>
+      <el-dialog
+          title="附件"
+          :visible.sync="dialogVisible"
+          append-to-body
+          width="70%">
+        <c-upload
+            typeUpload="GZ"
+            :basic="true"
+            deleteUrl="/api/blade-client/common-file/remove"
+            :data="orderList"
+            :disabled="form.status===4"
+            :enumerationValue="76"
+        ></c-upload>
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="dialogVisible = false" size="small">取 消</el-button>
+          <el-button type="primary" @click="saveAnnex" size="small" :disabled="form.status===4">保 存</el-button>
+        </span>
+      </el-dialog>
+    </basic-container>
+  </div>
+</template>
+
+<script>
+import {
+  driverQueryCollection,
+  acceptanceCollection,
+  acceptanceDispatchCollection,
+  confirmCompletion,
+  fleetList, motorcadeDriver, fleetDriverSave, getAttachment, saveAttached
+} from "@/api/landTransportation";
+
+export default {
+  name: "index",
+  data() {
+    return {
+      key:0,
+      form: {},
+      orderList:[],
+      dialogVisible: false,
+      loading: false,
+      activeName:'',
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0,
+        pageSizes: [10, 50, 100, 200, 300]
+      },
+      roleName: localStorage.getItem("roleName").split(',')[0],
+      goodsList: [],
+      goodsOptionCrud:{},
+      optionList: {
+        stripe:true,
+        index: true,
+        addBtn: false,
+        delBtn: false,
+        cellBtn: false,
+        cancelBtn: false,
+        editBtn: false,
+        addRowBtn: false,
+        refreshBtn: false,
+        searchIcon: true,
+        searchIndex: 2,
+        searchSpan: 8,
+        menu:false,
+        searchMenuPosition: "right",
+        searchMenuSpan: 6,
+        align: 'center',
+        height: "auto",
+        showSummary: true,
+        summaryText: "合计",
+        sumColumnList: [
+          {
+            name: 'landWeight',
+            type: 'sum',
+            decimals: 2
+          }, {
+            name: 'landAmountC',
+            type: 'sum',
+            decimals: 2
+          }, {
+            name: 'ctnQuantity',
+            type: 'count'
+          },{
+            name: 'oneFeeC',
+            type: 'sum',
+            decimals: 2
+          },{
+            name: 'twoFeeC',
+            type: 'sum',
+            decimals: 2
+          },{
+            name: 'threeFeeC',
+            type: 'sum',
+            decimals: 2
+          },{
+            name: 'fourFeeC',
+            type: 'sum',
+            decimals: 2
+          },{
+            name: 'fiveFeeC',
+            type: 'sum',
+            decimals: 2
+          }, {
+            name: 'oneFeeD',
+            type: 'sum',
+            decimals: 2
+          }, {
+            name: 'twoFeeD',
+            type: 'sum',
+            decimals: 2
+          }, {
+            name: 'threeFeeD',
+            type: 'sum',
+            decimals: 2
+          }, {
+            name: 'fourFeeD',
+            type: 'sum',
+            decimals: 2
+          }, {
+            name: 'fiveFeeD',
+            type: 'sum',
+            decimals: 2
+          }],
+        column: [{
+          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,
+        }, {
+          label: '客户名称',
+          prop: 'corpName',
+          overHidden: true,
+          index: 2,
+          width: 140,
+          search: true,
+        },{
+          label: '路线',
+          index: 3,
+          width: 160,
+          search: true,
+          prop: 'addressDetail'
+        },{
+          label: '发票号',
+          prop: 'invoiceNo',
+        },{
+          label: '提单号',
+          width: 100,
+          index:4,
+          search: true,
+          overHidden: true,
+          prop: 'billNo'
+        }, {
+          label: '尺寸箱型',
+          width: 100,
+          search: true,
+          index: 5,
+          overHidden: true,
+          prop: 'ctnType',
+          type: 'select',
+          dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxType",
+          props: {
+            label: "dictValue",
+            value: "dictValue"
+          },
+        }, {
+          label: '车队',
+          width: 200,
+          search: true,
+          index:7,
+          overHidden: true,
+          prop: 'fleetId'
+        }, {
+          label: '应付陆运费',
+          overHidden: true,
+          index: 8,
+          prop: 'landAmountC'
+        },{
+          label: '场站费',
+          width: 100,
+          precision: 2,
+          cell: true,
+          index: 9,
+          controls: false,
+          type: 'number',
+          prop: 'oneFeeC'
+        }, {
+          label: '港杂费',
+          width: 100,
+          precision: 2,
+          cell: true,
+          index: 10,
+          controls: false,
+          type: 'number',
+          prop: 'twoFeeC'
+        }, {
+          label: '扣款',
+          width: 100,
+          precision: 2,
+          cell: true,
+          index: 11,
+          controls: false,
+          type: 'number',
+          prop: 'threeFeeC'
+        }, {
+          label: '待时费',
+          width: 100,
+          precision: 2,
+          index: 12,
+          cell: true,
+          controls: false,
+          type: 'number',
+          prop: 'fourFeeC'
+        }, {
+          label: '其他',
+          width: 100,
+          precision: 2,
+          index: 13,
+          cell: true,
+          type: 'number',
+          controls: false,
+          prop: 'fiveFeeC'
+        }, {
+          label: '费用备注',
+          width: 245,
+          index: 14,
+          cell: true,
+          prop: 'feeRemarksC'
+        },{
+          label: '应收场站费',
+          width: 100,
+          precision: 2,
+          index: 15,
+          controls: false,
+          type: 'number',
+          prop: 'oneFeeD'
+        }, {
+          label: '应收港杂费',
+          width: 100,
+          precision: 2,
+          index: 16,
+          controls: false,
+          type: 'number',
+          prop: 'twoFeeD'
+        }, {
+          label: '应收扣款',
+          width: 100,
+          precision: 2,
+          controls: false,
+          index: 17,
+          type: 'number',
+          prop: 'threeFeeD'
+        }, {
+          label: '应收待时费',
+          width: 100,
+          precision: 2,
+          index: 18,
+          controls: false,
+          type: 'number',
+          prop: 'fourFeeD'
+        }, {
+          label: '应收其他',
+          width: 100,
+          precision: 2,
+          index: 19,
+          type: 'number',
+          controls: false,
+          prop: 'fiveFeeD'
+        }, {
+          label: '应收费用备注',
+          width: 245,
+          index: 20,
+          prop: 'feeRemarksD'
+        }, {
+          label: '应付场站费',
+          width: 100,
+          precision: 2,
+          controls: false,
+          index: 21,
+          type: 'number',
+          prop: 'oneFeeC'
+        }, {
+          label: '应付港杂费',
+          width: 100,
+          precision: 2,
+          index: 22,
+          controls: false,
+          type: 'number',
+          prop: 'twoFeeC'
+        }, {
+          label: '应付扣款',
+          width: 100,
+          index: 23,
+          precision: 2,
+          controls: false,
+          type: 'number',
+          prop: 'threeFeeC'
+        }, {
+          label: '应付待时费',
+          width: 100,
+          precision: 2,
+          index: 24,
+          controls: false,
+          type: 'number',
+          prop: 'fourFeeC'
+        }, {
+          label: '应付其他',
+          width: 100,
+          precision: 2,
+          type: 'number',
+          index: 25,
+          controls: false,
+          prop: 'fiveFeeC'
+        }, {
+          label: '应付费用备注',
+          width: 245,
+          index: 26,
+          prop: 'feeRemarksC'
+        }, {
+          label: '车号',
+          width: 150,
+          prop: 'vehicleId',
+          overHidden: true,
+          index: 27,
+          type: 'select',
+          search: true,
+          dicUrl: "/api/blade-client/land-vehicle/vehicle-list?fleetId={{key}}",
+          props: {
+            label: "plateNo",
+            value: "id"
+          }
+        }, {
+          label: '司机',
+          width: 115,
+          index: 28,
+          search: true,
+          overHidden: true,
+          prop: 'driverId',
+          type: 'select',
+          dicUrl: "/api/blade-client/land-driver/driver-list?vehicleId={{key}}",
+          props: {
+            label: "name",
+            value: "id"
+          },
+        }, {
+          label: '电话',
+          width: 160,
+          index: 29,
+          overHidden: true,
+          search: true,
+          prop: 'tel'
+        }
+
+        // ,{
+        //   label: '状态',
+        //   width: 100,
+        //   type: 'select',
+        //   index:1,
+        //   overHidden: true,
+        //   dicUrl: "/api/blade-system/dict-biz/dictionary?code=land_order_status",
+        //   props: {
+        //     label: "dictValue",
+        //     value: "dictKey"
+        //   },
+        //   dataType: "string",
+        //   prop: 'status'
+        // },{
+        //   label: '货物名称',
+        //   overHidden: true,
+        //   width: 160,
+        //   search: true,
+        //   index: 9,
+        //   prop: 'goods'
+        // }, {
+        //   label: '箱号',
+        //   cell: true,
+        //   width: 245,
+        //   index: 10,
+        //   overHidden: true,
+        //   search: true,
+        //   prop: 'ctnNo'
+        // }, {
+        //   label: '场站',
+        //   prop: 'station',
+        //   overHidden: true,
+        //   index: 11,
+        //   width: 140,
+        //   search: true,
+        // },{
+        //   label: '制单日期',
+        //   overHidden: true,
+        //   prop: 'createTime',
+        //   type: "date",
+        //   searchRange: true,
+        //   defaultTime: ['00:00:00', '23:59:59'],
+        //   format: "yyyy-MM-dd HH:mm:ss",
+        //   valueFormat: "yyyy-MM-dd HH:mm:ss",
+        //   index: 12,
+        //   width: 140,
+        //   search: true,
+        // },{
+        //   label: '船名航次',
+        //   prop: 'factory',
+        //   overHidden: true,
+        //   index: 13,
+        //   width: 140,
+        //   search: true,
+        // }, {
+        //   label: '箱量',
+        //   width: 50,
+        //   index: 15,
+        //   prop: 'ctnQuantity'
+        // }, {
+        //   label: '重量(吨)',
+        //   width: 160,
+        //   prop: 'landWeight',
+        //   controls: false,
+        //   overHidden: true,
+        //   index: 16,
+        //   precision: 2,
+        //   type: 'number'
+        // }, {
+        //   label: '委托备注',
+        //   overHidden: true,
+        //   width: 245,
+        //   index: 18,
+        //   prop: 'remarks'
+        // }, {
+        //   label: '车队备注',
+        //   overHidden: true,
+        //   width: 245,
+        //   index: 19,
+        //   prop: 'fleetRemarks'
+        // }, {
+        //   label: '司机备注',
+        //   overHidden: true,
+        //   cell: true,
+        //   width: 245,
+        //   index: 20,
+        //   prop: 'driverRemarks'
+        // }
+        ],
+      },
+      totalData:{}
+    }
+  },
+  async created() {
+    this.goodsOptionCrud = await this.getColumnData(this.getColumnName(88.1), this.optionList);
+    this.key++
+    let i = 0;
+    this.goodsOptionCrud.column.forEach(item => {
+      if (item.search) i++
+    })
+    if (i % 3 !== 0) {
+      const num = 3 - Number(i % 3)
+      this.goodsOptionCrud.searchMenuSpan = num * 8;
+      this.goodsOptionCrud.searchMenuPosition = "right";
+    }
+  },
+  methods: {
+    //自定义列保存
+    async saveColumn() {
+      /**
+       * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
+       * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
+       * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
+       */
+      const inSave = await this.saveColumnData(this.getColumnName(88.1), this.goodsOptionCrud);
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    //自定义列重置
+    async resetColumn() {
+      this.goodsOptionCrud = this.optionList;
+      const inSave = await this.delColumnData(this.getColumnName(88.1), this.optionList);
+      if (inSave) {
+        this.$message.success("重置成功");
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    // 获得高度
+    searchCriteriaSwitch(type) {
+      if (type) {
+        this.goodsOptionCrud.height = this.goodsOptionCrud.height - 184
+      } else {
+        this.goodsOptionCrud.height = this.goodsOptionCrud.height + 184
+      }
+      this.$refs.crud.getTableHeight()
+    },
+    //箱信息保存
+    rowSave(row, index, done, loading) {
+      done()
+    },
+    //箱信息选择车队
+    getfleetIdT(data, row) {
+      this.$set(row, 'fleetName', data.cname)
+    },
+    //搜索
+    searchChange(params, done) {
+      this.onLoad(this.page, params)
+      done();
+    },
+    //切换订单状态
+    handleClick(tab) {
+      this.activeName = tab
+      this.onLoad(this.page)
+    },
+    //查询
+    onLoad(page, params) {
+      motorcadeDriver(4).then(res=>{
+        this.totalData = res.data.data
+      })
+      let queryParams = {
+        size: page.pageSize,
+        current: page.currentPage,
+        tag: '0',
+        ...params
+      }
+      this.loading = true;
+      driverQueryCollection(queryParams).then(res => {
+        this.goodsList = res.data.data.records
+        this.page.total = res.data.data.total
+        this.goodsOptionCrud.height = window.innerHeight - 245;
+      }).finally(() => {
+        this.loading = false;
+      })
+    },
+    //箱信息保存
+    rowSaveT(row, index, done, loading) {
+      if (row.$cellEdit){
+        fleetDriverSave(row).then(res=>{
+          this.$message.success("保存成功");
+        })
+      }
+      this.$refs.crud.rowCell(row, index)
+    },
+    //箱信息派车
+    designate(row) {
+      this.$confirm('是否确定受理', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        acceptanceCollection(row).then(res => {
+          this.$message.success('操作成功');
+          this.onLoad(this.page)
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消'
+        });
+      });
+    },
+    //取消派车
+    cancelDesignate(row) {
+      this.$confirm('是否确定取消受理', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        acceptanceDispatchCollection({id: row.id}).then(res => {
+          this.$message.success('操作成功');
+          this.onLoad(this.page)
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消'
+        });
+      });
+    },
+    confirmCompletion(row) {
+      this.$confirm('是否确定完工', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        confirmCompletion({id: row.id}).then(res => {
+          this.$message.success('操作成功');
+          this.onLoad(this.page)
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消'
+        });
+      });
+    },
+    //打开附件
+    annexOpen(row, index){
+      this.dialogVisible = true
+      this.form = row
+      getAttachment({id:row.id}).then(res=>{
+        console.log(res)
+        this.orderList = res.data.data
+      })
+    },
+    //保存
+    saveAnnex(){
+      saveAttached({
+        id:this.form.id,
+        fileList:this.orderList
+      }).then(res=>{
+        this.annexOpen(this.form)
+      })
+    },
+    ToBreak (val) {
+      if (val)return val.replace('\n', '<br/>')
+    }
+  }
+}
+</script>
+
+<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: 6vh;
+  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>