Commit c9d607c2 by Cat

zd 社团 教师电子档案

parent 0ef44e50
......@@ -93,11 +93,12 @@ export function getNoticeInfo(query) {
}
//老师查看列表
export function getTeacherTnfo(query) {
export function getTeacherTnfo(userId,query) {
return request({
url: '/teacherFiles/files/getTeachList',
url: `/teacherFiles/files/getTeachList/${userId}`,
// url: `/teacherFiles/files/getTeachList/${userId}`,
method: 'get',
params: query
params:query
})
}
......
<!--社团风采-->
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="标题" prop="theme">
<el-input v-model="queryParams.theme" placeholder="请输入标题" clearable />
<el-input
v-model="queryParams.theme"
placeholder="请输入标题"
clearable
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">新增
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete">删除
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除
</el-button>
</el-col>
</el-row>
<el-table v-loading="loading" ref="table" :data="picList" @selection-change="handleSelectionChange">
<el-table
v-loading="loading"
ref="table"
:data="picList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" type="index" width="80" />
<el-table-column label="风采主题" align="center" prop="theme" />
<el-table-column label="活动主题" align="center" prop="theme" />
<el-table-column label="附件" align="center" prop="file">
<template slot-scope="scope">
<el-image v-for="(item,index) in scope.row.file.split(',')" :key="index" style="width: 100px; height: 100px" :src="item" :preview-src-list="[item]">
<el-image
v-for="(item, index) in scope.row.file.split(',')"
:key="index"
style="width: 100px; height: 100px"
:src="item"
:preview-src-list="[item]"
>
</el-image>
</template>
</el-table-column>
<el-table-column label="是否发布" align="center" prop="isfb">
<template slot-scope="scope">
<el-switch v-model="scope.row.isShow" active-value="1" inactive-value="0"
@change="handleIsShow(scope.row)"></el-switch>
<el-switch
v-model="scope.row.isfb"
active-value="1"
inactive-value="2"
@change="handleIsShow(scope.row)"
></el-switch>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<!-- 未发布可以修改删除 -->
<div>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改
</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除
</el-button>
</div>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleCheck(scope.row)">查看
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleCheck(scope.row)"
>查看
</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改社团主题对话框 -->
<el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="90px" style="width: 80%; margin: auto">
<el-form-item prop="file" style="
<el-form
ref="form"
:model="form"
:rules="rules"
label-width="90px"
style="width: 80%; margin: auto"
>
<el-form-item
prop="file"
style="
display: flex;
text-align: center;
justify-content: center;
......@@ -76,20 +153,28 @@
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload"
>
<!-- <img v-for="(item,index) in form.file" :key="index" v-if="form.file" :src="item" class="avatar" />-->
<!-- <img v-for="(item,index) in form.file" :key="index" v-if="form.file" :src="item" class="avatar" />-->
<div v-if="form.file">
<img v-for="(item,index) in form.file" :key="index" :src="item" class="avatar" />
<img
v-for="(item, index) in form.file"
:key="index"
:src="item"
class="avatar"
/>
</div>
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</el-form-item>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="风采主题:" prop="theme">
<el-input :readonly="check == true ? true : false" v-model="form.theme" placeholder="请输入风采主题"
style="width: 100%" />
<el-form-item label="活动主题:" prop="theme">
<el-input
:readonly="check == true ? true : false"
v-model="form.theme"
placeholder="请输入活动主题"
style="width: 100%"
/>
</el-form-item>
</el-col>
</el-row>
......@@ -301,10 +386,10 @@ export default {
},
/** 新增按钮操作 */
handleAdd() {
this.uploadList = []
this.uploadList = [];
this.check = false;
this.reset();
console.log('form.file',this.form.file)
console.log("form.file", this.form.file);
this.open = true;
this.title = "新增社团风采";
},
......@@ -312,14 +397,11 @@ export default {
handleUpdate(row) {
this.reset();
const ids = row.id || this.ids;
this.uploadList = []
this.form.file = []
this.uploadList = [];
this.form.file = [];
listCommunityInfo(ids).then((response) => {
console.log('修改',response)
this.form = response.data;
this.form.file = response.data.file.split(',')
console.log("this.form.file", this.form.file);
this.form.file = response.data.file.split(",");
this.imageUrl = this.pev + this.form.picUrl;
this.open = true;
this.title = "修改园区照片";
......@@ -327,31 +409,23 @@ export default {
},
/** 查看按钮操作 */
handleCheck(row) {
this.uploadList = []
this.form.file = []
this.uploadList = [];
this.form.file = [];
this.check = true;
this.open = true;
const ids = row.id || this.ids;
listCommunityInfo(ids).then((response) => {
console.log('查看',response)
this.form = response.data;
console.log('this.form.file',this.form.file)
this.form.file = response.data.file.split(',');
console.log(this.form.file);
this.form.file = response.data.file.split(",");
this.open = true;
});
this.title = "查看社团风采";
},
// 上传成功回调
handleAvatarSuccess(res, file) {
console.log('Success res',res)
console.log('Success file',file)
if(res.code == 200){
this.uploadList.push( this.pev + res.fileName );
this.form.file = this.uploadList
console.log('this.uploadList',this.uploadList)
console.log('this.form.file',this.form.file)
if (res.code == 200) {
this.uploadList.push(this.pev + res.fileName);
this.form.file = this.uploadList;
}
// this.imageUrl = res.data.url;
......@@ -380,7 +454,6 @@ export default {
},
// 上传图片
uploadImage(file) {
console.log('file',file)
const fileData = file.file;
const formData = new FormData();
formData.append("file", fileData);
......@@ -392,7 +465,7 @@ export default {
this.imageUrl = this.pev + response.url;
// this.form.picUrl = process.env.VUE_APP_BASE_API + response.url
this.form.file = this.pev + response.url;
console.log(this.form.picUrl, "this.form.picUrl");
this.form.picUrl = response.url;
})
.catch((error) => {
this.uploadLoading = false;
......@@ -409,7 +482,7 @@ export default {
id: this.form.id,
theme: this.form.theme,
// file: this.form.file,
file:this.uploadList.toString()
file: this.uploadList.toString(),
};
console.log(params, "params");
editCommunityInfo(params)
......@@ -418,13 +491,13 @@ export default {
this.$message.success("修改成功");
this.open = false;
})
.catch((err) => { });
.catch((err) => {});
} else {
// 新增
const params = {
cid: this.$route.query.id,
theme: this.form.theme,
file:this.uploadList.toString()
file: this.uploadList.toString(),
};
console.log(params, "params");
addCommunityInfo(params)
......@@ -433,7 +506,7 @@ export default {
this.$message.success("新增成功");
this.open = false;
})
.catch((err) => { });
.catch((err) => {});
}
}
});
......@@ -444,7 +517,8 @@ export default {
if (ids) {
this.$modal
.confirm(
`是否确认删除选中的${Object.hasOwnProperty.call(ids, "length") ? ids.length : 1
`是否确认删除选中的${
Object.hasOwnProperty.call(ids, "length") ? ids.length : 1
}条数据?`
)
.then(() => {
......@@ -464,29 +538,50 @@ export default {
/** 是否发布 */
handleIsShow(row) {
console.log(row);
// console.log(row);
// const data = {
// id: row.id,
// };
// this.$modal
// .confirm("是否发布此信息?")
// .then(() => {
// this.$modal.loading("正在修改状态,请稍等...");
// isCommunityFb(data)
// .then((response) => {
// this.$modal.closeLoading();
// this.$message.success("修改成功");
// this.getList();
// })
// .catch((error) => {
// this.$modal.closeLoading();
// });
// })
// .catch(() => {
// // 取消操作时的逻辑
// });
const data = {
id: row.id,
};
this.$modal
.confirm()
.confirm(row.isShow === "1" ? "是否确认发布?" : "是否取消发布?")
.then(() => {
this.$modal.loading("正在修改状态,请稍等...");
isCommunityFb(data)
isCommunityFb(data, row.isShow)
.then((response) => {
this.$modal.closeLoading();
this.$message.success("修改成功");
this.$modal.msgSuccess("修改成功");
// this.getList();
})
.catch((error) => {
this.$modal.closeLoading();
row.isShow = row.isShow === "2" ? "1" : "2";
});
})
.catch(() => {
// 取消操作时的逻辑
row.isShow = row.isShow === "2" ? "1" : "2";
});
},
},
};
</script>
......
......@@ -64,7 +64,6 @@
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="序号" align="center" prop="id" width="80" /> -->
<el-table-column label="序号" align="center" type="index" width="80" />
<el-table-column label="姓名" align="center" prop="name" />
<el-table-column label="性别" align="center" prop="sex">
......@@ -173,60 +172,6 @@
@getStudentList="getStudentList"
@setStudentInfo="setStudentInfo"
></StudentInfoSelect>
<!-- 学生选择
<el-dialog title="学生选择" :visible="dialogVisible" width="45%">
<el-form ref="formStu" :model="formStu" :rules="rules" label-width="68px">
<el-row>
<el-col :span="12">
<el-form-item label="姓名:" prop="name">
<el-input v-model="formStu.name" placeholder="请选择学生姓名" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>
搜索
</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
<el-table
ref="tableStu"
:data="atuList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="35" align="center" />
<el-table-column
label="序号"
align="center"
type="index"
width="80"
/>
<el-table-column label="姓名" align="center" prop="name" />
<el-table-column label="性别" align="center" prop="name" />
<el-table-column label="级部" align="center" prop="name" />
<el-table-column label="班级" align="center" prop="name" />
<el-table-column label="身份证号" align="center" prop="name" />
</el-table>
</el-form>
<div slot="footer" class="dialog-footer" center>
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog> -->
</div>
</template>
......@@ -319,6 +264,8 @@ export default {
},
/** 设置学生信息 */
setStudentInfo(item) {
this.form.ids = item.id;
console.log(this.form.ids, "this.form.ids11111");
console.log(item, "item");
this.$set(this.form, "name", item.studentName);
this.$set(this.form, "sex", item.sex);
......@@ -397,7 +344,7 @@ export default {
if (this.form.id != null) {
// 修改
const paramsedit = {
id: this.form.id,
id: this.form.ids,
name: this.form.name,
sex: this.form.sex,
cardid: this.form.cardid,
......@@ -418,7 +365,7 @@ export default {
} else {
// 新增
// 获取当前登录人userId
const userName = this.$store.state.user.userId;
// const userName = this.$store.state.user.userId;
const params = {
cid: this.$route.query.id,
orgName: this.form.orgName,
......@@ -429,7 +376,7 @@ export default {
classes: this.form.classes,
orgPosition: this.form.orgPosition,
phone: this.form.phone,
userId: userName,
userId: this.form.ids,
};
addMemberInfo(params)
.then((response) => {
......
......@@ -593,11 +593,11 @@ export default {
/** 查询信息列表 */
getList() {
this.loading = true;
// const userName = this.$store.state.user;
// const userId = this.$store.state.user.userId;
// const noticeName = this.queryForm.noticeName;
const userId = this.$store.state.user.userId;
// queryForm.noticeName
const params = {
userId: this.$store.state.user.userId,
// userId: this.$store.state.user.userId,
noticeName: this.queryForm.noticeName,
};
// const params = {
......@@ -605,20 +605,11 @@ export default {
// pageSize: this.queryForm.pageSize,
// teacherId: this.$store.state.user.userId,
// };
getTeacherTnfo(params).then((res) => {
getTeacherTnfo(userId, params).then((res) => {
this.tableData = res.rows;
console.log(params, "params");
console.log(res, "res");
this.total = res.total;
// =======
// const userId = this.$store.state.user.userId;
// const noticeName = this.queryForm.noticeName;
// console.log(userId, 'userId');
// console.log(noticeName, 'noticeName');
// getTeacherTnfo(userId, noticeName).then((res) => {
// this.tableData = res.rows;
// console.log(res, "res");
// >>>>>>> 026f530da388d11c389acb34cb726a7be3a375cf
});
},
......
......@@ -610,11 +610,26 @@ export default {
syncNotice(id).then((res) => {
console.log(id, "id");
console.log("res提取", res);
this.tableFirstData = res;
this.tableSecondData = res;
this.tableThirdData = res;
this.tableForthData = res;
this.$modal.msgSuccess("提取成功");
// this.tableFirstData = res;
// this.tableSecondData = res;
// this.tableThirdData = res;
// this.tableForthData = res;
});
// const id = this.form.id;
// this.$modal
// .confirm("是否提取信息?")
// .then(function () {
// return syncNotice(id);
// })
// .then(() => {
// this.$modal.msgSuccess("提取成功");
// this.tableFirstData = res;
// this.tableSecondData = res;
// this.tableThirdData = res;
// this.tableForthData = res;
// })
// .catch(() => {});
},
//修改按钮
handleEdit(row) {
......
......@@ -225,26 +225,17 @@ export default {
confirmDialog() {
const params = {
ids: this.selectedRows.map((row) => row.id),
// userId: this.selectedRows.map((row) => row.userId),
// tid: this.selectedRows.map((row) => row.tid),
// gid: this.selectedRows.map((row) => row.gid),
// gruoName: this.selectedRows.map((row) => row.gruoName),
// userName: this.selectedRows.map((row) => row.userName),
ids: this.selectedRows.map((row) => row.id), //查看数据的id
userId: this.selectedRows.map((row) => row.userId),
tid: this.selectedRows.map((row) => row.tid),
gid: this.selectedRows.map((row) => row.gid),
gruoName: this.selectedRows.map((row) => row.gruoName),
userName: this.selectedRows.map((row) => row.userName),
};
// this.$refs["tab"].validate((valid) => {
// if (valid) {
// addTeachaer(params)
// .then((response) => {
// this.getList();
// this.$message.success("新增成功");
// this.tableadd = false;
// })
// .catch((err) => {});
// }
// });
// const ids = this.selectedRows.map((row) => row.id);
addTeachaer(params).then((res) => {
let data = [];
data.push(params);
addTeachaer(data).then((res) => {
console.log(res, "ressss");
});
},
......
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