Browse Source

提交达沃特

caojunjie 2 years ago
parent
commit
f5eaff833d

+ 47 - 0
src/api/annualBudget.js

@@ -0,0 +1,47 @@
+import request from "@/router/axios";
+//删除
+export const remove = (ids) => {
+    return request({
+        url: '/api/blade-box-tube/annual/remove',
+        method: 'post',
+        params: {
+            ids,
+        }
+    })
+}
+//查询列表
+export const getList = (params) => {
+    return request({
+        url: '/api/blade-box-tube/annual/list',
+        method: 'get',
+        params: params
+    })
+}
+//查询明细
+
+export const detail = (params) => {
+    return request({
+        url: '/api/blade-box-tube/annual/detail',
+        method: 'get',
+        params: params
+    })
+}
+//新增修改
+export function submit(data){
+    return request({
+        url:'/api/blade-box-tube/annual/submit',
+        method:'post',
+        data
+    })
+}
+
+//删除明细
+export const tradingBoxItem = (ids) => {
+    return request({
+        url: '/api/blade-box-tube/annualItem/remove',
+        method: 'post',
+        params: {
+            ids,
+        }
+    })
+}

+ 13 - 0
src/api/budgetAnalysis.js

@@ -0,0 +1,13 @@
+import request from '@/router/axios';
+
+export const getList = (current, size, params) => {
+    return request({
+        url: '/api/blade-box-tube/annualItem/annualBudgetProfit',
+        method: 'get',
+        params: {
+            ...params,
+            current,
+            size
+        }
+    })
+}

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

@@ -1075,6 +1075,15 @@ const columnName = [{
 }, {
   code: 256.1,
   name: '船管理-明细'
+}, {
+  code: 257,
+  name: '年度预算-列表'
+}, {
+  code: 257.1,
+  name: '年度预算-明细'
+}, {
+  code: 258,
+  name: '预算分析'
 }]
 export const getColumnName = (key) => {
   for (let index = 0; index < columnName.length; index++) {

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

@@ -2380,5 +2380,31 @@ export default [{
     },
     component: () => import( /* webpackChunkName: "views" */ '@/views/maintenance/rebate/index')
   }]
+}, {
+  path: '/statisticAnalysis/budgetAnalysis/index',
+  component: Layout,
+  hidden: true,
+  children: [{
+    path: '/statisticAnalysis/budgetAnalysis/index',
+    name: '预算分析',
+    meta: {
+      i18n: '/statisticAnalysis/budgetAnalysis/index',
+      keepAlive: true,
+    },
+    component: () => import( /* webpackChunkName: "views" */ '@/views/statisticAnalysis/budgetAnalysis/index')
+  }]
+}, {
+  path: '/annualBudget/index',
+  component: Layout,
+  hidden: true,
+  children: [{
+    path: '/annualBudget/index',
+    name: '年度预算',
+    meta: {
+      i18n: '/annualBudget/index',
+      keepAlive: true,
+    },
+    component: () => import( /* webpackChunkName: "views" */ '@/views/annualBudget/index')
+  }]
 }
 ]

+ 389 - 0
src/views/annualBudget/detailsPage.vue

@@ -0,0 +1,389 @@
+<template>
+  <div>
+    <div class="customer-head">
+      <div class="customer-back">
+        <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
+                   @click="backToList(0)">返回列表
+        </el-button>
+        <el-button v-if="detailData.id" type="danger" style="border: none;background: none;color: red"
+                   icon="el-icon-arrow-left"
+                   @click="backToList(1)">返回审核列表
+        </el-button>
+      </div>
+      <div class="add-customer-btn">
+        <el-button class="el-button--small-yh" type="primary" size="small" :disabled="form.status>0"
+                   @click="editCustomer">保存数据
+        </el-button>
+      </div>
+    </div>
+    <trade-card title="基础资料" style="margin-top: 50px">
+      <avue-form :option="optionForm" v-model="form" ref="form">
+      </avue-form>
+    </trade-card>
+    <trade-card title="明细信息">
+      <avue-crud
+          :option="option"
+          :data="dataList"
+          v-model="formTwo"
+          ref="crud"
+          :key="key"
+          :before-open="beforeOpen"
+          @row-save="rowSave"
+          @row-update="rowUpdate"
+          @resetColumn="resetColumnTwo('crud','option','optionBack',257.1)"
+          @saveColumn="saveColumnTwo('crud','option','optionBack',257.1)">
+        <template slot="corpNameForm" slot-scope="scope">
+          <crop-select v-model="formTwo.corpId" corpType="KH"
+                       @getCorpData="(row)=>{getGSData(row,['formTwo','corpName'])}"/>
+        </template>
+        <template slot="monthForm" slot-scope="scope">
+          <el-input-number v-model="formTwo.month" :min="1" :max="12" placeholder="请输入 月" :controls="false"
+                           style="width: 100%;"></el-input-number>
+        </template>
+        <template slot-scope="{type,size,row,index,disabled}" slot="menu">
+          <el-button icon="el-icon-edit" :size="size" :disabled="disabled" :type="type"
+                     @click="$refs.crud.rowEdit(row,index)">编辑
+          </el-button>
+          <el-button icon="el-icon-delete" :size="size" :disabled="disabled" :type="type"
+                     @click="rowDel(row,index,'MX')">删除
+          </el-button>
+        </template>
+        <template slot="menuLeft" slot-scope="scope">
+          <el-button class="el-icon-download" type="info" size="small" :disabled="!form.id" @click="openReport">
+            报表打印
+          </el-button>
+        </template>
+      </avue-crud>
+    </trade-card>
+    <!--    报表-->
+    <report-dialog
+        :switchDialog="switchDialog"
+        :reportId="form.id"
+        reportName="预算分析"
+        @onClose="onClose()"
+    />
+  </div>
+</template>
+
+<script>
+import {
+  detail,
+  submit,
+  tradingBoxItem,
+} from "@/api/annualBudget.js";
+import reportDialog from "@/components/report-dialog/main.vue";
+
+export default {
+  name: "detailsPage",
+  props: {
+    onLoad: Object,
+    detailData: Object
+  },
+  components: {
+    reportDialog
+  },
+  data() {
+    return {
+      key: 0,
+      switchDialog: false,
+      form: {},
+      formTwo: {},
+      optionForm: {
+        menuBtn: false,
+        span: 6,
+        column: [{
+          label: '标题',
+          prop: 'title',
+          rules: [{
+            required: true,
+            message: " ",
+            trigger: "blur"
+          }]
+        }, {
+          label: "年份",
+          prop: "particularYear",
+          type: "year",
+          dataType: 'string',
+          valueFormat: "yyyy",
+          width: 100,
+          rules: [{
+            required: true,
+            message: " ",
+            trigger: "blur"
+          }]
+        }]
+      },
+      option: {},
+      optionBack: {
+        align: 'center',
+        index: true,
+        selection: false,
+        addBtnText: "录入明细",
+        refreshBtn: false,
+        addBtn: true,
+        span: 8,
+        addRowBtn: false,
+        cellBtn: false,
+        editBtn: false,
+        height: 600,
+        delBtn: false,
+        menuWidth: 200,
+        dialogTop: 25,
+        dialogWidth: "80%",
+        summaryText: "合计",
+        showSummary: true,
+        sumColumnList: [{
+          name: "keter",
+          type: "sum",
+          decimals: 2
+        }, {
+          name: "drivemaster",
+          type: "sum",
+          decimals: 2
+        }, {
+          name: "luxxan",
+          type: "sum",
+          decimals: 2
+        }, {
+          name: "xcentway",
+          type: "sum",
+          decimals: 2
+        }],
+        column: [{
+          label: "年份",
+          prop: "year",
+          type: "year",
+          overHidden: true,
+          valueFormat: "yyyy",
+          width: 100,
+          rules: [{
+            required: true,
+            message: " ",
+            trigger: "blur"
+          }]
+        }, {
+          label: "月",
+          prop: "month",
+          width: 100,
+          controls: false,
+          type: 'number',
+          rules: [{
+            required: true,
+            message: " ",
+            trigger: "blur"
+          }]
+        }, {
+          label: "客户名称",
+          prop: "corpName",
+          overHidden: true,
+          width: 100,
+          rules: [{
+            required: true,
+            message: " ",
+            trigger: "blur"
+          }]
+        }, {
+          label: "欧记",
+          prop: "keter",
+          overHidden: true,
+          type: 'number',
+          value: 0,
+          precision: 2,
+          controls: false,
+          width: 100,
+        }, {
+          label: "登马",
+          prop: "drivemaster",
+          overHidden: true,
+          type: 'number',
+          value: 0,
+          precision: 2,
+          controls: false,
+          width: 100,
+        }, {
+          label: "路迈",
+          prop: "luxxan",
+          overHidden: true,
+          type: 'number',
+          value: 0,
+          precision: 2,
+          controls: false,
+          width: 100,
+        }, {
+          label: "艾特路",
+          prop: "xcentway",
+          type: 'number',
+          value: 0,
+          precision: 2,
+          controls: false,
+          overHidden: true,
+          width: 100,
+        }, {
+          label: "汇总",
+          prop: "quantitySummary",
+          type: 'number',
+          value: 0,
+          precision: 2,
+          display: false,
+          controls: false,
+          overHidden: true,
+          width: 100,
+        }]
+      },
+      dataList: [],
+      disabled: false,
+    }
+  },
+  async created() {
+    this.option = await this.getColumnData(this.getColumnName(257.1), this.optionBack);
+    if (this.onLoad.id) {
+      this.refresh(this.onLoad.id, true)
+    }
+    this.findObject(this.option.column, "keter").change =
+        this.findObject(this.option.column, "drivemaster").change =
+            this.findObject(this.option.column, "luxxan").change =
+                this.findObject(this.option.column, "xcentway").change = (data) => {
+                  this.formTwo[data.column.prop] = data.value
+                  this.formTwo.quantitySummary = this.formTwo.keter + this.formTwo.drivemaster + this.formTwo.luxxan + this.formTwo.xcentway
+                }
+    this.key++
+  },
+  methods: {
+    getGSData(row, type) {
+      this[type[0]][type[1]] = row.cname
+    },
+    // 报表
+    openReport() {
+      this.switchDialog = !this.switchDialog;
+    },
+    // 报表关闭
+    onClose(val) {
+      this.switchDialog = val;
+    },
+    // 明细删除
+    rowDel(row, index, type) {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+            if (row.id) {
+              tradingBoxItem(row.id).then(res => {
+                if (res.data.success) {
+                  this.$message.success("操作成功!");
+                  this.dataList.splice(index, 1);
+                }
+              });
+            } else {
+              this.dataList.splice(index, 1);
+              this.$message.success("操作成功!");
+            }
+          }
+      );
+    },
+    refresh(id, type) {
+      const loading = this.$loading({
+        lock: true,
+        text: '加载中',
+        spinner: 'el-icon-loading',
+        background: 'rgba(255,255,255,0.7)'
+      });
+      detail({id: id}).then(res => {
+        this.form = res.data.data
+        this.dataList = res.data.data.itemList
+        loading.close();
+        this.key++
+      })
+    },
+    //新增修改
+    editCustomer() {
+      this.$refs["form"].validate((valid, done) => {
+        done()
+        if (valid) {
+          let data = {
+            ...this.form,
+            itemList: this.dataList,
+          }
+          const loading = this.$loading({
+            lock: true,
+            text: '加载中',
+            spinner: 'el-icon-loading',
+            background: 'rgba(255,255,255,0.7)'
+          });
+          submit(data).then(res => {
+            if (this.form.id) {
+              this.$message.success("修改成功")
+            } else {
+              this.$message.success("新增成功")
+            }
+            loading.close();
+            this.refresh(res.data.data.id)
+          }).catch(() => {
+            loading.close();
+          })
+        }
+      });
+    },
+    rowSave(form, done, loading) {
+      done(form)
+    },
+    rowUpdate(form, index, done, loading) {
+      done(form)
+    },
+    beforeOpen(done, type) {
+      if (!['view', 'edit'].includes(type)) {
+        this.formTwo.year = this.form.particularYear
+      }
+      done();
+    },
+    backToList(type) {
+      if (type == 0) {
+        if (this.detailData.id) {
+          this.$router.push({
+            path: '/boxManagement/exportShipment/index'
+          });
+        }
+        this.$emit("backToList", type);
+      } else if (type == 1) {
+        this.$router.push({
+          path: '/approveData/index'
+        });
+        this.$emit("backToList", type);
+      }
+    },
+    //自定义列保存
+    async saveColumnTwo(ref, option, optionBack, code) {
+      /**
+       * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
+       * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
+       * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
+       */
+      const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
+      }
+    },
+    //自定义列重置
+    async resetColumnTwo(ref, option, optionBack, code) {
+      this[option] = this[optionBack];
+      const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
+      if (inSave) {
+        this.$message.success("重置成功");
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
+        this.findObject(this.option.column, "keter").change = this.findObject(this.option.column, "drivemaster").change = this.findObject(this.option.column, "luxxan").change = this.findObject(this.option.column, "xcentway").change = (data) => {
+          this.formTwo[data.column.prop] = data.value
+          this.formTwo.quantitySummary = this.formTwo.keter + this.formTwo.drivemaster + this.formTwo.luxxan + this.formTwo.xcentway
+        }
+      }
+    }
+  }
+}
+</script>
+
+<style scoped>
+::v-deep .el-form-item {
+  margin-bottom: 8px;
+}
+</style>

+ 268 - 0
src/views/annualBudget/index.vue

@@ -0,0 +1,268 @@
+<template>
+  <div>
+    <basic-container v-show="!detailsOpen">
+      <avue-crud
+          :option="option"
+          :search.sync="search"
+          v-model="form"
+          :table-loading="loading"
+          :data="dataList"
+          ref="crud"
+          :key="key"
+          @on-load="onLoad"
+          @search-change="searchChange"
+          @row-del="rowDel"
+          @search-criteria-switch="searchCriteriaSwitch"
+          @refresh-change="refreshChange"
+          @resetColumn="resetColumnTwo('crud','option','optionList',257)"
+          @saveColumn="saveColumnTwo('crud','option','optionList',257)"
+          :page.sync="page">
+        <template slot-scope="{type,size,row,$index}" slot="menu">
+          <el-button icon="el-icon-view" :size="size" :type="type" @click="check(row)">查看</el-button>
+          <el-button icon="el-icon-delete" :size="size" v-if="row.status == 0" :type="type" @click="$refs.crud.rowDel(row,$index)">删除
+          </el-button>
+        </template>
+        <template slot-scope="{type,size,row,$index}" slot="menuLeft">
+          <el-button icon="el-icon-plus" type="primary" :size="size" @click="detailsOpen = true">创建单据</el-button>
+        </template>
+      </avue-crud>
+    </basic-container>
+    <detailsPage v-if="detailsOpen" :onLoad="form" :detailData="detailData" @backToList="backToList"></detailsPage>
+  </div>
+</template>
+
+<script>
+import {getList, remove} from "@/api/annualBudget.js";
+import detailsPage from "./detailsPage"
+
+export default {
+  name: "index",
+  components: {
+    detailsPage
+  },
+  data() {
+    return {
+      detailsOpen: false,
+      loading: false,
+      search: {},
+      form: {},
+      dataList: [],
+      detailData: {},
+      page: {
+        pageSize: 20,
+        currentPage: 1,
+        total: 0,
+        pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
+      },
+      key:0,
+      option: {},
+      optionList: {
+        viewBtn: false,
+        editBtn: false,
+        delBtn: false,
+        addBtn: false,
+        index: true,
+        span: 8,
+        border: true,
+        height:"auto",
+        searchMenuPosition: "right",
+        align: "center",
+        menuWidth:140,
+        searchSpan: 8,
+        searchIcon: true,
+        searchIndex: 2,
+        highlightCurrentRow: true,
+        dialogWidth: "70%",
+        showSummary: true,
+        sumColumnList: [{
+          name: 'boxNumber',
+          type: 'sum',
+          decimals:0
+        },{
+          name: 'totalAmount',
+          type: 'sum',
+          decimals:2
+        }],
+        column: [{
+          label: '标题',
+          prop: 'title',
+          width: 220,
+          search: true
+        },{
+          label: "年份",
+          prop: "particularYear",
+          type: "year",
+          search: true,
+          overHidden: true,
+          valueFormat: "yyyy",
+          width: 100,
+        },{
+          label: "制单人",
+          prop: "createUserName",
+          searchProp:"createUser",
+          overHidden: true,
+          width: 100,
+          search: true,
+          filterable: true,
+          remote: true,
+          type: "select",
+          dicUrl: "/api/blade-user/page?size=20&current=1&account={{key}}",
+          props: {
+            label: "account",
+            value: "id",
+            res: 'data.records'
+          }
+        }, {
+          label: "制单日期",
+          prop: "createTime",
+          searchProp:"createTimeList",
+          type: "date",
+          overHidden: true,
+          width: 200,
+          searchRange: true,
+          searchDefaultTime: ["00:00:00", "23:59:59"],
+          format: "yyyy-MM-dd",
+          valueFormat: "yyyy-MM-dd HH:mm:ss"
+        }, {
+          label: "更新人",
+          prop: "updateUserName",
+          searchProp:"updateUser",
+          overHidden: true,
+          width: 100,
+          search: true,
+          filterable: true,
+          remote: true,
+          type: "select",
+          dicUrl: "/api/blade-user/page?size=20&current=1&account={{key}}",
+          props: {
+            label: "account",
+            value: "id",
+            res: 'data.records'
+          }
+        }, {
+          label: "更新日期",
+          prop: "updateTime",
+          searchProp:"updateTimeList",
+          type: "date",
+          overHidden: true,
+          width: 200,
+          searchRange: true,
+          searchDefaultTime: ["00:00:00", "23:59:59"],
+          format: "yyyy-MM-dd",
+          valueFormat: "yyyy-MM-dd HH:mm:ss"
+        }]
+      }
+    }
+  },
+  activated() {
+    if (this.$route.query.check) {
+      this.detailsOpen = false
+      this.detailData = {
+        id: this.$route.query.check.billId,
+        check: this.$route.query.check,
+      };
+      this.form = {
+        id:this.$route.query.check.billId
+      }
+      this.detailsOpen = true
+      this.$router.$avueRouter.closeTag(window.location.hash.slice(1))
+    }
+  },
+  async created() {
+    this.option = await this.getColumnData(this.getColumnName(257), this.optionList);
+    this.key++
+    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: {
+    check(row){
+      this.form = row
+      this.detailsOpen = true
+    },
+    backToList(type) {
+      this.form = {}
+      this.detailsOpen = false
+      if (type === 0){
+        this.detailData = {}
+      }
+      this.onLoad(this.page,this.search)
+    },
+    searchCriteriaSwitch(type) {
+      this.$refs.crud.getTableHeight();
+    },
+    //刷新
+    refreshChange() {
+      this.onLoad(this.page, this.search)
+    },
+    rowDel(form, index) {
+      this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        remove(form.id).then(res => {
+          this.$message({
+            type: 'success',
+            message: '删除成功!'
+          });
+        })
+      }).catch(() => {
+      });
+    },
+    searchChange(params, done) {
+      done();
+      this.onLoad(this.page, params)
+    },
+    onLoad(page, params = {}) {
+      params = {
+        ...params,
+        current: page.currentPage,
+        size: page.pageSize,
+        ...Object.assign(params, this.search)
+      }
+      this.loading = true
+      getList(params).then(res => {
+        this.dataList = res.data.data.records
+        this.page.total = res.data.data.total
+        this.loading = false
+      }).finally(() => {
+        this.loading = false
+      })
+    },
+//自定义列保存
+    async saveColumnTwo(ref, option, optionBack, code) {
+      /**
+       * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
+       * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
+       * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
+       */
+      const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
+      }
+    },
+//自定义列重置
+    async resetColumnTwo(ref, option, optionBack, code) {
+      this[option] = this[optionBack];
+      const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
+      if (inSave) {
+        this.$message.success("重置成功");
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
+      }
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 21 - 1
src/views/client/js/optionList.js

@@ -163,6 +163,13 @@ export const option2 = {
       span: 24,
     },
     {
+      label: "别名",
+      prop: "alias",
+      width:200,
+      overHidden: true,
+      cell: true
+    },
+    {
       label: "地址",
       prop: "addr",
       dicData:[],
@@ -178,6 +185,19 @@ export const option2 = {
       span: 24,
     },
     {
+      label: "联系人",
+      prop: "attn",
+      width:200,
+      overHidden: true,
+      cell: true
+    },{
+      label: "电话",
+      prop: "tel",
+      width:200,
+      overHidden: true,
+      cell: true
+    },
+    {
       label: "详细地址",
       prop: "detailedAddress",
       cell: true,
@@ -529,4 +549,4 @@ export const capitalOption = {
       overHidden: true
     }
   ]
-}
+}

+ 323 - 0
src/views/statisticAnalysis/budgetAnalysis/index.vue

@@ -0,0 +1,323 @@
+<template>
+  <div>
+    <basic-container class="page-crad">
+      <avue-crud ref="crud" :option="option" :data="dataList" :page.sync="page" :search.sync="search"
+                 :cell-style="cellStyle" @search-change="searchChange" @current-change="currentChange" @size-change="sizeChange"
+                 @refresh-change="refreshChange" @on-load="onLoad" :table-loading="loading" @saveColumn="saveColumn"
+                 @resetColumn="resetColumn" @search-criteria-switch="searchCriteriaSwitch">
+        <template slot="menuLeft">
+          <el-button type="info" size="small" @click="outExport">导出
+          </el-button>
+        </template>
+        <template slot="corpNameSearch" slot-scope="scope">
+          <crop-select v-model="search.corpId" corpType="KH"/>
+        </template>
+        <template slot="monthSearch" slot-scope="scope">
+          <el-input-number v-model="search.month" :min="1" :max="12" placeholder="请输入 月" :controls="false"
+                           style="width: 100%;"></el-input-number>
+        </template>
+      </avue-crud>
+    </basic-container>
+  </div>
+</template>
+
+<script>
+import { getToken } from "@/util/auth";
+import { getList } from "@/api/budgetAnalysis"
+
+export default {
+  name: "index",
+  data() {
+    return {
+      UConfiguration: {
+        multipleChoices: false,
+        multiple: false,
+        disabled: false,
+        searchShow: true,
+        collapseTags: false,
+        placeholder: '请点击右边按钮选择',
+        dicData: []
+      },
+      form: {},
+      search: {},
+      dataList: [],
+      loading: false,
+      detailData: {},
+      page: {
+        pageSize: 20,
+        currentPage: 1,
+        total: 0,
+        pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
+      },
+      option: {},
+      optionBack: {
+        searchShow: true,
+        searchMenuPosition: "right",
+        searchSpan: 8,
+        searchMenuSpan: 24,
+        border: true,
+        index: true,
+        addBtn: false,
+        viewBtn: false,
+        editBtn: false,
+        delBtn: false,
+        searchIcon: true,
+        menu: false,
+        summaryText: "合计",
+        showSummary: true,
+        sumColumnList: [{
+          name: "keter",
+          type: "sum",
+          decimals: 2
+        },{
+          name: "keterOrdQuantity",
+          type: "sum",
+          decimals: 2
+        },{
+          name: "keterDeliverQuantity",
+          type: "sum",
+          decimals: 2
+        },{
+          name: "xcentway",
+          type: "sum",
+          decimals: 2
+        },{
+          name: "xcentwayOrdQuantity",
+          type: "sum",
+          decimals: 2
+        },{
+          name: "xcentwayDeliverQuantity",
+          type: "sum",
+          decimals: 2
+        },{
+          name: "luxxan",
+          type: "sum",
+          decimals: 2
+        },{
+          name: "luxxanOrdQuantity",
+          type: "sum",
+          decimals: 2
+        },{
+          name: "luxxanDeliverQuantity",
+          type: "sum",
+          decimals: 2
+        },{
+          name: "drivemaster",
+          type: "sum",
+          decimals: 2
+        },{
+          name: "drivemasterOrdQuantity",
+          type: "sum",
+          decimals: 2
+        },{
+          name: "drivemasterDeliverQuantity",
+          type: "sum",
+          decimals: 2
+        },{
+          name: "quantitySummary",
+          type: "sum",
+          decimals: 2
+        },{
+          name: "orderSummary",
+          type: "sum",
+          decimals: 2
+        },{
+          name: "deliverySummary",
+          type: "sum",
+          decimals: 2
+        }],
+        column: [
+          {
+            label: "年度",
+            prop: "year",
+            overHidden: true,
+            type: "year",
+            valueFormat: "yyyy",
+            search: true
+          },{
+            label: "月",
+            prop: "month",
+            overHidden: true,
+            search: true
+          },{
+            label: "客户名称",
+            prop: "corpName",
+            overHidden: true,
+            search: true
+          },{
+            label: "登马计划",
+            prop: "drivemaster",
+            overHidden: true
+          },{
+            label: "订单",
+            prop: "drivemasterOrdQuantity",
+            overHidden: true
+          },{
+            label: "发货",
+            prop: "drivemasterDeliverQuantity",
+            overHidden: true
+          },{
+            label: "欧记计划",
+            prop: "keter",
+            overHidden: true
+          },{
+            label: "订单",
+            prop: "keterOrdQuantity",
+            overHidden: true
+          },{
+            label: "发货",
+            prop: "keterDeliverQuantity",
+            overHidden: true
+          },{
+            label: "艾特路计划",
+            prop: "xcentway",
+            width:100,
+            overHidden: true
+          },{
+            label: "订单",
+            prop: "xcentwayOrdQuantity",
+            overHidden: true
+          },{
+            label: "发货",
+            prop: "xcentwayDeliverQuantity",
+            overHidden: true
+          },{
+            label: "路迈计划",
+            prop: "luxxan",
+            overHidden: true
+          },{
+            label: "订单",
+            prop: "luxxanOrdQuantity",
+            overHidden: true
+          },{
+            label: "发货",
+            prop: "luxxanDeliverQuantity",
+            overHidden: true
+          },{
+            label: "计划汇总",
+            prop: "quantitySummary",
+            width:160,
+            overHidden: true
+          },{
+            label: "订单汇总",
+            prop: "orderSummary",
+            width:160,
+            overHidden: true
+          },{
+            label: "发货汇总",
+            prop: "deliverySummary",
+            width:160,
+            overHidden: true
+          }
+        ]
+      }
+    };
+  },
+  async created() {
+    this.option = await this.getColumnData(this.getColumnName(258), this.optionBack);
+  },
+  methods: {
+    cellStyle() {
+      return "padding:0;height:40px;";
+    },
+    searchCriteriaSwitch(type) {
+      if (type) {
+        this.option.height = this.option.height - 46;
+      } else {
+        this.option.height = this.option.height + 46;
+      }
+      this.$refs.crud.getTableHeight();
+    },
+    //点击搜索按钮触发
+    searchChange(params, done) {
+      this.page.currentPage = 1;
+      this.onLoad(this.page, params);
+      done();
+    },
+    refreshChange() {
+      this.onLoad(this.page, this.search);
+    },
+    currentChange(val) {
+      this.page.currentPage = val;
+    },
+    sizeChange(val) {
+      this.page.currentPage = 1;
+      this.page.pageSize = val;
+    },
+    onLoad(page, params = {}) {
+      let data = this.deepClone(Object.assign({}, params, this.search));
+      this.loading = true;
+      getList(
+          page.currentPage,
+          page.pageSize,
+          Object.assign(data)
+      ).then(res => {
+        this.dataList = res.data.data.records ? res.data.data.records : [];
+        this.page.total = res.data.data.total;
+        if (this.page.total) {
+          this.option.height = window.innerHeight - 210;
+        }
+      }).finally(() => {
+        this.loading = false;
+      });
+    },
+    //列保存触发
+    async saveColumn() {
+      const inSave = await this.saveColumnData(this.getColumnName(258), this.option);
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    async resetColumn() {
+      this.option = this.optionBack;
+      const inSave = await this.delColumnData(this.getColumnName(258), this.optionBack);
+      if (inSave) {
+        this.$message.success("重置成功");
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    editOpen(row) {
+    },
+    outExport() {
+      let config = {params: {...this.search}}
+      if (config.params) {
+        for (const propName of Object.keys(config.params)) {
+          const value = config.params[propName];
+          if (value !== null && typeof (value) !== "undefined") {
+            if (value instanceof Array) {
+              for (const key of Object.keys(value)) {
+                let params = propName + '[' + key + ']';
+                config.params[params] = value[key]
+              }
+              delete config.params[propName]
+            }
+          }
+        }
+      }
+      const routeData = this.$router.resolve({
+        path: '/api/blade-box-tube/annualItem/annualBudgetProfitExcel',      //跳转目标窗口的地址
+        query: {
+          ...config.params    //括号内是要传递给新窗口的参数
+        }
+      })
+      window.open(routeData.href.slice(1, routeData.href.length) + '&' + `${this.website.tokenHeader}=${getToken()}`);
+    }
+  }
+};
+</script>
+
+<style scoped>
+.page-crad ::v-deep .basic-container__card {
+  height: 94.2vh;
+}
+
+::v-deep .el-table__expanded-cell[class*="cell"] {
+  padding: 0px;
+}
+
+.itemTable ::v-deep .el-table {
+  width: 100%;
+}
+</style>

+ 38 - 11
src/views/statisticAnalysis/dataDetail/index.vue

@@ -37,13 +37,15 @@ export default {
         pageSize: 20,
         currentPage: 1,
         total: 0,
-        pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
+        pageSizes: [20, 30, 40, 50, 100, 200, 300, 400, 500]
       },
       option: {},
       defaultOption: {
         searchShow: true,
         align: "center",
         searchSpan: 8,
+        height: "auto",
+        indexWidth:60,
         border: true,
         index: true,
         addBtn: false,
@@ -59,6 +61,11 @@ export default {
             decimals: 0
           },
           {
+            name: "actualQuantity",
+            type: "sum",
+            decimals: 0
+          },
+          {
             name: "amount",
             type: "sum",
           },
@@ -74,6 +81,7 @@ export default {
           {
             label: "销售订单号",
             prop: "orderNo",
+            width:100,
             search: true,
             overHidden: true,
           },
@@ -107,6 +115,19 @@ export default {
             overHidden: true,
           },
           {
+            label: "发货日期",
+            prop: "receiptTime",
+            searchProp:"receiptTimeList",
+            search: true,
+            type: 'date',
+            format: "yyyy-MM-dd",
+            valueFormat: "yyyy-MM-dd HH:mm:ss",
+            searchDefaultTime: ["00:00:00", "23:59:59"],
+            unlinkPanels: true,
+            searchRange: true,
+            overHidden: true,
+          },
+          {
             label: "产品名称",
             prop: "goodsName",
             search: false,
@@ -137,7 +158,13 @@ export default {
             overHidden: true,
           },
           {
+            label: "发货数量",
+            prop: "actualQuantity",
+            overHidden: true,
+          },
+          {
             label: "金额",
+            width:95,
             prop: "amount",
             search: false,
             overHidden: true,
@@ -197,11 +224,12 @@ export default {
       return "padding:0;height:40px;";
     },
     searchCriteriaSwitch(type) {
-      if (type) {
-        this.option.height = this.option.height - 46;
-      } else {
-        this.option.height = this.option.height + 46;
-      }
+      // if (type) {
+      //   this.option.height = this.option.height - 46;
+      // } else {
+      //   this.option.height = this.option.height + 46;
+      // }
+      this.$refs.crud.doLayout();
       this.$refs.crud.getTableHeight();
     },
     //点击搜索按钮触发
@@ -240,8 +268,7 @@ export default {
         page.currentPage,
         page.pageSize,
         queryParams
-      )
-        .then(res => {
+      ).then(res => {
           if (res.data.data.records) {
             res.data.data.records.forEach(e => {
               e.itemLoading = true;
@@ -249,9 +276,9 @@ export default {
           }
           this.dataList = res.data.data.records ? res.data.data.records : [];
           this.page.total = res.data.data.total;
-          if (this.page.total) {
-            this.option.height = window.innerHeight - 210;
-          }
+          // if (this.page.total) {
+          //   this.option.height = window.innerHeight - 210;
+          // }
         })
         .finally(() => {
           this.loading = false;