123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310 |
- <template>
- <div>
- <!-- 标题 -->
- <div class="title" style="margin-top: 10px">
- <div style="display: flex; justify-content: space-between">
- <h1 style="color: azure">漯河亿通集团数据看板</h1>
- <div class="time">
- <span class="iconfont icon-riqi"></span> {{ currentTime }}
- </div>
- </div>
- <img src="../../assets/bargound/图层 6.png" width="100%" />
- </div>
- <div class="content">
- <!-- 库存车辆 -->
- <el-tabs type="border-card" class="theme">
- <div style="display: flex; justify-content: space-between">
- <!-- 图标 -->
- <div>
- <p>
- <img src="../../assets/bargound/data.png" alt="" /><span
- class="kccl"
- >产值统计</span
- >
- </p>
- </div>
- <div style="display: flex">
- <!-- 下拉框 -->
- <div style="margin-right: 20px">
- <el-select class="select" v-model="company_ids" multiple placeholder="请选择" style="width: 200px">
- <el-option v-for="item in options" :key="item.value" :label="item.text" :value="item.value">
- </el-option>
- </el-select>
- </div>
- <!-- 日期表 -->
- <div class="dataForm" style="margin-right: 20px">
- <el-date-picker
- v-model="value1"
- type="daterange"
- range-separator="——"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- >
- </el-date-picker>
- </div>
- <!-- 按钮 -->
- <el-button
- @click="searchBtn"
- style="background-color: rgb(40, 155, 209); color: black"
- >搜索</el-button
- >
- </div>
- </div>
- <!-- 表格 -->
- <el-table
- class="exporttable"
- :data="tableData"
- border
- stripe
- :header-cell-style="{
- 'text-align': 'center',
- background: '#03111c',
- }"
- :cell-style="{ 'text-align': 'center' }"
- show-summary
- style="width: 100%; margin: 1px"
- >
- <el-table-column prop="company" label="品牌"> </el-table-column>
- <el-table-column label="收入类">
- <el-table-column prop="pjls" sortable label="零件配售"> </el-table-column>
- </el-table-column>
- <el-table-column label="首保收入">
- <el-table-column prop="sbgs" label="首保工时"> </el-table-column>
- <el-table-column prop="sbll" label="首保领料"> </el-table-column>
- </el-table-column>
- <el-table-column label="索赔收入">
- <el-table-column prop="spll" label="索赔领料"> </el-table-column>
- <el-table-column prop="spgs" label="索赔工时"> </el-table-column>
- </el-table-column>
- <el-table-column label="定保收入">
- <el-table-column prop="dbgs" label="定保工时"> </el-table-column>
- <el-table-column prop="dbll" label="定保领料"> </el-table-column>
- </el-table-column>
- <el-table-column label="一般维修收入">
- <el-table-column prop="ybwxll" label="外修领料"> </el-table-column>
- <el-table-column prop="ybwxgs" label="外修工时"> </el-table-column>
- </el-table-column>
- <el-table-column label="钣喷收入">
- <el-table-column prop="bpll" label="钣喷材料"> </el-table-column>
- <el-table-column prop="bpgs" label="钣喷工时"> </el-table-column>
- </el-table-column>
- <el-table-column prop="jpsr" label="精品"> </el-table-column>
- <el-table-column prop="qtsr" label="其他收入"> </el-table-column>
- <el-table-column prop="srhj" label="收入合计"> </el-table-column>
- </el-table>
- </el-tabs>
- </div>
- </div>
- </template>
- <script>
- import axios from "axios";
- export default {
- data() {
- return {
- company_ids:[],
- currentTime: "",
- value: "",
- //表格各类属性
- tableData: [],
- //下拉框内属性
- options: [],
- //日期表属性
- pickerOptions: {
- shortcuts: [
- {
- text: "最近一个月",
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
- picker.$emit("pick", [start, end]);
- },
- },
- ],
- },
- value1: ["2023-08-01", "2023-08-03"],
- };
- },
- mounted() {
- this.updateTime(); //时间
- this.getTableDate(); //开始获取表格
- this.getSelectDate(); //下拉框接口数据
- },
- beforeDestroy() {
- // 在组件销毁前清除定时器,避免内存泄漏
- clearInterval(this.timer);
- },
- methods: {
- //表格接口数据
- getTableDate() {
- axios
- .get("http://192.168.2.55:8022/plugins/lhyt/shsr_detail", {
- params: {
- company_ids: this.company_ids.join(),
- date_begin: this.value1[0],
- date_end: this.value1[1],
- },
- })
- .then((res) => {
- console.log("--------", res.data.rows);
- this.tableData = res.data.rows;
- });
- },
- //下拉框数据
- getSelectDate() {
- axios
- .get("http://192.168.2.55:8022/plugins/lhyt/get_companies")
- .then((ret) => {
- console.log(ret);
- this.options = ret.data.data;
- });
- },
- //更新时间
- updateTime() {
- // 在组件挂载结束时启动定时器,每秒更新一次时间
- this.currentTime = this.getCurrentTime();
- //每秒更新一次
- this.timer = setInterval(() => {
- this.currentTime = this.getCurrentTime();
- }, 1000);
- },
- getCurrentTime() {
- const now = new Date();
- const year = now.getFullYear();
- const month = String(now.getMonth() + 1).padStart(2, "0");
- const day = String(now.getDate()).padStart(2, "0");
- const hours = String(now.getHours()).padStart(2, "0");
- const minutes = String(now.getMinutes()).padStart(2, "0");
- const seconds = String(now.getSeconds()).padStart(2, "0");
- return `${year}.${month}.${day} ${hours}:${minutes}:${seconds}`;
- },
- resetDateFilter() {
- this.$refs.filterTable.clearFilter("date");
- },
- clearFilter() {
- this.$refs.filterTable.clearFilter();
- },
- formatter(row, column) {
- return row.address;
- },
- filterTag(value, row) {
- return row.tag === value;
- },
- filterHandler(value, row, column) {
- const property = column["property"];
- return row[property] === value;
- },
-
- searchBtn() {
- this.getTableDate()
- },
- },
- };
- </script>
- <style scoped="less">
- .content {
- padding: 10px;
- }
- .title {
- width: 100%;
- /* background: url('../../assets/bargound/'); */
- height: 64px;
- p {
- height: 100px;
- }
- }
- .kccl {
- color: #697c91;
- font-size: 24px;
- margin-left: 10px;
- }
- .el-input__inner {
- background-color: #133654;
- }
- .el-input__inner {
- border: 0;
- }
- ::v-deep .el-date-editor .el-range-input {
- display: inline-block;
- height: 100%;
- width: 39%;
- text-align: center;
- font-size: 14px;
- color: #ffffffba;
- background-color: #133654;
- }
- ::v-deep .el-table {
- border: none;
- }
- ::v-deep .el-table::before {
- background-color: black;
- }
- ::v-deep .el-table__footer-wrapper tbody td.el-table__cell,
- .el-table__header-wrapper tbody td.el-table__cell {
- background-color: rgb(2, 62, 2);
- color: #93acbf;
- }
- ::v-deep .el-table--border::after,
- .el-table--group::after,
- .el-table::before {
- content: "";
- position: absolute;
- background-color: black;
- z-index: 1;
- }
- ::v-deep .el-table td,
- .building-top .el-table th.is-leaf {
- color: #93acbf;
- }
- ::v-deep .el-table--enable-row-hover .el-table__body tr:hover > td {
- background-color: #133654;
- }
- ::v-deep .el-table tr {
- background: #133654;
- }
- ::v-deep .el-table--striped .el-table__body tr.el-table__row--striped td {
- background: #081b2b;
- }
- /**
- 改变边框颜色
- */
- .el-table {
- border-bottom: 1px solid #102b47;
- border-right: 1px solid #102b47;
- margin: 0 auto;
- }
- ::v-deep.el-table th {
- border: 1px solid #102b47 !important;
- border-right: none !important;
- border-bottom: none !important;
- }
- ::v-deep
- .el-tabs.theme.el-tabs--top.theme.el-tabs--border-card
- .el-tabs__nav-scroll {
- border-bottom: 1px solid;
- }
- ::v-deep.el-table td {
- border: 1px solid #102b47;
- border-right: none !important;
- }
- .time {
- color: rgb(174, 201, 222);
- margin-right: 2%;
- font-size: 16px;
- overflow: hidden;
- max-width: 15%;
- white-space: nowrap;
- }
- </style>
|