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

页面修改

parent 65df7e45
...@@ -94,9 +94,6 @@ export function queryDutyWork_V2(data) { ...@@ -94,9 +94,6 @@ export function queryDutyWork_V2(data) {
}) })
} }
//获取访客列表 //获取访客列表
export function queryVisitorPage(data) { export function queryVisitorPage(data) {
return request({ return request({
...@@ -115,6 +112,15 @@ export function setVisitor(data) { ...@@ -115,6 +112,15 @@ export function setVisitor(data) {
}) })
} }
//修改访客创建人员
export function setVisitorCreateBy(data) {
return request({
url: '/DutyPlan/UpdateVisitorCreateBy',
method: 'post',
data
})
}
//根据编号查询访客信息 //根据编号查询访客信息
export function queryVisitor(data) { export function queryVisitor(data) {
return request({ 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> <template>
<div class="page-body visitorRecord"> <div class="page-body">
<div class="page-search row items-center"> <div class="page-search row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md"> <div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-3"> <div class="col-3">
<q-input @input="resetSearch" clearable standout="bg-primary text-white" v-model="msg.KeyWords" label="关键字" <q-input @input="resetSearch" clearable standout="bg-primary text-white" v-model="msg.KeyWords" label="关键字"
@clear="resetSearch" maxlength="20" /> @clear="resetSearch" maxlength="20" />
</div> </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> </div>
<div class="page-content"> <div class="page-content">
...@@ -27,41 +13,101 @@ ...@@ -27,41 +13,101 @@
class="sticky-column-table sticky-right-column-table" separator="none" :data="dataList" :columns="columns" class="sticky-column-table sticky-right-column-table" separator="none" :data="dataList" :columns="columns"
row-key="name"> row-key="name">
<template v-slot:top="props"> <template v-slot:top="props">
<div class="col-2 q-table__title">访问记录</div> <div class="col-2 q-table__title">客户名单</div>
<q-space /> <q-space />
<div class="page-option">
</template> <q-btn color="accent" size="sm" class="q-mr-md" icon="add" label="添加客户" @click="editVisitor(null)" />
<template v-slot:body-cell-Name="props"> </div>
<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>
</template> </template>
<template v-slot:body-cell-Remark="props"> <template v-slot:body="props">
<q-td :props="props"> <q-tr :props="props">
{{getRemarks(props.row.Remark)}} <q-td key="Name" :props="props">
</q-td> <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>
<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>
</q-table> </q-table>
</div> </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> <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> </div>
</template> </template>
...@@ -69,19 +115,20 @@ ...@@ -69,19 +115,20 @@
import { import {
getVisitorAllPageList, getVisitorAllPageList,
} from '../../api/stuMan/index' } from '../../api/stuMan/index'
import {
queryEmployee
} from '../../api/users/user';
import schedulFanke from '../../components/schedul/schedul-fanke' 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 { export default {
meta: { meta: {
title: "访问记录" title: "客户名单"
}, },
components: { components: {
schedulFanke schedulFanke,
visitorForm,
appointForm,
visitorcreateForm
}, },
data() { data() {
return { return {
msg: { msg: {
...@@ -89,13 +136,9 @@ ...@@ -89,13 +136,9 @@
pageSize: 10, pageSize: 10,
rowsPerPage: 10, rowsPerPage: 10,
KeyWords: "", KeyWords: "",
CreateBy: '',
StartTime: '',
EndTime: '',
}, },
pageCount: 0, pageCount: 0,
dataList: [], dataList: [],
dateList2: [],
loading: false, loading: false,
columns: [{ columns: [{
name: 'Name', name: 'Name',
...@@ -171,50 +214,45 @@ ...@@ -171,50 +214,45 @@
align: 'left' align: 'left'
}, },
{ {
name: 'Remark', name: 'Id',
label: '备注', label: '操作',
field: 'Remark',
align: 'left'
},
],
option: {
disabledDate: (time) => {
return time.getTime() > Date.now()
} }
}, ],
EmployeeList: [], //业务员
AllemployeeList: [],
isShowDetail:false,
sendObj: {}, sendObj: {},
isShowDetail: false, //是否显示详情
isShowVisitor: false, //是否显示修改访客弹窗
isShowVisitorCreate: false, //是否显示修改业务员弹窗
visitObjOption: null,
isShowFangke: false, //是否显示填写预约
} }
}, },
mounted() { mounted() {
this.getList(); this.getList();
this.getEmployee()
}, },
created() { created() {
}, },
methods: { methods: {
//关闭 //新增访客
closeDetail() { editVisitor(obj) {
this.isShowDetail = false; if (obj) {
this.visitObjOption = obj;
} else {
this.visitObjOption = null;
}
this.isShowVisitor = true;
}, },
//获取详情 //显示修改业务员弹窗
getDetail(obj) { editorEmployee(obj) {
this.sendObj = obj; if (obj) {
this.isShowDetail = true; this.visitObjOption = obj;
} else {
this.visitObjOption = null;
}
this.isShowVisitorCreate = true;
}, },
getList() { getList() {
this.loading = true; 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 => { getVisitorAllPageList(this.msg).then(res => {
this.loading = false; this.loading = false;
this.dataList = res.Data.PageData; this.dataList = res.Data.PageData;
...@@ -239,67 +277,47 @@ ...@@ -239,67 +277,47 @@
return remark; return remark;
} }
}, },
//业务员 //获取详情
getEmployee(id) { getDetail(obj) {
var qMsg = { this.sendObj = obj;
Dept_Id: 0 this.isShowDetail = true;
}
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(() => {
})
}, },
//筛选业务员 //关闭
filterFn2(val, update) { closeDetail() {
update(() => { this.isShowDetail = false;
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)
}
})
}, },
//关闭访客弹窗
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> </script>
<style> <style scoped>
.visitorRecord .border-bottom { .border-bottom {
border-bottom: 1px dashed #EEE; border-bottom: 1px dashed #EEE;
padding-bottom: 5px; padding-bottom: 5px;
margin-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>
<style lang="sass"> <style lang="sass">
@import url('~assets/css/table.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