Commit e1fa51d3 authored by 黄奎's avatar 黄奎

页面修改

parent 0846dd7b
<style scoped> <style scoped>
.wenjuan_Shuru { .wenjuan_Shuru {
position: relative; position: relative;
} }
.SurverDel { .SurverDel {
position: absolute; position: absolute;
right: -5px; right: -5px;
top: -5px; top: -5px;
} }
</style> </style>
<template> <template>
<q-dialog <q-dialog v-model="persistent" content-class="bg-grey-1" persistent transition-show="scale" transition-hide="scale">
v-model="persistent" <q-card style="width: 500px;max-width:500px;">
content-class="bg-grey-1"
persistent
transition-show="scale"
transition-hide="scale"
>
<q-card style="width: 800px;max-width:800px;">
<q-card-section> <q-card-section>
<div class="text-h6">{{addMsg.ID==0?'新增学员':'修改学员'}}</div> <div class="text-h6">{{addMsg.ID==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="row wrap"> <div class="row wrap">
<!-- <q-select filled stack-label option-value="Id" option-label="Name" v-model="addMsg.SurveyType" <q-select filled stack-label clearable use-input option-value="Id" option-label="AccountName"
:options="platList" label="客户类型" ref="SurveyType" @input="getPlat()" :rules="[val => !!val || '请选择类型']" class="col-12 q-pb-lg" emit-value map-options /> v-model="addMsg.GuestId" :options="filterstudentList" @filter="filterStudentFn" label="学员编号" ref="GuestId"
--> :rules="[val => !!val || '请选择学员']" class="col-12 q-pb-lg" emit-value map-options />
<q-select filled stack-label clearable use-input option-value="Id" option-label="AccountName" v-model="addMsg.GuestId"
:options="filterstudentList" @filter="filterStudentFn" label="学员编号" ref="GuestId" :rules="[val => !!val || '请选择学员']" class="col-12 q-pb-lg" emit-value map-options />
<div class="col-12 q-pb-lg"> <div class="col-12 q-pb-lg">
<q-input <q-input filled v-model="addMsg.StartTime" mask="####-##-## ##:##:##" ref="StartTime" label="开始时间"
filled :rules="[val => !!val || '请选择开始时间']">
v-model="addMsg.StartTime"
mask="####-##-## ##:##:##"
ref="StartTime"
label="开始时间"
:rules="[val => !!val || '请选择开始时间']"
>
<template v-slot:append> <template v-slot:append>
<q-icon name="event" class="cursor-pointer"> <q-icon name="event" class="cursor-pointer">
<q-popup-proxy ref="StartTime" transition-show="scale" transition-hide="scale"> <q-popup-proxy ref="StartTime" transition-show="scale" transition-hide="scale">
<div class="q-gutter-md row items-start"> <div class="q-gutter-md row items-start">
<q-date <q-date v-model="addMsg.StartTime" mask="YYYY-MM-DD HH:mm:ss" @input="startDate" />
v-model="addMsg.StartTime" <q-time v-model="addMsg.StartTime" format24h mask="YYYY-MM-DD HH:mm:ss" @input="startTime" />
mask="YYYY-MM-DD HH:mm:ss"
@input="date"
/>
<q-time
v-model="addMsg.StartTime"
format24h
mask="YYYY-MM-DD HH:mm:ss"
@input="time"
/>
</div> </div>
<q-btn v-close-popup label="关闭" color="primary" flat style="float:right" /> <q-btn v-close-popup label="关闭" color="primary" flat style="float:right" />
</q-popup-proxy> </q-popup-proxy>
</q-icon> </q-icon>
</template> </template>
</q-input> </q-input>
</div> </div>
<div class="col-12 q-pb-lg"> <div class="col-12 q-pb-lg">
<q-input filled v-model="addMsg.EndTime" mask="####-##-## ##:##:##" ref="EndTime" label="结束时间" :rules="[val => !!val || '请选择结束时间']"> <q-input filled v-model="addMsg.EndTime" mask="####-##-## ##:##:##" ref="EndTime" label="结束时间"
<template v-slot:append> :rules="[val => !!val || '请选择结束时间']">
<template v-slot:append>
<q-icon name="event" class="cursor-pointer"> <q-icon name="event" class="cursor-pointer">
<q-popup-proxy ref="EndTime" transition-show="scale" transition-hide="scale"> <q-popup-proxy ref="EndTime" transition-show="scale" transition-hide="scale">
<div class="q-gutter-md row items-start"> <div class="q-gutter-md row items-start">
<q-date <q-date v-model="addMsg.EndTime" mask="YYYY-MM-DD HH:mm:ss" @input="endDate" />
v-model="addMsg.EndTime" <q-time v-model="addMsg.EndTime" format24h mask="YYYY-MM-DD HH:mm:ss" @input="endTime" />
mask="YYYY-MM-DD HH:mm:ss"
@input="endDate"
/>
<q-time
v-model="addMsg.EndTime"
format24h
mask="YYYY-MM-DD HH:mm:ss"
@input="endTime"
/>
</div> </div>
<q-btn v-close-popup label="关闭" color="primary" flat style="float:right" /> <q-btn v-close-popup label="关闭" color="primary" flat style="float:right" />
</q-popup-proxy> </q-popup-proxy>
</q-icon> </q-icon>
</template> </template>
</q-input> </q-input>
</div> </div>
</div> </div>
</q-card-section> </q-card-section>
<q-separator /> <q-separator />
<q-card-actions align="right" class="bg-white"> <q-card-actions align="right" class="bg-white">
<q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" @click="closeSaveForm" /> <q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" @click="closeSaveForm" />
<q-btn label="立即提交" color="accent q-px-md" style="font-weight:400 !important" :loading="saveLoading" @click="saveActive" /> <q-btn label="立即提交" color="accent q-px-md" style="font-weight:400 !important" :loading="saveLoading"
</q-card-actions> @click="saveActive" />
</q-card> </q-card-actions>
</q-dialog> </q-card>
</q-dialog>
</template> </template>
<script> <script>
import { import {
setActivitySurveyGuest, setActivitySurveyGuest,
getActivitySurveyGuestModule, getActivitySurveyGuestModule,
getAccountStudentList getAccountStudentList
} from '../../api/studentmsg/index' } from '../../api/studentmsg/index'
export default { export default {
props: { props: {
saveObj: { saveObj: {
type: Object, type: Object,
default: null default: null
}, },
ID: { ID: {
type: String, type: String,
default: null default: null
} }
},
data() {
return {
persistent: true,
addMsg: {
Id: 0, //新增传0
GuestType: 2, //客户类型(1-小程序用户,2-学员用户)
GuestId: '', //学员编号
StartTime: "", //开始时间
EndTime: "", //结束时间
SurveyId: 0 //意见调查表编号
}, },
data() { saveLoading: false,
return { studentAccountList: [],
persistent: true, filterstudentList: [],
addMsg: { };
Id: 0, //新增传0 },
GuestType: 2, //客户类型(1-小程序用户,2-学员用户) mounted() {
GuestId: '', //学员编号 this.studentAccount();
StartTime: "2022-04-20 00:00:00", //开始时间 this.initObj();
EndTime: "2022-04-25 18:00:00", //结束时间 },
SurveyId: 0 //意见调查表编号 methods: {
}, //初始化表单
platList: [], initObj() {
dateList: [], this.addMsg.SurveyId = this.ID
FormTypeList: [], if (this.saveObj && this.saveObj.Id > 0) {
saveLoading: false, getActivitySurveyGuestModule({
studentAccountList: [], Id: this.saveObj.Id
filterstudentList: [], }).then(res => {
}; var tempData = res.Data;
}, this.addMsg.Id = tempData.Id;
mounted() { this.addMsg.GuestId = tempData.GuestId;
this.studentAccount(); this.addMsg.StartTime = tempData.StartTime;
this.initObj(); this.addMsg.EndTime = tempData.EndTime;
}, })
methods: { } else {
// 选择报名开始时间 this.addMsg.Id = 0;
date(val) { this.addMsg.GuestId = '';
this.addMsg.SignStartTime = val; this.addMsg.StartTime = '';
}, this.addMsg.EndTime = '';
time(val) {
this.addMsg.SignStartTime = val;
},
// 选择报名结束时间
endDate(val) {
this.addMsg.SignEndTime = val;
},
endTime(val) {
this.addMsg.SignEndTime = val;
},
//初始化表单
initObj() {
this.addMsg.SurveyId = this.ID
console.log("this.saveObj", this.saveObj);
if (this.saveObj && this.saveObj.Id > 0) {
getActivitySurveyGuestModule({
Id: this.saveObj.Id
}).then(res => {
var tempData = res.Data;
this.addMsg.Id = tempData.Id;
this.addMsg.GuestId = tempData.GuestId;
this.addMsg.StartTime = tempData.StartTime;
this.addMsg.EndTime = tempData.EndTime;
// this.addMsg =
console.log("tempData", tempData);
})
} else {
this.addMsg.Id = 0;
this.addMsg.GuestId = '';
this.addMsg.StartTime = '';
this.addMsg.EndTime = '';
}
},
//关闭弹窗
closeSaveForm() {
this.$emit("close");
this.persistent = false;
},
//保存数据
saveActive() {
this.$refs.GuestId.validate();
this.$refs.StartTime.validate();
this.$refs.EndTime.validate();
if (!this.$refs.GuestId.hasError && !this.$refs.StartTime.hasError && !this.$refs.EndTime.hasError) {
setActivitySurveyGuest(this.addMsg).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据保存成功!',
position: 'top'
})
this.$emit('close');
this.$emit('success');
} else {
this.$q.notify({
type: 'negative',
position: "top",
message: res.Data.message
})
}
})
}
},
// 学生编号
studentAccount() {
getAccountStudentList({}).then(res => {
this.studentAccountList = res.Data;
this.filterstudentList = res.Data;
})
},
//学生筛选
filterStudentFn(val, update) {
update(() => {
if (val === '') {
this.filterstudentList = JSON.parse(JSON.stringify(this.studentAccountList))
} else {
const needle = val.toLowerCase();
this.filterstudentList = this.studentAccountList.filter(v => v.AccountName.toLowerCase().indexOf(needle) > -1)
}
})
},
} }
}; },
//意见调查开始时间
startDate(val) {
this.addMsg.StartTime = val;
},
startTime(val) {
this.addMsg.StartTime = val;
},
//意见调查结束时间
endDate(val) {
this.addMsg.EndTime = val;
},
endTime(val) {
this.addMsg.EndTime = val;
},
//关闭弹窗
closeSaveForm() {
this.$emit("close");
this.persistent = false;
},
//保存数据
saveActive() {
this.$refs.GuestId.validate();
this.$refs.StartTime.validate();
this.$refs.EndTime.validate();
if (!this.$refs.GuestId.hasError && !this.$refs.StartTime.hasError && !this.$refs.EndTime.hasError) {
setActivitySurveyGuest(this.addMsg).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据保存成功!',
position: 'top'
})
this.$emit('close');
this.$emit('success');
} else {
this.$q.notify({
type: 'negative',
position: "top",
message: res.Data.message
})
}
})
}
},
// 学生编号
studentAccount() {
getAccountStudentList({}).then(res => {
if (res.Code == 1) {
this.studentAccountList = res.Data;
this.filterstudentList = res.Data;
}
})
},
//学生筛选
filterStudentFn(val, update) {
update(() => {
if (val === '') {
this.filterstudentList = JSON.parse(JSON.stringify(this.studentAccountList))
} else {
const needle = val.toLowerCase();
this.filterstudentList = this.studentAccountList.filter(v => v.AccountName.toLowerCase().indexOf(
needle) > -1)
}
})
},
}
};
</script> </script>
\ No newline at end of file
...@@ -8,26 +8,26 @@ ...@@ -8,26 +8,26 @@
<div class="col-2 q-table__title">意见调查信息</div> <div class="col-2 q-table__title">意见调查信息</div>
<q-space /> <q-space />
<div class="page-option"> <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> </div>
</template> </template>
<template v-slot:body-cell-IsRequired="props"> <template v-slot:body-cell-IsRequired="props">
<q-td :props="props"> <q-td :props="props">
<span v-if="props.row.IsRequired==0"></span> <span v-if="props.row.IsRequired==0"></span>
<span v-if="props.row.IsRequired==1"></span> <span v-if="props.row.IsRequired==1"></span>
</q-td> </q-td>
</template> </template>
<template v-slot:body-cell-IsShow="props"> <template v-slot:body-cell-IsShow="props">
<q-td :props="props"> <q-td :props="props">
<span v-if="props.row.IsShow==0"></span> <span v-if="props.row.IsShow==0"></span>
<span v-if="props.row.IsShow==1"></span> <span v-if="props.row.IsShow==1"></span>
</q-td> </q-td>
</template> </template>
<template v-slot:bottom> <template v-slot:bottom>
<q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="pageCount" <q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="pageCount"
:input="true" @input="changePage" /> :input="true" @input="changePage" />
</template> </template>
<template v-slot:body-cell-optioned="props"> <template v-slot:body-cell-optioned="props">
<q-td :props="props"> <q-td :props="props">
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="编辑" <q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="编辑"
@click="addObj(props.row)" /> @click="addObj(props.row)" />
...@@ -35,156 +35,148 @@ ...@@ -35,156 +35,148 @@
@click="delQuestion(props.row)" /> @click="delQuestion(props.row)" />
</q-td> </q-td>
</template> </template>
</q-table> </q-table>
<student-form v-if="isShowWenjuan" :save-obj="objOption" :ID="msg.ActivitySurveyId" @close="closeSaveForm" @success="resetSearch"></student-form> <student-form v-if="isShowWenjuan" :save-obj="objOption" :ID="msg.SurveyId" @close="closeSaveForm"
</div> @success="resetSearch"></student-form>
</div> </div>
</div>
</template> </template>
<script> <script>
import studentForm from '../../components/activity/student-from' import studentForm from '../../components/activity/student-from'
import { import {
getActivitySurveyGuestPage, getActivitySurveyGuestPage,
removeActivitySurveyGuest removeActivitySurveyGuest
} from '../../api/studentmsg/index' } from '../../api/studentmsg/index'
export default { export default {
meta: { meta: {
title: "意见调查表" title: "意见调查表"
}, },
components: { components: {
studentForm studentForm
}, },
data() { data() {
return { return {
columns: [{ columns: [{
name: 'Id', name: 'Id',
label: 'ID', label: 'ID',
align: 'left', align: 'left',
field: 'Id' field: 'Id'
}, { }, {
name: 'GuestName', name: 'GuestName',
label: '学员名称', label: '学员名称',
field: 'GuestName', field: 'GuestName',
align: 'left' align: 'left'
}, { }, {
name: 'StartTime', name: 'StartTime',
label: '开始时间', label: '开始时间',
field: 'StartTime', field: 'StartTime',
align: 'left' align: 'left'
}, { }, {
name: 'EndTime', name: 'EndTime',
label: '结束时间', label: '结束时间',
field: 'EndTime', field: 'EndTime',
align: 'left' align: 'left'
}, },
{
name: 'optioned',
label: '操作',
field: 'TId'
}
],
dataList: [],
loading: true,
msg: {
pageIndex: 1,
pageSize: 12,
rowsPerPage: 12,
SurveyId: 1,
},
pageCount: 0, {
isShowWenjuan: false, name: 'optioned',
objOption: null, label: '操作',
} field: 'TId'
}
],
dataList: [],
loading: true,
msg: {
pageIndex: 1,
pageSize: 12,
rowsPerPage: 12,
SurveyId: 0,
}, },
created() { pageCount: 0,
if (this.$route.query && this.$route.query.ID) { isShowWenjuan: false,
this.msg.ActivitySurveyId = this.$route.query.ID; 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(); closeSaveForm() {
}, this.isShowWenjuan = false;
methods: { },
changePage(val) {
resetSearch() { this.msg.pageIndex = val;
this.msg.pageIndex = 1; this.getList();
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();
},
},
}
</script> </script>
<style lang="sass"> <style lang="sass">
@import url('~assets/css/table.sass') @import url('~assets/css/table.sass')
</style> </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