Commit 3016b9dd by 前端

commit

1 parent edea1047
<template>
<div class="add-wrap">
<div class="add-wrap" v-loading="loading">
<div class="container">
<div class="title">营销配置</div>
<div style="display:flex">
<div style="display: flex">
<div class="gl-form-page">
<el-form ref="configForm" label-width="154px" :model="addForm" :rules="addRules">
<el-form-item label="营销名称:" prop="imName">
......@@ -15,7 +15,7 @@
<el-date-picker type="date" :picker-options="pickerOptions" placeholder="选择日期" format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd" v-model="addForm.date1" style="width: 100%"></el-date-picker>
</el-col>
<!-- <el-col class="line" :span="1">-</el-col> -->
<el-col :span="11" style="margin-left:12px;">
<el-col :span="11" style="margin-left: 12px">
<el-time-picker placeholder="选择时间" value-format="HH:mm" format="HH:mm" v-model="addForm.date2" style="width: 100%"></el-time-picker>
</el-col>
<div class="el-form-item__error" v-if="isTime">请选择营销时间</div>
......@@ -51,7 +51,7 @@
<div class="config-form-item el-form-item">
<label class="is-require">短信内容:</label>
<div style="position: relative">
<wTextarea ref="textContent" class="textarea" v-model="addForm.messageContext" @updateText="updateText" :style="{ 'min-height': boxHeight + 'px' }"></wTextarea>
<wTextarea ref="textContent" class="textarea" v-model="addForm.messageContext" @updateText="updateText" :style="{ 'min-height': boxHeight + 'px' }"></wTextarea>
<div class="select-panel">
<div @click="handleSelectMessage" class="flex">
<img src="@/images/link.png" class="link" />
......@@ -130,6 +130,7 @@ export default {
},
textValue: '',
importName: '',
loading: false,
isTime: false,
isUplaod: false,
isLink: false,
......@@ -191,7 +192,7 @@ export default {
this.$refs.file.value = ''
},
handleSave() {
console.log(this.addForm.messageContext)
this.loading = true
this.isUplaod = false
this.isTime = false
this.isLink = false
......@@ -209,7 +210,7 @@ export default {
this.isLink = true
return
} else {
let array = this.addForm.messageContext.match(/#短链#/g)&&this.addForm.messageContext.match(/#短链#/g).length
let array = this.addForm.messageContext.match(/#短链#/g) && this.addForm.messageContext.match(/#短链#/g).length
this.count = array ? array.length : 0
}
if (this.count > 1) {
......@@ -219,26 +220,27 @@ export default {
this.$message.error('导入客户有效数为0,请重新上传')
return
}
// this.$refs.configForm.validate(valid => {
// if (valid) {
// let params = {
// imName: this.addForm.imName,
// messageContext: this.addForm.messageContext,
// exportUrl: this.addForm.exportUrl,
// sendTime: this.addForm.date1 + ' ' + this.addForm.date2,
// exportName: this.importName
// }
// this.$apis.marketing.createMessageInfo(params).then(res => {
// this.$message({
// message: res.code == '0' ? '创建成功' : res.message,
// type: res.code == '0' ? 'success' : 'error'
// })
// if (res.code == 0) {
// this.$router.go(-1)
// }
// })
// }
// })
this.$refs.configForm.validate(valid => {
if (valid) {
let params = {
imName: this.addForm.imName,
messageContext: this.addForm.messageContext,
exportUrl: this.addForm.exportUrl,
sendTime: this.addForm.date1 + ' ' + this.addForm.date2,
exportName: this.importName
}
this.$apis.marketing.createMessageInfo(params).then(res => {
this.loading = false
this.$message({
message: res.code == '0' ? '创建成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == 0) {
this.$router.go(-1)
}
})
}
})
},
handleSure() {
this.$router.push('/marketing/index')
......@@ -295,7 +297,6 @@ export default {
const ws = wb.Sheets[wsname]
if (!ws['!ref']) {
this.$message.error('格式错误')
this.loading = false
return
}
const data = this.getHeaderRow(ws)
......@@ -324,7 +325,6 @@ export default {
return headers
},
handleSaveImport() {
this.loading = true
let params = {
exportUrl: this.addForm.exportUrl
}
......@@ -358,7 +358,7 @@ export default {
.container {
background: #ffffff;
margin-bottom: 16px;
padding:0;
padding: 0;
.title {
height: 56px;
line-height: 56px;
......@@ -441,7 +441,7 @@ export default {
.upload-result {
display: flex;
align-items: center;
margin-top:6px;
margin-top: 6px;
&-input {
width: 320px;
height: 26px;
......@@ -507,7 +507,7 @@ export default {
font-size: 12px;
color: #999999;
line-height: 20px;
margin-top:4px;
margin-top: 4px;
white-space: nowrap;
}
}
......@@ -532,7 +532,7 @@ export default {
border-radius: 4px;
word-wrap: break-word;
margin-bottom: 10px;
line-height: 15px;
line-height: 15px;
}
}
img {
......@@ -555,8 +555,8 @@ export default {
.number {
color: #2cca74;
font-size: 26px;
font-weight: 600;
margin-bottom:4px;
font-weight: 600;
margin-bottom: 4px;
}
}
.fail {
......@@ -564,9 +564,9 @@ export default {
flex: 1;
.number {
color: #eb4e4e;
font-size: 26px;
font-weight: 600;
margin-bottom:4px;
font-size: 26px;
font-weight: 600;
margin-bottom: 4px;
}
}
}
......
......@@ -239,7 +239,6 @@ export default {
}
},
handleInput(target) {
console.log(target)
// 即时更新数据
this.updateData(target.innerHTML)
let htm = target.innerHTML
......@@ -292,7 +291,6 @@ export default {
value(val) {
// 非锁定状态下,实时更新innerHTML
if (!this.isLocked) {
console.log(222222)
this.$refs.wTextareaContent.innerHTML = val
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!