lion 2 years 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
})
}

@ -221,10 +221,19 @@
this.form.timeRange = '' this.form.timeRange = ''
} }
}, },
compareTime(startTime) {
let date1 = this.$moment()
let sign1 = this.$moment(startTime)
return sign1.isBefore(date1)
},
submit(status) { submit(status) {
this.form.status = 1 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.type === 'add') {
if (this.base.isNull(this.form.user_id) && this.base.isNull(this.form.name)) { if (this.base.isNull(this.form.user_id) && this.base.isNull(this.form.name)) {
this.$Message.warning('请选择学员或输入预约人姓名') this.$Message.warning('请选择学员或输入预约人姓名')

@ -8,7 +8,7 @@
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>所属课程 <span style="color: red;font-weight: bold;padding-right: 4px;"></span>所属课程
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
{{form.course_id}} {{form.course?form.course.name:''}}
</div> </div>
</div> </div>
</template> </template>
@ -18,7 +18,7 @@
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>姓名 <span style="color: red;font-weight: bold;padding-right: 4px;"></span>姓名
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
{{form.user_id}} {{form.user?form.user.name:''}}
</div> </div>
</div> </div>
</template> </template>
@ -115,6 +115,13 @@
if (newVal) { if (newVal) {
} else { } else {
this.form={
course_id:'',
user_id:"",
total: '',
start_time: '',
end_time: '',
}
this.$refs['dialog'].reset() 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> <div>
<el-button type="primary" size="small" @click="select.page=1,getList()"></el-button> <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="resetSelect"></el-button>
<el-button type="primary" size="small" @click="updateTotal"></el-button>
</div> </div>
</div> </div>
@ -92,6 +92,8 @@
</xy-table> </xy-table>
</div> </div>
<addCount ref="addCount" @refresh="getList"></addCount> <addCount ref="addCount" @refresh="getList"></addCount>
<updateCount ref="updateCount" @refresh="getList"></updateCount>
<showCount ref="showCount"></showCount> <showCount ref="showCount"></showCount>
</div> </div>
</template> </template>
@ -99,8 +101,10 @@
<script> <script>
import addCount from './components/addCount.vue'; import addCount from './components/addCount.vue';
import showCount from './components/showCount.vue'; import showCount from './components/showCount.vue';
import updateCount from './components/updateCount.vue';
import { import {
index index,
update
} from '@/api/book/count.js' } from '@/api/book/count.js'
import { import {
index as courseIndex index as courseIndex
@ -108,7 +112,8 @@
export default { export default {
components: { components: {
addCount, addCount,
showCount showCount,
updateCount
}, },
data() { data() {
return { return {
@ -197,13 +202,13 @@
const res = await index({ const res = await index({
page: this.select.page, page: this.select.page,
page_size: this.select.page_size, page_size: this.select.page_size,
filter:[{ filter: [{
key:'course_id', key: 'course_id',
op:'eq', op: 'eq',
value:this.select.course_id value: this.select.course_id
}], }],
name: this.select.name, name: this.select.name,
show_relation:['user','course'] show_relation: ['user', 'course']
}) })
this.list = res.data this.list = res.data
this.total = res.total this.total = res.total
@ -212,6 +217,10 @@
this.$refs.addCount.setRow(row) this.$refs.addCount.setRow(row)
this.$refs.addCount.isShow = true this.$refs.addCount.isShow = true
}, },
updateTotal() {
this.$refs.updateCount.setRow(this.course_options)
this.$refs.updateCount.isShow = true
},
showCounts(name) { showCounts(name) {
this.$refs.showCount.setName(name) this.$refs.showCount.setName(name)
this.$refs.showCount.isShow = true this.$refs.showCount.isShow = true

@ -54,6 +54,7 @@
}, },
tableName: String, tableName: String,
course_id: String, course_id: String,
status: String
}, },
data() { data() {
@ -246,6 +247,7 @@
data: { data: {
table_name: this.tableName, 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 data: this.tableList
} }
}).then(res => { }).then(res => {

@ -70,6 +70,8 @@
<div> <div>
<el-button type="primary" size="small" @click="select.page=1,getList()"></el-button> <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="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-button style="margin-right:10px" type="primary" size="small" @click="exportExcel"></el-button>
<el-popconfirm @confirm="updateAllStatus" title="确定要批量审核吗?"> <el-popconfirm @confirm="updateAllStatus" title="确定要批量审核吗?">
<el-button type="primary" size="small" slot="reference">批量审核</el-button> <el-button type="primary" size="small" slot="reference">批量审核</el-button>
@ -122,6 +124,8 @@
</div> </div>
<student-detail ref="studentDetail" @refresh="getList"></student-detail> <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> </div>
</template> </template>
@ -129,6 +133,7 @@
import studentDetail from '@/views/student/components/detail.vue'; import studentDetail from '@/views/student/components/detail.vue';
import myMixins from "@/mixin/selectMixin.js"; import myMixins from "@/mixin/selectMixin.js";
import formMixin from "@/mixin/formMixin.js"; import formMixin from "@/mixin/formMixin.js";
import imports from "@/views/component/imports.vue"
import { import {
index, index,
updateStatus updateStatus
@ -140,14 +145,14 @@
export default { export default {
mixins: [myMixins, formMixin], mixins: [myMixins, formMixin],
components: { components: {
studentDetail studentDetail,
imports
}, },
data() { data() {
return { return {
subjectObj: {}, subjectObj: {},
select: { select: {
name: '', name: '',
course_id: '',
mobile: '', mobile: '',
course_id: '', course_id: '',
company_name: '', company_name: '',
@ -263,8 +268,8 @@
this.select.page = 1 this.select.page = 1
this.getList() this.getList()
}, },
getIndex(e){ getIndex(e) {
let perSize = (this.select.page -1 ) * this.select.page_size let perSize = (this.select.page - 1) * this.select.page_size
let index = perSize + e + 1 let index = perSize + e + 1
return index return index
}, },
@ -321,7 +326,7 @@
} }
}, },
updateAllStatus(status) { updateAllStatus(status) {
if(this.base.isNull(this.subjectObj.date)){ if (this.base.isNull(this.subjectObj.date)) {
this.$message.warning("请先设置该课程的开课日期后再进行审核") this.$message.warning("请先设置该课程的开课日期后再进行审核")
return return
} }
@ -340,7 +345,7 @@
}) })
}, },
showDetail(type, row) { showDetail(type, row) {
if(this.base.isNull(this.subjectObj.date)){ if (this.base.isNull(this.subjectObj.date)) {
this.$message.warning("请先设置该课程的开课日期后再进行审核") this.$message.warning("请先设置该课程的开课日期后再进行审核")
return return
} }
@ -350,7 +355,9 @@
this.$refs.studentDetail.type = type this.$refs.studentDetail.type = type
this.$refs.studentDetail.isShow = true this.$refs.studentDetail.isShow = true
}, },
importTable(row) {
this.$refs.imports.show()
},
exportExcel() { exportExcel() {
let _export = {} let _export = {}
this.table_item.map(item => { this.table_item.map(item => {

@ -113,7 +113,7 @@
<student-detail ref="studentDetail" @refresh="getList"></student-detail> <student-detail ref="studentDetail" @refresh="getList"></student-detail>
<editSign ref="editSign" @refresh="getList"></editSign> <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> </div>
</template> </template>
@ -311,16 +311,7 @@
this.$refs.studentDetail.isShow = true this.$refs.studentDetail.isShow = true
}, },
importTable(row) { 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() this.$refs.imports.show()
// {"course_id":15,"course_content_id":188}
}, },
// //
async getAutoForm(){ async getAutoForm(){

Loading…
Cancel
Save