Bladeren bron

Merge branch 'refs/heads/master_red_banlance_20251103'

# Conflicts:
#	src/views/his/company/index.vue
xgb 1 week geleden
bovenliggende
commit
26ab59cadd

+ 9 - 0
src/api/his/company.js

@@ -36,6 +36,15 @@ export function recharge(data) {
     data: data
   })
 }
+// 红包充值
+export function redRecharge(data) {
+  return request({
+    url: '/his/company/redRecharge',
+    method: 'post',
+    data: data
+  })
+}
+
 
 // 新增诊所管理
 export function addCompany(data) {

+ 69 - 0
src/views/his/company/index.vue

@@ -122,6 +122,7 @@
       </el-table-column>
 
       <el-table-column label="余额" align="center" prop="money"/>
+      <el-table-column label="红包余额" align="center" prop="redPackageMoney"/>
       <el-table-column label="企业类型" align="center" prop="companyType">
         <template slot-scope="scope">
           <dict-tag :options="companyTypeOptions" :value="scope.row.companyType"/>
@@ -179,6 +180,14 @@
             v-hasPermi="['his:company:recharge']"
           >充值
           </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleRedRecharge(scope.row)"
+            v-hasPermi="['his:company:redRecharge']"
+          >红包充值
+          </el-button>
           <el-button
             size="mini"
             type="text"
@@ -470,6 +479,27 @@
       </div>
     </el-dialog>
 
+    <el-dialog :title="redRecharge.title" :visible.sync="redRecharge.open" width="500px" append-to-body>
+      <el-form ref="redRechargeForm" :rules="redRechargeRules" :model="redRechargeForm" label-width="80px">
+        <el-form-item label="公司">
+          <el-input v-model="redRechargeForm.companyName" disabled/>
+        </el-form-item>
+        <el-form-item label="余额">
+          <el-input v-model="redRechargeForm.balance" disabled/>
+        </el-form-item>
+        <el-form-item label="充值金额" prop="money">
+          <el-input-number v-model="redRechargeForm.money" :min="0.01" placeholder="请输入充值金额"/>
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="redRechargeForm.remark" placeholder="请输入备注"/>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitRedRechargeForm" :disabled="redSubmit">确 定</el-button>
+        <el-button @click="redRecharge.open=false">取 消</el-button>
+      </div>
+    </el-dialog>
+
     <el-dialog :title="deduct.title" :visible.sync="deduct.open" width="500px" append-to-body>
       <el-form ref="deductForm" :rules="deductRules" :model="deductForm" label-width="80px">
         <el-form-item label="公司">
@@ -657,6 +687,7 @@ import {
   addCompany,
   updateCompany,
   recharge,
+  redRecharge,
   deduct,
   exportCompany,
   resetPwd,
@@ -676,6 +707,7 @@ export default {
   name: 'Company',
   data() {
     return {
+      redSubmit: false,
       //分账参数
       revenue:{
           open: false,
@@ -694,6 +726,10 @@ export default {
         open: false,
         title: '后台充值'
       },
+      redRecharge: {
+        open: false,
+        title: '红包充值'
+      },
       // 遮罩层
       loading: true,
       // 导出遮罩层
@@ -736,6 +772,10 @@ export default {
       rechargeForm: {
         money: 0
       },
+      // 红包充值表单参数
+      redRechargeForm: {
+        money: 0
+      },
       followDoctorList: [],
       cateList: [],
       // 表单参数
@@ -812,6 +852,11 @@ export default {
           { required: true, message: '扣款金额不能为空', trigger: 'blur' }
         ]
       },
+      redRechargeRules: {
+        money: [
+          { required: true, message: '扣款金额不能为空', trigger: 'blur' }
+        ]
+      },
       deduct: {
         open: false,
         title: '后台扣款'
@@ -910,6 +955,15 @@ export default {
       this.rechargeForm.money = null
       this.recharge.open = true
     },
+    // 红包充值
+    handleRedRecharge(row) {
+      this.redSubmit=false
+      this.redRechargeForm.companyId = row.companyId
+      this.redRechargeForm.companyName = row.companyName
+      this.redRechargeForm.balance = row.money
+      this.redRechargeForm.money = null
+      this.redRecharge.open = true
+    },
     handleDeduct(row) {
       const companyId = row.companyId
       this.deductForm.companyId = row.companyId
@@ -932,6 +986,21 @@ export default {
         }
       })
     },
+    /** 红包充值提交按钮 */
+    submitRedRechargeForm() {
+      this.$refs['redRechargeForm'].validate(valid => {
+        if (valid) {
+          this.redSubmit=true
+          redRecharge(this.redRechargeForm).then(response => {
+            if (response.code === 200) {
+              this.msgSuccess(response.msg)
+              this.redRecharge.open = false
+              this.getList()
+            }
+          })
+        }
+      })
+    },
     submitRevenueForm(){
       var param = this.revenueForm;
       console.log("--------------",param)

+ 22 - 0
src/views/his/companyRecharge/index.vue

@@ -29,6 +29,16 @@
           />
         </el-select>
       </el-form-item>
+      <el-form-item label="业务类型" prop="businessType">
+        <el-select v-model="queryParams.businessType" placeholder="请选择支付类型" clearable size="small">
+          <el-option
+            v-for="dict in businessTypeOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
       <el-form-item label="状态" prop="status">
         <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
           <el-option
@@ -90,6 +100,11 @@
           <dict-tag :options="payTypeOptions" :value="scope.row.payType"/>
         </template>
       </el-table-column>
+      <el-table-column label="业务类型" align="center" prop="businessType">
+        <template slot-scope="scope">
+          <dict-tag :options="businessTypeOptions" :value="scope.row.businessType"/>
+        </template>
+      </el-table-column>
       <el-table-column label="审核状态" align="center" prop="isAudit">
         <template slot-scope="scope">
           <dict-tag :options="isAuditOptions" :value="scope.row.isAudit"/>
@@ -182,6 +197,8 @@ export default {
       statusOptions: [],
       // 支付类型 1微信 2支付宝 3人工转账字典
       payTypeOptions: [],
+      // 业务类型 0-普通 1-红包充值
+      businessTypeOptions:[],
       // 审核状态 0待审核 1已审核字典
       isAuditOptions: [],
       // 查询参数
@@ -193,6 +210,7 @@ export default {
         status: null,
         payType: null,
         isAudit: 0,
+        businessType:null, // 业务类型
       },
       // 表单参数
       form: {},
@@ -215,6 +233,9 @@ export default {
     this.getDicts("sys_company_isaudit").then(response => {
       this.isAuditOptions = response.data;
     });
+    this.getDicts("sys_company_pay_business_type").then(response => {
+      this.businessTypeOptions = response.data;
+    });
   },
   methods: {
     /** 查询充值管理列表 */
@@ -264,6 +285,7 @@ export default {
     /** 重置按钮操作 */
     resetQuery() {
       this.resetForm("queryForm");
+      this.queryParams.businessType=null;
       this.handleQuery();
     },
     // 多选框选中数据

+ 9 - 0
src/views/system/config/config.vue

@@ -1241,6 +1241,15 @@
           </el-form-item>
 
 
+          <!--   红包余额是否扣减开关      -->
+          <el-form-item label="红包余额是否扣减开关">
+            <el-radio-group v-model="form18.isRedPackageBalanceDeduction">
+              <el-radio label="1">开</el-radio>
+              <el-radio label="0">关</el-radio>
+            </el-radio-group>
+          </el-form-item>
+
+
           <el-form-item label="禁止发送时间段">
             <el-row v-for="(item, index) in form18.disabledTimeList" style="margin-top: 10px">
               <el-time-picker