|
@@ -18,12 +18,19 @@
|
|
|
class="elTable table-fixed"
|
|
|
:max-height="myHeight"
|
|
|
>
|
|
|
- <el-table-column label="消息名称" min-width="130px" align="center" prop="rolename" />
|
|
|
- <el-table-column label="触发条件" min-width="130px" align="center" prop="rolename" />
|
|
|
- <el-table-column label="提醒类型" min-width="130px" align="center" prop="rolename" />
|
|
|
- <el-table-column label="推送方式" min-width="130px" align="center" prop="rolename" />
|
|
|
- <el-table-column label="详细配置" min-width="130px" align="center" prop="rolename" />
|
|
|
- <el-table-column label="提醒对象" min-width="130px" align="center" prop="rolename" />
|
|
|
+ <el-table-column label="消息名称" min-width="130px" align="center" prop="message" />
|
|
|
+ <el-table-column label="触发条件" min-width="130px" align="center" prop="trigger" />
|
|
|
+ <el-table-column label="发送方式" min-width="130px" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.data.remind_type }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="详细配置" min-width="130px" align="center">
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ <a class="correcting" size="mini" style="width: 80px;" @click="handleSee(row)">查看</a>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="提醒对象" min-width="130px" align="center" prop="user" />
|
|
|
<el-table-column label="操作" align="center" width="150" class-name="small-padding fixed-width" fixed="right">
|
|
|
<template slot-scope="{row}">
|
|
|
<a class="correcting" size="mini" style="width: 80px;" @click="handleSetUp(row)">设置</a>
|
|
@@ -31,6 +38,7 @@
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
+ <!-- 设置 -->
|
|
|
<el-dialog :title="textMap[setUp.dialogStatus]" :visible.sync="setUp.dialogFormVisible" :close-on-click-modal="false" width="70%">
|
|
|
<div class="setup">
|
|
|
<div style="height: 500px;">
|
|
@@ -40,14 +48,14 @@
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="消息名称:" prop="messageName">
|
|
|
- <el-input v-model="temp.messageName" style="width: 100%;" class="filter-item" placeholder="消息名称" />
|
|
|
+ <span>{{temp.messageName}}</span>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="触发条件:" prop="triggerCondition">
|
|
|
- <el-input ref="triggerCondition" v-model="temp.triggerCondition" style="width: 100%;" class="filter-item" placeholder="触发条件" type="text" />
|
|
|
+ <span>{{temp.triggerCondition}}</span>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -60,6 +68,29 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
+ <div v-if="temp.sendingMethod == '1'">
|
|
|
+ <el-row :gutter="5">
|
|
|
+ <el-col :span="18">
|
|
|
+ <el-form-item label="发送机制">
|
|
|
+ <el-select v-model="temp.sendingMechanism" style="width: 100%;" placeholder="发送机制">
|
|
|
+ <el-option v-for="item in mechanismList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6" v-if="temp.sendingMechanism == '2'">
|
|
|
+ <el-input ref="numberCycles" v-model="temp.numberCycles" style="width: 100%;" placeholder="循环次数" type="text" />
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row v-if="temp.sendingMechanism !== '1' && temp.sendingMechanism !== ''">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="间隔周期:">
|
|
|
+ <el-input ref="intervalPeriod1" v-model="temp.intervalPeriod1" style="width: 33%;margin-right:1%" placeholder="天" type="text" />
|
|
|
+ <el-input ref="intervalPeriod2" v-model="temp.intervalPeriod2" style="width: 33%;margin-right:1%" placeholder="小时" type="text" />
|
|
|
+ <el-input ref="intervalPeriod3" v-model="temp.intervalPeriod3" style="width: 32%;" placeholder="分钟" type="text" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
<div v-if="temp.sendingMethod == '2'">
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
@@ -73,7 +104,7 @@
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="发送时间">
|
|
|
- <el-time-select placeholder="发送时间" style="width: 100%;" v-model="temp.sendTime" :picker-options="{ start: '00:00', step: '00:15', end: '23:59' }" />
|
|
|
+ <el-time-select placeholder="发送时间" :clearable="false" style="width: 100%;" v-model="temp.sendTime" :picker-options="{ start: '00:00', step: '00:15', end: '23:59' }" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -129,7 +160,7 @@
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="发送时间">
|
|
|
- <el-time-select placeholder="发送时间" style="width: 100%;" v-model="temp.sendTime" :picker-options="{ start: '00:00', step: '00:15', end: '23:59' }" />
|
|
|
+ <el-time-select placeholder="发送时间" :clearable="false" style="width: 100%;" v-model="temp.sendTime" :picker-options="{ start: '00:00', step: '00:15', end: '23:59' }" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -138,55 +169,56 @@
|
|
|
</el-col>
|
|
|
<el-col :span="16">
|
|
|
<b>提醒对象:</b>
|
|
|
- <el-tabs v-model="activeName" @tab-click="handleClick">
|
|
|
- <el-tab-pane label="角色" name="first">
|
|
|
- <el-table
|
|
|
- :key="setUp.table1.tableKey"
|
|
|
- v-loading="setUp.table1.listLoading"
|
|
|
- element-loading-text="给我一点时间"
|
|
|
- :data="setUp.table1.list"
|
|
|
- border
|
|
|
- fit
|
|
|
- highlight-current-row
|
|
|
- style="width: 100%;"
|
|
|
- :row-style="rowStyle"
|
|
|
- :cell-style="cellStyle"
|
|
|
- class="elTable table-fixed"
|
|
|
- @selection-change="handleSelectionChange"
|
|
|
- :max-height="450"
|
|
|
- >
|
|
|
- <el-table-column type="selection" align="center" width="50" />
|
|
|
- <el-table-column label="角色名称" min-width="130px" align="center" prop="rolename" />
|
|
|
- </el-table>
|
|
|
- </el-tab-pane>
|
|
|
- <el-tab-pane label="用户" name="second">
|
|
|
- <div class="search">
|
|
|
- <el-input v-model="setUp.table2.getdataListParm.parammaps.empCode" placeholder="用户名称" style="width: 180px;" class="filter-item" clearable />
|
|
|
- <el-input v-model="setUp.table2.getdataListParm.parammaps.empname" placeholder="员工姓名" style="width: 180px;" class="filter-item" clearable />
|
|
|
- <el-button class="successBorder" @click="handleSearch">查询</el-button>
|
|
|
- </div>
|
|
|
- <el-table
|
|
|
- :key="setUp.table2.tableKey"
|
|
|
- v-loading="setUp.table2.listLoading"
|
|
|
- element-loading-text="给我一点时间"
|
|
|
- :data="setUp.table2.list"
|
|
|
- border
|
|
|
- fit
|
|
|
- highlight-current-row
|
|
|
- style="width: 100%;"
|
|
|
- :row-style="rowStyle"
|
|
|
- :cell-style="cellStyle"
|
|
|
- class="elTable table-fixed"
|
|
|
- @selection-change="handleSelectionChange"
|
|
|
- :max-height="450"
|
|
|
- >
|
|
|
- <el-table-column type="selection" align="center" width="50" />
|
|
|
- <el-table-column label="用户名称" min-width="130px" align="center" prop="username" />
|
|
|
- <el-table-column label="员工姓名" min-width="130px" align="center" prop="empname" />
|
|
|
- <el-table-column label="角色" min-width="130px" align="center" prop="rolename" />
|
|
|
- </el-table>
|
|
|
- </el-tab-pane>
|
|
|
- </el-tabs>
|
|
|
+ <div class="search">
|
|
|
+ <el-input v-model="setUp.empCode" placeholder="角色名称" style="width: 180px;" class="filter-item" clearable />
|
|
|
+ <el-input v-model="setUp.empCode" placeholder="用户名称" style="width: 180px;" class="filter-item" clearable />
|
|
|
+ <el-input v-model="setUp.empname" placeholder="员工姓名" style="width: 180px;" class="filter-item" clearable />
|
|
|
+ <el-button class="successBorder" @click="handleSearch">查询</el-button>
|
|
|
+ </div>
|
|
|
+ <el-row :gutter="5">
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-table
|
|
|
+ :key="setUp.tableKey1"
|
|
|
+ v-loading="setUp.listLoading1"
|
|
|
+ element-loading-text="给我一点时间"
|
|
|
+ :data="setUp.list1"
|
|
|
+ border
|
|
|
+ fit
|
|
|
+ highlight-current-row
|
|
|
+ style="width: 100%;"
|
|
|
+ :row-style="rowStyle"
|
|
|
+ :cell-style="cellStyle"
|
|
|
+ class="elTable table-fixed"
|
|
|
+ @selection-change="handleSelectionChange1"
|
|
|
+ :height="450"
|
|
|
+ >
|
|
|
+ <el-table-column type="selection" align="center" width="50" />
|
|
|
+ <el-table-column label="角色名" min-width="100px" align="center" prop="rolename" />
|
|
|
+ </el-table>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="18">
|
|
|
+ <el-table
|
|
|
+ :key="setUp.tableKey2"
|
|
|
+ v-loading="setUp.listLoading2"
|
|
|
+ element-loading-text="给我一点时间"
|
|
|
+ :data="setUp.list2"
|
|
|
+ border
|
|
|
+ fit
|
|
|
+ highlight-current-row
|
|
|
+ style="width: 100%;"
|
|
|
+ :row-style="rowStyle"
|
|
|
+ :cell-style="cellStyle"
|
|
|
+ class="elTable table-fixed"
|
|
|
+ @selection-change="handleSelectionChange2"
|
|
|
+ :height="450"
|
|
|
+ >
|
|
|
+ <el-table-column type="selection" align="center" width="50" />
|
|
|
+ <el-table-column label="用户名称" min-width="130px" align="center" prop="username" />
|
|
|
+ <el-table-column label="员工姓名" min-width="130px" align="center" prop="empname" />
|
|
|
+ <el-table-column label="角色" min-width="130px" align="center" prop="rolename" />
|
|
|
+ </el-table>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
@@ -196,7 +228,116 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
-
|
|
|
+ <!-- 查看 -->
|
|
|
+ <el-dialog :title="textMap[see.dialogStatus]" :visible.sync="see.dialogFormVisible" :close-on-click-modal="false" width="40%">
|
|
|
+ <div class="setup">
|
|
|
+ <div style="height: 500px;">
|
|
|
+ <el-form ref="temp" :rules="temp.rules" :model="temp" label-position="right" label-width="110px" style="width: 100%;margin:0 auto">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="消息名称:" prop="messageName">
|
|
|
+ <span>{{temp.messageName}}</span>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="触发条件:" prop="triggerCondition">
|
|
|
+ <span>{{temp.triggerCondition}}</span>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="发送方式:" prop="sendingMethod">
|
|
|
+ <el-select v-model="temp.sendingMethod" style="width: 100%;" placeholder="发送方式">
|
|
|
+ <el-option v-for="item in modeList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <div v-if="temp.sendingMethod == '2'">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="延时:">
|
|
|
+ <el-input ref="delayed1" v-model="temp.delayed1" style="width: 33%;margin-right:1%" placeholder="天" type="text" />
|
|
|
+ <el-input ref="delayed2" v-model="temp.delayed2" style="width: 33%;margin-right:1%" placeholder="小时" type="text" />
|
|
|
+ <el-input ref="delayed3" v-model="temp.delayed3" style="width: 32%;" placeholder="分钟" type="text" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="发送时间">
|
|
|
+ <el-time-select placeholder="发送时间" style="width: 100%;" v-model="temp.sendTime" :picker-options="{ start: '00:00', step: '00:15', end: '23:59' }" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="5">
|
|
|
+ <el-col :span="18">
|
|
|
+ <el-form-item label="发送机制">
|
|
|
+ <el-select v-model="temp.sendingMechanism" style="width: 100%;" placeholder="发送机制">
|
|
|
+ <el-option v-for="item in mechanismList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6" v-if="temp.sendingMechanism == '2'">
|
|
|
+ <el-input ref="numberCycles" v-model="temp.numberCycles" style="width: 100%;" placeholder="循环次数" type="text" />
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row v-if="temp.sendingMechanism !== '1' && temp.sendingMechanism !== ''">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="间隔周期:">
|
|
|
+ <el-input ref="intervalPeriod1" v-model="temp.intervalPeriod1" style="width: 33%;margin-right:1%" placeholder="天" type="text" />
|
|
|
+ <el-input ref="intervalPeriod2" v-model="temp.intervalPeriod2" style="width: 33%;margin-right:1%" placeholder="小时" type="text" />
|
|
|
+ <el-input ref="intervalPeriod3" v-model="temp.intervalPeriod3" style="width: 32%;" placeholder="分钟" type="text" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ <div v-if="temp.sendingMethod == '3'">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="发送机制:">
|
|
|
+ <span>持续循环</span>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="5">
|
|
|
+ <el-col :span="18">
|
|
|
+ <el-form-item label="周期类型">
|
|
|
+ <el-select v-model="temp.cycleType" style="width: 100%;" placeholder="周期类型">
|
|
|
+ <el-option v-for="item in cycleTypeList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6" v-if="temp.cycleType == '2'">
|
|
|
+ <el-select v-model="temp.week" style="width: 100%;" placeholder="每周">
|
|
|
+ <el-option v-for="item in weekList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
+ </el-select>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6" v-if="temp.cycleType == 3">
|
|
|
+ <el-select v-model="temp.month" style="width: 100%;" placeholder="每月">
|
|
|
+ <el-option v-for="item in monthList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
+ </el-select>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="发送时间">
|
|
|
+ <el-time-select placeholder="发送时间" style="width: 100%;" v-model="temp.sendTime" :picker-options="{ start: '00:00', step: '00:15', end: '23:59' }" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom: 40px;">
|
|
|
+ <el-button class="cancelClose" @click="see.dialogFormVisible = false;getList(); ">取消</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 扫码 -->
|
|
|
<el-dialog :title="textMap[QRcode.dialogStatus]" :visible.sync="QRcode.dialogFormVisible" :close-on-click-modal="false" width="50%">
|
|
|
<div class="QRcode">
|
|
|
<div class="content">
|
|
@@ -216,7 +357,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import { GetDataByName,postJson2 } from '@/api/common'
|
|
|
+ import { GetDataByName,postJson2,postJson } from '@/api/common'
|
|
|
import Cookies from 'js-cookie'
|
|
|
export default {
|
|
|
name: 'ReminderSettings',
|
|
@@ -267,16 +408,6 @@
|
|
|
mechanism: '0',
|
|
|
activeName:'first',
|
|
|
table: {
|
|
|
- getdataListParm: {
|
|
|
- name: 'getRoleList',
|
|
|
- page: 1,
|
|
|
- offset: 1,
|
|
|
- pagecount: parseInt(Cookies.get('pageCount')),
|
|
|
- returntype: 'Map',
|
|
|
- parammaps: {
|
|
|
- pastureid: Cookies.get('pastureid')
|
|
|
- }
|
|
|
- },
|
|
|
tableKey: 0,
|
|
|
list: [],
|
|
|
total: 0,
|
|
@@ -285,39 +416,37 @@
|
|
|
setUp:{
|
|
|
dialogStatus: '',
|
|
|
dialogFormVisible:false,
|
|
|
- table1: {
|
|
|
- getdataListParm: {
|
|
|
- name: 'getRoleList',
|
|
|
- page: 1,
|
|
|
- offset: 1,
|
|
|
- pagecount: parseInt(Cookies.get('pageCount')),
|
|
|
- returntype: 'Map',
|
|
|
- parammaps: {
|
|
|
- pastureid: Cookies.get('pastureid')
|
|
|
- }
|
|
|
- },
|
|
|
- tableKey: 0,
|
|
|
- list: [],
|
|
|
- total: 0,
|
|
|
- listLoading: false
|
|
|
+ // 角色
|
|
|
+ tableKey1: 0,
|
|
|
+ list1: [],
|
|
|
+ total1: 0,
|
|
|
+ listLoading1: false,
|
|
|
+ data1:{
|
|
|
+ name: 'getRoleList', page: 1, offset: 1, pagecount:'',returntype: 'Map',
|
|
|
+ parammaps: {
|
|
|
+ pastureid: Cookies.get('pastureid')
|
|
|
+ }
|
|
|
},
|
|
|
- table2: {
|
|
|
- getdataListParm: {
|
|
|
- name: 'getuserallL',
|
|
|
- page: 1,
|
|
|
- offset: 1,
|
|
|
- pagecount: parseInt(Cookies.get('pageCount')),
|
|
|
- returntype: 'Map',
|
|
|
- parammaps: {
|
|
|
- pastureid: Cookies.get('pastureid')
|
|
|
- }
|
|
|
- },
|
|
|
- tableKey: 0,
|
|
|
- list: [],
|
|
|
- total: 0,
|
|
|
- listLoading: false
|
|
|
+ selectList1:[],
|
|
|
+ // 用户
|
|
|
+ tableKey2: 0,
|
|
|
+ list2: [],
|
|
|
+ total2: 0,
|
|
|
+ listLoading2: false,
|
|
|
+ data2:{
|
|
|
+ name: 'getuserallL', page: 1, offset: 1, pagecount:'',returntype: 'Map',
|
|
|
+ parammaps: {
|
|
|
+ pastureid: Cookies.get('pastureid'),
|
|
|
+ roleid:''
|
|
|
+ }
|
|
|
},
|
|
|
- selectList:[]
|
|
|
+ selectList2:[],
|
|
|
+ temp:{}
|
|
|
+ },
|
|
|
+ see:{
|
|
|
+ dialogStatus: '',
|
|
|
+ dialogFormVisible:false,
|
|
|
+ temp:{}
|
|
|
},
|
|
|
QRcode:{
|
|
|
dialogStatus: '',
|
|
@@ -327,7 +456,8 @@
|
|
|
textMap: {
|
|
|
setup: '设置',
|
|
|
QRcode:'提示',
|
|
|
- add:'新增'
|
|
|
+ add:'新增',
|
|
|
+ see:'查看'
|
|
|
},
|
|
|
isokDisable:false,
|
|
|
rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
|
|
@@ -348,12 +478,16 @@
|
|
|
methods: {
|
|
|
getList() {
|
|
|
this.table.listLoading = true
|
|
|
- // let url = 'http://tmrwatch.cn/notice/msgtype'
|
|
|
- // let data = {}
|
|
|
- GetDataByName(this.table.getdataListParm).then(response => {
|
|
|
- if (response.data.list !== null) {
|
|
|
- console.log('table数据', response.data.list)
|
|
|
- this.table.list = response.data.list
|
|
|
+ let url = 'authdata/remind/list'
|
|
|
+ let data = {
|
|
|
+ parammaps:{
|
|
|
+ pastureid:Cookies.get('pastureid')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ postJson(url,data).then(response => {
|
|
|
+ if (response.data !== null) {
|
|
|
+ console.log('table数据', response.data)
|
|
|
+ this.table.list = response.data
|
|
|
this.table.pageNum = response.data.pageNum
|
|
|
this.table.pageSize = response.data.pageSize
|
|
|
} else {
|
|
@@ -365,12 +499,79 @@
|
|
|
}, 100)
|
|
|
})
|
|
|
},
|
|
|
- handleSetUp(){
|
|
|
+ handleSetUp(row){
|
|
|
+ console.log(row,'row')
|
|
|
this.setUp.dialogStatus = 'setup'
|
|
|
this.setUp.dialogFormVisible = true
|
|
|
this.activeName = 'first'
|
|
|
+ this.setUp.temp = Object.assign({}, row)
|
|
|
+ this.temp.messageName = row.data.type_name //消息名称
|
|
|
+ this.temp.triggerCondition = row.trigger //触发条件
|
|
|
+ this.temp.sendingMethod = String(row.data.remind_type) //发送方式
|
|
|
+ // if(this.temp.sendingMethod == '2'){
|
|
|
+ // this.formatMinutes(row.data.interval_time) //延时
|
|
|
+ // }
|
|
|
+ // this.temp.sendTime = row.data.push_time //发送时间
|
|
|
+ // if(row.data.push_limit == 1){//发送机制
|
|
|
+ // this.temp.sendingMechanism = '1'
|
|
|
+ // }else if(row.data.push_limit == 0){
|
|
|
+ // this.temp.sendingMechanism = '3'
|
|
|
+ // }else{
|
|
|
+ // this.temp.sendingMechanism = '2'
|
|
|
+ // }
|
|
|
+ // this.temp.numberCycles = row.data.push_limit //循环次数
|
|
|
+ // if(this.temp.sendingMechanism !== '1' && this.temp.sendingMechanism !== ''){
|
|
|
+ // this.formatMinutes(row.data.interval_time) //间隔周期
|
|
|
+ // }
|
|
|
+ // data.cycle_type = this.temp.sendingMechanism //循环类型
|
|
|
+ // data.date_type = this.temp.cycleType //周期类型
|
|
|
+ // if(this.temp.cycleType == '1'){
|
|
|
+ // data.push_date = ''
|
|
|
+ // }else if(this.temp.cycleType == '2'){
|
|
|
+ // data.push_date = this.temp.week
|
|
|
+ // }else{
|
|
|
+ // data.push_date = this.temp.month
|
|
|
+ // }
|
|
|
+ // 周期类型?
|
|
|
+ if(row.data.date_type == 1){
|
|
|
+ this.temp.cycleType == '1'
|
|
|
+ }else if(row.data.date_type == 2){
|
|
|
+ this.temp.cycleType == '2'
|
|
|
+ row.data.push_date = this.temp.week
|
|
|
+ }else{
|
|
|
+ this.temp.cycleType == '3'
|
|
|
+ row.data.push_date = this.temp.month
|
|
|
+ }
|
|
|
+ // this.temp.cycleType = row.data.push_limit //周期类型
|
|
|
+ this.temp.sendTime = row.data.push_time //发送时间
|
|
|
this.getList1()
|
|
|
},
|
|
|
+ formatMinutes(minutes) {
|
|
|
+ var day = parseInt(Math.floor(minutes / 1440));
|
|
|
+ var hour = day > 0 ? Math.floor((minutes - day * 1440) / 60) : Math.floor(minutes / 60);
|
|
|
+ var minute = hour > 0 ? Math.floor(minutes - day * 1440 - hour * 60) : minutes;
|
|
|
+ if(this.temp.sendingMethod == '2'){
|
|
|
+ this.temp.delayed1 = day;
|
|
|
+ this.temp.delayed2 = hour;
|
|
|
+ this.temp.delayed3 = minute;
|
|
|
+ return this.temp.delayed1;
|
|
|
+ return this.temp.delayed2;
|
|
|
+ return this.temp.delayed3;
|
|
|
+ }
|
|
|
+ if(this.temp.sendingMechanism !== '1' && this.temp.sendingMechanism !== ''){
|
|
|
+ this.temp.intervalPeriod1 = day;
|
|
|
+ this.temp.intervalPeriod2 = hour;
|
|
|
+ this.temp.intervalPeriod3 = minute;
|
|
|
+ return this.temp.intervalPeriod1;
|
|
|
+ return this.temp.intervalPeriod2;
|
|
|
+ return this.temp.intervalPeriod3;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleSee(){
|
|
|
+ this.see.dialogStatus = 'see'
|
|
|
+ this.see.dialogFormVisible = true
|
|
|
+ this.see.temp = Object.assign({}, row)
|
|
|
+ },
|
|
|
handleClick(item){
|
|
|
if(item == 'first'){
|
|
|
this.getList1()
|
|
@@ -378,10 +579,21 @@
|
|
|
this.getList2()
|
|
|
}
|
|
|
},
|
|
|
- handleSelectionChange(val) {
|
|
|
+ handleSelectionChange1(val) {
|
|
|
+ console.log('勾选数据', val)
|
|
|
+ this.setUp.selectList1 = []
|
|
|
+ for(let i=0;i<val.length;i++){
|
|
|
+ this.setUp.selectList1.push(val[i].id)
|
|
|
+ }
|
|
|
+ this.setUp.data2.parammaps.roleid = this.setUp.selectList1.join(',')
|
|
|
+ console.log(this.setUp.data2.parammaps.roleid)
|
|
|
+ this.getList2()
|
|
|
+ },
|
|
|
+ handleSelectionChange2(val) {
|
|
|
console.log('勾选数据', val)
|
|
|
- this.selectList = val
|
|
|
+ this.setUp.selectList2 = val
|
|
|
},
|
|
|
+
|
|
|
handleGenerateQRcode(){
|
|
|
this.QRcode.dialogStatus = 'QRcode'
|
|
|
this.QRcode.dialogFormVisible = true
|
|
@@ -390,53 +602,42 @@
|
|
|
this.getList2()
|
|
|
},
|
|
|
getList1() {
|
|
|
- this.setUp.table1.listLoading = true
|
|
|
- GetDataByName(this.setUp.table1.getdataListParm).then(response => {
|
|
|
+ this.setUp.listLoading1 = true
|
|
|
+ let url = "authdata/GetDataByName"
|
|
|
+ postJson(url,this.setUp.data1).then(response => {
|
|
|
if (response.data.list !== null) {
|
|
|
- console.log('table数据', response.data.list)
|
|
|
- this.setUp.table1.list = response.data.list
|
|
|
- this.setUp.table1.pageNum = response.data.pageNum
|
|
|
- this.setUp.table1.pageSize = response.data.pageSize
|
|
|
+ this.setUp.list1 = response.data.list
|
|
|
+ this.setUp.data2.parammaps.roleid = ''
|
|
|
+ this.getList2()
|
|
|
} else {
|
|
|
- this.setUp.table1.list = []
|
|
|
+ this.setUp.list1 = []
|
|
|
}
|
|
|
- this.setUp.table1.total = response.data.total
|
|
|
setTimeout(() => {
|
|
|
- this.setUp.table1.listLoading = false
|
|
|
+ this.setUp.listLoading1 = false
|
|
|
}, 100)
|
|
|
})
|
|
|
},
|
|
|
getList2() {
|
|
|
- this.setUp.table2.listLoading = true
|
|
|
- GetDataByName(this.setUp.table2.getdataListParm).then(response => {
|
|
|
+ this.setUp.listLoading2 = true
|
|
|
+ let url = "authdata/GetDataByName"
|
|
|
+ postJson(url,this.setUp.data2).then(response => {
|
|
|
if (response.data.list !== null) {
|
|
|
- console.log('table数据', response.data.list)
|
|
|
- this.setUp.table2.list = response.data.list
|
|
|
- this.setUp.table2.pageNum = response.data.pageNum
|
|
|
- this.setUp.table2.pageSize = response.data.pageSize
|
|
|
+ this.setUp.list2 = response.data.list
|
|
|
+ if(this.setUp.selectList1.length > 0){
|
|
|
+ this.$set(this.setUp,'selectList2',response.data.list)
|
|
|
+ }
|
|
|
} else {
|
|
|
- this.setUp.table2.list = []
|
|
|
+ this.setUp.list2 = []
|
|
|
}
|
|
|
- this.setUp.table2.total = response.data.total
|
|
|
setTimeout(() => {
|
|
|
- this.setUp.table2.listLoading = false
|
|
|
+ this.setUp.listLoading2 = false
|
|
|
}, 100)
|
|
|
})
|
|
|
},
|
|
|
setData(){
|
|
|
- let url = 'http://tmrwatch.cn:8089/notice/msgtype'
|
|
|
+ let url = 'authdata/remind/edit'
|
|
|
let data = {}
|
|
|
- data.sys_name = 'tmrWatch'
|
|
|
- data.type_name = this.temp.messageName
|
|
|
- data.remind_type_id = parseInt(this.temp.sendingMethod)
|
|
|
- if(this.temp.sendingMethod == '1'){
|
|
|
- data.remind_type = '立即'
|
|
|
- }else if(this.temp.sendingMethod == '1'){
|
|
|
- data.remind_type = '延时'
|
|
|
- }else{
|
|
|
- data.remind_type = '指定周期'
|
|
|
- }
|
|
|
- let dateTime = 0
|
|
|
+ let delayedTime = 0
|
|
|
let delayed1 = 0
|
|
|
let delayed2 = 0
|
|
|
let delayed3 = 0
|
|
@@ -454,27 +655,95 @@
|
|
|
if(this.temp.delayed3 !== ''){
|
|
|
delayed3 = parseInt(this.temp.delayed3)
|
|
|
}else{
|
|
|
- delayed2 = 0
|
|
|
+ delayed3 = 0
|
|
|
}
|
|
|
- dateTime = delayed1+ delayed2 + delayed3
|
|
|
- if(this.temp.cycleType == '1'){
|
|
|
- data.push_date = ''
|
|
|
- }else if(this.temp.cycleType == '2'){
|
|
|
- data.push_date = this.temp.week
|
|
|
- }else{
|
|
|
- data.push_date = this.temp.month
|
|
|
+ delayedTime = delayed1 + delayed2 + delayed3
|
|
|
+
|
|
|
+ let intervalPeriodTime = 0
|
|
|
+ let intervalPeriod1 = 0
|
|
|
+ let intervalPeriod2 = 0
|
|
|
+ let intervalPeriod3 = 0
|
|
|
+
|
|
|
+ if(this.temp.intervalPeriod1 !== ''){
|
|
|
+ intervalPeriod1 = parseInt(this.temp.intervalPeriod1)*24*60
|
|
|
+ }else {
|
|
|
+ intervalPeriod1 = 0
|
|
|
+ }
|
|
|
+ if(this.temp.intervalPeriod2 !== ''){
|
|
|
+ intervalPeriod2 = parseInt(this.temp.intervalPeriod2)*60
|
|
|
+ }else {
|
|
|
+ intervalPeriod2 = 0
|
|
|
}
|
|
|
- data.push_time = this.temp.sendTime
|
|
|
- data.interval_time = dateTime
|
|
|
- if(this.temp.sendingMechanism == '1'){
|
|
|
- data.push_limit = 1
|
|
|
- }else if(this.temp.sendingMechanism == '2'){
|
|
|
- data.push_limit = this.temp.numberCycles
|
|
|
+ if(this.temp.intervalPeriod3 !== ''){
|
|
|
+ intervalPeriod3 = parseInt(this.temp.intervalPeriod3)
|
|
|
}else{
|
|
|
- data.push_limit = 0
|
|
|
+ intervalPeriod3 = 0
|
|
|
}
|
|
|
- data.template_id = 'BtkN1rWKOJtKP0C64lGxIrPzLRFsYFas-4gupX2-pFo'
|
|
|
- postJson2(url,data).then(response => {
|
|
|
+ intervalPeriodTime = intervalPeriod1+ intervalPeriod2 + intervalPeriod3
|
|
|
+
|
|
|
+ // sendingMethod 发送方式
|
|
|
+ // sendingMechanism 发送机制
|
|
|
+ // intervalPeriod1 间隔周期
|
|
|
+ // delayed1 延时
|
|
|
+ // sendTime 发送时间
|
|
|
+ // numberCycles 循环次数
|
|
|
+ if(this.temp.sendingMethod == '1'){
|
|
|
+ data.id = this.setUp.temp.id
|
|
|
+ data.user = this.setUp.temp.user
|
|
|
+ data.sys_name = 'tmrWatch'
|
|
|
+ data.type_name = this.temp.messageName
|
|
|
+ data.template_id = 'BtkN1rWKOJtKP0C64lGxIrPzLRFsYFas-4gupX2-pFo'
|
|
|
+ data.pastureid = Cookies.get('pastureid')
|
|
|
+ data.remind_type = parseInt(this.temp.sendingMethod) //发送方式123
|
|
|
+ data.cycle_type = parseInt(this.temp.sendingMechanism) //发送机制123
|
|
|
+ if(this.temp.sendingMechanism == 2){
|
|
|
+ data.push_limit = this.temp.numberCycles //循环次数
|
|
|
+ // data.
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // data.remind_type = parseInt(this.temp.sendingMethod)
|
|
|
+ // let dateTime = 0
|
|
|
+ // let delayed1 = 0
|
|
|
+ // let delayed2 = 0
|
|
|
+ // let delayed3 = 0
|
|
|
+
|
|
|
+ // if(this.temp.delayed1 !== ''){
|
|
|
+ // delayed1 = parseInt(this.temp.delayed1)*24*60
|
|
|
+ // }else {
|
|
|
+ // delayed1 = 0
|
|
|
+ // }
|
|
|
+ // if(this.temp.delayed2 !== ''){
|
|
|
+ // delayed2 = parseInt(this.temp.delayed2)*60
|
|
|
+ // }else {
|
|
|
+ // delayed2 = 0
|
|
|
+ // }
|
|
|
+ // if(this.temp.delayed3 !== ''){
|
|
|
+ // delayed3 = parseInt(this.temp.delayed3)
|
|
|
+ // }else{
|
|
|
+ // delayed2 = 0
|
|
|
+ // }
|
|
|
+ // dateTime = delayed1+ delayed2 + delayed3
|
|
|
+ // if(this.temp.cycleType == '1'){
|
|
|
+ // data.push_date = 0
|
|
|
+ // }else if(this.temp.cycleType == '2'){
|
|
|
+ // data.push_date = this.temp.week
|
|
|
+ // }else{
|
|
|
+ // data.push_date = this.temp.month
|
|
|
+ // }
|
|
|
+ // data.push_time = this.temp.sendTime
|
|
|
+ // data.interval_time = dateTime
|
|
|
+ // if(this.temp.sendingMechanism == '1'){
|
|
|
+ // data.push_limit = 1
|
|
|
+ // }else if(this.temp.sendingMechanism == '2'){
|
|
|
+ // data.push_limit = this.temp.numberCycles
|
|
|
+ // }else{
|
|
|
+ // data.push_limit = 0
|
|
|
+ // }
|
|
|
+
|
|
|
+ // data.cycle_type = this.temp.sendingMechanism //循环类型
|
|
|
+ // data.date_type = this.temp.cycleType //周期类型
|
|
|
+
|
|
|
+ postJson(url,data).then(response => {
|
|
|
if(response.code == 200){
|
|
|
console.log('成功')
|
|
|
this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
|