提交 2d4db049 编写于 作者: guangjun.yang's avatar guangjun.yang

请选择发送时间

上级 1ce3be99
...@@ -16,33 +16,35 @@ ...@@ -16,33 +16,35 @@
<span class="word-num">{{(formData.noticeContent).replace(/\s+/g,"").length}}/250</span> <span class="word-num">{{(formData.noticeContent).replace(/\s+/g,"").length}}/250</span>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="发送时间:" prop="sendTime"> <el-form-item label="发送时间:" prop="customPushTime">
<el-col :span="8"> <el-col :span="8">
<el-date-picker <el-date-picker
v-model="formData.sendTime" v-model="formData.customPushTime"
size="small" size="small"
type="datetime" type="datetime"
placeholder="请选择发送时间" placeholder="请选择发送时间"
value-format="yyyy-MM-dd HH:mm" value-format="yyyy-MM-dd HH:mm"
format="yyyy-MM-dd HH:mm" format="yyyy-MM-dd HH:mm"
style="width: 100%;" style="width: 100%;"
:picker-options="pickerOptions0"
></el-date-picker> ></el-date-picker>
</el-col> </el-col>
</el-form-item> </el-form-item>
<!-- :picker-options="pickerOptions0" -->
<el-form-item label="发送方式:"> <el-form-item label="发送方式:">
<el-col :span="20"> <el-col :span="20">
<el-checkbox size="small" v-model="formData.sendType">查看原始数据</el-checkbox> <el-checkbox-group v-model="formData.channel">
<el-checkbox size="small" :label="1">查看原始数据</el-checkbox>
</el-checkbox-group>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="发送对象:" prop="sendObj"> <el-form-item label="发送对象:" prop="sendScopeType">
<el-col :span="20"> <el-col :span="20">
<el-radio-group v-model="formData.sendObj"> <el-radio-group v-model="formData.sendScopeType">
<el-radio label="尚未参加的学员" name="sendObj"></el-radio> <el-radio :label=1>尚未参加的学员</el-radio>
<el-radio label="未完成项目的学员" name="sendObj"></el-radio> <el-radio :label=2>未完成项目的学员</el-radio>
<el-radio label="项目内区域/机构负责人" name="sendObj"></el-radio> <el-radio :label=3>项目内区域/机构负责人</el-radio>
<el-radio label="本机构及下级机构学员" name="sendObj"></el-radio> <el-radio :label=4>本机构及下级机构学员</el-radio>
<el-radio label="所有人" name="sendObj"></el-radio> <el-radio :label=5>所有人</el-radio>
</el-radio-group> </el-radio-group>
</el-col> </el-col>
</el-form-item> </el-form-item>
...@@ -64,7 +66,7 @@ ...@@ -64,7 +66,7 @@
<el-dialog <el-dialog
class="prot-dialog" class="prot-dialog"
title="" title="确认要发布吗?"
:visible.sync="isShowDialog" :visible.sync="isShowDialog"
width="30%" width="30%"
center center
...@@ -92,6 +94,11 @@ import * as commonUtil from "@/utils/utils"; ...@@ -92,6 +94,11 @@ import * as commonUtil from "@/utils/utils";
import * as operationData from "@/utils/operation"; import * as operationData from "@/utils/operation";
let vm = null; let vm = null;
export default { export default {
props: {
formData: {
type: Object,
}
},
data() { data() {
// let checkNoticeTitleStr = (rule, value, callback) => { // let checkNoticeTitleStr = (rule, value, callback) => {
// if(value.indexOf("\\") != -1) {//存在 // if(value.indexOf("\\") != -1) {//存在
...@@ -112,15 +119,15 @@ export default { ...@@ -112,15 +119,15 @@ export default {
{labelId: 3, labelName: '3333'}, {labelId: 3, labelName: '3333'},
{labelId: 4, labelName: '4444'} {labelId: 4, labelName: '4444'}
], ],
formData: { // formData: {
noticeTitle: '', // "projectId": 708,
noticeContent: '', // "noticeId": 1,
sendTime: 0, // "noticeTitle": "",
sendType: [], // "noticeContent": "",
choosedLabelList: [], // "customPushTime": '2029-11-30 15:25:00',
sendObj: 2, // "channel":[1],
projectId: 0 // "sendScopeType":1
}, // },
isShowDialog: false, isShowDialog: false,
isCancleBtn: true, isCancleBtn: true,
rules: { rules: {
...@@ -143,40 +150,43 @@ export default { ...@@ -143,40 +150,43 @@ export default {
trigger: "blur" trigger: "blur"
}, },
], ],
sendTime: [ customPushTime: [
{ required: true, message: "请选择发送对象", trigger: "blur" }, { required: true, message: "请选择发送时间", trigger: "blur" },
], ],
sendObj: [ sendScopeType: [
{ required: true, message: "请选择发送对象", trigger: "blur" }, { required: true, message: "请选择发送对象", trigger: "blur" },
] ]
} },
changeNum: 1,
pickerOptions0: {
disabledDate: time => {
if (this.formData.customPushTime) {
return (
time.getTime() < new Date().getTime() - 24 * 60 * 60 * 1000
);
}
}
},
}; };
}, },
watch: {
formData: {
handler(newVal) {
this.changeNum ++;
this.$emit('changeNum', this.changeNum);
},
deep: true
}
},
created() { created() {
vm = this; vm = this;
vm.projectId = vm.getUrlSearch(window.location.href, "projectId") || 1476;
vm.formData.projectId = vm.projectId
vm.getNoticeInfo();
}, },
// 挂载到Dom完成时 // 挂载到Dom完成时
mounted: function() { mounted: function() {
// commonUtil.resizeHeight(300, 500, 'slidebar-container', 'screenSetSPId'); // commonUtil.resizeHeight(300, 500, 'slidebar-container', 'screenSetSPId');
}, },
methods: { methods: {
//获取推送信息
getNoticeInfo() {
let req = {
projectId: vm.projectId
};
openLoading(vm);
vm.GET("portal/noticeInfo/getNoticeInfo", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
vm.formData = res.data;
}
});
},
beforeConfirm() { beforeConfirm() {
let flag = false; let flag = false;
vm.$refs['formData'].validate(valid => { vm.$refs['formData'].validate(valid => {
...@@ -196,8 +206,8 @@ export default { ...@@ -196,8 +206,8 @@ export default {
//提交推送信息 //提交推送信息
confirmEdit(needJump) { confirmEdit(needJump) {
openLoading(vm); openLoading(vm);
vm.formData.projectId = vm.projectId // vm.formData.projectId = vm.projectId
vm.POST("portal/noticeInfo/insertOrUpdate", vm.formData).then(res => { vm.POST("portal/noticeInfo/insertOrUpdateAppPush", vm.formData).then(res => {
closeLoading(vm); closeLoading(vm);
if (res.code == "000000") { if (res.code == "000000") {
// if(needJump) { // if(needJump) {
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<el-dialog <el-dialog
class="prot-dialog" class="prot-dialog"
title="" title="确认要发布吗?"
:visible.sync="isShowDialog" :visible.sync="isShowDialog"
width="30%" width="30%"
center center
...@@ -71,6 +71,7 @@ ...@@ -71,6 +71,7 @@
<el-button size="small" type="primary" @click="openFlagConfirm"> 确定 </el-button> <el-button size="small" type="primary" @click="openFlagConfirm"> 确定 </el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
...@@ -83,6 +84,11 @@ export default { ...@@ -83,6 +84,11 @@ export default {
components: { components: {
BreadCrumb BreadCrumb
}, },
props: {
formData: {
type: Object,
},
},
data() { data() {
// let checkNoticeTitleStr = (rule, value, callback) => { // let checkNoticeTitleStr = (rule, value, callback) => {
// if(value.indexOf("\\") != -1) {//存在 // if(value.indexOf("\\") != -1) {//存在
...@@ -97,15 +103,16 @@ export default { ...@@ -97,15 +103,16 @@ export default {
curmbFirst: "教培项目", curmbFirst: "教培项目",
curmbSecond: "公告管理", curmbSecond: "公告管理",
projectId: "", projectId: "",
formData: { // formData: {
noticeContent: "", // noticeContent: "",
noticeId: 0, // noticeId: 0,
noticeTitle: "", // noticeTitle: "",
openFlag: 0, // openFlag: 0,
projectId: 0 // projectId: 0
}, // },
isShowDialog: false, isShowDialog: false,
isCancleBtn: true, isCancleBtn: true,
changeNum: 1,
rules: { rules: {
noticeTitle: [ noticeTitle: [
{ required: true, message: "请输入公告标题", trigger: "blur" }, { required: true, message: "请输入公告标题", trigger: "blur" },
...@@ -126,33 +133,26 @@ export default { ...@@ -126,33 +133,26 @@ export default {
trigger: "blur" trigger: "blur"
}, },
], ],
} },
}; };
}, },
watch: {
formData: {
handler(newVal) {
this.changeNum ++;
this.$emit('changeNum', this.changeNum);
},
deep: true
}
},
created() { created() {
vm = this; vm = this;
vm.projectId = vm.getUrlSearch(window.location.href, "projectId") || 1476;
vm.formData.projectId = vm.projectId
vm.getNoticeInfo();
}, },
// 挂载到Dom完成时 // 挂载到Dom完成时
mounted: function() { mounted: function() {
commonUtil.resizeHeight(300, 500, 'slidebar-container', 'screenSetSNId'); commonUtil.resizeHeight(300, 500, 'slidebar-container', 'screenSetSNId');
}, },
methods: { methods: {
//获取公告信息
getNoticeInfo() {
let req = {
projectId: vm.projectId
};
openLoading(vm);
vm.GET("portal/noticeInfo/getNoticeInfo", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
vm.formData = res.data;
}
});
},
beforeConfirm() { beforeConfirm() {
let flag = false; let flag = false;
...@@ -173,7 +173,7 @@ export default { ...@@ -173,7 +173,7 @@ export default {
//提交公告信息 //提交公告信息
confirmEdit(needJump) { confirmEdit(needJump) {
openLoading(vm); openLoading(vm);
vm.formData.projectId = vm.projectId // vm.formData.projectId = vm.projectId
vm.POST("portal/noticeInfo/insertOrUpdate", vm.formData).then(res => { vm.POST("portal/noticeInfo/insertOrUpdate", vm.formData).then(res => {
closeLoading(vm); closeLoading(vm);
if (res.code == "000000") { if (res.code == "000000") {
......
...@@ -55,7 +55,7 @@ service.interceptors.request.use(config => { ...@@ -55,7 +55,7 @@ service.interceptors.request.use(config => {
if( process.env.BUILD_ENV == "development" ){ // 本地开发环境 if( process.env.BUILD_ENV == "development" ){ // 本地开发环境
// console.log('环境变量>>>> ', process.env.BUILD_ENV); // console.log('环境变量>>>> ', process.env.BUILD_ENV);
// config.headers['token'] = '29D71EAAB92E4580AFB16A8011BE7206'; // config.headers['token'] = '29D71EAAB92E4580AFB16A8011BE7206';
config.headers['token'] = '9154BF207DFB41C89ECFF57FCB3F5243'; config.headers['token'] = '52C379E6442B4B6AB3573E3E9D0822BE';
// config.headers['token'] = localStorage.getItem('storageToken') // config.headers['token'] = localStorage.getItem('storageToken')
}else{ }else{
config.headers['token'] = localStorage.getItem('storageToken') config.headers['token'] = localStorage.getItem('storageToken')
......
<template>
<div class="notice-item-shield">
<bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond"></bread-crumb>
<div class="component-content screenSet" id="screenSet">
<div class="header-title" style="position:relative;">
公告
<el-button
type="primary"
style="position: absolute;right: 30px;bottom: 8px;"
size="small"
@click="beforeConfirm()"
>发布</el-button>
<el-button
type="primary"
style="position: absolute;right: 100px;bottom: 8px;"
size="small"
@click="cancleEdit()"
>取消</el-button>
</div>
<el-row :gutter="30" class="row" type="flex" style="margin-top: 10px;">
<el-form :model="formData" ref="formData" :rules="rules" label-width="120px" class="form-inline">
<el-form-item label="是否开启公告:" prop="projectIntro" style="min-width: 1000px;margin-bottom: 10px">
<el-col :span="20">
<el-radio-group size="small" v-model="formData.openFlag">
<el-radio :label="1">开启</el-radio>
<el-radio :label="2">关闭</el-radio>
</el-radio-group>
</el-col>
</el-form-item>
<!-- <el-col :span="22" style="min-width: 600px;">
<el-form-item label="是否开启公告:">
<el-radio-group size="small" v-model="formData.openFlag" @change="changeOpenFlag">
<el-radio :label="1">开启</el-radio>
<el-radio :label="2">关闭</el-radio>
</el-radio-group>
</el-form-item>
</el-col> -->
<el-form-item v-show="formData.openFlag != 2" label="标题:" prop="noticeTitle">
<el-col :span="20">
<el-input size="small" v-model="formData.noticeTitle" placeholder="请输入公告标题" maxlength=20></el-input>
<span class="word-num">{{(formData.noticeTitle).replace(/\s+/g,"").length}}/20</span>
</el-col>
</el-form-item>
<!-- <el-col v-show="formData.openFlag != 2" :span="20">
<el-form-item label="标题:" prop="noticeTitle">
<el-input size="small" v-model="formData.noticeTitle" placeholder="请输入公告标题" maxlength=20></el-input>
<span class="word-num">{{(formData.noticeTitle).replace(/\s+/g,"").length}}/20</span>
</el-form-item>
</el-col> -->
<el-form-item v-show="formData.openFlag != 2" label="内容:" prop="noticeContent">
<el-col :span="20">
<el-input size="small" v-model="formData.noticeContent" placeholder="请输入公告内容" type="textarea"
:autosize="{ minRows: 5}" maxlength=150></el-input>
<span class="word-num">{{(formData.noticeContent).replace(/\s+/g,"").length}}/150</span>
</el-col>
</el-form-item>
<!-- <el-col v-show="formData.openFlag != 2" :span="20">
<el-form-item label="内容:" prop="noticeContent">
<el-input size="small" v-model="formData.noticeContent" placeholder="请输入公告内容" maxlength=150></el-input>
<span class="word-num">{{(formData.noticeContent).replace(/\s+/g,"").length}}/150</span>
</el-form-item>
</el-col> -->
</el-form>
</el-row>
</div>
<el-dialog
class="prot-dialog"
title=""
:visible.sync="isShowDialog"
width="30%"
center
:close-on-click-modal=false
:close-on-press-escape=false
:show-close=false>
<p v-show="isCancleBtn" class="prot-dialog-tips-1">确定取消吗?取消后将不保存本次操作内容</p>
<p v-show="!isCancleBtn" class="prot-dialog-tips-1">点击发布后将立即生效,是否继续发布?</p>
<!-- <p class="prot-dialog-tips-2">若您选择暂不发送,您只能录入量表的非敏感信息</p> -->
<!-- <p class="prot-dialog-tips-3">为避免打扰居民,7天内只能发送1次,您已发送过短信,请尽快联系居民同意授权</p> -->
<span v-show="isCancleBtn" slot="footer" class="dialog-footer">
<el-button size="small" @click="cancleConfirm"> 确定取消 </el-button>
<el-button size="small" type="primary" @click="isShowDialog = false"> 继续操作 </el-button>
</span>
<span v-show="!isCancleBtn" slot="footer" class="dialog-footer">
<el-button size="small" @click="openFlagCancle"> 取消 </el-button>
<el-button size="small" type="primary" @click="openFlagConfirm"> 确定 </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import BreadCrumb from "../../components/breadcrumb.vue";
import { openLoading, closeLoading } from "../../utils/utils";
import * as commonUtil from "../../utils/utils";
import * as operationData from "../../utils/operation";
let vm = null;
export default {
components: {
BreadCrumb
},
data() {
// let checkNoticeTitleStr = (rule, value, callback) => {
// if(value.indexOf("\\") != -1) {//存在
// callback(new Error('请勿输入字符“ \\ ”'));
// } else if (value.indexOf(".") != -1) {
// callback(new Error('请勿输入字符“ . ”'));
// } else {
// callback();
// }
// };
return {
curmbFirst: "教培项目",
curmbSecond: "公告管理",
projectId: "",
formData: {
noticeContent: "",
noticeId: 0,
noticeTitle: "",
openFlag: 0,
projectId: 0
},
isShowDialog: false,
isCancleBtn: true,
rules: {
noticeTitle: [
{ required: true, message: "请输入公告标题", trigger: "blur" },
{
min: 2,
max: 20,
message: "输入长度为2-20的内容,可包含中英文、数字及特殊符号",
trigger: "blur"
},
// { validator: checkNoticeTitleStr, trigger: 'blur' }
],
noticeContent: [
{ required: true, message: "请输入公告内容", trigger: "blur" },
{
min: 2,
max: 150,
message: "输入长度为2-150的内容,可包含中英文、数字及特殊符号",
trigger: "blur"
},
],
}
};
},
created() {
vm = this;
vm.projectId = vm.getUrlSearch(window.location.href, "projectId");
vm.formData.projectId = vm.projectId
vm.getNoticeInfo();
},
// 挂载到Dom完成时
mounted: function() {
commonUtil.resizeHeight();
},
methods: {
//获取公告信息
getNoticeInfo() {
let req = {
projectId: vm.projectId
};
openLoading(vm);
vm.GET("portal/noticeInfo/getNoticeInfo", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
vm.formData = res.data;
}
});
},
beforeConfirm() {
let flag = false;
vm.$refs['formData'].validate(valid => {
if (valid) {
flag = true;
} else {
flag = false;
}
});
if(!flag) return;
vm.isCancleBtn = false;
// if(vm.formData.noticeId) {
vm.isShowDialog = true;
// }
},
//提交公告信息
confirmEdit(needJump) {
openLoading(vm);
vm.formData.projectId = vm.projectId
vm.POST("portal/noticeInfo/insertOrUpdate", vm.formData).then(res => {
closeLoading(vm);
if (res.code == "000000") {
// if(needJump) {
vm.$router.push('/item-manager');
vm.$message.success('发布成功');
// }
}
});
},
// 点击取消按钮
cancleEdit() {
vm.isCancleBtn = true;
vm.isShowDialog = true;
},
// 切换开启状态
changeOpenFlag(value) {
if(vm.formData.noticeId && value == 1) {
vm.isCancleBtn = false;
vm.isShowDialog = true;
}
},
// 确认取消
cancleConfirm() {
vm.isShowDialog = false;
vm.$router.push('/item-manager');
},
// 确认开启的取消
openFlagCancle() {
vm.isShowDialog = false;
// vm.formData.openFlag = 2;
// vm.$forceUpdate();
},
// 确认开启
openFlagConfirm() {
vm.isShowDialog = false;
vm.confirmEdit();
}
}
};
</script>
<style lang="scss">
.notice-item-shield {
.component-content {
background: #fff;
padding: 20px 30px;
.header-title {
padding: 10px 12px;
font-size: 12px;
color: #449284;
border-bottom: 1px solid #efefef;
}
.complete {
float: right;
}
.text-black {
color: #d51f35;
}
}
.word-num {
font-size: 12px;
color: #999;
padding-top: 5px;
}
.el-input {
width: 80%;
}
.el-textarea {
width: 80%;
}
.el-form-item__error {
left: 13px;
}
}
</style>
\ No newline at end of file
此差异已折叠。
...@@ -188,9 +188,10 @@ ...@@ -188,9 +188,10 @@
type="primary" type="primary"
size="small" size="small"
>屏蔽</el-button> >屏蔽</el-button>
<!-- v-if="scope.row.level != 'L1'" -->
<el-button <el-button
v-if="idType == 1"
@click="addOrModifyNotice(scope.row, 0)" @click="addOrModifyNotice(scope.row, 0)"
v-if="scope.row.level != 'L3'"
type="primary" type="primary"
size="small" size="small"
>公告</el-button> >公告</el-button>
......
...@@ -5,10 +5,10 @@ ...@@ -5,10 +5,10 @@
<div class="add-content screenSet" > <div class="add-content screenSet" >
<el-tabs v-model="activeName" @tab-click="handleClick"> <el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="发送公告" name="first"> <el-tab-pane label="发送公告" name="first">
<SendNotice></SendNotice> <SendNotice :formData="noticeInfo.noticeInfo"></SendNotice>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="发送推送" name="second"> <el-tab-pane label="发送推送" name="second">
<PushNotice></PushNotice> <PushNotice :formData="noticeInfo.pushInfo"></PushNotice>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
...@@ -21,6 +21,7 @@ import SendNotice from "@/components/education/notice/sendNotice"; ...@@ -21,6 +21,7 @@ import SendNotice from "@/components/education/notice/sendNotice";
import PushNotice from "@/components/education/notice/pushNotice"; import PushNotice from "@/components/education/notice/pushNotice";
import { openLoading, closeLoading } from "@/utils/utils"; import { openLoading, closeLoading } from "@/utils/utils";
import * as commonUtil from "@/utils/utils"; import * as commonUtil from "@/utils/utils";
let vm = null;
export default { export default {
data() { data() {
return { return {
...@@ -29,6 +30,24 @@ export default { ...@@ -29,6 +30,24 @@ export default {
jumPathThird: 'template-manager', jumPathThird: 'template-manager',
curmbThird: '发送通知', curmbThird: '发送通知',
activeName: 'first', activeName: 'first',
noticeInfo: {
noticeInfo: {
noticeContent: "",
noticeId: 0,
noticeTitle: "",
openFlag: 0,
projectId: 0
},
pushInfo: {
channel: null,
customPushTime: null,
noticeContent: "",
noticeId: 0,
noticeTitle: "",
projectId: 0,
sendScopeType: null
}
}
} }
}, },
components: { components: {
...@@ -37,7 +56,11 @@ export default { ...@@ -37,7 +56,11 @@ export default {
PushNotice PushNotice
}, },
created() { created() {
this.projectId = this.$route.query.projectId; vm = this;
console.log('wwwwwwwww');
vm.projectId = vm.getUrlSearch(window.location.href, "projectId") || 1476;
// vm.formData.projectId = vm.projectId
vm.getNoticeInfo2();
}, },
mounted() { mounted() {
commonUtil.resizeHeight(); commonUtil.resizeHeight();
...@@ -45,7 +68,21 @@ export default { ...@@ -45,7 +68,21 @@ export default {
methods: { methods: {
handleClick(tab) { handleClick(tab) {
console.log(tab); console.log(tab);
} },
//获取推送信息
getNoticeInfo2() {
let req = {
projectId: vm.projectId
};
openLoading(vm);
vm.GET("portal/noticeInfo/getNoticeInfo", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
vm.noticeInfo = res.data;
}
});
},
}, },
} }
</script> </script>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册