Commit 0cd920d8 by 李少勇

fxdsdb 交易优化修改

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