Commit 1afcd2e0 by liushikai
parents bad97ddd 773d4e98
......@@ -20,7 +20,10 @@
"vue": "^2.6.11",
"vue-i18n": "^8.26.7",
"vue-router": "^3.2.0",
"vuex": "^3.4.0"
"vuedraggable": "^2.24.1",
"vuex": "^3.4.0",
"moment": "^2.27.0",
"vue-draggable-resizable": "^2.2.0"
},
"engines": {
"node": ">=6"
......
......@@ -7,7 +7,7 @@
popper-class="toolbars-popover"
>
<div class="toolbar-detail">
<ul>
<ul @click="openTool">
<li id="tool-caculate">计算器</li>
<li id="tool-search">大额支付行号查询</li>
<li id="tool-telexCode">电报码查询</li>
......@@ -36,6 +36,11 @@ export default {
data() {
return {};
},
methods:{
openTool(e){
this.$emit("openTool",e)
}
},
mounted() {
const that = this;
const dom = this.$el;
......
......@@ -500,7 +500,7 @@ export default {
let viewurl = "/#/docpan/show";
let XMLdata;
if (row.Type == 'LET') {
window.sessionStorage.docXML = ''
window.sessionStorage.docTXT = ''
window.sessionStorage.docXML = rtnmsg.data.docimm_xmldocblk;
}
else if (row.pandsc == "MT799") {
......
......@@ -498,7 +498,7 @@ export default {
let viewurl = "/#/docpan/show";
let XMLdata;
if (row.Type == 'LET') {
window.sessionStorage.docXML = ''
window.sessionStorage.docTXT = ''
window.sessionStorage.docXML = rtnmsg.data.docimm_xmldocblk;
}
else if (row.pandsc == "MT799") {
......
......@@ -2,7 +2,7 @@
<div>
<div style="height: 800px; overflow: auto">
<embed
v-if="this.model.docXML"
v-if="this.model.docXML && pdf"
:src="pdf"
type="application/pdf"
height="100%"
......@@ -31,7 +31,7 @@ export default {
data() {
return {
model: { docXML: "" },
pdf: "data:application/pdf;base64,",
pdf: "",
};
},
created() {
......@@ -49,7 +49,7 @@ export default {
if (this.model.docXML != "")
Api.post("pdf", { xml: this.model.docXML }).then((res) => {
if (res.respCode == SUCCESS) {
this.pdf += res.data;
this.pdf ="data:application/pdf;base64,"+ res.data;
}
});
},
......
......@@ -6,6 +6,98 @@
<headerCom></headerCom>
</el-header>
<!-- <div style="height: 8px"></div> -->
<vue-draggable-resizable
v-if="dragShow"
:w="size.w"
:h="size.h"
:x="250"
:y="100"
class="m-draggable"
:parent="true"
:disable-user-select="false"
:draggable="true"
:drag-cancel="'.'+ dragStyle"
>
<div
:class="{'m-enable-draggable-header': true,'m-enable-draggable-header-min': dragStatus == 0}"
>
<div class="m-draggable-header">
<span class="m-tool-title">{{toolTitle}}</span>
<i class="el-icon-minus" v-show="dragStatus !== 0" @click="changeSize(0)"></i>
<i class="el-icon-copy-document" v-show="dragStatus !== 1" @click="changeSize(1)"></i>
<i class="el-icon-full-screen" v-show="dragStatus !== 2" @click="changeSize(2)"></i>
<i class="el-icon-close" @click="closeDraggable"></i>
</div>
</div>
<div
style="margin:-15px -10px -15px -10px; border: 1px solid #f7fbfd; height: 15px;
width: 1000; background-color:#f7fbfd; z-index: -1 !important;"
v-show="dragStatus !== 0"
></div>
<div :draggable="false" :class="dragStyle" v-show="dragStatus !== 0">
<m-undisabled>
<div v-if="currentTool === 'tool-caculate'">
<calculator ref="calculator" />
</div>
<div v-if="currentTool === 'tool-search'">
<highvalue ref="highvalue" />
</div>
<div v-if="currentTool === 'tool-telexCode'">
<telexCode ref="telexCode" />
</div>
<div v-if="currentTool === 'tool-account'">
<account ref="account" />
</div>
<div v-if="currentTool === 'tool-swiftcode'">
<swiftcode ref="swiftcode" />
</div>
<div v-if="currentTool === 'tool-finishedtask'">
<finishedtask ref="finishedtask" />
</div>
<div v-if="currentTool === 'tool-exchangerate'">
<exchangerate ref="exchangerate" />
</div>
<div v-if="currentTool === 'tool-forwardexchangerate'">
<forwardexchangerate ref="forwardexchangerate" />
</div>
<div v-if="currentTool === 'tool-holiday'">
<holiday ref="holiday" />
</div>
<div v-if="currentTool === 'tool-interestrate'">
<interestrate ref="interestrate" />
</div>
<div v-if="currentTool === 'tool-businessoffer'">
<businessoffer ref="businessoffer" />
</div>
<div v-if="currentTool === 'tool-vatinvoic'">
<vatinvoic ref="vatinvoic" />
</div>
<div v-if="currentTool === 'tool-accttradedetails'">
<accttradedetails ref="accttradedetails" />
</div>
<div v-if="currentTool === 'tool-feetype'">
<feetype ref="feetype" />
</div>
<div v-if="currentTool === 'tool-sendMessageQuery'">
<sendMessageQuery ref="sendMessageQuery" />
</div>
<div v-if="currentTool === 'tool-receiveMessageQuery'">
<receiveMessageQuery ref="receiveMessageQuery" />
</div>
<div v-if="currentTool === 'tool-innerAccountBal'">
<innerAccountBal ref="innerAccountBal" />
</div>
<!-- <div v-if="currentTool === 'tool-txSerialNo'">
<txSerialNo ref="txSerialNo"/>
</div>-->
</m-undisabled>
</div>
<div
class="m-enable-draggable-header"
style="height:11px; padding:0px; margin-top:0px; margin-bottom=0px;"
v-show="dragStatus !== 0"
></div>
</vue-draggable-resizable>
<el-container>
<el-aside width="240px" style="background-color: white">
<sideMenu></sideMenu>
......@@ -15,7 +107,7 @@
<tagViews></tagViews>
<div style="height: 2px"></div>
<business></business>
<toolbars></toolbars>
<toolbars @openTool="handleChooseTool"></toolbars>
</el-main>
</el-container>
</el-container>
......@@ -27,10 +119,108 @@ import sideMenu from "./SideMenu";
import tagViews from "./components/TagsView";
import business from "../Business";
import toolbars from "~/components/Toolbars";
import calculator from "~/widget/Calculator"
import VueDraggableResizable from 'vue-draggable-resizable'
export default {
name: "Layout",
components: { headerCom, sideMenu, tagViews, business, toolbars },
components: { headerCom, sideMenu, tagViews, business, toolbars,
calculator,
'vue-draggable-resizable': VueDraggableResizable,
},
data(){
return {
isShow: false,
currentTool: '',
toolTitle: '',
size: {
w: 800,
h: 477,
},
dragStyle: 'm-draggable-content',
dragShow: false,
dragStatus: 1 // 0 最小化 1 中等 2 最大化
}
},
methods:{
getIsShow(data) {
this.isShow = data
console.log(this.isShow)
},
handleChooseTool(e) {
this.dragShow = true
this.currentTool = e.target.id
this.changeSize(1)
// 显示工具栏标题
if (this.currentTool === 'tool-caculate') {
this.toolTitle = "计算器";
} else if (this.currentTool === 'tool-search') {
this.toolTitle = "大额支付行号查询";
} else if (this.currentTool === 'tool-telexCode') {
this.toolTitle = "电报码查询";
} else if (this.currentTool === 'tool-account') {
this.toolTitle = "账户查询";
} else if (this.currentTool === 'tool-swiftcode') {
this.toolTitle = "SwiftCode查询";
} else if (this.currentTool === 'tool-finishedtask') {
this.toolTitle = "业务查询";
} else if (this.currentTool === 'tool-exchangerate') {
this.toolTitle = "即期牌价查询";
} else if (this.currentTool === 'tool-holiday') {
this.toolTitle = "节假日查询";
} else if (this.currentTool === 'tool-interestrate') {
this.toolTitle = "利率查询";
} else if (this.currentTool === 'tool-vatinvoic') {
this.toolTitle = "增值税发票查询";
} else if (this.currentTool === 'tool-accttradedetails') {
this.toolTitle = "账户交易明细查询";
} else if (this.currentTool === 'tool-forwardexchangerate') {
this.toolTitle = "远期牌价查询";
} else if (this.currentTool === 'tool-feetype') {
this.toolTitle = "费用查询";
} else if (this.currentTool === 'tool-txSerialNo') {
this.toolTitle = "交易流水号查询";
} else if (this.currentTool === 'tool-sendMessageQuery') {
this.toolTitle="发报查询";
this.sendMessageQuery = "发报查询";
} else if (this.currentTool === 'tool-receiveMessageQuery') {
this.toolTitle="收报查询";
this.receiveMessageQuery = "收报查询";
} else if (this.currentTool === 'tool-innerAccountBal') {
this.toolTitle = "内部户可用余额查询";
}
},
closeDraggable() {
this.dragShow = false
this.currentTool = ''
},
changeSize(tag) {
this.dragStatus = tag
if (this.dragStatus == 0) {
this.size = {
w: 250,
h: 20,
}
}
if (this.dragStatus == 2) {
this.size = {
w: 1200,
h: 777,
}
this.dragStyle = 'm-draggable-content-large'
}
if (this.dragStatus == 1) {
this.size = {
w: 800,
h: 477,
}
this.dragStyle = 'm-draggable-content'
}
}
}
};
</script>
......@@ -54,4 +244,119 @@ export default {
/* padding-bottom: 68px; */
box-sizing: border-box;
}
.m-draggable {
border-radius: 2px;
border: 1px solid #ccc;
box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
box-sizing: border-box;
z-index: 10000 !important;
position: absolute;
top: 0;
/* left: 200px; */
padding: 10px;
background-color: #f7fbfd;
}
.m-draggable-header {
height: 26px;
width: 100%;
text-align: right;
}
.m-enable-draggable-header {
margin: -10px;
height: 35px;
width: 1000;
padding: 10px 20px 10px 20px;
z-index: 10000 !important;
background-color: #409eff;
/* border:0px; */
border: 1px solid #409eff;
}
.m-draggable-content {
height: 420px;
overflow-y: auto;
}
.m-draggable-content-large {
height: 720px;
overflow-y: auto;
}
.m-draggable-header .el-icon-minus {
cursor: pointer;
color: #fff;
}
.m-enable-draggable-header-min {
padding: 10px 20px 0 20px;
}
.m-enable-draggable-header .el-icon-close {
cursor: pointer;
color: #fff;
}
.m-enable-draggable-header .el-icon-full-screen {
cursor: pointer;
color: #fff;
}
.m-enable-draggable-header .el-icon-copy-document {
cursor: pointer;
color: #fff;
}
.m-toolbar {
position: fixed;
top: 200px;
right: 0;
z-index: 10000;
}
.m-toolbar-core {
background: var(--themecolor);
border-radius: 4px;
width: 12px;
padding: 8px;
color: #fff;
font-size: 12px;
cursor: pointer;
}
.m-toolbar-detail {
padding: 0px;
font-size: 12px;
position: absolute;
top: -20px;
right: 32px;
width: 150px;
z-index: 10000;
}
.m-toolbar-detail ul {
margin-left: 5px;
margin-right: 5px;
padding: 0;
padding: 5px 0;
border-radius: 2px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
background: #fff;
cursor: pointer;
}
.m-toolbar-detail li {
list-style: none;
padding: 8px 15px;
}
.m-toolbar-detail li:hover {
background: var(--themecolor);
color: #fff;
}
.m-toolbar .m-toolbar-detail {
display: none;
}
.m-tool-title {
color: #fff;
text-align: left;
float: left;
}
.m-toolbar:hover .m-toolbar-detail {
display: block;
}
</style>
export default class Calculator {
constructor () {
this.data = {//null
prin: undefined,//本金
intRate: undefined,//利率
bgnIntDay: null,//起息日
dueDate: null,//到期日
weekday1:null,//周几1
weekday2:null,//周几2
holiday1:null,//节假日1
holiday2:null,//节假日2
busiDayNum:null,//业务天数
annlDayNum:null,//年度天数
payInt:undefined,//付息
payblAmt:undefined,//应付金额
ftp:undefined,//FTP
tax:6,//税率
profit:undefined,//收益点
days1:null,//标准天数1
days2:null,//标准天数2
month1:null,//标准月数1
month2:null,//标准月数2
price1:undefined,//价格1
price2:undefined,//价格2
realdays:"",//实际天数
guidePrice:null,//插值指导价
offer:undefined,//报价
taxBehindOffer:undefined ,//税后报价
taxBehindProfit:undefined ,//税后收益
cost:undefined,//成本
currCode:"156",//币种代码
queryDate:null,
isHolidayFlag:null,
}
}
}
\ No newline at end of file
<template>
<!-- 附加页面 -->
<div>
<!-- 页面左半部分 -->
<el-form
:model="model"
:model1="model1"
ref="modelForm"
label-position="left"
label-width="90px"
size="small"
:rules="rules"
style="height:600px"
>
<el-col :span="10">
<el-col :span="22">
<el-form-item label="起息日" prop="bgnIntDay">
<c-date-picker
v-model="model.bgnIntDay"
type="date"
placeholder="选择日期"
:picker-options="bgnIntDay"
@blur="completeDay"
:append-to-body="false"
style="width:180px !important;"
></c-date-picker>
</el-form-item>
</el-col>
</el-col>
<el-col :span="12">
<el-col :span="22">
<el-form-item label="到期日" prop="dueDate">
<c-date-picker
v-model="model1.dueDate"
type="date"
placeholder="选择日期"
:picker-options="dueDate"
@blur="completeDay"
:append-to-body="false"
style="width:180px !important;"
></c-date-picker>
</el-form-item>
</el-col>
</el-col>
<el-col :span="10">
<el-col :span="22">
<el-form-item label="周几" prop="weekday1">
<c-input v-model="model.weekday1" maxlength="32" disabled></c-input>
</el-form-item>
</el-col>
</el-col>
<el-col :span="12">
<el-col :span="22">
<el-form-item label="周几" prop="weekday2">
<c-input v-model="model1.weekday2" maxlength="32" disabled></c-input>
</el-form-item>
</el-col>
</el-col>
<el-col :span="10">
<el-col :span="22">
<el-form-item label="节假日" prop="holiday1">
<c-input v-model="model.holiday1" maxlength="32" disabled></c-input>
</el-form-item>
</el-col>
</el-col>
<el-col :span="12">
<el-col :span="22">
<el-form-item label="节假日" prop="holiday2">
<c-input v-model="model1.holiday2" maxlength="32" disabled></c-input>
</el-form-item>
</el-col>
</el-col>
<el-col :span="10">
<el-col :span="22">
<el-form-item label="实际天数" prop="realdays">
<c-input v-model="model.realdays" maxlength="32" placeholder="请输入" @blur="completeDate"></c-input>
</el-form-item>
</el-col>
</el-col>
</el-form>
</div>
</template>
<script>
import moment from "moment";
import Api from "~/service/Api";
import Calculator from "./Calculator";
export default {
data() {
return {
bgnIntDay: {
// 结束日期大于开始日期
disabledDate: time => {
return time.getTime() > moment(this.model1.dueDate);
}
},
dueDate: {
// 结束日期大于开始日期
disabledDate: time => {
return time.getTime() < moment(this.model.bgnIntDay);
}
},
model: new Calculator().data,
model1: new Calculator().data,
rules: {
/* realdays: [
{
message: "输入项必须为数字",
trigger: "blur"
}
] */
}
};
},
props: {},
methods: {
//补全天数
completeDay(){
this.$refs.modelForm.validate(async valid => {
if (!valid) return;
if (
this.model1.dueDate !== null &&
this.model.bgnIntDay !== null
) {
let days = moment(this.model1.dueDate).diff(
moment(this.model.bgnIntDay),
"days"
);
this.model.realdays = days;
}
this.isholiday();
});
},
//补全日期
completeDate(){
this.$refs.modelForm.validate(async valid => {
if (!valid) return;
if (this.model.bgnIntDay !== null && this.model.realdays !== "") {
let dueDate = moment(this.model.bgnIntDay)
.add(this.model.realdays, "days")
.format("YYYYMMDD");
this.model1.dueDate = dueDate;
} else if (this.model1.dueDate !== null && this.model.realdays !== "") {
let bgnIntDay = moment(this.model1.dueDate)
.subtract(this.model.realdays, "days")
.format("YYYYMMDD");
this.model.bgnIntDay = bgnIntDay;
}
this.isholiday();
});
},
//判断起息日是否是节假日
isholiday() {
this.$refs.modelForm.validate(async valid => {
if (!valid) return;
if (this.model.bgnIntDay !== null) {
this.model.queryDate = this.model.bgnIntDay;
let rtnmsg = await Api.post("v1/pm/isholiday", this.model);
// this.model.holiday1 = rtnmsg.data;
if (rtnmsg.data.isHolidayFlag == "0") {
this.model.holiday1 = "否";
} else {
this.model.holiday1 = "是";
}
console.log(rtnmsg.msg);
this.model.weekday1 = this.getWeekNo(this.model.bgnIntDay);
}
if (this.model1.dueDate !== null) {
this.model1.queryDate = this.model1.dueDate;
let rtnmsg1 = await Api.post("v1/pm/isholiday", this.model1);
// this.model1.holiday2 = rtnmsg1.data;
if (rtnmsg1.data.isHolidayFlag == "0") {
this.model1.holiday2 = "否";
} else {
this.model1.holiday2 = "是";
}
console.log(rtnmsg1.msg);
this.model1.weekday2 = this.getWeekNo(this.model1.dueDate);
}
});
},
//计算当前日期是周几
getWeekNo(date) {
let week = moment(date).day();
if (week === 0) {
return "7";
} else {
return week;
}
}
//todo:三个变量互相监听
// computed: {
// realdays() {
// let days = moment(this.model.dueDate).diff(
// moment(this.model.bgnIntDay),
// "days"
// );
// debugger;
// return days;
// }
// bgnIntDay() {
// // let bgnIntDay = moment(this.model.dueDate).substract(this.model.realdays,"days");
// // let date=format({date:bgnIntDay,formatStr:"yyyy-MM-dd"})
// let bgnIntDay="2020-01-01"+this.model.realdays;
// debugger;
// console.log(bgnIntDay);
// return date;
// }
// dueDate() {
// let dueDate = moment().substract(this.model.realdays, "days");
// return dueDate;
// }
// },
},
watch: {
"model.bgnIntDay": {
deep: true, //深度监听
handler: function() {
if (this.model.bgnIntDay == null || this.model.bgnIntDay == "") {
this.model.weekday1 = "";
this.model.holiday1 = "";
this.model.realdays = "";
}
}
},
"model1.dueDate": {
deep: true, //深度监听
handler: function() {
if (this.model1.dueDate == null || this.model1.dueDate == "") {
this.model1.weekday2 = "";
this.model1.holiday2 = "";
this.model.realdays = "";
}
}
},
}
};
</script>
\ No newline at end of file
<template>
<div>
<c-page>
<div class="eContainer">
<el-form
:model="model"
:rules="rules"
ref="lcdmstForm"
label-position="left"
label-width="150px"
size="small"
>
<el-tabs v-model="activeName" type="card" @tab-click="onTabClick">
<el-tab-pane label="普通计算器" name="norCalc">
<m-norCalc v-bind:model="model" v-bind:codes="codes" />
</el-tab-pane>
<el-tab-pane label="收益计算器" name="proCalc">
<m-proCalc v-bind:model="model" v-bind:codes="codes" />
</el-tab-pane>
<el-tab-pane label="插值计算器" name="interCalc">
<m-interCalc v-bind:model="model" v-bind:codes="codes" />
</el-tab-pane>
<el-tab-pane label="天数计算器" name="dayCalc">
<m-dayCalc v-bind:model="model" v-bind:codes="codes" />
</el-tab-pane>
<el-tab-pane label="收益点计算器" name="proPoiCalc">
<m-proPoiCalc v-bind:model="model" v-bind:codes="codes" />
</el-tab-pane>
</el-tabs>
</el-form>
<el-col class="eContainer-func"></el-col>
</div>
</c-page>
</div>
</template>
<script>
import norCalc from "./norCalc";
import proCalc from "./proCalc";
import dayCalc from "./dayCalc";
import interCalc from "./interCalc";
import proPoiCalc from "./proPoiCalc";
import Calculator from "./Calculator";
import Api from "~/service/Api";
const success = "SUCCESS";
export default {
components: {
"m-norCalc": norCalc,
"m-proCalc": proCalc,
"m-dayCalc": dayCalc,
"m-interCalc": interCalc,
"m-proPoiCalc": proPoiCalc
},
data() {
let num = /^[0-9]*$/;
let isNumber = (rules, value, callback) => {
if (!num.test(value)) {
return callback(new Error("请输入数字"));
} else {
callback();
}
};
let date = new Date();
let s1 =
date.getFullYear() +
"-" +
(date.getMonth() + 1) +
"-" +
(date.getDate() - 1);
let pickerOptions = (rules, value, callback) => {
if (value < new Date(s1)) {
return callback(new Error("所选日期不能小于当前日期,请重新选择"));
} else {
callback();
}
};
return {
activeName: "norCalc",
exitDialogVisible: false,
model: new Calculator().data,
codes:[],
rules: {}
};
},
methods: {
onTabClick() {}
}
};
</script>
\ No newline at end of file
<template>
<div id="app">
<div class="calculator" style="margin-top:0px;margin-bottom:0px;">
<div class="results input">{{equation}}</div>
<div class="mode">
<button type="button" class="button" @click="append(7)">7</button>
<button type="button" class="button" @click="append(8)">8</button>
<button type="button" class="button" @click="append(9)">9</button>
<button type="button" class="button" @click="append('×')">*</button>
<button type="button" class="button" @click="clear">AC</button>
<button type="button" class="button" @click="append(4)">4</button>
<button type="button" class="button" @click="append(5)">5</button>
<button type="button" class="button" @click="append(6)">6</button>
<button type="button" class="button" @click="append('÷')">/</button>
<button type="button" class="button" @click="calculatePercent">%</button>
<button type="button" class="button" @click="append(1)">1</button>
<button type="button" class="button" @click="append(2)">2</button>
<button type="button" class="button" @click="append(3)">3</button>
<button type="button" class="button" @click="append('+')">+</button>
<button type="button" class="button" @click="append('-')">-</button>
<button type="button" class="button" @click="append(0)">0</button>
<button type="button" class="button" @click="append('.')">.</button>
<button type="button" class="button" @click="calculateToggle">±</button>
<button type="button" class="button calculate" @click="calculate">=</button>
<!-- <button class="button" @click="press">(</button>
<button class="button" @click="press">)</button>-->
<!-- <button class="button" @click="press">x 2</button> -->
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
equation: "0",
isDecimalAdded: false, //只能输入一个小数位
isOperatorAdded: false, //只能写一个等号
isStarted: false //判断是否已经开始输入数据
};
},
methods: {
//判断是否是增删改查
isOperator(character) {
return ["+", "-", "×", "÷"].indexOf(character) > -1;
},
//追加数字
append(character) {
if (this.equation === "0" && !this.isOperator(character)) {
if (character === ".") {
this.equation += "" + character;
this.isDecimalAdded = true;
} else {
this.equation = "" + character;
}
this.isStarted = true;
return;
}
if (!this.isOperator(character)) {
if (character === "." && this.isDecimalAdded) {
return;
}
if (character === ".") {
this.isDecimalAdded = true;
this.isOperatorAdded = true;
} else {
this.isOperatorAdded = false;
}
this.equation += "" + character;
}
if (this.isOperator(character) && !this.isOperatorAdded) {
this.equation += "" + character;
this.isDecimalAdded = false;
this.isOperatorAdded = false;
}
},
//点击等于号
calculate() {
let result = this.equation
.replace(new RegExp("×", "g"), "*")
.replace(new RegExp("÷", "g"), "/");
this.equation = parseFloat(eval(result).toFixed(9)).toString();
this.isDecimalAdded = false;
this.isOperatorAdded = false;
},
//点击AC
clear() {
this.equation = "0";
this.isDecimalAdded = false;
this.isOperatorAdded = false;
this.isStarted = false;
},
//点击正负号
calculateToggle() {
if (this.isOperatorAdded || !this.isStarted) {
true;
}
this.equation = this.equation + "*(-1))";
this.calculate();
},
//点击百分比
calculatePercent() {
if (this.isOperatorAdded || !this.isStarted) {
true;
}
this.equation = this.equation + "*0.01";
this.calculate();
}
}
};
</script>
<style>
.calculator {
width: 500px;
padding: 20px;
border-radius: 5px;
margin: 20px auto;
font-size: 16px;
background-color: #d9d9d9;
}
.button {
margin: 3px;
width:80px;
border: 1px solid #0d0d0d;
height: 30px;
border-radius: 4px;
columns: #d9d9d9;
background-color: white;
cursor: pointer;
outline: none;
}
.calculate {
width: 175px;
}
.mode {
display: flex;
flex-wrap: wrap;
justify-content: space-evenly;
}
.input {
width: 480px;
height: 50px;
border-radius: 0px;
border: 1px solid black;
background-color: white;
color: black;
padding: 0 5px 0 5px;
margin: 0 0px 10px 0px;
}
</style>
\ No newline at end of file
<template>
<!-- 附加页面 -->
<div>
<el-form
:model="model"
ref="modelForm"
label-position="left"
label-width="70px"
size="small"
:rules="rules"
style="height:600px"
>
<!-- 页面左半部分 -->
<el-col :span="10">
<el-col :span="22">
<el-form-item label="本金" prop="prin">
<c-input-number v-model="model.prin" placeholder="请输入" :precision="4"></c-input-number>
</el-form-item>
</el-col>
</el-col>
<el-col :span="12">
<el-col :span="22">
<el-form-item label="利率" prop="intRate">
<div>
<c-input-number v-model="model.intRate" :precision="2" :max="99.99" placeholder="请输入"></c-input-number>%
</div>
</el-form-item>
</el-col>
</el-col>
<el-col :span="10">
<el-col :span="22">
<el-form-item label="起息日" prop="bgnIntDay">
<c-date-picker
v-model="model.bgnIntDay"
type="date"
placeholder="选择日期"
:picker-options="bgnIntDay"
@blur="isholiday1()"
:append-to-body="false"
></c-date-picker>
</el-form-item>
</el-col>
</el-col>
<el-col :span="12">
<el-col :span="22">
<el-form-item label="到期日" prop="dueDate">
<c-date-picker
v-model="model.dueDate"
type="date"
placeholder="选择日期"
:picker-options="dueDate"
@blur="isholiday2"
:append-to-body="false"
></c-date-picker>
</el-form-item>
</el-col>
</el-col>
<el-col :span="10">
<el-col :span="22">
<el-form-item label="周几" prop="weekday">
<c-input v-model="model.weekday1" maxlength="32" placeholder disabled></c-input>
<!-- :style="{'width':'80px', 'margin':'0px','padding' :'0px'}" -->
</el-form-item>
</el-col>
</el-col>
<el-col :span="12">
<el-col :span="22">
<el-form-item label="周几" prop="weekday">
<c-input v-model="model.weekday2" maxlength="32" placeholder disabled></c-input>
</el-form-item>
</el-col>
</el-col>
<el-col :span="10">
<el-col :span="20">
<el-form-item label="节假日" prop="holiday">
<c-input v-model="model.holiday1" maxlength="32" placeholder disabled></c-input>
</el-form-item>
</el-col>
</el-col>
<el-col :span="12">
<el-col :span="20">
<el-form-item label="节假日" prop="holiday">
<c-input v-model="model.holiday2" maxlength="32" placeholder disabled></c-input>
</el-form-item>
</el-col>
</el-col>
<el-col :span="10">
<el-col :span="22">
<el-form-item label="业务天数" prop="busiDayNum">
<c-input
v-model="model.busiDayNum"
maxlength="32"
placeholder
disabled
@blur="calculateBusinessDays()"
></c-input>
</el-form-item>
</el-col>
</el-col>
<el-col :span="12">
<el-col :span="22">
<el-form-item label="年度天数" prop="annlDayNum">
<c-input v-model="model.annlDayNum" maxlength="100" placeholder="请输入"></c-input>
</el-form-item>
</el-col>
</el-col>
<el-col :span="10">
<el-col :span="22">
<el-form-item label="付息" prop="payInt">
<c-input-number v-model="model.payInt" :precision="4" placeholder disabled></c-input-number>
</el-form-item>
</el-col>
</el-col>
<el-col :span="12">
<el-col :span="22">
<el-form-item label="应付金额" prop="payblAmt">
<c-input-number v-model="model.payblAmt" :precision="4" placeholder disabled></c-input-number>
</el-form-item>
</el-col>
</el-col>
<el-col :span="10">
<el-col :span="22">
<el-form-item label="FTP" prop="ftp">
<div>
<c-input-number v-model="model.ftp" :precision="4" :max="99.9999" placeholder="选输"></c-input-number>%
</div>
</el-form-item>
</el-col>
</el-col>
<el-col :span="12">
<el-col :span="22">
<el-form-item label="税率" prop="tax">
<div>
<c-input-number
v-model="model.tax"
placeholder="选输"
:precision="4"
:step="0.1"
:max="99.9999"
></c-input-number>%
</div>
</el-form-item>
</el-col>
</el-col>
<el-col :span="10">
<el-col :span="22">
<el-form-item label="收益点" prop="profit">
<div>
<c-input-number v-model="model.profit" :precision="4" placeholder disabled></c-input-number>%
</div>
</el-form-item>
</el-col>
</el-col>
</el-form>
</div>
</template>
<script>
import moment from "moment";
import Api from "~/service/Api";
import Calculator from "./Calculator";
export default {
data() {
return {
month: moment(new Date()).format("YYYYMMDD"),
bgnIntDay: {
// 结束日期大于开始日期
disabledDate: time => {
return time.getTime() > moment(this.model.dueDate);
}
},
dueDate: {
// 结束日期大于开始日期
disabledDate: time => {
return time.getTime() < moment(this.model.bgnIntDay);
}
},
model: new Calculator().data,
rules: {
prin: [
{
required: true,
trigger: "blur"
}
],
intRate: [
{
required: true,
message: "输入有误",
trigger: "blur"
}
],
bgnIntDay: [
{
required: true
}
],
dueDate: [
{
required: true
}
],
annlDayNum: [
{
required: true
}
]
}
};
},
methods: {
//判断起息日是否是节假日
async isholiday1() {
// this.$refs.modelForm.validate(async valid => {
// if (!valid) return;
if (this.model.bgnIntDay !== null) {
this.model.queryDate=this.model.bgnIntDay;
let rtnmsg =await Api.post("v1/pm/isholiday", this.model);
if (rtnmsg.data.isHolidayFlag=="0") {
this.model.holiday1 = "否";
} else {
this.model.holiday1 = "是";
}
this.model.weekday1 = this.getWeekNo(this.model.bgnIntDay);
if (this.model.bgnIntDay != null && this.model.dueDate != null) {
let days = this.getBusinessDay(
this.model.bgnIntDay,
this.model.dueDate
);
this.model.busiDayNum = days;
}
}
// });
},
//判断到期日是否是节假日
async isholiday2() {
// this.$refs.modelForm.validate(async valid => {
// if (valid) {
if (this.model.dueDate !== null) {
this.model.queryDate=this.model.dueDate;
let rtnmsg = await Api.post("v1/pm/isholiday", this.model);
// this.model.holiday2 = rtnmsg.data; //
if (rtnmsg.data.isHolidayFlag=="0") {
this.model.holiday2 = "否";
} else {
this.model.holiday2 = "是";
}
console.log(rtnmsg.msg);
this.model.weekday2 = this.getWeekNo(this.model.dueDate);
if (this.model.bgnIntDay != null && this.model.dueDate != null) {
let days = this.getBusinessDay(
this.model.bgnIntDay,
this.model.dueDate
);
this.model.busiDayNum = days;
}
}
// }
// });
},
//计算当前日期是周几
getWeekNo(date) {
let week = moment(date).day();
if (week === 0) {
return "7";
} else {
return week;
}
},
//计算业务天数:获取两个字符串日期的天数差
getBusinessDay(startDate, endDate) {
let days = moment(endDate).diff(moment(startDate), "days");
return days;
}
},
//计算:付息=本金x(利率/100/年度天数)x(到息日-起息日)
computed: {
payInt: function() {
if (this.model.annlDayNum !== 0) {
let time =
this.model.prin *
(this.model.intRate / 100 / this.model.annlDayNum) *
this.model.busiDayNum;
return time;
console.log(time);
}
},
//计算:应付金额=本金+付息
payblAmt: function() {
return this.model.prin + this.model.payInt;
},
//监听利率的变化,计算:收益点=利率/(1+税点)-FTP
profit: function() {
return (
(this.model.intRate / 100 / (1 + this.model.tax / 100) -
this.model.ftp / 100) *
100
);
}
},
watch: {
profit: function() {
this.model.profit = this.profit;
},
payInt: function() {
this.model.payInt = this.payInt;
},
payblAmt: function() {
this.model.payblAmt = this.payblAmt;
},
busiDayNum: function() {
this.model.busiDayNum = this.busiDayNum;
}
}
};
</script>
\ No newline at end of file
<template>
<!-- 附加页面 -->
<div>
<!-- 页面左半部分 -->
<el-form
:model="model"
ref="modelForm"
label-position="left"
label-width="150px"
size="small"
:rules="rules"
>
<el-col :span="12">
<el-col :span="22">
<el-form-item label="成本" prop="cost">
<c-input-number v-model="model.cost" :precision="4" placeholder="请输入"></c-input-number>%
</el-form-item>
</el-col>
</el-col>
<el-col :span="12">
<el-col :span="22">
<el-form-item label="报价" prop="offer">
<c-input-number v-model="model.offer" :precision="4" placeholder="请输入"></c-input-number>%
</el-form-item>
</el-col>
</el-col>
<el-col :span="12">
<el-col :span="22">
<el-form-item label="税率" prop="tax">
<div>
<c-input-number v-model="model.tax" :precision="4" placeholder="请输入"></c-input-number>%</div>
</el-form-item>
</el-col>
</el-col>
<el-col :span="12">
<el-col :span="22">
<el-form-item label="税后报价" prop="taxBehindOffer">
<c-input-number v-model="model.taxBehindOffer" :precision="4" disabled></c-input-number>%
</el-form-item>
</el-col>
</el-col>
<el-col :span="12">
<el-col :span="22">
<el-form-item label="税后收益" prop="taxBehindProfit">
<c-input-number v-model="model.taxBehindProfit" :precision="4" disabled></c-input-number>%
</el-form-item>
</el-col>
</el-col>
</el-form>
</div>
</template>
<script>
import moment from "moment";
import Api from "~/service/Api";
import Calculator from "./Calculator";
export default {
data() {
return {
zczyDate: {
// 最迟装运/服务提供日 大于等于有效日期 且 小于等于 信用证的到期日
disabledDate: time => {
return (
time.getTime() < moment(this.model.bgnIntDay) ||
time.getTime() > moment(this.model.dueDate)
);
}
},
model: new Calculator().data,
rules: {}
};
},
props: ["model", "codes"],
methods: {},
computed: {
//税后报价=成本*(1+税率)
taxBehindOffer() {
return this.model.cost *(1 + (this.model.tax/100));
},
//税后收益=报价-税后报价
taxBehindProfit() {
// let profit1=this.model.offer / (1 + this.model.tax/100) - this.model.cost;
let profit1 =this.model.offer - this.taxBehindOffer;
console.log(profit1)
return profit1
}
},
watch: {
taxBehindOffer() {
this.model.taxBehindOffer = this.taxBehindOffer;
},
taxBehindProfit() {
this.model.taxBehindProfit = this.taxBehindProfit;
}
}
};
</script>
\ No newline at end of file
<template>
<div>
<slot></slot>
</div>
</template>
<script>
export default {
provide: {
disabledImport: true
}
}
</script>
\ No newline at end of file
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