| | |
| | | </a-form-model-item>
|
| | | </a-col>
|
| | | </a-row>
|
| | | <span><b>发布单位:</b>{{form.publishingUnit}}</span>
|
| | | <!-- <span><b>发布单位:</b>{{form.publishingUnit}}</span>-->
|
| | | <br /><br />
|
| | | <!-- 子单位-->
|
| | | <a-row :gutter="24">
|
| | |
| | | </a-checkbox>
|
| | | </div>
|
| | | <a-form-model-item prop="recipient">
|
| | | <a-select mode="multiple" placeholder="选择平级接收单位" v-model="form.recipient" @change="handle"
|
| | | :maxTagCount="3">
|
| | | <a-select-option v-for="item in filteredOptions" :key="item.id" :value="item.id">
|
| | | {{ item.recipientName }}({{item.company}} {{item.phone}})
|
| | | </a-select-option>
|
| | | </a-select>
|
| | | <!-- <a-select mode="multiple" placeholder="选择平级接收单位" v-model="form.recipient" @change="handle"-->
|
| | | <!-- :maxTagCount="3">-->
|
| | | <!-- <a-select-option v-for="item in filteredOptions" :key="item.id" :value="item.id">-->
|
| | | <!-- {{ item.recipientName }}({{item.company}} {{item.phone}})-->
|
| | | <!-- </a-select-option>-->
|
| | | <!-- </a-select>-->
|
| | | <a-tree-select
|
| | | v-model="form.recipient"
|
| | | style="width: 100%"
|
| | | :tree-data="treeData"
|
| | | tree-checkable
|
| | | placeholder="选择平级接收单位"
|
| | | :show-checked-strategy="SHOW_PARENT"
|
| | | search-placeholder="Please select"
|
| | | @change="handle"
|
| | | />
|
| | | </a-form-model-item>
|
| | | </a-col>
|
| | | </a-row>
|
| | |
| | | <h2>短信预览</h2>
|
| | | <div class="mobile">
|
| | | <div class="mesg">
|
| | | <P>【自然灾害风险预警提示】{{form.content}}<br>发布单位:{{form.publishingUnit}}</P>
|
| | | <P>【自然灾害风险预警提示】{{form.content}}</P>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | |
| | | import {
|
| | | deleteFile
|
| | | } from "@/api/list";
|
| | | import { TreeSelect } from 'ant-design-vue';
|
| | | const SHOW_PARENT = TreeSelect.SHOW_PARENT;
|
| | | const treeData = [];
|
| | | export default {
|
| | | name: "notice",
|
| | | data() {
|
| | | return {
|
| | | value: [],
|
| | | SHOW_PARENT,
|
| | | treeData,
|
| | | userInfo: {},
|
| | | unittype: null,
|
| | | wrapperCol: {
|
| | |
| | | let res = await getPeerRecipient()
|
| | | if (res.data.code == 100) {
|
| | | if (res.data.data) {
|
| | | t.filteredOptions = res.data.data
|
| | | // t.filteredOptions = res.data.data
|
| | |
|
| | | for (const resKey in res.data.data) {
|
| | | t.filteredOptions = t.filteredOptions.concat(...res.data.data[resKey]);
|
| | | console.log('t.filteredOptions',t.filteredOptions)
|
| | | const obj = {
|
| | | title: resKey,
|
| | | value: resKey,
|
| | | key: resKey,
|
| | | children: res.data.data[resKey].map(item => {
|
| | | return {
|
| | | title: item.recipientName + '(' +item.company +item.phone+ ')',
|
| | | value: item.id,
|
| | | key: item.id,
|
| | | }
|
| | | })
|
| | | }
|
| | | t.treeData.push(obj);
|
| | | }
|
| | | } else {
|
| | | console.log('暂无数据')
|
| | | }
|
| | |
| | | //选择平级部门部分
|
| | | handle(selectedItems) {
|
| | | const t = this
|
| | | if (t.form.recipient.length == t.filteredOptions.length) {
|
| | | t.checkSlAll = true
|
| | | } else {
|
| | | t.checkSlAll = false
|
| | | }
|
| | | // if (t.form.recipient.length == t.filteredOptions.length) {
|
| | | // t.checkSlAll = true
|
| | | // } else {
|
| | | // t.checkSlAll = false
|
| | | // }
|
| | | const group = t.treeData.map(item => item.value)
|
| | | if (group.length === t.form.recipient.length && group.every((v,i) => v === t.form.recipient[i])) {
|
| | | 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)
|
| | | // t.form.recipient = t.filteredOptions.map(i => i.id)
|
| | | t.form.recipient = t.treeData.map(item => item.value)
|
| | | } else {
|
| | | t.form.recipient = []
|
| | | }
|
| | |
| | | ...data
|
| | | } = this.form
|
| | | msgSend(data).then(res => {
|
| | |
|
| | | if (res.data.code == 100) {
|
| | | this.deleteFile()
|
| | | this.$message.success('信息已提交审核')
|
| | |
| | | }
|
| | |
|
| | | }
|
| | | </style> |
| | | </style>
|