Commit e1fa51d3 authored by 黄奎's avatar 黄奎

页面修改

parent 0846dd7b
This diff is collapsed.
......@@ -8,26 +8,26 @@
<div class="col-2 q-table__title">意见调查信息</div>
<q-space />
<div class="page-option">
<q-btn color="accent" size="sm" icon="add" label="新增" @click="addObj(null)"/>
<q-btn color="accent" size="sm" icon="add" label="新增" @click="addObj(null)" />
</div>
</template>
<template v-slot:body-cell-IsRequired="props">
<template v-slot:body-cell-IsRequired="props">
<q-td :props="props">
<span v-if="props.row.IsRequired==0"></span>
<span v-if="props.row.IsRequired==1"></span>
</q-td>
</template>
<template v-slot:body-cell-IsShow="props">
<template v-slot:body-cell-IsShow="props">
<q-td :props="props">
<span v-if="props.row.IsShow==0"></span>
<span v-if="props.row.IsShow==1"></span>
</q-td>
</template>
<template v-slot:bottom>
<template v-slot:bottom>
<q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="pageCount"
:input="true" @input="changePage" />
</template>
<template v-slot:body-cell-optioned="props">
<template v-slot:body-cell-optioned="props">
<q-td :props="props">
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="编辑"
@click="addObj(props.row)" />
......@@ -35,156 +35,148 @@
@click="delQuestion(props.row)" />
</q-td>
</template>
</q-table>
<student-form v-if="isShowWenjuan" :save-obj="objOption" :ID="msg.ActivitySurveyId" @close="closeSaveForm" @success="resetSearch"></student-form>
</div>
</div>
</q-table>
<student-form v-if="isShowWenjuan" :save-obj="objOption" :ID="msg.SurveyId" @close="closeSaveForm"
@success="resetSearch"></student-form>
</div>
</div>
</template>
<script>
import studentForm from '../../components/activity/student-from'
import {
getActivitySurveyGuestPage,
removeActivitySurveyGuest
} from '../../api/studentmsg/index'
export default {
meta: {
title: "意见调查表"
},
components: {
studentForm
},
data() {
return {
columns: [{
name: 'Id',
label: 'ID',
align: 'left',
field: 'Id'
}, {
name: 'GuestName',
label: '学员名称',
field: 'GuestName',
align: 'left'
}, {
name: 'StartTime',
label: '开始时间',
field: 'StartTime',
align: 'left'
}, {
name: 'EndTime',
label: '结束时间',
field: 'EndTime',
align: 'left'
},
{
name: 'optioned',
label: '操作',
field: 'TId'
}
],
dataList: [],
loading: true,
msg: {
pageIndex: 1,
pageSize: 12,
rowsPerPage: 12,
SurveyId: 1,
},
import studentForm from '../../components/activity/student-from'
import {
getActivitySurveyGuestPage,
removeActivitySurveyGuest
} from '../../api/studentmsg/index'
export default {
meta: {
title: "意见调查表"
},
components: {
studentForm
},
data() {
return {
columns: [{
name: 'Id',
label: 'ID',
align: 'left',
field: 'Id'
}, {
name: 'GuestName',
label: '学员名称',
field: 'GuestName',
align: 'left'
}, {
name: 'StartTime',
label: '开始时间',
field: 'StartTime',
align: 'left'
}, {
name: 'EndTime',
label: '结束时间',
field: 'EndTime',
align: 'left'
},
pageCount: 0,
isShowWenjuan: false,
objOption: null,
}
{
name: 'optioned',
label: '操作',
field: 'TId'
}
],
dataList: [],
loading: true,
msg: {
pageIndex: 1,
pageSize: 12,
rowsPerPage: 12,
SurveyId: 0,
},
created() {
if (this.$route.query && this.$route.query.ID) {
this.msg.ActivitySurveyId = this.$route.query.ID;
pageCount: 0,
isShowWenjuan: false,
objOption: null,
}
},
created() {
if (this.$route.query && this.$route.query.ID) {
this.msg.SurveyId = this.$route.query.ID;
}
},
mounted() {
this.getList();
},
methods: {
resetSearch() {
this.msg.pageIndex = 1;
this.getList();
},
getList() {
this.loading = true;
getActivitySurveyGuestPage(this.msg).then(res => {
this.loading = false;
if (res.Code == 1) {
this.dataList = res.Data.PageData;
this.pageCount = res.Data.PageCount;
}
});
},
addObj(obj) {
if (obj) {
this.objOption = obj
} else {
this.objOption = null
}
this.isShowWenjuan = true;
},
//删除当前行信息
delQuestion(row) {
let that = this;
this.$q.dialog({
title: "提示",
message: '是否删除该活动信息?',
cancel: {
label: "取消",
flat: true
},
ok: {
label: "确认",
flat: true,
focus: true
}
}).onOk(() => {
removeActivitySurveyGuest({
Id: row.Id
}).then(res => {
if (res.Code == 1) {
that.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据删除成功!',
position: 'top'
})
that.getList();
} else {
that.$q.notify({
type: 'negative',
position: "top",
message: res.data.message,
})
}
},
mounted() {
this.getList();
},
methods: {
resetSearch() {
this.msg.pageIndex = 1;
this.getList();
},
getList() {
this.loading = true;
getActivitySurveyGuestPage(this.msg).then(res => {
this.loading = false;
if (res.Code == 1) {
this.dataList = res.Data.PageData;
this.pageCount = res.Data.PageCount;
}
console.log("res", res);
});
},
addObj(obj) {
if (obj) {
this.objOption = obj
} else {
this.objOption = null
}
this.isShowWenjuan = true;
},
//删除当前行信息
delQuestion(row) {
let that = this;
this.$q.dialog({
title: "提示",
message: '是否删除该活动信息?',
cancel: {
label: "取消",
flat: true
},
ok: {
label: "确认",
flat: true,
focus: true
}
}).onOk(() => {
removeActivitySurveyGuest({
Id: row.Id
}).then(res => {
this.dataList = '';
this.pageCount = '';
console.log(res + '111111')
if (res.Code == 1) {
that.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据删除成功!',
position: 'top'
})
that.getList();
} else {
that.$q.notify({
type: 'negative',
position: "top",
message: res.data.message,
})
}
})
})
},
closeSaveForm() {
this.isShowWenjuan = false;
},
changePage(val) {
this.msg.pageIndex = val;
this.getList();
},
},
}
})
})
},
closeSaveForm() {
this.isShowWenjuan = false;
},
changePage(val) {
this.msg.pageIndex = val;
this.getList();
},
},
}
</script>
<style lang="sass">
@import url('~assets/css/table.sass')
@import url('~assets/css/table.sass')
</style>
\ No newline at end of file
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