Commit 66730235 authored by zhengke's avatar zhengke

111

parent 33590d53
......@@ -45,4 +45,15 @@ export function removeActivitySurveyGuest(data) {
method: 'post',
data
})
}
/*
* 获取学员编号
*/
export function getAccountStudentList(data) {
return request({
url: '/User/GetAccountStudentList',
method: 'post',
data
})
}
\ No newline at end of file
......@@ -26,26 +26,20 @@
<!-- <q-select filled stack-label option-value="Id" option-label="Name" v-model="addMsg.SurveyType"
:options="platList" label="客户类型" ref="SurveyType" @input="getPlat()" :rules="[val => !!val || '请选择类型']" class="col-12 q-pb-lg" emit-value map-options />
-->
<q-input
filled
v-model="addMsg.Sort"
class="col-12 q-pb-lg"
ref="Sort"
label="学员编号"
:rules="[val => !!val || '请填写排序']"
></q-input>
<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">
<q-input
filled
v-model="addMsg.StartTime"
mask="####-##-## ##:##:##"
ref="SignStartTime"
ref="StartTime"
label="开始时间"
:rules="[val => !!val || '请选择开始时间']"
>
<template v-slot:append>
<q-icon name="event" class="cursor-pointer">
<q-popup-proxy ref="qDateProxy" 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">
<q-date
v-model="addMsg.StartTime"
......@@ -66,10 +60,10 @@
</q-input>
</div>
<div class="col-12 q-pb-lg">
<q-input filled v-model="addMsg.EndTime" mask="####-##-## ##:##:##" ref="SignEndTime" label="结束时间" :rules="[val => !!val || '请选择结束时间']">
<q-input filled v-model="addMsg.EndTime" mask="####-##-## ##:##:##" ref="EndTime" label="结束时间" :rules="[val => !!val || '请选择结束时间']">
<template v-slot:append>
<q-icon name="event" class="cursor-pointer">
<q-popup-proxy ref="qDateProxy" 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">
<q-date
v-model="addMsg.EndTime"
......@@ -102,7 +96,8 @@
<script>
import {
setActivitySurveyGuest,
getActivitySurveyGuestModule
getActivitySurveyGuestModule,
getAccountStudentList
} from '../../api/studentmsg/index'
export default {
props: {
......@@ -121,7 +116,7 @@
addMsg: {
Id: 0, //新增传0
GuestType: 2, //客户类型(1-小程序用户,2-学员用户)
GuestId: 2644, //学员编号
GuestId: '', //学员编号
StartTime: "2022-04-20 00:00:00", //开始时间
EndTime: "2022-04-25 18:00:00", //结束时间
SurveyId: 0 //意见调查表编号
......@@ -129,10 +124,13 @@
platList: [],
dateList: [],
FormTypeList: [],
saveLoading: false
saveLoading: false,
studentAccountList: [],
filterstudentList: [],
};
},
mounted() {
this.studentAccount();
this.initObj();
},
methods: {
......@@ -153,18 +151,24 @@
//初始化表单
initObj() {
this.addMsg.SurveyId = this.ID
if (this.saveObj && this.saveObj.ID > 0) {
console.log("this.saveObj", this.saveObj);
if (this.saveObj && this.saveObj.Id > 0) {
getActivitySurveyGuestModule({
Id: saveObj.ID
Id: this.saveObj.Id
}).then(res => {
this.addMsg = res.data.data;
console.log("11111", 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 = 1;
// this.StartTime = '';
// this.EndTime = '';
this.addMsg.GuestId = '';
this.addMsg.StartTime = '';
this.addMsg.EndTime = '';
}
},
//关闭弹窗
......@@ -172,29 +176,53 @@
this.$emit("close");
this.persistent = false;
},
//保存数据
saveActive() {
setActivitySurveyGuest(this.addMsg).then(res => {
if (res.data.Id == 0) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据保存成功!',
position: 'top'
})
this.$emit('close');
this.$emit('success');
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 {
this.$q.notify({
type: 'negative',
position: "top",
message: res.data.message
})
const needle = val.toLowerCase();
this.filterstudentList = this.studentAccountList.filter(v => v.AccountName.toLowerCase().indexOf(needle) > -1)
}
})
}
},
}
};
</script>
\ 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