Commit 66f1c719 by 前端

Merge branch 'yangm_v2.11.0' into 'v2.11.0'

Yangm v2.11.0

See merge request !39
2 parents e7878e3b 3b71fd90
......@@ -11,11 +11,8 @@
</el-form-item>
<el-form-item label="选择门店:" prop="selectStore" class="settingSelect">
<!-- <SearchDropDown :label="'msgMerchantName'" :value="'msgMerchantId'"></SearchDropDown>-->
<el-select ref="selectLabel" clearable filterable remote :remote-method="remoteMethod"
v-el-select-loadmore="loadmore" v-model="basicForm.selectStore" placeholder="请选择门店"
@change="selectChange" @clear="clearDrop">
<el-option v-for="(item, i) in dataItems" :key="i" :label="item.msgMerchantName"
:value="item.msgMerchantId"></el-option>
<el-select ref="selectLabel" clearable filterable remote :remote-method="remoteMethod" v-el-select-loadmore="loadmore" v-model="basicForm.selectStore" placeholder="请选择门店" @change="selectChange" @clear="clearDrop">
<el-option v-for="(item, i) in dataItems" :key="i" :label="item.msgMerchantName" :value="item.msgMerchantId"></el-option>
</el-select>
</el-form-item>
<el-form-item label="选择客户:" prop="selectType">
......@@ -37,10 +34,7 @@
</div>
<div v-show="tagging.length != 0" :key="key" class="el-input-tag input-tag-wrapper">
<span v-for="(tag, idx) in tagging" :key="idx">
<el-tag v-for="(tagItem, idx1) in tag.labelList" :key="idx1" :size="size" type="info" closable
:disable-transitions="false" @close="removeTag(tag, idx1, idx)">{{
tagItem.name
}}</el-tag>
<el-tag v-for="(tagItem, idx1) in tag.labelList" :key="idx1" :size="size" type="info" closable :disable-transitions="false" @close="removeTag(tag, idx1, idx)">{{ tagItem.name }}</el-tag>
</span>
</div>
</div>
......@@ -50,8 +44,7 @@
</el-button>
<div class="sale-select" v-show="basicForm.crowdList && basicForm.crowdList.length != 0">
<div class="el-input-tag input-tag-wrapper">
<el-tag effect="plain" type="info" v-for="(t, i) in basicForm.crowdList" :key="i" closable
:disable-transitions="false" @close="removeCrowd(t, i)">
<el-tag effect="plain" type="info" v-for="(t, i) in basicForm.crowdList" :key="i" closable :disable-transitions="false" @close="removeCrowd(t, i)">
{{ t.crowdName }}
</el-tag>
</div>
......@@ -63,8 +56,7 @@
<div class="filter-footer">
<div class="filter-number">
预计群发人数
<el-button type="text" v-show="isUpdate" :loading="viewLoading" @click="viewMembers">查看
</el-button>
<el-button type="text" v-show="isUpdate" :loading="viewLoading" @click="viewMembers">查看</el-button>
<span v-show="!isUpdate">{{ groupNumber }}</span>
</div>
</div>
......@@ -88,13 +80,10 @@
<el-button @click="handleCancel">取消</el-button>
<el-button type="primary" v-loading="addLoading" @click="handleSubmit">提交</el-button>
</GLFooter>
<SelectLabel ref="selectLabel" @tagSelected="handleSelect" :resetMerchantId="resetMerchantId"
:dialogVisible="dialogVisible"></SelectLabel>
<SelectCrowd ref="selectCrowd" @crowdData="getCrowdData" :resetMerchantId="resetMerchantId"
:selectCrowdData="basicForm.crowdList"></SelectCrowd>
<SelectLabel ref="selectLabel" @tagSelected="handleSelect" :resetMerchantId="resetMerchantId" :dialogVisible="dialogVisible"></SelectLabel>
<SelectCrowd ref="selectCrowd" @crowdData="getCrowdData" :resetMerchantId="resetMerchantId" :selectCrowdData="basicForm.crowdList"></SelectCrowd>
</div>
</template>
<script>
const combineType = {
label: 2,
......@@ -104,9 +93,7 @@ import emoji from '@/utils/emo'
import SelectCrowd from './components/selectCrowd.vue'
import SelectLabel from './components/SelectLabel.vue'
// import SearchDropDown from './components/searchDropDown/index'
import * as dayjs from 'dayjs'
export default {
components: {
SelectLabel,
......@@ -231,9 +218,9 @@ export default {
attachmentShow: false,
attachmentText: '',
basicRules: {
groupName: [{required: true, message: '请输入群发名称', trigger: 'blur'}],
selectStore: [{required: true, message: '请选择门店', trigger: 'change'}],
selectType: [{required: true, message: '请选择客户类型', trigger: 'change'}]
groupName: [{ required: true, message: '请输入群发名称', trigger: 'blur' }],
selectStore: [{ required: true, message: '请选择门店', trigger: 'change' }],
selectType: [{ required: true, message: '请选择客户类型', trigger: 'change' }]
},
basicForm: {
groupName: '',
......@@ -293,7 +280,7 @@ export default {
'el-select-loadmore': {
bind(el, binding) {
const SELECTWRAP_DOM = el.querySelector('.el-select-dropdown .el-select-dropdown__wrap')
SELECTWRAP_DOM.addEventListener('scroll', function () {
SELECTWRAP_DOM.addEventListener('scroll', function() {
const condition = this.scrollHeight - this.scrollTop <= this.clientHeight
if (condition) {
binding.value()
......@@ -335,7 +322,6 @@ export default {
})
this.dataItems = [...this.dataItems, ...this.arrBack]
},
async remoteMethod(searchValue) {
if (searchValue !== '') {
this.searchContentStorage = searchValue
......@@ -343,33 +329,33 @@ export default {
pageNum: 1,
pageSize: 40
}),
(this.dataItems = [])
(this.dataItems = [])
this.timer = setTimeout(() => {
this.loadUpData(this.pageData, searchValue)
}, 300)
} else {
this.dataItems = []
this.loadUpData(
{
pageNum: 1,
pageSize: 40
},
''
{
pageNum: 1,
pageSize: 40
},
''
)
}
},
selectChange(val) {
// 选择门店时,替换欢迎语组件当中的所有merchantId
this.btnList.forEach(item =>{
if (item.params && item.params.hasOwnProperty('merchant')){
item.params.merchant = val
}
if(item.funParams && Object.prototype.toString.call(item.funParams) === '[object Array]'){
item.funParams.forEach(funArr =>{
if (funArr.params && funArr.params.hasOwnProperty('merchantId')){
this.btnList.forEach(item => {
if (item.params && item.params.hasOwnProperty('merchant')) {
item.params.merchant = val
}
if (item.funParams && Object.prototype.toString.call(item.funParams) === '[object Array]') {
item.funParams.forEach(funArr => {
if (funArr.params && funArr.params.hasOwnProperty('merchantId')) {
funArr.params.merchantId = val
}
if (funArr.merchantOpen && funArr.merchantOpen.params && funArr.merchantOpen.params.hasOwnProperty('merchantId')){
if (funArr.merchantOpen && funArr.merchantOpen.params && funArr.merchantOpen.params.hasOwnProperty('merchantId')) {
funArr.merchantOpen.params.merchantId = val
}
})
......@@ -382,7 +368,6 @@ export default {
this.isUpdate = true
this.resetMerchantId = val
this.msgMerchantName = val && this.dataItems.find(item => item.msgMerchantId == val).msgMerchantName
},
// 返回
handleCancel() {
......@@ -392,11 +377,10 @@ export default {
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.$router.push('/wechatGroup/index')
})
.catch(() => {
})
.then(() => {
this.$router.push('/wechatGroup/index')
})
.catch(() => {})
} else {
this.$router.push('/wechatGroup/index')
}
......@@ -418,15 +402,15 @@ export default {
const params = this.getBaseInfo()
// 统计群发人数
await this.$apis.wechatGroup
.batchmessagingCustomercount(params)
.then(res => {
if (res || res == 0) {
this.groupNumber = res
}
})
.catch(err => {
this.groupNumber = 0
})
.batchmessagingCustomercount(params)
.then(res => {
if (res || res == 0) {
this.groupNumber = res
}
})
.catch(err => {
this.groupNumber = 0
})
this.$refs.basicForm.validate(valid => {
if (valid) {
if (this.basicForm.selectType == '1' && !this.taggingList.length) {
......@@ -474,7 +458,7 @@ export default {
if (item.attType == 1) {
const list = emoji.flat(Infinity)
const cutImg = item.attContent.replaceAll('<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/', '')
const replaceImg = cutImg.replace(/(\d){3}.png">/g, function (str) {
const replaceImg = cutImg.replace(/(\d){3}.png">/g, function(str) {
let s = list[parseInt(str.split('.')[0]) - 1]
return `[${s}]`
})
......@@ -595,21 +579,21 @@ export default {
const params = this.getBaseInfo()
this.viewLoading = true
this.$apis.wechatGroup
.batchmessagingCustomercount(params)
.then(res => {
if (res || res == 0) {
this.isUpdate = false
this.groupNumber = res
} else {
this.isUpdate = true
}
this.viewLoading = false
})
.catch(err => {
this.viewLoading = false
this.groupNumber = 0
.batchmessagingCustomercount(params)
.then(res => {
if (res || res == 0) {
this.isUpdate = false
})
this.groupNumber = res
} else {
this.isUpdate = true
}
this.viewLoading = false
})
.catch(err => {
this.viewLoading = false
this.groupNumber = 0
this.isUpdate = false
})
},
// 选择客户change事件
radioChange(val) {
......@@ -647,13 +631,11 @@ export default {
}
}
</script>
<style lang="scss" scoped>
.container {
margin-bottom: 20px;
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
// padding: 20px;
.title {
padding: 20px 0 17px 20px;
......@@ -662,19 +644,16 @@ export default {
font-weight: 600;
border-bottom: 1px solid #d8d8d8;
}
.info-box {
display: inline-flex;
width: 100%;
padding-bottom: 30px;
align-items: flex-end;
justify-content: space-between;
.info-content {
// width: calc(100% - 360px);
width: 66%;
padding-right: 20px;
//.filter-box {
// // margin-left: 120px;
// margin-bottom: 10px;
......@@ -690,7 +669,6 @@ export default {
// }
// }
//}
.filter-footer {
display: flex;
// padding: 14px 20px;
......@@ -698,7 +676,6 @@ export default {
align-items: center;
color: #999;
font-size: 14px;
.filter-number {
display: inline-block;
line-height: 20px;
......@@ -706,31 +683,25 @@ export default {
background-color: #e6e9ff;
color: #333;
margin-top: 8px;
span {
color: #5850ff;
cursor: pointer;
}
}
}
.basic-form {
padding: 32px 0 20px 20px;
.settingSelect {
/deep/ input {
height: 35px;
}
}
.selectedLabel {
display: flex;
.selectLen {
margin-left: 20px;
font-size: 14px;
color: #666666;
.num {
color: #5850ff;
}
......@@ -739,20 +710,16 @@ export default {
}
}
}
.form-tips {
font-size: 12px;
color: #999;
}
.preview {
flex: 1;
margin-right: 24px;
margin-bottom: 58px;
}
}
.footer-panel {
display: flex;
align-items: center;
......@@ -764,22 +731,18 @@ export default {
background: #ffffff;
box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
}
.label-text {
margin-left: 10px;
font-size: 14px;
span {
color: #5850ff;
}
}
.sale-select {
display: flex;
align-items: center;
// width: 50%;
}
.input-tag-wrapper {
max-height: 75px;
min-width: 488px;
......@@ -804,14 +767,12 @@ export default {
align-items: center;
margin-top: 6px;
font-size: 14px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
.el-tag {
margin-right: 4px;
height: 26px;
......@@ -819,7 +780,6 @@ export default {
margin-bottom: 6px;
// background: #fff !important;
}
.tag-input {
background: transparent;
border: none !important;
......@@ -829,49 +789,40 @@ export default {
padding-left: 0;
width: 100px;
}
.form-error {
color: #f56c6c;
font-size: 12px;
margin-left: 186px;
margin-top: 10px;
}
/deep/ {
//.el-form-item .el-form-item {
// margin-bottom: 22px;
//}
.required {
display: inline-block;
line-height: 40px;
}
.required::before {
content: '*';
color: #f56c6c;
margin-right: 4px;
}
.el-loading-spinner {
transform: translateY(8px);
}
.el-scrollbar {
padding-bottom: 10px;
}
.gl-form-page .el-form .welcome-box {
min-width: 488px;
max-width: 844px;
width: auto;
}
}
.group-content {
padding: 0 0 20px 0;
}
.tips-text {
font-size: 12px;
color: #f56c6c;
......@@ -879,22 +830,18 @@ export default {
line-height: 20px;
padding-bottom: 4px;
}
.crowd-tips {
color: #999999;
font-size: 12px;
line-height: 16px;
}
/deep/ .content .btn-group {
line-height: 14px;
}
/deep/ .el-select {
.el-select__caret:first-child::before {
content: "\e6e1";
content: '\e6e1';
}
.is-focus {
.el-select__caret:first-child {
transform: rotateZ(0deg);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!