From 7672bba9fc11315da4c42cba74504b7fd417df0c Mon Sep 17 00:00:00 2001
From: su1124 <1583764726@qq.com>
Date: 星期五, 08 三月 2024 15:43:58 +0800
Subject: [PATCH] su

---
 src/views/standard/tijiancom/index.vue |  268 ++++++++++++++++++++++++++++++----------------------
 1 files changed, 154 insertions(+), 114 deletions(-)

diff --git a/src/views/standard/tijiancom/index.vue b/src/views/standard/tijiancom/index.vue
index 8a3eac3..3e63cb7 100644
--- a/src/views/standard/tijiancom/index.vue
+++ b/src/views/standard/tijiancom/index.vue
@@ -1,21 +1,36 @@
 <template>
-    <div>
-        <el-form :model="queryParams" ref="tableList" :inline="true" label-width="76px" style="margin: 10px 10px">
-            <el-form-item label="缁熻鍖洪棿" prop="date">
-                <el-date-picker v-model="value1" type="datetimerange" align="right" start-placeholder="寮�濮嬫棩鏈�"
-                    :picker-options="pickerOptions" end-placeholder="缁撴潫鏃ユ湡" :default-time="['00:00:00', '23:00:00']"
-                    format="yyyy-MM-dd HH:mm" value-format="yyyy-MM-dd HH:mm" @change="dateChangebirthday1">
-                </el-date-picker>
-            </el-form-item>
-            <el-form-item>
-                <el-button type="primary" @click="submitForm">鎼滅储</el-button>
-            </el-form-item>
-        </el-form>
+  <div>
+    <el-form
+      :model="queryParams"
+      ref="tableList"
+      :inline="true"
+      label-width="76px"
+      style="margin: 10px 10px"
+    >
+      <el-form-item label="缁熻鍖洪棿" prop="date">
+        <el-date-picker
+          v-model="value1"
+          type="datetimerange"
+          align="right"
+          start-placeholder="寮�濮嬫棩鏈�"
+          :picker-options="pickerOptions"
+          end-placeholder="缁撴潫鏃ユ湡"
+          :default-time="['00:00:00', '23:00:00']"
+          format="yyyy-MM-dd HH:mm"
+          value-format="yyyy-MM-dd HH:mm"
+          @change="dateChangebirthday1"
+        >
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" @click="submitForm">鎼滅储</el-button>
+      </el-form-item>
+    </el-form>
 
-        <div class="data-view">
-            <div id="main"></div>
-        </div>
+    <div class="data-view">
+      <div id="main"></div>
     </div>
+  </div>
 </template>
     
         
@@ -26,123 +41,148 @@
 require("echarts/lib/component/tooltip");
 require("echarts/lib/component/legend");
 require("echarts/lib/chart/pie");
+import { getNewDateList } from "@/api/hosp/order";
+import moment from "moment";
 
 export default {
-    name: "chart",
-    data() {
-        return {
-            pickerOptions: {
-                shortcuts: [{
-                    text: '鏈�杩戜竴鍛�',
-                    onClick(picker) {
-                        const end = new Date();
-                        const start = new Date();
-                        start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
-                        picker.$emit('pick', [start, end]);
-                    }
-                }, {
-                    text: '鏈�杩戜竴涓湀',
-                    onClick(picker) {
-                        const end = new Date();
-                        const start = new Date();
-                        start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
-                        picker.$emit('pick', [start, end]);
-                    }
-                }, {
-                    text: '鏈�杩戜笁涓湀',
-                    onClick(picker) {
-                        const end = new Date();
-                        const start = new Date();
-                        start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
-                        picker.$emit('pick', [start, end]);
-                    }
-                }]
+  name: "chart",
+  data() {
+    return {
+      pickerOptions: {
+        shortcuts: [
+          {
+            text: "鏈�杩戜竴鍛�",
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+              picker.$emit("pick", [start, end]);
             },
-            value1: "",
-            DateList: [],
-            startTime: "",
-            dateAll: [],
-            queryParams: {
-                date: null,
-                startDate: null,
-                endDate: null,
+          },
+          {
+            text: "鏈�杩戜竴涓湀",
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+              picker.$emit("pick", [start, end]);
             },
-        };
+          },
+          {
+            text: "鏈�杩戜笁涓湀",
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+              picker.$emit("pick", [start, end]);
+            },
+          },
+        ],
+      },
+      value1: "",
+      DateList: [],
+      startTime: "",
+      dateAll: [],
+      queryParams: {
+        date: null,
+        startDate: null,
+        endDate: null,
+      },
+    };
+  },
+
+  created() {
+    this.getdate();
+  },
+  methods: {
+    getdate() {
+      getNewDateList().then((res) => {
+        this.value1 = [
+          moment(res.data).format("YYYY-MM-DD 00:00:00"),
+          moment(res.data).format("YYYY-MM-DD 23:59:00"),
+        ];
+      });
     },
-
-
-    methods: {
-        getList() {
-            this.queryParams.startDate = this.startTime[0];
-            this.queryParams.endDate = this.startTime[1];
-            let myChart = this.$echarts.init(document.getElementById("main"));
-            //浣犺繘鍏ラ〉闈㈠厛鎶婂浘琛ㄦ覆鏌撲簡  鐒跺悗鎵嶈幏鍙栫殑鏁版嵁鎶�
-            myChart.setOption({
-               
-                tooltip: {},
-                xAxis: {
-                    type: 'category',
-                    data: ['涓�鑸鏌�','澶栫','鍐呯', '鍖栭獙绉�', '妫�楠岀', '蹇冪數鍥惧','濡囩','B瓒呭','鏂扮敓鍎跨', '鍎跨绉�']
-                },
-                yAxis: {
-                    type: 'value'
-                },
-                legend: {
-                    data: ['鍓╀綑浣撴浜烘暟', '宸插畬鎴愪綋妫�浜烘暟']
-                },
-
-                series: [{
-                    name: '鍓╀綑浣撴浜烘暟',
-                    color: ['#2f4554'],
-                    data: [100, 150, 120, 90, 50, 130, 110,80,90,100],
-                    type: 'bar',
-                    label: {
-                        // show: true,
-                        position: 'right'
-                    }
-                },
-                {
-                    name: '宸插畬鎴愪綋妫�浜烘暟',
-                    color: ['#c23531'],
-                    data: [120, 130, 110, 70, 60, 110, 140,80,90,80],
-                    type: 'bar',
-                    label: {
-                        // show: true,
-                        position: 'right'
-                    }
-                }]
-
-
-            });
-
+    getList() {
+      this.queryParams.startDate = this.startTime[0];
+      this.queryParams.endDate = this.startTime[1];
+      let myChart = this.$echarts.init(document.getElementById("main"));
+      //浣犺繘鍏ラ〉闈㈠厛鎶婂浘琛ㄦ覆鏌撲簡  鐒跺悗鎵嶈幏鍙栫殑鏁版嵁鎶�
+      myChart.setOption({
+        tooltip: {},
+        xAxis: {
+          type: "category",
+          data: [
+            "涓�鑸鏌�",
+            "澶栫",
+            "鍐呯",
+            "鍖栭獙绉�",
+            "妫�楠岀",
+            "蹇冪數鍥惧",
+            "濡囩",
+            "B瓒呭",
+            "鏂扮敓鍎跨",
+            "鍎跨绉�",
+          ],
         },
-        // 鏃堕棿
-        dateChangebirthday1(val) {
-            this.startTime = val;
+        yAxis: {
+          type: "value",
+        },
+        legend: {
+          data: ["鍓╀綑浣撴浜烘暟", "宸插畬鎴愪綋妫�浜烘暟"],
         },
 
-        // 鎼滅储
-        submitForm() {
-            this.queryParams.pageNum = 1;
-            this.getList();
-        },
+        series: [
+          {
+            name: "鍓╀綑浣撴浜烘暟",
+            color: ["#2f4554"],
+            data: [100, 150, 120, 90, 50, 130, 110, 80, 90, 100],
+            type: "bar",
+            label: {
+              // show: true,
+              position: "right",
+            },
+          },
+          {
+            name: "宸插畬鎴愪綋妫�浜烘暟",
+            color: ["#c23531"],
+            data: [120, 130, 110, 70, 60, 110, 140, 80, 90, 80],
+            type: "bar",
+            label: {
+              // show: true,
+              position: "right",
+            },
+          },
+        ],
+      });
+    },
+    // 鏃堕棿
+    dateChangebirthday1(val) {
+      this.startTime = val;
     },
 
-    mounted() {
-        this.getList();
+    // 鎼滅储
+    submitForm() {
+      this.queryParams.pageNum = 1;
+      this.getList();
     },
+  },
+
+  mounted() {
+    this.getList();
+  },
 };
 </script>
 <style>
 .data-view {
-    margin: 5px 15px;
-    height: 580px;
+  margin: 5px 15px;
+  height: 580px;
 }
 
 #main {
-    padding: 10px;
-    height: 580px;
-    background-color: #fff;
+  padding: 10px;
+  height: 580px;
+  background-color: #fff;
 }
 </style>
     

--
Gitblit v1.8.0