|
|
|
@ -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>
|