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

页面修改

parent 65df7e45
......@@ -94,9 +94,6 @@ export function queryDutyWork_V2(data) {
})
}
//获取访客列表
export function queryVisitorPage(data) {
return request({
......@@ -115,6 +112,15 @@ export function setVisitor(data) {
})
}
//修改访客创建人员
export function setVisitorCreateBy(data) {
return request({
url: '/DutyPlan/UpdateVisitorCreateBy',
method: 'post',
data
})
}
//根据编号查询访客信息
export function queryVisitor(data) {
return request({
......
<template>
<q-dialog v-model="persistent" persistent content-class="bg-grey-1" transition-show="scale" transition-hide="scale">
<q-card style="width: 600px;max-width:600px;">
<q-card-section>
<div class="text-h6">
{{ objOption.Id > 0 ? "修改业务员" : "修改业务员" }}
</div>
</q-card-section>
<q-card-section class="q-pt-none scroll" style="max-height: 70vh">
<div class="row wrap">
<q-select filled stack-label :dense="false" v-model="objOption.CreateBy" :options="EmployeeList"
option-value="Id" option-label="EmployeeName" emit-value map-options label="业务员" clearable use-input
:rules="[(val) => !!val || '请选择业务员']" @filter="filterFn" class="col-12">
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
未找到相关数据
</q-item-section>
</q-item>
</template>
</q-select>
</div>
</q-card-section>
<q-separator />
<q-card-actions align="right" class="bg-white">
<q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" @click="closeVisitCreateForm" />
<q-btn label="保存" color="accent q-px-md" style="font-weight:400 !important" :loading="saveVisitorCreateLoading"
@click="saveVisitoryCreateBy" />
</q-card-actions>
</q-card>
</q-dialog>
</template>
<script>
import {
setVisitorCreateBy
} from '../../api/scheduling/schedu'
import {
queryEmployee
} from '../../api/users/user'
import {
format
} from 'quasar';
export default {
components: {},
props: {
saveObj: {
type: Object,
default: null
}
},
data() {
return {
persistent: true,
objOption: {
Id: 0, //编号
CreateBy: 0, //创建人
},
EmployeeList: [],
allEmployeeListOption: [], //
saveVisitorCreateLoading: false
};
},
created() {
this.getEmployeeList();
},
mounted() {
console.log("this.saveObj",this.saveObj)
if (this.saveObj && this.saveObj.Id > 0) {
this.objOption.Id = this.saveObj.Id;
this.objOption.CreateBy = this.saveObj.CreateBy;
}
},
methods: {
//获取员工列表
getEmployeeList() {
var qMsg = {
Dept_Id: 0
}
queryEmployee(qMsg).then(res => {
if (res.Code == 1) {
this.EmployeeList = res.Data;
this.allEmployeeListOption = res.Data;
}
})
},
//筛选员工
filterFn(val, update) {
update(() => {
if (val === "") {
this.EmployeeList = JSON.parse(
JSON.stringify(this.EmployeeList)
);
} else {
const needle = val.toLowerCase();
this.EmployeeList = this.allEmployeeListOption.filter(
(v) => v.EmployeeName.toLowerCase().indexOf(needle) > -1
);
}
});
},
//关闭弹窗
closeVisitCreateForm() {
this.$emit("close");
this.persistent = false;
},
//保存业务员
saveVisitoryCreateBy() {
this.saveVisitorCreateLoading = true;
setVisitorCreateBy(this.objOption).then(res => {
this.saveVisitorCreateLoading = false;
this.closeVisitCreateForm();
this.$emit('success');
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据保存成功!',
position: 'top'
})
})
},
}
};
</script>
<template>
<div class="page-body visitorRecord">
<div class="page-body">
<div class="page-search row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-3">
<q-input @input="resetSearch" clearable standout="bg-primary text-white" v-model="msg.KeyWords" label="关键字"
@clear="resetSearch" maxlength="20" />
</div>
<div class="col-3">
<q-select @input="resetSearch" standout="bg-primary text-white" option-value="Id" clearable
option-label="EmployeeName" v-model="msg.CreateBy" :options="EmployeeList" emit-value map-options
label="业务员" use-input @filter="filterFn2" />
</div>
<div class="col-3">
<q-field filled>
 <template v-slot:control>
<el-date-picker v-model="dateList2" @change="resetSearch()" value-format="yyyy-MM-dd" type="daterange" style="border:none;"
:picker-options="option"  range-separator="至"  start-placeholder="开班开始时间"  end-placeholder="开班结束时间">
 </el-date-picker>       
</template>
</q-field>
</div>
</div>
</div>
<div class="page-content">
......@@ -27,41 +13,101 @@
class="sticky-column-table sticky-right-column-table" separator="none" :data="dataList" :columns="columns"
row-key="name">
<template v-slot:top="props">
<div class="col-2 q-table__title">访问记录</div>
<div class="col-2 q-table__title">客户名单</div>
<q-space />
</template>
<template v-slot:body-cell-Name="props">
<q-td>
<span style="color:#2961FE;cursor:pointer;" @click="getDetail(props.row)">{{props.row.Name}}</span>
</q-td>
</template>
<template v-slot:body-cell-VisitorStatus="props">
<q-td :props="props">
<img v-if="props.row.VisitorStatus==1" title="正常" src="../../assets/images/normal.png" />
<img v-if="props.row.VisitorStatus==2" title="贵宾" src="../../assets/images/vip.png" />
<img v-if="props.row.VisitorStatus==3" title="黑名单" src="../../assets/images/blackList.png" />
</q-td>
</template>
<template v-slot:body-cell-Evaluate="props">
<q-td :props="props">
{{getRemarks(props.row.Evaluate)}}
</q-td>
<div class="page-option">
<q-btn color="accent" size="sm" class="q-mr-md" icon="add" label="添加客户" @click="editVisitor(null)" />
</div>
</template>
<template v-slot:body-cell-Remark="props">
<q-td :props="props">
{{getRemarks(props.row.Remark)}}
</q-td>
<template v-slot:body="props">
<q-tr :props="props">
<q-td key="Name" :props="props">
<span style="color:#2961FE;cursor:pointer;" @click="getDetail(props.row)">{{props.row.Name}}</span>
</q-td>
<q-td key="Age" :props="props">
{{props.row.Age}}
</q-td>
<q-td key="Tel" :props="props">
{{props.row.Tel}}
</q-td>
<q-td key="WeChatNum" :props="props">
{{props.row.WeChatNum}}
</q-td>
<q-td key="CourseName" :props="props">
{{props.row.CourseName}}
</q-td>
<q-td key="StudyTime" :props="props">
{{props.row.StudyTime}}
</q-td>
<q-td key="LevelType" :props="props">
{{props.row.LevelType}}
</q-td>
<q-td key="CreateByName" :props="props">
{{props.row.CreateByName}}
</q-td>
<q-td key="VisitorStatus" :props="props">
<img v-if="props.row.VisitorStatus==1" title="正常" src="../../assets/images/normal.png" />
<img v-if="props.row.VisitorStatus==2" title="贵宾" src="../../assets/images/vip.png" />
<img v-if="props.row.VisitorStatus==3" title="黑名单" src="../../assets/images/blackList.png" />
</q-td>
<q-td key="Evaluate" :props="props">
{{props.row.Evaluate}}
</q-td>
<q-td key="CreateTimeStr" :props="props">
{{props.row.CreateTimeStr}}
</q-td>
<q-td key="VisitTimes" :props="props">
{{props.row.VisitTimes}}
</q-td>
<q-td key="Id" :props="props">
<q-btn flat size="xs" @click="editVisitor(props.row)" icon="edit" color="accent" style="font-weight:400"
label="编辑" />
<q-btn-dropdown flat size="xs" color="dark" label="更多" style="margin-left: 10px">
<q-list>
<q-item clickable v-close-popup @click="editorEmployee(props.row)">
<q-item-section>
<q-item-label>修改业务员</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="getAppointment(props.row)">
<q-item-section>
<q-item-label>申请约课</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="getDetail(props.row)">
<q-item-section>
<q-item-label>详情</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
</q-td>
</q-tr>
<q-tr :props="props">
<q-td colspan="100%" class="bg-grey-2">
<div class="flex row items-start">
<q-badge color="negative" class="q-mr-md">
备注
</q-badge>
<div v-html="props.row.Remark" class="text-left col"></div>
</div>
</q-td>
</q-tr>
</template>
<template v-slot:bottom>
<q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="pageCount"
:input="true" @input="changePage" />
</template>
</q-table>
</div>
<visitor-form v-if="isShowVisitor" :save-obj="visitObjOption" @close="closeVisitorForm" @success="refreshPage">
</visitor-form>
<visitorcreate-form v-if="isShowVisitorCreate" :save-obj="visitObjOption" @close="closeVisitorForm"
@success="refreshPage">
</visitorcreate-form>
<schedulFanke v-if="isShowDetail" @close="closeDetail" :save-obj="sendObj"></schedulFanke>
<appoint-form v-if="isShowFangke" :save-obj="visitObjOption" @close="closeAppoint" @success="refreshPage">
</appoint-form>
</div>
</template>
......@@ -69,19 +115,20 @@
import {
getVisitorAllPageList,
} from '../../api/stuMan/index'
import {
queryEmployee
} from '../../api/users/user';
import schedulFanke from '../../components/schedul/schedul-fanke'
import visitorForm from '../../components/schedul/visitor-form'
import visitorcreateForm from '../../components/schedul/visitorcreate-form'
import appointForm from '../../components/schedul/appoint-form'
export default {
meta: {
title: "访问记录"
title: "客户名单"
},
components: {
schedulFanke
schedulFanke,
visitorForm,
appointForm,
visitorcreateForm
},
data() {
return {
msg: {
......@@ -89,13 +136,9 @@
pageSize: 10,
rowsPerPage: 10,
KeyWords: "",
CreateBy: '',
StartTime: '',
EndTime: '',
},
pageCount: 0,
dataList: [],
dateList2: [],
loading: false,
columns: [{
name: 'Name',
......@@ -171,50 +214,45 @@
align: 'left'
},
{
name: 'Remark',
label: '备注',
field: 'Remark',
align: 'left'
},
],
option: {
disabledDate: (time) => {
return time.getTime() > Date.now()
name: 'Id',
label: '操作',
}
},
EmployeeList: [], //业务员
AllemployeeList: [],
isShowDetail:false,
],
sendObj: {},
isShowDetail: false, //是否显示详情
isShowVisitor: false, //是否显示修改访客弹窗
isShowVisitorCreate: false, //是否显示修改业务员弹窗
visitObjOption: null,
isShowFangke: false, //是否显示填写预约
}
},
mounted() {
this.getList();
this.getEmployee()
},
created() {
},
methods: {
//关闭
closeDetail() {
this.isShowDetail = false;
//新增访客
editVisitor(obj) {
if (obj) {
this.visitObjOption = obj;
} else {
this.visitObjOption = null;
}
this.isShowVisitor = true;
},
//获取详情
getDetail(obj) {
this.sendObj = obj;
this.isShowDetail = true;
//显示修改业务员弹窗
editorEmployee(obj) {
if (obj) {
this.visitObjOption = obj;
} else {
this.visitObjOption = null;
}
this.isShowVisitorCreate = true;
},
getList() {
this.loading = true;
if (this.dateList2 && this.dateList2.length > 0) {
this.msg.StartTime = this.dateList2[0];
this.msg.EndTime = this.dateList2[1];
} else {
this.msg.StartTime = '';
this.msg.EndTime = '';
}
getVisitorAllPageList(this.msg).then(res => {
this.loading = false;
this.dataList = res.Data.PageData;
......@@ -239,67 +277,47 @@
return remark;
}
},
//业务员
getEmployee(id) {
var qMsg = {
Dept_Id: 0
}
qMsg.Dept_Id = id;
queryEmployee(qMsg).then(res => {
if (res.Code == 1) {
this.EmployeeList = res.Data;
let obj = {
Id: "",
EmployeeName: "不限"
}
this.EmployeeList.unshift(obj)
this.AllemployeeList = JSON.parse(JSON.stringify(this.EmployeeList));
}
}).catch(() => {
})
//获取详情
getDetail(obj) {
this.sendObj = obj;
this.isShowDetail = true;
},
//筛选业务员
filterFn2(val, update) {
update(() => {
if (val === '') {
this.EmployeeList = JSON.parse(JSON.stringify(this.AllemployeeList))
} else {
const needle = val.toLowerCase()
this.EmployeeList = this.AllemployeeList.filter(v => v.EmployeeName.toLowerCase().indexOf(needle) > -1)
}
})
//关闭
closeDetail() {
this.isShowDetail = false;
},
//关闭访客弹窗
closeVisitorForm() {
this.isShowVisitor = false;
this.isShowVisitorCreate=false;
this.isShowDetail = false;
},
//刷新页面
refreshPage() {
this.isShowVisitor = false;
this.isShowDetail = false;
this.isShowVisitorCreate=false;
this.getList();
},
//打开约课
getAppointment(item) {
this.visitObjOption = item;
this.isShowFangke = true;
},
closeAppoint() {
this.isShowFangke = false;
}
}
}
</script>
<style>
.visitorRecord .border-bottom {
<style scoped>
.border-bottom {
border-bottom: 1px dashed #EEE;
padding-bottom: 5px;
margin-bottom: 5px;
}
.visitorRecord .el-input {
width: 100%;
border: none;
background-color: transparent;
}
.visitorRecord .el-input__inner {
width: 100%;
border: none;
background-color: transparent;
}
.visitorRecord .el-range-input {
background-color: transparent !important;
}
</style>
<style lang="sass">
@import url('~assets/css/table.sass')
......
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