| | |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <div> |
| | | <div style="display:flex;justify-content: space-between;align-items: center;"> |
| | | <b>平级接收人选择:</b> |
| | | <a-checkbox :checked="checkSlAll" @change="checkSlChange"> |
| | | 全选 |
| | | </a-checkbox> |
| | | </div> |
| | | <a-form-model-item> |
| | | <a-select mode="multiple" placeholder="选择平级接收单位" v-model="form.recipient" @change="handle"> |
| | | <a-select-option v-for="item in filteredOptions" :key="item.id" :value="item.id"> |
| | | {{ item.recipientName }} |
| | | {{ item.recipientName }}({{item.company}} {{item.phone}}) |
| | | </a-select-option> |
| | | </a-select> |
| | | </a-form-model-item> |
| | |
| | | <h2>短信预览</h2> |
| | | <div class="mobile"> |
| | | <div class="mesg"> |
| | | <P>{{form.content}}发布单位:{{form.publishingUnit}}</P> |
| | | <P>【自然灾害风险预警提示】{{form.content}}发布单位:{{form.publishingUnit}}</P> |
| | | </div> |
| | | |
| | | </div> |
| | |
| | | horizontalRecipient: [] |
| | | }, |
| | | checkAll: false, |
| | | checkSlAll: false, |
| | | areaUsers: [], |
| | | replaceFields: { |
| | | children:'children', |
| | |
| | | t.userTitTree(res.data.data) |
| | | treeD.push(t.findNodeById(res.data.data,t.userInfo.districtId)) |
| | | t.areaUsers = treeD |
| | | console.log(t.areaUsers,t.unittype,'696969') |
| | | }else{ |
| | | console.log('暂无数据') |
| | | } |
| | |
| | | } |
| | | }, |
| | | |
| | | //选择平级部门部分 |
| | | handle(selectedItems) { |
| | | const t = this |
| | | if(t.form.recipient.length == t.filteredOptions.length){ |
| | | t.checkSlAll = true |
| | | }else{ |
| | | t.checkSlAll = false |
| | | } |
| | | }, |
| | | |
| | | checkSlChange(e) { |
| | | const t = this |
| | | t.checkSlAll = !t.checkSlAll |
| | | if(t.checkSlAll == true){ |
| | | t.form.recipient = t.filteredOptions.map(i=>i.id) |
| | | }else{ |
| | | t.form.recipient = [] |
| | | } |
| | | }, |
| | | |
| | | confirmSend(){ |
| | | this.$refs.ruleForm.validate(valid => { |
| | | if (valid) { |
| | |
| | | } |
| | | const newAList = [].concat(...aList) |
| | | for(let i of newAList){ |
| | | const {realName,id,...data} = i |
| | | const {realName,id,roleId,...data} = i |
| | | const {company: recipientUnit,...rest} = data |
| | | const obj = {recipientUnit,recipientType:1,...rest} |
| | | this.form.verticalRecipient.push(obj) |
| | |
| | | this.$message.success('信息群发成功') |
| | | this.$refs.ruleForm.clearValidate() |
| | | this.$refs.ruleForm.resetFields() |
| | | this.form.recipient = [] |
| | | |
| | | }else{ |
| | | this.$message.error(res.data.msg) |
| | | this.$refs.ruleForm.clearValidate() |
| | |
| | | handleLevel(selectedItems) { |
| | | // this.selectedItems = selectedItems; |
| | | }, |
| | | handle(selectedItems) { |
| | | // this.selectedItems = selectedItems; |
| | | }, |
| | | onChange(){ |
| | | console.log(this.value) |
| | | }, |
| | |
| | | traverseTree(treeData) { |
| | | let result = []; |
| | | function traverse(node) { |
| | | result.push({ label: node.name, value: node.id }); |
| | | if (node.children && node.children.length > 0) { |
| | | for (let child of node.children) { |
| | | traverse(child); |
| | | if(node.users && node.users.length>0){ |
| | | result.push({ label: node.name, value: node.id }); |
| | | if (node.children && node.children.length > 0) { |
| | | for (let child of node.children) { |
| | | traverse(child); |
| | | } |
| | | } |
| | | } |
| | | } |