Commit 90f6f0a1 by 闫泽浩

Tdh静态交易更新

parent 8b73c26a
import Api from "~/service/Api"
export function queryByPage(data) {
return Api.post("/service/tdh/queryByPage", data)
}
export function queryById(inr) {
return Api.post(`/service/tdh/queryById?inr=${inr}`)
}
export function queryDetailById(data) {
return Api.post(`/service/tdh/queryDetailById`, data)
}
export function add(data) {
return Api.post("/service/tdh/add", data)
}
export function edit(data) {
return Api.post("/service/tdh/edit", data)
}
export function deleteById(data) {
return Api.post(`/service/tdh/deleteById`, data)
}
export function queryYearList(data) {
return Api.post(`/service/tdh/queryYearList`, data)
}
export function queryCalList(data) {
return Api.post(`/service/tdh/queryCalList`, data)
}
\ No newline at end of file
......@@ -354,6 +354,12 @@ import Dbaxrt from "~/views/Statics/Xrt/views/Dbaxrt";
import Dbexrt from "~/views/Statics/Xrt/views/Dbexrt";
import Dbdxrt from "~/views/Statics/Xrt/views/Dbdxrt";
import Dbatdh from "~/views/Statics/Tdh/views/Dbatdh";
import Dbdtdh from "~/views/Statics/Tdh/views/Dbdtdh";
import Dbetdh from "~/views/Statics/Tdh/views/Dbetdh";
import Dbitdh from "~/views/Statics/Tdh/views/Dbitdh";
import Inftdh from "~/views/Statics/Tdh/views/Inftdh";
import Dbaswm from "~/views/Statics/Swm/views/Dbaswm";
import Dbdswm from "~/views/Statics/Swm/views/Dbdswm";
......@@ -737,5 +743,11 @@ const BusRouter = [
{ path: 'dbaxrt', component: Dbaxrt, name: 'StaticsDbaxrt', meta: { title: '牌价新增' } },
{ path: 'dbexrt/:inr', component: Dbexrt, name: 'StaticsDbexrt', meta: { title: (tag) => { return '牌价修改: ' + tag.params.inr } } },
{ path: 'dbdxrt/:inr', component: Dbdxrt, name: 'StaticsDbdxrt', meta: { title: (tag) => { return '牌价删除: ' + tag.params.inr } } },
{ path: 'inftdh', component: Inftdh, name: 'StaticsInftdh', meta: { title: '节假日信息查询' } },
{ path: 'dbitdh/:inr', component: Dbitdh, name: 'StaticsDbitdh', meta: { title: (tag) => { return '节假日信息详情: ' + tag.params.inr } } },
{ path: 'dbatdh', component: Dbatdh, name: 'StaticsDbatdh', meta: { title: '节假日新增' } },
{ path: 'dbetdh/:inr', component: Dbetdh, name: 'StaticsDbetdh', meta: { title: (tag) => { return '节假日修改: ' + tag.params.inr } } },
{ path: 'dbdtdh/:inr', component: Dbdtdh, name: 'StaticsDbdtdh', meta: { title: (tag) => { return '节假日删除: ' + tag.params.inr } } },
]
export default BusRouter
\ No newline at end of file
......@@ -14,6 +14,12 @@ import Dbiusr from "./Dbiusr";
import Dbeusr from "./Dbeusr";
import Dbdusr from "./Dbdusr";
import Dbatdh from "./Tdh/views/Dbatdh";
import Dbdtdh from "./Tdh/views/Dbdtdh";
import Dbetdh from "./Tdh/views/Dbetdh";
import Dbitdh from "./Tdh/views/Dbitdh";
import Inftdh from "./Tdh/views/Inftdh";
import Infcty from "./cty/views/Infcty";
import Dbicty from "./cty/views/Dbicty";
import Dbacty from "./cty/views/Dbacty";
......@@ -219,6 +225,12 @@ const StaticsRouter = [
{ path: 'dbifec/:inr', component: Dbifec, name: 'StaticsDbifec', meta: { title: (tag) => { return '费率详情: ' + tag.params.inr } } },
{ path: 'dbefec/:inr', component: Dbefec, name: 'StaticsDbefec', meta: { title: (tag) => { return '费率修改: ' + tag.params.inr } } },
{ path: 'dbdfec/:inr', component: Dbdfec, name: 'StaticsDbdfec', meta: { title: (tag) => { return '费率删除: ' + tag.params.inr } } },
{ path: 'inftdh', component: Inftdh, name: 'StaticsInftdh', meta: { title: '节假日信息查询' } },
{ path: 'dbitdh/:inr', component: Dbitdh, name: 'StaticsDbitdh', meta: { title: (tag) => { return '节假日信息详情: ' + tag.params.inr } } },
{ path: 'dbatdh', component: Dbatdh, name: 'StaticsDbatdh', meta: { title: '节假日新增' } },
{ path: 'dbetdh/:inr', component: Dbetdh, name: 'StaticsDbetdh', meta: { title: (tag) => { return '节假日修改: ' + tag.params.inr } } },
{ path: 'dbdtdh/:inr', component: Dbdtdh, name: 'StaticsDbdtdh', meta: { title: (tag) => { return '节假日删除: ' + tag.params.inr } } },
]
export default StaticsRouter
export default class Tdh {
constructor() {
this.data = {
inr: "",
calyear: "",
calendarName: "",
calendar: "",
ver: "",
dat: "",
dateday: "",
}
}
}
export const Pattern = {
"dat": [
{ "required": true, "message": "必输项", "type": "date", "trigger": "blur" },
],
"calendar": [
{ "required": true, "message": "必输项", "type": "string", "trigger": "blur" },
],
"dateday": [
{ "required": true, "message": "必输项", "type": "string", "trigger": "blur" },
],
"calendarname": [
{ "required": true, "message": "必输项", "type": "string", "trigger": "blur" },
],
}
<template>
<m-tdh title="dbatdh" type="add"></m-tdh>
</template>
<script>
import Dbitdh from "~/views/Statics/Tdh/views/Dbitdh";
export default {
name: "StaticsDbatdh",
components: {
"m-tdh": Dbitdh
},
data() {
return {};
},
mounted() {
}
};
</script>
<style>
</style>
\ No newline at end of file
<template>
<m-tdh title="dbdtdh" type="delete"></m-tdh>
</template>
<script>
import Dbitdh from "~/views/Statics/Tdh/views/Dbitdh";
export default {
name: "StaticsDbdtdh",
components: {
"m-tdh": Dbitdh
},
data() {
return {};
},
};
</script>
<style>
</style>
\ No newline at end of file
<template>
<m-tdh title="dbetdh" type="edit"></m-tdh>
</template>
<script>
import Dbitdh from "~/views/Statics/Tdh/views/Dbitdh";
export default {
name: "StaticsDbetdh",
components: {
"m-tdh": Dbitdh
},
data() {
return {};
},
};
</script>
<style>
</style>
\ No newline at end of file
<template>
<div class="eibs-tab">
<!-- =============================================左边=========================================== -->
<c-col :span="12" class="col-left">
<c-col :span="24">
<el-form-item label="日期" prop="dat">
<c-date-picker type="date"  v-model="model.dat" style="width:100%"  placeholder="请选择日期"></c-date-picker>
</el-form-item>
</c-col>
<c-col :span="24">
<el-form-item label="日历代码" prop="calendar">
<c-input :disabled="type === 'edit'" v-model="model.calendar" placeholder="请输入日历代码" style="width: 100%">
</c-input>
</el-form-item>
</c-col>
</c-col>
<!-- =============================================右边=========================================== -->
<c-col :span="12" class="col-right">
<c-col :span="24">
<el-form-item label="节日名" prop="dateday">
<c-input v-model="model.dateday" style="width: 100%" placeholder="请输入节日名"> </c-input>
</el-form-item>
</c-col>
<c-col :span="24">
<el-form-item label="日历名称" prop="calendarname">
<c-input :disabled="type === 'edit'" v-model="model.calendarname" style="width: 100%" placeholder="请输入日历名称"> </c-input>
</el-form-item>
</c-col>
</c-col>
</div>
</template>
<script>
import codes from "~/config/CodeTable";
export default {
name: '',
props: ['model', 'type'],
data() {
return {
}
},
mounted() {},
methods: {
getCodesByKey(key) {
return codes[key] ?? [];
},
},
}
</script>
<style></style>
<template>
<div class="eContainer">
<c-page :title="title">
<el-form
ref="modelForm"
label-width="120px"
size="small"
label-position="right"
:model="model"
:rules="rules"
:validate-on-rule-change="false"
:disabled="isDisabled"
>
<c-tabs v-model="tabVal" ref="elment" type="card">
<el-tab-pane label="节假日查询" name="tdh">
<c-content>
<m-tdh-info :model="model" :type="type" />
</c-content>
</el-tab-pane>
</c-tabs>
</el-form>
<div style="text-align: center">
<c-button
type="primary"
style="margin-right: 10px"
@click="commitAdd"
v-if="type === 'add'"
>提 交</c-button
>
<c-button
type="primary"
style="margin-right: 10px"
@click="commitEdit"
v-if="type === 'edit'"
>提 交</c-button
>
<c-button
type="primary"
style="margin-right: 10px"
@click="commitDelete"
v-if="type === 'delete'"
>提 交</c-button
>
<c-button type="primary" @click="goBack">返 回</c-button>
</div>
</c-page>
</div>
</template>
<script>
import Utils from "~/utils";
import Tdh, { Pattern } from "~/views/Statics/Tdh/model/Tdh.js";
import TdhInfo from "./TdhInfo.vue";
import { queryById, add, edit, deleteById, queryDetailById } from "~/service/test/tdh.js";
export default {
name: "StaticsDbitdh",
components: {
"m-tdh-info": TdhInfo,
},
provide() {
return {
root: this,
};
},
props: {
type: {
type: String,
default: "info"
},
title: {
type: String,
default: "dbitdh"
}
},
data() {
return {
model: new Tdh().data,
tabVal: "tdh",
rules: Pattern,
};
},
computed: {
isDisabled() {
return this.type === "info" || this.type === "delete";
},
},
created() {
if (this.type !== "add") {
const inr = this.$route.params.inr;
queryById(inr).then((res) => {
if (res.inr) {
this.model = res;
} else {
this.$message.error("数据不存在")
}
});
}
},
methods: {
commitAdd() {
this.$refs.modelForm.validate((validated) => {
if (validated) {
add(this.model)
.then((res) => {
this.$message.success("保存成功!")
this.goBack(true)
})
.catch((err) => {
this.$message.error("保存失败!");
});
} else {
Utils.formValidateTips(this.$refs.modelForm.fields)
}
});
},
commitEdit() {
this.$refs.modelForm.validate((validated) => {
if (validated) {
edit(this.model)
.then((res) => {
this.$message.success("保存成功!");
this.goBack(true)
})
.catch((err) => {
this.$message.error("保存失败!");
});
} else {
Utils.formValidateTips(this.$refs.modelForm.fields)
}
});
},
commitDelete() {
this.$confirm("是否确认删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
let data = {"inr":this.model.inr}
deleteById(data)
.then((res) => {
this.$message.success("删除成功!");
this.goBack(true)
})
.catch((err) => {
this.$message.error("删除失败!");
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消删除",
});
});
},
/**
* update 是否更新inftdh的查询列表
*/
goBack(update) {
this.$store.dispatch("TagsView/delView", this.$route);
this.$router.push({ name: "StaticsInftdh", params: { update } });
},
},
};
</script>
<style>
</style>
\ No newline at end of file
<template>
<div class="eibs-tab">
<c-col :span="12" class="col-left">
<c-col :span="24">
<el-form-item label="日历名称" prop="calendarname">
<c-select v-model="model.calendarname" placeholder="请选择日历名称" @change="getTdhYearList">
<el-option v-for="item in tdhCalList" :key="item.lable" :label="item.lable" :value="item.value"></el-option>
</c-select>
</el-form-item>
</c-col>
</c-col>
<!------------- 右 ---------->
<c-col :span="12" class="col-right">
<c-col :span="24">
<el-form-item label="年份" prop="calyear">
<c-select v-model="model.calyear" placeholder="请选择年份">
<el-option v-for="item in tdhYearList" :key="item.lable" :label="item.lable"
:value="item.value"></el-option>
</c-select>
</el-form-item>
</c-col>
</c-col>
<c-col :span="24">
<c-col :span="12" style="text-align: left">
<el-button type="primary" size="small" @click="tdhAdd">新增</el-button>
</c-col>
<c-col :span="12" style="text-align: right">
<el-button size="small" @click="handleReset">重置</el-button>
<el-button type="primary" icon="el-icon-search" size="small" @click="onSearch()">查询
</el-button>
</c-col>
</c-col>
<c-col :span="24">
<c-paging-table :data="tdhData" :columns="tdhColumns" :pageNumber="model.pageNum" :pageSize="model.pageSize"
:total="model.total" v-on:queryFunc="queryFunc" :border="true">
<c-table-column fixed="right" prop="op" label="操作" width="240px">
<template slot-scope="{ scope }">
<c-button style="margin-left: 0" size="small" @click="tdhInfo(scope.$index, scope.row)">详情</c-button>
<c-button style="margin-left: 5px" size="small" type="primary"
@click="tdhEdit(scope.$index, scope.row)">修改</c-button>
<c-button size="small" style="margin-left: 5px" @click="tdhDelete(scope.$index, scope.row)">删除</c-button>
<el-popover placement="top-start" width="50" trigger="click">
<ul class="table-button-item-list">
<li>
<c-button size="small" style="margin-left: 0">指派</c-button>
</li>
<li>
<c-button size="small" style="margin-left: 0">删除</c-button>
</li>
</ul>
<a slot="reference" href="javascript:void(0)" style="margin-left: 5px">
<i class="el-icon-more"></i>
</a>
</el-popover>
</template>
</c-table-column>
</c-paging-table>
</c-col>
</div>
</template>
<script>
import codes from "~/config/CodeTable";
import { queryByPage, queryYearList, queryCalList } from "~/service/test/tdh.js";
export default {
name: "",
props: ["model"],
inject: ["root"],
data() {
return {
tdhData: [],
tdhColumns: [
{ label: '日期', prop: 'datStr', width: 'auto' },
{ label: '节日名', prop: 'dateday', width: 'auto' }
],
tdhYearList: [],
tdhCalList: [],
};
},
computed: {
},
created() {
this.getTdhCalList()
},
activated() {
this.getTdhCalList()
const { update } = this.$route.params
if (update) {
this.onInftdhSearch()
}
},
methods: {
getTdhCalList() {
queryCalList(this.model).then(res => {
this.tdhCalList = res.list
})
},
getTdhYearList() {
this.model.calyear ? this.model.calyear = '' : ''
queryYearList(this.model).then(res => {
this.tdhYearList = res.list
})
},
getCodesByKey(key) {
return codes[key] ?? [];
},
handleReset() {
this.root.$refs.modelForm.resetFields();
},
onSearch() {
this.model.pageSize = 5;
this.model.pageNum = 1;
this.onInftdhSearch();
},
onInftdhSearch() {
queryByPage(this.model).then(res => {
const list = res.list
this.tdhData = list
this.model.pageNum = res.pageNumber
this.model.pageSize = res.pageSize
this.model.total = res.total
})
},
queryFunc(pageNumber, pageSize) {
this.model.pageNum = pageNumber
this.model.pageSize = pageSize
this.onInftdhSearch()
},
tdhtypeChange(val) {
this.model.fectyp = val;
},
tdhCodesByKey(key) {
return codes[key] ?? [];
},
tdhAdd() {
this.$router.push(`/statics/dbatdh`)
},
tdhInfo(index, row) {
this.$router.push(`/statics/dbitdh/${row.inr}`)
},
tdhEdit(index, row) {
this.$router.push(`/statics/dbetdh/${row.inr}`)
},
tdhDelete(index, row) {
this.$router.push(`/statics/dbdtdh/${row.inr}`)
},
},
};
</script>
<style scoped>
.table-button-item-list {
padding: 0;
margin: 0;
}
.table-button-item-list li {
list-style: none;
padding: 5px 0;
text-align: center;
color: #606266;
cursor: pointer;
}
</style>
<template>
<div class="eContainer">
<c-page title="节假日查询">
<el-form :model="model" ref="modelForm" label-width="120px" label-position="right" size="small">
<c-tabs v-model="tabVal" ref="elment" type="card">
<!--PD000039 -->
<el-tab-pane label="查询面板" name="infsea">
<c-content>
<m-infsea :model="model" ref="infsea" />
</c-content>
</el-tab-pane>
</c-tabs>
</el-form>
</c-page>
</div>
</template>
<script>
import Infsea from "./Infsea";
export default {
name: "StaticsInftdh",
components: {
"m-infsea": Infsea,
},
provide() {
return {
root: this,
};
},
data() {
return {
tabVal: "infsea",
model: {
cod: "",
pageSize:5,
pageNum:1,
total:0
},
};
},
};
</script>
<style>
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment