|
@@ -1,5 +1,6 @@
|
|
|
//招标公告
|
|
|
var Tender = {
|
|
|
+ status:false,
|
|
|
keyWordDialog: null,
|
|
|
getKeyWordDialog: function(clickLi){
|
|
|
if(this.keyWordDialog == null){
|
|
@@ -17,6 +18,7 @@ var Tender = {
|
|
|
};
|
|
|
//中标公告
|
|
|
var Bid = {
|
|
|
+ status:false,
|
|
|
keyWordDialog: null,
|
|
|
getKeyWordDialog: function(clickLi){
|
|
|
if(this.keyWordDialog == null){
|
|
@@ -55,7 +57,7 @@ function KeyWordDialog(type,clickLi){
|
|
|
KeyWordDialog.AppendNode(dialogObj);
|
|
|
});
|
|
|
dialogObj.find(".submit").click(function(){
|
|
|
- commonAjaxReq(thisClass);
|
|
|
+ commonAjaxReq(thisClass,type);
|
|
|
});
|
|
|
if(dialogObj.find(".keyWordGroup").length == 0){
|
|
|
KeyWordDialog.AppendNode(dialogObj);
|
|
@@ -71,15 +73,17 @@ KeyWordDialog.AppendNode = function(dialogObj,value){
|
|
|
return '<div class="keyWordGroup">'
|
|
|
+'<lable>关键词<font>'+index+'</font></lable>'
|
|
|
+'<div><input type="text" value="'+(value?value:"")+'" placeholder="示例:综合布线 电话线 网线" maxlength="100"></div>'
|
|
|
- +'<div><img src="/wxswordfish/images/delete.png" class="delete"></div>'
|
|
|
+ +'<div>'+(index==1?'':'<img src="/wxswordfish/images/delete.png" class="delete">')+'</div>'
|
|
|
+'</div>';
|
|
|
}
|
|
|
var count = dialogObj.find(".keyWordGroup").length;
|
|
|
- if(count >= 5){
|
|
|
+ if(count >= 10){
|
|
|
return;
|
|
|
}
|
|
|
var obj = $(getHtml(count+1,value));
|
|
|
dialogObj.find(".addKeyWordArea").before(obj);
|
|
|
+ //自动滚动到底部
|
|
|
+ $("#a_end")[0].scrollIntoView();
|
|
|
obj.find(".delete").click(function(){
|
|
|
dialogObj.find(".addKeyWord").removeAttr("disabled");
|
|
|
$(this).parents(".keyWordGroup").remove();
|
|
@@ -90,7 +94,7 @@ KeyWordDialog.AppendNode = function(dialogObj,value){
|
|
|
if(typeof(value) == "undefined" || value == ""){
|
|
|
obj.find("[type='text']").focus();
|
|
|
}
|
|
|
- if(count == 4){
|
|
|
+ if(count >= 9){
|
|
|
dialogObj.find(".addKeyWord").attr("disabled",true);
|
|
|
}
|
|
|
}
|
|
@@ -121,14 +125,24 @@ function ScopeDialog(type,clickLi){
|
|
|
}
|
|
|
});
|
|
|
dialogObj.find(".submit").click(function(){
|
|
|
- commonAjaxReq(thisClass);
|
|
|
+ commonAjaxReq(thisClass,type);
|
|
|
});
|
|
|
}
|
|
|
-function commonAjaxReq(object){
|
|
|
+function commonAjaxReq(object,module){
|
|
|
+ if($("#"+module+"-on-off").hasClass("open")){
|
|
|
+ //开服务要校验
|
|
|
+ if(module=="tender"){
|
|
|
+ if(!Tender.status){
|
|
|
+ //提示扣积分
|
|
|
+ $(".creditTip-dialog").show()
|
|
|
+ $("html,body").addClass("overflow-hidden")
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //是关的不用处理
|
|
|
var dataObj = {
|
|
|
- reqType: "other",
|
|
|
- tender_flag: $("#tender-on-off").hasClass("open"),
|
|
|
- bid_flag: $("#bid-on-off").hasClass("open")
|
|
|
+ reqType: "other"
|
|
|
};
|
|
|
var keysString = "",scopeString = "";
|
|
|
var thisClass = this;
|
|
@@ -191,22 +205,12 @@ function commonAjaxReq(object){
|
|
|
});
|
|
|
return tender_scope.join(",");
|
|
|
}
|
|
|
- /*******************招标公告****************/
|
|
|
- if(dataObj.tender_flag){
|
|
|
- dataObj["tender_keys"] = this.setKeyWord("tender");
|
|
|
- dataObj["tender_scope"] = this.setScope("tender");
|
|
|
- if(dataObj.tender_keys.length > 0 && dataObj.tender_scope == ""){
|
|
|
- dataObj["tender_scope"] = "A";
|
|
|
- }
|
|
|
- }
|
|
|
- /*******************中标公告****************/
|
|
|
- if(dataObj.bid_flag){
|
|
|
- dataObj["bid_keys"] = this.setKeyWord("bid");
|
|
|
- dataObj["bid_scope"] = this.setScope("bid");
|
|
|
- if(dataObj.bid_keys.length > 0 && dataObj.bid_scope == ""){
|
|
|
- dataObj["bid_scope"] = "A";
|
|
|
- }
|
|
|
+ dataObj[module+"_keys"] = this.setKeyWord(module);
|
|
|
+ dataObj[module+"_scope"] = this.setScope(module);
|
|
|
+ if(dataObj[module+"_keys"].length > 0 && dataObj[module+"_scope"] == ""){
|
|
|
+ dataObj[module+"_scope"] = "A";
|
|
|
}
|
|
|
+ dataObj[module+"_status"] = $("#"+module+"-on-off").hasClass("open")?1:0
|
|
|
/*****************************************/
|
|
|
$.ajax({
|
|
|
type: "POST",
|
|
@@ -271,12 +275,18 @@ $(function(){
|
|
|
if(typeof(msgset.tender) != "undefined"){
|
|
|
setKeyWord("tender",msgset.tender.a_key);
|
|
|
setScope("tender",msgset.tender.s_scope);
|
|
|
- turnOn($("#tender-on-off"));
|
|
|
+ if(msgset.tender.i_status){
|
|
|
+ turnOn($("#tender-on-off"));
|
|
|
+ Tender.status=true
|
|
|
+ }
|
|
|
}
|
|
|
if(typeof(msgset.bid) != "undefined"){
|
|
|
setKeyWord("bid",msgset.bid.a_key);
|
|
|
setScope("bid",msgset.bid.s_scope);
|
|
|
- turnOn($("#bid-on-off"));
|
|
|
+ if(msgset.bid.i_status){
|
|
|
+ turnOn($("#bid-on-off"));
|
|
|
+ Bid.status=true
|
|
|
+ }
|
|
|
}
|
|
|
//开关
|
|
|
$(".on-off").click(function(){
|
|
@@ -291,7 +301,18 @@ $(function(){
|
|
|
}else{
|
|
|
turnOn($(this));
|
|
|
}
|
|
|
- commonAjaxReq(null);
|
|
|
+ //判断是不是开,是开再判断是不是在有效期内,如果不在有效期内,则进行提示并存快照
|
|
|
+
|
|
|
+ commonAjaxReq(null,$(this).attr("v"));
|
|
|
+ });
|
|
|
+ //收费规则
|
|
|
+ $(".rule").closest(".parent-node").click(function(){
|
|
|
+ $(".credit-dialog").show();
|
|
|
+ $("html,body").addClass("overflow-hidden");
|
|
|
+ })
|
|
|
+ $("#credit-dialog-back").click(function(){
|
|
|
+ $(".credit-dialog").hide();
|
|
|
+ $("html,body").removeClass("overflow-hidden");
|
|
|
});
|
|
|
//
|
|
|
$("#tender-content>li").click(function(){
|