|
|
@@ -46,6 +46,13 @@
|
|
|
@click="handleRecharge"
|
|
|
v-hasPermi="['company:companyRecharge:Recharge']"
|
|
|
>充值</el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ @click="handleRedRecharge"
|
|
|
+ v-hasPermi="['company:companyRecharge:Recharge']"
|
|
|
+ >红包充值</el-button>
|
|
|
</el-col>
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
@@ -160,11 +167,33 @@
|
|
|
</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>
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listCompanyRecharge, getCompanyRecharge, delCompanyRecharge, addCompanyRecharge, updateCompanyRecharge, exportCompanyRecharge, recharge } from "@/api/company/companyRecharge";
|
|
|
+import { listCompanyRecharge, getCompanyRecharge, delCompanyRecharge, addCompanyRecharge, updateCompanyRecharge, exportCompanyRecharge, recharge, redRecharge, getCompanyRedPacketBalance } from "@/api/company/companyRecharge";
|
|
|
import { getInfo } from '@/api/login';
|
|
|
export default {
|
|
|
name: "CompanyRecharge",
|
|
|
@@ -224,6 +253,20 @@ export default {
|
|
|
rechargeForm: {
|
|
|
money: 0,
|
|
|
},
|
|
|
+ redSubmit: false,
|
|
|
+ // 红包充值表单参数
|
|
|
+ redRechargeForm: {
|
|
|
+ money: 0
|
|
|
+ },
|
|
|
+ redRecharge: {
|
|
|
+ open: false,
|
|
|
+ title: '红包充值'
|
|
|
+ },
|
|
|
+ redRechargeRules: {
|
|
|
+ money: [
|
|
|
+ { required: true, message: '扣款金额不能为空', trigger: 'blur' }
|
|
|
+ ]
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
@@ -320,6 +363,22 @@ 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()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
|
const rechargeIds = row.rechargeId || this.ids;
|
|
|
@@ -357,6 +416,20 @@ export default {
|
|
|
};
|
|
|
this.recharge.open = true;
|
|
|
},
|
|
|
+ /** 红包充值按钮*/
|
|
|
+ handleRedRecharge(){
|
|
|
+ getCompanyRedPacketBalance().then(response => {
|
|
|
+ console.log(response.data);
|
|
|
+ const data = response.data;
|
|
|
+ this.redSubmit=false
|
|
|
+ this.redRechargeForm.companyId = data.companyId
|
|
|
+ this.redRechargeForm.companyName = data.companyName
|
|
|
+ this.redRechargeForm.balance = data.redPackageMoney
|
|
|
+ this.redRechargeForm.money = null
|
|
|
+ this.redRecharge.open = true
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
/** 提交按钮 */
|
|
|
submitRechargeForm() {
|
|
|
this.$refs["rechargeForm"].validate(valid => {
|