添加驳回原因操作及展示

This commit is contained in:
yangjun 2025-03-17 09:39:55 +08:00
parent b42d0ebb3c
commit 2e6b19cab7
4 changed files with 235 additions and 20 deletions

View File

@ -26,7 +26,9 @@
>{{ dayjs(item.xshpkssj).format('YYYY.MM.DD HH:mm') }} ~ {{ dayjs(item.xshpjssj).format('YYYY.MM.DD HH:mm') }}</span
><span v-else>未设置互评</span></a-col
>
<a-col :span="24" v-if="!item.stuFilePath && item.bhContent"><span style="color:red;width:100%;">驳回原因{{item.bhContent}}</span></a-col>
<a-col :span="12" class="zyCon Score-List">
<a-popover title="得分情况">
<template #content>
<p>作业得分{{ item.stuscore && item.scoreFabu == '1' ? item.stuscore : '未评' }}</p>

View File

@ -556,6 +556,7 @@
<YyzyListModal ref="YyzyListModalPage" @success="handleCallYinyong"></YyzyListModal>
<ZyCyFenxiangListModal ref="ZyCyFenxiangListModalpage"></ZyCyFenxiangListModal>
<Xzxx ref="XzxxRef" :studentsQP="queryParam" @saveSuccess="xzxxSaveSuccess"></Xzxx>
<ZyInfoBhModal ref="bohuiRef" @success="handleSuccess"></ZyInfoBhModal>
<a-modal v-model:visible="imgvisible" title="图片预览" width="800px" :cancelText="`关闭`"
:okButtonProps="{ class: { 'jee-hidden': true } }">
@ -607,6 +608,7 @@ import XxhbbksListModal from '/@/views/kc/xxhbbks/XxhbbksListModal.vue';
import ZyInfoEditModal from './components/ZyInfoEditModal.vue';
import YyzyListModal from '/@/views/zy/zyInfo/YyzyListModal.vue';
import ZyCyFenxiangListModal from '/@/views/zy/zyCyFenxiang/ZyCyFenxiangListModal.vue';
import ZyInfoBhModal from '/@/views/zy/zyInfo/components/ZyInfoBhModal.vue';
import Xzxx from './components/Xzxx.vue';
import { encryptByBase64 } from '/@/utils/cipher';
@ -664,6 +666,7 @@ const registerPiyueModal = ref();
const YyzyListModalPage = ref();
const ZyCyFenxiangListModalpage = ref();
const XzxxRef = ref()
const bohuiRef = ref()
const pdfUrl = ref('/downPath/ylhpsf.pdf');
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
@ -954,26 +957,30 @@ function yulanFile(record) {
}
//
async function handleBohui(record: Recordable) {
createConfirm({
iconType: 'warning',
title: '驳回',
content: '您确定驳回此作业吗,驳回后需要学生重新提交?',
okText: '确认',
cancelText: '取消',
onOk: async () => {
let zyinfo = await defHttp.get({ url: '/zyInfo/zyInfo/queryById', params: { id: record.mainId } })
if(zyinfo.xzxstjzy == 'Y'){
let stuZyIds = await defHttp.post({ url: '/zyInfoStudent/zyInfoStudent/getZyStuIdById', data: { zyinfoId: record.mainId, xh: record.createBy } })
stuZyIds.forEach(async stu => {
await defHttp.post({ url: '/zyInfoStudent/zyInfoStudent/editBohui', params: { id: stu.id } })
})
}else{
await defHttp.post({ url: '/zyInfoStudent/zyInfoStudent/editBohui', params: { id: record.id } })
}
createMessage.success('作业驳回成功!')
handleSuccess();
},
});
bohuiRef.value.disableSubmit = false;
bohuiRef.value.edit(record);
// createConfirm({
// iconType: 'warning',
// title: '',
// content: '',
// okText: '',
// cancelText: '',
// onOk: async () => {
// let zyinfo = await defHttp.get({ url: '/zyInfo/zyInfo/queryById', params: { id: record.mainId } })
// if(zyinfo.xzxstjzy == 'Y'){
// let stuZyIds = await defHttp.post({ url: '/zyInfoStudent/zyInfoStudent/getZyStuIdById', data: { zyinfoId: record.mainId, xh: record.createBy } })
// stuZyIds.forEach(async stu => {
// await defHttp.post({ url: '/zyInfoStudent/zyInfoStudent/editBohui', params: { id: stu.id } })
// })
// }else{
// await defHttp.post({ url: '/zyInfoStudent/zyInfoStudent/editBohui', params: { id: record.id } })
// }
// createMessage.success('!')
// handleSuccess();
// },
// });
}
//
function handleScore(record: Recordable) {

View File

@ -0,0 +1,131 @@
<template>
<a-spin :spinning="confirmLoading">
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-row>
<a-col :span="24" style="margin-top:30px;">
<a-form-item label="驳回原因" v-bind="validateInfos.bhContent">
<a-textarea v-model:value="formData.bhContent" placeholder="请输入驳回原因" style="height: 100px;" :disabled="disabled"></a-textarea>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import { getValueType } from '/@/utils';
import { editCdlx } from '../ZyInfoStudent.api';
import { Form } from 'ant-design-vue';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
const { createConfirm } = useMessage();
const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: ()=>{} },
formBpm: { type: Boolean, default: true }
});
const formRef = ref();
const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']);
const formData = reactive<Record<string, any>>({
id: '',
cdlx: '',
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const confirmLoading = ref<boolean>(false);
//
const validatorRules = {
};
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
//
const disabled = computed(()=>{
if(props.formBpm === true){
if(props.formData.disabled === false){
return false;
}else{
return true;
}
}
return props.formDisabled;
});
/**
* 新增
*/
function add() {
edit({});
}
/**
* 编辑
*/
function edit(record) {
nextTick(() => {
resetFields();
//
Object.assign(formData, record);
});
}
/**
* 提交数据
*/
async function submitForm() {
//
await validate();
confirmLoading.value = true;
const isUpdate = ref<boolean>(false);
//
let model = formData;
if (model.id) {
isUpdate.value = true;
}
//
for (let data in model) {
//
if (model[data] instanceof Array) {
let valueType = getValueType(formRef.value.getProps, data);
//
if (valueType === 'string') {
model[data] = model[data].join(',');
}
}
}
let zyinfo = await defHttp.get({ url: '/zyInfo/zyInfo/queryById', params: { id: model.mainId } })
if(zyinfo.xzxstjzy == 'Y'){
let stuZyIds = await defHttp.post({ url: '/zyInfoStudent/zyInfoStudent/getZyStuIdById', data: { zyinfoId: model.mainId, xh: model.createBy } })
stuZyIds.forEach(async stu => {
await defHttp.post({ url: '/zyInfoStudent/zyInfoStudent/editBohui', params: { id: stu.id,bhContent:model.bhContent } })
})
}else{
await defHttp.post({ url: '/zyInfoStudent/zyInfoStudent/editBohui', params: { id: model.id,bhContent:model.bhContent } })
}
emit("ok");
}
defineExpose({
add,
edit,
submitForm,
});
</script>
<style lang="less" scoped>
.antd-modal-form {
min-height: 300px !important;
overflow-y: auto;
padding: 24px 24px 24px 24px;
}
</style>

View File

@ -0,0 +1,75 @@
<template>
<a-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<ZyInfoBhForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></ZyInfoBhForm>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import ZyInfoBhForm from './ZyInfoBhForm.vue'
const title = ref<string>('');
const width = ref<string>('80%');
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 新增
*/
function add() {
title.value = '新增';
visible.value = true;
nextTick(() => {
registerForm.value.add();
});
}
/**
* 编辑
* @param record
*/
function edit(record) {
title.value = disableSubmit.value ? '详情' : '编辑';
visible.value = true;
nextTick(() => {
registerForm.value.edit(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback() {
handleCancel();
emit('success');
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
add,
edit,
disableSubmit,
});
</script>
<style>
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>