Commit ce7d5e90 by 前端

修复bug

1 parent 95ff9116
...@@ -63,7 +63,7 @@ export default { ...@@ -63,7 +63,7 @@ export default {
data() { data() {
return { return {
url: 0, url: 0,
initId:'', initId: '',
crowdVisible: false, crowdVisible: false,
searchForm: {userName: ''}, searchForm: {userName: ''},
innerTags: [], innerTags: [],
...@@ -83,12 +83,12 @@ export default { ...@@ -83,12 +83,12 @@ export default {
hasNum: false, hasNum: false,
listName: 'crowdUnitList', listName: 'crowdUnitList',
// 行数据的key // 行数据的key
mutiSelectUniqueKey: 'crowdId', mutiSelectUniqueKey: 'userId',
// 多选ref的名称 // 多选ref的名称
mutiSelectName: 'crowdlist', mutiSelectName: 'crowdlist',
tableColumns: [ tableColumns: [
{ {
label: '客户名称', label: '客户昵称',
prop: 'nickname' prop: 'nickname'
}, },
{ {
...@@ -105,38 +105,29 @@ export default { ...@@ -105,38 +105,29 @@ export default {
clearTheSelectedList() { clearTheSelectedList() {
this.$refs.crowdTable.clearMutiSelect() this.$refs.crowdTable.clearMutiSelect()
}, },
init(val,userId) { init(val, userId) {
this.initId = userId this.initId = userId
this.inner = this.$common.utils.deepClone(val) this.inner = this.$common.utils.deepClone(val)
this.innerTags = this.$common.utils.deepClone(val) this.innerTags = this.$common.utils.deepClone(val)
this.crowdVisible = true this.crowdVisible = true
this.searchForm.userName = '' this.searchForm.userName = ''
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.crowdTable.$refs.crowdlistMutiTable.clearSelection() this.$refs.crowdTable.$refs.crowdlistMutiTable && this.$refs.crowdTable.$refs.crowdlistMutiTable.clearSelection()
this.$refs.crowdTable.page.pageNum = 1 this.$refs.crowdTable.page.pageNum = 1
this.getCrowdList( {pageNum: 1, pageSize: 10}) this.getCrowdList({pageNum: 1, pageSize: 10})
}) })
}, },
getCrowdList(page = {pageNum: 1, pageSize: 10}) { async getCrowdList(page = {pageNum: 1, pageSize: 10}) {
this.$refs.crowdTable.page = page this.$refs.crowdTable.page = page
var params = { var params = {
pageSize: page.pageSize, pageSize: page.pageSize,
pageNum: page.pageNum, pageNum: page.pageNum,
userId:this.initId, userId: this.initId,
userName:this.searchForm.userName userName: this.searchForm.userName
} }
this.$apis.collocation.getStaffFriends(params).then(res => { await this.$apis.collocation.getStaffFriends(params).then(res => {
this.tableData = res && res.data this.tableData = res && res.data
this.tableTotal = res && res.count this.tableTotal = res && res.count
// console.log(this.inner)
// console.log(this.tableData)
// this.tableData.forEach(item => {
// this.inner.forEach((itm, index) => {
// if (itm.crowdId == item.crowdId) {
// this.rowClick(item)
// }
// })
// })
this.recoverySelected() this.recoverySelected()
}) })
}, },
...@@ -183,7 +174,6 @@ export default { ...@@ -183,7 +174,6 @@ export default {
}, },
recoverySelected() { recoverySelected() {
// 翻页,去掉已选项 // 翻页,去掉已选项
console.log(this.$refs.crowdTable.mutiSelectArr)
var selectedData = this.$refs.crowdTable.mutiSelectArr.crowdlist var selectedData = this.$refs.crowdTable.mutiSelectArr.crowdlist
var deleteList = [] var deleteList = []
this.addSelected() this.addSelected()
......
...@@ -105,7 +105,6 @@ export default { ...@@ -105,7 +105,6 @@ export default {
let list = this.tableData.filter(item => { let list = this.tableData.filter(item => {
return item['idBefEncryption'] == this.selectId return item['idBefEncryption'] == this.selectId
}) })
console.log(list[0])
let selectEmp = { let selectEmp = {
staffName: list[0].staffName, staffName: list[0].staffName,
staffCloudIdList: list[0].idBefEncryption, staffCloudIdList: list[0].idBefEncryption,
......
...@@ -3,9 +3,10 @@ import * as dayjs from "dayjs"; ...@@ -3,9 +3,10 @@ import * as dayjs from "dayjs";
export default { export default {
data() { data() {
return { return {
selectSenderList:null, selectSenderList: null,
groupNumber: 0, groupNumber: 0,
viewLoading: false, viewLoading: false,
staffCloudIdListStr: '',
isUpdate: true, isUpdate: true,
dateOptions: { dateOptions: {
disabledDate(time) { disabledDate(time) {
...@@ -37,6 +38,9 @@ export default { ...@@ -37,6 +38,9 @@ export default {
this.basicForm.crowdList = [] this.basicForm.crowdList = []
this.$refs.selectLabel.labelTreeRetSelect = [] this.$refs.selectLabel.labelTreeRetSelect = []
} }
},
'staffCloudIdListStr'(newVal, oldVal) {
this.basicForm.customerList = newVal == oldVal ? this.basicForm.customerList : []
} }
}, },
methods: { methods: {
...@@ -46,6 +50,8 @@ export default { ...@@ -46,6 +50,8 @@ export default {
selectSender(list) { selectSender(list) {
this.selectSenderList = list this.selectSenderList = list
this.basicForm.staffCloudIdList.push(list.staffCloudIdList) this.basicForm.staffCloudIdList.push(list.staffCloudIdList)
let staffCloudIdList = this.basicForm.staffCloudIdList
this.staffCloudIdListStr = staffCloudIdList && staffCloudIdList.at(-1).toString()
}, },
// 客户筛选弹窗 // 客户筛选弹窗
selectCustomer() { selectCustomer() {
...@@ -57,8 +63,7 @@ export default { ...@@ -57,8 +63,7 @@ export default {
message: '请选择发送人' message: '请选择发送人'
}) })
} }
let staffCloudIdListStr = staffCloudIdList[0].toString() this.$refs.selectCustomer.init(customerList, this.staffCloudIdListStr)
this.$refs.selectCustomer.init(customerList, staffCloudIdListStr)
}, },
// 返回 // 返回
handleCancel(path) { handleCancel(path) {
...@@ -193,7 +198,7 @@ export default { ...@@ -193,7 +198,7 @@ export default {
this.isUpdate = false this.isUpdate = false
this.viewLoading = false this.viewLoading = false
} }
if (managedType ==2) { if (managedType == 2) {
this.groupNumber = this.basicForm.customerList.length this.groupNumber = this.basicForm.customerList.length
this.isUpdate = false this.isUpdate = false
} }
...@@ -215,7 +220,7 @@ export default { ...@@ -215,7 +220,7 @@ export default {
}, },
getBaseInfo(managedType) { getBaseInfo(managedType) {
let params = {} let params = {}
if (managedType == 1){ if (managedType == 1) {
params = { params = {
customerType: this.basicForm.selectType, customerType: this.basicForm.selectType,
msgName: this.basicForm.groupName, msgName: this.basicForm.groupName,
...@@ -234,7 +239,7 @@ export default { ...@@ -234,7 +239,7 @@ export default {
params.combineType = combineType.crowd params.combineType = combineType.crowd
} }
} }
if (managedType == 2){ if (managedType == 2) {
let customerCloudIdList = [] let customerCloudIdList = []
let staffCloudIdList = [] let staffCloudIdList = []
this.basicForm.customerList.forEach(item => { this.basicForm.customerList.forEach(item => {
......
...@@ -463,13 +463,13 @@ export default { ...@@ -463,13 +463,13 @@ export default {
if (material.length > 1) { if (material.length > 1) {
materialType = 2 materialType = 2
} }
const {taskName, taskMerchantId, sendType, managedType} = this.basicForm const {taskName, taskMerchantId, sendType, managedType, selectType, customerList} = this.basicForm
const taskMerchantName = managedType == 1 && this.optionsMe.find(item => item.msgMerchantId == taskMerchantId).msgMerchantName const taskMerchantName = managedType == 1 && this.optionsMe.find(item => item.msgMerchantId == taskMerchantId).msgMerchantName
let peopleParams = this.getBaseInfo(managedType) let peopleParams = this.getBaseInfo(managedType)
if (managedType == 1 && this.basicForm.selectType != 0) { if (managedType == 1 && selectType != 0) {
await this.getTheNumberOfPeople(peopleParams) await this.getTheNumberOfPeople(peopleParams)
} }
if ((this.basicForm.selectType != 0 && this.groupNumber == 0 && managedType == 1) || (managedType == 2 && this.basicForm.customerList && this.basicForm.customerList.length == 0)) { if ((selectType != 0 && this.groupNumber == 0 && managedType == 1) || (managedType == 2 && selectType != 0 && customerList && customerList.length == 0)) {
this.$message({ this.$message({
type: 'error', type: 'error',
message: '群发人数为0!' message: '群发人数为0!'
......
...@@ -186,8 +186,8 @@ export default { ...@@ -186,8 +186,8 @@ export default {
this.getListData() this.getListData()
const merchantList = await this.merchantList() const merchantList = await this.merchantList()
const index = this.searchFormData.findIndex(item => item.name == 'merchantName') const index = this.searchFormData.findIndex(item => item.name == 'merchantName')
this.searchFormData[index].optionList = merchantList ? merchantList.data : [] this.searchFormData[index].optionList = merchantList ? merchantList : []
this.searchFormData[index].optionList.unshift({msgMerchantId: null, msgMerchantName: '全部'}) this.searchFormData[index].optionList && this.searchFormData[index].optionList.unshift({msgMerchantId: null, msgMerchantName: '全部'})
}, },
methods: { methods: {
......
...@@ -380,6 +380,9 @@ export default { ...@@ -380,6 +380,9 @@ export default {
this.basicForm.customerList = [] //未接入门店客户 this.basicForm.customerList = [] //未接入门店客户
//群发内容
this.$refs.welcome.textValue = ''
this.$refs.welcome.previewList = []
} }
}, },
'selectSenderList'(val) { 'selectSenderList'(val) {
...@@ -447,7 +450,6 @@ export default { ...@@ -447,7 +450,6 @@ export default {
await this.getTheNumberOfPeople(params) await this.getTheNumberOfPeople(params)
} }
console.log(params)
if ((this.basicForm.managedType == 1 && this.groupNumber == 0) || (this.basicForm.managedType == 2 && this.basicForm.customerList.length == 0)) { if ((this.basicForm.managedType == 1 && this.groupNumber == 0) || (this.basicForm.managedType == 2 && this.basicForm.customerList.length == 0)) {
this.$message({ this.$message({
type: 'error', type: 'error',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!