<!--消息推送配置新增弹窗--> <template> <el-dialog :title="title" width="520px" :visible.sync="isShowInfo" append-to-body @close="close" > <!-- <dialog-header title="新增消息通知" @close="close"></dialog-header> --> <div class="brandDialog"> <div class="inputContent"> <div class="inputBox"> <red-star /> <input-vue v-model="massageInfo.messageTitle" title="消息标题" placeholder="请输入标题" width="300px" class="inputWidth" style="justify-content: space-between" /> </div> <div class="inputBox"> <red-star /> <input-vue title="消息内容" class="inputWidth" style="justify-content: space-between" > <el-input v-model="massageInfo.messageContent" style="width: 300px" type="textarea" :rows="3" placeholder="请输入内容" /> </input-vue> </div> <div class="inputBox" style="align-items: baseline"> <red-star /> <input-vue title="目标用户" placeholder="" width="300px" class="inputWidth" style="justify-content: space-between; align-items: baseline" > <div style="width: 100%; padding-left: 58px"> <div style="margin-top: 10px"> <el-radio v-model="massageInfo.userFlag" :label="1" > 全部用户 </el-radio> </div> <div style="margin-top: 10px"> <el-radio v-model="massageInfo.userFlag" :label="0" > 标签用户 </el-radio> <div v-if="massageInfo.userFlag==0" style="height: 80px; overflow: auto ;margin-top: 10px"> <el-checkbox-group v-model="checkList" :max="5"> <el-checkbox v-for="item in ProvinceList" :key="item.id" :label="item.areaName" /> </el-checkbox-group> </div> </div> </div> </input-vue> </div> </div> <div class="btnBox"> <el-button type="primary" class="save" @click="save"> 确定 </el-button> <el-button type="info" class="close" @click="close"> 取消 </el-button> </div> </div> </el-dialog> </template> <script> import InputVue from '../../input/inputVue.vue' import DialogHeader from '../dialogHeader.vue' import RedStar from '../../redStar.vue' import InputNumber from '../../input/inputNumber.vue' import { add } from '../../../../api/move/message' import { order_area } from '../../../../api/order/order' export default { components: { DialogHeader, RedStar, InputVue, InputNumber }, props: { dataInfo: {}, isShowInfo: { type: Boolean, default: true }, title: '' }, data() { return { checkList: [], ProvinceList: [], massageInfo: { messageTitle: '', messageContent: '', userFlag: 1, provinceList: [] } } }, mounted() { order_area('pid=0').then((res) => { console.log(res) this.ProvinceList = res }) }, methods: { close() { this.$emit('close') }, save() { if (this.title == '消息推送新增') { const temp = { ...this.massageInfo } if (this.massageInfo.userFlag == 0) { temp.provinceList = this.checkList } add(temp).then((res) => { if (res != '') { this.$message.success('新增成功') this.close() this.massageInfo = { messageTitle: '', messageContent: '', userFlag: 1, provinceList: [] } } }) } } } } </script> <style lang="scss" scoped> .brandDialog { width: 500px; .inputContent { padding: 20px; display: flex; flex-direction: column; justify-content: space-between; .inputBox { width: 100%; display: flex; align-items: center; } } .btnBox { padding: 30px; box-sizing: border-box; display: flex; align-items: center; justify-content: space-evenly; .save, .close { width: 100px; } } } </style>