Commit 4700965d authored by Zhang Xiaojie's avatar Zhang Xiaojie

贷款产品发布请求

parent f8807aed
<template>
<div>
<a-table :columns="columns" :data-source="dataSource" style=" text-align: center; margin-top:40px;" bordered >
<span slot="introduction" slot-scope="text,record"> <a @click="getIntroduction(record.key)">查看</a> </span>
<span slot="characteristic" slot-scope="text,record"> <a @click="getCharacteristic(record.key)">查看</a> </span>
<span slot="target" slot-scope="text,record"> <a @click="getTarget(record.key)">查看</a> </span>
<span slot="application" slot-scope="text,record"> <a @click="getApplication(record.key)">查看</a> </span>
<span slot="submission" slot-scope="text,record"> <a @click="getSubmission(record.key)">查看</a> </span>
<a-table
:columns="columns"
:data-source="dataSource"
style="text-align: center; margin-top: 40px"
bordered
>
<span slot="introduction" slot-scope="text, record">
<a @click="getIntroduction(record.key)">查看</a>
</span>
<span slot="characteristic" slot-scope="text, record">
<a @click="getCharacteristic(record.key)">查看</a>
</span>
<span slot="target" slot-scope="text, record">
<a @click="getTarget(record.key)">查看</a>
</span>
<span slot="application" slot-scope="text, record">
<a @click="getApplication(record.key)">查看</a>
</span>
<span slot="submission" slot-scope="text, record">
<a @click="getSubmission(record.key)">查看</a>
</span>
<!-- 操作 -->
<div slot="action" slot-scope="text,record">
<!-- 下架状态 -->
<div v-if="record.state=='已下架'">
<a @click="toAdd">上架</a>
<a-divider type="vertical" />
<a @click="toDelete">删除</a>
</div>
<!-- 上架状态 -->
<div v-else>
<a @click="toRemove">下架</a>
<a-divider type="vertical" />
<a @click="$router.push({name:'publishLoanProduct',query:{key:1}})">编辑</a>
<a-divider type="vertical" />
<a v-if="record.state.indexOf('热门') == -1" @click="setAsHot">热门</a>
<a v-else @click="setAsCommon">普通</a>
</div>
<div slot="action" slot-scope="text, record">
<!-- 下架状态 -->
<div v-if="record.state == '已下架'">
<a @click="toAdd">上架</a>
<a-divider type="vertical" />
<a @click="toDelete">删除</a>
</div>
<!-- 上架状态 -->
<div v-else>
<a @click="toRemove">下架</a>
<a-divider type="vertical" />
<a
@click="
$router.push({ name: 'publishLoanProduct', query: { key: 1 } })
"
>编辑</a
>
<a-divider type="vertical" />
<a v-if="record.state.indexOf('热门') == -1" @click="setAsHot"
>热门</a
>
<a v-else @click="setAsCommon">普通</a>
</div>
</div>
</a-table>
<!-- 操作弹窗 -->
<a-modal v-model="show" :title="modalTitle[type]" :centered="true" @ok="handleOk">
<a-modal
v-model="show"
:title="modalTitle[type]"
:centered="true"
@ok="handleOk"
>
<!-- 上架 -->
<p v-if="type == 0" class=" text-center">
确定上架产品?
</p>
<p v-if="type == 0" class="text-center">确定上架产品?</p>
<!-- 下架 -->
<p v-else-if="type == 1" class=" text-center">
确定下架产品?
</p>
<p v-else-if="type == 1" class="text-center">确定下架产品?</p>
<!-- 普通 -->
<p v-else-if="type == 2" class=" text-center">
确定设置为普通产品?
</p>
<p v-else-if="type == 2" class="text-center">确定设置为普通产品?</p>
<!-- 热门 -->
<p v-else-if="type == 3" class=" text-center">
确定设置为热门产品?
</p>
<p v-else-if="type == 3" class="text-center">确定设置为热门产品?</p>
<!-- 删除 -->
<p v-else-if="type == 4" class=" text-center">
确定删除产品?
</p>
<p v-else-if="type == 4" class="text-center">确定删除产品?</p>
</a-modal>
</div>
</template>
<script lang="ts">
import Vue, { PropType } from 'vue'
import columns from '@/const/columns/productColumn'
import dataSource from '@/mock/loanProduct'
import Vue, { PropType } from "vue";
import columns from "@/const/columns/productColumn";
import dataSource from "@/mock/loanProduct";
enum modalType {
add,
remove,
common,
hot,
delete
delete,
}
export default Vue.extend({
props:{
modalTitle:{
type:Array as PropType<String[]>,
default(){
return ['上架产品','下架产品','设置普通产品','设置热门产品','删除产品']
}
}
props: {
modalTitle: {
type: Array as PropType<String[]>,
default() {
return [
"上架产品",
"下架产品",
"设置普通产品",
"设置热门产品",
"删除产品",
];
},
},
},
data(){
let type:modalType = 0
data() {
let type: modalType = 0;
return {
columns,
dataSource,
type,
show:false
}
show: false,
};
},
methods:{
getIntroduction(key:string){
console.log(key)
methods: {
getIntroduction(key: string) {
console.log(key);
},
getCharacteristic(key:string){
console.log(key)
getCharacteristic(key: string) {
console.log(key);
},
getTarget(key:string){
console.log(key)
getTarget(key: string) {
console.log(key);
},
getApplication(key:string){
console.log(key)
getApplication(key: string) {
console.log(key);
},
getSubmission(key:string){
console.log(key)
getSubmission(key: string) {
console.log(key);
},
toAdd(key:string){
this.type = 0
this.show = true
toAdd(key: string) {
this.type = 0;
this.show = true;
},
toRemove(key:string){
this.type = 1
this.show = true
toRemove(key: string) {
this.type = 1;
this.show = true;
},
setAsCommon(key:string){
this.type = 2
this.show = true
setAsCommon(key: string) {
this.type = 2;
this.show = true;
},
setAsHot(key:string){
this.type = 3
this.show = true
setAsHot(key: string) {
this.type = 3;
this.show = true;
},
toDelete(key:string){
this.type = 4
this.show = true
toDelete(key: string) {
this.type = 4;
this.show = true;
},
handleOk(e:Event) {
this.show = false
handleOk(e: Event) {
this.show = false;
},
}
})
},
});
</script>
<style>
.ant-modal-header{
.ant-modal-header {
text-align: center;
}
.ant-modal-footer{
.ant-modal-footer {
text-align: center;
}
</style>
\ No newline at end of file
......@@ -3,7 +3,9 @@
<a-input placeholder="产品名称模糊搜索" v-model="searchPageReqParams.name" style=" width:150px; margin-right:10px;"/>
<span class=" font-semibold">创建时间:</span>
<timerange class=" mr-3"
@getNewTime="getNewTime"/>
@getNewTime="getNewTime"
:startTime="searchPageReqParams.startTime"
:endTime="searchPageReqParams.endTime"/>
<span class=" mr-3">消息分类</span>
<a-select :default-value="productType[0]"
style="width: 120px; margin-right:10px;"
......
export default[
{
title: '发布事件',
title: '发布时间',
align: 'center',
dataIndex: 'time',
dataIndex: 'created_at',
},
{
title: '产品名称',
align: 'center',
dataIndex: 'name',
dataIndex: 'product_name',
},
{
title: '产品分类',
align: 'center',
dataIndex: 'type',
dataIndex: 'product_type',
},
{
title: '贷款期限(月)',
......@@ -32,37 +32,37 @@ export default[
{
title: '担保方式',
align: 'center',
dataIndex: 'guarantee',
dataIndex: 'guarantee_type',
},
{
title: '产品介绍',
align: 'center',
scopedSlots: { customRender: 'introduction' },
scopedSlots: { customRender: 'products' },
},
{
title: '产品特点',
align: 'center',
scopedSlots: { customRender: 'characteristic' },
scopedSlots: { customRender: 'features' },
},
{
title: '适用客户',
align: 'center',
scopedSlots: { customRender: 'target' },
scopedSlots: { customRender: 'apply_to' },
},
{
title: '申请条件',
align: 'center',
scopedSlots: { customRender: 'application' },
scopedSlots: { customRender: 'apply_cond' },
},
{
title: '提交条件',
align: 'center',
scopedSlots: { customRender: 'submission' },
scopedSlots: { customRender: 'submit_cond' },
},
{
title: '状态',
align: 'center',
dataIndex: 'state',
dataIndex: 'product_status',
},
{
title: '操作',
......
import { eBannerLocation, eBannerStatus } from '@/types/banner'
import { eUserStatus } from '@/types/user'
import { eGuaranteeType,eProductStatus,eProductType} from '@/types/loanProduct'
import moment from 'moment'
export default {
......@@ -51,6 +52,28 @@ export default {
return '已发布'
}
},
filterGuaranteeType(type:eProductType) {
switch (type) {
case eProductType.all:
return '全部贷款'
case eProductType.all:
return '企业贷款'
case eProductType.identity:
return '个人贷款'
}
},
filterProductStatus(status:eProductStatus) {
switch (status) {
case eProductStatus.all:
return '全部状态'
case eProductStatus.unpublished:
return '未发布'
case eProductStatus.normal:
return '普通'
case eProductStatus.hot:
return '热门'
}
},
} as {
[key: string]: (...args: any) => any
}
import baseAxios from '../index'
import { eProductType,eProductStatus,eGuaranteeType } from "@/types/loanProduct"
export default class LoanProductService {
static instance: LoanProductService
static getInstance() {
if (!LoanProductService.instance) {
LoanProductService.instance = new LoanProductService()
}
return LoanProductService.instance
}
addLoan(
data: {
apply_cond: string
apply_to: string
features:string
guarantee_type:eGuaranteeType
inst_name:string
loan_type:eProductType
max_amount:string
max_date:string
product_name:string
products:string
rate_lower:string
rate_upper:string
submit_cond:string
}
){
return baseAxios({
url: '/loan/admin/list',
method: 'POST',
data,
})
}
queryDirectLoanReq(data: {
end_time?: number
limit?: number
loan_type:eProductType
offset:number
product_status:eProductStatus
start_time?:number
}) {
return baseAxios({
url: '/loan/admin/list',
method: 'POST',
data,
})
}
}
\ No newline at end of file
......@@ -27,18 +27,6 @@ export default class StaffService {
})
}
// getBranchList(data:{
// level:number,
// page:number,
// pageSize:number,
// parentID:number
// }) {
// return baseAxios({
// url: '/staff/' + uuid,
// method: 'delete',
// })
// }
import(data: { staffs: iStaffItem[] }) {
return baseAxios({
url: '/staff/import',
......@@ -51,7 +39,7 @@ export default class StaffService {
leve: eLevel
page: number
page_size: number
parent_id: number
parent_id?: number
}) {
return baseAxios({
url: '/staff/branch',
......@@ -59,4 +47,6 @@ export default class StaffService {
data,
})
}
}
export enum eGuaranteeType{
credit=1,
mortgage=2,
uarantee=3,
discount=4,
composite=5,
Pledge=6
}
export enum eProductStatus{
all=0,
unpublished=1,
normal=2,
hot=3
}
export enum eProductType{
all=0,
company=1,
identity=2
}
\ No newline at end of file
This diff is collapsed.
<template>
<div>
<p class=" text-2xl font-bold mb-5">用户管理</p>
<p class="text-2xl font-bold mb-5">用户管理</p>
<div>
<!-- 级联选择 -->
<a-cascader :disabled="search.length == 0? false:true"
v-model="value"
:options="options"
change-on-select
placeholder="通过选择搜索"
style=" width:40%;margin-right:15px;"/>
<a-cascader
:disabled="search.length == 0 ? false : true"
v-model="value"
@change="handleChange"
placeholder="通过选择搜索"
style="width: 40%; margin-right: 15px"
/>
<!-- 搜索框 -->
<a-input :disabled="value.length == 0? false:true" placeholder="通过输入详细地址搜索" v-model="search" style="width: 20%; margin-right:15px;"/>
<a-input
:disabled="value.length == 0 ? false : true"
placeholder="通过输入详细地址搜索"
v-model="search"
style="width: 20%; margin-right: 15px"
/>
<!-- 操作 -->
<a-button type="primary" style=" margin-right:10px;" @click="query">查询</a-button>
<a-button type="primary" style=" margin-right:10px;" @click="reset">重置</a-button>
<a-button type="primary" style="margin-right: 10px" @click="query"
>查询</a-button
>
<a-button type="primary" style="margin-right: 10px" @click="reset"
>重置</a-button
>
</div>
</div>
</template>
......@@ -23,7 +33,10 @@ import Vue from 'vue'
import { Cascader} from 'ant-design-vue'
import { options } from '@/mock/index'
import { message } from 'ant-design-vue'
import StaffService from "@/service/StaffService";
import { getUserMsg } from "@/utils/userMsg/userMsg"
import { eLevel } from '@/types/level';
import { PAGE_SIZE } from "@/const/config/page"
Vue.use(Cascader)
Vue.prototype.$message = message
......@@ -37,11 +50,30 @@ export default Vue.extend({
return{
search:'',
value:[],
casDisabled:false,
inputDisabled:false
}
},
mounted(){
this.getBranchList()
},
methods:{
handleChange(){
// 调用请求接口
console.log(1);
this.getBranchList()
},
async getBranchList(){
const userLevel = getUserMsg()?.level
console.log("level",userLevel);
const ret = StaffService.getInstance().getBranch({
leve:userLevel as eLevel,
page:5,
page_size:PAGE_SIZE,
});
console.log(ret);
},
query(){
if( this.value.length==0 && this.search.length == 0 ){
this.$message.info('请通过选择或者输入详细地址搜索')
......@@ -49,7 +81,7 @@ export default Vue.extend({
const search:string|Array<string> = this.value.length==0? this.search:this.value
console.log(search)
}
this.$router.push({name:'firstLevel'})
// this.$router.push({name:'firstLevel'})
},
reset(){
this.value = []
......
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