短信推送功能完善
This commit is contained in:
parent
cf323977c3
commit
28dfe1ad34
|
|
@ -13,7 +13,7 @@
|
|||
"type" : "uniCloud"
|
||||
},
|
||||
{
|
||||
"playground" : "custom",
|
||||
"playground" : "standard",
|
||||
"type" : "uni-app:app-android"
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -160,6 +160,22 @@ export function getPersonInfoApi(data) {
|
|||
data: data
|
||||
})
|
||||
}
|
||||
// 获取人员信息
|
||||
export function addContentJobTicketApi(data) {
|
||||
return request_yn({
|
||||
url: '/ynPlanApp/infDay/addContentJobTicket',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 修改人员信息
|
||||
export function addPlanUserApi(data) {
|
||||
return request_yn({
|
||||
url: '/ynPlanApp/infDay/addPlanUser',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 生产月计划
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
import request_yn from '@/utils/request_new_yn'
|
||||
|
||||
// 获取推送人员信息列表
|
||||
export function getPushPersonListApi(data) {
|
||||
return request_yn({
|
||||
url: '/ynPlanApp/select/getSendMessageUser',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 点击报告获取内容
|
||||
export function getReportMessageApi(data) {
|
||||
return request_yn({
|
||||
url: '/ynPlanApp/infDay/getReportMessage',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
29
pages.json
29
pages.json
|
|
@ -329,11 +329,12 @@
|
|||
{
|
||||
//人员库-详情
|
||||
"path": "pages/realName/workbench/peopleLibrary/detail",
|
||||
"style": {
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},{
|
||||
//人员库-身份证识别
|
||||
},
|
||||
{
|
||||
//人员库-身份证识别
|
||||
"path": "pages/realName/workbench/peopleLibrary/idCard",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
|
|
@ -378,13 +379,13 @@
|
|||
}
|
||||
},
|
||||
//电子合同
|
||||
{
|
||||
//电子合同-提醒
|
||||
"path": "pages/realName/workbench/electronicContract/contractTip",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
//电子合同-提醒
|
||||
"path": "pages/realName/workbench/electronicContract/contractTip",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
//电子合同-视频
|
||||
"path": "pages/realName/workbench/electronicContract/contractVideo",
|
||||
|
|
@ -516,7 +517,7 @@
|
|||
"path": "pages/realName/workbench/exam/exam",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
//安全教育培训-考试详情
|
||||
|
|
@ -1047,6 +1048,12 @@
|
|||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/workPlan/messagePush/index",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}
|
||||
],
|
||||
"globalStyle": {
|
||||
|
|
|
|||
|
|
@ -380,6 +380,7 @@ export default {
|
|||
uni.setStorageSync('wkToken', res.data.user.token)
|
||||
uni.setStorageSync('wkName', res.data.user.username)
|
||||
uni.setStorageSync('wkRole', res.data.user.role)
|
||||
uni.setStorageSync('wkPermissions', res.data.permissions)
|
||||
// uni.setStorageSync('realNameUser', res.data.data.loginUser.sysUser)
|
||||
// uni.setStorageSync('realNamePermissions', res.data.data.loginUser.permissions)
|
||||
// uni.removeStorageSync('hasChosenPro')
|
||||
|
|
|
|||
|
|
@ -339,7 +339,14 @@
|
|||
></uni-data-select>
|
||||
|
||||
<view v-if="f.name === 'rys'" @tap="onAddSubUserInfoNew(f.name, index)">
|
||||
<u--input :autoHeight="true" type="text" v-model="item.rys" placeholder="请选择" disabled />
|
||||
<u--input
|
||||
style="color: #3c9cff"
|
||||
:autoHeight="true"
|
||||
type="text"
|
||||
v-model="item.rys"
|
||||
placeholder="请选择"
|
||||
disabled
|
||||
/>
|
||||
|
||||
<!-- <uni-easyinput
|
||||
v-else
|
||||
|
|
@ -363,18 +370,35 @@
|
|||
placeholder="请填写"
|
||||
/>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="作业票/站班会" v-if="currentTime == $moment().format('YYYY-MM-DD')">
|
||||
<uni-forms-item label="作业票/站班会(1-6张照片)" v-if="currentTime == $moment().format('YYYY-MM-DD')">
|
||||
<view class="example-body">
|
||||
<uni-file-picker
|
||||
v-model="imageValue"
|
||||
v-model="item.imgList"
|
||||
fileMediatype="image"
|
||||
mode="grid"
|
||||
@select="select"
|
||||
@delete="onDelete"
|
||||
:limit="item.imgCount"
|
||||
:title="`最多选择${item.imgCount}张图片`"
|
||||
v-if="item.imgCount > 0"
|
||||
></uni-file-picker>
|
||||
<view class="view-box">
|
||||
<view v-for="(j, i) in item.imgViewList" :key="i">
|
||||
<image
|
||||
:src="`http://192.168.0.14:19191/ynPlanApp${j}`"
|
||||
mode="scaleToFill"
|
||||
class="view-autograph"
|
||||
></image>
|
||||
<text class="delete-icon" @tap="onDeleteAutograph(j)">
|
||||
<uni-icons type="trash-filled" size="24" style="color: #fa3534"></uni-icons>
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
<view class="submit-btn" v-if="currentTime == $moment().format('YYYY-MM-DD')">保存提交</view>
|
||||
<view class="submit-btn" @tap="onSubmitViewData" v-if="currentTime == $moment().format('YYYY-MM-DD')">
|
||||
保存提交
|
||||
</view>
|
||||
</uni-forms>
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
|
|
@ -678,7 +702,9 @@ import {
|
|||
getReportFormListApi,
|
||||
getImportMonthPlanApi,
|
||||
getWorkPlanContentApi,
|
||||
getPersonInfoApi
|
||||
getPersonInfoApi,
|
||||
addContentJobTicketApi,
|
||||
addPlanUserApi
|
||||
} from '../../../api/workPlan/dayPlan'
|
||||
export default {
|
||||
components: {
|
||||
|
|
@ -978,11 +1004,36 @@ export default {
|
|||
this_.monthParams[this_.currenPersonIndex].rys =
|
||||
this_.monthParams[this_.currenPersonIndex].selectuser.split('@').length
|
||||
|
||||
if (activeIndex == '查看报表') {
|
||||
this_.monthDataList[this_.currenPersonIndexNew].selectuser = userId.slice(0, -1)
|
||||
if (this_.activeIndex == '查看报表') {
|
||||
// this_.monthDataList[this_.currenPersonIndexNew].selectuser = userId.slice(0, -1)
|
||||
|
||||
this_.monthDataList[this_.currenPersonIndexNew].rys =
|
||||
this_.monthDataList[this_.currenPersonIndexNew].selectuser.split('@').length
|
||||
this_.monthDataList[this_.currenPersonIndexNew].rys = data.length
|
||||
let personList = []
|
||||
let idNumberStr = ''
|
||||
if (data.length > 0) {
|
||||
data.forEach(e => {
|
||||
personList.push(e.idNumber)
|
||||
})
|
||||
|
||||
idNumberStr = personList.join('@')
|
||||
}
|
||||
const params = {
|
||||
contentId: this_.monthDataList[this_.currenPersonIndexNew].contentId,
|
||||
idNumber: idNumberStr,
|
||||
day: this_.monthDataList[this_.currenPersonIndexNew].planDate
|
||||
}
|
||||
|
||||
console.log(params, '******修改参数')
|
||||
|
||||
addPlanUserApi(params).then(res => {
|
||||
console.log('人员修改结果', res)
|
||||
|
||||
if (res.res == 1) {
|
||||
uni.showToast({ title: '修改成功', icon: 'none' })
|
||||
this_.getMonthPlanData()
|
||||
}
|
||||
})
|
||||
// this_.monthDataList[this_.currenPersonIndexNew].selectuser.split('@').length
|
||||
}
|
||||
|
||||
console.log(userNameStr, userId)
|
||||
|
|
@ -1260,6 +1311,18 @@ export default {
|
|||
uni.showToast({ icon: 'none', title: '暂无日计划数据!' })
|
||||
}
|
||||
this.monthDataList = res.obj
|
||||
|
||||
this.monthDataList.forEach(e => {
|
||||
this.$set(e, 'imgList', [])
|
||||
this.$set(e, 'imgViewList', [])
|
||||
this.$set(e, 'imgCount', 6)
|
||||
|
||||
if (e.zbhPath) {
|
||||
e.imgViewList = e.zbhPath.split(',')
|
||||
|
||||
e.imgCount -= e.imgViewList.length
|
||||
}
|
||||
})
|
||||
this.activeFormPages = 0
|
||||
|
||||
if (this.monthDataList.length > 0) {
|
||||
|
|
@ -1713,11 +1776,14 @@ export default {
|
|||
.then(res => {
|
||||
let personList = []
|
||||
console.log('res-----', res)
|
||||
if (res.obj.length > 0) {
|
||||
res.obj.forEach(e => {
|
||||
personList.push(e.idNumber)
|
||||
})
|
||||
e.selectuser = personList.join('@')
|
||||
|
||||
if (res.resMsg == 'success') {
|
||||
if (res.obj.length > 0) {
|
||||
res.obj.forEach(e => {
|
||||
personList.push(e.idNumber)
|
||||
})
|
||||
e.selectuser = personList.join('@')
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
|
|
@ -1762,7 +1828,11 @@ export default {
|
|||
this.monthDataList.forEach(e => {
|
||||
// console.log(e.selectuser, 'e.selectusere.selectusere.selectuser')
|
||||
console.log('eeeee----', e)
|
||||
personList.push(e.selectuser)
|
||||
|
||||
if (e.selectuser) {
|
||||
personList.push(e.selectuser)
|
||||
}
|
||||
|
||||
// this.$set(e, 'selectusere', 'personStr')
|
||||
})
|
||||
|
||||
|
|
@ -1865,12 +1935,12 @@ export default {
|
|||
const imgUrl = item.url
|
||||
const imgName = item.name
|
||||
uni.uploadFile({
|
||||
url: 'http://192.168.0.14:19191/ynPlanApp/infDay/addContentJobTicket',
|
||||
url: 'http://192.168.0.14:19191/ynPlanApp/user/uploadPhoto',
|
||||
filePath: imgUrl,
|
||||
name: 'image',
|
||||
formData: {
|
||||
file: imgUrl,
|
||||
photoType: 'photo'
|
||||
photoType: 'zbh'
|
||||
},
|
||||
header: { 'Content-Type': 'multipart/form-data' },
|
||||
success: uploadFileRes => {
|
||||
|
|
@ -1878,13 +1948,15 @@ export default {
|
|||
console.log('上传成功!', uploadFileRes)
|
||||
const imgInfo = {
|
||||
name: imgName,
|
||||
tempUrl: `ynPlan/photo/${this.$moment().format('YYYY')}/${this.$moment().format(
|
||||
tempUrl: `ynPlan/zbh/${this.$moment().format('YYYY')}/${this.$moment().format(
|
||||
'MM'
|
||||
)}/${this.$moment().format('DD')}/${imgName}`,
|
||||
url: imgUrl
|
||||
}
|
||||
|
||||
this.imageValue.push(imgInfo)
|
||||
// console.log(this.activeFormPages,'----')
|
||||
// console.log(this.monthDataList[this.activeFormPages],'----')
|
||||
this.monthDataList[this.activeFormPages].imgList.push(imgInfo)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
@ -1892,7 +1964,88 @@ export default {
|
|||
},
|
||||
onDelete(e) {
|
||||
const tempFilePath = e.tempFilePath
|
||||
this.imageValue = this.imageValue.filter(e => e.url !== tempFilePath)
|
||||
this.monthDataList[this.activeFormPages].imgList = this.monthDataList[this.activeFormPages].imgList.filter(
|
||||
e => e.url !== tempFilePath
|
||||
)
|
||||
|
||||
if (this.monthDataList[this.activeFormPages].imgViewList.length > 0) {
|
||||
this.monthDataList[this.activeFormPages].imgCount =
|
||||
6 -
|
||||
(this.monthDataList[this.activeFormPages].imgList.length +
|
||||
this.monthDataList[this.activeFormPages].imgViewList.length)
|
||||
} else {
|
||||
this.monthDataList[this.activeFormPages].imgCount = 6
|
||||
}
|
||||
},
|
||||
/* 查看报表中的保存提交 */
|
||||
async onSubmitViewData() {
|
||||
console.log(this.monthDataList[this.activeFormPages], '----')
|
||||
|
||||
if (
|
||||
this.monthDataList[this.activeFormPages].imgList.length < 1 &&
|
||||
!this.monthDataList[this.activeFormPages].zbhPath
|
||||
) {
|
||||
uni.showToast({ title: `当前页并未上传作业票/站班会图片,请上传!`, icon: 'none' })
|
||||
return
|
||||
}
|
||||
let imgArray = []
|
||||
let imgStr = ''
|
||||
|
||||
if (this.monthDataList[this.activeFormPages].imgList.length > 0) {
|
||||
this.monthDataList[this.activeFormPages].imgList.forEach(e => {
|
||||
imgArray.push(e.tempUrl)
|
||||
})
|
||||
|
||||
imgStr = imgArray.join(',')
|
||||
}
|
||||
let imgViewArray = []
|
||||
let imgViewStr = ''
|
||||
if (this.monthDataList[this.activeFormPages].imgViewList.length > 0) {
|
||||
this.monthDataList[this.activeFormPages].imgViewList.forEach(e => {
|
||||
imgViewArray.push(e.slice(1))
|
||||
})
|
||||
|
||||
imgViewStr = imgViewArray.join(',')
|
||||
}
|
||||
|
||||
const params = [
|
||||
{
|
||||
zbhPath: imgStr ? `${imgStr},${imgViewStr}` : imgViewStr,
|
||||
contentId: this.monthDataList[this.activeFormPages].contentId
|
||||
}
|
||||
]
|
||||
|
||||
console.log('保存参数', params)
|
||||
|
||||
uni.showLoading({
|
||||
title: '正在提交,请勿重复点击'
|
||||
})
|
||||
const result = await addContentJobTicketApi({ list: JSON.stringify(params) })
|
||||
uni.hideLoading()
|
||||
|
||||
if (result.res == 1) {
|
||||
uni.showToast({ title: '提交成功!', icon: 'none' })
|
||||
this.getMonthPlanData()
|
||||
} else {
|
||||
uni.showToast({ title: res.resMsg, icon: 'none' })
|
||||
}
|
||||
// console.log(result,'保存结果')
|
||||
},
|
||||
/* 删除图片 */
|
||||
onDeleteAutograph(item) {
|
||||
this.monthDataList[this.activeFormPages].imgViewList = this.monthDataList[
|
||||
this.activeFormPages
|
||||
].imgViewList.filter(e => e != item)
|
||||
|
||||
if (this.monthDataList[this.activeFormPages].imgList.length > 0) {
|
||||
this.monthDataList[this.activeFormPages].imgCount =
|
||||
6 - this.monthDataList[this.activeFormPages].imgViewList.length
|
||||
} else {
|
||||
this.monthDataList[this.activeFormPages].imgCount =
|
||||
6 -
|
||||
(this.monthDataList[this.activeFormPages].imgList.length +
|
||||
this.monthDataList[this.activeFormPages].imgViewList.length)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -2507,7 +2660,45 @@ export default {
|
|||
font-size: 26rpx;
|
||||
}
|
||||
.example-body {
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
|
||||
.upload-container {
|
||||
width: 30%;
|
||||
height: 220rpx;
|
||||
}
|
||||
|
||||
.view-box {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
view {
|
||||
width: 31%;
|
||||
margin-left: 3%;
|
||||
margin-top: 20rpx !important;
|
||||
height: 230rpx;
|
||||
// background-color: #eee;
|
||||
// border: 1px solid #ccc;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
|
||||
.delete-icon {
|
||||
position: absolute;
|
||||
top: 3rpx;
|
||||
right: 3rpx;
|
||||
}
|
||||
|
||||
.view-autograph {
|
||||
width: 100%;
|
||||
height: 230rpx;
|
||||
// z-index: 6;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.view-box view:nth-child(3n + 1) {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.submit-btn {
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@
|
|||
<view class="person-list">
|
||||
<view>
|
||||
固定人员:
|
||||
<text v-for="(item, index) in fixedPersonList" :key="index">{{ item }}</text>
|
||||
<text style="color: #c95645" v-for="(item, index) in fixedPersonList" :key="index">{{ item }}</text>
|
||||
</view>
|
||||
<view>
|
||||
暂退人员:
|
||||
|
|
@ -271,7 +271,7 @@ export default {
|
|||
// })
|
||||
// }
|
||||
|
||||
console.log('全部状态---')
|
||||
console.log('全部状态---', this.personList)
|
||||
if (this.subUserListTemp.length == 0) {
|
||||
if (this.personList.length > 0) {
|
||||
this.subUserListAll.forEach(e => {
|
||||
|
|
@ -297,6 +297,8 @@ export default {
|
|||
this.subUserList = JSON.parse(JSON.stringify(this.subUserListAll))
|
||||
// this.subUserListTemp = JSON.parse(JSON.stringify(this.subUserListAll))
|
||||
}
|
||||
} else {
|
||||
this.subUserList = JSON.parse(JSON.stringify(this.subUserListAll))
|
||||
}
|
||||
} else {
|
||||
this.subUserListAll.forEach(e => {
|
||||
|
|
@ -407,40 +409,42 @@ export default {
|
|||
},
|
||||
// 提交
|
||||
onUserSubmit() {
|
||||
const isSelect = this.subUserList.some(e => e.isChecked === true)
|
||||
if (!isSelect) {
|
||||
uni.showToast({
|
||||
title: '请勾选人员数据',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
} else {
|
||||
this.subUserList.forEach(e => {
|
||||
console.log('选择的每一项', e)
|
||||
// const isSelect = this.subUserList.some(e => e.isChecked === true)
|
||||
// if (!isSelect) {
|
||||
// uni.showToast({
|
||||
// title: '请勾选人员数据',
|
||||
// icon: 'none'
|
||||
// })
|
||||
// return
|
||||
// } else {
|
||||
|
||||
if (e.isChecked) {
|
||||
if (e.userState == 1) {
|
||||
// 固定人员
|
||||
this.fixedPersonList.push(e.name)
|
||||
}
|
||||
if (e.userState == 2) {
|
||||
// 临时人员
|
||||
this.tempPersonList.push(e.name)
|
||||
}
|
||||
if (e.userState == 3) {
|
||||
// 暂退人员
|
||||
this.returnPersonList.push(e.name)
|
||||
}
|
||||
// }
|
||||
|
||||
this.subUserList.forEach(e => {
|
||||
console.log('选择的每一项', e)
|
||||
|
||||
if (e.isChecked) {
|
||||
if (e.userState == 1) {
|
||||
// 固定人员
|
||||
this.fixedPersonList.push(e.name)
|
||||
}
|
||||
})
|
||||
this.$refs.popupPerson.open('center')
|
||||
}
|
||||
if (e.userState == 2) {
|
||||
// 临时人员
|
||||
this.tempPersonList.push(e.name)
|
||||
}
|
||||
if (e.userState == 3) {
|
||||
// 暂退人员
|
||||
this.returnPersonList.push(e.name)
|
||||
}
|
||||
}
|
||||
})
|
||||
this.$refs.popupPerson.open('center')
|
||||
},
|
||||
onCancelBtn() {
|
||||
this.$refs.popupPerson.close()
|
||||
},
|
||||
onSubmitBtn() {
|
||||
const userInfo = this.subUserList.filter(e => e.isChecked === true)
|
||||
const userInfo = this.subUserList.filter(e => e.isChecked == true)
|
||||
uni.navigateBack({
|
||||
delta: 1,
|
||||
success() {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,420 @@
|
|||
<template>
|
||||
<view>
|
||||
<u-navbar
|
||||
class="u-navbar"
|
||||
title="短信推送"
|
||||
placeholder
|
||||
@leftClick="leftClick"
|
||||
leftIconColor="#fff"
|
||||
bgColor="#00337A"
|
||||
:titleStyle="{ color: '#FFF', fontSize: '32rpx' }"
|
||||
/>
|
||||
<view class="push-container">
|
||||
<view class="receipt-person">
|
||||
<view>收件人:</view>
|
||||
<view>
|
||||
<u--textarea v-model="phoneStr" placeholder="请输入手机号" autoHeight />
|
||||
</view>
|
||||
<view class="search-icon" @tap="onSearchPerson" />
|
||||
</view>
|
||||
|
||||
<!-- 内容区域 -->
|
||||
<view class="message-content">
|
||||
<view class="btn-container">
|
||||
<view class="report-btn" @tap="getReportMessage">报告</view>
|
||||
</view>
|
||||
|
||||
<view class="message-ipt">
|
||||
<u--textarea v-model="reportMessage" placeholder="请输入或点击报告填写内容" autoHeight />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="send-btn" @tap="onSendMessage">发送</view>
|
||||
</view>
|
||||
|
||||
<!-- 人员弹框 -->
|
||||
<uni-popup ref="popupAuditing" background-color="#fff">
|
||||
<view class="auditing-content">
|
||||
<view class="auditing-title">
|
||||
<view class="title">
|
||||
<text style="margin-left: 15rpx">请选择推送人</text>
|
||||
</view>
|
||||
<view class="search">
|
||||
<view class="search-ipt">
|
||||
<uni-easyinput :clear="false" type="text" placeholder="请输入姓名关键字" v-model="searchUserName" />
|
||||
</view>
|
||||
<view class="search-btn" @tap="onSearchUserInfo">搜索</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="user-info">
|
||||
<view class="user-title">
|
||||
<view style="width: 8%"></view>
|
||||
<view style="width: 12%">姓名</view>
|
||||
<view style="width: 40%">岗位</view>
|
||||
<view style="width: 40%">电话</view>
|
||||
</view>
|
||||
|
||||
<scroll-view :scroll-y="true" style="height: 33vh" @scrolltolower="onScrollTolower">
|
||||
<view class="user-content" v-for="item in auditingUserList" :key="item.id">
|
||||
<view style="width: 8%">
|
||||
<label>
|
||||
<checkbox
|
||||
:checked="item.isChecked"
|
||||
color="#fff"
|
||||
borderColor="#ccc"
|
||||
backgroundColor="#fff"
|
||||
activeBorderColor="#003778"
|
||||
activeBackgroundColor="#003778"
|
||||
style="transform: scale(0.7)"
|
||||
@tap="onCheckBoxChange(item)"
|
||||
/>
|
||||
</label>
|
||||
</view>
|
||||
<view style="width: 12%">{{ item.name }}</view>
|
||||
<view style="width: 40%">{{ item.orgName }}</view>
|
||||
<view style="width: 40%">{{ item.phone }}</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<view class="user-btn">
|
||||
<view class="btn-cancel" @tap="onHandlerCancel">取消</view>
|
||||
<view class="btn-submit" @tap="onHandlerSubmit">确定</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getPushPersonListApi, getReportMessageApi } from '../../../api/workPlan/my'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
pageNo: 0, // 当前页数
|
||||
phoneStr: '',
|
||||
reportMessage: '',
|
||||
searchUserName: '',
|
||||
mobilePhoneNumber: '',
|
||||
phoneList: [],
|
||||
auditingUserList: [],
|
||||
pushPersonListAll: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
leftClick() {
|
||||
uni.navigateBack()
|
||||
},
|
||||
onSearchPerson() {
|
||||
// console.log('查找收件人')
|
||||
this.searchUserName = ''
|
||||
this.$refs.popupAuditing.open('center')
|
||||
this.getPushPersonListData()
|
||||
},
|
||||
|
||||
async getPushPersonListData() {
|
||||
this.pageNo = 0
|
||||
uni.showLoading({ title: '正在查询,请勿重复点击', mask: true })
|
||||
const res = await getPushPersonListApi({ name: this.searchUserName })
|
||||
uni.hideLoading()
|
||||
// console.log(res, '人员信息')
|
||||
// 1. 先存储所有数据
|
||||
this.pushPersonListAll = res
|
||||
this.pushPersonListAll.forEach(e => {
|
||||
this.$set(e, 'isChecked', false)
|
||||
})
|
||||
|
||||
// 2. 展示 10 条数据
|
||||
this.auditingUserList = this.pushPersonListAll.slice(this.pageNo, 10)
|
||||
this.pageNo++
|
||||
},
|
||||
// 搜索人员
|
||||
onSearchUserInfo() {
|
||||
this.getPushPersonListData()
|
||||
},
|
||||
// 取消
|
||||
onHandlerCancel() {
|
||||
this.$refs.popupAuditing.close()
|
||||
},
|
||||
// 确定
|
||||
onHandlerSubmit() {
|
||||
const selectPersonList = this.auditingUserList.filter(e => e.isChecked === true)
|
||||
|
||||
// console.log('selectPersonList', selectPersonList)
|
||||
|
||||
let phoneList = []
|
||||
if (selectPersonList.length > 0) {
|
||||
selectPersonList.forEach(e => {
|
||||
phoneList.push(e.phone)
|
||||
})
|
||||
}
|
||||
|
||||
this.phoneList = phoneList // 选中的人员号码
|
||||
this.phoneStr = phoneList.join(',') // 回显号码
|
||||
this.$refs.popupAuditing.close()
|
||||
},
|
||||
// 复选框单击事件
|
||||
onCheckBoxChange(item) {
|
||||
// console.log(item, '*****')
|
||||
item.isChecked = !item.isChecked
|
||||
},
|
||||
// 滚动触底
|
||||
onScrollTolower() {
|
||||
// console.log('滚动触底---')
|
||||
this.auditingUserList = [
|
||||
...this.auditingUserList,
|
||||
...this.pushPersonListAll.splice(this.pageNo * 10, (this.pageNo + 1) * 10)
|
||||
]
|
||||
this.pageNo++
|
||||
},
|
||||
// 报告按钮
|
||||
async getReportMessage() {
|
||||
const res = await getReportMessageApi()
|
||||
this.reportMessage = res
|
||||
// console.log('报告内容', res)
|
||||
},
|
||||
// 发送按钮
|
||||
onSendMessage() {
|
||||
if (!this.phoneStr) {
|
||||
uni.showToast({ title: '请选择收件人或填写收件人号码', icon: 'none' })
|
||||
return
|
||||
}
|
||||
if (!this.reportMessage) {
|
||||
uni.showToast({ title: '请填写短信内容', icon: 'none' })
|
||||
return
|
||||
}
|
||||
|
||||
const sendPhoneList = this.phoneStr.split(',')
|
||||
|
||||
console.log('sendPhoneList', sendPhoneList)
|
||||
|
||||
new Promise((resolve, reject) => {
|
||||
let promisesFun = []
|
||||
|
||||
sendPhoneList.forEach(e => {
|
||||
console.log(e, '手机号码')
|
||||
|
||||
// 封装 uni.request 为 Promise
|
||||
let promise = new Promise((reqResolve, reqReject) => {
|
||||
let params = {
|
||||
ddtKey: 'bonusyn',
|
||||
secretkey: 'IU0ypHbH',
|
||||
mobile: e,
|
||||
content: this.reportMessage
|
||||
}
|
||||
console.log('发送参数', params)
|
||||
|
||||
uni.request({
|
||||
url: 'http://api.ktsms.cn/sms_token',
|
||||
method: 'POST',
|
||||
data: params,
|
||||
header: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
// dataType: 'json',
|
||||
success: res => {
|
||||
console.log('短信发送成功', res)
|
||||
reqResolve(res) // 请求成功,调用 reqResolve
|
||||
},
|
||||
fail: err => {
|
||||
console.log(err, '发送失败')
|
||||
reqReject(err) // 请求失败,调用 reqReject
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
// 将返回的 promise 添加到数组中
|
||||
promisesFun.push(promise)
|
||||
})
|
||||
|
||||
// 等待所有请求完成
|
||||
Promise.all(promisesFun)
|
||||
.then(() => {
|
||||
resolve() // 所有请求成功后调用 resolve
|
||||
})
|
||||
.catch(err => {
|
||||
reject(err) // 如果有任何请求失败,调用 reject
|
||||
})
|
||||
})
|
||||
.then(res => {
|
||||
// console.log('短信发送结果---')
|
||||
uni.showToast({ title: '短信发送成功!', icon: 'none' })
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 500)
|
||||
})
|
||||
.catch(err => {
|
||||
console.log('短信发送失败')
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.push-container {
|
||||
background-color: #eef3f7;
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
padding-top: 20rpx;
|
||||
|
||||
.receipt-person {
|
||||
width: 94%;
|
||||
margin: 0 auto;
|
||||
padding: 22rpx 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
background-color: #fff;
|
||||
|
||||
.search-icon {
|
||||
width: 78rpx;
|
||||
height: 78rpx;
|
||||
background: url('../../../static/images/workPlan/contacts.png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
view {
|
||||
margin: 0 12rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.receipt-person view:nth-child(2) {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.message-content {
|
||||
width: 94%;
|
||||
height: 50vh;
|
||||
margin: 20rpx auto 15rpx;
|
||||
padding: 22rpx 0;
|
||||
background-color: #fff;
|
||||
|
||||
.btn-container {
|
||||
width: 95%;
|
||||
margin: 15rpx auto;
|
||||
}
|
||||
|
||||
.report-btn {
|
||||
width: 165rpx;
|
||||
height: 72rpx;
|
||||
line-height: 72rpx;
|
||||
text-align: center;
|
||||
border-radius: 16rpx;
|
||||
background-color: #003778;
|
||||
font-size: 26rpx;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.message-ipt {
|
||||
width: 95%;
|
||||
margin: 20rpx auto 0;
|
||||
}
|
||||
}
|
||||
|
||||
.send-btn {
|
||||
width: 60%;
|
||||
height: 78rpx;
|
||||
margin: 30rpx auto 0;
|
||||
line-height: 78rpx;
|
||||
text-align: center;
|
||||
border-radius: 12rpx;
|
||||
background-color: #003778;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.auditing-content {
|
||||
width: 95vw;
|
||||
height: 60vh;
|
||||
background-color: #eee;
|
||||
|
||||
.auditing-title {
|
||||
width: 100%;
|
||||
padding-bottom: 4rpx;
|
||||
margin-bottom: 16rpx;
|
||||
background-color: #fff;
|
||||
|
||||
.title {
|
||||
width: 93%;
|
||||
margin: 20rpx auto;
|
||||
padding: 13rpx 0;
|
||||
border: 1px solid #ccc;
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
border-radius: 5rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.search {
|
||||
width: 93%;
|
||||
margin: 20rpx auto;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.search-ipt {
|
||||
width: 65%;
|
||||
}
|
||||
|
||||
.search-btn {
|
||||
width: 25%;
|
||||
height: 60rpx;
|
||||
text-align: center;
|
||||
line-height: 60rpx;
|
||||
color: #fff;
|
||||
border-radius: 12rpx;
|
||||
background-color: #003778;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.user-info {
|
||||
width: 93%;
|
||||
margin: 0 auto;
|
||||
box-sizing: content-box;
|
||||
background-color: #fff;
|
||||
.user-title,
|
||||
.user-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 8rpx;
|
||||
|
||||
view {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.user-content {
|
||||
padding: 15rpx 0;
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
}
|
||||
|
||||
.user-btn {
|
||||
width: 93%;
|
||||
margin: 0 auto;
|
||||
padding-top: 28rpx;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
|
||||
view {
|
||||
width: 40%;
|
||||
height: 82rpx;
|
||||
text-align: center;
|
||||
line-height: 82rpx;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
.btn-cancel {
|
||||
background-color: #ccc !important;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.btn-submit {
|
||||
color: #fff;
|
||||
background-color: #003778 !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
<view>{{ userPhone }}</view>
|
||||
</view>
|
||||
|
||||
<view class="message-push">
|
||||
<view class="message-push" @tap="onMessagePush">
|
||||
<uni-icons type="email" size="30" style="color: #9da7b0; margin-right: 36rpx"></uni-icons>
|
||||
短信推送
|
||||
</view>
|
||||
|
|
@ -31,7 +31,8 @@ export default {
|
|||
return {
|
||||
tabbar: TabbarConfig,
|
||||
userName: '',
|
||||
userPhone: ''
|
||||
userPhone: '',
|
||||
wkPermissions: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -40,11 +41,33 @@ export default {
|
|||
uni.reLaunch({
|
||||
url: '/pages/gzt/index'
|
||||
})
|
||||
},
|
||||
/* 短信推送按钮 */
|
||||
onMessagePush() {
|
||||
console.log('推送')
|
||||
|
||||
if (this.wkPermissions.length > 0) {
|
||||
const isPush = this.wkPermissions.some(e => e.name == '短信推送')
|
||||
|
||||
if (isPush) {
|
||||
// console.log('具备权限')
|
||||
uni.navigateTo({ url: '/pages/workPlan/messagePush/index' })
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '当前无短信推送权限,请联系管理员!',
|
||||
icon: 'none',
|
||||
mask: true
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
console.log(this.wkPermissions, '权限')
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.userName = uni.getStorageSync('wkName')
|
||||
this.userPhone = uni.getStorageSync('userPhone')
|
||||
this.wkPermissions = uni.getStorageSync('wkPermissions')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 544 B |
Loading…
Reference in New Issue