1226 lines
41 KiB
Vue
1226 lines
41 KiB
Vue
<template>
|
|
<div class="container_hui">
|
|
<div class="tab-box">
|
|
<div class="tab_" :class="{active:index== tabindex }" @click="getindex(index)" v-for="(item,index) in tabs"
|
|
:key="index">
|
|
{{ item.name }}
|
|
</div>
|
|
</div>
|
|
<div class="card-changes" v-if="tabindex == 0">
|
|
<!-- 短信模板查询 -->
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="180px">
|
|
<el-form-item label="" prop="name">
|
|
<el-input
|
|
v-model="queryParams.name"
|
|
placeholder="请输入短信名称"
|
|
clearable
|
|
style="width: 240px;"
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
</el-form-item>
|
|
|
|
<el-form-item label="" prop="roeleList">
|
|
<el-select v-model="queryParams.roeleList" placeholder="请选择接收角色" clearable style="width: 240px;">
|
|
<el-option v-for="item in dutyList1" :label="item.dutyName" :value="item.dutyId"></el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
|
|
<el-form-item label="" prop="status">
|
|
<el-select v-model="queryParams.status" style="width: 240px" placeholder="请选择短信模版状态">
|
|
<el-option
|
|
v-for="dict in dict.type.message_status"
|
|
:key="dict.value"
|
|
:label="dict.label"
|
|
:value="dict.value"
|
|
/>
|
|
</el-select>
|
|
</el-form-item>
|
|
|
|
<el-form-item style="float: right;margin-right: 0px">
|
|
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
|
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
|
<el-button
|
|
type="primary"
|
|
icon="el-icon-plus"
|
|
@click="handleAdd"
|
|
>新增短信模板
|
|
</el-button>
|
|
</el-form-item>
|
|
</el-form>
|
|
<!-- 短信模板列表 -->
|
|
<div style="height: 68vh;overflow: auto;width: 100%">
|
|
<el-table :data="tableData" border width="500%" :header-cell-style="{'text-align':'center'}">
|
|
<el-table-column type="index" label="序号"></el-table-column>
|
|
<el-table-column prop="messageId" label="短信模板ID" width="100">
|
|
<template slot-scope="scope">
|
|
<span class="ju">{{ scope.row.messageId }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="name" label="短信名称" width="120">
|
|
<template slot-scope="scope">
|
|
<span class="ju">{{ scope.row.name }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="content" label="短信模板内容" width="350">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.content }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="roleName" label="接收角色">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.roleName }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="短信模板状态" align="center" prop="status">
|
|
<template slot-scope="scope">
|
|
<el-switch
|
|
v-model="scope.row.status"
|
|
active-value="1"
|
|
inactive-value="0"
|
|
active-color="#13ce66"
|
|
inactive-color="#ff4949"
|
|
@change="changeStatus(scope.row)"
|
|
>
|
|
</el-switch>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="createName" label="创建人">
|
|
<template slot-scope="scope">
|
|
<span class="ju">{{ scope.row.createName }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="createTime" label="创建时间">
|
|
<template slot-scope="scope">
|
|
<span class="ju">{{ scope.row.createTime }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width">
|
|
<template slot-scope="scope">
|
|
<el-button
|
|
size="mini"
|
|
type="text"
|
|
icon="el-icon-edit"
|
|
@click="edit(scope.row)"
|
|
v-hasPermi="['setting:message:edit']"
|
|
>修改
|
|
</el-button>
|
|
<el-button
|
|
size="mini"
|
|
type="text"
|
|
icon="el-icon-delete"
|
|
@click="del(scope.row)"
|
|
v-hasPermi="['setting:message:delete']"
|
|
>删除
|
|
</el-button>
|
|
<el-button
|
|
size="mini"
|
|
type="text"
|
|
icon="el-icon-delete"
|
|
@click="sendHandleAdd(scope.row)"
|
|
v-hasPermi="['setting:message:delete']"
|
|
>发送信息
|
|
</el-button>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
</div>
|
|
<pagination
|
|
v-show="messTemtotal>0"
|
|
:total="messTemtotal"
|
|
:page.sync="queryParams.current"
|
|
:limit.sync="queryParams.size"
|
|
@pagination="getList"
|
|
/>
|
|
|
|
</div>
|
|
<!-- 发送短信 -->
|
|
<div class="card-changes" v-if="tabindex == 1">
|
|
<el-form :model="sendqueryParams" ref="queryForm" size="small" :inline="true" label-width="180px">
|
|
<el-form-item label="" prop="name">
|
|
<el-input
|
|
v-model="sendqueryParams.name"
|
|
placeholder="请输入短信名称"
|
|
clearable
|
|
style="width: 240px;"
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
</el-form-item>
|
|
|
|
<el-form-item label="" prop="roeleList">
|
|
<el-select v-model="sendqueryParams.roeleList" placeholder="请选择接收角色" clearable style="width: 240px;">
|
|
<el-option v-for="item in dutyList1" :label="item.dutyName" :value="item.dutyId"></el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
|
|
<el-form-item style="float: right;margin-right: 0px">
|
|
<el-button type="primary" icon="el-icon-search" @click="sendhandleQuery">搜索</el-button>
|
|
<el-button icon="el-icon-refresh" @click="sendresetQuery">重置</el-button>
|
|
</el-form-item>
|
|
</el-form>
|
|
<!-- 发送短信列表 -->
|
|
<div style="height: 70vh;overflow: auto;width: 100%">
|
|
<el-table :data="messageRecordList" border style="width: 100%">
|
|
<el-table-column type="index" label="序号"></el-table-column>
|
|
<el-table-column prop="name" label="短信名称">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.name }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="content" label="短信内容">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.content }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="roleIds" label="接收角色">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.roleIds }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="successNum" label="短信发送记录">
|
|
<template slot-scope="scope">
|
|
<span @click="showDialog(scope.row)"
|
|
style="color: #0BADFE">{{ scope.row.successNum || 0 }}/{{ scope.row.sendNum || 0 }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
|
|
<el-table-column prop="status" label="发送状态">
|
|
<template slot-scope="scope">
|
|
<div v-if="scope.row.status==0">
|
|
停用
|
|
</div>
|
|
<div v-else>
|
|
启用
|
|
</div>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="createName" label="发送人">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.createName }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="createTime" label="发送时间">
|
|
<template slot-scope="scope">
|
|
<span>{{ convertTimestampToDate(scope.row.sendTime) }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
</div>
|
|
<pagination
|
|
v-show="sendquerytotal>0"
|
|
:total="sendquerytotal"
|
|
:page.sync="sendqueryParams.page"
|
|
:limit.sync="sendqueryParams.pageSize"
|
|
@pagination="messageRecordListss"
|
|
/>
|
|
<!-- 弹出框 -->
|
|
<el-dialog center :close-on-click-modal="false"
|
|
title="短信接收人"
|
|
:visible.sync="dialogVisible"
|
|
width="50%">
|
|
<el-table :data="msgList" border style="width: 100%">
|
|
<el-table-column type="index" label="序号"></el-table-column>
|
|
<el-table-column prop="deptNames" label="所属机构"></el-table-column>
|
|
<el-table-column prop="mobile" label="手机号" width="180"></el-table-column>
|
|
<el-table-column prop="status" label="短信状态" width="180" :formatter="statusFormatter"></el-table-column>
|
|
<el-table-column prop="messageNum" label="短信条数" width="180"></el-table-column>
|
|
|
|
</el-table>
|
|
<pagination
|
|
v-show="msgTotal>0"
|
|
:total="msgTotal"
|
|
:page.sync="msgQuery.page"
|
|
:limit.sync="msgQuery.pageSize"
|
|
@pagination="msgRecordList"
|
|
/>
|
|
<span slot="footer" class="dialog-footer">
|
|
<el-button @click="dialogVisible = false">关闭</el-button>
|
|
</span>
|
|
</el-dialog>
|
|
|
|
</div>
|
|
<!-- 短信费用 -->
|
|
<div class="card-changes" v-if="tabindex == 2">
|
|
<el-form :model="costqueryParams" ref="queryParams2" size="small" :inline="true" label-width="180px">
|
|
|
|
<el-form-item label="" prop="createName">
|
|
<el-input
|
|
v-model="costqueryParams.createName"
|
|
placeholder="请输入操作人"
|
|
clearable
|
|
style="width: 240px;"
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
</el-form-item>
|
|
<el-form-item style="float: right;margin-right: 0px">
|
|
<el-button type="primary" icon="el-icon-search" @click="costhandleQuery">搜索</el-button>
|
|
<el-button icon="el-icon-refresh" @click="costresetQuery">重置</el-button>
|
|
<el-button
|
|
type="primary"
|
|
icon="el-icon-plus"
|
|
@click="handleAdd2"
|
|
>新增短信费用
|
|
</el-button>
|
|
</el-form-item>
|
|
</el-form>
|
|
|
|
<div style="height: 70vh;overflow: auto;width: 100%">
|
|
<el-table :data="messageCostList" border style="width: 100%">
|
|
<el-table-column type="index" align="center" label="序号"></el-table-column>
|
|
<el-table-column prop="deptName" align="center" label="机构名称">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.deptName }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="contacts" align="center" label="联系人">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.contacts }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="mobile" align="center" label="联系方式">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.mobile }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="balance" align="center" label="短信余额">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.balance || 0 }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="messageNum" align="center" label="累计已发短信条数">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.messageNum || 0 }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="residueNum" align="center" label="剩余短信条数">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.residueNum || 0 }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="rechargeRecord" align="center" label="短信充值记录">
|
|
<template slot-scope="scope">
|
|
<span @click="rechargeshowDialog(scope.row)" style="color: #0BADFE">{{
|
|
scope.row.rechargeRecord || 0
|
|
}}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="createName" align="center" label="操作人">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.createName }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="createTime" align="center" label="操作时间">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.createTime }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width">
|
|
<template slot-scope="scope">
|
|
<el-button
|
|
size="mini"
|
|
type="text"
|
|
@click="recharge(scope.row)"
|
|
>充值
|
|
</el-button>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
</div>
|
|
<pagination
|
|
v-show="costtotal>0"
|
|
:total="costtotal"
|
|
:page.sync="costqueryParams.page"
|
|
:limit.sync="costqueryParams.pageSize"
|
|
@pagination="getMessageCostList"
|
|
/>
|
|
|
|
<el-dialog center :close-on-click-modal="false"
|
|
title="短信充值记录"
|
|
:visible.sync="rechargedialogVisible"
|
|
width="50%">
|
|
<el-table :data="rechargeList" border style="width: 100%">
|
|
<el-table-column type="index" label="序号"></el-table-column>
|
|
<el-table-column prop="deptName" label="所属机构"></el-table-column>
|
|
<el-table-column prop="amount" label="充值金额(元)"></el-table-column>
|
|
<el-table-column prop="unitPrice" label="短信单价(分/条)"></el-table-column>
|
|
<el-table-column prop="messageNum" label="短信条数"></el-table-column>
|
|
<el-table-column prop="rechargeUser" label="充值用户"></el-table-column>
|
|
<el-table-column prop="createTime" label="充值时间"></el-table-column>
|
|
</el-table>
|
|
|
|
<pagination
|
|
v-show="rechargeTotal>0"
|
|
:total="rechargeTotal"
|
|
:page.sync="msgQuery.page"
|
|
:limit.sync="msgQuery.pageSize"
|
|
@pagination="msgRecordList"
|
|
/>
|
|
<span slot="footer" class="dialog-footer">
|
|
<el-button @click="rechargedialogVisible = false">关闭</el-button>
|
|
</span>
|
|
</el-dialog>
|
|
|
|
</div>
|
|
<!-- 短信模板添加/修改 -->
|
|
<el-dialog center :title="title" :close-on-click-modal="false" :visible.sync="open" width="35%" append-to-body>
|
|
<el-form ref="form" :rules="rules" :model="form" label-width="95px">
|
|
|
|
<el-form-item label="短信模板ID" prop="messageId">
|
|
<el-input v-model="form.messageId" placeholder="请输入短信模板ID"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="短信名称" prop="name">
|
|
<el-input v-model="form.name" placeholder="请输入短信名称" @blur="handleBlur"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="短信模板" prop="content">
|
|
<el-input type="textarea"
|
|
v-model="form.content"
|
|
:maxlength="200"
|
|
show-word-limit
|
|
placeholder="请输入短信模板">
|
|
</el-input>
|
|
</el-form-item>
|
|
<el-form-item label="适用范围" prop="deptIdList">
|
|
<el-select v-model="form.deptIdList" multiple placeholder="请选择所属机构" style="width: 100%">
|
|
<el-option
|
|
v-for="item in deptListSelect"
|
|
:key="item.deptId"
|
|
:label="item.deptName"
|
|
:value="item.deptId"
|
|
></el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
<!-- 接收角色 -->
|
|
<el-form-item label="接收角色" :required="true">
|
|
<el-select v-model="form.roleIds" multiple placeholder="请选择角色" style="width: 100%">
|
|
<el-option v-for="item in dutyList1" :label="item.dutyName" :value="item.dutyId+''"></el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
|
|
<el-form-item label="状态" prop="status">
|
|
<el-switch
|
|
v-model="form.status"
|
|
active-value="1"
|
|
inactive-value="0">
|
|
</el-switch>
|
|
|
|
</el-form-item>
|
|
|
|
<!-- 发送条件 -->
|
|
<el-form-item label="发送条件" style="margin-bottom: 10px" :required="true">
|
|
<!-- <div v-for="(condition, index) in form.conditions" :key="index" class="condition-group"-->
|
|
<!-- style="margin-bottom: 10px">-->
|
|
<!-- <el-select v-model="condition.field" placeholder="请选择条件" style="width: 150px;margin-right: 10px"-->
|
|
<!-- @change="changeField(index)">-->
|
|
<!-- <el-option label="商品库存量" value="商品库存量"></el-option>-->
|
|
<!-- <el-option label="剩余可挂账额度" value="剩余可挂账额度"></el-option>-->
|
|
<!-- <el-option label="车队总余额" value="车队总余额"></el-option>-->
|
|
<!-- <!– 添加其他选项 –>-->
|
|
<!-- </el-select>-->
|
|
<!-- <el-select v-model="condition.operator" placeholder="请选择" style="width: 100px;margin-right: 10px">-->
|
|
<!-- <el-option label="大于" value="大于"></el-option>-->
|
|
<!-- <el-option label="等于" value="等于"></el-option>-->
|
|
<!-- <el-option label="小于" value="小于"></el-option>-->
|
|
<!-- <!– 添加其他选项 –>-->
|
|
<!-- </el-select>-->
|
|
<!-- <el-input v-model="condition.value" placeholder="请输入" style="width: 200px;margin-right: 10px">-->
|
|
<!-- <template slot="append">{{ condition.field != '商品库存量' ? '元' : '件' }}</template>-->
|
|
<!-- </el-input>-->
|
|
<!-- </div>-->
|
|
<div class="condition-group" style="margin-bottom: 10px">
|
|
<el-select v-model="form.sendCondition" placeholder="请选择条件" style="width: 150px;margin-right: 10px">
|
|
<el-option label="商品库存量" value="0"></el-option>
|
|
<el-option label="剩余可挂账额度" value="1"></el-option>
|
|
<el-option label="车队总余额" value="2"></el-option>
|
|
<!-- 添加其他选项 -->
|
|
</el-select>
|
|
<el-select v-model="form.meetCondition" placeholder="请选择" style="width: 100px;margin-right: 10px">
|
|
<el-option label="大于" value="大于"></el-option>
|
|
<el-option label="等于" value="等于"></el-option>
|
|
<el-option label="小于" value="小于"></el-option>
|
|
<!-- 添加其他选项 -->
|
|
</el-select>
|
|
<el-input v-model="form.fleetAmount" v-if="form.sendCondition==2" placeholder="请输入车队的总余额" style="width: 200px;margin-right: 10px">
|
|
<template slot="append">元</template>
|
|
</el-input>
|
|
<el-input v-model="form.creditAmount" v-if="form.sendCondition==1" placeholder="请输入剩余可挂账额度" style="width: 200px;margin-right: 10px">
|
|
<template slot="append">元</template>
|
|
</el-input>
|
|
<el-input v-model="form.goodsStock" v-else placeholder="请输入商品库存" style="width: 200px;margin-right: 10px">
|
|
<template slot="append">件</template>
|
|
</el-input>
|
|
</div>
|
|
</el-form-item>
|
|
|
|
<div style="text-align: center">
|
|
<el-button @click="open = false">取 消</el-button>
|
|
<el-button type="primary" @click="submitForm('form')">保 存</el-button>
|
|
</div>
|
|
</el-form>
|
|
|
|
</el-dialog>
|
|
<!-- 新增费用设置 -->
|
|
<el-dialog center :title="title" :close-on-click-modal="false" :visible.sync="open2" width="30%" append-to-body>
|
|
<el-form ref="form2" :rules="rules" :model="form2" label-width="80px">
|
|
|
|
<el-form-item label="机构名称" prop="deptId">
|
|
<el-select v-model="form2.deptId" placeholder="请选择所属机构" @change="getStaff(form2.deptId)"
|
|
style="width: 100%">
|
|
<el-option
|
|
v-for="item in deptListSelect"
|
|
:key="item.deptId"
|
|
:label="item.deptName"
|
|
:value="item.deptId"
|
|
></el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="联系人" prop="contacts">
|
|
<el-input v-model="form2.contacts"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="联系方式" prop="mobile">
|
|
<el-input v-model="form2.mobile"></el-input>
|
|
</el-form-item>
|
|
</el-form>
|
|
<div slot="footer" style="text-align: center">
|
|
<el-button @click="open2 = false">取 消</el-button>
|
|
<el-button type="primary" @click="submitForm2">保 存</el-button>
|
|
</div>
|
|
</el-dialog>
|
|
<!-- 充值 -->
|
|
<el-dialog center :title="title" :close-on-click-modal="false" :visible.sync="open3" width="30%" append-to-body>
|
|
<el-form ref="form3" :rules="rules" :model="form3" label-width="80px">
|
|
|
|
<el-form-item label="机构名称" prop="deptId">
|
|
<el-select v-model="form3.deptId" placeholder="请选择所属机构" style="width: 100%" disabled>
|
|
<el-option
|
|
v-for="item in deptListSelect"
|
|
:key="item.deptId"
|
|
:label="item.deptName"
|
|
:value="item.deptId"
|
|
></el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="充值金额" prop="amount">
|
|
<el-input v-model="form3.amount" @input="countNum()" placeholder="请输入充值金额"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="短信单价" prop="unitPrice">
|
|
<el-input v-model="form3.unitPrice" @input="countNum()" placeholder="请输入短信单价"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="短信条数" prop="messageNum">
|
|
<el-input v-model="form3.messageNum" placeholder="自动获取短信条数" disabled></el-input>
|
|
</el-form-item>
|
|
<div style="text-align: center">
|
|
<el-button @click="open3 = false">取 消</el-button>
|
|
<el-button type="primary" @click="submitForm3">保 存</el-button>
|
|
</div>
|
|
</el-form>
|
|
</el-dialog>
|
|
<!-- 发送短信框 -->
|
|
<el-dialog :title="title" :close-on-click-modal="false" :visible.sync="sendOpen" width="35%" append-to-body>
|
|
<el-form ref="sendForm" :model="sendForm" label-width="90px">
|
|
<el-form-item label="短信接收人" prop="messageSendee">
|
|
<el-input v-model="sendForm.messageSendee"
|
|
placeholder="请输入手机号,多个手机号用英文逗号隔开"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="短信名称" prop="messageId" v-show="false">
|
|
<el-input v-model="sendForm.messageId" placeholder="请选择短信名称" disabled
|
|
v-show="false"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="短信名称" prop="messageId">
|
|
<el-input v-model="sendForm.messageName" placeholder="请选择短信名称"
|
|
disabled></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="短信模板" prop="messageId">
|
|
<el-input v-model="sendForm.aa" disabled></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="发送时间" prop="sendTime">
|
|
<div class="block">
|
|
<el-date-picker
|
|
v-model="sendForm.sendTime"
|
|
type="date"
|
|
placeholder="选择日期">
|
|
</el-date-picker>
|
|
</div>
|
|
</el-form-item>
|
|
<div style="text-align: center">
|
|
<el-button @click="sendOpen = false">取 消</el-button>
|
|
<el-button type="primary" @click="sendSubmitForm">确 定</el-button>
|
|
</div>
|
|
</el-form>
|
|
</el-dialog>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
|
|
import {
|
|
deleteApi, getListApi, saveApi, updateApi, getNameListApi, sendMessageSaveApi,
|
|
messageRecordListApi, selectChildList, getOneApi
|
|
} from "../../api/sys/message";
|
|
import {getToken} from '../../utils/auth'
|
|
import {selectChildByDeptId} from "../../api/system/Site/site";
|
|
import NotifyMode from "./page/mode.vue";
|
|
import {getCostListApi, saveCostApi, updateCostApi, getCostReListApi} from "@/api/sys/messageCost";
|
|
import {getStaffByDeptId} from "@/api/staff/staff";
|
|
import {saveMessageRechargeRecordApi} from "../../api/sys/messageRechargeRecord.js"
|
|
import {dutyList} from "@/api/duty/duty";
|
|
|
|
export default {
|
|
name: "printIndex",
|
|
components: {NotifyMode},
|
|
dicts: ['dept_ids', 'message_status'],
|
|
data() {
|
|
return {
|
|
dutyList1: [],
|
|
conditions: [],
|
|
tableData: [
|
|
{status: 0},
|
|
{status: 1},
|
|
],
|
|
dialogVisible: false,
|
|
rechargedialogVisible: false,
|
|
currentData: [],
|
|
sendqueryParams: {
|
|
page: 1,
|
|
pageSize: 10,
|
|
roleIds: '',
|
|
roeleList: ''
|
|
},
|
|
sendTime: '',
|
|
tabindex: 0,
|
|
tabs: [
|
|
{
|
|
name: '短信模板',
|
|
},
|
|
{
|
|
name: '短信记录',
|
|
},
|
|
{
|
|
name: '短信费用设置',
|
|
},
|
|
],
|
|
// tableData: [],
|
|
form: {
|
|
conditions: [{field:'',operator:"",value:""}]
|
|
},
|
|
deptListSelect: [],
|
|
systemPositionList: [{
|
|
value: '首页',
|
|
label: '首页'
|
|
}, {
|
|
value: '系统首页',
|
|
label: '系统首页'
|
|
},],
|
|
// 是否显示弹出层
|
|
open: false,
|
|
title: "",
|
|
total: 0,
|
|
// 查询参数
|
|
queryParams: {
|
|
current: 1,
|
|
size: 10,
|
|
bannerName: '',
|
|
systemPosition: '',
|
|
bannerStatus: '',
|
|
},
|
|
|
|
total1: 0,
|
|
// 查询参数
|
|
queryParams1: {
|
|
page: 1,
|
|
pageSize: 10,
|
|
},
|
|
messageRecordList: [],
|
|
|
|
total2: 0,
|
|
// 查询参数
|
|
queryParams2: {
|
|
page: 1,
|
|
pageSize: 10,
|
|
deptIdList: ''
|
|
},
|
|
messageCostList: [],
|
|
open2: false,
|
|
form2: {},
|
|
open3: false,
|
|
form3: {},
|
|
sendOpen: false,
|
|
sendForm: {},
|
|
messageSendee: '',
|
|
// 上传地址
|
|
uploadAction: process.env.VUE_APP_BASE_API + 'backendApi/file/upload',
|
|
uploadHeader: {'Access-Token': getToken()}, // 上传文件列表
|
|
uploadFiles: [
|
|
{
|
|
name: "nihao",
|
|
url: 'http://localhost:8008/static/uploadImages/20231103/ffbbe7d3ee1441fdaf706802fa0f176a.png'
|
|
}
|
|
],
|
|
// 图片根目录
|
|
imagePath: process.env.VUE_APP_BASE_API,
|
|
// 隐藏上传
|
|
hideUpload: false,
|
|
msgList: [],
|
|
msgQuery: {
|
|
page: 1,
|
|
pageSize: 10,
|
|
},
|
|
costqueryParams: {
|
|
page: 1,
|
|
pageSize: 10,
|
|
},
|
|
rechargeList: [],
|
|
rechargeQuery: {
|
|
page: 1,
|
|
pageSize: 10,
|
|
},
|
|
msgTotal: 0,
|
|
rechargeTotal: 0,
|
|
messTemtotal: 0,
|
|
costtotal: 0,
|
|
sendquerytotal: 0,
|
|
// 表单校验
|
|
rules: {
|
|
messageId: [
|
|
{required: true, message: "短信模板id不能为空", trigger: "blur"}
|
|
],
|
|
name: [
|
|
{required: true, message: "短信名称不能为空", trigger: "blur"}
|
|
],
|
|
deptIdList: [
|
|
{required: true, message: "适用范围不能为空", trigger: "blur"}
|
|
],
|
|
content: [
|
|
{required: true, message: "短信介绍不能为空", trigger: "blur"},
|
|
{max: 200, message: '短信模板不能超过200个字符', trigger: 'blur'}
|
|
],
|
|
deptId: [
|
|
{required: true, message: "机构名称不能为空", trigger: "blur"}
|
|
],
|
|
contacts: [
|
|
{required: true, message: "联系人不能为空", trigger: "blur"}
|
|
],
|
|
mobile: [
|
|
{required: true, message: "联系方式不能为空", trigger: "blur"}
|
|
],
|
|
amount: [
|
|
{required: true, message: "充值金额不能为空", trigger: "blur"}
|
|
],
|
|
unitPrice: [
|
|
{required: true, message: "单价不能为空", trigger: "blur"}
|
|
],
|
|
messageNum: [
|
|
{required: true, message: "短信条数不能为空", trigger: "blur"}
|
|
]
|
|
}
|
|
};
|
|
},
|
|
created() {
|
|
this.getList()
|
|
this.selectChildByDeptIdApi()
|
|
this.messageRecordListss()
|
|
this.getDutyList()
|
|
},
|
|
methods: {
|
|
// 计算短信条数
|
|
countNum() {
|
|
if (this.form3.amount && this.form3.unitPrice) {
|
|
this.form3.messageNum = (this.form3.amount / this.form3.unitPrice).toFixed(0)
|
|
}
|
|
},
|
|
convertTimestampToDate(timestamp) {
|
|
const date = new Date(timestamp);
|
|
// 获取本地时间的各部分
|
|
const year = date.getFullYear();
|
|
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始
|
|
const day = String(date.getDate()).padStart(2, '0');
|
|
const hours = String(date.getHours()).padStart(2, '0');
|
|
const minutes = String(date.getMinutes()).padStart(2, '0');
|
|
const seconds = String(date.getSeconds()).padStart(2, '0');
|
|
|
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
},
|
|
changeField(index) {
|
|
let field = this.form.conditions[index].field
|
|
let sum = 0
|
|
this.form.conditions.forEach(res => {
|
|
if (res.field === field) {
|
|
sum++
|
|
}
|
|
})
|
|
if (sum > 1) {
|
|
this.form.conditions.splice(index, 1)
|
|
this.$message({
|
|
type: 'info',
|
|
message: '条件不允许重复!'
|
|
});
|
|
}
|
|
},
|
|
getDutyList() {
|
|
// this.loading = true;
|
|
let queryParams1 = {
|
|
page: 1,
|
|
pageSize: 10000
|
|
}
|
|
dutyList(queryParams1).then(res => {
|
|
this.dutyList1 = res.data.records;
|
|
// this.total1 = res.data.total;
|
|
// this.loading = false;
|
|
})
|
|
},
|
|
// 充值记录列表
|
|
rechargeRecordList() {
|
|
getCostReListApi(this.rechargeQuery).then(res => {
|
|
this.rechargeList = res.data.records
|
|
this.rechargeTotal = res.data.total
|
|
})
|
|
},
|
|
// 充值记录弹框
|
|
rechargeshowDialog(row) {
|
|
this.rechargeQuery.storeId = row.storeId
|
|
this.rechargeRecordList()
|
|
this.rechargedialogVisible = true;
|
|
},
|
|
// 充值
|
|
recharge(data) {
|
|
this.form3 = {
|
|
deptId: data.deptId
|
|
}
|
|
this.open3 = true;
|
|
this.title = "充值"
|
|
},
|
|
statusFormatter(row, column, cellValue, index) {
|
|
return cellValue === 0 ? '成功' : '失败';
|
|
},
|
|
// 短信接收人
|
|
showDialog(row) {
|
|
this.msgQuery.messageRecordId = row.id
|
|
this.msgRecordList()
|
|
this.dialogVisible = true;
|
|
},
|
|
// 短信接收列表
|
|
msgRecordList() {
|
|
selectChildList(this.msgQuery).then(res => {
|
|
this.msgList = res.data.records
|
|
this.msgTotal = res.data.total
|
|
})
|
|
},
|
|
// 发送短信重置
|
|
sendresetQuery() {
|
|
this.sendqueryParams = {
|
|
page: 1,
|
|
pageSize: 10,
|
|
},
|
|
this.messageRecordListss()
|
|
},
|
|
// 发送短信查询
|
|
sendhandleQuery() {
|
|
this.messageRecordListss()
|
|
},
|
|
// 发送短信列表
|
|
messageRecordListss() {
|
|
this.sendqueryParams.roleIds = this.sendqueryParams.roeleList;
|
|
messageRecordListApi(this.sendqueryParams).then(res => {
|
|
this.messageRecordList = res.data.records;
|
|
this.sendquerytotal = res.data.total
|
|
})
|
|
},
|
|
// 发送信息提交按钮
|
|
sendSubmitForm: function () {
|
|
this.$refs["sendForm"].validate(valid => {
|
|
if (!valid) {
|
|
return;
|
|
}
|
|
sendMessageSaveApi(this.sendForm).then(response => {
|
|
if (response.code === 200) {
|
|
this.$modal.msgSuccess("新增成功");
|
|
this.sendOpen = false;
|
|
this.getList();
|
|
} else {
|
|
this.$message.error(response.message)
|
|
}
|
|
});
|
|
});
|
|
},
|
|
sendHandleAdd(e) {
|
|
this.clean()
|
|
this.sendForm.messageId = e.id
|
|
getOneApi(e.id).then(res => {
|
|
if (res.code === 200) {
|
|
this.sendForm.messageName = res.data.name;
|
|
this.sendForm.aa = res.data.content;
|
|
}
|
|
this.sendOpen = true;
|
|
this.title = "发送短信";
|
|
})
|
|
},
|
|
// 校验参数是否为空字符
|
|
validateMessageId(rule, value, callback) {
|
|
if (value === null || value === '' || value === undefined) {
|
|
} else {
|
|
callback(); // 验证通过
|
|
}
|
|
},
|
|
// 鼠标移出事件
|
|
handleBlur() {
|
|
console.log(this.form.name)
|
|
// if (!this.form.name === undefined || this.form.name === '' || this.form.name === null) {
|
|
getNameListApi(this.form.name).then(res => {
|
|
if (res.code === 200) {
|
|
if (res.data === 1) {
|
|
this.$message({
|
|
message: '短信名称重复',
|
|
type: 'warning'
|
|
});
|
|
}
|
|
}
|
|
})
|
|
// }
|
|
},
|
|
// 短信模板提交按钮
|
|
submitForm(form) {
|
|
this.$refs["form"].validate(valid => {
|
|
if (!valid) {
|
|
return;
|
|
}
|
|
if (this.form.roleIds) this.form.roleIds = this.form.roleIds.toString()
|
|
// 修改的提交
|
|
if (this.form.id != null) {
|
|
updateApi(this.form).then(response => {
|
|
if (response.code === 200) {
|
|
this.$modal.msgSuccess("修改成功");
|
|
this.open = false;
|
|
this.getList();
|
|
} else {
|
|
this.$message.error(response.message)
|
|
}
|
|
});
|
|
return;
|
|
}
|
|
// 添加的提交
|
|
saveApi(this.form).then(response => {
|
|
if (response.code === 200) {
|
|
this.$modal.msgSuccess("新增成功");
|
|
this.open = false;
|
|
this.getList();
|
|
} else {
|
|
this.$message.error(response.message)
|
|
}
|
|
});
|
|
// if (valid) {
|
|
// // 表单验证通过,可以提交数据
|
|
// this.submitDeviceInfo();
|
|
// } else {
|
|
// // 表单验证失败,不执行任何操作
|
|
// return false;
|
|
// }
|
|
});
|
|
},
|
|
getStaff(deptId) {
|
|
getStaffByDeptId(deptId).then(res => {
|
|
this.form2.contacts = res.data.realName
|
|
this.form2.mobile = res.data.mobile
|
|
this.$forceUpdate()
|
|
})
|
|
},
|
|
// 提交按钮
|
|
submitForm2: function () {
|
|
this.$refs["form2"].validate(valid => {
|
|
if (valid) {
|
|
if (!this.form2.id) {
|
|
saveCostApi(this.form2).then(res => {
|
|
if (res.data == 1) {
|
|
this.$message.success("添加成功")
|
|
this.open2 = false
|
|
this.queryParams2.page = 1;
|
|
this.getMessageCostList()
|
|
} else {
|
|
this.$message.error("添加失败,机构名称不可重复!")
|
|
}
|
|
})
|
|
} else {
|
|
updateCostApi(this.form).then(res => {
|
|
if (res.data == 1) {
|
|
this.$message.success("修改成功")
|
|
this.open2 = false
|
|
this.queryParams.page = 1;
|
|
this.getList()
|
|
} else {
|
|
this.$message.error("添加失败,机构名称不可重复!")
|
|
}
|
|
})
|
|
}
|
|
}
|
|
});
|
|
},
|
|
// 充值提交按钮
|
|
submitForm3: function () {
|
|
this.$refs["form3"].validate(valid => {
|
|
if (!valid) {
|
|
return;
|
|
}
|
|
saveMessageRechargeRecordApi(this.form3).then(response => {
|
|
if (response.code === 200) {
|
|
this.$modal.msgSuccess("新增成功");
|
|
this.open3 = false;
|
|
this.getMessageCostList();
|
|
} else {
|
|
this.$message.error(response.message)
|
|
}
|
|
});
|
|
});
|
|
},
|
|
handleAdd2() {
|
|
this.form2 = {}
|
|
this.open2 = true
|
|
this.title = "新增费用设置"
|
|
},
|
|
// 短信费用
|
|
getMessageCostList() {
|
|
getCostListApi(this.costqueryParams).then(res => {
|
|
this.messageCostList = res.data.records
|
|
this.costtotal = res.data.total
|
|
})
|
|
},
|
|
getindex(index) {
|
|
this.tabindex = index
|
|
if (index == 0) {
|
|
this.queryParams = {
|
|
page: 1,
|
|
pageSize: 10,
|
|
};
|
|
this.getList()
|
|
} else if (index == 1) {
|
|
this.messageRecordListss()
|
|
} else if (index == 2) {
|
|
this.queryParams2 = {
|
|
page: 1,
|
|
pageSize: 10,
|
|
};
|
|
this.getMessageCostList()
|
|
}
|
|
},
|
|
selectChildByDeptIdApi() {
|
|
selectChildByDeptId().then(res => {
|
|
this.deptListSelect = res.data
|
|
|
|
})
|
|
},
|
|
// 短信模板列表
|
|
getList() {
|
|
getListApi(this.queryParams).then(res => {
|
|
this.tableData = res.data.records;
|
|
this.messTemtotal = res.data.total
|
|
})
|
|
},
|
|
/*submitForm(formName) {
|
|
this.$refs[formName].validate(valid => {
|
|
if (valid) {
|
|
// 表单验证通过,可以提交数据
|
|
this.submitDeviceInfo();
|
|
} else {
|
|
// 表单验证失败,不执行任何操作
|
|
return false;
|
|
}
|
|
});
|
|
},*/
|
|
submitDeviceInfo() {
|
|
// 在这里调用接口提交设备信息数据
|
|
console.log('提交设备信息数据:', this.form);
|
|
if (this.form.id) {
|
|
updateApi(this.form).then(res => {
|
|
if (res.code === 200) {
|
|
this.getList()
|
|
this.open = false
|
|
}
|
|
})
|
|
} else {
|
|
saveApi(this.form).then(res => {
|
|
if (res.code === 200) {
|
|
this.getList()
|
|
this.open = false
|
|
}
|
|
})
|
|
}
|
|
},
|
|
// 修改状态
|
|
changeStatus(data) {
|
|
updateApi(data).then(res => {
|
|
if (res.code === 200) {
|
|
this.$message({
|
|
type: 'success',
|
|
message: '修改状态成功!'
|
|
});
|
|
this.getList()
|
|
}
|
|
|
|
})
|
|
},
|
|
// 上传封面
|
|
handleUploadSuccessCover(file) {
|
|
this.form.productImage = file.data.fileName;
|
|
this.form.productImage = file.data.fileName;
|
|
},
|
|
handleQuery() {
|
|
this.getList()
|
|
},
|
|
costhandleQuery() {
|
|
this.getMessageCostList()
|
|
},
|
|
costresetQuery() {
|
|
this.costqueryParams = {
|
|
page: 1,
|
|
pageSize: 10,
|
|
}
|
|
this.getMessageCostList()
|
|
},
|
|
|
|
resetQuery() {
|
|
this.queryParams = {
|
|
current: 1,
|
|
size: 10,
|
|
deviceName: '',
|
|
}
|
|
this.getList()
|
|
},
|
|
handleAdd(e) {
|
|
this.clean()
|
|
this.open = true;
|
|
this.title = "新增短信模板"
|
|
},
|
|
edit(e) {
|
|
this.clean()
|
|
this.open = true;
|
|
this.title = "修改短信"
|
|
console.log("1078", e)
|
|
this.form = e
|
|
if (e.roleIds) this.form.roleIds = e.roleIds.split(",")
|
|
// getOneApi(e.id).then(res => {
|
|
// this.form = res.data
|
|
// if (res.data.roleIds) this.form.roleIds = res.data.roleIds.split(",")
|
|
// })
|
|
},
|
|
del(e) {
|
|
this.$confirm('此操作将永久删除该短信, 是否继续?', '提示', {
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
}).then(() => {
|
|
deleteApi(e.id).then(res => {
|
|
if (res.code == 200) {
|
|
this.$message({
|
|
type: 'success',
|
|
message: '删除成功!'
|
|
});
|
|
this.getList()
|
|
}
|
|
})
|
|
|
|
}).catch(() => {
|
|
this.$message({
|
|
type: 'info',
|
|
message: '已取消删除'
|
|
});
|
|
});
|
|
},
|
|
clean() {
|
|
this.form = {
|
|
id: null, // 自增id
|
|
bannerName: '', // Banner名称
|
|
productImage: '', // 短信图片
|
|
systemPosition: '', // 系统位置
|
|
sortOrder: null, // 排序号
|
|
bannerLink: '', // Banner链接
|
|
bannerStatus: false, // Banner状态
|
|
note: '', // 备注
|
|
createByName: '', //
|
|
conditions: [{field:'',operator:"",value:""}]
|
|
};
|
|
this.selectedDat = undefined;
|
|
},
|
|
}
|
|
};
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
.app-container {
|
|
padding: 0px !important;
|
|
}
|
|
.container_hui{
|
|
background: #f6f8f9;
|
|
box-sizing: border-box;
|
|
// padding-bottom: 10px;
|
|
}
|
|
|
|
.card-changes{
|
|
background: #fff;
|
|
border-radius: 8px;
|
|
box-sizing: border-box;
|
|
padding: 15px;
|
|
margin: 10px;
|
|
height: 86vh;
|
|
}
|
|
|
|
.common-dialog > > > .el-upload--picture-card {
|
|
width: 60px;
|
|
height: 50px;
|
|
line-height: 60px;
|
|
}
|
|
|
|
.d-dialog > > > .el-upload--picture-card {
|
|
width: 100px;
|
|
height: 100px;
|
|
line-height: 100px;
|
|
}
|
|
|
|
.d-dialog > > > .avatar-uploader .el-upload {
|
|
width: 100px;
|
|
height: 100px;
|
|
}
|
|
|
|
.d-dialog > > > .el-upload-list--picture-card .el-upload-list__item {
|
|
width: 100px;
|
|
height: 100px;
|
|
}
|
|
|
|
.list-img {
|
|
width: 98px;
|
|
height: 98px;
|
|
}
|
|
|
|
.tab-box {
|
|
margin-top: 2px;
|
|
width: 100%;
|
|
height: 40px;
|
|
background: #fff;
|
|
display: flex;
|
|
box-sizing: border-box;
|
|
margin-bottom: 10px;
|
|
text-align: center; /* 水平居中 */
|
|
|
|
}
|
|
|
|
.tab_ {
|
|
width: 85px;
|
|
height: 100%;
|
|
//border-bottom: 2px solid #FF770F;
|
|
display: flex;
|
|
font-weight: 500;
|
|
font-size: 14px;
|
|
color: #999999;
|
|
align-items: center;
|
|
justify-content: center;
|
|
margin-left: 50px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.active {
|
|
border-bottom: 2px solid #FF770F !important;
|
|
color: #FF770F !important;
|
|
}
|
|
|
|
.ju {
|
|
display: block;
|
|
text-align: center;
|
|
}
|
|
|
|
</style>
|
|
|