洋浦学校 八大中心后台管理 日期公示模块前端开发

init
gongdi 3 years ago
parent 4572f0880e
commit c00e9ba6a2

@ -1159,5 +1159,55 @@ const InterfaceConfig = {
method: 'post',
isTestLogin: true,
},
/*
* 获取家长日期公示列表-分页
* "bureau_id":"必填 int 机构id"
"publicity_type":"非必填 int 公示日期类型(查询条件)"
"stage_id":"非必填 int 学段(查询条件)"
"create_year":"非必填 int 入学年份(查询条件)"
"page_number":"非必填 number 【当前页码】"
"page_size":"非必填 number 【每页条数】"
* */
"getPublicityList":{
url: 'intellioa/center/publicity/list',
method: 'get',
isTestLogin: true,
},
/*
* 查看家长日期公示信息
* "publicity_id": "必填 number【公示日期id】"
* */
"getPublicityInfo":{
url: 'intellioa/center/publicity/view',
method: 'get',
isTestLogin: true,
},
/*
* 新增编辑保存家长日期公示信息
* "publicity_id""公示日期idnumber非必填填写代表编辑"
"publicity_type""公示日期类型0-开放日1-家长会number必填"
"publicity_date""公示日期时间string必填"
"stage_id""学段idint必填"
"create_year""入学年份int必填"
"person_id":"必填 int 操作人ID"
"identity_id":"必填 int 操作人身份ID"
"bureau_id":"必填 int 机构ID"
* */
"savePublicity":{
url: 'intellioa/center/publicity/save',
method: 'post',
isTestLogin: true,
},
/*
* 删除家长日期公示信息
* "publicity_ids""公示日期idsstring必填批量删除时以英文逗号分隔"
"bureau_id":"必填 int 机构ID"
* */
"deletePublicity":{
url: 'intellioa/center/publicity/delete',
method: 'post',
isTestLogin: true,
},
};
export default InterfaceConfig;

@ -0,0 +1,339 @@
<template>
<div class="club-activity-info-content-style">
<a-spin :spinning="pageLoading">
<div class="add-record-row-style">
<div class="li-box li-left"><span class="must-option-style">*</span>公示日期类型</div>
<div class="li-box li-right">
<a-select :value="publicityType" @change="publicityTypeChange">
<a-select-option v-for="item in publicityList" :key="item.publicityType" :value="item.publicityType">
{{ item.publicityName }}
</a-select-option>
</a-select>
</div>
</div>
<div class="add-record-row-style">
<div class="li-box li-left"><span class="must-option-style">*</span>公示日期时间</div>
<div class="li-box li-right">
<a-date-picker
v-model="publicityDate"
:show-time="{ format: 'HH:mm' }"
format="YYYY-MM-DD HH:mm"
placeholder="select time"
@change="onRangeChange"
@ok="onRangeOk"
/>
</div>
</div>
<div class="add-record-row-style">
<div class="li-box li-left"><span class="must-option-style">*</span>学段学年</div>
<div class="li-box li-right">
<a-cascader
:field-names="{label:'createYearName',value:'createYear',children:'create_year_list'}"
:allowClear="false"
v-model:value="defaultValue"
:options="stageList" @change="stageChange" placeholder="选择学段学年"></a-cascader>
</div>
</div>
<div class="add-record-row-style button-row-style">
<a-button type="primary" class="button-style" @click="submit">
提交
</a-button>
<a-button class="button-style" @click="cancel"></a-button>
</div>
</a-spin>
</div>
</template>
<script>
import {Spin, Button, Cascader, Input, InputNumber, Modal, Select, DatePicker,Icon,TimePicker} from 'ant-design-vue';
import InterConfig from '../interConfig';
import locale from 'ant-design-vue/es/date-picker/locale/zh_CN';
import moment from 'moment';
import ATextarea from "ant-design-vue/es/input/TextArea";
export default{
props: {
publicityId:{
type:String,
default:""
},
},
data(){
return {
pageLoading: false,
showStudentPanel:false,
stageId: "",
stageList: [],
yearId: "",
defaultValue: [],//
dataList: [],
publicityid:this.$props.publicityId,//
publicityType: "",
publicityList: [{publicityType:"",publicityName:"全部"},
{publicityType:0,publicityName:"开放日"},
{publicityType:1,publicityName:"家长会"},
],
locale,
publicityDate:"",//
}
},
created(){
this.getStageList();
if (this.$props.publicityId !== "") {
this.getInfo();
}
},
methods: {
getStageList: function () {
let param = {
bureau_id: this.BaseConfig.person_info_my.bureau_id,
}
this.InterfaceConfig.callInterface([{
url: InterConfig.getSchoolStageList.url,
params: param,
method: InterConfig.getSchoolStageList.method,
isTestLogin: InterConfig.getSchoolStageList.isTestLogin,
}], (result) => {
let resData = result[0].data;
if (resData.code === 2000) {
let stageList = resData.data;
if (stageList && stageList.length > 0) {
for (let i = 0, len = stageList.length; i < len; i++) {
stageList[i].createYear = stageList[i].stage_id;
stageList[i].createYearName = stageList[i].stage_name;
}
}
this.stageList = stageList;
}
})
},
publicityTypeChange:function (value) {
this.publicityType = value;
},
onRangeChange:function(value,dateString){
this.publicityDate = dateString;
},
onRangeOk:function (value) {
console.log(value)
},
stageChange: function (value) {
if (value.length > 0) {
this.stageId = value[0];
this.yearId = value[1];
} else {
this.stageId = "";
this.yearId = "";
}
},
getInfo: function () {
let param = {
publicity_id: this.$props.publicityId,
}
this.InterfaceConfig.callInterface([{
url: InterConfig.getPublicityInfo.url,
params: param,
method: InterConfig.getPublicityInfo.method,
isTestLogin: InterConfig.getPublicityInfo.isTestLogin,
}], (result) => {
let resData = result[0].data;
if (resData.code === 2000) {
let info = resData.data;
this.publicityType = info.publicity_type;
this.publicityDate = info.publicity_date;
this.stageId = info.stage_id;
this.yearId = info.create_year;
this.defaultValue = [info.stage_id,info.create_year]
}
})
},
submit: function () {
if (this.publicityType === "") {
Modal.warning({
title: "请选择公示日期类型",
content: "",
centered: true
})
return;
}
if (this.publicityDate === "") {
Modal.warning({
title: "请选择公示日期时间",
content: "",
centered: true
})
return;
}
if (this.stageId === "") {
Modal.warning({
title: "请选择学段",
content: "",
centered: true
})
return;
}
if (this.yearId === "") {
Modal.warning({
title: "请选择入学年份",
content: "",
centered: true
})
return;
}
let param = {
publicity_type:this.publicityType,
publicity_date: this.publicityDate,
stage_id:this.stageId,
create_year:this.yearId,
person_id: this.BaseConfig.userInfo.person_id,
identity_id: this.BaseConfig.userInfo.identity_id,
bureau_id: this.BaseConfig.person_info_my.bureau_id,
}
if(this.$props.publicityId !== ""){
param.publicity_id = this.$props.publicityId;
}
this.pageLoading = true;
this.InterfaceConfig.callInterface([{
url: InterConfig.savePublicity.url,
params: param,
method: InterConfig.savePublicity.method,
isTestLogin: InterConfig.savePublicity.isTestLogin,
}], (result) => {
this.pageLoading = false;
let resData = result[0].data;
if (resData.code === 2000) {
Modal.success({
title: "操作成功",
content: "",
centered: true
});
this.cancel();
}
})
},
cancel: function () {
this.$emit("cancel");
}
},
components: {
ATextarea,
ASpin: Spin,
ASelect: Select,
ASelectOption: Select.Option,
AInput: Input,
ADatePicker: DatePicker,
ARangePicker:DatePicker.RangePicker,
ACascader: Cascader,
AButton: Button,
AIcon:Icon,
}
}
</script>
<style scoped lang="scss">
.club-activity-info-content-style {
width: 100%;
height: auto;
font-size: 1rem;
color: black;
.add-record-row-style {
width: 50%;
min-height: 3rem;
margin: 0.5rem auto;
display: flex;
.li-box {
min-height: 3rem;
line-height: 3rem;
.must-option-style {
color: red;
margin-right: 0.2rem;
}
}
.li-left {
width: 15%;
text-align: right;
}
.li-right {
width: 85%;
.person-list-content-style {
width: 700px;
height: 500px;
background-color: #ebebeb;
.list-content-style {
width: 100%;
height: 100%;
display: flex;
flex-wrap: wrap;
.honor-person-info {
width: auto;
height: 180px;
border: 1px solid #31a8fa;
margin: 0.5rem 0 0 0.5rem;
display: flex;
flex-direction: column;
justify-content: center;
.person-name {
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
text-align: center;
}
/deep/ .img-style {
margin-right: 0 !important;
}
}
}
}
.ant-select {
width: 100px;
}
.no-border-input-style {
border-top: 0 !important;
border-left: 0 !important;
border-right: 0 !important;
}
.photo-container-style {
display: flex;
align-items: center;
align-content: center;
justify-content: center;
justify-items: center;
width: 120px !important;
border: 1px solid #e5e5e5;
height: 160px;
background-color: white;
position: relative;
.operate-class {
position: absolute;
bottom: 0.1rem;
color: #31a8fa;
font-size: 1rem;
cursor: pointer;
display: none;
}
.photo-size-style {
display: flex;
align-items: center;
align-content: center;
justify-items: center;
justify-content: center;
}
}
.edit-style {
&:hover {
.operate-class {
display: inline-block;
}
}
}
}
}
.button-row-style {
width: 50%;
margin: auto;
display: flex;
justify-content: center;
align-items: center;
.button-style {
margin-left: 0.5rem;
}
}
}
</style>

@ -0,0 +1,296 @@
<template>
<div class="moral-publicity-list-content-style">
<template v-if="pageType === 0">
<div class="search-and-add-style">
<div>
<a-cascader
:field-names="{label:'createYearName',value:'createYear',children:'create_year_list'}"
:allowClear="false"
v-model:value="defaultValue"
:options="stageList" @change="stageChange" placeholder="选择学段学年"></a-cascader>
<span style="margin:0 0.5rem">公示类型</span>
<a-select :value="publicityType" @change="publicityTypeChange">
<a-select-option v-for="item in publicityList" :key="item.publicityType" :value="item.publicityType">
{{ item.publicityName }}
</a-select-option>
</a-select>
<a-icon type="search" :style="{fontSize: '16px', color: '#31a8fa',marginLeft:'0.5rem'}" @click="search" />
</div>
<a-button type="primary" @click="toAdd" class="add-button-style">新增</a-button>
</div>
<a-table :columns="tableColumn" :data-source="dataList" :loading="loading" :pagination="false">
<span slot="action" slot-scope="text, record">
<a @click="toEdit(record)"></a>
<a-divider type="vertical"/>
<a @click="toDelete(record)"></a>
</span>
</a-table>
<a-pagination v-if="totalPage > 1" v-model="pageNumber" :pageSize="pageSize" :total="totalNum"
@change="onPageChange"/>
</template>
<a-modal title="提示"
:visible="visible"
centered
cancelText="取消"
okText="确定"
@ok="handleOk"
@cancel="handleCancel">
是否确定删除此条信息
</a-modal>
<template v-if="pageType === 1">
<PublicityInfo @cancel="cancel" :publicityId="publicityId"/>
</template>
</div>
</template>
<script>
import InterConfig from '../interConfig';
import {Table, Button, Select, Modal, Divider, Cascader, Icon, Input,Pagination} from 'ant-design-vue';
import PublicityInfo from './publicityInfo.vue';
const tableColumn = [
{
dataIndex: 'index',
key: 'index',
title: '序号',
width: "80px",
align: "center"
},
{
dataIndex: 'publicityTypeStr',
key: 'publicity_type_str',
title: '公示日期类型',
align: "center"
},
{
dataIndex: 'publicity_date',
key: 'publicityDate',
title: '公示日期时间',
align: "center"
},
{
dataIndex: 'stage_name',
key: 'stageName',
title: '学段名称',
align: "center"
},
{
dataIndex: 'create_year',
key: 'createYear',
title: '入学年份',
align: "center"
},
{
dataIndex: 'create_time',
key: 'createTime',
title: '创建时间',
align: "center"
},
{
title: '操作',
key: 'action',
align: "center",
scopedSlots: {customRender: 'action'},
}
]
export default{
props: ["menuId"],
data(){
return {
pageType: 0,//0 1
stageId: "",
stageList: [],
yearId: "",
defaultValue: [],//
publicityType: "",
publicityList: [{publicityType:"",publicityName:"全部"},
{publicityType:0,publicityName:"开放日"},
{publicityType:1,publicityName:"家长会"},
],
tableColumn: tableColumn,
dataList: [],
loading: false,
publicityId: "",
visible: false,
pageNumber: 1,
pageSize: 10,
totalPage: 0,
totalNum: 0,
}
},
created(){
this.getStageList();
this.getPublicityList();
},
mounted(){
},
methods: {
getStageList: function () {
let param = {
bureau_id: this.BaseConfig.person_info_my.bureau_id,
}
this.InterfaceConfig.callInterface([{
url: InterConfig.getSchoolStageList.url,
params: param,
method: InterConfig.getSchoolStageList.method,
isTestLogin: InterConfig.getSchoolStageList.isTestLogin,
}], (result) => {
let resData = result[0].data;
if (resData.code === 2000) {
let stageList = resData.data;
if (stageList && stageList.length > 0) {
for (let i = 0, len = stageList.length; i < len; i++) {
stageList[i].createYear = stageList[i].stage_id;
stageList[i].createYearName = stageList[i].stage_name;
}
}
this.stageList = stageList;
}
})
},
search:function () {
this.getPublicityList();
},
getPublicityList: function () {
let param = {
bureau_id: this.BaseConfig.person_info_my.bureau_id,
publicity_type:this.publicityType,
stage_id: this.stageId,
create_year: this.yearId,
page_number: this.pageNumber,
page_size: this.pageSize,
}
this.InterfaceConfig.callInterface([{
url: InterConfig.getPublicityList.url,
params: param,
method: InterConfig.getPublicityList.method,
isTestLogin: InterConfig.getPublicityList.isTestLogin,
}], (result) => {
let resData = result[0].data;
if (resData.code === 2000) {
let dataList = resData.data.list;
if (dataList && dataList.length > 0) {
for (let i = 0, len = dataList.length; i < len; i++) {
dataList[i]['index'] = i + 1;
dataList[i]['publicityTypeStr'] = dataList[i]['publicity_type'] === 0?"开放日":"家长会";
}
}
this.dataList = dataList;
this.totalNum = resData.data.total_row;
this.totalPage = resData.data.total_page;
}
})
},
onPageChange: function (page) {
this.pageNumber = page;
this.getPublicityList();
},
stageChange: function (value) {
if (value.length > 0) {
this.stageId = value[0];
this.yearId = value[1];
} else {
this.stageId = "";
this.yearId = "";
}
},
publicityTypeChange: function (value) {
this.publicityType = value;
},
toAdd: function () {
this.publicityId = "";
this.pageType = 1;
},
toEdit: function (record) {
this.pageType = 1;
this.publicityId = record.publicity_id + "";
},
toDelete: function (record) {
this.publicityId = record.publicity_id + "";
this.visible = true;
},
cancel: function () {
this.pageType = 0;
this.getPublicityList();
},
//
handleOk: function () {
let param = {
publicity_ids: this.publicityId,
bureau_id: this.BaseConfig.person_info_my.bureau_id,
}
this.InterfaceConfig.callInterface([{
url: InterConfig.deletePublicity.url,
params: param,
method: InterConfig.deletePublicity.method,
isTestLogin: InterConfig.deletePublicity.isTestLogin,
}], (result) => {
let resData = result[0].data;
if (resData.code === 2000) {
Modal.success({
title: "操作成功",
content: "",
centered: true
});
this.handleCancel();
this.getPublicityList();
}
})
},
//
handleCancel: function () {
this.publicityId = "";
this.visible = false;
}
},
components: {
ATable: Table,
AButton: Button,
ASelect: Select,
ASelectOption: Select.Option,
AModal: Modal,
ADivider: Divider,
ACascader: Cascader,
AIcon: Icon,
AInput: Input,
APagination:Pagination,
PublicityInfo
}
}
</script>
<style scoped lang="scss">
.moral-publicity-list-content-style {
width: 100%;
height: auto;
padding: 0.5rem;
.search-and-add-style {
width: 100%;
height: 3.5rem;
background-color: white;
margin-bottom: 0.5rem;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 0.5rem;
.ant-select {
width: 150px;
}
.ant-input {
width: 150px;
}
.add-button-style {
float: right;
}
}
.ant-table-wrapper {
/deep/ .upload-container-style {
display: flex;
justify-content: center;
align-items: center;
}
}
.ant-pagination {
margin-top: 0.5rem;
text-align: right;
}
}
</style>

@ -339,6 +339,14 @@ export const systemCenterConfig = [
component:() => import("./servicePlatform/moralEducation/menuList.vue"),
props:true,
},
{
id:"moralEducation-3-3",
title:"日期公示",
path:'/workBench/servicePlatform/moralEducationPublicity/:id/:name/:menuId',
name:'moralEducationPublicity',
component:() => import("./servicePlatform/moralEducation/publicityList.vue"),
props:true,
},
]
},
]

Loading…
Cancel
Save