| | |
| | | :model="role" |
| | | :rules="createRoleRules" |
| | | label-position="right" |
| | | :disabled="type === 'view'" |
| | | > |
| | | <!-- 提醒方式 --> |
| | | <el-form-item class="optionItem" label="提醒方式:" prop="channelCode"> |
| | | <el-form-item class="optionItem" label="提醒方式:" prop="channelCode" > |
| | | <el-radio-group v-model="role.channelCode"> |
| | | <el-radio label="01">站内信</el-radio> |
| | | <el-radio label="03">邮件</el-radio> |
| | |
| | | show-checkbox |
| | | @check="handleCheck" |
| | | default-expand-all |
| | | :default-checked-keys="checkedList" |
| | | node-key="id" |
| | | > |
| | | </el-tree> |
| | |
| | | type="primary" |
| | | @click.native.prevent="handleSubmit(0)" |
| | | class="btn save" |
| | | v-if="type !== 'view'" |
| | | >保存 |
| | | </el-button> |
| | | <el-button |
| | | type="primary" |
| | | @click.native.prevent="handleSubmit(1)" |
| | | class="btn submit" |
| | | v-if="type !== 'view'" |
| | | >发布 |
| | | </el-button> |
| | | <el-button |
| | | type="primary" |
| | | @click.native.prevent="handleView" |
| | | class="btn submit" |
| | | v-if="type !== 'view'" |
| | | >预览 |
| | | </el-button> |
| | | <el-button class="btn cancel" @click.native.prevent="handleReset" |
| | | <el-button class="btn cancel" @click.native.prevent="handleReset" v-if="type !== 'view'" |
| | | >重置</el-button |
| | | > |
| | | </div> |
| | |
| | | getMessageById(this.myDataRow.id) |
| | | .then(res => { |
| | | this.role = res; |
| | | this.role.targetTo = `${this.role.targetTo.split(',').length}人`; |
| | | if (res.targetTo) { |
| | | this.checkedList = res.targetTo.split(','); |
| | | 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: { |
| | | // 关闭弹窗 |
| | |
| | | this.getColumnList(); |
| | | } |
| | | }, |
| | | |
| | | getType(){ |
| | | return this.type; |
| | | }, |
| | | // 获取部门树 |
| | | async getDepartList() { |
| | | await this.$axios({ |
| | |
| | | |
| | | // 选中id |
| | | handleCheck(data, node) { |
| | | node.checkedNodes.forEach((item) => { |
| | | if (!item.hasOwnProperty("departType")) { |
| | | this.checkedList.push(item.id); |
| | | this.tempNameArr.push(item.departName); |
| | | } |
| | | }); |
| | | this.role.targetTo = this.checkedList.length + "人"; |
| | | const checkedNodes = node.checkedNodes.filter(item => !item.children); |
| | | this.checkedList = checkedNodes.map(item => item.id); |
| | | this.tempNameArr = checkedNodes.map(item => item.departName); |
| | | this.role.targetTo = this.checkedList.length ? this.checkedList.length + "人" : null; |
| | | }, |
| | | |
| | | // 新建/保存消息(1:新建,0保存消息) |
| | |
| | | }) |
| | | ); |
| | | } else { |
| | | updateMessage(params) |
| | | updateMessage({ id: this.myDataRow.id, ...params }) |
| | | .then(() => { |
| | | this.$emit("closeMyDialog"); |
| | | this.$message({ type: "success", message: "操作成功" }); |