增加风控报告接口,合同功能(未完成)

This commit is contained in:
邱贞招 2024-01-27 16:48:46 +08:00
parent 3c35adb294
commit ab709263df
12 changed files with 425 additions and 18 deletions

View File

@ -3,7 +3,7 @@ ENV = 'development'
# base api
# VUE_APP_BASE_API = '/dev-api'
VUE_APP_BASE_API = 'http://127.0.0.1:8080'
VUE_APP_BASE_API = 'http://117.50.215.20:20400'
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
# to control whether the babel-plugin-dynamic-import-node plugin is enabled.

View File

@ -3,5 +3,5 @@ ENV = 'production'
# base api
# VUE_APP_BASE_API = '/prod-api'
VUE_APP_BASE_API = 'http://117.50.184.218:20400'
VUE_APP_BASE_API = 'http://106.75.49.247:20400'

View File

@ -108,6 +108,30 @@ export function getIdentityInfo(params) {
});
}
/**
* 获取天狼星报告
* @param pram
*/
export function getTlxReport(params) {
return request({
url: `/admin/user/tlxReport`,
method: 'get',
params,
});
}
/**
* 获取紫微星报告
* @param pram
*/
export function getZwxReport(params) {
return request({
url: `/admin/user/zwxReport`,
method: 'get',
params,
});
}
/**
* 会员管理 批量设置分组
* @param pram

View File

@ -13,6 +13,7 @@ import Layout from '@/layout';
import storeRouter from './modules/store';
import orderRouter from './modules/order';
import channelRouter from './modules/channel';
import contractRouter from './modules/contract';
import userRouter from './modules/user';
import distributionRouter from './modules/distribution';
import marketingRouter from './modules/marketing';
@ -59,6 +60,8 @@ export const constantRoutes = [
orderRouter,
//渠道
channelRouter,
//合同
contractRouter,
// 会员
userRouter,
// 分销

View File

@ -0,0 +1,23 @@
import Layout from '@/layout';
const contractRouter = {
path: '/contract',
component: Layout,
redirect: '/contract/index',
name: 'Contract',
alwaysShow: true,
meta: {
title: '合同',
icon: 'clipboard',
},
children: [
{
path: 'index',
component: () => import('@/views/contract/index'),
name: 'ContractIndex',
meta: { title: '合同' },
},
],
};
export default contractRouter;

View File

@ -0,0 +1,167 @@
<template>
<el-dialog
v-if="dialogVisible"
title="添加渠道"
:visible.sync="dialogVisible"
width="500px"
:before-close="handleClose"
>
<el-form :model="channelInfo" :rules="rules" ref="channelInfo" label-width="100px" class="demo-ruleForm" v-loading="loading">
<el-form-item label="渠道名称" prop="name">
<el-input v-model="channelInfo.name" placeholder="请输入渠道名称"></el-input>
</el-form-item>
<el-form-item label="链接" prop="url">
<el-input v-model="channelInfo.url" placeholder="请输入链接"></el-input>
</el-form-item>
<el-form-item label="单价(元)" >
<el-input-number style="width: 60%"
v-model="channelInfo.price"
:min="0"
:step="0.1"
step-strictly
placeholder="请输入单价"
class="selWidthd mr20"
/>
</el-form-item>
<el-form-item label="开关">
<el-switch
v-model="channelInfo.status"
active-text="打开"
inactive-text="关闭"
:active-value="true"
:inactive-value="false"
/>
</el-form-item>
<el-form-item label="备注:" prop="remark">
<el-input type="textarea" v-model="channelInfo.remark"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="resetForm('channelInfo')"> </el-button>
<el-button
type="primary"
@click="submitForm('formValidate')"
v-hasPermi="['admin:setting:update', 'admin:setting:save']"
> </el-button
>
</span>
</el-dialog>
</template>
<script>
import { AddChannel,UpdateChannel} from '@/api/channel';
import { Debounce } from '@/utils/validate';
const obj = {
name: '',
url: '',
price: '',
status: true,
remark: '',
id: null,
};
export default {
name: 'CreatChannel',
props: {
channelInfo: Object,
},
mounted() {
// console.log("channelInfo===="+JSON.stringify(this.channelInfo));
},
data() {
return {
dialogVisible: false,
formValidate: Object.assign({}, obj),
loading: false,
rules: {
name: [{ required: true, message: '请输入渠道名称', trigger: 'blur' }],
url: [{ required: true, message: '请输入链接', trigger: 'blur' }],
price: [{ type: 'number', message: '单价必须为数字值' }],
},
};
},
methods: {
formatPercentage(value) {
if(value == "0.00" || value == "0.0" || value == "0" || value == 0 || value == null){
return "-";
}else {
return (value * 100).toFixed(2) + '%';
}
},
// info(id) {
// this.loading = true;
// levelInfoApi({ id: id })
// .then((res) => {
// this.formValidate = res;
// this.loading = false;
// })
// .catch(() => {
// this.loading = false;
// });
// },
handleClose() {
this.dialogVisible = false;
// this.user = Object.assign({}, '')
},
submitForm: Debounce(function (formName) {
this.$refs.channelInfo.validate((valid) => {
if (valid) {
this.loading = true;
// debugger
// this.channelInfo.amountComesUp = (this.channelInfo.amountComesUpStr)/100;
// this.channelInfo.downPaymentPercent = (this.channelInfo.downPaymentPercentStr)/100;
console.log("----------- "+JSON.stringify(this.channelInfo));
let data = {
name: this.channelInfo.name,
url: this.channelInfo.url,
price: this.channelInfo.price,
status: this.channelInfo.status,
remark: this.channelInfo.remark,
id: this.channelInfo.id
};
this.channelInfo.id
? UpdateChannel(data)
.then((res) => {
this.$message.success('编辑成功');
this.loading = false;
this.handleClose();
this.formValidate = Object.assign({}, obj);
this.$parent.getList();
})
.catch(() => {
this.loading = false;
})
: AddChannel(this.channelInfo)
.then((res) => {
this.$message.success('添加成功');
this.loading = false;
this.handleClose();
this.formValidate = Object.assign({}, obj);
this.$parent.getList();
})
.catch(() => {
this.loading = false;
this.formValidate = Object.assign({}, obj);
});
} else {
return false;
}
});
}),
resetForm(formName) {
this.dialogVisible = false;
this[formName] = {};
// this.$nextTick(() => {
// this.$refs.formData.resetFields();
// })
},
},
};
</script>
<style scoped>
.el-input-number .el-input-group__append {
padding: 0 12px;
line-height: 36px;
border-left: 1px solid #dcdfe6;
}
</style>

View File

@ -0,0 +1,142 @@
<template>
<div class="divBox">
<creat-channel ref="grades" :channelInfo="channelInfo"></creat-channel>
</div>
</template>
<script>
import { ListChannel,AddChannel,UpdateChannel,InfoChannel,DelChannel} from '@/api/channel';
import creatChannel from './creatChannel';
import { checkPermi } from '@/utils/permission'; //
export default {
name: 'Channel',
filters: {
typeFilter(status) {
const statusMap = {
wechat: '微信用户',
routine: '小程序你用户',
h5: 'H5用户',
};
return statusMap[status];
},
},
components: { creatChannel },
data() {
return {
listLoading: true,
channelInfo: {},
constants: this.$constants,
listPram: {
productId: null,
productName: null,
page: 1,
limit: this.$constants.page.limit[0],
},
listData: { list: [], total: 0 },
tableData: {
data: [],
total: 0,
},
};
},
mounted() {
this.getList();
},
methods: {
formatPercentage(value) {
if(value == "0.00" || value == "0.0" || value == "0" || value == 0 || value == null){
return "-";
}else {
return (value * 100).toFixed(2) + '%';
}
},
formatNumber(value){
if(value == 0){
return "-";
}else {
return value + "期";
}
},
checkPermi,
seachList() {
this.getList();
},
add() {
this.$refs.grades.dialogVisible = true;
this.channelInfo = {status:true};
},
edit(channelInfo) {
// this.$refs.grades.info(id)
// user.amountComesUpStr = user.amountComesUp*100;
// user.downPaymentPercentStr = user.downPaymentPercent*100;
this.channelInfo = channelInfo;
this.$refs.grades.dialogVisible = true;
},
//
getList() {
this.listLoading = true;
ListChannel(this.listPram)
.then((res) => {
this.listData = res;
this.listLoading = false;
})
.catch(() => {
this.listLoading = false;
});
},
//
handleDelete(id, idx) {
this.$modalSure('删除吗?删除会导致对应渠道数据清空,请谨慎操作!').then(() => {
DelChannel(id).then(() => {
this.$message.success('删除成功');
this.getList();
});
});
},
handleSizeChange(val) {
this.listPram.limit = val;
this.handlerGetListData(this.listPram);
},
handleCurrentChange(val) {
this.listPram.page = val;
this.handlerGetListData(this.listPram);
},
onchangeIsShow(row) {
if (row.isShow == false) {
row.isShow = !row.isShow;
UpdateChannel({ id: row.id, isShow: row.isShow })
.then(() => {
this.$message.success('修改成功');
this.getList();
})
.catch(() => {
row.isShow = !row.isShow;
});
} else {
this.$modalSure('确定修改渠道状态吗?').then(() => {
row.isShow = !row.isShow;
// console.log("row-----------"+JSON.stringify(row))
UpdateChannel(row)
.then(() => {
this.$message.success('修改成功');
this.getList();
})
.catch(() => {
row.isShow = !row.isShow;
});
});
}
},
},
};
</script>
<style scoped lang="scss">
.el-switch.is-disabled {
opacity: 1;
}
::v-deep .el-switch__label {
cursor: pointer !important;
}
</style>

View File

@ -22,11 +22,17 @@
<el-radio-button label="audit"
>待审核 {{ '(' + orderChartType.audit ? orderChartType.audit : 0 + ')' }}</el-radio-button
>
<el-radio-button label="awaitSign"
>待签约 {{ '(' + orderChartType.awaitSign ? orderChartType.awaitSign : 0 + ')' }}</el-radio-button
>
<el-radio-button label="notShipped"
>未发货 {{ '(' + orderChartType.notShipped ? orderChartType.notShipped : 0 + ')' }}</el-radio-button
>
<el-radio-button label="spike"
>待收货 {{ '(' + orderChartType.spike ? orderChartType.spike : 0 + ')' }}</el-radio-button
<!-- <el-radio-button label="spike"-->
<!-- >待收货 {{ '(' + orderChartType.spike ? orderChartType.spike : 0 + ')' }}</el-radio-button-->
<!-- >-->
<el-radio-button label="inUse"
>使用中 {{ '(' + orderChartType.inUse ? orderChartType.inUse : 0 + ')' }}</el-radio-button
>
<el-radio-button label="bargain"
>待评价 {{ '(' + orderChartType.bargain ? orderChartType.bargain : 0 + ')' }}</el-radio-button
@ -199,7 +205,7 @@
</template>
</el-table-column>
<el-table-column prop="createTime" label="下单时间" min-width="150" v-if="checkedCities.includes('下单时间')" />
<el-table-column label="操作" min-width="150" fixed="right" align="center" :render-header="renderHeader">
<el-table-column label="操作" min-width="220" fixed="right" align="center" :render-header="renderHeader">
<template slot-scope="scope">
<el-button
v-if="scope.row.paid === false && !scope.row.isAlterPrice && checkPermi(['admin:order:update:price'])"
@ -217,6 +223,13 @@
class="mr10"
>审核</el-button
>
<!-- <el-button-->
<!-- v-if="scope.row.orderType == '[分期订单]' && scope.row.statusStr.key === 'audit'"-->
<!-- type="text"-->
<!-- size="small"-->
<!-- @click="userDetail(scope.row)"-->
<!-- class="mr10"-->
<!-- >用户详情</el-button>-->
<el-button
v-if="
scope.row.statusStr.key === 'notShipped' &&
@ -771,6 +784,16 @@ export default {
};
this.AuditVisible = true;
},
userDetail(row) {
console.log("----------"+JSON.stringify(row))
// this.orderids = row.orderId;
// this.AuditData = {
// orderId: row.orderId,
// audit: "pass",
// reason: ""
// };
// this.AuditVisible = true;
},
//
onOrderLog(id) {
this.tableFromLog.limit = 10;

View File

@ -28,8 +28,8 @@
/>
</el-form-item>
<el-form-item label="上浮比例(%)" >
<el-input style="width: 30%;float: left"
v-model="user.amountComesUpStr"
<el-input-number style="width: 50%;float: left"
v-model="user.amountComesUp"
:min="0"
:step="1"
step-strictly
@ -38,8 +38,8 @@
<span class="el-input-group__append">%</span>
</el-form-item>
<el-form-item label="首付比例(%)" >
<el-input style="width: 30%;float: left"
v-model="user.downPaymentPercentStr"
<el-input-number style="width: 50%;float: left"
v-model="user.downPaymentPercent"
:min="0"
:step="1"
step-strictly
@ -161,14 +161,14 @@ export default {
this.$refs.user.validate((valid) => {
if (valid) {
this.loading = true;
this.user.amountComesUp = (this.user.amountComesUpStr)/100;
this.user.downPaymentPercent = (this.user.downPaymentPercentStr)/100;
// this.user.amountComesUp = (this.user.amountComesUp)/100;
// this.user.downPaymentPercent = (this.user.downPaymentPercent)/100;
console.log("----------- "+JSON.stringify(this.user));
let data = {
name: this.user.name,
installmentNumber: this.user.installmentNumber,
amountComesUp: (this.user.amountComesUpStr)/100,
downPaymentPercent: (this.user.downPaymentPercentStr)/100,
// amountComesUp: (this.user.amountComesUp)/100,
// downPaymentPercent: (this.user.downPaymentPercent)/100,
downPaymentNumber: this.user.downPaymentNumber,
cycle: this.user.cycle,
id: this.user.id

View File

@ -122,9 +122,10 @@ export default {
this.userInfo = {};
},
edit(user) {
console.log(JSON.stringify(user))
// this.$refs.grades.info(id)
user.amountComesUpStr = user.amountComesUp*100;
user.downPaymentPercentStr = user.downPaymentPercent*100;
// user.amountComesUpStr = user.amountComesUp*100;
// user.downPaymentPercentStr = user.downPaymentPercent*100;
this.userInfo = user;
this.$refs.grades.dialogVisible = true;
},

View File

@ -514,11 +514,11 @@
</span>
</el-dialog>
<!--账户详情-->
<el-dialog title="用户详情" :visible.sync="Visible" width="1100px" v-if="Visible" :before-close="Close">
<el-dialog title="用户详情" :visible.sync="Visible" width="1600px" v-if="Visible" :before-close="Close">
<user-details ref="userDetails" :uid="uid" v-if="Visible"></user-details>
</el-dialog>
<!--身份信息-->
<el-dialog title="身份信息" :visible.sync="IdVisible" width="1100px" v-if="IdVisible" :before-close="Close">
<el-dialog title="身份信息" :visible.sync="IdVisible" width="1600px" v-if="IdVisible" :before-close="Close">
<user-identity ref="userIdentity" :uid="uid" v-if="IdVisible"></user-identity>
</el-dialog>
<!-- 用户等级 -->
@ -817,6 +817,7 @@ export default {
Close() {
this.Visible = false;
this.levelVisible = false;
this.IdVisible = false;
},
//
onDetails(id) {

View File

@ -29,11 +29,19 @@
</div>
</div>
</div>
<div v-if="identityInfo">
<el-button class="mr10" size="small" @click="tlxReport" type="primary" >获取天狼星报告</el-button>
<img :src="tlxReportUrl" alt="">
</div>
<div v-if="identityInfo">
<el-button class="mr10" size="small" @click="zwxReport" type="success" >获取紫微星报告</el-button>
<img :src="zwxReportUrl" alt="">
</div>
</div>
</template>
<script>
import { getIdentityInfo } from '@/api/user'
import { getIdentityInfo, getTlxReport, getZwxReport } from '@/api/user'
export default {
name: 'UserIdentity',
props: {
@ -46,6 +54,8 @@ export default {
return {
loading: false,
identityInfo: null,
tlxReportUrl: null,
zwxReportUrl: null,
};
},
mounted() {
@ -55,6 +65,19 @@ export default {
}
},
methods: {
tlxReport(){
console.log("获取天狼星报告")
getTlxReport({ userId: this.uid }).then((res) => {
// console.log("11111111111111111---------"+JSON.stringify(res))
this.tlxReportUrl = res.url;
});
},
zwxReport(){
console.log("获取紫微星报告")
getZwxReport({ userId: this.uid }).then((res) => {
this.zwxReportUrl = res.url;
});
},
getIdentityInfo(){
getIdentityInfo({ userId: this.uid }).then((res) => {
this.identityInfo = res;