Commit 6a22c474 authored by 杨梦雪's avatar 杨梦雪

11

parent 0141615f
......@@ -14,15 +14,7 @@ export function getTeacherWork(data) {
params: data
})
}
// 下载老师作业
export function downloadTeacherWork(data) {
data['identity'] = store.state.indexIdentity;
return request({
method: 'get',
url: '/web/download/downloadTeacherWork',
params: data
})
}
// 获取学生上传作业的oss
export function PostWorkStudentOss(data) {
data['identity'] = store.state.indexIdentity;
......@@ -38,7 +30,7 @@ export function delPic(data) {
return request({
method: 'post',
url: '/web/download/delPic',
params:data
params: data
})
}
......
......@@ -5,21 +5,21 @@ import {
import store from '@/store'
// 获取学生提交的营地作业
export function getStudentWork(data) {
// 获取资料(个人信息)
export function getAccountInfo(data) {
data['identity'] = store.state.indexIdentity;
return request({
method: 'post',
url: '/web/download/getStudentWork ',
url: '/web/signUp/getAccountInfo',
data
})
}
// 提交营地作业
export function subStudentWork(data) {
// 保存个人资料
export function setAccountInfo(data) {
data['identity'] = store.state.indexIdentity;
return request({
method: 'post',
url: '/web/download/subStudentWork ',
url: '/web/signUp/setAccountInfo',
data
})
}
......@@ -5,7 +5,12 @@
<!-- <div class="bg-top"></div> -->
<div class="bg-top">
<el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item
:to="{
path: '/signUp/examInfo?code=' + $store.state.indexIdentity,
}"
>首页</el-breadcrumb-item
>
<el-breadcrumb-item>活动管理</el-breadcrumb-item>
</el-breadcrumb>
</div>
......@@ -101,12 +106,11 @@ export default {
window.removeEventListener("resize", this.onResize, true);
},
methods: {
ToSignUp(index) {
console.log(index, "index");
let code = this.$store.state.indexIdentity;
this.campindex_type = index;
console.log(this.$route)
console.log(this.$route);
// if (this.campindex_type == 0) {
// this.$router.push("Info/personalInfo?code=" + code);
// } else
......
......@@ -7,6 +7,7 @@
class="checkForm"
:rules="referInfoRules"
>
<!-- 个人信息 -->
<div class="cont_title">个人信息</div>
<el-row :gutter="20">
<el-col :span="12">
......@@ -210,34 +211,40 @@
</el-form-item>
</el-col>
</el-row>
<!-- 收件信息 (不可编辑) -->
<div class="cont_title">收件信息</div>
<el-form :model="addressForm" >
<el-form :model="addressForm">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="收件人" prop="certificate_name">
<el-input
v-model="addressForm.certificate_name"
placeholder="填写真实姓名"
size="small"
clearable
:disabled="true"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="收件人电话" prop="certificate_phone">
<el-input
v-model="addressForm.certificate_phone"
placeholder="填写真实电话"
size="small"
clearable
:disabled="true"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="收货地址" prop="certificate_province">
<el-select
ref="certificate_province"
v-model="addressForm.certificate_province"
clearable
:disabled="true"
placeholder="选择省份"
@change="changeProvince($event)"
@change="changeProvince(3, $event)"
>
<el-option
v-for="item in selectProvince"
......@@ -254,7 +261,7 @@
<el-select
ref="certificate_city"
v-model="addressForm.certificate_city"
clearable
:disabled="true"
placeholder="选择城市"
>
<el-option
......@@ -284,11 +291,10 @@
</el-option>
</el-select> -->
<el-input
v-model="county"
placeholder="选择所在区县"
size="small"
clearable
:disabled="true"
></el-input>
</el-form-item>
</el-col>
......@@ -299,8 +305,7 @@
v-model="certificate_address"
placeholder="填写详细地址"
size="small"
clearable
@change="getCertificate_address"
:disabled="true"
></el-input>
</el-form-item>
</el-form>
......@@ -314,12 +319,11 @@
<script>
/* eslint-disable */
import {
getAccount,
setAccount,
getProAndCity,
getSchool,
} from "r/index/signUp";
import { getStudentWork, subStudentWork } from "r/index/info";
import { getAccountInfo, setAccountInfo } from "r/index/info";
import { getAddress } from "r/index/certificate";
import validator from "common/validator";
......@@ -513,6 +517,17 @@ export default {
resultPicture: "",
dialogVisible: false,
disabled: false, //限制输入框
// 收货信息模块
// 收件地址-地址栏
addressForm: {
certificate_name: "",
certificate_phone: "",
certificate_province: null,
certificate_city: null,
certificate_address: "",
},
county: "", //区县
certificate_address: "", //详细地址
};
},
mounted() {},
......@@ -532,10 +547,11 @@ export default {
this.getProAndCity();
this.getTenYear();
this.getAccount(); // 页面信息个人获取
this.getAddress(); //收件信息获取
},
watch: {
referForm(val) {
// console.log(val, "val");
console.log(val, "val");
for (var k in val) {
if (val[k] == null || !val[k]) {
val[k] = this.referForm[k];
......@@ -587,6 +603,28 @@ export default {
},
},
methods: {
// 收件信息获取
getAddress() {
// console.log(111111)
getAddress({}).then((res) => {
// console.log(res, "getAddress");
if (res.data.code != 200) {
return this.$message.error(res.data.message);
}
this.addressForm.certificate_name = res.data.info.certificate_name;
this.addressForm.certificate_phone = res.data.info.certificate_phone;
this.addressForm.certificate_province =
res.data.info.certificate_province;
this.addressForm.certificate_city = res.data.info.certificate_city;
this.selectCitySchool = this.getCurrentCityLists(
this.addressForm.certificate_province
);
this.county = res.data.info.certificate_address.split("-")[0];
this.certificate_address =
res.data.info.certificate_address.split("-")[1];
// console.log(res.data.info.certificate_address.split("-"))
});
},
//获取近10年的年份
getTenYear() {
let nowDate = new Date();
......@@ -608,8 +646,8 @@ export default {
},
// 页面信息个人获取
getAccount() {
getAccount({}).then((res) => {
// console.log(res, "getAccount");
getAccountInfo({}).then((res) => {
console.log(res, "getAccountInfo");
if (res.data.code != 200) {
return this.$message.error(res.data.message);
}
......@@ -637,6 +675,8 @@ export default {
getyear() {
this.referForm.start_school_date =
this.start_year.toString() + "-" + this.start_grade.toString();
console.log( this.referForm.start_school_date);
},
// 获取省份城市
getProAndCity() {
......@@ -815,7 +855,7 @@ export default {
this.scrollView(object);
return false;
}
setAccount(this.referForm).then((res) => {
setAccountInfo(this.referForm).then((res) => {
// console.log(res, "setAccount");
if (res.data.code != 200) {
if (res.data.code == 400068) {
......@@ -830,6 +870,7 @@ export default {
// let code = this.$store.state.indexIdentity;
// this.$router.push("/signUp/check?code=" + code);
this.referForm = res.data.data;
// this.getAccount(); // 页面信息个人获取(刷新)
});
});
},
......
......@@ -114,7 +114,6 @@
</el-option>
</el-select> -->
<el-input
v-model="county"
placeholder="选择所在区县"
size="small"
......@@ -130,7 +129,6 @@
placeholder="填写详细地址"
size="small"
clearable
@change="getCertificate_address"
></el-input>
</el-form-item>
</el-form>
......@@ -179,9 +177,9 @@ export default {
trigger: "change",
},
],
county: [
{ required: true, message: "请选择所在区县!", trigger: "blur" },
],
// county: [
// { required: true, message: "请选择所在区县!", trigger: "blur" },
// ],
certificate_address: [
{ required: true, message: "详细地址不能为空!", trigger: "blur" },
],
......@@ -217,25 +215,17 @@ export default {
}
this.addressForm.certificate_name = res.data.info.certificate_name;
this.addressForm.certificate_phone = res.data.info.certificate_phone;
this.addressForm.certificate_province =
res.data.info.certificate_province;
this.addressForm.certificate_province = res.data.info.certificate_province;
this.addressForm.certificate_city = res.data.info.certificate_city;
this.getCurrentCityLists(this.addressForm.certificate_city, true);
this.selectCitySchool = this.getCurrentCityLists(this.addressForm.certificate_province);
this.county = res.data.info.certificate_address.split("-")[0];
this.certificate_address =
res.data.info.certificate_address.split("-")[1];
// console.log(res.data.info.certificate_address.split("-"))
this.certificate_address = res.data.info.certificate_address.split("-")[1];
});
},
getCertifi() {
this.dialogVisible = true;
},
getCertificate_address() {
this.addressForm.certificate_address =
this.county.toString() + "-" + this.certificate_address.toString();
},
// 获取省份城市
getProAndCity() {
getProAndCity({}).then((res) => {
......@@ -244,8 +234,7 @@ export default {
return this.$message.error(res.data.message);
}
this.selectProvince = res.data.province_list;
// this.CityName = res.data.city_list;
// console.log(this.selectProvince, this.CityName);
this.CityName = res.data.city_list;
});
},
......@@ -261,7 +250,7 @@ export default {
//返回当前省份下的城市列表
getCurrentCityLists(val) {
console.log(val)
console.log(val);
let currentCity = [];
if (
this.CityName == null ||
......@@ -270,12 +259,8 @@ export default {
) {
getProAndCity({})
.then((res) => {
// console.log(res, "getProAndCity");
if (res.data.code === 200) {
// this.selectProvince = res.data.province_list;
this.CityName = res.data.city_list;
console.log(this.CityName)
for (let key in this.CityName) {
if (this.CityName[key].parent_id == val) {
currentCity.push(this.CityName[key]);
......@@ -301,12 +286,15 @@ export default {
},
// 提交
setAddress() {
this.addressForm.certificate_address =
this.county.toString() + "-" + this.certificate_address.toString();
this.$refs["addressRef"].validate((valid, object) => {
console.log(valid, "valid");
if (!valid) {
return false;
}
});
setAddress(this.addressForm).then((res) => {
// console.log(res, "setAddress");
if (res.data.code != 200) {
......
......@@ -16,7 +16,9 @@
<div class="top flex">
<div class="homework_name flex">
<div>作业名称:{{ item.work_name }}</div>
<span>未完成</span>
<span v-if="item.student_status == 0">未完成</span>
<span v-if="item.student_status == 1">待评分</span>
<span v-if="item.student_status == 2">已评分</span>
</div>
<el-button size="mini" round @click="toRefer(item)"
>查看作业</el-button
......@@ -42,6 +44,7 @@
:work_contexts="work_context"
:enclosure_urls="enclosure_url"
:work_nums="work_num"
:student_status="student_status"
@closeDialog="closeDialog"
></refer>
</div>
......@@ -63,6 +66,7 @@ export default {
work_context: "",
enclosure_url: "",
work_num: 0,
student_status: 0,
};
},
created() {
......@@ -83,6 +87,7 @@ export default {
this.work_context = item.work_context;
this.enclosure_url = item.enclosure_url;
this.work_num = item.work_num;
this.student_status = item.student_status;
},
getTeacherWork() {
getTeacherWork({ page: 1 }).then((res) => {
......@@ -144,10 +149,11 @@ export default {
.home_content {
padding-bottom: 200px;
font-size: 13px;
.each_content {
padding: 25px 30px;
background-color: #eceaea;
margin: 0 30px;
margin: 0 30px 20px 30px;
// border-radius: 25px;
.top {
margin-bottom: 10px;
......
......@@ -16,6 +16,7 @@
label-position="top"
class="readForm"
>
<!-- 老师布置的作业 -->
<div class="cont_title">
<div class="line"></div>
<div class="lf">
......@@ -27,9 +28,9 @@
<div class="cont_title_2">相关附件</div>
<div class="upload_box">
<div
v-if="stuFileList.length > 0"
v-if="teaFileList.length > 0"
class="img_list"
v-for="(item, index) in stuFileList"
v-for="(item, index) in teaFileList"
:key="index"
>
<div>
......@@ -40,7 +41,7 @@
</div>
</div>
</div>
<div v-if="stuFileList.length <= 0" class="img_list">
<div v-if="teaFileList.length <= 0" class="img_list">
<div>
<div class="item_name">暂无相关附件</div>
</div>
......@@ -48,9 +49,11 @@
<div style="clear: both"></div>
</div>
<!-- 我的作业 -->
<div v-if="this.student_status == 0 || this.student_status == 1">
<div class="cont_title">
<div class="line"></div>
评阅结果
我的作业
</div>
<el-form-item
label="文字描述(如超过300字,建议以附件形式上传)"
......@@ -65,7 +68,6 @@
show-word-limit
/>
</el-form-item>
<el-form-item label="相关附件" prop="teacherUrl">
<div class="fj_info">1、请上传1-10份相关附件;</div>
<div class="fj_info">
......@@ -74,22 +76,24 @@
<div class="upload_box">
<div
class="img_list"
v-for="(item, index) in fileList"
v-for="(item, index) in stuFileList"
:key="index"
>
<div>
<el-image :src="fileImg"></el-image>
<div class="item_name">{{ item.name }}</div>
<div class="item_remove" @click="handleRemove(item)">删除</div>
<div class="item_remove" @click="handleRemove(item)">
删除
</div>
</div>
</div>
<el-upload
v-if="fileList.length < 10"
v-if="stuFileList.length < 10"
ref="systemLogo"
name="multipartFile"
action="#"
:file-list="fileList"
:file-list="stuFileList"
:disabled="isUploading || fileList.length >= 10"
:limit="10"
list-type="picture-card"
......@@ -109,9 +113,44 @@
></i>
</el-upload>
</div>
</el-form-item>
</div>
<!-- 评阅结果 -->
<div v-if="this.student_status == 2">
<div class="cont_title">
<div class="line"></div>
<div class="lf">
<span>评阅结果</span>
</div>
</div>
<div class="cont_title_2">导师评分</div>
<div class="cont_info">{{ score }}</div>
<div class="cont_title_2">作业内容</div>
<div v-html="this.teacher_commment" class="cont_info">}</div>
<div class="cont_title_2">相关附件</div>
<div class="upload_box">
<div
v-if="tea_scoreFileList.length > 0"
class="img_list"
v-for="(item, index) in tea_scoreFileList"
:key="index"
>
<div>
<el-image :src="fileImg"></el-image>
<div class="item_name">{{ item.name }}</div>
<div class="item_remove" @click="downloadScoreFile(item.url)">
下载
</div>
</div>
</div>
<div v-if="tea_scoreFileList.length <= 0" class="img_list">
<div>
<div class="item_name">暂无相关附件</div>
</div>
</div>
</div>
</div>
<el-form-item class="btn">
<el-button type="primary" @click="confirm">保存</el-button>
</el-form-item>
......@@ -123,14 +162,10 @@
<script>
import Bus from "config/bus.js";
import {
downloadTeacherWork,
PostWorkStudentOss,
delPic,
getStudentWork,
subStudentWork,
GetStuWork,
SaveTheRead,
GetAllReadInfo,
SaveYiRead,
} from "r/index/homework";
import fileImg from "@/assets/img/homework/file_img.png";
......@@ -141,6 +176,7 @@ export default {
work_contexts: [Number, String], //作业内容
enclosure_urls: [Object, String], //老师作业地址
work_nums: [Number],
student_status: [Number], //作业状态
},
data() {
return {
......@@ -162,25 +198,32 @@ export default {
upLoading: false, // 老师-上传loading
fileList: [],
stu_fileList: "",
disabled: false, //限制输入框
score: false, //老师评分
teacher_commment: false, //老师评语
tea_scoreFileList:[]
};
},
created() {
console.log(this.enclosure_urls);
let code = this.$store.state.indexIdentity;
let studentFile = window.localStorage.getItem(
"student_file_" + window.localStorage.getItem("phone" + code) + code
);
if (studentFile && JSON.parse(studentFile).length > 0) {
this.fileList = JSON.parse(studentFile);
this.stuFileList = JSON.parse(studentFile);
}
},
methods: {
open() {
console.log(this.stu_work_nums);
this.titleName = this.work_nums;
console.log(this.student_status);
this.getTeachList();
if (this.student_status == 0) {
} else if (this.student_status == 1) {
this.getStudentWork();
} else if (this.student_status == 2) {
this.getStudentWork();
}
},
//老师作业展示
getTeachList() {
......@@ -189,7 +232,7 @@ export default {
if (this.enclosure_urls) {
let arr = url.split(",");
arr.forEach((item) => {
this.stuFileList.push({
this.teaFileList.push({
url: item,
name: item.split("/work/")[1],
status: "success",
......@@ -199,16 +242,17 @@ export default {
this.stuFileList = [];
}
},
// 下载老师附件
downloadStuFile(url) {
this.download(
'http://api.campcenter.cn/web/download/downloadTeacherWork',
"http://api.campcenter.cn/web/download/downloadTeacherWork",
{
enclosure_url:url,
identity : this.$store.state.indexIdentity
enclosure_url: url,
identity: this.$store.state.indexIdentity,
},
''
)
""
);
// downloadTeacherWork({ enclosure_url:url }).then((res) => {
// console.log(res, "res");
// if (res.code != 200) {
......@@ -218,18 +262,59 @@ export default {
// });
// window.location.href = url;
},
// 下载老师评分结果
downloadScoreFile(url) {
this.download(
"http://api.campcenter.cn/web/download/downloadTeacherWork",
{
enclosure_url: url,
identity: this.$store.state.indexIdentity,
},
""
);
},
// 学生作业回显
getStudentWork() {
let stu_work_num = this.work_nums;
getStudentWork({ stu_work_num: stu_work_num }).then((res) => {
console.log(res);
if (res.data.code != 200) {
return this.$message.error(res.data.message);
}
this.$message.success(res.data.message);
console.log(res.data.stu_answer);
this.formData.stu_answer = res.data.data.stu_answer;
let gotfileList = res.data.data.stu_enclosure_url_arr;
this.stuFileList = gotfileList.map((item) => {
return {
name: item.split("/work/")[1],
url: item,
};
});
this.score = res.data.data.score; //老师评分
this.teacher_commment = res.data.data.teacher_commment; //老师评语
let scoreFileList = res.data.data.teacher_url;
this.tea_scoreFileList = scoreFileList.map((item) => {
return {
name: item.split("/work/")[1],
url: item,
};
});
});
},
// 保存按钮
confirm() {
this.$refs["formRef"].validate((valid) => {
if (!valid) return;
// if (this.type == 1) {
if (this.student_status == 0) {
// 未完成
this.notReadHandle();
// } else if (this.type == 2) {
} else if (this.student_status == 1) {
console.log(11111);
// 已完成
// this.yiReadHandle();
// }
this.yiReadHandle();
}
});
},
......@@ -240,10 +325,30 @@ export default {
subStudentWork(this.formData)
.then((response) => {
console.log(response);
if (response.code != 200) {
return this.$message.error(response.message);
if (response.data.code != 200) {
return this.$message.error(response.data.message);
}
this.$message.success(response.message);
this.$message.success(response.data.message);
this.cancelBtnTrue();
})
.catch((error) => {
console.log(error);
});
},
// 待评阅
yiReadHandle() {
let code = this.$store.state.indexIdentity;
this.formData.stu_work_num = this.work_nums;
this.formData.stu_enclosure_url = window.localStorage.getItem(
"student_file_" + window.localStorage.getItem("phone" + code) + code
);
subStudentWork(this.formData)
.then((response) => {
console.log(response);
if (response.data.code != 200) {
return this.$message.error(response.data.message);
}
this.$message.success(response.data.message);
this.cancelBtnTrue();
})
.catch((error) => {
......@@ -285,7 +390,7 @@ export default {
handleUploadProgress(event, file, fileList) {
// console.log(fileList);
this.isUploading = true;
if (this.fileList.lenge < 10) {
if (this.stuFileList.lenge < 10) {
return this.$message.info("chaochushuliamng");
}
},
......@@ -294,7 +399,7 @@ export default {
console.log(file, "file");
// console.log(fileList, "fileList");
this.referForm.achievementPath = res;
this.fileList = {
this.stuFileList = {
name: file.name,
url: res,
};
......@@ -325,7 +430,7 @@ export default {
};
await PostWorkStudentOss({
image: image,
stu_work_num: this.stu_work_nums,
stu_work_num: this.work_nums,
})
.then((res) => {
console.log(res, "开始上传图片");
......@@ -357,6 +462,7 @@ export default {
savefile: res.data.config.savefile,
};
this.fileList.push(obj);
console.log( this.fileList)
// let stu_obj={
// url: ress.data.picture_path,
......@@ -368,7 +474,7 @@ export default {
return item.url;
})
.join(",");
// console.log(this.stu_fileList)
console.log(this.stu_fileList)
let code = this.$store.state.indexIdentity;
window.localStorage.setItem(
"student_file_" +
......@@ -410,30 +516,34 @@ export default {
console.log(str, "str");
let savefile = str[1];
// console.log(savefile, "savefile");
delPic({ object: savefile }).then((res) => {
// console.log(res, "delpic");
let stu_work_num = this.work_nums;
delPic({ object: savefile, stu_work_num: stu_work_num }).then(
(res) => {
console.log(res, "delpic");
if (res.data.code != 200) {
return this.$message.error(res.data.message);
}
this.fileList.forEach((item, idx) => {
this.stuFileList.forEach((item, idx) => {
// console.log(item.url == file.url);
if (item.url == file.url) {
this.fileList.splice(idx, 1);
this.stuFileList.splice(idx, 1);
let code = this.$store.state.indexIdentity;
window.localStorage.setItem(
"student_file_" +
window.localStorage.getItem("phone" + code) +
code,
JSON.stringify(this.fileList)
JSON.stringify(this.stuFileList)
);
}
});
// console.log(this.fileList);
this.$message.success(res.data.message);
});
}
);
})
.catch((err) => {
console.log(err, "err");
this.$message({
type: "info",
message: "取消删除",
......@@ -446,15 +556,6 @@ export default {
dialogVisibleFu() {
this.dialogVisible = this.dialogVisibleFu;
},
campIdFu() {
this.campId = this.campIdFu;
},
stuInfoFu() {
this.stuInfo = this.stuInfoFu;
},
typeFu() {
this.type = this.typeFuFu;
},
},
};
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment