洋浦学校 荣誉管理

init
gongdi 3 years ago
parent 95d2b0903f
commit b53cfa35f5

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

@ -10,7 +10,16 @@
<a-button type="primary" @click="toAdd"></a-button> <a-button type="primary" @click="toAdd"></a-button>
</div> </div>
<a-table :columns="tableColumn" :data-source="dataList" :loading="loading" :pagination="false"> <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"> <span slot="action" slot-scope="text, record">
<a @click="toView(record)"></a>
<a-divider type="vertical"/>
<a @click="toDelete(record)"></a> <a @click="toDelete(record)"></a>
</span> </span>
</a-table> </a-table>
@ -26,6 +35,7 @@
@cancel="handleCancel"> @cancel="handleCancel">
是否确定删除此条信息 是否确定删除此条信息
</a-modal> </a-modal>
<template v-if="pageType === 1"> <template v-if="pageType === 1">
<HonorInfo @cancel="cancel" @submit="submit" :categoryType="categoryType"/> <HonorInfo @cancel="cancel" @submit="submit" :categoryType="categoryType"/>
</template> </template>
@ -33,8 +43,9 @@
</template> </template>
<script> <script>
import InterConfig from '../interConfig'; 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 _ from 'lodash';
import Upload from '../../../../../../components/common/uploader/Upload.vue';
import HonorInfo from './honorInfo.vue'; import HonorInfo from './honorInfo.vue';
const tableColumn = [ const tableColumn = [
{ {
@ -63,29 +74,30 @@
return { return {
pageType: 0,//0 1 pageType: 0,//0 1
categoryType: 0,// 5 6 categoryType: 0,// 5 6
categoryId: 0, categoryId: "",
categoryList: [ categoryList: [
{category_id: 0, category_name: "全部"}, {category_id: "", category_name: "全部"},
{category_id: 1, category_name: "模范教师"}, // {category_id: 1, category_name: ""},
{category_id: 2, category_name: "优秀教师"}, // {category_id: 2, category_name: ""},
{category_id: 3, category_name: "骨干教师"}, // {category_id: 3, category_name: ""},
{category_id: 4, category_name: "特级名师"}, // {category_id: 4, category_name: ""},
{category_id: 5, category_name: "教学名师"} // {category_id: 5, category_name: ""}
], ],
pageNumber: 1, pageNumber: 1,
pageSize: 10, pageSize: 3,
totalPage: 0, totalPage: 0,
totalNum: 0, totalNum: 0,
tableColumn: [], tableColumn: [],
dataList: [], dataList: [],
loading: false, loading: false,
honorId:"", honorId: "",
visible: false, visible: false,
} }
}, },
created(){ created(){
this.categoryType = this.$props.menuId === "studentHonor" ? 6 : 5; this.categoryType = this.$props.menuId === "studentHonor" ? 6 : 5;
this.buildTableColumn(); this.buildTableColumn();
this.getCategoryList();
this.getHonorList(); this.getHonorList();
}, },
mounted(){ mounted(){
@ -95,11 +107,32 @@
menuId: function (newId) { menuId: function (newId) {
this.pageType = 0; this.pageType = 0;
this.categoryType = newId === "studentHonor" ? 6 : 5; this.categoryType = newId === "studentHonor" ? 6 : 5;
this.categoryList = [
{category_id: "", category_name: "全部"}];
this.categoryId = "";
this.buildTableColumn(); this.buildTableColumn();
this.getCategoryList();
this.getHonorList(); this.getHonorList();
} }
}, },
methods: { 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 () { buildTableColumn: function () {
this.tableColumn = _.cloneDeep(tableColumn); this.tableColumn = _.cloneDeep(tableColumn);
if (this.categoryType === 5) { if (this.categoryType === 5) {
@ -121,11 +154,18 @@
} }
this.tableColumn.push( this.tableColumn.push(
...[{ ...[{
dataIndex: 'create_time', dataIndex: 'honor_photo',
key: 'createTime', key: 'honorPhoto',
title: '创建时间', title: '获奖照片',
align: "center" align: "center",
scopedSlots: {customRender: 'honorPhoto'},
}, },
{
dataIndex: 'create_time',
key: 'createTime',
title: '创建时间',
align: "center"
},
{ {
title: '操作', title: '操作',
key: 'action', key: 'action',
@ -138,7 +178,7 @@
let param = { let param = {
bureau_id: this.BaseConfig.person_info_my.bureau_id, bureau_id: this.BaseConfig.person_info_my.bureau_id,
category_type: this.categoryType, category_type: this.categoryType,
category_id: "", category_id: this.categoryId,
page_number: this.pageNumber, page_number: this.pageNumber,
page_size: this.pageSize page_size: this.pageSize
} }
@ -156,6 +196,12 @@
if (dataList && dataList.length > 0) { if (dataList && dataList.length > 0) {
for (let i = 0, len = dataList.length; i < len; i++) { for (let i = 0, len = dataList.length; i < len; i++) {
dataList[i]['index'] = i + 1 + ((this.pageNumber - 1) * 10); 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; this.dataList = dataList;
@ -172,6 +218,7 @@
categoryChange: function (value) { categoryChange: function (value) {
if (this.categoryId !== value) { if (this.categoryId !== value) {
this.categoryId = value; this.categoryId = value;
this.getHonorList();
} }
}, },
toAdd: function () { toAdd: function () {
@ -181,6 +228,9 @@
this.honorId = record.honor_id; this.honorId = record.honor_id;
this.visible = true; this.visible = true;
}, },
toView: function (record) {
this.honorId = record.honor_id;
},
cancel: function () { cancel: function () {
this.pageType = 0; this.pageType = 0;
this.getHonorList(); this.getHonorList();
@ -235,7 +285,7 @@
}) })
}, },
// //
handleCancel:function () { handleCancel: function () {
this.honorId = ""; this.honorId = "";
this.visible = false; this.visible = false;
} }
@ -247,7 +297,9 @@
ASelect: Select, ASelect: Select,
ASelectOption: Select.Option, ASelectOption: Select.Option,
AModal: Modal, AModal: Modal,
HonorInfo ADivider: Divider,
HonorInfo,
Upload
} }
} }
</script> </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-文档等)" "category_type":"必填 int 分类类型参考分类字典约定例如1-图文2-图片3-文档等)"
"page_number":"非必填 number 【当前页码】" "page_number":"非必填 number 【当前页码】"
* *
* */ * */
"getCategoryList":{ "getCategoryList":{
url: 'intellioa/center/category/list', url: 'intellioa/center/category/list',
method: 'get', method: 'get',
isTestLogin: true, 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-文档等)" * "category_type":"必填 int 分类类型参考分类字典约定例如1-图文2-图片3-文档等)"

Loading…
Cancel
Save