添加作业新流程
This commit is contained in:
parent
08b87d995d
commit
55937d47d7
|
@ -264,7 +264,17 @@
|
|||
<a-col :span="24">
|
||||
<div class="region">
|
||||
<div class="region-title"><span class="region-title-headline"></span><span>查重设置</span></div>
|
||||
<a-form-item label="检测通过率" :labelCol="labelCol3" :wrapperCol="wrapperCol3" style="margin: -1px; margin-left: -10px">
|
||||
<a-form-item label="是否进行查重" :labelCol="labelCol3" :wrapperCol="wrapperCol3">
|
||||
<j-dict-select-tag
|
||||
type="radio"
|
||||
v-model:value="zyInfo.sfcc"
|
||||
dictCode="yn"
|
||||
placeholder="请选择是否查重"
|
||||
:disabled="editDisabled"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="检测通过率" :labelCol="labelCol3" :wrapperCol="wrapperCol3" style="margin: -1px; margin-left: -10px" v-if="zyInfo.sfcc=='1'">
|
||||
<a-input-number
|
||||
v-model:value="zyInfo.wwtgl"
|
||||
placeholder="请输入检测通过率"
|
||||
|
@ -276,7 +286,7 @@
|
|||
<template #addonAfter> % </template>
|
||||
</a-input-number>
|
||||
</a-form-item>
|
||||
<a-form-item label="比对库设置" :labelCol="labelCol3" :wrapperCol="wrapperCol3" style="margin-left: -10px">
|
||||
<a-form-item label="比对库设置" :labelCol="labelCol3" :wrapperCol="wrapperCol3" style="margin-left: -10px" v-if="zyInfo.sfcc=='1'">
|
||||
<div style="padding: 5px 0">维普</div>
|
||||
<div style="display: flex; flex-direction: column">
|
||||
<a-checkbox v-model:checked="zyInfo.wwcc" :disabled="editDisabled" style="margin-left: 8px">
|
||||
|
@ -544,6 +554,7 @@
|
|||
|
||||
<SzybStudentModal ref="SzybStudentModalpage" @success="handleSuccess"></SzybStudentModal>
|
||||
<ZyInfoStudentScoreModal ref="registerScoreModal" @success="handleSuccess"></ZyInfoStudentScoreModal>
|
||||
<ZyInfoStudentPiyueModal ref="registerPiyueModal" @success="handleSuccess"></ZyInfoStudentPiyueModal>
|
||||
<KcTeachingUnitContentOneListModal ref="registerZcjcModal" @success="handleCheckZcjcSuccess"></KcTeachingUnitContentOneListModal>
|
||||
|
||||
<ZyInfoDetailModal ref="registerDetialModal" @success="handleSuccess"></ZyInfoDetailModal>
|
||||
|
@ -581,6 +592,7 @@ import { openByUrl } from '/@/utils/file/download';
|
|||
|
||||
import SzybStudentModal from '/@/views/zy/zyInfoStudent/components/SzybStudentModal.vue';
|
||||
import ZyInfoStudentScoreModal from '/@/views/zy/zyInfoStudent/components/ZyInfoStudentScoreModal.vue';
|
||||
import ZyInfoStudentPiyueModal from '/@/views/zy/zyInfoStudent/components/ZyInfoStudentPiyueModal.vue';
|
||||
import KcTeachingUnitContentOneListModal from '/@/views/zy/zyInfo/zyCheckZcjc/KcTeachingUnitContentOneListModal.vue';
|
||||
|
||||
import ZyInfoDetailModal from './components/ZyInfoDetailModal.vue';
|
||||
|
@ -619,6 +631,7 @@ const formRef = ref();
|
|||
const confirmLoading = ref<boolean>(false);
|
||||
const zyyqShow = ref<boolean>(false);
|
||||
const pfbzShow = ref<boolean>(false);
|
||||
const sfccShow = ref<boolean>(false);
|
||||
const editDisabled = ref<boolean>(false);
|
||||
const queryType = ref<string>('');
|
||||
|
||||
|
@ -636,6 +649,7 @@ const ZyInfoStudentModalPage = ref();
|
|||
const XxhbbksListModalPage = ref();
|
||||
const registerEditModal = ref();
|
||||
const registerDetialModal = ref();
|
||||
const registerPiyueModal = ref();
|
||||
const pdfUrl = ref('/downPath/ylhpsf.pdf');
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
|
@ -649,7 +663,7 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
|||
pageSize: 10,
|
||||
},
|
||||
actionColumn: {
|
||||
width: '170px',
|
||||
width: '200px',
|
||||
fixed: 'right',
|
||||
},
|
||||
showTableSetting: true,
|
||||
|
@ -833,9 +847,14 @@ function handleDown(text) {
|
|||
}
|
||||
//预览
|
||||
function yulanFile(record) {
|
||||
var url2 = getFileAccessHttpUrl(record.pdfPath);
|
||||
let url = baseApiUrl + '/generic/web/viewer.html?file=' + encodeURIComponent(url2);
|
||||
window.open(url, '_blank');
|
||||
if(record.pdfPath){
|
||||
var url2 = getFileAccessHttpUrl(record.pdfPath);
|
||||
let url = baseApiUrl + '/generic/web/viewer.html?file=' + encodeURIComponent(url2);
|
||||
window.open(url, '_blank');
|
||||
}else{
|
||||
createMessage.error('当前作业不支持预览,请下载后查阅!');
|
||||
}
|
||||
|
||||
}
|
||||
//驳回
|
||||
function handleBohui(record: Recordable) {
|
||||
|
@ -868,6 +887,12 @@ function handleScoreFabu(record: Recordable) {
|
|||
handleSuccess();
|
||||
});
|
||||
}
|
||||
//教师批阅作业
|
||||
function handlepiyue(record: Recordable){
|
||||
registerPiyueModal.value.disableSubmit = false;
|
||||
registerPiyueModal.value.edit(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
|
@ -899,6 +924,10 @@ function getTableAction(record) {
|
|||
label: '驳回',
|
||||
onClick: handleBohui.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '批阅',
|
||||
onClick: handlepiyue.bind(null, record),
|
||||
},
|
||||
// {
|
||||
// label: record.score ? '修改评分' : '评分',
|
||||
// onClick: handleScore.bind(null, record),
|
||||
|
@ -1195,22 +1224,32 @@ async function submitForm() {
|
|||
var xncc = model.xncc;
|
||||
var nwcc = model.nwcc;
|
||||
var aigccc = model.aigccc;
|
||||
var sfcc = model.sfcc;
|
||||
console.log('🚶♂️', model);
|
||||
if (wwtgl) {
|
||||
if ((wwcc == false && xncc == false && nwcc == false && aigccc == false) || (!wwcc && !xncc && !nwcc && !aigccc)) {
|
||||
createMessage.warning('您设置了检测通过率,但您没有设置查重比对库,请先设置查重比对库!');
|
||||
confirmLoading.value = false;
|
||||
return;
|
||||
}
|
||||
console.log('1111111111', wwtgl, wwcc, xncc, aigccc);
|
||||
} else {
|
||||
console.log('22222222222', wwtgl, wwcc, xncc, aigccc);
|
||||
if (wwcc == true || xncc == true || nwcc == true || aigccc == true || wwcc == 'true' || xncc == 'true' || nwcc == 'true' || aigccc == 'true') {
|
||||
createMessage.warning('您设置了查重比对库,但您没设置检测通过率,请先设置检测通过率');
|
||||
confirmLoading.value = false;
|
||||
return;
|
||||
if(sfcc == '1'){//开启查重再进行验证,否则不进行验证
|
||||
if (wwtgl) {
|
||||
if ((wwcc == false && xncc == false && nwcc == false && aigccc == false) || (!wwcc && !xncc && !nwcc && !aigccc)) {
|
||||
createMessage.warning('您设置了检测通过率,但您没有设置查重比对库,请先设置查重比对库!');
|
||||
confirmLoading.value = false;
|
||||
return;
|
||||
}
|
||||
console.log('1111111111', wwtgl, wwcc, xncc, aigccc);
|
||||
} else {
|
||||
console.log('22222222222', wwtgl, wwcc, xncc, aigccc);
|
||||
if (wwcc == true || xncc == true || nwcc == true || aigccc == true || wwcc == 'true' || xncc == 'true' || nwcc == 'true' || aigccc == 'true') {
|
||||
createMessage.warning('您设置了查重比对库,但您没设置检测通过率,请先设置检测通过率');
|
||||
confirmLoading.value = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}else{//如果不进行查重,则强制清空查重配置数据
|
||||
model.wwtgl = null;
|
||||
model.wwcc = null;
|
||||
model.xncc = null;
|
||||
model.nwcc = null;
|
||||
model.aigccc = null;
|
||||
}
|
||||
|
||||
|
||||
var xshpkssj = model.xshpkssj;
|
||||
var xshpjssj = model.xshpjssj;
|
||||
|
@ -1433,6 +1472,9 @@ function handleEdit(record, type) {
|
|||
if (!record.sfzzcj) {
|
||||
record.sfzzcj = '1';
|
||||
}
|
||||
if (!record.sfcc) {
|
||||
record.sfcc = '1';
|
||||
}
|
||||
if (!record.xssfck) {
|
||||
record.xssfck = '1';
|
||||
}
|
||||
|
|
|
@ -80,6 +80,27 @@
|
|||
</a-form-item>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col v-if="formData.pyContent || formData.pyFilePath">
|
||||
<div class="wrapper-back">
|
||||
<div class="wrapper-title">批阅信息</div>
|
||||
<a-row>
|
||||
<a-col :span="24" v-if="formData.pyContent">
|
||||
<a-form-item label="批阅内容" layout="inline">
|
||||
<div class="spanb-word" style="margin-top:5px" v-html="formData.pyContent"></div>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" v-if="formData.pyFilePath">
|
||||
<a-form-item label="批阅附件">
|
||||
<span>{{ lastString(formData.pyFilePath) }}</span>
|
||||
<a-button type="primary" style="margin-left: 10px" @click="downLoad(formData.pyFilePath)">下载</a-button>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
</a-col>
|
||||
|
||||
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-col>
|
||||
|
|
|
@ -88,10 +88,13 @@
|
|||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" v-if="!isYl" style="text-align: left; margin-left:220px; margin-top:20px">
|
||||
<!-- <a-form-item label="上传作业" v-bind="validateInfos.filePath"> -->
|
||||
<j-upload v-model:value="formData.filePath" :disabled="disabled" maxCount="1" accept=".doc,.docx,.pdf" :text="`上传作业`" style="background: #ededed; " :forceAcceptVerify="true" ></j-upload>
|
||||
<!-- </a-form-item> -->
|
||||
</a-col>
|
||||
<div v-if="zyInfo.sfcc == '1'">
|
||||
<j-upload v-model:value="formData.filePath" :disabled="disabled" maxCount="1" accept=".doc,.docx,.pdf" :text="`上传作业`" style="background: #ededed; " :forceAcceptVerify="true" ></j-upload>
|
||||
</div>
|
||||
<div v-if="zyInfo.sfcc == '0'">
|
||||
<j-upload v-model:value="formData.filePath" :disabled="disabled" maxCount="1" :text="`上传作业`" style="background: #ededed; " :forceAcceptVerify="true" ></j-upload>
|
||||
</div>
|
||||
</a-col>
|
||||
<a-col :span="24" v-if="isYl">
|
||||
<span style="width:300px;float: left;">
|
||||
<span style="float:left;">
|
||||
|
|
|
@ -0,0 +1,188 @@
|
|||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-row>
|
||||
<!-- <a-col :span="24">
|
||||
<span style="margin-left: 8%;line-height:60px;">预设作业分值:{{zyInfo.score?zyInfo.score+"分 评分不能高于预设分值":'未设置 评分不能高于100分'}}</span>
|
||||
</a-col> -->
|
||||
<a-col :span="24">
|
||||
<a-form-item label="作业名称">
|
||||
{{zyInfo.title}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="学生姓名">
|
||||
{{formData.studentName}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="批阅内容" v-bind="validateInfos.pyContent">
|
||||
<JEditor v-model:value="formData.pyContent" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="批阅附件" v-bind="validateInfos.pyFilePath">
|
||||
<j-upload v-model:value="formData.pyFilePath" :disabled="disabled" maxCount="1" :text="`上传批阅附件`" style="background: #ededed; " :forceAcceptVerify="true" ></j-upload>
|
||||
</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 JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
|
||||
import { getValueType } from '/@/utils';
|
||||
import { saveOrUpdate } from '../ZyInfoStudent.api';
|
||||
import { Form } from 'ant-design-vue';
|
||||
import JEditor from '/@/components/Form/src/jeecg/components/JEditor.vue';
|
||||
|
||||
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: '',
|
||||
score: '',
|
||||
});
|
||||
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 zyInfo = ref<any>({});
|
||||
//表单验证
|
||||
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 handleJyfz(record){
|
||||
console.log(`🚀 ~ handleJyfz ~ record:`, record)
|
||||
// if(zyInfo.score){
|
||||
// if(parseInt(record) > parseInt(zyInfo.score)){
|
||||
// createMessage.warning('评分不能超过预设作业分值!');
|
||||
// formData.score = zyInfo.score;
|
||||
// }
|
||||
// }else{
|
||||
// if(parseInt(record) > 100){
|
||||
// createMessage.warning('评分不能超过100分!');
|
||||
// formData.score = zyInfo.score;
|
||||
// }
|
||||
// }
|
||||
|
||||
if(parseInt(record) > 100){
|
||||
createMessage.warning('评分不能超过100分!');
|
||||
formData.score = '';
|
||||
}
|
||||
|
||||
if(parseInt(record) < 0){
|
||||
createMessage.warning('评分不能低于0分!');
|
||||
formData.score = '';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
edit({});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
function edit(record) {
|
||||
nextTick(() => {
|
||||
resetFields();
|
||||
|
||||
defHttp.get({url:'/zyInfo/zyInfo/queryById',params:{id:record.mainId}}).then(res=>{
|
||||
console.log(`🚀 ~ defHttp.get ~ res:`, res)
|
||||
zyInfo.value = res;
|
||||
})
|
||||
|
||||
|
||||
|
||||
//赋值
|
||||
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(',');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
defHttp.post({url:'/zyInfoStudent/zyInfoStudent/editPiyue',params:model}).then(res =>{
|
||||
emit('ok');
|
||||
})
|
||||
.finally(() => {
|
||||
confirmLoading.value = false;
|
||||
});
|
||||
// await saveOrUpdate(model, isUpdate.value)
|
||||
// .then((res) => {
|
||||
// if (res.success) {
|
||||
// createMessage.success(res.message);
|
||||
// emit('ok');
|
||||
// } else {
|
||||
// createMessage.warning(res.message);
|
||||
// }
|
||||
// })
|
||||
// .finally(() => {
|
||||
// confirmLoading.value = false;
|
||||
// });
|
||||
}
|
||||
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
submitForm,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.antd-modal-form {
|
||||
min-height: 150px !important;
|
||||
overflow-y: auto;
|
||||
padding: 24px 24px 24px 24px;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,75 @@
|
|||
<template>
|
||||
<a-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
||||
<ZyInfoStudentPiyueForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></ZyInfoStudentPiyueForm>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import ZyInfoStudentPiyueForm from './ZyInfoStudentPiyueForm.vue'
|
||||
|
||||
const title = ref<string>('');
|
||||
const width = ref<number>(800);
|
||||
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 = '评分';
|
||||
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>
|
Loading…
Reference in New Issue