Commit d7d174a4 authored by Zhang Xiaojie's avatar Zhang Xiaojie

fix

parent ff491f1d
......@@ -7,6 +7,7 @@
bordered
:loading="loading"
:pagination="false"
@change="handleChange"
>
<template #created_at="text">
{{ text | formatDate }}
......@@ -57,7 +58,7 @@
@click="
$router.push({
name: 'editLoanProduct',
params: { uuid: record.uuid },
query: { record: JSON.stringify(record) },
})
"
>编辑</a
......@@ -115,6 +116,7 @@ import {
import { modalType } from "./const";
import { mapActions, mapMutations, mapState } from "vuex";
import LoanProductService from "@/service/LoanProductService";
import { Pagination } from "ant-design-vue";
export default Vue.extend({
computed: {
......@@ -149,6 +151,7 @@ export default Vue.extend({
editableProductStatus,
eProductType,
eGuaranteeType,
filteredInfo:null as any
};
},
methods: {
......@@ -166,6 +169,10 @@ export default Vue.extend({
});
this.loanProductQuery();
},
handleChange(pagination:Pagination, filters:any, sorter:any) {
console.log('Various parameters',filters);
this.filteredInfo = filters;
},
getIntroduction(record: any) {
this.title = "产品介绍";
this.content = record.products;
......@@ -177,7 +184,7 @@ export default Vue.extend({
this.visible = true;
},
getTarget(record: any) {
this.title = "使用客户";
this.title = "用客户";
this.content = record.apply_to;
this.visible = true;
},
......
......@@ -14,15 +14,22 @@
/>
<span class="mr-3">产品分类</span>
<a-select
:default-value="productType[0]"
style="width: 120px; margin-right: 10px"
v-model="searchPageReqParams.type"
@change="handleChange"
>
<a-select-option v-for="(type, i) in productType" :key="i" :value="i">
{{ type }}
</a-select-option>
</a-select>
<span class="mr-3">产品状态</span>
<a-select
style="width: 120px; margin-right: 10px"
v-model="searchPageReqParams.status"
>
<a-select-option v-for="(status, i) in productStatus" :key="i" :value="status.value">
{{ status.title }}
</a-select-option>
</a-select>
<a-button type="primary" style="margin-right: 10px" @click="query"
>查询</a-button
>
......@@ -42,7 +49,7 @@ 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'
import { mapActions, mapMutations, mapState } from "vuex";
export default Vue.extend({
components: { timerange },
props: {
......@@ -52,13 +59,43 @@ export default Vue.extend({
return ["全部", "企业", "个人"];
},
},
productStatus: {
type: Array as PropType<Object[]>,
default() {
return [
{
title: "全部",
value: 0,
},
{
title: "未发布",
value: 1,
},
{
title: "已发布",
value: 4,
},
{
title: "普通",
value: 2,
},
{
title: "热门",
value: 3,
},
];
},
},
},
computed:{
...mapState('loanProductManagement', [
'start_time',
'end_time',
'name',
'loan_type',
computed: {
...mapState("loanProductManagement", [
"start_time",
"end_time",
"product_name",
"loan_type",
]),
},
data() {
......@@ -66,6 +103,7 @@ export default Vue.extend({
searchPageReqParams: {
name: "",
type: 0,
status: 0,
startTime: undefined as undefined | number,
endTime: undefined as undefined | number,
offset: 0,
......@@ -78,23 +116,24 @@ export default Vue.extend({
deep: true,
handler(newV) {
this.productSave({
name: newV.name,
product_name: newV.name,
start_time: newV.startTime,
end_time: newV.endTime,
loan_type: newV.type,
})
product_status:newV.status
});
},
},
},
methods: {
handleChange(val:any){
this.searchPageReqParams.type = val
handleChange(val: any) {
this.searchPageReqParams.type = val;
},
...mapMutations('loanProductManagement', {
productSave: 'save',
...mapMutations("loanProductManagement", {
productSave: "save",
}),
...mapActions('loanProductManagement', {
productQuery: 'query',
...mapActions("loanProductManagement", {
productQuery: "query",
}),
getNewTime(startTime: number, endTime: number) {
this.searchPageReqParams.startTime = startTime;
......@@ -103,8 +142,9 @@ export default Vue.extend({
query() {
this.productSave({
page: 1,
})
this.productQuery()
offset: 0,
});
this.productQuery();
},
reset() {
this.searchPageReqParams.name = "";
......@@ -114,9 +154,9 @@ export default Vue.extend({
this.$nextTick(() => {
this.productSave({
page: 1,
})
this.query()
})
});
this.query();
});
},
},
});
......
export default[
export default [
{
title: '发布时间',
align: 'center',
......@@ -14,6 +14,11 @@ export default[
title: '产品分类',
align: 'center',
dataIndex: 'loan_type',
filters: [
{ text: '企业', value: '1' },
{ text: '个人', value: '2' },
],
onFilter: (value: any, record: any) => { return record.loan_type == value},
scopedSlots: { customRender: 'loan_type' },
},
{
......@@ -41,7 +46,7 @@ export default[
title: '产品介绍',
align: 'center',
scopedSlots: { customRender: 'products' },
},
},
{
title: '产品特点',
align: 'center',
......
......@@ -86,7 +86,7 @@ export default {
case editableProductStatus.normal:
return '已发布/普通'
case editableProductStatus.hot:
return '已发布热门'
return '已发布/热门'
}
},
filterActivitytatus(status:activityStatus) {
......
......@@ -32,6 +32,7 @@ export default class ActivityService {
limit?: number
offset?: number
start_time?: number
title?:string
}
) {
return baseAxios<{
......
......@@ -77,6 +77,7 @@ export default class LoanProductService {
}
queryDirectLoanReq(data: {
product_name?:string,
end_time?: number
limit?: number
loan_type: eProductType
......
......@@ -17,7 +17,7 @@ export default <Module<iProductModuleState, {}>>{
loading:false,
total:0,
page: 1,
name:''
product_name:''
},
mutations: {
save(state, payload) {
......@@ -28,11 +28,12 @@ export default <Module<iProductModuleState, {}>>{
async query({ state, commit }, payload) {
state.loading = true
const ret = await LoanProductService.getInstance().queryDirectLoanReq({
product_name:state.product_name,
end_time: state.end_time as number,
limit: state.limit,
loan_type: state.loan_type,
offset: state.offset as number,
product_status: 0,
product_status: state.product_status,
start_time: state.start_time as number,
})
if (ret.code === 200) {
......
......@@ -32,6 +32,6 @@ export interface iProductModuleState {
start_time: number | undefined
total: number
page:number
name:string
product_name:string
loading: boolean
}
<template>
<div>
<p class="text-2xl font-bold mb-5">{{ title }}</p>{{$route.query.id}}
<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" />
<img v-if="imageUrl" :src="imageUrl" class="mx-auto my-5" />
<p class="text-left p-5" v-html="content">{{ content }}</p>
</div>
</template>
......@@ -25,20 +26,13 @@ export default Vue.extend({
};
},
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;
}
const item: eActivityItem = JSON.parse(this.$route.query.record as string);
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)
this.imageUrl = FileService.getInstance().getImageSrc(this.file_name);
}
},
});
......
......@@ -8,7 +8,7 @@
style="width: 150px; margin-right: 10px"
/>
<!-- timepicker -->
<span class="font-semibold">注册时间:</span>
<span class="font-semibold">发布时间:</span>
<timerange
class="mr-3"
:startTime="searchPageReqParams.startTime"
......@@ -112,8 +112,8 @@ export default Vue.extend({
modalLoading: false,
list: [] as eActivityItem[],
total: 0,
tableLoading:false,
PAGE_SIZE
tableLoading: false,
PAGE_SIZE,
};
},
mounted() {
......@@ -122,14 +122,15 @@ export default Vue.extend({
methods: {
handlePaginationChange(current: number) {
this.searchPageReqParams.offset = (current - 1) * PAGE_SIZE;
console.log(current,this.searchPageReqParams.offset );
console.log(current, this.searchPageReqParams.offset);
this.fetchList();
},
fetchList() {
this.tableLoading = true
this.tableLoading = true;
ActivityService.getInstance()
.queryActivityList({
activity_status: activityStatus.all,
title: this.searchPageReqParams.name,
end_time: this.searchPageReqParams.endTime,
limit: PAGE_SIZE,
offset: this.searchPageReqParams.offset,
......@@ -139,11 +140,12 @@ export default Vue.extend({
if (ret.code === 200) {
this.list = ret.data.items;
this.total = ret.data.total;
this.tableLoading = false
this.tableLoading = false;
}
});
},
query() {
this.searchPageReqParams.offset = 0;
this.fetchList();
},
getNewTime(startTime: number, endTime: number) {
......@@ -161,15 +163,15 @@ export default Vue.extend({
edit(record: any) {
this.$router.push({
name: "editActivity",
params: { uuid: record.uuid },
query: { record: JSON.stringify(record) },
});
},
add(record: any) {
this.uuid = record.uuid;
this.type = modal.on;
this.show = true;
this.title = "上架资讯";
this.text = "确定上架该资讯吗?";
this.title = "上架活动";
this.text = "确定上架该活动吗?";
},
remove(record: any) {
this.uuid = record.uuid;
......@@ -207,8 +209,7 @@ export default Vue.extend({
this.modalLoading = false;
},
toDetail(record: any) {
const uuid = record.uuid;
this.$router.push({ name: "activityDetail", params: { uuid: uuid } });
this.$router.push({ name: "activityDetail", query: { record: JSON.stringify(record) } });
},
},
});
......
......@@ -43,7 +43,7 @@ export default Vue.extend({
title: "",
content: "",
file_hash: "",
editableContent:"",
editableContent: "",
},
rules: {
title: [{ required: true, message: "请输入文章标题", trigger: "blur" }],
......@@ -59,27 +59,21 @@ export default Vue.extend({
file_src: "",
};
},
created() {
mounted() {
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;
}
});
if (this.$route.query.record) {
const items: eActivityItem = JSON.parse(
this.$route.query.record as string
);
this.form.title = items.title;
this.form.editableContent = items.content;
this.form.file_hash = items.file_name;
this.uuid = items.uuid;
if (this.form.file_hash) {
this.file_src = FileService.getInstance().getImageSrc(
this.form.file_hash
);
}
}
},
methods: {
......
......@@ -31,6 +31,7 @@
:value="form.startTime"
@change="(v) => (form.startTime = Math.floor(v))"
:step="1"
:max="98"
style="width: 20%"
:min="0"
/>
......@@ -39,26 +40,36 @@
:value="form.endTime"
@change="(v) => (form.endTime = Math.floor(v))"
:step="1"
:max="99"
:min="Math.floor(form.startTime + 1)"
style="width: 20%"
/>
</a-form-model-item>
<a-form-model-item label="参考利率(%)">
<a-input-number
:value="isNaN(form.interstMin)? 0:form.interstMin"
@change="(v) => ( form.interstMin = Number.parseFloat(v).toFixed(2))"
placeholder="最多可输小数点后两位"
:value="isNaN(form.interstMin) ? 0 : form.interstMin"
@change="(v) => (form.interstMin = Number.parseFloat(v).toFixed(2))"
placeholder="最多可输小数点后两位"
:step="0.01"
:min="0"
style="width: 20%"
/>
——
<a-input-number
:value="isNaN(form.interstMax)? +Number.parseFloat(form.interstMin+0.01).toFixed(2):form.interstMax"
@change="(v) => (form.interstMax = isNaN(v)? 0: Number.parseFloat(v).toFixed(2))"
:value="
isNaN(form.interstMax)
? +Number.parseFloat(form.interstMin + 0.01).toFixed(2)
: form.interstMax
"
@change="
(v) =>
(form.interstMax = isNaN(v)
? 0
: Number.parseFloat(v).toFixed(2))
"
placeholder="最多可输小数点后两位"
:step="0.01"
:min="+Number.parseFloat(form.interstMin+0.01).toFixed(2)"
:min="+Number.parseFloat(form.interstMin + 0.01).toFixed(2)"
style="width: 20%"
/>
</a-form-model-item>
......@@ -67,6 +78,7 @@
:value="form.limitMin"
@change="(v) => (form.limitMin = Math.floor(v))"
style="width: 20%"
:max="9998"
:min="0"
/>
——
......@@ -75,6 +87,7 @@
:value="form.limitMax"
@change="(v) => (form.limitMax = Math.floor(v))"
:min="Math.floor(form.limitMin + 1)"
:max="9999"
/>
</a-form-model-item>
<a-form-model-item label="担保方式" :wrapper-col="{ span: 5 }">
......@@ -148,30 +161,24 @@ export default Vue.extend({
},
},
},
async created() {
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.loan_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;
}
mounted() {
if (this.$route.query.record) {
const record:iListItem= JSON.parse(this.$route.query.record as string);
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.loan_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() {
......@@ -180,10 +187,10 @@ export default Vue.extend({
name: "",
orgnization: "",
startTime: 0,
endTime: 0,
interstMax: 0,
endTime: 1,
interstMax: 0.01,
interstMin: 0,
limitMax: 0,
limitMax: 1,
limitMin: 0,
guarantee: eGuaranteeType.credit,
type: eProductType.company,
......@@ -198,9 +205,13 @@ export default Vue.extend({
uuid: "",
eGuaranteeType,
rules: {
name: [{ required: true, message: "请输入产品名称", trigger: "blur" }],
name: [
{ required: true, message: "请输入产品名称", trigger: "blur" },
{ message: "产品名称最长为20字", max: 20, trigger: "blur" },
],
orgnization: [
{ required: true, message: "请输入机构名称", trigger: "blur" },
{ message: "机构名称最长为20字", max: 15, trigger: "blur" },
],
startTime: [
{ required: true, message: "请输入最小贷期限", trigger: "blur" },
......@@ -225,15 +236,19 @@ export default Vue.extend({
],
characteristic: [
{ required: true, message: "请输入产品特点", trigger: "blur" },
{ message: "内容最多为50字", max: 50, trigger: "blur" },
],
target: [
{ required: true, message: "请输入适用客户", trigger: "blur" },
{ message: "内容最多为50字", max: 50, trigger: "blur" },
],
applicationCon: [
{ required: true, message: "请输入申请条件", trigger: "blur" },
{ message: "内容最多为50字", max: 50, trigger: "blur" },
],
submissionCon: [
{ required: true, message: "请输入提交条件", trigger: "blur" },
{ message: "内容最多为50字", max: 50, trigger: "blur" },
],
},
};
......@@ -253,7 +268,6 @@ export default Vue.extend({
onSubmit() {
(this.$refs.addProductForm as FormModel).validate((valid) => {
if (valid) {
if (this.isEditable) {
// 编辑
LoanProductService.getInstance()
......
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