technicalBrokerEnterCompanyInfoCtrl.js 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798
  1. angular.module('push')
  2. .controller('technicalBrokerEnterCompanyInfoCtrl', function ($scope, $state, ActivityService, $ionicPopup, $stateParams, $timeout, $rootScope, $ionicSlideBoxDelegate, $ionicScrollDelegate,
  3. UtilService, UserService, ConfigService, ModelService, $ionicListDelegate, DockingService,
  4. TechnicalBrokerPublishTrainService, roleService) {
  5. $scope.defaultLan = UserService.defaultLan;
  6. $scope.user = UserService.user;
  7. var loadflg = false;
  8. //TODO
  9. if ($scope.app) {
  10. $scope.setStatusBar(1);
  11. }
  12. $scope.noData = false;
  13. $scope.userid = UserService.id;
  14. $scope.orgid = 0;//再次走访需要
  15. // $scope.userid = 1;
  16. // 搜索关键词
  17. // $scope.keyfilter.key = "";
  18. $scope.keyfilter = {
  19. key: ''
  20. }
  21. // 我的数据库分页索引值,默认第一页:1
  22. $scope.pagenum = 1;
  23. // 我的当前页,分页加载用
  24. $scope.isload = false;
  25. // 我的走访记录总数
  26. $scope.totalCount = 0;
  27. // 所有云走访,默认文件夹0
  28. $scope.claid = 0;
  29. // 我的走访记录列表
  30. $scope.visitTaskRecordList = [];
  31. // 所有数据库分页索引值,默认第一页:1
  32. $scope.pagenumall = 1;
  33. // 所有当前页,分页加载用
  34. $scope.isloadall = false;
  35. // 初始化文件夹列表
  36. $scope.folderlist = [];
  37. // 云走访记录列表
  38. $scope.allVisitTaskRecordList = [];
  39. // 我的走访记录总数
  40. $scope.allTotalCount = 0;
  41. // 获取评论列表的传参
  42. $scope.roleModel =
  43. {
  44. //TODO
  45. funid: 1,//所属功能:1走访、2录入等
  46. roleidList: []// 角色数组
  47. };
  48. // 走访录入回跳
  49. $scope.gobackFromBack = function () {
  50. if ($stateParams.comfrom == 'homepageOfNode') {
  51. // location.href=localStorage.url;
  52. $scope.go('homepageOfNode');
  53. } else if ($stateParams.comfrom == 'tab.account') {
  54. $scope.go('tab.account');
  55. } else {
  56. $scope.go('tab.activityIndex');
  57. }
  58. }
  59. /*参数设置*/
  60. /*========================================================================================================================*/
  61. /*逻辑操作*/
  62. //根据角色获取所有模版
  63. $scope.rolePageList = [];
  64. $scope.roleModel.roleidList.push(0);// 角色默认一笔0,否则后台 in查询会报错
  65. // $scope.showLoadingToast();
  66. var getRolePageList = function () {
  67. if (UtilService.isDefined(UserService.role)) {
  68. angular.forEach(UserService.role, function (value, index) {
  69. $scope.roleModel.roleidList.push(value.roleid);
  70. });
  71. }
  72. // console.log($scope.roleModel);
  73. $scope.roleModel.node = UserService.node;
  74. // $scope.roleModel.uId = UserService.id;
  75. // console.log( $scope.roleModel)
  76. roleService.getRolePageList($scope.roleModel).then(function (response) {
  77. // console.log("==============================");
  78. console.log(response);
  79. // 模版列表
  80. $scope.rolePageList = response.data;
  81. angular.forEach($scope.rolePageList, function (val) {
  82. val.logo = val.pagename == '走企业' ? 'iconfont-enterprise'
  83. : val.pagename == '走高校' ? 'iconfont-colleges'
  84. : val.pagename == '走访' ? 'iconfont-interview'
  85. : val.pagename == '数据导入' ? 'iconfont-import'
  86. : 'ion-compose';
  87. })
  88. // console.log(response.data);
  89. }, function () {
  90. })
  91. };
  92. getRolePageList();
  93. //进入云文件夹详情
  94. $scope.goSpecifyFolder = function (folder) {
  95. $scope.go('cloudFolderDetail', {folder: angular.toJson(folder)});
  96. };
  97. // 获取我的走访列表
  98. var getMyInterviewList = function () {
  99. // $scope.showLoadingToast();
  100. TechnicalBrokerPublishTrainService.getMyInterviewList($scope.keyfilter.key, $scope.userid, $scope.pagenum, 1,UserService.node).then(function (response) {
  101. // console.log(response);
  102. $scope.visitTaskRecordList = response.data;
  103. angular.forEach($scope.visitTaskRecordList, function (val) {
  104. angular.forEach(val.userlist, function (value) {
  105. if (!/http/g.test(value.photo)) {
  106. value.photo = ConfigService.imgurl + value.photo;
  107. }
  108. })
  109. val.allLables = val.otherObj ? val.otherObj.slice(0, 3) : [];
  110. })
  111. // page分页信息
  112. var temppage = angular.fromJson(response.page);
  113. // 记录总数
  114. $scope.totalCount = temppage.totalCount;
  115. var totalPage = Math.ceil(temppage.totalCount / temppage.pageSize);
  116. var trHtml = "<div class='refresh_tip_div'>更新了" + $scope.visitTaskRecordList.length + "条内容</div>";
  117. $timeout(function () {
  118. $(".resourcelistDiv .list").prepend(trHtml);
  119. $(".refresh_tip_div").animate({width: 100 + "%"}, 150);
  120. }, 800);
  121. $timeout(function () {
  122. $(".refresh_tip_div").slideUp();
  123. }, 1200);
  124. //判断是否有下一页
  125. $timeout(function () {
  126. // $timeout(function () {
  127. if (temppage.currentPage >= totalPage) {
  128. $scope.isload = false;
  129. } else {
  130. $scope.isload = true;
  131. }
  132. $scope.pagenum = 2;
  133. // $scope.noData=true;
  134. $scope.hideLoadingToast();
  135. // }, 1000);
  136. $ionicSlideBoxDelegate.update();
  137. $ionicScrollDelegate.$getByHandle("privateContent").scrollTo(0, 0);
  138. }, 50);
  139. }, function () {
  140. $scope.hideLoadingToast();
  141. }).finally(function () {
  142. $scope.$broadcast('scroll.refreshComplete');
  143. });
  144. };
  145. getMyInterviewList();
  146. // 加载更多我的走访列表
  147. $scope.loadMore = function () {
  148. // $scope.showLoadingToast();
  149. $scope.isload = false;
  150. $scope.loadmore = true;
  151. TechnicalBrokerPublishTrainService.getMyInterviewList($scope.keyfilter.key, $scope.userid, $scope.pagenum, 1,UserService.node).then(function (response) {
  152. // console.log(response);
  153. var tempreslib = angular.fromJson(response.data);
  154. // page分页信息
  155. var temppage = angular.fromJson(response.page);
  156. var totalPage = Math.ceil(temppage.totalCount / temppage.pageSize);
  157. //加载数据,更新当前页数
  158. angular.forEach(tempreslib, function (val) {
  159. angular.forEach(val.userlist, function (value) {
  160. if (!/http/g.test(value.photo)) {
  161. value.photo = ConfigService.imgurl + value.photo;
  162. }
  163. })
  164. val.allLables = val.otherObj ? val.otherObj.slice(0, 3) : [];
  165. })
  166. $timeout(function () {
  167. if ($scope.visitTaskRecordList.length > 0) {
  168. $scope.visitTaskRecordList = $scope.visitTaskRecordList.concat(tempreslib);
  169. }
  170. $scope.loadmore = false;
  171. }, 1000);
  172. //判断是否有下一页
  173. $timeout(function () {
  174. if (temppage.currentPage >= totalPage) {
  175. $scope.isload = false;
  176. } else {
  177. $scope.isload = true;
  178. }
  179. $scope.pagenum++;
  180. $scope.hideLoadingToast();
  181. }, 1000);
  182. }, function () {
  183. $scope.hideLoadingToast();
  184. $scope.loadmore = false;
  185. }).finally(function () {
  186. $scope.$broadcast('scroll.infiniteScrollComplete');
  187. });
  188. };
  189. // 获取全部走访列表:
  190. // 列表模式(默认)
  191. // 第一页是文件夹列表,文件夹分页
  192. // 第二页是文件夹+走访记录列表,文件夹不分页,记录分页
  193. var getAllInterviewList = function () {
  194. $scope.showLoadingToast();
  195. TechnicalBrokerPublishTrainService.getAllInterviewListByList($scope.keyfilter.key, $scope.userid, $scope.pagenumall, 1).then(function (response) {
  196. // console.log(response);
  197. if (UtilService.isDefined(response.data)) {
  198. $scope.allVisitTaskRecordList = response.data;
  199. } else {
  200. $scope.allVisitTaskRecordList = [];
  201. }
  202. if ($scope.allVisitTaskRecordList.length > 0) {
  203. $scope.noData = false;
  204. } else {
  205. $scope.noData = true;
  206. }
  207. angular.forEach($scope.allVisitTaskRecordList, function (val) {
  208. angular.forEach(val.userlist, function (value) {
  209. if (!/http/g.test(value.photo)) {
  210. value.photo = ConfigService.imgurl + value.photo;
  211. }
  212. })
  213. val.allLables = val.otherObj ? val.otherObj.slice(0, 3) : [];
  214. })
  215. console.log($scope.allVisitTaskRecordList);
  216. // page分页信息
  217. var temppage = angular.fromJson(response.page);
  218. // 记录总数
  219. $scope.allTotalCount = (temppage == null ? 0 : temppage.totalCount);
  220. var totalPage = Math.ceil(temppage.totalCount / temppage.pageSize);
  221. var trHtml = "<div class='refresh_tip_div'>更新了" + $scope.allVisitTaskRecordList.length + "条内容</div>";
  222. $timeout(function () {
  223. $(".resourcelistDiv .list").prepend(trHtml);
  224. $(".refresh_tip_div").animate({width: 100 + "%"}, 150);
  225. }, 800);
  226. $timeout(function () {
  227. $(".refresh_tip_div").slideUp();
  228. }, 1200);
  229. //判断是否有下一页
  230. $timeout(function () {
  231. $timeout(function () {
  232. if (temppage.currentPage >= totalPage) {
  233. $scope.isloadall = false;
  234. } else {
  235. $scope.isloadall = true;
  236. }
  237. $scope.pagenumall = 2;
  238. $scope.hideLoadingToast();
  239. }, 1000);
  240. $ionicSlideBoxDelegate.update();
  241. $ionicScrollDelegate.$getByHandle("privateContent").scrollTo(0, 0);
  242. }, 50);
  243. }, function () {
  244. $scope.hideLoadingToast();
  245. }).finally(function () {
  246. $scope.$broadcast('scroll.refreshComplete');
  247. });
  248. };
  249. getAllInterviewList();
  250. // 加载更多全部走访列表
  251. // 列表模式(默认)
  252. $scope.allloadMore = function () {
  253. // $scope.showLoadingToast();
  254. $scope.isloadall = false;
  255. $scope.allloadmore = true;
  256. TechnicalBrokerPublishTrainService.getAllInterviewListByList($scope.keyfilter.key, $scope.userid, $scope.pagenumall, 1).then(function (response) {
  257. // console.log(response);
  258. var tempreslib = angular.fromJson(response.data);
  259. // page分页信息
  260. var temppage = angular.fromJson(response.page);
  261. var totalPage = Math.ceil(temppage.totalCount / temppage.pageSize);
  262. //加载数据,更新当前页数
  263. angular.forEach(tempreslib, function (val) {
  264. angular.forEach(val.userlist, function (value) {
  265. if (!/http/g.test(value.photo)) {
  266. value.photo = ConfigService.imgurl + value.photo;
  267. }
  268. })
  269. val.allLables = val.otherObj ? val.otherObj.slice(0, 3) : [];
  270. })
  271. $timeout(function () {
  272. if ($scope.allVisitTaskRecordList.length > 0) {
  273. $scope.allVisitTaskRecordList = $scope.allVisitTaskRecordList.concat(tempreslib);
  274. }
  275. $scope.allloadmore = false;
  276. }, 1000);
  277. //判断是否有下一页
  278. $timeout(function () {
  279. if (temppage.currentPage >= totalPage) {
  280. $scope.isloadall = false;
  281. } else {
  282. $scope.isloadall = true;
  283. }
  284. $scope.pagenumall++;
  285. $scope.hideLoadingToast();
  286. }, 1000);
  287. }, function () {
  288. $scope.hideLoadingToast();
  289. $scope.allloadmore = false;
  290. }).finally(function () {
  291. $scope.$broadcast('scroll.infiniteScrollComplete');
  292. });
  293. };
  294. /*// 获取全部走访列表:
  295. // 文件夹模式 暂时不显示
  296. // 第一页是文件夹列表,文件夹分页
  297. // 第二页是文件夹+走访记录列表,文件夹不分页,记录分页
  298. var getAllInterviewList = function () {
  299. $scope.showLoadingToast();
  300. TechnicalBrokerPublishTrainService.getAllInterviewListByFold($scope.keyfilter.key, $scope.userid, $scope.pagenumall, $scope.claid).then(function (response) {
  301. console.log(response);
  302. $scope.folderlist = response.arrayList;
  303. /!* if(UtilService.isDefined(response.data)){
  304. $scope.allVisitTaskRecordList = response.data;
  305. }*!/
  306. // page分页信息
  307. var temppage = angular.fromJson(response.page);
  308. // 记录总数
  309. $scope.allTotalCount = temppage.totalCount;
  310. var totalPage = Math.ceil(temppage.totalCount / temppage.pageSize);
  311. var trHtml = "<div class='refresh_tip_div'>更新了" + $scope.folderlist.length + "条内容</div>";
  312. $timeout(function () {
  313. $(".resourcelistDiv .list").prepend(trHtml);
  314. $(".refresh_tip_div").animate({width: 100 + "%"}, 150);
  315. }, 800);
  316. $timeout(function () {
  317. $(".refresh_tip_div").slideUp();
  318. }, 1200);
  319. //判断是否有下一页
  320. $timeout(function () {
  321. $timeout(function () {
  322. if (temppage.currentPage >= totalPage) {
  323. $scope.isloadall = false;
  324. } else {
  325. $scope.isloadall = true;
  326. }
  327. $scope.pagenumall = 2;
  328. }, 1000);
  329. $scope.hideLoadingToast();
  330. $ionicSlideBoxDelegate.update();
  331. $ionicScrollDelegate.$getByHandle("privateContent").scrollTo(0, 0);
  332. }, 50);
  333. }, function () {
  334. $scope.hideLoadingToast();
  335. }).finally(function () {
  336. $scope.$broadcast('scroll.refreshComplete');
  337. });
  338. };
  339. getAllInterviewList();
  340. // 加载更多全部走访列表
  341. // 文件夹模式
  342. $scope.allloadMore = function () {
  343. $scope.showLoadingToast();
  344. $scope.isloadall = false;
  345. $scope.allloadmore = true;
  346. TechnicalBrokerPublishTrainService.getAllInterviewListByFold($scope.keyfilter.key, $scope.userid, $scope.pagenumall, $scope.claid).then(function (response) {
  347. console.log(response);
  348. var tempreslib = angular.fromJson(response.arrayList);
  349. // page分页信息
  350. var temppage = angular.fromJson(response.page);
  351. var totalPage = Math.ceil(temppage.totalCount / temppage.pageSize);
  352. //加载数据,更新当前页数
  353. $timeout(function () {
  354. if ($scope.folderlist.length > 0) {
  355. $scope.folderlist = $scope.folderlist.concat(tempreslib);
  356. }
  357. $scope.allloadmore = false;
  358. }, 1000);
  359. //判断是否有下一页
  360. $timeout(function () {
  361. if (temppage.currentPage >= totalPage) {
  362. $scope.isloadall = false;
  363. } else {
  364. $scope.isloadall = true;
  365. }
  366. $scope.pagenumall++;
  367. $scope.hideLoadingToast();
  368. }, 1000);
  369. }, function () {
  370. $scope.hideLoadingToast();
  371. $scope.allloadmore = false;
  372. }).finally(function () {
  373. $scope.$broadcast('scroll.infiniteScrollComplete');
  374. });
  375. };*/
  376. //获取企业信息列表
  377. $scope.companylist = [
  378. {
  379. logo: "https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2102756011,2989429775&fm=27&gp=0.jpg",
  380. companyname: "企业A",
  381. ishigh: "1",
  382. industry: "产业领域"
  383. },
  384. {
  385. logo: "https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2427437564,310554570&fm=27&gp=0.jpg",
  386. companyname: "企业B",
  387. ishigh: "0",
  388. industry: "产业领域"
  389. },
  390. {
  391. logo: "https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=733963650,3633348335&fm=27&gp=0.jpg",
  392. companyname: "企业C",
  393. ishigh: "1",
  394. industry: "产业领域"
  395. },
  396. {
  397. logo: "https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=1477507599,2478418295&fm=27&gp=0.jpg",
  398. companyname: "企业D",
  399. ishigh: "0",
  400. industry: "产业领域"
  401. },
  402. {
  403. logo: "https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=376390060,3966999180&fm=27&gp=0.jpg",
  404. companyname: "企业E",
  405. ishigh: "1",
  406. industry: "产业领域"
  407. }
  408. ];
  409. $scope.islogin = ConfigService.islogin;
  410. $scope.goDetail = function (connid) {
  411. $scope.go("technicalBrokerCompanyInfo", {connid: connid});
  412. };
  413. //弹出各类按钮
  414. $scope.showAnthorBtnWrap = false;
  415. $scope.goEnterCompanyInfo = function () {
  416. if (!$scope.islogin) {
  417. if (localStorage.wxFlag == "true") {
  418. if (localStorage.isUserFocusXW == 0) {
  419. var title = localStorage.appidStr;
  420. $ionicPopup.alert({
  421. title: '提示',
  422. template: '请先关注微信公众号"' + title + '"!'
  423. });
  424. return;
  425. } else {
  426. if (localStorage.isUserBindWx == 0) {
  427. var wxFlag = JSON.parse(localStorage.params);
  428. if (wxFlag.weChatModel) {
  429. $scope.go('bindPhone', {
  430. params: localStorage.params,
  431. comfrom: 'maincontroller',
  432. url: window.location.href.split('#/')[1]
  433. });
  434. } else {
  435. $scope.go('login');
  436. return;
  437. }
  438. } else {
  439. $scope.go('login');
  440. return;
  441. }
  442. }
  443. } else {
  444. $scope.go('login');
  445. return;
  446. }
  447. } else {
  448. $scope.showAnthorBtnWrap = true;
  449. }
  450. };
  451. //隐藏各类按钮
  452. $scope.hideAnthorBtnWrap = function () {
  453. $scope.showAnthorBtnWrap = false;
  454. };
  455. //切换到对应页面
  456. var activity = ['selfDetailList', 'groupDetailList'];
  457. $scope.act = activity[1];//默认是全部走访记录
  458. $scope.changeAct = function (num) {
  459. $scope.islogin = ConfigService.islogin;
  460. if (num == 0) {
  461. if (!$scope.islogin) {
  462. if (localStorage.wxFlag == "true") {
  463. if (localStorage.isUserFocusXW == 0) {
  464. var title = localStorage.appidStr;
  465. $ionicPopup.alert({
  466. title: '提示',
  467. template: '请先关注微信公众号"' + title + '"!'
  468. });
  469. return;
  470. } else {
  471. if (localStorage.isUserBindWx == 0) {
  472. var wxFlag = JSON.parse(localStorage.params);
  473. if (wxFlag.weChatModel) {
  474. $scope.go('bindPhone', {
  475. params: localStorage.params,
  476. comfrom: 'maincontroller',
  477. url: window.location.href.split('#/')[1]
  478. });
  479. } else {
  480. $scope.go('login');
  481. return;
  482. }
  483. } else {
  484. $scope.go('login');
  485. return;
  486. }
  487. }
  488. } else {
  489. $scope.go('login');
  490. return;
  491. }
  492. } else {
  493. $scope.act = activity[num];
  494. if ($scope.allVisitTaskRecordList.length > 0) {
  495. $scope.noData = false;
  496. } else {
  497. $scope.noData = true;
  498. }
  499. }
  500. } else if (num == 1) {
  501. $scope.act = activity[num];
  502. if ($scope.allVisitTaskRecordList.length > 0) {
  503. $scope.noData = false;
  504. } else {
  505. $scope.noData = true;
  506. }
  507. }
  508. };
  509. if ($stateParams.comfrom == 'tab.account') {
  510. $scope.changeAct(0);//默认是全部走访记录
  511. }
  512. //共享文件夹
  513. //展开按钮
  514. $scope.showAction = function () {
  515. $scope.showMoreAction = !$scope.showMoreAction;
  516. };
  517. //关闭按钮
  518. $scope.actionButton_three = function () {
  519. $scope.showMoreAction = !$scope.showMoreAction;
  520. };
  521. //进入设置资源库页面
  522. $scope.goAutoritySet = function (reclib) {
  523. $timeout(function () {
  524. $ionicListDelegate.closeOptionButtons();
  525. }, 10);
  526. if (UtilService.isDefined(reclib.localid)) {
  527. $scope.go("authorityLocalSet", {authoritydata: angular.toJson(reclib), type: 0, goflg: 0});
  528. } else {
  529. $scope.go("authoritySet", {
  530. reclibid: reclib.id,
  531. authorityid: reclib.authorityid,
  532. authoritycomefrom: reclib.authoritycomefrom,
  533. name: reclib.name,
  534. content: reclib.content,
  535. sort: reclib.sort,
  536. type: 0,
  537. parentid: reclib.parentid
  538. });
  539. }
  540. };
  541. //新建记录
  542. $scope.addRecord = function () {
  543. if ($scope.folderlist.length < 1) {
  544. UtilService.showMess("您还没有文件夹,去新建文件夹吧");
  545. return;
  546. }
  547. ModelService.setCreateType(0);
  548. ModelService.setCheckdeFolder($scope.folderlist[0]);
  549. $scope.go('cloudAddConnInfo');
  550. };
  551. //新建文件夹
  552. $scope.buildNewFolder = function () {
  553. $scope.go("authorityCreate", {templettype: 2});
  554. };
  555. //进入分类详情,记录列表
  556. $scope.queryFolder = function (folder) {
  557. $scope.go('cloudFolderDetail', {folder: angular.toJson(folder)});
  558. };
  559. //再次走访
  560. $scope.repeatVisit = function (companyid, pageid, orgtype, name, pagecode, templettype, node) {
  561. if (!$scope.islogin) {
  562. if (localStorage.wxFlag == "true") {
  563. if (localStorage.isUserFocusXW == 0) {
  564. var title = localStorage.appidStr;
  565. $ionicPopup.alert({
  566. title: '提示',
  567. template: '请先关注微信公众号"' + title + '"!'
  568. });
  569. return;
  570. } else {
  571. if (localStorage.isUserBindWx == 0) {
  572. var wxFlag = JSON.parse(localStorage.params);
  573. if (wxFlag.weChatModel) {
  574. $scope.go('bindPhone', {
  575. params: localStorage.params,
  576. comfrom: 'maincontroller',
  577. url: window.location.href.split('#/')[1]
  578. });
  579. return;
  580. } else {
  581. $scope.go('login');
  582. return;
  583. }
  584. } else {
  585. $scope.go('login');
  586. return;
  587. }
  588. }
  589. } else {
  590. $scope.go('login');
  591. return;
  592. }
  593. }
  594. $scope.orgid = companyid;
  595. //弹出新建走访按钮
  596. // $scope.goEnterCompanyInfo();
  597. console.log({
  598. companyid: companyid,
  599. pageid: templettype,
  600. orgtype: orgtype,
  601. pagecode: pagecode,
  602. isedit: 0,
  603. node: node,
  604. pageTitle: '新建走访',
  605. title: name
  606. })
  607. $scope.go('visitModularForm', {
  608. companyid: companyid,
  609. pageid: templettype,
  610. orgtype: orgtype,
  611. pagecode: pagecode,
  612. isedit: 0,
  613. node: node,
  614. pageTitle: '新建走访',
  615. title: name
  616. });
  617. };
  618. // 各模版快捷入口页面跳转
  619. $scope.jumpPage = function (companyid, pageid, orgtype, pagecode) {
  620. console.log(orgtype)
  621. if(orgtype=='10106'){
  622. $scope.go('technicalBrokerExportCompanyInfo')
  623. }else {
  624. if ($scope.defaultLan == "Chinese") {
  625. $scope.go('visitModularForm', {
  626. companyid: companyid,
  627. pageid: pageid,
  628. orgtype: orgtype,
  629. pagecode: pagecode,
  630. isedit: 0,
  631. node: UserService.node,
  632. pageTitle: '新建走访'
  633. });
  634. } else {
  635. $scope.go('visitModularForm', {
  636. companyid: companyid,
  637. pageid: pageid,
  638. orgtype: orgtype,
  639. pagecode: pagecode,
  640. isedit: 0,
  641. node: UserService.node,
  642. pageTitle: 'New Interview'
  643. });
  644. }
  645. }
  646. // if(UserService.node=='320117005'||UserService.node=='320117003'||UserService.node=='320117002'||UserService.node=='320117001'||UserService.node=='320117004'){
  647. // $scope.go('typeinAllModal', {companyid: 0, pageid: id, orgtype: orgtype,pagecode:pagecode, isedit: isedit,node:UserService.node});
  648. // }else{
  649. // $scope.go('typeinInformation',{orgtype:orgtype,pagecode:pagecode,pagename:pagename,id:id,isedit:isedit})
  650. // }
  651. };
  652. // 点击企业名称进入该企业的最新履历页面
  653. $scope.gotoConnInfoDetail = function (resid, pagecode, node, orgtype, templettype, resource) {
  654. // console.log(resid,pagecode,node,orgtype,templettype);
  655. $scope.islogin = ConfigService.islogin;
  656. if (!$scope.islogin) {
  657. if (localStorage.wxFlag == "true") {
  658. if (localStorage.isUserFocusXW == 0) {
  659. var title = localStorage.appidStr;
  660. $ionicPopup.alert({
  661. title: '提示',
  662. template: '请先关注微信公众号"' + title + '"!'
  663. });
  664. return;
  665. } else {
  666. if (localStorage.isUserBindWx == 0) {
  667. var wxFlag = JSON.parse(localStorage.params);
  668. if (wxFlag.weChatModel) {
  669. $scope.go('bindPhone', {
  670. params: localStorage.params,
  671. comfrom: 'maincontroller',
  672. url: window.location.href.split('#/')[1]
  673. });
  674. } else {
  675. $scope.go('login');
  676. return;
  677. }
  678. } else {
  679. $scope.go('login');
  680. return;
  681. }
  682. }
  683. } else {
  684. $scope.go('login');
  685. return;
  686. }
  687. } else {
  688. switch ($scope.act) {
  689. case "selfDetailList":
  690. $scope.isAllVisitor = 0;
  691. break;
  692. case "groupDetailList":
  693. $scope.isAllVisitor = 1;
  694. break;
  695. }
  696. $scope.go('resourceCommonInfoDetailsPage', {
  697. resid: resid,
  698. isAllVisitor: $scope.isAllVisitor,
  699. pagecode: pagecode,
  700. node: node,
  701. orgtype: orgtype,
  702. templettype: templettype,
  703. label: JSON.stringify(resource.otherObj),
  704. });
  705. }
  706. };
  707. //返回至首页
  708. $scope.gotoHome = function () {
  709. $(".tab_hide").hide();
  710. $state.go('tab.activityIndex');
  711. };
  712. //进入资源库发布者列表
  713. $scope.goResourcePublisher = function (userlist) {
  714. $scope.go('resourcePublisherAccount', {userlist: userlist});
  715. };
  716. //虚拟搜索框
  717. $scope.isShowSearchButton = true;
  718. $scope.keyfilter = {key: ""};//搜索关键词
  719. $scope.showSearchButtonLeft = function () {
  720. $scope.isShowSearchButton = false;
  721. $timeout(function () {
  722. $(".showSearchInput").focus();
  723. }, 300)
  724. };
  725. //清空搜索内容
  726. $scope.clearSearch = function () {
  727. $scope.isShowSearchButton = true;
  728. $scope.keyfilter.key = "";
  729. $scope.searchList();
  730. };
  731. //TODO 放开注释
  732. if ($scope.app) {
  733. if (device.platform != "Android") {
  734. $scope.isIos = true;
  735. } else {
  736. $scope.isIos = false;
  737. }
  738. }
  739. $scope.searchList = function () {
  740. // $scope.showLoadingToast();
  741. if ($scope.act == 'selfDetailList') {
  742. $scope.pagenum = 1;
  743. getMyInterviewList();
  744. } else {
  745. $scope.pagenumall = 1;
  746. getAllInterviewList();
  747. }
  748. }
  749. });