zhanghua
2023-02-16 a8532e35b1a39de9bbcc5f2a648fe02c72d9c2b0
src/views/operate/sms/smsIndex/createSms/index.vue
@@ -8,7 +8,7 @@
                    <el-form-item class="optionItem" label="短信模板:" prop="messageType">
                        <div class="message-item">
                            <div class="message-item__left">
                                <el-select v-model="role.messageType" placeholder="请选择短信模板">
                                <el-select v-model="role.messageType" placeholder="请选择短信模板" @change="setTemplateValue">
                                    <el-option v-for="item in colList" :key="item.id" :label="item.title"
                                        :value="item.id">
                                    </el-option>
@@ -82,7 +82,7 @@
                    { required: true, trigger: "blur", message: '请输入短信标题' },
                ],
                targetTo: [
                    { required: true  , trigger: "blur", message: '请选择接收人' },
                    { required: true  , trigger: "blur", message: '请选择接收对象' },
                ],
                body: [
                  { required: true, trigger: ['blur', 'change'], validator: validateMessageContent }
@@ -172,6 +172,7 @@
        },
        // 选中id
        handleCheck(data, node) {
            this.checkedList = []
            node.checkedNodes.forEach(item => {
                if(!item.hasOwnProperty('departType')){
                    this.checkedList.push(item.id)
@@ -191,12 +192,20 @@
                  sendMessage(params)
                      .then(() => {
                        this.$message({ type: 'success', message: '操作成功' });
                        this.$emit('closeDialog');
                        this.$emit('closeMyDialog');
                      })
                      .catch(err => this.$message({ type: 'error', message: err }));
                } else {
                  this.$message.warning('请检查必填项');
                }
            })
        },
        setTemplateValue(obj){
            var _this=this
            SMS.getSMSTemplateById(obj).then((result) =>{
                _this.role.head=result.title
                _this.role.body=result.body
                _this.$refs.edit.editor.txt.html(result.body)
            })
        },
        // 重置表单
@@ -213,8 +222,8 @@
                url: 'sccg/admin/info?name=' + name,
            })
                .then(res => {
                    this.role.targetFrom = res.data.userId
                    this.sendUser = res.data.username
                    this.role.targetFrom = res.data.userId;
                    this.sendUser = res.data.username;
                })
        }
    }
@@ -223,29 +232,29 @@
<style lang="scss" scoped>
.createUser {
    border-radius: 1px;
    background-color: #09152f;
    background-color: white;
    main {
        text-align: left;
        background-color: #09152f;
        background-color: white;
        padding-bottom: 50px;
        .mainContent {
            display: flex;
            justify-content: center;
            padding-top: 50px;
            &:deep(.el-dialog__title) {
                color: #4b9bb7;
            }
            &::v-deep .el-form-item__label {
                color: #4b9bb7;
            }
            &::v-deep .el-input__inner {
                width: 400px;
                background-color: #09152f;
                border: 1px solid #17324c;
            }
            //&:deep(.el-dialog__title) {
            //    color: #4b9bb7;
            //}
            //&::v-deep .el-form-item__label {
            //    color: #4b9bb7;
            //}
            //
            //&::v-deep .el-input__inner {
            //    width: 400px;
            //    background-color: #09152f;
            //    border: 1px solid #17324c;
            //}
            .message-item__left {
                width: 400px;
@@ -261,9 +270,9 @@
                width: 400px;
            }
            :deep(.el-input) {
                width: 400px;
            }
            //:deep(.el-input) {
            //    width: 400px;
            //}
            .message-item {
                display: flex;
@@ -278,14 +287,14 @@
                margin-left: 20px;
            }
            :deep(.el-input--suffix) {
                width: 400px;
            }
            &::v-deep .el-textarea__inner {
                background-color: #09152f;
                border: 1px solid #17324c;
            }
            //:deep(.el-input--suffix) {
            //    width: 400px;
            //}
            //
            //&::v-deep .el-textarea__inner {
            //    background-color: #09152f;
            //    border: 1px solid #17324c;
            //}
            .el-form-item__content {
                width: 400px;
@@ -320,4 +329,4 @@
        }
    }
}
</style>
</style>