Przeglądaj źródła

医健宝-首页统计、店铺初始密码字段

chenguo 6 dni temu
rodzic
commit
270684902d

+ 10 - 10
src/api/statistics/statistics.js

@@ -33,11 +33,11 @@ export function analysisPreview(param) {
  * @param query
  * @returns {AxiosPromise}
  */
-export function dealerAggregated() {
+export function dealerAggregated(param) {
   return request({
     url: '/index/statistics/dealerAggregated',
     method: 'get',
-    params: {}
+    params: param
   })
 }
 
@@ -45,22 +45,22 @@ export function dealerAggregated() {
  * 消费余额
  * @returns {AxiosPromise}
  */
-export function rechargeComsumption(){
+export function rechargeComsumption(param){
   return request({
     url: '/index/statistics/rechargeComsumption',
     method: 'get',
-    params: {}
+    params: param
   })
 }
 /**
  * 获取统计流量
  * @returns {AxiosPromise}
  */
-export function trafficLog(){
+export function trafficLog(param){
   return request({
     url: '/index/statistics/trafficLog',
     method: 'get',
-    params: {}
+    params: param
   })
 }
 
@@ -71,11 +71,11 @@ export function trafficLog(){
  * @param query
  * @returns {AxiosPromise}
  */
-export function smsBalance() {
+export function smsBalance(query) {
   return request({
     url: '/index/statistics/smsBalance',
     method: 'get',
-    params: {}
+    params: query
   })
 }
 
@@ -83,11 +83,11 @@ export function smsBalance() {
  * 授权信息
  * @returns {*}
  */
-export function authorizationInfo() {
+export function authorizationInfo(param) {
   return request({
     url: '/index/statistics/authorizationInfo',
     method: 'get',
-    params: {}
+    params: param
   })
 }
 

+ 1 - 1
src/views/hisStore/store/index.vue

@@ -552,7 +552,7 @@
           <el-input v-model="form.account" placeholder="请输入登录帐号" />
         </el-form-item>
         <!--        tips-->
-        <span class="tip-text" v-if="title !== '修改店铺管理'">请牢记登录账号,初试密码123456,请及时修改密码</span>
+        <span class="tip-text" v-if="title !== '修改店铺管理'">请及时修改密码,初试密码XyzAbc~12</span>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>

+ 3 - 2
src/views/hisStore/storeProduct/index.vue

@@ -440,11 +440,11 @@
             </el-form-item>
           </el-col>
         </el-row>
-        <div v-if="form.isDrug === '1' && this.isMedicalMall">
+        <div v-if="form.isDrug === '1' ">
           <el-form-item label="药品展示图" prop="drugImage">
             <Material v-model="drugImageArr" type="image" :num="1" :width="150" :height="150" />
           </el-form-item>
-
+          <div v-if="this.isMedicalMall">
           <el-row>
             <el-col :span="12">
               <el-form-item label="药品注册证书编号" prop="drugRegCertNo">
@@ -530,6 +530,7 @@
             <el-input v-model="form.precautions" type="textarea" placeholder="请输入注意事项" />
           </el-form-item>
         </div>
+        </div>
         <el-row>
           <el-col :span="24">
             <el-form-item label="商品简介" prop="productInfo">

+ 182 - 117
src/views/index.vue

@@ -59,7 +59,12 @@
               <div class="card-value highlight1">
                 <count-to :start-val="0" :end-val="padUsedNum" :duration="3600" class="card-panel-num companynumber" />
                 /
-                <count-to :start-val="0" :end-val="padTotalNum" :duration="1800" class="card-panel-num companynumber" />
+                <template v-if="typeof padTotalNum === 'number'">
+                  <count-to :start-val="0" :end-val="padTotalNum" :duration="1800" class="card-panel-num companynumber" />
+                </template>
+                <template v-else>
+                  <span class="card-panel-num companynumber">{{ padTotalNum }}</span>
+                </template>
               </div>
             </div>
           </div>
@@ -230,7 +235,7 @@
 
         <div class="action-group">
           <!-- 选择部门 -->
-          <el-select v-model="deptId" placeholder="请选择部门" size="small" @change="handleDeptChange" style="width: 100px">
+          <el-select v-model="deptId" placeholder="请选择部门" size="small" @change="handleDeptChange" style="width: 150px">
             <el-option
               v-for="company in deptOptions"
               :key="company.deptId"
@@ -877,9 +882,12 @@ export default {
   components: {CountTo},
   data() {
     return {
+      deptInitOptions:[],
       deptOptions:[],
-      deptId:this.$store.state.user.deptId,
-      companyInitOptions:[],
+      intiDeptId:this.$store.state.user.user.deptId,
+      deptId:this.$store.state.user.user.deptId,
+      staticParam : {companyId:null,deptId:this.$store.state.user.user.deptId},
+      companyIntiOptions:[],
       companyOptions:[],
       companyId:null,
       percentage: 0,
@@ -983,32 +991,77 @@ export default {
   created() {
     this.refresh();
     listDept().then(res => {
-      this.deptOptions = res.data;
-    });
-    listCompany().then(res => {
-      this.companyIntiOptions = res.rows;
-      this.companyOptions = this.companyIntiOptions.filter(item => item.deptId === this.deptId);
+      this.deptInitOptions = res.data;
+      listCompany().then(res => {
+        this.companyIntiOptions = res.rows;
+        this.getDeptOptions(this.intiDeptId);
+        this.getCompanyOptions(this.intiDeptId);
+      });
     });
   },
   methods: {
-    //首页统计选择部门、销售公司
-    handleDeptChange(){
-        this.companyOptions = this.companyIntiOptions.filter(item => item.deptId === this.deptId);
-        this.companyId = null;
-        this.refresh();
+    getDeptOptions(deptId) {
+      const deptInitOptions = this.deptInitOptions;
+      // 部门本身节点
+      let deptNode = deptInitOptions.filter(item => item.deptId === deptId);
+
+      // 递归查找所有子节点
+      function findChildren(parentId) {
+        //部门的子部门
+        let deptChildren = deptInitOptions.filter(item => item.parentId === parentId);
+        //添加子部门
+        deptChildren.forEach(child => {
+          deptNode.push(child);
+          findChildren(child.deptId); // 递归查找子节点的子节点
+        });
+      }
+
+      // 从目标节点开始查找子节点
+      findChildren(deptId);
+      this.deptOptions = deptNode;
     },
-    handleCompanyChange(){
-      if(this.companyId){
-        this.deptId = this.companyOptions.filter(item => item.companyId === this.companyId)[0].deptId;
-        this.refresh();
-      }else{
-        this.refresh();
+    getCompanyOptions(deptId) {
+      this.companyId = null;
+      //修改选择后清空查询参数
+      this.staticParam.companyId = null;
+      this.staticParam.deptId = deptId;
+      const deptInitOptions = this.deptInitOptions;
+      const companyInitOptions = this.companyIntiOptions;
+      // 部门下的公司
+      let companyNode = companyInitOptions.filter(item => item.deptId === deptId);
+
+      // 递归查找所有子节点
+      function findChildren(parentId) {
+        //部门的子部门
+        let deptChildren = deptInitOptions.filter(item => item.parentId === parentId);
+        //添加子部门
+        deptChildren.forEach(child => {
+          //子部门下的销售公司
+          let companyChildren = companyInitOptions.filter(item => item.deptId === child.deptId);
+          companyChildren.forEach(companyChild => {
+            companyNode.push(companyChild);
+          })
+          findChildren(child.deptId); // 递归查找子节点的子节点
+        });
       }
+
+      // 从目标节点开始查找子节点
+      findChildren(deptId);
+      this.companyOptions = companyNode;
+    },
+    //首页统计选择部门、销售公司
+    handleDeptChange() {
+      this.getCompanyOptions(this.deptId);
+      this.refresh();
+    },
+    handleCompanyChange() {
+      this.staticParam.companyId = this.companyId;
+      this.refresh();
     },
-    handleUserType(){
-      if(this.userTypeText === '会员'){
+    handleUserType() {
+      if (this.userTypeText === '会员') {
         this.userType = 1
-      }else{
+      } else {
         this.userType = 2
       }
 
@@ -1118,43 +1171,43 @@ export default {
       }
     },
     refresh() {
-      rechargeComsumption().then(res=>{
-        if(res.code === 200){
+      rechargeComsumption(this.staticParam).then(res => {
+        if (res.code === 200) {
           this.balance = res.data.balance;
           this.todayComsumption = res.data.todayComsumption;
           this.yesterdayComsumption = res.data.yesterdayComsumption;
-          let calculateRemainingDays1 = this.calculateRemainingDays(this.balance,this.todayComsumption,this.yesterdayComsumption);
+          let calculateRemainingDays1 = this.calculateRemainingDays(this.balance, this.todayComsumption, this.yesterdayComsumption);
           this.percentage = calculateRemainingDays1.percentage;
           this.remainMessage = calculateRemainingDays1.message;
         }
       });
 
-      trafficLog().then(res=>{
-        if(res.code === 200) {
+      trafficLog(this.staticParam).then(res => {
+        if (res.code === 200) {
           this.todayTraffic = res.data.today;
           this.thisMonthTraffic = res.data.thisMonth;
           this.trafficCount = res.data.traffic;
         }
       })
 
-      dealerAggregated().then(res=>{
-        if(res.code === 200){
-          this.dealderCount = res.data.dealderCount??0;
-          this.groupMgrCount = res.data.groupMgrCount??0;
-          this.memberCount = res.data.memberCount??0;
-          this.qwMemberNum = res.data.qwMemberNum??0;
-          this.padTotalNum = res.data.padTotalNum??0;
-          this.padUsedNum = res.data.padUsedNum??0;
+      dealerAggregated(this.staticParam).then(res => {
+        if (res.code === 200) {
+          this.dealderCount = res.data.dealderCount ?? 0;
+          this.groupMgrCount = res.data.groupMgrCount ?? 0;
+          this.memberCount = res.data.memberCount ?? 0;
+          this.qwMemberNum = res.data.qwMemberNum ?? 0;
+          this.padTotalNum = (res.data.padTotalNum ?? 0) === -1 ? '不限' : res.data.padTotalNum;
+          this.padUsedNum = res.data.padUsedNum ?? 0;
           this.padInfo = res.data.padInfo;
-          this.normalNum = res.data.normalNum??0;
-          this.blackNum = res.data.blackNum??0;
-          this.todayIncreaseUserNum = res.data.todayIncreaseUserNum??0;
-          this.orderTotalNum = res.data.orderTotalNum??0;
-          this.todayOrderNum = res.data.todayOrderNum??0;
-          this.recvTotalNum = res.data.recvTotalNum??0;
-          this.recvTodayNum = res.data.recvTodayNum??0;
-          this.goodsTotalNum = res.data.goodsTotalNum??0;
-          this.todayGoodsNum = res.data.todayGoodsNum??0;
+          this.normalNum = res.data.normalNum ?? 0;
+          this.blackNum = res.data.blackNum ?? 0;
+          this.todayIncreaseUserNum = res.data.todayIncreaseUserNum ?? 0;
+          this.orderTotalNum = res.data.orderTotalNum ?? 0;
+          this.todayOrderNum = res.data.todayOrderNum ?? 0;
+          this.recvTotalNum = res.data.recvTotalNum ?? 0;
+          this.recvTodayNum = res.data.recvTodayNum ?? 0;
+          this.goodsTotalNum = res.data.goodsTotalNum ?? 0;
+          this.todayGoodsNum = res.data.todayGoodsNum ?? 0;
         }
       })
       let param = this.getParam();
@@ -1163,8 +1216,8 @@ export default {
       const today = dayjs();
       param.startTime = this.formatDate(today);
       param.endTime = this.formatDate(today);
-      analysisPreview(param).then(res=>{
-        if(res.code === 200){
+      analysisPreview(param).then(res => {
+        if (res.code === 200) {
           this.watchUserCount = res.data.watchUserCount;
           this.completedUserCount = res.data.completedUserCount;
           this.completedRate = res.data.completedRate;
@@ -1178,17 +1231,17 @@ export default {
           this.watchRate = res.data.watchRate;
         }
       })
-      smsBalance().then(res=>{
-        if(res.code === 200){
-          if(res.data == null) {
+      smsBalance(this.staticParam).then(res => {
+        if (res.code === 200) {
+          if (res.data == null) {
             this.smsRemainCount = 0;
           } else {
             this.smsRemainCount = res.data;
           }
         }
       })
-      authorizationInfo().then(res=>{
-        if(res.code === 200){
+      authorizationInfo(this.staticParam).then(res => {
+        if (res.code === 200) {
           this.todayWatchUserCount = res.data.todayWatchUserCount;
           this.versionLimit = res.data.versionLimit;
         }
@@ -1243,8 +1296,7 @@ export default {
           } else {
           }
         });
-      }
-      else if (selected === 0) {
+      } else if (selected === 0) {
         this.$nextTick(() => {
           if (this.viewerChart) this.viewerChart.resize();
           if (this.dealerChart) this.dealerChart.resize();
@@ -1269,11 +1321,13 @@ export default {
       return dayjs(date).format('YYYY-MM-DD');
     },
 
-    getParam(){
+    getParam() {
       let param = {
         startTime: '',
         endTime: '',
-        userType: this.userType
+        userType: this.userType,
+        companyId: this.companyId,
+        deptId: this.deptId
       };
       // 获取当前日期时间
       const today = dayjs();
@@ -1340,18 +1394,18 @@ export default {
         this.handleAnswerRedPackMoneyViewerChart()
       }
     },
-    handleAnswerRedPackViewerChart(){
+    handleAnswerRedPackViewerChart() {
       let param = this.getParam();
-      param = {...param,statisticalType:this.viewerType,dataType: this.dataType};
-      rewardMoneyTopTen(param).then(res=>{
-        if(res.code === 200){
+      param = { ...param, statisticalType: this.viewerType, dataType: this.dataType };
+      rewardMoneyTopTen(param).then(res => {
+        if (res.code === 200) {
           let data = res.data;
-          let companyNameList = data.map(e=>e.companyName)
-          let courseNameList = data.map(e=>e.courseName)
-          let rewardMoneyList = data.map(e=>e.rewardMoney)
-          if(this.dataType === '0'){
+          let companyNameList = data.map(e => e.companyName)
+          let courseNameList = data.map(e => e.courseName)
+          let rewardMoneyList = data.map(e => e.rewardMoney)
+          if (this.dataType === '0') {
             redPackageOption.xAxis.data = companyNameList;
-          }else{
+          } else {
             redPackageOption.xAxis.data = courseNameList;
           }
           redPackageOption.series[0].data = rewardMoneyList;
@@ -1360,13 +1414,13 @@ export default {
         }
       })
     },
-    handleAnswerRedPackMoneyViewerChart(){
+    handleAnswerRedPackMoneyViewerChart() {
       let param = this.getParam();
-      param = {...param,statisticalType:this.viewerType,dataType: this.dataType};
-      rewardMoneyTrend(param).then(res=>{
-        if(res.code === 200){
+      param = { ...param, statisticalType: this.viewerType, dataType: this.dataType };
+      rewardMoneyTrend(param).then(res => {
+        if (res.code === 200) {
           let data = res.data;
-          let option = data.map(e=>[e.x,e.rewardMoney])
+          let option = data.map(e => [e.x, e.rewardMoney])
           lineChartOption.series[0].data = option;
 
           this.answerRedPackMoneyViewerChart.setOption(lineChartOption)
@@ -1375,15 +1429,15 @@ export default {
     },
     handleCourseWatchChart() {
       let param = this.getParam();
-      param = {...param,statisticalType:this.viewerType};
-      watchCourseTopTen(param).then(res=>{
-        if(res.code === 200){
+      param = { ...param, statisticalType: this.viewerType };
+      watchCourseTopTen(param).then(res => {
+        if (res.code === 200) {
           let data = res.data;
-          let watchUserCountList = data.map(e=>e.watchUserCount);
-          let completedUserCountList = data.map(e=>e.completedUserCount);
-          let answerUserCountList = data.map(e=>e.answerUserCount);
-          let correctUserCountList = data.map(e=>e.correctUserCount);
-          let courseNameList = data.map(e=>e.courseName);
+          let watchUserCountList = data.map(e => e.watchUserCount);
+          let completedUserCountList = data.map(e => e.completedUserCount);
+          let answerUserCountList = data.map(e => e.answerUserCount);
+          let correctUserCountList = data.map(e => e.correctUserCount);
+          let courseNameList = data.map(e => e.courseName);
           courseWatchOption.xAxis.data = courseNameList;
           courseWatchOption.series[0].data = watchUserCountList;
           courseWatchOption.series[1].data = completedUserCountList;
@@ -1393,15 +1447,15 @@ export default {
         }
       })
     },
-    handleDealerChartData(){
+    handleDealerChartData() {
       let param = this.getParam();
 
       // 经销商会员观看TOP10
-      deaMemberTopTen({...param,statisticalType: this.viewerType}).then(res=>{
-        if(res.code === 200){
+      deaMemberTopTen({ ...param, statisticalType: this.viewerType }).then(res => {
+        if (res.code === 200) {
           let data = res.data;
-          let companyNameList = data.map(e=>e.companyName);
-          let watchUserList = data.map(e=>e.watchUserCount);
+          let companyNameList = data.map(e => e.companyName);
+          let watchUserList = data.map(e => e.watchUserCount);
           dealerOption.yAxis.data = companyNameList;
           dealerOption.series[0].data = watchUserList;
 
@@ -1410,9 +1464,9 @@ export default {
       })
 
     },
-    handleThisMonthOrderCount(){
-      thisMonthOrderCount().then(res=>{
-        if(res.code === 200){
+    handleThisMonthOrderCount() {
+      thisMonthOrderCount().then(res => {
+        if (res.code === 200) {
           let dates = res.dates;
           let orderCount = res.orderCount;
           let payPrice = res.payPrice;
@@ -1425,9 +1479,9 @@ export default {
         }
       })
     },
-    handleThisMonthRecvCount(){
-      thisMonthRecvCount().then(res=>{
-        if(res.code === 200){
+    handleThisMonthRecvCount() {
+      thisMonthRecvCount().then(res => {
+        if (res.code === 200) {
           let dates = res.dates;
           let orderCount = res.orderCount;
           let payMoney = res.payMoney;
@@ -1439,15 +1493,15 @@ export default {
         }
       })
     },
-    handleViewChartData(){
+    handleViewChartData() {
       let param = this.getParam();
 
-      watchEndPlayTrend({...param}).then(res=>{
-        if(res.code === 200){
+      watchEndPlayTrend({ ...param }).then(res => {
+        if (res.code === 200) {
           let data = res.data;
-          let watchUserCountList = data.map(e=>e.watchUserCount);
-          let completedUserCountList = data.map(e=>e.completedUserCount);
-          let xAxis = data.map(e=>e.x);
+          let watchUserCountList = data.map(e => e.watchUserCount);
+          let completedUserCountList = data.map(e => e.completedUserCount);
+          let xAxis = data.map(e => e.x);
           viewCharOption.series[0].data = watchUserCountList;
           viewCharOption.series[1].data = completedUserCountList;
           viewCharOption.xAxis.data = xAxis;
@@ -1457,11 +1511,11 @@ export default {
       })
 
     },
-    initThisMonthOrderChart(){
+    initThisMonthOrderChart() {
       this.thisMonthOrderChart = echarts.init(this.$refs.viewerOrderChart)
       this.thisMonthOrderChart.setOption(thisMonthOrderCountOption)
     },
-    initThisMonthRecvChart(){
+    initThisMonthRecvChart() {
       this.thisMonthRecvChart = echarts.init(this.$refs.viewerReceiveChart)
       this.thisMonthRecvChart.setOption(thisMonthOrderCountOption)
     },
@@ -1479,12 +1533,12 @@ export default {
 
       this.courseWatchChart.setOption(courseWatchOption)
     },
-    initAnswerRedPackViewerChart(){
+    initAnswerRedPackViewerChart() {
       this.answerRedPackViewerChart = echarts.init(this.$refs.answerRedPackViewerChart)
 
       this.answerRedPackViewerChart.setOption(redPackageOption)
     },
-    initAnswerRedPackMoneyViewerChart(){
+    initAnswerRedPackMoneyViewerChart() {
       this.answerRedPackMoneyViewerChart = echarts.init(this.$refs.answerRedPackMoneyViewerChart)
 
       this.answerRedPackMoneyViewerChart.setOption(lineChartOption)
@@ -1518,7 +1572,7 @@ export default {
   transform: scale(.9);
 }
 
-.action-group .el-button+.el-button,
+.action-group .el-button + .el-button,
 .action-group .el-dropdown {
   margin-left: 10px;
 }
@@ -1848,7 +1902,6 @@ export default {
 }
 
 
-
 .companynumber {
   color: white;
 }
@@ -1882,8 +1935,6 @@ export default {
 }
 
 
-
-
 .propertyboxtitle {
   background-image: url(../assets/images/zcgl_bg.png);
   height: 100px;
@@ -1946,11 +1997,12 @@ export default {
   line-height: 50px;
 }
 
-.operatetitle-col{
+.operatetitle-col {
   display: flex;
   justify-content: space-between;
   padding-bottom: 20px;
   padding-right: 5px;
+
   .operatetitle-card {
     width: 24%;
     border: 1px solid transparent;
@@ -1981,6 +2033,7 @@ export default {
   border-radius: 6px;
   padding: 2px 5px 15px 5px;
   width: 100%;
+
   .internet-cardtop {
     background-color: white;
     border-radius: 3px;
@@ -2024,28 +2077,33 @@ export default {
 
   }
 
-  .internetbox-messge{
+  .internetbox-messge {
     color: white;
     display: flex;
     justify-content: space-between;
     padding: 15px 10px 10px 10px;
-    .internet-card{
+
+    .internet-card {
       display: flex;
       font-size: 14px;
       align-items: center;
-      img{
+
+      img {
         height: 18px;
         width: 18px;
       }
-      span{
+
+      span {
         padding-left: 5px;
       }
     }
-    .internet-number{
+
+    .internet-number {
       font-size: 25px;
 
     }
   }
+
   .internetbox {
     display: flex;
     color: white;
@@ -2065,9 +2123,10 @@ export default {
 }
 
 .company {
-  background-color: 006CFF;
+  background-color: #006CFF;
 }
-.highlight-red{
+
+.highlight-red {
   text-align: center;
   margin-top: 1em;
   font-family: BebasNeue;
@@ -2077,7 +2136,8 @@ export default {
   font-weight: 600;
   margin-top: 8px;
 }
-.highlight-black{
+
+.highlight-black {
   text-align: center;
   margin-top: 1em;
   font-family: BebasNeue;
@@ -2088,26 +2148,31 @@ export default {
   margin-top: 8px;
 
 }
-.operatetitle-card:hover{
+
+.operatetitle-card:hover {
   border: 1px solid #4592ff;
   background-color: #e7f1ff;
 }
-.icon-img{
+
+.icon-img {
   height: 14px;
   width: 14px;
 }
-.progress{
+
+.progress {
   transform: rotate(180deg);
   margin-top: 20px;
 }
-.progress ::v-deep .el-progress-bar__outer{
+
+.progress ::v-deep .el-progress-bar__outer {
   background-color: rgba(247, 152, 11, 0.2);
 }
+
 ::v-deep .el-progress {
 
   .el-progress-bar {
     .el-progress-bar__inner {
-      background: linear-gradient(to right, #FF6300,#FF9F01)
+      background: linear-gradient(to right, #FF6300, #FF9F01)
     }
   }
 }