Commit c1107728 by 黑潮

update: 企微任务详情

parent 28cba854
<template>
<div>
<el-dialog :title="isEdit ? '编辑企微任务' : '企微任务'" :visible.sync="show" width="630px" @closed="close">
<el-dialog :title="isEdit && !readOnly ? '编辑企微任务' : '企微任务'" :visible.sync="show" width="630px" @closed="close">
<dm-steps v-if="!isEdit" style="margin-bottom:30px" class="step-inner" :active="step" finish-status="success">
<dm-step title="编辑基本信息"></dm-step>
<dm-step title="配置任务完成方式"></dm-step>
......@@ -13,10 +13,10 @@
</el-select>
</el-form-item>
<el-form-item label="任务标题" prop="title">
<el-input show-word-limit v-model="form.title" :maxlength="20"></el-input>
<el-input show-word-limit v-model="form.title" :maxlength="20" :readonly="readOnly"></el-input>
</el-form-item>
<el-form-item label="任务描述" prop="remark">
<el-input class="task-desc" type="textarea" show-word-limit v-model="form.remark" :rows="4" :maxlength="200" resize="none"></el-input>
<el-input class="task-desc" type="textarea" show-word-limit v-model="form.remark" :rows="4" :maxlength="200" resize="none" :readonly="readOnly"></el-input>
</el-form-item>
<el-form-item>
<template slot="label">
......@@ -29,7 +29,7 @@
<span>发放对象</span>
<span>排序</span>
</div>
<draggable v-model="ruleList" animation="200" handle=".drag">
<draggable v-model="ruleList" animation="200" handle=".drag" :disabled="readOnly">
<transition-group>
<div class="rule-item" v-for="(el, i) in ruleList" :key="el.key">
<span>{{ i + 1 }}</span>
......@@ -43,37 +43,37 @@
<div class="tip">可点击表格处 <img style="width:12px;height:12px;" src="../assets/img/sort2.svg" /> 按钮进行拖拽排序。</div>
</el-form-item>
<el-form-item label="任务逾期判定" prop="expireDays">
<el-input-number v-model="form.expireDays" :min="1" controls-position="right"></el-input-number>
<el-input-number v-model="form.expireDays" :min="1" controls-position="right" :disabled="readOnly"></el-input-number>
<span>天之后</span>
</el-form-item>
</el-form>
<div v-if="isEdit" class="sub-title" style="margin-top:48px">任务完成方式</div>
<div v-show="step == 1 || isEdit">
<div class="task-wrapper">
<el-checkbox label="话务" v-model="form.telFlag" :true-label="1" :false-label="0"></el-checkbox>
<el-checkbox label="话务" v-model="form.telFlag" :true-label="1" :false-label="0" :disabled="readOnly"></el-checkbox>
</div>
<div class="task-wrapper">
<el-checkbox style="margin-bottom:0" label="会话" v-model="form.chatFlag" :true-label="1" :false-label="0"></el-checkbox>
<el-checkbox style="margin-bottom:0" label="会话" v-model="form.chatFlag" :true-label="1" :false-label="0" :disabled="readOnly"></el-checkbox>
<span style="color: #909399;font-size:12px;line-height:17px;margin-left:15px">最多可添加 5 个</span>
<div style="margin-bottom:16px;display:flex;flex-wrap:wrap;margin-top:12px">
<material-item class="card-item" v-for="item in materials" :key="item.relation_id" :item="item" @delete="onDeleteMaterial"></material-item>
<div v-show="materials.length < 5" class="chat-item card-item" @click="materialVisible = true">
<material-item class="card-item" v-for="item in materials" :key="item.relation_id" :item="item" @delete="onDeleteMaterial" :read-only="readOnly"></material-item>
<div v-show="materials.length < 5 && !readOnly" class="chat-item card-item" @click="materialVisible = true">
<i class="el-icon-plus"></i>
<span class="add-text">添加素材</span>
</div>
</div>
</div>
<div class="task-wrapper">
<el-checkbox label="短信" v-model="form.smsFlag" :true-label="1" :false-label="0"></el-checkbox>
<el-checkbox label="短信" v-model="form.smsFlag" :true-label="1" :false-label="0" :disabled="readOnly"></el-checkbox>
<el-row class="sms" type="flex">
<div class="sms-label">短信内容</div>
<div class="sms-template-wrapper">
<div class="sms-template-header">
<el-button type="text" @click="openDialog('smsTemplate')">选择模板</el-button>
<el-button type="text" @click="openDialog('smsTemplate')" :disabled="readOnly">选择模板</el-button>
<el-divider direction="vertical"></el-divider>
<el-button type="text" @click="openDialog('transferLink')">插入小程序链接</el-button>
<el-button type="text" @click="openDialog('transferLink')" :disabled="readOnly">插入小程序链接</el-button>
<el-divider direction="vertical"></el-divider>
<el-button type="text" @click="openDialog('reduceLink')">压缩网址</el-button>
<el-button type="text" @click="openDialog('reduceLink')" :disabled="readOnly">压缩网址</el-button>
<el-divider direction="vertical"></el-divider>
<el-popover v-model="showPopover" placement="top" trigger="click" width="600" :offset="148">
<div style="padding:8px;position:relative">
......@@ -118,20 +118,20 @@
<el-button type="text" slot="reference">查看变量</el-button>
</el-popover>
</div>
<el-input class="sms-template" v-model="form.smsContent" placeholder="亲爱的{2},{3}是你的生日,祝你生日快乐,心想事成!" type="textarea" :rows="4" resize="none" show-word-limit :maxlength="450"></el-input>
<el-input class="sms-template" v-model="form.smsContent" placeholder="亲爱的{2},{3}是你的生日,祝你生日快乐,心想事成!" type="textarea" :rows="4" resize="none" show-word-limit :maxlength="450" :readonly="readOnly"></el-input>
</div>
</el-row>
</div>
</div>
<template slot="footer" v-if="isEdit">
<template slot="footer" v-if="isEdit && !readOnly">
<el-button style="width:74px" :key="2" @click="close">取消</el-button>
<el-button style="width:74px" :key="2" type="primary" @click="addItem">确定</el-button>
</template>
<template slot="footer" v-else-if="step == 0">
<template slot="footer" v-else-if="step == 0 && !readOnly">
<el-button style="width:74px" :key="1" @click="close">取消</el-button>
<el-button style="width:74px" :key="1" type="primary" @click="onNext">下一步</el-button>
</template>
<template slot="footer" v-else-if="step == 1">
<template slot="footer" v-else-if="step == 1 && !readOnly">
<el-button style="width:74px" :key="2" type="primary" @click="step = 0">上一步</el-button>
<el-button style="width:74px" :key="2" type="primary" @click="addItem">确定</el-button>
</template>
......@@ -159,6 +159,10 @@ export default {
show: {
type: Boolean,
default: false
},
readOnly: {
type: Boolean,
default: false
}
},
components: {
......
<template>
<div class="material-item">
<img v-if="item.statusFlag === 0" class="invalid" src="../assets/img/invalid.svg" />
<el-button class="material-item__delete" type="text" @click="onDelete">删除</el-button>
<el-button v-if="!readOnly" class="material-item__delete" type="text" @click="onDelete">删除</el-button>
<template v-if="item.type == 1">
<div class="text__title">{{ item.title }}</div>
<div class="text__content">{{ item.content }}</div>
......@@ -31,7 +31,8 @@ const fileImg = require('../assets/img/file2.svg'); //eslint-disable-line
export default {
name: 'material-item',
props: {
item: Object
item: Object,
readOnly: Boolean
},
data() {
return {
......
......@@ -22,6 +22,7 @@
<i class="el-icon-delete dm-marketing__opt--icon"></i>
</dm-delete>
</template>
<i v-else-if="v.comName == 'item-qywx'" class="el-icon-edit dm-marketing__opt--icon" @click="editItem(v)"></i>
</div>
</div>
</div>
......@@ -32,7 +33,7 @@
</transition>
</div>
<!-- 弹窗组件 -->
<component :is="dialogCom" @sendItem="saveToList" :showOutCouponIcon="showOutCouponIcon" :item="currentItem" :show.sync="dialogShow" :isSupportVar="isSupportVar" :cardLimitType="cardLimitType" :integralMultiple="integralMultiple" :singleFlag="singleFlag"></component>
<component :is="dialogCom" @sendItem="saveToList" :showOutCouponIcon="showOutCouponIcon" :item="currentItem" :show.sync="dialogShow" :isSupportVar="isSupportVar" :cardLimitType="cardLimitType" :integralMultiple="integralMultiple" :singleFlag="singleFlag" :read-only="readOnly"></component>
</section>
</template>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment