Commit 89e6db88 authored by 罗超's avatar 罗超

1

parent 2b3d2c85
...@@ -8,72 +8,75 @@ ...@@ -8,72 +8,75 @@
> >
<q-card style="width: 600px"> <q-card style="width: 600px">
<q-card-section> <q-card-section>
<div class="text-h6">{{ objOption.Id == 0 ? "新增" : "修改" }}</div> <div class="text-h6">
{{ dataList.some((e) => e.FeedBackId > 0) ? "修改" : "新增" }}
</div>
</q-card-section> </q-card-section>
<q-card-section class="q-pt-none scroll" style="max-height: 70vh"> <q-card-section class="q-pt-none scroll" style="max-height: 70vh">
<div class="text-caption q-mb-lg q-px-md text-grey-6">课程反馈</div> <div class="text-caption q-mb-lg q-px-md text-grey-6">课程反馈</div>
<div class="row wrap"> <div v-for="(item, index) in dataList" :key="index">
<!-- <q-input <div class="row wrap" style="margin: 20px 0 10px 0">
filled {{ item.GuestName }}:
stack-label </div>
maxlength="5" <div class="row wrap">
:dense="false" <q-select
v-model.number="objOption.Score" filled
ref="MenuUrl" stack-label
class="col-6 q-pr-lg q-pb-lg" class="col-6 q-pr-lg q-pb-lg"
label="评分" v-model="item.Score"
/> --> :options="ScoreOpts"
<q-select emit-value
filled map-options
stack-label label="评分"
class="col-6 q-pr-lg q-pb-lg" />
v-model="objOption.Score" </div>
:options="ScoreOpts" <div class="row">
emit-value <q-input
map-options v-model="item.Comment"
label="评分" filled
/> stack-label
</div> type="textarea"
<div class="row"> label="评语"
<q-input style="width: 100%"
v-model="objOption.Comment" />
filled </div>
stack-label
type="textarea" <div class="row wrap" style="padding-top: 20px">
label="评语" <div style="display: flex; flex-wrap: wrap">
style="width: 100%" <div
/> v-if="item.PhotoList && item.PhotoList.length > 0"
</div> v-for="(item1, index1) in item.PhotoList"
<div class="row wrap" style="padding-top: 20px"> :key="index1"
<div style="display: flex; flex-wrap: wrap"> >
<div <div class="ItemImgDiv">
v-if="objOption.PhotoList && objOption.PhotoList.length > 0" <q-img
v-for="(item, index) in objOption.PhotoList" :src="item1"
> spinner-color="white"
<div class="ItemImgDiv"> style="height: 100%; height: 100%"
<q-img />
:src="item" <q-btn
spinner-color="white" size="7px"
style="height: 100%; height: 100%" @click="deleteItemImg(index, index1)"
/> style="position: absolute; right: -5px; top: -5px"
<q-btn round
size="7px" color="red"
@click="deleteItemImg(index)" icon="iconfont icon-guanbi1"
style="position: absolute; right: -5px; top: -5px" />
round </div>
color="red"
icon="iconfont icon-guanbi1"
/>
</div> </div>
<el-upload
class="avatar-uploader addDutyMain"
action=""
:before-upload="
(file) => {
return uploadFile(file, index);
}
"
:show-file-list="false"
>
<i class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</div> </div>
<el-upload
class="avatar-uploader addDutyMain"
action=""
:before-upload="uploadFile"
:show-file-list="false"
>
<i class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</div> </div>
</div> </div>
</q-card-section> </q-card-section>
...@@ -107,64 +110,20 @@ export default { ...@@ -107,64 +110,20 @@ export default {
type: Array, type: Array,
default: null, default: null,
}, },
saveObj: {
type: Object,
default: null,
},
}, },
data() { data() {
return { return {
persistent: true, persistent: true,
saveLoading: false, saveLoading: false,
objOption: {
OrderGuestId: 0,
ClassTimeId: 0,
School_Id: 0,
Score: 0,
TeacherId: 0,
ClassPlanId: 0,
ClassId: 0,
Comment: "",
PhotoList: [],
FeedBackId: 0,
},
rowindex: 0, rowindex: 0,
ScoreOpts: [0, 1, 2, 3, 4, 5], ScoreOpts: [0, 1, 2, 3, 4, 5],
dataList: [],
}; };
}, },
mounted() { mounted() {
this.initData(); this.dataList = this.arr;
}, },
methods: { methods: {
initData() {
if (this.saveObj && this.saveObj.ClassTimeId > 0) {
this.rowindex = this.saveObj.index;
this.objOption.FeedBackId = this.saveObj.FeedBackId;
this.objOption.PhotoList = this.saveObj.PhotoList;
this.objOption.Comment = this.saveObj.Comment;
this.objOption.ClassId = this.saveObj.ClassId;
this.objOption.ClassPlanId = this.saveObj.ClassPlanId;
this.objOption.TeacherId = this.saveObj.Teacher_Id;
this.objOption.Score = this.saveObj.Score;
this.objOption.School_Id = this.saveObj.School_Id;
this.objOption.ClassTimeId = this.saveObj.ClassTimeId;
this.objOption.OrderGuestId = this.saveObj.OrderGuestId;
} else {
this.objOption.FeedBackId = 0;
this.objOption.PhotoList = [];
this.objOption.Comment = "";
this.objOption.ClassId = 0;
this.objOption.ClassPlanId = 0;
this.objOption.TeacherId = 0;
this.objOption.Score = 0;
this.objOption.School_Id = 0;
this.objOption.ClassTimeId = 0;
this.objOption.OrderGuestId = 0;
}
console.log(135, this.saveObj);
console.log(136, this.objOption);
},
//关闭弹窗 //关闭弹窗
closeSaveForm() { closeSaveForm() {
this.$emit("close"); this.$emit("close");
...@@ -173,7 +132,7 @@ export default { ...@@ -173,7 +132,7 @@ export default {
//保存 //保存
saveData() { saveData() {
this.saveLoading = true; this.saveLoading = true;
setFeedBack(this.objOption) setFeedBack(this.arr)
.then((res) => { .then((res) => {
this.saveLoading = false; this.saveLoading = false;
this.$q.notify({ this.$q.notify({
...@@ -190,13 +149,14 @@ export default { ...@@ -190,13 +149,14 @@ export default {
this.saveLoading = false; this.saveLoading = false;
}); });
}, },
uploadFile(files) { uploadFile(files, index) {
console.log(files, index, this.dataList);
let type = let type =
files.type.indexOf("video") != -1 || files.type.indexOf("image") != -1; files.type.indexOf("video") != -1 || files.type.indexOf("image") != -1;
if (type) { if (type) {
UploadSelfFile("studentIcon", files, (res) => { UploadSelfFile("studentIcon", files, (res) => {
if (res.Code == 1) { if (res.Code == 1) {
this.objOption.PhotoList.push(res.FileUrl); this.dataList[index].PhotoList.push(res.FileUrl);
} }
}); });
} else { } else {
...@@ -209,8 +169,8 @@ export default { ...@@ -209,8 +169,8 @@ export default {
} }
}, },
//删除图片 //删除图片
deleteItemImg(index) { deleteItemImg(index, index1) {
this.objOption.PhotoList.splice(index, 1); this.dataList[index].PhotoList.splice(index1, 1);
}, },
}, },
}; };
......
...@@ -8,40 +8,46 @@ ...@@ -8,40 +8,46 @@
separator="none" separator="none"
:data="tableData" :data="tableData"
:columns="columns" :columns="columns"
row-key="FeedBackId" row-key="OrderGuestId"
selection="multiple" selection="multiple"
:selected.sync="selected" :selected.sync="selected"
> >
<template v-slot:top> <template v-slot:top>
<div class="col-2 q-table__title">课程反馈</div> <div class="col-2 q-table__title">课程反馈</div>
<q-space></q-space> <q-space></q-space>
<q-btn color="accent" size="sm" label="新增" @click="showForm" /> <q-btn
color="accent"
size="sm"
:label="selected.some((e) => e.FeedBackId > 0) ? '修改' : '新增'"
@click="showForm"
:disabled="selected.length === 0"
/>
</template> </template>
<template v-slot:body-cell-Score="props"> <!-- <template v-slot:body-cell-Score="props">
<q-td auto-width :props="props"> <q-td auto-width :props="props">
<q-rating <q-rating
v-model="props.Score" v-model="props.row.Score"
size="3.5em" size="3.5em"
icon="img:https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/rate.png" icon="img:https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/rate.png"
/> />
</q-td> </q-td>
</template> </template> -->
<template v-slot:body-cell-optioned="props"> <!-- <template v-slot:body-cell-optioned="props">
<q-td> <q-td>
<q-btn <q-btn
size="xs" size="xs"
color="accent" color="accent"
label="修改" :label="props.row.FeedBackId > 0 ? '修改' : '新增'"
@click="Edit(props.row, props.rowIndex)" @click="Edit(props.row, props.rowIndex)"
/> />
</q-td> </q-td>
</template> </template> -->
<template v-slot:bottom> </template> <template v-slot:bottom> </template>
</q-table> </q-table>
<feedback-form <feedback-form
v-if="isShowForm" v-if="isShowForm"
:save-obj="ObjOption" :save-obj="ObjOption"
:arr="tableData" :arr="selected"
@close="closeSaveForm" @close="closeSaveForm"
@success="refreshPage" @success="refreshPage"
> >
...@@ -92,13 +98,13 @@ export default { ...@@ -92,13 +98,13 @@ export default {
{ {
name: " CreateTimeStr", name: " CreateTimeStr",
label: "上课时间", label: "上课时间",
field: " CreateTimeStr", field: "CreateTimeStr",
align: "left", align: "left",
}, },
{ {
name: " Score", name: " Score",
label: "评分", label: "评分",
field: " Score", field: "Score",
align: "left", align: "left",
}, },
{ {
...@@ -107,12 +113,12 @@ export default { ...@@ -107,12 +113,12 @@ export default {
field: "Comment", field: "Comment",
align: "left", align: "left",
}, },
{ // {
name: "optioned", // name: "optioned",
label: "操作", // label: "操作",
field: "optioned", // field: "optioned",
align: "left", // align: "left",
}, // },
], ],
tableData: [], tableData: [],
isShowForm: false, isShowForm: false,
...@@ -130,12 +136,12 @@ export default { ...@@ -130,12 +136,12 @@ export default {
}, },
//修改 //修改
Edit(obj, index) { Edit(obj, index) {
if (obj) { // if (obj) {
this.ObjOption = obj; // this.ObjOption = obj;
this.ObjOption.index = index; // this.ObjOption.index = index;
} else { // } else {
this.ObjOption = null; // this.ObjOption = null;
} // }
this.isShowForm = true; this.isShowForm = true;
}, },
//关闭弹窗 //关闭弹窗
...@@ -144,8 +150,6 @@ export default { ...@@ -144,8 +150,6 @@ export default {
}, },
//刷新页面 //刷新页面
refreshPage() { refreshPage() {
if (!this.ObjOption) {
}
this.getData(); this.getData();
}, },
showForm() { showForm() {
......
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