Procházet zdrojové kódy

首页实时数据

fubin před 1 rokem
rodič
revize
c0b4294934
2 změnil soubory, kde provedl 150 přidání a 0 odebrání
  1. 2 0
      src/api/pages/common/common.js
  2. 148 0
      src/view/single-page/home/home.vue

+ 2 - 0
src/api/pages/common/common.js

@@ -119,6 +119,8 @@ export default {
     getGoodsForInto: 'get_goods_for_into',
     ///获取商品(其他入库开单用)(分页)
     getGoodsForIntoByPage: 'get_goods_for_into_by_page',
+    // 获取首页实时数据
+    getRealTimeData: 'get_real_time_data',
   },
   fileService:{
     prefix: 'mdm-server/file/',

+ 148 - 0
src/view/single-page/home/home.vue

@@ -178,6 +178,97 @@
       </div>
     </Card>
 
+    <!-- 实时数据 -->
+    <Card class="card card-upcoming" @contextmenu.native.prevent>
+      <div style="display: flex">
+        <div style="font-size: 16px;font-weight:500;color:#17233d;margin-right: 40px">
+          实时数据
+        </div>
+        <Select v-model="realTimeDataType" style="width:200px;margin: 0px 0px 10px 0px" ref="selCp" @on-change="cpRealTimeDataType">
+          <Option v-for="item in realTimeDataTypeList" :value="item.id" :key="item.id">{{ item.name }}</Option>
+        </Select>
+      </div>
+      <Tooltip style="cursor: pointer" slot="extra" :content="$v('refresh')" theme="light" >
+        <Button icon="md-refresh" shape="circle" class="circle-button" @click="refreshRealTimeData "></Button>
+      </Tooltip>
+      <div style="display: flex;align-items: center;">
+        <div class="upcoming">
+          <!--销售订单-->
+          <div class="upcoming-card"  @click="openDrawer($config.homeDrawType.waitAudit)">
+            <Row>
+              <Col span="6" class="upcoming-card-icon">
+                <img :src="require('@/assets/images/menu-image/' + 'web-order-pending.png')" style="width: 40px;height: 40px;"/>
+              </Col>
+              <Col span="18">
+                <Row class="upcoming-card-text" style="margin: 15px 0px 0px 5px">
+                {{ orderQty }} 单 {{ orderAmt }} 元
+                </Row>
+              </Col>
+              <Col span="18">
+                <Row class="upcoming-card-text" style="margin: 5px 0px 0px 5px">
+                  销售订单
+                </Row>
+              </Col>
+            </Row>
+          </div>
+          <!--出库订单-->
+          <div class="upcoming-card" @click="openDrawer($config.homeDrawType.waitAudit)">
+            <Row>
+              <Col span="6" class="upcoming-card-icon">
+                <img :src="require('@/assets/images/menu-image/' + 'web-into-pending.png')" style="width: 40px;height: 40px;"/>
+              </Col>
+              <Col span="18">
+                <Row class="upcoming-card-text" style="margin: 15px 0px 0px 5px">
+                  {{ outQty }} 单 {{ outAmt }} 元
+                </Row>
+              </Col>
+              <Col span="18">
+                <Row class="upcoming-card-text" style="margin: 5px 0px 0px 5px">
+                  出库订单
+                </Row>
+              </Col>
+            </Row>
+          </div>
+          <!--退货订单-->
+          <div class="upcoming-card" @click="openDrawer($config.homeDrawType.waitAudit)">
+            <Row>
+              <Col span="6" class="upcoming-card-icon">
+                <img :src="require('@/assets/images/menu-image/' + 'web-out-pending.png')" style="width: 40px;height: 40px;"/>
+              </Col>
+              <Col span="18">
+                <Row class="upcoming-card-text" style="margin: 15px 0px 0px 5px">
+                  {{ returnQty }} 单 {{ returnAmt }} 元
+                </Row>
+              </Col>
+              <Col span="18">
+                <Row class="upcoming-card-text" style="margin: 5px 0px 0px 5px">
+                  退货订单
+                </Row>
+              </Col>
+            </Row>
+          </div>
+          <!--新增客户-->
+          <div class="upcoming-card"  @click="openDrawer($config.homeDrawType.waitAudit)">
+            <Row>
+              <Col span="6" class="upcoming-card-icon">
+                <img :src="require('@/assets/images/menu-image/' + 'web-order-pending.png')" style="width: 40px;height: 40px;"/>
+              </Col>
+              <Col span="18">
+                <Row class="upcoming-card-text" style="margin: 15px 0px 0px 5px">
+                  {{ cusQty }} 单 {{ cusAmt }} 元
+                </Row>
+              </Col>
+              <Col span="18">
+                <Row class="upcoming-card-text" style="margin: 5px 0px 0px 5px">
+                  新增客户
+                </Row>
+              </Col>
+            </Row>
+          </div>
+        </div>
+      </div>
+    </Card>
+
     <!--    底部留白-->
     <div style="width: 100%; height: 20px"></div>
   </div>
@@ -406,6 +497,22 @@
         salesHelperDays2: '15',
         // 销售助手天数3
         salesHelperDays3: '30',
+
+        /***************** 实时数据 ******************/
+        realTimeDataType:"经营日报",
+        orderQty:0,
+        orderAmt:0,
+        outQty:0,
+        outAmt:0,
+        returnQty:0,
+        returnAmt:0,
+        cusQty:0,
+        cusAmt:0,
+        realTimeDataTypeList:[
+          {"id":"经营日报", "name":"经营日报"},
+          {"id":"经营月报", "name":"经营月报"}
+          ],
+        /***************** 实时数据 ******************/
       }
     },
     mounted() {
@@ -1062,12 +1169,53 @@
           }
         })
       },
+      /**
+       * @desc   : 刷新实时数据
+       * @author : 付斌
+       * @date   : 2024-06-14 16:44
+       */
+      refreshRealTimeData(){
+        // 查询实时数据
+        this.selectRealTimeData()
+      },
+      /**
+       * @desc   : 切换实时数据类型
+       * @author : 付斌
+       * @date   : 2024-06-14 16:43
+       */
+      cpRealTimeDataType(){
+        // 查询实时数据
+        this.selectRealTimeData()
+      },
+      /**
+       * @desc   : 查询实时数据
+       * @author : 付斌
+       * @date   : 2024-06-14 15:13
+       */
+      selectRealTimeData(){
+        let params = {
+          realTimeDataType:this.realTimeDataType,
+        }
+        this.excute(this.$service.commonService, this.$service.commonService.getRealTimeData, params).then(res => {
+          if (res.code === this.$config.SUCCESS_CODE) {
+            this.orderQty = res.data.orderQty
+            this.orderAmt = res.data.orderAmt
+            this.outQty = res.data.outQty
+            this.outAmt = res.data.outAmt
+            this.returnQty = res.data.returnQty
+            this.returnAmt = res.data.returnAmt
+            this.cusQty = res.data.cusQty
+            this.cusAmt = res.data.cusAmt
+          }
+        })
+      },
     },
     created() {
       this.routeObjName = 'appMenu'  // 设置路由名称
       this.getCommonMenu();   // 获取常用功能的菜单
       this.selectCommonUse();//查询常用功能
       this.selectPending();//获取代办事项个数
+      this.selectRealTimeData();//查询实时数据
       // this.getApprovalCount();// 获取待审中心数据
       // this.getUnreadNoticeCount();// 获取未读公告条数
       this.waitApprovalRight =this.$libaray.checkButtonHasRight('wait-approval')