Jelajahi Sumber

Merge remote-tracking branch 'origin/master' into cqtyt-master

yfh 1 Minggu lalu
induk
melakukan
fe14d1f8fa

+ 50 - 12
src/views/his/statistics/comprehensiveStatistics.vue

@@ -24,10 +24,10 @@
           <!-- 统计维度选择 -->
           <el-col :span="4">
             <el-form-item label="统计维度">
-              <el-select 
-                v-model="queryParams.dimension" 
-                placeholder="请选择统计维度" 
-                @change="handleDimensionChange" 
+              <el-select
+                v-model="queryParams.dimension"
+                placeholder="请选择统计维度"
+                @change="handleDimensionChange"
                 clearable
                 style="width: 100%">
                 <el-option label="个人" :value="1"></el-option>
@@ -95,9 +95,9 @@
         <el-table-column prop="companyName" label="公司名称"/>
         <el-table-column prop="deptName" label="部门名称" v-if="showDeptNameColumn" />
         <!-- 根据维度决定是否显示人员姓名 -->
-        <el-table-column prop="companyUserName" label="人员名" v-if="showUserNameColumn" />
+        <el-table-column prop="companyUserName" label="人员名" v-if="showUserNameColumn" />
         <!-- 更新以下列为新的字段名 -->
-        <el-table-column prop="sendCount" label="发数">
+        <el-table-column prop="sendCount" label="发数">
           <template slot-scope="scope">
             {{ scope.row.sendCount || 0 }}
           </template>
@@ -107,11 +107,23 @@
             {{ scope.row.completeNum || 0 }}
           </template>
         </el-table-column>
+        <!-- 完播率 -->
+        <el-table-column prop="completeRate" label="完播率" width="100">
+          <template slot-scope="scope">
+            {{ calculateCompleteRate(scope.row) }}
+          </template>
+        </el-table-column>
         <el-table-column prop="answerNum" label="答题数">
           <template slot-scope="scope">
             {{ scope.row.answerNum || 0 }}
           </template>
         </el-table-column>
+        <!-- 答题率 -->
+        <el-table-column prop="answerRate" label="答题率" width="100">
+          <template slot-scope="scope">
+            {{ calculateAnswerRate(scope.row) }}
+          </template>
+        </el-table-column>
         <el-table-column prop="redPacketNum" label="红包领取数">
           <template slot-scope="scope">
             {{ scope.row.redPacketNum || 0 }}
@@ -270,7 +282,7 @@ export default {
       return getSearchDeptInfo({ id: companyId }).then(response => {
         const deptData = response.data || [];
         this.deptList = deptData;
-        
+
         // 如果后端直接返回树形结构(第一层数据有children),直接使用
         // 否则通过buildDeptTree构建树形结构
         const hasTreeStructure = deptData.some(dept => dept.children && dept.children.length > 0);
@@ -301,9 +313,9 @@ export default {
       deptList.forEach(dept => {
         // 如果后端返回的数据中已经有children字段且有值,则使用后端的children
         // 否则初始化为空数组
-        deptMap[dept.deptId] = { 
-          ...dept, 
-          children: (dept.children && dept.children.length > 0) ? dept.children : [] 
+        deptMap[dept.deptId] = {
+          ...dept,
+          children: (dept.children && dept.children.length > 0) ? dept.children : []
         };
       });
 
@@ -399,7 +411,7 @@ export default {
       getSearchDeptInfo({ id: companyId }).then(response => {
         const deptData = response.data || [];
         this.deptList = deptData;
-        
+
         // 如果后端直接返回树形结构(第一层数据有children),直接使用
         // 否则通过buildDeptTree构建树形结构
         const hasTreeStructure = deptData.some(dept => dept.children && dept.children.length > 0);
@@ -476,6 +488,32 @@ export default {
 
     handleCurrentChange(val) {
       this.currentPage = val;
+    },
+
+    // 计算完播率:完课数 / 发送数
+    calculateCompleteRate(row) {
+      const sendCount = row.sendCount || 0;
+      const completeNum = row.completeNum || 0;
+
+      if (sendCount === 0) {
+        return '0%';
+      }
+
+      const rate = (completeNum / sendCount * 100).toFixed(2);
+      return rate + '%';
+    },
+
+    // 计算答题率:答题数 / 完课数
+    calculateAnswerRate(row) {
+      const completeNum = row.completeNum || 0;
+      const answerNum = row.answerNum || 0;
+
+      if (completeNum === 0) {
+        return '0%';
+      }
+
+      const rate = (answerNum / completeNum * 100).toFixed(2);
+      return rate + '%';
     }
   }
 };
@@ -532,4 +570,4 @@ export default {
     padding: 20px 50px;
   }
 }
-</style>
+</style>

+ 1 - 0
src/views/his/user/index.vue

@@ -499,6 +499,7 @@ export default {
         this.title = "修改用户";
         this.form.status = String(this.form.status)
         this.form.level = String(this.form.level)
+        this.form.isPromoter = String(this.form.isPromoter)
 
       });
     },

+ 1 - 1
src/views/hisStore/components/productAfterSalesOrder.vue

@@ -336,7 +336,7 @@ export default {
     handleRefund(){
         this.audit.open=true;
         this.form.salesId=this.afterSales.id;
-        this.form.refundAmount=this.afterSales.refundAmount;
+        this.form.refundAmount=this.order.payMoney;
     },
     submitAuditForm() {
       this.$refs["form"].validate(valid => {