lion 2 years ago
parent 75c3897ed5
commit e6dd3840ff

@ -0,0 +1,64 @@
import request from "@/utils/request";
function customParamsSerializer(params) {
let result = '';
for (let key in params) {
if (params.hasOwnProperty(key)) {
if (Array.isArray(params[key])) {
params[key].forEach((item,index) => {
if(item.key){
result += `${key}[${index}][key]=${item.key}&${key}[${index}][op]=${item.op}&${key}[${index}][value]=${item.value}&`;
}else{
result +=`${key}[${index}]=${item}&`
}
});
} else {
result += `${key}=${params[key]}&`;
}
}
}
return result.slice(0, -1);
}
export function index(params,isLoading = false) {
return request({
method: "get",
url: "/api/admin/course-types/index",
params,
paramsSerializer: customParamsSerializer,
isLoading
})
}
export function show(params, isLoading = true) {
return request({
method: "get",
url: "/api/admin/course-types/show",
params,
isLoading
})
}
export function save(data) {
return request({
method: "post",
url: "/api/admin/course-types/save",
data
})
}
export function destroy(params) {
return request({
method: "get",
url: "/api/admin/course-types/destroy",
params
})
}
export function contentImport(data) {
return request({
method: "post",
url: "/api/admin/course-types/import",
data
})
}

@ -1,6 +1,13 @@
export default {
data() {
return {
return {
types_status:[{
id: 0,
value: '禁用'
}, {
id: 1,
value: '启用'
}],
false_or_true: [{
id: 0,
value: '否'

@ -343,7 +343,8 @@
}
})
}
this.form.publicize_ids = pubFiles
this.form.publicize_ids = pubFiles
this.form.publicize = []
save({
...this.form
}).then(res => {

@ -0,0 +1,183 @@
<template>
<div>
<xy-dialog ref="dialog" :width="70" :is-show.sync="isShow" :type="'form'" :title="type === 'add' ? '新增课程' : '编辑课程'"
:form="form" :rules='rules' @submit="submit">
<template v-slot:name>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>课程类型
</div>
<div class="xy-table-item-content">
<el-input v-model="form.name" placeholder="请输入课程类型" clearable style="width: 100%;"></el-input>
</div>
</div>
</template>
<template v-slot:status>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>是否启用
</div>
<div class="xy-table-item-content">
<el-select v-model="form.status" placeholder="请选择状态" clearable style="width: 100%;">
<el-option v-for="item in types_status" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:wait_tip>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>待审核提示
</div>
<div class="xy-table-item-content">
<el-input style="width: 100%;" v-model="form.wait_tip" placeholder="请输入待审核提示" clearable></el-input>
</div>
</div>
</template>
<template v-slot:pass_tip>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>通过提示
</div>
<div class="xy-table-item-content">
<el-input style="width: 100%;" v-model="form.pass_tip" placeholder="请输入通过提示" clearable></el-input>
</div>
</div>
</template>
<template v-slot:fault_tip>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>不通过提示
</div>
<div class="xy-table-item-content">
<el-input style="width: 100%;" v-model="form.fault_tip" placeholder="请输入不通过提示" clearable></el-input>
</div>
</div>
</template>
<template v-slot:back_tip>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>备选提示
</div>
<div class="xy-table-item-content">
<el-input style="width: 100%;" v-model="form.back_tip" placeholder="请输入备选提示" clearable></el-input>
</div>
</div>
</template>
<template v-slot:year_total>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>年预约次数
</div>
<div class="xy-table-item-content">
<el-input style="width: 100%;" v-model="form.year_total" placeholder="请输入年预约次数" clearable></el-input>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import myMixins from "@/mixin/selectMixin.js";
import {
show,
save
} from "@/api/course/courseType.js"
export default {
mixins: [myMixins],
components: {
},
data() {
return {
isShow: false,
type: 'add',
id: '',
form: {
name:'',
status:'',
wait_tip:"",
pass_tip:"",
fault_tip:'',
back_tip:"",
year_total:""
},
rules: {
name: [{
required: true,
message: '请输入类型'
}],
},
}
},
created() {},
methods: {
submit() {
if (this.id) {
this.form.id = this.id
}
save({
...this.form
}).then(res => {
this.$message({
type: 'success',
message: '保存课程成功'
})
this.id = res.id
this.$emit('refresh')
// this.active = 1
})
},
getDetail() {
show({
id: this.id
}).then(res => {
this.form = this.base.requestToForm(res, this.form)
})
},
},
watch: {
isShow(newVal) {
if (newVal) {
if (this.type === 'editor') {
this.getDetail()
}
} else {
this.id = ''
this.$refs['dialog'].reset()
}
},
}
}
</script>
<style scoped lang="scss">
::v-deep .content,
::v-deep .step,
::v-deep .applylabel,
::v-deep .image_id,
::v-deep .publicize_ids {
flex-basis: 100%;
}
::v-deep .status,
::v-deep .is_arrange,
::v-deep .is_fee,
{
flex-basis: 33%;
}
::v-deep .el-step.is-simple .el-step__head {
display: flex
}
</style>

@ -160,14 +160,13 @@
this.$refs.showCourse.type = type
this.$refs.showCourse.isShow = true
},
goTxl() {
goTxl(row) {
let value = ''
this.course_type.map(item=>{
if(item.id==row.type){
value = item.value
}
})
this.$router.push({
path: '/course/txl',
query: { title: row.name, id:row.id, date: row.start_date+'至'+row.end_date,leibie:value }

@ -59,7 +59,7 @@
<template v-slot:btns>
<el-table-column align='center' fixed="right" label="操作" width="80" header-align="center">
<template slot-scope="scope">
<el-button type="primary" size="small" @click="showDetail('show')"></el-button>
<el-button type="primary" size="small" @click="showDetail('show',scope.row.id)"></el-button>
</template>
</el-table-column>
</template>
@ -103,13 +103,23 @@
list: [],
total: 0,
table_item: [{
prop: 'name',
prop: 'username',
label: '姓名',
align: 'center',
width: 120
}, {
prop: 'sex',
label: '性别',
align: 'center',
width: 120
},{
prop: 'idcard',
label: '身份证号',
align: 'center',
width: 180
},{
prop: 'company_name',
label: '公司',
label: '公司名称',
align: 'left',
}, {
prop: 'company_position',
@ -121,32 +131,7 @@
label: '联系电话',
align: 'center',
width: 120,
}, {
prop: 'company_type',
label: '企业性质',
align: 'center',
width: 180,
}, {
prop: 'company_industry',
label: '所属行业',
align: 'center',
width: 120,
}, {
prop: 'company_area',
label: '所属区域',
align: 'center',
width: 120,
}, {
prop: 'date',
label: '报名时间',
align: 'center',
width: 180,
}, {
prop: 'status',
label: '审核状态',
align: 'center',
width: 180,
}]
},]
}
},
mounted() {
@ -198,7 +183,7 @@
value: this.select.company_industry
}]
})
this.list = res.data
this.list = res.list.data
this.total = res.total
},
showDetail(type, id) {

@ -0,0 +1,144 @@
<template>
<div>
<div>
<div ref="lxHeader">
<lx-header icon="md-apps" :text="$route.meta.title" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<div slot="content">
<div class="searchwrap" style="display: flex;align-items: center;">
<el-button type="primary" size="small" @click="editTypes('add')"></el-button>
</div>
</div>
</lx-header>
</div>
</div>
<div>
<xy-table :list="list" :total="total" @pageIndexChange="pageIndexChange" @pageSizeChange="pageSizeChange"
:table-item="table_item">
<template v-slot:status>
<el-table-column align='center' label="状态" width="120" header-align="center">
<template slot-scope="scope">
<div v-for="item in types_status">
<el-tag :type="item.type" v-if="scope.row.status===item.id">{{item.value}}</el-tag>
</div>
</template>
</el-table-column>
</template>
<template v-slot:btns>
<el-table-column align='left' label="操作" width="180" header-align="center">
<template slot-scope="scope">
<el-button type="primary" size="small"
@click="editTypes('editor',scope.row.id)">编辑</el-button>
<el-popconfirm style="margin:0 10px" @confirm="deleteList(scope.row.id)" title="确定删除吗?">
<el-button type="danger" size="small" slot="reference">删除</el-button>
</el-popconfirm>
<!-- <el-button type="primary" size="small" @click="goAttendance"></el-button>
<el-button type="primary" size="small" @click="setMain(scope.row.id)"></el-button> -->
</template>
</el-table-column>
</template>
</xy-table>
</div>
<add-types ref="addTypes" @refresh="getList"></add-types>
</div>
</template>
<script>
import addTypes from './components/addTypes.vue';
import myMixins from "@/mixin/selectMixin.js";
import {
index,
destroy
} from "@/api/course/courseType.js"
export default {
mixins: [myMixins],
components: {
addTypes
},
data() {
return {
select: {
page: 1,
page_size: 10,
},
list: [],
total: 0,
table_item: [{
prop: 'name',
label: '类型名称',
align: 'left'
}, {
prop: 'status',
label: '状态',
align: 'center',
width: 120,
}]
}
},
created() {
this.getList()
},
methods: {
pageIndexChange(e) {
this.select.page = e
this.getList()
},
pageSizeChange(e) {
this.select.page_size = e
this.select.page = 1
this.getList()
},
async getList() {
const res = await index({
page: this.select.page,
page_size: this.select.page_size
})
this.list = res.data
this.total = res.total
},
editTypes(type, id) {
this.$refs.addTypes.type = type
if (id) {
this.$refs.addTypes.id = id
}
this.$refs.addTypes.isShow = true
},
deleteList(id) {
var that = this;
destroy({
id: id,
}).then(response => {
this.$Message.success('删除成功');
this.getList()
}).catch(error => {
console.log(error)
reject(error)
})
},
}
}
</script>
<style lang="scss" scoped>
.searchwrap {
display: flex;
align-items: center;
&>div {
display: flex;
align-items: center;
margin-right: 10px;
span {
min-width: 70px;
}
}
}
</style>

@ -101,20 +101,22 @@
</el-descriptions>
</div>
<lx-header icon="" text="审核" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<!-- <lx-header icon="" text="审核" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
</lx-header>
<div v-if="type=='show'">
<div class="studentInfo">
<div>
<span>审核结果</span>
<span>未通过</span>
<span></span>
</div>
<div>
<span>不通过原因</span>
<span>1111</span>
<span></span>
</div>
</div>
</div>
</div> -->
</div>
</div>
</div>

Loading…
Cancel
Save