Commit 3ba829d9 authored by xhx's avatar xhx

消息资讯

parents 4be7af52 172f8488
<template>
<!-- 上传概要图片 -->
<div class="border-dotted border-2 p-4 mb-5">
<div class="border-dotted border-2 p-4 mb-5" :path="path">
<a-upload
name="uploadFile"
list-type="picture-card"
class="avatar-uploader"
:show-upload-list="false"
action="/proxyApi/api/v1/image/upload"
:accept="ACCEPT_IMAGE_TYPE"
:before-upload="beforeUpload"
@change="handleChange"
>
<img v-if="imgUrl" :src="imgUrl" alt="avatar" />
<img v-if="imageUrl" :src="imageUrl" alt="图片不存在" />
<div v-else>
<a-icon :type="loading ? 'loading' : 'plus'" />
<div class="ant-upload-text">
......@@ -24,7 +25,14 @@
<script lang="ts">
import Vue from 'vue'
import { message } from 'ant-design-vue'
import FileService from '@/service/FileService/index'
import {
ACCEPT_IMAGE_TYPE,
isAcceptImageType,
TOAST_TEXT,
TOAST_TEXT2,
MAX_IMAGE_SIZE,
} from '@/const/config/upload'
function getBase64(img: Blob, callback: (any: any) => void) {
const reader = new FileReader();
......@@ -33,15 +41,23 @@ function getBase64(img: Blob, callback: (any: any) => void) {
}
export default Vue.extend({
data(){
return{
// imageUrl: "",
loading: false
props:{
path:{
type:String,
required:true
}
},
watch:{
path(newV,oldV){
this.imageUrl = newV
}
},
props: {
imgUrl: {
type: String
data(){
return{
imageUrl: "",
loading: false,
ACCEPT_IMAGE_TYPE,
file_name:'',
}
},
methods:{
......@@ -51,22 +67,26 @@ export default Vue.extend({
return;
}
if (info.file.status === 'done') {
const res = info.file.response?.data
const imageUrl = new FileService().getImageSrc(res)
this.$emit('update:imgUrl', imageUrl)
}
},
beforeUpload(file:File) {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
if (!isJpgOrPng) {
message.error('You can only upload JPG file!');
}
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isLt2M) {
message.error('Image must smaller than 2MB!');
// get file_hash
this.file_name = info.file.response.data
this.$emit('getFileHash',this.file_name)
getBase64(info.file.originFileObj, imageUrl => {
this.imageUrl = imageUrl;
this.loading = false;
});
}
return isJpgOrPng && isLt2M;
},
beforeUpload(file: File) {
const isAccpet = isAcceptImageType(file)
if (!isAccpet) {
message.error(TOAST_TEXT)
}
const isLt4M = file.size < MAX_IMAGE_SIZE
if (!isLt4M) {
message.error(TOAST_TEXT2)
}
return isAccpet && isLt4M
},
}
})
</script>
......@@ -85,4 +105,4 @@ export default Vue.extend({
margin-top: 8px;
color: #666;
}
</style>
\ No newline at end of file
</style>
<template>
<div class=" border border-gray-300 p-3 rounded">
<EditorMenuBar :editor="editor"/>
<div class="border border-gray-300 p-3 rounded" >
<EditorMenuBar :editor="editor" />
<editor-content :editor="editor" class="editor__content" />
</div>
</template>
<script lang="ts">
import Vue from 'vue'
import { Editor, EditorContent } from '@tiptap/vue-2'
import StarterKit from '@tiptap/starter-kit'
import {Image as Timage} from '@tiptap/extension-image'
import EditorMenuBar from './editorMenuBar.vue'
// async function handleUpload(file) {
// const ret = await upload(file);
// if (ret && ret.code === 200) {
// return ret.data.url;
// } else {
// return "";
// }
// }
import Vue from "vue";
import { Editor, EditorContent } from "@tiptap/vue-2";
import StarterKit from "@tiptap/starter-kit";
import { Image as Timage } from "@tiptap/extension-image";
import EditorMenuBar from "./editorMenuBar.vue";
export default Vue.extend({
components: {
EditorContent,
EditorMenuBar,
},
props:{
visible:{
type:Boolean,
default:true
props: {
visible: {
type: Boolean,
default: true,
},
text: {
type: String,
required: true,
default:''
},
editorContent: {
type: String
},
watch:{
text(newV,oldV){
this.editor.commands.insertContent(newV)
}
},
data(){
let editor:any = undefined
data() {
let editor: any = undefined;
return {
editor,
// content:''
}
};
},
mounted(){
mounted() {
this.editor = new Editor({
onUpdate: () => {
// this.content = this.editor.getHTML()
// this.$emit('getContent',this.content)
const content = this.editor.getHTML()
this.$emit('update:editorContent', content)
const content = this.editor.getHTML();
this.$emit("update:editorContent", content);
},
extensions: [
StarterKit,
Timage,
],
content: this.editorContent,
autofocus: 'start',
})
extensions: [StarterKit, Timage],
autofocus: "start",
});
},
beforeDestroy() {
this.editor.destroy()
this.editor.destroy();
},
})
});
</script>
<style lang="scss">
.editor__content {
min-height: 400px;
img{
img {
display: block;
margin: 0 auto;
}
......@@ -76,12 +66,11 @@ export default Vue.extend({
/* Placeholder (at the top) */
.ProseMirror p.is-editor-empty:first-child::before {
content: '请输入文章正文';
content: "请输入文章正文";
float: left;
color: #ced4da;
pointer-events: none;
height: 0;
font-style: italic;
}
</style>
\ No newline at end of file
</style>
......@@ -12,8 +12,8 @@
<template #created_at="text">
{{ text | formatDate }}
</template>
<template #status="text">
{{ text | platformfilterUserStatus }}
<template #name="text">
{{ text +1 }}
</template>
<div slot="action" slot-scope="text, record">
<a
......
export enum modalType {
add,
remove,
common,
hot,
delete,
}
<template>
<div>
<a-input placeholder="产品名称模糊搜索" v-model="searchPageReqParams.name" style=" width:150px; margin-right:10px;"/>
<span class=" font-semibold">创建时间:</span>
<timerange class=" mr-3"
@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;"
v-model="searchPageReqParams.type"
<a-input
placeholder="产品名称模糊搜索"
v-model="searchPageReqParams.name"
style="width: 150px; margin-right: 10px"
/>
<span class="font-semibold">创建时间:</span>
<timerange
class="mr-3"
@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"
v-model="searchPageReqParams.type"
>
<a-select-option v-for="(type,i) in productType" :key="i">
{{type}}
<a-select-option v-for="(type, i) in productType" :key="i">
{{ type }}
</a-select-option>
</a-select>
<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" @click="$router.push({name:'publishLoanProduct'})">发布</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
>
<a-button
type="primary"
@click="$router.push({ name: 'publishLoanProduct' })"
>发布</a-button
>
</div>
</template>
<script lang="ts">
import Vue, { PropType } from 'vue'
import timerange from '@/components/TimePicker/index.vue'
import Vue, { PropType } from "vue";
import timerange from "@/components/TimePicker/index.vue";
import LoanProductService from "@/service/LoanProductService/index";
import { PAGE_SIZE } from "@/const/config/page";
import { mapActions, mapMutations, mapState } from 'vuex'
export default Vue.extend({
components:{ timerange },
props:{
productType:{
type:Array as PropType<String[]>,
default(){
return [ '全部','企业','个人']
}
}
components: { timerange },
props: {
productType: {
type: Array as PropType<String[]>,
default() {
return ["全部", "企业", "个人"];
},
},
},
data(){
computed:{
...mapState('loanProductManagement', [
'start_time',
'end_time',
'name',
'loan_type',
]),
},
data() {
return {
searchPageReqParams: {
name: '',
type: '',
name: "",
type: "",
startTime: undefined as undefined | number,
endTime: undefined as undefined | number,
offset: 0,
limit: PAGE_SIZE,
},
};
},
watch: {
searchPageReqParams: {
deep: true,
handler(newV) {
this.productSave({
name: newV.name,
start_time: newV.startTime,
end_time: newV.endTime,
loan_type: newV.type,
})
},
}
},
},
methods:{
getNewTime(startTime:number,endTime:number){
this.searchPageReqParams.startTime = startTime
this.searchPageReqParams.endTime = endTime
methods: {
...mapMutations('loanProductManagement', {
productSave: 'save',
}),
...mapActions('loanProductManagement', {
productQuery: 'query',
}),
getNewTime(startTime: number, endTime: number) {
this.searchPageReqParams.startTime = startTime;
this.searchPageReqParams.endTime = endTime;
},
query(){
console.log(this.searchPageReqParams);
query() {
this.productSave({
page: 1,
})
this.productQuery()
},
reset(){
this.searchPageReqParams.name = ''
this.searchPageReqParams.type = ''
this.searchPageReqParams.startTime = undefined
this.searchPageReqParams.endTime = undefined
reset() {
this.searchPageReqParams.name = "";
this.searchPageReqParams.type = "";
this.searchPageReqParams.startTime = undefined;
this.searchPageReqParams.endTime = undefined;
this.$nextTick(() => {
this.productSave({
page: 1,
})
this.query()
})
},
}
})
},
});
</script>
<style scoped>
</style>
\ No newline at end of file
......@@ -3,7 +3,8 @@ const columns:Array<column>=[
{
title: '发布时间',
align:'center',
dataIndex: 'time',
dataIndex: 'created_at',
scopedSlots: { customRender: 'created_at' },
},
{
title: '活动标题',
......@@ -19,12 +20,12 @@ const columns:Array<column>=[
{
title: '状态',
align:'center',
dataIndex: 'state',
dataIndex: 'activity_status',
scopedSlots: { customRender: 'activity_status' },
},
{
title: '操作',
align:'center',
dataIndex: 'action',
scopedSlots: { customRender: 'action' },
}
]
......
......@@ -3,36 +3,39 @@ export default[
title: '发布时间',
align: 'center',
dataIndex: 'created_at',
scopedSlots: { customRender: 'created_at' },
},
{
title: '产品名称',
align: 'center',
dataIndex: 'product_name',
scopedSlots: { customRender: 'name' },
},
{
title: '产品分类',
align: 'center',
dataIndex: 'product_type',
scopedSlots: { customRender: 'product_type' },
},
{
title: '贷款期限(月)',
align: 'center',
dataIndex: 'deadline',
scopedSlots: { customRender: 'date' },
},
{
title: '参考利率(%)',
align: 'center',
dataIndex: 'interst',
scopedSlots: { customRender: 'rate' },
},
{
title: '贷款额度(万元)',
align: 'center',
dataIndex: 'limit',
scopedSlots: { customRender: 'amount' },
},
{
title: '担保方式',
align: 'center',
dataIndex: 'guarantee_type',
scopedSlots: { customRender: 'guarantee_type' },
},
{
title: '产品介绍',
......@@ -63,6 +66,7 @@ export default[
title: '状态',
align: 'center',
dataIndex: 'product_status',
scopedSlots: { customRender: 'product_status' },
},
{
title: '操作',
......
import { eBannerLocation, eBannerStatus } from '@/types/banner'
import { eUserStatus } from '@/types/user'
import { eGuaranteeType,eProductStatus,eProductType} from '@/types/loanProduct'
import { editableProductStatus,eGuaranteeType,eProductType} from '@/types/loanProduct'
import { activityStatus } from "@/service/ActivityService/type"
import moment from 'moment'
export default {
......@@ -52,26 +53,46 @@ export default {
return '已发布'
}
},
filterGuaranteeType(type:eProductType) {
filterLoanType(type:eProductType) {
switch (type) {
case eProductType.all:
return '全部贷款'
case eProductType.all:
case eProductType.company:
return '企业贷款'
case eProductType.identity:
return '个人贷款'
}
},
filterProductStatus(status:eProductStatus) {
filterGuaranteeType(type:eGuaranteeType) {
switch (type) {
case eGuaranteeType.credit:
return '信用'
case eGuaranteeType.mortgage:
return '抵押'
case eGuaranteeType.guarantee:
return '保证'
case eGuaranteeType.discount:
return '贴现'
case eGuaranteeType.composite:
return '综合'
case eGuaranteeType.pledge:
return '质押'
}
},
filterProductStatus(status:editableProductStatus) {
switch (status) {
case eProductStatus.all:
return '全部状态'
case eProductStatus.unpublished:
case editableProductStatus.unpublished:
return '未发布'
case eProductStatus.normal:
return '普通'
case eProductStatus.hot:
return '热门'
case editableProductStatus.normal:
return '已发布/普通'
case editableProductStatus.hot:
return '已发布热门'
}
},
filterActivitytatus(status:activityStatus) {
switch (status) {
case activityStatus.editable:
return '待发布'
case activityStatus.published:
return '已发布'
}
},
} as {
......
......@@ -64,7 +64,7 @@ const router = new VueRouter({
})
router.beforeEach((to, from, next) => {
console.log({ from, to })
// console.log({ from, to })
const usermsg = getUserMsg()
if (usermsg === undefined) {
......@@ -80,17 +80,17 @@ router.beforeEach((to, from, next) => {
/* 有登录 */
const roles = (to.meta as { roles?: eRole[] }).roles
const oldRole = getOldRoleFromUserMsg(usermsg)
console.log(oldRole, roles, oldRole && roles && roles.includes(oldRole))
// console.log(oldRole, roles, oldRole && roles && roles.includes(oldRole))
const userHasRoleInCurPage = oldRole !== undefined && roles !== undefined && roles.includes(oldRole)
if (userHasRoleInCurPage) {
console.log(1)
// console.log(1)
next()
} else {
if (oldRole == eRole.platform_management) {
console.log(2)
// console.log(2)
next({ name: 'platformUserManagement' })
} else {
console.log(3)
// console.log(3)
next({ name: 'home' })
}
}
......
import baseAxios from '../index'
const prefix = '/activity/admin'
import { eActivityItem } from "./type"
export default class ActivityService {
static instance: ActivityService
static getInstance() {
if (!ActivityService.instance) {
ActivityService.instance = new ActivityService()
}
return ActivityService.instance
}
addActivity(
data: {
content: string
file_name: string
title: string
}
) {
return baseAxios({
url: prefix + '/add',
method: 'POST',
data,
})
}
queryActivityList(
data: {
activity_status: number
end_time?: number
limit?: number
offset?: number
start_time?: number
}
) {
return baseAxios<{
count: number,
items: eActivityItem[],
total: number
}>({
url: prefix + '/list',
method: 'POST',
data,
})
}
queryActivityInfo(uuid: string) {
return baseAxios<{
count: number,
items: eActivityItem[],
total: number
}>({
url: '/activity/query/info?uuid='+uuid,
method: 'GET',
})
}
modifyActivity(data: {
content: string
file_name: string
title: string
uuid:string
}) {
return baseAxios({
url: prefix + '/modify',
method: 'POST',
data,
})
}
modifyActivityStatus(data: {
activity_status: number,
uuid: string,
}) {
return baseAxios({
url: prefix + '/modify/status',
method: 'POST',
data,
})
}
deleteActivity(uuid: string) {
return baseAxios({
url: prefix + '/delete?uuid=' + uuid,
method: 'DELETE',
})
}
}
\ No newline at end of file
export enum activityStatus{
all=0,
editable=1, //未发布
published=2 //已发布
}
export interface eActivityItem{
activity_status:activityStatus,
content:string,
created_at:number,
file_name:string,
title:string,
update_at:number,
uuid:string
}
import baseAxios from '../index'
import { eProductType,eProductStatus,eGuaranteeType } from "@/types/loanProduct"
import { eProductType, eProductStatus, eGuaranteeType, editableProductStatus } from "@/types/loanProduct"
import { iLoanProdcutItem } from "./type"
const prefix = '/loan/admin'
export default class LoanProductService {
static instance: LoanProductService
......@@ -14,39 +16,98 @@ export default class LoanProductService {
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
}
){
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
min_date: string
min_amount: string
}
) {
return baseAxios({
url: '/loan/admin/list',
url: prefix + '/add',
method: 'POST',
data,
})
}
queryDirectLoanReq(data: {
end_time?: number
limit?: number
loan_type:eProductType
offset:number
product_status:eProductStatus
start_time?:number
}) {
modifyLoan(
data: {
apply_cond: string
apply_to: string
features: string
guarantee_type: eGuaranteeType
inst_name: string
product_type: eProductType
max_amount: string
max_date: string
product_name: string
products: string
rate_lower: string
rate_upper: string
submit_cond: string
min_amount: string
min_date: string
uuid:string
}
) {
return baseAxios({
url: prefix + '/modify',
method: 'POST',
data,
})
}
modifyLoanStatus(data: {
product_status: editableProductStatus,
uuid: string
}) {
return baseAxios({
url: '/loan/admin/list',
url: prefix + '/modify/status',
method: 'POST',
data,
})
}
queryDirectLoanReq(data: {
end_time?: number
limit?: number
loan_type: eProductType
offset?: number
product_status: eProductStatus
start_time?: number
}) {
return baseAxios<{
count: number
items: iLoanProdcutItem[]
total: number
}>({
url: prefix + '/list',
method: 'POST',
data,
})
}
queryInfo(uuid: string) {
return baseAxios({
url: '/loan/query/info?uuid=' + uuid,
method: 'get',
})
}
deleteLoanItem(uuid: string) {
return baseAxios({
url: prefix + '/delete?uuid=' + uuid,
method: 'delete',
})
}
}
\ No newline at end of file
export interface iLoanProdcutItem{
apply_cond: string,
apply_to: string,
created_at: number,
features: string,
guarantee_type: number,
inst_name: string,
max_amount: string,
max_date: string,
min_amount: string,
min_date: string,
product_name: string,
product_status: number,
product_type: number,
products: string,
rate_lower: string,
rate_upper: string,
submit_cond: string,
update_at: number,
uuid: string
}
\ No newline at end of file
......@@ -160,7 +160,7 @@ export default class UserService {
total: number
}>({
method: 'get',
url: '/admin/query/banks',
url: '/query/banks',
})
}
}
......
import { eProductType, eProductStatus } from "@/types/loanProduct"
import { PAGE_SIZE } from '@/const/config/page'
import LoanProductService from "@/service/LoanProductService/index"
import { Module } from 'vuex'
import { iListItem, iProductModuleState } from './type'
export default <Module<iProductModuleState, {}>>{
namespaced: true,
state: {
list: [] as iListItem[],
end_time:undefined,
limit: PAGE_SIZE,
loan_type: eProductType.all,
offset: 0,
product_status: eProductStatus.all,
start_time: undefined,
loading:false,
total:0,
page: 1,
name:''
},
mutations: {
save(state, payload) {
Object.assign(state, payload)
},
},
actions: {
async query({ state, commit }, payload) {
state.loading = true
const ret = await LoanProductService.getInstance().queryDirectLoanReq({
end_time: state.end_time as number,
limit: state.limit,
loan_type: 0,
offset: state.offset as number,
product_status: 0,
start_time: state.start_time as number,
})
if (ret.code === 200) {
commit('save', {
list: ret.data.items,
total: ret.data.total,
})
state.loading = false
}
},
},
}
import { eProductType, eProductStatus } from "@/types/loanProduct"
export interface iListItem {
apply_cond: string,
apply_to: string,
created_at: number,
features: string,
guarantee_type: number,
inst_name: string,
max_amount: string,
max_date: string,
min_amount: string,
min_date: string,
product_name: string,
product_status: number,
product_type: number,
products: string,
rate_lower: string,
rate_upper: string,
submit_cond: string,
update_at: number,
uuid: string
}
export interface iProductModuleState {
list: iListItem[]
end_time: number | undefined
limit: number | undefined
loan_type: eProductType
offset: number | undefined
product_status: eProductStatus
start_time: number | undefined
total: number
page:number
name:string
loading: boolean
}
......@@ -2,16 +2,19 @@ import Vue from 'vue'
import Vuex from 'vuex'
import platformUserManagement from './platformUserManagement/index'
import { iPlatformModuleState } from './platformUserManagement/types'
import loanProductManagement from './LoanProductManagement/index'
import { iProductModuleState } from './LoanProductManagement/type'
Vue.use(Vuex)
const store = new Vuex.Store<{ platformUserManagement?: iPlatformModuleState }>(
const store = new Vuex.Store<{ platformUserManagement?: iPlatformModuleState,loanProductManagement?:iProductModuleState }>(
{
state: {},
mutations: {},
actions: {},
modules: {
platformUserManagement,
loanProductManagement,
},
},
)
......
export enum eGuaranteeType{
credit=1,
mortgage=2,
uarantee=3,
guarantee=3,
discount=4,
composite=5,
Pledge=6
pledge=6
}
export enum eProductStatus{
......@@ -14,8 +14,14 @@ export enum eProductStatus{
hot=3
}
export enum editableProductStatus{
unpublished=1,
normal=2,
hot=3
}
export enum eProductType{
all=0,
company=1,
identity=2
}
\ No newline at end of file
}
export enum eRole {
platform_management, // 平台管理员
platform_management, // 平台管理员 admin admin
superManager, // 超级管理员 也叫 银行管理员
firstLevel_branch, // 一级分行管理员
......
......@@ -157,33 +157,38 @@ function parseJSYHSheet(Sheet: any) {
/* 只能解析xlsx文件 accpet设置 .xlsx */
export const handle建设银行excelFileChange = (e: Event) => {
const files = (e.target as HTMLInputElement).files
if (files && files.length !== 0) {
const f = files[0]
var reader = new FileReader()
reader.onload = function (e) {
var data = new Uint8Array(
((e.target as any).result as unknown) as ArrayBufferLike,
)
var workbook = xlsx.read(data, { type: 'array' })
/* DO SOMETHING WITH workbook HERE */
return new Promise((resolve) => {
const files = (e.target as HTMLInputElement).files
if (files && files.length !== 0) {
const f = files[0]
var reader = new FileReader()
reader.onload = function (e) {
var data = new Uint8Array(
((e.target as any).result as unknown) as ArrayBufferLike,
)
var workbook = xlsx.read(data, { type: 'array' })
/* DO SOMETHING WITH workbook HERE */
const Sheets = workbook.Sheets
const SheetsKeys = Object.keys(Sheets)
if (SheetsKeys.length !== 0) {
const list = (parseJSYHSheet(Sheets[SheetsKeys[0]]) as unknown) as any[]
const locationList = getAddressList((list as unknown) as any)
console.log(JSON.stringify(locationList))
getAddressLalonObj(locationList).then((addressLalonObj) => {
list.forEach((data) => {
data.la_lon = addressLalonObj[data.location]
const Sheets = workbook.Sheets
const SheetsKeys = Object.keys(Sheets)
if (SheetsKeys.length !== 0) {
const list = (parseJSYHSheet(
Sheets[SheetsKeys[0]],
) as unknown) as any[]
const locationList = getAddressList((list as unknown) as any)
console.log(JSON.stringify(locationList))
getAddressLalonObj(locationList).then((addressLalonObj) => {
list.forEach((data) => {
data.la_lon = addressLalonObj[data.location]
})
console.log(list, 'show list')
resolve(list)
})
console.log(list, 'show list')
})
} else {
throw new Error('excel文件无Sheet')
} else {
throw new Error('excel文件无Sheet')
}
}
reader.readAsArrayBuffer(f)
}
reader.readAsArrayBuffer(f)
}
})
}
......@@ -12,7 +12,7 @@ export async function getSelfOutLet(): Promise<iOutLet> {
const data: iOutLet = ret.data
localStorage.setItem(OUT_LET, JSON.stringify(data))
} else {
throw new Error('用户网点信息获取失败F')
throw new Error('用户网点信息获取失败')
}
}
const storage = localStorage.getItem(OUT_LET)
......
......@@ -219,6 +219,7 @@ export default Vue.extend({
const ret = await UserService.getInstance().login({
is_admin: isAdminAccount,
use_pwd: true,
phone: isAdminAccount ? undefined : name,
pwd,
});
console.log(ret);
......
<template>
<div>
<p class=" text-2xl font-bold mb-5 ">{{title}}</p>
<p class=" text-gray-400">发布时间:{{time}} <span class=" ml-2">作者:{{name}}</span></p>
<p class="text-left p-5">{{content}}</p>
<p class="text-2xl font-bold mb-5">{{ title }}</p>{{$route.query.id}}
<p class="text-gray-400">发布时间:{{ time | formatDate }}</p>
<img v-if="imageUrl" :src="imageUrl" class=" mx-auto my-5" />
<p class="text-left p-5" v-html="content">{{ content }}</p>
</div>
</template>
<script lang="ts">
import Vue from 'vue'
import Vue from "vue";
import ActivityService from "@/service/ActivityService/index";
import { eActivityItem } from "@/service/ActivityService/type";
import FileService from "@/service/FileService/index";
export default Vue.extend({
data(){
return{
title:'银保监会、人民银行联合出台现金管理类理财产品监管规则',
time:'2021-07-01',
name:'丁洁',
content:'“中国冰雪大篷车”是国家体育总局深入推进冰雪运动“南展西扩东进”战略,落实“带动三亿人参与冰雪运动”目标的重要群众性活动之一。“中国冰雪大篷车”将在为期半年的时间里,深入全国30余个城市,举办100场线下活动,同时结合持续的线上互动,以创新的体验模式、丰富的活动内容和众多的展示渠道,普及冰雪运动常识,推广冰雪运动理念,让普通大众在家门口就能感受冰雪运动的乐趣。'
data() {
return {
uuid: "",
title: "",
file_name: undefined as undefined | string,
time: 0,
content: "",
imageUrl: "",
};
},
async mounted() {
this.uuid = this.$route.params.uuid;
const ret = await ActivityService.getInstance().queryActivityInfo(
this.uuid
);
if (ret.code == 200) {
const item: eActivityItem = ret.data as unknown as eActivityItem;
this.title = item.title;
this.time = item.created_at;
this.content = item.content;
this.file_name = item.file_name;
}
}
})
if (this.file_name) {
this.imageUrl = FileService.getInstance().getImageSrc(this.file_name)
}
},
});
</script>
\ No newline at end of file
<template>
<div>
<p class=" text-2xl font-bold mb-5">活动管理</p>
<p class="text-2xl font-bold mb-5">活动管理</p>
<!-- 搜索框 -->
<a-input placeholder="活动名称模糊搜索" v-model="searchPageReqParams.name" style="width: 150px; margin-right:10px;"/>
<!-- timepicker -->
<span class=" font-semibold">注册时间:</span>
<timerange class=" mr-3"
@getNewTime="getNewTime"/>
<a-input
placeholder="活动名称模糊搜索"
v-model="searchPageReqParams.name"
style="width: 150px; margin-right: 10px"
/>
<!-- timepicker -->
<span class="font-semibold">注册时间:</span>
<timerange
class="mr-3"
:startTime="searchPageReqParams.startTime"
:endTime="searchPageReqParams.endTime"
@getNewTime="getNewTime"
/>
<!-- 操作 -->
<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" @click="release">发布</a-button>
<!-- 资讯列表 -->
<a-table
:columns="columns"
:data-source="list"
style="text-align: center; margin-top: 40px"
bordered
:loading="tableLoading"
:pagination="false"
>
<template #created_at="text">
{{ text | formatDate }}
</template>
<template #activity_status="text">
{{ text | filterActivitytatus }}
</template>
<!-- 新闻内容 -->
<span slot="content" slot-scope="text, record">
<a @click="toDetail(record)">查看</a>
</span>
<!-- 操作 -->
<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" @click="release">发布</a-button>
<!-- 资讯列表 -->
<a-table :columns="columns" :data-source="list" style=" text-align: center; margin-top:40px;" bordered >
<!-- 新闻内容 -->
<span slot="content" slot-scope="text,record">
<a @click="toDetail(record.key)">查看</a>
</span>
<!-- 操作 -->
<span slot="action" slot-scope="text,record">
<a v-if="record.state=='已下架'"
@click="add(record.key)">
上架
</a>
<a v-else
@click="remove(record.key)">
下架
</a>
<span slot="action" slot-scope="text, record">
<span v-if="record.activity_status == activityStatus.editable">
<a @click="add(record)"> 上架 </a>
<a-divider type="vertical" />
<a @click="edit(record)"> 编辑 </a>
<a-divider type="vertical" />
<a @click="onDelete(record.key)">
删除
</a>
<a @click="onDelete(record)"> 删除 </a>
</span>
</a-table>
<!-- 操作Modal -->
<a-modal
:title="title"
v-model="show"
:centered="true"
:closable="false"
@ok="handleOk"
@cancle="show = false"
>
<p class=" text-center">{{text}}</p>
</a-modal>
<a v-else @click="remove(record)"> 下架 </a>
</span>
</a-table>
<a-pagination
class="text-right mt-4"
:current="current"
:total="total"
:pageSize="PAGE_SIZE"
@change="handlePaginationChange"
></a-pagination>
<!-- 操作Modal -->
<a-modal
:title="title"
v-model="show"
:centered="true"
:closable="false"
@ok="handleOk"
:confirmLoading="modalLoading"
@cancle="show = false"
>
<p class="text-center">{{ text }}</p>
</a-modal>
</div>
</template>
<script lang="ts">
import Vue from 'vue'
import { activityList } from '@/mock/index'
import { columns } from '@/const/columns/activityColumn'
import { modal } from './const'
import timerange from '@/components/TimePicker/index.vue'
import Vue from "vue";
import { columns } from "@/const/columns/activityColumn";
import { modal } from "./const";
import timerange from "@/components/TimePicker/index.vue";
import ActivityService from "@/service/ActivityService/index";
import { eActivityItem, activityStatus } from "@/service/ActivityService/type";
import { PAGE_SIZE } from "@/const/config/page";
export default Vue.extend({
components:{ timerange },
computed:{
columns(){
return columns
components: { timerange },
computed: {
columns() {
return columns;
},
current(): number {
return this.searchPageReqParams.offset / PAGE_SIZE + 1;
},
list(){
return activityList
}
},
data(){
return{
data() {
return {
searchPageReqParams: {
name: '',
name: "",
startTime: undefined as undefined | number,
endTime: undefined as undefined | number,
offset: 0,
},
show:false,
title:'',
type:modal.on,
text:'',
}
show: false,
title: "",
type: modal.on,
text: "",
activityStatus,
uuid: "",
modalLoading: false,
list: [] as eActivityItem[],
total: 0,
tableLoading:false,
PAGE_SIZE
};
},
methods:{
query(){
console.log(this.searchPageReqParams);
mounted() {
this.fetchList();
},
methods: {
handlePaginationChange(current: number) {
this.searchPageReqParams.offset = (current - 1) * PAGE_SIZE;
console.log(current,this.searchPageReqParams.offset );
this.fetchList();
},
getNewTime(startTime:number,endTime:number){
this.searchPageReqParams.startTime = startTime
this.searchPageReqParams.endTime = endTime
fetchList() {
this.tableLoading = true
ActivityService.getInstance()
.queryActivityList({
activity_status: activityStatus.all,
end_time: this.searchPageReqParams.endTime,
limit: PAGE_SIZE,
offset: this.searchPageReqParams.offset,
start_time: this.searchPageReqParams.startTime,
})
.then((ret) => {
if (ret.code === 200) {
this.list = ret.data.items;
this.total = ret.data.total;
this.tableLoading = false
}
});
},
reset(){
this.searchPageReqParams.name =''
this.searchPageReqParams.startTime = undefined
this.searchPageReqParams.endTime = undefined
query() {
this.fetchList();
},
release(){
this.$router.push({name:'publishActivity'})
getNewTime(startTime: number, endTime: number) {
this.searchPageReqParams.startTime = startTime;
this.searchPageReqParams.endTime = endTime;
},
edit(key:string){
this.$router.push({name:'publishActivity',query:{key:key}})
reset() {
this.searchPageReqParams.name = "";
this.searchPageReqParams.startTime = undefined;
this.searchPageReqParams.endTime = undefined;
},
add(record:any){
this.type = modal.on
this.show = true
this.title = '上架资讯'
this.text = '确定上架该资讯吗?'
release() {
this.$router.push({ name: "publishActivity" });
},
remove(record:any){
this.type = modal.off
this.show = true
this.title = '下架活动'
this.text = '确定下架该活动吗?'
edit(record: any) {
this.$router.push({
name: "editActivity",
params: { uuid: record.uuid },
});
},
onDelete(record:any){
this.type = modal.delete
this.show = true
this.title = '删除活动'
this.text = '确定删除该活动吗?'
add(record: any) {
this.uuid = record.uuid;
this.type = modal.on;
this.show = true;
this.title = "上架资讯";
this.text = "确定上架该资讯吗?";
},
handleOk(record:any){
if( this.type == modal.on){
} else if( this.type == modal.off){
} else if( this.type == modal.delete){
}
this.show = false
remove(record: any) {
this.uuid = record.uuid;
this.type = modal.off;
this.show = true;
this.title = "下架活动";
this.text = "确定下架该活动吗?";
},
toDetail(key:string){
this.$router.push({name:'activityDetail',query:{key:key}})
}
}
})
onDelete(record: any) {
this.uuid = record.uuid;
this.type = modal.delete;
this.show = true;
this.title = "删除活动";
this.text = "确定删除该活动吗?";
},
handleOk(record: any) {
this.modalLoading = true;
try {
if (this.type == modal.on) {
ActivityService.getInstance().modifyActivityStatus({
uuid: this.uuid,
activity_status: activityStatus.published,
});
} else if (this.type == modal.off) {
ActivityService.getInstance().modifyActivityStatus({
uuid: this.uuid,
activity_status: activityStatus.editable,
});
} else if (this.type == modal.delete) {
ActivityService.getInstance().deleteActivity(this.uuid);
}
this.fetchList();
this.show = false;
} catch (err) {}
this.modalLoading = false;
},
toDetail(record: any) {
const uuid = record.uuid;
this.$router.push({ name: "activityDetail", params: { uuid: uuid } });
},
},
});
</script>
<template>
<div class=" editor">
<p class=" text-2xl font-bold mb-5">发布活动</p>
<input
v-model="title"
placeholder="请输入标题"
class="border-gray-300 border-2 px-3 py-2 w-full focus:outline-none focus:ring rounded"
/>
<!-- 上传概要图片 -->
<editor-upload/>
<!-- 编辑器 -->
<editor class="edit-news text-left" @getContent="getContent"/>
<!-- 发布操作 -->
<a-button type="primary" @click="onSubmit" class=" mt-5">确定发布</a-button>
<div class="editor">
<p class="text-2xl font-bold mb-5">发布活动</p>
<a-form-model :model="form" :rules="rules" ref="activityPublishForm">
<a-form-model-item prop="title">
<a-input v-model="form.title" placeholder="请输入标题" />
</a-form-model-item>
<!-- 上传概要图片 -->
<a-form-model-item prop="file_hash" ref="timeUploader" :autoLink="false">
<editor-upload @getFileHash="getFileHash" :path="file_src" />
</a-form-model-item>
<!-- 编辑器 -->
<a-form-model-item prop="content" ref="editor" :autoLink="false">
<editor
class="edit-news text-left"
@getContent="getContent"
:editorContent.sync="form.content"
:text="form.editableContent"
/>
</a-form-model-item>
<!-- 发布操作 -->
<a-button type="primary" @click="onSubmit" class="mt-5"
>确定发布</a-button
>
</a-form-model>
</div>
</template>
<script lang="ts">
import Vue from 'vue'
import Editor from '@/components/Editor/index.vue'
import EditorUpload from '@/components/Editor/editorUpload.vue'
import Vue from "vue";
import Editor from "@/components/Editor/index.vue";
import EditorUpload from "@/components/Editor/editorUpload.vue";
import ActivityService from "@/service/ActivityService/index";
import { message, FormModel } from "ant-design-vue";
import { eActivityItem } from "@/service/ActivityService/type";
import FileService from "@/service/FileService/index";
export default Vue.extend({
components:{ Editor,EditorUpload },
data(){
return{
title:'',
content:''
components: { Editor, EditorUpload },
data() {
return {
form: {
title: "",
content: "",
file_hash: "",
editableContent:"",
},
rules: {
title: [{ required: true, message: "请输入文章标题", trigger: "blur" }],
content: [
{ required: true, message: "请输入文章内容", trigger: "blur" },
],
file_hash: [
{ required: true, message: "请上传概要图片", trigger: "blur" },
],
},
uuid: "",
isEditable: false,
file_src: "",
};
},
created() {
this.isEditable = this.$route.name == "editActivity" ? true : false;
if (this.isEditable) {
this.uuid = this.$route.params.uuid;
ActivityService.getInstance()
.queryActivityInfo(this.uuid)
.then((ret) => {
const items: eActivityItem = ret.data as unknown as eActivityItem;
if (ret.code === 200) {
this.form.title = items.title;
this.form.editableContent = items.content;
this.form.file_hash = items.file_name;
if (this.form.file_hash) {
this.file_src = FileService.getInstance().getImageSrc(
this.form.file_hash
);
}
} else {
return;
}
});
}
},
methods:{
getContent(value:string){
this.content = value
methods: {
getContent(value: string) {
this.form.content = value;
(this.$refs.editor as any).onFieldBlur();
},
getFileHash(value: string) {
this.form.file_hash = value;
(this.$refs.timeUploader as any).onFieldBlur();
},
isValid(): boolean {
let isValid = false;
(this.$refs.activityPublishForm as FormModel).validate((valid) => {
if (valid) {
isValid = true;
} else {
isValid = false;
}
});
return isValid;
},
onSubmit() {
async onSubmit() {
if (this.isValid()) {
if (this.isEditable) {
const ret = await ActivityService.getInstance().modifyActivity({
title: this.form.title,
content: this.form.content,
file_name: this.form.file_hash,
uuid: this.uuid,
});
if (ret.code == 200) {
message.success("编辑成功");
this.$router.push({ name: "activity" });
} else {
return;
}
} else {
const ret = await ActivityService.getInstance().addActivity({
title: this.form.title,
content: this.form.content,
file_name: this.form.file_hash,
});
console.log(ret);
if (ret.code == 200) {
message.success("发布成功");
this.$router.push({ name: "activity" });
} else {
return;
}
}
} else {
return;
}
},
}
})
},
});
</script>
<style lang="scss">
</style>
\ No newline at end of file
......@@ -114,6 +114,7 @@
class="text-right mt-4"
:current="current"
:total="total"
:pageSize="PAGE_SIZE"
@change="handlePaginationChange"
></a-pagination>
<!-- 操作Modal -->
......@@ -207,6 +208,7 @@ export default Vue.extend({
{ required: true, message: '请上传文件', trigger: 'change' },
],
},
PAGE_SIZE,
showViewer: false,
url: '',
list,
......
......@@ -3,7 +3,7 @@
<p class=" text-2xl font-bold mb-5">消息管理</p>
<!-- 消息分类 -->
<span class=" mr-3">消息分类</span>
<a-select :default-value="1" style="width: 120px; margin-right:10px;">
<a-select :default-value="1" style="width: 120px; margin-right:10px;" v-model="form.type">
<a-select-option v-for="type in msgType" :key="type.value">{{ type.label }}</a-select-option>
</a-select>
<!-- 操作 -->
......@@ -125,10 +125,6 @@ export default Vue.extend({
type:Array,
default(){
return [
// {
// label: '全部',
// value: 0
// },
{
label: '滚动通知',
value: 1
......@@ -146,12 +142,13 @@ export default Vue.extend({
},
methods:{
getList() {
console.log(this.form.type)
notify.notifyList({
limit: this.pagination.defaultPageSize,
offset: (this.pagination.current - 1) * this.pagination.defaultPageSize,
notify_status: 0,
// notify_type: this.form.type
notify_type: 0
notify_type: this.form.type
// notify_type: 0
}).then(res => {
this.list = res.data.items
this.pagination.total = res.data.total
......
......@@ -166,6 +166,8 @@ export default Vue.extend({
const searchParams = this.searchPageReqParams.article_type === 1 ? "searchByPolicy" : "searchByTitle"
news[searchParams]({title: this.searchPageReqParams.title}).then(res => {
console.log(res)
this.list = res.data.items
this.pagination.total = res.data.total
})
},
query(){
......
......@@ -12,11 +12,11 @@
</a-select>
</div>
<!-- 上传概要图片 -->
<editor-upload class=" mt-5" :imgUrl.sync="imgUrl" />
<editor-upload class=" mt-5" :path="imageUrl" @getFileHash="getImage" />
<!-- 文章概要 -->
<a-textarea v-model="summary" :maxLength="50" placeholder="请输入文章概要,字数限制50字以内" auto-size />
<!-- 编辑器 -->
<editor class="edit-news text-left mt-5" :editorContent.sync="content"
<editor class="edit-news text-left mt-5" :text="editableContent" :editorContent.sync="content"
@getContent="getContent"/>
<!-- 发布操作 -->
<a-button type="primary" @click="onSubmit" class=" mt-5">确定发布</a-button>
......@@ -28,6 +28,7 @@ import Vue from 'vue';
import Editor from '@/components/Editor/index.vue'
import EditorUpload from '@/components/Editor/editorUpload.vue'
import News from '@/service/News/index'
import FileService from "@/service/FileService/index";
import { message } from 'ant-design-vue';
const news = new News()
......@@ -54,8 +55,10 @@ export default Vue.extend({
author:'',
type: undefined as number|any,
imgUrl: '',
imageUrl: '',
summary:'',
content:''
content:'',
editableContent: '',
}
},
created() {
......@@ -63,7 +66,6 @@ export default Vue.extend({
},
methods:{
getDetails() {
console.log(Object.keys(this.$route.query))
if (Object.keys(this.$route.query).length === 0) {
this.type = undefined
return
......@@ -73,7 +75,6 @@ export default Vue.extend({
this.type = +type
if (+type === 1) {
news.searchPolicy(id).then(res => {
console.log(res)
this.initData(res.data)
})
} else {
......@@ -86,8 +87,9 @@ export default Vue.extend({
this.title = res.title
this.author = res.writer
this.imgUrl = res.file_name
this.imageUrl = new FileService().getImageSrc(res.file_name)
this.summary = res.desc
this.content = res.content
this.editableContent = res.content
},
getContent(value:string){
this.content = value
......@@ -130,13 +132,12 @@ export default Vue.extend({
})
},
onSubmit() {
console.log(this.imgUrl)
console.log(this.content)
if (this.$route.query.key) {
this.editForm()
} else {
this.addForm()
}
// console.log(this.content);
},
}
})
......
......@@ -3,7 +3,7 @@
<a-select
v-for="(item, index) in fooList"
:key="index"
class="header-select-item mx-3"
class="header-select-item mx-3 my-2"
@change="(value) => handleSelectChange(value, index)"
:placeholder="item.placeholder"
:value="item.value"
......@@ -23,13 +23,13 @@
import { eLevel } from "@/types/level";
import { eNewRoleRelatedToBackEnd } from "@/types/role";
import { getSelfOutLet } from "@/utils/outlet";
import { getUserMsg } from "@/utils/userMsg/userMsg";
import { message } from "ant-design-vue";
import StaffService from "@/service/StaffService";
import { fooList } from "./const";
import Vue, { PropType } from "vue";
import { iOutLet } from "@/service/StaffService/types";
export default Vue.extend({
props: {
fooList: {
......@@ -89,50 +89,147 @@ export default Vue.extend({
});
this.setFooList(newList);
},
resetList() {
const list = this.fooList.map((i) => {
return {
...i,
disable: false,
value: undefined,
options: [],
};
});
this.setFooList([...list]);
},
async init() {
const selfOutLet = await getSelfOutLet();
if (this.role === eNewRoleRelatedToBackEnd.BackAdmin) {
const ret = await StaffService.getInstance().getBranch({
level: eLevel.firstLevel_branch,
});
if (ret.code === 200) {
const options = ret.data.item;
this.fooList[0].options = options;
const newList = this.fooList.map((item, i) => {
return {
...item,
disable: i >= 1,
};
});
this.setFooList(newList);
this.resetList();
this.$nextTick(() => {
if (this.role === eNewRoleRelatedToBackEnd.BackAdmin) {
this.initBackAdmin(selfOutLet);
} else if (this.level === eLevel.firstLevel_branch) {
this.init_firstLevel(selfOutLet);
} else if (this.level === eLevel.secondary_branch) {
this.init_secondLevel(selfOutLet);
} else if (this.level === eLevel.firstLevel_sub_branch) {
this.init_first_sub_Level(selfOutLet);
} else if (this.level === eLevel.secondary_sub_branch) {
this.init_second_sub_Level(selfOutLet);
}
} else if (this.level === eLevel.firstLevel_branch) {
this.init_firstLevel(selfOutLet);
} else if (this.level === eLevel.secondary_branch) {
this.init_firstLevel(selfOutLet);
// this.setSelectValue([selfOutLet.fid, selfOutLet.sid]);
} else if (this.level === eLevel.firstLevel_sub_branch) {
// this.
// this.setSelectValue([selfOutLet.fid, selfOutLet.sid, selfOutLet.fs_id]);
} else if (this.level === eLevel.secondary_sub_branch) {
// this.setSelectValue([
// selfOutLet.fid,
// selfOutLet.sid,
// selfOutLet.fs_id,
// selfOutLet.ss_id,
// ]);
});
},
async initBackAdmin(selfOutLet: iOutLet) {
const ret = await StaffService.getInstance().getBranch({
level: eLevel.firstLevel_branch,
});
if (ret.code === 200) {
const options = ret.data.item;
this.fooList[0].options = options;
const newList = this.fooList.map((item, i) => {
return {
...item,
disable: i >= 1,
};
});
this.setFooList(newList);
}
},
init_firstLevel(selfOutLet: iOutLet) {
const { fid, first_branch } = selfOutLet;
this.fooList[0].value = fid;
this.fooList[0].options = [{ ID: fid, Name: first_branch }];
this.fooList[0].disable = true;
const list = this.initFooListBasicValues(
selfOutLet,
eLevel.firstLevel_branch
);
this.setFooList(list);
},
async init_secondLevel(selfOutLet: iOutLet) {
const { fid, first_branch, sid, second_branch } = selfOutLet;
const list = this.initFooListBasicValues(
selfOutLet,
eLevel.secondary_branch
);
this.setFooList(list);
const ret = await StaffService.getInstance().getBranch({
level: eLevel.firstLevel_sub_branch,
page_size: 10000,
parent_id: sid,
});
if (ret.code === 200) {
this.fooList[2].options = ret.data.item;
}
this.setFooList(this.fooList);
},
init_secondLevel(selfOutLet: iOutLet) {},
init_first_sub_Level(selfOutLet: iOutLet) {},
init_second_sub_Level(selfOutLet: iOutLet) {},
async init_first_sub_Level(selfOutLet: iOutLet) {
const { fid, first_branch, sid, second_branch, fs_id, first_sub_branch } =
selfOutLet;
const list = this.initFooListBasicValues(
selfOutLet,
eLevel.firstLevel_sub_branch
);
this.setFooList(list);
const ret = await StaffService.getInstance().getBranch({
level: eLevel.secondary_sub_branch,
page_size: 1000,
parent_id: fs_id,
});
if (ret.code === 200) {
this.fooList[3].options = ret.data.item;
}
this.setFooList(this.fooList);
},
init_second_sub_Level(selfOutLet: iOutLet) {
this.initFooListBasicValues(selfOutLet, eLevel.secondary_sub_branch);
},
initFooListBasicValues(selfOutLet: iOutLet, level: eLevel) {
let list = this.fooList;
const {
fid,
first_branch,
sid,
second_branch,
fs_id,
first_sub_branch,
ss_id,
second_sub_branch,
} = selfOutLet;
if (
[
eLevel.firstLevel_branch,
eLevel.secondary_branch,
eLevel.firstLevel_sub_branch,
eLevel.secondary_sub_branch,
].includes(level)
) {
list[0].value = fid;
list[0].options = [{ ID: fid, Name: first_branch }];
list[0].disable = true;
}
if (
[
eLevel.secondary_branch,
eLevel.firstLevel_sub_branch,
eLevel.secondary_sub_branch,
].includes(level)
) {
list[1].value = sid;
list[1].options = [{ ID: sid, Name: second_branch }];
list[1].disable = true;
}
if (
[eLevel.firstLevel_sub_branch, eLevel.secondary_sub_branch].includes(
level
)
) {
list[2].value = fs_id;
list[2].options = [{ ID: fs_id, Name: first_sub_branch }];
list[2].disable = true;
}
if ([eLevel.secondary_sub_branch].includes(level)) {
list[3].value = ss_id;
list[3].options = [{ ID: ss_id, Name: second_sub_branch }];
list[3].disable = true;
}
return list;
},
popupScroll1(e: Event) {
let h = e.target as HTMLElement;
if (h.scrollHeight - h.scrollTop <= h.clientHeight) {
......
......@@ -4,6 +4,7 @@
<p class="text-2xl font-bold mb-5">网点管理</p>
<div>
<header-select
ref="headerSelect"
:setFooList="setFooList"
:fooList="fooList"
:level="level"
......@@ -360,49 +361,9 @@ export default Vue.extend({
},
clickQueryOnSearchPage() {},
clickReset() {
this.cascaderValue = [];
(this.$refs.headerSelect as any).init();
this.addressSearchValue = "";
},
onChange(value: any[]) {
this.cascaderValue = value;
if (this.cascaderValue.length === LEVE_ORG) {
this.$router.push({
query: {
cascaderValue: this.cascaderValue.toString(),
},
});
}
},
loadData(
selectedOptions: {
loading: boolean;
isLeaf: boolean;
value: any;
label: string;
children: any[];
}[]
) {
const targetOption = selectedOptions[selectedOptions.length - 1];
targetOption.loading = true;
// load options lazily
setTimeout(() => {
targetOption.loading = false;
targetOption.children = [
{
label: `${targetOption.label} Dynamic 1`,
value: "dynamic1",
isLeaf: false,
},
{
label: `${targetOption.label} Dynamic 2`,
isLeaf: true,
value: "dynamic2",
},
];
this.options = [...this.options];
}, 10);
},
clickResetOnSearchPage() {
this.searchPageReqParams.name = "";
this.searchPageReqParams.phone = "";
......
<template>
<div>
<p class=" text-2xl font-bold mb-5">贷款产品管理</p>
<topbar/>
<product-table/>
<p class="text-2xl font-bold mb-5">贷款产品管理</p>
<topbar />
<product-table />
</div>
</template>
<script lang="ts">
import Vue from 'vue'
import bar from '@/components/productManage/topbar.vue'
import producttable from '@/components/productManage/productTable.vue'
import Vue from "vue";
import bar from "@/components/productManage/topbar.vue";
import producttable from "@/components/productManage/productTable.vue";
import { mapActions } from "vuex";
export default Vue.extend({
components: { 'topbar':bar,'product-table':producttable },
})
components: { topbar: bar, "product-table": producttable },
mounted() {
this.fetchList();
},
methods: {
...mapActions("loanProductManagement", {
productQuery: "query",
}),
fetchList() {
this.productQuery();
},
},
});
</script>
<style scoped>
</style>
\ No newline at end of file
......@@ -26,23 +26,15 @@
>
<a-input v-model="form.orgnization" />
</a-form-model-item>
<a-row :gutter="[16,16]">
<a-col :span="8">
<a-form-model-item label="贷款期限(月)">
<a-input-number
v-model="form.startTime"
style="width: 20%"
:min="0"
/>
——
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-input-number v-model="form.endTime" :min="0" style="width: 20%" />
</a-col>
<a-form-model-item label="贷款期限(月)">
<a-input-number
v-model="form.startTime"
style="width: 20%"
:min="0"
/>
——
</a-row>
<a-form-model-item>
<a-input-number v-model="form.endTime" :min="0" style="width: 20%" />
</a-form-model-item>
<a-form-model-item label="参考利率(%)">
<a-input-number
......@@ -119,29 +111,67 @@ import Vue, { PropType } from "vue";
import { InputNumber, FormModel, message, Row, Col } from "ant-design-vue";
import LoanProductService from "@/service/LoanProductService/index";
import { eProductType, eGuaranteeType } from "@/types/loanProduct";
import { iListItem } from "@/store/LoanProductManagement/type";
import { mapMutations } from "vuex";
Vue.use(InputNumber).use(Col).use(Row);
export default Vue.extend({
props: {
guaranteeType: {
type: Array as PropType<String[]>,
default() {
return ["信用", "抵押", "保证", "贴现", "综合", "质押"];
},
},
},
async mounted() {
this.isEditable = this.$route.name == "editLoanProduct" ? true : false;
if (this.isEditable) {
const uuid = this.$route.params.uuid;
this.uuid = uuid;
const ret = await LoanProductService.getInstance().queryInfo(uuid);
if (ret.code == 200) {
const record = ret.data as unknown as iListItem;
this.form.name = record.product_name;
this.form.orgnization = record.inst_name;
this.form.startTime = record.min_date;
this.form.endTime = record.max_date;
this.form.interstMin = record.rate_lower;
this.form.interstMax = record.rate_upper;
this.form.limitMin = record.min_amount;
this.form.limitMax = record.max_amount;
this.form.guarantee = record.guarantee_type;
this.form.type = record.product_type;
this.form.introduction = record.products;
this.form.characteristic = record.features;
this.form.target = record.apply_to;
this.form.applicationCon = record.apply_cond;
this.form.submissionCon = record.submit_cond;
}
}
},
data() {
return {
form: {
name: "",
startTime: "",
endTime: "",
orgnization: "",
interstMax: "",
interstMin: "",
limitMax: "",
limitMin: "",
guarantee: undefined as undefined | eGuaranteeType,
type: undefined as undefined | eProductType,
startTime: 0 as number | string,
endTime: 0 as number | string,
interstMax: 0 as number | string,
interstMin: 0 as number | string,
limitMax: 0 as number | string,
limitMin: 0 as number | string,
guarantee: eGuaranteeType.credit,
type: eProductType.company,
introduction: "",
characteristic: "",
target: "",
applicationCon: "",
submissionCon: "",
},
isEditable: false,
eProductType,
uuid: "",
eGuaranteeType,
rules: {
name: [{ required: true, message: "请输入产品名称", trigger: "blur" }],
......@@ -184,14 +214,6 @@ export default Vue.extend({
},
};
},
props: {
guaranteeType: {
type: Array as PropType<String[]>,
default() {
return ["信用", "抵押", "保证", "贴现", "综合", "质押"];
},
},
},
methods: {
changeGuarantee(value: eGuaranteeType) {
this.form.guarantee = value;
......@@ -201,32 +223,75 @@ export default Vue.extend({
this.form.type = value;
console.log(value);
},
...mapMutations("loanProductManagement", {
productSave: "save",
}),
onSubmit() {
(this.$refs.addProductForm as FormModel).validate((valid) => {
if (!valid) {
LoanProductService.getInstance()
.addLoan({
apply_cond: this.form.applicationCon,
apply_to: this.form.target,
features: this.form.characteristic,
guarantee_type: this.form.guarantee as eGuaranteeType,
inst_name: this.form.orgnization,
loan_type: this.form.type as eProductType,
max_amount: this.form.limitMax,
max_date: this.form.endTime,
product_name: this.form.name,
products: this.form.introduction,
rate_lower: this.form.interstMin,
rate_upper: this.form.interstMax,
submit_cond: this.form.submissionCon,
})
.then((ret) => {
if (ret.code == 200) {
console.log(this.form);
message.success("发布成功");
console.log(ret);
}
if (valid) {
if (this.isEditable) {
// 编辑
LoanProductService.getInstance()
.modifyLoan({
apply_cond: this.form.applicationCon,
apply_to: this.form.target,
features: this.form.characteristic,
guarantee_type: this.form.guarantee as eGuaranteeType,
inst_name: this.form.orgnization,
max_amount: this.form.limitMax.toString(),
max_date: this.form.endTime.toString(),
product_name: this.form.name,
products: this.form.introduction,
product_type: this.form.type,
rate_lower: this.form.interstMin.toString(),
rate_upper: this.form.interstMax.toString(),
submit_cond: this.form.submissionCon,
min_amount: this.form.limitMin.toString(),
min_date: this.form.startTime.toString(),
uuid: this.uuid,
})
.then((ret) => {
if (ret.code === 200) {
message.success("编辑成功");
this.$router.push({ name: "loanProduct" });
} else if (ret.code === 406) {
message.success("发布失败");
}
});
} else {
// 新增
LoanProductService.getInstance()
.addLoan({
apply_cond: this.form.applicationCon,
apply_to: this.form.target,
features: this.form.characteristic,
guarantee_type: this.form.guarantee as eGuaranteeType,
inst_name: this.form.orgnization,
max_amount: this.form.limitMax.toString(),
max_date: this.form.endTime.toString(),
min_amount: this.form.limitMin.toString(),
min_date: this.form.startTime.toString(),
loan_type: this.form.type as eProductType,
product_name: this.form.name,
products: this.form.introduction,
rate_lower: this.form.interstMin.toString(),
rate_upper: this.form.interstMax.toString(),
submit_cond: this.form.submissionCon,
})
.then((ret) => {
if (ret.code === 200) {
message.success("发布成功");
console.log(ret);
this.$router.push({ name: "loanProduct" });
} else if (ret.code === 406) {
message.success("发布失败");
console.log(ret);
this.$router.push({ name: "loanProduct" });
}
});
}
this.productSave({
page: 1,
});
} else {
return false;
......
......@@ -50,7 +50,7 @@ export const menuList: iMenuConfigItem[] = [
// getName: () => '理财产品',
// roles: [eRole.superManager],
// routeName: 'financialManagement',
// hiddeInMenu: false,
// hiddeInMenu: false,
// path: '/backend/product/financialManagement',
// component: () => import('@/views/Root/Banner/index.vue'),
// onClick: (e: Event) => {},
......@@ -93,7 +93,7 @@ export const menuList: iMenuConfigItem[] = [
eRole.firstLevel_sub_branch,
eRole.secondary_sub_branch,
eRole.secondary_sub_clientManager,
eRole.firstLevel_sub_clientManager
eRole.firstLevel_sub_clientManager,
],
onClick: (e: Event) => {},
},
......@@ -103,9 +103,7 @@ export const menuList: iMenuConfigItem[] = [
routeName: 'loanProduct',
path: '/backend/loanProduct',
component: () => import('@/views/Root/Product/Loan/index.vue'),
roles: [
eRole.superManager,
],
roles: [eRole.superManager],
},
{
getName: () => '发布贷款产品',
......@@ -118,6 +116,16 @@ export const menuList: iMenuConfigItem[] = [
onClick: (e: Event) => {},
},
{
getName: () => '编辑贷款产品',
routeName: 'editLoanProduct',
hiddeInMenu: true,
belongToMenuName: 'loanProduct',
path: '/backend/loanProduct/edit/:uuid',
component: () => import('@/views/Root/Product/Loan/publish.vue'),
roles: [eRole.superManager],
onClick: (e: Event) => {},
},
{
getName: () => '一级支行客户名单',
onClick: (e: Event) => {},
routeName: 'firstSubClient',
......@@ -126,7 +134,7 @@ export const menuList: iMenuConfigItem[] = [
belongToMenuName: 'userManage',
component: () => import('@/views/Root/User/client.vue'),
roles: [
eRole.superManager,
eRole.superManager,
eRole.firstLevel_branch,
eRole.firstLevel_sub_clientManager,
],
......@@ -149,10 +157,7 @@ export const menuList: iMenuConfigItem[] = [
hiddeInMenu: true,
belongToMenuName: 'userManage',
component: () => import('@/views/Root/User/secondary.vue'),
roles: [
eRole.superManager,
eRole.firstLevel_branch
],
roles: [eRole.superManager, eRole.firstLevel_branch],
},
{
getName: () => '一级支行搜索结果',
......@@ -226,7 +231,7 @@ export const menuList: iMenuConfigItem[] = [
eRole.firstLevel_sub_branch,
eRole.secondary_sub_branch,
eRole.firstLevel_sub_clientManager,
eRole.secondary_sub_clientManager
eRole.secondary_sub_clientManager,
],
},
{
......@@ -271,8 +276,7 @@ export const menuList: iMenuConfigItem[] = [
routeName: 'activity',
path: '/backend/activity',
component: () => import('@/views/Root/Activity/index.vue'),
roles: [eRole.superManager,
],
roles: [eRole.superManager],
},
{
getName: () => '用户管理',
......@@ -280,9 +284,7 @@ export const menuList: iMenuConfigItem[] = [
routeName: 'platformUserManagement',
path: '/backend/platformUserManagement',
component: () => import('@/views/Root/Platform_UserManagement/index.vue'),
roles: [
eRole.platform_management,
],
roles: [eRole.platform_management],
},
{
getName: () => '安全设置',
......@@ -303,7 +305,7 @@ export const menuList: iMenuConfigItem[] = [
eRole.secondary_branch,
eRole.secondary_sub_branch,
eRole.firstLevel_sub_clientManager,
eRole.secondary_sub_clientManager
eRole.secondary_sub_clientManager,
],
onClick: (e: Event) => {},
},
......@@ -321,7 +323,7 @@ export const menuList: iMenuConfigItem[] = [
eRole.secondary_branch,
eRole.secondary_sub_branch,
eRole.firstLevel_sub_clientManager,
eRole.secondary_sub_clientManager
eRole.secondary_sub_clientManager,
],
},
],
......@@ -333,7 +335,7 @@ export const menuList: iMenuConfigItem[] = [
eRole.secondary_branch,
eRole.secondary_sub_branch,
eRole.firstLevel_sub_clientManager,
eRole.secondary_sub_clientManager
eRole.secondary_sub_clientManager,
],
},
{
......@@ -345,7 +347,7 @@ export const menuList: iMenuConfigItem[] = [
roles: [eRole.superManager],
},
{
getName: () => '发布新闻内容',
getName: () => '发布活动内容',
routeName: 'publishActivity',
hiddeInMenu: true,
belongToMenuName: 'activity',
......@@ -355,11 +357,21 @@ export const menuList: iMenuConfigItem[] = [
onClick: (e: Event) => {},
},
{
getName: () => '编辑活动内容',
routeName: 'editActivity',
hiddeInMenu: true,
belongToMenuName: 'activity',
path: '/backend/activity/edit/:uuid',
component: () => import('@/views/Root/Activity/publish.vue'),
roles: [eRole.superManager],
onClick: (e: Event) => {},
},
{
getName: () => '查看活动内容',
routeName: 'activityDetail',
hiddeInMenu: true,
belongToMenuName: 'activity',
path: '/backend/activity/detail',
path: '/backend/activity/detail/:uuid',
component: () => import('@/views/Root/Activity/detail.vue'),
roles: [eRole.superManager],
onClick: (e: Event) => {},
......
......@@ -74,7 +74,7 @@ export default Vue.extend({
};
},
mounted() {
console.log(this.menuList, "show menulist");
// console.log(this.menuList, "show menulist");
},
computed: {
role(): eRole | undefined {
......@@ -84,7 +84,7 @@ export default Vue.extend({
| undefined;
},
menuList(): iMenuList {
console.log(this.role, "show this.role");
// console.log(this.role, "show this.role");
return (this.role !== undefined && getMenuList(this.role)) || [];
},
filteredMenuList(): iMenuList {
......
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