Преглед изворни кода

Merge branch 'master' of http://1.14.104.71:10880/root/ylrz_scrm_companyUI

ct пре 4 дана
родитељ
комит
a0988752d6

+ 10 - 1
src/api/company/companyRecharge.js

@@ -50,4 +50,13 @@ export function exportCompanyRecharge(query) {
     method: 'get',
     params: query
   })
-}
+}
+
+// 充值接口
+export function recharge(data) {
+  return request({
+    url: '/company/companyRecharge/recharge',
+    method: 'post',
+    data: data
+  })
+}

+ 90 - 6
src/views/company/companyRecharge/index.vue

@@ -39,6 +39,12 @@
           @click="handleExport"
           v-hasPermi="['company:companyRecharge:export']"
         >导出</el-button>
+        <el-button
+          size="mini"
+          type="primary"
+          icon="el-icon-edit"
+          @click="handleRecharge"
+        >充值</el-button>
       </el-col>
 	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
@@ -53,7 +59,6 @@
               <el-tag prop="status" v-for="(item, index) in payTypeOptions"   v-if="scope.row.payType==item.dictValue">{{item.dictLabel}}</el-tag>
         </template>
       </el-table-column>
-
       <el-table-column label="凭证照片" align="center" prop="images" >
         <template slot-scope="scope">
           <div v-if="scope.row.imgs != null && scope.row.imgs != undefined && scope.row.imgs != ''">
@@ -66,7 +71,7 @@
           </div>
         </template>
       </el-table-column>
-       <el-table-column label="状态" align="center" prop="status" >
+       <el-table-column label="支付状态" align="center" prop="status" >
         <template slot-scope="scope">
               <el-tag prop="status" v-for="(item, index) in statusOptions"  :type="scope.row.status==1?'success':'danger'"  v-if="scope.row.status==item.dictValue">{{item.dictLabel}}</el-tag>
         </template>
@@ -76,6 +81,18 @@
           <span>{{ parseTime(scope.row.payTime) }}</span>
         </template>
       </el-table-column>
+      <el-table-column label="审核状态" align="center" prop="isAudit" >
+        <template slot-scope="scope">
+          <el-tag prop="isAudit" type="danger"  v-if="scope.row.isAudit === -1">已驳回</el-tag>
+          <el-tag prop="isAudit" type="warning"  v-if="scope.row.isAudit === 0">待审核</el-tag>
+          <el-tag prop="isAudit" type="success"  v-if="scope.row.isAudit === 1">已审核</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="审核时间" align="center" prop="auditTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.auditTime) }}</span>
+        </template>
+      </el-table-column>
     </el-table>
     <pagination
       v-show="total>0"
@@ -116,12 +133,38 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
+
+    <!-- 充值对话框 -->
+    <el-dialog :title="recharge.title" :visible.sync="recharge.open" width="500px" append-to-body>
+      <el-form ref="rechargeForm" :rules="rechargeRules" :model="rechargeForm"  label-width="80px">
+<!--        <el-form-item label="公司" >-->
+<!--          <el-input v-model="rechargeForm.companyName" disabled />-->
+<!--        </el-form-item>-->
+<!--        <el-form-item label="余额" >-->
+<!--          <el-input v-model="rechargeForm.balance" disabled />-->
+<!--        </el-form-item>-->
+        <el-form-item label="充值金额" prop="money">
+          <el-input-number v-model="rechargeForm.money" :min="0" placeholder="请输入充值金额" />
+        </el-form-item>
+        <el-form-item label="凭证" prop="imgs">
+          <image-upload v-model="rechargeForm.imgs" :limit="9" />
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="rechargeForm.remark" placeholder="请输入备注" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitRechargeForm">确 定</el-button>
+        <el-button @click="recharge.open=false">取 消</el-button>
+      </div>
+    </el-dialog>
+
   </div>
 </template>
 
 <script>
-import { listCompanyRecharge, getCompanyRecharge, delCompanyRecharge, addCompanyRecharge, updateCompanyRecharge, exportCompanyRecharge } from "@/api/company/companyRecharge";
-
+import { listCompanyRecharge, getCompanyRecharge, delCompanyRecharge, addCompanyRecharge, updateCompanyRecharge, exportCompanyRecharge, recharge } from "@/api/company/companyRecharge";
+import { getInfo } from '@/api/login';
 export default {
   name: "CompanyRecharge",
   data() {
@@ -162,7 +205,24 @@ export default {
       form: {},
       // 表单校验
       rules: {
-      }
+      },
+      recharge:{
+        open:false,
+        title:"后台充值"
+      },
+      // 表单校验
+      rechargeRules: {
+        money: [
+          { required: true, message: "充值金额不能为空", trigger: "blur" }
+        ],
+        imgs: [
+          { required: true, message: "凭证不能为空", trigger: "change" }
+        ],
+      },
+      // 表单参数
+      rechargeForm: {
+        money: 0,
+      },
     };
   },
   created() {
@@ -285,7 +345,31 @@ export default {
         }).then(response => {
           this.download(response.msg);
         }).catch(function() {});
-    }
+    },
+    /** 充值按钮操作 */
+    handleRecharge() {
+      this.rechargeForm = {
+        money: 0,
+        balance: 0, //默认余额为0
+        remark: '',
+        imgs: []
+      };
+      this.recharge.open = true;
+    },
+    /** 提交按钮 */
+    submitRechargeForm() {
+      this.$refs["rechargeForm"].validate(valid => {
+        if (valid) {
+          recharge(this.rechargeForm).then(response => {
+            if (response.code === 200) {
+              this.msgSuccess(response.msg);
+              this.recharge.open = false;
+              this.getList();
+            }
+          });
+        }
+      });
+    },
   }
 };
 </script>

+ 43 - 26
src/views/course/courseRedPacketLog/index.vue

@@ -62,17 +62,17 @@
     </el-form>
 
     <el-row :gutter="10" class="mb8">
-<!--      <el-col :span="1.5">-->
-<!--        <el-button-->
-<!--          type="warning"-->
-<!--          plain-->
-<!--          icon="el-icon-download"-->
-<!--          size="mini"-->
-<!--          :loading="exportLoading"-->
-<!--          @click="handleExport"-->
-<!--          v-hasPermi="['course:courseRedPacketLog:export']"-->
-<!--        >导出</el-button>-->
-<!--      </el-col>-->
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['course:courseRedPacketLog:export']"
+        >导出</el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
     <el-tabs type="card" v-model="activeName" @tab-click="handleClick">
@@ -160,7 +160,7 @@ export default {
       // 遮罩层
       loading: true,
       // 导出遮罩层
-      // exportLoading: false,
+      exportLoading: false,
       // 选中数组
       ids: [],
       // 非单个禁用
@@ -353,20 +353,37 @@ export default {
 	  });
 	},
     /** 导出按钮操作 */
-    // handleExport() {
-    //   const queryParams = this.queryParams;
-    //   this.$confirm('是否确认导出所有短链课程看课记录数据项?', "警告", {
-    //       confirmButtonText: "确定",
-    //       cancelButtonText: "取消",
-    //       type: "warning"
-    //     }).then(() => {
-    //       this.exportLoading = true;
-    //       return exportCourseRedPacketLog(queryParams);
-    //     }).then(response => {
-    //       this.download(response.msg);
-    //       this.exportLoading = false;
-    //     }).catch(() => {});
-    // }
+    handleExport() {
+      const queryParams = this.queryParams;
+
+      // 定义要排除的字段
+      const excludeFields = ['pageNum', 'pageSize']
+
+      // 检查除排除字段外是否有非null值
+      const hasQueryParams = Object.keys(queryParams).some(key => {
+        return !excludeFields.includes(key) && queryParams[key] !== null &&
+          queryParams[key] !== ''
+      })
+
+      if (!hasQueryParams) {
+        return this.$message.warning({
+          message: '导出失败,请选择至少一个查询条件再试!',
+          duration: 3000
+        })
+      }
+
+      this.$confirm('是否确认导出所有短链课程看课记录数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportCourseRedPacketLog(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
   }
 };
 </script>

+ 43 - 26
src/views/course/courseRedPacketLog/myCourseRedPacketLog.vue

@@ -52,17 +52,17 @@
     </el-form>
 
     <el-row :gutter="10" class="mb8">
-<!--      <el-col :span="1.5">-->
-<!--        <el-button-->
-<!--          type="warning"-->
-<!--          plain-->
-<!--          icon="el-icon-download"-->
-<!--          size="mini"-->
-<!--          :loading="exportLoading"-->
-<!--          @click="handleExport"-->
-<!--          v-hasPermi="['course:courseRedPacketLog:export']"-->
-<!--        >导出</el-button>-->
-<!--      </el-col>-->
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['course:courseRedPacketLog:export']"
+        >导出</el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
     <el-tabs type="card" v-model="activeName" @tab-click="handleClick">
@@ -149,7 +149,7 @@ export default {
       // 遮罩层
       loading: true,
       // 导出遮罩层
-      // exportLoading: false,
+      exportLoading: false,
       // 选中数组
       ids: [],
       // 非单个禁用
@@ -355,20 +355,37 @@ export default {
 	  });
 	},
     /** 导出按钮操作 */
-    // handleExport() {
-    //   const queryParams = this.queryParams;
-    //   this.$confirm('是否确认导出所有短链课程看课记录数据项?', "警告", {
-    //       confirmButtonText: "确定",
-    //       cancelButtonText: "取消",
-    //       type: "warning"
-    //     }).then(() => {
-    //       this.exportLoading = true;
-    //       return exportCourseRedPacketLog(queryParams);
-    //     }).then(response => {
-    //       this.download(response.msg);
-    //       this.exportLoading = false;
-    //     }).catch(() => {});
-    // }
+    handleExport() {
+      const queryParams = this.queryParams;
+
+      // 定义要排除的字段
+      const excludeFields = ['pageNum', 'pageSize']
+
+      // 检查除排除字段外是否有非null值
+      const hasQueryParams = Object.keys(queryParams).some(key => {
+        return !excludeFields.includes(key) && queryParams[key] !== null &&
+          queryParams[key] !== ''
+      })
+
+      if (!hasQueryParams) {
+        return this.$message.warning({
+          message: '导出失败,请选择至少一个查询条件再试!',
+          duration: 3000
+        })
+      }
+
+      this.$confirm('是否确认导出所有短链课程看课记录数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportCourseRedPacketLog(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
   }
 };
 </script>

+ 1 - 1
src/views/index.vue

@@ -54,7 +54,7 @@
               可用余额
             </div>
             <div class="card-value highlight">
-              <count-to :start-val="0" :end-val="balance" :duration="3600" class="card-panel-num" />
+              {{balance}}
             </div>
           </div>
         </el-col>