Commit e319119e by yangxiaolei

节假日管理

parent 822d817a
import Api from '~/service/Api';
import { getTrnNameByInr } from "~/service/business/common";
import moment from 'moment';
export default {
methods: {
async handleSearch() {
let opndatfrom = this.model.infcon.opndatfrom;
if (!opndatfrom || opndatfrom == '') {
this.$notify.error({ title: '错误', message: '查询开始日期必输!' });
return;
}
let opndatto = this.model.infcon.opndatto;
if (!opndatto || opndatto == '') {
this.$notify.error({ title: '错误', message: '查询结束日期必输!' });
return;
}
let params = {
...this.model.infcon,
seadocflg: this.model.seadocflg,
seagodcod: this.model.seagodcod,
pageIndex: this.pagination.pageIndex,
pageSize: this.pagination.pageSize,
opndatfrom:moment(opndatfrom).format('YYYY-MM-DD'),
opndatto:moment(opndatto).format('YYYY-MM-DD'),
};
let rtnmsg = await Api.post('/service/infled/getList', params);
if (rtnmsg.respCode == SUCCESS) {
this.stmData.data = [];
this.stmData.data = rtnmsg.data.list;
// debugger
this.pagination.total = rtnmsg.data.total;
} else {
this.$notify.error({ title: '错误', message: '服务请求失败!' });
}
},
async handleReset() {
this.model.sealcrtyp = '';
this.model.infcon.opndatfrom = new Date();
this.model.infcon.opndatto = new Date();
this.model.infcon.seaownref = '';
this.model.infcon.seashgref = '';
this.model.infcon.seaamtfr = '';
this.model.infcon.seasta = '';
this.model.infcon.seacur = '';
this.model.infcon.pty.extkey = '';
this.model.infcon.pty.nam = '';
this.model.infcon.usr.extkey = '';
this.model.infcon.seaamtto = '';
this.model.infcon.searol = '';
this.model.infcon.nam = '';
this.model.infcon.seapty = '';
this.model.infcon.searef = '';
},
// pageSize改变
handleSizeChange(val) {
console.log(`每页 ${val} 条`);
this.pagination.pageIndex = 1;
this.pagination.pageSize = val;
this.handleSearch();
},
// 页码改变
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
this.pagination.pageIndex = val;
this.handleSearch();
},
// 详情
async details(row) {
const params = {
//根据xx字段 查询详情表的数据
inr:row.inr,
userId: window.sessionStorage.userId || 'ZL',
ownref: row.ownref,
};
const res = await Api.post('/service/infled/getDetail', params);
if (res.respCode === SUCCESS) {
this.trnData.data = res.data;
}
},
// 关闭详情弹框
closeDetailsDialog(refId) {
this.$refs[refId].doClose();
console.log('close');
},
// 处理
async handler(row) {
this.initdialog = true;
this.currentHandleRow = row
const params = {
//根据xx字段 查询处理的数据
ownref: row.ownref,
};
const res = await Api.post('/service/infled/dealWithByOwnref', params);
if (res.respCode === SUCCESS) {
if (res.data) {
this.handlerDataList = []
Object.keys(res.data).map((item) => {
this.handlerDataList.push({
label: item,
value: res.data[item]
})
})
}
}
},
handleClick (btn) {
if (btn.value === 'N') {
return
}
let filterRoute = this.btnRouteMap.filter((item) => {
return item.label === btn.label
})
this.$router.history.push({
path: filterRoute[0].route,
query: {
inr: this.currentHandleRow.inr
}
});
this.initdialog = false;
},
// 关闭处理弹框
closeHandlerDialog() {
this.initdialog = false;
},
/**
* 打开详情页面
* @param {string} inr
*/
display(inr) {
getTrnNameByInr({ inr }).then((res) => {
if (res.respCode == SUCCESS) {
const trnName = res.data.toLowerCase();
let viewurl = "/#/display/" + trnName + "?trn=" + inr
window.open(viewurl, 'newwindow', 'height=1500,width=1200,top=100,left=100,toolbar=no,resizable=no,menubar=no,location=no, status=no');
}
});
},
toLetopn() {
// 点击开立,清空从待经办进来的时候带的行参数
localStorage.setItem('row_letopn', null)
localStorage.setItem('review_letopn',null)
this.$router.history.push('/business-new/letopn');
},
toLetnot() {
this.$router.history.push('/business-new/letnot');
},
toLetdrw() {
this.$router.history.push('/business-new/letdrw');
},
toLetrsv() {
this.$router.history.push('/business-new/letrsv');
},
},
};
export default class Currency {
constructor () {
this.data = {
currCode: '',//币种代码
custCurrCode: '',//自定义币种代码
currSymbol:'',//币种代码2
currEnName: '',
currCnName: '',
isOften: '',
currDecimalBit: '',
quotatConvtUCd: '',
exgRatMaxPermitChgPct: '',
}
}
}
\ No newline at end of file
export default class Holiday {
constructor() {
this.data = {
month: new Date(),//月份
currCode: '156',//币种代码
currSymbol: '',//币种符号
calendarDt: '',//日历日期
}
}
}
export default class OperateParams {
constructor() {
this.data = {
operateData: '', // 操作数据
operorNo: '', //操作人编号
operorName: '', //操作人姓名
txCode: '', //交易代码
oprTypeCode: '', //操作类型代码 A-新增 U-修改 D-删除
oprRecordPrKey: '', //操作记录主键
summary: '', //摘要
oprNo: '', //操作编号
}
}
}
export default class QueryRequest {//分页查询条件
constructor() {
this.data = {
current: 1, // 当前页
size: 20, // 每页的数量
orders:[], //排序信息
data: null
}
}
}
\ No newline at end of file
<!-- author cuibo -->
<template>
<c-select v-model="model" v-bind="$attrs" placeholder="请选择币种" filterable v-bind:disabled="isDisable" @change="handleChange"
popper-class="m-currency-dropdown">
<el-option v-for="item in codes" :key="item.value" :label="item.label" :value="item.value" :disabled="disabledList.indexOf(item.value)!== -1">
</el-option>
</c-select>
</template>
<script>
import QueryRequest from "../../model/QueryRequest";
import Currency from "../../model/Currency";
import Select from "../Select"
export default {
components: {
'c-select': Select
},
props: {
value: {
type: [String, Array, Number],
default: undefined
},
disabledList: {
type: Array,
default: function () {
return []
}
},
disabled: {
type: Boolean,
default: false
},
isOften: {
type: Boolean,
default: true
},
},
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: {
listCurs(){
return Promise.resolve(null)
},
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>
<template>
<el-select
ref="select"
:title = "tip"
:id="id" v-model="model" v-bind="$attrs" :size="size"
v-on="$listeners" v-bind:disabled="isDisable" :clearable="clearable" @click.native="handleClick" >
<slot></slot>
</el-select>
</template>
<script>
export default {
inject: {
disabledImport: {
default: false
}
},
props: {
value: {
type: [String, Array, Number],
default: undefined
},
disabled: {
type: Boolean,
default: false
},
clearable: {
type: Boolean,
default: true
},
id: {
type: String,
default: ''
},
size: {
type: String,
default: 'small'
}
},
data: function () {
return {
tip: ''
}
},
computed: {
model: {
get() {
return this.value
},
set(newVal) {
this.$emit('input', newVal)
}
},
mode() {
return this.$store.state.Status.mode
},
isDisable: {
get() {
if (this.disabledImport && !this.disabled) {
return false
}
return this.mode === 'display' || this.disabled
}
},
highlight () {
return this.$store.state.Status.highlights.indexOf(this.id) !== -1
}
},
created: function () {
this.updateTip()
},
watch: {
value: function () {
this.updateTip()
}
},
methods: {
updateTip: function () {
this.$nextTick(() => {
if (this.$refs.select) {
this.tip = this.$refs.select.selectedLabel || this.$refs.select.query || ''
}
})
},
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="holidayContainer">
<div class="m-holiday-calendar">
<el-form :model="model" ref="paramsForm" :rules="paramsRules" :inline="true" label-position="left" size="small"
@submit.native.prevent>
<el-form-item label="币种" prop="currCode">
<m-currency-list v-model="model.currCode" style="width:100%" placeholder="请选择">
</m-currency-list>
</el-form-item>
<el-form-item label="月份" prop="month">
<el-date-picker v-model="model.month" type="month" size="small" placeholder="请选择"></el-date-picker>
</el-form-item>
<el-form-item>
<c-button type="primary" @click="handleSearch" icon="el-icon-search" size="small">查询</c-button>
<c-button @click="handleReset" size="small">重置</c-button>
</el-form-item>
</el-form>
<el-calendar v-model="model.month">
<template slot="dateCell" slot-scope="{date,data}">
<div class="m-holiday-calendar-datecell" @click="()=>clickItem(data)">
<p :class="holidayList.indexOf(data.day) !== -1 ? 'holiday' : ''">
<!-- p区分是否红色标记 -->
{{ data.day.split('-').slice(1).join('-') }}
<!-- 显示日期框的数字 -->
</p>
</div>
</template>
</el-calendar>
<p class="m-holiday-notice">标记所选月份的节假日后 ,请点击提交按钮以提交节假日信息</p>
<el-row type="flex" justify="center">
<c-button type="primary" size="small" @click="submitHol()" :disabled="model.currCode===''">提交</c-button>
</el-row>
</div>
<div class="m-holiday-list">
<div class="m-holiday-list-header">
<span class="m-holiday-title">节假日列表</span>
<c-button type="primary" size="small" @click="importDialog = true">节假日导入</c-button>
</div>
<div class="m-holiday-table">
<c-list-page ref="cList" :columnsConfig="columnsConfig" :params="searchParams" :pageSize="pageSize" :multipleSelect="false"
:loadDataFirstRender="true" url="v1/pm/hols" @update-list="handleUpdateList">
</c-list-page>
</div>
</div>
<el-dialog title="节假日导入" :visible.sync="importDialog" class="eContainer-dialog" center>
<el-form ref="importForm" label-position="left" label-width="150px" size="small">
<el-upload name="upload" ref="upload" action="abc" :auto-upload="true" :http-request="httpRequest" :limit="1"
:before-upload="beforeUpload" accept=".xls,.xlsx">
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
<el-button style="margin-left: 10px;" size="small" type="success" :loading="loading" @click="submitUpload">上传</el-button>
<div slot="tip" class="el-upload_tip">只能上传xlsx/xls文件,且不超过10M</div>
</el-upload>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="importDialog = false">取消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import moment from "moment"
import Holiday from "../model/Holiday"
import CurrencyList from './CurrencyList/index'
import QueryRequest from "../model/QueryRequest"
import {
dateFormatFunc
} from "~/utils/format";
import OperateParams from "../model/OperateParams"
// import {
// insertParaApv,
// importParaApvFile
// } from "~/service/public/paraApprove"
export default {
name:"holiday",
components: {
'm-currency-list': CurrencyList
},
data: function() {
return {
month: moment(new Date()).format("YYYYMM"),
holidayList: [],
model: new Holiday().data,
originDataList: [],
importDialog: false,
//以key-value形式存储数据 发送文件
formData: new FormData(),
//文件上传进度显示
loading: false,
fileName: "",
columnsConfig: [{
type: 'selection',
width: "55"
}, {
prop: 'currSymbol',
label: '币种',
}, {
prop: 'calendarDt',
label: '日期',
formatter: row => {
return dateFormatFunc(row.calendarDt);
}
}],
//查询条件
searchParams: {},
// 每页展示的数据 默认为20
pageSize: 40,
paramsRules: {
"currCode": [{
type: "string",
required: true,
message: "币种不能为空"
}],
"month": [{
type: "date",
required: true,
trigger: 'change',
message: "月份不能为空"
}]
}
}
},
watch: {
"model.month": function() {
if (this.month !== moment(this.model.month).format("YYYYMM")) {
this.month = moment(this.model.month).format("YYYYMM")
this.holidayList = []
this.handleSearch()
}
}
},
created() {
this.handleSearch();
},
methods: {
httpRequest(params) {
this.formData.append("file", params.file);
// this.formData.forEach((value, key) => {
// console.log("key", key);
// console.log("value", value);
// });
},
// 文件上传校验
beforeUpload(file) {
console.log("文件上传校验")
this.files = file;
//文件格式校验
const xls = file.name.split('.')[1] === 'xls'
const xlsx = file.name.split('.')[1] === 'xlsx'
if (!xls && !xlsx) {
this.$message.warning('上传的文件只能是xls或xlsx格式!');
return
}
this.fileName = file.name;
console.log("file.size", file.size)
if (file.size > 10240000) {
this.$message.warning('上传的文件大小不能超过10M!');
return
}
},
submitUpload() {
console.log("文件上传", this.fileName)
if (this.fileName == "") {
this.$message.warning('请选择要上传的文件')
return false
} else {
this.loading = true
}
this.formData.append('operorNo', window.sessionStorage.getItem('userId'))
this.formData.append('operorName', window.sessionStorage.getItem('userName'))
this.formData.append('txCode', '010149')
this.formData.append('oprTypeCode', 'F')
importParaApvFile(this.formData)
.then(res => {
if (res.code === SUCCESS) {
this.$message('导入成功,请等待管理员审核')
this.handleSearch()
this.loading = false
this.importDialog = false
}
})
.catch(error => {
this.$message('导入失败')
this.handleSearch()
this.loading = false
});
},
handleSearch() {
var params = new QueryRequest().data;
params.data = new Holiday().data;
params.data.month = moment(this.model.month).format("YYYYMM");
params.data.currCode = this.model.currCode;
//清空页面日历展示的节假日列表
this.holidayList = []
this.searchParams = {
...params.data
}
},
handleReset() {
this.$refs.paramsForm.resetFields()
this.handleSearch();
},
handleUpdateList(list, total, res) {
this.holidayList = [];
if (list.length > 0) {
for (var i = 0; i < list.length; i++) {
var tempCalendarDt = list[i].calendarDt
this.holidayList.push(moment(tempCalendarDt).format('YYYY-MM-DD'))
}
}
console.log('节假日列表', this.holidayList)
this.originDataList = [];
for (var i = 0; i < this.holidayList.length; i++) {
var holiday = new Holiday().data;
holiday.currCode = this.model.currCode;
holiday.calendarDt = moment(this.holidayList[i]).format('YYYYMMDD')
this.originDataList.push(holiday)
}
},
clickItem(data) {
console.log('clickItem', data.day)
console.log('before click this.holidayList', this.holidayList)
if (this.holidayList.indexOf(data.day) !== -1) {
//该日期是节假日 要改成非节假日 从holidayList中删除该日期
this.holidayList.splice(this.holidayList.indexOf(data.day), 1)
} else {
//该日期不是节假日 要改成节假日 加到holidayList中
this.holidayList.push(data.day)
}
console.log('after click this.holidayList', this.holidayList)
},
submitHol() {
this.$prompt("是否提交节假日?若确定提交,请填写摘要", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
inputPlaceholder: "为加快审批速度,请简洁填写摘要",
inputValidator: (val) => {
if (val == null) {
return true
}
return !(val.length > 200)
},
inputErrorMessage: '摘要长度不能大于200'
}).then(({
value
}) => {
//操作数据列表
var operateDataList = []
for (var i = 0; i < this.holidayList.length; i++) {
var holiday = new Holiday().data;
holiday.currCode = this.model.currCode;
holiday.calendarDt = moment(this.holidayList[i]).format('YYYYMMDD')
operateDataList.push(holiday)
console.log("holiday" + holiday.currCode)
}
var params = new OperateParams().data
//操作人编号
params.operorNo = window.sessionStorage.getItem('userId')
//操作人姓名
params.operorName = window.sessionStorage.getItem('userName')
//交易代码
params.txCode = '010149'
//操作类型 U-修改
params.oprTypeCode = 'U'
//操作数据
params.operateData = operateDataList
params.originData = this.originDataList
//操作记录主键列表 新增时无主键 传空数组 必传
params.oprRecordPrKey = [this.model.currCode + this.month];
//摘要
params.summary = value
insertParaApv(params)
.then(res => {
if (res.code === SUCCESS) {
this.$message('提交成功,请等待管理员审核')
this.$refs['cList'].getList();
this.handleSearch();
}
})
.catch(error => {
this.$message('提交失败')
this.handleSearch();
});
})
},
}
}
</script>
<style>
.holidayContainer{
padding-top:50px
}
.m-holiday-notice {
padding-left: 20px;
}
.m-holiday-title {
padding-bottom: 20px;
}
.m-holiday-calendar {
display: flex;
flex-direction: column;
align-items: center;
}
.m-holiday-calendar .el-calendar {
width: 800px;
}
.m-holiday-calendar .el-calendar__header {
display: none;
}
.m-holiday-notice {
font-size: 14px;
color: #999;
padding-top: 0;
}
.m-holiday-list {
display: flex;
flex-direction: column;
align-items: center;
}
.m-holiday-table {
width: 800px;
}
.m-holiday-list-header {
width: 800px;
margin: 30px;
position: relative;
text-align: center;
}
.m-holiday-list-header .el-button {
position: absolute;
right: 0;
top: 0;
}
.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>
......@@ -19,6 +19,7 @@ import CustomComponent from "./components";
import vuefunc from "./utils/vuefunc";
import "./permission";
import EventService,{LOGIN,LOGOUT} from "~/service/EventService";
import Api from "./service/Api";
window.SUCCESS = "AAAAAA";
......@@ -40,6 +41,8 @@ EventService.on(LOGOUT,()=>{
resetCache();
});
Vue.prototype.$Api = Api
new Vue({
el: "#app",
store,
......@@ -47,3 +50,4 @@ new Vue({
router: RootRouter,
render: (h) => h(App),
});
......@@ -49,6 +49,7 @@ const Business = [
{ path: 'infbrd', component: () => import('~/business/infbrd/views'), name: 'Infbrd', meta: { title: '进口信用证单据入口交易' } },
{ path: 'inflid', component: () => import('~/business/inflid/views'), name: 'Inflid', meta: { title: '信用证入口交易' } },
{ path: 'infled', component: () => import('~/business/infled/views'), name: 'Infled', meta: { title: '出口信用证交易查询' } },
{ path: 'holiday', component: () => import('~/business/holiday/views'), name: 'holiday', meta: { title: '节假日管理' } },
{ path: 'letame', component: () => import('~/business/letame/views'), name: 'Letame', meta: { title: '出口信用证修改' } },
{ path: 'letcan', component: () => import('~/business/letcan/views'), name: 'Letcan', meta: { title: '出口信用证注销' } },
{ path: 'letnot', component: () => import('~/business/letnot/views'), name: 'Letnot', meta: { title: '出口信用证预通知' } },
......
......@@ -190,6 +190,7 @@ export default {
// { inifrm: "infpty", ininam: "客户信息查询", pntmiu: "10" },
// { inifrm: "infpta", ininam: "客户地址查询", pntmiu: "10" },
{ inifrm: "inholiday", ininam: "节假日管理", pntmiu: "10" },
{ inifrm: "infact", ininam: "账号信息查询", pntmiu: "10" },
{ inifrm: "infapf", ininam: "报文格式信息查询", pntmiu: "10" },
{ inifrm: "infatp", ininam: "交易模式配置查询", pntmiu: "10" },
......
......@@ -126,6 +126,7 @@ export default {
},
addTags() {
const { name } = this.$route;
console.log("this.$route=>",this.$route)
if (name) {
this.$store.dispatch("TagsView/addView", this.$route);
}
......
<template>
<el-container
style="background-color: #e8e8e8; margin: 0; padding-bottom: 8px"
style="background-color: #e8e8e8;height: 100%;
position: relative; margin: 0; padding-bottom: 8px"
>
<el-header style="padding: 0">
<headerCom></headerCom>
......@@ -102,7 +103,8 @@
v-show="dragStatus !== 0"
></div>
</vue-draggable-resizable>
<el-container>
<el-container style="height: 100%;
position: relative;">
<el-aside width="240px" style="background-color: white">
<sideMenu></sideMenu>
</el-aside>
......
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