| | |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | //评级接收人分组 |
| | | |
| | | //分页查询 |
| | | export function getSameLevelGroup(data){ |
| | | return request({ |
| | | url: '/mesmanager/recipientGroup/page', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | //新增 |
| | | export function addSameLevelGroup(data){ |
| | | return request({ |
| | | url: '/mesmanager/recipientGroup/add ', |
| | | method: 'post', |
| | | data:data |
| | | }) |
| | | } |
| | | |
| | | //修改 |
| | | export function updateSameLevelGroup(data){ |
| | | return request({ |
| | | url: '/mesmanager/recipientGroup/update', |
| | | method: 'post', |
| | | data:data |
| | | }) |
| | | } |
| | | //删除 |
| | | export function delSameLevelGroup(id){ |
| | | return request({ |
| | | url:'/mesmanager/recipientGroup/delete?id=' + id, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | //列表 |
| | | export function getSameLevelGroupList(data){ |
| | | return request({ |
| | | url: '/mesmanager/recipientGroup/list', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | |
| | | },
|
| | | {
|
| | | MenuID: "34",
|
| | | MenuTitle: "平级接收人分组",
|
| | | MenuPath: "/samelevelGroup",
|
| | | },
|
| | | {
|
| | | MenuID: "35",
|
| | | MenuTitle: "原通讯录",
|
| | | MenuPath: "/addressBook",
|
| | | }
|
| | |
| | | },
|
| | | {
|
| | | MenuID: "34",
|
| | | MenuTitle: "平级接收人分组",
|
| | | MenuPath: "/samelevelGroup",
|
| | | },
|
| | | {
|
| | | MenuID: "35",
|
| | | MenuTitle: "原通讯录",
|
| | | MenuPath: "/addressBook",
|
| | | }
|
| | |
| | | meta: { title: 'App版本信息' }, |
| | | component: () => import('@/views/Admin/appFile.vue'), |
| | | }, |
| | | { |
| | | path: '/samelevelGroup', |
| | | name: 'samelevelGroup', |
| | | meta: { title: '平级接收人分组' }, |
| | | component: () => import('@/views/Admin/sameLevelGroup.vue'), |
| | | }, |
| | | // { |
| | | // path: '/menu', |
| | | // name: 'menu', |
对比新文件 |
| | |
| | | <template> |
| | | <a-modal |
| | | :title="title" |
| | | :visible="visible" |
| | | centered |
| | | :confirm-loading="confirmLoading" |
| | | width="50%" |
| | | cancelText="取消" |
| | | okText="确认" |
| | | @ok="onSubmit" |
| | | @cancel="handleCancel" |
| | | :afterClose="clearMod" |
| | | > |
| | | <a-form-model ref="ruleForm" :rules="rules" :model="form" :label-col="labelCol" :wrapper-col="wrapperCol" :colon="false"> |
| | | <a-form-model-item label="分组名称" prop="name"> |
| | | <a-input v-model="form.name"/> |
| | | </a-form-model-item> |
| | | </a-form-model> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import {addRecipient, addSameLevelGroup, addUser, updateRecipient, updateSameLevelGroup, updateUser} from "@/api/user"; |
| | | import {verifySimplePhone} from "@/util/validate"; |
| | | export default { |
| | | name: 'userMod', |
| | | props: [], |
| | | data () { |
| | | return { |
| | | title: '新增用户', |
| | | visible: false, |
| | | confirmLoading: false, |
| | | labelCol: { span: 4 }, |
| | | wrapperCol: { span: 14 }, |
| | | form: { |
| | | id: null, |
| | | name: '', |
| | | }, |
| | | rules: { |
| | | name: [{ required: true, message: '请输入分组名称', trigger: 'blur'}], |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | const t = this |
| | | }, |
| | | methods:{ |
| | | openDialog(type,data){ |
| | | const t = this |
| | | if(type == 'add'){ |
| | | t.title = '新增' |
| | | t.form = { |
| | | id: null, |
| | | name: '', |
| | | } |
| | | }else{ |
| | | t.title = '编辑' |
| | | for(let i in data){ |
| | | if(t.isValidKey(i,t.form)){ |
| | | t.form[i] = data[i] |
| | | } |
| | | } |
| | | } |
| | | t.visible = true |
| | | }, |
| | | |
| | | isValidKey(key, object){ |
| | | return key in object; |
| | | }, |
| | | |
| | | clearMod(){ |
| | | this.$refs.ruleForm.clearValidate() |
| | | this.$refs.ruleForm.resetFields() |
| | | }, |
| | | |
| | | onSubmit() { |
| | | this.$refs.ruleForm.validate(valid => { |
| | | if (valid) { |
| | | if(this.title == '新增'){ |
| | | const { id,...data } = this.form |
| | | addSameLevelGroup(data).then(res => { |
| | | if(res.data.code == 100){ |
| | | this.$message.success('新增成功') |
| | | this.$emit('refresh') |
| | | }else{ |
| | | this.$message.error(res.data.msg) |
| | | } |
| | | }) |
| | | }else{ |
| | | const data = this.form |
| | | updateSameLevelGroup(data).then((res)=>{ |
| | | if(res.data.code == 100){ |
| | | this.$message.success('修改成功') |
| | | this.$emit('refresh') |
| | | }else{ |
| | | this.$message.error(res.data.msg) |
| | | } |
| | | }) |
| | | } |
| | | this.visible = false |
| | | } else { |
| | | return false; |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | handleCancel(e) { |
| | | const t = this |
| | | t.visible = false; |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | |
| | | </style> |
| | |
| | | > |
| | | </a-tree-select> |
| | | </a-form-model-item> |
| | | <a-form-model-item label="选择分组" prop="peerRecipientGroupId"> |
| | | <a-select v-model="form.peerRecipientGroupId" style="width: 100%"> |
| | | <a-select-option v-for="item in groupData" :value="item.id" :key="item.id">{{item.name}}</a-select-option> |
| | | </a-select> |
| | | </a-form-model-item> |
| | | </a-form-model> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import {addRecipient, addUser, updateRecipient, updateUser} from "@/api/user"; |
| | | import {addRecipient, addUser, getSameLevelGroupList, updateRecipient, updateUser} from "@/api/user"; |
| | | import {verifySimplePhone} from "@/util/validate"; |
| | | export default { |
| | | name: 'userMod', |
| | |
| | | labelCol: { span: 4 }, |
| | | wrapperCol: { span: 14 }, |
| | | areaData: [], |
| | | groupData: [ |
| | | { |
| | | id: '', |
| | | name: '未分类' |
| | | } |
| | | ], |
| | | replaceFields: { |
| | | children:'children', |
| | | title:'name', |
| | |
| | | company: '', |
| | | phone: '', |
| | | unittype: null, |
| | | districtId: null |
| | | districtId: null, |
| | | peerRecipientGroupId: null |
| | | }, |
| | | rules: { |
| | | recipientName: [{ required: true, message: '请输入姓名或称呼', trigger: 'blur'}], |
| | | company: [{ required: true, message: '请输入单位名称(备注)', trigger: 'blur'}], |
| | | phone: [{ required: true, validator: validatePhone, trigger: 'blur'}] |
| | | phone: [{ required: true, validator: validatePhone, trigger: 'blur'}], |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | const t = this |
| | | t.getGroupList(); |
| | | }, |
| | | methods:{ |
| | | openDialog(type,data){ |
| | |
| | | company: '', |
| | | phone: '', |
| | | unittype: null, |
| | | districtId: null |
| | | districtId: null, |
| | | peerRecipientGroupId: null |
| | | } |
| | | }else{ |
| | | t.title = '编辑用户' |
| | |
| | | t.form[i] = data[i] |
| | | } |
| | | } |
| | | t.form.peerRecipientGroupId = data.peerRecipientGroupId ? data.peerRecipientGroupId: '' |
| | | } |
| | | t.visible = true |
| | | }, |
| | |
| | | isValidKey(key, object){ |
| | | return key in object; |
| | | }, |
| | | |
| | | async getGroupList () { |
| | | const t = this |
| | | const res = await getSameLevelGroupList(); |
| | | if(res.data.code == 100){ |
| | | t.groupData = t.groupData.concat(res.data.data) |
| | | }else{ |
| | | this.$message.error(res.data.msg) |
| | | } |
| | | }, |
| | | clearMod(){ |
| | | this.$refs.ruleForm.clearValidate() |
| | | this.$refs.ruleForm.resetFields() |
| | |
| | | <!-- </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"> |
| | |
| | | <h2>短信预览</h2> |
| | | <div class="mobile"> |
| | | <div class="mesg"> |
| | | <P>【自然灾害风险预警提示】{{form.content}}发布单位:{{form.publishingUnit}}</P> |
| | | <P>【自然灾害风险预警提示】{{form.content}}</P> |
| | | </div> |
| | | |
| | | </div> |
| | |
| | | } |
| | | |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | </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>
|
对比新文件 |
| | |
| | | <template> |
| | | <div class="inner"> |
| | | <a-row type="flex" justify="space-between" style="margin-bottom: 20px"> |
| | | <a-col :span="4"> |
| | | <a-button type="primary" @click="editData('add',{})">添加</a-button> |
| | | </a-col> |
| | | </a-row> |
| | | <div class="table-cont"> |
| | | <a-table :columns="columns" :data-source="tableData" :pagination="pagination" :rowKey="record=>record.id" bordered> |
| | | <template #action="action,row"> |
| | | <a-button type="link" @click="editData('edit',row)">编辑</a-button> |
| | | <a-button type="link" class="delBtn" @click="delData(row)">删除</a-button> |
| | | </template> |
| | | </a-table> |
| | | </div> |
| | | <same-level-mod-group ref="sameLevelMod" @refresh="getUserList"></same-level-mod-group> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import sameLevelModGroup from "@/views/Admin/components/sameLevelGroupMod.vue" |
| | | import {getUserInfo} from "@/util/storage"; |
| | | import {delSameLevelGroup, getSameLevelGroup} from "@/api/user"; |
| | | export default { |
| | | name: 'sameLevel', |
| | | components: { |
| | | sameLevelModGroup |
| | | }, |
| | | data () { |
| | | return { |
| | | areaVal: [], |
| | | unittype: null, |
| | | districtId: null, |
| | | search:{ |
| | | pageIndex: 1, |
| | | pageSize: 10, |
| | | }, |
| | | columns:[ |
| | | { |
| | | title: '分组名称', |
| | | dataIndex: 'name', |
| | | key: 'name', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: '操作', |
| | | width: '12%', |
| | | key: 'action', |
| | | scopedSlots: { customRender: 'action' } |
| | | }, |
| | | ], |
| | | tableData: [], |
| | | pagination: { |
| | | current: 1, |
| | | defaultCurrent: 1, |
| | | defaultPageSize: 10, |
| | | total: 0, |
| | | onChange: ( page, pageSize ) => this.onPageChange(page,pageSize), |
| | | showTotal: total => `共 ${total} 条` |
| | | }, |
| | | fieldNames:{ |
| | | label: 'name', |
| | | value: 'id', |
| | | children: 'children' |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | const t = this |
| | | t.unittype = getUserInfo().unittype |
| | | t.districtId = getUserInfo().districtId |
| | | t.getUserList() |
| | | }, |
| | | methods:{ |
| | | async getUserList(){ |
| | | const t = this |
| | | const res = await getSameLevelGroup(t.search); |
| | | if(res.data.code == 100){ |
| | | t.tableData = res.data.data |
| | | t.pagination.total = res.data.total |
| | | }else{ |
| | | t.$message.warning(res.data.msg); |
| | | } |
| | | }, |
| | | |
| | | resetSearch(){ |
| | | const t = this |
| | | t.areaVal = [] |
| | | t.search = { |
| | | pageIndex: 1, |
| | | pageSize: 10, |
| | | } |
| | | t.getUserList() |
| | | }, |
| | | |
| | | editData(type,data){ |
| | | const t = this |
| | | t.$refs.sameLevelMod.openDialog(type,data) |
| | | }, |
| | | |
| | | async delData(row){ |
| | | const t = this |
| | | this.$confirm({ |
| | | title: '提示', |
| | | content: h => <div>是否删除该条信息?</div>, |
| | | cancelText: '取消', |
| | | okText: '确认', |
| | | centered: true, |
| | | onOk() { |
| | | delSameLevelGroup(row.id).then(res=>{ |
| | | if(res.data.code == 100){ |
| | | t.$message.success('删除成功'); |
| | | t.getUserList() |
| | | }else{ |
| | | t.$message.warning(res.data.msg); |
| | | } |
| | | }) |
| | | }, |
| | | onCancel() { |
| | | console.log('Cancel'); |
| | | }, |
| | | }); |
| | | }, |
| | | onPageChange(page, pageSize) { |
| | | const t= this |
| | | t.pagination.current = page |
| | | t.search.pageIndex = page |
| | | t.getUserList() |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | .delBtn{ |
| | | color: @danger |
| | | } |
| | | </style> |