Commit c5deaa5c by 前端

commit

1 parent 73168da6
{ {
"name": "scrm-micro-outbound", "name": "outbound",
"version": "1.0.0", "version": "1.0.0",
"description": "A Vue.js project", "description": "A Vue.js project",
"private": true, "private": true,
......
...@@ -26,8 +26,9 @@ ...@@ -26,8 +26,9 @@
</div> </div>
<img src="./assets/logo.png" alt="" srcset="" /> <img src="./assets/logo.png" alt="" srcset="" />
</div>--> </div>-->
<keep-alive exclude="details">
<router-view /> <router-view />
</keep-alive>
</div> </div>
</template> </template>
......
/**
* 新增参数sign 判断接口是否需要sign签名
*/
/**
* 用法 : this.$apis.demo.GETLISTDEVICEFILEUNSTOCK(...)
* @param {*} params
* @returns
*/
import { http_common } from '@/main'
const pictureUpload = params => {
params.method = 'glsx.accounts.biz.common.pictureUpload'
return http_common({
url: '/router?method=glsx.accounts.biz.common.pictureUpload',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
export default {
pictureUpload
}
import { http } from '@/main'
const url = '/rop-scrm-entmicro/router'
// 智能外呼任务分页
const getTaskList = params => {
params.method = 'entmicro.api.outbound.task.page'
return http({
url,
method: 'POST',
data: params,
sign: true
})
}
// 统计:所有任务的执行状态
const getStatusStatistics = params => {
params.method = 'entmicro.api.outbound.task.status'
return http({
url,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 设置外呼数量
const setOutBoundNum = params => {
params.method = 'entmicro.api.outbound.task.outBoundNum'
return http({
url,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 创建外呼执行任务
const createExecuteTask = params => {
params.method = 'entmicro.api.outbound.call.create.execute.task'
return http({
url,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 获取机器人列表
const getRobotList = params => {
params.method = 'entmicro.api.outbound.call.robot.list.query'
return http({
url,
method: 'POST',
data: params,
sign: true
})
}
// 获取呼叫电话列表
const getCallerList = params => {
params.method = 'entmicro.api.outbound.call.caller.numbers.query'
return http({
url,
method: 'POST',
data: params,
sign: true
})
}
// 智能外呼任务详情-基本信息
const taskbaseDetails = params => {
params.method = 'entmicro.api.outbound.task.detail'
return http({
url,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 智能外呼任务详情-手机号状态列表分页
const getphoneStatusList = params => {
params.method = 'entmicro.api.outbound.task.phoneStatus.page'
return http({
url,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 下载手机号状态列表
const downloadPhoneList = params => {
params.method = 'entmicro.api.outbound.task.phoneStatus.download'
return http({
url,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 执行任务状态变更
const updateStatus = params => {
params.method = 'entmicro.api.outbound.call.execute.task.status.update'
return http({
url,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 导入手机号更新添加状态接口
const updatePhoneStatus = params => {
params.method = 'entmicro.api.outbound.call.import.update.phone.status'
return http({
url,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 获取外呼数量
const getOutBoundNum = params => {
params.method = 'entmicro.api.outbound.task.getOutBoundNum'
return http({
url,
method: 'POST',
data: params,
sign: true
})
}
export default { getTaskList, getStatusStatistics, setOutBoundNum, createExecuteTask, getRobotList, getCallerList ,taskbaseDetails ,getphoneStatusList,downloadPhoneList,updateStatus,updatePhoneStatus,getOutBoundNum}
import { http } from '@/main'
const defaultPath = 'scrm.api.shopmall.'
const getZoneListApi = params => {
params.method = `${defaultPath}zoneInfo.page`
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
const deleteZoneApi = params => {
params.method = `${defaultPath}zoneInfo.delete`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const getZoneInfoApi = params => {
params.method = `${defaultPath}zoneInfo.getById`
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
const insertZoneApi = params => {
params.method = `${defaultPath}zoneInfo.insertOrUpdate`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export default { getZoneListApi, deleteZoneApi, getZoneInfoApi, insertZoneApi }
...@@ -5,19 +5,59 @@ html { ...@@ -5,19 +5,59 @@ html {
margin: 0; margin: 0;
padding: 0; padding: 0;
overflow: hidden; overflow: hidden;
background-color: #F4F5FA; background-color: #f4f5fa;
} }
.el-form-item__content {
.marketing .container { width: 360px;
.el-input__inner {
height: 32px !important;
line-height: 32px !important;
}
}
.flex {
display: flex;
align-items: center;
}
.outbound .container {
background: #ffffff; background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 20px; padding: 20px;
} }
.marketing .m-b-20 { .outbound .m-b-20 {
margin-bottom: 20px; margin-bottom: 20px;
} }
.fwt-4{
font-weight: 400;
}
.font-12 {
font-size: 12px;
}
.font-14 {
font-size: 14px;
}
.color6 {
color: #666666;
}
.color3 {
color: #333333;
}
.color58{
color:#5850FF
}
.m-r-4 {
margin-right: 4px;
}
.m-l-4 {
margin-left: 4px;
}
.marketing.p-t-20 { .m-b-10 {
margin-bottom: 10px;
}
.outbound.p-t-20 {
padding-top: 20px; padding-top: 20px;
} }
.line-20{
line-height: 20px;
}
\ No newline at end of file \ No newline at end of file
/**
* 时间控件-限制月份
*/
export const rangePickerOptions = {
disabledDate(date) {
if (date > new Date()) {
return true
}
return false
}
}
export const rangetimePickerOptions = {
disabledDate(date) {
let dateHour = new Date()
dateHour.setDate(date.getDate())
dateHour.setHours(8)
dateHour.setMinutes(0)
dateHour.setSeconds(0)
if (dateHour.getTime() < date.getTime() < new Date(2016, 9, 10, 20, 0).getTime()) {
return true
}
return false
}
}
<!-- 搜索 -->
<template>
<div class="glsx-combi-form">
<el-form :ref="formRef" :inline="true" :model="formObj" :label-width="labelWidth" :rules="formRules" size="mini" class="glsx-combi-form-block">
<template v-for="(item, index) in formData">
<el-form-item v-if="!item.isHide" :key="index" :class="{ 'no-label': !item.label, tips: item.tips }" :label="item.label ? item.label + ':' : ''" :prop="item.name">
<slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot>
<el-input v-else-if="item.type === 'input'" :placeholder="item.placeholder || '请输入' + item.label" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :style="{ width: item.width || 'auto' }" :show-word-limit="item.showLimit || false" @keydown.native="e => handleInputDown(e, item)"></el-input>
<!-- 选择-输入框 -->
<el-input v-else-if="item.type === 'selectInput'" :placeholder="'请输入' + item.selectOption.find(k => k.name === searchSelectObj[item.selectName].attr).label" v-model.trim="searchSelectObj[item.selectName].value" :clearable="item.isClear || false" class="input-with-select">
<el-select v-model="searchSelectObj[item.selectName].attr" style="width: 130px" slot="prepend" placeholder="请选择" @change="item.handleSelectChange">
<el-option v-for="(subItem, subIndex) in item.selectOption" :key="subIndex" :label="subItem.label" :value="subItem.name"></el-option>
</el-select>
</el-input>
<!-- 选择-时间选择框 -->
<template v-else-if="item.type === 'selectDatePicker'">
<el-select v-model="searchSelectObj[item.selectName].attr" style="width: 130px" placeholder="请选择" @change="item.handleSelectChange">
<el-option v-for="(subItem, subIndex) in item.selectOption" :key="subIndex" :label="subItem.label" :value="subItem.name"></el-option>
</el-select>
<el-date-picker v-model="searchSelectObj[item.selectName].value" style="width: calc(100% - 130px)" :type="item.dateType || 'daterange'" :clearable="item.isClear || false" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOption[item.pickerOptions]"></el-date-picker>
</template>
<!-- 选择-时间选择框 -->
<template v-else-if="item.type === 'selectTimePicker'">
<el-time-picker is-range v-model="formObj[item.name]" :value-format="item.format || ''" :style="{ width: item.width || '100%' }" :picker-options="item.pickerOptions || ''" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" placeholder="选择时间范围"></el-time-picker>
</template>
<!-- 双选择框 -->
<template v-else-if="item.type === 'selectDouble'">
<el-select v-model="searchSelectObj[item.selectName].attr" style="width: 130px" placeholder="请选择" @change="item.handleSelectChange">
<el-option v-for="(subItem, subIndex) in item.selectOption" :key="subIndex" :label="subItem.label" :value="subItem.name"></el-option>
</el-select>
<el-select v-model="searchSelectObj[item.selectName].value" style="width: calc(100% - 130px)" :placeholder="'请选择' + item.selectOption.find(k => k.name === searchSelectObj[item.selectName].attr).label">
<el-option label="全部" value=""></el-option>
<el-option v-for="subItem in item.selectOption.find(k => k.name === searchSelectObj[item.selectName].attr).optionList" :key="subItem[item.optionId]" :label="subItem[item.optionLabel]" :value="subItem[item.optionId]"></el-option>
</el-select>
</template>
<!-- 选择框 -->
<el-select v-else-if="item.type === 'select'" :style="{ width: item.width || '100%' }" v-model="formObj[item.name]" :clearable="item.isClear || false" :placeholder="'请选择' + item.label" :filterable="!item.noFilter" :disabled="item.isDisabled" :no-data-text="item.noDataText || '无数据'" :multiple="item.multiple || false" :collapse-tags="item.collapseTags || true" @change="selectAddAttr($event, item)">
<el-option v-for="subItem in item.optionList" :key="item.optionId ? subItem[item.optionId] : subItem" :label="item.optionLabel ? subItem[item.optionLabel] : subItem" :value="item.optionId ? subItem[item.optionId] : subItem" :disabled="subItem.isDisabled || false"></el-option>
</el-select>
<!-- 计数器 -->
<template v-else-if="item.type === 'inputNumber'"></template>
<!-- radio -->
<el-radio-group v-else-if="item.type === 'radio'" v-model="formObj[item.name]" @change="item.handleRadioChange">
<el-radio v-for="subItem in item.optionList" :key="subItem[item.optionId]" :label="subItem[item.optionId]" :disabled="subItem.isDisabled || false">{{ subItem[item.optionLabel] }}</el-radio>
</el-radio-group>
<el-date-picker v-else-if="item.type === 'datePicker'" v-model="formObj[item.name]" :type="item.dateType || 'daterange'" :clearable="item.isClear || false" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOption[item.pickerOptions]"></el-date-picker>
</el-form-item>
</template>
<slot></slot>
</el-form>
</div>
</template>
<script>
import { rangePickerOptions, rangetimePickerOptions } from './common'
export default {
name: 'glsx-combi-form',
data() {
return {
pickerOption: {
rangePickerOptions: rangePickerOptions,
rangetimePickerOptions: rangetimePickerOptions
}
}
},
props: {
formRef: {
type: String,
default: 'formRef'
},
labelWidth: {
type: String,
default: '85px'
},
formData: {
type: Array,
default: () => []
},
formObj: {
type: Object,
default: () => {}
},
hasTitle: {
type: Boolean,
default: true
},
formRules: {
type: Object,
default: () => {}
},
// 搜索+输入框/搜索组合组件,搜索栏绑值
searchSelectObj: {
type: Object,
default: () => {}
}
},
mounted() {},
methods: {
// 选择框-添加其他属性
selectAddAttr(value, targetItem) {
targetItem.changeAttr && targetItem.changeAttr(value, targetItem)
},
handleInputDown(e, item) {
if (e.keyCode === 13 && item.hasOwnProperty('keyFn')) {
item.keyFn()
}
}
}
}
</script>
<style scoped lang="scss">
.glsx-combi-form .no-label.el-form-item--mini .el-form-item__content,
.el-form-item--mini .el-form-item__label {
width: 100%;
}
.glsx-combi-form .el-col {
margin-bottom: 10px;
}
.glsx-combi-form .el-select {
width: 100%;
}
.glsx-combi-form .item-height {
height: 37px;
}
.glsx-combi-form input::-webkit-outer-spin-button,
.glsx-combi-form input::-webkit-inner-spin-button {
-webkit-appearance: none !important;
}
.glsx-combi-form input[type='number'] {
-moz-appearance: textfield !important;
}
.glsx-combi-form .input-with-select .el-input-group__prepend {
background-color: #fff;
}
.glsx-combi-form .tips {
margin: 0;
}
.glsx-combi-form /deep/ .el-input-number {
width: 85px;
.el-input__inner {
height: 28px !important;
line-height: 28px !important;
// width:45px;
}
.el-input-number__decrease,
.el-input-number__increase {
background-color: #fff !important;
width: 20px;
}
}
</style>
<template>
<div>
<template >
<div class="layout-wrap">
<el-row :gutter="30">
<template v-for="(params, index) in rowParams">
<el-col :span="params.span" :key="index">
<div class="label-wrap">
<label>{{ params.label }}</label>
<slot v-if="params.addHtml" :name="params.addHtml" :scope="list"></slot>
<span v-else>
{{ list[params.prop] }}
</span>
</div>
</el-col>
</template>
</el-row>
</div>
</template>
</div>
</template>
<script>
export default {
name: 'glsx-rows',
data() {
return {
list: '',
rowParams: ''
}
},
props: {
//获取的数据
layoutData: {
type: Object,
default: () => {}
},
layoutParams: {
type: Array,
default: () => []
}
},
watch: {
layoutData(val) {
this.list = val
let { layoutParams } = this
for (let i = 0; i < layoutParams.length; i++) {
if (layoutParams[i].isHidden && !layoutParams[i].isHidden(val)) {
layoutParams.splice(i--, 1)
}
}
this.rowParams = layoutParams
console.log(this.rowParams,'-------------')
}
},
created() {}
}
</script>
<style scoped lang="scss">
.layout-wrap {
.el-row {
&:last-child {
margin-bottom: -20px;
}
.el-col {
margin-bottom: 20px;
}
.label-wrap {
display: flex;
align-items: center;
min-width: 80%;
label {
font-size: 14px;
font-weight: 400;
color: #666666;
line-height: 20px;
text-align: right;
min-width: 70px;
display: inline-block;
}
span {
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
text-align: left;
// max-width: 228px;
// white-space: nowrap;
// overflow: hidden;
// text-overflow: ellipsis;
// display: inline-block;
}
}
}
}
</style>
...@@ -9,5 +9,12 @@ ...@@ -9,5 +9,12 @@
*/ */
import Vue from 'vue' import Vue from 'vue'
import glsxDialog from '@/components/glsx-dialog/index.vue' import glsxDialog from '@/components/glsx-dialog/index.vue'
import glsxCombiForm from '@/components/glsx-combi-form/index.vue'
import tipPanel from '@/components/tipPanel/index.vue'
import glsxRows from '@/components/glsx-rows/index.vue'
Vue.component('glsx-dialog', glsxDialog) Vue.component('glsx-dialog', glsxDialog)
Vue.component('glsx-combi-form', glsxCombiForm)
Vue.component('tip-panel', tipPanel)
Vue.component('glsx-rows', glsxRows)
\ No newline at end of file \ No newline at end of file
<template>
<div>
<div class="initPanel flex" :style="{ width: panelWidth, minHeight: panelMinHeight }">
<img src="@/assets/Shape.png" alt="" />
<label>{{ panelContent }}</label>
<i class="el-icon-close" @click="closeInitPanel"></i>
</div>
</div>
</template>
<script>
export default {
props: {
panelWidth: {
type: String,
default: ''
},
panelMinHeight: {
type: String,
default: '20px'
},
panelContent: {
type: String,
default: '请传入面板内容'
},
isShowCloseBtn: {
type: Boolean,
default: false
}
},
data() {
return {}
},
methods: {
closeInitPanel() {
this.$emit('closePanel')
}
}
}
</script>
<style lang="scss" scoped>
// @import '@/styles/variables.scss';
.initPanel {
margin-bottom: 20px;
position: relative;
box-sizing: border-box;
background: #e6e9ff;
border-radius: 4px;
padding: 0 8px;
font-size: 14px;
font-weight: 400;
color: rgba(0, 0, 0, 0.65);
line-height: 20px;
img {
margin-right: 4px;
}
i {
width: 9px;
height: 9px;
cursor: pointer;
position: absolute;
top: 14px;
right: 18px;
}
}
</style>
...@@ -12,7 +12,7 @@ let cfg = require('./conf.js') ...@@ -12,7 +12,7 @@ let cfg = require('./conf.js')
import { Http } from 'glsx-common' import { Http } from 'glsx-common'
let timeout = 30000 //超时时间 let timeout = 30000 //超时时间
export const fetchConfig = function (isEnv = true) { export const fetchConfig = function (isEnv = true) {
// console.log(1111111)
// if (isEnv) { // if (isEnv) {
// let { request } = cfg // let { request } = cfg
// Object.assign(request, { timeout }) // Object.assign(request, { timeout })
......
const staticRoutes = Object.freeze([{ const staticRoutes = Object.freeze([{
name: 'default', name: 'default',
path: '/', path: '/',
redirect: { name: 'zoneList' } redirect: { name: 'outbound' }
}, },
{ {
name: 'zoneList', name: 'outbound',
path: '/zoneList/index', path: '/outbound/index',
component: resolve => require([`@/views/zoneList/index.vue`], resolve), component: resolve => require([`@/views/outbound/index.vue`], resolve),
meta: {}
},
{
name: 'details',
path: '/outbound/details',
component: resolve => require([`@/views/outbound/details.vue`], resolve),
meta: {} meta: {}
} }
]) ])
......
<!-- -->
<template>
<div class="container-detail">
<div class="outbound-info">
<div class="outbound-info-title">外呼基本信息</div>
<glsx-rows class="glsx-rows-wrap" :layoutData="detailData" :layoutParams="outboundParams">
<template slot="callerNums" slot-scope="scope">
<template v-for="item in eval(scope.scope.callerNums)">
<span class="font-14 color3 line-20" :key="item">{{ item }}</span>
</template>
</template>
<template slot="dialTime" slot-scope="scope">
<span class="font-14 color3 line-20">{{ scope.scope.dialStartTime }}-{{ scope.scope.dialEndTime }}</span>
</template>
<template slot="retryTimes" slot-scope="scope">
<span class="font-14 color3 line-20">重播{{ scope.scope.retryTimes }}次,每次间隔{{ scope.scope.retryInterval }}分钟</span>
</template>
</glsx-rows>
</div>
<div class="outbound-info">
<div class="outbound-info-title flex">
离店客户加好友概览
<span style="margin:0 8px;color: #666666; font-size: 14px;">|</span>
<lbael class="color6 font-14 fwt-4">{{ detailData.taskStatus == 2 ? '正在执行中' : detailData.taskStatus == 3 ? '已暂停' : '已完成' }}</lbael>
</div>
<div class="outbound-info-wrap">
<div class="general">
<div class="general-item" v-for="(item, index) in statisticsList" :key="index">
<div class="general-item-icon">
<img :src="item.logo" />
</div>
<div>
<div class="general-item-title">{{ item.describe }}</div>
<div class="general-item-num">
{{ item.value(detailData) }}
<span class="font-14;color3;m-l-4">人</span>
</div>
</div>
</div>
</div>
<div class="chart" id="lineRef"></div>
<GLCombiForm :rowNumber="1" class="searchForm" ref="detailsSearch" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<GLTable class="detailsTable" ref="detailsTable" :searchForm="searchForm" :pageConf="pageConf" :tableParams="tableParams" :getListApi="getListApi">
<template slot="phoneStatus" slot-scope="scope">
<div :class="['task_icon', `task_icon${scope.scope.phoneStatus}`]">{{ taskStatus(scope.scope.phoneStatus) }}</div>
</template>
</GLTable>
</div>
</div>
</div>
</template>
<script>
const TASK_STATUS = [
{
label: '该用户不存在',
value: 1
},
{
label: '待发送好友申请',
value: 2
},
{
label: '已发送好友申请',
value: 3
},
{
label: '申请通过',
value: 4
}
]
import * as echarts from 'echarts'
export default {
name: 'details',
data() {
return {
id: this.$route.query.id ? this.$route.query.id : 0,
getListApi: this.$apis.outbound.getphoneStatusList,
detailData: {},
myChart: null,
searchForm: {
phone: '',
status: '',
id: this.$route.query.id
},
outboundParams: [
{
label: '任务名称:',
prop: 'taskName',
span: 12
},
{
label: '选择话术机器人:',
prop: 'robotName',
span: 12
},
{
label: '外呼主叫号码:',
addHtml: 'callerNums',
span: 12
},
{
label: '外呼时间:',
addHtml: 'dialTime',
span: 12
},
{
label: '重播设置:',
addHtml: 'retryTimes',
span: 12
}
// {
// label: '号码过滤:',
// prop: 'numTypeFilterList',
// span: 12
// }
],
searchFormData: [
{
label: '手机号',
name: 'phone',
type: 'input'
}
// {
// label: '状态',
// name: 'status',
// type: 'select',
// optionList: [
// {
// id: '',
// name: '全部'
// },
// {
// id: 1,
// name: '该用户不存在'
// },
// {
// id: 2,
// name: '待发送好友申请'
// },
// {
// id: 3,
// name: '已发送好友申请'
// }],
// optionId: 'id',
// optionLabel: 'name'
// }
],
statisticsList: [
{
logo: require('../../assets/customer.png'),
describe: '客户总数',
value: obj => {
return obj.phoneCount ? obj.phoneCount : 0
}
},
{
logo: require('../../assets/apply.png'),
describe: '通过申请',
value: obj => {
return obj.passNums ? obj.passNums : 0
}
},
{
logo: require('../../assets/user.png'),
describe: '不存在的手机号用户',
value: obj => {
return obj.noneUserNums ? obj.noneUserNums : 0
}
}
],
// 表格参数
tableParams: {
listName: 'data.data',
tableColumns: [
{
label: '手机号',
prop: 'phone'
},
{
label: '状态',
prop: 'phoneStatus',
addHtml: 'phoneStatus'
}
]
},
pageConf: {
pageSize: 'pageSize',
pageNum: 'pageNum',
totalCount: 'data.count'
}
}
},
mounted() {
let chartDom = document.getElementById('lineRef')
this.myChart = echarts.init(chartDom)
window.addEventListener('resize', () => {
this.myChart.resize()
})
this.taskbaseDetails()
},
methods: {
eval(data) {
const arr = data.replace(/("|\[|\])/g, '').split(',')
return arr
},
taskStatus(status) {
const val = TASK_STATUS.find(item => item.value == status)
return val ? val.label : '--'
},
taskbaseDetails() {
let params = {
id: this.id
}
this.$apis.outbound.taskbaseDetails(params).then(res => {
if (res.code == 0) this.detailData = res.data
this.initCanvas(this.detailData.phoneStatusDailyCharts)
})
},
handleSearch() {
this.$refs.detailsTable.refreshTable()
},
handleReset() {
this.searchForm = {
phone: '',
status: '',
id: this.id
}
this.handleSearch()
},
initCanvas(lineValue) {
const x_data = lineValue && lineValue.length ? lineValue.map(item => item.dailyDate) : []
const y_data = lineValue && lineValue.length ? lineValue.map(item => item.passedCounts) : []
this.option = {
tooltip: {
show: true,
axisPointer: {
// type: 'cross'
}
},
grid: {
right: '90x',
left: '90px'
},
minInterval: 1,
xAxis: {
type: 'category',
data: x_data
},
yAxis: {
type: 'value'
},
series: [
{
// symbol: 'none',
data: y_data,
type: 'line',
smooth: true,
areaStyle: {
color: 'rgba(88,80,255, 0.15)'
}
}
]
}
this.myChart.setOption(this.option)
},
btnClick() {}
}
}
</script>
<style scoped lang="scss">
.task_icon {
position: relative;
&::after {
content: '';
position: absolute;
top: 4px;
left: -10px;
width: 6px;
height: 6px;
border-radius: 4px;
}
&.task_icon1 {
&::after {
background: #999999;
}
}
&.task_icon2 {
&::after {
background: #fdb757;
}
}
&.task_icon3 {
&::after {
background:#5850ff;
}
}
&.task_icon4 {
&::after {
background: #2cca74;
}
}
}
.container-detail {
padding: 20px 0;
overflow-y: scroll;
height: 100%;
.outbound-info {
width: 100%;
height: auto;
background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
margin-bottom: 10px;
&-title {
line-height: 28px;
font-size: 16px;
font-weight: 600;
color: #333333;
padding: 15px 0 15px 20px;
border-bottom: 1px solid #e5e5e5;
}
.glsx-rows-wrap {
padding: 32px 76px;
}
&-wrap {
padding: 20px 16px;
box-sizing: border-box;
background: #ffffff;
.general {
display: flex;
align-items: center;
margin: 0 40px 20px 40px;
.general-item {
width: 274px;
height: 100px;
background: #f9fafc;
border-radius: 4px;
padding: 20px 16px;
display: flex;
box-sizing: border-box;
margin-right: 16px;
&-icon {
width: 48px;
height: 48px;
margin-right: 16px;
img {
width: 100%;
}
}
&-title {
font-size: 14px;
color: #333333;
line-height: 20px;
margin-bottom: 10px;
}
&-num {
font-size: 26px;
font-weight: bold;
color: #333;
line-height: 31px;
}
}
}
.chart {
height: 320px;
}
.searchForm {
margin-bottom: 20px;
}
}
}
.m-b-7 {
margin-bottom: 70px;
}
.footer-btn {
position: fixed;
bottom: 0;
width: 100%;
text-align: center;
background-color: #fff;
}
}
.detailsTable {
// /deep/ {
// .el-table__header tr,
// .el-table th.el-table__cell {
// background: #f4f6fc;
// font-size: 14px;
// color: #333;
// display: flex;
// line-height: 20px;
// width: 100vw;
// }
// th:nth-child(1) {
// visibility: hidden;
// }
// th {
// flex: 1;
// }
// }
}
</style>
<!-- 专区管理 -->
<template>
<div class="outbound">
<div class="container">
<GLCombiForm :rowNumber="1" ref="formSearch" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="outbound-head-btn">
<div class="choseRow">
<div class="choseItem" :class="{ active: currentIndex == index + 1 }" v-for="(item, index) in tabList" :key="index" @click="tabClick(index + 1)">{{ item.label }}({{ taskStatus[item.name] }})</div>
</div>
<el-button :size="size" type="primary" class="outbound-set-btn" plain @click="outboundVisible = true">外呼设置</el-button>
</div>
<div class="outbound-tabe-wrap">
<!-- 表格区域 开始 -->
<GLTable ref="outboundRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div slot="outboundInfo" slot-scope="scope">
<!-- 子任务 -->
<el-table class="subtasks-wrap" border :data="scope.scope.executeTaskList">
<template v-for="(col, index) in outboundInfoParams">
<el-table-column v-if="col.addHtml" :prop="col.prop" :label="col.label" :key="index" :width="col.width || ''">
<template slot-scope="endTime">
<span>{{ endTime.row.executeTaskEndTime ? endTime.row.executeTaskEndTime : '--' }}</span>
</template>
</el-table-column>
<el-table-column v-else :prop="col.prop" :label="col.label" :key="index" :width="col.width || ''"></el-table-column>
</template>
<el-table-column label="操作">
<template slot-scope="scopeChild">
<el-button type="text" v-if="scopeChild.row.taskStatus == 2" @click.stop="handleStop(scope.scope, 1)">暂停</el-button>
<el-button type="text" v-if="scopeChild.row.taskStatus == 3 && scope.scope.stopType == '手动暂停'" @click.stop="handleStop(scope.scope, 2)">开启外呼</el-button>
<el-button type="text" v-if="scopeChild.row.taskStatus == 4" @click.stop="download(scopeChild.row, 'executeTaskId')" size="small">下载本次数据</el-button>
</template>
</el-table-column>
</el-table>
</div>
<template slot="phoneCount" slot-scope="scope">
<div class="process-box">
<div class="process-bar">
<div class="process-bar-item" :style="{ width: calcNum(scope.scope) }"></div>
</div>
<div class="process-val">{{ calcNum(scope.scope) }}</div>
</div>
</template>
<template slot="excelName" slot-scope="scope">
<div>
{{ scope.scope.excelName }}
<span class="color58 font-14" style="cursor: pointer" @click="downloadFile(scope.scope.excelUrl, scope.scope.excelName)">下载</span>
</div>
</template>
<template slot="stopType" slot-scope="scope">
<div :class="['task_icon', scope.scope.stopType == '手动暂停' ? 'task_icon1' : 'task_icon2']">{{ scope.scope.stopType }}</div>
</template>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button type="text" v-if="currentIndex == 1 || (currentIndex == 3 && scope.scope.stopType == '自动暂停') || (currentIndex == 3 && scope.scope.stopType == null)" @click="handleOutboundOn(scope.scope)">开启外呼</el-button>
<el-button type="text" v-if="currentIndex == 3 && scope.scope.stopType && scope.scope.stopType == '手动暂停'" @click="handleStop(scope.scope, 2)">开启外呼</el-button>
<el-button type="text" v-if="currentIndex == 2 || currentIndex == 3 || currentIndex == 4" @click="handleDetails(scope.scope)">详情</el-button>
<el-button type="text" v-if="scope.scope.taskStatus == 2" @click="handleStop(scope.scope, 1)">暂停</el-button>
<div class="upload-btn" v-if="currentIndex == 4">
<el-button type="text" size="small">
导入
</el-button>
<input type="file" style="opacity: 0" ref="file" accept="*" @change="importExcel($event, scope.scope)" />
</div>
<el-button type="text" v-if="currentIndex == 4" @click="download(scope.scope, 'taskId')">下载</el-button>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
</div>
<!-- 外呼设置 -->
<GLDialog :mode="mode" class="outboungSet-dialog" title="外呼设置" @onOk="handleOutboundConfirm" @onCancel="handleOutboundClose" :visible.sync="outboundVisible">
<el-form ref="outboundsetRef" :model="outboundForm" label-width="154px" :rules="outboundRule">
<el-form-item label="每天外呼数量:" prop="outboundNum">
<el-input v-model="outboundForm.outboundNum" @keyup.native="outboundForm.outboundNum = oninput(outboundForm.outboundNum)"></el-input>
</el-form-item>
</el-form>
<p class="marked">默认所有外呼任务按此规则进行外呼</p>
</GLDialog>
<!-- 开启外呼确认 -->
<GLDialog :mode="mode" title="开启外呼确认" :visible.sync="openVisible" @onCancel="handleOpenOutboundClose" @onOk="handleOpenOutboundConfirm">
<tip-panel panelMinHeight="45px" :panelContent="panelContent" v-if="isPanel" @closePanel="closePanel"></tip-panel>
<glsx-combi-form formRef="outboundChildRef" ref="outboundFormRef" labelWidth="154px" :formObj="outboundForm" :formData="outboundFormData" :formRules="outboundRule">
<template slot="replay">
<div class="flex m-b-10">
<label class="font-14 color6 m-r-4">重播次数</label>
<el-input-number size="mini" v-model="outboundForm.retryTimes" :min="0" :max="2" label="描述文字"></el-input-number>
</div>
<div class="flex">
<label class="font-14 color6 m-r-4">重播间隔</label>
<el-input-number size="mini" v-model="outboundForm.retryInterval" :min="5" :max="60" label="描述文字"></el-input-number>
</div>
</template>
</glsx-combi-form>
</GLDialog>
</div>
</template>
<script>
const timeRules = (rule, value, callback) => {
if (value) {
const date = new Date()
let endYear = date.getFullYear() //获取年份
let endMonth = date.getMonth() + 1 // 获取月份
let endDay = date.getDate()
const startTime = endYear + '-' + endMonth + '-' + endDay + ' ' + value[0]
const endTime = endYear + '-' + endMonth + '-' + endDay + ' ' + value[1]
const start = endYear + '-' + endMonth + '-' + endDay + ' ' + '9:00'
const end = endYear + '-' + endMonth + '-' + endDay + ' ' + '20:00'
let result = new Date(startTime) >= new Date(start) && new Date(endTime) <= new Date(end)
if (!result) {
callback(new Error('外呼时间只限于09:00-20:00'))
} else {
callback()
}
} else if (!value) {
callback(new Error('请选择时间'))
}
}
import url from '@/assets/empty.png'
export default {
name: 'outbound',
data() {
return {
panelContent: '请在外呼拨打时间内及时登录企微及启动加好友程序,确保外呼完可及时发送好友申请,提高加微率',
size: 'small',
mode: 'mid',
url: url,
currentIndex: 1,
activeName: 'notExecute',
isPanel: true,
outboundVisible: false,
openVisible: false,
taskData: {},
outboundForm: {
outboundNum: 60,
taskId: '',
taskName: '',
callerNums: [],
robotId: '',
dialDate: ['9:00', '20:00'],
retryTimes: 1,
retryInterval: 10,
filtration: 1
},
outboundFormData: [
{
label: '任务名称',
name: 'taskName',
type: 'input',
maxlength: 15,
width: '360px',
isDisabled: 'true'
},
{
label: '外呼主机号码',
name: 'callerNums',
type: 'select',
width: '360px',
multiple: true,
optionList: [],
optionId: '',
optionLabel: '',
optionsName: 'callerList'
},
{
label: '选择话术机器人',
name: 'robotId',
type: 'select',
width: '360px',
optionList: [],
optionId: 'robotId',
optionLabel: 'robotName',
optionsName: 'robotList'
},
{
label: '外呼时间',
name: 'dialDate',
type: 'selectTimePicker',
format: 'HH:mm',
width: '360px'
},
{
label: '重播设置',
addHtml: 'replay',
name: 'replay'
},
{
label: '号码过滤',
type: 'radio',
name: 'filtration',
optionList: [
{
text: '不过滤',
id: 1
},
{
text: '过滤',
id: 2,
isDisabled: true
}
],
optionId: 'id',
optionLabel: 'text',
optionsName: 'productTypeList'
}
],
outboundRule: {
outboundNum: [{ required: true, message: '请输入外呼数量', trigger: 'blur' }],
callerNums: [{ required: true, message: '请选择外呼主机号码', trigger: 'change' }],
robotId: [{ required: true, message: '请选择话术机器人', trigger: 'change' }],
dialDate: [{ required: true, validator: timeRules, trigger: 'change' }]
},
tabList: [
{
label: '待执行',
name: 'notExecute'
},
{
label: '执行中',
name: 'executing'
},
{
label: '已暂停',
name: 'stop'
},
{
label: '已完成',
name: 'executed'
}
],
taskStatus: {},
searchForm: {},
tableSearchForm: {
merchantName: '',
taskName: '',
createDate: [],
taskStatus: 1
},
// 搜索
searchFormData: [
{
label: '门店名称',
name: 'merchantName',
type: 'input'
},
{
label: '商户号',
name: 'merchantIds',
type: 'input'
},
{
label: '任务名称',
name: 'taskName',
type: 'input'
},
{
label: '提交时间',
name: 'createDate',
type: 'datePicker',
isClear: true
}
],
// 表格
getListApi: this.$apis.outbound.getTaskList,
tableParams: {
listName: 'data',
rowClassName: 'row-expand-cover',
tableColumns: []
},
tableColumns: [
{
label: '',
prop: '',
columnattrs: {
type: 'expand'
},
addHtml: 'outboundInfo'
},
{
label: '商户号',
prop: 'merchantId',
width: 160
},
{
label: '门店名称',
prop: 'merchantName',
width: 160,
line: 1
},
{
label: '任务名称',
prop: 'taskName',
width: 150,
line: 1
},
{
label: '执行总数',
prop: 'phoneCount',
filter: 'executing,notExecute,stop,executed',
line: 1,
width: 120
},
{
label: '进度',
addHtml: 'phoneCount',
filter: 'executing,stop',
width: 200
},
{
label: '已执行',
addHtml: 'phoneCount',
filter: 'executed',
width: 200
},
{
label: '已发送好友申请',
prop: 'sendApplyCount',
filter: 'executed',
width: 170
},
{
label: '手机号文件',
addHtml: 'excelName',
filter: 'notExecute'
},
{
label: '通过申请',
prop: 'passCount',
filter: 'executing,stop,executed',
width: 100
},
{
label: '不存在的手机号用户',
prop: 'unExistCount',
filter: 'executed',
width: 160
},
{
label: '当前执行次数',
prop: 'executeTimes',
filter: 'executing,stop,executed',
width: 150
},
{
label: '最后一次暂停时间',
prop: 'lastStopTime',
filter: 'stop',
width: 170
},
{
label: '暂停方式',
addHtml: 'stopType',
filter: 'stop',
width: 120
},
{
label: '结束时间',
prop: 'taskEndTime',
width: 170,
filter: 'executed'
},
{
label: '提交时间',
prop: 'submitTime',
width: 180
},
{
label: '操作',
addHtml: 'auth-button',
width: 180
}
],
outboundInfoParams: [
{
label: '子任务名称',
prop: 'executeTaskName'
},
{
label: '执行数量',
prop: 'phoneCounts'
},
{
label: '通过申请',
prop: 'passCounts'
},
{
label: '开始时间',
prop: 'executeTaskStartTime'
},
{
label: '结束时间',
prop: '',
addHtml: 'executeTaskEndTime'
}
],
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
baseData: {
robotList: [],
callerList: []
}
}
},
created() {
this.getRobotList() //获取机器人列表
this.getCallerList() // 获取呼叫电话列表
this.initParams()
this.getStatusStatistics()
this.getOutBoundNum()
},
methods: {
timeCompare() {
let startDate = new Date(this.outboundForm.dialDate[0]).getTime()
let endDate = new Date(this.outboundForm.dialDate[1]).getTime()
// if (startGetTime != 0 && endGetTime != 0 && startGetTime > endGetTime) {
// return true
// }
},
calcNum(val) {
let count = '0%'
if (val.phoneCount) {
count = (100 * val.executedCount) / val.phoneCount
count = (count > 100 ? 100 : Number.isInteger(count) ? count : count.toFixed(2)) + '%'
}
return count
},
downloadFile(url, fileName) {
this.getBlob(url).then(blob => {
this.saveAs(blob, fileName + '.xlsx')
})
},
getBlob(url) {
return new Promise(resolve => {
const xhr = new XMLHttpRequest()
xhr.open('GET', url, true)
xhr.responseType = 'blob'
xhr.onload = () => {
if (xhr.status === 200) {
resolve(xhr.response)
}
}
xhr.send()
})
},
saveAs(blob, filename) {
if (window.navigator.msSaveOrOpenBlob) {
navigator.msSaveBlob(blob, filename)
} else {
const link = document.createElement('a')
const body = document.querySelector('body')
let binaryData = []
binaryData.push(blob)
link.href = window.URL.createObjectURL(new Blob(binaryData))
link.download = filename
// fix Firefox
link.style.display = 'none'
body.appendChild(link)
link.click()
body.removeChild(link)
window.URL.revokeObjectURL(link.href)
}
},
//导入
importExcel(e, row) {
const file = e.srcElement.files[0]
let AllImgExt = '.xls|.xlsx'
let extName = file.name.substring(file.name.lastIndexOf('.')).toLowerCase()
if (AllImgExt.indexOf(extName) === -1) {
this.$message.error('上传格式不正确')
return false
}
const size = file.size / 1024 / 1024
this.downloadStatus = true
this.setInter = setInterval(this.addProcess, 100)
const reader = new FileReader()
reader.readAsDataURL(file)
reader.onload = event => {
const imgFile = event.target.result
const arrBase64 = imgFile.split(',')
const splitStr = file.name.split('.')
const fileUrl = splitStr[splitStr.length - 1] + '@' + arrBase64[1]
this.$apis.common.pictureUpload({ file: fileUrl }).then(res => {
if (res) {
this.fileName = file.name
this.url = res
this.importTask(row, res)
}
// this.$refs.file.value = ''
})
}
},
importTask(row, url) {
let params = { taskId: row.id, url }
this.$apis.outbound.updatePhoneStatus(params).then(res => {
this.$message({
message: res.code == '0' ? '导入成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
this.handleSearch()
})
},
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} else {
this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
}
},
oninput(value) {
let limitNum = value
if (!/^[0-9]+$/.test(value)) limitNum = value.replace(/\D/g, '')
if (limitNum >= 2000) limitNum = 2000
if (limitNum <= 0) limitNum = 1
return limitNum
},
// 统计:所有任务的执行状态
getStatusStatistics() {
let params = {
merchantName: this.tableSearchForm.merchantName,
taskName: this.tableSearchForm.taskName,
merchantIds: this.tableSearchForm.merchantIds,
createDate: []
}
if (this.tableSearchForm.createDate.length) {
params.startTime = new Date(this.tableSearchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.endTime = new Date(this.tableSearchForm.createDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
this.$apis.outbound.getStatusStatistics(params).then(res => {
if (res.code == 0) {
this.taskStatus = res.data
}
})
},
//获取机器人列表
getRobotList() {
this.$apis.outbound.getRobotList({}).then(res => {
this.baseData.robotList = res
this.getOptionsList('outboundFormData', false, 'robotId')
})
},
// 获取呼叫电话列表
getCallerList() {
this.$apis.outbound.getCallerList({}).then(res => {
this.baseData.callerList = res
this.getOptionsList('outboundFormData', false, 'callerNums')
})
},
//外呼设置
handleOutboundClose() {
this.outboundVisible = false
},
handleOutboundConfirm() {
let params = {
outboundNum: this.outboundForm.outboundNum
}
this.$apis.outbound.setOutBoundNum(params).then(res => {
this.$message({
message: res.code == '0' ? '设置成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
this.outboundVisible = false
this.getOutBoundNum()
})
},
//初始化数据回显
initData() {
this.outboundForm.dialDate = ['9:00', '20:00']
this.outboundForm.taskId = this.taskData.id
this.outboundForm.taskName = this.taskData.merchantName + this.taskData.taskName
this.outboundForm.robotId = this.baseData.robotList && this.baseData.robotList[0].robotId
this.outboundForm.robotName = this.baseData.robotList && this.baseData.robotList[0].robotName
this.outboundForm.callerNums = this.baseData.callerList
},
// 获取外呼数量
getOutBoundNum() {
this.$apis.outbound.getOutBoundNum({}).then(res => {
this.outboundForm.outboundNum = res
})
},
//开启外呼
handleOutboundOn(data) {
this.taskData = data
this.openVisible = true
this.initData()
},
handleOpenOutboundClose() {
this.openVisible = false
this.initData()
},
handleOpenOutboundConfirm() {
this.$refs.outboundFormRef.$refs.outboundChildRef.validate(valid => {
if (valid) {
let params = {
taskId: this.outboundForm.taskId,
callerNums: this.outboundForm.callerNums,
robotId: this.outboundForm.robotId,
dialStartTime: this.outboundForm.dialDate[0].length < 5 ? '0' + this.outboundForm.dialDate[0] : this.outboundForm.dialDate[0],
dialEndTime: this.outboundForm.dialDate[1].length < 5 ? '0' + this.outboundForm.dialDate[1] : this.outboundForm.dialDate[1],
retryTimes: this.outboundForm.retryTimes,
retryInterval: this.outboundForm.retryInterval
}
this.baseData.robotList.forEach(item => (item.robotId == this.outboundForm.robotId ? (params.robotName = item.robotName) : ''))
this.$apis.outbound.createExecuteTask(params).then(res => {
this.$message({
message: res.code == '0' ? '任务开启成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == 0) {
this.openVisible = false
this.handleSearch()
}
})
}
})
},
//外呼详情
handleDetails(data) {
this.$router.push({
path: '/outbound/details',
query: {
id: data.id
}
})
},
//暂停
handleStop(data, value) {
let message = value == 1 ? '任务暂停成功' : '任务开启成功'
let params = {
taskId: data.id
}
this.$apis.outbound.updateStatus(params).then(res => {
this.$message({
message: res.code == '0' ? message : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == 0) {
this.handleSearch()
}
})
},
// 下载导入
download(data, parameter) {
let params = {
[parameter]: data.id
}
this.$apis.outbound.downloadPhoneList(params).then(res => {
if (res.code != 0) {
this.$message({
message: res.message,
type: 'error'
})
}
if (res.code == 0) {
window.open(res.data)
}
})
},
initParams() {
this.tableParams.tableColumns = []
this.tableParams.tableColumns = this.tableColumns.filter(item => {
return !item.filter || item.filter.indexOf(this.activeName) != -1
})
if (this.currentIndex != 1) {
this.tableParams.rowClassName = ''
} else {
this.tableParams.rowClassName = 'row-expand-cover'
}
},
getParams() {
var params = JSON.parse(JSON.stringify(this.tableSearchForm))
if (this.tableSearchForm.createDate.length) {
params.startTime = new Date(this.tableSearchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.endTime = new Date(this.tableSearchForm.createDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
params.taskStatus = this.currentIndex
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.searchForm = this.getParams()
delete this.searchForm.createDate
resolve()
})
},
tabClick(index) {
this.currentIndex = index
this.activeName = this.tabList[index - 1].name
this.initParams()
this.handleSearch()
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.outboundRef.data.length ? (this.$refs.outboundRef.tableHeightValues = '') : this.$refs.outboundRef.setTableHeightFun()
},
handleSearch() {
this.$refs.outboundRef.refreshTable()
this.getStatusStatistics()
},
handleReset() {
this.tableSearchForm = {
merchantName: '',
taskName: '',
createDate: []
}
this.searchForm = {
merchantName: '',
taskName: '',
startTime: '',
endTime: ''
}
this.handleSearch()
},
closePanel() {
this.isPanel = false
}
}
}
</script>
<style lang="scss" scoped>
.process-box {
display: flex;
align-items: center;
.process-bar {
margin-right: 6px;
}
.process-val {
width: 70px;
white-space: nowrap;
}
}
.process-bar {
width: 100%;
height: 6px;
background: #e7e7e7;
position: relative;
border-radius: 6px;
.process-bar-item {
position: absolute;
top: 0px;
border-radius: 6px;
left: 0px;
height: 6px;
background: #5850ff;
}
}
.upload-btn {
position: relative;
display: inline-block;
input {
cursor: pointer;
position: absolute;
height: 100%;
width: 100%;
top: 0px;
left: 0px;
font-size: 0px;
}
}
.outbound {
.container {
.outbound-head-btn {
display: flex;
justify-content: space-between;
position: relative;
z-index: 100;
margin-bottom: -1px;
.choseRow {
display: flex;
height: auto;
.choseItem {
display: inline-block;
cursor: pointer;
line-height: 40px;
height: 40px;
background: #fafafa;
border-radius: 4px 4px 0px 0px;
border: 1px solid #e5e5e5;
margin-right: 1px;
padding: 0 20px;
box-sizing: border-box;
}
.active {
color: #5850ff;
background: #ffffff;
border-bottom: 1px solid #fff;
font-weight: 600;
}
}
.outbound-set-btn {
width: 88px;
height: 32px;
font-size: 14px;
}
}
.outbound-tabe-wrap {
position: relative;
width: 100%;
height: auto;
padding: 20px;
border-radius: 0px 4px 4px 4px;
border: 1px solid #e5e5e5;
box-sizing: border-box;
z-index: 99;
.table-tr {
width: 100%;
display: flex;
border-top: 1px solid #e8e8ea;
&:first-child {
background: #f4f6fc;
color: #333333;
font-weight: 700;
}
div {
height: 40px;
line-height: 40px;
padding-left: 10px;
width: 16.6%;
}
}
}
}
.marked {
margin-left: 154px;
margin-top: -14px;
font-size: 12px;
font-weight: 400;
color: #999999;
line-height: 17px;
}
.outboungSet-dialog {
/deep/ {
.el-form-item__error {
top: 64px;
}
}
}
.task_icon {
position: relative;
&::after {
content: '';
position: absolute;
top: 4px;
left: -10px;
width: 6px;
height: 6px;
border-radius: 4px;
}
&.task_icon1 {
&::after {
background: #5850ff;
}
}
&.task_icon2 {
&::after {
background: #2cca74;
}
}
}
/deep/ .row-expand-cover .el-table__expand-icon {
visibility: hidden;
}
}
.subtasks-wrap {
margin: 16px;
box-sizing: border-box;
width: 98% !important;
}
</style>
<!-- 专区管理 -->
<template>
<div class="marketing p-t-20">
<div class="m-b-20">
<el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit(1)">新建</el-button>
</div>
<div class="container">
<el-form :inline="true">
<el-form-item label="专区名称">
<el-input style="width: 215px;" :size="size" v-model="searchForm.zoneName"></el-input>
</el-form-item>
<el-form-item class="search-btns">
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" type="default" @click="handleReset">查询</el-button>
</el-form-item>
</el-form>
<!-- 表格区域 开始 -->
<GLTable
ref="zoneRef"
:getListApi="getListApi"
:noDataImg="url"
:searchForm="tableSearchForm"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun"
>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleEdit(2, scope.scope)">编辑</el-button>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
export default {
name: 'zoneList',
data() {
return {
size: 'small',
url: url,
searchForm: {
zoneName: '',
createDate: []
},
tableSearchForm: {},
// 搜索
searchFormData: [
{
label: '专区名称',
name: 'zoneName',
type: 'input',
maxlength: 20
},
{
label: '创建日期',
name: 'createDate',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
}
],
// 表格
getListApi: this.$apis.zoneList.getZoneListApi,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '专区名称',
prop: 'zoneName'
},
{
label: '创建日期',
prop: 'createdDate',
width: '180',
formatter: cellValue => {
return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss')
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' }
}
},
mounted() {},
methods: {
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
params.zoneType = '2' //专区类型(1发现频道,2商城专区)
if (this.searchForm.createDate.length) {
params.startTime = new Date(this.searchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.endTime = new Date(this.searchForm.createDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
delete params.createDate
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
delete this.tableSearchForm.createDate
resolve()
})
},
// 1-新增;2-编辑
handleEdit(addOrEdit, row) {
this.$message({
type: 'success',
message: addOrEdit == '1' ? '新增' : '编辑'
})
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.zoneRef.data.length ? (this.$refs.zoneRef.tableHeightValues = '') : this.$refs.zoneRef.setTableHeightFun()
},
handleSearch() {
this.$refs.zoneRef.refreshTable()
},
handleReset() {
this.searchForm = {
zoneName: ''
}
this.handleSearch()
}
}
}
</script>
<style scoped>
.marketing .search-btns {
float: right;
margin-right: 0;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!