Blame view

src/views/tjfx/bdcdjtjfx/components/zszl.vue 6.68 KB
“miaofang committed
1 2 3 4 5 6 7 8 9
<!--
 * @Description:
 * @Autor: renchao
 * @LastEditTime: 2023-08-25 08:59:04
-->
<template>
  <div class="djlx">
    <div class="inquire">
      <el-form :model="queryForm" ref="queryForm" label-width="100px">
“miaofang committed
10 11 12
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="缮证日期" class="width100">
“miaofang committed
13
              <el-date-picker
“miaofang committed
14 15
                v-model="queryForm.sj"
                type="daterange"
“miaofang committed
16
                class="width100"
“miaofang committed
17 18 19 20 21 22 23
                range-separator="至"
                :clearable="false"
                value-format="yyyy-MM-dd"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
              >
              </el-date-picker>
“miaofang committed
24 25
            </el-form-item>
          </el-col>
“miaofang committed
26
          <el-col :span="7">
“miaofang committed
27 28 29 30 31
            <el-form-item label="区域" class="width100">
              <el-select
                v-model="queryForm.qy"
                class="width100"
                clearable
“miaofang committed
32
                placeholder="请选择区域"
“miaofang committed
33 34
              >
                <el-option
“miaofang committed
35
                  v-for="item in dictData['A20']"
“miaofang committed
36 37 38 39 40 41 42 43
                  :key="item.dcode"
                  :label="item.dname"
                  :value="item.dcode"
                >
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
“miaofang committed
44
          <el-col :span="4" class="btnColRight">
“miaofang committed
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
            <el-form-item>
              <el-button
                type="primary"
                native-type="submit"
                @click="handleSearch"
                >查询</el-button
              >
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </div>
    <div class="concent">
      <div class="left">
        <el-table
          height="187"
          stripe
          :data="tableList"
“miaofang committed
63
           show-summary
“miaofang committed
64 65 66 67 68
          size="mini"
          border
          header-cell-class-name="table-header-gray"
        >
          <el-table-column
“miaofang committed
69
            label="证书种类"
“miaofang committed
70 71 72 73
            prop="name"
            minWidth="100"
            align="center" />
          <el-table-column
“miaofang committed
74 75
            label="收件数量"
            prop="value"
“miaofang committed
76 77 78 79 80 81 82 83 84 85 86
            minWidth="120"
            align="center"
        /></el-table>
      </div>
      <div class="right">
        <div ref="chart" style="width: 100%; height: 200px"></div>
      </div>
    </div>
  </div>
</template>
<script>
赵千 committed
87
import { getPrintBdcqzStatistic } from "@/api/tjfx.js";
“miaofang committed
88 89
import * as echarts from "echarts";
import { mapGetters } from "vuex";
“miaofang committed
90
import { getdatamonth } from "@/utils/util";
“miaofang committed
91 92 93
export default {
  components: {},
  computed: {
“miaofang committed
94 95
    ...mapGetters(["dictData", "transfer"]),
  },
“miaofang committed
96 97
  data() {
    return {
赵千 committed
98 99 100
      queryForm: {
        qy: ''
      },
“miaofang committed
101
      tableList: [
“miaofang committed
102 103 104
        { name: "单一版不动产权证书", value: "459" },
        { name: "不动产登记证明", value: "164" },

“miaofang committed
105
      ],
“miaofang committed
106
    };
“miaofang committed
107 108
  },
  mounted() {
“miaofang committed
109
    this.setdata();
“miaofang committed
110 111 112 113 114
    // 创建一个 ECharts 实例
    this.chart = echarts.init(this.$refs.chart);
    // 在 ECharts 实例中配置图表
    this.chart.setOption(this.getOption());
  },
“miaofang committed
115
  methods: {
赵千 committed
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157
    getPrintBdcqzStatistic() {
      getPrintBdcqzStatistic({
        startDate: this.queryForm.sj[0],
        endDate: this.queryForm.sj[1],
        qxdm: this.queryForm.qy
      }).then(res => {
        if (res.code === 200) {
          this.tableList = []
          res.result.forEach(it=>{
            let obj = {
              name: it.BDCQZLX == '1' ? '单一版不动产权证书' : '不动产登记证明',
              ky: it.BDCQZLX,
              value: it.SJCOUNT
            }
            this.tableList.push(obj)
          })
          const hasBdclx1 = this.tableList.some(item => item.ky === '1');
          if (!hasBdclx1) {
            let obj1 = {
              name: '单一版不动产权证书',
              ky: '1',
              value: 0
            }
            this.tableList.push(obj1)
          }
          const hasBdclx2 = this.tableList.some(item => item.ky === '2');
          if (!hasBdclx2) {
            let obj2 = {
              name: '不动产登记证明',
              ky: '2',
              value: 0
            }
            this.tableList.push(obj2)
          }

          // 创建一个 ECharts 实例
          this.chart = echarts.init(this.$refs.chart);
          // 在 ECharts 实例中配置图表
          this.chart.setOption(this.getOption());
        }
      })
    },
“miaofang committed
158 159
    getOption() {
      return {
“miaofang committed
160
        title: {
“miaofang committed
161
          text: "证书种类统计分析发证",
“miaofang committed
162 163 164 165 166 167
          x: "center",
          textStyle: {
            //主标题文本设置
            fontSize: 12, //大小
          },
        },
“miaofang committed
168 169
        tooltip: {
          trigger: "item",
“miaofang committed
170 171 172 173 174 175 176 177
          formatter: "{a} <br/>{b} : {c}个 ({d}%)",
        },
        grid: {
          top: "4%",
          left: "2%",
          right: "3%",
          bottom: "20%",
          containLabel: true,
“miaofang committed
178 179 180
        },
        series: [
          {
“miaofang committed
181
            name: "统计分析图",
“miaofang committed
182
            type: "pie",
“miaofang committed
183 184 185 186 187 188 189 190
            radius: "70%",
            center: ["50%", "100%"],
            data: this.tableList,
            itemStyle: {
              emphasis: {
                shadowBlur: 10,
                shadowOffsetX: 0,
                shadowColor: "rgba(0, 0, 0, 0.5)",
“miaofang committed
191 192
              },
            },
“miaofang committed
193 194 195 196 197 198 199 200 201
            label: {
              normal: {
                formatter: "{c}/个",
                position: "inside", //让文字显示在饼状图里面
                textStyle: {
                  fontSize: 10,
                  color: "#fff",
                },
              },
“miaofang committed
202
            },
“miaofang committed
203
            center: ["50%", "50%"], // 这个属性调整图像的位置!!!!!
“miaofang committed
204 205 206 207
          },
        ],
      };
    },
“miaofang committed
208 209 210
    setdata() {
      this.queryForm.sj = getdatamonth();
      console.log("this.queryForm", this.queryForm);
赵千 committed
211
      this.getPrintBdcqzStatistic()
“miaofang committed
212
    },
“miaofang committed
213 214
    handleSearch() {
      console.log(" this.queryForm", this.queryForm);
赵千 committed
215
      this.getPrintBdcqzStatistic()
“miaofang committed
216
    },
“miaofang committed
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231
  },
};
</script>
<style scoped lang="scss">
/deep/.el-card__header {
  padding: 8px 10px;
}

/deep/.el-card__body {
  padding: 3px 10px 5px 10px;
  overflow: hidden;
}
.yhjgba {
  .el-col {
    padding: 4px;
“miaofang committed
232
    margin-right: 4px;
“miaofang committed
233 234 235 236
  }
  .inquire {
    width: 100%;
    height: 40px;
“miaofang committed
237 238 239 240 241 242
    background-color: #f4f7fd;
    /deep/ .el-form {
      .el-form-item--small.el-form-item {
        margin-bottom: 5px;
      }
    }
“miaofang committed
243
  }
“miaofang committed
244

“miaofang committed
245 246 247 248
  .concent {
    width: 100%;
    height: 300px;
    display: flex;
“miaofang committed
249
    //调整表头高度
“miaofang committed
250 251 252 253
    /deep/.el-table th {
      height: 36px !important;
      font-size: 14px;
      color: #4a4a4a;
“miaofang committed
254
    }
“miaofang committed
255 256 257 258 259 260
    .left {
      width: 70%;
      height: 200px;
    }
    .right {
      width: 30%;
“miaofang committed
261
      height: 300px;
“miaofang committed
262 263 264 265
    }
  }
}
</style>