洋浦学校 课程计划功能开发

init
gongdi 3 years ago
parent db2c1ee516
commit 324e29bdf5

@ -303,6 +303,57 @@ const InterfaceConfig = {
url: 'intellioa/center/category/delete',
method: 'post',
isTestLogin: true,
}
},
/*
* 获取学校的学段年级信息
* "bureau_id":"必填 int 机构id"
* */
"getSchoolStageList":{
url: 'intellioa/center/course/getSchoolStageList',
method: 'get',
isTestLogin: true,
},
/*
* 根据学段年级获取课程计划信息列表-不分页
"bureau_id":"必填 int 机构id"
"stage_id":"必填 int 学段id"
"create_year":"必填 int 入学年份(年级)"
* */
"listPlanByStageYear":{
url: 'intellioa/center/course/listPlanByStageYear',
method: 'get',
isTestLogin: true,
},
/*
* 新增修改保存课程计划信息单条
* "plan_id""非必填number课程计划id填写即修改"
"stage_id":"必填 int 学段id"
"create_year":"必填 int 入学年份(年级)"
"course_name": "必填string课程名称【varchar(255)】",
"plan_number": "必填number省级计划数量【int(11)】",
"real_number": "必填number学校实际执行数量【int(11)】"
"person_id":"必填 int 操作人ID"
"identity_id":"必填 int 操作人身份ID"
"bureau_id":"必填 int 机构ID"
* */
"saveSingle":{
url: 'intellioa/center/course/saveSingle',
method: 'post',
isTestLogin: true,
},
/*
* 删除课程计划信息
"plan_ids""课程计划idsstring必填批量删除时以英文逗号分隔"
"bureau_id":"必填 int 机构ID"
* */
"deleteCourse":{
url: 'intellioa/center/course/delete',
method: 'post',
isTestLogin: true,
},
};
export default InterfaceConfig;

@ -0,0 +1,286 @@
<template>
<div class="course-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-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">
<div class="li-box li-left"><span class="must-option-style">*</span>课程名称</div>
<div class="li-box li-right">
<a-input v-model="courseName" placeholder="请输入课程名称" maxlength="100"/>
</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-input-number v-model="planNumber"/>
</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-input-number v-model="realNumber"/>
</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} from 'ant-design-vue';
import InterConfig from '../interConfig';
export default{
props: {
defaultValue: {
type: Array,
default: [],
}
},
data(){
return {
pageLoading: false,
planId:"",
stageId: "",
yearId: "",
stageList: [],
courseName: "",//
planNumber: "",//
realNumber: "",//
}
},
created(){
this.getStageList();
},
mounted(){
this.stageId = this.defaultValue[0];
this.yearId = this.defaultValue[1];
},
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;
}
})
},
stageChange: function (value) {
if (value.length > 0) {
this.stageId = value[0];
this.yearId = value[1];
}
},
submit: function () {
if(this.stageId === "" || this.yearId === ""){
Modal.warning({
title: "请选择学段或者学年",
content: "",
centered: true
})
return;
}
if(this.courseName.trim() === ""){
Modal.warning({
title: "请输入课程名称",
content: "",
centered: true
})
return;
}
if(this.planNumber === ""){
Modal.warning({
title: "请输入省级计划数量",
content: "",
centered: true
})
return;
}
if(this.realNumber === ""){
Modal.warning({
title: "请输入学校实际执行数量",
content: "",
centered: true
})
return;
}
let param = {
plan_id:this.planId,
stage_id:this.stageId,
create_year:this.yearId,
course_name:this.courseName,
plan_number:this.planNumber,
real_number:this.realNumber,
person_id: this.BaseConfig.userInfo.person_id,
identity_id: this.BaseConfig.userInfo.identity_id,
bureau_id: this.BaseConfig.person_info_my.bureau_id,
}
this.InterfaceConfig.callInterface([{
url: InterConfig.saveSingle.url,
params: param,
method: InterConfig.saveSingle.method,
isTestLogin: InterConfig.saveSingle.isTestLogin,
}], (result) => {
let resData = result[0].data;
if (resData.code === 2000) {
Modal.success({
title: "操作成功",
content: "",
centered: true
});
this.cancel();
}
})
},
cancel: function () {
this.$emit("cancel");
}
},
components: {
ASpin: Spin,
AButton: Button,
ACascader: Cascader,
AInput: Input,
AInputNumber: InputNumber,
AModal: Modal
}
}
</script>
<style scoped lang="scss">
.course-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: 20%;
text-align: right;
}
.li-right {
width: 80%;
.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>

@ -1,17 +1,300 @@
<template>
<div>
课程安排
<div class="course-plan-list-content-style">
<template v-if="pageType === 0">
<div class="search-and-add-style">
<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>
<a-button type="primary" @click="toAdd" class="add-button-style">新增</a-button>
</div>
<a-table :columns="tableColumn" :data-source="dataList" :loading="loading" :pagination="false"
:scroll="{ y: 500 }">
<span slot="realPlanMatchingDegree" slot-scope="text, record">
<a-icon type="arrow-up" :style="{fontSize: '16px', color: 'green'}"
v-if="record.real_plan_matching_degree > 0"/>
<span v-if="record.real_plan_matching_degree === 0">~</span>
<a-icon type="arrow-down" :style="{fontSize: '16px', color: 'red'}"
v-if="record.real_plan_matching_degree < 0"/>
</span>
<span slot="action" slot-scope="text, record">
<a @click="toDelete(record)"></a>
</span>
</a-table>
</template>
<a-modal title="提示"
:visible="visible"
centered
cancelText="取消"
okText="确定"
@ok="handleOk"
@cancel="handleCancel">
是否确定删除此条信息
</a-modal>
<template v-if="pageType === 1">
<course-info :defaultValue="defaultValue" @cancel="cancel" @submit="submit"/>
</template>
</div>
</template>
<script>
import InterConfig from '../interConfig';
import {Table, Button, Select, Modal, Divider, Cascader, Icon} from 'ant-design-vue';
import _ from 'lodash';
import Upload from '../../../../../../components/common/uploader/Upload.vue';
import CourseInfo from './courseInfo.vue';
const tableColumn = [
{
dataIndex: 'index',
key: 'index',
title: '序号',
width: "80px",
align: "center"
},
{
dataIndex: 'course_name',
key: 'courseName',
title: '课程名称',
align: "center"
},
{
dataIndex: 'plan_number',
key: 'planNumber',
title: '省计划',
align: "center"
},
{
dataIndex: 'real_number',
key: 'realNumber',
title: '校执行',
align: "center"
},
{
dataIndex: 'real_plan_matching_degree',
key: 'realPlanMatchingDegree',
title: '匹配度',
align: "center",
scopedSlots: {customRender: 'realPlanMatchingDegree'},
},
{
dataIndex: 'create_time',
key: 'createTime',
title: '创建时间',
align: "center"
},
{
title: '操作',
key: 'action',
align: "center",
scopedSlots: {customRender: 'action'},
}
]
export default{
props: ["menuId"],
data(){
return {}
return {
pageType: 0,//0 1
stageId: "",
stageList: [],
yearId: "",
defaultValue: [],//
tableColumn: tableColumn,
dataList: [],
loading: false,
honorId: "",
visible: false,
}
},
created(){
this.getStageList();
},
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;
this.buildDefaultValue();
}
})
},
buildDefaultValue: function () {
for (let i = 0, len = this.stageList.length; i < len; i++) {
let yearList = this.stageList[i].create_year_list;
if (yearList && yearList.length > 0) {
this.stageId = this.stageList[i].stage_id;
this.yearId = yearList[0].createYear;
this.defaultValue.push(...[this.stageId, this.yearId]);
break;
}
}
this.getListPlanByStageYear();
},
getListPlanByStageYear: function () {
if (this.stageId !== "" && this.yearId !== "") {
let param = {
bureau_id: this.BaseConfig.person_info_my.bureau_id,
stage_id: this.stageId,
create_year: this.yearId,
}
this.InterfaceConfig.callInterface([{
url: InterConfig.listPlanByStageYear.url,
params: param,
method: InterConfig.listPlanByStageYear.method,
isTestLogin: InterConfig.listPlanByStageYear.isTestLogin,
}], (result) => {
let resData = result[0].data;
if (resData.code === 2000) {
let dataList = resData.data;
if (dataList && dataList.length > 0) {
for (let i = 0, len = dataList.length; i < len; i++) {
dataList[i]['index'] = i + 1;
}
}
this.dataList = dataList;
}
})
}
},
stageChange: function (value) {
if (value.length > 0) {
this.stageId = value[0];
this.yearId = value[1];
} else {
this.stageId = "";
this.yearId = "";
}
this.getListPlanByStageYear();
},
toAdd: function () {
this.pageType = 1;
},
toDelete: function (record) {
this.honorId = record.honor_id;
this.visible = true;
},
cancel: function () {
this.pageType = 0;
this.getStageList();
},
submit: function (obj) {
let param = {
category_id: obj.category_id,
honor_list_json: JSON.stringify(obj.honor_list_json),
person_id: this.BaseConfig.userInfo.person_id,
identity_id: this.BaseConfig.userInfo.identity_id,
bureau_id: this.BaseConfig.person_info_my.bureau_id,
}
this.InterfaceConfig.callInterface([{
url: InterConfig.saveHonor.url,
params: param,
method: InterConfig.saveHonor.method,
isTestLogin: InterConfig.saveHonor.isTestLogin,
}], (result) => {
let resData = result[0].data;
if (resData.code === 2000) {
Modal.success({
title: "操作成功",
content: "",
centered: true
});
this.cancel();
}
})
},
//
handleOk: function () {
let param = {
honor_ids: this.honorId,
bureau_id: this.BaseConfig.person_info_my.bureau_id,
}
this.InterfaceConfig.callInterface([{
url: InterConfig.deleteHonor.url,
params: param,
method: InterConfig.deleteHonor.method,
isTestLogin: InterConfig.deleteHonor.isTestLogin,
}], (result) => {
let resData = result[0].data;
if (resData.code === 2000) {
Modal.success({
title: "操作成功",
content: "",
centered: true
});
this.handleCancel();
this.getHonorList();
}
})
},
//
handleCancel: function () {
this.honorId = "";
this.visible = false;
}
},
components: {
ATable: Table,
AButton: Button,
ASelect: Select,
ASelectOption: Select.Option,
AModal: Modal,
ADivider: Divider,
Upload,
ACascader: Cascader,
CourseInfo,
AIcon: Icon
}
}
</script>
<style></style>
<style scoped lang="scss">
.course-plan-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: 100px;
}
.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>
Loading…
Cancel
Save