Commit c829d453 authored by zhengke's avatar zhengke

修改

parent c0b47847
...@@ -2,36 +2,39 @@ ...@@ -2,36 +2,39 @@
<q-dialog v-model="persistent" content-class="bg-grey-1" persistent transition-show="scale" transition-hide="scale"> <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 style="width: 800px;max-width:900px;">
<q-card-section> <q-card-section>
<div class="text-h6">{{objOption.CateId==0?'新增留学':'修改留学'}}</div> <div class="text-h6">{{objOption.Id==0?'新增留学':'修改留学'}}</div>
</q-card-section> </q-card-section>
<q-card-section class="q-pt-none scroll" style="max-height: 70vh"> <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="text-caption q-mb-lg q-px-md text-grey-6">留学信息</div>
<div class="row wrap"> <div class="row wrap">
<q-input filled stack-label maxlength="30" :dense="false" v-model="objOption.CateName" ref="CateName" <q-input filled stack-label maxlength="30" :dense="false" v-model="objOption.Name" ref="Name"
class="col-6 q-pr-lg q-pb-lg" label="项目名称" :rules="[val => !!val || '项目名称']" /> 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" <q-select filled stack-label option-value="Id" option-label="Name" v-model="objOption.SupplierId"
class="col-6 q-pr-lg q-pb-lg" label="排序" @keyup.native="checkInteger(objOption,'SortNum')" /> ref="Type" :options="supplierList" label="供应编号" :dense="false" class="col-6 q-pb-lg q-pr-lg" emit-value
<div class="col-12 q-pr-lg q-pb-lg q-pt-lg"> map-options />
<q-toggle size="md" label="状态" color="primary" :false-value="1" :true-value="0" v-model="objOption.Status"
title="注意:关闭后,分类将无法正常使用." />
</div>
</div> </div>
<div class="row wrap">
<q-input filled stack-label maxlength="30" :dense="false" v-model="objOption.SupplierContract" ref="SupplierContract"
class="col-6 q-pr-lg q-pb-lg" label="供应商合同" :rules="[val => !!val || '供应商合同']" />
<q-input filled stack-label maxlength="30" :dense="false" v-model="objOption.CommissionProfits" ref="SupplierContract"
class="col-6 q-pr-lg q-pb-lg" label="佣金利润说明" :rules="[val => !!val || '佣金利润说明']" />
</div>
</q-card-section> </q-card-section>
<q-separator /> <q-separator />
<q-card-actions align="right" class="bg-white"> <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="取消" 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" <q-btn label="立即提交" color="accent q-px-md" style="font-weight:400 !important" :loading="saveLoading"
@click="saveCategory" /> @click="saveStudyInfo" />
</q-card-actions> </q-card-actions>
</q-card> </q-card>
</q-dialog> </q-dialog>
</template> </template>
<script> <script>
import { import {
queryCourseCategoryTree, saveStudyAbroad,
queryCourseCategoryInfo, queryStudyAbroadInfo
saveCourseCategoryInfo } from '../../api/studyabroad/index'
} from '../../api/course/index'
export default { export default {
props: { props: {
saveObj: { saveObj: {
...@@ -41,64 +44,39 @@ ...@@ -41,64 +44,39 @@
}, },
data() { data() {
return { return {
isShow: false,
persistent: true, persistent: true,
objOption: { objOption: {
programName:'', //项目名称 Id:0,
supplier:'', //供应商 Type:1, //1留学 2就业
saleprice:'', //卖价 Name:'', //项目名称
profits:'', //佣金/利润 SupplierId:0, //供应商编号
costof:'', //直接成本 SupplierContract:'', //供应商合同
commission:'', //同行返佣 CommissionProfits:'', //佣金利润说明
salecommission:'', //销售提成 SellPrice:'', //卖价
offer:'', //报价 CostPrice:'', //直接成本价
CostInfo:'', //成本价包含内容
B2BCommission:'', //同行返佣
B2BCommissionType:0, //同行返佣类型
B2BCommissionType:'', //销售返佣
SaleCommissionType:0, //销售返佣类型
OfferPrice:'', //校企报价
OfferCommissionType:0, //校企报价返佣类型
OfferCommission:'', //校企返佣金额
Remark:'', //备注
SaleState:0 //销售状态(0-待完善,1-上架审核中,2-上架)
}, },
optionTitle: "", optionTitle: "",
//树形课程分类列表
TreeCategoryList: [],
saveLoading: false, saveLoading: false,
chooseCategroyArray: [], supplierList:[], //供应商下拉数据
} }
}, },
mounted() { mounted() {
this.getCategoryTreeList();
this.initObj() this.initObj()
}, },
methods: { methods: {
//获取树形课程分类列表
getCategoryTreeList() {
this.TreeCategoryList = [];
var qMsg = {}
queryCourseCategoryTree(qMsg).then(res => {
this.TreeCategoryList = res.Data;
this.isShow = true;
})
},
//初始化表单 //初始化表单
initObj() { 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() { closeSaveForm() {
...@@ -106,38 +84,8 @@ ...@@ -106,38 +84,8 @@
this.persistent = false this.persistent = false
}, },
//保存菜单 //保存菜单
saveCategory() { saveStudyInfo() {
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;
}
} }
} }
} }
......
<template> <template>
<div class="page-body"> <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="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" <q-table :loading="loading" no-data-label="暂无相关数据" flat class="sticky-column-table"
separator="none" :data="data" :columns="columns" row-key="name"> separator="none" :data="dataList" :columns="columns" row-key="name">
<template v-slot:top="props"> <template v-slot:top="props">
<div class="col-2 q-table__title">系列信息</div> <div class="col-2 q-table__title">留学信息</div>
<q-space /> <q-space />
<div class="page-option"> <div class="page-option">
<q-btn color="accent" size="sm" class="q-mr-md" icon="add" label="新增系列" @click="EditCategory(null)" /> <q-btn color="accent" size="sm" class="q-mr-md" icon="add" label="新增留学" @click="EditStudy(null)" />
</div> </div>
</template> </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> <template v-slot:bottom>
<q-pagination class="full-width justify-end" v-model="msg.PageIndex" color="primary" :max="msg.PageCount" <q-pagination class="full-width justify-end" v-model="msg.PageIndex" color="primary" :max="PageCount"
:input="true" @input="changePage" /> :input="true" @input="changePage" />
</template> </template>
</q-table> </q-table>
<category-form v-if="isShowCategory" :save-obj="categoryObj" @close="closeCagegoryForm" @success="refreshPage"> <studyAbroad-form v-if="isShowStudy" :save-obj="studyObj" @close="closeStudyForm" @success="refreshPage">
</category-form> </studyAbroad-form>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { import {
queryCourseCategoryPage queryStudyAbroadPage
} from '../../api/course/index' } from '../../api/studyabroad/index'
import categoryForm from '../../components/course/category-form' import studyAbroadForm from '../../components/studyAbroad/studyAbroad-form'
export default { export default {
meta: { meta: {
title: "课程系类" title: "留学"
}, },
components: { components: {
categoryForm, studyAbroadForm,
}, },
data() { data() {
return { return {
msg:{ msg:{
PageIndex:1, Type:1, //1留学 2就业
PageSize:20, pageIndex: 1,
PageCount:1 pageSize: 12
}, },
currentUrl: "", dataList: [],
data: [],
keyWords: '',
isShowCategory: false,
isShow: false,
categoryObj: {},
loading:true, loading:true,
columns: [ columns: [
{ {
name: 'CateName', name: 'Name',
label: '系列名称', label: '项目名称',
field: 'CateName', field: 'Name',
align: 'left'
},
{
name: 'SupplierId',
label: '供应编号',
field: 'SupplierId',
align: 'left'
},
{
name: 'SupplierContract',
label: '供应商合同',
field: 'SupplierContract',
align: 'left'
},
{
name: 'CommissionProfits',
label: '佣金利润说明',
field: 'CommissionProfits',
align: 'left'
},
{
name: 'SellPrice',
label: '卖价',
field: 'SellPrice',
align: 'left'
},
{
name: 'CostPrice',
label: '直接成本价',
field: 'CostPrice',
align: 'left'
},
{
name: 'CostInfo',
label: '成本价包含内容',
field: 'CostInfo',
align: 'left'
},
{
name: 'B2BCommission',
label: '同行返佣',
field: 'B2BCommission',
align: 'left' align: 'left'
}, },
{ {
name: 'CourseCount', name: 'B2BCommissionType',
label: '关联课程', label: '同行返佣类型',
align: 'left', field: 'B2BCommissionType',
field: row => row.CourseCount, align: 'left'
format: (val, row) => `${val}个课程`
}, },
{ {
name: 'Status', name: 'SaleCommission',
label: '状态', label: '销售返佣',
align: 'left', field: 'SaleCommission',
field: row => row.Status align: 'left'
}, },
{ {
name: 'UpdateByName', name: 'SaleCommissionType',
label: '修改人', label: '销售返佣类型',
align: 'left', field: 'SaleCommissionType',
field: row => row.UpdateByName align: 'left'
}, },
{ {
name: 'UpdateTimeStr', name: 'OfferPrice',
label: '修改时间', label: '校企报价',
align: 'left', field: 'OfferPrice',
field: row => row.UpdateTimeStr align: 'left'
},
{
name: 'OfferCommissionType',
label: '校企报价返佣类型',
field: 'OfferCommissionType',
align: 'left'
},
{
name: 'OfferCommission',
label: '校企返佣金额',
field: 'OfferCommission',
align: 'left'
},
{
name: 'Remark',
label: '备注',
field: 'Remark',
align: 'left'
},
{
name: 'SaleState',
label: '销售状态',
field: 'SaleState',
align: 'left'
}, },
{ {
name: 'CateId', name: 'CateId',
...@@ -127,85 +146,48 @@ ...@@ -127,85 +146,48 @@
field: 'CateId' field: 'CateId'
} }
], ],
PageCount:0,
isShowStudy:false,
studyObj:{}
} }
}, },
mounted() { mounted() {
this.currentUrl = this.$route.path this.getList();
this.getcoursecategorytree() },
created() {
}, },
methods: { methods: {
changePage(val) { getList() {
this.msg.PageIndex = val; this.loading = true;
this.getcoursecategorytree() queryStudyAbroadPage(this.msg).then(res => {
}, this.loading = false;
//删除系列 console.log(res,'数据来了');
deleteCategory(item) { this.dataList = res.Data.PageData;
let delMsg = { this.pageCount = res.Data.PageCount;
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(() => { .catch(() => {
this.loading = false;
}); });
},
//搜索分类
myFilterMethod(node, filter) {
return node.CateName && node.CateName.indexOf(filter) > -1;
}, },
//重置搜索关键词 changePage(val){
resetFilter() { this.msg.pageIndex=val;
this.keyWords = '' this.getList();
this.$refs.filter.focus()
}, },
//刷新页面 //关闭弹窗
refreshPage() { closeStudyForm() {
this.getcoursecategorytree(); this.isShowStudy = false
}, },
//获取课程分类树形结构 refreshPage(){
getcoursecategorytree() { this.getList();
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) { EditStudy(obj){
if (obj) { if (obj) {
this.categoryObj = obj this.studyObj = obj;
} else { } else {
this.categoryObj = null this.studyObj = null;
} }
this.isShowCategory = true; this.isShowStudy=true;
},
//关闭弹窗
closeCagegoryForm() {
this.isShowCategory = false
} }
} }
} }
......
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