123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352 |
- angular.module('push')
- .controller('recordInfoAccountCtrl', function ($scope,ActivityService,$stateParams,$timeout, $rootScope, $ionicSlideBoxDelegate,$ionicScrollDelegate,
- UtilService, UserService, ConfigService, ModelService, $ionicListDelegate, DockingService,
- TechnicalBrokerPublishTrainService, roleService) {
- //TODO
- if($scope.app){
- $scope.setStatusBar(1);
- }
- // $scope.userid = 653;
- $scope.userid = UserService.id;
- $scope.orgid = 0;//再次录入需要
- // $scope.userid = 1;
- // 搜索关键词
- $scope.keyword = "";
- // 我的数据库分页索引值,默认第一页:1
- $scope.pagenum = 1;
- // 我的当前页,分页加载用
- $scope.isload = false;
- // 我的录入记录总数
- $scope.totalCount = 0;
- // 所有云录入,默认文件夹0
- $scope.claid = 0;
- // 我的录入记录列表
- $scope.recordList = [];
- // 所有数据库分页索引值,默认第一页:1
- $scope.pagenumall = 1;
- // 所有当前页,分页加载用
- $scope.isloadall = false;
- // 初始化文件夹列表
- $scope.folderlist = [];
- // 云录入记录列表
- $scope.allVisitTaskRecordList = [];
- // 我的录入记录总数
- $scope.allTotalCount = 0;
- // 获取模版列表的传参
- $scope.roleModel=
- {
- //TODO
- funid: 2,//所属功能:1走访、2录入等
- roleidList: []// 角色数组
- };
- /*参数设置*/
- /*========================================================================================================================*/
- /*逻辑操作*/
- //根据角色获取所有模版
- $scope.rolePageList = [];
- $scope.roleModel.roleidList.push(0);// 角色默认一笔0,否则后台 in查询会报错
- var getRolePageList = function () {
- if (UtilService.isDefined(UserService.role)) {
- angular.forEach(UserService.role, function (value, index) {
- $scope.roleModel.roleidList.push(value.roleid);
- });
- }
- $scope.roleModel.node=UserService.node;
- roleService.getRolePageList($scope.roleModel).then(function (response) {
- // console.log("==============================");
- // console.log(response);
- // 模版列表
- $scope.rolePageList = response.data;
- angular.forEach($scope.rolePageList,function(val){
- val.logo=val.pagename=='基本信息'?'iconfont-basic-info'
- :val.pagename=='需求信息'?'iconfont-demand'
- :val.pagename=='成果信息'?'iconfont-achievement'
- :val.pagename=='产品信息'?'iconfont-product'
- :val.pagename=='专利信息'?'iconfont-patents'
- :val.pagename=='人才信息'?'iconfont-talents'
- :val.pagename=='月报表'?'iconfont-report-form'
- :val.pagename=='项目转化'?'iconfont-transform'
- :val.pagename=='对接录入'?'iconfont-butt-joint'
- :'ion-compose';
- })
- }, function () {
- })
- };
- getRolePageList();
- // 获取我的录入列表
- var getMyInterviewList = function () {
- $scope.showLoadingToast();
- TechnicalBrokerPublishTrainService.getMyInterviewList($scope.keyword, $scope.userid, $scope.pagenum, 2,UserService.node).then(function (response) {
- console.log(response);
- $scope.recordList = response.data;
- // page分页信息
- var temppage = angular.fromJson(response.page);
- // 记录总数
- $scope.totalCount = temppage.totalCount;
- var totalPage = Math.ceil(temppage.totalCount / temppage.pageSize);
- var trHtml = "<div class='refresh_tip_div'>更新了" + $scope.recordList.length + "条内容</div>";
- $timeout(function () {
- $(".resourcelistDiv .list").prepend(trHtml);
- $(".refresh_tip_div").animate({width: 100 + "%"}, 150);
- }, 800);
- $timeout(function () {
- $(".refresh_tip_div").slideUp();
- }, 1200);
- //判断是否有下一页
- $timeout(function () {
- $timeout(function () {
- if (temppage.currentPage >= totalPage) {
- $scope.isload = false;
- } else {
- $scope.isload = true;
- }
- $scope.pagenum = 2;
- }, 1000);
- $scope.hideLoadingToast();
- $ionicSlideBoxDelegate.update();
- $ionicScrollDelegate.$getByHandle("privateContent").scrollTo(0, 0);
- }, 50);
- }, function () {
- $scope.hideLoadingToast();
- }).finally(function () {
- $scope.$broadcast('scroll.refreshComplete');
- });
- };
- getMyInterviewList();
- // 加载更多我的录入列表
- $scope.loadMore = function () {
- $scope.showLoadingToast();
- $scope.isload = false;
- $scope.loadmore = true;
- TechnicalBrokerPublishTrainService.getMyInterviewList($scope.keyword, $scope.userid, $scope.pagenum, 2,UserService.node).then(function (response) {
- // console.log(response);
- var tempreslib = angular.fromJson(response.data);
- // page分页信息
- var temppage = angular.fromJson(response.page);
- var totalPage = Math.ceil(temppage.totalCount / temppage.pageSize);
- //加载数据,更新当前页数
- $timeout(function () {
- if ($scope.recordList.length > 0) {
- $scope.recordList = $scope.recordList.concat(tempreslib);
- }
- $scope.loadmore = false;
- }, 1000);
- //判断是否有下一页
- $timeout(function () {
- if (temppage.currentPage >= totalPage) {
- $scope.isload = false;
- } else {
- $scope.isload = true;
- }
- $scope.pagenum++;
- $scope.hideLoadingToast();
- }, 1000);
- }, function () {
- $scope.hideLoadingToast();
- $scope.loadmore = false;
- }).finally(function () {
- $scope.$broadcast('scroll.infiniteScrollComplete');
- });
- };
- $scope.goDetail = function (pagecode,connid,node,templettype,orgid,name,orgtype,resource) {
- // $scope.go('resourceCommonInfoDetailsPage',{orgtype:orgtype,pagecode:pagecode,pagename:pagename,id:id,isedit:isedit,connid:connid,node:node})
- console.log(node);
- if(templettype==10){
- $scope.go('reportDetail',{pageTitle:name,pageid:templettype,orgid:orgid,isedit:true})
- // }else if(templettype==4){
- // $scope.go('taskDetail',{
- // // resid:,
- // node:node,
- // title:name,
- // restype:1,
- // comefrom:'myTask',
- // // actions:
- // });
- }else{
- $scope.go('resourceCommonInfoDetailsPage', {
- resid: connid,
- isAllVisitor: 0,
- pagecode: pagecode,
- node: node,
- comfrom: 'typein',//录入信息
- orgtype:orgtype,
- templettype:templettype,
- label:JSON.stringify(resource.otherObj),
- });
- }
- };
- //弹出各类按钮
- $scope.showAnthorBtnWrap=false;
- $scope.goEnterCompanyInfo=function () {
- $scope.showAnthorBtnWrap=true;
- };
- //隐藏各类按钮
- $scope.hideAnthorBtnWrap=function () {
- $scope.showAnthorBtnWrap=false;
- };
- var hideAnthorBtnf=function () {
- $scope.showAnthorBtnWrap=false;
- $("ion-nav-view[name='tab-activityIndex']").css("z-index","1");
- };
- // $scope.jumpQuick=function (ind) {
- // switch (ind){
- // case 3:
- // $scope.go("unitOrPersonalBaseInfo", {pageid: ind, isedit: 0});
- // break;
- // case 4:
- // $scope.go("recordDemandInfo", {pageid: ind, isedit: 0});
- // break;
- // case 5:
- // $scope.go("recordAchievementsInfo", {pageid: ind, isedit: 0});
- // break;
- // case 6:
- // $scope.go("recordProductInfo", {pageid: ind, isedit: 0});
- // break;
- // case 7:
- // $scope.go("recordPatentInfo", {pageid: ind, isedit: 0});
- // break;
- // case 8:
- // $scope.go("recordTalentInfo", {pageid: ind, isedit: 0});
- // break;
- // default: return;
- // }
- // hideAnthorBtnf();
- // };
- $scope.jumpQuick=function (orgtype,pagecode,pagename,id,isedit) {
- // console.log(1);
- // $scope.go('typeinAllModal', {companyid: 0, pageid: id, orgtype: orgtype,pagecode:pagecode, isedit: isedit,node:UserService.node});
- if(id==10){
- $scope.go('reportEditModal',{pageTitle:'报表录入',pageid:id})
- }else if(id==16){
- $scope.go('dockingInput',{comfrom: "dockingInput",companyName: "",companyid: 0,taskId: "",taskTitle: ""})
- }else{
- if (UserService.node == '330122000' && id == 4) {
- $scope.go('visitModularFormDemand', {
- companyid: 0,
- pageid: id,
- orgtype: orgtype,
- pagecode: pagecode,
- isedit: isedit,
- node: UserService.node,
- pageTitle: '新建录入'
- });
- } else {
- $scope.go('visitModularForm', {
- companyid: 0,
- pageid: id,
- orgtype: orgtype,
- pagecode: pagecode,
- isedit: isedit,
- node: UserService.node,
- pageTitle: '新建录入'
- });
- }
- }
- hideAnthorBtnf();
- };
- //共享文件夹
- //展开按钮
- $scope.showAction = function () {
- $scope.showMoreAction = !$scope.showMoreAction;
- };
- //关闭按钮
- $scope.actionButton_three = function () {
- $scope.showMoreAction = !$scope.showMoreAction;
- };
- //进入设置资源库页面
- $scope.goAutoritySet = function (reclib) {
- $timeout(function () {
- $ionicListDelegate.closeOptionButtons();
- }, 10);
- if (UtilService.isDefined(reclib.localid)) {
- $scope.go("authorityLocalSet", {authoritydata: angular.toJson(reclib), type: 0, goflg: 0});
- } else {
- $scope.go("authoritySet", {
- reclibid: reclib.id,
- authorityid: reclib.authorityid,
- authoritycomefrom: reclib.authoritycomefrom,
- name: reclib.name,
- content: reclib.content,
- sort: reclib.sort,
- type: 0,
- parentid: reclib.parentid
- });
- }
- };
- //新建记录
- $scope.addRecord = function () {
- if ($scope.folderlist.length < 1) {
- UtilService.showMess("您还没有文件夹,去新建文件夹吧");
- return;
- }
- ModelService.setCreateType(0);
- ModelService.setCheckdeFolder($scope.folderlist[0]);
- $scope.go('cloudAddConnInfo');
- };
- //新建文件夹
- $scope.buildNewFolder = function () {
- $scope.go("authorityCreate", {templettype: 2});
- };
- //进入分类详情,记录列表
- $scope.queryFolder = function (folder) {
- $scope.go('cloudFolderDetail', {folder: angular.toJson(folder)});
- };
- //再次录入
- $scope.repeatVisit = function (companyid, pageid, orgtype) {
- $scope.orgid = companyid;
- //弹出新建录入按钮
- $scope.goEnterCompanyInfo();
- };
- // 各模版快捷入口页面跳转
- $scope.jumpPage = function (companyid, pageid, orgtype) {
- $scope.go('visitModularForm', {companyid: companyid, pageid: pageid, orgtype: orgtype, isedit: 0, pageTitle:'新建走访'});
- };
- //虚拟搜索框
- $scope.isShowSearchButton = true;
- $scope.keyfilter = {key: ""};//搜索关键词
- $scope.showSearchButtonLeft = function () {
- $scope.isShowSearchButton = false;
- $(".showSearchInput").focus();
- };
- //清空搜索内容
- $scope.clearSearch = function () {
- $scope.isShowSearchButton = true;
- $scope.keyfilter.key = "";
- };
- //TODO 放开注释
- if($scope.app){
- if (device.platform != "Android") {
- $scope.isIos=true;
- }else{
- $scope.isIos=false;
- }
- }
- $scope.defaultLan = UserService.defaultLan;
- $scope.gobackFromBack=function(){
- $scope.goback();
- }
- });
|