1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- 'use strict';
- var app = angular.module('app', [
- 'angularUtils.directives.dirPagination'
- ]);
- app.controller("monitorUserInfoCtrl", ["$http", "$scope", "$timeout", function ($http, $scope, $timeout) {
- var self = this;
- self.webApiUrl2 = "";
- self.get_userid = $.cookie("GlWorkPlatform-userid");
- self.get_username = $.cookie("GlWorkPlatform-username"); //获取英文名
- self.get_chineseName = decodeURI($.cookie("GlWorkPlatform-chineseName")); //获取中文名
- self.get_AccessToken = localStorage.getItem("GlWorkPlatform-AccessToken");
- self.get_id = sp.getUrlName("id");
- self.backUrl = "lastReturnPageno=" + sp.getUrlName("lastReturnPageno");
- ///返回按钮事件
- self.btnGoBack = function () {
- window.location.href = "monitorUser.html?" + self.backUrl;
- }
- var postCfgJson = {
- headers: {
- 'Content-Type': 'application/json',
- 'Authorization': "Bearer " + self.get_AccessToken
- }
- };
- self.info = {
- ID: self.get_id,
- USERID: "",
- OPENID: "",
- USERREALNAME: "",
- GENDER: "",
- STREET: "",
- COMMUNITY: "",
- BLOCK: "",
- BUILDING: "",
- DOORNO: "",
- HOUSENO: ""
- };
- //////加载数据;只有编辑
- self.getEditInfo = function () {
- var data = {
- entity: "XG_REGISTRATION",
- id: self.get_id,
- idName: "",
- fields: ""
- };
- $http.post(apiurljs.backend + "Data/Get", data, postCfgJson)
- .success(function (res) {
- //console.log(JSON.stringify(res));
- if (sp.isval(res)) {
- self.info = res;
- }
- });
- };
- self.getEditInfo();
- self.btnSave = function () {
- if (spngvld.submit("#tableAddData")) {
- var updateData = {
- userid: self.info.USERID,
- openid: self.info.OPENID,
- community: self.info.COMMUNITY,
- block: self.info.BLOCK,
- building: self.info.BUILDING,
- doorno: self.info.DOORNO,
- houseno: self.info.HOUSENO
- }
- //$http.post(apiurljs.backend + "XinGuan/UpdateRegisterInfo", updateData, postCfgJson)
- //.success(function (res) {
- // //console.log(res);
- // if (res.success) {
- // sp.dialog(res.message);
- // $timeout(function () {
- // self.getEditInfo();
- // sp.dialoghide();
- // }, 500);
- // } else {
- // sp.dialog(res.message);
- // }
- //});
- };
- };
- }]);
|