111
This commit is contained in:
parent
4ee5a0fe42
commit
1babcd6ff2
|
@ -4,5 +4,5 @@ ENV = 'production'
|
|||
# base api
|
||||
# VUE_APP_BASE_API = '/prod-api'
|
||||
# VUE_APP_BASE_API = 'http://106.75.49.247:20400'
|
||||
# VUE_APP_BASE_API = 'https://yruibao.com/admin'
|
||||
VUE_APP_BASE_API = 'http://192.168.2.5:20401'
|
||||
VUE_APP_BASE_API = 'https://yruibao.com/admin'
|
||||
# VUE_APP_BASE_API = 'http://192.168.2.5:20401'
|
||||
|
|
|
@ -15,7 +15,16 @@ export function DelInstallments(id) {
|
|||
params: data,
|
||||
});
|
||||
}
|
||||
|
||||
export function DelInstallmentschild(id) {
|
||||
const data = {
|
||||
id: id,
|
||||
};
|
||||
return request({
|
||||
url: '/admin/customInstallmentsDetail/delete',
|
||||
method: 'GET',
|
||||
params: data,
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 商品分期配置表详情
|
||||
* @param id
|
||||
|
@ -77,9 +86,9 @@ export function AddInstallments(pram) {
|
|||
export function AddInstallmentsDetail(pram) {
|
||||
const data = {
|
||||
installmentsId: pram.id,
|
||||
installmentNumber: pram.installmentNumber,
|
||||
intervalCycle: pram.intervalCycle,
|
||||
repaymentPercent: pram.repaymentPercent,
|
||||
repaymentDeadlineStr: pram.repaymentDeadlineStr,
|
||||
// repaymentDeadlineStr: pram.repaymentDeadlineStr,
|
||||
};
|
||||
return request({
|
||||
url: '/admin/customInstallmentsDetail/save',
|
||||
|
@ -105,3 +114,17 @@ export function UpdateInstallments(pram) {
|
|||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
export function UpdateInstallmentschild(pram) {
|
||||
const data = {
|
||||
installmentsId: pram.id,
|
||||
intervalCycle: pram.intervalCycle,
|
||||
repaymentPercent: pram.repaymentPercent,
|
||||
};
|
||||
return request({
|
||||
url: '/admin/customInstallmentsDetail/update',
|
||||
method: 'post',
|
||||
params: { id: pram.id },
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
|
|
@ -33,7 +33,8 @@
|
|||
<el-table-column prop="address" label=" 总点击/总转化/总注册/回款率/" min-width="80">
|
||||
<template slot-scope="scope">
|
||||
<div class="cont" style="display: flex;flex-wrap: nowrap;justify-content: center;">
|
||||
{{ scope.row.totalClickNum }}/ {{ scope.row.totalConversionRatio }} / {{ scope.row.totalRegisterNum }}/ {{ scope.row.totalReturnRate }}
|
||||
{{ scope.row.totalClickNum }}/ {{ scope.row.totalConversionRatio }} / {{ scope.row.totalRegisterNum }}/ {{
|
||||
scope.row.totalReturnRate }}
|
||||
|
||||
|
||||
</div>
|
||||
|
@ -103,23 +104,34 @@
|
|||
</el-table>
|
||||
<el-dialog title="" :visible.sync="dialogVisibles" width="1388px" :before-close="handleClose">
|
||||
<div class="detailbox">
|
||||
<div class="tit"> <span :class="titindex==0?'act1':''" style="margin-right: 10px;" @click="titindex=0">统计报表</span> <span :class="titindex==1?'act1':''" @click="titindex=1"> 注册用户</span> </div>
|
||||
<div class="tit"> <span :class="titindex == 0 ? 'act1' : ''" style="margin-right: 10px;"
|
||||
@click="titindex = 0">统计报表</span>
|
||||
<span :class="titindex == 1 ? 'act1' : ''" @click="titindex = 1"> 注册用户</span>
|
||||
</div>
|
||||
<div class="tj" v-show="titindex == 0">
|
||||
<div class="mintit">基础信息</div>
|
||||
<div class="infobox">
|
||||
<div class="img_box" style="right: 100px;">
|
||||
<!-- <canvas ref="qrcodeCanvas"></canvas> -->
|
||||
<!-- <div id="payQrcode"></div> -->
|
||||
<div class="img_box" style="right: 70px;">
|
||||
|
||||
|
||||
<div id="qrcodes" ref="qrcodes" style="margin-bottom: 20px;"></div>
|
||||
<div class="tits" style="width: 60px;text-align: center;font-size: 12px;margin-bottom: 10px;">h5</div>
|
||||
<el-button type="primary" @click="downloadimg()" style="margin-left: 0px;">下载</el-button>
|
||||
</div>
|
||||
<div class="img_box" style="right: 150px;">
|
||||
|
||||
|
||||
<div id="qrcode" ref="qrcode" style="margin-bottom: 20px;"></div>
|
||||
<el-button type="primary" @click="downloadimg()" style="margin-left: 0px;" >下载图片</el-button>
|
||||
<div class="tits" style="width: 60px;text-align: center;font-size: 12px;margin-bottom: 10px;">微信小程序</div>
|
||||
<el-button type="primary" @click="downloadimgs()" style="margin-left: 0px;">下载</el-button>
|
||||
</div>
|
||||
<div class="img_box" style="right: -10px;">
|
||||
<!-- <canvas ref="qrcodeCanvas"></canvas> -->
|
||||
<!-- <div id="payQrcode"></div> -->
|
||||
|
||||
<img :src="chooselist.qrCodeUrlCircleBlue" alt="" style="margin-bottom: 20px;">
|
||||
<el-button type="primary" @click="downloadImage(chooselist.qrCodeUrlCircleBlue)" style="margin-left: 0px;" >下载图片</el-button>
|
||||
|
||||
<img :src="chooselist.qrCodeUrlCircleBlue" alt="" style="margin-bottom: 20px;width: 60px;height: 60px;">
|
||||
<div class="tits" style="width: 60px;text-align: center;font-size: 12px;margin-bottom: 10px;">ali小程序</div>
|
||||
<el-button type="primary" @click="downloadImage(chooselist.qrCodeUrlCircleBlue)"
|
||||
style="margin-left: 0px;width: 60px;font-size: 12px;">下载</el-button>
|
||||
</div>
|
||||
<div class="infoli">
|
||||
<div class="li">渠道名称:{{ chooselist.name }} </div>
|
||||
|
@ -199,8 +211,8 @@
|
|||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination :page-sizes="[10, 15,]" :page-size="tableFrom.limit" :current-page="tableFrom.page"
|
||||
layout="total, sizes, prev, pager, next, jumper" :total="userdata.total" @size-change="userhandleSizeChange"
|
||||
@current-change="userpageChange" />
|
||||
layout="total, sizes, prev, pager, next, jumper" :total="userdata.total"
|
||||
@size-change="userhandleSizeChange" @current-change="userpageChange" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -290,6 +302,14 @@ export default {
|
|||
render: qRender,
|
||||
});
|
||||
},
|
||||
qrcodes(qWidth, qHeight, qText, qRender) {
|
||||
new QRCode("qrcodes", {
|
||||
width: qWidth,
|
||||
height: qHeight,
|
||||
text: qText,
|
||||
render: qRender,
|
||||
});
|
||||
},
|
||||
async downloadImage(imageUrl) {
|
||||
try {
|
||||
const response = await fetch(imageUrl);
|
||||
|
@ -322,6 +342,22 @@ export default {
|
|||
console.error("无法找到二维码画布。");
|
||||
}
|
||||
},
|
||||
downloadimgs() {
|
||||
// 获取生成二维码的canvas元素
|
||||
const canvas = document.querySelector("#qrcodes canvas");
|
||||
if (canvas) {
|
||||
// 创建一个临时的a元素
|
||||
const link = document.createElement('a');
|
||||
// 将canvas的内容转换为图片的DataURL
|
||||
link.href = canvas.toDataURL("image/png");
|
||||
// 设置下载的文件名
|
||||
link.download = 'qrcode.png';
|
||||
// 模拟点击下载
|
||||
link.click();
|
||||
} else {
|
||||
console.error("无法找到二维码画布。");
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
@ -407,9 +443,14 @@ export default {
|
|||
// await this.generateQRCode(row.url)
|
||||
if (this.$refs.qrcode) this.$refs.qrcode.innerHTML = "";
|
||||
this.$nextTick(function () {
|
||||
this.qrcode(100, 100, row.url, "canvas");
|
||||
this.qrcode(60, 60, row.url, "canvas");
|
||||
console.log(QRCode.CorrectLevel.L);
|
||||
});
|
||||
this.$nextTick(function () {
|
||||
this.qrcodes(60, 60, row.wxurl, "canvas");
|
||||
console.log(QRCode.CorrectLevel.L);
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
formatPercentage(value) {
|
||||
|
@ -535,6 +576,7 @@ export default {
|
|||
font-size: 20px;
|
||||
font-variation-settings: "opsz" auto;
|
||||
cursor: pointer;
|
||||
|
||||
.act1 {
|
||||
font-weight: 700;
|
||||
font-size: 25px;
|
||||
|
@ -555,17 +597,20 @@ export default {
|
|||
margin: 5px auto;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.img_box {
|
||||
right: 70px;
|
||||
position: absolute;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
|
||||
img {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
// background-color: red;
|
||||
}
|
||||
}
|
||||
|
||||
.infoli {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
|
|
|
@ -6,12 +6,12 @@
|
|||
width="500px"
|
||||
:before-close="handleClose">
|
||||
<el-form :model="user" :rules="rules" ref="user" label-width="100px" class="demo-ruleForm" v-loading="loading">
|
||||
<el-form-item label="第几期" >
|
||||
<el-select v-model="user.installmentNumber" placeholder="请选择" style="width: 20%">
|
||||
<el-form-item label="间隔时间" >
|
||||
<el-select v-model="user.intervalCycle" placeholder="请选择" style="width: 40%">
|
||||
<el-option v-for="item in installmentNumberTreeData" :key="item" :label="item" :value="item">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<span>期</span>
|
||||
<span>天</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="还款比例(%)" >
|
||||
<el-input-number style="width: 50%;float: left"
|
||||
|
@ -23,9 +23,9 @@
|
|||
/>
|
||||
<span class="el-input-group__append">%</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="还款时间" prop="repaymentDeadlineStr">
|
||||
<!-- <el-form-item label="还款时间" prop="repaymentDeadlineStr">
|
||||
<el-date-picker v-model="user.repaymentDeadlineStr" type="date" placeholder="选择日期" />
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="分期提示" prop="tips">-->
|
||||
<!-- <el-input v-model="user.tips" placeholder="请输入分期提示"></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
|
@ -62,7 +62,7 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
detailVisible: false,
|
||||
installmentNumberTreeData: [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18],
|
||||
installmentNumberTreeData: [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30],
|
||||
formValidate: Object.assign({}, obj),
|
||||
loading: false,
|
||||
rules: {
|
||||
|
|
|
@ -2,57 +2,75 @@
|
|||
<div class="divBox">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<el-button type="primary" class="mr10" @click="add" size="small" v-hasPermi="['admin:setting:save']"
|
||||
>添加套餐</el-button>
|
||||
<el-button type="primary" class="mr10" @click="add" size="small"
|
||||
v-hasPermi="['admin:setting:save']">添加套餐</el-button>
|
||||
</div>
|
||||
|
||||
<el-table v-loading="listLoading" :data="listData.list" style="width: 100%" size="mini">
|
||||
<el-table-column prop="id" label="ID" min-width="50" />
|
||||
<el-table-column prop="name" label="分期套餐名称" min-width="100" />
|
||||
<el-table-column prop="tips" label="提示内容" min-width="100" />
|
||||
<el-table v-loading="listLoading" :data="listData.list" style="width: 100%" size="mini" row-key="name"
|
||||
:tree-props="{ children: 'child', hasChildren: 'hasChildren' }">
|
||||
<!-- <el-table-column prop="id" label="ID" min-width="50" /> -->
|
||||
<el-table-column prop="name" label="分期套餐名称" min-width="100" align="center" />
|
||||
<el-table-column prop="tips" label="提示内容" min-width="100" align="center" />
|
||||
<el-table-column prop="intervalCycle" label="间隔时间" min-width="100" align="center" />
|
||||
<el-table-column prop="installmentNumber" label="期数" min-width="100" align="center" />
|
||||
<el-table-column prop="repaymentPercent" label="还款比例(%)" min-width="100" align="center" />
|
||||
<!-- <el-table-column prop="repaymentDeadline" label="还款时间" min-width="100" align="center" /> -->
|
||||
<el-table-column label="操作" min-width="120" fixed="right" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="addDetail(scope.row)"
|
||||
class="mr10"
|
||||
:disabled="scope.row.pid > 0"
|
||||
>添加自定义账单</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="edit(scope.row)"
|
||||
class="mr10"
|
||||
v-hasPermi="['admin:setting:update']"
|
||||
>编辑</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="handleDelete(scope.row.id, scope.$index)"
|
||||
v-hasPermi="['admin:setting:delete']"
|
||||
>删除</el-button>
|
||||
<el-button v-if="scope.row.tips" type="text" size="small" @click="addDetail(scope.row)" class="mr10"
|
||||
:disabled="scope.row.pid > 0">添加自定义账单</el-button>
|
||||
<el-button v-if="scope.row.tips" type="text" size="small" @click="edit(scope.row)" class="mr10"
|
||||
v-hasPermi="['admin:setting:update']">编辑</el-button>
|
||||
<el-button v-if="scope.row.tips" type="text" size="small" @click="handleDelete(scope.row.id, scope.$index)"
|
||||
v-hasPermi="['admin:setting:delete']">删除</el-button>
|
||||
<el-button v-if="scope.row.installmentNumber" type="text" size="small"
|
||||
@click="handleDeletechild(scope.row.id, scope.$index)"
|
||||
v-hasPermi="['admin:setting:delete']">删除</el-button>
|
||||
<el-button v-if="scope.row.installmentNumber" type="text" size="small"
|
||||
@click="changechild(scope.row)" v-hasPermi="['admin:setting:delete']">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block mb20">
|
||||
<el-pagination
|
||||
:current-page="listPram.page"
|
||||
:page-sizes="constants.page.limit"
|
||||
:layout="constants.page.layout"
|
||||
:total="listData.total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
<el-pagination :current-page="listPram.page" :page-sizes="constants.page.limit" :layout="constants.page.layout"
|
||||
:total="listData.total" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
|
||||
</div>
|
||||
</el-card>
|
||||
<creat-setting ref="grades" :user="userInfo"></creat-setting>
|
||||
<creat-detail ref="grades1" :user="detailInfo"></creat-detail>
|
||||
<el-dialog v-if="detailVisible" title="添加自定义账单" :visible.sync="detailVisible" width="500px"
|
||||
:before-close="handleClose">
|
||||
<el-form :rules="rules" label-width="100px" class="demo-ruleForm" v-loading="loading">
|
||||
<el-form-item label="间隔时间">
|
||||
<el-select v-model="user.intervalCycle" placeholder="请选择" style="width: 40%">
|
||||
<el-option v-for="item in installmentNumberTreeData" :key="item" :label="item" :value="item">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<span>天</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="还款比例(%)">
|
||||
<el-input-number style="width: 50%;float: left" v-model="user.repaymentPercent" :min="0" :step="1"
|
||||
step-strictly placeholder="请输入还款比例" />
|
||||
<span class="el-input-group__append">%</span>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="还款时间" prop="repaymentDeadlineStr">
|
||||
<el-date-picker v-model="user.repaymentDeadline" type="date" placeholder="选择日期" />
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="分期提示" prop="tips">-->
|
||||
<!-- <el-input v-model="user.tips" placeholder="请输入分期提示"></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="resetForm('user')">取 消</el-button>
|
||||
<el-button type="primary" @click="submitForm('formValidate')"
|
||||
v-hasPermi="['admin:setting:update', 'admin:setting:save']">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ListInstallments,UpdateInstallments,DelInstallments} from '@/api/systemInstallment';
|
||||
import { ListInstallments, UpdateInstallments, DelInstallments, DelInstallmentschild,UpdateInstallmentschild } from '@/api/systemInstallment';
|
||||
import creatSetting from './creatSetting';
|
||||
import creatDetail from './creatDetail';
|
||||
import { checkPermi } from '@/utils/permission'; // 权限判断函数
|
||||
|
@ -86,6 +104,15 @@ export default {
|
|||
data: [],
|
||||
total: 0,
|
||||
},
|
||||
detailVisible:false,
|
||||
user:{},
|
||||
loading: false,
|
||||
installmentNumberTreeData: [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30],
|
||||
rules: {
|
||||
name: [{ required: true, message: '请输入分期套餐名称', trigger: 'blur' }],
|
||||
},
|
||||
// detailVisible: false,
|
||||
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
@ -100,6 +127,10 @@ export default {
|
|||
return (value * 100).toFixed(2) + '%';
|
||||
}
|
||||
},
|
||||
handleClose() {
|
||||
this.detailVisible = false;
|
||||
// this.user = Object.assign({}, '')
|
||||
},
|
||||
formatNumber(value) {
|
||||
if (value == 0) {
|
||||
return "-";
|
||||
|
@ -107,6 +138,13 @@ export default {
|
|||
return value + "期";
|
||||
}
|
||||
},
|
||||
resetForm(formName) {
|
||||
this.detailVisible = false;
|
||||
// this[formName] = {};
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.formData.resetFields();
|
||||
// })
|
||||
},
|
||||
checkPermi,
|
||||
seachList() {
|
||||
this.getList();
|
||||
|
@ -125,6 +163,10 @@ export default {
|
|||
this.userInfo = user;
|
||||
this.$refs.grades.dialogVisible = true;
|
||||
},
|
||||
changechild(item){
|
||||
this.user=item
|
||||
this.detailVisible=true
|
||||
},
|
||||
// 列表
|
||||
getList() {
|
||||
this.listLoading = true;
|
||||
|
@ -146,6 +188,14 @@ export default {
|
|||
});
|
||||
});
|
||||
},
|
||||
handleDeletechild(id, idx) {
|
||||
this.$modalSure('删除吗?删除会导致对应分期套餐配置数据清空,请谨慎操作!').then(() => {
|
||||
DelInstallmentschild(id).then(() => {
|
||||
this.$message.success('删除成功');
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.listPram.limit = val;
|
||||
this.handlerGetListData(this.listPram);
|
||||
|
@ -154,6 +204,16 @@ export default {
|
|||
this.listPram.page = val;
|
||||
this.handlerGetListData(this.listPram);
|
||||
},
|
||||
submitForm() {
|
||||
UpdateInstallmentschild(this.user)
|
||||
.then((res) => {
|
||||
this.$message.success('修改成功');
|
||||
this.detailVisible = false;
|
||||
})
|
||||
.catch(() => {
|
||||
|
||||
});
|
||||
},
|
||||
onchangeIsShow(row) {
|
||||
if (row.isShow == false) {
|
||||
row.isShow = !row.isShow;
|
||||
|
@ -187,6 +247,7 @@ export default {
|
|||
.el-switch.is-disabled {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
::v-deep .el-switch__label {
|
||||
cursor: pointer !important;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user