批量更新

master
lion 2 months ago
parent a943cd5a67
commit dea79129ab

@ -94,12 +94,7 @@
<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(1)" title="确定要批量审核吗?">
<el-button style="margin-right:10px" type="primary" size="small" slot="reference">批量审核通过</el-button>
</el-popconfirm>
<!-- <el-popconfirm @confirm="updateAllStatus(2)" title="确定要批量审核吗?"> -->
<el-button @click="updateAllStatus(2)" type="warning" size="small" slot="reference">批量审核不通过</el-button>
<!-- </el-popconfirm> -->
<el-button type="primary" size="small" @click="openBatchAudit"></el-button>
</div>
</div>
@ -193,13 +188,10 @@
</xy-table>
</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>
<updateStaturReason ref="updateStaturReason" @refresh="getList"></updateStaturReason>
<batch-audit-dialog ref="batchAuditDialog" @refresh="getList" />
</div>
</template>
@ -211,19 +203,18 @@
import imports from "@/views/component/imports.vue"
import {
index,
updateStatus,
destroy
} from '@/api/apply/index.js'
import {
download
} from "@/utils/downloadRequest";
import updateStaturReason from "./components/updateStaturReason.vue"
import BatchAuditDialog from './components/BatchAuditDialog.vue'
export default {
mixins: [myMixins, formMixin],
components: {
studentDetail,
imports,
updateStaturReason
BatchAuditDialog
},
data() {
return {
@ -517,33 +508,17 @@
this.selectids = []
}
},
updateAllStatus(status) {
// if (this.base.isNull(this.subjectObj.date)) {
// this.$message.warning("")
// return
// }
openBatchAudit() {
if (this.selectids.length < 1) {
this.$message.warning("请先选择要审核的学员")
return
}
let ids = this.selectids.join(',')
if(status==2){
this.$refs.updateStaturReason.setIds({
course_id: this.select.course_id,
ids: ids,
status: status,
})
this.$refs.updateStaturReason.isShow = true
this.$message.warning('请先选择要审核的学员')
return
}
updateStatus({
const ids = this.selectids.join(',')
this.$refs.batchAuditDialog.setIds({
course_id: this.select.course_id,
ids: ids,
status: status,
}).then(res => {
this.$Message.success('审核成功')
this.getList()
ids
})
this.$refs.batchAuditDialog.isShow = true
},
showDetail(type, row) {
// if (this.base.isNull(this.subjectObj.date)) {

@ -0,0 +1,182 @@
<template>
<div>
<xy-dialog ref="dialog" :width="60" :is-show.sync="isShow" :type="'form'" title="批量审核"
:form="form" :rules="rules" @submit="submit">
<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 filterable v-model="form.status" placeholder="请选择" clearable style="width: 100%;">
<el-option v-for="item in apply_status_list" :key="item.id" :label="item.value" :value="item.id" />
</el-select>
</div>
</div>
</template>
<template v-slot:score>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">评分</div>
<div class="xy-table-item-content">
<el-input type="number" v-model="form.score" placeholder="请输入评分" clearable style="width: 100%;" />
</div>
</div>
</template>
<template v-slot:giveup_reason>
<div v-if="form.status === 5" 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="textarea" v-model="form.giveup_reason" placeholder="请输入放弃原因" style="width: 100%;" />
</div>
</div>
</template>
<template v-slot:file_ids>
<div v-if="form.status === 1" class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">录取通知书</div>
<div class="xy-table-item-content">
<el-upload
:action="action"
class="upload-demo"
:file-list="fileList"
ref="pictureUpload"
:auto-upload="true"
:limit="1"
:on-success="uploadSuccess"
:on-remove="uploadRemove"
>
<el-button size="small" type="primary">点击上传</el-button>
<div class="el-upload__tip" slot="tip">可上传各类格式文件</div>
</el-upload>
</div>
</div>
</template>
<template v-slot:reason>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span v-if="form.status === 2" style="color: red;font-weight: bold;padding-right: 4px;">*</span>
</div>
<div class="xy-table-item-content">
<el-input type="textarea" :rows="4" v-model="form.reason" placeholder="请输入备注(展示给学员查看)" style="width: 100%;" />
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import myMixins from '@/mixin/selectMixin.js'
import { updateStatus } from '@/api/apply/index.js'
export default {
mixins: [myMixins],
data() {
return {
isShow: false,
action: `${process.env.VUE_APP_UPLOAD_API}`,
ids_obj: {
ids: '',
course_id: ''
},
form: {
status: '',
score: '',
giveup_reason: '',
file_ids: [],
reason: ''
},
fileList: [],
rules: {
status: [{ required: true, message: '请选择审核结果', trigger: 'change' }]
}
}
},
methods: {
setIds(obj) {
this.ids_obj = { ...obj }
},
uploadSuccess(response, file, fileList) {
this.fileList = fileList
},
uploadRemove(file, fileList) {
this.fileList = fileList
},
submit() {
if (this.form.status !== 0 && (this.form.status == null || this.form.status === '')) {
this.$message.warning('请选择审核结果')
return
}
const s = this.form.status
if (s === 2) {
if (!this.form.reason || !String(this.form.reason).trim()) {
this.$message.warning('审核不通过时,请填写备注')
return
}
}
if (s === 5) {
if (!this.form.giveup_reason || !String(this.form.giveup_reason).trim()) {
this.$message.warning('主动放弃时,请填写放弃原因')
return
}
}
const fileIds = []
if (this.fileList && this.fileList.length > 0) {
this.fileList.forEach(item => {
if (item.response && item.response.id) {
fileIds.push(item.response.id)
} else if (item.id) {
fileIds.push(item.id)
}
})
}
const payload = {
course_id: this.ids_obj.course_id,
ids: this.ids_obj.ids,
status: this.form.status,
reason: this.form.reason || '',
score: this.form.score || '',
giveup_reason: this.form.giveup_reason || '',
file_ids: fileIds
}
updateStatus(payload).then(res => {
this.$message.success('批量审核成功')
this.isShow = false
this.$emit('refresh')
}).catch(err => {
this.$message.error(err && (err.message || err.msg) ? (err.message || err.msg) : '批量审核失败')
})
}
},
watch: {
isShow(val) {
if (!val) {
this.ids_obj = { ids: '', course_id: '' }
this.form = {
status: '',
score: '',
giveup_reason: '',
file_ids: [],
reason: ''
}
this.fileList = []
this.$refs.dialog && this.$refs.dialog.reset()
}
}
}
}
</script>
<style scoped lang="scss">
::v-deep .status,
::v-deep .score,
::v-deep .giveup_reason,
::v-deep .file_ids,
::v-deep .reason {
flex-basis: 100%;
}
</style>
Loading…
Cancel
Save