Commit 8ec19730 by yangxiaolei

节假日管理联调接口

parent e319119e
...@@ -3,7 +3,7 @@ export default class Holiday { ...@@ -3,7 +3,7 @@ export default class Holiday {
constructor() { constructor() {
this.data = { this.data = {
month: new Date(),//月份 month: new Date(),//月份
currCode: '156',//币种代码 currCode: 'CHY',//币种代码
currSymbol: '',//币种符号 currSymbol: '',//币种符号
calendarDt: '',//日历日期 calendarDt: '',//日历日期
} }
......
...@@ -5,8 +5,14 @@ ...@@ -5,8 +5,14 @@
@submit.native.prevent> @submit.native.prevent>
<el-form-item label="币种" prop="currCode"> <el-form-item label="币种" prop="currCode">
<m-currency-list v-model="model.currCode" style="width:100%" placeholder="请选择"> <el-select v-model="model.currCode" style="width:100%" placeholder="请选择">
</m-currency-list> <el-option
v-for="item in codes.curtxt1"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="月份" prop="month"> <el-form-item label="月份" prop="month">
<el-date-picker v-model="model.month" type="month" size="small" placeholder="请选择"></el-date-picker> <el-date-picker v-model="model.month" type="month" size="small" placeholder="请选择"></el-date-picker>
...@@ -39,12 +45,39 @@ ...@@ -39,12 +45,39 @@
<div class="m-holiday-list"> <div class="m-holiday-list">
<div class="m-holiday-list-header"> <div class="m-holiday-list-header">
<span class="m-holiday-title">节假日列表</span> <span class="m-holiday-title">节假日列表</span>
<c-button type="primary" size="small" @click="importDialog = true">节假日导入</c-button> <!-- <c-button type="primary" size="small" @click="importDialog = true">节假日导入</c-button> -->
</div> </div>
<div class="m-holiday-table"> <div class="m-holiday-table">
<c-list-page ref="cList" :columnsConfig="columnsConfig" :params="searchParams" :pageSize="pageSize" :multipleSelect="false" <el-table
:loadDataFirstRender="true" url="v1/pm/hols" @update-list="handleUpdateList"> :data="tableData"
</c-list-page> style="width: 100%"
>
<el-table-column
prop="currCode"
label="币种"
sortable
>
</el-table-column>
<el-table-column
prop="calendarDt"
label="日期"
sortable
>
</el-table-column>
</el-table>
<div class="pagination-box">
<el-pagination
style="margin-right: 30px;"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="pagination.pageIndex"
:page-sizes="[10, 20, 50, 100, 500]"
:page-size="pagination.pageSize"
layout="sizes, prev, pager, next"
:total="pagination.total">
</el-pagination>
</div>
</div> </div>
</div> </div>
<el-dialog title="节假日导入" :visible.sync="importDialog" class="eContainer-dialog" center> <el-dialog title="节假日导入" :visible.sync="importDialog" class="eContainer-dialog" center>
...@@ -72,6 +105,7 @@ ...@@ -72,6 +105,7 @@
dateFormatFunc dateFormatFunc
} from "~/utils/format"; } from "~/utils/format";
import OperateParams from "../model/OperateParams" import OperateParams from "../model/OperateParams"
import CodeTable from "~/config/CodeTable";
// import { // import {
// insertParaApv, // insertParaApv,
// importParaApvFile // importParaApvFile
...@@ -84,6 +118,9 @@ ...@@ -84,6 +118,9 @@
}, },
data: function() { data: function() {
return { return {
codes:CodeTable,
tableData:[],
totalSize:0,
month: moment(new Date()).format("YYYYMM"), month: moment(new Date()).format("YYYYMM"),
holidayList: [], holidayList: [],
model: new Holiday().data, model: new Holiday().data,
...@@ -98,7 +135,7 @@ ...@@ -98,7 +135,7 @@
type: 'selection', type: 'selection',
width: "55" width: "55"
}, { }, {
prop: 'currSymbol', prop: 'currCode',
label: '币种', label: '币种',
}, { }, {
prop: 'calendarDt', prop: 'calendarDt',
...@@ -107,6 +144,11 @@ ...@@ -107,6 +144,11 @@
return dateFormatFunc(row.calendarDt); return dateFormatFunc(row.calendarDt);
} }
}], }],
pagination: {
pageIndex: 1,
pageSize: 10,
total: 0
},
//查询条件 //查询条件
searchParams: {}, searchParams: {},
// 每页展示的数据 默认为20 // 每页展示的数据 默认为20
...@@ -139,6 +181,26 @@ ...@@ -139,6 +181,26 @@
this.handleSearch(); this.handleSearch();
}, },
methods: { methods: {
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 getList(){
const res = await this.$Api.post('/service/hol/list', {
...this.searchParams
});
if (res.data && res.data.length) {
this.tableData = res.data
this.pagination.total = res.data.length
}
},
httpRequest(params) { httpRequest(params) {
this.formData.append("file", params.file); this.formData.append("file", params.file);
// this.formData.forEach((value, key) => { // this.formData.forEach((value, key) => {
...@@ -195,7 +257,7 @@ ...@@ -195,7 +257,7 @@
handleSearch() { handleSearch() {
var params = new QueryRequest().data; var params = new QueryRequest().data;
params.data = new Holiday().data; params.data = new Holiday().data;
params.data.month = moment(this.model.month).format("YYYYMM"); params.data.calendarDt = moment(this.model.month).format("YYYYMM");
params.data.currCode = this.model.currCode; params.data.currCode = this.model.currCode;
//清空页面日历展示的节假日列表 //清空页面日历展示的节假日列表
...@@ -204,6 +266,8 @@ ...@@ -204,6 +266,8 @@
this.searchParams = { this.searchParams = {
...params.data ...params.data
} }
console.log("this.searchParams=>",this.searchParams)
this.getList()
}, },
handleReset() { handleReset() {
this.$refs.paramsForm.resetFields() this.$refs.paramsForm.resetFields()
...@@ -257,35 +321,21 @@ ...@@ -257,35 +321,21 @@
//操作数据列表 //操作数据列表
var operateDataList = [] var operateDataList = []
for (var i = 0; i < this.holidayList.length; i++) { for (var i = 0; i < this.holidayList.length; i++) {
var holiday = new Holiday().data; let calendarDt = moment(this.holidayList[i]).format('YYYYMMDD')
holiday.currCode = this.model.currCode; operateDataList.push(calendarDt)
holiday.calendarDt = moment(this.holidayList[i]).format('YYYYMMDD')
operateDataList.push(holiday)
console.log("holiday" + holiday.currCode)
} }
var params = new OperateParams().data let params = {
//操作人编号 currCode: this.model.currCode,
params.operorNo = window.sessionStorage.getItem('userId') calendarDtList:operateDataList
//操作人姓名 }
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) this.$Api.post('/service/hol/upd',{
...params
})
.then(res => { .then(res => {
if (res.code === SUCCESS) { if (res.respCode === "AAAAAA") {
this.$message('提交成功,请等待管理员审核') this.$message('提交成功,请等待管理员审核')
this.$refs['cList'].getList();
this.handleSearch(); this.handleSearch();
} }
}) })
...@@ -336,6 +386,7 @@ ...@@ -336,6 +386,7 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
margin-bottom: 50px;
} }
.m-holiday-table { .m-holiday-table {
...@@ -382,4 +433,14 @@ ...@@ -382,4 +433,14 @@
background-color: #f08080; background-color: #f08080;
text-align: center; text-align: center;
} }
.pagination-box {
width: 100%;
height: 30px;
display: flex;
align-items: center;
justify-content: flex-end;
padding: 0 10px;
background: #fff;
margin-top: 5px;
}
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment