洋浦学校 荣誉管理

init
gongdi 3 years ago
parent 95d2b0903f
commit b53cfa35f5

@ -37,7 +37,8 @@
<a-button class="button-style" @click="cancel"></a-button>
</div>
</a-spin>
<select-people v-if="category === 5" :show="showPeoplePanel" :dataRange="['3']" modalTitle="请选择人员" ref="selectPeoplePanel"
<select-people v-if="category === 5" :show="showPeoplePanel" :dataRange="['3']" modalTitle="请选择人员"
ref="selectPeoplePanel"
@cancel="closePanel" @selectComplete="selectComplete"/>
<select-student v-if="category === 6" :show="showStudentPanel" modalTitle="请选择学生" ref="selectStudentPanel"
@cancel="closeStudentPanel" @selectComplete="selectStudentComplete"
@ -50,43 +51,69 @@
import SelectPeople from '../../../../../../components/common/selectPeople/SelectPeople';
import SelectStudent from '../../../../../../components/common/selectPeople/SelectStudent';
import Upload from '../../../../../../components/common/uploader/Upload.vue';
import InterConfig from '../interConfig';
export default{
props:["categoryType"],
props: ["categoryType"],
data(){
return {
category:this.$props.categoryType,//5 6
category: this.$props.categoryType,//5 6
pageLoading: false,
showPeoplePanel: false,
showStudentPanel: false,
categoryId: 0,
categoryList: [
{category_id: 0, category_name: "全部"},
{category_id: 1, category_name: "模范教师"},
{category_id: 2, category_name: "优秀教师"},
{category_id: 3, category_name: "骨干教师"},
{category_id: 4, category_name: "特级名师"},
{category_id: 5, category_name: "教学名师"}
// {category_id: 1, category_name: ""},
// {category_id: 2, category_name: ""},
// {category_id: 3, category_name: ""},
// {category_id: 4, category_name: ""},
// {category_id: 5, category_name: ""}
],
personJson: [],
personList: [],
listScroll: this.StaticParams.scrollOption,
}
},
watch:{
categoryType:function (newVal) {
created(){
this.getCategoryList();
},
watch: {
categoryType: function (newVal) {
this.category = newVal;
this.categoryList = [
{category_id: 0, category_name: "全部"},
];
this.getCategoryList();
}
},
methods: {
getCategoryList:function () {
let param = {
bureau_id: this.BaseConfig.person_info_my.bureau_id,
category_type: this.category,
}
this.InterfaceConfig.callInterface([{
url: InterConfig.getCategories.url,
params: param,
method: InterConfig.getCategories.method,
isTestLogin: InterConfig.getCategories.isTestLogin,
}], (result) => {
let resData = result[0].data;
if (resData.code === 2000) {
this.categoryList.push(...resData.data);
console.log(this.categoryList);
}
})
},
categoryChange: function (value) {
if (this.categoryId !== value) {
this.categoryId = value;
}
},
showChoose: function () {
if(this.category === 5){
if (this.category === 5) {
this.showPeoplePanel = true;
}else if(this.category === 6){
} else if (this.category === 6) {
this.showStudentPanel = true;
}
},

@ -10,7 +10,16 @@
<a-button type="primary" @click="toAdd"></a-button>
</div>
<a-table :columns="tableColumn" :data-source="dataList" :loading="loading" :pagination="false">
<div slot="honorPhoto" slot-scope="text, record" class="idPhotoContent">
<Upload :type="2" :multiple="false" :option="{}" :canDownload="false"
:fileData="record.fileList"
:canUpload="false"
ref="fileUpload"
/>
</div>
<span slot="action" slot-scope="text, record">
<a @click="toView(record)"></a>
<a-divider type="vertical"/>
<a @click="toDelete(record)"></a>
</span>
</a-table>
@ -26,6 +35,7 @@
@cancel="handleCancel">
是否确定删除此条信息
</a-modal>
<template v-if="pageType === 1">
<HonorInfo @cancel="cancel" @submit="submit" :categoryType="categoryType"/>
</template>
@ -33,8 +43,9 @@
</template>
<script>
import InterConfig from '../interConfig';
import {Table, Pagination, Button, Select, Modal} from 'ant-design-vue';
import {Table, Pagination, Button, Select, Modal, Divider} from 'ant-design-vue';
import _ from 'lodash';
import Upload from '../../../../../../components/common/uploader/Upload.vue';
import HonorInfo from './honorInfo.vue';
const tableColumn = [
{
@ -63,29 +74,30 @@
return {
pageType: 0,//0 1
categoryType: 0,// 5 6
categoryId: 0,
categoryId: "",
categoryList: [
{category_id: 0, category_name: "全部"},
{category_id: 1, category_name: "模范教师"},
{category_id: 2, category_name: "优秀教师"},
{category_id: 3, category_name: "骨干教师"},
{category_id: 4, category_name: "特级名师"},
{category_id: 5, category_name: "教学名师"}
{category_id: "", category_name: "全部"},
// {category_id: 1, category_name: ""},
// {category_id: 2, category_name: ""},
// {category_id: 3, category_name: ""},
// {category_id: 4, category_name: ""},
// {category_id: 5, category_name: ""}
],
pageNumber: 1,
pageSize: 10,
pageSize: 3,
totalPage: 0,
totalNum: 0,
tableColumn: [],
dataList: [],
loading: false,
honorId:"",
honorId: "",
visible: false,
}
},
created(){
this.categoryType = this.$props.menuId === "studentHonor" ? 6 : 5;
this.buildTableColumn();
this.getCategoryList();
this.getHonorList();
},
mounted(){
@ -95,11 +107,32 @@
menuId: function (newId) {
this.pageType = 0;
this.categoryType = newId === "studentHonor" ? 6 : 5;
this.categoryList = [
{category_id: "", category_name: "全部"}];
this.categoryId = "";
this.buildTableColumn();
this.getCategoryList();
this.getHonorList();
}
},
methods: {
getCategoryList: function () {
let param = {
bureau_id: this.BaseConfig.person_info_my.bureau_id,
category_type: this.categoryType,
}
this.InterfaceConfig.callInterface([{
url: InterConfig.getCategories.url,
params: param,
method: InterConfig.getCategories.method,
isTestLogin: InterConfig.getCategories.isTestLogin,
}], (result) => {
let resData = result[0].data;
if (resData.code === 2000) {
this.categoryList.push(...resData.data);
}
})
},
buildTableColumn: function () {
this.tableColumn = _.cloneDeep(tableColumn);
if (this.categoryType === 5) {
@ -121,11 +154,18 @@
}
this.tableColumn.push(
...[{
dataIndex: 'create_time',
key: 'createTime',
title: '创建时间',
align: "center"
dataIndex: 'honor_photo',
key: 'honorPhoto',
title: '获奖照片',
align: "center",
scopedSlots: {customRender: 'honorPhoto'},
},
{
dataIndex: 'create_time',
key: 'createTime',
title: '创建时间',
align: "center"
},
{
title: '操作',
key: 'action',
@ -138,7 +178,7 @@
let param = {
bureau_id: this.BaseConfig.person_info_my.bureau_id,
category_type: this.categoryType,
category_id: "",
category_id: this.categoryId,
page_number: this.pageNumber,
page_size: this.pageSize
}
@ -156,6 +196,12 @@
if (dataList && dataList.length > 0) {
for (let i = 0, len = dataList.length; i < len; i++) {
dataList[i]['index'] = i + 1 + ((this.pageNumber - 1) * 10);
let fileList = [];
let fileJson = dataList[i]['attachment_json'];
if (fileJson && fileJson !== "") {
fileList.push(...JSON.parse(fileJson));
}
dataList[i]['fileList'] = fileList;
}
}
this.dataList = dataList;
@ -172,6 +218,7 @@
categoryChange: function (value) {
if (this.categoryId !== value) {
this.categoryId = value;
this.getHonorList();
}
},
toAdd: function () {
@ -181,6 +228,9 @@
this.honorId = record.honor_id;
this.visible = true;
},
toView: function (record) {
this.honorId = record.honor_id;
},
cancel: function () {
this.pageType = 0;
this.getHonorList();
@ -235,7 +285,7 @@
})
},
//
handleCancel:function () {
handleCancel: function () {
this.honorId = "";
this.visible = false;
}
@ -247,7 +297,9 @@
ASelect: Select,
ASelectOption: Select.Option,
AModal: Modal,
HonorInfo
ADivider: Divider,
HonorInfo,
Upload
}
}
</script>

@ -246,18 +246,41 @@ const InterfaceConfig = {
},
/*
* 分类列表-分页
* "bureau_id":"必填 int 机构id"
* 查看师生荣誉信息
* "honor_id": "必填 number【荣誉id】"
* */
"viewHonor":{
url: 'intellioa/center/honor/view',
method: 'get',
isTestLogin: true,
},
/*
* 分类列表-分页
* "bureau_id":"必填 int 机构id"
"category_type":"必填 int 分类类型参考分类字典约定例如1-图文2-图片3-文档等)"
"page_number":"非必填 number 【当前页码】"
*
* */
* */
"getCategoryList":{
url: 'intellioa/center/category/list',
method: 'get',
isTestLogin: true,
},
/*
* 分类列表-不分页
* "bureau_id":"必填 int 机构id"
"category_type":"必填 int 分类类型参考分类字典约定例如1-图文2-图片3-文档等)"
"page_number":"非必填 number 【当前页码】"
*
* */
"getCategories":{
url: 'intellioa/center/category/categories',
method: 'get',
isTestLogin: true,
},
/*
* 新增编辑保存分类
* "category_type":"必填 int 分类类型参考分类字典约定例如1-图文2-图片3-文档等)"

Loading…
Cancel
Save