Commit 15fc20d3 authored by caimeng's avatar caimeng

申请列表,公告,产品

parent d4aecbb4
......@@ -5,7 +5,7 @@ const theme = {
//布局种类 horizontal vertical gallery comprehensive common
layout: 'vertical',
//主题名称 default ocean green glory white
themeName: 'default',
themeName: 'glory',
//是否固定头部
fixedHeader: true,
//是否显示顶部进度条
......
......@@ -86,9 +86,7 @@ export const asyncRoutes = [
component: Layout,
redirect: '/merchant/list',
meta: {
title: '机构管理',
remixIcon: 'device-recover-line',
roles: ['admin'],
title: '机构管理'
},
children: [
{
......@@ -97,7 +95,7 @@ export const asyncRoutes = [
component: () => import('@/views/merchant/list'),
meta: {
title: '机构列表',
remixIcon: 'user-3-line',
remixIcon: 'building-line',
},
},
{
......@@ -105,8 +103,7 @@ export const asyncRoutes = [
name: 'MerchantNew',
component: () => import('@/views/merchant/new'),
meta: {
title: '新增机构',
remixIcon: 'shape-line',
title: '新增机构'
},
hidden:true
}
......@@ -114,13 +111,11 @@ export const asyncRoutes = [
},
{
path: '/prod',
name: 'Prod',
name: 'prod',
component: Layout,
redirect: '/prod/list',
meta: {
title: '产品列表',
remixIcon: 'line-chart-line',
roles: ['admin'],
title: '产品列表'
},
children: [
{
......@@ -129,7 +124,7 @@ export const asyncRoutes = [
component: () => import('@/views/prod/list'),
meta: {
title: '产品列表',
remixIcon: 'user-3-line',
remixIcon: 'product-hunt-line',
},
},
{
......@@ -137,8 +132,65 @@ export const asyncRoutes = [
name: 'ProdNew',
component: () => import('@/views/prod/new'),
meta: {
title: '产品新增',
remixIcon: 'admin-line',
title: '产品新增'
},
hidden: true
},
{
path: 'edit',
name: 'ProdEdit',
component: () => import('@/views/prod/edit'),
meta: {
title: '产品详情'
},
hidden: true
}
],
},
{
path: '/apply',
name: 'apply',
component: Layout,
redirect: '/apply/list',
meta: {
title: '申请管理'
},
children: [
{
path: 'list',
name: 'ApplyList',
component: () => import('@/views/apply/list'),
meta: {
title: '申请列表',
remixIcon: 'task-line'
},
}
],
},
{
path: '/notice',
name: 'notice',
component: Layout,
redirect: '/notice/list',
meta: {
title: '公告管理'
},
children: [
{
path: 'list',
name: 'NoticeList',
component: () => import('@/views/notice/list'),
meta: {
title: '公告列表',
remixIcon: 'notification-3-line'
},
},
{
path: 'new',
name: 'NoticeNew',
component: () => import('@/views/notice/new'),
meta: {
title: '公告新增'
},
hidden: true
}
......
......@@ -59,6 +59,14 @@ export default {
})
},
// 产品列表
merchant_select(params) {
return request({
url: '/macy/selectList',
method: 'get',
params,
})
},
// 产品列表
prod_list(data) {
return request({
url: '/macy/selectProductPageList',
......@@ -89,5 +97,37 @@ export default {
method: 'get',
params,
})
}
},
// 申请列表
apply_list(data) {
return request({
url: '/zeus/pageQueryApply',
method: 'post',
data,
})
},
// 推送
apply_push(params) {
return request({
url: '/zeus/applyRetryPush',
method: 'get',
params,
})
},
// 公告列表
notice_list(data) {
return request({
url: '/smgw/getBackPageList',
method: 'post',
data,
})
},
// 公告发送
notice_add(data) {
return request({
url: '/smgw/sendZnx',
method: 'post',
data,
})
},
}
......@@ -15,7 +15,7 @@ Object.keys(modules).forEach((key) => {
modules[key]['namespaced'] = true
})
console.log(modules, '结果')
//console.log(modules, '结果')
const store = new Vuex.Store({
modules,
......
......@@ -14,7 +14,7 @@ import { isArray } from '@/utils/validate'
const API_URL = process.env.VUE_APP_API_PATH;
console.log(API_URL,'是啥');
//console.log(API_URL,'是啥');
let loadingInstance
......
......@@ -20,7 +20,7 @@ VabProgress.configure({
showSpinner: false
});
console.log(router.getRoutes(), "路由信息");
//console.log(router.getRoutes(), "路由信息");
router.beforeEach(async (to, from, next) => {
const showProgressBar = store.getters["settings/showProgressBar"];
......
.merchant-new{
box-sizing: border-box;
padding: 20px;
}
.form-item{
width:500px;
margin-bottom: 24px !important;
}
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
width: 120px;
height: 120px;
line-height: 120px;
}
.avatar-uploader .el-upload:hover {
border-color: #409eff;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 120px;
height: 120px;
line-height: 120px;
text-align: center;
}
.avatar {
width: 120px;
height: 120px;
display: block;
}
//.el-input{
// width:200px;
//}
<template>
<div class="page-fence">
<!--搜索-->
<div class="search">
<el-form
label-suffix=":"
:inline="true"
:model="queryForm"
class="form-inline"
>
<el-form-item label="订单编号">
<el-input
v-model="queryForm.orderNo"
clearable
placeholder="请输入机构编号"
/>
</el-form-item>
<el-form-item label="用户姓名">
<el-input
v-model="queryForm.tenantNo"
clearable
placeholder="请输入机构名称"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
@click="onSubmit"
>
查询
</el-button>
</el-form-item>
</el-form>
</div>
<!--表格-->
<el-table
ref="tableSort"
v-loading="listLoading"
border
:data="list"
style="width: 100%"
>
<el-table-column
v-for="(item, index) in finallyColumns"
:key="index"
align="center"
:label="item.label"
:sortable="item.sortable"
:width="item.width"
:fixed="!!item.fixed"
:show-overflow-tooltip="!!item.overflow"
>
<template #default="{ row }">
<div v-if="item.label==='LOGO'">
<el-image
style="width: 50px; height: 35px"
:src="row[item.prop]"
fit="fit"
/>
</div>
<div v-else-if="item.label==='产品状态'">
<span>{{ row[item.prop]==="1"?'启用':'禁用' }}</span>
</div>
<span v-else>{{ row[item.prop] }}</span>
</template>
</el-table-column>
<el-table-column
fixed="right"
align="center"
label="操作"
>
<template #default="{ row }">
<el-button
type="text"
@click="handleView(row)"
>
详情
</el-button>
<el-button
type="text"
@click="handleView(row)"
>
推送
</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="queryForm.pageNo"
:layout="layout"
:page-size="queryForm.pageSize"
:total="total"
background
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
/>
</div>
</template>
<script>
import _ from "lodash";
import { doDelete, getList } from "@/api/table";
import API from "@/server/api";
export default {
name: "Fence",
data() {
return {
checkList: ["产品等级", "产品编号", "产品名称", "LOGO", "机构编号", "机构名称", "产品状态","对接方式","创建时间",],
columns: [
{
order: 1,
label: "产品等级",
prop: "gradeSort"
},
{
order: 2,
label: "产品编号",
prop: "appNo"
},
{
order: 3,
label: "产品名称",
prop: "appName"
},
{
order: 4,
label: "LOGO",
prop: "appLogo"
},
{
order: 5,
label: "机构编号",
prop: "tenantNo",
overflow: true
},
{
order: 6,
label: "机构名称",
prop: "loanLicenseUrl"
},
{
order: 7,
label: "产品状态",
prop: "status"
},
{
order: 8,
label: "对接方式",
prop: "abutmentWay"
},
{
order: 9,
width:170,
label: "创建时间",
prop: "gmtCreated"
}
],
list: [],
listLoading: true,
layout: "total, sizes, prev, pager, next, jumper",
total: 0,
queryForm: {
current: 1,
size: 10,
orderNo: ""
}
};
},
computed: {
finallyColumns() {
let finallyArray = [];
this.checkList.forEach((checkItem) => {
finallyArray.push(
this.columns.filter((item) => item.label === checkItem)[0]
);
});
//return _.sortBy(finallyArray, (item) => item.order);
return finallyArray;
}
},
created() {
//防止三级以上路由时多次走created
if (this.$route.name === this.$options.name) this.fetchData();
},
mounted() {
this.fetchData();
},
methods: {
onSubmit() {
this.fetchData();
},
handleView(row) {
const {appNo} = row;
this.$router.push({
path: '/prod/edit',
query: { appNo }
})
},
handleSizeChange(val) {
this.queryForm.size = val;
this.fetchData();
},
handleCurrentChange(val) {
this.queryForm.current = val;
this.fetchData();
},
handleQuery() {
this.queryForm.current = 1;
this.fetchData();
},
async fetchData() {
this.listLoading = true;
const result = await API.apply_list(this.queryForm);
const { records, total } = result.result;
this.list = records;
this.total = total;
this.listLoading = false;
}
}
};
</script>
<style lang="scss" scoped>
.page-fence {
::v-deep {
i {
cursor: pointer;
}
}
box-sizing: border-box;
padding: 20px;
}
</style>
<style lang="scss">
.custom-table-checkbox {
.el-checkbox {
display: block !important;
margin: 0 0 $base-padding/4 0;
}
}
.action-bar {
margin-bottom: 15px;
}
</style>
<template>
<div class="goods-list-container">
<el-alert
:closable="false"
title="本模块由开源爱好者维护,vue-admin-beautiful作者不提供物料市场插件技术支持,每一位开发者都可以联系作者提供优质的第三方插件,经过审核后可上线物料市场,价格由插件原作者制定,所得盈利80%归插件原作者所有。"
type="warning"
></el-alert>
<vab-query-form>
<vab-query-form-right-panel :span="24">
<el-form
ref="form"
:inline="true"
:model="queryForm"
@submit.native.prevent
>
<el-form-item>
<el-input v-model="queryForm.title" placeholder="请输入商品名称" />
</el-form-item>
<el-form-item>
<el-button
icon="el-icon-search"
native-type="submit"
type="primary"
@click="handleQuery"
>
查询
</el-button>
</el-form-item>
</el-form>
</vab-query-form-right-panel>
</vab-query-form>
<el-row :gutter="20">
<el-col
v-for="(item, index) in list"
:key="index"
:lg="8"
:md="8"
:sm="8"
:xl="6"
:xs="24"
>
<el-popover trigger="hover" width="300">
<div style="text-align: center">
<img alt="" src="@/assets/skm2.jpg" width="200px" />
<br />
付款后加QQ 1204505056 备注购买的物料名称 获取下载地址
</div>
<el-card
slot="reference"
:body-style="{ padding: '0px' }"
shadow="hover"
@click.native="handleBuy"
>
<div class="goods-list-card-body">
<div class="goods-list-tag-group">
<el-tag v-if="item.isRecommend" hit type="success">推荐</el-tag>
</div>
<div class="goods-list-image-group">
<div class="goods-list-image">
<vab-remix-icon :icon-class="item.icon"></vab-remix-icon>
</div>
</div>
<div class="goods-list-title">{{ item.title }}</div>
<div class="goods-list-price">
<el-tag hit type="warning">¥ {{ item.price }}</el-tag>
<el-tag hit>{{ item.type }}</el-tag>
</div>
</div>
</el-card>
</el-popover>
</el-col>
</el-row>
<el-pagination
:current-page="queryForm.pageNo"
:layout="layout"
:page-size="queryForm.pageSize"
:total="total"
background
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
></el-pagination>
</div>
</template>
<script>
import { getList } from '@/api/goods'
export default {
name: 'Goods',
components: {},
data() {
return {
queryForm: {
pageNo: 1,
pageSize: 20,
title: '',
},
list: [],
listLoading: true,
layout: 'total, sizes, prev, pager, next, jumper',
total: 0,
}
},
created() {
this.fetchData()
},
methods: {
handleBuy() {},
handleSizeChange(val) {
this.queryForm.pageSize = val
this.fetchData()
},
handleCurrentChange(val) {
this.queryForm.pageNo = val
this.fetchData()
},
handleQuery() {
this.queryForm.pageNo = 1
this.fetchData()
},
async fetchData() {
this.listLoading = true
const { data, totalCount } = await getList(this.queryForm)
this.list = data
this.total = totalCount
},
},
}
</script>
<style lang="scss" scoped>
.goods-list-container {
.goods-list-card-body {
position: relative;
padding: $base-padding;
cursor: pointer;
.goods-list-tag-group {
position: absolute;
top: 0;
right: 0;
z-index: 9;
padding: $base-padding * 1.5;
}
.goods-list-image-group {
height: 200px;
overflow: hidden;
.goods-list-image {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 200px;
background: linear-gradient(to right, #0f2027, #203a43, #2c5364);
transition: all ease-in-out 0.3s;
i {
font-size: 100px;
color: $base-color-white;
}
&:hover {
transform: scale(1.1);
}
}
}
.goods-list-title {
margin: $base-padding 0 8px 0;
font-size: 16px;
font-weight: bold;
}
.goods-list-price {
margin: 15px 0 0;
font-size: 14px;
color: $base-color-orange;
s {
color: #c5c8ce;
}
}
}
}
</style>
.merchant-new{
box-sizing: border-box;
padding: 20px;
}
.form-item{
width:500px;
margin-bottom: 24px !important;
}
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
width: 120px;
height: 120px;
line-height: 120px;
}
.avatar-uploader .el-upload:hover {
border-color: #409eff;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 120px;
height: 120px;
line-height: 120px;
text-align: center;
}
.avatar {
width: 120px;
height: 120px;
display: block;
}
//.el-input{
// width:200px;
//}
<template>
<div class="page-fence">
<!--操作菜单栏-->
<div
v-if="true"
class="action-bar"
>
<div class="action-bar-left">
<router-link to="/notice/new">
<el-button
type="primary"
size="mini"
>
发布公告
</el-button>
</router-link>
</div>
<div class="action-bar-right" />
</div>
<!--表格-->
<el-table
ref="tableSort"
v-loading="listLoading"
border
:data="list"
style="width: 100%"
>
<el-table-column
v-for="(item, index) in finallyColumns"
:key="index"
align="center"
:label="item.label"
:sortable="item.sortable"
:width="item.width"
:fixed="!!item.fixed"
:show-overflow-tooltip="!!item.overflow"
>
<template #default="{ row }">
<div v-if="item.label==='LOGO'">
<el-image
style="width: 50px; height: 35px"
:src="row[item.prop]"
fit="fit"
/>
</div>
<div v-else-if="item.label==='产品状态'">
<span>{{ row[item.prop]==="1"?'启用':'禁用' }}</span>
</div>
<span v-else>{{ row[item.prop] }}</span>
</template>
</el-table-column>
<el-table-column
fixed="right"
align="center"
label="操作"
>
<template #default="{ row }">
<el-button
type="text"
@click="handleView(row)"
>
详情
</el-button>
<el-button
type="text"
@click="handleView(row)"
>
推送
</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="queryForm.pageNo"
:layout="layout"
:page-size="queryForm.pageSize"
:total="total"
background
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
/>
</div>
</template>
<script>
import _ from "lodash";
import { doDelete, getList } from "@/api/table";
import API from "@/server/api";
export default {
name: "Fence",
data() {
return {
checkList: ["产品等级", "产品编号", "产品名称", "LOGO", "机构编号", "机构名称", "产品状态","对接方式","创建时间",],
columns: [
{
order: 1,
label: "产品等级",
prop: "gradeSort"
},
{
order: 2,
label: "产品编号",
prop: "appNo"
},
{
order: 3,
label: "产品名称",
prop: "appName"
},
{
order: 4,
label: "LOGO",
prop: "appLogo"
},
{
order: 5,
label: "机构编号",
prop: "tenantNo",
overflow: true
},
{
order: 6,
label: "机构名称",
prop: "loanLicenseUrl"
},
{
order: 7,
label: "产品状态",
prop: "status"
},
{
order: 8,
label: "对接方式",
prop: "abutmentWay"
},
{
order: 9,
width:170,
label: "创建时间",
prop: "gmtCreated"
}
],
list: [],
listLoading: true,
layout: "total, sizes, prev, pager, next, jumper",
total: 0,
queryForm: {
current: 1,
size: 10
}
};
},
computed: {
finallyColumns() {
let finallyArray = [];
this.checkList.forEach((checkItem) => {
finallyArray.push(
this.columns.filter((item) => item.label === checkItem)[0]
);
});
//return _.sortBy(finallyArray, (item) => item.order);
return finallyArray;
}
},
created() {
//防止三级以上路由时多次走created
if (this.$route.name === this.$options.name) this.fetchData();
},
mounted() {
this.fetchData();
},
methods: {
onSubmit() {
this.fetchData();
},
handleView(row) {
const {appNo} = row;
this.$router.push({
path: '/prod/edit',
query: { appNo }
})
},
handleSizeChange(val) {
this.queryForm.size = val;
this.fetchData();
},
handleCurrentChange(val) {
this.queryForm.current = val;
this.fetchData();
},
handleQuery() {
this.queryForm.current = 1;
this.fetchData();
},
async fetchData() {
this.listLoading = true;
const result = await API.notice_list(this.queryForm);
const { records, total } = result.result;
this.list = records;
this.total = total;
this.listLoading = false;
}
}
};
</script>
<style lang="scss" scoped>
.page-fence {
::v-deep {
i {
cursor: pointer;
}
}
box-sizing: border-box;
padding: 20px;
}
</style>
<style lang="scss">
.custom-table-checkbox {
.el-checkbox {
display: block !important;
margin: 0 0 $base-padding/4 0;
}
}
.action-bar {
margin-bottom: 15px;
}
</style>
<template>
<div class="merchant-new">
<el-form
ref="h5form"
label-suffix=":"
:rules="rules"
:model="form"
label-width="120px"
>
<block-header title="对接信息" />
<el-form-item
class="form-item"
label="对接机构"
>
<el-select
v-model="form.tenantNo"
placeholder="请选择"
>
<el-option
v-for="(item,index) in merchant"
:key="index"
:label="item.tenantName"
:value="item.tenantNo"
/>
</el-select>
</el-form-item>
<el-form-item
class="form-item"
label="对接方式"
>
<el-select
v-model="form.abutmentWay"
placeholder="请选择"
>
<el-option
label="API"
value="API"
/>
<el-option
label="H5"
value="H5"
/>
</el-select>
</el-form-item>
<block-header title="产品信息" />
<el-form-item
prop="appName"
class="form-item"
label="产品名称"
>
<el-input v-model="form.appName" />
</el-form-item>
<el-form-item
prop="appLogo"
class="form-item"
label="产品LOGO"
>
<el-upload
class="avatar-uploader"
action="/api/sysUser/upload"
list-type="picture-card"
:show-file-list="false"
:on-success="handleSuccessLogo"
:before-upload="beforeAvatarUpload"
>
<img
v-if="form.appLogo"
:src="form.appLogo"
class="avatar"
>
<i
v-else
class="el-icon-plus avatar-uploader-icon"
/>
</el-upload>
</el-form-item>
<el-form-item
prop="appInfo"
class="form-item"
label="产品描述"
>
<el-input v-model="form.appInfo" />
</el-form-item>
<el-form-item
prop="customerNumbers"
class="form-item"
label="客服电话"
>
<el-input
v-model="form.customerNumbers"
class="el-input"
/>
</el-form-item>
<el-form-item
prop="abstratInfo"
class="form-item"
label="产品摘要"
>
<el-input
v-model="form.abstratInfo"
type="textarea"
:rows="3"
/>
</el-form-item>
<el-form-item
class="form-item"
label="产品备注"
>
<el-input
v-model="form.memo"
type="textarea"
:rows="3"
/>
</el-form-item>
<block-header title="配置信息" />
<el-form-item
prop="gradeSort"
class="form-item"
label="产品等级"
>
<el-input-number
v-model="form.gradeSort"
controls-position="right"
:min="1"
:max="1000"
/>
</el-form-item>
<el-form-item
prop="creditWay"
label="授信方式"
>
<el-radio-group v-model="form.creditWay">
<el-radio :label="1">
一次授信一次借款
</el-radio>
<el-radio :label="2">
一次授信多次借款
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
required
class="form-item"
label="额度"
>
<el-row>
<el-col :span="5">
<el-form-item prop="applyAmtMin">
<el-input
v-model="form.applyAmtMin"
style="width: 80px"
/>
</el-form-item>
</el-col>
<el-col :span="4">
<div style="text-align: center">
~
</div>
</el-col>
<el-col :span="5">
<el-form-item prop="applyAmtMin">
<el-input
v-model="form.applyAmtMax"
style="width: 130px"
>
<template slot="append">
</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-form-item>
<el-form-item
prop="withdrawSpan"
class="form-item"
label="提现跨度"
>
<el-input-number
v-model="form.withdrawSpan"
controls-position="right"
:min="1"
:max="1000"
/>
</el-form-item>
<el-form-item
prop="approvalTime"
class="form-item"
label="审批时间"
>
<el-input
v-model="form.approvalTime"
class="el-input"
>
<template slot="append">
小时
</template>
</el-input>
<div class="el-extra">
从提交授信到授信结果返回时间
</div>
</el-form-item>
<el-form-item
required
class="form-item"
label="放款时间"
>
<el-row>
<el-col :span="5">
<el-form-item prop="raiseTimeMin">
<el-input
v-model="form.raiseTimeMin"
style="width: 80px"
/>
</el-form-item>
</el-col>
<el-col :span="4">
<div style="text-align: center;">
~
</div>
</el-col>
<el-col :span="5">
<el-form-item prop="raiseTimeMax">
<el-input
v-model="form.raiseTimeMax"
style="width: 130px"
>
<template slot="append">
</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-form-item>
<el-form-item
required
class="form-item"
label="每日进件时间"
>
<el-row>
<el-col :span="5">
<el-form-item prop="incomeTimeBefore">
<el-input
v-model="form.incomeTimeBefore"
style="width: 80px"
/>
</el-form-item>
</el-col>
<el-col :span="4">
<div style="text-align: center;">
~
</div>
</el-col>
<el-col :span="5">
<el-form-item prop="incomeTimeLate">
<el-input
v-model="form.incomeTimeLate"
style="width: 130px"
>
<template slot="append">
</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<span class="el-extra">请输入0~24之间的整数</span>
</el-form-item>
<el-form-item
prop="incomeCount"
class="form-item"
label="每日进件上限"
>
<el-input v-model="form.incomeCount" />
</el-form-item>
<el-form-item>
<el-button
type="primary"
@click="onSubmit('h5form')"
>
保存
</el-button>
<el-button @click="$router.go(-1)">
取消
</el-button>
<el-button @click="onReset('h5form')">
重置
</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import BlockHeader from "@/components/blockHeader";
import API from "@/server/api";
export default {
name: "MerchantNew",
components: {
"block-header": BlockHeader
},
data() {
return {
form: {
tenantNo: "",
abutmentWay: "",
gradeSort: "3",
appLogo: "",
appName: "MC产品",
appInfo: "产品介绍",
abstratInfo: "产品摘要",
applyAmtMin: "300",
applyAmtMax: "500",
withdrawSpan: "1000",
incomeCount: "1000",
approvalTime: "1000",
raiseTimeMax: "7",
raiseTimeMin: "5",
memo: "1000",
customerNumbers: "400", // 客服电话
creditWay: 1 // 授信方式
},
rules: {
tenantNo: [{ required: true, message: "请选择机构名称", trigger: "change" }],
abutmentWay: [{ required: true, message: "请选择对接方式", trigger: "change" }],
appName: [{ required: true, message: "请输入产品名称", trigger: "blur" }],
appLogo: [{ required: true, message: "请上传产品LOGO图片", trigger: "blur" }],
appInfo: [{ required: true, message: "请输入产品描述", trigger: "blur" }],
abstratInfo: [{ required: true, message: "请输入产品摘要", trigger: "blur" }],
customerNumbers: [{ required: true, message: "请输入客服电话", trigger: "blur" }],
creditWay: [{ required: true, message: "请选择授信方式", trigger: "blur" }],
gradeSort: [
{
required: true,
message: "请输入产品等级",
trigger: "blur"
}
],
raiseTimeMin: [
{ required: true, message: "请输入时间", trigger: "blur" },
{
validator: (rule, value, callback) => {
if (value * 1 >= this.form.raiseTimeMax * 1) {
callback(new Error("时间不大于最大时间"));
} else {
callback();
}
},
trigger: "change"
}
],
raiseTimeMax: [
{ required: true, message: "请输入时间", trigger: "blur" },
{
validator: (rule, value, callback) => {
if (value * 1 <= this.form.raiseTimeMin * 1) {
callback(new Error("时间不小于最小时间"));
} else {
callback();
}
},
trigger: "change"
}
],
applyAmtMin: [
{ required: true, message: "请输入额度", trigger: "blur" },
{
validator: (rule, value, callback) => {
if (value * 1 >= this.form.applyAmtMax * 1) {
callback(new Error("额度必须小于最大额度"));
} else {
callback();
}
},
trigger: "change"
}
],
applyAmtMax: [
{ required: true, message: "请输入额度", trigger: "blur" },
{
validator: (rule, value, callback) => {
if (value * 1 <= this.form.applyAmtMin * 1) {
callback(new Error("额度必须大于最小额度"));
} else {
callback();
}
},
trigger: "change"
}
],
incomeTimeBefore: [
{ required: true, message: "请输入时间", trigger: "blur" },
{
validator: (rule, value, callback) => {
if (value * 1 >= this.form.incomeTimeLate * 1) {
callback(new Error("时间须小于结束时间"));
} else {
callback();
}
},
trigger: "change"
}
],
incomeTimeLate: [
{ required: true, message: "请输入时间", trigger: "blur" },
{
validator: (rule, value, callback) => {
if (value * 1 <= this.form.incomeTimeBefore * 1) {
callback(new Error("时间须大于开始时间"));
} else {
callback();
}
},
trigger: "change"
}
],
withdrawSpan: [{ required: true, message: "请输入提现跨度", trigger: "blur" }],
approvalTime: [{ required: true, message: "请输入申请时间", trigger: "blur" }],
incomeCount: [{ required: true, message: "请输入每日进件上限", trigger: "blur" }]
},
merchant: []
};
},
async created() {
// 初始化机构列表
await this.initMerchant();
},
methods: {
// 初始化机构列表
async initMerchant() {
const result = await API.merchant_select();
if (result.success) {
this.merchant = result.result;
}
},
handleSuccessLogo(res) {
this.form.appLogo = res.result;
},
beforeAvatarUpload(file) {
const isJPG = file.type === "image/jpeg";
const isPNG = file.type === "image/png";
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isJPG && !isPNG) {
this.$message.error("上传图片只能是 JPG 或者 PNG 格式!");
return false;
}
if (!isLt2M) {
this.$message.error("上传图片大小不能超过 2MB!");
return false;
}
return true;
},
onSubmit(formName) {
this.$refs[formName].validate(async (valid) => {
if (valid) {
const form = Object.assign({}, this.form);
let result = await API.prod_add({ ...form });
if (result.success) {
this.$baseMessage("产品保存成功", "success");
setTimeout(() => {
this.$router.back();
}, 1500);
}
}
});
},
onReset(formName) {
this.$refs[formName].resetFields();
}
}
};
</script>
<style lang="scss" src="./index.scss"></style>
<template>
<el-dialog
:title="title"
:visible.sync="dialogFormVisible"
width="500px"
@close="close"
>
<el-form
ref="form"
:model="form"
:rules="rules"
label-width="80px"
>
<el-form-item
label="标题"
prop="title"
>
<el-input v-model.trim="form.title" />
</el-form-item>
<el-form-item
label="作者"
prop="author"
>
<el-input v-model.trim="form.author" />
</el-form-item>
</el-form>
<div
slot="footer"
class="dialog-footer"
>
<el-button @click="close">
取 消
</el-button>
<el-button
type="primary"
@click="save"
>
确 定
</el-button>
</div>
</el-dialog>
</template>
<script>
import { doEdit } from '@/api/table'
export default {
name: 'TableEdit',
data() {
return {
form: {
title: '',
author: '',
},
rules: {
title: [{ required: true, trigger: 'blur', message: '请输入标题' }],
author: [{ required: true, trigger: 'blur', message: '请输入作者' }],
},
title: '',
dialogFormVisible: false,
}
},
created() {},
methods: {
showEdit(row) {
if (!row) {
this.title = '添加'
} else {
this.title = '编辑'
this.form = Object.assign({}, row)
}
this.dialogFormVisible = true
},
close() {
this.$refs['form'].resetFields()
this.form = this.$options.data().form
this.dialogFormVisible = false
this.$emit('fetch-data')
},
save() {
this.$refs['form'].validate(async (valid) => {
if (valid) {
const { msg } = await doEdit(this.form)
this.$baseMessage(msg, 'success')
this.$refs['form'].resetFields()
this.dialogFormVisible = false
this.$emit('fetch-data')
this.form = this.$options.data().form
} else {
return false
}
})
},
},
}
</script>
<template>
<el-form
ref="h5form"
label-suffix=":"
:rules="rules"
:model="form"
label-width="120px"
>
<block-header title="产品信息" />
<el-form-item
prop="gradeSort"
class="form-item"
label="产品等级"
>
<el-input v-model="form.gradeSort" />
</el-form-item>
<el-form-item
prop="appLogo"
class="form-item"
label="产品LOGO"
>
<el-upload
class="avatar-uploader"
action="/api/sysUser/upload"
list-type="picture-card"
:show-file-list="false"
:on-success="handleSuccessLogo"
:before-upload="beforeAvatarUpload"
>
<img
v-if="form.appLogo"
:src="form.appLogo"
class="avatar"
>
<i
v-else
class="el-icon-plus avatar-uploader-icon"
/>
</el-upload>
</el-form-item>
<el-form-item
prop="appName"
class="form-item"
label="产品名称"
>
<el-input v-model="form.appName" />
</el-form-item>
<el-form-item
prop="appInfo"
class="form-item"
label="产品描述"
>
<el-input v-model="form.appInfo" />
</el-form-item>
<el-form-item
prop="abstratInfo"
class="form-item"
label="产品摘要"
>
<el-input v-model="form.abstratInfo" />
</el-form-item>
<el-form-item
prop="tenantFullName"
class="form-item"
label="额度"
>
<el-row>
<el-col :span="10">
<el-form-item prop="applyAmtMin">
<el-input v-model="form.applyAmtMin" />
</el-form-item>
</el-col>
<el-col :span="4">
-
</el-col>
<el-col :span="10">
<el-form-item prop="applyAmtMin">
<el-input v-model="form.applyAmtMax" />
</el-form-item>
</el-col>
</el-row>
</el-form-item>
<el-form-item
prop="time"
class="form-item"
label="每日进件时间"
>
<el-time-picker
v-model="form.time"
is-range
range-separator="至"
format="HH:mm"
start-placeholder="开始时间"
end-placeholder="结束时间"
placeholder="选择时间范围"
/>
</el-form-item>
<el-form-item
prop="incomeCount"
class="form-item"
label="每日进件上限"
>
<el-input v-model="form.incomeCount" />
</el-form-item>
<el-form-item>
<el-button
type="primary"
@click="onSubmit('h5form')"
>
保存
</el-button>
<el-button @click="$router.go(-1)">
取消
</el-button>
</el-form-item>
</el-form>
</template>
<script>
import BlockHeader from "@/components/blockHeader";
export default {
name: "H5Com",
components: {
"block-header": BlockHeader
},
data() {
return {
form: {
gradeSort: "",
appLogo: "",
appName: "",
appInfo: "",
abstratInfo: "",
applyAmtMin: "",
applyAmtMax: "",
time: "",
incomeCount: ""
},
rules: {
gradeSort: [{ required: true, message: "请输入机构名称", trigger: "blur" }],
appLogo: [{ required: true, message: "请输入机构简称", trigger: "blur" }],
appName: [{ required: true, message: "请上传营业执照", trigger: "blur" }],
appInfo: [{ required: true, message: "请上传小贷拍照", trigger: "blur" }],
abstratInfo: [{ required: true, message: "请上传金融办批文", trigger: "blur" }],
applyAmtMin: [{ required: true, message: "请上传金融办批文", trigger: "blur" }],
applyAmtMax: [{ required: true, message: "请上传金融办批文", trigger: "blur" }],
time: [{ required: true, message: "请上传金融办批文", trigger: "blur" }],
incomeCount: [{ required: true, message: "请上传金融办批文", trigger: "blur" }]
},
title: "",
dialogFormVisible: false
};
},
created() {
},
methods: {
handleSuccessLogo(res) {
this.form.loanLicenseUrl = res.result;
},
beforeAvatarUpload(file) {
const isJPG = file.type === "image/jpeg";
const isPNG = file.type === "image/png";
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isJPG && !isPNG) {
this.$message.error("上传图片只能是 JPG 或者 PNG 格式!");
return false;
}
if (!isLt2M) {
this.$message.error("上传图片大小不能超过 2MB!");
return false;
}
return true;
},
onSubmit(formName) {
this.$refs[formName].validate(async (valid) => {
if (valid) {
}else {
}
})
}
}
};
</script>
<template>
<div class="merchant-new">
<el-form
ref="h5form"
label-suffix=":"
:rules="rules"
:model="form"
label-width="120px"
>
<block-header title="对接信息" />
<el-form-item
class="form-item"
label="对接机构"
>
<el-select
v-model="form.tenantNo"
:disabled="!!appNo"
placeholder="请选择"
>
<el-option
v-for="(item,index) in merchant"
:key="index"
:label="item.tenantName"
:value="item.tenantNo"
/>
</el-select>
</el-form-item>
<el-form-item
class="form-item"
label="对接方式"
>
<el-select
v-model="form.abutmentWay"
placeholder="请选择"
>
<el-option
label="API"
value="API"
/>
<el-option
label="H5"
value="H5"
/>
</el-select>
</el-form-item>
<block-header title="产品信息" />
<el-form-item
prop="appName"
class="form-item"
label="产品名称"
>
<el-input v-model="form.appName" />
</el-form-item>
<el-form-item
prop="appLogo"
class="form-item"
label="产品LOGO"
>
<el-upload
class="avatar-uploader"
action="/api/sysUser/upload"
list-type="picture-card"
:show-file-list="false"
:on-success="handleSuccessLogo"
:before-upload="beforeAvatarUpload"
>
<img
v-if="form.appLogo"
:src="form.appLogo"
class="avatar"
>
<i
v-else
class="el-icon-plus avatar-uploader-icon"
/>
</el-upload>
</el-form-item>
<el-form-item
prop="appInfo"
class="form-item"
label="产品描述"
>
<el-input v-model="form.appInfo" />
</el-form-item>
<el-form-item
prop="customerNumbers"
class="form-item"
label="客服电话"
>
<el-input
v-model="form.customerNumbers"
class="el-input"
/>
</el-form-item>
<el-form-item
prop="abstratInfo"
class="form-item"
label="产品摘要"
>
<el-input
v-model="form.abstratInfo"
type="textarea"
:rows="3"
/>
</el-form-item>
<el-form-item
class="form-item"
label="产品备注"
>
<el-input
v-model="form.memo"
type="textarea"
:rows="3"
/>
</el-form-item>
<block-header title="配置信息" />
<template v-if="appNo">
<el-form-item
prop="gradeSort"
class="form-item"
label="产品等级"
>
<el-input-number
v-model="form.gradeSort"
controls-position="right"
:min="1"
:max="1000"
/>
</el-form-item>
</template>
<el-form-item
prop="creditWay"
label="授信方式"
>
<el-radio-group v-model="form.creditWay">
<el-radio :label="1">
一次授信一次借款
</el-radio>
<el-radio :label="2">
一次授信多次借款
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
required
class="form-item"
label="额度"
>
<el-row>
<el-col :span="5">
<el-form-item prop="applyAmtMin">
<el-input
v-model="form.applyAmtMin"
style="width: 80px"
/>
</el-form-item>
</el-col>
<el-col :span="4">
<div style="text-align: center">
~
</div>
</el-col>
<el-col :span="5">
<el-form-item prop="applyAmtMin">
<el-input
v-model="form.applyAmtMax"
style="width: 130px"
>
<template slot="append">
</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-form-item>
<el-form-item
prop="withdrawSpan"
class="form-item"
label="提现跨度"
>
<el-input-number
v-model="form.withdrawSpan"
controls-position="right"
:min="1"
:max="1000"
/>
</el-form-item>
<el-form-item
prop="approvalTime"
class="form-item"
label="审批时间"
>
<el-input
v-model="form.approvalTime"
class="el-input"
>
<template slot="append">
小时
</template>
</el-input>
<div class="el-extra">
从提交授信到授信结果返回时间
</div>
</el-form-item>
<el-form-item
required
class="form-item"
label="放款时间"
>
<el-row>
<el-col :span="5">
<el-form-item prop="raiseTimeMin">
<el-input
v-model="form.raiseTimeMin"
style="width: 80px"
/>
</el-form-item>
</el-col>
<el-col :span="4">
<div style="text-align: center;">
~
</div>
</el-col>
<el-col :span="5">
<el-form-item prop="raiseTimeMax">
<el-input
v-model="form.raiseTimeMax"
style="width: 130px"
>
<template slot="append">
</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-form-item>
<el-form-item
required
class="form-item"
label="每日进件时间"
>
<el-row>
<el-col :span="5">
<el-form-item prop="incomeTimeBefore">
<el-input
v-model="form.incomeTimeBefore"
style="width: 80px"
/>
</el-form-item>
</el-col>
<el-col :span="4">
<div style="text-align: center;">
~
</div>
</el-col>
<el-col :span="5">
<el-form-item prop="incomeTimeLate">
<el-input
v-model="form.incomeTimeLate"
style="width: 130px"
>
<template slot="append">
</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<span class="el-extra">请输入0~24之间的整数</span>
</el-form-item>
<el-form-item
prop="incomeCount"
class="form-item"
label="每日进件上限"
>
<el-input v-model="form.incomeCount" />
</el-form-item>
<el-form-item>
<el-button
type="primary"
@click="onSubmit('h5form')"
>
保存
</el-button>
<el-button @click="$router.go(-1)">
取消
</el-button>
<el-button @click="onReset('h5form')">
重置
</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import BlockHeader from "@/components/blockHeader";
import API from "@/server/api";
export default {
name: "MerchantNew",
components: {
"block-header": BlockHeader
},
data() {
return {
appNo:'',
form: {
tenantNo: "",
abutmentWay: "",
gradeSort: "3",
appLogo: "",
appName: "MC产品",
appInfo: "产品介绍",
abstratInfo: "产品摘要",
applyAmtMin: "300",
applyAmtMax: "500",
withdrawSpan: "1000",
incomeCount: "1000",
approvalTime: "1000",
raiseTimeMax: "7",
raiseTimeMin: "5",
memo: "1000",
customerNumbers: "400", // 客服电话
creditWay: 1 // 授信方式
},
rules: {
tenantNo: [{ required: true, message: "请选择机构名称", trigger: "change" }],
abutmentWay: [{ required: true, message: "请选择对接方式", trigger: "change" }],
appName: [{ required: true, message: "请输入产品名称", trigger: "blur" }],
appLogo: [{ required: true, message: "请上传产品LOGO图片", trigger: "blur" }],
appInfo: [{ required: true, message: "请输入产品描述", trigger: "blur" }],
abstratInfo: [{ required: true, message: "请输入产品摘要", trigger: "blur" }],
customerNumbers: [{ required: true, message: "请输入客服电话", trigger: "blur" }],
creditWay: [{ required: true, message: "请选择授信方式", trigger: "blur" }],
gradeSort: [
{
required: true,
message: "请输入产品等级",
trigger: "blur"
}
],
raiseTimeMin: [
{ required: true, message: "请输入时间", trigger: "blur" },
{
validator: (rule, value, callback) => {
if (value * 1 >= this.form.raiseTimeMax * 1) {
callback(new Error("时间不大于最大时间"));
} else {
callback();
}
},
trigger: "change"
}
],
raiseTimeMax: [
{ required: true, message: "请输入时间", trigger: "blur" },
{
validator: (rule, value, callback) => {
if (value * 1 <= this.form.raiseTimeMin * 1) {
callback(new Error("时间不小于最小时间"));
} else {
callback();
}
},
trigger: "change"
}
],
applyAmtMin: [
{ required: true, message: "请输入额度", trigger: "blur" },
{
validator: (rule, value, callback) => {
if (value * 1 >= this.form.applyAmtMax * 1) {
callback(new Error("额度必须小于最大额度"));
} else {
callback();
}
},
trigger: "change"
}
],
applyAmtMax: [
{ required: true, message: "请输入额度", trigger: "blur" },
{
validator: (rule, value, callback) => {
if (value * 1 <= this.form.applyAmtMin * 1) {
callback(new Error("额度必须大于最小额度"));
} else {
callback();
}
},
trigger: "change"
}
],
incomeTimeBefore: [
{ required: true, message: "请输入时间", trigger: "blur" },
{
validator: (rule, value, callback) => {
if (value * 1 >= this.form.incomeTimeLate * 1) {
callback(new Error("时间须小于结束时间"));
} else {
callback();
}
},
trigger: "change"
}
],
incomeTimeLate: [
{ required: true, message: "请输入时间", trigger: "blur" },
{
validator: (rule, value, callback) => {
if (value * 1 <= this.form.incomeTimeBefore * 1) {
callback(new Error("时间须大于开始时间"));
} else {
callback();
}
},
trigger: "change"
}
],
withdrawSpan: [{ required: true, message: "请输入提现跨度", trigger: "blur" }],
approvalTime: [{ required: true, message: "请输入申请时间", trigger: "blur" }],
incomeCount: [{ required: true, message: "请输入每日进件上限", trigger: "blur" }]
},
merchant: []
};
},
async created() {
// 初始化机构列表
await this.initMerchant();
// 再请求表单
const { query } = this.$route;
if (query && query.appNo) {
this.appNo = query.appNo;
await this.initProd();
}
},
methods: {
// 初始化机构列表
async initMerchant() {
const result = await API.merchant_select();
if (result.success) {
this.merchant = result.result;
}
},
// 初始化产品信息
async initProd() {
const appNo = this.appNo;
const { result, success } = await API.prod_view({ appNo });
if (success) {
//result.creditWay = result.creditWay+'';
this.form = result;
}
},
handleSuccessLogo(res) {
this.form.appLogo = res.result;
},
beforeAvatarUpload(file) {
const isJPG = file.type === "image/jpeg";
const isPNG = file.type === "image/png";
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isJPG && !isPNG) {
this.$message.error("上传图片只能是 JPG 或者 PNG 格式!");
return false;
}
if (!isLt2M) {
this.$message.error("上传图片大小不能超过 2MB!");
return false;
}
return true;
},
onSubmit(formName) {
this.$refs[formName].validate(async (valid) => {
if (valid) {
const form = Object.assign({}, this.form);
//form.tenantNo = this.tenantNo;
//form.abutmentWay = 'API'
let result;
if(this.appNo){
form.appNo = this.appNo;
result = await API.prod_update({ ...form });
}else{
result = await API.prod_add({ ...form });
}
if (result.success) {
this.$baseMessage("产品保存成功", "success");
setTimeout(() => {
this.$router.back();
}, 1500);
}
}
});
},
onReset(formName) {
this.$refs[formName].resetFields();
}
}
};
</script>
<style lang="scss" src="./index.scss"></style>
......@@ -34,3 +34,7 @@
height: 120px;
display: block;
}
//.el-input{
// width:200px;
//}
......@@ -109,9 +109,9 @@
<template #default="{ row }">
<el-button
type="text"
@click="handleEdit(row)"
@click="handleView(row)"
>
编辑
详情
</el-button>
</template>
</el-table-column>
......@@ -224,10 +224,10 @@ export default {
onSubmit() {
this.fetchData();
},
handleEdit(row) {
handleView(row) {
const {appNo} = row;
this.$router.push({
path: '/prod/new',
path: '/prod/edit',
query: { appNo }
})
},
......
<template>
<div class="merchant-new">
<el-form
ref="form"
ref="h5form"
label-suffix=":"
:rules="rules"
:model="form"
label-width="120px"
>
......@@ -16,16 +17,10 @@
placeholder="请选择"
>
<el-option
label="手机借钱"
value="100000001"
/>
<el-option
label="弟弟机构"
value="1000003"
/>
<el-option
label="借钱花有限公司哈"
value="1000002"
v-for="(item,index) in merchant"
:key="index"
:label="item.tenantName"
:value="item.tenantNo"
/>
</el-select>
</el-form-item>
......@@ -47,96 +42,421 @@
/>
</el-select>
</el-form-item>
</el-form>
<!-- 产品表单-->
<template v-if="form.tenantNo && form.abutmentWay==='API'">
<com-api :tenant-no="form.tenantNo" />
</template>
<template v-if="form.tenantNo && form.abutmentWay==='H5'">
<com-h5 :tenant-no="form.tenantNo" />
</template>
<block-header title="产品信息" />
<el-form-item
prop="appName"
class="form-item"
label="产品名称"
>
<el-input v-model="form.appName" />
</el-form-item>
<el-form-item
prop="appLogo"
class="form-item"
label="产品LOGO"
>
<el-upload
class="avatar-uploader"
action="/api/sysUser/upload"
list-type="picture-card"
:show-file-list="false"
:on-success="handleSuccessLogo"
:before-upload="beforeAvatarUpload"
>
<img
v-if="form.appLogo"
:src="form.appLogo"
class="avatar"
>
<i
v-else
class="el-icon-plus avatar-uploader-icon"
/>
</el-upload>
</el-form-item>
<el-form-item
prop="appInfo"
class="form-item"
label="产品描述"
>
<el-input v-model="form.appInfo" />
</el-form-item>
<el-form-item
prop="customerNumbers"
class="form-item"
label="客服电话"
>
<el-input
v-model="form.customerNumbers"
class="el-input"
/>
</el-form-item>
<el-form-item
prop="abstratInfo"
class="form-item"
label="产品摘要"
>
<el-input
v-model="form.abstratInfo"
type="textarea"
:rows="3"
/>
</el-form-item>
<el-form-item
class="form-item"
label="产品备注"
>
<el-input
v-model="form.memo"
type="textarea"
:rows="3"
/>
</el-form-item>
<block-header title="配置信息" />
<el-form-item
prop="gradeSort"
class="form-item"
label="产品等级"
>
<el-input-number
v-model="form.gradeSort"
controls-position="right"
:min="1"
:max="1000"
/>
</el-form-item>
<el-form-item
prop="creditWay"
label="授信方式"
>
<el-radio-group v-model="form.creditWay">
<el-radio :label="1">
一次授信一次借款
</el-radio>
<el-radio :label="2">
一次授信多次借款
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
required
class="form-item"
label="额度"
>
<el-row>
<el-col :span="5">
<el-form-item prop="applyAmtMin">
<el-input
v-model="form.applyAmtMin"
style="width: 80px"
/>
</el-form-item>
</el-col>
<el-col :span="4">
<div style="text-align: center">
~
</div>
</el-col>
<el-col :span="5">
<el-form-item prop="applyAmtMin">
<el-input
v-model="form.applyAmtMax"
style="width: 130px"
>
<template slot="append">
</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-form-item>
<el-form-item
prop="withdrawSpan"
class="form-item"
label="提现跨度"
>
<el-input-number
v-model="form.withdrawSpan"
controls-position="right"
:min="1"
:max="1000"
/>
</el-form-item>
<el-form-item
prop="approvalTime"
class="form-item"
label="审批时间"
>
<el-input
v-model="form.approvalTime"
class="el-input"
>
<template slot="append">
小时
</template>
</el-input>
<div class="el-extra">
从提交授信到授信结果返回时间
</div>
</el-form-item>
<el-form-item
required
class="form-item"
label="放款时间"
>
<el-row>
<el-col :span="5">
<el-form-item prop="raiseTimeMin">
<el-input
v-model="form.raiseTimeMin"
style="width: 80px"
/>
</el-form-item>
</el-col>
<el-col :span="4">
<div style="text-align: center;">
~
</div>
</el-col>
<el-col :span="5">
<el-form-item prop="raiseTimeMax">
<el-input
v-model="form.raiseTimeMax"
style="width: 130px"
>
<template slot="append">
</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-form-item>
<el-form-item
required
class="form-item"
label="每日进件时间"
>
<el-row>
<el-col :span="5">
<el-form-item prop="incomeTimeBefore">
<el-input
v-model="form.incomeTimeBefore"
style="width: 80px"
/>
</el-form-item>
</el-col>
<el-col :span="4">
<div style="text-align: center;">
~
</div>
</el-col>
<el-col :span="5">
<el-form-item prop="incomeTimeLate">
<el-input
v-model="form.incomeTimeLate"
style="width: 130px"
>
<template slot="append">
</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<span class="el-extra">请输入0~24之间的整数</span>
</el-form-item>
<el-form-item
prop="incomeCount"
class="form-item"
label="每日进件上限"
>
<el-input v-model="form.incomeCount" />
</el-form-item>
<el-form-item>
<el-button
type="primary"
@click="onSubmit('h5form')"
>
保存
</el-button>
<el-button @click="$router.go(-1)">
取消
</el-button>
<el-button @click="onReset('h5form')">
重置
</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import BlockHeader from "@/components/blockHeader";
import H5Com from "./components/H5Com";
import APICom from "./components/APICom";
import API from "@/server/api";
export default {
name: "MerchantNew",
components: {
"block-header": BlockHeader,
"com-h5": H5Com,
"com-api": APICom
"block-header": BlockHeader
},
data() {
return {
tenantNo: "",
form: {
tenantNo: "",
abutmentWay: ""
}
abutmentWay: "",
gradeSort: "3",
appLogo: "",
appName: "MC产品",
appInfo: "产品介绍",
abstratInfo: "产品摘要",
applyAmtMin: "300",
applyAmtMax: "500",
withdrawSpan: "1000",
incomeCount: "1000",
approvalTime: "1000",
raiseTimeMax: "7",
raiseTimeMin: "5",
memo: "1000",
customerNumbers: "400", // 客服电话
creditWay: 1 // 授信方式
},
rules: {
tenantNo: [{ required: true, message: "请选择机构名称", trigger: "change" }],
abutmentWay: [{ required: true, message: "请选择对接方式", trigger: "change" }],
appName: [{ required: true, message: "请输入产品名称", trigger: "blur" }],
appLogo: [{ required: true, message: "请上传产品LOGO图片", trigger: "blur" }],
appInfo: [{ required: true, message: "请输入产品描述", trigger: "blur" }],
abstratInfo: [{ required: true, message: "请输入产品摘要", trigger: "blur" }],
customerNumbers: [{ required: true, message: "请输入客服电话", trigger: "blur" }],
creditWay: [{ required: true, message: "请选择授信方式", trigger: "blur" }],
gradeSort: [
{
required: true,
message: "请输入产品等级",
trigger: "blur"
}
],
raiseTimeMin: [
{ required: true, message: "请输入时间", trigger: "blur" },
{
validator: (rule, value, callback) => {
if (value * 1 >= this.form.raiseTimeMax * 1) {
callback(new Error("时间不大于最大时间"));
} else {
callback();
}
},
trigger: "change"
}
],
raiseTimeMax: [
{ required: true, message: "请输入时间", trigger: "blur" },
{
validator: (rule, value, callback) => {
if (value * 1 <= this.form.raiseTimeMin * 1) {
callback(new Error("时间不小于最小时间"));
} else {
callback();
}
},
trigger: "change"
}
],
applyAmtMin: [
{ required: true, message: "请输入额度", trigger: "blur" },
{
validator: (rule, value, callback) => {
if (value * 1 >= this.form.applyAmtMax * 1) {
callback(new Error("额度必须小于最大额度"));
} else {
callback();
}
},
trigger: "change"
}
],
applyAmtMax: [
{ required: true, message: "请输入额度", trigger: "blur" },
{
validator: (rule, value, callback) => {
if (value * 1 <= this.form.applyAmtMin * 1) {
callback(new Error("额度必须大于最小额度"));
} else {
callback();
}
},
trigger: "change"
}
],
incomeTimeBefore: [
{ required: true, message: "请输入时间", trigger: "blur" },
{
validator: (rule, value, callback) => {
if (value * 1 >= this.form.incomeTimeLate * 1) {
callback(new Error("时间须小于结束时间"));
} else {
callback();
}
},
trigger: "change"
}
],
incomeTimeLate: [
{ required: true, message: "请输入时间", trigger: "blur" },
{
validator: (rule, value, callback) => {
if (value * 1 <= this.form.incomeTimeBefore * 1) {
callback(new Error("时间须大于开始时间"));
} else {
callback();
}
},
trigger: "change"
}
],
withdrawSpan: [{ required: true, message: "请输入提现跨度", trigger: "blur" }],
approvalTime: [{ required: true, message: "请输入申请时间", trigger: "blur" }],
incomeCount: [{ required: true, message: "请输入每日进件上限", trigger: "blur" }]
},
merchant: []
};
},
created() {
const { query } = this.$route;
if (query && query.tenantNo) {
this.tenantNo = query.tenantNo;
this.initMerchant();
}
async created() {
// 初始化机构列表
await this.initMerchant();
},
methods: {
// 初始化机构列表
async initMerchant() {
const tenantNo = this.tenantNo;
const { result, success } = await API.merchant_view({
tenantNo
});
if (success) {
this.form = result;
const result = await API.merchant_select();
if (result.success) {
this.merchant = result.result;
}
},
onSubmit(formName) {
this.$refs[formName].validate(async (valid) => {
if (valid) {
let result;
if (this.tenantNo) {
this.form.tenantNo = this.tenantNo;
const form = this.form;
result = await API.merchant_update({
...form
});
} else {
const form = this.form;
result = await API.merchant_add({
...form
});
}
if (result.success) {
this.$baseMessage("保存机构信息成功", "success");
setTimeout(() => {
this.$router.back();
}, 1500);
}
} else {
console.log("error submit!!");
return false;
}
});
},
handleSuccessOffice(res) {
this.form.officeApprovalUrl = res.result;
},
handleSuccessBusiness(res) {
this.form.businessLicenseUrl = res.result;
},
handleSuccessLoan(res) {
this.form.loanLicenseUrl = res.result;
handleSuccessLogo(res) {
this.form.appLogo = res.result;
},
beforeAvatarUpload(file) {
const isJPG = file.type === "image/jpeg";
......@@ -151,6 +471,24 @@ export default {
return false;
}
return true;
},
onSubmit(formName) {
this.$refs[formName].validate(async (valid) => {
if (valid) {
const form = Object.assign({}, this.form);
let result = await API.prod_add({ ...form });
if (result.success) {
this.$baseMessage("产品保存成功", "success");
setTimeout(() => {
this.$router.back();
}, 1500);
}
}
});
},
onReset(formName) {
this.$refs[formName].resetFields();
}
}
};
......
......@@ -69,7 +69,7 @@ module.exports = {
// }
//},
"/api": {
target: `http://192.168.0.199:8221`,
target: `http://192.168.0.75:8080`,
ws: true,
changeOrigin: true,
pathRewrite: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment