面授课bug

This commit is contained in:
zhangyc
2022-11-29 15:53:47 +08:00
parent 0083d3b4d9
commit a6fefb61bf

View File

@@ -134,10 +134,18 @@
<span style="margin-right: 3px">面授时长:</span> <span style="margin-right: 3px">面授时长:</span>
</div> </div>
<div class="btnbox"> <div class="btnbox">
<a-input <a-input-number
:min="0"
:max="300"
:precision="0"
style="
width: 364px;
height: 32px;
border-radius: 8px;
overflow: hidden;
"
v-model:value="duration" v-model:value="duration"
style="width: 384px; height: 32px" ></a-input-number>
/>
<span style="margin-left: 5px; width: 30px">分钟</span> <span style="margin-left: 5px; width: 30px">分钟</span>
</div> </div>
</div> </div>
@@ -172,31 +180,30 @@
<div class="timerbox"> <div class="timerbox">
<span>开始前:</span> <span>开始前:</span>
<a-input-number <a-input-number
:min="0" :min="0"
:max="30" :max="300"
:precision="0" :precision="0"
style=" style="
width: 88px; width: 100px;
height: 32px; height: 32px;
border-radius: 8px; border-radius: 8px;
overflow: hidden; overflow: hidden; "
" v-model:value="before"
:v-model:value="beforeStartValue" ></a-input-number>
></a-input-number>
<span style="color: #999999; margin-left: 8px">分钟</span> <span style="color: #999999; margin-left: 8px">分钟</span>
</div> </div>
<div class="timerbox"> <div class="timerbox">
<span>开始后:</span> <span>开始后:</span>
<a-input-number <a-input-number
:min="0" :min="0"
:max="30" :max="300"
:precision="0" :precision="0"
style=" style="
width: 88px; width: 100px;
height: 32px; height: 32px;
border-radius: 8px; border-radius: 8px;
overflow: hidden;" overflow: hidden;"
:value="afterStartValue" v-model:value="afterStartValue"
></a-input-number> ></a-input-number>
<span style="color: #999999; margin-left: 8px">分钟</span> <span style="color: #999999; margin-left: 8px">分钟</span>
</div> </div>
@@ -233,7 +240,7 @@
</div> </div>
<div class="btnbox"> <div class="btnbox">
<a-checkbox v-model:checked="innerPersion" @click="innerPersion=!innerPersion">允许项目内人员临时到场参加</a-checkbox> <a-checkbox v-model:checked="innerPersion" @click="innerPersion=!innerPersion">允许项目内人员临时到场参加</a-checkbox>
<a-checkbox v-model:checked="outPerson" @click="outPerson=!outPerson">允许项目外人员临时到场参加</a-checkbox> <a-checkbox v-model:checked="outPersion" @click="outPersion=!outPersion">允许项目外人员临时到场参加</a-checkbox>
</div> </div>
</div> </div>
<div class="main_item2"> <div class="main_item2">
@@ -348,7 +355,7 @@ import { ProjectEditTask, RouterEditTask } from "@/api/indexTask";
import { message } from "ant-design-vue"; import { message } from "ant-design-vue";
import { getMemberInfo } from "@/api/index1"; import { getMemberInfo } from "@/api/index1";
import { debounce } from "lodash-es"; import { debounce } from "lodash-es";
import { queryFaceDetailById, editPlan } from "../../api/indexFace"; import { queryFaceDetailById,editPlan } from "../../api/indexFace";
import dayjs from "dayjs"; import dayjs from "dayjs";
import AssessmentList from "../drawers/ AssessmentList.vue"; import AssessmentList from "../drawers/ AssessmentList.vue";
// import { toDate } from "../../api/method";、 // import { toDate } from "../../api/method";、
@@ -432,8 +439,8 @@ export default {
courseName: "", courseName: "",
duration:null, duration:null,
address: null, address: null,
beforeStartValue:20, before:null,
afterStartValue:10, afterStartValue:null,
description: "", description: "",
chooseTime: [], chooseTime: [],
fileList: [], fileList: [],
@@ -443,7 +450,10 @@ export default {
EditWorkId:null, EditWorkId:null,
assessmentVisible:false, assessmentVisible:false,
needEval:false, needEval:false,
onlySign:false,
completeLeave:false,
innerPersion:false,
outPersion:false,
}); });
const clear = () => { const clear = () => {
@@ -451,21 +461,21 @@ export default {
state.memberValue = null; state.memberValue = null;
state.duration = null; state.duration = null;
state.address = null; state.address = null;
state.beforeStart = 0; state.before=null;
state.afterStartValue =0; state.afterStartValue=null;
state.chooseTime = []; state.chooseTime = [];
state.description =""; state.description ="";
state.onlySign =false; state.onlySign =false;
state.completeLeave =false; state.completeLeave =false;
state.projectMember =false; state.innerPersion =false;
state.noProjectMember =false; state.outPersion =false;
state.chooseCourse = null; state.chooseCourse = null;
state.EditTestId =null; state.EditTestId =null;
state.assessmentId=null; state.assessmentId=null;
state.EditWorkId=null; state.EditWorkId=null;
state.EditEvalId=null; state.EditEvalId=null;
state.applyFlag=""; state.applyFlag="";
console.log("state.afterStart",state.afterStartValue); state.needEval=false;
}; };
const closeDrawer = () => { const closeDrawer = () => {
ctx.emit("update:addfaceteachVisible", false); ctx.emit("update:addfaceteachVisible", false);
@@ -512,7 +522,7 @@ export default {
//查询面授 //查询面授
const queryFaceTeach = () => { const queryFaceTeach = () => {
console.log("props.EditFaceI========d",props.EditFaceId);
queryFaceDetailById(props.EditFaceId).then((res) => { queryFaceDetailById(props.EditFaceId).then((res) => {
console.log("获取到了面授课开课详情", res.data.data); console.log("获取到了面授课开课详情", res.data.data);
let result = res.data.data; let result = res.data.data;
@@ -529,63 +539,67 @@ export default {
state.chooseTime = []; state.chooseTime = [];
} }
state.address = result.address; state.address = result.address;
state.beforeStart = result.beforeStart; state.before =result.beforeStart;
state.afterStartValue = result.afterStart; state.afterStartValue = result.afterStart;
console.log("编辑========",state.afterStartValue);
state.fileList = JSON.parse(result.attach); state.fileList = JSON.parse(result.attach);
state.EditWorkId = result.homeWorkId; state.EditWorkId = result.homeWorkId;
state.onlySign = result.completeType.split(",")[0]=="1"?true:false; state.onlySign = result.completeType.split(",")[0]=="1"?true:false;
state.completeLeave =result.completeType.split(",")[1]=="1"?true:false; state.completeLeave =result.completeType.split(",")[1]=="1"?true:false;
state.chooseCourse =result.offcourseId; state.chooseCourse =result.offcourseId;
state.projectMember = result.projectMember.split(",")[0]=="1"?true:false; state.innerPersion = result.projectMember.split(",")[0]=="1"?true:false;
state.noProjectMember = result.projectMember.split(",")[1]=="1"?true:false; state.outPersion = result.projectMember.split(",")[1]=="1"?true:false;
state.EditTestId = result.testId; state.EditTestId = result.testId;
state.EditWorkId=result.homeWorkId; state.EditWorkId=result.homeWorkId;
state.assessmentId =result.evaluateId; state.assessmentId =result.evaluateId;
state.needEval = result.evaluateId;
console.log("state=======",state);
}); });
}; };
//新建或编辑面授 //新建或编辑面授
// 新增任务 // 新增任务
const updateFaceTeach = () => { const updateFaceTeach = () => {
console.log("v",state.beforeStart,"v",state.afterStartValue,"v",
state.applyFlag,"v",state.evalFlag,"v",state.completeType,"state.address",state.address);
if ( if (
/*
state.courseName == "" || state.courseName == "" ||
state.chooseCourse == null ||s state.chooseCourse == null ||
state.memberValue == "" || state.memberValue == "" ||
state.chooseTime == [] || state.chooseTime == [] ||
state.duration == "" || state.duration == "" ||
*/
state.address == "" state.address == ""
) { ) {
message.destroy(); message.destroy();
return message.warning("请输入必填字段"); return message.warning("请输入必填字段");
} else { } else {
let type =state.onlySign ? "1,":"0,";
let t = state.completeLeave?"1":"0";
let p=state.innerPersion?"1,":"0,";
let p1=state.outPersion?"1":"0";
let obj = { let obj = {
teacherId:state.memberValue.value, teacherId:state.memberValue.value,
teacher:state.memberValue.label, teacher:state.memberValue.label,
address:state.address, address:state.address,
applyFlag: state.applyFlag, applyFlag: state.applyFlag,
attach: JSON.stringify(state.fileList), attach: JSON.stringify(state.fileList),
afterStart:state.afterStartValue ||0, afterStart:state.afterStartValue || 0,
beforeStart:state.beforeStart, beforeStart:state.before || 0,
beginTime: parseInt( new Date(state.chooseTime[0].$d).getTime() / 1000), beginTime: parseInt( new Date(state.chooseTime[0].$d).getTime() / 1000),
completeType: state.onlySign? "1,":"0," + state.completeLeave?"1":"0", completeType:type.concat(t),
description: state.description, description: state.description,
endTime: parseInt(new Date(state.chooseTime[1].$d).getTime() / 1000), endTime: parseInt(new Date(state.chooseTime[1].$d).getTime() / 1000),
evalFlag:state.needEval?1:0, evalFlag:state.needEval?1:0,
evaluateId:state.assessmentId, evaluateId:state.assessmentId,
homeWorkId: state.EditWorkId, homeWorkId: state.EditWorkId,
name: state.courseName, name: state.courseName,
projectMember:state.innerPersion?"1,":"0," + state.outPerson?"1":"0", projectMember:p.concat(p1),
offcourseId:state.chooseCourse, offcourseId:state.chooseCourse,
offcoursePlanId:props.EditFaceId >0 ? props.EditFaceId : 0, offcoursePlanId:props.EditFaceId >0 ? props.EditFaceId : 0,
testId: state.EditTestId testId: state.EditTestId
}; };
console.log("obj============",obj,"6"+"9");
editPlan(obj) editPlan(obj)
.then((res) => { .then((res) => {
console.log("更新任务s's"); console.log("更新任务s's");