|
@@ -186,6 +186,45 @@ $(function() {
|
|
|
</div>\
|
|
|
</div>\
|
|
|
</div>',
|
|
|
+ remindTpl: '<div class="dialog-wp">\
|
|
|
+ <div class="mask"></div>\
|
|
|
+ <div class="dialog export-or-download-con" style="width: 340px;">\
|
|
|
+ <div class="title-wp">\
|
|
|
+ <span>订餐提醒</span>\
|
|
|
+ <span class="close-btn"></button>\
|
|
|
+ </div>\
|
|
|
+ <%if(!orgid){%>\
|
|
|
+ <div class="export-or-download-wp">\
|
|
|
+ <div class="choose-item-wp">\
|
|
|
+ <span class="tip" style="margin-left: 33px;">项 目:</span>\
|
|
|
+ <input class="default-select w-orgid" id="orgId" org__id="" autocomplete="off"/>\
|
|
|
+ <span class="select_wrap _hide" style="width: 200px"></span>\
|
|
|
+ </div>\
|
|
|
+ </div>\
|
|
|
+ <%}%>\
|
|
|
+ <%if(orgid){%>\
|
|
|
+ <input type="hidden" class="default-select w-orgid" id="orgId" org__id="<%=orgid%>" autocomplete="off"/>\
|
|
|
+ <%}%>\
|
|
|
+ <div class="export-or-download-wp">\
|
|
|
+ <div class="choose-item-wp" style="width: 100%;">\
|
|
|
+ <div style="padding: 0 38px;text-align: left;">\
|
|
|
+ <span class="tip">订餐提醒:</span>\
|
|
|
+ <div class="checkbox-wp">\
|
|
|
+ <span class="checkbox-input">\
|
|
|
+ <input type="checkbox" id="mealCheck" class="check-item"/>\
|
|
|
+ <span class="checkbox-inner"></span>\
|
|
|
+ </span> \
|
|
|
+ <label class="checkbox-con">开启</label>\
|
|
|
+ </div>\
|
|
|
+ </div>\
|
|
|
+ <div style="padding-left: 110px;color: #999999;font-size: 15px;text-align: left;">开启后会给订餐人员推送消息</div>\
|
|
|
+ </div>\
|
|
|
+ <div class="export-or-download-btns">\
|
|
|
+ <button class="sure-operate-btn btn-red-width90" type="button">确定</button> \
|
|
|
+ </div>\
|
|
|
+ </div>\
|
|
|
+ </div>\
|
|
|
+ </div>',
|
|
|
deptTpl: '<option value="">请选择部门</option>\
|
|
|
<%for(var i=0;i<data.length;i++){%>\
|
|
|
<option value="<%=data[i].id%>"><%=data[i].itemname%></option>\
|
|
@@ -241,25 +280,29 @@ $(function() {
|
|
|
// 订餐提醒
|
|
|
$(".warnOrder").on("click",function() {
|
|
|
var orgid = $("#conditionform .single-orgid").attr("org__id")
|
|
|
- $("body").append(template.render(tpl.warnTpl)({orgid:orgid}));
|
|
|
+ $("body").append(template.render(tpl.remindTpl)({orgid:orgid}));
|
|
|
if(orgid){
|
|
|
- _this.getOrgByMessage(orgid);
|
|
|
- }
|
|
|
+ // _this.getOrgByMessage(orgid);
|
|
|
+ _this.getPushSetByOrgIdHandler(orgid);
|
|
|
+ }
|
|
|
$(".close-btn").on("click", function() {
|
|
|
$(".dialog-wp").remove();
|
|
|
});
|
|
|
$(".sure-operate-btn").on("click", function() {
|
|
|
var orgId = $(".w-orgid").attr('org__id');
|
|
|
- var isSetMessage
|
|
|
+ var isStatus
|
|
|
if (!orgId) {
|
|
|
layer.msg("请选择项目");
|
|
|
return false;
|
|
|
};
|
|
|
- $("#warn").attr('checked')?isSetMessage = 1:isSetMessage = 0;
|
|
|
- $("#warnM").attr('checked')?isSetWechatMessage = 1:isSetWechatMessage = 0;
|
|
|
- _this.isSetMessage(isSetMessage,isSetWechatMessage,orgId, function() {
|
|
|
+ $("#mealCheck").attr('checked')?isStatus = 1:isStatus = 0;
|
|
|
+ _this.isSetStatusHandler(isStatus, orgId, function () {
|
|
|
$(".dialog-wp").remove();
|
|
|
})
|
|
|
+
|
|
|
+ // _this.isSetMessage(isSetMessage,isSetWechatMessage,orgId, function() {
|
|
|
+ // $(".dialog-wp").remove();
|
|
|
+ // })
|
|
|
})
|
|
|
})
|
|
|
// 模糊搜索
|
|
@@ -346,7 +389,8 @@ $(function() {
|
|
|
eve(option_3, { type: 1,
|
|
|
click_callback:function(){
|
|
|
var orgId = $('.w-orgid').attr('org__id')
|
|
|
- _this.getOrgByMessage(orgId);
|
|
|
+ // _this.getOrgByMessage(orgId);
|
|
|
+ _this.getPushSetByOrgIdHandler(orgId);
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -476,7 +520,7 @@ $(function() {
|
|
|
pageName: 'pageNo' //页码的参数名称,默认:page
|
|
|
,
|
|
|
limitName: 'pageSize' ,//每页数据量的参数名,默认:limit
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
done: function(res, curr, count) {
|
|
|
//如果是异步请求数据方式,res即为你接口返回的信息。
|
|
@@ -723,6 +767,34 @@ $(function() {
|
|
|
});
|
|
|
},
|
|
|
/**
|
|
|
+ * 设置订餐推送开关
|
|
|
+ * @param isStatus // 当前开关状态
|
|
|
+ * @param orgId // 项目开关
|
|
|
+ * @param callback 返回数据
|
|
|
+ */
|
|
|
+ isSetStatusHandler: function(isStatus, orgId, callback) {
|
|
|
+ var _this = this;
|
|
|
+ $.ajax({
|
|
|
+ type: "post",
|
|
|
+ url: contextPath + "/admin/dinner/place/saveAndPushSet",
|
|
|
+ data: {
|
|
|
+ orgId: orgId,
|
|
|
+ status: isStatus,
|
|
|
+ },
|
|
|
+ success: function(data) {
|
|
|
+ if (data.code == ERROK) {
|
|
|
+ layer.msg('设置成功')
|
|
|
+ callback()
|
|
|
+ } else {
|
|
|
+ layer.msg(data.msg)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error: function(error) {
|
|
|
+ layer.msg('error')
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /**
|
|
|
* 判断是否开启短信提醒功能
|
|
|
* @param orgId 项目id
|
|
|
*/
|
|
@@ -747,6 +819,30 @@ $(function() {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 判断是否开启订餐提醒功能
|
|
|
+ * @param orgId 项目id
|
|
|
+ */
|
|
|
+ getPushSetByOrgIdHandler: function (orgId) {
|
|
|
+ var _this = this;
|
|
|
+ $.ajax({
|
|
|
+ type: "post",
|
|
|
+ url: contextPath + "/admin/dinner/place/getPushSetByOrgId",
|
|
|
+ data: {
|
|
|
+ orgId: orgId
|
|
|
+ },
|
|
|
+ success: function(data) {
|
|
|
+ if (data.code == ERROK) {
|
|
|
+ data.data.status == 1?$("#mealCheck").attr('checked',"checked"):$("#mealCheck").attr('checked',false)
|
|
|
+ } else {
|
|
|
+ layer.msg(data.msg)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error: function(error) {
|
|
|
+ layer.msg('error')
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
};
|
|
|
api.init();
|
|
|
-})
|
|
|
+})
|