Ejemplo n.º 1
0
	Model.prototype.deleteChatBtnClick = function(event) {
		var self = this;
		var popMenu = this.comp("popMenu");
		var type = popMenu._type;
		var id = popMenu._id;
		if (type === "user") {
			var peer = IM.getUserPeer(id);
			justep.Util.confirm("确定删除该联系人的对话?", function() {
				IM.deleteChat(peer);
				if (self.currentDialogID.peek() === id) {
					self.currentDialogID.set(null);
					justep.Shell.fireEvent('onCloseMessagePage');
				}
			});
		} else {
			var gPeer = IM.getGroupPeer(id);
			justep.Util.confirm("确定退出该群?", function() {
				IM.leaveGroup(gPeer.id).then(function() {
					IM.deleteChat(gPeer);
					if (self.currentDialogID.peek() === id) {
						self.currentDialogID.set(null);
						justep.Shell.fireEvent('onCloseMessagePage');
					}
				});
			});
		}

	};
Ejemplo n.º 2
0
	Model.prototype.currentRowClick = function(event) {
		var arr = this.comp('employeeGrid').getCheckeds();
		if (arr.length != 1) {
			justep.Util.hint("请先选中一行数据");
			return;
		}
		var row = this.comp('employeeData').getRowByID(arr[0]);
		justep.Util.hint("姓名:" + row.val("name") + "---" + "性别:" + row.val("sex") + "---" + "部门:" + row.val("dept") + "---" + "学历:" + row.val("enducation"));

	};
Ejemplo n.º 3
0
			IM.getOrgPersons(IM.getCurrentPersonID()).done(function(persons) {
				var rows = [];
				$.each(persons, function(i, v) {
					if (v.sFID.indexOf(sFID) === 0&&v.sPersonID!==IM.getCurrentPersonID()) {
						rows.push(IM.getPerson(v.sPersonID));
					}
				});
				self.personNum = rows.length;
				if (rows.length >= 0) {
					justep.Util.confirm("确定将此部门及其子部门下所有人创建为群组?", function() {
						self.createGroupState.set(false);
						var addPerson = function(uid) {
							self.userIds.push(uid);
							self.count++;
							if (self.count == self.personNum) {
								IM.createGroup(sName, null, self.userIds).then(function(peer) {
									justep.Shell.fireEvent("onGroupSendMessagePage", {
										id : peer.id,
										type : peer.type
									});
									self.createGroupState.set(true);
								}, function(e) {
									self.createGroupState = false;
									justep.Util.hint("创建失败!");
								});
							}
						};
						for (var i = 0; i < rows.length; i++) {
							IM.regPerson(rows[i]).done(addPerson.bind());
						}
					});
				}
			});
Ejemplo n.º 4
0
	Model.prototype.downLoadBtnClick = function(event) {
		var type = this.getContext().getRequestParameter("type");

		var apkPath = this.ip + require.toUrl("/app/dangchat.apk");
		var apkPlusPath = '';
		var indexUrl = this.ip + require.toUrl("$UI/chat/wex5/index.w?device=m");

		if (justep.Browser.isWeChat) {
			if (type == "open") {
				location.href = indexUrl;
			} else {
				$(this.getElementByXid("weixin-tip-img")).show();
			}
		} else {
			if (justep.Browser.isAndroid) {
				if (this.isBadAndroid()) {
					location.href = apkPlusPath;
				} else {
					location.href = apkPath;
				}
			} else if (justep.Browser.isIOS) {
				justep.Util.hint("苹果系统请到安装路径下app文件夹下找到dangchat.ipa文件,使用数据线下载到手机上", {
					"type" : "info",
					"delay" : 100000
				})
			} else {
				location.href = indexUrl;
			}
		}
	};
Ejemplo n.º 5
0
	Model.prototype.attachmentEditor_Extend_SetTemplate_TempNewFromTemplate = function(event){
	 
		// 获取用户选择的模板
		debugger;
		var dTemplate = this.comp("dAttachment_Extend_SetTemplate");
		var docsStr = dTemplate.getValue("fAttachment");
		var template = null;
		if (docsStr != "") {
			var docs = eval(docsStr);
			if (docs.length > 0) {
				template = docs[0];
			}
		}
		// 没有模板阻止新建
		if (template == null) {
			event.cancel = true;
			
			justep.Util.hint("没有可用的模板");
			return;
		}
	
		// 设定新建模板
		event.data[0] = {
				sDocId: template.docID,
				sDocName: template.docName,
				sDocPath: template.docPath,
				sFileId: template.fileID
		};
		event.data.length = 1;
	};
Ejemplo n.º 6
0
	Model.prototype.moveDownClick = function(event) {
		var arr = this.comp('employeeGrid').getCheckeds();
		if (arr.length != 1) {
			justep.Util.hint("请先选中一行数据");
			return;
		}

		var row = this.comp('employeeData').getRowByID(arr[0]);
		var index = row.index();
		this.comp('employeeData').deleteData(row);
		this.comp('employeeData').newData({
			index : index + 1,
			defaultValues : [ {
				"id" : row.val("id"),
				"name" : row.val("name"),
				"sex" : row.val("sex"),
				"dept" : row.val("dept"),
				"enducation" : row.val("enducation")

			} ]
		})
		this.comp('employeeGrid').refresh();
		this.comp('employeeGrid').setRowChecked(row.val("id"), true);

	};
Ejemplo n.º 7
0
	Model.prototype.sendsmsbuttonClick = function(event) {
		// 通过Baas获取数据
		// 验证手机号是否合法!
		var reg = /^[1][34578][0-9]{9}$/;
		var phoneNumber = this.comp("phonenumber").val();
		if (reg.test(phoneNumber)) {
			this.comp("sendsmsbutton").mytimer();
			justep.Baas.sendRequest({
				"url" : "/work/Dx",
				"action" : "DuanXinCheck",
				"params" : {
					"fPhoneNumber" : this.comp("phonenumber").val()
				},
				"success" : function(resultData) {
					if (resultData.backStr) {
						numbers = resultData.backStr;
					} else {
						justep.Util.hint('验证码发送失败', {
							'type' : 'danger'
						});
					}
				}
			});
		} else {
			justep.Util.hint('手机号码格式不正确!', {
				'type' : 'danger'
			});
		}

	};
Ejemplo n.º 8
0
	Model.prototype.button_getClick = function(event){//接单
		if(!localStorage.getItem("userID")){
			justep.Util.hint("请先登录");
		}
		else{
			var me = this;
			var date_current=new Date();
			var date1 = justep.Date.toString(date_current,justep.Date.STANDART_FORMAT_SHOT);
			this.comp('ag_baasData').newData({
					defaultValues:[{
						"GID":QID,			//必须和Q相同主键
						"GDescription":detail,
						"GPrice":price,
						"GOwner":owner,
						"GAddress":address,
						"GAddressAim":addressaim,
						"GContact":contact,
						"GAddTime":time,
						"GType":type,
						"GGetterNumber":localStorage.getItem("userID"),
						"GGetterName":localStorage.getItem("userName"),
						"GGetTime":date1
					}]
			});
			this.comp('ag_baasData').saveData({
				onSuccess:function(){
					justep.Util.hint("接单成功请在“我的接单”查看");
					me.comp('windowReceiver_index').windowEnsure("接单成功");//关闭窗口,传"接单成功",跳转到首页
				}
			});
		}
	};
Ejemplo n.º 9
0
		$.each(docs, function(k, v) {
			if (v.docName == docName) {
				justep.Util.hint("已存在同名文件“" + docName + "”");
			// 当发现已存在同名文档,阻止上传
				event.cancel = true;
				return;
			}
		}); 
Ejemplo n.º 10
0
    Model.prototype.saveClick = function(event){
    	localStorage.setItem("ajaxServerIP",this.fIP);
    	localStorage.setItem("wbServerIP",'http://'+this.fIP+':'+this.duankou);
    	localStorage.setItem("duankou",this.duankou);
    	justep.Util.hint("保存成功", {
					"type" : "success"
				}, 'json');
    };
Ejemplo n.º 11
0
	Model.prototype.closeBtnClickClick = function(event){
		var tel = this.getElementByXid("tel").value;
		var address = this.getElementByXid("address").value;
		var reg = /^[1][3,4,5,7,8,]\d{9}$/;
		if(!reg.test(tel)){
			justep.Util.hint("请输入正确的电话号码");
			return false;
		}else if(!address){
			justep.Util.hint("地址不能为空;");
			return false;
		}else{
			justep.Util.hint("提交成功。。。请等待审核:");
			this.comp("windowReceiver").windowCancel();
		}
		

	};
Ejemplo n.º 12
0
	Model.prototype.saveBtnClick = function(event){
		var mainData = this.comp("mainData");
		var weekData = this.comp("weekData");
		var mapData = this.comp("addrData");
		var index =null; //被选中的单选框的下标
		var groupName = this.comp("fAttendanceGroupNameInput").val();
		var range = this.comp("fEffectiveRange").val();
		
		$("input[name=banzhi]").each(function(i,obj){
			if(obj.checked){
				index = i+1;
			}
		});
		
		if(this.rows.length>0 && this.SpersonID.length>0 && this.JpersonID.length>0 && groupName && range){
			//保存考勤星期表数据
			weekData.setValue("fAttendanceAdminID",mainData.getValue("fID"));
			
			//保存考勤主表数据
			index && mainData.setValue("fAttendanceClass", index);
			mainData.setValue("fAttendanceTeamManager",this.SpersonName.join(","));
			mainData.setValue("fAttendanceTeamManagerID", this.SpersonID.join(","));
			mainData.setValue("fAttendancePersonName", this.JpersonName.join(","));
			mainData.setValue("fAttendancePersonID", this.JpersonID.join(","));
			con.savePerson(mainData);
			con.saveDept(mainData);
			con.saveOgn(mainData);
			
			//保存考勤地址信息
			for (var i = 0; i < this.rows.length; i++) {
				mapData.setValueByID("fAttendanceAdminID", mainData.getValue("fID"), this.rows[i].val("fID"));
			}
			mainData.saveData();
			weekData.saveData();
			mapData.saveData();
			this.owner.close();
		}else{
			this.rows.length>0  ||  justep.Util.hint("请添加考勤地址!");
			this.SpersonID.length>0  ||  justep.Util.hint("请添加考勤组负责人!");
			this.JpersonID.length>0  ||  justep.Util.hint("请添加参与考勤人员!");
			groupName  ||  justep.Util.hint("请填写考勤组名称!");
			range  ||  justep.Util.hint("请设置考勤范围!");
		}
		
		
	};
Ejemplo n.º 13
0
	Model.prototype.mapBtnClick = function(event){
		this.signAddr = this.comp("statusData").getValue("address");
		if(this.signAddr){
			this.comp("mapDialog").open();
		}else{
			justep.Util.hint("获取地理位置失败!请尝试设置应用权限");
		}
	};
Ejemplo n.º 14
0
	Model.prototype.deleteGroupChatBtnClick = function(event) {
		var popMenu = this.comp("popMenu");
		var id = popMenu._id;
		var gPeer = IM.getGroupPeer(id);
		justep.Util.confirm("确定删除该组的对话?", function() {
			IM.deleteChat(gPeer);
		});
	};
Ejemplo n.º 15
0
	Model.prototype.createCompose = function(src) {
		this.dbFrame = document.createElement('iframe');
		this.dbFrame.style.cssText = "border:0;width:100%;height:100%";
		this.dbFrame.src = src;
		this.dbContainer.appendChild(this.dbFrame);
		this._recalcHeight();
		var self = this;
		$(window).resize(justep.Util.bindModelFn(self, self._recalcHeight));
	}
Ejemplo n.º 16
0
	Model.prototype.submitClick = function(event){
			var data = this.comp("userData");
			//获取到当前行
			var row = data.getCurrentRow();
			//刷新
			data.refreshData();
			data.add().assign(row); 
			justep.Util.hint("提交成功");
	};
Ejemplo n.º 17
0
		_doChange : function(event) {
			var value = event.item;
			if(value){
				event.source._value.set(value);
				this.updatePickerValue();
				var self = this;
				setTimeout(justep.Util.bindModelFn(self.getModel(),function(){self._updatePickerValueByMaxAndMin();}), 1);
			}
		},
Ejemplo n.º 18
0
	Model.prototype.leaveGroupBtnClick = function(event) {
		var id = this.comp("groupMenu")._id;
		var peer = IM.getGroupPeer(id);
		justep.Util.confirm("删除并退出该群?", function() {
			IM.leaveGroup(peer.id).then(function() {
				IM.deleteChat(peer);
			});
		});
	};
Ejemplo n.º 19
0
	Model.prototype.submitMousedown = function(event){
		if(!this.getElementByXid('commentInput').value){
			justep.Util.hint("不能为空");
		}
		else{
			this.comp('comments_baasData').saveData();
			this.comp('comments_baasData').refreshData();
		}
	};
Ejemplo n.º 20
0
	Model.prototype.joinCartBtnClick = function(event){
		if(!localStorage.getItem("userID")){
			justep.Util.hint("请先登录");
		}
		else{
			this.comp('comments_baasData').newData();
			this.comp('popOver_comments').show();
		}
	};
Ejemplo n.º 21
0
	Model.prototype.okBtnClick = function(event){
		var name = this.comp('nameInput').val();
		var type = this.comp('typeSelect').val();
		var me =  this;
		if(me.arr.indexOf(name) >= 0){
			justep.Util.hint("关系名称重复!");
			return;
		}
		if(!name){
			justep.Util.hint("名称不能为空!");
			return;
		}
		if(!type){
			justep.Util.hint("类型不能为空!");
			return;
		}
		this.comp('windowReceiver').windowEnsure({name:name,type:type});
	};
Ejemplo n.º 22
0
				"success" : function(resultData) {
					if (resultData.backStr) {
						numbers = resultData.backStr;
					} else {
						justep.Util.hint('验证码发送失败', {
							'type' : 'danger'
						});
					}
				}
Ejemplo n.º 23
0
			uploader.on('onFileSelected',function(event){
				var file = data.getValue("fFileNum"); 
				if(file){
				if($.parseJSON(file).length>=2){
					justep.Util.hint("只能上传2个文件");
					event.cancel = true;
				}
				}
				
		});
Ejemplo n.º 24
0
	Model.prototype.sendMessageBtnClick = function(event) {
		var sFID = this.params.sFID;
		var sName = this.params.sName;
		var self = this;
		if(this.createGroupState.get()){
			this.createGroupState.set(false);
			justep.Util.confirm("确定将此部门及其子部门下所有人创建为群组?", function() {
				IM.createDeptDlg(sFID, sName).done(function(peer) {
					justep.Shell.fireEvent("onGroupSendMessagePage", {
						id : peer.id,
						type : peer.type
					});
					self.createGroupState.set(true);
				});
			});
		}else{
			justep.Util.hint("正在创建群组请稍后");
		}
	};
Ejemplo n.º 25
0
	Model.prototype.datePickerOK = function(event) {
		var date = justep.Date.toString(event.source.getValue(), "yyyy年MM月dd日");
		if (date < justep.Date.toString(new Date(), "yyyy年MM月dd日")) {
			justep.Util.hint("日期选择不符合规范", {
				"type" : "danger"
			});
			return;
		}
		this.comp("mainData").setValue("sLimitTime", event.source.getValue());
	};
Ejemplo n.º 26
0
	Model.prototype.dataTablesRowClick = function(event){
		var domButton = $(event.domEvent.target);// 获取点击的元素
		if (domButton.hasClass("btnUpdate")) {// 判断是否包含某个样式
			justep.Util.hint("角色修改");
		} else if (domButton.hasClass("btnUser")) {
			this.comp("relevance_users").show();
		} else if (domButton.hasClass("btnResource")) {
			this.comp("resource").show();
		}
	};
Ejemplo n.º 27
0
	Model.prototype.sendMessageBtnClick = function(event) {
		var self = this;
		var sFID = this.params.sFID;
		var sName = this.params.sName;
		if(this.createGroupState.get()){
			justep.Util.confirm("确定将此部门及其子部门下所有人创建为群组?", function() {
				self.createGroupState.set(false);
				IM.createDeptDlg(sFID, sName).done(function(peer) {
					justep.Shell.fireEvent("onSendMessagePage", {
						id : peer.id,
						type : peer.type
					});
					//self.getElementByXid('sendMessageBtn').disabled = false;
				});
			});
		}else{
			justep.Util.hint("正在创建群组请稍后...");
		}
	};
Ejemplo n.º 28
0
	Model.prototype.okBtnClick = function(event) {
		if (this.wifiArr.length > 0) {
			this.owner.send({
				data : this.wifiArr
			});
			this.owner.close();
		}else{
			justep.Util.hint("请选择办公wifi!");
		}
	};
Ejemplo n.º 29
0
	Model.prototype.leaveGroupBtnClick = function(event) {
		var id  = this.params.id;
		var type = this.params.type;
		var peer = IM.getPeer(id,type);
		justep.Util.confirm("删除并退出该群?", function() {
			IM.leaveGroup(peer.id).then(function() {
				IM.deleteChat(peer);
				justep.Shell.showMainPage();
			});
		});
	};
Ejemplo n.º 30
0
		_updatePickerValue : function(name){
			var comp = this['_'+name+'Comp'];
			if (comp) {
				var self = this;
				if(this['_set'+name+'PickerValueHandle']) clearTimeout(this['_set'+name+'PickerValueHandle']);
				this['_set'+name+'PickerValueHandle'] = setTimeout(justep.Util.bindModelFn(self.getModel(),function() {
					self['_set'+name+'PickerValueHandle'] = null;
					self._setPickerValue(name, self['_'+name+'Value'].peek());
				}), 1);
			}
		},