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