Commit e69f43eb by 前端

更新欢迎语组件,筛选条件过滤,更换压缩接口

1 parent e6b4d12b
...@@ -14466,9 +14466,9 @@ ...@@ -14466,9 +14466,9 @@
} }
}, },
"word-edit": { "word-edit": {
"version": "1.0.8", "version": "1.0.9",
"resolved": "https://registry.npmmirror.com/word-edit/-/word-edit-1.0.8.tgz", "resolved": "https://registry.npmmirror.com/word-edit/-/word-edit-1.0.9.tgz",
"integrity": "sha512-MyEkcrUkZFEO5JQyXXUX0Azi4uWZ45nzwhkcdyML/CGWhZxtGGBbE/p3hgVKxVp6Q2GKMwtdIOvX+WAghmnDlA==", "integrity": "sha512-TIoRTWu6TL5RwGSVU5t6mMnjCekX42QQlP91r7PPQpoQCgtGt8sWx7p6/BoqdiwNOxB4Loyh0xLKW+LEeO5zPQ==",
"requires": { "requires": {
"@amap/amap-jsapi-loader": "^1.0.1", "@amap/amap-jsapi-loader": "^1.0.1",
"core-js": "^3.6.5", "core-js": "^3.6.5",
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
"vuedraggable": "^2.24.3", "vuedraggable": "^2.24.3",
"vuex": "^3.1.2", "vuex": "^3.1.2",
"wangeditor": "^4.7.12", "wangeditor": "^4.7.12",
"word-edit": "^1.0.8" "word-edit": "^1.0.9"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "^4.1.0", "@vue/cli-plugin-babel": "^4.1.0",
......
...@@ -117,6 +117,28 @@ const pictureUpload = params => { ...@@ -117,6 +117,28 @@ const pictureUpload = params => {
}) })
} }
const compressPicture = params => {
// params.method = '/video/compression/upload'
// params.sessionId = session
return http({
url: '/rpc-scrm-entmicro-container/picture/compression/upload',
method: 'POST',
data: params,
sign: true
})
}
const compressVideo = params => {
// params.method = '/video/compression/upload'
// params.sessionId = session
return http({
url: '/rpc-scrm-entmicro-container/video/compression/upload',
method: 'POST',
data: params,
sign: true
})
}
const querylabeltree = params => { const querylabeltree = params => {
params.method = 'scrm.api.datahub.labelgroup.queryLabelTree' params.method = 'scrm.api.datahub.labelgroup.queryLabelTree'
// params.sessionId = session // params.sessionId = session
...@@ -184,4 +206,4 @@ const getCrowdfundingOrderConfig = (params = {}) => { ...@@ -184,4 +206,4 @@ const getCrowdfundingOrderConfig = (params = {}) => {
}) })
} }
export default { getMerchantGoodsListApi, getGoodsListApi, uploadImgApi, uploadMusicApi, uploadVideoApi, uploadFundingVideoApi, getMerchantList, getSimpleMerchantList, getZoneListApi, getClassifyListApi, pictureUpload, querylabeltree, getCrowdTreeListApi, getStaffFollowerListApi, getMerchantInfoApi, getSuperMerchantApi, getCrowdfundingOrderConfig } export default { getMerchantGoodsListApi, getGoodsListApi, uploadImgApi, uploadMusicApi, uploadVideoApi, uploadFundingVideoApi, getMerchantList, getSimpleMerchantList, getZoneListApi, getClassifyListApi, pictureUpload, querylabeltree, getCrowdTreeListApi, getStaffFollowerListApi, getMerchantInfoApi, getSuperMerchantApi, getCrowdfundingOrderConfig,compressPicture,compressVideo }
...@@ -26,27 +26,31 @@ ...@@ -26,27 +26,31 @@
</el-tag> </el-tag>
</div> </div>
</div> </div>
</el-form-item>
<el-form-item label="可见的客户:" prop="visibleCustomer">
<el-radio-group v-model="basicForm.visibleCustomer">
<el-radio :label="1">全部客户</el-radio>
<el-radio :label="2">筛选客户</el-radio>
</el-radio-group>
<div v-show="basicForm.visibleCustomer =='1'">
<div class="filter-footer"> <div class="filter-footer">
<!-- <span>将消息发送给客户符合条件的客户</span> --> <!-- <span>将消息发送给客户符合条件的客户</span> -->
<div class="filter-number"> <div class="filter-number">
查看客户数 查看客户数
<el-button type="text" v-show="isUpdate" :loading="viewLoading" @click="viewMembers">查看 <el-button type="text" v-show="isUpdate" :loading="viewLoading" @click="viewMembers('all')">查看
</el-button> </el-button>
<!-- <span v-show="isUpdate" @click="viewMembers">查看</span> -->
<span v-show="!isUpdate">{{ groupNumber }}</span> <span v-show="!isUpdate">{{ groupNumber }}</span>
</div> </div>
</div> </div>
</el-form-item> </div>
<el-form-item label="可见的客户:" prop="visibleCustomer">
<el-radio-group v-model="basicForm.visibleCustomer">
<el-radio :label="1">全部客户</el-radio>
<el-radio :label="2">筛选客户</el-radio>
</el-radio-group>
<div v-show="basicForm.visibleCustomer =='2'"> <div v-show="basicForm.visibleCustomer =='2'">
<el-button <el-button
v-show="customerDataList.length == 0 ||customerDataList.every(item => item.labelList.length == 0)" v-show="customerDataList.length == 0 ||customerDataList.every(item => item.labelList.length == 0)"
class="screeningCustomers default-blue-btn el-icon-plus m-t-10" size="small" class="screeningCustomers default-blue-btn el-icon-plus m-t-10" size="small"
@click="handleSelectCustomer()"> 去选择 @click="viewMembers()"> 去选择
</el-button> </el-button>
<div <div
v-show="customerDataList.length != 0 && customerDataList.some(item => item.labelList.length !== 0)"> v-show="customerDataList.length != 0 && customerDataList.some(item => item.labelList.length !== 0)">
...@@ -201,7 +205,7 @@ export default { ...@@ -201,7 +205,7 @@ export default {
// limitWidth: 10000, //限制单张图片宽度 // limitWidth: 10000, //限制单张图片宽度
// limitHeight: 10000,//限制单张图片高度 // limitHeight: 10000,//限制单张图片高度
Isdraggable: true, //图片拖拽 Isdraggable: true, //图片拖拽
uploadApi: this.$apis.common.pictureUpload uploadApi: this.$apis.common.compressPicture
}, },
{ {
name: '视频', name: '视频',
...@@ -213,13 +217,14 @@ export default { ...@@ -213,13 +217,14 @@ export default {
// limitWidth: 1280, //限制视频宽度 // limitWidth: 1280, //限制视频宽度
// limitHeight: 720, //限制视频高度 // limitHeight: 720, //限制视频高度
limitTime: 30, //限制视频时长 limitTime: 30, //限制视频时长
uploadApi: this.$apis.common.pictureUpload uploadApi: this.$apis.common.compressVideo
}, },
{ {
name: '链接', name: '链接',
type: 'postLink', type: 'postLink',
funName: 'postLink', funName: 'postLink',
togetherItem: [ATT_TYPE.TEXT], togetherItem: [ATT_TYPE.TEXT],
limitOrNot: true,
uploadApi: this.$apis.common.pictureUpload uploadApi: this.$apis.common.pictureUpload
} }
], ],
...@@ -275,7 +280,8 @@ export default { ...@@ -275,7 +280,8 @@ export default {
customerDataList: [], customerDataList: [],
isTagVisible: false, isTagVisible: false,
estimatedNumberOfPeople: '', estimatedNumberOfPeople: '',
customerLoading: false customerLoading: false,
whetherToSelectMembers: true,
} }
}, },
watch: { watch: {
...@@ -300,18 +306,23 @@ export default { ...@@ -300,18 +306,23 @@ export default {
mounted() { mounted() {
}, },
methods: { methods: {
getCustomerByTagList() { getCustomerByTagList(type) {
var params = { let params = {}
combineType: 2, if (type == 'all') {
pageSize: 1, this.viewLoading = true
pageNum: 1, }
tagLists: [] if (type == 'filtrate') {
params = {
selectType: 2,
condition: {
labelList: []
}
} }
this.customerDataList && this.customerDataList &&
this.customerDataList.forEach(item => { this.customerDataList.forEach(item => {
item.labelList.length && item.labelList.length &&
item.labelList.forEach(subItem => { item.labelList.forEach(subItem => {
params.tagLists.push({ params.condition.labelList.push({
groupId: item.labelGroup.id, groupId: item.labelGroup.id,
groupName: item.labelGroup.name, groupName: item.labelGroup.name,
groupType: item.labelType, groupType: item.labelType,
...@@ -320,30 +331,60 @@ export default { ...@@ -320,30 +331,60 @@ export default {
}) })
}) })
}) })
this.$apis.sop.getCustomerByTagListApi(params).then(res => {
this.estimatedNumberOfPeople = res.count }
const userList = this.basicForm.userList.map(item => {
return {
staffId: item.staffId,
staffName: item.staffName,
masterStatus: item.masterStatus,
follow: item.follow
}
})
params.userList = userList
this.$apis.friendGroup
.momentCount(params)
.then(res => {
if (this.basicForm.visibleCustomer == 1) {
this.viewLoading = false
this.groupNumber = res
this.isUpdate = false
} else {
this.estimatedNumberOfPeople = res
this.customerLoading = false this.customerLoading = false
}
}) })
.catch(err => {
this.viewLoading = false
this.groupNumber = 0
})
}, },
handleDeleteCustomer(idx, pIdx) { handleDeleteCustomer(idx, pIdx) {
this.customerDataList[pIdx].labelList.splice(idx, 1) this.customerDataList[pIdx].labelList.splice(idx, 1)
this.customerLoading = true this.customerLoading = true
this.getCustomerByTagList()
this.getCustomerByTagList('filtrate')
}, },
handleResetCustomer() { handleResetCustomer() {
this.customerDataList = [] this.customerDataList = []
this.customerLoading = false this.customerLoading = false
this.estimatedNumberOfPeople = '' this.estimatedNumberOfPeople = ''
}, },
handleDialogConfirm(val) { handleDialogConfirm(val) {
this.customerDataList = val this.customerDataList = val
this.customerLoading = true this.customerLoading = true
this.getCustomerByTagList()
this.getCustomerByTagList('filtrate')
}, },
handleSelectCustomer() { handleSelectCustomer() {
this.isTagVisible = !this.isTagVisible this.isTagVisible = !this.isTagVisible
this.$refs.selectTagForm.init(JSON.parse(JSON.stringify(this.customerDataList))) this.$refs.selectTagForm.init(JSON.parse(JSON.stringify(this.customerDataList)))
}, },
previewForm(val) { previewForm(val) {
// this.previewView = val // this.previewView = val
...@@ -351,9 +392,11 @@ export default { ...@@ -351,9 +392,11 @@ export default {
if (value[0] && !value[0].attContent) value.splice(0, 1) if (value[0] && !value[0].attContent) value.splice(0, 1)
this.previewView = value this.previewView = value
}, },
openMembers() { openMembers() {
this.membersVisible = !this.membersVisible this.membersVisible = !this.membersVisible
}, },
handleCancel() { handleCancel() {
if (this.editStatus || this.$refs.welcome.previewList.length > 0) { if (this.editStatus || this.$refs.welcome.previewList.length > 0) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', { this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
...@@ -379,33 +422,10 @@ export default { ...@@ -379,33 +422,10 @@ export default {
}) })
return return
} }
this.viewLoading = true this.basicForm.visibleCustomer == 2 ? this.handleSelectCustomer() : this.getCustomerByTagList('all')
const userList = this.basicForm.userList.map(item => {
return {
staffId: item.staffId,
staffName: item.staffName,
masterStatus: item.masterStatus,
follow: item.follow
}
})
let params = {
userList
}
this.$apis.friendGroup
.momentCount(params)
.then(res => {
this.viewLoading = false
this.groupNumber = res
this.isUpdate = false
})
.catch(err => {
this.viewLoading = false
this.groupNumber = 0
})
}, },
// 成员弹窗 // 成员弹窗
handleConfirm() { handleConfirm() {
console.log(this.$refs.membersForm.innerTags)
if (this.$refs.membersForm.innerTags.length) { if (this.$refs.membersForm.innerTags.length) {
// this.basicForm.userList = this.$refs.membersForm.innerTags // this.basicForm.userList = this.$refs.membersForm.innerTags
this.$set(this.basicForm, 'userList', this.$refs.membersForm.innerTags) this.$set(this.basicForm, 'userList', this.$refs.membersForm.innerTags)
...@@ -489,12 +509,25 @@ export default { ...@@ -489,12 +509,25 @@ export default {
// 对链接字段做处理 // 对链接字段做处理
attachmentList.forEach(item => { attachmentList.forEach(item => {
if (item.attType == 4){ if (item.attType == 4) {
item.attContent = JSON.stringify(item.attContent ) item.attContent = JSON.stringify(item.attContent)
} }
}) })
params.attachmentList = attachmentList params.attachmentList = attachmentList
// 筛选客户
if (this.basicForm.visibleCustomer) {
params.tagList = []
this.customerDataList &&
this.customerDataList.forEach(item => {
item.labelList.length &&
item.labelList.forEach(subItem => {
params.tagList.push(
subItem.id,
)
})
})
}
if (params.sendType == 2) { if (params.sendType == 2) {
params.sendTimeStr = this.basicForm.sendTime + ' ' + this.basicForm.sendDate params.sendTimeStr = this.basicForm.sendTime + ' ' + this.basicForm.sendDate
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!