|
|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div>
|
|
|
|
|
<xy-dialog ref="dialog" :width="50" :is-show.sync="isShow" :type="'form'" :title="typeName" :form="form">
|
|
|
|
|
<xy-dialog ref="dialog" :width="70" :is-show.sync="isShow" :type="'form'" :title="typeName" :form="form">
|
|
|
|
|
<template v-slot:show>
|
|
|
|
|
<div class="xy-table-item" style="padding: 0 20px;">
|
|
|
|
|
<div class="xy-table-item-label" style="font-weight: bold;width:0;padding: 0;display: none;">
|
|
|
|
|
@ -13,60 +13,69 @@
|
|
|
|
|
<div>课程体系:{{subjectObj.leibie}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<lx-header icon="" :text="type=='checkshow' || type=='check'?'报名信息':'个人信息'" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
|
|
|
|
|
<lx-header icon="" :text="type=='checkshow' || type=='check'?'报名信息':'个人信息'"
|
|
|
|
|
style="margin-bottom: 10px; border: 0px; margin-top: 15px">
|
|
|
|
|
</lx-header>
|
|
|
|
|
<div>
|
|
|
|
|
<el-descriptions class="margin-top" :column="2" border>
|
|
|
|
|
<!-- 学员字段表 -->
|
|
|
|
|
<el-descriptions-item v-for="item in selectFormList" :span="item.span?item.span:1">
|
|
|
|
|
<template slot="label">
|
|
|
|
|
{{item.name}}
|
|
|
|
|
</template>
|
|
|
|
|
<div v-if="item.field==='company_date'">
|
|
|
|
|
{{student_info[item.field]?(student_info[item.field]=='0000-00-00'?'':student_info[item.field]):''}}
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else>
|
|
|
|
|
{{student_info[item.field]?student_info[item.field]:''}}
|
|
|
|
|
</template>
|
|
|
|
|
<div v-if="item.field==='company_date'">
|
|
|
|
|
{{student_info[item.field]?(student_info[item.field]=='0000-00-00'?'':student_info[item.field]):''}}
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else>
|
|
|
|
|
{{student_info[item.field]?student_info[item.field]:''}}
|
|
|
|
|
<!-- 是否有更改的字段 -->
|
|
|
|
|
<template v-if="change_data.length>0">
|
|
|
|
|
<template v-for="change in change_data">
|
|
|
|
|
<span style="color:red"
|
|
|
|
|
v-if="change[item.field] && change['need_update']">-->{{change[item.field]}}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
</div>
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
<el-descriptions-item :span="2" v-if="type==='check' || type==='checkshow' || type==='setPosition'">
|
|
|
|
|
<el-descriptions-item :span="2" v-if="type==='check' || type==='checkshow' || type==='setPosition'">
|
|
|
|
|
<template slot="label">
|
|
|
|
|
本班职务
|
|
|
|
|
</template>
|
|
|
|
|
{{sign_result.position?sign_result.position:''}}
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
<!-- 报名信息 -->
|
|
|
|
|
<template v-if="sign_info.length>0">
|
|
|
|
|
<!-- <lx-header v-if="type==='check' || type==='checkshow' || type==='setPosition'" icon="" text="报名信息"
|
|
|
|
|
style="margin-bottom: 10px; border: 0px; margin-top: 15px">
|
|
|
|
|
</lx-header> -->
|
|
|
|
|
<template v-if="type==='check' || type==='checkshow' || type==='setPosition'">
|
|
|
|
|
<!-- <el-descriptions class="margin-top" :column="2" border> -->
|
|
|
|
|
<template v-for="item in sign_info">
|
|
|
|
|
<el-descriptions-item :span="2" v-if="item.submit_files && item.submit_files.length>0">
|
|
|
|
|
<template slot="label">
|
|
|
|
|
{{item.name}}
|
|
|
|
|
</template>
|
|
|
|
|
<div>
|
|
|
|
|
<template v-for="file in item.submit_files">
|
|
|
|
|
<img style="width:100px;margin:10px" :src="host+file"></img>
|
|
|
|
|
</template>
|
|
|
|
|
</div>
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
<el-descriptions-item v-else :span="2">
|
|
|
|
|
<template slot="label">
|
|
|
|
|
{{item.name}}
|
|
|
|
|
</template>
|
|
|
|
|
{{item.value}}
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- </el-descriptions> -->
|
|
|
|
|
</template>
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
<!-- 报名信息 -->
|
|
|
|
|
<template v-if="sign_info.length>0">
|
|
|
|
|
<!-- <lx-header v-if="type==='check' || type==='checkshow' || type==='setPosition'" icon="" text="报名信息"
|
|
|
|
|
style="margin-bottom: 10px; border: 0px; margin-top: 15px">
|
|
|
|
|
</lx-header> -->
|
|
|
|
|
<template v-if="type==='check' || type==='checkshow' || type==='setPosition'">
|
|
|
|
|
<!-- <el-descriptions class="margin-top" :column="2" border> -->
|
|
|
|
|
<template v-for="item in sign_info">
|
|
|
|
|
<el-descriptions-item :span="2" v-if="item.submit_files && item.submit_files.length>0">
|
|
|
|
|
<template slot="label">
|
|
|
|
|
{{item.name}}
|
|
|
|
|
</template>
|
|
|
|
|
<div>
|
|
|
|
|
<template v-for="file in item.submit_files">
|
|
|
|
|
<img style="width:100px;margin:10px" :src="host+file"></img>
|
|
|
|
|
</template>
|
|
|
|
|
</div>
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
<el-descriptions-item v-else :span="2">
|
|
|
|
|
<template slot="label">
|
|
|
|
|
{{item.name}}
|
|
|
|
|
</template>
|
|
|
|
|
{{item.value}}
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- </el-descriptions> -->
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
</el-descriptions>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 审核查看 -->
|
|
|
|
|
@ -188,23 +197,52 @@
|
|
|
|
|
v-else-if="type=='check'|| type=='setPosition'" @click="isShow=false">取消</el-button>
|
|
|
|
|
<el-button type="primary" plain style='margin-left:5px;margin-bottom:5px;'
|
|
|
|
|
v-else-if="type=='show'||type=='checkshow'" @click="isShow=false">关闭</el-button>
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
</xy-dialog>
|
|
|
|
|
|
|
|
|
|
<!-- 选择要覆盖的 字段 -->
|
|
|
|
|
<Modal v-model="showChange" width="60" title="审核并更新字段">
|
|
|
|
|
<div class="update">
|
|
|
|
|
<template v-for="item in selectFormList">
|
|
|
|
|
<template v-for="(change,index) in change_data">
|
|
|
|
|
<div class="update-item" v-if="change[item.field] && change['need_update']">
|
|
|
|
|
<el-checkbox @change="(e)=>{changeCheckBox(e,index)}" v-model="change['is_checked']">
|
|
|
|
|
<div class="update-item-name">{{item.name}}:</div>
|
|
|
|
|
<div class="update-item-fieldwrap">
|
|
|
|
|
<div class="update-item-field" :style="{'margin-top':student_info[item.field]?'10px':'0px'}">
|
|
|
|
|
{{student_info[item.field]}}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="update-item-field1" :style="{'margin-top':change[item.field]?'10px':'0px'}">
|
|
|
|
|
{{change[item.field]}}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</el-checkbox>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
</div>
|
|
|
|
|
<template v-slot:footer>
|
|
|
|
|
<el-button plain type="primary" plain style='margin-left:5px;margin-bottom:5px;'
|
|
|
|
|
@click="showChange = false">取消</el-button>
|
|
|
|
|
<el-button type="primary" style='margin-left:5px;margin-bottom:5px;' @click="saveAndUpdate(false)">直接审核</el-button>
|
|
|
|
|
<el-button type="primary" style='margin-left:5px;margin-bottom:5px;' @click="saveAndUpdate(true)">审核并更新</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</Modal>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import {
|
|
|
|
|
show
|
|
|
|
|
show,
|
|
|
|
|
save as saveUser
|
|
|
|
|
} from '@/api/student/index.js'
|
|
|
|
|
import {
|
|
|
|
|
save,
|
|
|
|
|
show as showSign
|
|
|
|
|
} from '@/api/apply/index.js'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import myMixins from "@/mixin/selectMixin.js";
|
|
|
|
|
import formMixin from "@/mixin/formMixin.js";
|
|
|
|
|
export default {
|
|
|
|
|
@ -217,14 +255,17 @@
|
|
|
|
|
isShow: false,
|
|
|
|
|
type: 'show',
|
|
|
|
|
typeName: '查看个人明细',
|
|
|
|
|
showChange: false,
|
|
|
|
|
id: '',
|
|
|
|
|
action: `${process.env.VUE_APP_UPLOAD_API}`,
|
|
|
|
|
host: `${process.env.VUE_APP_BASE_API}`,
|
|
|
|
|
subjectObj: {},
|
|
|
|
|
student_info: {},
|
|
|
|
|
row: {},
|
|
|
|
|
sign_info: [],
|
|
|
|
|
sign_info: [], //报名的信息,是去除 user表字段的其他字段
|
|
|
|
|
change_data: [], // 有变更的user表中的字段 ,提交上来的一定是user表中的字段
|
|
|
|
|
sign_result: {},
|
|
|
|
|
update_student_info: {}, //存储需要更新的学员字段
|
|
|
|
|
fileList: [],
|
|
|
|
|
form: {
|
|
|
|
|
show: '',
|
|
|
|
|
@ -245,6 +286,15 @@
|
|
|
|
|
uploadRemove(file, fileList) {
|
|
|
|
|
this.fileList = fileList
|
|
|
|
|
},
|
|
|
|
|
changeCheckBox(e, index) {
|
|
|
|
|
console.log(e, index)
|
|
|
|
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.$set(this.change_data[index], 'is_checked', e)
|
|
|
|
|
})
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
|
console.log("this.change", this.change_data)
|
|
|
|
|
},
|
|
|
|
|
// beforeUpload(file) {
|
|
|
|
|
// const isImage = file.type.includes('image');
|
|
|
|
|
// if (!isImage) {
|
|
|
|
|
@ -267,6 +317,29 @@
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
this.form.file_ids = _arr
|
|
|
|
|
|
|
|
|
|
// 如果是审核通过 提交的时候看下change_data有没有值 有的话要提醒是否覆盖user
|
|
|
|
|
// 还要判断下 student_info中是否还有值与change_data中不一致的 才显示提醒,如果全部都更新过了值一样就不用了
|
|
|
|
|
// 且选择的状态为审核通过 1
|
|
|
|
|
let has_count = 0 // 是否还有字段值不一样
|
|
|
|
|
if (this.type === 'check') {
|
|
|
|
|
if (this.change_data.length > 0 && this.form.status === 1) {
|
|
|
|
|
for (var k of this.change_data) {
|
|
|
|
|
if (k['need_update']) {
|
|
|
|
|
has_count++
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (has_count > 0) {
|
|
|
|
|
console.log("has_count", has_count, this.change_data)
|
|
|
|
|
this.showChange = true
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
console.log("123")
|
|
|
|
|
// return
|
|
|
|
|
// 其他的正常更新提交
|
|
|
|
|
save({
|
|
|
|
|
...this.row,
|
|
|
|
|
status: this.form.status,
|
|
|
|
|
@ -284,6 +357,74 @@
|
|
|
|
|
this.$emit('refresh')
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 提交审核并更新用户信息
|
|
|
|
|
saveAndUpdate(isUpdate) {
|
|
|
|
|
console.log("isUpdate",isUpdate)
|
|
|
|
|
// return
|
|
|
|
|
if(isUpdate){
|
|
|
|
|
let update_count = 0 // 需要更新的字段
|
|
|
|
|
this.change_data.map(item => {
|
|
|
|
|
if (item.is_checked) {
|
|
|
|
|
update_count++
|
|
|
|
|
// 替换学员数据中的值
|
|
|
|
|
for (var student in this.student_info) {
|
|
|
|
|
if (item[student]) {
|
|
|
|
|
this.update_student_info[student] = item[student]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
// 有需要更新的字段
|
|
|
|
|
if (update_count > 0) {
|
|
|
|
|
save({
|
|
|
|
|
...this.row,
|
|
|
|
|
status: this.form.status,
|
|
|
|
|
reason: this.form.reason,
|
|
|
|
|
score: this.form.score,
|
|
|
|
|
giveup_reason: this.form.giveup_reason,
|
|
|
|
|
file_ids: this.form.file_ids,
|
|
|
|
|
position: this.form.position
|
|
|
|
|
}).then(res => {
|
|
|
|
|
saveUser({
|
|
|
|
|
...this.update_student_info
|
|
|
|
|
}).then(res => {
|
|
|
|
|
this.$message({
|
|
|
|
|
type: 'success',
|
|
|
|
|
message: '审核并更新成功'
|
|
|
|
|
})
|
|
|
|
|
this.isShow = false
|
|
|
|
|
this.showChange = false
|
|
|
|
|
this.$emit('refresh')
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
console.log("update", this.update_student_info)
|
|
|
|
|
} else {
|
|
|
|
|
this.$Message.warning("请选择需要更新的字段")
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
save({
|
|
|
|
|
...this.row,
|
|
|
|
|
status: this.form.status,
|
|
|
|
|
reason: this.form.reason,
|
|
|
|
|
score: this.form.score,
|
|
|
|
|
giveup_reason: this.form.giveup_reason,
|
|
|
|
|
file_ids: this.form.file_ids,
|
|
|
|
|
position: this.form.position
|
|
|
|
|
}).then(res => {
|
|
|
|
|
this.$message({
|
|
|
|
|
type: 'success',
|
|
|
|
|
message: '审核成功'
|
|
|
|
|
})
|
|
|
|
|
this.isShow = false
|
|
|
|
|
this.showChange = false
|
|
|
|
|
this.$emit('refresh')
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getDetail() {
|
|
|
|
|
show({
|
|
|
|
|
@ -298,16 +439,20 @@
|
|
|
|
|
show_relation: ['user']
|
|
|
|
|
}).then(res => {
|
|
|
|
|
this.student_info = res.user
|
|
|
|
|
this.update_student_info = this.base.deepCopy(res.user)
|
|
|
|
|
this.sign_result = res
|
|
|
|
|
this.form.position = res.position ? res.position : ''
|
|
|
|
|
this.change_data = res.change_data ? res.change_data : []
|
|
|
|
|
|
|
|
|
|
// 提取出 自定义表单中不属于user的字段
|
|
|
|
|
let _arr = []
|
|
|
|
|
if (res.data && Array.isArray(res.data)) {
|
|
|
|
|
res.data.map(item => {
|
|
|
|
|
if(item.edit_input==='files'){
|
|
|
|
|
if (!this.base.isNull(item.value) && item.value.indexOf("/storage/files/") !== -1) {
|
|
|
|
|
item.submit_files = item.value.split(",")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
res.data.map(item => {
|
|
|
|
|
if (item.edit_input === 'files') {
|
|
|
|
|
if (!this.base.isNull(item.value) && item.value.indexOf("/storage/files/") !== -1) {
|
|
|
|
|
item.submit_files = item.value.split(",")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 处理自定义字段中是否 是个人用户信息
|
|
|
|
|
if (!this.student_info.hasOwnProperty(item.field)) {
|
|
|
|
|
console.log("item.field")
|
|
|
|
|
@ -320,11 +465,23 @@
|
|
|
|
|
}
|
|
|
|
|
this.form.status = res.status ? res.status : 0
|
|
|
|
|
this.form.score = res.score ? res.score : ''
|
|
|
|
|
this.form.reason = res.reason ? res.reason : ''
|
|
|
|
|
this.form.giveup_reason = res.giveup_reason?res.giveup_reason:''
|
|
|
|
|
this.form.reason = res.reason ? res.reason : ''
|
|
|
|
|
this.form.giveup_reason = res.giveup_reason ? res.giveup_reason : ''
|
|
|
|
|
this.fileList = res.files ? res.files : []
|
|
|
|
|
|
|
|
|
|
console.log("this.sign_info", this.sign_info)
|
|
|
|
|
// 只显示 change_data 中与user表中字段值不一样的
|
|
|
|
|
if (this.change_data.length > 0) {
|
|
|
|
|
for (var k of this.change_data) {
|
|
|
|
|
for (var s in this.student_info) {
|
|
|
|
|
console.log(k, s, k.hasOwnProperty(s), k[s] != this.student_info[s])
|
|
|
|
|
if (k.hasOwnProperty(s) && k[s] != this.student_info[s]) {
|
|
|
|
|
k['need_update'] = true
|
|
|
|
|
k['is_checked'] = true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
console.log("this.sign_info", this.sign_info, this.change_data)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
@ -348,10 +505,15 @@
|
|
|
|
|
} else {
|
|
|
|
|
this.id = ''
|
|
|
|
|
this.type = 'show'
|
|
|
|
|
this.showChange = false
|
|
|
|
|
this.subjectObj = {}
|
|
|
|
|
this.sign_result = {}
|
|
|
|
|
this.sign_info = []
|
|
|
|
|
this.change_data = []
|
|
|
|
|
this.fileList = []
|
|
|
|
|
this.student_info = {}
|
|
|
|
|
this.update_student_info = {}
|
|
|
|
|
this.row = {}
|
|
|
|
|
this.$refs['dialog'].reset()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
@ -376,6 +538,50 @@
|
|
|
|
|
margin-top: 0 !important;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.update {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
align-items: center;
|
|
|
|
|
padding: 30px;
|
|
|
|
|
|
|
|
|
|
&-item {
|
|
|
|
|
flex-basis: 50%;
|
|
|
|
|
margin: 10px 0;
|
|
|
|
|
font-size: 20px;
|
|
|
|
|
|
|
|
|
|
::v-deep .el-checkbox {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: baseline;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&-fieldwrap {
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
align-items: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&-name {
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
color: rgba(0, 0, 0, 0.5)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&-field {
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
margin-top: 10px;
|
|
|
|
|
flex-basis: 100%;
|
|
|
|
|
color: #000
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&-field1 {
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
margin-top: 10px;
|
|
|
|
|
flex-basis: 100%;
|
|
|
|
|
color: red
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.studentInfo {
|
|
|
|
|
&>div {
|
|
|
|
|
display: flex;
|
|
|
|
|
|