lion 1 year ago
parent 480a4c3c77
commit 549d2a10e3

@ -55,5 +55,14 @@ export function destroy(params) {
})
}
export function update(data) {
return request({
method: "post",
url: "/api/admin/course-appointment-total/batch-update-total",
data
})
}

@ -220,11 +220,20 @@
this.form.date = ''
this.form.timeRange = ''
}
},
compareTime(startTime) {
let date1 = this.$moment()
let sign1 = this.$moment(startTime)
return sign1.isBefore(date1)
},
submit(status) {
this.form.status = 1
console.log(this.form)
console.log(this.form)
if(this.compareTime(this.form.start_time)){
this.$Message.warning('预约开始时间不能早于当前时间')
return
}
if (this.type === 'add') {
if (this.base.isNull(this.form.user_id) && this.base.isNull(this.form.name)) {
this.$Message.warning('请选择学员或输入预约人姓名')

@ -8,7 +8,7 @@
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>所属课程
</div>
<div class="xy-table-item-content">
{{form.course_id}}
{{form.course?form.course.name:''}}
</div>
</div>
</template>
@ -18,7 +18,7 @@
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>姓名
</div>
<div class="xy-table-item-content">
{{form.user_id}}
{{form.user?form.user.name:''}}
</div>
</div>
</template>
@ -114,7 +114,14 @@
isShow(newVal) {
if (newVal) {
} else {
} else {
this.form={
course_id:'',
user_id:"",
total: '',
start_time: '',
end_time: '',
}
this.$refs['dialog'].reset()
}
},

@ -0,0 +1,100 @@
<template>
<div>
<xy-dialog ref="dialog" :width="40" :is-show.sync="isShow" :type="'form'" title="预约次数调整" :form="form" :rules='rules'
@submit="submit">
<template v-slot:course_id>
<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 style="width:100%" clearable v-model="form.course_id" placeholder="请选择课程">
<el-option v-for="item in course_options" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot: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 type="number" style="width:100%" v-model="form.total"></el-input>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
update
} from '@/api/book/count.js'
export default {
components: {
},
data() {
return {
isShow: false,
form: {
course_id: '',
total: ''
},
course_options: [],
rules: {
course_id: [{
required: true,
message: '请选择课程'
}],
total: [{
required: true,
message: '请填可预约次数'
}]
}
}
},
created() {},
methods: {
submit() {
update({
...this.form
}).then(res => {
this.$message({
type: 'success',
message: '调整成功'
})
this.isShow = false
this.$emit('refresh')
})
},
setRow(row) {
this.course_options = row
}
},
watch: {
isShow(newVal) {
if (newVal) {
} else {
this.$refs['dialog'].reset()
}
},
}
}
</script>
<style scoped lang="scss">
::v-deep .course_id,
::v-deep .total {
flex-basis: 100%;
}
</style>

@ -24,7 +24,7 @@
<div>
<el-button type="primary" size="small" @click="select.page=1,getList()"></el-button>
<el-button type="primary" size="small" @click="resetSelect"></el-button>
<el-button type="primary" size="small" @click="updateTotal"></el-button>
</div>
</div>
@ -35,24 +35,24 @@
<div>
<xy-table :list="list" @pageIndexChange="pageIndexChange" @pageSizeChange="pageSizeChange" :total="total"
:table-item="table_item">
<template v-slot:start_time>
<el-table-column align='center' label="开始日期" header-align="center" width="120">
<template slot-scope="scope">
<div v-if="scope.row.start_time">
{{scope.row.start_time.substring(0,10)}}
</div>
</template>
</el-table-column>
</template>
<template v-slot:end_time>
<el-table-column align='center' label="结束日期" header-align="center" width="120">
<template slot-scope="scope">
<div v-if="scope.row.end_time">
{{scope.row.end_time.substring(0,10)}}
</div>
</template>
</el-table-column>
:table-item="table_item">
<template v-slot:start_time>
<el-table-column align='center' label="开始日期" header-align="center" width="120">
<template slot-scope="scope">
<div v-if="scope.row.start_time">
{{scope.row.start_time.substring(0,10)}}
</div>
</template>
</el-table-column>
</template>
<template v-slot:end_time>
<el-table-column align='center' label="结束日期" header-align="center" width="120">
<template slot-scope="scope">
<div v-if="scope.row.end_time">
{{scope.row.end_time.substring(0,10)}}
</div>
</template>
</el-table-column>
</template>
<!-- <template v-slot:appointments_count>
<el-table-column align='center' label="已预约次数" header-align="center" width="120">
@ -92,6 +92,8 @@
</xy-table>
</div>
<addCount ref="addCount" @refresh="getList"></addCount>
<updateCount ref="updateCount" @refresh="getList"></updateCount>
<showCount ref="showCount"></showCount>
</div>
</template>
@ -99,8 +101,10 @@
<script>
import addCount from './components/addCount.vue';
import showCount from './components/showCount.vue';
import updateCount from './components/updateCount.vue';
import {
index
index,
update
} from '@/api/book/count.js'
import {
index as courseIndex
@ -108,7 +112,8 @@
export default {
components: {
addCount,
showCount
showCount,
updateCount
},
data() {
return {
@ -142,12 +147,12 @@
label: '开始日期',
align: 'center',
width: 120,
},
{
prop: 'end_time',
label: '结束日期',
align: 'center',
width: 120
},
{
prop: 'end_time',
label: '结束日期',
align: 'center',
width: 120
},
// {
// prop: 'appointments_count',
@ -196,14 +201,14 @@
async getList() {
const res = await index({
page: this.select.page,
page_size: this.select.page_size,
filter:[{
key:'course_id',
op:'eq',
value:this.select.course_id
page_size: this.select.page_size,
filter: [{
key: 'course_id',
op: 'eq',
value: this.select.course_id
}],
name: this.select.name,
show_relation:['user','course']
name: this.select.name,
show_relation: ['user', 'course']
})
this.list = res.data
this.total = res.total
@ -212,6 +217,10 @@
this.$refs.addCount.setRow(row)
this.$refs.addCount.isShow = true
},
updateTotal() {
this.$refs.updateCount.setRow(this.course_options)
this.$refs.updateCount.isShow = true
},
showCounts(name) {
this.$refs.showCount.setName(name)
this.$refs.showCount.isShow = true

@ -53,7 +53,8 @@
default: () => [],
},
tableName: String,
course_id: String,
course_id: String,
status: String
},
data() {
@ -245,7 +246,8 @@
url: this.import_action,
data: {
table_name: this.tableName,
course_id: this.course_id ? this.course_id : '',
course_id: this.course_id ? this.course_id : '',
status:this.status===0?0:this.status,
data: this.tableList
}
}).then(res => {

@ -70,6 +70,8 @@
<div>
<el-button type="primary" size="small" @click="select.page=1,getList()"></el-button>
<el-button type="primary" size="small" @click="resetSelect"></el-button>
<el-button type="primary" size="small" @click="importTable"></el-button>
<el-button style="margin-right:10px" type="primary" size="small" @click="exportExcel"></el-button>
<el-popconfirm @confirm="updateAllStatus" title="确定要批量审核吗?">
<el-button type="primary" size="small" slot="reference">批量审核</el-button>
@ -91,13 +93,13 @@
</div>
<xy-table :list="list" :total="total" :showIndex="false" @pageIndexChange="pageIndexChange"
@pageSizeChange="pageSizeChange" :table-item="table_item" @selection-change="selectionChange">
<template v-slot:index>
<el-table-column align='center' fixed="left" label="" width="50" header-align="center">
<template slot-scope="scope">
{{getIndex(scope.$index)}}
</template>
</el-table-column>
</template>
<template v-slot:index>
<el-table-column align='center' fixed="left" label="" width="50" header-align="center">
<template slot-scope="scope">
{{getIndex(scope.$index)}}
</template>
</el-table-column>
</template>
<template v-slot:status>
<el-table-column align='center' label="状态" width="120" header-align="center">
<template slot-scope="scope">
@ -122,6 +124,8 @@
</div>
<student-detail ref="studentDetail" @refresh="getList"></student-detail>
<imports ref="imports" :course_id="subjectObj.id" :status="0" :table-name="'course_signs'" @refresh="getList"></imports>
</div>
</template>
@ -129,6 +133,7 @@
import studentDetail from '@/views/student/components/detail.vue';
import myMixins from "@/mixin/selectMixin.js";
import formMixin from "@/mixin/formMixin.js";
import imports from "@/views/component/imports.vue"
import {
index,
updateStatus
@ -140,14 +145,14 @@
export default {
mixins: [myMixins, formMixin],
components: {
studentDetail
studentDetail,
imports
},
data() {
return {
subjectObj: {},
select: {
name: '',
course_id: '',
mobile: '',
course_id: '',
company_name: '',
@ -262,11 +267,11 @@
this.select.page_size = e
this.select.page = 1
this.getList()
},
getIndex(e){
let perSize = (this.select.page -1 ) * this.select.page_size
let index = perSize + e + 1
return index
},
getIndex(e) {
let perSize = (this.select.page - 1) * this.select.page_size
let index = perSize + e + 1
return index
},
resetSelect() {
this.select.name = ''
@ -320,10 +325,10 @@
this.selectids = []
}
},
updateAllStatus(status) {
if(this.base.isNull(this.subjectObj.date)){
this.$message.warning("请先设置该课程的开课日期后再进行审核")
return
updateAllStatus(status) {
if (this.base.isNull(this.subjectObj.date)) {
this.$message.warning("请先设置该课程的开课日期后再进行审核")
return
}
if (this.selectids.length < 1) {
this.$message.warning("请先选择要审核的学员")
@ -339,10 +344,10 @@
this.getList()
})
},
showDetail(type, row) {
if(this.base.isNull(this.subjectObj.date)){
this.$message.warning("请先设置该课程的开课日期后再进行审核")
return
showDetail(type, row) {
if (this.base.isNull(this.subjectObj.date)) {
this.$message.warning("请先设置该课程的开课日期后再进行审核")
return
}
this.$refs.studentDetail.subjectObj = this.subjectObj
this.$refs.studentDetail.id = row.id
@ -350,7 +355,9 @@
this.$refs.studentDetail.type = type
this.$refs.studentDetail.isShow = true
},
importTable(row) {
this.$refs.imports.show()
},
exportExcel() {
let _export = {}
this.table_item.map(item => {

@ -113,7 +113,7 @@
<student-detail ref="studentDetail" @refresh="getList"></student-detail>
<editSign ref="editSign" @refresh="getList"></editSign>
<imports ref="imports" :course_id="subjectObj.id" :table-name="'course_signs'" @refresh="getList"></imports>
<imports ref="imports" :course_id="subjectObj.id" :status="1" :table-name="'course_signs'" @refresh="getList"></imports>
</div>
</template>
@ -311,16 +311,7 @@
this.$refs.studentDetail.isShow = true
},
importTable(row) {
// this.$refs.imports.tableData = {
// 'data[course_id]': row.course_id,
// 'data[course_content_id]': row.id
// }
// this.$refs.imports.tableData = {
// 'data[course_id]': this.subjectObj.id
// }
this.$refs.imports.show()
// {"course_id":15,"course_content_id":188}
},
//
async getAutoForm(){

Loading…
Cancel
Save