Commit 404a7bab by liuxin

合并邮储项目

parent 022310b6
<template>
<el-autocomplete
style="width:100%"
v-model="model"
:placeholder="placeholder"
:fetch-suggestions="handleSearch"
@select="handleSelect"
></el-autocomplete>
</template>
<script>
import Api from "~/service/Api";
export default {
props:{
url:{
type:String
},
placeholder:{
type:String,
default:"请输入"
},
text:{
type:String
},
dataConfig:{
type:Object,
default: ()=>{}
}
},
data(){
return {
model:this.dataConfig
}
},
methods:{
async handleSearch(qs,cb){
var list = [{}];
let cond = {'cond':qs}
let rtnmsg = await Api.post(this.url,cond);
if(rtnmsg.code == 0){
for(let item of rtnmsg.data){
item.value = item[this.text]
}
}
list = rtnmsg.data
cb(list)
},
handleSelect(item){
this.$emit('select',item)
}
}
}
</script>
\ No newline at end of file
export default class BigNumber{
constructor(value) {
this.value = value;
}
static comparedTo(value){
if (this.value > value){
return 1;
}else if(this.value === value){
return 0;
}else{
return -1;
}
}
}
// module.exports = {
// 'name': 'bignumber',
// 'category': 'Construction',
// 'syntax': [
// 'bignumber(x)'
// ],
// method:{
// comparedTo(value){
// if (this.value > value){
// return 1;
// }else if(this.value === value){
// return 0;
// }else{
// return -1;
// }
// }
// },
// 'description':
// 'Create a big number from a number or string.',
// 'examples': [
// '0.1 + 0.2',
// 'bignumber(0.1) + bignumber(0.2)',
// 'bignumber("7.2")',
// 'bignumber("7.2e500")',
// 'bignumber([0.1, 0.2, 0.3])'
// ],
// 'seealso': [
// 'boolean', 'complex', 'fraction', 'index', 'matrix', 'string', 'unit'
// ]
// };
<template>
<button
class="el-button"
@click="handleClick"
:disabled="buttonDisabled || loading"
:autofocus="autofocus"
:type="nativeType"
:class="[
type ? 'el-button--' + type : '',
buttonSize ? 'el-button--' + buttonSize : '',
{
'is-disabled': buttonDisabled,
'is-loading': loading,
'is-plain': plain,
'is-round': round,
'is-circle': circle
}
]"
>
<i class="el-icon-loading" v-if="loading"></i>
<i :class="icon" v-if="icon && !loading"></i>
<span v-if="$slots.default"><slot></slot></span>
</button>
</template>
<script>
export default {
name: 'ElButton',
inject: {
elForm: {
default: ''
},
elFormItem: {
default: ''
}
},
props: {
type: {
type: String,
default: 'default'
},
size: String,
icon: {
type: String,
default: ''
},
nativeType: {
type: String,
default: 'button'
},
loading: Boolean,
disabled: Boolean,
plain: Boolean,
autofocus: Boolean,
round: Boolean,
circle: Boolean
},
computed: {
mode () {
return this.$store.state.Status.mode
},
_elFormItemSize() {
return (this.elFormItem || {}).elFormItemSize;
},
buttonSize() {
return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
},
buttonDisabled() {
return this.mode === 'display' || this.disabled || (this.elForm || {}).disabled;
}
},
methods: {
handleClick(evt) {
this.$emit('click', evt);
}
}
};
</script>
\ No newline at end of file
<template>
<el-cascader
:id="id" :class="{'highlight': highlight}" v-model="model" v-bind="$attrs"
v-on="$listeners" v-bind:disabled="isDisable" :clearable="clearable">
<slot></slot>
</el-cascader>
</template>
<script>
export default {
props: {
value: {
type: [String, Array, Number],
default: undefined
},
disabled: {
type: Boolean,
default: false
},
clearable: {
type: Boolean,
default: true
},
id: {
type: String,
default: ''
}
},
computed: {
model: {
get() {
return this.value
},
set(newVal) {
this.$emit('input', newVal)
}
},
mode() {
return this.$store.state.Status.mode
},
isDisable: {
get() {
return this.mode === 'display' || this.disabled
}
},
highlight () {
return this.$store.state.Status.highlights.indexOf(this.id) !== -1
}
},
// methods: {
// handleClick: function (e) {
// let ev = new Event("click", {"bubbles": true})
// let node = e.target
// while (node && node.parentElement) {
// if (node.classList.contains('el-form-item')) {
// break
// } else {
// node = node.parentElement
// }
// }
// node.setAttribute('selectid', this.id)
// node.dispatchEvent(ev)
// }
// }
}
</script>
<style>
.el-cascader.highlight .el-input .el-input__inner {
border-color: red;
}
</style>
\ No newline at end of file
<template>
<el-checkbox v-model="model" v-bind="$attrs" v-on="$listeners" v-bind:disabled="isDisable">
<slot></slot>
</el-checkbox>
</template>
<script>
export default {
props: {
value: {
type: String,
default: ''
},
disabled: {
type: Boolean,
default: false
}
},
computed: {
model: {
get () {
return this.value
},
set (newVal) {
this.$emit('input', newVal)
}
},
mode () {
return this.$store.state.Status.mode
},
isDisable: {
get () {
return this.mode === 'display' || this.disabled
}
}
}
}
</script>
\ No newline at end of file
<template>
<el-checkbox-group :id="id" v-model="model" v-bind="$attrs" v-on="$listeners" v-bind:disabled="isDisable">
<slot></slot>
</el-checkbox-group>
</template>
<script>
export default {
props: {
value: {
type: Array,
default: []
},
disabled: {
type: Boolean,
default: false
},
id: {
type: String,
default: ''
}
},
computed: {
model: {
get () {
return this.value
},
set (newVal) {
this.$emit('input', newVal)
}
},
mode () {
return this.$store.state.Status.mode
},
isDisable: {
get () {
return this.mode === 'display' || this.disabled
}
},
highlight () {
return this.$store.state.Status.highlights.indexOf(this.id) !== -1
},
highlightChanges () {
return this.$store.state.Status.highlightChanges.indexOf(this.id) !== -1
}
}
}
</script>
<style>
/* .el-checkbox-group.highlight {
padding: 10px;
margin: -10px;
border: 1px solid red;
}
.el-checkbox-group.change-light {
padding: 10px;
margin: -10px;
border: 1px solid #E6A23C;
} */
</style>
\ No newline at end of file
<template>
<el-scrollbar :id="contentRef" class="c-content-scrollbar" style="width: 100%;">
<slot></slot>
</el-scrollbar>
</template>
<script>
export default {
props: ['height'],
data() {
return {
clientHeight: '',
contentRef: 'contentRef' + Math.floor(Math.random() * 100),
}
},
mounted() {
this.clientHeight = `${document.documentElement.clientHeight}`
this.changeFixed()
this.handleResizeBind = this.handleResize.bind(this, this.contentRef, this.height)
window.addEventListener('resize', this.handleResizeBind)
},
methods: {
changeFixed() {
let content = document.getElementById(this.contentRef)
if (content) {
content.style.height = this.clientHeight - this.height + 'px'
}
},
handleResize: (contentRef, height) => {
let content = document.getElementById(contentRef)
let clientHeight = `${document.documentElement.clientHeight}`
content.style.height = clientHeight - height + 'px'
}
},
destroyed: function () {
window.removeEventListener('resize', this.handleResizeBind)
}
}
</script>
<style>
.c-content-scrollbar .el-scrollbar__wrap{
overflow-y: scroll;
overflow-x: auto;
}
</style>
\ No newline at end of file
<template>
<span>
<c-button type="primary" icon="el-icon-search" class="m-inputbtn-btn" @click="onDialogOpen"></c-button>
<el-dialog title="机构选择" :visible.sync="dialogOpen" v-if="dialogOpen" append-to-body>
<c-list-search ref="listSearch" @form-reset="handleReset" @form-search="handleSearch" :formCount="formCount">
<template v-slot="slotProps">
<el-form class="m-table-search-form" :model="model" ref="paramsForm" :inline="true" label-position="right"
label-width="100px" size="small">
<el-form-item label="机构号" prop="instNo">
<c-input v-model="model.instNo" style="width:100%" maxlength="16" placeholder="请输入"></c-input>
</el-form-item>
<el-form-item label="机构名称" prop="instName">
<c-input v-model="model.instName" style="width:100%" maxlength="16" placeholder="请输入"></c-input>
</el-form-item>
</el-form>
</template>
</c-list-search>
<c-list-page
ref="cList"
:columnsConfig="columnsConfig"
:params="searchParams"
:pageSize="pageSize"
:multipleSelect="false"
:loadDataFirstRender="false"
:url="url"
:watchCurrentChg="false"
@current-change="handleCurrentChange"
@row-dblclick="handleRowDBClick"
maxHeight="300px"
/>
</el-dialog>
</span>
</template>
<script>
import Api from "~/service/Api";
import Utils from "~/utils"
export default {
data: function () {
return {
dialogOpen:false,
loading:true,
model:{
instNo:'',
instName:''
},
formCount: 2, // 传入搜索项的数量,组件根据数量判断是否可收起
// 映射到 list 中的搜索参数模型,searchParams 改变后会自动重新拉取数据
searchParams: {},
// 列表的配置项
columnsConfig: [
{ prop: "instNo", label: "机构码" },
{ prop: "instName", label: "机构名称" },
{ prop: "pbcInstNo", label: "人行机构编码" },
{ prop: "instType", label: "机构类别" },
{ prop: "instSubType", label: "机构类别细分" },
{ prop: "instShtName", label: "机构简称" },
{ prop: "instAddr", label: "机构地址" }
],
// 每页展示的数据。默认为20
pageSize: 10,
url:"v1/pm/instManage/queryInstFromSync"
}
},
mounted(){
this.handleSearch()
},
methods: {
onDialogOpen(){
this.dialogOpen = true
},
handleRowDBClick: function (row) {
this.$emit('instselect',row)
this.dialogOpen = false
},
// 重置搜索条件需要更新到 searchParams 上
handleReset: function () {
this.model = {
instNo: '',
instName: ''
}
},
handleCurrentChange: async function(){
this.handleSearch()
},
// 点击搜索需要更新 searchParams 的值,注意不能直接将 params 赋值给 searchParams
handleSearch: async function () {
this.$refs["paramsForm"].validate(async valid => {
if(valid){
let requrl = this.url+"?pageIndex="
+this.$refs['cList'].listConfig.current
+"&pageSize="+this.pageSize;
this.$refs['cList'].loading = true;
let rtnmsg = await Api.post(requrl,this.model);
if(rtnmsg.code == 0){
this.$refs['cList'].listConfig.list = rtnmsg.data;
this.$refs['cList'].listConfig.total = rtnmsg.pageInfo.total;
this.$refs['cList'].listConfig.current = rtnmsg.pageInfo.pageIndex;
}else {
this.$notify.error({ title: "错误", message: "服务请求失败!" });
}
this.$refs['cList'].loading = false;
}
})
}
}
}
</script>
<style>
.m-table .m-table-operation {
margin-top: 15px;
}
.m-table .m-table-search-operation-simple {
position: absolute;
right: 20px;
top: 20px;
}
</style>
\ No newline at end of file
<template>
<el-date-picker :id="id" :class="{'highlight': highlight}" v-model="model" v-bind="$attrs" v-on="$listeners" v-bind:disabled="isDisable" :value-format="valueFormat" :format="format"></el-date-picker>
</template>
<script>
export default {
props: {
value: {
default: ''
},
disabled: {
type: Boolean,
default: false
},
valueFormat: {
type: String,
default: 'yyyyMMdd'
},
format: {
type: String,
default: 'yyyy-MM-dd'
},
id: {
type: String,
default: ''
}
},
computed: {
model: {
get () {
return this.value
},
set (newVal) {
this.$emit('input', newVal)
}
},
mode () {
return this.$store.state.Status.mode
},
isDisable: {
get () {
return this.mode === 'display' || this.disabled
}
},
highlight () {
return this.$store.state.Status.highlights.indexOf(this.id) !== -1
}
}
}
</script>
<style>
.el-input.highlight .el-input__inner{
border-color: red;
}
</style>
\ No newline at end of file
<!-- 引用方法
<c-function-btn :handleStart="handleStart" :handleCheck="handleCheck" :handleSave="handleSave"
></c-function-btn>
-->
<template>
<el-col class="eContainer-func" v-if="!isReview">
<el-button type="primary" size="small" @click="handleStart">提交</el-button>
<el-button type="primary" size="small" @click="handleCheck">检核</el-button>
<el-button type="primary" size="small" @click="handleSave">暂存</el-button>
<el-button type="primary" size="small" @click="handleCancel">退出</el-button>
</el-col>
</template>
<script>
// 反洗钱组件引入
export default {
// 如果需要制裁信息按钮则给组件传 showAml 方法,如果不需要则不传
props: ['handleStart', 'handleCheck', 'handleSave'],
data: function () {
return {
isReview: false,
}
},
created () {
if (this.$route.path.indexOf('review') !== -1) {
this.isReview = true
} else {
this.isReview = false
}
},
methods: {
handleCancel: function () {
this.$confirm('确认退出?', '', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning'
}).then(res => {
this.$router.push('/business/home')
}).catch(() => {})
}
}
}
</script>
\ No newline at end of file
<template>
<div @click="handleClick" :id="id" :class="{'c-highlight-content': true, 'highlight': highlight, 'change-light': highlightChanges}">
<slot></slot>
</div>
</template>
<script>
export default {
props: ['id', 'path'],
data: function () {
return {
process: '0'
}
},
computed: {
showHighlight: {
get () {
return this.process == '1' || this.process == '2'
}
},
highlight () {
return this.$store.state.Status.highlights.indexOf(this.id) !== -1
},
highlightChanges () {
let flag = false
this.$store.state.Status.highlightChanges.forEach(item => {
if (item == this.path || item.indexOf(this.path) == 0) {
flag = true
}
})
return flag
}
},
created: function () {
if (this.$route.query.routeParams) {
this.process = this.$route.query.routeParams.process;
this.busiTempInfoSriNo = this.$route.query.routeParams.busiTempInfoSriNo;
}
// this.process = '1'
},
methods: {
handleClick: function () {
if (this.showHighlight) {
this.updateHighlights(this.id)
}
},
updateHighlights(id) {
let list = this.$store.state.Status.highlights;
if (list.indexOf(id) == -1) {
list.push(id)
this.$store.commit('updateRemark', id)
} else {
let index = list.indexOf(id)
list.splice(index, 1)
}
this.$store.commit('setHighlights', list)
},
}
}
</script>
<style>
.c-highlight-content {
/* overflow: hidden; */
}
.c-highlight-content.change-light {
border: 1px solid rgb(201, 171, 1);
}
.c-highlight-content.highlight {
border: 1px solid red;
}
</style>
\ No newline at end of file
<template>
<el-date-picker :id="id" :class="{'highlight': highlight}" placeholder="选择日期" type="date" :picker-options="pickerOptions" v-model="model" v-bind="$attrs"
v-on="$listeners" v-bind:disabled="isDisable" value-format="yyyyMMdd" format="yyyy-MM-dd"></el-date-picker>
</template>
<script>
export default {
props: {
value: {
type: [String, Date],
default: ''
},
disabled: {
type: Boolean,
default: false
},
id: {
type: String,
default: ''
}
},
computed: {
model: {
get() {
return this.value
},
set(newVal) {
this.$emit('input', newVal)
}
},
mode() {
return this.$store.state.Status.mode
},
isDisable: {
get() {
return this.mode === 'display' || this.disabled
}
},
highlight () {
return this.$store.state.Status.highlights.indexOf(this.id) !== -1
}
},
data() {
var holiday = {
'20200801': '建军节',
'20200825': '七夕节',
'20200826': '节日3',
'20200808': '节日4',
'20200814': '节日5'
}
return {
value: '',
pickerOptions: {
cellClassName(data) {
var year = data.getFullYear()
var month = data.getMonth() + 1
var day = data.getDate()
if (month >= 1 && month <= 9) {
month = "0" + month
}
if (day >= 1 && day <= 9) {
day = "0" + day
}
var currentdate = year + month + day
if (holiday[currentdate] !== undefined) {
(currentdate)
return 'holiday'
}
}
}
}
},
methods: {
}
}
</script>
<style>
.holiday span::after {
display: block;
content: "h";
color: white;
width: 14px;
height: 14px;
line-height: 14px;
margin: auto;
position: relative;
left: 15px;
bottom: 30px;
border-radius: 50%;
background-color: #f08080;
}
.el-input.highlight .el-input__inner{
border-color: red;
}
</style>
\ No newline at end of file
<template>
<el-input :id="id" ref="form-item" v-model="model" v-bind="$attrs" v-on="$listeners" v-bind:disabled="isDisable"/>
</template>
<script>
export default {
props: {
value: {
type: [String, Number],
default: undefined
},
disabled: {
type: Boolean,
default: false
},
id: {
type: String,
default: ''
}
},
computed: {
model: {
get () {
return this.value
},
set (newVal) {
this.$emit('input', newVal)
}
},
mode () {
return this.$store.state.Status.mode
},
isDisable: {
get () {
return this.mode === 'display' || this.disabled
}
},
highlight () {
return this.$store.state.Status.highlights.indexOf(this.id) !== -1
},
highlightChanges () {
return this.$store.state.Status.highlightChanges.indexOf(this.id) !== -1
}
}
}
</script>
<style>
/* .el-input.highlight .el-input__inner{
border-color: red;
}
.el-textarea.highlight .el-textarea__inner {
border-color: red;
}
.el-input.change-light .el-input__inner{
border-color: #E6A23C;
}
.el-textarea.change-light .el-textarea__inner {
border-color: #E6A23C;
} */
</style>
\ No newline at end of file
<template>
<el-input
:id="id"
ref="form-item"
class="m-input-currency"
v-model="model"
v-bind="$attrs"
v-on="$listeners"
v-bind:disabled="isDisable"
@blur="onBlur"
@focus="focus"
/>
</template>
<script>
import BigNumber from "./bignumber";
export default {
props: {
value: {
type: [String, Number],
default: undefined
},
currency: {
type: String,
default: "ZH"
},
precision: {
type: Number,
default: 2
},
max: {
type: [Number, String],
default: Infinity
},
min: {
type: [Number, String],
default: 0
},
disabled: {
type: Boolean,
default: false
},
id: {
type: String,
default: ""
}
},
data() {
return {
isOnBlur: true
};
},
computed: {
model: {
get() {
return this.formatCurrency(this.value);
},
set(newVal) {
this.$emit("input", this.formatValue(newVal));
}
},
mode() {
return this.$store.state.Status.mode;
},
highlight() {
return this.$store.state.Status.highlights.indexOf(this.id) !== -1;
},
isDisable: {
get() {
return this.mode === "display" || this.disabled;
}
}
},
methods: {
onBlur() {
this.isOnBlur = true;
},
focus() {
this.isOnBlur = false;
},
formatCurrency(value) {
let max = this.max.toString();
let min = this.min.toString();
if (
this.value !== null &&
this.value !== undefined &&
this.value.toString
) {
if (this.isOnBlur) {
value = this.formatValue(value.toString());
if (value === "" || value === "-") {
this.model = "";
return "";
}
let valueNum = new BigNumber(value);
let maxNum = new BigNumber(max);
let minNum = new BigNumber(min);
if (valueNum.comparedTo(maxNum) == 1) {
value = max;
}
if (valueNum.comparedTo(minNum) == -1) {
value = min;
}
let sign = true;
let array = [];
if (value[0] == "-") {
sign = false;
array = value.slice(1).split(".");
} else {
array = value.split(".");
}
// 增加逗号
var temp = "";
while (array[0].length > 3) {
temp =
"," +
array[0].substring(array[0].length - 3, array[0].length) +
temp;
array[0] = array[0].substring(0, array[0].length - 3);
}
temp = array[0] + temp;
if (this.currency === "392" || this.currency === "JPY") {
this.model = sign ? temp : "-" + temp;
return sign ? temp : "-" + temp;
}
if (this.precision <= 0) {
temp = temp;
} else if (array.length === 1) {
// 没有小数位数,补全 0
temp += ".";
// if (this.precision)
for (var i = 0; i < this.precision; i++) {
temp += "0";
}
} else if (array[1].length < this.precision) {
temp += "." + array[1];
// 精度不足补全 0
for (var i = array[1].length; i < this.precision; i++) {
temp += "0";
}
} else {
temp += "." + array[1].substring(0, this.precision);
}
this.model = sign ? temp : "-" + temp;
return sign ? temp : "-" + temp;
} else {
return this.formatValue(value);
}
}
return this.value;
},
formatValue(value) {
if (value !== null && value !== undefined && value.toString) {
var temp = value
.toString()
.split(",")
.join("");
// 取出正负符号
let sign = true;
if (temp[0] == "-") {
sign = false;
temp = temp.slice(1);
}
// 以小数点开头的前面加 0
if (temp.charAt(0) === ".") temp = "0" + temp;
// 以0 为开头且后面不是小数点的去掉前面的 0
if (temp.charAt(0) === "0" && temp.length > 1 && temp.charAt(1) !== ".")
temp = temp.substring(1);
// 日元只保留前面的数字
if (this.currency === "392" || this.currency === "JPY") {
var i = 0;
while (i < temp.length) {
if (!(temp.charAt(i) >= "0" && temp.charAt(i) <= "9")) break;
i++;
}
temp = temp.substring(0, i);
} else {
// 其他币种取出前面整数和小数部分
var i = 0;
while (i < temp.length) {
if (
!(
(temp.charAt(i) >= "0" && temp.charAt(i) <= "9") ||
temp.charAt(i) === "."
)
)
break;
i++;
}
temp = temp.substring(0, i);
var array = temp.split(".");
if (this.precision <= 0) {
temp = array[0];
} else if (array.length > 1 && array[1].length > 0) {
temp = array[0] + "." + array[1].substring(0, this.precision);
} else if (array.length > 1 && array[1].length === 0) {
temp = array[0] + "."; // 原来有小数点的地方也保留小数
} else {
temp = array[0];
}
}
return sign ? temp : "-" + temp;
}
return value;
}
}
};
</script>
<style>
/* .el-input.highlight .el-input__inner{
border-color: red;
} */
.el-input.m-input-currency .el-input__inner {
text-align: right;
}
</style>
\ No newline at end of file
<template>
<el-input :id="id" :class="{'highlight': highlight}" ref="form-item" v-model="model" v-bind="$attrs" v-on="$listeners" v-bind:disabled="isDisable" @blur="onBlur"
@focus="focus" />
</template>
<script>
export default {
props: {
value: {
type: [String, Number],
default: undefined
},
currency: {
type: String,
default: 'ZH'
},
precision: {
type: Number,
default: 2
},
max: {
type: [Number, String],
default: ''
},
min: {
type: [Number, String],
default: ''
},
disabled: {
type: Boolean,
default: false
},
id: {
type: String,
default: ''
}
},
data() {
return {
isOnBlur: true
}
},
computed: {
model: {
get() {
return this.format(this.value)
},
set(newVal) {
this.$emit('input', this.formatValue(newVal))
}
},
mode() {
return this.$store.state.Status.mode
},
highlight () {
return this.$store.state.Status.highlights.indexOf(this.id) !== -1
},
isDisable: {
get() {
return this.mode === 'display' || this.disabled
}
},
},
methods: {
onBlur() {
this.isOnBlur = true
},
focus() {
this.isOnBlur = false
},
format(value) {
let max = this.max && this.max.toString && this.max.toString() || ''
let min = this.min && this.min.toString && this.min.toString() || ''
if (this.value !== null && this.value !== undefined && this.value.toString) {
if (this.isOnBlur) {
value = this.formatValue(value.toString())
if (value === '') {
this.model = ''
return ''
}
if (max !== '' && this.compareNumber(value, max)) {
value = max
} else if (min !== '' && this.compareNumber(min, value)) {
value = min
}
var array = value.split('.')
var temp = ''
while (array[0].length > 3) {
temp = ',' + array[0].substring(array[0].length - 3, array[0].length) + temp
array[0] = array[0].substring(0, array[0].length - 3)
}
temp = array[0] + temp
if (this.currency === '392' || this.currency=== 'JPY') {
this.model = temp
return temp
}
if (array.length === 1) {
temp += '.'
for (var i = 0; i < this.precision; i++) {
temp += '0'
}
} else if (array[1].length < this.precision) {
temp += '.' + array[1]
for (var i = array[1].length; i < this.precision; i++) {
temp += '0'
}
} else {
temp += '.' + array[1].substring(0, this.precision)
}
this.model = temp
return temp
} else {
return this.formatValue(value)
}
}
return this.value
},
formatValue(value) {
if (value !== null && value !== undefined && value.toString) {
var temp = value.toString().split(',').join('')
if (temp.charAt(0) === '.')
temp = '0' + temp
if (temp.charAt(0) === '0' && temp.length > 1 && temp.charAt(1) !== '.')
temp = temp.substring(1)
if (this.currency === '392' || this.currency=== 'JPY') {
var i = 0;
while (i < temp.length) {
if (!(temp.charAt(i) >= '0' && temp.charAt(i) <= '9'))
break
i++
}
temp = temp.substring(0, i)
} else {
var i = 0;
while (i < temp.length) {
if (!((temp.charAt(i) >= '0' && temp.charAt(i) <= '9') || temp.charAt(i) === '.'))
break
i++
}
temp = temp.substring(0, i)
var array = temp.split('.')
if (array.length > 1 && array[1].length > 0) {
temp = array[0] + '.' + array[1].substring(0, this.precision)
} else if (array.length > 1 && array[1].length === 0) {
temp = array[0] + '.'
} else {
temp = array[0]
}
}
return temp
}
return value
},
compareNumber(num1, num2) {
var arr1 = num1.split('.')
var arr2 = num2.split('.')
if (this.compareInteger(arr1[0], arr2[0])) {
return true
} else if (arr1[0] === arr2[0]) {
if (arr1.length > 1 && arr2.length > 1) {
for (var i = arr2[1].length; i < arr1[1].length; i++) {
arr2[1] += '0'
}
for (var i = arr1[1].length; i < arr2[1].length; i++) {
arr1[1] += '0'
}
return arr1[1] > arr2[1]
} else if (arr1.length > 1 && arr2.length === 1) {
var str = ''
for (var i = 0; i < arr1[1].length; i++) {
str += '0'
}
return arr1[1] > str
} else if (arr1.length === 1 && arr2.length > 1) {
var str = ''
for (var i = 0; i < arr2[1].length; i++) {
str += '0'
}
return str > arr2[1]
} else {
return false
}
} else {
return false
}
},
compareInteger(num1, num2) {
if (num1.length > num2.length) {
return true
} else if (num1.length < num2.length) {
return false
} else {
return num1 > num2
}
}
}
}
</script>
<style>
.el-input.highlight .el-input__inner{
border-color: red;
}
</style>
\ No newline at end of file
<template>
<el-input
:id="id"
ref="form-item"
class="m-input-currency"
v-model="model"
v-bind="$attrs"
v-on="$listeners"
v-bind:disabled="isDisable"
@blur="onBlur"
@focus="focus"
/>
</template>
<script>
import BigNumber from "./bignumber";
export default {
props: {
value: {
type: [String, Number],
default: undefined
},
currency: {
type: String,
default: "ZH"
},
precision: {
type: Number,
default: 2
},
max: {
type: [Number, String],
default: Infinity
},
min: {
type: [Number, String],
default: ""
},
disabled: {
type: Boolean,
default: false
},
id: {
type: String,
default: ""
}
},
data() {
return {
isOnBlur: true
};
},
computed: {
model: {
get() {
return this.formatCurrency(this.value);
},
set(newVal) {
this.$emit("input", this.formatValue(newVal));
}
},
mode() {
return this.$store.state.Status.mode;
},
highlight() {
return this.$store.state.Status.highlights.indexOf(this.id) !== -1;
},
isDisable: {
get() {
return this.mode === "display" || this.disabled;
}
}
},
methods: {
onBlur() {
this.isOnBlur = true;
},
focus() {
this.isOnBlur = false;
},
formatCurrency(value) {
let max = this.max.toString();
let min = this.min.toString();
if (
this.value !== null &&
this.value !== undefined &&
this.value.toString
) {
if (this.isOnBlur) {
value = this.formatValue(value.toString());
if (value === "" || value === "-") {
this.model = "";
return "";
}
let valueNum = new BigNumber(value);
let maxNum = new BigNumber(max);
let minNum = new BigNumber(min);
if (valueNum.comparedTo(maxNum) == 1) {
value = max;
}
if (valueNum.comparedTo(minNum) == -1) {
value = min;
}
let sign = true;
let array = [];
if (value[0] == "-") {
sign = false;
array = value.slice(1).split(".");
} else {
array = value.split(".");
}
// 增加逗号
var temp = "";
while (array[0].length > 3) {
temp =
"," +
array[0].substring(array[0].length - 3, array[0].length) +
temp;
array[0] = array[0].substring(0, array[0].length - 3);
}
temp = array[0] + temp;
if (this.currency === "392" || this.currency === "JPY") {
this.model = sign ? temp : "-" + temp;
return sign ? temp : "-" + temp;
}
if (this.precision <= 0) {
temp = temp;
} else if (array.length === 1) {
// 没有小数位数,补全 0
temp += ".";
// if (this.precision)
for (var i = 0; i < this.precision; i++) {
temp += "0";
}
} else if (array[1].length < this.precision) {
temp += "." + array[1];
// 精度不足补全 0
for (var i = array[1].length; i < this.precision; i++) {
temp += "0";
}
} else {
temp += "." + array[1].substring(0, this.precision);
}
this.model = sign ? temp : "-" + temp;
return sign ? temp : "-" + temp;
} else {
return this.formatValue(value);
}
}
return this.value;
},
formatValue(value) {
if (value !== null && value !== undefined && value.toString) {
var temp = value
.toString()
.split(",")
.join("");
// 取出正负符号
let sign = true;
if (temp[0] == "-") {
sign = false;
temp = temp.slice(1);
}
// 以小数点开头的前面加 0
if (temp.charAt(0) === ".") temp = "0" + temp;
// 以0 为开头且后面不是小数点的去掉前面的 0
if (temp.charAt(0) === "0" && temp.length > 1 && temp.charAt(1) !== ".")
temp = temp.substring(1);
// 日元只保留前面的数字
if (this.currency === "392" || this.currency === "JPY") {
var i = 0;
while (i < temp.length) {
if (!(temp.charAt(i) >= "0" && temp.charAt(i) <= "9")) break;
i++;
}
temp = temp.substring(0, i);
} else {
// 其他币种取出前面整数和小数部分
var i = 0;
while (i < temp.length) {
if (
!(
(temp.charAt(i) >= "0" && temp.charAt(i) <= "9") ||
temp.charAt(i) === "."
)
)
break;
i++;
}
temp = temp.substring(0, i);
var array = temp.split(".");
if (this.precision <= 0) {
temp = array[0];
} else if (array.length > 1 && array[1].length > 0) {
temp = array[0] + "." + array[1].substring(0, this.precision);
} else if (array.length > 1 && array[1].length === 0) {
temp = array[0] + "."; // 原来有小数点的地方也保留小数
} else {
temp = array[0];
}
}
return sign ? temp : "-" + temp;
}
return value;
}
}
};
</script>
<style>
/* .el-input.highlight .el-input__inner{
border-color: red;
} */
.el-input.m-input-currency .el-input__inner {
text-align: right;
}
</style>
\ No newline at end of file
<template>
<el-input :id="id" ref="form-item" v-model="model" type="textarea" v-bind="$attrs" v-on="$listeners" v-bind:disabled="isDisable" :rows="maxRows" resize="none" />
</template>
<script>
export default {
props: {
value: {
type: String,
default: ""
},
maxRows: {
type: Number,
default: 3
},
maxCols: {
type: Number,
default: 4
},
disabled: {
type: Boolean,
default: false
},
id: {
type: String,
default: ''
}
},
computed: {
model: {
get () {
let value = this.format(this.value)
return value
},
set (newVal) {
this.$emit('input', newVal)
}
},
mode () {
return this.$store.state.Status.mode
},
isDisable: {
get () {
return this.mode === 'display' || this.disabled
}
},
highlight () {
return this.$store.state.Status.highlights.indexOf(this.id) !== -1
}
},
methods: {
format: function (value) {
let maxRows = this.maxRows
let maxCols = this.maxCols
var length = 0
var strs = new Array()
strs = value.split('\n')
for (var i = 0; i < strs.length && i < maxRows; i++) {
if (strs[i].length === 0 && i !== strs.length - 1) {
strs.splice(i, 1)
i--
} else if (strs[i].length > maxCols) {
strs.splice(i + 1, 0, strs[i].substring(maxCols))
strs[i] = strs[i].substring(0, maxCols)
}
}
value = ''
for (var i = 0; i < strs.length && i < maxRows; i++) {
if (i === strs.length - 1 || i === maxRows - 1) {
value += strs[i]
} else {
value += strs[i] + '\n'
}
}
return value
}
}
}
</script>
<style>
/* .el-input.highlight .el-input__inner{
border-color: red;
} */
</style>
\ No newline at end of file
<template>
<el-input-number :id="id" :class="{'highlight': highlight}" ref="form-item" v-model="model" :controls="false" v-bind="$attrs" v-on="$listeners" v-bind:disabled="isDisable"/>
</template>
<script>
export default {
props: {
value: {
type: Number,
default: undefined
},
disabled: {
type: Boolean,
default: false
},
id: {
type: String,
default: ''
}
},
computed: {
model: {
get () {
return this.value
},
set (newVal) {
this.$emit('input', newVal)
}
},
mode () {
return this.$store.state.Status.mode
},
isDisable: {
get () {
return this.mode === 'display' || this.disabled
}
},
highlight () {
return this.$store.state.Status.highlights.indexOf(this.id) !== -1
}
}
}
</script>
<style scope>
.el-input-number .el-input__inner {
text-align: left;
}
.el-input.highlight .el-input__inner{
border-color: red;
}
</style>
\ No newline at end of file
<template>
<span>
<c-button type="primary" icon="el-icon-search" class="m-inputbtn-btn" @click="onDialogOpen"></c-button>
<el-dialog title="机构选择(双击以选择机构)" :visible.sync="dialogOpen" append-to-body>
<c-list-search ref="listSearch" @form-reset="handleReset" @form-search="handleSearch" :formCount="formCount">
<template v-slot="slotProps">
<el-form class="m-table-search-form" :model="model" ref="paramsForm" :inline="true" label-position="right"
label-width="100px" size="small">
<el-form-item label="机构号" prop="instCode">
<c-input v-model="model.instCode" style="width:100%" maxlength="16" placeholder="请输入"></c-input>
</el-form-item>
<el-form-item label="机构名称" prop="instName">
<c-input v-model="model.instName" style="width:100%" maxlength="16" placeholder="请输入"></c-input>
</el-form-item>
</el-form>
</template>
</c-list-search>
<c-list-page
ref="cList"
:columnsConfig="columnsConfig"
:params="searchParams"
:pageSize="pageSize"
:multipleSelect="false"
:loadDataFirstRender="false"
:url="url"
:watchCurrentChg="false"
@current-change="handleCurrentChange"
@row-dblclick="handleRowDBClick"
maxHeight="300px"
/>
</el-dialog>
</span>
</template>
<script>
import Api from "~/service/Api";
import Utils from "~/utils"
export default {
data: function () {
return {
dialogOpen:false,
loading:true,
model:{
instCode:'',
instName:''
},
formCount: 2, // 传入搜索项的数量,组件根据数量判断是否可收起
// 映射到 list 中的搜索参数模型,searchParams 改变后会自动重新拉取数据
searchParams: {},
// 列表的配置项
columnsConfig: [
{
prop: "instCode",
label: "机构代码",
width: '100'
},
{
prop: "instName",
label: "机构名称",
width: '100'
},
{
prop: "inClearInstTpName",
label: "国结机构类型",
width: '120'
},
{
prop: "instLvlName",
label: "机构层级",
width: '100'
},
{
prop: "supInstName",
label: "上级机构名称",
width: '120'
},
{
prop: "supBusiInstNo",
label: "上级业务机构",
width: '120'
},
{
prop: "swiftNo",
label: "swift号码",
width: '100'
},
{
prop: "instCnAddr",
label: "机构中文地址",
width: '120'
},
{
prop: 'enableFlagName',
label: '启用标识',
width: '100'
}
],
// 每页展示的数据。默认为20
pageSize: 10,
url:"v1/pm/instManage/queryPage"
}
},
methods: {
onDialogOpen(){
this.dialogOpen = true
},
handleRowDBClick: function (row) {
this.$emit('instselect',row)
this.dialogOpen = false
},
// 重置搜索条件需要更新到 searchParams 上
handleReset: function () {
this.model = {
instCode: '',
instName: ''
}
},
handleCurrentChange: async function(){
this.handleSearch()
},
// 点击搜索需要更新 searchParams 的值,注意不能直接将 params 赋值给 searchParams
handleSearch: async function () {
let requrl = this.url+"?pageIndex="
+this.$refs['cList'].listConfig.current
+"&pageSize="+this.pageSize;
this.$refs['cList'].loading = true;
let rtnmsg = await Api.post(requrl,this.model);
if(rtnmsg.code == 0){
this.$refs['cList'].listConfig.list = rtnmsg.data;
this.$refs['cList'].listConfig.total = rtnmsg.pageInfo.total;
this.$refs['cList'].listConfig.current = rtnmsg.pageInfo.pageIndex;
}else {
this.$notify.error({ title: "错误", message: "服务请求失败!" });
}
this.$refs['cList'].loading = false;
}
}
}
</script>
<style>
.m-table .m-table-operation {
margin-top: 15px;
}
.m-table .m-table-search-operation-simple {
position: absolute;
right: 20px;
top: 20px;
}
</style>
\ No newline at end of file
<template>
<div class="m-table-list">
<slot name="operation"></slot>
<div>
<div class="m-table-list-selection" v-if="multipleSelect">
<span class="desc">已选中{{isSelectAll? listConfig.total: count}}条/共{{listConfig.total}}</span>
<c-button type="text" @click="handleSelectAll">{{isSelectAll?'取消全选': '全选'}}</c-button>
</div>
<c-table
v-bind="listConfig"
:loading="loading"
ref="tablelist"
:default-sort="listConfig.sort ? {prop: listConfig.sort, order: listConfig.order}: {}"
@selection-change="handleSelectionChange"
@current-change="handleCurrentChange"
@sort-change="handleSortChange"
v-on="$listeners"
:tableRowClassName="tableRowClass"
:maxHeight="maxHeight"
:outerHeight="outerHeight"
:row-key="getRowKey"
>
<slot></slot>
</c-table>
</div>
</div>
</template>
<script>
import Request from '~/utils/request'
export default {
props: {
columnsConfig: { // 列配置项
type: Array,
default: []
},
params: { // 搜索查询参数
type: Object,
default: ()=>{}
},
pageSize: { // 每页限制展示数目
type: Number,
default: 20
},
url: { // 拉取列表接口名称
type: String
},
method: { // 拉取列表接口方法,默认 post
type: String,
default: 'post'
},
defaultSort: { // 默认首次加载排序字段名称
type: String,
default: ""
},
defaultOrder: { // 默认首次加载排序顺序
type: String,
default: "ascending"
},
multipleSelect: { // 是否要展示多项选择框
type: Boolean,
default: false
},
loadDataFirstRender: {
type: Boolean,
default: true
},
tableRowClassName: {
type: Function
},
watchCurrentChg:{
type: Boolean,
default: true
},
maxHeight:{
type:String,
default:undefined
},
outerHeight: {
type: Number,
default: undefined
},
},
data(){
return{
listConfig: {
list: [],
total: 0,
current: 1,
limit: this.pageSize,
columnsConfig: this.columnsConfig,
sort: this.defaultSort,
order: this.defaultOrder,
},
count: 0,
isSelectAll: false,
selection: [],
loading: false,
isMounted: false
}
},
computed: {
'searchParams': function () {
console.log('computed searchParams')
let params = {}
if(this.watchCurrentChg){
params = {
current: this.listConfig.current,
size: this.pageSize,
data: this.params
}
}else{
params = {
size: this.pageSize,
data: this.params
}
}
if (this.listConfig.sort && this.listConfig.order) {
params.orders = [
{
column: this.listConfig.sort,
asc: this.listConfig.order == 'ascending'
}
]
}
return params
}
},
watch: {
'params': function () {
// 更改搜索条件需要重置为 0
this.listConfig.current = 1
},
'searchParams': function () {
if (this.isMounted) {
this.getList()
}
}
},
created() {
if (this.multipleSelect &&
this.listConfig.columnsConfig &&
this.listConfig.columnsConfig[0].type !== 'selection') {
this.listConfig.columnsConfig.unshift({
type: "selection",
width: "55",
fixed: "left"
})
}
},
mounted () {
if (this.loadDataFirstRender) {
this.getList()
}
this.isMounted = true
},
methods: {
handleSelectionChange: function (selection) {
this.count = selection.length
this.selection = selection
this.isSelectAll = false
this.$emit('selection-change', selection)
},
handleCurrentChange: function (current) {
this.listConfig.current = current
this.$emit('current-change',current)
},
handleSortChange: function ({column, prop, order}) {
this.listConfig.sort = column.columnKey || prop
if (order == 'ascending') {
this.listConfig.order = 'ascending'
} else {
this.listConfig.order = 'descending'
}
this.listConfig.current = 1
},
getList() {
if (this.url && this.method == 'post') {
let self = this
self.loading = true
Request.post(this.url, this.searchParams).then(res => {
if (res.code === SUCCESS) {
self.listConfig.list = res.data || []
self.listConfig.total = res.pageInfo && res.pageInfo.total || 0
self.$emit('update-list', self.listConfig.list, self.listConfig.total, res)
} else {
self.listConfig.list = []
self.listConfig.total = 0
}
self.loading = false
}).catch(err=> {
self.loading = false
})
}
},
handleSelectAll: function() {
let currentSelectAll = !this.isSelectAll
if (currentSelectAll) {
// 全选
this.$refs["tablelist"].$refs["table"].clearSelection()
this.listConfig.list.forEach(row => {
this.$refs["tablelist"].$refs["table"].toggleRowSelection(row)
})
this.selection = []
this.count = this.listConfig.total
this.$emit('selection-change', this.selection, currentSelectAll)
} else {
// 取消全选
this.$refs["tablelist"].$refs["table"].clearSelection()
this.selection = []
this.count = 0
this.$emit('selection-change', this.selection, currentSelectAll)
}
this.isSelectAll = currentSelectAll
},
tableRowClass: function ({row, rowIndex}) {
if (this.tableRowClassName) {
return this.tableRowClassName({row, rowIndex})
} else {
return ''
}
},
getRowKey(row){
let key = null
this.$emit('getRowKey',row,val => {key = val})
return key
}
},
}
</script>
<style>
.eContainer-table-block .paginationLable{
font-size: 12px;
color: #808080;
height: 26px;
line-height: 26px;
float:right;
margin-top:20px;
}
.eContainer-table-block .el-table__body-wrapper {
overflow: auto;
}
.m-table-list {
margin-top: 20px;
}
.m-table-list-operation {
margin-bottom: 15px;
}
.m-table-list-selection .desc{
font-size: 14px;
color: #808080;
}
.m-table-search-operation-simple {
position: absolute;
right: 20px;
top: 20px;
}
</style>
\ No newline at end of file
<template>
<div class="m-table-search">
<slot v-bind:searchToggle="searchToggle"></slot>
<div v-if="formCount>3" :class="searchToggle? (formCount%3 == 0?'m-table-search-operation':'m-table-search-operation-bottom'): 'm-table-search-operation-top'" >
<el-button size="small" @click="handleReset">重置</el-button>
<el-button type="primary" icon="el-icon-search" size="small" @click="handleSearch">查询</el-button>
<el-button type="text" @click="handleToggleSearch">
{{searchToggle?'收起': '展开'}}
<i :class="searchToggle? 'el-icon-arrow-up': 'el-icon-arrow-down'"></i>
</el-button>
</div>
<div v-if="formCount <= 3" :class="formCount == 3? 'm-table-search-operation': 'm-table-search-operation-top'">
<el-button size="small" @click="handleReset">重置</el-button>
<el-button type="primary" icon="el-icon-search" size="small" @click="handleSearch">查询</el-button>
</div>
</div>
</template>
<script>
export default {
props: {
formCount: {
type: Number,
default: 6
}
},
data: function () {
return {
searchToggle: false
}
},
created: function () {
if (this.formCount <= 3) {
this.searchToggle = true
}
},
methods: {
handleReset: function () {
this.$emit('form-reset')
},
handleSearch: function () {
this.$emit('form-search')
},
handleToggleSearch: function () {
this.searchToggle = !this.searchToggle
this.$emit('search-toggle', this.searchToggle)
},
}
}
</script>
<style>
.m-table-search {
position: relative;
margin: -20px -20px 0 -20px;
padding: 20px 20px 10px 20px;
border-bottom: 10px solid rgb(232, 232, 232);
}
.m-table-search-operation {
text-align: right;
}
.m-table-search-form {
position: flex;
flex-direction: row;
}
.m-table-search-form .el-form-item__content {
width: calc(100% - 110px);
}
.m-table-search-form .el-form-item {
width: 33%;
margin-right: 0;
padding-right: 20px;
box-sizing: border-box;
}
.m-table-search-form .el-form-item:nth-child(3n) {
padding-right: 0;
}
.m-table-operation {
margin-top: 15px;
}
.m-table-search-operation-top {
position: absolute;
right: 20px;
top: 20px;
}
.m-table-search-operation-bottom {
position: absolute;
right: 20px;
bottom: 30px;
}
</style>
\ No newline at end of file
<template>
<el-select
:id="id" v-model="model" v-bind="$attrs"
v-on="$listeners"
:disabled="disabled"
:clearable="clearable"
:multiple="multiple"
:loading="loading"
@change="handelSelChange">
<div v-if="queryable" style="width:90%;margin-left:5%">
<el-input v-model="cond">
<i slot="suffix" class="el-input__icon el-icon-search" @click="getOptions(1)" @keyup.enter="getOptions(1)"></i>
</el-input>
</div>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
<el-pagination
:total="total"
:current-page="current"
:page-size="pagesize"
@current-change="handleCurrentChange"
layout="prev,pager,next">
</el-pagination>
</el-select>
</template>
<script>
import Request from '~/utils/request'
export default {
props:{
value: {
type:[String,Number,Array],
default: undefined
},
disabled: {
type: Boolean,
default: false
},
placeholder:{
type:String,
default: '请选择'
},
clearable: {
type: Boolean,
default: true
},
multiple: {
type: Boolean,
default: false
},
id: {
type: String,
default: ''
},
remote:{
type:Boolean,
default:true
},
filterable:{
type:Boolean,
default:true
},
url:{
type:String,
required:true
},
code:{
type:String,
required:true
},
name:{
type:String,
required:true
},
pagesize:{
type:Number,
default:20
},
queryable:{
type:Boolean,
default:true
}
},
data(){
return {
loading:false,
options:[],
total:0,
current:1,
isMounted:false,
cond:'',
}
},
computed:{
model:{
get(){
if(this.multiple && typeof this.value == 'string'){
return this.value.split(',')
}else{
return this.value
}
},
set(newVal) {
//this.value = newVal.join(',')
console.log(newVal)
if(this.multiple){
let valStr = newVal.join(',')
this.$emit('input', valStr)
}else{
this.$emit('input', newVal)
}
//this.$emit('update:value',newVal)
}
}
},
watch:{
/*model:{
handler(newVal,oldVal){
this.$emit('update:value',newVal)
},
deep:true
},*/
current(val){
}
},
mounted(){
this.getOptions(1)
},
methods:{
async getOptions(page){
if (this.url) {
let self = this
self.loading = true
self.options = []
let requrl = self.url+"?pageIndex="
+page
+"&pageSize="+self.pagesize
Request.post(requrl, {'cond':this.cond}).then(res => {
if (res.code === SUCCESS) {
for(let item of res.data){
let obj = {}
obj.key = item[self.code]
obj.label = item[self.name]
obj.value = item[self.code]
self.options.push(obj)
}
self.total = res.pageInfo && res.pageInfo.total || 0
self.loading = false
}
}).catch(err=> {
self.loading = false
})
}
},
handleCurrentChange(val){
this.current = val
this.getOptions(val)
},
handelSelChange(sels){
}
}
}
</script>
\ No newline at end of file
<template>
<span>
<c-button type="primary" @click="onDialogOpen" size="small">打印</c-button>
<el-dialog title="打印" :visible.sync="dialogOpen" width="75%">
<div class="eContainer">
</div>
</el-dialog>
</span>
</template>
<script>
import Api from "~/service/Api"
import Utils from "~/utils"
export default {
props: ['service', 'flag', 'extkey', 'ctx'],
data() {
return {
dialogOpen: false,
loading: true,
model: {
ptyname: "",
ptyData: []
}
}
},
methods: {
onDialogOpen() {
this.dialogOpen = true
}
}
}
</script>
\ No newline at end of file
<template>
<el-radio v-model="model" v-bind="$attrs" v-on="$listeners" v-bind:disabled="isDisable">
<slot></slot>
</el-radio>
</template>
<script>
export default {
props: {
value: {
type: String,
default: ''
},
disabled: {
type: Boolean,
default: false
}
},
computed: {
model: {
get () {
return this.value
},
set (newVal) {
this.$emit('input', newVal)
}
},
mode () {
return this.$store.state.Status.mode
},
isDisable: {
get () {
return this.mode === 'display' || this.disabled
}
}
}
}
</script>
\ No newline at end of file
<template>
<el-radio-group :id="id" v-model="model" v-bind="$attrs" v-on="$listeners" v-bind:disabled="isDisable">
<slot></slot>
</el-radio-group>
</template>
<script>
export default {
props: {
value: {
type: [String, Boolean],
default: ''
},
disabled: {
type: Boolean,
default: false
},
id: {
type: String,
default: ''
}
},
computed: {
model: {
get () {
return this.value
},
set (newVal) {
this.$emit('input', newVal)
}
},
mode () {
return this.$store.state.Status.mode
},
isDisable: {
get () {
return this.mode === 'display' || this.disabled
}
},
highlight () {
return this.$store.state.Status.highlights.indexOf(this.id) !== -1
},
highlightChanges () {
return this.$store.state.Status.highlightChanges.indexOf(this.id) !== -1
}
}
}
</script>
<style>
/* .el-radio-group.highlight {
padding: 10px;
margin: -10px;
border: 1px solid red;
}
.el-radio-group.change-light {
padding: 10px;
margin: -10px;
border: 1px solid #E6A23C;
} */
</style>
\ No newline at end of file
<template>
<el-select
:id="id" v-model="model" v-bind="$attrs"
v-on="$listeners" v-bind:disabled="isDisable" :clearable="clearable" @click.native="handleClick" >
<slot></slot>
</el-select>
</template>
<script>
export default {
props: {
value: {
type: [String, Array, Number],
default: undefined
},
disabled: {
type: Boolean,
default: false
},
clearable: {
type: Boolean,
default: true
},
id: {
type: String,
default: ''
}
},
computed: {
model: {
get() {
return this.value
},
set(newVal) {
this.$emit('input', newVal)
}
},
mode() {
return this.$store.state.Status.mode
},
isDisable: {
get() {
return this.mode === 'display' || this.disabled
}
},
highlight () {
return this.$store.state.Status.highlights.indexOf(this.id) !== -1
}
},
methods: {
handleClick: function (e) {
let ev = new Event("click", {"bubbles": true})
let node = e.target
if (node.parentElement) {
node.parentElement.dispatchEvent(ev)
}
}
}
}
</script>
<style>
/* .el-select.highlight .el-input .el-input__inner {
border-color: red;
} */
</style>
\ No newline at end of file
<template>
<div class="eContainer-table-block">
<el-table :id="tableRef" :data="list" ref="table" style="width: 100%" class="eContainer-table" :header-cell-style="{background: 'eef1f6', color: '#606266'}"
v-bind="$attrs" v-on="tableListeners" v-loading="loading" :row-class-name="tableRowClass" :max-height="maxHeight">
<el-table-column
v-for="(item, key) in columnsConfig"
:key="key"
v-bind="item"
></el-table-column>
<slot></slot>
</el-table>
<el-pagination
class="eContainer-pagination"
:background="type=='small'? false: true"
small
layout="prev, pager, next, jumper"
:page-size="limit"
:current-page="current"
:total="total"
v-on="$listeners"
></el-pagination>
<div class="paginationLable">当前显示第 {{page1}}-{{page2}} 条,共 {{total}}</div>
</div>
</template>
<script>
export default {
props: {
type: {
type: String,
default: 'normal'
},
list: {
type: Array,
default: () => {
return []
}
},
columnsConfig: {
type: Array,
default: () => {
return []
}
},
total: {
type: Number,
default: 0
},
current: {
type: Number,
default: 0
},
limit: {
type: Number,
default: 0
},
outerHeight: {
type: Number,
default: undefined
},
loading: {
type: Boolean,
default: false
},
tableRowClassName: {
type: Function
},
maxHeight:{
type: String,
default:undefined
}
},
data(){
return{
page1:'',
page2:'',
tableListeners: {},
tableRef: 'tableRef' + Math.floor(Math.random() * 100)
}
},
watch: {
'current': function () {
this.getPageNum()
},
'outerHeight': function () {
if (this.outerHeight !== undefined) {
window.removeEventListener('resize', this.handleResizeBind)
this.clientHeight = `${document.documentElement.clientHeight}`
this.changeFixed()
this.handleResizeBind = this.handleResize.bind(this, this.tableRef, this.outerHeight)
window.addEventListener('resize', this.handleResizeBind)
}
}
},
created() {
this.getPageNum()
this.tableListeners = {...this.$listeners}
delete this.tableListeners['current-change']
},
mounted() {
if (this.outerHeight) {
this.clientHeight = `${document.documentElement.clientHeight}`
this.changeFixed()
this.handleResizeBind = this.handleResize.bind(this, this.tableRef, this.outerHeight)
window.addEventListener('resize', this.handleResizeBind)
}
},
methods: {
changeFixed() {
let content = document.getElementById(this.tableRef)
let clientHeight = `${document.documentElement.clientHeight}`
let target
for (let i = 0; i < content.children.length; i++) {
if (content.children[i].classList.contains('el-table__body-wrapper')) {
target = content.children[i]
}
}
target.style.maxHeight = clientHeight - this.outerHeight + 'px'
},
handleResize: (tableRef, outerHeight) => {
let content = document.getElementById(tableRef)
let clientHeight = `${document.documentElement.clientHeight}`
let target
for (let i = 0; i < content.children.length; i++) {
if (content.children[i].classList.contains('el-table__body-wrapper')) {
target = content.children[i]
}
}
target.style.maxHeight = clientHeight - outerHeight + 'px'
},
getPageNum(){
if( this.current == Math.ceil(this.total/this.limit)){
this.page1 = this.current*this.limit-this.limit + 1
this.page2 = this.total
}else{
this.page1 = this.current*this.limit-this.limit + 1
this.page2 = this.current*this.limit
}
},
tableRowClass: function ({row, rowIndex}) {
if (this.tableRowClassName) {
return this.tableRowClassName({row, rowIndex})
} else {
return ''
}
}
},
destroyed: function () {
if (this.outerHeight) {
window.removeEventListener('resize', this.handleResizeBind)
}
},
}
</script>
<style>
.eContainer-table-block .paginationLable{
font-size: 12px;
color: #808080;
height: 26px;
line-height: 26px;
float:right;
margin-top:20px;
}
.eContainer-table-block .el-table__body-wrapper {
overflow: auto;
}
.el-table .warning-row {
background: oldlace;
}
.el-table .success-row {
background: #f0f9eb;
}
</style>
\ No newline at end of file
......@@ -3,11 +3,71 @@ import PtyPicker from "./PtyPicker"
import UnicodePicker from "./UnicodePicker"
import DocShow from "./DocShow"
import Input from "./Input.vue"
import Select from "./Select.vue"
import Button from './Button.vue'
import DatePicker from './DatePicker.vue'
import Checkbox from './Checkbox.vue'
import Table from "./Table"
import Radio from "./Radio"
import InputNumber from "./InputNumber"
import PrintButton from "./PrintButton"
import InputFormat from "./InputFormat"
import InputCurrency from "./InputCurrency"
import InputCurrencyMin from "./InputCurrencyMin"
import HolidayPicker from "./HolidayPicker"
import Content from "./Content"
import RadioGroup from "./RadioGroup"
import CheckboxGroup from "./CheckboxGroup"
import Cascader from "./Cascader.vue"
import List from "./List"
import ListSearch from "./ListSearch"
import HighlightContent from "./HighlightContent"
// 循环组件
import MessageArea from '~/widget/SwfMessage/MessageArea'
import CycList from '~/widget/SwfMessage/CycList'
import SeqList from '~/widget/SwfMessage/SeqList'
import Tag from '~/widget/SwfMessage/Tag'
import DailyInstPicker from "./DailyInstPicker"
import InstPicker from "./InstPicker"
import AutoComplete from "./AutoComplete"
import PagedSelect from "./PagedSelect"
import FunctionBtn from "./FunctionBtn"
export default {
install(Vue){
Vue.component("c-page",c_page)
Vue.component("c-ptypicker",PtyPicker)
Vue.component("c-docshow",DocShow)
Vue.component("c-UnicodePicker",UnicodePicker)
install(Vue) {
Vue.component("c-page", c_page)
Vue.component('c-input', Input)
Vue.component('c-select', Select)
Vue.component('c-button', Button)
Vue.component('c-date-picker', DatePicker)
Vue.component('c-checkbox', Checkbox)
Vue.component("c-ptypicker", PtyPicker)
Vue.component("c-docshow", DocShow)
Vue.component("c-UnicodePicker", UnicodePicker)
Vue.component("c-table", Table)
Vue.component("c-radio", Radio)
Vue.component("c-input-number", InputNumber)
Vue.component("c-print-button", PrintButton)
Vue.component("c-input-format", InputFormat)
Vue.component("c-input-currency", InputCurrency)
Vue.component("c-input-currency-min", InputCurrencyMin)
Vue.component("c-holiday-picker", HolidayPicker)
Vue.component("c-content", Content)
Vue.component("c-radio-group", RadioGroup)
Vue.component("c-list-page", List)
Vue.component("c-list-search", ListSearch)
Vue.component('message-area', MessageArea)
Vue.component('cyc-list', CycList)
Vue.component('seq-list', SeqList)
Vue.component('m-tag', Tag)
Vue.component("c-dailyinstpicker", DailyInstPicker)
Vue.component("c-instpicker", InstPicker)
Vue.component("c-autocomplete", AutoComplete)
Vue.component("c-checkbox-group", CheckboxGroup)
Vue.component("c-cascader", Cascader)
Vue.component("c-highlight-content", HighlightContent)
Vue.component("c-paged-select",PagedSelect)
Vue.component("c-function-btn", FunctionBtn)
}
}
\ No newline at end of file
export default class ButtonAuthValidate {
//校验当前用户是否有点击该按钮的权限 buttonName需要统一注册
static validate(buttonName) {
return this.$store.state.status.authButtons.includes(buttonName)
}
}
\ No newline at end of file
export default class DocuParser {
// 组装table里面的数据项,在beforeStart之前一定要调用
static processDocu(docuList) {
return docuList.map(item => {
return `${item.currEnName}|${item.ExgRatMaxPermitChgPct1}|${item.ExgRatMaxPermitChgPct2}`
}).join(';')
}
static initDocu(arr) {
// 解析table里面的数据项,在loadData之后一定要调用
let docuList = [];
if (arr) {
docuList = arr.split(';').map(item => {
let tmpItem = item.split('|');
return {
docuNo: new Date().getTime() + '',
// currCode2: "",
// currCode: "",-
currEnName: tmpItem[0],
// currCnName: "",
// decimalBit: "",
// unit: "",
ExgRatMaxPermitChgPct1: tmpItem[1],
ExgRatMaxPermitChgPct2: tmpItem[2]
};
})
}
return docuList;
};
}
\ No newline at end of file
/* eslint-disable */
import { saveAs } from 'file-saver'
import XLSX from 'xlsx'
function generateArray(table) {
var out = [];
var rows = table.querySelectorAll('tr');
var ranges = [];
for (var R = 0; R < rows.length; ++R) {
var outRow = [];
var row = rows[R];
var columns = row.querySelectorAll('td');
for (var C = 0; C < columns.length; ++C) {
var cell = columns[C];
var colspan = cell.getAttribute('colspan');
var rowspan = cell.getAttribute('rowspan');
var cellValue = cell.innerText;
if (cellValue !== "" && cellValue == +cellValue) cellValue = +cellValue;
//Skip ranges
ranges.forEach(function (range) {
if (R >= range.s.r && R <= range.e.r && outRow.length >= range.s.c && outRow.length <= range.e.c) {
for (var i = 0; i <= range.e.c - range.s.c; ++i) outRow.push(null);
}
});
//Handle Row Span
if (rowspan || colspan) {
rowspan = rowspan || 1;
colspan = colspan || 1;
ranges.push({
s: {
r: R,
c: outRow.length
},
e: {
r: R + rowspan - 1,
c: outRow.length + colspan - 1
}
});
};
//Handle Value
outRow.push(cellValue !== "" ? cellValue : null);
//Handle Colspan
if (colspan)
for (var k = 0; k < colspan - 1; ++k) outRow.push(null);
}
out.push(outRow);
}
return [out, ranges];
};
function datenum(v, date1904) {
if (date1904) v += 1462;
var epoch = Date.parse(v);
return (epoch - new Date(Date.UTC(1899, 11, 30))) / (24 * 60 * 60 * 1000);
}
function sheet_from_array_of_arrays(data, opts) {
var ws = {};
var range = {
s: {
c: 10000000,
r: 10000000
},
e: {
c: 0,
r: 0
}
};
for (var R = 0; R != data.length; ++R) {
for (var C = 0; C != data[R].length; ++C) {
if (range.s.r > R) range.s.r = R;
if (range.s.c > C) range.s.c = C;
if (range.e.r < R) range.e.r = R;
if (range.e.c < C) range.e.c = C;
var cell = {
v: data[R][C]
};
if (cell.v == null) continue;
var cell_ref = XLSX.utils.encode_cell({
c: C,
r: R
});
if (typeof cell.v === 'number') cell.t = 'n';
else if (typeof cell.v === 'boolean') cell.t = 'b';
else if (cell.v instanceof Date) {
cell.t = 'n';
cell.z = XLSX.SSF._table[14];
cell.v = datenum(cell.v);
} else cell.t = 's';
ws[cell_ref] = cell;
}
}
if (range.s.c < 10000000) ws['!ref'] = XLSX.utils.encode_range(range);
return ws;
}
function Workbook() {
if (!(this instanceof Workbook)) return new Workbook();
this.SheetNames = [];
this.Sheets = {};
}
function s2ab(s) {
var buf = new ArrayBuffer(s.length);
var view = new Uint8Array(buf);
for (var i = 0; i != s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;
return buf;
}
export function export_table_to_excel(id) {
var theTable = document.getElementById(id);
var oo = generateArray(theTable);
var ranges = oo[1];
/* original data */
var data = oo[0];
var ws_name = "SheetJS";
var wb = new Workbook(),
ws = sheet_from_array_of_arrays(data);
/* add ranges to worksheet */
// ws['!cols'] = ['apple', 'banan'];
ws['!merges'] = ranges;
/* add worksheet to workbook */
wb.SheetNames.push(ws_name);
wb.Sheets[ws_name] = ws;
var wbout = XLSX.write(wb, {
bookType: 'xlsx',
bookSST: false,
type: 'binary'
});
saveAs(new Blob([s2ab(wbout)], {
type: "application/octet-stream"
}), "test.xlsx")
}
export function export_json_to_excel({
multiHeader = [],
header,
data,
filename,
merges = [],
autoWidth = true,
bookType = 'xlsx'
} = {}) {
/* original data */
filename = filename || 'excel-list'
data = [...data]
data.unshift(header);
for (let i = multiHeader.length - 1; i > -1; i--) {
data.unshift(multiHeader[i])
}
var ws_name = "SheetJS";
var wb = new Workbook(),
ws = sheet_from_array_of_arrays(data);
if (merges.length > 0) {
if (!ws['!merges']) ws['!merges'] = [];
merges.forEach(item => {
ws['!merges'].push(XLSX.utils.decode_range(item))
})
}
if (autoWidth) {
/*设置worksheet每列的最大宽度*/
const colWidth = data.map(row => row.map(val => {
/*先判断是否为null/undefined*/
if (val == null) {
return {
'wch': 10
};
}
/*再判断是否为中文*/
else if (val.toString().charCodeAt(0) > 255) {
return {
'wch': val.toString().length * 2
};
} else {
return {
'wch': val.toString().length
};
}
}))
/*以第一行为初始值*/
let result = colWidth[0];
for (let i = 1; i < colWidth.length; i++) {
for (let j = 0; j < colWidth[i].length; j++) {
if (result[j]['wch'] < colWidth[i][j]['wch']) {
result[j]['wch'] = colWidth[i][j]['wch'];
}
}
}
ws['!cols'] = result;
}
/* add worksheet to workbook */
wb.SheetNames.push(ws_name);
wb.Sheets[ws_name] = ws;
var wbout = XLSX.write(wb, {
bookType: bookType,
bookSST: false,
type: 'binary'
});
saveAs(new Blob([s2ab(wbout)], {
type: "application/octet-stream"
}), `${filename}.${bookType}`);
}
// // example
// // 普通input框必输, blur 时触发校验
// [Validator.RequiredBlur()]
// // 普通 select, radio, datepicker 必输, change 时触发校验
// [Validator.RequiredChange()]
// // 固定字符长度校验
// [
// Validator.RequiredBlur(),
// Validator.StrLength(4)
// ]
// // 字符长度范围校验
// [
// Validator.RequiredBlur(),
// Validator.StrRange(4,8)
// ]
// // 数字位数范围校验
// [
// Validator.RequiredBlur(),
// // 整数位不超过 5位,小数位不超过2位
// Validator.CurrencyRange(5, 2)
// ],
// // 特殊校验
// [
// Validator.RequiredBlur(),
// Validator.func(() => {
// return true
// })
// ]
export default {
CurrencyRange (count, precision) {
let reg = new RegExp(`^[\\d]{1,${count}}[\\.]{0,1}[\\d]{0,${precision}}$`, 'g')
return {
message: `数字整数位不得超过${count}位,小数位不得超过${precision}`,
pattern: reg,
trigger: 'change'
}
},
RequiredBlur (flag = true) {
return {
required: flag,
message: '该项为必输项',
trigger: 'blur'
}
},
RequiredChange (flag = true) {
return {
required: flag,
message: '该项为必输项',
trigger: 'change'
}
},
StrRange (min, max, trigger = 'blur') {
return {
min: min,
max: max,
message: `字符串长度为${min}-${max}位`,
trigger: trigger
}
},
StrLength (length, trigger = 'blur') {
return {
len: length,
message: `字符串长度需为${length}`,
trigger: trigger
}
},
func (judgeFunc, trigger = 'change') {
return {
async validator(rule, value, callback) {
let res = await judgeFunc()
if (res == true) {
callback()
} else {
callback(new Error(res))
}
},
trigger: trigger
}
}
}
\ No newline at end of file
import axios from 'axios'
export const BASE_HOST = "/"
export const BASE_URI = BASE_HOST + "";
const instance = axios.create({
baseURL: BASE_URI,
timeout: 5000,
method: 'post',
});
export default class FileUpload {
static fileUpload(url, data = {}, params = {}) {
return this._base(url, 'post', data, params)
}
static fileDownload(url) {
return this._base(url, "get", {}, "");
}
static _base(url, method, data, params, headers = {
'Content-Type': 'multipart/form-data'
}) {
return new Promise((resolve, reject) => {
axios({
url: BASE_URI + url,
method: method,
data,
params,
timeout: 50000,
headers: headers
}).then(response => {
const { data } = response;
resolve(data)
})
.catch(error => {
});
});
}
static pget(url, data) {
let token = window.sessionStorage.token
let userId = window.sessionStorage.userId
let headers = { userId, token, "terminal": "WEB" };
if (url != `${BASE_URI}login` && token)
headers.token = token;
return new Promise((resolve, reject) => {
axios.get(url, data, {
headers,
timeout: 50000,
})
.then(response => {
const { data } = response;
resolve(data)
})
.catch(error => {
if (error.response) {
// The request was made and the server responded with a status code
// that falls out of the range of 2xx
console.log(error.response.data);
console.log(error.response.status);
console.log(error.response.headers);
resolve(error.response.status);
} else if (error.request) {
// The request was made but no response was received
// `error.request` is an instance of XMLHttpRequest in the browser and an instance of
// http.ClientRequest in node.js
console.log(error.request);
resolve('error.request');
} else {
// Something happened in setting up the request that triggered an Error
console.log('Error', error.message);
resolve(error.message);
}
console.log(error.config);
});
})
}
static get(url, data) {
return this.pget(BASE_HOST + url, data)
}
static downloadFile(excelObj, filename) {
let url = document.createElement('a');
url.download = filename;
url.style.display = "none";
url.href = excelObj;
document.body.appendChild(url);
url.click()
document.body.removeChild(url);
}
}
// 数字展示成金额
export function moneyFormat(value, precision = 2) {
//0
let num = value
if (num == 0) {
return num.toLocaleString();
}
if (num) {
num = typeof num == 'string' ? parseFloat(num) : num
num = num.toFixed(precision);
num = parseFloat(num);
num = num.toLocaleString();
return num;
} else {
return num = null;
}
}
export function dateFormatFunc(date) {
if (date != null) {
const pattern = /(\d{4})(\d{2})(\d{2})/
let formatedDate = date.replace(pattern, '$1-$2-$3')
return formatedDate
}
}
export function datetimeFormat(datetime) {
//replace方法需要datetime判空 否则前端error 无法展示查询出的数据
if (datetime != null) {
const pattern = /(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/
let formatedDatetime = datetime.replace(pattern, '$1-$2-$3 $4:$5:$6')
return formatedDatetime
}
}
export function monthFormat(month) {
if (month != null) {
const pattern = /(\d{4})(\d{2})/
return month.replace(pattern, '$1-$2')
}
}
export function bopcurFormatFunc(value, config) {
var obj = {};
obj = config.find(function (item) {
return item.value === value;
});
if (obj != undefined) {
return obj.label;
} else {
return "";
}
}
export function instFormat(value, config) {
var obj = {};
obj = config.find(function (item) {
return item.instCode === value;
});
if (obj != undefined) {
return obj.instName;
} else {
return "";
}
}
\ No newline at end of file
import Request from "~/utils/request";
export async function getCurr() {
var cur = [];
var params = {
current: 0,
size: 0
};
let rst = await Request.post("v1/pm/curs", params);
if (rst.code == "000000") {
for (var i = 0; i < rst.data.length; i++) {
cur.push({
value: rst.data[i].currCode,
label: rst.data[i].currSymbol + "-" + rst.data[i].currCnName
});
}
}
return cur;
}
export async function getInsts() {
//根据受理中心机构号查询下属营销机构
var marketInsts = [];
let instCode = window.sessionStorage.instCode;
console.log("受理中心机构号: ", instCode);
let rst = await Request.get("/v1/pm/instManage/queryDownInstById/" + instCode);
if (rst.code == "000000") {
marketInsts = rst.data;
}
return marketInsts;
}
export async function getCountries() {
var country = [];
var info = {
current: 0,
size: 0,
data: {}
};
let rst = await Request.post("v1/pm/Cou/cous", info);
if (rst.code == "000000") {
for (var i = 0; i < rst.data.length; i++) {
country.push({
value: rst.data[i].countryRegionCode,
label: rst.data[i].countryEnName + "-" + rst.data[i].countryCnName
});
}
}
return country;
}
\ No newline at end of file
/**
*
* UUID
*/
export function getUUID() {
var s = [];
var hexDigits = "0123456789abcdef";
for(var i=0;i<36;i++){
s[i] = hexDigits.substr(Math.floor(Math.random()*0x10),1);
}
s[14] = "4";
s[19] = hexDigits.substr((s[19] & 0x3) | 0x8,1);
s[8] = s[13] = s[18] = s[23] = "";
return s.join("");
}
import axios from 'axios'
import {
MessageBox,
Notification,
} from 'element-ui'
export const BASE_HOST = ""
export const BASE_URI = BASE_HOST + "";
const instance = axios.create({
baseURL: BASE_URI,
timeout: 5000,
method: 'post',
});
export default class Request {
static pget(url, data) {
let token = window.sessionStorage.token
let userId = window.sessionStorage.userId
let headers = {
userId,
token,
"terminal": "WEB"
};
if (url != `${BASE_URI}login` && token)
headers.token = token;
return new Promise((resolve, reject) => {
axios.get(url, data, {
headers,
timeout: 50000,
})
.then(response => {
const {
data
} = response;
resolve(data)
})
.catch(error => {
if (error.response) {
// The request was made and the server responded with a status code
// that falls out of the range of 2xx
console.log(error.response.data);
console.log(error.response.status);
console.log(error.response.headers);
resolve(error.response.status);
} else if (error.request) {
// The request was made but no response was received
// `error.request` is an instance of XMLHttpRequest in the browser and an instance of
// http.ClientRequest in node.js
console.log(error.request);
resolve('error.request');
} else {
// Something happened in setting up the request that triggered an Error
console.log('Error', error.message);
resolve(error.message);
}
console.log(error.config);
});
})
}
static logout() {
console.log('asdasdasdasdasd')
window.location.href = "#/login";
}
// static _post(url, data, method = "post") {
// let token = window.sessionStorage.token
// let userId = window.sessionStorage.userId
// let headers = {
// userId,
// token,
// "terminal": "WEB"
// };
// if (url != `${BASE_URI}login` && token)
// headers.token = token;
// return new Promise((resolve, reject) => {
// axios.post(url, data, {
// headers,
// method,
// timeout: 50000,
// })
// .then(response => {
// const {
// data
// } = response;
// if (data && data.code != SUCCESS) {
// console.log("错误码:" + data.code + " 错误信息:" + data.message)
// }
// if (data && data.code == 'L0003') {
// window.sessionStorage.removeItem("token")
// window.sessionStorage.removeItem("userId")
// MessageBox.alert({
// title: '会话超时',
// message: '即将退出,请重新登录',
// showClose: false,
// callback: () => {
// window.location.href = "/?#/" + "login"
// }
// })
// return;
// }
// resolve(data)
// })
// .catch(error => {
// if (error.response) {
// // The request was made and the server responded with a status code
// // that falls out of the range of 2xx
// console.log(error.response.data);
// console.log(error.response.status);
// console.log(error.response.headers);
// resolve({
// retcod: '500',
// retmsg: error.response.status
// });
// } else if (error.request) {
// // The request was made but no response was received
// // `error.request` is an instance of XMLHttpRequest in the browser and an instance of
// // http.ClientRequest in node.js
// console.log(error.request);
// resolve({
// retcod: '501'
// });
// } else {
// // Something happened in setting up the request that triggered an Error
// console.log('Error', error.message);
// resolve({
// retcod: '502',
// retmsg: error.message
// });
// }
// console.log(error.config);
// });
// });
// }
// static _get(url, data) {
// return this._post(url, data, "get");
// }
static _base(url, method, data, params) {
let token = window.sessionStorage.token
let userId = window.sessionStorage.userId
let headers = {
userId,
token,
"terminal": "WEB"
};
// 统一处理前端生成的交易流水号,加到 headers 里面
if (params && params.serialNo) {
headers['n-serial-no'] = params.serialNo
delete params.serialNo
}
if (data && data.serialNo) {
headers['n-serial-no'] = data.serialNo
delete data.serialNo
}
if (url != `${BASE_URI}login` && token)
headers.token = token;
return new Promise((resolve, reject) => {
axios({
url: BASE_HOST + url,
method: method,
data,
params,
headers: headers,
timeout: 50000,
}).then(response => {
const {
data
} = response;
if (data && data.code != SUCCESS) {
Notification({
type: 'error',
title: '提示',
message: data.msg
})
console.log("错误码:" + data.code + " 错误信息:" + data.msg)
}
if (data && data.code == 'L0003') {
window.sessionStorage.removeItem("token")
window.sessionStorage.removeItem("userId")
MessageBox.alert({
title: '会话超时',
message: '即将退出,请重新登录',
showClose: false,
callback: () => {
window.location.href = "/?#/" + "login"
}
})
return;
}
resolve(data)
})
.catch(error => {
if (error.response) {
// The request was made and the server responded with a status code
// that falls out of the range of 2xx
console.log(error.response.data);
console.log(error.response.status);
console.log(error.response.headers);
resolve({
retcod: '500',
retmsg: error.response.status
});
} else if (error.request) {
// The request was made but no response was received
// `error.request` is an instance of XMLHttpRequest in the browser and an instance of
// http.ClientRequest in node.js
console.log(error.request);
resolve({
retcod: '501'
});
} else {
// Something happened in setting up the request that triggered an Error
console.log('Error', error.message);
resolve({
retcod: '502',
retmsg: error.message
});
}
console.log(error.config);
});
});
}
static post(url, data = {}, params = {}) {
return this._base(url, 'post', data, params, BASE_HOST)
}
static get(url, params) {
return this._base(url, 'get', {}, params)
}
static delete(url, data = {}, params = {}) {
return this._base(url, 'delete', data, params)
}
static put(url, data = {}, params = {}) {
return this._base(url, 'put', data, params)
}
}
\ No newline at end of file
<template>
<span>
<el-button @click="onDialogOpen" type="primary" size="small">制裁信息</el-button>
<m-aml-pop ref="aml"></m-aml-pop>
</span>
</template>
<script>
import { createAmlFailInfo, getAmlFailInfo } from "~/service/public/aml"
import QueryRequest from "~/model/Common/QueryRequest"
import AmlCheckModel from "~/model/widget/Aml/AmlCheckModel"
import AmlCheckField from "~/model/widget/Aml/AmlCheckField"
import AmlFailInfo from "~/widget/Aml/AmlFailInfo"
import Request from "~/model/Common/Request"
export default {
components: {
"m-aml-pop": AmlFailInfo,
},
props: {
trigger: {
type: Boolean,//是否触发筛查,默认不触发,仅在受理中心经办触发筛查
required: true,
default: false,
},
txSriNo: String,//交易流水号
request: {
type: Object,
default: () => {
return new Request().data//筛查模型
},
}
},
data() {
return {
}
},
methods: {
onDialogOpen() {
this.$refs.aml.handleClick(this.trigger, this.txSriNo, this.request)
}
},
}
</script>
\ No newline at end of file
<template>
<span>
<el-button @click="showAmlDetail" type="primary" size="small">反洗钱审批信息</el-button>
<!-- 反洗钱线上审批详情 -->
<div v-bind:class="{top:amlDetailUrl!='','top-inline':amlDetailUrl==''}">
<vue-draggable-resizable v-if="amlDetailUrl!=''" :w="1000" :h="600" :x="0" :y="0" class="m-draggable" :parent="true">
<div class="m-draggable-header">
<i class="el-icon-close" @click="amlDetailUrl=''"></i>
</div>
<div :draggable="false" class="m-draggable-content">
<iframe :src="amlDetailUrl" style="width:1300px;height:520px;"></iframe>
</div>
</vue-draggable-resizable>
</div>
</span>
</template>
<script>
import VueDraggableResizable from 'vue-draggable-resizable'
export default {
components: {
'vue-draggable-resizable': VueDraggableResizable,
},
props: {
amlTempData: {
String,//反洗钱数据主键
required: true,
},
},
data() {
return {
amlDetailUrl: '',
}
},
methods: {
//查看反洗钱线上审批详情
showAmlDetail() {
if (this.amlTempData == null || typeof this.amlTempData == undefined) {
return this.$message.info("交易未触及反洗钱!")
}
var routeParams = {}
routeParams.amlTempData = this.amlTempData
var routeData = this.$router.resolve({
path: '/display/public/aml-approve',
query: {
routeParams: JSON.stringify(routeParams)
}
})
this.amlDetailUrl = routeData.href
},
},
}
</script>
<style>
.top {
position: fixed;
top: 0;
height: 100%;
width: 100%;
background-color: transparent;
display: inline-block;
left: 0;
z-index: 99;
}
.top-inline {
display: inline;
}
</style>
\ No newline at end of file
<!-- author liuxin -->
<template>
<div class="widget-block">
<div>
<c-button
type="primary"
icon="el-icon-search"
class="m-inputbtn-btn"
size="small"
@click="searchDialog = true"
></c-button>
</div>
<!-- 查询搜索弹框 -->
<el-dialog
title="业务信息查询"
:visible.sync="searchDialog"
:close-on-click-modal="false"
width="60%"
class="m-busi-temp"
>
<!-- formCount 传入搜索项的数量,组件根据数量判断是否可收起 -->
<c-list-search @form-reset="handleReset" @form-search="handleSearch" :formCount="4">
<template v-slot="slotProps">
<el-form
class="m-table-search-form"
:model="params"
:rules="rules"
ref="paramsForm"
:inline="true"
label-position="right"
label-width="100px"
size="small"
>
<el-form-item label="业务编号" prop="busiNo">
<c-input v-model="params.busiNo" placeholder="请输入业务编号" style="width:100%"></c-input>
</el-form-item>
<el-form-item label="业务状态" prop="status">
<c-select
v-model="params.status"
placeholder="请选择"
disabled
style="width:100%"
>
<el-option
v-for="item in busiStatus"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</c-select>
</el-form-item>
</el-form>
</template>
</c-list-search>
<!-- 日期可以添加 :defaultSort="defaultSort" -->
<c-list-page
ref="cList"
:columnsConfig="columnsConfig"
:params="searchParams"
:pageSize="pageSize"
:multipleSelect="false"
url="v1/finacing/common/getBeforTrans"
@selection-change="handleSelectionChange"
@row-click="handleRowClick"
>
<!-- 按钮 -->
<!-- <template v-slot:operation>
</template>-->
<!-- 操作列自定义 -->
<!-- <el-table-column prop label="操作" width="200px">
<template v-slot="scope">
</template>
</el-table-column>-->
</c-list-page>
</el-dialog>
</div>
</template>
<script>
import MarginInfo from "~/model/Finacing/MarginInfo";
import TxCode from "~/config/TxCode/txCode";
import Api from "~/service/Api";
import { queryMargin } from "~/service/finacing/marginservice";
import Global from "~/model/Common/globalVariable";
import moment from "moment";
import { moneyFormat, dateFormatFunc } from "~/utils/format";
import Institution from "~/widget/Institution/index";
import InstitutionModel from "~/model/widget/Institution";
import MarketInstList from "~/widget/Institution/MarketInstList/index";
export default {
components: {
"m-institution": Institution,
"m-marketInst-list": MarketInstList
},
props: {
busiCode: {
type: String,
default: "fftBusi@status@V@tb_finmst_fft_buy"
}, //当前交易
title: {
type: String,
default: "业务信息信息"
}
},
/**
* 触发改变
*/
computed: {
busiStatus: function() {
let path = this.busiCode.split("@");
return this.txCodes[path[0]][path[1]];
}
},
data() {
return {
searchDialog: false,
// defaultSort: "", // 默认首次进入的排序字段名,需要排序则必填,如不需要排序则不用填写
pageSize: Global.size,
//查询参数
params: {
busiNo: "",
tableName: this.busiCode.split("@")[3],
status: this.busiCode.split("@")[2]
},
// 映射到 list 中的搜索参数模型,searchParams 改变后会自动重新拉取数据
searchParams: {},
//自定义codes
txCodes: TxCode,
//规则
rules: {
// mode后属性直接定义成prop属性名
},
//列表的配置项
columnsConfig: [
{ prop: "busiNo", label: "业务编号" },
{ prop: "busiTempInfoSriNo", label: "业务临时表编号" },
{ prop: "txSriNo", label: "中心流水表编号" },
{ prop: "txCode", label: "交易码" },
{ prop: "txName", label: "交易名称" },
{ prop: "status", label: "状态" }
]
};
},
methods: {
/**
* 列表前有多选框才需要绑定的事件
*/
handleSelectionChange: function(selection, isSelectAll = false) {
console.log("selection changed");
console.log(selection);
console.log(isSelectAll);
},
handleRowClick: function(row) {
console.log(row);
this.$refs.paramsForm.resetFields();
this.searchDialog = false;
this.$emit("updatemodel", row);
},
/**
* 重置搜索条件需要更新到 searchParams 上
*
* */
handleReset: function() {
this.params = {
busiNo: "",
tableName:"",
status: ""
};
this.searchParams = {};
},
/**
* 点击搜索需要更新 searchParams 的值,注意不能直接将 params 赋值给 searchParams
*/
handleSearch: function() {
this.$refs.paramsForm.validate();
this.searchParams = {
...this.params
};
this.searchParams.busiNo = this.params.busiNo=="" ? null :this.params.busiNo
}
}
};
</script>
<!-- author liuxin -->
<template>
<div class="widget-block">
<div>
<c-button
type="primary"
icon="el-icon-search"
class="m-inputbtn-btn"
size="small"
@click="searchDialog = true"
></c-button>
</div>
<!-- 查询搜索弹框 -->
<el-dialog
title="业务信息查询"
:visible.sync="searchDialog"
:close-on-click-modal="false"
width="60%"
class="m-busi-temp"
>
<!-- formCount 传入搜索项的数量,组件根据数量判断是否可收起 -->
<c-list-search @form-reset="handleReset" @form-search="handleSearch" :formCount="4">
<template v-slot="slotProps">
<el-form
class="m-table-search-form"
:model="params"
:rules="rules"
ref="paramsForm"
:inline="true"
label-position="right"
label-width="100px"
size="small"
>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="业务编号" prop="busiNo">
<c-input v-model="params.busiNo" placeholder="请输入业务编号" style="width:100%"></c-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="当前交易" prop="currentTxCode">
<c-select
v-model="params.currentTxCode"
placeholder="请选择"
disabled
style="width:100%"
>
<el-option
v-for="item in txCode"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</c-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-form-item label="前手交易" prop="beforeTxCode" v-show="slotProps.searchToggle">
<el-checkbox-group v-model="params.beforeTxCode" disabled>
<el-checkbox
v-for="item in txCode"
:key="item.value"
:label="item.value"
>{{item.label}}</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-row>
<el-form-item label="后手交易" prop="afterTxCode" v-show="false">
<el-checkbox-group v-model="params.afterTxCode">
<el-checkbox
v-for="item in txCode"
:key="item.value"
:label="item.value"
>{{item.label}}</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-form>
</template>
</c-list-search>
<!-- 日期可以添加 :defaultSort="defaultSort" -->
<c-list-page
ref="cList"
:columnsConfig="columnsConfig"
:params="searchParams"
:pageSize="pageSize"
:multipleSelect="false"
url="v1/finacing/queryFinmstSeqBusiTempSriList"
@selection-change="handleSelectionChange"
@row-click="handleRowClick"
>
<!-- 按钮 -->
<!-- <template v-slot:operation>
</template>-->
<!-- 操作列自定义 -->
<!-- <el-table-column prop label="操作" width="200px">
<template v-slot="scope">
</template>
</el-table-column>-->
</c-list-page>
</el-dialog>
</div>
</template>
<script>
import MarginInfo from "~/model/Finacing/MarginInfo";
import TxCode from "~/config/TxCode/txCode";
import Api from "~/service/Api";
import { queryMargin } from "~/service/finacing/marginservice";
import Global from "~/model/Common/globalVariable";
import moment from "moment";
import { moneyFormat, dateFormatFunc } from "~/utils/format";
import Institution from "~/widget/Institution/index";
import InstitutionModel from "~/model/widget/Institution";
import MarketInstList from "~/widget/Institution/MarketInstList/index";
export default {
components: {
"m-institution": Institution,
"m-marketInst-list": MarketInstList
},
props: {
busiTxCode: {
type: String,
default: "fftBusi@TxCode@060601"
}, //当前交易
title: {
type: String,
default: "业务信息信息"
}
},
/**
* 触发改变
*/
computed: {
txCode: function() {
let path = this.busiTxCode.split("@");
//前手交易
this.params.beforeTxCode = this.txCodes[path[0]]["beforeTxCode"][path[2]];
this.params.afterTxCode = this.txCodes[path[0]]["afterTxCode"][path[2]];
return this.txCodes[path[0]][path[1]];
}
},
data() {
return {
searchDialog: false,
// defaultSort: "", // 默认首次进入的排序字段名,需要排序则必填,如不需要排序则不用填写
pageSize: Global.size,
//查询参数
params: {
busiNo: "",
currentTxCode: this.busiTxCode.split("@")[2],
beforeTxCode: [],
afterTxCode: []
},
// 映射到 list 中的搜索参数模型,searchParams 改变后会自动重新拉取数据
searchParams: {},
//自定义codes
txCodes: TxCode,
//规则
rules: {
// //mode后属性直接定义成prop属性名
// beforeTxCode: [{ required: true, message: "请输入前手交易码" }],
// afterTxCode: [{ required: true, message: "请输入后手交易码" }]
},
//列表的配置项
columnsConfig: [
{ prop: "busiNo", label: "业务编号" },
{ prop: "busiTempInfoSriNo", label: "业务临时表编号" },
{ prop: "txSriNo", label: "中心流水表编号" },
{ prop: "txCode", label: "交易码" },
{ prop: "txName", label: "交易名称" }
]
};
},
methods: {
/**
* 列表前有多选框才需要绑定的事件
*/
handleSelectionChange: function(selection, isSelectAll = false) {
console.log("selection changed");
console.log(selection);
console.log(isSelectAll);
},
handleRowClick: function(row) {
console.log(row);
this.$refs.paramsForm.resetFields();
this.searchDialog = false;
this.$emit("updatemodel", row);
},
/**
* 重置搜索条件需要更新到 searchParams 上
*
* */
handleReset: function() {
this.params = {
busiNo: "",
beforeTxCode: [],
afterTxCode: []
};
this.searchParams = {};
},
/**
* 点击搜索需要更新 searchParams 的值,注意不能直接将 params 赋值给 searchParams
*/
handleSearch: function() {
this.$refs.paramsForm.validate();
this.searchParams = {
...this.params
};
}
}
};
</script>
<style scoped>
.m-busi-temp .m-table-search-form {
position: relative;
}
.m-busi-temp .m-table-search-form .el-form-item__content {
width: calc(100% - 100px);
}
.m-busi-temp .m-table-search-form .el-form-item {
width: auto;
margin-right: auto;
}
.m-busi-temp .m-table-search-form {
margin-bottom: 10px;
}
</style>
<template>
<div class="m-holiday-calendar">
<div class="m-holiday-calendar-datepicker">
<el-date-picker v-model="currentMonth" type="month" placeholder="选择月"></el-date-picker>
</div>
<el-calendar v-model="currentMonth">
<template slot="dateCell" slot-scope="{date,data}">
<div class="m-holiday-calendar-datecell" @click="()=>clickItem(data)">
<p :class="holidayList.indexOf(data.day) !== -1 ? 'holiday' : ''">
{{ data.day.split('-').slice(1).join('-') }}
</p>
</div>
</template>
</el-calendar>
<el-row type="flex" justify="center">
<el-button type="primary" @click="submitForm()">提交</el-button>
</el-row>
</div>
</template>
<script>
import moment from "moment"
import {getList, postItem} from "~/service/example/calendar"
export default {
data: function () {
return {
currentMonth: new Date(),
month: moment(new Date()).format("YYYYMM"),
holidayList: []
}
},
watch: {
currentMonth: function () {
if (this.month !== moment(this.currentMonth).format("YYYYMM")) {
this.month = moment(this.currentMonth).format("YYYYMM")
this.holidayList = []
this.fetchData()
}
}
},
created() {
this.fetchData();
},
methods: {
saveData(data) {
// 向后端保存数据
postItem(data);
},
fetchData() {
let params = {
month: this.month
}
console.log(params)
// 从后端拉取初始数据
getList(params).then(res => {
//判断list是否为空 遍历这个月的每一天 weekOfDay函数 将周六 周日 加到holidayList中
// this.list = res.data.list
})
},
clickItem(data){
console.log('clickItem')
if (this.holidayList.indexOf(data.day) !== -1) {
//是节假日 要改成非节假日
this.holidayList.splice(this.holidayList.indexOf(data.day), 1)
} else {
//非节假日 要改成节假日
this.holidayList.push(data.day)
}
},
submitForm() {
var data = {
selectedDay: this.holidayList
};
this.saveData(data);
}
}
}
</script>
<style>
.m-holiday-calendar .el-calendar__header {
display: none;
}
.m-holiday-calendar .m-holiday-calendar-datepicker {
text-align: right;
padding-right: 20px;
}
.m-holiday-calendar .m-holiday-calendar-datecell {
width: 100%;
height: 100%;
box-sizing: border-box;
}
.m-holiday-calendar .m-holiday-calendar-datecell p {
padding: 1em;
margin: 0;
}
.holiday::after {
display: block;
content: "h";
color: white;
width: 20px;
height: 20px;
line-height: 20px;
font-size: 16px;
margin: 0;
position: relative;
left: 60px;
bottom: 20px;
border-radius: 50%;
background-color: #f08080;
text-align: center;
}
</style>
\ No newline at end of file
<!-- author dongxiaotong -->
<template>
<el-cascader v-model="model" :options="options" placeholder="选择地区代码" filterable v-bind:disabled="disabled" ></el-cascader>
<!-- <c-select v-model="model" v-bind="$attrs" placeholder="请选择" filterable>
<el-option v-for="item in codes" :key="item.value" :label="item.label" :value="item.value"></el-option>
</c-select>-->
</template>
<script>
import Api from "~/service/Api";
import { listCodeinfo1 } from "~/service/public/dict";
import QueryRequest from "~/model/Common/QueryRequest";
export default {
props: {
value: {
type: [String, Array, Number],
default: undefined
},
//前台传参数--字典类型代码
dictTypeFlag: {
type: String,
default: ""
},
disabled: {
type: Boolean,
default: false
},
},
computed: {
model: {
get() {
if (
this.value &&
typeof this.value == "string" &&
this.value.length == 6
) {
return [
this.value.substring(0, 2) + "0000",
this.value.substring(0, 4) + "00",
this.value
];
}
return "";
},
set(newVal) {
if (newVal && newVal.length) this.$emit("input", newVal[2]);
else this.$emit("input", "");
}
}
},
data: function() {
return {
options: []
};
},
mounted() {
this.handleSearch();
},
methods: {
handleSearch() {
var params = new QueryRequest().data;
params.current = 0;
params.size = 0;
params.data = { dictTypeFlag: this.dictTypeFlag };
listCodeinfo1(params)
.then(res => {
let list = res.data;
let codes = [];
let province, city;
for (var i = 0; i < list.length; i++) {
let item = list[i];
const { dicIteNo, dictVal } = item;
if (dicIteNo.endsWith("0000")) {
if (dicIteNo == "100000") {
continue;
}
//省开头
province = {
value: dicIteNo,
label: `${dicIteNo}-${dictVal}`,
children: []
};
codes.push(province);
} else if (dicIteNo.endsWith("00")) {
//市开头
city = {
value: dicIteNo,
label: `${dicIteNo}-${dictVal}`,
children: []
};
province.children.push(city);
} else {
city.children.push({
value: dicIteNo,
label: `${dicIteNo}-${dictVal}`,
leaf: true
});
}
}
this.options = codes;
})
.catch(error => {
console.log(error);
});
}
}
};
</script>
<!-- author liuxin -->
<template>
<div class="widget-block">
<div>
<c-button
type="primary"
icon="el-icon-search"
class="m-inputbtn-btn"
size="small"
@click="searchDialog = true"
></c-button>
</div>
<!-- <el-dialog title="公司客户账号查询" :visible.sync="searchDialog" :close-on-click-modal="false">
<div>
<c-list-search @form-reset="handleReset" @form-search="handleSearch" :formCount="formCount">
<template v-slot="slotProps">
<el-form
class="m-table-search-form"
:model="params"
ref="paramsForm"
:inline="true"
label-position="right"
label-width="100px"
size="small"
@submit.native.prevent
>
<el-form-item label="客户编号" prop="ptyNo">
<c-input
v-model="params.ptyNo"
style="width:100%"
maxlength="400"
placeholder="请输入"
></c-input>
</el-form-item>
</el-form>
</template>
</c-list-search>
<c-list-page
ref="cList"
:columnsConfig="columnsConfig"
:params="searchParams"
:loadDataFirstRender="false"
url="v1/pm/pty/customer-account"
@row-click="handleRowClick"
></c-list-page>
</div>
</el-dialog>-->
<el-dialog title="客户账号查询" :visible.sync="searchDialog" :close-on-click-modal="false">
<div class="eContainer-params">
<el-form
:model="params"
:rules="paramsRules"
ref="modelForm"
label-position="left"
label-width="150px"
size="small"
@submit.native.prevent
>
<el-col :span="12">
<el-col :span="22">
<el-form-item label="客户编号" prop="ptyNo">
<c-input v-model="params.ptyNo" style="width:100%" placeholder="请输入"></c-input>
</el-form-item>
</el-col>
</el-col>
<el-col :span="12">
<el-col :span="24" style="text-align:center;">
<el-button size="small" type="primary" icon="el-icon-search" @click="handleSearch">查询</el-button>
<el-button size="small" type="primary" @click="handleReset">重置</el-button>
</el-col>
</el-col>
</el-form>
</div>
<div class="eContainer-list">
<el-table :data="tableData" height="250" @row-click="handleRowClick">
<el-table-column label="账号" prop="accountNo"></el-table-column>
<el-table-column label="子账号" prop="subAcct"></el-table-column>
<el-table-column label="客户类型" prop="customerType"></el-table-column>
<el-table-column label="账户名称" prop="custName"></el-table-column>
<el-table-column label="账户性质" prop="accountFlag"></el-table-column>
<el-table-column label="账户开户机构" prop="openbranch"></el-table-column>
<el-table-column label="存款类别" prop="depType"></el-table-column>
<el-table-column label="币种" prop="currency"></el-table-column>
<el-table-column label="可用余额" prop="availaleBal"></el-table-column>
<el-table-column label="账户余额" prop="acctBal"></el-table-column>
<el-table-column label="账户到期日" prop="dueDate"></el-table-column>
<el-table-column label="冻结止付标志" prop="frozFlag"></el-table-column>
<el-table-column label="挂失标志" prop="lossFlag"></el-table-column>
</el-table>
</div>
</el-dialog>
</div>
</template>
<script>
import { listAccountByNo } from "~/service/public/party";
import QueryRequest from "~/model/Common/QueryRequest";
export default {
props: {
value: {
type: Object,
default: () => {
return {
ptyNo: "",
currency: "",
accountNo: "",
availaleBal: ""
};
}
},
rules: {
type: Object,
default: {}
},
},
computed: {
model: {
get() {
return this.value;
},
set(newVal) {
this.$emit("input", newVal);
}
}
},
data() {
return {
searchDialog: false,
params: {
ptyNo: "",// 客户号
},
queryreq: new QueryRequest().data,
paramsRules: {
ptyNo: [{
type: "string",
required: true,
len: 14,
message: "必输,长度必须为14个字符"
}]
},
tableData:[],
// formCount: 1,
// searchParams: {},
}
},
methods: {
handleReset: function () {
this.$refs.modelForm.resetFields();
},
// 点击搜索需要更新 searchParams 的值,注意不能直接将 params 赋值给 searchParams
handleSearch: function () {
this.$refs.modelForm.validate(async valid => {
if (!valid) return;
listAccountByNo(this.params.ptyNo)
.then(res => {
this.tableData = res.data;
// this.listConfig.total = res.pageInfo.total;
// console.log(res.pageInfo.total);
console.log(res);
})
.catch(error => {
console.log(error);
});
});
},
handleRowClick: function (row) {
this.$refs.modelForm.resetFields();
this.tableData = [];
this.searchDialog = false;
this.model = { ...row };
this.$emit("updatemodel", row);
},
// 通过这个方法可以刷新列表
// handleGetList: function () {
// this.$refs['cList'].getList()
// }
}
};
</script>
<!-- author dongxiaotong -->
<template>
<c-select v-model="model" placeholder="请选择国家" filterable v-bind:disabled="isDisable" >
<el-option v-for="item in codes" :key="item.value" :label="item.label" :value="item.value"></el-option>
</c-select>
</template>
<script>
import Api from "~/service/Api";
import { queryCou } from "~/service/public/CountryManage";
import QueryRequest from "~/model/Common/QueryRequest";
export default {
props: {
value: {
type: [String, Array, Number],
default: undefined
},
disabled: {
type: Boolean,
default: false
},
},
computed: {
model: {
get() {
return this.value;
},
set(newVal) {
console.log(newVal)
this.$emit("input", newVal);
}
},
isDisable: {
get() {
return this.disabled
}
},
},
data: function() {
return {
codes: [],
list: []
};
},
created() {
this.handleSearch();
},
methods: {
handleSearch() {
var params = new QueryRequest().data;
params.current = 0;
params.size = 0;
params.data = {};
queryCou(params)
.then(res => {
this.list = res.data;
console.log("list", this.list);
for (var i = 0; i < this.list.length; i++) {
this.codes.push({
value: this.list[i].countryRegionCode,
label:
this.list[i].countryEnName + "-" + this.list[i].countryCnName
});
}
})
.catch(error => {
console.log(error);
});
}
}
};
</script>
<!-- author cuibo -->
<template>
<c-select v-model="model" v-bind="$attrs" placeholder="请选择币种" filterable
v-bind:disabled="isDisable"
@change="handleChange">
<el-option v-for="item in codes" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</c-select>
</template>
<script>
import Api from "~/service/Api";
import {
listCurs
} from "~/service/public/currency";
import QueryRequest from "~/model/Common/QueryRequest";
import Currency from "~/model/Public/ParaManage/Currency";
export default {
props: {
value: {
type: [String, Array, Number],
default: undefined
},
disabled: {
type: Boolean,
default: false
},
isOften: {
type: Boolean,
default: false
},
},
computed: {
model: {
get() {
return this.value;
},
set(newVal) {
this.$emit("input", newVal);
}
},
isDisable: {
get() {
return this.disabled
}
},
},
data: function() {
return {
codes: [],
list: [],
currencyMap: {}
}
},
created() {
this.handleSearch();
},
methods: {
handleSearch() {
var params = new QueryRequest().data;
params.current = 0;
params.size = 0;
params.data = new Currency().data;
// console.log('this.isOften', this.isOften)
let key = 'curCache'
if(this.isOften===true){
//查询条件——是常用币种
params.data.isOften='Y'
key = key+'Y'
}
else{
params.data = {};
}
let promise ;
if(!window[key] || new Date() - window[key].lastTime > 30000) //30s内不超时
{
promise = listCurs(params)
window[key]={lastTime:new Date()-0,promise}
}
else
{
promise = window[key].promise
}
promise
.then(res => {
if (res.code === SUCCESS) {
this.list = res.data;
console.log('list', this.list)
for (var i = 0; i < this.list.length; i++) {
this.codes.push({
value: this.list[i].currCode,
label: this.list[i].currSymbol + '-' + this.list[i].currCnName
});
//利用map遍历list
this.currencyMap[this.list[i].currCode] = JSON.parse(JSON.stringify(this.list[i]))
}
}
})
.catch(error => {
console.log(error);
});
},
handleChange(value) {
//根据value在currencyMap中找到list中的币种对象 返回
this.$emit('update-currency', this.currencyMap[value])
}
}
}
</script>
<!-- author dongxiaotong -->
<template>
<!-- <div> -->
<c-select
v-model="model"
placeholder="请选择"
filterable
>
<el-option v-for="item in codes" :key="item.value" :label="item.label" :value="item.value"></el-option>
</c-select>
<!-- </div> -->
</template>
<script>
import Api from "~/service/Api";
import { listCustMgr } from "~/service/public/CustMgr";
import QueryRequest from "~/model/Common/QueryRequest";
export default {
props: {
value: {
type: [String, Array, Number],
default: undefined
},
disabled: {
type: Boolean,
default: false
},
custMgrBelongInst:{
type:String,
default:""
}
},
computed: {
model: {
get() {
return this.value;
},
set(newVal) {
this.$emit("input", newVal);
}
},
isDisable: {
get() {
return this.disabled;
}
}
},
data: function() {
return {
codes: [],
list: []
};
},
created() {
this.handleSearch();
},
methods: {
handleSearch() {
var params = new QueryRequest().data;
params.current = 0;
params.size = 0;
params.data = {...this.model,custMgrBelongInst:this.custMgrBelongInst};
listCustMgr(params)
.then(res => {
this.list = res.data;
for (var i = 0; i < this.list.length; i++) {
this.codes.push({
value: this.list[i].custMgrNo,
label: this.list[i].custMgrName
});
}
})
.catch(error => {
console.log(error);
});
}
}
};
</script>
<template>
<!-- 详情弹框 -->
<el-dialog title="详情查看" :visible.sync="detailDialog" :close-on-click-modal="false">
<div>
<el-form
:model="customer"
ref="modelForm1"
label-position="left"
label-width="150px"
size="small"
>
<el-col :span="12">
<el-col :span="22">
<el-form-item label="客户编号" prop="party.pty.ptyNo">
<c-input v-model="customer.party.pty.ptyNo" placeholder disabled></c-input>
</el-form-item>
</el-col>
</el-col>
<el-col :span="24">
<el-col :span="23">
<el-form-item label="客户中文名称" prop="party.ptyAddr.ptyCnName">
<c-input
type="textarea"
:row="1"
v-model="customer.party.ptyAddr.ptyCnName"
placeholder
disabled
></c-input>
</el-form-item>
</el-col>
</el-col>
<el-col :span="24">
<el-col :span="23">
<el-form-item label="客户中文地址" prop="party.ptyAddr.ptyCnAddr">
<c-input
type="textarea"
:row="1"
v-model="customer.party.ptyAddr.ptyCnAddr"
placeholder
disabled
></c-input>
</el-form-item>
</el-col>
</el-col>
<el-col :span="24">
<el-col :span="23">
<el-form-item label="客户英文名称" prop="party.ptyAddr.ptyEnName">
<c-input
type="textarea"
:row="1"
v-model="customer.party.ptyAddr.ptyEnName"
placeholder
disabled
></c-input>
</el-form-item>
</el-col>
</el-col>
<el-col :span="24">
<el-col :span="23">
<el-form-item label="客户英文地址" prop="party.ptyAddr.ptyEnAddr">
<c-input
type="textarea"
:row="1"
v-model="customer.party.ptyAddr.ptyEnAddr"
placeholder
disabled
></c-input>
</el-form-item>
</el-col>
</el-col>
</el-form>
</div>
<!-- <c-content height="280"> -->
<div>
<c-list-page
ref="cList"
:columnsConfig="feeColumnsConfig"
:params="detailParams"
:pageSize="pageSize"
:loadDataFirstRender="false"
url="v1/pm/feeRateManage/queryPage"
></c-list-page>
</div>
<div>
<c-list-page
ref="cList2"
:columnsConfig="exgRateColumnsConfig"
:params="detailParams"
:loadDataFirstRender="false"
:pageSize="pageSize"
url="v1/pm/feeRateManage/queryPage"
></c-list-page>
</div>
<!-- </c-content> -->
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="closeDialog">返回</el-button>
</div>
</el-dialog>
</template>
<script>
import { listPty, getPtyById } from "~/service/public/party";
import Party from "~/model/Public/Party/Party";
export default {
props: {
ptyNo: {
type: String,
required: false
}
},
// 查看详情
watch: {
detailDialog: function () {
console.log(this.ptyNo);
console.log(this.detailDialog);
if (this.detailDialog && this.ptyNo) {
this.detailParams.custNo = this.ptyNo
console.log("费率查询参数")
console.log(this.detailParams.custNo)
getPtyById(this.ptyNo)
.then(res => {
this.customer.party.pty = res.data.pty;
this.customer.party.ptyAddr = res.data.ptyAddr;
})
.catch(error => {
console.log(error);
});
this.$nextTick(() => {
this.$refs['cList'].getList()
})
}
}
},
data() {
return {
customer: {
party: new Party().data
},
detailDialog: false,
detailParams: { custNo: "" },
pageSize: 5,
//汇率
exgRateColumnsConfig: [
{
prop: "currCode",
label: "币种"
},
{
prop: "settExcDiscountPoint",
label: "结汇优惠点数"
},
{
prop: "exchSurDiscountPoint",
label: "售汇优惠点数"
}
],
//费率
feeRateTp: {
'1': "按固定金额收费",
'2': "按百分率收费",
'3': "按千分率收费",
'4': "按区间收费",
'5': "按浮动利率收费",
},
feeColumnsConfig: [
{
prop: "feeName",
label: "费率名称"
},
{
prop: "feeRateTpCd",
label: "费率类型",
formatter: row => {
var temp = row.feeRateTpCd;
return this.feeRateTp[temp];
}
},
{
prop: "fixedAmtCurrCd",
label: "币种"
},
{
prop: "fixedAmt",
label: "固定金额"
},
{
prop: "cfeeRate",
label: "费率",
formatter: row => {
var temp = row.feeRateTpCd;
if (temp == 2) return row.cfeeRate;
if (temp == 3) return row.cfeeRatePermilla;
}
}
],
};
},
methods: {
closeDialog() {
this.$refs.modelForm1.resetFields();
this.detailDialog = false
},
}
};
</script>
This source diff could not be displayed because it is too large. You can view the blob instead.
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