Commit 7792002d by cwq0219

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

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