| | |
| | | :model="role" |
| | | :rules="createRoleRules" |
| | | label-position="right" |
| | | :disabled="edit" |
| | | :disabled="type === 'view'" |
| | | > |
| | | <!-- 提醒方式 --> |
| | | <el-form-item class="optionItem" label="提醒方式:" prop="channelCode" > |
| | |
| | | type="primary" |
| | | @click.native.prevent="handleSubmit(0)" |
| | | class="btn save" |
| | | v-if="this.type=='update'||this.type=='create'" |
| | | v-if="type !== 'view'" |
| | | >保存 |
| | | </el-button> |
| | | <el-button |
| | | type="primary" |
| | | @click.native.prevent="handleSubmit(1)" |
| | | class="btn submit" |
| | | v-if="this.type=='update'||this.type=='create'" |
| | | v-if="type !== 'view'" |
| | | >发布 |
| | | </el-button> |
| | | <el-button |
| | | type="primary" |
| | | @click.native.prevent="handleView" |
| | | class="btn submit" |
| | | v-if="this.type=='update'||this.type=='create'" |
| | | v-if="type !== 'view'" |
| | | >预览 |
| | | </el-button> |
| | | <el-button class="btn cancel" @click.native.prevent="handleReset" v-if="this.type=='update'||this.type=='create'" |
| | | <el-button class="btn cancel" @click.native.prevent="handleReset" v-if="type !== 'view'" |
| | | >重置</el-button |
| | | > |
| | | </div> |
| | |
| | | import MyEditor from "@/components/edit"; |
| | | import MyColumnAdd from "@/views/operate/message/mycontrol/createUser"; |
| | | import MyColView from "../messageView"; |
| | | import { sendMessage, updateMessage, getMessageById } from "@/api/operate/messageManagement"; |
| | | import { sendMessage, updateMessage, getMessageById,saveMessage } from "@/api/operate/messageManagement"; |
| | | |
| | | export default { |
| | | components: { MyEditor, MyColumnAdd, MyColView }, |
| | |
| | | }, |
| | | ], |
| | | }, |
| | | edit: false, |
| | | colList: [], |
| | | departList: [], |
| | | typeList: [], |
| | |
| | | this.getColumnList(); |
| | | this.getDepartList(); |
| | | this.getLoginUserInfo(); |
| | | if(this.type=="view"){ |
| | | this.edit=true; |
| | | } |
| | | if (this.type !== "create" && this.myDataRow) { |
| | | getMessageById(this.myDataRow.id) |
| | | .then(res => { |
| | | this.role = res; |
| | | if (res.targetTo) { |
| | | this.checkedList = res.targetTo.split(','); |
| | | this.role.targetTo = `${this.checkedList}人`; |
| | | this.role.targetTo = `${this.checkedList.length}人`; |
| | | } |
| | | }) |
| | | .catch(err => this.$message.error(`${err}`)) |
| | |
| | | if (this.type !== 'create') { |
| | | this.$refs.edit.editor.txt.append(this.myDataRow.body); |
| | | } |
| | | |
| | | |
| | | }, |
| | | methods: { |
| | | // 关闭弹窗 |
| | |
| | | async getColumnList() { |
| | | await this.$axios({ |
| | | method: "get", |
| | | url: "sccg/message_column/getShowColumn", |
| | | url: "sccg/message_column/show ", |
| | | }).then((res) => { |
| | | this.colList = res.data; |
| | | }); |
| | |
| | | this.role.body = this.$refs.edit.editor.txt.html(); |
| | | this.$refs.user.validate((valid) => { |
| | | if (valid) { |
| | | const { body, head, messageType, channelCode } = this.role; |
| | | if(mystatus==1){ |
| | | const { body, head, messageType, channelCode } = this.role; |
| | | const params = { |
| | | body, |
| | | head, |
| | |
| | | }) |
| | | ); |
| | | } |
| | | } |
| | | if(mystatus==0){ |
| | | const { body, head, messageType, channelCode } = this.role; |
| | | const params = { |
| | | body, |
| | | head, |
| | | messageType, |
| | | channelCode: `${channelCode}`, |
| | | sendTime: new Date(), |
| | | targetTo: this.checkedList.join(","), |
| | | status: mystatus, |
| | | }; |
| | | if (this.role.channelCode === '03') { |
| | | delete params.messageType; |
| | | } |
| | | if (this.type === "create") { |
| | | saveMessage(params) |
| | | .then(() => { |
| | | this.$emit("closeMyDialog"); |
| | | this.$message({ type: "success", message: "操作成功" }); |
| | | }) |
| | | .catch((err) => |
| | | this.$message({ |
| | | type: "error", |
| | | message: err.data || err.message, |
| | | }) |
| | | ); |
| | | } else { |
| | | updateMessage({ id: this.myDataRow.id, ...params }) |
| | | .then(() => { |
| | | this.$emit("closeMyDialog"); |
| | | this.$message({ type: "success", message: "操作成功" }); |
| | | }) |
| | | .catch((err) => |
| | | this.$message({ |
| | | type: "error", |
| | | message: err.data || err.message, |
| | | }) |
| | | ); |
| | | } |
| | | } |
| | | |
| | | } else { |
| | | this.$message.error({ type: "warning", message: "请检查必填项" }); |
| | | } |
| | |
| | | <style lang="scss" scoped> |
| | | .createUser { |
| | | border-radius: 1px; |
| | | background-color: #09152f; |
| | | background-color: white; |
| | | |
| | | main { |
| | | text-align: left; |
| | | padding: 0 55px; |
| | | background-color: #09152f; |
| | | background-color: white; |
| | | |
| | | .mainContent { |
| | | display: flex; |
| | | justify-content: center; |
| | | padding-top: 50px; |
| | | &:deep(.el-dialog__title) { |
| | | color: #4b9bb7; |
| | | //color: #4b9bb7; |
| | | } |
| | | &::v-deep .el-form-item__label { |
| | | color: #4b9bb7; |
| | | //color: #4b9bb7; |
| | | } |
| | | |
| | | &::v-deep .el-input__inner { |
| | | width: 400px; |
| | | background-color: #09152f; |
| | | border: 1px solid #17324c; |
| | | //background-color: #09152f; |
| | | //border: 1px solid #17324c; |
| | | } |
| | | |
| | | .message-item__left { |
| | |
| | | |
| | | span { |
| | | margin-left: 20px; |
| | | color: #4b9bb7; |
| | | color: #606266; |
| | | } |
| | | } |
| | | |
| | |
| | | width: 400px; |
| | | } |
| | | |
| | | &::v-deep .el-textarea__inner { |
| | | background-color: #09152f; |
| | | border: 1px solid #17324c; |
| | | } |
| | | // &::v-deep .el-textarea__inner { |
| | | // //background-color: #09152f; |
| | | // //border: 1px solid #17324c; |
| | | // } |
| | | |
| | | .el-form-item__content { |
| | | width: 400px; |
| | |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | | </style> |