Commit 286a8a18 by 前端

Merge branch 'huy_dev_v2.10.0' into 'v2.10.0'

Huy dev v2.10.0

See merge request !347
2 parents fff8ac10 031f8236
......@@ -137,7 +137,7 @@ const staffList = params => {
}
// 客户群发客户列表
const customerDetailList = params => {
params.method = `${path}customer.list`
params.method = `${path}customer.list.page`
return http({
url: URL,
method: 'GET',
......
......@@ -28,7 +28,7 @@
<el-form-item v-for="(item, index) in formList" :key="index" :label="item.label || ''">
<template>
<template v-if="item.type === 'input'">
<el-input v-model="formModel[item.prop]" :type="item.inputType || 'text'" :placeholder="item.placeholder || '请输入'" :clearable="item.clearable || false" :readonly="item.readonly || false" @keyup.enter.native="onInput" ></el-input>
<el-input v-model="formModel[item.prop]" :type="item.inputType || 'text'" :placeholder="item.placeholder || '请输入'" :clearable="item.clearable || false" :readonly="item.readonly || false" @keyup.enter.native="onInput"></el-input>
</template>
<template v-else-if="item.type === 'select'">
<el-select size="small" v-model="formModel[item.prop]" :placeholder="item.placeholder || '请选择'" :filterable="!item.noFilter">
......@@ -83,7 +83,7 @@ export default {
type: Boolean,
default: false
},
isThreeRowShow:{
isThreeRowShow: {
type: Boolean,
default: false
},
......@@ -99,7 +99,7 @@ export default {
type: Boolean,
default: false
},
isNeedThreeBtns:{
isNeedThreeBtns: {
type: Boolean,
default: true
}
......@@ -118,34 +118,31 @@ export default {
//调用默认时间(30天)
this.getPassMonthFormatDate()
}
this.$nextTick(()=>{
var sf = document.getElementById('searchForm')
if (sf.clientWidth < 1280 && this.isHasSyncBtn) {
document.querySelector('.itemWidth').style.maxWidth = 700 + 'px'
}
if (sf.clientWidth < 952 && this.isHasSyncBtn) {
this.isShowBtns = false
}
this.$nextTick(() => {
var sf = document.getElementById('searchForm')
let lineHeight = 75 //75
if (document.getElementById('searchForm').offsetHeight > lineHeight * 2) {
this.expande = false
this.needShowExpande = true
} else {
this.needShowExpande = false
this.expande = true
}
if (sf.clientWidth < 1280 && this.isHasSyncBtn) {
document.querySelector('.itemWidth').style.maxWidth = 700 + 'px'
}
if (sf.clientWidth < 952 && this.isHasSyncBtn) {
this.isShowBtns = false
}
if( sf.clientWidth< 840 && this.isThreeRowShow){
document.querySelector('.itemWidth').style.minHeight= document.querySelector('.itemWidth').offsetHeight + 50 + 'px'
// 客户群里面四个表做特殊处理,当为苹果笔记本电脑尺寸时,不是现实展开收起按钮
this.needShowExpande = false
this.expande = true
}
let lineHeight = 75 //75
if (document.getElementById('searchForm').offsetHeight > lineHeight * 2) {
this.expande = false
this.needShowExpande = true
} else {
this.needShowExpande = false
this.expande = true
}
if (sf.clientWidth < 840 && this.isThreeRowShow) {
document.querySelector('.itemWidth').style.minHeight = document.querySelector('.itemWidth').offsetHeight + 50 + 'px'
// 客户群里面四个表做特殊处理,当为苹果笔记本电脑尺寸时,不是现实展开收起按钮
this.needShowExpande = false
this.expande = true
}
})
//有数据不算表格高度,没数据算高度
......@@ -160,7 +157,7 @@ export default {
// $(window).bind('resize', function() {
// if (resizeTimer) clearTimeout(resizeTimer)
// resizeTimer = setTimeout(function() {
//
//
// }, 100)
// })
// window.onresize = () => {
......@@ -215,8 +212,8 @@ export default {
syncClick() {
this.$emit('syncClick')
},
handleExport(){
this.$emit('handleExport')
handleExport() {
this.$emit('handleExport')
},
expandeClick() {
......@@ -264,7 +261,7 @@ this.$emit('handleExport')
}
}
</script>
<style lang="scss">
<style lang="scss" scoped>
@import '@/styles/variables.scss';
.search-form {
padding: 18px 0 0 0;
......@@ -324,7 +321,7 @@ this.$emit('handleExport')
.el-select {
width: 215px;
}
.el-select>.el-input{
.el-select > .el-input {
width: 215px;
}
.el-form-item__content {
......
......@@ -48,14 +48,14 @@
<div class="detail-modular">
<div class="title">客户详情</div>
<div class="detail-info">
<el-menu :default-active="customIndex" class="el-menu-demo" mode="horizontal" @select="handleCustomSelect">
<el-menu :default-active="customIndex" class="el-menu-demo" mode="horizontal" @select="handleCustomSelect" infinite-scroll-distance="10">
<el-menu-item index>全部</el-menu-item>
<el-menu-item index="1">已送达客户</el-menu-item>
<el-menu-item index="0">未送达客户</el-menu-item>
<el-menu-item index="2">客户送达失败</el-menu-item>
</el-menu>
<div class="detail-total">共 {{ customerlist.length || 0 }} 人</div>
<div v-if="customerlist.length != 0" class="info-list">
<div class="detail-total">共 {{ customerCount || 0 }} 人</div>
<div v-if="customerCount != 0" class="info-list" v-infinite-scroll="customerDetailLoad" immediate-check="false">
<div class="info-item" v-for="item in customerlist" :key="item.id">
<img class="info-avatar" :src="item.avatar ? item.avatar : require('@/assets/guestCustom/default-avatar.png')" alt />
<div class="info-content info-custom">
......@@ -108,7 +108,14 @@ export default {
eventBus: new Vue(),
isDisabled: false,
footerLeft: 0,
footerWidth: 0
footerWidth: 0,
// 客户详情分页
customerPage: {
pageSize: 10,
pageNum: 1
},
// 客户详情总数
customerCount: 0
}
},
mounted() {
......@@ -126,8 +133,19 @@ export default {
this.activeIndex = val
this.getStaffList(val)
},
// 客户详情选择切换
handleCustomSelect(val) {
this.customIndex = val
this.customerlist = []
// 获取滑动高度清0,防止tab切换时记录滚动条位置问题
var scrolltopList = document.querySelectorAll('.info-list')
if (scrolltopList) {
scrolltopList[1] ? (scrolltopList[1].scrollTop = 0) : ''
}
this.customerPage = {
pageSize: 10,
pageNum: 1
}
this.getCustomerList(val)
},
remind(data, index) {
......@@ -163,10 +181,28 @@ export default {
this.employeelist = res ? res : []
})
},
// 客户详情下拉加载
customerDetailLoad() {
// 详情列表有数据时才触发
if (this.customerlist.length > 0) {
this.customerPage.pageNum++
// 详情数组数量小于总数才触发,带上切换的tab值
if (this.customerlist.length < this.customerCount) this.getCustomerList(this.customIndex)
}
},
// 获取客户详情列表
getCustomerList(status = null) {
const id = this.$route.params.id
this.$apis.customerTransform.customerDetailList({ id, status }).then(res => {
this.customerlist = res ? res : []
var params = JSON.parse(JSON.stringify(this.customerPage))
params.status = status
params.id = id
this.$apis.customerTransform.customerDetailList(params).then(res => {
this.customerCount = res.count
if (!res.data.length) {
this.customerlist = []
return
}
this.customerlist.push(...res.data)
})
},
remindUserGroup() {
......@@ -276,7 +312,7 @@ export default {
margin-top: 0;
margin-left: 10px;
&.send {
width: 70px;
width: 80px;
}
span {
vertical-align: middle;
......
......@@ -147,17 +147,15 @@ export default {
}
},
mounted() {
this.eventBus.$emit('update', this.previewList)
// this.updateList(this.previewList)
// obj.init('video')
},
methods: {
handleImgChange(e, targetItem) {
var reader = new FileReader()
var file = e.srcElement.files[0]
// 默认1MB
const limitSize = targetItem.limitSize || 1
const isLt = file.size / 1024 / 1024 < limitSize
......@@ -170,12 +168,10 @@ export default {
var image = new Image()
image.src = e.target.result
image.onload = () => {
const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
this.previewList.push({
attType: ATT_TYPE.IMAGE,
attContent: res
......@@ -198,10 +194,9 @@ export default {
reader.readAsDataURL(file)
reader.onload = e => {
const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
this.previewList.push({
attType: ATT_TYPE.VEDIO,
attContent: res
......@@ -213,7 +208,7 @@ export default {
handleImg(e) {
var reader = new FileReader()
var file = e.srcElement.files[0]
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
......@@ -227,11 +222,10 @@ export default {
image.src = e.target.result
image.onload = () => {
const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.$set(this.appletForm, 'picUrl', 'dfasdfasfa')
this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
this.$set(this.appletForm, 'picUrl', res)
}
})
......@@ -239,7 +233,6 @@ export default {
}
},
switchDailog(funName) {
if (funName == 'link') {
this.dialogTitle = '添加网页消息'
} else if (funName == 'applet') {
......@@ -253,7 +246,6 @@ export default {
case '添加网页消息':
this.$refs.linkForm.validate(valid => {
if (valid) {
this.previewList.push({
attType: ATT_TYPE.URL,
attContent: this.linkForm
......@@ -264,16 +256,13 @@ export default {
// this.linkForm = {}
// this.$refs.linkForm.clearValidate()
} else {
return false
}
})
break
case '添加小程序':
this.$refs.appletForm.validate(valid => {
if (valid) {
this.previewList.push({
attType: ATT_TYPE.MINIPROGRAM,
attContent: this.appletForm
......@@ -283,25 +272,21 @@ export default {
// this.appletForm = {}
// this.$refs.appletForm.clearValidate()
} else {
return false
}
})
break
default:
}
},
close(index) {
// this.previewList
this.previewList.splice(index, 1)
this.eventBus.$emit('update', this.previewList)
},
textInput(val) {
const hasText = this.previewList.some(item => item.attType == 1)
if (hasText) {
this.$set(this.previewList, 0, {
attContent: val,
......@@ -313,7 +298,6 @@ export default {
attType: ATT_TYPE.TEXT
})
}
},
closeDialog() {
if (this.dialogVisible) {
......@@ -342,7 +326,7 @@ export default {
<style lang="scss" scoped>
.welcome-box {
display: inline-block !important;
display: inline-block !important;
// padding-top: 20px;
// margin-left: 87px;
}
......
......@@ -407,7 +407,7 @@ export default {
.border {
padding: 20px;
background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
// box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
}
.orange {
......
......@@ -420,7 +420,8 @@ export default {
reader.readAsDataURL(file)
reader.onload = e => {
const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
// const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
const base64 = file.name.slice(-3) + '@' + imgFile.split(',')[1]
this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
this.pdfUrl = res
......@@ -448,7 +449,7 @@ export default {
reader.readAsDataURL(file)
reader.onload = e => {
const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
// console.log(res)
......
......@@ -43,7 +43,7 @@ export default {
this.$emit('focus')
}
// 上传图片
this.editor.config.customUploadImg = function (resultFiles, insertImgFn) {
this.editor.config.customUploadImg = function(resultFiles, insertImgFn) {
var file = resultFiles[0]
var reader = new FileReader()
// 默认1MB
......@@ -56,7 +56,7 @@ export default {
reader.readAsDataURL(file)
reader.onload = e => {
const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
_this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
// console.log(res)
......@@ -69,7 +69,7 @@ export default {
}
}
// 上传视频
this.editor.config.customUploadVideo = function (resultFiles, insertVideoFn) {
this.editor.config.customUploadVideo = function(resultFiles, insertVideoFn) {
var file = resultFiles[0]
var reader = new FileReader()
// 默认1MB
......@@ -82,7 +82,7 @@ export default {
reader.readAsDataURL(file)
reader.onload = e => {
const videoFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + videoFile.split(',')[1]
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + videoFile.split(',')[1]
_this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
// console.log(res)
......
......@@ -13,7 +13,7 @@
</span>
<div class="container">
<div class="search-form">
<GLCombiForm ref="showSearch" :rowNumber="2" :formObj="searchForm" :formData="materialFormData" @handleOk="getListApi" @handleRest="handleReset"></GLCombiForm>
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="materialFormData" @handleOk="getListApi" @handleRest="handleReset"></GLCombiForm>
</div>
<div class="tabelList">
<el-row>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!