Commit f8706718 by 胡悦

修复bug

1 parent ef316f80
...@@ -210,6 +210,15 @@ const getActivity = params => { ...@@ -210,6 +210,15 @@ const getActivity = params => {
sign: true sign: true
}) })
} }
const nameVaild = params => {
params.method = 'entmicro.api.one.template.name.valid'
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
export default { export default {
customerList, customerList,
customerGroupList, customerGroupList,
...@@ -231,5 +240,6 @@ export default { ...@@ -231,5 +240,6 @@ export default {
getCard, getCard,
getCoupon, getCoupon,
getPackage, getPackage,
getActivity getActivity,
nameVaild
} }
...@@ -282,7 +282,10 @@ export default { ...@@ -282,7 +282,10 @@ export default {
addLoading: false, addLoading: false,
eventBus: new Vue(), eventBus: new Vue(),
basicForm: { basicForm: {
condition: {} selectType: 1,
condition: {
sex: ''
}
}, },
basicRules: { basicRules: {
userList: [ userList: [
......
...@@ -169,6 +169,19 @@ export default { ...@@ -169,6 +169,19 @@ export default {
} }
} }
} }
const nameVaild = (rule, value, callback) => {
console.log(value)
if (value) {
this.$apis.customerTransform.nameVaild({ templateName: value }).then(res => {
console.log(res)
if (res) {
callback(new Error('群聊名称不可重复'))
} else {
callback()
}
})
}
}
return { return {
addLoading: false, addLoading: false,
eventBus: new Vue(), eventBus: new Vue(),
...@@ -178,7 +191,10 @@ export default { ...@@ -178,7 +191,10 @@ export default {
// { required: true, message: '请选择群发账号', trigger: 'blur' }, // { required: true, message: '请选择群发账号', trigger: 'blur' },
{ validator: validatorUser, trigger: 'change' } { validator: validatorUser, trigger: 'change' }
], ],
massName: [{ required: true, message: '请输入群聊名称', trigger: 'blur' }], massName: [
{ required: true, message: '请输入群聊名称', trigger: 'blur' },
{ validator: nameVaild, trigger: 'blur' }
],
attachmentList: [ attachmentList: [
// { required: true, message: '请输入入群欢迎语' }, // { required: true, message: '请输入入群欢迎语' },
{ validator: validatorAttachment, trigger: 'change' } { validator: validatorAttachment, trigger: 'change' }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<div class="detail-label">创建者:</div> <div class="detail-label">创建者:</div>
<div class="detail-value">{{basicInfo.createdName ? basicInfo.createdName : '-'}}</div> <div class="detail-value">{{basicInfo.createdName ? basicInfo.createdName : '-'}}</div>
</div> </div>
<div class="detail-item"> <div class="detail-item" v-show="form == 'customer'">
<div class="detail-label">群发类型:</div> <div class="detail-label">群发类型:</div>
<div class="detail-value">{{basicInfo.sendType == 1 ? '立即发送': '定时发送'}}</div> <div class="detail-value">{{basicInfo.sendType == 1 ? '立即发送': '定时发送'}}</div>
</div> </div>
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
<div class="detail-label">发送状态:</div> <div class="detail-label">发送状态:</div>
<div class="detail-value">{{STATUS_TYPE[basicInfo.status]}}</div> <div class="detail-value">{{STATUS_TYPE[basicInfo.status]}}</div>
</div> </div>
<div class="detail-item" v-show="form == 'customer' && basicInfo.sendType == 2"> <div class="detail-item">
<div class="detail-label">发送时间:</div> <div class="detail-label">发送时间:</div>
<div class="detail-value">{{basicInfo.sendTime}}</div> <div class="detail-value">{{basicInfo.sendTime ? basicInfo.sendTime : '--'}}</div>
</div> </div>
<div class="detail-item"> <div class="detail-item">
<div class="detail-label">群发对象:</div> <div class="detail-label">群发对象:</div>
...@@ -93,6 +93,8 @@ const STATUS = { ...@@ -93,6 +93,8 @@ const STATUS = {
'1': '发送成功', '1': '发送成功',
'2': '发送失败' '2': '发送失败'
} }
import * as dayjs from 'dayjs'
import Preview from '../components/preview.vue' import Preview from '../components/preview.vue'
export default { export default {
name: 'BasicInof', name: 'BasicInof',
...@@ -117,6 +119,7 @@ export default { ...@@ -117,6 +119,7 @@ export default {
this.$apis.customerTransform.customerDetail({ id }).then(res => { this.$apis.customerTransform.customerDetail({ id }).then(res => {
console.log(res) console.log(res)
this.basicInfo = res this.basicInfo = res
// this.basicInfo.sendTime = dayjs(this.basicInfo.sendTime).format('YYYY-MM-DD HH:mm:ss')
const previewList = res.attachmentList.map(item => { const previewList = res.attachmentList.map(item => {
if (item.attType == 7) item.attContent = JSON.parse(item.attContent) if (item.attType == 7) item.attContent = JSON.parse(item.attContent)
return item return item
......
...@@ -318,6 +318,8 @@ export default { ...@@ -318,6 +318,8 @@ export default {
} }
.customer-table { .customer-table {
display: flex; display: flex;
margin-top: 0;
margin-left: 10px;
&.send { &.send {
width: 70px; width: 70px;
} }
......
...@@ -125,14 +125,14 @@ export default { ...@@ -125,14 +125,14 @@ export default {
label: '发送时间', label: '发送时间',
prop: 'sendTime', prop: 'sendTime',
width: 160, width: 160,
line: 2, line: 2
formatter: cellValue => { // formatter: cellValue => {
if (cellValue.sendTime) { // if (cellValue.sendTime) {
return dayjs(cellValue.sendTime).format('YYYY-MM-DD HH:mm:ss') // return dayjs(cellValue.sendTime).format('YYYY-MM-DD HH:mm:ss')
} else { // } else {
return '' // return ''
} // }
} // }
}, },
{ {
label: '已发送员工', label: '已发送员工',
...@@ -185,6 +185,13 @@ export default { ...@@ -185,6 +185,13 @@ export default {
prop: 'sendTime', prop: 'sendTime',
width: 150, width: 150,
line: 2 line: 2
// formatter: cellValue => {
// if (cellValue.sendTime) {
// return dayjs(cellValue.sendTime).format('YYYY-MM-DD HH:mm:ss')
// } else {
// return ''
// }
// }
}, },
{ {
label: '已发送群主', label: '已发送群主',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!