Commit 052df95f by WH

zmqxrt

parent 1e2fcdd1
import Api from "~/service/Api"
export function queryByPage(data) {
return Api.post("/manager/zmqxrt/queryByPage", data)
}
export function queryById(inr) {
return Api.post(`/manager/zmqxrt/queryById?inr=${inr}`)
}
export function add(data) {
return Api.post("/manager/zmqxrt/add", data)
}
export function edit(data) {
return Api.post("/manager/zmqxrt/edit", data)
}
export function deleteById(inr) {
return Api.post(`/manager/zmqxrt/deleteById?inr=${inr}`)
}
export function queryDetailById(inr) {
return Api.post(`/manager/zmqxrt/queryDetailById?inr=${inr}`)
}
\ No newline at end of file
<template>
<m-zmqxrt ref="zmq" title="dbazmq" type="add"></m-zmqxrt>
</template>
<script>
import Dbizmqxrt from "~/views/Statics/Dbizmqxrt";
debugger
export default {
name: "StaticsDbizmqxrt",
components: {
"m-zmqxrt": Dbizmqxrt
},
data() {
return {};
},
mounted() {
// this.$refs.pty.rules['ptaList'] = [
// { type: 'array', required: true, min: 1, message: '地址信息栏不能为空' }
// ]
}
};
debugger
</script>
<style>
</style>
\ No newline at end of file
<template>
<m-zmqxrt ref="zmq" title="dbezmq" type="delete"></m-zmqxrt>
</template>
<script>
import Dbizmqxrt from "~/views/Statics/Dbizmqxrt";
export default {
name: "StaticsDbezmq",
components: {
"m-zmqxrt": Dbizmqxrt
},
data() {
return {};
},
};
</script>
<style>
</style>
\ No newline at end of file
<template>
<m-zmqxrt ref="zmq" title="dbezmq" type="edit"></m-zmqxrt>
</template>
<script>
import Dbizmqxrt from "~/views/Statics/Dbizmqxrt";
export default {
name: "StaticsDbezmq",
components: {
"m-zmqxrt": Dbizmqxrt
},
data() {
return {
rules:{required:false}
};
},
};
</script>
<style>
</style>
\ No newline at end of file
export default class Zmqxrt {
constructor() {
this.data = {
inr: "",
cur: "",
begdat: "",
enddat: "",
buyrat: "",
midrat: "",
selrat: "",
ttrrat: "",
odrrat: "",
ver: "",
resrat: "",
rebrat: "",
ibrrat: "",
sel1rat: "",
buy1rat: "",
etgextkey: "CEBGRP",
xrttim: "",
caozbz: "",
canssm: "",
}
}
}
export const Pattern = {
"inr": [
{ "type": "string", "trigger": "blur" },
{ "max": 8, "message": "最大长度8个字符", "trigger": "blur" }
],
"cur": [
{ "type": "string", "trigger": "blur" },
{ "max": 3, "message": "最大长度3个字符", "trigger": "blur" }
],
"begdat": [
{ "type": "date", "trigger": "blur" }
],
"enddat": [
{ "type": "date", "trigger": "blur" }
],
"buyrat": [
{ "trigger": "blur" },
{ "pattern": /^-?\d{0,14}(\.\d{1,6})?$/, "message": "整数不能超过14位,小数不能超过6位", "trigger": "blur" }
],
"midrat": [
{ "trigger": "blur" },
{ "pattern": /^-?\d{0,14}(\.\d{1,6})?$/, "message": "整数不能超过14位,小数不能超过6位", "trigger": "blur" }
],
"selrat": [
{ "trigger": "blur" },
{ "pattern": /^-?\d{0,14}(\.\d{1,6})?$/, "message": "整数不能超过14位,小数不能超过6位", "trigger": "blur" }
],
"ttrrat": [
{ "trigger": "blur" },
{ "pattern": /^-?\d{0,14}(\.\d{1,6})?$/, "message": "整数不能超过14位,小数不能超过6位", "trigger": "blur" }
],
"odrrat": [
{ "trigger": "blur" },
{ "pattern": /^-?\d{0,14}(\.\d{1,6})?$/, "message": "整数不能超过14位,小数不能超过6位", "trigger": "blur" }
],
"ver": [
{ "type": "string", "trigger": "blur" },
{ "max": 4, "message": "最大长度4个字符", "trigger": "blur" }
],
"resrat": [
{ "trigger": "blur" },
{ "pattern": /^-?\d{0,14}(\.\d{1,6})?$/, "message": "整数不能超过14位,小数不能超过6位", "trigger": "blur" }
],
"rebrat": [
{ "trigger": "blur" },
{ "pattern": /^-?\d{0,14}(\.\d{1,6})?$/, "message": "整数不能超过14位,小数不能超过6位", "trigger": "blur" }
],
"ibrrat": [
{ "trigger": "blur" },
{ "pattern": /^-?\d{0,14}(\.\d{1,6})?$/, "message": "整数不能超过14位,小数不能超过6位", "trigger": "blur" }
],
"sel1rat": [
{ "trigger": "blur" },
{ "pattern": /^-?\d{0,14}(\.\d{1,6})?$/, "message": "整数不能超过14位,小数不能超过6位", "trigger": "blur" }
],
"buy1rat": [
{ "trigger": "blur" },
{ "pattern": /^-?\d{0,14}(\.\d{1,6})?$/, "message": "整数不能超过14位,小数不能超过6位", "trigger": "blur" }
],
"etgextkey": [
{ "type": "string", "trigger": "blur" },
{ "max": 8, "message": "最大长度8个字符", "trigger": "blur" }
],
"xrttim": [
{ "type": "string", "trigger": "blur" },
{ "max": 20, "message": "最大长度20个字符", "trigger": "blur" }
],
"caozbz": [
{ "type": "string", "trigger": "blur" },
{ "max": 1, "message": "最大长度1个字符", "trigger": "blur" }
],
// "zmqxrt_cur": [
// ],
}
<template>
<div class="eibs-tab">
<c-row>
<c-col :span="12" class="col-left">
<c-col :span="24">
<el-form-item label="币种" prop="cur">
<c-select
v-model="model.cur"
style="width: 100%"
placeholder="请选择币种类型"
:code="getCodesByKey('cur')"
></c-select>
</el-form-item>
</c-col>
<c-col :span="24">
<el-form-item
label="开始日期"
prop="model.begdat"
style="width: 100%"
>
<c-col :span="11">
<c-date-picker
type="date"
v-model="model.begdat"
style="width: 100%"
placeholder="请选择起始日期"
value-format="yyyy-MM-dd"
></c-date-picker>
</c-col>
</el-form-item>
</c-col>
<c-col :span="24">
<el-form-item
label="终止日期"
prop="model.enddat"
style="width: 100%"
>
<c-col :span="11">
<c-date-picker
type="date"
v-model="model.enddat"
style="width: 100%"
placeholder="请选择终止日期"
value-format="yyyy-MM-dd"
></c-date-picker>
</c-col>
</el-form-item>
</c-col>
<c-col :span="24">
<el-form-item label="买入价" prop="buyrat">
<c-input-currency
v-model="model.buyrat"
placeholder="请输入买入价"
>
</c-input-currency>
</el-form-item>
</c-col>
<c-col :span="24">
<el-form-item label="中间价" prop="midrat">
<c-input-currency
v-model="model.midrat"
placeholder="请输入中间价"
>
</c-input-currency>
</el-form-item>
</c-col>
<c-col :span="24">
<el-form-item label="卖出价" prop="selrat">
<c-input-currency
v-model="model.selrat"
placeholder="请输入卖出价"
>
</c-input-currency>
</el-form-item>
</c-col>
<c-col :span="24">
<el-form-item label="ttrrat" prop="ttrrat">
<c-input-currency
v-model="model.ttrrat"
placeholder="请输入ttrrat"
>
</c-input-currency>
</el-form-item>
</c-col>
<c-col :span="24">
<el-form-item label="odrrat" prop="odrrat">
<c-input-currency
v-model="model.odrrat"
placeholder="请输入odrrat"
>
</c-input-currency>
</el-form-item>
</c-col>
</c-col>
<c-col :span="12" class="col-right">
<c-col :span="24">
<el-form-item label="resrat" prop="resrat">
<c-input-currency
v-model="model.resrat"
placeholder="请输入resrat"
>
</c-input-currency>
</el-form-item>
</c-col>
<c-col :span="24">
<el-form-item label="rebrat" prop="rebrat">
<c-input-currency
v-model="model.rebrat"
placeholder="请输入rebrat"
>
</c-input-currency>
</el-form-item>
</c-col>
<c-col :span="24">
<el-form-item label="ibrrat" prop="ibrrat">
<c-input-currency
v-model="model.ibrrat"
placeholder="请输入ibrrat"
>
</c-input-currency>
</el-form-item>
</c-col>
<c-col :span="24">
<el-form-item label="sel1rat" prop="sel1rat">
<c-input-currency
v-model="model.sel1rat"
placeholder="请输入sel1rat"
>
</c-input-currency>
</el-form-item>
</c-col>
<c-col :span="24">
<el-form-item label="buy1rat" prop="buy1rat">
<c-input-currency
v-model="model.buy1rat"
placeholder="请输入buy1rat"
>
</c-input-currency>
</el-form-item>
</c-col>
<c-col :span="24">
<el-form-item label="实体组代码" prop="etgextkey">
<c-input
v-model="model.etgextkey"
placeholder="请输入实体组代码"
>
</c-input>
</el-form-item>
</c-col>
<c-col :span="24">
<el-form-item label="牌价时间" prop="xrttim">
<c-input
v-model="model.xrttim"
placeholder="请输入牌价时间"
>
</c-input>
</el-form-item>
</c-col>
<c-col :span="24">
<el-form-item label="caozbz" prop="caozbz">
<c-select
v-model="model.caozbz"
placeholder="请输入caozbz"
:code="getCodesByKey('caozbz')"
>
</c-select>
</el-form-item>
</c-col>
<c-col :span="24">
<el-form-item label="canssm" prop="canssm">
<c-input
v-model="model.canssm"
placeholder="请输入canssm"
>
</c-input>
</el-form-item>
</c-col>
</c-col>
</c-row>
<!-- <c-col :span="24">-->
<!-- </c-col>-->
</div>
</template>
<script>
import codes from "~/config/CodeTable";
export default {
name: "zmqxrt",
props: ["model"],
data() {
return {};
},
methods: {
getCodesByKey(key) {
return codes[key] ?? [];
},
},
};
</script>
<style>
</style>
\ No newline at end of file
<template>
<div class="eContainer">
<c-page :title="title">
<el-form
ref="modelForm"
label-width="180px"
size="small"
label-position="right"
:model="model"
:rules="rules"
:validate-on-rule-change="false"
:disabled="isDisabled"
>
<c-tabs v-model="tabVal" ref="elment" type="card" @tab-click="changePosition">
<el-tab-pane label="自贸区牌价信息" name="zmqxrt">
<c-content>
<m-zmqxrt-info :model="model" />
</c-content>
</el-tab-pane>
</c-tabs>
</el-form>
<div style="text-align: center">
<c-button
type="primary"
style="margin-right: 10px"
@click="commitAdd"
v-if="type === 'add'"
>提 交</c-button
>
<c-button
type="primary"
style="margin-right: 10px"
@click="commitEdit"
v-if="type === 'edit'"
>提 交</c-button
>
<c-button
type="primary"
style="margin-right: 10px"
@click="commitDelete"
v-if="type === 'delete'"
>提 交</c-button
>
<c-button type="primary" @click="goBack">返 回</c-button>
</div>
</c-page>
</div>
</template>
<script>
import Utils from "~/utils";
import Zmqxrt, { Pattern } from "./Zmqxrt.js";
import ZmqxrtInfo from "./ZmqxrtInfo.vue";
import {queryDetailById, queryByPage, queryById, add, edit, deleteById } from "~/service/test/zmqxrt.js";
export default {
name: "StaticsDbizmqxrt",
components: {
"m-zmqxrt-info": ZmqxrtInfo,
},
provide() {
return {
root: this,
};
},
props: {
type: {
type: String,
default: "info"
},
title: {
type: String,
default: "dbizmqxrt"
}
},
data() {
return {
model: new Zmqxrt().data,
tabVal: "zmqxrt",
rules: Pattern,
tabPosition:"tab-zmqxrt",
};
},
computed: {
isDisabled() {
return this.type === "info" || this.type === "delete";
},
},
created() {
debugger
if (this.type !== "add") {
const inr = this.$route.params.inr;
this.model.inr = this.$route.params.inr;
console.log(inr);
queryById(inr).then((res) => {
if (res.inr) {
this.model = res;
} else {
this.$message.error("不存在")
}
});
}
},
methods: {
commitAdd() {
this.$refs.modelForm.validate((validated) => {
if (validated) {
add(this.model)
.then((res) => {
this.$message.success("保存成功!");
this.goBack(true)
})
.catch((err) => {
this.$message.error("保存失败!");
});
} else {
Utils.formValidateTips(this.$refs.modelForm.fields)
}
});
},
commitEdit() {
this.$refs.modelForm.validate((validated) => {
if (validated) {
if(this.tabPosition===`tab-zmqxrt`){
edit(this.model)
.then((res) => {
this.$message.success("自贸区牌价信息修改保存成功!");
this.goBack()
})
.catch((err) => {
this.$message.error("自贸区牌价信息修改保存失败!");
});}
} else {
Utils.formValidateTips(this.$refs.modelForm.fields)
}
});
},
commitDelete() {
this.$confirm("是否确认删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
if(this.tabPosition===`tab-zmqxrt`){
debugger
deleteById(this.model.inr)
.then((res) => {
debugger
this.$message.success("自贸区牌价信息删除成功!");
this.goBack(true)
})
.catch((err) => {
this.$message.error("自贸区牌价信息删除失败!");
})};
})
.catch(() => {
this.$message({
type: "info",
message: "已取消删除",
});
});
},
/**
* update 是否更新inffec的查询列表
*/
goBack(update) {
this.$store.dispatch("TagsView/delView", this.$route);
this.$router.push({ name: "StaticsInffec", params: { update } });
},
changePosition(tab,event){
this.tabPosition=event.target.getAttribute('id');
console.log(this.tabPosition)
},
},
};
</script>
<style>
</style>
\ No newline at end of file
<template>
<div class="eibs-tab">
<!-- ----------左 ---------->
<c-col :span="24">
<el-form-item label="币种" prop="cur">
<c-select
v-model="model.cur"
placeholder="请选择币种"
:code="getCodesByKey('cur')"
></c-select>
</el-form-item>
</c-col>
<c-col :span="12" class="col-left">
<!-- <c-col :span="24">-->
<!-- <el-form-item label="BEGDAT" prop="BEGDAT">-->
<!-- <c-input-->
<!-- v-model="model.BEGDAT"-->
<!-- placeholder="请输入BEGDAT"-->
<!-- ></c-input>-->
<!-- </el-form-item>-->
<!-- </c-col>-->
<c-col :span="24">
<el-form-item
label="开始日期"
prop="model.begdat"
style="width: 100%"
>
<c-col :span="11">
<c-date-picker
type="date"
v-model="model.begdat"
style="width: 100%"
placeholder="请选择起始日期"
value-format="yyyy-MM-dd"
></c-date-picker>
</c-col>
</el-form-item>
</c-col>
</c-col>
<!------------- 右 ---------->
<c-col :span="12" class="col-right">
<c-col :span="24">
<!-- <el-form-item label="Party No." prop="extkey">-->
<!-- <c-input-->
<!-- v-model="model.extkey"-->
<!-- maxlength="24"-->
<!-- placeholder="请输入Party No."-->
<!-- ></c-input>-->
<!-- </el-form-item>-->
</c-col>
<c-col :span="24">
<el-form-item
label="结束日期"
prop="model.enddat"
style="width: 100%"
>
<c-col :span="11">
<c-date-picker
type="date"
v-model="model.enddat"
style="width: 100%"
placeholder="请选择结束日期"
value-format="yyyy-MM-dd"
></c-date-picker>
</c-col>
</el-form-item>
</c-col>
</c-col>
<c-col :span="24">
<c-col :span="12" style="text-align: left">
<el-button type="primary" size="small" @click="zmqxrtAdd" :disabled="model.cur===''" >新增</el-button>
</c-col>
<c-col :span="12" style="text-align: right">
<el-button size="small" @click="handleReset">重置</el-button>
<el-button
type="primary"
icon="el-icon-search"
size="small"
@click="onSearch()"
>查询
</el-button>
</c-col>
</c-col>
<c-col :span="24">
<c-paging-table
:data="zmqxrtData"
:columns="zmqxrtColumns"
:pageNumber="model.pageNum"
:pageSize="model.pageSize"
:total="model.total"
v-on:queryFunc="queryFunc"
:border="true"
>
<c-table-column fixed="right" prop="op" label="操作" width="240px">
<template slot-scope="{ scope }">
<c-button
style="margin-left: 0"
size="small"
@click="zmqxrtInfo(scope.$index, scope.row)"
>详情</c-button
>
<c-button
style="margin-left: 5px"
size="small"
type="primary"
@click="zmqxrtEdit(scope.$index, scope.row)"
>修改</c-button
>
<c-button
size="small"
style="margin-left: 5px"
@click="zmqxrtDelete(scope.$index, scope.row)"
>删除</c-button
>
<el-popover placement="top-start" width="50" trigger="click">
<ul class="table-button-item-list">
<li>
<c-button size="small" style="margin-left: 0">指派</c-button>
</li>
<li>
<c-button size="small" style="margin-left: 0">删除</c-button>
</li>
</ul>
<a
slot="reference"
href="javascript:void(0)"
style="margin-left: 5px"
>
<i class="el-icon-more"></i>
</a>
</el-popover>
</template>
</c-table-column>
</c-paging-table>
</c-col>
</div>
</template>
<script>
import codes from "~/config/CodeTable";
import { queryByPage } from "~/service/test/zmqxrt.js";
export default {
name: "",
props: ["model"],
inject: ["root"],
data() {
return {
zmqxrtData: [],
zmqxrtColumns: [
{ label: 'INR', prop: 'inr', width: '120' },
{ label: '币种', prop: 'cur', width: '120' },
{ label: '起始日期', prop: 'begdat', width: '150' },
{ label: '终止日期', prop: 'enddat', width: '200' },
{ label: '买入价', prop: 'buyrat', width: '100' },
{ label: '中间价', prop: 'midrat', width: '200' },
{ label: '卖出价', prop: 'selrat', width: '98' },
// { label: 'TTRRAT', prop: 'ttrrat', width: '98' },
// { label: 'ODRRAT', prop: 'odrrat', width: '200' },
// { label: 'VER', prop: 'ver', width: '120' },
// { label: 'RESRAT', prop: 'resrat', width: '200' },
// { label: 'REBRAT', prop: 'rebrat', width: '98' },
// { label: 'IBRRAT', prop: 'ibrrat', width: '200' },
// { label: 'SEL1RAT', prop: 'sel1rat', width: '100' },
// { label: 'BUY1RAT', prop: 'buy1rat', width: '150' },
{ label: '实体组代码', prop: 'etgextkey', width: '120' },
{ label: '牌价时间', prop: 'xrttim', width: '98' },
// { label: 'CAOZBZ', prop: 'caozbz', width: '98' },
// { label: 'CANSSM', prop: 'canssm', width: '98' },
],
};
},
computed: {
seatypb: {
get: function () {
return this.model.zmqxrttyp === "B";
},
set: function (val) {
this.model.zmqxrttyp = val ? "B" : "";
},
},
seatypc: {
get: function () {
return this.model.zmqxrttyp === "C";
},
set: function (val) {
this.model.zmqxrttyp = val ? "C" : "";
},
},
seatypa: {
get: function () {
return this.model.zmqxrttyp === "A";
},
set: function (val) {
this.model.zmqxrttyp = val ? "A" : "";
},
},
seatypo: {
get: function () {
return this.model.zmqxrttyp === "O";
},
set: function (val) {
this.model.zmqxrttyp = val ? "O" : "";
},
},
seatyph: {
get: function () {
return this.model.zmqxrttyp === "H";
},
set: function (val) {
this.model.zmqxrttyp = val ? "H" : "";
},
},
},
activated() {
const { update } = this.$route.params
if (update) {
this.onInfzmqxrtSearch()
}
},
methods: {
handleReset() {
this.root.$refs.modelForm.resetFields();
},
onSearch(){
this.model.pageNum = 1;
this.model.pageSize = 5;
this.onInfzmqxrtSearch();
},
onInfzmqxrtSearch() {
queryByPage(this.model).then(res => {
/**
* pageNumber: 0
* pageSize: 0
* total: 69
* totalPage: 0
*/
const list = res.list
this.zmqxrtData = list
this.model.pageNum = res.pageNumber
this.model.pageSize = res.pageSize
this.model.total = res.total
})
},
queryFunc(pageNumber, pageSize) {
this.model.pageNum = pageNumber
this.model.pageSize = pageSize
this.onInfzmqxrtSearch()
},
zmqxrttypeChange(val) {
this.model.zmqxrttyp = val;
},
getCodesByKey(key) {
return codes[key] ?? [];
},
zmqxrtAdd() {
this.$router.push(`/statics/dbazmq`)
},
zmqxrtInfo(index, row) {
this.$router.push(`/statics/dbizmqxrt/${row.inr}`)
},
zmqxrtEdit(index, row) {
this.$router.push(`/statics/dbezmq/${row.inr}`)
},
zmqxrtDelete(index, row) {
this.$router.push(`/statics/dbdzmq/${row.inr}`)
},
},
};
</script>
<style scoped>
.table-button-item-list {
padding: 0;
margin: 0;
}
.table-button-item-list li {
list-style: none;
padding: 5px 0;
text-align: center;
color: #606266;
cursor: pointer;
}</style>
<template>
<div class="eContainer">
<c-page title="自贸区牌价查询">
<el-form
:model="model"
ref="modelForm"
label-width="120px"
label-position="right"
size="small"
>
<c-tabs v-model="tabVal" ref="elment" type="card">
<!--PD000039 -->
<el-tab-pane label="自贸区牌价查询" name="infsea">
<c-content>
<m-infsea :model="model" ref="infsea" />
</c-content>
</el-tab-pane>
</c-tabs>
</el-form>
</c-page>
</div>
</template>
<script>
import Infsea from "./Infsea";
export default {
name: "StaticsDblzmq",
components: {
"m-infsea": Infsea,
},
provide() {
return {
//cur: model.cur,
root: this,
};
},
data() {
return {
tabVal: "infsea",
model: {
inr:"",
cur:"",
begdat:"",
enddat:"",
// paging
pageNum: 1,
pageSize: 5,
total: 0
},
};
},
};
</script>
<style></style>
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