Commit 0cd920d8 by 李少勇

fxdsdb 交易优化修改

parent 5205bbac
import Api from "~/service/Api"; import Api from "~/service/Api";
import moment from "moment"; import moment from "moment";
import Fxdsdb from "../model";
import Utils from "~/utils";
export default { export default {
methods: { methods: {
async handleSearch() { async handleSearch() {
let begdat = this.model.fddp.begdat; let begdat = this.model.fddp.begdat;
if (!begdat || begdat == "") { if (!begdat || begdat == "") {
this.$notify.error({ this.$notify.error({
title: this.$t("financing.错误"), title: this.$t("financing.错误"),
message: this.$t("financing.导入起始日期必输!"), message: this.$t("financing.导入起始日期必输!"),
}); });
return; return;
} }
let enddat = this.model.fddp.enddat; let enddat = this.model.fddp.enddat;
if (!enddat || enddat == "") { if (!enddat || enddat == "") {
this.$notify.error({ this.$notify.error({
title: this.$t("financing.错误"), title: this.$t("financing.错误"),
message: this.$t("financing.导入结束日期必输!"), message: this.$t("financing.导入结束日期必输!"),
}); });
return; return;
} }
this.load = true; this.load = true;
let rtnmsg = await Api.post("/frontend/fxdsdb/query", { let rtnmsg = await Api.post("/frontend/fxdsdb/query", {
...this.model.fddp, ...this.model.fddp,
pageNum: this.pagination.pageNum, pageNum: this.pagination.pageNum,
pageSize: this.pagination.pageSize, pageSize: this.pagination.pageSize,
begdat: moment(begdat).format("YYYY-MM-DD"), begdat: moment(begdat).format("YYYY-MM-DD"),
enddat: moment(enddat).format("YYYY-MM-DD"), enddat: moment(enddat).format("YYYY-MM-DD"),
}); });
if (rtnmsg.respCode == SUCCESS) { if (rtnmsg.respCode == SUCCESS) {
this.load = false; this.load = false;
this.stmData.data = []; this.stmData.data = [];
const {list} = rtnmsg.data; const { list } = rtnmsg.data;
const {codes:{sta1}} = this; const { codes: { sta1 } } = this;
list.forEach(v=>{ list.forEach(v => {
for(let i in sta1){ for (let i in sta1) {
if(sta1[i].value == v.sta){ if (sta1[i].value == v.sta) {
v.sta = sta1[i].label; v.sta = sta1[i].label;
} }
} }
}) })
this.stmData.data = list; this.stmData.data = list;
this.pagination = { this.pagination = {
pageNum: rtnmsg.data.pageNum || 1, pageNum: rtnmsg.data.pageNum || 1,
pageSize: rtnmsg.data.pageSize || 10, pageSize: rtnmsg.data.pageSize || 10,
total: parseInt(rtnmsg.data.total), total: parseInt(rtnmsg.data.total),
}; };
} else { } else {
this.$notify.error({ this.$notify.error({
title: this.$t("financing.错误"), title: this.$t("financing.错误"),
message: this.$t("financing.服务请求失败!"), message: this.$t("financing.服务请求失败!"),
}); });
} }
this.load = false; this.load = false;
}, },
async handleReset() { async handleReset() {
let resetModel = new Fxdsdb().data
Utils.copyValueFromVoData(this.model, resetModel);
this.handleSearch();
}, },
// pageSize改变 // pageSize改变
handleSizeChange(val) { handleSizeChange(val) {
......
import Utils from "~/utils" export default {
"fddp.begdat": [
/** { type: "string", required: false, message: "输入正确的日期" }
* Fxdsdb Check规则 ],
*/ "fddp.enddat": [
let checkObj = { { type: "string", required: false, message: "输入正确的日期" }
} ],
for (const key in checkObj) {
if (Object.hasOwnProperty.call(checkObj, key)) {
checkObj[key] = checkObj[key] ? checkObj[key] : Utils.reflectCheck(key)
}
}
export default checkObj
"fddp.filnam": [
{ type: "string", required: false, message: "必输项" },
{ max: 0, message: "长度不能超过0" }
],
}
\ No newline at end of file
/**
* Fxdsdb Default规则
*/
import Api from "~/service/Api";
import Utils from "~/utils/index"
export default {
}
//你可以添加自动default处理
import Api from "~/service/Api"
import Utils from "~/utils"
export default {
async onSel(){
let rtnmsg = await this.executeRule("sel")
if(rtnmsg.respCode == SUCCESS)
{
//TODO 处理数据逻辑
}
else
{
this.$notify.error({title: '错误',message: '服务请求失败!'});
}
},
async onReset(){
let rtnmsg = await this.executeRule("reset")
if(rtnmsg.respCode == SUCCESS)
{
//TODO 处理数据逻辑
}
else
{
this.$notify.error({title: '错误',message: '服务请求失败!'});
}
},
async onFddpAdd(){
let rtnmsg = await this.executeRule("fddp.add")
if(rtnmsg.respCode == SUCCESS)
{
//TODO 处理数据逻辑
}
else
{
this.$notify.error({title: '错误',message: '服务请求失败!'});
}
},
}
\ No newline at end of file
export default {
"fddp.begdat":[
{type: "date", required: false, message: "输入正确的日期"}
],
"fddp.enddat":[
{type: "date", required: false, message: "输入正确的日期"}
],
"fddp.filnam":[
{type: "string", required: false, message: "必输项"},
{max: 0,message:"长度不能超过0"}
],
}
\ No newline at end of file
import Api from "~/service/Api" import Api from "~/service/Api"
import Pts from "~/page/Model/Common/Pts" import Pts from "~/page/Model/Common/Pts"
export default class Fxdsdb{ export default class Fxdsdb {
constructor () { constructor() {
this.data = { this.data = {
fddp:{ fddp: {
begdat:new Date((new Date).getTime() - (3 * 24 * 60 * 60 * 1000)), // 导入起始日期 .fddp.begdat begdat: new Date((new Date).getTime() - (3 * 24 * 60 * 60 * 1000)), // 导入起始日期 .fddp.begdat
enddat:new Date(), // 导入截止日期 .fddp.enddat enddat: new Date(), // 导入截止日期 .fddp.enddat
filtyp:"", // 文件类型 .fddp.filtyp filtyp: "", // 文件类型 .fddp.filtyp
filnam:"", // 文件名 .fddp.filnam filnam: "", // 文件名 .fddp.filnam
}, },
cpsfxdgrp:{ cpsfxdgrp: {
fxdlst:[], // .cpsfxdgrp.fxdlst fxdlst: [], // .cpsfxdgrp.fxdlst
}, },
pageId: "" // ctx的key
}
} }
}
} }
\ No newline at end of file
...@@ -54,13 +54,19 @@ ...@@ -54,13 +54,19 @@
<el-col :span="24" style="margin-top: 10px"> <el-col :span="24" style="margin-top: 10px">
<div style="height: 90%"> <div style="height: 90%">
<c-col :span="24"> <c-col :span="24">
<el-table :data="stmData.data" :columns="stmData.columns" v-loading="load" style="width: 100%" <el-table
@selection-change="handleSelectionChange" size="small" :border="true" height="calc(100vh - 310px)" :data="stmData.data" :columns="stmData.columns"
v-loading="load" style="width: 100%"
@selection-change="handleSelectionChange"
size="small" :border="true"
height="calc(100vh - 310px)"
:highlight-current-row="true"> :highlight-current-row="true">
<el-table-column type="selection" width="55"> <el-table-column type="selection" width="55"></el-table-column>
</el-table-column> <el-table-column
<el-table-column v-for="(item, key) in stmData.columns" :key="key" :label="item.label" :prop="item.prop" v-for="(item, key) in stmData.columns"
:min-width="item.width"> :key="key" :label="item.label"
:prop="item.prop"
:width="item.width">
<template slot-scope="scope"> <template slot-scope="scope">
<c-select-value-to-label v-if="item.prop == 'filtyp'" v-model="scope.row.filtyp" :code="codes.cpsfiltyp"></c-select-value-to-label> <c-select-value-to-label v-if="item.prop == 'filtyp'" v-model="scope.row.filtyp" :code="codes.cpsfiltyp"></c-select-value-to-label>
<span v-else>{{ scope.row[item.prop] }}</span> <span v-else>{{ scope.row[item.prop] }}</span>
...@@ -68,8 +74,12 @@ ...@@ -68,8 +74,12 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination layout="total, sizes, prev, pager, next, jumper" :total="pagination.total" <el-pagination
:page-size="pagination.pageSize" :current-page.sync="pagination.pageNum" @size-change="handleSizeChange" layout="total, sizes, prev, pager, next, jumper"
:total="pagination.total"
:page-size="pagination.pageSize"
:current-page.sync="pagination.pageNum"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"> @current-change="handleCurrentChange">
</el-pagination> </el-pagination>
</c-col> </c-col>
...@@ -104,17 +114,17 @@ export default { ...@@ -104,17 +114,17 @@ export default {
{ {
label: "文件类型", label: "文件类型",
prop: "filtyp", prop: "filtyp",
width: "120px" width: "240px"
}, },
{ {
label: "文件名称", label: "文件名称",
prop: "filnam", prop: "filnam",
width: "120px" width: "240px"
}, },
{ {
label: "文件保存路径", label: "文件保存路径",
prop: "filpth", prop: "filpth",
width: "120px" width: "auto"
}], }],
data: [], data: [],
}, },
......
...@@ -23,8 +23,7 @@ ...@@ -23,8 +23,7 @@
:border="true" :border="true"
:highlight-current-row="true" :highlight-current-row="true"
> >
<el-table-column v-for="(item, key) in stmData.columns" :key="key" :label="item.label" :prop="item.prop" <el-table-column v-for="(item, key) in stmData.columns" :key="key" :label="item.label" :prop="item.prop" :min-width="item.width">
:min-width="item.width">
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
...@@ -60,17 +59,17 @@ export default { ...@@ -60,17 +59,17 @@ export default {
{ {
label: "公共数据代码", label: "公共数据代码",
prop: "comcod", prop: "comcod",
width: "100px" width: "120px"
}, },
{ {
label: "公共数据中文名称", label: "公共数据中文名称",
prop: "comnam", prop: "comnam",
width: "100px" width: "150px"
}, },
{ {
label: "公共数据值", label: "公共数据值",
prop: "val", prop: "val",
width: "100px" width: "120px"
}, },
{ {
label: "生效类型", label: "生效类型",
...@@ -80,17 +79,17 @@ export default { ...@@ -80,17 +79,17 @@ export default {
{ {
label: "生效日期", label: "生效日期",
prop: "effdat", prop: "effdat",
width: "100px" width: "120px"
}, },
{ {
label: "公共数据类型", label: "公共数据类型",
prop: "comtyp", prop: "comtyp",
width: "100px" width: "120px"
}, },
{ {
label: "公共参数英文名称", label: "公共参数英文名称",
prop: "comengnam", prop: "comengnam",
width: "100px" width: "150px"
}, },
{ {
label: "变更类型", label: "变更类型",
......
<template> <template>
<div class="eContainer-search"> <div class="eContainer-search">
<el-form <el-form
:model="model" :model="model"
:rules="rules" :rules="rules"
ref="modelForm" ref="modelForm"
label-width="100px" label-width="100px"
label-position="right" label-position="right"
size="small" size="small"
:validate-on-rule-change="false" :validate-on-rule-change="false"
> >
<c-content> <c-content>
<m-mainpanel :model="model" :codes="codes" ref="mainpanel"/> <m-mainpanel :model="model" :codes="codes" ref="mainpanel"/>
...@@ -22,19 +22,17 @@ ...@@ -22,19 +22,17 @@
import event from "../event" import event from "../event"
import Mainpanel from "./Mainpanel.vue" import Mainpanel from "./Mainpanel.vue"
export default { export default {
name: "Fxdsdb", name: "Fxdsdb",
components:{ components:{
"m-mainpanel" : Mainpanel, "m-mainpanel" : Mainpanel,
}, },
provide() { provide() {
return { return {
root: this root: this
} }
}, },
mixins: [event], // 里面包含了Default、Check等的公共处理 mixins: [event],
data(){ data(){
return { return {
tabVal: "mainpanel", tabVal: "mainpanel",
......
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