Commit 783c7f71 authored by zhengke's avatar zhengke

增加页面

parent c7ba5a75
......@@ -12,7 +12,7 @@ export default {
<style>
@import url('~assets/css/font.css');
@import url('//at.alicdn.com/t/font_2077629_izue8ioqz5e.css');
@import url('//at.alicdn.com/t/font_2077629_fnioszx4oyw.css');
html,
body,
......
<template>
<q-dialog v-model="persistent" content-class="bg-grey-1" persistent transition-show="scale" transition-hide="scale">
<q-card style="width: 800px;max-width:900px;">
<q-card-section>
<div class="text-h6">{{objOption.CateId==0?'新增留学':'修改留学'}}</div>
</q-card-section>
<q-card-section class="q-pt-none scroll" style="max-height: 70vh">
<div class="text-caption q-mb-lg q-px-md text-grey-6">留学信息</div>
<div class="row wrap">
<q-input filled stack-label maxlength="30" :dense="false" v-model="objOption.CateName" ref="CateName"
class="col-6 q-pr-lg q-pb-lg" label="项目名称" :rules="[val => !!val || '项目名称']" />
<q-input filled stack-label maxlength="5" :dense="false" v-model="objOption.SortNum" ref="SortNum"
class="col-6 q-pr-lg q-pb-lg" label="排序" @keyup.native="checkInteger(objOption,'SortNum')" />
<div class="col-12 q-pr-lg q-pb-lg q-pt-lg">
<q-toggle size="md" label="状态" color="primary" :false-value="1" :true-value="0" v-model="objOption.Status"
title="注意:关闭后,分类将无法正常使用." />
</div>
</div>
</q-card-section>
<q-separator />
<q-card-actions align="right" class="bg-white">
<q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" @click="closeSaveForm" />
<q-btn label="立即提交" color="accent q-px-md" style="font-weight:400 !important" :loading="saveLoading"
@click="saveCategory" />
</q-card-actions>
</q-card>
</q-dialog>
</template>
<script>
import {
queryCourseCategoryTree,
queryCourseCategoryInfo,
saveCourseCategoryInfo
} from '../../api/course/index'
export default {
props: {
saveObj: {
type: Object,
default: null
}
},
data() {
return {
isShow: false,
persistent: true,
objOption: {
programName:'', //项目名称
supplier:'', //供应商
saleprice:'', //卖价
profits:'', //佣金/利润
costof:'', //直接成本
commission:'', //同行返佣
salecommission:'', //销售提成
offer:'', //报价
},
optionTitle: "",
//树形课程分类列表
TreeCategoryList: [],
saveLoading: false,
chooseCategroyArray: [],
}
},
mounted() {
this.getCategoryTreeList();
this.initObj()
},
methods: {
//获取树形课程分类列表
getCategoryTreeList() {
this.TreeCategoryList = [];
var qMsg = {}
queryCourseCategoryTree(qMsg).then(res => {
this.TreeCategoryList = res.Data;
this.isShow = true;
})
},
//初始化表单
initObj() {
if (this.saveObj && this.saveObj.CateId > 0) {
queryCourseCategoryInfo({
CateId: this.saveObj.CateId
}).then(res => {
this.objOption.CateId = res.Data.CateId;
this.objOption.ParentId = res.Data.ParentId;
this.objOption.CateName = res.Data.CateName;
this.objOption.SortNum = res.Data.SortNum;
this.objOption.Status = res.Data.Status;
if (res.Data.ParentId && res.Data.ParentId > 0) {
this.chooseCategroyArray.push(res.Data.ParentId);
}
})
this.optionTitle = "修改系列信息"
} else {
this.optionTitle = "新增系列"
this.objOption.CateId = 0;
this.objOption.ParentId = 0;
this.objOption.CateName = "";
this.objOption.SortNum = 0;
this.objOption.Status = 0;
}
},
//关闭弹窗
closeSaveForm() {
this.$emit('close')
this.persistent = false
},
//保存菜单
saveCategory() {
var tempKeys = "";
if (this.chooseCategroyArray && this.chooseCategroyArray.length > 0) {
this.chooseCategroyArray.forEach(item => {
this.objOption.ParentId = item;
})
}
this.saveLoading = true
saveCourseCategoryInfo(this.objOption).then(res => {
this.saveLoading = false
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据保存成功!',
position: 'top'
})
this.$emit("success")
this.closeSaveForm()
}).catch(() => {
this.saveLoading = false
})
}
},
watch: {
chooseCategroyArray: function (val, oldval) {
if (this.chooseCategroyArray.length > 1) {
var end = this.chooseCategroyArray[this.chooseCategroyArray.length - 1];
var tempArray = [];
tempArray.push(end);
this.chooseCategroyArray = tempArray;
}
}
}
}
</script>
<template>
<q-dialog v-model="persistent" content-class="bg-grey-1" persistent transition-show="scale" transition-hide="scale">
<q-card style="width: 800px;max-width:900px;">
<q-card-section>
<!-- <div class="text-h6">{{objOption.CateId==0?'新增供应商':'修改供应商'}}</div> -->
<div class="text-h6">新增供应商</div>
</q-card-section>
<q-card-section class="q-pt-none scroll" style="max-height: 70vh">
<div class="text-caption q-mb-lg q-px-md text-grey-6">供应商信息</div>
<div class="row wrap">
<q-select filled stack-label option-value="Id" option-label="Name" v-model="addMsg.Type"
ref="Type" :options="supplierList" label="供应商类型" :dense="false" class="col-6 q-pb-lg q-pr-lg" emit-value
map-options />
<q-input filled stack-label maxlength="5" :dense="false" v-model="addMsg.Name" ref="Name"
class="col-6 q-pr-lg q-pb-lg" label="供应商名称" />
</div>
</div>
</q-card-section>
<q-separator />
<q-card-actions align="right" class="bg-white">
<q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" @click="closeSaveForm" />
<q-btn label="立即提交" color="accent q-px-md" style="font-weight:400 !important" :loading="saveLoading"
@click="saveInfo" />
</q-card-actions>
</q-card>
</q-dialog>
</template>
<script>
import {
saveCourseCategoryInfo
} from '../../api/course/index'
export default {
props: {
saveObj: {
type: Object,
default: null
}
},
data() {
return {
persistent: true,
saveLoading: false,
addMsg: {
Type: 0, //供应商类型
Name: '', //供应商名称
},
supplierList:[], //供应商下拉数据
}
},
mounted() {
this.initObj()
},
methods: {
//初始化表单
initObj() {
},
//关闭弹窗
closeSaveForm() {
this.$emit('close')
this.persistent = false
},
//保存菜单
saveInfo() {
}
}
}
</script>
......@@ -114,7 +114,7 @@
@click="EditCourse(props.row, 1)" />
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="价格设置"
@click="EditCourse(props.row, 2)" v-if="isHavePriceAction" />
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400;display:none;" label="详情"
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400;" label="详情"
@click="goMycourse(props.row)" />
</q-td>
</template>
......
<style>
.jobInfoMain{
width: 1200px;
margin:auto;
}
.jobInTop{
width:100%;
padding: 24px 20px 0 24px;
background: #fff;
box-shadow: 0px 2px 10px 0px rgba(237,238,240,0.5);
border-radius: 8px;
margin-bottom: 20px;
}
.newLeft{
/* height: 877px; */
overflow: hidden;
outline: none;
width: 280px;
height: 100%;
background: #fff;
border-radius: 0 0 8px 8px;
box-shadow: 0px 2px 10px 0px rgba(237,238,240,0.5);
float: left;
border-radius: 8px;
}
.newRight{
float: right;
width:900px;
height:100%;
}
</style>
<template>
<q-card style="width: 800px;max-width:900px;">
<div class="page-body" style="background-color:rgb(242, 244, 247)">
<div class="jobInfoMain">
<div class="jobInTop">
<q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.JobName" ref="JobName"
class="col-6 q-pr-lg q-pb-lg" label="作业名称" :rules="[val => !!val || '请填写作业名称']" />
</div>
<div class="newLeft">
</div>
<div class="newRight">
</div>
</div>
<!-- <q-card style="width: 1200px;max-width:1200px;">
<q-card-section>
<div class="text-h6">{{objOption.CourseId==0?'新增作业信息':'修改作业信息'}}</div>
</q-card-section>
......@@ -43,8 +87,8 @@
<q-btn label="立即提交" color="accent q-px-md" style="font-weight:400 !important" :loading="saveCourseLoading"
@click="saveCourse" />
</q-card-actions>
</q-card>
</q-card> -->
</div>
</template>
<script>
......
<template>
<div class="page-body">
<div class="page-search row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-3">
<q-input ref="filter" filled v-model="keyWords" label="系列名称">
<template v-slot:append>
<q-icon v-if="keyWords !== ''" name="clear" class="cursor-pointer" @click="resetFilter" />
</template>
</q-input>
</div>
</div>
</div>
<div class="page-content">
<!--<div class="q-pa-md q-gutter-sm">
<q-tree v-if="isShow" :nodes="data" node-key="CateId" label-key="CateName" children-key="ChildList"
:filter="keyWords" :filter-method="myFilterMethod" default-expand-all no-results-label="暂无相关数据">
<template v-slot:default-header="prop">
<div class="row items-center">
<div class="text-weight-bold text-primary">{{ prop.node.CateName }}</div>
<template v-if="prop.node.ChildList && prop.node.ChildList.length>0">
&nbsp;
<q-btn round icon="add" size="xs" @click="EditCategory(null)" />
</template>
&nbsp;
<q-btn round icon="edit" size="xs" @click="EditCategory(prop.node)" />
</div>
</template>
</q-tree>
</div>-->
<q-table :loading="loading" no-data-label="暂无相关数据" flat class="sticky-column-table"
separator="none" :data="data" :columns="columns" row-key="name">
<template v-slot:top="props">
<div class="col-2 q-table__title">系列信息</div>
<q-space />
<div class="page-option">
<q-btn color="accent" size="sm" class="q-mr-md" icon="add" label="新增系列" @click="EditCategory(null)" />
</div>
</template>
<template v-slot:body-cell-Status="props">
<q-td :props="props">
<q-badge :color="props.value==1?'negative':'primary'" :label="props.value==0?'正常':'禁用'" />
</q-td>
</template>
<template v-slot:body-cell-CateId="props">
<q-td :props="props">
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="编辑"
@click="EditCategory(props.row)" />
<q-btn flat size="xs" icon="delete" color="negative" style="font-weight:400;" label="删除"
@click="deleteCategory(props.row)" />
</q-td>
</template>
<template v-slot:bottom>
<q-pagination class="full-width justify-end" v-model="msg.PageIndex" color="primary" :max="msg.PageCount"
:input="true" @input="changePage" />
</template>
</q-table>
<category-form v-if="isShowCategory" :save-obj="categoryObj" @close="closeCagegoryForm" @success="refreshPage">
</category-form>
</div>
</div>
</template>
<script>
import {
queryCourseCategoryPage
} from '../../api/course/index'
import categoryForm from '../../components/course/category-form'
export default {
meta: {
title: "课程系类"
},
components: {
categoryForm,
},
data() {
return {
msg:{
PageIndex:1,
PageSize:20,
PageCount:1
},
currentUrl: "",
data: [],
keyWords: '',
isShowCategory: false,
isShow: false,
categoryObj: {},
loading:true,
columns: [
{
name: 'CateName',
label: '系列名称',
field: 'CateName',
align: 'left'
},
{
name: 'CourseCount',
label: '关联课程',
align: 'left',
field: row => row.CourseCount,
format: (val, row) => `${val}个课程`
},
{
name: 'Status',
label: '状态',
align: 'left',
field: row => row.Status
},
{
name: 'UpdateByName',
label: '修改人',
align: 'left',
field: row => row.UpdateByName
},
{
name: 'UpdateTimeStr',
label: '修改时间',
align: 'left',
field: row => row.UpdateTimeStr
},
{
name: 'CateId',
label: '操作',
field: 'CateId'
}
],
}
},
mounted() {
this.currentUrl = this.$route.path
this.getcoursecategorytree()
},
methods: {
changePage(val) {
this.msg.PageIndex = val;
this.getcoursecategorytree()
},
//删除系列
deleteCategory(item) {
let delMsg = {
CateId: item.CateId,
};
this.$q.dialog({
title: '提示信息',
message: '是否确定删除该系列?',
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消",
}).onOk(() => {
deleteCourseCategory(delMsg).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '删除成功!',
position: 'top'
})
this.refreshPage();
}
})
}).onCancel(() => {
});
},
//搜索分类
myFilterMethod(node, filter) {
return node.CateName && node.CateName.indexOf(filter) > -1;
},
//重置搜索关键词
resetFilter() {
this.keyWords = ''
this.$refs.filter.focus()
},
//刷新页面
refreshPage() {
this.getcoursecategorytree();
},
//获取课程分类树形结构
getcoursecategorytree() {
this.isShow = false;
queryCourseCategoryPage({
PageSize:this.msg.PageSize,
PageIndex:this.msg.PageIndex
}).then(res => {
this.isShow = true;
this.loading=false;
this.data = res.Data.PageData;
this.msg.PageCount=res.Data.PageCount
})
},
//新增修改角色
EditCategory(obj) {
if (obj) {
this.categoryObj = obj
} else {
this.categoryObj = null
}
this.isShowCategory = true;
},
//关闭弹窗
closeCagegoryForm() {
this.isShowCategory = false
}
}
}
</script>
<style lang="sass">
@import url('~assets/css/table.sass')
</style>
<template>
<div class="page-body">
<div class="page-search row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-3">
<q-input ref="filter" filled v-model="keyWords" label="系列名称">
<template v-slot:append>
<q-icon v-if="keyWords !== ''" name="clear" class="cursor-pointer" @click="resetFilter" />
</template>
</q-input>
</div>
</div>
</div>
<div class="page-content">
<!--<div class="q-pa-md q-gutter-sm">
<q-tree v-if="isShow" :nodes="data" node-key="CateId" label-key="CateName" children-key="ChildList"
:filter="keyWords" :filter-method="myFilterMethod" default-expand-all no-results-label="暂无相关数据">
<template v-slot:default-header="prop">
<div class="row items-center">
<div class="text-weight-bold text-primary">{{ prop.node.CateName }}</div>
<template v-if="prop.node.ChildList && prop.node.ChildList.length>0">
&nbsp;
<q-btn round icon="add" size="xs" @click="EditCategory(null)" />
</template>
&nbsp;
<q-btn round icon="edit" size="xs" @click="EditCategory(prop.node)" />
</div>
</template>
</q-tree>
</div>-->
<q-table :loading="loading" no-data-label="暂无相关数据" flat class="sticky-column-table"
separator="none" :data="data" :columns="columns" row-key="name">
<template v-slot:top="props">
<div class="col-2 q-table__title">系列信息</div>
<q-space />
<div class="page-option">
<q-btn color="accent" size="sm" class="q-mr-md" icon="add" label="新增系列" @click="EditCategory(null)" />
</div>
</template>
<template v-slot:body-cell-Status="props">
<q-td :props="props">
<q-badge :color="props.value==1?'negative':'primary'" :label="props.value==0?'正常':'禁用'" />
</q-td>
</template>
<template v-slot:body-cell-CateId="props">
<q-td :props="props">
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="编辑"
@click="EditCategory(props.row)" />
<q-btn flat size="xs" icon="delete" color="negative" style="font-weight:400;" label="删除"
@click="deleteCategory(props.row)" />
</q-td>
</template>
<template v-slot:bottom>
<q-pagination class="full-width justify-end" v-model="msg.PageIndex" color="primary" :max="msg.PageCount"
:input="true" @input="changePage" />
</template>
</q-table>
<category-form v-if="isShowCategory" :save-obj="categoryObj" @close="closeCagegoryForm" @success="refreshPage">
</category-form>
</div>
</div>
</template>
<script>
import {
queryCourseCategoryPage
} from '../../api/course/index'
import categoryForm from '../../components/course/category-form'
export default {
meta: {
title: "课程系类"
},
components: {
categoryForm,
},
data() {
return {
msg:{
PageIndex:1,
PageSize:20,
PageCount:1
},
currentUrl: "",
data: [],
keyWords: '',
isShowCategory: false,
isShow: false,
categoryObj: {},
loading:true,
columns: [
{
name: 'CateName',
label: '系列名称',
field: 'CateName',
align: 'left'
},
{
name: 'CourseCount',
label: '关联课程',
align: 'left',
field: row => row.CourseCount,
format: (val, row) => `${val}个课程`
},
{
name: 'Status',
label: '状态',
align: 'left',
field: row => row.Status
},
{
name: 'UpdateByName',
label: '修改人',
align: 'left',
field: row => row.UpdateByName
},
{
name: 'UpdateTimeStr',
label: '修改时间',
align: 'left',
field: row => row.UpdateTimeStr
},
{
name: 'CateId',
label: '操作',
field: 'CateId'
}
],
}
},
mounted() {
this.currentUrl = this.$route.path
this.getcoursecategorytree()
},
methods: {
changePage(val) {
this.msg.PageIndex = val;
this.getcoursecategorytree()
},
//删除系列
deleteCategory(item) {
let delMsg = {
CateId: item.CateId,
};
this.$q.dialog({
title: '提示信息',
message: '是否确定删除该系列?',
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消",
}).onOk(() => {
deleteCourseCategory(delMsg).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '删除成功!',
position: 'top'
})
this.refreshPage();
}
})
}).onCancel(() => {
});
},
//搜索分类
myFilterMethod(node, filter) {
return node.CateName && node.CateName.indexOf(filter) > -1;
},
//重置搜索关键词
resetFilter() {
this.keyWords = ''
this.$refs.filter.focus()
},
//刷新页面
refreshPage() {
this.getcoursecategorytree();
},
//获取课程分类树形结构
getcoursecategorytree() {
this.isShow = false;
queryCourseCategoryPage({
PageSize:this.msg.PageSize,
PageIndex:this.msg.PageIndex
}).then(res => {
this.isShow = true;
this.loading=false;
this.data = res.Data.PageData;
this.msg.PageCount=res.Data.PageCount
})
},
//新增修改角色
EditCategory(obj) {
if (obj) {
this.categoryObj = obj
} else {
this.categoryObj = null
}
this.isShowCategory = true;
},
//关闭弹窗
closeCagegoryForm() {
this.isShowCategory = false
}
}
}
</script>
<style lang="sass">
@import url('~assets/css/table.sass')
</style>
<template>
<div class="page-body">
<!-- <div class="page-search row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-3">
<q-input ref="filter" filled v-model="keyWords" label="系列名称">
<template v-slot:append>
<q-icon v-if="keyWords !== ''" name="clear" class="cursor-pointer" @click="resetFilter" />
</template>
</q-input>
</div>
</div>
</div> -->
<div class="page-content">
<q-table :loading="loading" no-data-label="暂无相关数据" flat class="sticky-column-table"
separator="none" :data="data" :columns="columns" row-key="name">
<template v-slot:top="props">
<div class="col-2 q-table__title">供应商信息</div>
<q-space />
<div class="page-option">
<q-btn color="accent" size="sm" class="q-mr-md" icon="add" label="新增供应商" @click="EditCategory(null)" />
</div>
</template>
<!-- <template v-slot:bottom>
<q-pagination class="full-width justify-end" v-model="msg.PageIndex" color="primary" :max="msg.PageCount"
:input="true" @input="changePage" />
</template> -->
</q-table>
<supplier-form v-if="isShowCategory" :save-obj="categoryObj" @close="closeCagegoryForm" @success="refreshPage">
</supplier-form>
</div>
</div>
</template>
<script>
import {
queryCourseCategoryPage
} from '../../api/course/index'
import supplierForm from '../../components/studyAbroad/supplier-form'
export default {
meta: {
title: "供应商"
},
components: {
supplierForm,
},
data() {
return {
msg:{
Id:0,
Type:1, //供应商类型
Name:'' //供应商名称
},
data: [],
keyWords: '',
isShowCategory: false,
isShow: false,
categoryObj: {},
loading:true,
columns: [
{
name: 'Type',
label: '供应商类型',
field: 'Type',
align: 'left'
},
{
name: 'Name',
label: '供应商名称',
align: 'left',
field: 'Name'
},
{
name: 'CateId',
label: '操作',
field: 'CateId'
}
],
}
},
mounted() {
this.currentUrl = this.$route.path
this.getcoursecategorytree()
},
methods: {
changePage(val) {
this.msg.PageIndex = val;
this.getcoursecategorytree()
},
//刷新页面
refreshPage() {
this.getcoursecategorytree();
},
//获取课程分类树形结构
getcoursecategorytree() {
this.isShow = false;
queryCourseCategoryPage({
PageSize:this.msg.PageSize,
PageIndex:this.msg.PageIndex
}).then(res => {
this.isShow = true;
this.loading=false;
this.data = res.Data.PageData;
this.msg.PageCount=res.Data.PageCount
})
},
//新增修改角色
EditCategory(obj) {
if (obj) {
this.categoryObj = obj
} else {
this.categoryObj = null
}
this.isShowCategory = true;
},
//关闭弹窗
closeCagegoryForm() {
this.isShowCategory = false
}
}
}
</script>
<style lang="sass">
@import url('~assets/css/table.sass')
</style>
......@@ -507,6 +507,21 @@ const routes = [{
component: () =>
import("pages/course/jobinfo.vue")
},
{
path: "/studyAbroad/studyabroad", //留学
component: () =>
import("pages/studyAbroad/studyabroad.vue")
},
{
path: "/studyAbroad/employment", //就业
component: () =>
import("pages/studyAbroad/employment.vue")
},
{
path: "/studyAboard/supplier", //供应商
component: () =>
import("pages/studyAbroad/supplier.vue")
},
{
path: "/test", //API测试
component: () =>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment