Commit 6f0d888d authored by 黄奎's avatar 黄奎

页面修改

parent c181dc3c
...@@ -2,65 +2,30 @@ ...@@ -2,65 +2,30 @@
<template> <template>
<div> <div>
<div class="row wrap"> <div class="row wrap">
<q-btn <q-btn label="新增" color="accent q-mb-lg" size="sm"
label="新增" v-if="!saveObj.IsHaveCurseManager || userInfo.IsCourseConsultant == 1" @click="isShowAdd = true" />
color="accent q-mb-lg"
size="sm"
v-if="!saveObj.IsHaveCurseManager || userInfo.IsCourseConsultant == 1"
@click="isShowAdd = true"
/>
<span v-else class="text-grey-4">学员已推送课程顾问,只能进行查看</span> <span v-else class="text-grey-4">学员已推送课程顾问,只能进行查看</span>
<q-btn <q-btn label="取消" style="margin-left:20px;" v-if="isShowAdd" flat color="grey-10 q-mb-lg" size="sm"
label="取消" @click="isShowAdd = false" />
style="margin-left:20px;"
v-if="isShowAdd"
flat
color="grey-10 q-mb-lg"
size="sm"
@click="isShowAdd = false"
/>
</div> </div>
<template v-if="isShowAdd"> <template v-if="isShowAdd">
<div class="row wrap studentDate"> <div class="row wrap studentDate">
<q-input <!-- <q-input filled class="col-6 q-pb-lg q-pr-lg" dense v-model="yueMsg.AppointmentPoint" label="约访地点"></q-input> -->
filled
class="col-6 q-pb-lg q-pr-lg"
dense
v-model="yueMsg.AppointmentPoint"
label="约访地点"
></q-input>
<q-field filled class="q-pb-lg" dense> <q-field filled class="q-pb-lg" dense>
<template v-slot:control> <template v-slot:control>
<el-date-picker <el-date-picker v-model="yueMsg.AppointmentTime" type="datetime" size="mini" style="width:228px"
v-model="yueMsg.AppointmentTime" placeholder="选择约访日期时间!">
type="datetime"
size="mini"
style="width:228px"
placeholder="选择约访日期时间!"
>
</el-date-picker> </el-date-picker>
</template> </template>
</q-field> </q-field>
</div> </div>
<div class="row wrap"> <div class="row wrap">
<q-input <q-input filled v-model="yueMsg.Remark" dense :rows="3" type="textarea" class="col-12 q-pb-lg q-pr-lg"
filled label="备注">
v-model="yueMsg.Remark"
dense
:rows="3"
type="textarea"
class="col-12 q-pb-lg q-pr-lg"
label="备注"
>
</q-input> </q-input>
</div> </div>
<div class="row wrap justify-end q-pr-lg" style="margin-bottom:10px;"> <div class="row wrap justify-end q-pr-lg" style="margin-bottom:10px;">
<q-btn <q-btn label="保存" color="accent q-mb-lg" size="md" @click="savePoint()" />
label="保存"
color="accent q-mb-lg"
size="md"
@click="savePoint()"
/>
</div> </div>
</template> </template>
<div style="display:flex;flex:1;flex-direction: column;overflow:hidden;"> <div style="display:flex;flex:1;flex-direction: column;overflow:hidden;">
...@@ -71,7 +36,7 @@ ...@@ -71,7 +36,7 @@
<div class="visit_Cont"> <div class="visit_Cont">
<div class="Log_Content"> <div class="Log_Content">
<div>约访时间:{{ tItem.AppointmentTime }}</div> <div>约访时间:{{ tItem.AppointmentTime }}</div>
<div>约访地点:{{ tItem.AppointmentPoint }}</div> <!-- <div>约访地点:{{ tItem.AppointmentPoint }}</div> -->
<div class="StuCom_Remark"> <div class="StuCom_Remark">
<div class="StuCom_Left">备注</div> <div class="StuCom_Left">备注</div>
...@@ -84,10 +49,7 @@ ...@@ -84,10 +49,7 @@
</div> </div>
</div> </div>
<div style="display:flex;margin-top:10px;"> <div style="display:flex;margin-top:10px;">
<div <div @click="delVisit(tItem.Id)" class="visit_delete text-negative">
@click="delVisit(tItem.Id)"
class="visit_delete text-negative"
>
删除 删除
</div> </div>
<div @click="clickItem(tItem)" class="stu_ComFeed"> <div @click="clickItem(tItem)" class="stu_ComFeed">
...@@ -98,42 +60,15 @@ ...@@ -98,42 +60,15 @@
}} }}
<q-popup-proxy> <q-popup-proxy>
<q-banner v-if="isShowEdit"> <q-banner v-if="isShowEdit">
<div <div class="row wrap" style="margin-top:10px;width:300px;">
class="row wrap" <q-input filled v-model="feedBackMsg.Feedback" :rows="3" type="textarea"
style="margin-top:10px;width:300px;" class="col-12 q-pb-sm" label="请输入反馈内容">
>
<q-input
filled
v-model="feedBackMsg.Feedback"
:rows="3"
type="textarea"
class="col-12 q-pb-sm"
label="请输入反馈内容"
>
</q-input> </q-input>
<q-select <q-select filled v-model="stuStageId" dense :options="cusStateList" option-label="Name"
filled option-value="Id" emit-value map-options label="客户状态" class="col-12 q-pb-sm" />
v-model="stuStageId"
dense
:options="cusStateList"
option-label="Name"
option-value="Id"
emit-value
map-options
label="客户状态"
class="col-12 q-pb-sm"
/>
</div> </div>
<div <div class="row wrap" style="float:right;margin-bottom:10px;">
class="row wrap" <q-btn label="保存" color="accent" size="sm" @click="SetFeedBack()" />
style="float:right;margin-bottom:10px;"
>
<q-btn
label="保存"
color="accent"
size="sm"
@click="SetFeedBack()"
/>
</div> </div>
</q-banner> </q-banner>
</q-popup-proxy> </q-popup-proxy>
...@@ -152,139 +87,92 @@ ...@@ -152,139 +87,92 @@
</div> </div>
</div> </div>
<div style="margin-bottom:20px"> <div style="margin-bottom:20px">
<q-pagination <q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="page_Count" input
class="full-width justify-end" @input="changePage" />
v-model="msg.pageIndex"
color="primary"
:max="page_Count"
input
@input="changePage"
/>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { import {
saveStudentAppointment, saveStudentAppointment,
queryStudentAppointmentPage, queryStudentAppointmentPage,
deleteStudentAppointment, deleteStudentAppointment,
saveStudentAppointmentFeedBack, saveStudentAppointmentFeedBack,
SetStuStage SetStuStage
} from "../../../api/customerstudent/customerstudent"; } from "../../../api/customerstudent/customerstudent";
export default { export default {
meta: { meta: {
title: "" title: ""
},
components: {},
props: {
stateId: {
type: Number,
default: 0
}, },
stateList: { components: {},
type: Array, props: {
default: () => [] stateId: {
}, type: Number,
saveObj: { default: 0
type: Object,
default: null
}
},
data() {
return {
isShowAdd: false,
yueMsg: {
Id: 0, //约访编号
StuId: 0, //学员编号
AppointmentPoint: "", //约访地点
AppointmentTime: "", //约访时间
Remark: "" //备注
},
msg: {
pageIndex: 1,
pageSize: 12,
StuId: 0
}, },
//反馈信息 stateList: {
feedBackMsg: { type: Array,
Id: 0, default: () => []
Feedback: "" //反馈
}, },
isShowEdit: false, saveObj: {
dataList: [], type: Object,
page_Count: 0, default: null
cusStateList: [],
stuStageId: 0,
userInfo: {}
};
},
created() {
if (this.saveObj && this.saveObj.StuId) {
this.msg.StuId = this.saveObj.StuId;
this.userInfo = this.getLocalStorage();
}
},
watch: {
stateId(val) {
this.stuStageId = val;
}
},
mounted() {
this.stuStageId = this.stateId;
this.cusStateList = this.stateList;
this.getList();
},
methods: {
//点击到访
clickItem(item) {
this.feedBackMsg.Id = item.Id;
this.feedBackMsg.Feedback = item.Feedback;
this.isShowEdit = true;
},
SetFeedBack() {
saveStudentAppointmentFeedBack(this.feedBackMsg).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: "iconfont icon-chenggong",
color: "accent",
timeout: 2000,
message: "数据保存成功!",
position: "top"
});
this.getList();
this.feedBackMsg.Id = 0;
this.feedBackMsg.Feedback = "";
this.isShowEdit = false;
}
});
if (this.stuStageId ?? 0 > 0) {
this.setStuStage();
} }
}, },
//保存约访 data() {
savePoint() { return {
this.yueMsg.StuId = this.saveObj.StuId; isShowAdd: false,
if (this.yueMsg.AppointmentPoint == "") { yueMsg: {
this.$q.notify({ Id: 0, //约访编号
type: "negative", StuId: 0, //学员编号
position: "top", AppointmentPoint: "", //约访地点
timeout: 2000, AppointmentTime: "", //约访时间
message: "请输入约访地点!" Remark: "" //备注
}); },
return; msg: {
pageIndex: 1,
pageSize: 12,
StuId: 0
},
//反馈信息
feedBackMsg: {
Id: 0,
Feedback: "" //反馈
},
isShowEdit: false,
dataList: [],
page_Count: 0,
cusStateList: [],
stuStageId: 0,
userInfo: {}
};
},
created() {
if (this.saveObj && this.saveObj.StuId) {
this.msg.StuId = this.saveObj.StuId;
this.userInfo = this.getLocalStorage();
} }
if (this.yueMsg.AppointmentTime == "") { },
this.$q.notify({ watch: {
type: "negative", stateId(val) {
position: "top", this.stuStageId = val;
timeout: 2000,
message: "请选择约访日期时间!"
});
return;
} }
saveStudentAppointment(this.yueMsg) },
.then(res => { mounted() {
this.stuStageId = this.stateId;
this.cusStateList = this.stateList;
this.getList();
},
methods: {
//点击到访
clickItem(item) {
this.feedBackMsg.Id = item.Id;
this.feedBackMsg.Feedback = item.Feedback;
this.isShowEdit = true;
},
SetFeedBack() {
saveStudentAppointmentFeedBack(this.feedBackMsg).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
this.$q.notify({ this.$q.notify({
icon: "iconfont icon-chenggong", icon: "iconfont icon-chenggong",
...@@ -294,72 +182,113 @@ export default { ...@@ -294,72 +182,113 @@ export default {
position: "top" position: "top"
}); });
this.getList(); this.getList();
this.clearMsg(); this.feedBackMsg.Id = 0;
this.feedBackMsg.Feedback = "";
this.isShowEdit = false;
} }
}) });
.catch(() => {}); if (this.stuStageId ?? 0 > 0) {
}, this.setStuStage();
//获取数据 }
getList() { },
queryStudentAppointmentPage(this.msg) //保存约访
.then(res => { savePoint() {
if (res.Code == 1) { this.yueMsg.StuId = this.saveObj.StuId;
this.dataList = res.Data.PageData; // if (this.yueMsg.AppointmentPoint == "") {
this.page_Count = res.Data.PageCount; // this.$q.notify({
} // type: "negative",
}) // position: "top",
.catch(() => {}); // timeout: 2000,
}, // message: "请输入约访地点!"
//清除数据 // });
clearMsg() { // return;
this.yueMsg.Id = 0; // }
this.yueMsg.StuId = 0; if (this.yueMsg.AppointmentTime == "") {
this.yueMsg.AppointmentPoint = ""; this.$q.notify({
this.yueMsg.AppointmentTime = ""; type: "negative",
this.yueMsg.Remark = ""; position: "top",
this.yueMsg.Feedback = ""; timeout: 2000,
this.isShowAdd = false; message: "请选择约访日期时间!"
},
//删除到访
delVisit(Id) {
let that = this;
this.$q
.dialog({
title: "提示信息",
message: "是否确定删除?",
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消"
})
.onOk(() => {
deleteStudentAppointment({
Id: Id
}).then(res => {
that.$q.notify({
icon: "iconfont icon-chenggong",
timeout: 2000,
message: res.Message,
position: "top"
});
that.getList();
}); });
}) return;
.onCancel(() => {}); }
}, saveStudentAppointment(this.yueMsg)
changePage(val) { .then(res => {
this.msg.pageIndex = val; if (res.Code == 1) {
this.getList(); this.$q.notify({
}, icon: "iconfont icon-chenggong",
setStuStage() { color: "accent",
const msg = { timeout: 2000,
StuId: this.saveObj.StuId, message: "数据保存成功!",
StuStage: this.stuStageId position: "top"
}; });
SetStuStage(msg).then(res => { this.getList();
this.$emit("update"); this.clearMsg();
}); }
})
.catch(() => {});
},
//获取数据
getList() {
queryStudentAppointmentPage(this.msg)
.then(res => {
if (res.Code == 1) {
this.dataList = res.Data.PageData;
this.page_Count = res.Data.PageCount;
}
})
.catch(() => {});
},
//清除数据
clearMsg() {
this.yueMsg.Id = 0;
this.yueMsg.StuId = 0;
this.yueMsg.AppointmentPoint = "";
this.yueMsg.AppointmentTime = "";
this.yueMsg.Remark = "";
this.yueMsg.Feedback = "";
this.isShowAdd = false;
},
//删除到访
delVisit(Id) {
let that = this;
this.$q
.dialog({
title: "提示信息",
message: "是否确定删除?",
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消"
})
.onOk(() => {
deleteStudentAppointment({
Id: Id
}).then(res => {
that.$q.notify({
icon: "iconfont icon-chenggong",
timeout: 2000,
message: res.Message,
position: "top"
});
that.getList();
});
})
.onCancel(() => {});
},
changePage(val) {
this.msg.pageIndex = val;
this.getList();
},
setStuStage() {
const msg = {
StuId: this.saveObj.StuId,
StuStage: this.stuStageId
};
SetStuStage(msg).then(res => {
this.$emit("update");
});
}
} }
} };
}; </script>
</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