Commit 7792002d by cwq0219

邀约详情,日历组件,列表;按钮组件逻辑

1 parent 3d0259ea
......@@ -37,7 +37,7 @@ export default {
type: Object,
default: null
},
showBtnName: {
showBtnIds: {
type: Array,
default: []
},
......@@ -54,7 +54,7 @@ export default {
* mapping 非必填 但: 当列表中的操作选项 根据 某个字段 变化的话 必填 且 必须 注明 field: 字段名
* label 当传入label 字段时 标识明确指定渲染该label 的按钮
* size 按钮样式,默认mini
* showBtnName 按需显示按钮
* showBtnIds 按需显示按钮
*/
const {
category,
......@@ -62,7 +62,7 @@ export default {
mapping,
label,
size,
showBtnName
showBtnIds
} = ctx.props
let curBtns = []
/**
......@@ -94,7 +94,7 @@ export default {
* 循环最终显示的按钮列表
* 并渲染到页面
*/
curBtns = showBtnName.length ? curBtns.filter(item => showBtnName.includes(item.label)) : curBtns
curBtns = showBtnIds.length ? curBtns.filter(item => showBtnIds.includes(item.authId)) : curBtns
curBtns.forEach(btn => {
// var judgeRes = data ? (data.yqMerchantId === _this.$store.state.d2admin.user.info.detail.merchantId) : true
// var isShow = !btn.judgeShow ? true : judgeRes
......
......@@ -287,7 +287,6 @@ export const resources = {
authId: '9030601',
parentId: '90306',
label: '再次电联',
type: 'primary',
handle: 'handleMoreCall'
// ruleObj: {
// attr: 'status',
......@@ -300,7 +299,6 @@ export const resources = {
authId: '9030602',
parentId: '90306',
label: '取消预约',
type: 'primary',
handle: 'handleCancel'
}, {
authId: '9030603',
......
......@@ -38,7 +38,7 @@
<auth-button
category="Button"
style="{display: inline-block}"
showBtnName="['预录客户']"
showBtnIds="['9020201']"
></auth-button>
<span class="table-header-left-txt">已预录客户列表{{total}}条记录。</span>
</span>
......@@ -46,7 +46,7 @@
<span class="btn-tips"><img src="../../assets/icon-warn.png">所有号码已启用隐私号码保护功能!</span>
<auth-button
category="Button"
showBtnName="['一键导入']"
showBtnIds="['9020202']"
></auth-button>
</span>
</d2-table-header>
......
......@@ -39,13 +39,13 @@
<auth-button
category="Button"
style="{display: inline-block}"
showBtnName="['新增商品']"
showBtnIds="['9030201']"
></auth-button>
</span>
<auth-button
category="Button"
style="{display: inline-block}"
showBtnName="['导出']"
showBtnIds="['9030202']"
></auth-button>
</d2-table-header>
<d2-table
......
<!-- 邀约详情 -->
<template>
<div class="appoint-table">
<table
cellpadding='0'
cellspacing='0'
>
<tr>
<td>邀约时间</td>
<td>邀约详情</td>
<td>服务状态</td>
</tr>
<tr
v-for="(item, index) in detailData"
:key="index"
<div class="appoint-header">
<p>今日邀约详情</p>
</div>
<div class="appoint-table-content">
<table
cellpadding='0'
cellspacing='0'
>
<td>{{item.time}}</td>
<td class="flex">
<img
class="detail-header"
:src="item.info.sex === 1 ? './header-man.jpg' : './header-woman.jpg'"
/>
<block class="detail-info">
<p>{{item.info.name}}</p>
<p>{{item.info.project}}</p>
</block>
<block class="detail-phone">
<p
class="secret-phone"
v-show="!item.info.phone"
>
<span class="one-tip">手机号码已加密</span>
<span
class="two-tip"
@click="handleGetPhone(item, index)"
>获取虚拟手机号</span>
</p>
<p v-show="item.info.phone">{{item.info.phone}}</p>
</block>
</td>
<td>
{{item.status === 1 ? '完成服务' : '未到店'}}
</td>
</tr>
</table>
<tr class="appoint-table-header">
<td>邀约时间</td>
<td>邀约详情</td>
<td>服务状态</td>
</tr>
<template v-if="detailData.length">
<tr
v-for="(item, index) in detailData"
:key="index"
>
<td>{{item.time}}</td>
<td class="flex">
<img
class="detail-header"
:src="item.info.sex === 1 ? './images/header-man-grey.png' : './images/header-woman.png'"
/>
<block class="detail-info">
<p>{{item.info.name}}</p>
<p>{{item.info.project}}</p>
</block>
<block class="detail-phone">
<p
class="secret-phone"
v-show="!item.info.phone"
>
<span class="one-tip">手机号码已加密</span>
<span
class="two-tip"
@click="handleGetPhone(item, index)"
>获取虚拟手机号</span>
</p>
<p v-show="item.info.phone">{{item.info.phone}}</p>
</block>
</td>
<td>
{{item.status === 1 ? '完成服务' : '未到店'}}
</td>
</tr>
</template>
<tr v-else>
<td colspan="3">无数据</td>
</tr>
</table>
</div>
</div>
</template>
......@@ -58,7 +68,7 @@ export default {
{ 'hour': '15:00' }, { 'hour': '16:00' },
{ 'hour': '17:00' }, { 'hour': '18:00' }],
detailData: [{
time: '9:00',
time: '上午9:00',
info: {
header: '',
name: '张三',
......@@ -70,7 +80,7 @@ export default {
// 0 - 未到店; 1 - 完成服务
status: 0
}, {
time: '9:00',
time: '上午9:00',
info: {
header: '',
name: '张兰',
......@@ -81,7 +91,62 @@ export default {
// 0 - 未到店; 1 - 完成服务
status: 1
}, {
time: '10:00',
time: '上午10:00',
info: {
header: '',
name: '张一二',
sex: 1,
project: '预约项目',
phone: ''
},
// 0 - 未到店; 1 - 完成服务
status: 0
}, {
time: '上午10:00',
info: {
header: '',
name: '张一二',
sex: 1,
project: '预约项目',
phone: ''
},
// 0 - 未到店; 1 - 完成服务
status: 0
}, {
time: '上午10:00',
info: {
header: '',
name: '张一二',
sex: 1,
project: '预约项目',
phone: ''
},
// 0 - 未到店; 1 - 完成服务
status: 0
}, {
time: '上午10:00',
info: {
header: '',
name: '张一二',
sex: 1,
project: '预约项目',
phone: ''
},
// 0 - 未到店; 1 - 完成服务
status: 0
}, {
time: '上午10:00',
info: {
header: '',
name: '张一二',
sex: 1,
project: '预约项目',
phone: ''
},
// 0 - 未到店; 1 - 完成服务
status: 0
}, {
time: '上午10:00',
info: {
header: '',
name: '张一二',
......@@ -115,19 +180,38 @@ export default {
</script>
<style lang="scss" scoped>
.appoint-table {
width: 50%;
width: 49%;
min-width: 536px;
padding: 20px;
margin-right: 10px;
box-shadow: 0 0 11px 0 rgba(207, 207, 207, 0.5);
p {
margin: 0 0;
}
.flex {
display: flex;
}
.appoint-header {
font-size: 16px;
color: #6c6f71;
margin-bottom: 16px;
}
.appoint-table-header {
height: 40px;
}
.appoint-table-content {
height: 533px;
overflow-y: scroll;
}
table {
width: 98%;
color: #333;
border: 1px solid #cfd3d5;
color: #666666;
border: 1px solid #e5e6e7;
border-width: 1px 0 0 1px;
td {
font-size: 12px;
padding: 0px 10px;
border: 1px solid #cfd3d5;
border: 1px solid #e5e6e7;
border-width: 0px 1px 1px 0px;
border-spacing: 0;
text-align: center;
......@@ -135,8 +219,8 @@ export default {
overflow: hidden;
text-overflow: ellipsis;
.detail-header {
height: 70px;
width: 70px;
height: 30px;
width: 30px;
border-radius: 50%;
margin: 6px 10px;
}
......@@ -149,9 +233,6 @@ export default {
height: 70px;
line-height: 70px;
overflow: hidden;
p {
margin: 0 0;
}
}
.secret-phone {
position: absolute;
......@@ -164,7 +245,8 @@ export default {
height: 100%;
}
.two-tip {
background-color: #cccccc;
color: #ffffff;
background-color: #4ECB73;
}
}
.secret-phone:hover {
......
<!-- 日期时间 - 选择器 -->
<template>
<div class="time-selector">
<el-button icon="el-icon-d-arrow-left" type="text" :disabled="currentWeek === 1" @click="handleWeek(false)"></el-button>
<div class="date-picker">
<div
class="wrapper"
v-for="(item, index) in dateList.slice(currentWeek * 7 - 7, currentWeek * 7)"
:key="index"
>
<span>
<p
v-for="(info, infoIndex) in appointData[index].infoList"
:key="infoIndex"
<div class="time-selector-header">
<p>邀约日历</p>
<p>2020年</p>
</div>
<div class="time-selector-container">
<block class="date-left-tips">
<div class="date-tips-time">
<p>上午9:00</p>
<p>中午12:00</p>
<p>晚上18:00</p>
</div>
<p class="date-y-line"></p>
</block>
<el-button
icon="el-icon-d-arrow-left"
type="text"
class="arrow-left-icon"
:disabled="currentWeek === 1"
@click="handleWeek(false)"
></el-button>
<block>
<div class="date-picker">
<div
class="wrapper"
v-for="(item, index) in dateList.slice(currentWeek * 7 - 7, currentWeek * 7)"
:key="index"
>
<span>
<p
v-for="(info, infoIndex) in appointData[index].infoList"
:key="infoIndex"
>
<el-popover
placement="bottom-start"
title=""
width="200"
open-delay="600"
trigger="hover"
:disabled="info.status === 0"
>
<div>
<p>1、客户姓名,时间,项目</p>
<p>2、客户姓名,时间,项目</p>
<p>余位数:8</p>
</div>
<el-button
:class="{'col-width': true, 'hour-block': true, 'status-full': info.status === 2, 'status-remain': info.status === 1 }"
slot="reference"
@click="handleAppoint(item, infoIndex)"
>{{appointStatusList[info.status]}}</el-button>
</el-popover>
</p>
</span>
</div>
</div>
<p class="date-x-line"></p>
<div class="date-picker">
<div
class="wrapper"
v-for="(item, index) in dateList.slice(currentWeek * 7 - 7, currentWeek * 7)"
:key="index"
>
<el-popover
placement="bottom-start"
title=""
width="200"
open-delay="600"
trigger="hover"
:disabled="info.status !== 1"
<el-button
type="text"
:class="{'date-btn': true, 'col-width': true, 'active': item.active}"
@click="handleSelectDate(index)"
>
<div>
<p>1、客户姓名,时间,项目</p>
<p>2、客户姓名,时间,项目</p>
<p>余位数:8</p>
</div>
<el-button
class="col-width hour-block"
slot="reference"
:disabled="((item.date == new Date().toLocaleDateString()) && (+hoursList[infoIndex].hour.split(':')[0] <= new Date().getHours())) || (info.status === 2)"
@click="handleAppoint(item, infoIndex)"
>{{appointStatusList[info.status]}}</el-button>
</el-popover>
</p>
</span>
<el-button
type="text"
:class="{'date-btn': true, 'col-width': true, 'active': item.active}"
@click="handleSelectDate(index)"
>
<p>{{item.date.split('/')[1] + '.' + item.date.split('/')[2]}}</p>
<p>{{weekList[item.week]}}</p>
</el-button>
</div>
<p>{{item.date.split('/')[1] + '.' + item.date.split('/')[2]}}</p>
<p>{{weekList[item.week]}}</p>
</el-button>
</div>
</div>
</block>
<el-button
icon="el-icon-d-arrow-right"
type="text"
:disabled="currentWeek === 5"
@click="handleWeek(true)"
></el-button>
</div>
<el-button icon="el-icon-d-arrow-right" type="text" :disabled="currentWeek === 5" @click="handleWeek(true)"></el-button>
</div>
</template>
......@@ -89,12 +124,12 @@ export default {
methods: {
// 日期选择
handleSelectDate(currentIndex) {
this.dateList[this.dateIndex].active = false
this.dateIndex = currentIndex
this.dateList[currentIndex].active = true
// this.dateList[this.dateIndex].active = false
// this.dateIndex = currentIndex
// this.dateList[currentIndex].active = true
},
handleAppoint(date, hourIndex) {
this.$emit('handleAppoint', { date: date.date, hour: this.hoursList[hourIndex].hour })
// this.$emit('handleAppoint', { date: date.date, hour: this.hoursList[hourIndex].hour })
},
handleWeek(isAdd) {
isAdd ? this.currentWeek++ : this.currentWeek--
......
.time-selector {
width: 50%;
height: 100%;
display: flex;
align-items: center;
padding: 20px;
box-shadow: 0 0 11px 0 rgba(207, 207, 207, 0.50);
p {
margin: 0 0;
}
.time-selector-header {
display: flex;
justify-content: space-between;
font-size: 16px;
color: #6C6F71;
.col-width {
width: 80px;
p {
margin-top: 0;
}
}
.date-picker {
.time-selector-container {
position: relative;
width: 50%;
height: 100%;
display: flex;
width: 100%;
overflow-x: scroll;
margin: 0 8px;
// align-items: center;
color: #A1A1A1;
.wrapper {
width: 100%;
p {
margin: 0 0;
}
.arrow-left-icon {
position: absolute;
left: 73px;
top: 46%;
}
.col-width {
width: 62px;
height: 44px;
}
.date-left-tips {
display: flex;
align-self: flex-start;
font-size: 12px;
.date-tips-time {
width: 32px;
margin-right: 18px;
p {
width: 32px;
position: absolute;
text-align: right;
}
p:nth-child(2) {
top: 140px;
}
p:nth-child(3) {
top: 403px;
}
}
.hour-block {
text-align: center;
.date-y-line {
height: 441px;
width: 1px;
background-color: rgba(207, 207, 207, 0.50);
}
}
.date-x-line {
position: relative;
height: 1px;
width: 100%;
background-color: rgba(207, 207, 207, 0.50);
margin: 20px 0 8px;
}
// .date-x-line::before {
// content: '';
// position: absolute;
// display: inline-block;
// width: 9px;
// height: 9px;
// background-color: #FDAB27;
// border-radius: 50%;
// top: -5px;
// }
.date-picker {
display: flex;
width: 434px;
overflow-x: scroll;
padding-left: 40px;
.wrapper {
width: 100%;
.hour-block {
text-align: center;
background: #F7F7F7;
border: 1px solid #ffffff;
border-radius: 0;
}
.hour-block.status-full {
color: #ffffff;
background: #FDAB27;
border: 1px solid #FFFFFF;
}
.hour-block.status-remain {
color: #ffffff;
background: #4ECB73;
border: 1px solid #FFFFFF;
}
.date-btn {
position: relative;
font-size: 12px;
color: #A1A1A1;
&.active {
color: #666666;
}
// &.active::before {
// content: '';
// position: absolute;
// display: inline-block;
// width: 9px;
// height: 9px;
// background-color: #FDAB27;
// border-radius: 50%;
// }
// &.active {
// color: #68c9d0;
.date-btn {
position: relative;
color: #333;
// &.active {
// color: #68c9d0;
// &:after {
// position: absolute;
// bottom: 0;
// left: 9%;
// content: '';
// width: 82%;
// display: block;
// height: 2px;
// background: #68c9d0;
// }
// }
// &:after {
// position: absolute;
// bottom: 0;
// left: 9%;
// content: '';
// width: 82%;
// display: block;
// height: 2px;
// background: #68c9d0;
// }
// }
}
}
}
}
......
......@@ -12,6 +12,91 @@
@handleAppoint="handleAppoint"
></time-date>
</div>
<div class="d2-container-content">
<el-form :inline="true">
<el-form-item label="日期:">
<el-date-picker
v-model="searchForm.date"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</el-form-item>
<el-form-item label="">
<el-input
v-model="searchForm.name"
placeholder="客户姓名或车架号"
></el-input>
</el-form-item>
<el-form-item>
<el-button
v-show="activeName === 'first'"
:id="tableParams.btnId"
size="small"
type="primary"
>查询</el-button>
<el-button
v-show="activeName === 'second'"
:id="tableSecondParams.btnId"
size="small"
type="primary"
style="margin-left: 0px;"
>查询</el-button>
<el-button
size="small"
@click="handleReset"
>重置</el-button>
</el-form-item>
</el-form>
<el-tabs
v-model="activeName"
type="card"
>
<el-tab-pane name="first">
<span slot="label"><i class="el-icon-date"></i>已预约(16)</span>
<d2-table
ref="invitationFirstTable"
:hasNum="false"
:searchForm="searchForm"
:tableParams="tableParams"
:getListApi="getListApi"
>
<template
slot="auth-button"
slot-scope="scope"
>
<auth-button
:data="scope.scope"
showBtnIds="['9030601', '9030602', '9030603', '9030604']"
></auth-button>
</template>
</d2-table>
</el-tab-pane>
<el-tab-pane name="second">
<span slot="label"><i class="el-icon-date"></i>待预约(18)</span>
<d2-table
ref="invitationSecondTable"
:hasNum="false"
:searchForm="searchForm"
:tableParams="tableSecondParams"
:getListApi="getListApi"
>
<template
slot="auth-button"
slot-scope="scope"
>
<auth-button
:data="scope.scope"
showBtnIds="['9030605', '9030606', '9030607']"
></auth-button>
</template>
</d2-table>
</el-tab-pane>
</el-tabs>
</div>
<d2-dialog
title="正在为客户预约"
:isVisible="appointDialogVisible"
......@@ -81,10 +166,10 @@
</template>
<script>
import { getList } from '@api/commodity'
import { afterTodayOptions, appointDays } from '@/common/constants'
import TimeDate from './invitation-component/TimeDate'
import AppointTable from './invitation-component/AppointTable'
// import TimeDateTemp from './invitation-component/TimeDateTemp'
export default {
name: 'invitation',
data() {
......@@ -114,7 +199,70 @@ export default {
{ 'hour': '11:00' }, { 'hour': '12:00' },
{ 'hour': '13:00' }, { 'hour': '14:00' },
{ 'hour': '15:00' }, { 'hour': '16:00' },
{ 'hour': '17:00' }, { 'hour': '18:00' }]
{ 'hour': '17:00' }, { 'hour': '18:00' }],
// table
activeName: 'first',
searchForm: {
date: '',
name: ''
},
getListApi: getList,
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: true,
tableColumns: [{
label: '操作日期',
prop: ''
}, {
label: '客户信息',
prop: 'customerInfo',
addHtml: 'customerInfo'
}, {
label: '状态',
prop: 'status'
}, {
label: '预约信息',
prop: 'customerInfo',
addHtml: ''
}, {
label: '备注信息',
prop: 'customerInfo',
addHtml: ''
}]
},
tableSecondParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000) + 'second',
listName: 'list',
tableOption: true,
tableColumns: [{
label: '操作日期',
prop: ''
}, {
label: '客户信息',
prop: 'customerInfo',
addHtml: 'customerInfo'
}, {
label: '录入时间',
prop: 'status'
}, {
label: '来源',
prop: 'customerInfo',
addHtml: ''
}, {
label: '状态',
prop: 'customerInfo',
addHtml: ''
}, {
label: '操作记录',
prop: 'customerInfo',
addHtml: ''
}, {
label: '备注信息',
prop: 'customerInfo',
addHtml: ''
}]
}
}
},
......@@ -154,7 +302,9 @@ export default {
<style lang="scss">
.invitation {
.header {
min-width: 1176px;
display: flex;
justify-content: space-around;
padding: 20px 20px;
}
}
......
......@@ -39,13 +39,13 @@
<auth-button
category="Button"
style="{display: inline-block}"
showBtnName="['新增素材']"
showBtnIds="['9030101']"
></auth-button>
</span>
<auth-button
category="Button"
style="{display: inline-block}"
showBtnName="['导出']"
showBtnIds="['9030103']"
></auth-button>
</d2-table-header>
<d2-table
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!