a
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-dialog :visible.sync="visible" width="60%" :title="`面试审核(${row.name})`">
|
||||
<el-dialog v-model="visible" width="60%" :title="`面试审核(${row.name})`">
|
||||
<el-row>
|
||||
<el-radio v-model="status" label="1">通过</el-radio>
|
||||
<el-radio v-model="status" label="-1">未通过</el-radio>
|
||||
@@ -9,54 +9,68 @@
|
||||
<el-input type="textarea" v-model="reason" placeholder="请输入未通过的原因"></el-input>
|
||||
</el-row>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="confirm"><span>确认</span></el-button>
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from 'vue'
|
||||
import { useMessage } from '/@/hooks/message'
|
||||
// @ts-ignore
|
||||
import global from "@/components/tools/commondict"
|
||||
import {interview} from "@/api/recruit/recruitstudentsignup";
|
||||
export default {
|
||||
name: "interviewForm",
|
||||
data:function() {
|
||||
return {
|
||||
visible: false,
|
||||
row:{},
|
||||
status: '1',
|
||||
reason:''
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
init(row){
|
||||
this.visible = true
|
||||
this.row = row
|
||||
this.status = row.interview
|
||||
this.reason = row.interviewReason
|
||||
},
|
||||
confirm(){
|
||||
if(!this.status || (this.status == '-1' && !this.reason)){
|
||||
import { interview } from "@/api/recruit/recruitstudentsignup"
|
||||
|
||||
global.showWarningInfo(this,"请选择通过还是未通过,未通过请输入原因",2000)
|
||||
return
|
||||
}else{
|
||||
interview({"id":this.row.id,"interview":this.status,"interviewReason":this.reason}).then(resp=>{
|
||||
global.showSuccessInfo(this,"操作成功",2000)
|
||||
this.visible = false
|
||||
this.$emit('refresh')
|
||||
}).catch(e =>{
|
||||
global.showWarningInfo(this,"操作失败",2000)
|
||||
})
|
||||
// 消息提示 hooks
|
||||
const message = useMessage()
|
||||
|
||||
}
|
||||
}
|
||||
// Emits
|
||||
const emit = defineEmits<{
|
||||
(e: 'refresh'): void
|
||||
}>()
|
||||
|
||||
// 响应式数据
|
||||
const visible = ref(false)
|
||||
const row = reactive<any>({})
|
||||
const status = ref('1')
|
||||
const reason = ref('')
|
||||
|
||||
// 初始化
|
||||
const init = (rowData: any) => {
|
||||
visible.value = true
|
||||
Object.assign(row, rowData)
|
||||
status.value = rowData.interview || '1'
|
||||
reason.value = rowData.interviewReason || ''
|
||||
}
|
||||
|
||||
// 确认
|
||||
const confirm = () => {
|
||||
if (!status.value || (status.value == '-1' && !reason.value)) {
|
||||
message.warning('请选择通过还是未通过,未通过请输入原因')
|
||||
return
|
||||
} else {
|
||||
interview({ "id": row.id, "interview": status.value, "interviewReason": reason.value }).then(() => {
|
||||
message.success('操作成功')
|
||||
visible.value = false
|
||||
emit('refresh')
|
||||
}).catch(() => {
|
||||
message.error('操作失败')
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// 暴露方法给父组件
|
||||
defineExpose({
|
||||
init
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.dialog-footer {
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user