Commit 3bfcc0e9 by 姜鹏凯

列表表头表单搜索统一

1 parent a551b0ff
Showing 27 changed files with 1347 additions and 1275 deletions
<template> <template>
<div> <div>
<el-form-item label="详细地址" prop="address"> <el-form-item label="详细地址" prop="address">
<el-autocomplete :disabled="isDetail" @change="setChange" v-model="form.address" style="width:500px;" popper-class="autoAddressClass" :fetch-suggestions="querySearchAsync" :trigger-on-focus="false" placeholder="详细地址" clearable @select="handleSelect"> <el-autocomplete
:disabled="isDetail"
@change="setChange"
v-model="form.address"
style="width: 500px;"
popper-class="autoAddressClass"
:fetch-suggestions="querySearchAsync"
:trigger-on-focus="false"
placeholder="详细地址"
clearable
@select="handleSelect"
>
<template slot-scope="{ item }"> <template slot-scope="{ item }">
<i class="el-icon-search fl mgr10" /> <i class="el-icon-search fl mgr10" />
<div style="overflow:hidden;"> <div style="overflow: hidden;">
<div class="title">{{ item.title }}</div> <div class="title">{{ item.title }}</div>
<span class="address ellipsis">{{ item.address }}</span> <span class="address ellipsis">{{ item.address }}</span>
</div> </div>
...@@ -12,7 +23,7 @@ ...@@ -12,7 +23,7 @@
</el-autocomplete> </el-autocomplete>
</el-form-item> </el-form-item>
<el-form-item label=""> <el-form-item label="">
<div id="map-container" style="width:500px;height:300px;" /> <div id="map-container" style="width: 500px; height: 300px;" />
</el-form-item> </el-form-item>
</div> </div>
</template> </template>
...@@ -21,14 +32,15 @@ ...@@ -21,14 +32,15 @@
/* eslint-disable */ /* eslint-disable */
import loadBMap from '@/utils/baiduMap.js' import loadBMap from '@/utils/baiduMap.js'
export default { export default {
data () { data() {
return { return {
form: { form: {
province: '', province: '',
city: '', city: '',
area: '', area: '',
address: '', // 详细地址 address: '', // 详细地址
addrPoint: { // 详细地址经纬度 addrPoint: {
// 详细地址经纬度
lng: 0, lng: 0,
lat: 0 lat: 0
} }
...@@ -41,7 +53,7 @@ ...@@ -41,7 +53,7 @@
props: { props: {
initData: { initData: {
type: Object, type: Object,
default: () => { } default: () => {}
}, },
isDetail: { isDetail: {
type: Boolean, type: Boolean,
...@@ -50,34 +62,107 @@ ...@@ -50,34 +62,107 @@
}, },
watch: { watch: {
initData: { initData: {
handler (value) { handler(value) {
if (this.initData.address) { if (this.initData.address) {
this.form.address = this.initData.address this.form.address = this.initData.address
this.form.addrPoint.lng = this.initData.longitude if (this.initData.longitude && this.initData.latitude) {
this.form.addrPoint.lat = this.initData.latitude this.form.addrPoint.lng = this.initData.longitude
this.form.addrPoint.lat = this.initData.latitude
} else {
let detailAddress = this.initData.area + this.initData.address
this.getPoint(detailAddress)
}
this.initMap() this.initMap()
} }
}, },
immediate: true, immediate: true
} }
}, },
async mounted () { async mounted() {
// 百度地图AK: GeDsF2XGs01U0bUSpFIUCmvyNoYuGC3P // 百度地图AK: GeDsF2XGs01U0bUSpFIUCmvyNoYuGC3P
await loadBMap('GeDsF2XGs01U0bUSpFIUCmvyNoYuGC3P') // 加载引入BMap await loadBMap('GeDsF2XGs01U0bUSpFIUCmvyNoYuGC3P') // 加载引入BMap
if (this.initData.address) { if (this.initData.address) {
this.form.address = this.initData.address this.form.address = this.initData.address
this.form.addrPoint.lng = this.initData.longitude if (this.initData.longitude && this.initData.latitude) {
this.form.addrPoint.lat = this.initData.latitude this.form.addrPoint.lng = this.initData.longitude
this.form.addrPoint.lat = this.initData.latitude
} else {
let detailAddress = this.initData.area + this.initData.address
this.getPoint(detailAddress)
}
} }
this.initMap() this.initMap()
}, },
methods: { methods: {
getCity(str) {
if (str) {
let area = {}
let index11 = 0
let index1 = str.indexOf('省')
if (index1 == -1) {
index11 = str.indexOf('自治区')
if (index11 != -1) {
area.Province = str.substring(0, index11 + 3)
} else {
area.Province = str.substring(0, 0)
}
} else {
area.Province = str.substring(0, index1 + 1)
}
let index2 = str.indexOf('市')
if (index11 == -1) {
area.City = str.substring(index11 + 1, index2 + 1)
} else {
if (index11 == 0) {
area.City = str.substring(index1 + 1, index2 + 1)
} else {
area.City = str.substring(index11 + 3, index2 + 1)
}
}
let index3 = str.indexOf('区')
if (index3 == -1) {
index3 = str.indexOf('县')
if (index3 == -1) {
index3 = str.indexOf('旗')
area.Country = str.substring(index2 + 1, index3 + 1)
} else {
area.Country = str.substring(index2 + 1, index3 + 1)
}
} else {
area.Country = str.substring(index2 + 1, index3 + 1)
}
return area.City
} else {
return ''
}
},
getPoint(str) {
var that = this
var myGeo = new BMap.Geocoder()
myGeo.getPoint(
str,
function (point) {
if (point) {
that.form.addrPoint = point
that.$emit('point', point)
} else {
// alert('您选择的地址没有解析到结果!')
}
},
that.getCity(str)
)
},
// 初始化地图 // 初始化地图
initMap () { initMap() {
var that = this var that = this
// 1、挂载地图 // 1、挂载地图
this.map = new BMap.Map('map-container', { enableMapClick: false }) this.map = new BMap.Map('map-container', { enableMapClick: false })
var point = new BMap.Point(this.form.addrPoint.lng || 117.2334414073489, this.form.addrPoint.lat || 31.826578293886) var point = new BMap.Point(
this.form.addrPoint.lng || 117.2334414073489,
this.form.addrPoint.lat || 31.826578293886
)
this.map.centerAndZoom(point, 19) this.map.centerAndZoom(point, 19)
// 3、设置图像标注并绑定拖拽标注结束后事件 // 3、设置图像标注并绑定拖拽标注结束后事件
this.mk = new BMap.Marker(point, { enableDragging: true }) this.mk = new BMap.Marker(point, { enableDragging: true })
...@@ -86,7 +171,9 @@ ...@@ -86,7 +171,9 @@
that.getAddrByPoint(e.point) that.getAddrByPoint(e.point)
}) })
// 4、添加(右上角)平移缩放控件 // 4、添加(右上角)平移缩放控件
this.map.addControl(new BMap.NavigationControl({ anchor: BMAP_ANCHOR_TOP_RIGHT, type: BMAP_NAVIGATION_CONTROL_SMALL })) this.map.addControl(
new BMap.NavigationControl({ anchor: BMAP_ANCHOR_TOP_RIGHT, type: BMAP_NAVIGATION_CONTROL_SMALL })
)
// 5、添加(左下角)定位控件 // 5、添加(左下角)定位控件
var geolocationControl = new BMap.GeolocationControl({ anchor: BMAP_ANCHOR_BOTTOM_LEFT }) var geolocationControl = new BMap.GeolocationControl({ anchor: BMAP_ANCHOR_BOTTOM_LEFT })
geolocationControl.addEventListener('locationSuccess', function (e) { geolocationControl.addEventListener('locationSuccess', function (e) {
...@@ -104,32 +191,34 @@ ...@@ -104,32 +191,34 @@
}) })
}, },
// 获取两点间的距离 // 获取两点间的距离
getDistancs (pointA, pointB) { getDistancs(pointA, pointB) {
return this.map.getDistance(pointA, pointB).toFixed(2) return this.map.getDistance(pointA, pointB).toFixed(2)
}, },
// 浏览器定位函数 // 浏览器定位函数
geolocation () { geolocation() {
if (!this.isDetail) { if (!this.isDetail) {
var that = this var that = this
var geolocation = new BMap.Geolocation() var geolocation = new BMap.Geolocation()
geolocation.getCurrentPosition(function (res) { geolocation.getCurrentPosition(
if (this.getStatus() == BMAP_STATUS_SUCCESS) { function (res) {
that.getAddrByPoint(res.point) if (this.getStatus() == BMAP_STATUS_SUCCESS) {
that.locationPoint = res.point that.getAddrByPoint(res.point)
} else { that.locationPoint = res.point
alert('failed' + this.getStatus()) } else {
that.locationPoint = new BMap.Point(117.2334414073489, 31.826578293886) alert('failed' + this.getStatus())
} that.locationPoint = new BMap.Point(117.2334414073489, 31.826578293886)
}, { enableHighAccuracy: true }) }
},
{ enableHighAccuracy: true }
)
} }
}, },
// 2、逆地址解析函数 // 2、逆地址解析函数
getAddrByPoint (point) { getAddrByPoint(point) {
if (!this.isDetail) { if (!this.isDetail) {
var that = this var that = this
var geco = new BMap.Geocoder() var geco = new BMap.Geocoder()
geco.getLocation(point, function (res) { geco.getLocation(point, function (res) {
console.log(res)
that.mk.setPosition(point) that.mk.setPosition(point)
that.map.panTo(point) that.map.panTo(point)
that.form.address = that.splitName(res.address) that.form.address = that.splitName(res.address)
...@@ -139,7 +228,7 @@ ...@@ -139,7 +228,7 @@
} }
}, },
// 8-1、地址搜索 // 8-1、地址搜索
querySearchAsync (str, cb) { querySearchAsync(str, cb) {
var options = { var options = {
onSearchComplete: function (res) { onSearchComplete: function (res) {
var s = [] var s = []
...@@ -156,13 +245,13 @@ ...@@ -156,13 +245,13 @@
var local = new BMap.LocalSearch(this.map, options) var local = new BMap.LocalSearch(this.map, options)
local.search(str) local.search(str)
}, },
splitName (str) { splitName(str) {
if (str) { if (str) {
let area = {} let area = {}
let index11 = 0 let index11 = 0
let index1 = str.indexOf("省") let index1 = str.indexOf('省')
if (index1 == -1) { if (index1 == -1) {
index11 = str.indexOf("自治区") index11 = str.indexOf('自治区')
if (index11 != -1) { if (index11 != -1) {
area.Province = str.substring(0, index11 + 3) area.Province = str.substring(0, index11 + 3)
} else { } else {
...@@ -171,8 +260,8 @@ ...@@ -171,8 +260,8 @@
} else { } else {
area.Province = str.substring(0, index1 + 1) area.Province = str.substring(0, index1 + 1)
} }
let index2 = str.indexOf("市") let index2 = str.indexOf('市')
if (index11 == -1) { if (index11 == -1) {
area.City = str.substring(index11 + 1, index2 + 1) area.City = str.substring(index11 + 1, index2 + 1)
} else { } else {
...@@ -182,10 +271,10 @@ ...@@ -182,10 +271,10 @@
area.City = str.substring(index11 + 3, index2 + 1) area.City = str.substring(index11 + 3, index2 + 1)
} }
} }
let index3 = str.indexOf("区") let index3 = str.indexOf('区')
if (index3 == -1) { if (index3 == -1) {
index3 = str.indexOf("县") index3 = str.indexOf('县')
if (index3 == -1) { if (index3 == -1) {
index3 = str.indexOf('旗') index3 = str.indexOf('旗')
area.Country = str.substring(index2 + 1, index3 + 1) area.Country = str.substring(index2 + 1, index3 + 1)
...@@ -197,9 +286,9 @@ ...@@ -197,9 +286,9 @@
} }
let data = area.Province + area.City + area.Country let data = area.Province + area.City + area.Country
if (area.Province) { if (area.Province) {
this.form.province = area.Province this.form.province = area.Province
} }
if (area.city) { if (area.City) {
this.form.city = area.City this.form.city = area.City
} }
this.form.area = area.Country this.form.area = area.Country
...@@ -209,7 +298,7 @@ ...@@ -209,7 +298,7 @@
} }
}, },
// 8-2、选择地址 // 8-2、选择地址
handleSelect (item) { handleSelect(item) {
this.form.province = item.province this.form.province = item.province
this.form.city = item.city this.form.city = item.city
this.form.address = this.splitName(item.address) + item.title this.form.address = this.splitName(item.address) + item.title
...@@ -220,7 +309,7 @@ ...@@ -220,7 +309,7 @@
this.map.panTo(item.point) this.map.panTo(item.point)
this.onSubmit() this.onSubmit()
}, },
setChange (data) { setChange(data) {
if (!data) { if (!data) {
this.form = { this.form = {
address: '', address: '',
...@@ -232,7 +321,7 @@ ...@@ -232,7 +321,7 @@
this.onSubmit() this.onSubmit()
} }
}, },
onSubmit () { onSubmit() {
this.$emit('update', this.form) this.$emit('update', this.form)
} }
} }
...@@ -260,4 +349,4 @@ ...@@ -260,4 +349,4 @@
} }
} }
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
...@@ -84,10 +84,11 @@ ...@@ -84,10 +84,11 @@
<div class="app-container"> <div class="app-container">
<el-form ref="queryForm" :inline="true" :model="query" class="top-search" size="small"> <el-form ref="queryForm" :inline="true" :model="query" class="top-search" size="small">
<el-form-item label="裂变名" prop="taskName"> <el-form-item label="裂变名" prop="taskName">
<el-input v-model="query.taskName" placeholder="请输入"></el-input> <el-input clearable v-model="query.taskName" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="添加日期"> <el-form-item label="添加日期">
<el-date-picker <el-date-picker
clearable
v-model="dateRange" v-model="dateRange"
@change="setChange" @change="setChange"
type="daterange" type="daterange"
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
export default { export default {
name: 'Group', name: 'Group',
data () { data() {
return { return {
query: { query: {
pageNum: 1, pageNum: 1,
...@@ -11,15 +11,15 @@ ...@@ -11,15 +11,15 @@
taskName: '', taskName: '',
startTime: '', startTime: '',
overTime: '', overTime: '',
fissionType: 1, fissionType: 1
}, },
dateRange: [], dateRange: [],
tableData: [], tableData: [],
total: 0, total: 0,
loading: false, loading: false
} }
}, },
created () { created() {
this.getList() this.getList()
this.$store.dispatch( this.$store.dispatch(
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
) )
}, },
methods: { methods: {
setChange (e) { setChange(e) {
if (e) { if (e) {
this.query.startTime = e[0] this.query.startTime = e[0]
this.query.overTime = e[1] this.query.overTime = e[1]
...@@ -39,19 +39,19 @@ ...@@ -39,19 +39,19 @@
this.query.overTime = '' this.query.overTime = ''
} }
}, },
resetFn () { resetFn() {
this.query = { this.query = {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
taskName: '', taskName: '',
startTime: '', startTime: '',
overTime: '', overTime: '',
fissionType: 1, fissionType: 1
} }
this.dateRange = [] this.dateRange = []
this.getList() this.getList()
}, },
getList (data) { getList(data) {
this.loading = true this.loading = true
let params = Object.assign({}, this.query, data) let params = Object.assign({}, this.query, data)
api.getList(params).then(({ rows, total }) => { api.getList(params).then(({ rows, total }) => {
...@@ -60,23 +60,23 @@ ...@@ -60,23 +60,23 @@
this.loading = false this.loading = false
}) })
}, },
resetForm () { }, resetForm() {},
toDetail (row) { toDetail(row) {
this.$router.push({ this.$router.push({
path: `detail?id=${row.id}`, path: `detail?id=${row.id}`
}) })
}, },
newAdd () { newAdd() {
this.$router.push({ this.$router.push({
path: 'add', path: 'add'
}) })
}, },
toEdit (row) { toEdit(row) {
this.$router.push({ this.$router.push({
path: `add?id=${row.id}`, path: `add?id=${row.id}`
}) })
}, }
}, }
} }
</script> </script>
...@@ -84,16 +84,37 @@ ...@@ -84,16 +84,37 @@
<div class="app-container"> <div class="app-container">
<el-form ref="queryForm" :inline="true" :model="query" class="top-search" size="small"> <el-form ref="queryForm" :inline="true" :model="query" class="top-search" size="small">
<el-form-item label="任务名" prop="taskName"> <el-form-item label="任务名" prop="taskName">
<el-input v-model="query.taskName" placeholder="请输入"></el-input> <el-input clearable v-model="query.taskName" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="添加日期"> <el-form-item label="添加日期">
<el-date-picker v-model="dateRange" @change="setChange" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" align="right"></el-date-picker> <el-date-picker
clearable
v-model="dateRange"
@change="setChange"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
align="right"
></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label=" "> <el-form-item label=" ">
<el-button v-hasPermi="['customerManage:customer:query']" type="primary" :loading="loading" @click="getList({ pageNum: 1 })">查询</el-button> <el-button
v-hasPermi="['customerManage:customer:query']"
type="primary"
:loading="loading"
@click="getList({ pageNum: 1 })"
>查询</el-button
>
<el-button @click="resetFn" type="success">清空</el-button> <el-button @click="resetFn" type="success">清空</el-button>
<el-button v-hasPermi="['customerManage:customer:query']" type="primary" @click="newAdd()" style="background: #fa7216; color: #ffffff; border-color: #fa7216">新增任务</el-button> <el-button
v-hasPermi="['customerManage:customer:query']"
type="primary"
@click="newAdd()"
style="background: #fa7216; color: #ffffff; border-color: #fa7216;"
>新增任务</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table :data="tableData"> <el-table :data="tableData">
...@@ -103,7 +124,15 @@ ...@@ -103,7 +124,15 @@
<template slot-scope="scope"> <template slot-scope="scope">
<!-- -1-发送失败 0-待发送 1-进行中 2-已结束 --> <!-- -1-发送失败 0-待发送 1-进行中 2-已结束 -->
<p> <p>
{{ scope.row.fissStatus === 1 ? '进行中' : scope.row.fissStatus === -1 ? '发送失败' : scope.row.fissStatus === 0 ? '待发送' : '已结束' }} {{
scope.row.fissStatus === 1
? '进行中'
: scope.row.fissStatus === -1
? '发送失败'
: scope.row.fissStatus === 0
? '待发送'
: '已结束'
}}
</p> </p>
</template> </template>
</el-table-column> </el-table-column>
...@@ -114,7 +143,13 @@ ...@@ -114,7 +143,13 @@
</el-table-column> </el-table-column>
<el-table-column prop="operation" label="操作" width="120"> <el-table-column prop="operation" label="操作" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button @click="toDetail(scope.row)" v-hasPermi="['enterpriseWechat:view']" size="medium" type="text" icon="el-icon-view"></el-button> <el-button
@click="toDetail(scope.row)"
v-hasPermi="['enterpriseWechat:view']"
size="medium"
type="text"
icon="el-icon-view"
></el-button>
<!-- <el-button <!-- <el-button
v-if="scope.row.fissStatus != 2" v-if="scope.row.fissStatus != 2"
@click="toEdit(scope.row)" @click="toEdit(scope.row)"
...@@ -127,7 +162,13 @@ ...@@ -127,7 +162,13 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination v-show="total > 0" :total="total" :page.sync="query.pageNum" :limit.sync="query.pageSize" @pagination="getList()" /> <pagination
v-show="total > 0"
:total="total"
:page.sync="query.pageNum"
:limit.sync="query.pageSize"
@pagination="getList()"
/>
</div> </div>
</template> </template>
......
...@@ -154,7 +154,7 @@ ...@@ -154,7 +154,7 @@
<div class="g-card g-pad20"> <div class="g-card g-pad20">
<el-form ref="queryForm" :inline="true" :model="query" label-width="110px" class="top-search"> <el-form ref="queryForm" :inline="true" :model="query" label-width="110px" class="top-search">
<el-form-item label="商品名称或描述" prop="name"> <el-form-item label="商品名称或描述" prop="name">
<el-input v-model="query.name" placeholder="请输入"></el-input> <el-input clearable v-model="query.name" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<el-form-item label=" "> <el-form-item label=" ">
<el-button type="primary" @click="getList(1)">查询</el-button> <el-button type="primary" @click="getList(1)">查询</el-button>
......
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
<div class="g-card g-pad20"> <div class="g-card g-pad20">
<el-form :inline="true" label-width="110px" class="top-search"> <el-form :inline="true" label-width="110px" class="top-search">
<el-form-item label="商品名称或描述" prop="productName"> <el-form-item label="商品名称或描述" prop="productName">
<el-input v-model="query.productName" placeholder="请输入商品名称或描述"></el-input> <el-input clearable v-model="query.productName" placeholder="请输入商品名称或描述"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="客户名称" prop="externalName"> <el-form-item label="客户名称" prop="externalName">
<el-input v-model="query.externalName" placeholder="请输入客户名称"></el-input> <el-input clearable v-model="query.externalName" placeholder="请输入客户名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="收款员工" prop="name"> <el-form-item label="收款员工" prop="name">
<el-input :value="qrUserName" readonly @focus="dialogVisibleSelect = true" placeholder="请选择员工" /> <el-input clearable :value="qrUserName" readonly @focus="dialogVisibleSelect = true" placeholder="请选择员工" />
</el-form-item> </el-form-item>
<el-form-item label="交易状态" prop="name"> <el-form-item label="交易状态" prop="name">
<el-select v-model="query.orderState" :popper-append-to-body="false"> <el-select v-model="query.orderState" :popper-append-to-body="false">
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
</el-form-item> </el-form-item>
<el-form-item label="交易时间" prop="name"> <el-form-item label="交易时间" prop="name">
<el-date-picker <el-date-picker
clearable
v-model="dateRange" v-model="dateRange"
type="daterange" type="daterange"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
......
...@@ -151,16 +151,17 @@ ...@@ -151,16 +151,17 @@
<div> <div>
<el-form ref="queryForm" :inline="true" :model="query" label-width="100px" class="top-search" size="small"> <el-form ref="queryForm" :inline="true" :model="query" label-width="100px" class="top-search" size="small">
<el-form-item label="活码名称" prop="taskName"> <el-form-item label="活码名称" prop="taskName">
<el-input v-model="query.taskName" placeholder="请输入"></el-input> <el-input clearable v-model="query.taskName" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人" prop="createBy"> <el-form-item label="创建人" prop="createBy">
<el-input v-model="query.createBy" placeholder="请输入"></el-input> <el-input clearable v-model="query.createBy" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="关键词" prop="keywords"> <el-form-item label="关键词" prop="keywords">
<el-input v-model="query.keywords" placeholder="请输入"></el-input> <el-input clearable v-model="query.keywords" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建时间"> <el-form-item label="创建时间">
<el-date-picker <el-date-picker
clearable
v-model="dateRange" v-model="dateRange"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
type="daterange" type="daterange"
......
<script> <script>
import { getList, remove, download, downloadBatch } from '@/api/communityOperating/newCustomer' import { getList, remove, download, downloadBatch } from '@/api/communityOperating/newCustomer'
export default { export default {
components: {}, components: {},
props: {}, props: {},
data() { data() {
return { return {
query: { query: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
emplCodeName: '', // 活码名称 emplCodeName: '', // 活码名称
createBy: '', // 创建人 createBy: '', // 创建人
beginTime: '', // 开始日期 beginTime: '', // 开始日期
endTime: '' // 结束日期 endTime: '' // 结束日期
}, },
dateRange: [], // 添加日期 dateRange: [], // 添加日期
total: 0, // 数据总量 total: 0, // 数据总量
form: {}, form: {},
list: [], list: [],
dialogVisible: false, dialogVisible: false,
disabled: false, disabled: false,
loading: false, loading: false,
status: ['正常', '停用'], status: ['正常', '停用'],
pushType: { pushType: {
0: '发给客户', 0: '发给客户',
1: '发给客户群' 1: '发给客户群'
}, },
queryUser: [], // 搜索框选择的添加人 queryUser: [], // 搜索框选择的添加人
ids: [] ids: []
}
},
computed: {},
watch: {
// 日期选择器数据同步至查询参数
dateRange(dateRange) {
if (!dateRange || dateRange.length !== 2) {
this.query.beginTime = ''
this.query.endTime = ''
} else {
;[this.query.beginTime, this.query.endTime] = dateRange
} }
} },
}, computed: {},
created() { watch: {
this.getList() // 日期选择器数据同步至查询参数
this.$store.dispatch( dateRange(dateRange) {
'app/setBusininessDesc', if (!dateRange || dateRange.length !== 2) {
` this.query.beginTime = ''
this.query.endTime = ''
} else {
;[this.query.beginTime, this.query.endTime] = dateRange
}
}
},
created() {
this.getList()
this.$store.dispatch(
'app/setBusininessDesc',
`
<div>指在客户通过员工活码加为好友后,员工自动推送入群引导语和群活码,客户可通过群活码扫码入群。</div> <div>指在客户通过员工活码加为好友后,员工自动推送入群引导语和群活码,客户可通过群活码扫码入群。</div>
` `
) )
},
mounted() {
// new clipboard(".copy-btn");
},
methods: {
// 获取新客数据
getList(page) {
page && (this.query.pageNum = page)
this.loading = true
getList(this.query)
.then(({ rows, total }) => {
this.list = rows
this.total = +total
this.loading = false
})
.catch(() => {
this.loading = false
})
},
// 新建/编辑新客数据
goRoute(id) {
this.$router.push({
path: 'newCustomerAev',
query: { id }
})
}, },
// 多选框选中数据 mounted() {
handleSelectionChange(selection) { // new clipboard(".copy-btn");
this.ids = selection.map((item) => item.id)
}, },
/** 删除按钮操作 */ methods: {
remove(id) { // 获取新客数据
const ids = id || this.ids getList(page) {
this.$confirm('是否确认删除?', '警告', { page && (this.query.pageNum = page)
confirmButtonText: '确定', this.loading = true
cancelButtonText: '取消',
type: 'warning' getList(this.query)
}) .then(({ rows, total }) => {
.then(function () { this.list = rows
return remove(ids) this.total = +total
}) this.loading = false
.then(() => { })
this.getList() .catch(() => {
this.msgSuccess('删除成功') this.loading = false
})
},
// 新建/编辑新客数据
goRoute(id) {
this.$router.push({
path: 'newCustomerAev',
query: { id }
}) })
.catch(function () {}) },
}, // 多选框选中数据
// 下载 handleSelectionChange(selection) {
download(data) { this.ids = selection.map((item) => item.id)
let name = data.codeName + '.png' },
download(data.id).then((res) => { /** 删除按钮操作 */
if (res != null) { remove(id) {
let blob = new Blob([res], { type: 'application/zip' }) const ids = id || this.ids
let url = window.URL.createObjectURL(blob) this.$confirm('是否确认删除?', '警告', {
const link = document.createElement('a') // 创建a标签 confirmButtonText: '确定',
link.href = url cancelButtonText: '取消',
link.download = name // 重命名文件 type: 'warning'
link.click()
URL.revokeObjectURL(url) // 释放内存
}
})
},
// 批量下载
downloadBatch() {
this.$confirm('是否确认下载所有活码图片吗?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
return downloadBatch(this.ids + '')
// window.open(downloadBatch(this.ids))
}) })
.then((res) => { .then(function () {
return remove(ids)
})
.then(() => {
this.getList()
this.msgSuccess('删除成功')
})
.catch(function () {})
},
// 下载
download(data) {
let name = data.codeName + '.png'
download(data.id).then((res) => {
if (res != null) { if (res != null) {
let blob = new Blob([res], { type: 'application/zip' }) let blob = new Blob([res], { type: 'application/zip' })
let url = window.URL.createObjectURL(blob) let url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签 const link = document.createElement('a') // 创建a标签
link.href = url link.href = url
link.download = '批量员工活码.zip' // 重命名文件 link.download = name // 重命名文件
link.click() link.click()
URL.revokeObjectURL(url) // 释放内存 URL.revokeObjectURL(url) // 释放内存
} }
}) })
.catch(function () {}) },
}, // 批量下载
// 重置查询参数 downloadBatch() {
resetQuery() { this.$confirm('是否确认下载所有活码图片吗?', '警告', {
this.dateRange = [] confirmButtonText: '确定',
this.$refs['queryForm'].resetFields() cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
return downloadBatch(this.ids + '')
// window.open(downloadBatch(this.ids))
})
.then((res) => {
if (res != null) {
let blob = new Blob([res], { type: 'application/zip' })
let url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = '批量员工活码.zip' // 重命名文件
link.click()
URL.revokeObjectURL(url) // 释放内存
}
})
.catch(function () {})
},
// 重置查询参数
resetQuery() {
this.dateRange = []
this.$refs['queryForm'].resetFields()
this.$nextTick(() => { this.$nextTick(() => {
this.getList(1) this.getList(1)
}) })
}
} }
} }
}
</script> </script>
<template> <template>
<div> <div>
<el-form <el-form ref="queryForm" :inline="true" :model="query" label-width="100px" class="top-search" size="small">
ref="queryForm"
:inline="true"
:model="query"
label-width="100px"
class="top-search"
size="small"
>
<el-form-item label="活码名称" prop="emplCodeName"> <el-form-item label="活码名称" prop="emplCodeName">
<el-input v-model="query.emplCodeName" placeholder="请输入"></el-input> <el-input clearable v-model="query.emplCodeName" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人" prop="createBy"> <el-form-item label="创建人" prop="createBy">
<el-input v-model="query.createBy" placeholder="请输入"></el-input> <el-input clearable v-model="query.createBy" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建时间"> <el-form-item label="创建时间">
<el-date-picker <el-date-picker
clearable
v-model="dateRange" v-model="dateRange"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
type="daterange" type="daterange"
...@@ -179,14 +173,8 @@ export default { ...@@ -179,14 +173,8 @@ export default {
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label=" "> <el-form-item label=" ">
<el-button type="primary" @click="getList(1)" <el-button type="primary" @click="getList(1)">查询</el-button>
>查询</el-button <el-button type="success" @click="resetQuery()">重置</el-button>
>
<el-button
type="success"
@click="resetQuery()"
>重置</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -195,15 +183,8 @@ export default { ...@@ -195,15 +183,8 @@ export default {
<el-button type="primary" @click="goRoute()">新建活码</el-button> <el-button type="primary" @click="goRoute()">新建活码</el-button>
</div> </div>
<div> <div>
<el-button type="primary" :disabled="!ids.length" @click="downloadBatch()" <el-button type="primary" :disabled="!ids.length" @click="downloadBatch()">批量下载</el-button>
>批量下载</el-button <el-button :disabled="!ids.length" type="cyan" @click="remove()">批量删除</el-button>
>
<el-button
:disabled="!ids.length"
type="cyan"
@click="remove()"
>批量删除</el-button
>
</div> </div>
</div> </div>
...@@ -247,20 +228,12 @@ export default { ...@@ -247,20 +228,12 @@ export default {
<div v-if="row.actualGroupName" slot-scope="{ row }"> <div v-if="row.actualGroupName" slot-scope="{ row }">
<el-popover placement="bottom" trigger="hover" :disabled="row.tagList.length < 3"> <el-popover placement="bottom" trigger="hover" :disabled="row.tagList.length < 3">
<div> <div>
<el-tag <el-tag type="primary" v-for="(unit, unique) in row.actualGroupName.split(',')" :key="unique">
type="primary"
v-for="(unit, unique) in row.actualGroupName.split(',')"
:key="unique"
>
{{ unit }} {{ unit }}
</el-tag> </el-tag>
</div> </div>
<div slot="reference"> <div slot="reference">
<el-tag <el-tag type="primary" v-for="(unit, unique) in row.actualGroupName.split(',').slice(0, 2)" :key="unique">
type="primary"
v-for="(unit, unique) in row.actualGroupName.split(',').slice(0, 2)"
:key="unique"
>
{{ unit }} {{ unit }}
</el-tag> </el-tag>
<el-tag type="primary" key="a" v-if="row.tagList.length > 2">...</el-tag> <el-tag type="primary" key="a" v-if="row.tagList.length > 2">...</el-tag>
...@@ -269,35 +242,14 @@ export default { ...@@ -269,35 +242,14 @@ export default {
</div> </div>
<span v-else>无群聊</span> <span v-else>无群聊</span>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="添加好友数" align="center" prop="cusNumber" width="100"></el-table-column>
label="添加好友数"
align="center"
prop="cusNumber"
width="100"
></el-table-column>
<el-table-column label="创建人" align="center" prop="createBy"></el-table-column> <el-table-column label="创建人" align="center" prop="createBy"></el-table-column>
<el-table-column <el-table-column label="创建时间" align="center" prop="createTime" width="160"></el-table-column>
label="创建时间" <el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width">
align="center"
prop="createTime"
width="160"
></el-table-column>
<el-table-column
label="操作"
align="center"
width="180"
class-name="small-padding fixed-width"
>
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<el-button type="text" @click="goRoute(row.id)" <el-button type="text" @click="goRoute(row.id)">编辑</el-button>
>编辑</el-button <el-button type="text" @click="download(row)">下载</el-button>
> <el-button type="text" @click="remove(row.id)">删除</el-button>
<el-button type="text" @click="download(row)"
>下载</el-button
>
<el-button type="text" @click="remove(row.id)"
>删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -313,13 +265,13 @@ export default { ...@@ -313,13 +265,13 @@ export default {
</template> </template>
<style scoped lang="scss"> <style scoped lang="scss">
.code-image { .code-image {
width: 200px; width: 200px;
height: 200px; height: 200px;
} }
.code-image--small { .code-image--small {
width: 50px; width: 50px;
height: 50px; height: 50px;
} }
</style> </style>
...@@ -216,7 +216,7 @@ ...@@ -216,7 +216,7 @@
<div class="top-search"> <div class="top-search">
<el-form inline label-position="right" :model="query" label-width="100px" ref="queryForm"> <el-form inline label-position="right" :model="query" label-width="100px" ref="queryForm">
<el-form-item label="任务名称" prop="taskName"> <el-form-item label="任务名称" prop="taskName">
<el-input v-model="query.taskName" placeholder="请输入"></el-input> <el-input clearable v-model="query.taskName" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<!-- <el-form-item label="发送方式" prop="sendType"> <!-- <el-form-item label="发送方式" prop="sendType">
<el-select v-model="query.sendType" placeholder="请选择" size="small"> <el-select v-model="query.sendType" placeholder="请选择" size="small">
...@@ -229,10 +229,11 @@ ...@@ -229,10 +229,11 @@
</el-select> </el-select>
</el-form-item> --> </el-form-item> -->
<el-form-item label="创建人" prop="createBy"> <el-form-item label="创建人" prop="createBy">
<el-input v-model="query.createBy" placeholder="请输入"></el-input> <el-input clearable v-model="query.createBy" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建时间"> <el-form-item label="创建时间">
<el-date-picker <el-date-picker
clearable
v-model="dateRange" v-model="dateRange"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
type="daterange" type="daterange"
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
<el-input <el-input
class="mb10" class="mb10"
placeholder="搜索客户" placeholder="搜索客户"
clearable
prefix-icon="el-icon-search" prefix-icon="el-icon-search"
v-model="customerQuery.name" v-model="customerQuery.name"
@keyup.enter.native="getCustomerList(1)" @keyup.enter.native="getCustomerList(1)"
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
</el-form-item> </el-form-item>
<el-form-item label="时间范围"> <el-form-item label="时间范围">
<el-date-picker <el-date-picker
clearable
v-model="dateRange" v-model="dateRange"
type="daterange" type="daterange"
format="yyyy-MM-dd" format="yyyy-MM-dd"
......
...@@ -6,14 +6,12 @@ ...@@ -6,14 +6,12 @@
<div class="tag-input" @click="dialogVisibleSelectUser = true"> <div class="tag-input" @click="dialogVisibleSelectUser = true">
<span class="tag-place" v-if="!queryUser.length">请选择</span> <span class="tag-place" v-if="!queryUser.length">请选择</span>
<template v-else> <template v-else>
<el-tag type="info" v-for="(unit, unique) in queryUser" :key="unique">{{ <el-tag type="info" v-for="(unit, unique) in queryUser" :key="unique">{{ unit.name }}</el-tag>
unit.name
}}</el-tag>
</template> </template>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-input v-model="form.keyword" placeholder="搜索关键词" style="width: 240px"> </el-input> <el-input clearable v-model="form.keyword" placeholder="搜索关键词" style="width: 240px;"> </el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="getSensitiveList">查询</el-button> <el-button type="primary" @click="getSensitiveList">查询</el-button>
...@@ -24,7 +22,7 @@ ...@@ -24,7 +22,7 @@
<el-col :span="8"> <el-col :span="8">
<div class="left-title">触发记录</div> <div class="left-title">触发记录</div>
</el-col> </el-col>
<el-col :span="16" style="text-align: right"> <el-col :span="16" style="text-align: right;">
<el-radio-group v-model="selectDate" size="small"> <el-radio-group v-model="selectDate" size="small">
<el-radio-button label="昨日"></el-radio-button> <el-radio-button label="昨日"></el-radio-button>
<el-radio-button label="7日"></el-radio-button> <el-radio-button label="7日"></el-radio-button>
...@@ -42,12 +40,7 @@ ...@@ -42,12 +40,7 @@
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<el-table <el-table :data="tableData" stripe style="width: 100%;" :header-cell-style="{ background: '#fff' }">
:data="tableData"
stripe
style="width: 100%"
:header-cell-style="{ background: '#fff' }"
>
<el-table-column prop="patternWords" label="敏感词"> </el-table-column> <el-table-column prop="patternWords" label="敏感词"> </el-table-column>
<el-table-column prop="content" label="内容"> <el-table-column prop="content" label="内容">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
...@@ -87,118 +80,118 @@ ...@@ -87,118 +80,118 @@
</div> </div>
</template> </template>
<script> <script>
import * as sensitiveApis from '@/api/conversation/security' import * as sensitiveApis from '@/api/conversation/security'
import SelectUser from '@/components/SelectUser' import SelectUser from '@/components/SelectUser'
import ChatContent from '@/components/ChatContent' import ChatContent from '@/components/ChatContent'
export default { export default {
components: { components: {
SelectUser, SelectUser,
ChatContent ChatContent
}, },
data() { data() {
return { return {
form: { form: {
pageSize: 10, pageSize: 10,
pageNum: 1, pageNum: 1,
scopeType: '', scopeType: '',
auditScopeId: '', auditScopeId: '',
keyword: '' // 关键词 keyword: '' // 关键词
},
selectDate: '',
dateRangeValue: '', // 时间选择
tableData: [],
queryUser: [], // 搜索框选择的添加人
query: {
pageNum: 1,
pageSize: 10
},
total: 0,
dialogVisibleSelectUser: false, // 选择添加人弹窗显隐
floorRange: '全部',
displayOptions: [
{
value: '0',
label: '全部'
},
{
value: '1',
label: '已发送'
}, },
{ selectDate: '',
value: '2', dateRangeValue: '', // 时间选择
label: '已撤回' tableData: [],
queryUser: [], // 搜索框选择的添加人
query: {
pageNum: 1,
pageSize: 10
}, },
{ total: 0,
value: '3', dialogVisibleSelectUser: false, // 选择添加人弹窗显隐
label: '已删除' floorRange: '全部',
} displayOptions: [
] {
} value: '0',
}, label: '全部'
created() { },
this.getSensitiveList() {
}, value: '1',
methods: { label: '已发送'
getSensitiveList() { },
this.form.pageSize = this.query.pageSize {
this.form.pageNum = this.query.pageNum value: '2',
sensitiveApis.getSecurityList(this.form).then((res) => { label: '已撤回'
if (res.code === 200) { },
this.tableData = res.rows {
this.total = Number(res.total) value: '3',
} label: '已删除'
}) }
}, ]
chechName(e) {
if (e == 0) {
this.floorRange = '全部'
} else if (e == 1) {
this.floorRange = '已发送'
} else if (e == 2) {
this.floorRange = '已撤回'
} else {
this.floorRange = '切回企业日志'
} }
}, },
selectedUser(list) { created() {
// console.log(list)
this.queryUser = list
this.form.scopeType = 2 //list.map((d) => d.department) + ''
console.log(list, 'scopeType')
this.form.auditScopeId = list.map((d) => d.userId) + ''
this.getSensitiveList() this.getSensitiveList()
},
methods: {
getSensitiveList() {
this.form.pageSize = this.query.pageSize
this.form.pageNum = this.query.pageNum
sensitiveApis.getSecurityList(this.form).then((res) => {
if (res.code === 200) {
this.tableData = res.rows
this.total = Number(res.total)
}
})
},
chechName(e) {
if (e == 0) {
this.floorRange = '全部'
} else if (e == 1) {
this.floorRange = '已发送'
} else if (e == 2) {
this.floorRange = '已撤回'
} else {
this.floorRange = '切回企业日志'
}
},
selectedUser(list) {
// console.log(list)
this.queryUser = list
this.form.scopeType = 2 //list.map((d) => d.department) + ''
console.log(list, 'scopeType')
this.form.auditScopeId = list.map((d) => d.userId) + ''
this.getSensitiveList()
}
} }
} }
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.demo-form-inline { .demo-form-inline {
background: #efefef; background: #efefef;
padding: 18px 10px 0 10px; padding: 18px 10px 0 10px;
} }
.search-content { .search-content {
height: 40px;
margin-top: 15px;
padding: 10px;
.left-title {
height: 40px; height: 40px;
line-height: 40px; margin-top: 15px;
padding: 10px;
.left-title {
height: 40px;
line-height: 40px;
}
.date-range {
margin-left: 10px;
width: 300px;
}
} }
.date-range { .noborder {
margin-left: 10px; ::v-deep .el-input--mini .el-input__inner {
width: 300px; width: 2px;
border: none;
}
} }
} .content {
.noborder { margin-top: 15px;
::v-deep .el-input--mini .el-input__inner { padding: 10px;
width: 2px;
border: none;
} }
}
.content {
margin-top: 15px;
padding: 10px;
}
</style> </style>
<script> <script>
import * as api from '@/api/customer' import * as api from '@/api/customer'
import { getList as getListTag } from '@/api/customer/tag' import { getList as getListTag } from '@/api/customer/tag'
import AddTag from '@/components/AddTag' import AddTag from '@/components/AddTag'
import SelectTag from '@/components/SelectTag' import SelectTag from '@/components/SelectTag'
import { dictAddType, dictTrackState } from '@/utils/dictionary' import { dictAddType, dictTrackState } from '@/utils/dictionary'
export default { export default {
name: 'Customer', name: 'Customer',
components: { AddTag, SelectTag }, components: { AddTag, SelectTag },
props: {}, props: {},
data() { data() {
return { return {
query: { query: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
name: '', // "客户名称", name: '', // "客户名称",
userIds: '', // "添加人id", userIds: '', // "添加人id",
tagIds: '', // "标签id,多个标签,id使用逗号隔开", tagIds: '', // "标签id,多个标签,id使用逗号隔开",
beginTime: '', // "开始时间", beginTime: '', // "开始时间",
endTime: '', // "结束时间" endTime: '', // "结束时间"
customerType: '', //客户类型 1:微信客户;2:企业客户 customerType: '', //客户类型 1:微信客户;2:企业客户
trackState: '', //跟进状态 1:待跟进;2:跟进中;3:已成交;4:无意向;5:已流失 trackState: '', //跟进状态 1:待跟进;2:跟进中;3:已成交;4:无意向;5:已流失
addMethod: '', //添加方式 0:未知来源;1:扫描二维码;2:搜索手机号;3:名片分享;4:群聊;5:手机通讯录;6:微信联系人;7:来自微信好友的添加申请;8:安装第三方应用时自动添加的客服人员;9:搜索邮箱;10:视频号主页添加;11:员工活码;12:新客拉群;13:活动裂变;201:内部成员共享;202:管理员/负责人分配 addMethod: '', //添加方式 0:未知来源;1:扫描二维码;2:搜索手机号;3:名片分享;4:群聊;5:手机通讯录;6:微信联系人;7:来自微信好友的添加申请;8:安装第三方应用时自动添加的客服人员;9:搜索邮箱;10:视频号主页添加;11:员工活码;12:新客拉群;13:活动裂变;201:内部成员共享;202:管理员/负责人分配
gender: '', //0-未知 1-男性 2-女性 gender: '' //0-未知 1-男性 2-女性
}, },
queryTag: [], // 搜索框选择的标签 queryTag: [], // 搜索框选择的标签
queryUser: [], // 搜索框选择的添加人 queryUser: [], // 搜索框选择的添加人
dateRange: [], // 添加日期 dateRange: [], // 添加日期
loading: false, loading: false,
total: 0, total: 0,
lastSyncTime: '', lastSyncTime: '',
noRepeatCustomerTotal: 0, noRepeatCustomerTotal: 0,
// 添加标签表单 // 添加标签表单
form: { form: {
gourpName: '', gourpName: '',
weTags: [], weTags: []
}, },
list: [], // 客户列表 list: [], // 客户列表
staffList: [], // 所有员工列表 staffList: [], // 所有员工列表
multipleSelection: [], // 多选数组 multipleSelection: [], // 多选数组
dialogVisible: false, // 选择标签弹窗显隐 dialogVisible: false, // 选择标签弹窗显隐
dialogVisibleSelectUser: false, // 选择添加人弹窗显隐 dialogVisibleSelectUser: false, // 选择添加人弹窗显隐
dialogVisibleAddTag: false, // 添加标签弹窗显隐 dialogVisibleAddTag: false, // 添加标签弹窗显隐
dialogVisibleExtend: false, // 在职继承弹窗显隐 dialogVisibleExtend: false, // 在职继承弹窗显隐
extendStaff: '', // 在职继承选择的员工 extendStaff: '', // 在职继承选择的员工
currentEidt: '', // 当前编辑项 currentEidt: '', // 当前编辑项
selectedTag: [], // 选择的标签 selectedTag: [], // 选择的标签
tagDialogType: { tagDialogType: {
title: '', // 选择标签弹窗标题 title: '', // 选择标签弹窗标题
type: '', // 弹窗类型 type: '' // 弹窗类型
}, },
dictCustomerType: Object.freeze({ 1: '微信客户', 2: '企业客户' }), dictCustomerType: Object.freeze({ 1: '微信客户', 2: '企业客户' }),
dictAddType, dictAddType,
dictTrackState, dictTrackState
} }
}, },
watch: {}, watch: {},
computed: {}, computed: {},
created() { created() {
this.getList() this.getList()
this.getListTag() this.getListTag()
this.$store.dispatch( this.$store.dispatch(
'app/setBusininessDesc', 'app/setBusininessDesc',
` `
<div>用于查看当前企业所有的客户列表及详细信息,支持对客户进行打标签。</div> <div>用于查看当前企业所有的客户列表及详细信息,支持对客户进行打标签。</div>
` `
) )
}, },
mounted() {}, mounted() {},
methods: { methods: {
getList(page) { getList(page) {
// console.log(this.dateRange); // console.log(this.dateRange);
if (this.dateRange) { if (this.dateRange) {
this.query.beginTime = this.dateRange[0] this.query.beginTime = this.dateRange[0]
this.query.endTime = this.dateRange[1] this.query.endTime = this.dateRange[1]
} else { } else {
this.query.beginTime = '' this.query.beginTime = ''
this.query.endTime = '' this.query.endTime = ''
} }
page && (this.query.pageNum = page) page && (this.query.pageNum = page)
this.query.tagIds = this.queryTag.map((d) => d.tagId) + '' this.query.tagIds = this.queryTag.map((d) => d.tagId) + ''
this.query.userIds = this.queryUser.map((d) => d.userId) + '' this.query.userIds = this.queryUser.map((d) => d.userId) + ''
this.loading = true this.loading = true
api api
.getListNew(this.query) .getListNew(this.query)
.then(({ rows, total, lastSyncTime, noRepeatCustomerTotal }) => { .then(({ rows, total, lastSyncTime, noRepeatCustomerTotal }) => {
rows.forEach((element) => { rows.forEach((element) => {
if (element.tagIds && element.tagNames) { if (element.tagIds && element.tagNames) {
element.tagIds = element.tagIds.split(',') element.tagIds = element.tagIds.split(',')
element.tagNames = element.tagNames.split(',') element.tagNames = element.tagNames.split(',')
element.tags = [] element.tags = []
element.tagIds.forEach((unit, index) => { element.tagIds.forEach((unit, index) => {
element.tags.push({ element.tags.push({
tagId: unit, tagId: unit,
tagName: element.tagNames[index], tagName: element.tagNames[index]
})
}) })
}) }
} })
this.list = rows
this.total = +total
this.lastSyncTime = lastSyncTime
this.noRepeatCustomerTotal = +noRepeatCustomerTotal
this.loading = false
this.multipleSelection = []
}) })
this.list = rows .catch(() => {
this.total = +total this.loading = false
this.lastSyncTime = lastSyncTime
this.noRepeatCustomerTotal = +noRepeatCustomerTotal
this.loading = false
this.multipleSelection = []
})
.catch(() => {
this.loading = false
})
},
getListTag(refresh) {
getListTag().then(({ rows }) => {
this.listTagOneArray = []
rows.forEach((element) => {
element.weTags.forEach((d) => {
this.listTagOneArray.push(d)
}) })
}) },
if (refresh) { getListTag(refresh) {
this.$refs.selectTag.getList() getListTag().then(({ rows }) => {
this.form = { this.listTagOneArray = []
gourpName: '', rows.forEach((element) => {
weTags: [], element.weTags.forEach((d) => {
this.listTagOneArray.push(d)
})
})
if (refresh) {
this.$refs.selectTag.getList()
this.form = {
gourpName: '',
weTags: []
}
} }
})
},
showTagDialog() {
this.selectedTag = this.queryTag
this.tagDialogType = {
title: '选择标签',
type: 'query'
} }
}) this.dialogVisible = true
}, // this.$refs.selectTag.$forceUpdate()
showTagDialog() { },
this.selectedTag = this.queryTag makeTag(row) {
this.tagDialogType = { this.currentEidt = row
title: '选择标签', // if (!this.multipleSelection.length) {
type: 'query', // this.msgInfo('请选择一位客户')
} // return
this.dialogVisible = true // }
// this.$refs.selectTag.$forceUpdate() // if (this.multipleSelection.length > 1) {
}, // this.msgInfo('同时只能选择一位客户')
makeTag(row) { // return
this.currentEidt = row // }
// if (!this.multipleSelection.length) { this.selectedTag = []
// this.msgInfo('请选择一位客户') let hasErrorTag = []
// return let repeat = []
// } row.tags &&
// if (this.multipleSelection.length > 1) { row.tags.forEach((unit) => {
// this.msgInfo('同时只能选择一位客户') // 判断是否有重复标签
// return let isRepeat = this.selectedTag.some((d) => {
// } return d.tagId === unit.tagId
this.selectedTag = [] })
let hasErrorTag = [] // 去重
let repeat = [] if (isRepeat) {
row.tags && repeat.push(unit.tagName)
row.tags.forEach((unit) => { return
// 判断是否有重复标签 }
let isRepeat = this.selectedTag.some((d) => { let filter = this.listTagOneArray.find((d) => {
return d.tagId === unit.tagId return d.tagId === unit.tagId
})
// 如果没有匹配到,则说明该便签处于异常状态,可能已被删除或破坏
if (!filter) {
hasErrorTag.push(unit.tagName)
return
}
this.selectedTag.push(filter)
}) })
// 去重 // this.multipleSelection.forEach((element) => {
if (isRepeat) { // })
repeat.push(unit.tagName) if (hasErrorTag.length > 0) {
return this.$notify({
} // title: '标题名称',
let filter = this.listTagOneArray.find((d) => { message: this.$createElement(
return d.tagId === unit.tagId 'i',
{ style: 'color: red' },
'已有标签[' + hasErrorTag + ']不在标签库中,已被删除或存在异常'
),
type: 'warning',
customClass: 'mzindex'
}) })
// 如果没有匹配到,则说明该便签处于异常状态,可能已被删除或破坏 // this.msgError('已有标签[' + hasErrorTag + ']不在标签库中,已被删除或存在异常')
if (!filter) { }
hasErrorTag.push(unit.tagName)
return
}
this.selectedTag.push(filter)
})
// this.multipleSelection.forEach((element) => {
// })
if (hasErrorTag.length > 0) {
this.$notify({
// title: '标题名称',
message: this.$createElement(
'i',
{ style: 'color: red' },
'已有标签[' + hasErrorTag + ']不在标签库中,已被删除或存在异常'
),
type: 'warning',
customClass: 'mzindex',
})
// this.msgError('已有标签[' + hasErrorTag + ']不在标签库中,已被删除或存在异常')
}
this.tagDialogType = { this.tagDialogType = {
title: '标签设置' + (repeat.length ? '(重复的标签已去重显示)' : ''), title: '标签设置' + (repeat.length ? '(重复的标签已去重显示)' : '')
}
this.dialogVisible = true
// this.$refs.selectTag.$forceUpdate()
},
sync() {
// const loading = this.$loading({
// lock: true,
// text: 'Loading',
// spinner: 'el-icon-loading',
// background: 'rgba(0, 0, 0, 0.7)',
// })
api
.sync()
.then(() => {
// loading.close()
this.getList(1)
this.msgSuccess('后台开始同步数据,请稍后关注进度')
})
.catch((fail) => {
// loading.close()
console.log(fail)
})
},
// /** 导出按钮操作 */
// exportCustomer() {
// const queryParams = this.query
// this.$confirm('是否确认导出所有客户数据项?', '警告', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// type: 'warning'
// })
// .then(function() {
// return api.exportCustomer(queryParams)
// })
// .then((response) => {
// this.download(response.msg)
// })
// .catch(function() {})
// },
selectedUser(list) {
this.queryUser = list
},
submitSelectTag(selected) {
if (this.tagDialogType.type === 'query') {
this.queryTag = selected
this.dialogVisible = false
} else {
let data = {
externalUserid: this.currentEidt.externalUserid,
addTag: selected,
userId: this.currentEidt.firstUserId,
} }
// let apiType = { this.dialogVisible = true
// add: 'makeLabel', // this.$refs.selectTag.$forceUpdate()
// remove: 'removeLabel' },
// } sync() {
this.loading = true // const loading = this.$loading({
// lock: true,
// text: 'Loading',
// spinner: 'el-icon-loading',
// background: 'rgba(0, 0, 0, 0.7)',
// })
api api
.makeLabel(data) .sync()
.then(() => { .then(() => {
this.msgSuccess('操作成功') // loading.close()
this.dialogVisible = false this.getList(1)
this.getList() this.msgSuccess('后台开始同步数据,请稍后关注进度')
this.loading = false
}) })
.catch(() => { .catch((fail) => {
this.loading = false // loading.close()
console.log(fail)
}) })
} },
}, // /** 导出按钮操作 */
resetForm(formName) { // exportCustomer() {
this.dateRange = [] // const queryParams = this.query
this.queryTag = [] // this.$confirm('是否确认导出所有客户数据项?', '警告', {
this.queryUser = [] // confirmButtonText: '确定',
this.$refs['queryForm'].resetFields() // cancelButtonText: '取消',
this.getList(1) // type: 'warning'
}, // })
// 多选框选中数据 // .then(function() {
handleSelectionChange(selection) { // return api.exportCustomer(queryParams)
this.multipleSelection = selection // })
}, // .then((response) => {
// 用于多选变单选 // this.download(response.msg)
handleSelection(selection, row) { // })
this.$nextTick(() => { // .catch(function() {})
this.$refs.table.clearSelection() // },
this.$refs.table.toggleRowSelection(row) selectedUser(list) {
}) this.queryUser = list
}, },
goRoute(row) { submitSelectTag(selected) {
let { externalUserid, firstUserId: userId } = row if (this.tagDialogType.type === 'query') {
this.$router.push({ this.queryTag = selected
path: 'customerDetail', this.dialogVisible = false
query: { externalUserid, userId }, } else {
}) let data = {
}, externalUserid: this.currentEidt.externalUserid,
addTag: selected,
userId: this.currentEidt.firstUserId
}
// let apiType = {
// add: 'makeLabel',
// remove: 'removeLabel'
// }
this.loading = true
api
.makeLabel(data)
.then(() => {
this.msgSuccess('操作成功')
this.dialogVisible = false
this.getList()
this.loading = false
})
.catch(() => {
this.loading = false
})
}
},
resetForm(formName) {
this.dateRange = []
this.queryTag = []
this.queryUser = []
this.$refs['queryForm'].resetFields()
this.getList(1)
},
// 多选框选中数据
handleSelectionChange(selection) {
this.multipleSelection = selection
},
// 用于多选变单选
handleSelection(selection, row) {
this.$nextTick(() => {
this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(row)
})
},
goRoute(row) {
let { externalUserid, firstUserId: userId } = row
this.$router.push({
path: 'customerDetail',
query: { externalUserid, userId }
})
},
// 在职继承 // 在职继承
async transfer(row) { async transfer(row) {
await this.$refs['SelectStaffForm'].validate() await this.$refs['SelectStaffForm'].validate()
// if (!this.extendStaff) { // if (!this.extendStaff) {
// this.msgError('请选择员工') // this.msgError('请选择员工')
// return // return
// } // }
let data = { let data = {
handoverUserId: this.currentEidt.firstUserId, //移交人 handoverUserId: this.currentEidt.firstUserId, //移交人
takeoverUserId: this.extendStaff, //接受人 takeoverUserId: this.extendStaff, //接受人
externalUserid: this.currentEidt.externalUserid, //客户id,多个客户使用逗号隔开 externalUserid: this.currentEidt.externalUserid //客户id,多个客户使用逗号隔开
}
api.jobExtends(data).then((res) => {
this.msgSuccess('操作成功')
this.dialogVisibleExtend = false
this.getList()
})
} }
api.jobExtends(data).then((res) => { }
this.msgSuccess('操作成功') }
this.dialogVisibleExtend = false
this.getList()
})
},
},
}
</script> </script>
<template> <template>
<div v-loading="loading"> <div v-loading="loading">
<el-form <el-form ref="queryForm" :inline="true" :model="query" label-width="100px" class="top-search" size="small">
ref="queryForm"
:inline="true"
:model="query"
label-width="100px"
class="top-search"
size="small"
>
<el-form-item label="客户名称" prop="name"> <el-form-item label="客户名称" prop="name">
<el-input v-model="query.name" placeholder="请输入"></el-input> <el-input clearable v-model="query.name" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="客户类型" prop="customerType"> <el-form-item label="客户类型" prop="customerType">
<el-select v-model="query.customerType" placeholder="请选择"> <el-select clearable v-model="query.customerType" placeholder="请选择">
<el-option <el-option v-for="(item, index) in dictCustomerType" :key="index" :label="item" :value="index"></el-option>
v-for="(item, index) in dictCustomerType"
:key="index"
:label="item"
:value="index"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="客户标签" prop="customerType"> <el-form-item label="客户标签" prop="customerType">
...@@ -347,27 +335,18 @@ export default { ...@@ -347,27 +335,18 @@ export default {
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="跟进状态" prop="trackState"> <el-form-item label="跟进状态" prop="trackState">
<el-select v-model="query.trackState" placeholder="请选择"> <el-select clearable v-model="query.trackState" placeholder="请选择">
<el-option <el-option v-for="(item, index) in dictTrackState" :key="index" :label="item.name" :value="index"></el-option>
v-for="(item, index) in dictTrackState"
:key="index"
:label="item.name"
:value="index"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="添加方式" prop="addMethod"> <el-form-item label="添加方式" prop="addMethod">
<el-select v-model="query.addMethod" placeholder="请选择"> <el-select clearable v-model="query.addMethod" placeholder="请选择">
<el-option <el-option v-for="(item, index) in dictAddType" :key="index" :label="item" :value="index"></el-option>
v-for="(item, index) in dictAddType"
:key="index"
:label="item"
:value="index"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="添加日期"> <el-form-item label="添加日期">
<el-date-picker <el-date-picker
clearable
v-model="dateRange" v-model="dateRange"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
type="daterange" type="daterange"
...@@ -412,11 +391,7 @@ export default { ...@@ -412,11 +391,7 @@ export default {
<el-table-column label="客户" prop="customerName" header-align="center" align="" width="180"> <el-table-column label="客户" prop="customerName" header-align="center" align="" width="180">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<div class="cp flex aic" @click="goRoute(row)"> <div class="cp flex aic" @click="goRoute(row)">
<el-image <el-image style="width: 50px; height: 50px; flex: none;" :src="row.avatar" fit="fit"></el-image>
style="width: 50px; height: 50px; flex: none"
:src="row.avatar"
fit="fit"
></el-image>
<div class="ml10"> <div class="ml10">
<p>{{ row.customerName }}</p> <p>{{ row.customerName }}</p>
<i :class="['el-icon-s-custom', { 1: 'man', 2: 'woman' }[row.gender]]"></i> <i :class="['el-icon-s-custom', { 1: 'man', 2: 'woman' }[row.gender]]"></i>
...@@ -497,11 +472,7 @@ export default { ...@@ -497,11 +472,7 @@ export default {
</SelectTag> </SelectTag>
<!-- 选择添加人弹窗 --> <!-- 选择添加人弹窗 -->
<SelectWeUser <SelectWeUser :visible.sync="dialogVisibleSelectUser" title="选择添加人" @success="selectedUser"></SelectWeUser>
:visible.sync="dialogVisibleSelectUser"
title="选择添加人"
@success="selectedUser"
></SelectWeUser>
<!-- 添加标签弹窗 --> <!-- 添加标签弹窗 -->
<AddTag :visible.sync="dialogVisibleAddTag" :form="form" @success="getListTag(true)" /> <AddTag :visible.sync="dialogVisibleAddTag" :form="form" @success="getListTag(true)" />
...@@ -518,23 +489,23 @@ export default { ...@@ -518,23 +489,23 @@ export default {
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-icon-s-custom { .el-icon-s-custom {
font-size: 16px; font-size: 16px;
// margin-left: 4px; // margin-left: 4px;
color: #999; color: #999;
&.man { &.man {
color: #13a2e8; color: #13a2e8;
}
&.woman {
color: #f753b2;
}
} }
&.woman { .bfc-d + .bfc-d .el-checkbox:first-child {
color: #f753b2; margin-left: 10px;
} }
}
.bfc-d + .bfc-d .el-checkbox:first-child {
margin-left: 10px;
}
</style> </style>
<style> <style>
.mzindex { .mzindex {
z-index: 5000 !important; z-index: 5000 !important;
} }
</style> </style>
<script> <script>
import AllocatedStaffDetailList from './allocatedStaffDetailList' import AllocatedStaffDetailList from './allocatedStaffDetailList'
export default { export default {
name: 'AllocatedStaffDetail', name: 'AllocatedStaffDetail',
components: { AllocatedStaffDetailList }, components: { AllocatedStaffDetailList },
props: {}, props: {},
data() { data() {
return { return {
active: 'customer', active: 'customer',
dateRange: [] // 离职日期 dateRange: [] // 离职日期
} }
},
watch: {},
computed: {},
created() {},
mounted() {},
methods: {
getList() {
this.$refs[this.active].getList(1)
}, },
resetForm(formName) { watch: {},
this.dateRange = [] computed: {},
this.$refs['queryForm'].resetFields() created() {},
this.getList() mounted() {},
methods: {
getList() {
this.$refs[this.active].getList(1)
},
resetForm(formName) {
this.dateRange = []
this.$refs['queryForm'].resetFields()
this.getList()
}
} }
} }
}
</script> </script>
<template> <template>
<div class="page"> <div class="page">
<el-form <el-form ref="queryForm" :inline="true" label-width="70px" class="top-search">
ref="queryForm"
:inline="true"
label-width="70px"
class="top-search"
>
<el-form-item label="离职日期"> <el-form-item label="离职日期">
<el-date-picker <el-date-picker
clearable
v-model="dateRange" v-model="dateRange"
type="daterange" type="daterange"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
...@@ -49,16 +45,8 @@ export default { ...@@ -49,16 +45,8 @@ export default {
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label> <el-form-item label>
<el-button <el-button v-hasPermi="['customerManage:dimission:query']" type="primary" @click="getList(1)">查询</el-button>
v-hasPermi="['customerManage:dimission:query']" <el-button v-hasPermi="['customerManage:dimission:query']" type="info" @click="resetForm('queryForm')"
type="primary"
@click="getList(1)"
>查询</el-button
>
<el-button
v-hasPermi="['customerManage:dimission:query']"
type="info"
@click="resetForm('queryForm')"
>重置</el-button >重置</el-button
> >
</el-form-item> </el-form-item>
...@@ -66,17 +54,10 @@ export default { ...@@ -66,17 +54,10 @@ export default {
<el-tabs v-model="active"> <el-tabs v-model="active">
<el-tab-pane label="已分配客户" name="customer"> <el-tab-pane label="已分配客户" name="customer">
<AllocatedStaffDetailList <AllocatedStaffDetailList ref="customer" :dateRange="dateRange"></AllocatedStaffDetailList>
ref="customer"
:dateRange="dateRange"
></AllocatedStaffDetailList>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="已分配群聊" name="group"> <el-tab-pane label="已分配群聊" name="group">
<AllocatedStaffDetailList <AllocatedStaffDetailList ref="group" :dateRange="dateRange" type="group"></AllocatedStaffDetailList>
ref="group"
:dateRange="dateRange"
type="group"
></AllocatedStaffDetailList>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
......
<script> <script>
import { getList } from '@/api/customer/dimission' import { getList } from '@/api/customer/dimission'
export default { export default {
name: 'AllocatedStaffList', name: 'AllocatedStaffList',
components: {}, components: {},
props: {}, props: {},
data() { data() {
return { return {
// 查询参数 // 查询参数
query: { query: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
userName: undefined, userName: undefined,
beginTime: undefined, beginTime: undefined,
endTime: undefined endTime: undefined
}, },
loading: false, loading: false,
total: 0, total: 0,
list: [], list: [],
dialogVisibleSelectUser: false, dialogVisibleSelectUser: false,
dateRange: [] // 离职日期 dateRange: [] // 离职日期
}
},
watch: {},
computed: {},
created() {
this.getList()
},
mounted() {},
methods: {
/** 查询 */
getList(page) {
if (this.dateRange) {
this.query.beginTime = this.dateRange[0]
this.query.endTime = this.dateRange[1]
} else {
this.query.beginTime = ''
this.query.endTime = ''
} }
page && (this.query.pageNum = page)
this.loading = true
getList(this.query)
.then(({ rows, total }) => {
this.list = rows
this.total = +total
this.loading = false
})
.catch(() => {
this.loading = false
})
}, },
resetForm() { watch: {},
this.dateRange = [] computed: {},
this.$refs['queryForm'].resetFields() created() {
this.getList(1) this.getList()
},
mounted() {},
methods: {
/** 查询 */
getList(page) {
if (this.dateRange) {
this.query.beginTime = this.dateRange[0]
this.query.endTime = this.dateRange[1]
} else {
this.query.beginTime = ''
this.query.endTime = ''
}
page && (this.query.pageNum = page)
this.loading = true
getList(this.query)
.then(({ rows, total }) => {
this.list = rows
this.total = +total
this.loading = false
})
.catch(() => {
this.loading = false
})
},
resetForm() {
this.dateRange = []
this.$refs['queryForm'].resetFields()
this.getList(1)
}
} }
} }
}
</script> </script>
<template> <template>
<div class="page"> <div class="page">
<el-form ref="queryForm" :inline="true" :model="query" label-width="100px" class="top-search"> <el-form ref="queryForm" :inline="true" :model="query" label-width="100px" class="top-search">
<el-form-item label="已离职员工" prop="userName"> <el-form-item label="已离职员工" prop="userName">
<el-input v-model="query.userName" placeholder="请输入"></el-input> <el-input clearable v-model="query.userName" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="离职日期"> <el-form-item label="离职日期">
<el-date-picker <el-date-picker
clearable
v-model="dateRange" v-model="dateRange"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
type="daterange" type="daterange"
...@@ -79,35 +80,19 @@ export default { ...@@ -79,35 +80,19 @@ export default {
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label> <el-form-item label>
<el-button <el-button v-hasPermi="['customerManage:dimission:query']" type="primary" @click="getList(1)">查询</el-button>
v-hasPermi="['customerManage:dimission:query']" <el-button v-hasPermi="['customerManage:dimission:query']" type="success" @click="resetForm('queryForm')"
type="primary"
@click="getList(1)"
>查询</el-button
>
<el-button
v-hasPermi="['customerManage:dimission:query']"
type="success"
@click="resetForm('queryForm')"
>重置</el-button >重置</el-button
> >
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table ref="multipleTable" :data="list" tooltip-effect="dark" style="width: 100%"> <el-table ref="multipleTable" :data="list" tooltip-effect="dark" style="width: 100%;">
<el-table-column type="index" label="序号" width="55"></el-table-column> <el-table-column type="index" label="序号" width="55"></el-table-column>
<el-table-column prop="userName" label="已离职员工"></el-table-column> <el-table-column prop="userName" label="已离职员工"></el-table-column>
<el-table-column prop="department" label="所属部门"></el-table-column> <el-table-column prop="department" label="所属部门"></el-table-column>
<el-table-column <el-table-column prop="allocateCustomerNum" label="已分配客户数" show-overflow-tooltip></el-table-column>
prop="allocateCustomerNum" <el-table-column prop="allocateGroupNum" label="已分配群聊数" show-overflow-tooltip></el-table-column>
label="已分配客户数"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="allocateGroupNum"
label="已分配群聊数"
show-overflow-tooltip
></el-table-column>
<el-table-column prop="dimissionTime" label="离职时间" show-overflow-tooltip> <el-table-column prop="dimissionTime" label="离职时间" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.dimissionTime }}</template> <template slot-scope="scope">{{ scope.row.dimissionTime }}</template>
</el-table-column> </el-table-column>
......
...@@ -118,10 +118,11 @@ ...@@ -118,10 +118,11 @@
<div class="page"> <div class="page">
<el-form ref="queryForm" :inline="true" :model="query" label-width="100px" class="top-search"> <el-form ref="queryForm" :inline="true" :model="query" label-width="100px" class="top-search">
<el-form-item label="已离职员工" prop="userName"> <el-form-item label="已离职员工" prop="userName">
<el-input v-model="query.userName" placeholder="请输入"></el-input> <el-input clearable v-model="query.userName" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="离职日期"> <el-form-item label="离职日期">
<el-date-picker <el-date-picker
clearable
v-model="dateRange" v-model="dateRange"
type="daterange" type="daterange"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
export default { export default {
name: 'Group', name: 'Group',
components: { SelectTag }, components: { SelectTag },
data () { data() {
return { return {
// 查询参数 // 查询参数
query: { query: {
...@@ -42,12 +42,12 @@ ...@@ -42,12 +42,12 @@
} }
}, },
computed: {}, computed: {},
created () { created() {
this.getList() this.getList()
}, },
methods: { methods: {
/** 查询 */ /** 查询 */
getList (page) { getList(page) {
if (this.dateRange) { if (this.dateRange) {
this.query.beginTime = this.dateRange[0] this.query.beginTime = this.dateRange[0]
this.query.endTime = this.dateRange[1] this.query.endTime = this.dateRange[1]
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
this.loading = false this.loading = false
}) })
}, },
showTagDialog () { showTagDialog() {
this.selectedTag = this.queryTag this.selectedTag = this.queryTag
this.tagDialogType = { this.tagDialogType = {
title: '选择标签', title: '选择标签',
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
this.dialogVisible = true this.dialogVisible = true
// this.$refs.selectTag.$forceUpdate() // this.$refs.selectTag.$forceUpdate()
}, },
makeTag (data) { makeTag(data) {
this.makeLabelCustomerList = data || this.ids this.makeLabelCustomerList = data || this.ids
this.tagDialogType.type = '' this.tagDialogType.type = ''
let curTags = [] let curTags = []
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
this.selectedTag = curTags this.selectedTag = curTags
this.dialogVisible = true this.dialogVisible = true
}, },
submitSelectTag (selected) { submitSelectTag(selected) {
if (this.tagDialogType.type === 'query') { if (this.tagDialogType.type === 'query') {
this.queryTag = selected this.queryTag = selected
this.dialogVisible = false this.dialogVisible = false
...@@ -130,14 +130,14 @@ ...@@ -130,14 +130,14 @@
} }
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery () { resetQuery() {
this.dateRange = [] this.dateRange = []
this.queryTag = [] this.queryTag = []
this.queryUser = [] this.queryUser = []
this.$refs['queryForm'].resetFields() this.$refs['queryForm'].resetFields()
this.getList(1) this.getList(1)
}, },
sync () { sync() {
// const loading = this.$loading({ // const loading = this.$loading({
// lock: true, // lock: true,
// text: 'Loading', // text: 'Loading',
...@@ -151,7 +151,7 @@ ...@@ -151,7 +151,7 @@
}) })
}, },
// 多选框选中数据 // 多选框选中数据
handleSelectionChange (selection) { handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id) this.ids = selection.map((item) => item.id)
this.multiple = !selection.length this.multiple = !selection.length
} }
...@@ -179,10 +179,10 @@ ...@@ -179,10 +179,10 @@
<div class=""> <div class="">
<el-form :model="query" ref="queryForm" :inline="true" class="top-search" label-width="80px"> <el-form :model="query" ref="queryForm" :inline="true" class="top-search" label-width="80px">
<el-form-item label="群名" prop="groupName"> <el-form-item label="群名" prop="groupName">
<el-input v-model="query.groupName" placeholder="请输入群名" clearable /> <el-input clearable v-model="query.groupName" placeholder="请输入群名" clearable />
</el-form-item> </el-form-item>
<el-form-item label="群主" prop="groupLeaderName"> <el-form-item label="群主" prop="groupLeaderName">
<el-input v-model="query.groupLeaderName" placeholder="请输入群主" clearable /> <el-input clearable v-model="query.groupLeaderName" placeholder="请输入群主" clearable />
</el-form-item> </el-form-item>
<el-form-item label="群标签"> <el-form-item label="群标签">
<div class="tag-input" @click="showTagDialog"> <div class="tag-input" @click="showTagDialog">
...@@ -193,7 +193,16 @@ ...@@ -193,7 +193,16 @@
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="创建日期"> <el-form-item label="创建日期">
<el-date-picker v-model="dateRange" value-format="yyyy-MM-dd" type="daterange" :picker-options="pickerOptions" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker> <el-date-picker
clearable
v-model="dateRange"
value-format="yyyy-MM-dd"
type="daterange"
:picker-options="pickerOptions"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label=" "> <el-form-item label=" ">
<!-- v-hasPermi="['customerManage:group:query']" --> <!-- v-hasPermi="['customerManage:group:query']" -->
...@@ -252,12 +261,16 @@ ...@@ -252,12 +261,16 @@
<el-table-column label="创建时间" align="center" prop="createTime" width="180"></el-table-column> <el-table-column label="创建时间" align="center" prop="createTime" width="180"></el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click=" <el-button
type="text"
@click="
$router.push({ $router.push({
path: 'groupDetail', path: 'groupDetail',
query: { chatId: scope.row.chatId } query: { chatId: scope.row.chatId }
}) })
">查看详情</el-button> "
>查看详情</el-button
>
<!-- v-hasPermi="['customerManage:group:view']" --> <!-- v-hasPermi="['customerManage:group:view']" -->
<el-button type="text" @click="makeTag(scope.row)">标签管理</el-button> <el-button type="text" @click="makeTag(scope.row)">标签管理</el-button>
<!-- v-hasPermi="['customerManage/customer:makeTag']" --> <!-- v-hasPermi="['customerManage/customer:makeTag']" -->
...@@ -265,10 +278,23 @@ ...@@ -265,10 +278,23 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination v-show="total > 0" :total="total" :page.sync="query.pageNum" :limit.sync="query.pageSize" @pagination="getList()" /> <pagination
v-show="total > 0"
:total="total"
:page.sync="query.pageNum"
:limit.sync="query.pageSize"
@pagination="getList()"
/>
<!-- 选择标签弹窗 --> <!-- 选择标签弹窗 -->
<SelectTag ref="selectTag" :visible.sync="dialogVisible" type="2" :title="tagDialogType.title" :defaultValues="selectedTag" @success="submitSelectTag"> <SelectTag
ref="selectTag"
:visible.sync="dialogVisible"
type="2"
:title="tagDialogType.title"
:defaultValues="selectedTag"
@success="submitSelectTag"
>
</SelectTag> </SelectTag>
</div> </div>
</template> </template>
......
<script> <script>
import { getListNew, exportCustomer, lossRemind, getLossRemindStatus } from '@/api/customer' import { getListNew, exportCustomer, lossRemind, getLossRemindStatus } from '@/api/customer'
// import { getList as getListTag } from '@/api/customer/tag' // import { getList as getListTag } from '@/api/customer/tag'
// import { getList as getListOrganization } from '@/api/organization' // import { getList as getListOrganization } from '@/api/organization'
import SelectUser from '@/components/SelectUser' import SelectUser from '@/components/SelectUser'
import SelectTag from '@/components/SelectTag' import SelectTag from '@/components/SelectTag'
export default { export default {
name: 'LossRemind', name: 'LossRemind',
components: { SelectUser, SelectTag }, components: { SelectUser, SelectTag },
props: {}, props: {},
data() { data() {
return { return {
query: { query: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
name: '', // "客户名称", name: '', // "客户名称",
userIds: '', // "添加人id", userIds: '', // "添加人id",
tagIds: '', // "标签id,多个标签,id使用逗号隔开", tagIds: '', // "标签id,多个标签,id使用逗号隔开",
beginTime: '', // "开始时间", beginTime: '', // "开始时间",
endTime: '', // "结束时间" endTime: '', // "结束时间"
trackState:5 trackState: 5
}, },
queryTag: [], // 搜索框选择的标签 queryTag: [], // 搜索框选择的标签
queryUser: [], // 搜索框选择的添加人 queryUser: [], // 搜索框选择的添加人
dateRange: [], // 添加日期 dateRange: [], // 添加日期
loading: false, loading: false,
isMoreFilter: false, isMoreFilter: false,
total: 0, total: 0,
// 添加标签表单 // 添加标签表单
form: { form: {
gourpName: '', gourpName: '',
weTags: [] weTags: []
}, },
list: [], // 客户列表 list: [], // 客户列表
listOrganization: [], // 组织架构列表 listOrganization: [], // 组织架构列表
multipleSelection: [], // 多选数组 multipleSelection: [], // 多选数组
dialogVisible: false, // 选择标签弹窗显隐 dialogVisible: false, // 选择标签弹窗显隐
dialogVisibleSelectUser: false, // 选择添加人弹窗显隐 dialogVisibleSelectUser: false, // 选择添加人弹窗显隐
selectedGroup: '', // 选择的标签分组 selectedGroup: '', // 选择的标签分组
selectedTag: [], // 选择的标签 selectedTag: [], // 选择的标签
removeTag: [], // 可移除的标签 removeTag: [], // 可移除的标签
tagDialogType: { tagDialogType: {
title: '', // 选择标签弹窗标题 title: '', // 选择标签弹窗标题
type: '' // 弹窗类型 type: '' // 弹窗类型
}, },
isNotice: '0' isNotice: '0'
} }
}, },
watch: {}, watch: {},
computed: {}, computed: {},
created() { created() {
this.getList() this.getList()
// this.getListTag() // this.getListTag()
// this.getListOrganization() // this.getListOrganization()
this.getLossRemindStatus() this.getLossRemindStatus()
this.$store.dispatch( this.$store.dispatch(
'app/setBusininessDesc', 'app/setBusininessDesc',
` `
<div>当企业成员被客户删除时,会在流失列表中产生一条记录,开启删除通知后,被删除的成员会收到一条推送</div> <div>当企业成员被客户删除时,会在流失列表中产生一条记录,开启删除通知后,被删除的成员会收到一条推送</div>
` `
) )
}, },
mounted() {}, mounted() {},
methods: { methods: {
getList(page) { getList(page) {
// console.log(this.dateRange); // console.log(this.dateRange);
if (this.dateRange) { if (this.dateRange) {
this.query.beginTime = this.dateRange[0] this.query.beginTime = this.dateRange[0]
this.query.endTime = this.dateRange[1] this.query.endTime = this.dateRange[1]
} else { } else {
this.query.beginTime = '' this.query.beginTime = ''
this.query.endTime = '' this.query.endTime = ''
} }
page && (this.query.pageNum = page) page && (this.query.pageNum = page)
this.loading = true this.loading = true
getListNew(this.query) getListNew(this.query)
.then(({ rows, total }) => { .then(({ rows, total }) => {
this.list = rows this.list = rows
this.total = +total this.total = +total
this.loading = false this.loading = false
this.multipleSelection = [] this.multipleSelection = []
})
.catch(() => {
this.loading = false
})
},
// getListTag() {
// getListTag().then(({ rows }) => {
// this.listTagOneArray = []
// rows.forEach((element) => {
// element.weTags.forEach((d) => {
// this.listTagOneArray.push(d)
// })
// })
// })
// },
// getListOrganization() {
// getListOrganization().then(({ rows }) => {
// this.listOrganization = Object.freeze(rows)
// })
// },
getLossRemindStatus() {
getLossRemindStatus().then(({ data }) => {
this.isNotice = data
}) })
.catch(() => { },
this.loading = false showTagDialog() {
this.selectedTag = this.queryTag
this.tagDialogType = {
title: '选择标签',
type: '1'
}
this.dialogVisible = true
},
// /** 导出按钮操作 */
// exportCustomer() {
// const queryParams = this.query
// this.$confirm('是否确认导出所有客户数据项?', '警告', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// type: 'warning'
// })
// .then(function() {
// return exportCustomer(queryParams)
// })
// .then((response) => {
// this.download(response.msg)
// })
// .catch(function() {})
// },
selectedUser(list) {
this.queryUser = list
this.query.userIds = list.map((d) => d.userId) + ''
},
submitSelectTag(selected) {
if (this.tagDialogType.type === '1') {
this.query.tagIds = selected.map((d) => d.tagId) + ''
// debugger;
this.queryTag = selected
this.dialogVisible = false
}
},
resetForm() {
this.dateRange = []
this.queryTag = []
this.queryUser = []
this.$refs['queryForm'].resetFields()
this.getList(1)
},
// 多选框选中数据
handleSelectionChange(selection) {
this.multipleSelection = selection
},
// 流失提醒开关事件
remindSwitch(val) {
lossRemind(val).then(() => {
this.msgSuccess('操作成功')
}) })
},
// getListTag() {
// getListTag().then(({ rows }) => {
// this.listTagOneArray = []
// rows.forEach((element) => {
// element.weTags.forEach((d) => {
// this.listTagOneArray.push(d)
// })
// })
// })
// },
// getListOrganization() {
// getListOrganization().then(({ rows }) => {
// this.listOrganization = Object.freeze(rows)
// })
// },
getLossRemindStatus() {
getLossRemindStatus().then(({ data }) => {
this.isNotice = data
})
},
showTagDialog() {
this.selectedTag = this.queryTag
this.tagDialogType = {
title: '选择标签',
type: '1'
}
this.dialogVisible = true
},
// /** 导出按钮操作 */
// exportCustomer() {
// const queryParams = this.query
// this.$confirm('是否确认导出所有客户数据项?', '警告', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// type: 'warning'
// })
// .then(function() {
// return exportCustomer(queryParams)
// })
// .then((response) => {
// this.download(response.msg)
// })
// .catch(function() {})
// },
selectedUser(list) {
this.queryUser = list
this.query.userIds = list.map((d) => d.userId) + ''
},
submitSelectTag(selected) {
if (this.tagDialogType.type === '1') {
this.query.tagIds = selected.map((d) => d.tagId) + ''
// debugger;
this.queryTag = selected
this.dialogVisible = false
} }
},
resetForm() {
this.dateRange = []
this.queryTag = []
this.queryUser = []
this.$refs['queryForm'].resetFields()
this.getList(1)
},
// 多选框选中数据
handleSelectionChange(selection) {
this.multipleSelection = selection
},
// 流失提醒开关事件
remindSwitch(val) {
lossRemind(val).then(() => {
this.msgSuccess('操作成功')
})
} }
} }
}
</script> </script>
<template> <template>
<div> <div>
<el-form <el-form ref="queryForm" :inline="true" :model="query" label-width="100px" class="top-search" size="small">
ref="queryForm"
:inline="true"
:model="query"
label-width="100px"
class="top-search"
size="small"
>
<el-form-item label="客户名称" prop="name"> <el-form-item label="客户名称" prop="name">
<el-input v-model="query.name" placeholder="请输入"></el-input> <el-input clearable v-model="query.name" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="添加人"> <el-form-item label="添加人">
<div class="tag-input" @click="dialogVisibleSelectUser = true"> <div class="tag-input" @click="dialogVisibleSelectUser = true">
<span class="tag-place" v-if="!queryUser.length">请选择</span> <span class="tag-place" v-if="!queryUser.length">请选择</span>
<template v-else> <template v-else>
<el-tag type="info" v-for="(unit, unique) in queryUser" :key="unique">{{ <el-tag type="info" v-for="(unit, unique) in queryUser" :key="unique">{{ unit.name }}</el-tag>
unit.name
}}</el-tag>
</template> </template>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="添加日期"> <el-form-item label="添加日期">
<el-date-picker <el-date-picker
clearable
v-model="dateRange" v-model="dateRange"
type="daterange" type="daterange"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
...@@ -202,23 +194,15 @@ export default { ...@@ -202,23 +194,15 @@ export default {
<div class="tag-input" @click="showTagDialog"> <div class="tag-input" @click="showTagDialog">
<span class="tag-place" v-if="!queryTag.length">请选择</span> <span class="tag-place" v-if="!queryTag.length">请选择</span>
<template v-else> <template v-else>
<el-tag type="info" v-for="(unit, unique) in queryTag" :key="unique">{{ <el-tag type="info" v-for="(unit, unique) in queryTag" :key="unique">{{ unit.name }}</el-tag>
unit.name
}}</el-tag>
</template> </template>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label=" "> <el-form-item label=" ">
<!-- v-hasPermi="['customerManage:customer:query']" --> <!-- v-hasPermi="['customerManage:customer:query']" -->
<el-button type="primary" @click="getList(1)" <el-button type="primary" @click="getList(1)">查询</el-button>
>查询</el-button <!-- v-hasPermi="['customerManage:customer:query']" -->
> <el-button type="success" @click="resetForm()">重置</el-button>
<!-- v-hasPermi="['customerManage:customer:query']" -->
<el-button
type="success"
@click="resetForm()"
>重置</el-button
>
<!-- <el-button <!-- <el-button
v-hasPermi="['customerManage:customer:export']" v-hasPermi="['customerManage:customer:export']"
type="info" type="info"
...@@ -241,8 +225,7 @@ export default { ...@@ -241,8 +225,7 @@ export default {
@change="remindSwitch" @change="remindSwitch"
></el-switch> ></el-switch>
</div> </div>
<!-- v-hasPermi="['customerManage/customer:makeTag']" --> <!-- v-hasPermi="['customerManage/customer:makeTag']" -->
</div> </div>
<el-table <el-table
...@@ -250,7 +233,7 @@ export default { ...@@ -250,7 +233,7 @@ export default {
ref="multipleTable" ref="multipleTable"
:data="list" :data="list"
tooltip-effect="dark" tooltip-effect="dark"
style="width: 100%" style="width: 100%;"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<!-- <el-table-column type="selection" align="center" width="55"></el-table-column> --> <!-- <el-table-column type="selection" align="center" width="55"></el-table-column> -->
...@@ -272,9 +255,7 @@ export default { ...@@ -272,9 +255,7 @@ export default {
</el-table-column> </el-table-column>
<el-table-column prop="address" label="标签" align="center"> <el-table-column prop="address" label="标签" align="center">
<template slot-scope="{ row }" v-if="row.tagNames"> <template slot-scope="{ row }" v-if="row.tagNames">
<el-tag type="info" v-for="(unit, unique) in row.tagNames.split(',')" :key="unique">{{ <el-tag type="info" v-for="(unit, unique) in row.tagNames.split(',')" :key="unique">{{ unit }}</el-tag>
unit
}}</el-tag>
<!-- <div v-for="(item, index) in row.weFlowerCustomerRels" :key="index"> <!-- <div v-for="(item, index) in row.weFlowerCustomerRels" :key="index">
<el-tag type="info" v-for="(unit, unique) in item.weFlowerCustomerTagRels" :key="unique">{{ <el-tag type="info" v-for="(unit, unique) in item.weFlowerCustomerTagRels" :key="unique">{{
...@@ -285,7 +266,7 @@ export default { ...@@ -285,7 +266,7 @@ export default {
</el-table-column> </el-table-column>
<el-table-column label="操作" width="100"> <el-table-column label="操作" width="100">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<!-- v-hasPermi="['customerManage:customer:view']" --> <!-- v-hasPermi="['customerManage:customer:view']" -->
<el-button <el-button
@click=" @click="
...@@ -293,7 +274,7 @@ export default { ...@@ -293,7 +274,7 @@ export default {
path: 'customerDetail', path: 'customerDetail',
query: { query: {
externalUserid: row.externalUserid, externalUserid: row.externalUserid,
userId: row.firstUserId, userId: row.firstUserId
} }
}) })
" "
...@@ -325,27 +306,23 @@ export default { ...@@ -325,27 +306,23 @@ export default {
</SelectTag> </SelectTag>
<!-- 选择添加人弹窗 --> <!-- 选择添加人弹窗 -->
<SelectUser <SelectUser :visible.sync="dialogVisibleSelectUser" title="选择添加人" @success="selectedUser"></SelectUser>
:visible.sync="dialogVisibleSelectUser"
title="选择添加人"
@success="selectedUser"
></SelectUser>
</div> </div>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-icon-s-custom { .el-icon-s-custom {
font-size: 16px; font-size: 16px;
margin-left: 4px; margin-left: 4px;
color: #999; color: #999;
&.man { &.man {
color: #13a2e8; color: #13a2e8;
}
&.woman {
color: #f753b2;
}
} }
&.woman { .bfc-d + .bfc-d .el-checkbox:first-child {
color: #f753b2; margin-left: 10px;
} }
}
.bfc-d + .bfc-d .el-checkbox:first-child {
margin-left: 10px;
}
</style> </style>
<script> <script>
import { getList } from '@/api/customer/group' import { getList } from '@/api/customer/group'
export default { export default {
props: { props: {
customerGroupId: { customerGroupId: {
type: String, type: String,
default: '' default: ''
}
},
data() {
return {
query: {
groupLeader: '',
groupName: '',
beginTime: '',
endTime: '',
pageNum: 1,
pageSize: 10
},
searchDate: '', // 查询日期
loading: false, // 加载状态
total: 0, // 总数据量
customerGroups: [], // 客户群数据
currentRow: null, // 当前选中行
}
},
watch: {
searchDate(dateRange) {
if (!dateRange || dateRange.length !== 2) {
this.query.beginTime = ''
this.query.endTime = ''
} else {
;[this.query.beginTime, this.query.endTime] = dateRange
} }
}
},
created() {
this.getList()
},
methods: {
// 获取客户群数据
getList() {
const params = Object.assign({}, this.query)
this.loading = true
getList(params)
.then((res) => {
this.customerGroups = res.rows
this.total = parseInt(res.total)
for (let group of this.customerGroups) {
if (group.chatId === this.customerGroupId) this.currentRow = group
}
this.loading = false
})
.catch(() => {
this.loading = false
})
}, },
// 单选变更 data() {
handleSelectionChange(val) { return {
this.currentRow = val query: {
groupLeader: '',
groupName: '',
beginTime: '',
endTime: '',
pageNum: 1,
pageSize: 10
},
searchDate: '', // 查询日期
loading: false, // 加载状态
total: 0, // 总数据量
customerGroups: [], // 客户群数据
currentRow: null // 当前选中行
}
}, },
resetQuery() { watch: {
this.searchDate = [] searchDate(dateRange) {
this.$refs['queryForm'].resetFields() if (!dateRange || dateRange.length !== 2) {
this.query.beginTime = ''
this.$nextTick(() => { this.query.endTime = ''
this.getList() } else {
}) ;[this.query.beginTime, this.query.endTime] = dateRange
}
}
},
created() {
this.getList()
}, },
submit() { methods: {
this.$emit('callback', this.currentRow) // 获取客户群数据
getList() {
const params = Object.assign({}, this.query)
this.loading = true
getList(params)
.then((res) => {
this.customerGroups = res.rows
this.total = parseInt(res.total)
for (let group of this.customerGroups) {
if (group.chatId === this.customerGroupId) this.currentRow = group
}
this.loading = false
})
.catch(() => {
this.loading = false
})
},
// 单选变更
handleSelectionChange(val) {
this.currentRow = val
},
resetQuery() {
this.searchDate = []
this.$refs['queryForm'].resetFields()
this.$nextTick(() => {
this.getList()
})
},
submit() {
this.$emit('callback', this.currentRow)
}
} }
} }
}
</script> </script>
<template> <template>
<div> <div>
<el-form <el-form ref="queryForm" :model="query" :inline="true" class="top-search" label-width="100px">
ref="queryForm"
:model="query"
:inline="true"
class="top-search"
label-width="100px"
>
<el-form-item label="群名" prop="groupName"> <el-form-item label="群名" prop="groupName">
<el-input v-model="query.groupName" placeholder="请输入群名"></el-input> <el-input clearable v-model="query.groupName" placeholder="请输入群名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="群主" prop="groupLeader"> <el-form-item label="群主" prop="groupLeader">
<el-input v-model="query.groupLeader" placeholder="请输入群主"></el-input> <el-input clearable v-model="query.groupLeader" placeholder="请输入群主"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建时间"> <el-form-item label="创建时间">
<el-date-picker <el-date-picker
clearable
v-model="searchDate" v-model="searchDate"
format="yyyy-MM-dd" format="yyyy-MM-dd"
value-format="yyyyMMdd" value-format="yyyyMMdd"
...@@ -109,40 +104,16 @@ export default { ...@@ -109,40 +104,16 @@ export default {
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table :data="customerGroups" v-loading="loading" highlight-current-row @current-change="handleSelectionChange">
:data="customerGroups" <el-table-column width="55" align="center">
v-loading="loading"
highlight-current-row
@current-change="handleSelectionChange"
>
<el-table-column
width="55"
align="center"
>
<template #default="{ row }"> <template #default="{ row }">
<el-checkbox :value="currentRow && row.chatId === currentRow.chatId"></el-checkbox> <el-checkbox :value="currentRow && row.chatId === currentRow.chatId"></el-checkbox>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="groupName" label="群名" align="center"></el-table-column>
prop="groupName" <el-table-column prop="memberNum" label="群人数" align="center"></el-table-column>
label="群名" <el-table-column prop="groupLeaderName" label="群主" align="center"></el-table-column>
align="center" <el-table-column prop="createTime" label="创建时间" align="center"></el-table-column>
></el-table-column>
<el-table-column
prop="memberNum"
label="群人数"
align="center"
></el-table-column>
<el-table-column
prop="groupLeaderName"
label="群主"
align="center"
></el-table-column>
<el-table-column
prop="createTime"
label="创建时间"
align="center"
></el-table-column>
</el-table> </el-table>
<pagination <pagination
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="g-card g-pad20"> <div class="g-card g-pad20">
<el-form ref="queryForm" :model="query" inline class="top-search" label-position="left" label-width="80px"> <el-form ref="queryForm" :model="query" inline class="top-search" label-position="left" label-width="80px">
<el-form-item label="活码名称" prop="activityName"> <el-form-item label="活码名称" prop="activityName">
<el-input v-model="query.activityName" placeholder="请输入活码名称"></el-input> <el-input clearable v-model="query.activityName" placeholder="请输入活码名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="客群标签" prop="tagIds"> <el-form-item label="客群标签" prop="tagIds">
<el-input :value="tagNames" readonly @focus="showSelectTag = true" placeholder="请选择客群标签" /> <el-input :value="tagNames" readonly @focus="showSelectTag = true" placeholder="请选择客群标签" />
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
@keyup.enter.native="getList(1)" /> @keyup.enter.native="getList(1)" />
</el-form-item> </el-form-item>
<el-form-item label="添加状态" prop="addState"> <el-form-item label="添加状态" prop="addState">
<el-select v-model="query.addState"> <el-select clearable v-model="query.addState">
<el-option label="待添加" :value="0"></el-option> <el-option label="待添加" :value="0"></el-option>
<el-option label="已添加" :value="1"></el-option> <el-option label="已添加" :value="1"></el-option>
<!-- <el-option label="待通过" :value="3"> <!-- <el-option label="待通过" :value="3">
......
...@@ -2,24 +2,44 @@ ...@@ -2,24 +2,44 @@
<div> <div>
<el-form label-width="120px" label-position="right" ref="form" :rules="rule" :model="form"> <el-form label-width="120px" label-position="right" ref="form" :rules="rule" :model="form">
<div class="g-card g-pad20"> <div class="g-card g-pad20">
<div class="card-title" style="display:inline-block;">基础信息</div> <div class="card-title" style="display: inline-block;">基础信息</div>
<div style="float:right;" v-if="isDetail"> <div style="float: right;" v-if="isDetail">
<el-button type="primary" size="mini" @click=" <el-button
$router.push({ type="primary"
path: 'add', size="mini"
query: { @click="
id: $route.query.id, $router.push({
obj: encodeURIComponent(JSON.stringify(form)), path: 'add',
}, query: {
})">编辑</el-button> id: $route.query.id,
obj: encodeURIComponent(JSON.stringify(form))
}
})
"
>编辑</el-button
>
</div> </div>
<el-form-item label="门店名称" prop="storeName"> <el-form-item label="门店名称" prop="storeName">
<el-input :disabled="isDetail" v-model="form.storeName" placeholder="请输入门店名称" style="width: 400px;" show-word-limit maxlength="30" /> <el-input
:disabled="isDetail"
v-model="form.storeName"
placeholder="请输入门店名称"
style="width: 400px;"
show-word-limit
maxlength="30"
/>
</el-form-item> </el-form-item>
<el-form-item label="所属地区" prop="area"> <el-form-item label="所属地区" prop="area">
<el-cascader :disabled="isDetail" v-model="areaArray" :props="props" :options="cityTree" ref="tree" @change="handleTree"></el-cascader> <el-cascader
:disabled="isDetail"
v-model="areaArray"
:props="props"
:options="cityTree"
ref="tree"
@change="handleTree"
></el-cascader>
</el-form-item> </el-form-item>
<baidu-map @update="handleChange" :isDetail="isDetail" :initData="form"></baidu-map> <baidu-map @update="handleChange" @point="getPoint" :isDetail="isDetail" :initData="form"></baidu-map>
</div> </div>
<div class="g-card g-pad20"> <div class="g-card g-pad20">
<div class="card-title"> <div class="card-title">
...@@ -29,25 +49,51 @@ ...@@ -29,25 +49,51 @@
<div v-if="selectedUserList.length > 0"> <div v-if="selectedUserList.length > 0">
<el-tag size="medium" v-for="(item, index) in selectedUserList" :key="index">{{ item.name }}</el-tag> <el-tag size="medium" v-for="(item, index) in selectedUserList" :key="index">{{ item.name }}</el-tag>
</div> </div>
<el-button v-if="!isDetail" icon="el-icon-plus" type="primary" plain size="mini" @click="onSelectUser">{{selectedUserList.length ? '编辑':'选择'}}导购</el-button> <el-button v-if="!isDetail" icon="el-icon-plus" type="primary" plain size="mini" @click="onSelectUser"
>{{ selectedUserList.length ? '编辑' : '选择' }}导购</el-button
>
</el-form-item> </el-form-item>
<el-form-item label="门店群活码"> <el-form-item label="门店群活码">
<template> <template>
<div v-if="form.groupCodeUrl"> <div v-if="form.groupCodeUrl">
<div>{{form.groupCodeName}}</div> <div>{{ form.groupCodeName }}</div>
<img style="height: 80px;width: 80px;margin-top: 5px;" :src="form.groupCodeUrl" /> <img style="height: 80px; width: 80px; margin-top: 5px;" :src="form.groupCodeUrl" />
</div> </div>
</template> </template>
<template> <template>
<el-button v-if="!isDetail" icon="el-icon-plus" type="primary" plain size="mini" @click="dialogVisibleSelectQrCode = true">{{form.groupCodeUrl ? '编辑':'选择'}}群活码</el-button> <el-button
v-if="!isDetail"
icon="el-icon-plus"
type="primary"
plain
size="mini"
@click="dialogVisibleSelectQrCode = true"
>{{ form.groupCodeUrl ? '编辑' : '选择' }}群活码</el-button
>
</template> </template>
</el-form-item> </el-form-item>
<el-form-item label="门店状态"> <el-form-item label="门店状态">
<template v-if="!isDetail"> <template v-if="!isDetail">
<el-switch size="mini" :disabled="!form.groupCodeUrl && !form.shopGuideId" v-model="form.storeState" active-text="启用" inactive-text='停用' :active-value=0 :inactive-value=1></el-switch> <el-switch
size="mini"
:disabled="!form.groupCodeUrl && !form.shopGuideId"
v-model="form.storeState"
active-text="启用"
inactive-text="停用"
:active-value="0"
:inactive-value="1"
></el-switch>
</template> </template>
<template v-else> <template v-else>
<el-switch size="mini" disabled v-model="form.storeState" active-text="启用" inactive-text='停用' :active-value=0 :inactive-value=1></el-switch> <el-switch
size="mini"
disabled
v-model="form.storeState"
active-text="启用"
inactive-text="停用"
:active-value="0"
:inactive-value="1"
></el-switch>
</template> </template>
</el-form-item> </el-form-item>
</div> </div>
...@@ -56,10 +102,20 @@ ...@@ -56,10 +102,20 @@
<el-button type="primary" @click="submitFn" :loading="submitLoading" :disabled="submitLoading">确定</el-button> <el-button type="primary" @click="submitFn" :loading="submitLoading" :disabled="submitLoading">确定</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<SelectWeUser key="123" :visible.sync="dialogVisibleSelectUser" title="选择导购" :isOnlyLeaf="true" :defaultValues="selectedUserList" @success="selectedUser"></SelectWeUser> <SelectWeUser
<SelectQrCode :visible.sync="dialogVisibleSelectQrCode" @success="selectedQrCode" :selected="selectedCodeList"></SelectQrCode> key="123"
:visible.sync="dialogVisibleSelectUser"
title="选择导购"
:isOnlyLeaf="true"
:defaultValues="selectedUserList"
@success="selectedUser"
></SelectWeUser>
<SelectQrCode
:visible.sync="dialogVisibleSelectQrCode"
@success="selectedQrCode"
:selected="selectedCodeList"
></SelectQrCode>
</div> </div>
</template> </template>
<script> <script>
import BaiduMap from '@/components/common/BaiduMap' import BaiduMap from '@/components/common/BaiduMap'
...@@ -67,10 +123,10 @@ ...@@ -67,10 +123,10 @@
import SelectWeUser from '@/components/SelectWeUser' import SelectWeUser from '@/components/SelectWeUser'
import { getProCityList } from '@/api/common' import { getProCityList } from '@/api/common'
import { addOrUpdateStore, storeDetail } from "@/api/drainageCode/store" import { addOrUpdateStore, storeDetail } from '@/api/drainageCode/store'
export default { export default {
name: 'store-add', name: 'store-add',
data () { data() {
return { return {
areaArray: [], areaArray: [],
current: { current: {
...@@ -105,15 +161,9 @@ ...@@ -105,15 +161,9 @@
value: 'name' value: 'name'
}, },
rule: { rule: {
storeName: [ storeName: [{ required: true, message: '请输入门店名称', trigger: 'blur' }],
{ required: true, message: '请输入门店名称', trigger: 'blur' } area: [{ required: true, message: '请选择所属地区', trigger: 'blur' }],
], address: [{ required: true, message: '请选择详细地址', trigger: 'blur' }]
area: [
{ required: true, message: '请选择所属地区', trigger: 'blur' }
],
address: [
{ required: true, message: '请选择详细地址', trigger: 'blur' }
]
} }
} }
}, },
...@@ -129,35 +179,39 @@ ...@@ -129,35 +179,39 @@
SelectWeUser SelectWeUser
}, },
methods: { methods: {
handleChange (data) { getPoint(addrPoint) {
this.form.longitude = addrPoint.lng.toString()
this.form.latitude = addrPoint.lat.toString()
},
handleChange(data) {
if (data.address) { if (data.address) {
this.form.address = data.address this.form.address = data.address
this.form.area = data.province + data.city + data.area this.form.area = data.province + data.city + data.area
if (data.province) { if (data.province) {
this.areaArray =[data.province, data.city, data.area] this.areaArray = [data.province, data.city, data.area]
} }
this.form.longitude = data.addrPoint.lng.toString() this.form.longitude = data.addrPoint.lng.toString()
this.form.latitude = data.addrPoint.lat.toString() this.form.latitude = data.addrPoint.lat.toString()
} }
}, },
handleTree (data) { handleTree(data) {
this.form.area = this.areaArray.join('') this.form.area = this.areaArray.join('')
}, },
selectedUser (data) { selectedUser(data) {
this.selectedUserList = data this.selectedUserList = data
let ids = [] let ids = []
let names = [] let names = []
data.forEach(dd => { data.forEach((dd) => {
ids.push(dd.userId) ids.push(dd.userId)
names.push(dd.name) names.push(dd.name)
}) })
this.form.shopGuideId = ids.join(',') this.form.shopGuideId = ids.join(',')
this.form.shopGuideName = names.join(',') this.form.shopGuideName = names.join(',')
}, },
onSelectUser () { onSelectUser() {
this.dialogVisibleSelectUser = true this.dialogVisibleSelectUser = true
}, },
selectedQrCode (data) { selectedQrCode(data) {
if (data) { if (data) {
this.selectedCodeList[0] = data this.selectedCodeList[0] = data
this.form.groupCodeUrl = data.codeUrl this.form.groupCodeUrl = data.codeUrl
...@@ -165,11 +219,11 @@ ...@@ -165,11 +219,11 @@
this.form.groupCodeId = data.id this.form.groupCodeId = data.id
} }
}, },
submitFn () { submitFn() {
this.$refs['form'].validate((valitate) => { this.$refs['form'].validate((valitate) => {
if (valitate) { if (valitate) {
this.submitLoading = true this.submitLoading = true
addOrUpdateStore(this.form).then(res => { addOrUpdateStore(this.form).then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.msgSuccess('操作成功') this.msgSuccess('操作成功')
this.$router.back() this.$router.back()
...@@ -182,23 +236,23 @@ ...@@ -182,23 +236,23 @@
} }
}) })
}, },
cancelFn () { cancelFn() {
this.$confirm(`是否确认取消${this.$route.query.id ? '编辑':'新建'}?取消后不可恢复,请谨慎操作。`, '提示', { this.$confirm(`是否确认取消${this.$route.query.id ? '编辑' : '新建'}?取消后不可恢复,请谨慎操作。`, '提示', {
confirmButtonText: '确认', confirmButtonText: '确认',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning'
}) })
.then(() => { .then(() => {
this.$router.back() this.$router.back()
}) })
.catch(function () { }) .catch(function () {})
}, },
setDetail () { setDetail() {
if (this.form.groupCodeId) { if (this.form.groupCodeId) {
this.selectedCodeList[0] = { id: this.form.groupCodeId } this.selectedCodeList[0] = { id: this.form.groupCodeId }
} }
if (this.form.area) { if (this.form.area) {
let reg = /.+?(省|市|自治区|自治州|县|区|旗)/g; let reg = /.+?(省|市|自治区|自治州|县|区|旗)/g
let arr = this.form.area.match(reg) let arr = this.form.area.match(reg)
this.areaArray = arr this.areaArray = arr
} }
...@@ -215,21 +269,21 @@ ...@@ -215,21 +269,21 @@
} }
} }
}, },
created () { created() {
getProCityList().then(res => { getProCityList().then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.cityTree = res.data this.cityTree = res.data
} }
}) })
if (this.$route.query.id) { if (this.$route.query.id) {
storeDetail(this.$route.query.id).then(res => { storeDetail(this.$route.query.id).then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.form = res.data this.form = res.data
this.setDetail() this.setDetail()
} }
}) })
} }
}, }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -240,4 +294,4 @@ ...@@ -240,4 +294,4 @@
color: #333333; color: #333333;
margin-bottom: 20px; margin-bottom: 20px;
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<el-form label-position="left" inline label-width="80px"> <el-form label-position="left" inline label-width="80px">
<el-form-item label="欢迎语"> <el-form-item label="欢迎语">
<el-input placeholder="请输入欢迎语" v-model="query.welcomeMsg" style="width: 260px;"></el-input> <el-input clearable placeholder="请输入欢迎语" v-model="query.welcomeMsg" style="width: 260px;"></el-input>
</el-form-item> </el-form-item>
<el-form-item label-width="0"> <el-form-item label-width="0">
<!-- <el-button v-hasPermi="['wecom:code:list']" type="cyan" @click="getList(1)">查询</el-button> --> <!-- <el-button v-hasPermi="['wecom:code:list']" type="cyan" @click="getList(1)">查询</el-button> -->
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
</el-form-item> --> </el-form-item> -->
<el-form-item label="时间范围"> <el-form-item label="时间范围">
<el-date-picker <el-date-picker
clearable
v-model="value1" v-model="value1"
format="yyyy-MM-dd" format="yyyy-MM-dd"
@change="setTimeChange" @change="setTimeChange"
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
</el-form-item> </el-form-item>
<el-form-item label="时间范围"> <el-form-item label="时间范围">
<el-date-picker <el-date-picker
clearable
v-model="value1" v-model="value1"
format="yyyy-MM-dd" format="yyyy-MM-dd"
@change="setTimeChange" @change="setTimeChange"
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="top-search"> <div class="top-search">
<el-form inline label-position="right" :model="query" label-width="100px" ref="queryForm"> <el-form inline label-position="right" :model="query" label-width="100px" ref="queryForm">
<el-form-item label="红包状态" prop="status"> <el-form-item label="红包状态" prop="status">
<el-select v-model="query.status" placeholder="请选择"> <el-select clearable v-model="query.status" placeholder="请选择">
<el-option <el-option
v-for="(item, key) in dictStatusType" v-for="(item, key) in dictStatusType"
:key="key" :key="key"
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="发送场景" prop="sceneType"> <el-form-item label="发送场景" prop="sceneType">
<el-select v-model="query.sceneType" placeholder="请选择" size="small"> <el-select clearable v-model="query.sceneType" placeholder="请选择" size="small">
<el-option <el-option
v-for="(item, key) in dictSendSence" v-for="(item, key) in dictSendSence"
:key="key" :key="key"
......
...@@ -109,13 +109,13 @@ ...@@ -109,13 +109,13 @@
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="领取客户" prop="customerName"> <el-form-item label="领取客户" prop="customerName">
<el-input v-model="query.customerName" placeholder="请输入"></el-input> <el-input clearable v-model="query.customerName" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="发放时间"> <el-form-item label="发放时间">
<el-date-picker v-model="dateRange" value-format="yyyy-MM-dd" type="daterange" :picker-options="pickerOptions" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" align="right"></el-date-picker> <el-date-picker clearable v-model="dateRange" value-format="yyyy-MM-dd" type="daterange" :picker-options="pickerOptions" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" align="right"></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="全部类型" prop="sendState"> <el-form-item label="全部类型" prop="sendState">
<el-select v-model="query.sendState" placeholder="请选择"> <el-select clearable v-model="query.sendState" placeholder="请选择">
<el-option v-for="(item, key) in dictStatusType" :key="key" :label="item" :value="key"></el-option> <el-option v-for="(item, key) in dictStatusType" :key="key" :label="item" :value="key"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
export default { export default {
components: { CardGroupIndex }, components: { CardGroupIndex },
data () { data() {
return { return {
query: { query: {
pageNum: 1, pageNum: 1,
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
groupName: '', // 客户群名 groupName: '', // 客户群名
redEnvelopeType: '', // 1: 普通红包2:拼手气红包 redEnvelopeType: '', // 1: 普通红包2:拼手气红包
beginTime: '', // 创建开始时间 beginTime: '', // 创建开始时间
endTime: '', // 创建结束时间 endTime: '' // 创建结束时间
}, },
dateRange: [], // 添加日期 dateRange: [], // 添加日期
total: 0, // total: 0, //
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
dictStatusType: Object.freeze({ dictStatusType: Object.freeze({
0: '全部类型', 0: '全部类型',
1: '普通红包', 1: '普通红包',
2: '拼手气红包', 2: '拼手气红包'
}), }),
dialogVisible: false, dialogVisible: false,
...@@ -32,23 +32,23 @@ ...@@ -32,23 +32,23 @@
query: { query: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
chatId: '', // 群id chatId: '' // 群id
}, },
loading: false, loading: false,
total: 0, // total: 0, //
list: [], // list: [] //
}, },
dialogVisibleSelectUser: false, // 选择添加人弹窗显隐 dialogVisibleSelectUser: false, // 选择添加人弹窗显隐
queryUser: [], // 搜索框选择的添加人 queryUser: [] // 搜索框选择的添加人
} }
}, },
watch: {}, watch: {},
created () { created() {
this.getList() this.getList()
}, },
methods: { methods: {
getList (page) { getList(page) {
if (this.dateRange) { if (this.dateRange) {
;[this.query.beginTime, this.query.endTime] = this.dateRange ;[this.query.beginTime, this.query.endTime] = this.dateRange
} else { } else {
...@@ -68,17 +68,17 @@ ...@@ -68,17 +68,17 @@
}) })
}, },
// 重置查询参数 // 重置查询参数
resetQuery () { resetQuery() {
this.dateRange = [] this.dateRange = []
this.queryUser = [] this.queryUser = []
this.$refs['queryForm'].resetFields() this.$refs['queryForm'].resetFields()
this.getList(1) this.getList(1)
}, },
exportData () { exportData() {
this.$confirm('确认导出吗?', '提示', { this.$confirm('确认导出吗?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning'
}) })
.then(() => { .then(() => {
this.loading = true this.loading = true
...@@ -95,26 +95,26 @@ ...@@ -95,26 +95,26 @@
}) })
}, },
// 处理多选 // 处理多选
handleSelectionChange (val) { handleSelectionChange(val) {
this.multiSelect = val this.multiSelect = val
}, },
view (row) { view(row) {
let cardData = [ let cardData = [
{ {
title: '群主', title: '群主',
value: row.groupLeaderName, value: row.groupLeaderName,
noArrow: true, noArrow: true
}, },
{ {
title: '领取人数', title: '领取人数',
value: row.receiveNum, value: row.receiveNum,
noArrow: true, noArrow: true
}, },
{ {
title: '剩余红包个数', title: '剩余红包个数',
value: row.surplusNum, value: row.surplusNum,
noArrow: true, noArrow: true
}, }
] ]
this.cardData = cardData this.cardData = cardData
this.dialogVisible = true this.dialogVisible = true
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
this.getListGroupUser(1) this.getListGroupUser(1)
}, },
// 获取领取详情 // 获取领取详情
getListGroupUser (page) { getListGroupUser(page) {
page && (this.dialog.query.pageNum = page) page && (this.dialog.query.pageNum = page)
this.dialog.loading = true this.dialog.loading = true
getListGroupUser(this.dialog.query) getListGroupUser(this.dialog.query)
...@@ -135,8 +135,8 @@ ...@@ -135,8 +135,8 @@
.catch(() => { .catch(() => {
this.dialog.loading = false this.dialog.loading = false
}) })
}, }
}, }
} }
</script> </script>
...@@ -153,15 +153,25 @@ ...@@ -153,15 +153,25 @@
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="领取客户群" prop="groupName"> <el-form-item label="领取客户群" prop="groupName">
<el-input v-model="query.groupName" placeholder="请输入"></el-input> <el-input clearable v-model="query.groupName" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="全部类型" prop="redEnvelopeType"> <el-form-item label="全部类型" prop="redEnvelopeType">
<el-select v-model="query.redEnvelopeType" placeholder="请选择"> <el-select clearable v-model="query.redEnvelopeType" placeholder="请选择">
<el-option v-for="(item, key) in dictStatusType" :key="key" :label="item" :value="key"></el-option> <el-option v-for="(item, key) in dictStatusType" :key="key" :label="item" :value="key"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="发放时间"> <el-form-item label="发放时间">
<el-date-picker v-model="dateRange" value-format="yyyy-MM-dd" type="daterange" :picker-options="pickerOptions" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" align="right"></el-date-picker> <el-date-picker
clearable
v-model="dateRange"
value-format="yyyy-MM-dd"
type="daterange"
:picker-options="pickerOptions"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
align="right"
></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label=" "> <el-form-item label=" ">
<!-- v-hasPermi="['customerManage:customer:query']" --> <!-- v-hasPermi="['customerManage:customer:query']" -->
...@@ -172,14 +182,13 @@ ...@@ -172,14 +182,13 @@
<el-button type="success" @click="resetQuery()">重置</el-button> <el-button type="success" @click="resetQuery()">重置</el-button>
</el-form-item> </el-form-item>
<el-form-item style="float:right;"> <el-form-item style="float: right;">
<el-button type="primary" @click="exportData()">导出Excel</el-button> <el-button type="primary" @click="exportData()">导出Excel</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<div class="mid-action"> <div class="mid-action">
<div> <div>
<!-- <el-button <!-- <el-button
v-hasPermi="['customerManage:customer:export']" v-hasPermi="['customerManage:customer:export']"
...@@ -194,8 +203,7 @@ ...@@ -194,8 +203,7 @@
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
<!-- <el-table-column type="selection" width="50" align="center"></el-table-column> --> <!-- <el-table-column type="selection" width="50" align="center"></el-table-column> -->
<el-table-column label="发放员工" align="center" prop="userName" :show-overflow-tooltip="true"></el-table-column> <el-table-column label="发放员工" align="center" prop="userName" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="领取客户群" align="center" prop="groupName" width="120"> <el-table-column label="领取客户群" align="center" prop="groupName" width="120"> </el-table-column>
</el-table-column>
<el-table-column label="红包类型" align="center" prop="redEnvelopeType"> <el-table-column label="红包类型" align="center" prop="redEnvelopeType">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
...@@ -216,29 +224,44 @@ ...@@ -216,29 +224,44 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination v-show="total > 0" :total="total" :page.sync="query.pageNum" :limit.sync="query.pageSize" @pagination="getList()" /> <pagination
v-show="total > 0"
:total="total"
:page.sync="query.pageNum"
:limit.sync="query.pageSize"
@pagination="getList()"
/>
<!-- 选择使用员工弹窗 --> <!-- 选择使用员工弹窗 -->
<SelectUser :visible.sync="dialogVisibleSelectUser" title="选择添加人" :defaultValues="queryUser" @success=" <SelectUser
:visible.sync="dialogVisibleSelectUser"
title="选择添加人"
:defaultValues="queryUser"
@success="
(list) => { (list) => {
queryUser = list queryUser = list
query.userId = list.map((i) => i.userId).join() query.userId = list.map((i) => i.userId).join()
} }
"></SelectUser> "
></SelectUser>
<el-dialog title="领取详情" :visible.sync="dialogVisible" width="width"> <el-dialog title="领取详情" :visible.sync="dialogVisible" width="width">
<div> <div>
<CardGroupIndex :data="cardData"></CardGroupIndex> <CardGroupIndex :data="cardData"></CardGroupIndex>
<el-table v-loading="dialog.loading" :data="dialog.list"> <el-table v-loading="dialog.loading" :data="dialog.list">
<el-table-column label="领取客户" align="center" width="120" prop="customerName"> <el-table-column label="领取客户" align="center" width="120" prop="customerName"> </el-table-column>
</el-table-column>
<el-table-column label="领取金额(元)" align="center" prop="redEnvelopeMoney"></el-table-column> <el-table-column label="领取金额(元)" align="center" prop="redEnvelopeMoney"></el-table-column>
<el-table-column label="领取时间" align="center" prop="createTime"></el-table-column> <el-table-column label="领取时间" align="center" prop="createTime"></el-table-column>
<el-table-column label="交易订单号" align="center" prop="orderNo"></el-table-column> <el-table-column label="交易订单号" align="center" prop="orderNo"></el-table-column>
</el-table> </el-table>
<pagination :total="dialog.total" :page.sync="dialog.query.pageNum" :limit.sync="dialog.query.pageSize" @pagination="getListGroupUser()" /> <pagination
:total="dialog.total"
:page.sync="dialog.query.pageNum"
:limit.sync="dialog.query.pageSize"
@pagination="getListGroupUser()"
/>
</div> </div>
<div slot="footer"> <div slot="footer">
<el-button type="primary" @click="dialogVisible = false">确 定</el-button> <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!