Commit 9925ab10 authored by 罗超's avatar 罗超

调整新增客户功能

parent e1b00863
...@@ -32,6 +32,15 @@ export function checkStuTel(data) { ...@@ -32,6 +32,15 @@ export function checkStuTel(data) {
}) })
} }
export function queryStudentByTel(data) {
return request({
url: '/User/GetStudentByTel',
method: 'post',
data
})
}
/** /**
* 修改离职信息 * 修改离职信息
* @param {查询参数} data * @param {查询参数} data
......
...@@ -124,7 +124,15 @@ ...@@ -124,7 +124,15 @@
</q-input> </q-input>
</div> </div>
<div v-if="tabCheck == 'second'"> <div v-if="tabCheck == 'second'">
<q-btn outline dense icon="add" class="q-px-sm" color="primary" @click="showAddForm=true" label="新增客户"></q-btn> <q-btn
outline
dense
icon="add"
class="q-px-sm"
color="primary"
@click="showAddForm = true"
label="新增客户"
></q-btn>
</div> </div>
</div> </div>
<div class="page-content"> <div class="page-content">
...@@ -503,20 +511,65 @@ ...@@ -503,20 +511,65 @@
@close="closeDetail" @close="closeDetail"
:save-obj="sendObj" :save-obj="sendObj"
></schedulFanke> ></schedulFanke>
<q-dialog v-model="showAddForm" persistent content-class="bg-grey-1 big-dialog"> <q-dialog
<student-add-form @success="addFinishHandler" @close="showAddForm=false"></student-add-form> v-model="showAddForm"
persistent
content-class="bg-grey-1 big-dialog"
>
<student-add-form
@success="addFinishHandler"
@close="showAddForm = false"
></student-add-form>
</q-dialog>
<q-dialog persistent v-model="isShowModelInfo" v-if="visitModel">
<q-card flat class="q-pa-md" style="width:300px">
<div class="text-h6">客户已存在</div>
<div class="text-center q-my-md">
<q-avatar
size="40px"
rounded
style="background:#C7C7C7"
text-color="white"
>
<span>{{ visitModel.StuName.substring(0, 1) }}</span>
</q-avatar>
</div>
<div class="text-center text-dark" style="font-size:12px">
<span class="text-primary">{{ visitModel.StuName }}</span>
<span class="q-mx-xs" style="font-size:20px;font-weight:bold">·</span>
<span>{{ visitModel.StuTel }}</span>
</div>
<div style="font-size:12px" class="q-mt-xs text-center q-mb-md text-grey-6">
该客户已于{{ visitModel.CreateTimeStr }},由{{
visitModel.CreateByName
}}加入会员库
</div>
<q-separator class="q-mb-md" />
<div class="text-center q-py-xs">
<q-btn
outline
color="primary"
class="q-px-md"
label="打卡到访"
@click="createVisitHandler(visitModel)"
></q-btn>
</div>
</q-card>
</q-dialog> </q-dialog>
</div> </div>
</template> </template>
<script> <script>
import { getTodayVisitList } from "../../api/stuMan/index"; import { getTodayVisitList } from "../../api/stuMan/index";
import { getStudentPage, saveStudent, getStudentInfo } from "../../api/school"; import { getStudentPage, saveStudent, getStudentInfo } from "../../api/school";
import { saveStudentVisitFeedback } from "../../api/customerstudent/customerstudent"; import {
saveStudentVisitFeedback,
saveStudentVisit
} from "../../api/customerstudent/customerstudent";
import { getGuestBasicsEnumList } from "../../api/sale/sale"; import { getGuestBasicsEnumList } from "../../api/sale/sale";
import schedulFanke from "../schedul/schedul-fanke"; import schedulFanke from "../schedul/schedul-fanke";
import { queryDutyTrialLesson } from "../../api/duty/index"; import { queryDutyTrialLesson } from "../../api/duty/index";
import studentAddForm from '../../components/school/student/studentAddForm' import studentAddForm from "../../components/school/student/studentAddForm";
import { mapGetters } from "vuex";
export default { export default {
props: { props: {
saveObj: { saveObj: {
...@@ -532,8 +585,13 @@ export default { ...@@ -532,8 +585,13 @@ export default {
schedulFanke, schedulFanke,
studentAddForm studentAddForm
}, },
computed: {
...mapGetters(["userInfo"])
},
data() { data() {
return { return {
isShowModelInfo: true,
visitModel: null,
tabCheck: "first", tabCheck: "first",
columns: [ columns: [
{ {
...@@ -584,7 +642,7 @@ export default { ...@@ -584,7 +642,7 @@ export default {
label: "操作" label: "操作"
} }
], ],
showAddForm:false, showAddForm: false,
visitColumns: [ visitColumns: [
{ {
name: "StuName", name: "StuName",
...@@ -821,6 +879,46 @@ export default { ...@@ -821,6 +879,46 @@ export default {
this.initDutyTrialLessonList(); this.initDutyTrialLessonList();
}, },
methods: { methods: {
addFinishHandler(m, t) {
console.log(m, t);
if (m && m.StuId) {
if (t == 1) {
this.visitModel = m;
} else {
this.visitModel = null;
this.createVisitHandler(m);
this.getVisitoryPage();
}
}
this.showAddForm = false;
},
createVisitHandler(m) {
let d = new Date();
let msg = {
Id: 0,
Date: d.getFullYear() + "-" + (d.getMonth() + 1) + "-" + d.getDate(),
ReceptionPersion: this.userInfo.Id,
Remark:
"客户临时到访门店,由" + this.userInfo.AccountName + "记录到访信息",
School_Id: this.userInfo.School_Id,
StuId: m.StuId,
VisitTime: d.getHours() + ":" + d.getMinutes()
};
console.log("进来了呀", msg);
saveStudentVisit(msg).then(r => {
this.visitModel=null
if (r.Data) {
let msg2 = {
Id: r.Data.Id,
IsVisit: 1,
Feedback: msg.remark
};
saveStudentVisitFeedback(msg2).then(r2 => {
this.initTodayVistList();
});
}
});
},
submitForm(addMsg1) { submitForm(addMsg1) {
//提交创建、修改表单 //提交创建、修改表单
this.$refs[addMsg1].validate(valid => { this.$refs[addMsg1].validate(valid => {
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
full-mask full-mask
mask="###########" mask="###########"
label="客户电话" label="客户电话"
@input="checkStuTel"
></q-input> ></q-input>
</div> </div>
<div class="q-mt-xs row q-col-gutter-md"> <div class="q-mt-xs row q-col-gutter-md">
...@@ -170,39 +171,6 @@ ...@@ -170,39 +171,6 @@
></q-btn> ></q-btn>
</div> </div>
</q-card> </q-card>
<div style="display:none">
<div class="info_content" style="margin-bottom:0;">
<div class="info_content">
<div class="info_item">
<div class="item_label">创建人</div>
<div class="item_value">
<q-select
filled
v-model="customObj.CreateBy"
dense
disable
@filter="filterEmployee"
use-input
:options="myEmployeeList"
option-label="EmployeeName"
option-value="Id"
emit-value
map-options
/>
</div>
</div>
<div class="info_item">
<q-btn
color="accent"
class="q-mr-md"
label="保存"
@click="saveStu()"
/>
</div>
</div>
</div>
</div>
</div> </div>
</template> </template>
<script> <script>
...@@ -217,7 +185,7 @@ import { ...@@ -217,7 +185,7 @@ import {
getGuestLearningGoalsEnumList, getGuestLearningGoalsEnumList,
GetStuChannelList GetStuChannelList
} from "../../../api/sale/sale"; } from "../../../api/sale/sale";
import { queryEmployee,checkStuTel } from "../../../api/users/user"; import { queryEmployee,queryStudentByTel } from "../../../api/users/user";
export default { export default {
meta: { meta: {
title: "学员管理" title: "学员管理"
...@@ -287,24 +255,29 @@ export default { ...@@ -287,24 +255,29 @@ export default {
methods: { methods: {
checkStuTel(){ checkStuTel(){
if (this.customObj.StuTel && this.customObj.StuTel.length == 11){ if (this.customObj.StuTel && this.customObj.StuTel.length == 11){
this.customObj queryStudentByTel({StuTel:this.customObj.StuTel}).then(r=>{
if(r.Data){
this.$emit("success",r.Data,1);
}
})
} }
}, },
validate() { validate() {
let msg = ""; let msg = "";
console.log(this.customObj)
if (!this.customObj.StuName) { if (!this.customObj.StuName) {
msg = "请输入客户名称"; msg = "请输入客户名称";
} else if (!this.customObj.StuTel || this.customObj.StuTel.length != 11) { } else if (!this.customObj.StuTel || this.customObj.StuTel.length != 11) {
msg = "请输入正确的客户手机号"; msg = "请输入正确的客户手机号";
} else if (!customObj.cusfrom) { } else if (!this.customObj.cusfrom) {
msg = "请选择客户来源"; msg = "请选择客户来源";
} else if (!customObj.StuChannelList) { } else if (!this.customObj.StuChannel) {
msg = "请选择客户获客渠道"; msg = "请选择客户获客渠道";
} else if ( } else if (
customObj.StuChannelList == 6 || this.customObj.StuChannel == 6 ||
customObj.StuChannelList == 7 this.customObj.StuChannel == 7
) { ) {
if (!customObj.PlatformName) { if (!this.customObj.PlatformName) {
msg = "请填写具体渠道信息"; msg = "请填写具体渠道信息";
} }
} }
...@@ -330,7 +303,7 @@ export default { ...@@ -330,7 +303,7 @@ export default {
message: "数据保存成功!", message: "数据保存成功!",
position: "top" position: "top"
}); });
this.$emit("success"); this.$emit("success",res.Data,0);
} }
}); });
}, },
......
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