identifyFormForTongLuCtrl.js 79 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369
  1. /**
  2. * Created by pushkeji on 2018/8/16.
  3. */
  4. angular.module('push')
  5. .controller('identifyFormForTongLuCtrl', function ($scope, $stateParams, $ionicActionSheet, $ionicLoading, $ionicScrollDelegate, UtilService, dataToolsService, $sce, AccountService, UserService, $ionicSlideBoxDelegate, $timeout, $state, $http, ConfigService, CommonService, $ionicPopup, ResourceLibraryService, taskModuleService, ScienceCircleService, $ionicModal, $q) {
  6. console.log($stateParams);
  7. // 弹出任务邀请框
  8. $scope.tempData = {};
  9. $scope.readCommit = false;
  10. $scope.node = UserService.node;
  11. if ($scope.node == '330122000') {
  12. $scope.agree = 1;
  13. } else {
  14. $scope.agree = true;
  15. }
  16. if (UserService.user.data == null || UserService.user.data == undefined || UserService.user.data == "") {
  17. $scope.mobile = UserService.user.mobile;
  18. } else {
  19. $scope.mobile = UserService.user.data.mobile;
  20. }
  21. $scope.url = 'http://pic.ubittc.com/group1/M00/03/B7/wKjIKluVD3OAfkH4AAA74dltjKY89.docx';
  22. $scope.alertInfo = function () {
  23. // CommonService.showMessage('请在电脑端下载打印',$scope)
  24. if ($scope.app) {
  25. $ionicPopup.alert({
  26. title: '提示',
  27. template: '《企业认证申请公函》请在电脑端下载打印,并加盖企业公章后上传。电脑端web网址:ubittc.com'
  28. });
  29. }
  30. }
  31. if ($scope.app) {
  32. $scope.url = '';
  33. // $scope.alertInfo()
  34. }
  35. if ($stateParams.pageTitle) {
  36. $scope.pageTitle = $stateParams.pageTitle;
  37. } else {
  38. $scope.pageTitle = sessionStorage.indentifyDetailTitle;
  39. }
  40. if ($stateParams.code) {
  41. $scope.code = $stateParams.code;
  42. if ($stateParams.code == 1) {
  43. $scope.code = $stateParams.type;
  44. }
  45. } else {
  46. $scope.code = sessionStorage.indentifyDetailCode;
  47. }
  48. $scope.action = $stateParams.action;
  49. $scope.type = $stateParams.type;
  50. // console.log($stateParams);
  51. // console.log($scope.pageTitle,$scope.code,$scope.action);
  52. // if($stateParams.type=){
  53. // $scope.type=$stateParams.type;
  54. // }else{
  55. // $scope.type=sessionStorage.type;
  56. // }
  57. $scope.orgid = null;
  58. $scope.showNew = false;
  59. $scope.showHistory = false;
  60. $scope.showFinish = false;
  61. $scope.showReject = -3;
  62. $scope.refusereason = '';
  63. if ($stateParams.type == 5100) {
  64. $scope.showNew = true;
  65. } else if ($stateParams.type == 5101 || $stateParams.type == 0 || $scope.action == 'check' || $stateParams.type == 5102 || $stateParams.type == 5103 || $stateParams.type == 5104) {
  66. $scope.showHistory = true;
  67. if ($stateParams.type == 5102 || $stateParams.type == 5103 || $stateParams.type == 5104) {
  68. $scope.showFinish = true;
  69. }
  70. }
  71. if ($stateParams.type == 5103 && $stateParams.code == 4801) {
  72. $scope.showReject = -1;
  73. }
  74. if ($stateParams.type == 5102 && $stateParams.code == 4801) {
  75. $scope.showReject = 1;
  76. }
  77. if ($stateParams.type == 5104 && $stateParams.code == 4801) {
  78. $scope.showReject = -2;
  79. }
  80. $scope.personalNotices = [
  81. {
  82. image: '1',
  83. title: '注意事项',
  84. item: [
  85. '1.每个证件只能绑定一个账号',
  86. '2.证件照不清晰或与输入的信息不匹配,将导致实名认证被驳回',
  87. '3.您提供的证件信息将受到严格保护,仅用于身份验证,未经本人许可不会用于其他用途'
  88. ]
  89. }, {
  90. image: '2',
  91. title: '证件要求',
  92. item: [
  93. '1.需上传本人二代身份证背面照+身份证反面照(不需手持)',
  94. '2.证件必须在有效期内,有效期需在一个月以上',
  95. ]
  96. }, {
  97. image: '2',
  98. title: '照片要求',
  99. item: [
  100. '1.证件照上信息需完整且清晰可辩(无反光、遮挡、水印、证件套、logo等)',
  101. '2.申请人填写的“真实姓名”和“证件号码”需和提交证件照片信息一致',
  102. '3.证件必须真实拍摄,不能使用复印件',
  103. '4.确保照片完整(不缺边角),证件周围不允许加上边角框(如:加上红框等)'
  104. ]
  105. },
  106. ];
  107. var personal = [
  108. {
  109. title: '真实姓名',
  110. placeholder: '请填写真实姓名',
  111. content: '',
  112. type: 'input',
  113. needed: true,
  114. saveKey: 'applyname',
  115. }, {
  116. title: '证件类型',
  117. placeholder: '请选择证件类型',
  118. // type:'certificateType',
  119. content: '',
  120. key: '',
  121. saveKey: 'idtype',
  122. type: 'select',
  123. selectkey: 'id_type',
  124. needed: true,
  125. }, {
  126. title: '证件号码',
  127. placeholder: '请填写证件号码',
  128. type: 'input',
  129. content: '',
  130. needed: true,
  131. saveKey: 'cardno',
  132. }, {
  133. title: '证件正面照',
  134. content: '[]',
  135. type: 'upload',
  136. needed: true,
  137. imagelist: [],
  138. imageSaveList: [],
  139. imageDeleteList: [],
  140. doctype: 4906,
  141. remarkType: 'identify',
  142. }, {
  143. title: '证件背面照',
  144. content: '[]',
  145. type: 'upload',
  146. needed: true,
  147. imagelist: [],
  148. imageSaveList: [],
  149. imageDeleteList: [],
  150. doctype: 4907,
  151. remarkType: 'identify',
  152. },
  153. ];
  154. $scope.identifyFormList = $stateParams.formlist;
  155. // console.log('params', $stateParams.formlist);
  156. console.log('params', $scope.identifyFormList, UserService.node);
  157. if (UserService.node == 330122000) {
  158. console.log(1);
  159. var tecBroker = [
  160. {
  161. title: '单位',
  162. placeholder: '请填写单位信息',
  163. fuzzyQuery: true,
  164. content: $scope.identifyFormList ? $scope.identifyFormList.department : '',
  165. type: 'input',
  166. needed: true,
  167. saveKey: 'department',
  168. }, {
  169. title: '证书号',
  170. placeholder: '请填写技术经纪人证书号',
  171. content: $scope.identifyFormList ? $scope.identifyFormList.brokercertificate : '',
  172. type: 'input',
  173. needed: true,
  174. saveKey: 'brokercertificate',
  175. }, {
  176. title: '姓名',
  177. placeholder: '请填写姓名',
  178. content: $scope.identifyFormList ? $scope.identifyFormList.applyname : '',
  179. type: 'input',
  180. needed: true,
  181. saveKey: 'applyname',
  182. }, {
  183. title: '职务',
  184. placeholder: '请填写职务',
  185. content: $scope.identifyFormList ? $scope.identifyFormList.title : '',
  186. type: 'input',
  187. needed: false,
  188. saveKey: 'title',
  189. }, {
  190. title: '联系方式',
  191. placeholder: '请填写联系方式',
  192. content: $scope.identifyFormList ? $scope.identifyFormList.tel : '',
  193. type: 'input',
  194. needed: true,
  195. saveKey: 'tel',
  196. },
  197. // {
  198. // title: '涉及领域',
  199. // content: $scope.identifyFormList ? $scope.identifyFormList.categoryid : '',
  200. // key: '',
  201. // type: 'selectDomain',
  202. // needed: false,
  203. // saveKey: 'categoryid',
  204. // },
  205. {
  206. title: '上传证书',
  207. content: $scope.identifyFormList.images ? '' : '[]',
  208. key: '',
  209. type: 'uploadcard',
  210. needed: true,
  211. imagelist: $scope.identifyFormList.images ? JSON.parse($scope.identifyFormList.images) : [],
  212. imageSaveList: [],
  213. imageDeleteList: [],
  214. saveKey: 'categoryid',
  215. },
  216. ];
  217. } else {
  218. var tecBroker = [
  219. {
  220. title: '单位',
  221. placeholder: '若无工作单位信息,请填无',
  222. fuzzyQuery: true,
  223. content: $scope.identifyFormList ? $scope.identifyFormList[0].content : '',
  224. type: 'input',
  225. needed: true,
  226. saveKey: 'department',
  227. }, {
  228. title: '证书号',
  229. placeholder: '请填写技术经纪人证书号',
  230. content: $scope.identifyFormList ? $scope.identifyFormList[1].content : '',
  231. type: 'input',
  232. needed: true,
  233. saveKey: 'brokercertificate',
  234. }, {
  235. title: '姓名',
  236. placeholder: '请填写姓名',
  237. content: $scope.identifyFormList ? $scope.identifyFormList[2].content : '',
  238. type: 'input',
  239. needed: true,
  240. saveKey: 'applyname',
  241. }, {
  242. title: '职务',
  243. placeholder: '请填写职务',
  244. content: $scope.identifyFormList ? $scope.identifyFormList[3].content : '',
  245. type: 'input',
  246. needed: false,
  247. saveKey: 'title',
  248. }, {
  249. title: '联系方式',
  250. placeholder: '请填写联系方式',
  251. content: $scope.identifyFormList ? $scope.identifyFormList[4].content : $scope.mobile,
  252. type: 'input',
  253. needed: true,
  254. saveKey: 'tel',
  255. },
  256. // {
  257. // title: '涉及领域',
  258. // content: $scope.identifyFormList ? $scope.identifyFormList[5].content : '',
  259. // key: '',
  260. // type: 'selectDomain',
  261. // needed: false,
  262. // saveKey: 'categoryid',
  263. // },
  264. ];
  265. }
  266. var enterprise = [
  267. {
  268. title: '企业全称',
  269. placeholder: '请填写企业全称',
  270. fuzzyQuery: true,
  271. content: '',
  272. type: 'input',
  273. needed: true,
  274. saveKey: 'applyname',
  275. }, {
  276. title: '统一社会信用代码',
  277. placeholder: '请填写统一社会信用代码',
  278. content: '',
  279. type: 'input',
  280. needed: true,
  281. saveKey: 'orgcode',
  282. }, {
  283. title: '所属行业',
  284. placeholder: '请选择所属行业',
  285. content: '',
  286. key: '',
  287. type: 'selectDomain',
  288. needed: false,
  289. saveKey: 'categoryid',
  290. }, {
  291. title: '所在地区',
  292. content: '',
  293. type: 'selectArea',
  294. needed: false,
  295. saveKey: 'district',
  296. code: ''
  297. }, {
  298. title: '企业详细地址',
  299. placeholder: '请填写企业详细地址',
  300. content: '',
  301. type: 'input',
  302. needed: false,
  303. saveKey: 'detailaddress',
  304. }, {
  305. title: '企业法人',
  306. placeholder: '请填写企业法人',
  307. content: '',
  308. type: 'input',
  309. needed: false,
  310. saveKey: 'legalperson',
  311. }, {
  312. title: '职务',
  313. placeholder: '请填写职务',
  314. content: '',
  315. type: 'input',
  316. needed: true,
  317. saveKey: 'title',
  318. }, {
  319. title: '工作证明',
  320. content: '[]',
  321. type: 'upload',
  322. needed: true,
  323. imagelist: [],
  324. imageSaveList: [],
  325. imageDeleteList: [],
  326. doctype: 4903,
  327. remarkType: 'normal',
  328. }, {
  329. title: '是否认领机构管理员',
  330. type: 'toggle',
  331. content: '10502',
  332. togglecontent: false,
  333. saveKey: 'ifleader'
  334. }, {
  335. title: '机构管理运营确认函',
  336. content: '[]',
  337. type: 'upload',
  338. needed: true,
  339. imagelist: [],
  340. imageSaveList: [],
  341. imageDeleteList: [],
  342. doctype: 4908,
  343. remarkType: 'manage'
  344. }, {
  345. title: '补充文件',
  346. content: '[]',
  347. type: 'upload',
  348. needed: false,
  349. imagelist: [],
  350. imageSaveList: [],
  351. imageDeleteList: [],
  352. doctype: 4900,
  353. remarkType: 'add'
  354. },
  355. ];
  356. var college = [
  357. {
  358. title: '高校全称',
  359. placeholder: '请填写高校全称',
  360. fuzzyQuery: true,
  361. content: '',
  362. type: 'input',
  363. needed: true,
  364. saveKey: 'applyname',
  365. }, {
  366. title: '职务',
  367. placeholder: '请填写职务',
  368. content: '',
  369. type: 'input',
  370. needed: true,
  371. saveKey: 'title',
  372. }, {
  373. title: '所在地区',
  374. content: '',
  375. type: 'selectArea',
  376. needed: false,
  377. saveKey: 'district',
  378. code: ''
  379. }, {
  380. title: '所属领域',
  381. content: '',
  382. key: '',
  383. type: 'selectDomain',
  384. needed: true,
  385. saveKey: 'categoryid',
  386. }, {
  387. title: '工作证明',
  388. content: '[]',
  389. type: 'upload',
  390. needed: true,
  391. imagelist: [],
  392. imageSaveList: [],
  393. imageDeleteList: [],
  394. doctype: 4903,
  395. remarkType: 'normal',
  396. }, {
  397. title: '是否认领机构管理员',
  398. type: 'toggle',
  399. content: '10502',
  400. togglecontent: false,
  401. saveKey: 'ifleader'
  402. }, {
  403. title: '机构管理运营确认函',
  404. content: '[]',
  405. type: 'upload',
  406. needed: true,
  407. imagelist: [],
  408. imageSaveList: [],
  409. imageDeleteList: [],
  410. doctype: 4908,
  411. remarkType: 'manage'
  412. }, {
  413. title: '补充文件',
  414. content: '[]',
  415. type: 'upload',
  416. needed: false,
  417. imagelist: [],
  418. imageSaveList: [],
  419. imageDeleteList: [],
  420. doctype: 4900,
  421. remarkType: 'add'
  422. },
  423. ];
  424. var government = [
  425. {
  426. title: '政府全称',
  427. placeholder: '请填写政府全称',
  428. fuzzyQuery: true,
  429. content: '',
  430. type: 'input',
  431. needed: true,
  432. saveKey: 'applyname',
  433. }, {
  434. title: '职务',
  435. placeholder: '请填写职务',
  436. content: '',
  437. type: 'input',
  438. needed: true,
  439. saveKey: 'title',
  440. }, {
  441. title: '所在地区',
  442. content: '',
  443. type: 'selectArea',
  444. needed: false,
  445. saveKey: 'district',
  446. code: ''
  447. }, {
  448. title: '所在部门',
  449. placeholder: '请填写所在部门',
  450. content: '',
  451. type: 'input',
  452. needed: false,
  453. saveKey: 'department',
  454. }, {
  455. title: '工作证明',
  456. content: '[]',
  457. type: 'upload',
  458. needed: true,
  459. imagelist: [],
  460. imageSaveList: [],
  461. imageDeleteList: [],
  462. doctype: 4903,
  463. remarkType: 'normal',
  464. }, {
  465. title: '是否认领机构管理员',
  466. type: 'toggle',
  467. content: '10502',
  468. togglecontent: false,
  469. saveKey: 'ifleader'
  470. }, {
  471. title: '机构管理运营确认函',
  472. content: '[]',
  473. type: 'upload',
  474. needed: true,
  475. imagelist: [],
  476. imageSaveList: [],
  477. imageDeleteList: [],
  478. doctype: 4908,
  479. remarkType: 'manage'
  480. }, {
  481. title: '补充文件',
  482. content: '[]',
  483. type: 'upload',
  484. needed: false,
  485. imagelist: [],
  486. imageSaveList: [],
  487. imageDeleteList: [],
  488. doctype: 4900,
  489. remarkType: 'add'
  490. },
  491. ];
  492. var serviceorg = [
  493. {
  494. title: '服务机构全称',
  495. placeholder: '请填写服务机构全称',
  496. fuzzyQuery: true,
  497. content: '',
  498. type: 'input',
  499. needed: true,
  500. saveKey: 'applyname',
  501. }, {
  502. title: '统一社会信用代码',
  503. placeholder: '请填写统一社会信用代码',
  504. content: '',
  505. type: 'input',
  506. needed: true,
  507. saveKey: 'orgcode',
  508. }, {
  509. // title:'服务类型',
  510. // content:'',
  511. // type:'input',
  512. // needed:true,
  513. // saveKey:'categoryid',
  514. // dictionarytype:30050,
  515. // dictionary:0
  516. // },{
  517. title: '所在地区',
  518. content: '',
  519. type: 'selectArea',
  520. needed: false,
  521. saveKey: 'district',
  522. code: ''
  523. }, {
  524. title: '机构详细地址',
  525. placeholder: '请填写机构详细地址',
  526. content: '',
  527. type: 'input',
  528. needed: false,
  529. saveKey: 'detailaddress',
  530. }, {
  531. title: '企业法人',
  532. placeholder: '请填写企业法人',
  533. content: '',
  534. type: 'input',
  535. needed: false,
  536. saveKey: 'legalperson',
  537. }, {
  538. title: '职务',
  539. placeholder: '请填写职务',
  540. content: '',
  541. type: 'input',
  542. needed: true,
  543. saveKey: 'title',
  544. }, {
  545. title: '工作证明',
  546. content: '[]',
  547. type: 'upload',
  548. needed: true,
  549. imagelist: [],
  550. imageSaveList: [],
  551. imageDeleteList: [],
  552. doctype: 4903,
  553. remarkType: 'normal',
  554. }, {
  555. title: '是否认领机构管理员',
  556. type: 'toggle',
  557. content: '10502',
  558. togglecontent: false,
  559. saveKey: 'ifleader'
  560. }, {
  561. title: '机构管理运营确认函',
  562. content: '[]',
  563. type: 'upload',
  564. needed: true,
  565. imagelist: [],
  566. imageSaveList: [],
  567. imageDeleteList: [],
  568. doctype: 4908,
  569. remarkType: 'manage'
  570. }, {
  571. title: '补充文件',
  572. content: '[]',
  573. type: 'upload',
  574. needed: false,
  575. imagelist: [],
  576. imageSaveList: [],
  577. imageDeleteList: [],
  578. doctype: 4900,
  579. remarkType: 'add'
  580. },
  581. ];
  582. console.log('code到底是什么', $scope.code, tecBroker)
  583. switch ($scope.code) {
  584. case 4800:
  585. $scope.formList = personal;
  586. break;
  587. case 4803:
  588. $scope.formList = enterprise;
  589. break;
  590. case 4801:
  591. console.log('tecBroker', tecBroker)
  592. $scope.formList = tecBroker;
  593. break;
  594. case 4804:
  595. $scope.formList = college;
  596. break;
  597. case 4805:
  598. $scope.formList = government;
  599. break;
  600. case 4806:
  601. $scope.formList = serviceorg;
  602. break;
  603. }
  604. // 对接录入
  605. if ($stateParams.comfrom == 'dockingInput') {
  606. $scope.formList = [
  607. {
  608. title: '企业',
  609. placeholder: '请填写企业全称',
  610. fuzzyQuery: true,
  611. content: '',
  612. type: 'input',
  613. needed: false,
  614. saveKey: 'companyid',
  615. rowMargin: true
  616. }, {
  617. title: '需求',
  618. placeholder: '请选择对接需求',
  619. content: null,
  620. selectkey: '',
  621. type: 'companyTaskSelect',
  622. needed: true,
  623. saveKey: 'taskid',
  624. key: null,
  625. list: []
  626. }, {
  627. title: '状态',
  628. placeholder: '请填写状态',
  629. content: '',
  630. type: 'input',
  631. needed: true,
  632. saveKey: 'title',
  633. recommend: '热门状态',
  634. recommendLable: ['洽谈', '签约', '合作中', '完成']
  635. }, {
  636. title: '内容',
  637. placeholder: '请填写对接内容',
  638. type: 'textarea',
  639. maxlength: 500,
  640. content: '',
  641. needed: true,
  642. saveKey: 'content',
  643. }, {
  644. title: '补充文件',
  645. content: '[]',
  646. type: 'upload',
  647. needed: false,
  648. imagelist: [],
  649. imageSaveList: [],
  650. imageDeleteList: [],
  651. doctype: 4900,
  652. remarkType: 'add',
  653. rowMargin: true
  654. }
  655. ]
  656. for (var i = 0; i < $scope.formList.length; i++) {
  657. if ($scope.formList[i].saveKey == 'taskid') {
  658. $scope.formList[i].content = $stateParams.taskTitle;
  659. $scope.tempData.resourceid = $stateParams.taskid;
  660. }
  661. if ($scope.formList[i].saveKey == 'companyid') {
  662. $scope.formList[i].content = $stateParams.companyName;
  663. }
  664. }
  665. taskModuleService.searchCompanyTask($stateParams.companyid, 1, 200).then(function (res) {
  666. console.log(res);
  667. if (res.code == 3350) {
  668. $scope.formList[1].listItem = [];
  669. angular.forEach(res.data, function (val) {
  670. $scope.formList[1].listItem.push({
  671. text: '<a class="action-sheet-push">' + val.projectname + '</a>',
  672. itemkey: val.id,
  673. itemvalue: val.projectname //名字
  674. })
  675. })
  676. }
  677. })
  678. }
  679. if ($stateParams.comfrom == 'taskRelease') {
  680. $scope.formList = [
  681. {
  682. title: '所属企业',
  683. placeholder: '请填写企业全称',
  684. fuzzyQuery: true,
  685. content: '',
  686. type: 'input',
  687. needed: true,
  688. saveKey: 'companyid',
  689. rowMargin: true
  690. }, {
  691. title: '需求名称',
  692. placeholder: '请填写需求名称',
  693. content: '',
  694. type: 'input',
  695. needed: true,
  696. saveKey: 'projectname',
  697. }, {
  698. title: '投入预算(w)',
  699. placeholder: '请填写预算',
  700. content: 0,
  701. type: 'input',
  702. needed: false,
  703. saveKey: 'capitalScale',
  704. inputType: 'number',
  705. }, {
  706. title: '联系人',
  707. placeholder: '请填写联系人',
  708. content: '',
  709. type: 'input',
  710. needed: false,
  711. saveKey: 'contactor',
  712. }, {
  713. title: '联系电话',
  714. placeholder: '请填联系电话',
  715. content: '',
  716. type: 'input',
  717. needed: false,
  718. saveKey: 'tel',
  719. inputType: 'number',
  720. }, {
  721. title: '合作模式',
  722. placeholder: '请选择合作模式',
  723. content: '',
  724. selectkey: 'cooperationmodel',
  725. type: 'select',
  726. needed: false,
  727. saveKey: 'cooperationmodel',
  728. key: ''
  729. }, {
  730. title: '需求介绍',
  731. placeholder: '请填写需求介绍',
  732. type: 'textarea',
  733. maxlength: 500,
  734. content: '',
  735. needed: true,
  736. saveKey: 'taskintroduction',
  737. }, {
  738. title: '关键字',
  739. placeholder: '请写关键字,多个请用逗号分隔',
  740. content: '',
  741. type: 'input',
  742. needed: false,
  743. saveKey: 'labelname',
  744. }, {
  745. title: '添加图片',
  746. content: '[]',
  747. type: 'upload',
  748. needed: false,
  749. imagelist: [],
  750. imageSaveList: [],
  751. imageDeleteList: [],
  752. doctype: 4911,
  753. remarkType: 'add',
  754. rowMargin: true
  755. }
  756. // ,{
  757. // title:'关键字',
  758. // placeholder:'请填写关键字,逗号隔开',
  759. // content:'',
  760. // type:'input',
  761. // needed:true,
  762. // saveKey:'',
  763. // },
  764. ];
  765. if (JSON.stringify($stateParams.data) != '{}') {
  766. // console.log($stateParams.data);
  767. $scope.formList[0].disable = true;
  768. $scope.orgid = $stateParams.data.baseInfoModel.oid;
  769. $scope.tempData.id = $stateParams.data.resid;
  770. angular.forEach($scope.formList, function (val) {
  771. if (val.type == 'upload') {
  772. val.content = JSON.stringify($stateParams.data.images);
  773. val.imagelist = $stateParams.data.images;
  774. val.imageSaveList = $stateParams.data.images;
  775. }
  776. for (var i = 0; i < $stateParams.data.infoSectionList[0].unitlist.length; i++) {
  777. var item = $stateParams.data.infoSectionList[0].unitlist[i];
  778. console.log(item.tcname);
  779. if (val.saveKey == 'companyid' && item.tcname == 'oid') {
  780. val.content = item.content;
  781. }
  782. if (val.saveKey == item.tcname) {
  783. val.content = item.content;
  784. if (val.type == 'upload') {
  785. var temp = JSON.parse(item.content);
  786. val.imagelist = temp;
  787. val.imageSaveList = temp;
  788. item.content = [];
  789. }
  790. }
  791. }
  792. console.log(val);
  793. val.saveKey == 'projectname' ? val.content = $stateParams.data.title :
  794. val.saveKey == 'capitalScale' ? val.content = Number($stateParams.data.capitalScale) :
  795. val.saveKey == 'taskintroduction' ? val.content = $stateParams.data.content :
  796. val.saveKey == 'tel' ? val.content = Number($stateParams.data.tel) :
  797. "";
  798. })
  799. }
  800. // 接单类型
  801. dataToolsService.getTypeEntryListByTypeName('usertask_show').then(function (res) {
  802. console.log(res);
  803. if (res.code == 3350) {
  804. angular.forEach(res.data, function (val) {
  805. val.class = val.itemvalue == 5310 ? 'iconfont-single-select'
  806. : val.itemvalue == 5311 ? 'iconfont-add-person' : '';
  807. val.checked = false;
  808. })
  809. $scope.taskType = res.data;
  810. $scope.taskType[0].checked = true;
  811. if ($stateParams.data.opentowho && $stateParams.data.opentowho.length > 0) {
  812. $scope.taskType[0].checked = false;
  813. $scope.taskType[1].checked = true;
  814. $scope.releaseToWhoList = $stateParams.data.opentowho;
  815. }
  816. }
  817. })
  818. // $scope.taskType=[
  819. // {name:'自主接单',checked:true,class:'iconfont-single-select',id:5310},
  820. // {name:'邀请接单',checked:false,class:'iconfont-add-person',id:5311},
  821. // ];
  822. }
  823. $scope.addressList = false;
  824. $scope.releaseToWhoList = [];
  825. var opentype = 5310;
  826. $scope.selectOpentype = function (index) {
  827. console.log(index);
  828. angular.forEach($scope.taskType, function (val) {
  829. val.checked = false;
  830. })
  831. $scope.taskType[index].checked = true;
  832. $scope.addressList = $scope.taskType[index].itemvalue == 5311;
  833. opentype = $scope.taskType[index].itemvalue;
  834. console.log(opentype);
  835. if ($scope.taskType[index].itemvalue == 5311) {
  836. $scope.taskInvite.show();
  837. }
  838. }
  839. $scope.closeAddressList = function () {
  840. $scope.addressList = false;
  841. }
  842. $scope.readCommition = function () {
  843. $scope.readCommit = !$scope.readCommit;
  844. }
  845. $scope.selectPeople = function (outerIndex, innerIndex) {
  846. $scope.mailDatas[outerIndex].userlist[innerIndex].select = !$scope.mailDatas[outerIndex].userlist[innerIndex].select;
  847. if ($scope.mailDatas[outerIndex].userlist[innerIndex].select) {
  848. $scope.releaseToWhoList.push($scope.mailDatas[outerIndex].userlist[innerIndex]);
  849. } else {
  850. for (var i = 0; i < $scope.releaseToWhoList.length; i++) {
  851. if ($scope.releaseToWhoList[i] == $scope.mailDatas[outerIndex].userlist[innerIndex].userid) {
  852. $scope.releaseToWhoList.splice(i, 1);
  853. }
  854. }
  855. }
  856. console.log($scope.releaseToWhoList);
  857. }
  858. $scope.deleteSelectedPerson = function (id, index) {
  859. for (var i = 0; i < $scope.mailDatas.length; i++) {
  860. if ($scope.mailDatas[i].userUpper == $scope.releaseToWhoList[index].userNamePinYin) {
  861. for (var j = 0; j < $scope.mailDatas[i].userlist.length; j++) {
  862. if ($scope.mailDatas[i].userlist[j].userid == id) {
  863. $scope.mailDatas[i].userlist[j].select = false;
  864. }
  865. }
  866. }
  867. }
  868. $scope.releaseToWhoList.splice(index, 1);
  869. }
  870. $scope.keyfilter = {
  871. key: ""
  872. }
  873. $scope.isShowSearchButton = true;
  874. $scope.showSearchButtonLeft = function () {
  875. // console.log('aaa');
  876. $scope.isShowSearchButton = false;
  877. $timeout(function () {
  878. $(".showSearchInput").focus();
  879. }, 300)
  880. };
  881. $scope.clearSearch = function () {
  882. $scope.isShowSearchButton = true;
  883. $scope.keyfilter.key = "";
  884. $scope.searchDatas = [];
  885. }
  886. $scope.getPersonData = function () {
  887. $scope.showLoadingToast();
  888. ScienceCircleService.searchUser($scope.keyfilter.key, 1).then(function (response) {
  889. console.log(response);
  890. $scope.searchDatas = response.data.user;
  891. // if ($scope.userList.length < 1) {
  892. // $scope.shownone = true;
  893. // } else {
  894. // $scope.shownone = false;
  895. // }
  896. if ($scope.searchDatas.length == 0) {
  897. if ($scope.app) {
  898. UtilService.showMess("未搜索到相关用户");
  899. } else {
  900. CommonService.showMessage("未搜索到相关用户", $scope);
  901. }
  902. }
  903. // toSelectUserList(response);
  904. }, function () {
  905. if ($scope.app) {
  906. UtilService.showMess("网络不给力,请重试");
  907. } else {
  908. CommonService.showMessage("网络不给力,请重试", $scope);
  909. }
  910. }).finally(function () {
  911. $scope.hideLoadingToast();
  912. });
  913. }
  914. $scope.selectSearchPeople = function (index) {
  915. $scope.releaseToWhoList.push($scope.searchDatas[index]);
  916. $scope.keyfilter.key = '';
  917. $scope.searchDatas = [];
  918. }
  919. // 模糊查询
  920. $scope.queryOrgName = function (index) {
  921. if ($scope.formList[index].fuzzyQuery) {
  922. if ($scope.formList[index].content) {
  923. var pagecode = $scope.code == 4803 ? 1000003 : 1000004;
  924. dataToolsService.getOrganizationModelByOrgname($scope.formList[index].content, pagecode, 0).then(function (response) {
  925. // console.log(response);
  926. if (response.code == 3350) {
  927. $scope.orgList = response.data;
  928. $scope.isRelateUl = true;
  929. } else {
  930. $scope.orgList = [];
  931. $scope.isRelateUl = false;
  932. }
  933. }, function () {
  934. })
  935. } else {
  936. $scope.isRelateUl = false;
  937. $scope.orgList = [];
  938. }
  939. }
  940. }
  941. $scope.ttt = function (tmptitle) {
  942. return $sce.trustAsHtml(tmptitle);
  943. }
  944. var getSaveKeyContent = function (list, key, org) {
  945. for (var i = 0; i < list.length; i++) {
  946. if (list[i].tcname == key) {
  947. list[i].content = org[key];
  948. return;
  949. }
  950. ;
  951. }
  952. }
  953. if ($scope.code == 4803 && $stateParams.companyName != '') {
  954. $scope.formList[0].content = $stateParams.companyName;
  955. $scope.queryOrgName(0);
  956. }
  957. //*************选择区域
  958. $scope.areaDropDown = [
  959. {
  960. title: '省',
  961. code: '0',
  962. showList: false,
  963. list: [],
  964. selectName: '',
  965. }, {
  966. title: '市',
  967. code: '1',
  968. showList: false,
  969. list: [],
  970. selectName: '',
  971. }, {
  972. title: '区',
  973. showList: false,
  974. code: '1',
  975. list: [],
  976. selectName: '',
  977. }
  978. ]
  979. $scope.domainDropDown = [
  980. {
  981. title: '请选择',
  982. code: '0',
  983. showList: false,
  984. list: [],
  985. selectName: '',
  986. }, {
  987. title: '请选择',
  988. code: '1',
  989. showList: false,
  990. list: [],
  991. selectName: '',
  992. }, {
  993. title: '请选择',
  994. showList: false,
  995. code: '1',
  996. list: [],
  997. selectName: '',
  998. }
  999. ]
  1000. var getAreaList = function (code, index) {
  1001. AccountService.getAreaInfo(code).then(function (res) {
  1002. if (res.code == 3350) {
  1003. // console.log(res);
  1004. // $scope.areaDropDown[index].list=res.data;
  1005. $scope.areaDropDown[index].list = [];
  1006. angular.forEach(res.data, function (val) {
  1007. $scope.areaDropDown[index].list.push({
  1008. text: '<a class="action-sheet-push">' + val.areaname + '</a>',
  1009. itemkey: val.id,
  1010. itemvalue: val.areaname //名字
  1011. })
  1012. })
  1013. } else {
  1014. }
  1015. })
  1016. }
  1017. var getDomainList = function (code, index) {
  1018. AccountService.getDomainInfo(code, $scope.node).then(function (res) {
  1019. if (res.code == 3350) {
  1020. // console.log(res);
  1021. angular.forEach(res.data, function (val) {
  1022. $scope.domainDropDown[index].list.push({
  1023. text: '<a class="action-sheet-push">' + val.name + '</a>',
  1024. itemkey: val.id,
  1025. itemvalue: val.name, //名字,
  1026. itemcode: val.code
  1027. })
  1028. })
  1029. } else {
  1030. }
  1031. })
  1032. }
  1033. //获取填写记录信息
  1034. console.log($stateParams.userid)
  1035. console.log($scope.code)
  1036. AccountService.getAuthMessageInfo(UserService.user.userid, $scope.code).then(function (val1) {
  1037. // console.log('我IC想了解', val1)
  1038. if (val1.code == 3350) {
  1039. // console.log('这是一个机会', $scope.formList);
  1040. // console.log(JSON.parse(val1.data[0].images));
  1041. // if (JSON.parse(val1.data[0].images).length) {
  1042. // angular.forEach($scope.formList, (val) => {
  1043. // if (val.type === 'upload' || val.type === "uploadcard") {
  1044. // val.imagelist = JSON.parse(val1.data[0].images);
  1045. // }
  1046. // })
  1047. // }
  1048. // angular.forEach($scope.formList, function (val) {
  1049. // if (val.type == 'affiliatedOrg') {
  1050. // var pagecode = $scope.code == 4803 ? 1000003 : 1000004;
  1051. // dataToolsService.getOrganizationModelByOrgname(' ', pagecode, 0, 1).then(function (response) {
  1052. // console.log(response);
  1053. // if (response.data.length > 0) {
  1054. // if ($stateParams.type == 5100) {
  1055. // $scope.brokernode = UserService.node;
  1056. // if (UserService.node != '330122000') {
  1057. // val.content = '普适云平台';
  1058. // val.key = '123456';
  1059. // }
  1060. // }
  1061. // val.listItem = [];
  1062. // angular.forEach(response.data, function (value) {
  1063. // val.listItem.push({
  1064. // text: '<a class="action-sheet-push">' + value.name + '</a>',
  1065. // itemkey: value.id,
  1066. // itemvalue: value.name //名字
  1067. // })
  1068. // })
  1069. // }
  1070. // }, function () {
  1071. // });
  1072. // }
  1073. // if (val.type == 'select') {
  1074. // val.listItem = [];
  1075. // dataToolsService.getTypeEntryListByTypeName(val.selectkey).then(function (res) {
  1076. // if (res.code == 3350) {
  1077. // angular.forEach(res.data, function (value) {
  1078. // val.listItem.push({
  1079. // text: '<a class="action-sheet-push">' + value.itemkey + '</a>',
  1080. // itemkey: value.itemvalue,
  1081. // itemvalue: value.itemkey //名字
  1082. // })
  1083. // })
  1084. // $timeout(function () {
  1085. // if (val.content) {
  1086. // var temp = val.listItem.filter(function (vv) {
  1087. // return vv.itemvalue == val.content;
  1088. // })
  1089. // if (temp.length > 0) {
  1090. // val.key = temp[0].itemkey;
  1091. // }
  1092. // }
  1093. // }, 1000);
  1094. // }
  1095. // })
  1096. // }
  1097. // if (val.type == 'selectArea') {
  1098. // getAreaList(0, 0);
  1099. // }
  1100. // if (val.type == 'upload') {
  1101. // var image = JSON.parse(val1.data[0].images);
  1102. // angular.forEach(image, function (res3) {
  1103. // if (val.title == res3.remark) {
  1104. // val.imagelist.push(res3.photoName);
  1105. // }
  1106. // })
  1107. // }
  1108. // if (val.type == 'uploadcard') {
  1109. // var image = JSON.parse(val1.data[0].images);
  1110. // val.imagelist = image
  1111. // val.imageSaveList = image
  1112. // }
  1113. // if (val.type == 'selectDomain') {
  1114. // // getDomainList(0,0);
  1115. // // console.log(val);
  1116. // val.listItem = [];
  1117. // AccountService.getDomainInfo(0, $scope.node).then(function (res) {
  1118. // console.log(res)
  1119. // if (res.code == 3350) {
  1120. // // console.log(res);
  1121. // angular.forEach(res.data, function (value) {
  1122. // val.listItem.push({
  1123. // text: '<a class="action-sheet-push">' + value.name + '</a>',
  1124. // itemkey: value.code,
  1125. // itemvalue: value.name, //名字,
  1126. // // itemcode:value.code
  1127. // })
  1128. // })
  1129. // $scope.checkData = val1.data[0];
  1130. // $scope.agree = ($scope.checkData && $scope.checkData.authenstatus != 5103);
  1131. // dealWithData(val1.data[0]);
  1132. // } else {
  1133. // }
  1134. // })
  1135. // }
  1136. // })
  1137. // $timeout(function () {
  1138. // console.log($scope.formList);
  1139. // }, 4000)
  1140. }
  1141. })
  1142. // 获取数据处理
  1143. var dealWithData = function (temp) {
  1144. console.log(temp);
  1145. $scope.orgid = (temp && temp.orgid) ? temp.orgid : 0;
  1146. // 处理数据
  1147. var arr = [];
  1148. $scope.refusereason = (temp && temp.refusereason) ? temp.refusereason : "";
  1149. if (temp && temp.images != '' && temp.images != null) {
  1150. arr = JSON.parse(temp.images);
  1151. }
  1152. console.log(temp);
  1153. for (var key in temp) {
  1154. for (var i = 0; i < $scope.formList.length; i++) {
  1155. if (key == $scope.formList[i].saveKey) {
  1156. // console.log(key);
  1157. $scope.formList[i].content = temp[key];
  1158. // if(key=='district'&&temp[key]!=''&&$scope.formList[i].type=='selectArea'){
  1159. // console.log(temp[key]);
  1160. // var tp=JSON.parse(temp[key]);
  1161. // var str='';
  1162. // angular.forEach(tp,function(val,index){
  1163. // str+=val.name+' ';
  1164. // })
  1165. // $scope.formList[i].content=str;
  1166. // }
  1167. if ($scope.showNew == true && key == 'district' && temp[key] != '' && $scope.formList[i].type == 'selectArea') {
  1168. var tempArry = temp[key].split('/')
  1169. // console.log(temp);
  1170. for (var j = 0; j < $scope.areaDropDown.length; j++) {
  1171. $scope.areaDropDown[j].selectName = tempArry[j];
  1172. }
  1173. }
  1174. if ($scope.formList[i].type == 'select' || $scope.formList[i].type == 'selectDomain' || $scope.formList[i].type == 'affiliatedOrg' || $scope.formList[i].type == 'companyTaskSelect') {
  1175. // console.log($scope.formList[i]);
  1176. // console.log(temp[key]);
  1177. console.log($scope.formList[i].listItem)
  1178. var tparr = $scope.formList[i].listItem.filter(function (vv) {
  1179. return vv.itemkey == temp[key];
  1180. })
  1181. console.log(tparr);
  1182. $scope.formList[i].content = tparr.length > 0 ? tparr[0].itemvalue : '';
  1183. $scope.formList[i].key = tparr.length > 0 ? tparr[0].itemkey : '';
  1184. }
  1185. if ($scope.formList[i].type == 'toggle') {
  1186. $scope.formList[i].content = temp[key] == 10501 ? '是' : '否';
  1187. $scope.formList[i].togglecontent = temp[key] == 10501 ? true : false;
  1188. }
  1189. }
  1190. if ($scope.formList[i].type == 'upload' && arr.length > 0) {
  1191. $scope.formList[i].imagelist = arr.filter(function (va, ind) {
  1192. return $scope.formList[i].doctype == va.doctype;
  1193. })
  1194. $scope.formList[i].imageSaveList = arr.filter(function (va, ind) {
  1195. return $scope.formList[i].doctype == va.doctype;
  1196. })
  1197. $scope.formList[i].content = '点击放大查看图片';
  1198. }
  1199. if ($scope.formList[i].type == 'uploadcard' && arr.length >= 0) {
  1200. $scope.formList[i].content = '点击放大查看图片';
  1201. }
  1202. // if($scope.formList[i].type=='selectArea'){
  1203. // console.log($scope.formList[i].content);
  1204. // if($scope.formList[i].content!=''){
  1205. // var tempArea=JSON.parse($scope.formList[i].content);
  1206. // var str='';
  1207. // angular.forEach(tempArea,function(val,index){
  1208. // str+=val.name+' ';
  1209. // })
  1210. // $scope.formList[i].content=str;
  1211. // }
  1212. // }
  1213. // if($scope.formList[i].type=='select'){
  1214. // var tempArr=JSON.parse(temp[key]);
  1215. //
  1216. // }
  1217. }
  1218. }
  1219. console.log($scope.formList);
  1220. };
  1221. $scope.checkData = {};
  1222. $scope.agree = true;
  1223. //判断是否从我的审核进来
  1224. // if ($scope.showHistory == true) {
  1225. // console.log($scope.action)
  1226. // if ($scope.action == 'submit') {
  1227. // // 获取认证信息
  1228. // // console.log($scope.code);
  1229. // AccountService.getAuthMessageInfo($stateParams.userid,$scope.code).then(function (res) {
  1230. // console.log(res);
  1231. // if (res.code == 3350) {
  1232. // // $scope.dataList=res.data;
  1233. // // console.log(res);
  1234. // // console.log($stateParams);
  1235. // var temp = res.data.filter(function (val, index, arr) {
  1236. // return val.id == $stateParams.id;
  1237. // })[0];
  1238. // $scope.id = temp.id;
  1239. // dealWithData(temp);
  1240. // }
  1241. // })
  1242. // } else if ($scope.action == 'check') {
  1243. // // console.log(2);
  1244. // // AccountService.getAuthCheckInfo($stateParams.pagenum, $stateParams.pagesize, '', 0, 0).then(function (res) {
  1245. // // console.log(res);
  1246. // // if (res.code == 3350) {
  1247. // // // $scope.dataList=res.data;
  1248. // // var temp = res.data.filter(function (val, index, arr) {
  1249. // // return val.id == $stateParams.id;
  1250. // // })[0];
  1251. // // console.log(temp);
  1252. // // if (temp) {
  1253. // // $scope.checkData = temp;
  1254. // // }
  1255. // // $scope.agree = ($scope.checkData && $scope.checkData.authenstatus != 5103);
  1256. // // dealWithData(temp);
  1257. // // }
  1258. // // })
  1259. // AccountService.getAuthMessageInfo($stateParams.userid,$scope.code).then(function (res) {
  1260. // console.log(res);
  1261. // if (res.code == 3350) {
  1262. // // $scope.dataList=res.data;
  1263. // // console.log(res);
  1264. // // console.log($stateParams);
  1265. // var temp = res.data.filter(function (val, index, arr) {
  1266. // return val.id == $stateParams.id;
  1267. // })[0];
  1268. // if (temp) {
  1269. // $scope.checkData = temp;
  1270. // }
  1271. // $scope.agree = ($scope.checkData && $scope.checkData.authenstatus != 5103);
  1272. // dealWithData(temp);
  1273. // }
  1274. // })
  1275. // }
  1276. // }
  1277. $scope.selectItems = function (index) {
  1278. console.log(index);
  1279. if ($scope.formList[index].type == 'select' || $scope.formList[index].type == 'selectDomain' || $scope.formList[index].type == 'affiliatedOrg' || $scope.formList[index].type == 'companyTaskSelect') {
  1280. console.log($scope.formList[index].listItem)
  1281. var list = $scope.formList[index].listItem;
  1282. $ionicActionSheet.show({
  1283. buttons: list,
  1284. cancelText: '取消',
  1285. buttonClicked: function (indx) {
  1286. if ($stateParams.comfrom == 'dockingInput') {
  1287. $stateParams.taskid = list[indx].itemkey
  1288. }
  1289. $scope.formList[index].key = list[indx].itemkey;
  1290. $scope.formList[index].content = list[indx].itemvalue;
  1291. return true;
  1292. }
  1293. })
  1294. }
  1295. }
  1296. $scope.gobackpage = function () {
  1297. $scope.goback();
  1298. /*if(UserService.isTaskFlag == 1){
  1299. $scope.go('taskHoll');
  1300. UserService.isTaskFlag = 0;
  1301. }else{
  1302. goback();
  1303. }*/
  1304. }
  1305. // 选中机构
  1306. $scope.setOrgName = function (org) {
  1307. $scope.orgid = org.id;
  1308. for (var key in org) {
  1309. for (var i = 0; i < $scope.formList.length; i++) {
  1310. if ($scope.formList[i].saveKey == key) {
  1311. $scope.formList[i].content = org[key];
  1312. if ($scope.formList[i].type == 'select' || $scope.formList[i].type == 'selectDomain' || $scope.formList[i].type == 'affiliatedOrg' || $scope.formList[i].type == 'companyTaskSelect') {
  1313. if (Array.isArray($scope.formList[i].listItem)) {
  1314. var tparr = $scope.formList[i].listItem.filter(function (vv) {
  1315. return vv.itemkey == org[key];
  1316. })
  1317. $scope.formList[i].content = tparr.length > 0 ? tparr[0].itemvalue : '';
  1318. }
  1319. }
  1320. }
  1321. if ($scope.formList[i].saveKey == 'department') {
  1322. $scope.formList[i].content = org.name;
  1323. }
  1324. }
  1325. }
  1326. // console.log($scope.formList);
  1327. $scope.isRelateUl = false;
  1328. if ($stateParams.comfrom == 'dockingInput') {
  1329. taskModuleService.searchCompanyTask(org.id, 1, 200).then(function (res) {
  1330. console.log(res);
  1331. if (res.code == 3350) {
  1332. $scope.formList[1].listItem = [];
  1333. angular.forEach(res.data, function (val) {
  1334. $scope.formList[1].listItem.push({
  1335. text: '<a class="action-sheet-push">' + val.projectname + '</a>',
  1336. itemkey: val.id,
  1337. itemvalue: val.projectname //名字
  1338. })
  1339. })
  1340. }
  1341. })
  1342. }
  1343. }
  1344. var hasArea = function () {
  1345. angular.forEach($scope.formList, function (val, index) {
  1346. if (val.type == 'selectArea') {
  1347. if (val.content != '') {
  1348. // var temp=JSON.parse(val.content);
  1349. var temp = val.content.split('/');
  1350. for (var i = 0; i < $scope.areaDropDown.length; i++) {
  1351. // $scope.areaDropDown[i].code=temp[i].code;
  1352. // $scope.areaDropDown[i].selectName=temp[i].name;
  1353. $scope.areaDropDown[i].selectName = temp[i];
  1354. // getAreaList(temp[i].code,i);
  1355. }
  1356. }
  1357. return true
  1358. }
  1359. ;
  1360. })
  1361. return false;
  1362. }
  1363. $scope.showAreaList = function (index, outerIndex, arr, key) {
  1364. // console.log(arr);
  1365. var list = arr[index].list;
  1366. $ionicActionSheet.show({
  1367. buttons: list,
  1368. cancelText: '取消',
  1369. buttonClicked: function (indx) {
  1370. // 先清除
  1371. if (index == 0) {
  1372. arr[1].selectName = '';
  1373. arr[2].selectName = '';
  1374. arr[1].code = '';
  1375. arr[2].code = '';
  1376. } else if (index == 1) {
  1377. arr[2].selectName = '';
  1378. arr[2].code = '';
  1379. }
  1380. if (index < 2) {
  1381. arr[index + 1].code = list[indx].itemkey;
  1382. if (key == 'area') {
  1383. getAreaList(list[indx].itemkey, index + 1);
  1384. } else {
  1385. getDomainList(list[indx].itemkey, index + 1);
  1386. }
  1387. }
  1388. arr[index].selectName = list[indx].itemvalue;
  1389. // var tempArr=[];
  1390. // angular.forEach(arr,function(val,index){
  1391. // tempArr.push({name:val.selectName,code:val.code});
  1392. // })
  1393. var tempArr = '';
  1394. angular.forEach(arr, function (val, index) {
  1395. tempArr += val.selectName + '/';
  1396. })
  1397. $scope.formList[outerIndex].code = list[indx].itemkey;
  1398. if (index == 0) {
  1399. $scope.formList[outerIndex].content = tempArr.slice(0, tempArr.length - 3);
  1400. } else {
  1401. $scope.formList[outerIndex].content = tempArr.slice(0, tempArr.length - 1);
  1402. }
  1403. // console.log($scope.formList[outerIndex].content);
  1404. return true;
  1405. }
  1406. })
  1407. }
  1408. $scope.setAreaListCode = function (code, name, index, outerIndex) {
  1409. // 先清除
  1410. if (index == 0) {
  1411. $scope.areaDropDown[1].selectName = '';
  1412. $scope.areaDropDown[2].selectName = '';
  1413. $scope.areaDropDown[1].code = '1';
  1414. $scope.areaDropDown[2].code = '1';
  1415. } else if (index == 1) {
  1416. $scope.areaDropDown[2].selectName = '';
  1417. $scope.areaDropDown[2].code = '1';
  1418. }
  1419. // 然后再新赋值,准备下一级别数据
  1420. $scope.areaDropDown[index].showList = false;
  1421. if (index + 1 < $scope.areaDropDown.length) {
  1422. $scope.areaDropDown[index + 1].code = code;
  1423. getAreaList(code, index + 1);
  1424. }
  1425. $scope.areaDropDown[index].selectName = name;
  1426. var tempArr = [];
  1427. angular.forEach($scope.areaDropDown, function (val, index) {
  1428. tempArr.push({ name: val.selectName, code: val.code });
  1429. })
  1430. $scope.formList[outerIndex].content = JSON.stringify(tempArr);
  1431. }
  1432. // *************有效证件
  1433. $scope.showCTList = false;
  1434. // $scope.certificateType=[
  1435. // {name:'身份证',code:1},
  1436. // {name:'军官证',code:2},
  1437. // ]
  1438. $scope.showCertificateTypeList = function (index) {
  1439. $scope.clickIndex = index;
  1440. $scope.showCTList = true;
  1441. }
  1442. $scope.setCertificateType = function (index) {
  1443. $scope.showCTList = false;
  1444. $scope.formList[$scope.clickIndex].content = $scope.formList[$scope.clickIndex].listItem[index].itemkey;
  1445. $scope.formList[$scope.clickIndex].itemvalue = $scope.formList[$scope.clickIndex].listItem[index].itemvalue;
  1446. }
  1447. // *************上传照片
  1448. // 先从数据中读取照片
  1449. angular.forEach($scope.formList, function (val, index) {
  1450. if (val.type == 'upload') {
  1451. if (val.content != '') {
  1452. var temp = JSON.parse(val.content);
  1453. val.imagelist = Object.assign([], JSON.parse(val.content));
  1454. val.imageSaveList = Object.assign([], JSON.parse(val.content));
  1455. val.content = [];
  1456. console.log(val);
  1457. }
  1458. }
  1459. ;
  1460. })
  1461. // console.log($scope.formList);
  1462. //加载动画
  1463. $scope.showLoadingToast = function () {
  1464. $ionicLoading.show({
  1465. template: '<ion-spinner icon="bubbles" class="spinner-calm"></ion-spinner>',
  1466. content: '努力加载中',
  1467. animation: 'fade-in',
  1468. showBackdrop: true,//是否显示蒙层
  1469. maxWidth: 150,
  1470. showDelay: 0
  1471. });
  1472. // $timeout(function () {
  1473. // $ionicLoading.hide();
  1474. // }, 15000);
  1475. };
  1476. //关闭加载动画
  1477. $scope.hideLoadingToast = function () {
  1478. $ionicLoading.hide();
  1479. };
  1480. var listIndex = 1000;
  1481. $scope.goToIndex = function () {
  1482. $scope.go('tab.activityIndex');
  1483. }
  1484. $scope.addImagecard = function (index) {
  1485. listIndex = index;
  1486. if ($scope.app) {
  1487. var list = [
  1488. { text: '<a class="action-sheet-push">拍照</a>' },
  1489. { text: '<a class="action-sheet-push">从相册上传</a>' },
  1490. ];
  1491. var clickfunction = function (indx) {
  1492. if (indx == 0) {
  1493. $scope.openCamera();
  1494. } else {
  1495. getPictures();
  1496. }
  1497. return true;
  1498. }
  1499. $ionicActionSheet.show({
  1500. buttons: list,
  1501. cancelText: '取消',
  1502. buttonClicked: clickfunction
  1503. })
  1504. } else {
  1505. setTimeout(function () {
  1506. var files = document.getElementById('file');
  1507. files.click();
  1508. $(files).unbind().on('change', function (e) {
  1509. if ($scope.formList[listIndex].imagelist.length + files.files.length > 3) {
  1510. if ($scope.app) {
  1511. UtilService.showMess('只能上传一张照片');
  1512. } else {
  1513. console.log("111")
  1514. $ionicPopup.alert({
  1515. title: '提示',
  1516. template: "最多只能上传三张图片"
  1517. });
  1518. }
  1519. return;
  1520. }
  1521. $.each(e.target.files, function (i, file) {
  1522. var data = new FormData();
  1523. data.append('file', file);
  1524. CommonService.webUploadImage(data).then(function (res) {
  1525. console.log('cccc', res)
  1526. files.value = ''
  1527. var temp = {
  1528. id: 0,
  1529. title: res.title,
  1530. doctype: res.doctype,//文档类型 1图片,2文件,3pdf,4xls
  1531. isenabled: 1,//是否可用:0-不可用,1-可用,2-已停用
  1532. photoName: res.photoName,
  1533. originalName: res.originalName,
  1534. sourceName: res.sourceName,
  1535. sourceSize: res.sourceSize
  1536. }
  1537. $scope.formList[listIndex].imageSaveList.push(temp);
  1538. // console.log($scope.formList[listIndex].imageSaveList)
  1539. $scope.formList[listIndex].imagelist.push(temp)
  1540. // console.log(temp);
  1541. // console.log($scope.formList[listIndex]);
  1542. })
  1543. });
  1544. })
  1545. }, 0)
  1546. }
  1547. }
  1548. $scope.addImage = function (index) {
  1549. listIndex = index;
  1550. if ($scope.app) {
  1551. var list = [
  1552. { text: '<a class="action-sheet-push">拍照</a>' },
  1553. { text: '<a class="action-sheet-push">从相册上传</a>' },
  1554. ];
  1555. var clickfunction = function (indx) {
  1556. if (indx == 0) {
  1557. $scope.openCamera();
  1558. } else {
  1559. getPictures();
  1560. }
  1561. return true;
  1562. }
  1563. } else {
  1564. var list = [
  1565. { text: '<a class="action-sheet-push">从相册上传</a>' },
  1566. ];
  1567. var clickfunction = function (indx) {
  1568. if (indx == 0) {
  1569. var files = document.getElementById('file');
  1570. files.click();
  1571. $(files).unbind().on('change', function (e) {
  1572. // console.log(e);
  1573. if ($scope.formList[listIndex].imagelist.length > 1) {
  1574. if ($scope.app) {
  1575. UtilService.showMess('只能上传一张照片');
  1576. } else {
  1577. CommonService.showMessage('只能上传一张照片', $scope);
  1578. }
  1579. return;
  1580. }
  1581. $.each(e.target.files, function (i, file) {
  1582. var url = null;
  1583. if (window.createObjectURL != undefined) { // basic
  1584. url = window.createObjectURL(file);
  1585. } else if (window.URL != undefined) { // mozilla(firefox)
  1586. url = window.URL.createObjectURL(file);
  1587. } else if (window.webkitURL != undefined) { // webkit or chrome
  1588. url = window.webkitURL.createObjectURL(file);
  1589. }
  1590. $scope.formList[listIndex].imagelist.push({ photoName: url, originalName: url });
  1591. })
  1592. $.each(e.target.files, function (i, file) {
  1593. var data = new FormData();
  1594. data.append('file', file);
  1595. CommonService.webUploadImage(data).then(function (res) {
  1596. console.log(res)
  1597. var temp = {
  1598. id: 0,
  1599. title: "",
  1600. doctype: $scope.formList[listIndex].doctype,//文档类型 1图片,2文件,3pdf,4xls
  1601. isenabled: 1,//是否可用:0-不可用,1-可用,2-已停用
  1602. photoName: res.photoName,
  1603. originalName: res.originalName,
  1604. sourceName: res.sourceName,
  1605. sourceSize: res.sourceSize
  1606. }
  1607. $scope.formList[listIndex].imageSaveList.push(temp);
  1608. // console.log(temp);
  1609. // console.log($scope.formList[listIndex]);
  1610. })
  1611. });
  1612. })
  1613. }
  1614. return true;
  1615. }
  1616. }
  1617. $ionicActionSheet.show({
  1618. buttons: list,
  1619. cancelText: '取消',
  1620. buttonClicked: clickfunction
  1621. })
  1622. }
  1623. $scope.openCamera = function () {
  1624. if ($scope.formList[listIndex].imagelist.length >= 9) {
  1625. if ($scope.app) {
  1626. UtilService.showMess("最多选取9张图片");
  1627. } else {
  1628. CommonService.showMessage("最多选取9张图片", $scope)
  1629. }
  1630. return;
  1631. }
  1632. UtilService.getPicture(1).then(function (results) {
  1633. $scope.showLoadingToast();
  1634. $scope.formList[listIndex].imagelist.push({ photoName: results, originalName: results })
  1635. UtilService.uploadFile([results], 0, "image/jpeg").then(function (response) {
  1636. angular.forEach(response, function (value) {
  1637. $scope.formList[listIndex].imageSaveList.push({
  1638. id: 0,
  1639. title: "",
  1640. doctype: $scope.formList[listIndex].doctype,//文档类型 1图片,2文件,3pdf,4xls
  1641. isenabled: 1,//是否可用:0-不可用,1-可用,2-已停用
  1642. photoName: value.photoName,
  1643. originalName: value.originalName,
  1644. sourceName: value.sourceName,
  1645. sourceSize: value.sourceSize
  1646. })
  1647. })
  1648. $scope.hideLoadingToast();
  1649. }, function () {
  1650. $scope.hideLoadingToast();
  1651. if ($scope.app) {
  1652. UtilService.showMess("网络不给力,请重试");
  1653. } else {
  1654. CommonService.showMessage("网络不给力,请重试", $scope)
  1655. }
  1656. });
  1657. $ionicScrollDelegate.$getByHandle("scrollimage").resize();
  1658. }, function (err) {
  1659. });
  1660. }
  1661. var getPictures = function () {
  1662. if (device.platform == "Android") {
  1663. verifyStorage();
  1664. } else {
  1665. getPic();
  1666. }
  1667. };
  1668. var verifyStorage = function () {
  1669. window.imagePicker.verifyStorage(
  1670. function (results) {
  1671. if (results == "1") {
  1672. getPic();
  1673. }
  1674. }, function (error) {
  1675. }
  1676. );
  1677. };
  1678. var getPic = function () {
  1679. var imagelistLength = $scope.formList[listIndex].imagelist.length;
  1680. if (imagelistLength >= 9) {
  1681. if ($scope.app) {
  1682. UtilService.showMess("最多选取9张图片");
  1683. } else {
  1684. CommonService.showMessage("最多选取9张图片", $scope)
  1685. }
  1686. return;
  1687. }
  1688. UtilService.getPictureList(9 - imagelistLength).then(function (results) {
  1689. $scope.showLoadingToast();
  1690. angular.forEach(results, function (val, i) {
  1691. $scope.formList[listIndex].imagelist.push({ photoName: val, originalName: val });
  1692. })
  1693. UtilService.uploadFile(results, 0, "image/jpeg").then(function (response) {
  1694. angular.forEach(response, function (value) {
  1695. if (value.status) {
  1696. $scope.formList[listIndex].imageSaveList.push({
  1697. id: 0,
  1698. title: "",
  1699. doctype: $scope.formList[listIndex].doctype,//文档类型 1图片,2文件,3pdf,4xls
  1700. isenabled: 1,//是否可用:0-不可用,1-可用,2-已停用
  1701. photoName: value.photoName,
  1702. originalName: value.originalName,
  1703. sourceName: value.sourceName,
  1704. sourceSize: value.sourceSize
  1705. });
  1706. }
  1707. })
  1708. $scope.hideLoadingToast();
  1709. }, function () {
  1710. $scope.hideLoadingToast();
  1711. if ($scope.app) {
  1712. UtilService.showMess("网络不给力,请重试");
  1713. } else {
  1714. CommonService.showMessage("网络不给力,请重试", $scope)
  1715. }
  1716. });
  1717. $ionicScrollDelegate.$getByHandle("scrollimage").resize();
  1718. }, function (err) {
  1719. });
  1720. };
  1721. //删除图片
  1722. $scope.deletePhoto = function (index, outerIndex) {
  1723. if ($scope.formList[outerIndex].imageSaveList[index].id != 0) {
  1724. $scope.formList[outerIndex].imageSaveList[index].isenabled = 2;
  1725. $scope.formList[outerIndex].imageDeleteList.push($scope.formList[outerIndex].imageSaveList[index]);
  1726. }
  1727. $scope.formList[outerIndex].imagelist.splice(index, 1);
  1728. $scope.formList[outerIndex].imageSaveList.splice(index, 1);
  1729. // console.log($scope.formList[outerIndex].imagelist);
  1730. // console.log($scope.formList[outerIndex].imageSaveList);
  1731. // console.log($scope.formList[outerIndex].imageDeleteList);
  1732. }
  1733. $scope.uploadPic = function (e) {
  1734. // console.log(2);
  1735. // console.log(e.target);
  1736. }
  1737. // **************切换开关
  1738. $scope.watchIsChange = function (index) {
  1739. $scope.formList[index].content = $scope.formList[index].togglecontent ? "10501" : "10502";
  1740. }
  1741. // **************提交按钮
  1742. $scope.checkNotice = function () {
  1743. $scope.isChecked = !$scope.isChecked;
  1744. }
  1745. // 处理审核
  1746. console.log($scope.showHistory)
  1747. console.log($scope.formList)
  1748. $scope.reSubmit = function () {
  1749. $scope.showNew = true;
  1750. $scope.showHistory = false;
  1751. $scope.tempData = {};
  1752. $scope.tempData.id = $scope.id;
  1753. console.log($scope.formList);
  1754. console.log($scope.showHistory)
  1755. angular.forEach($scope.formList, function (val) {
  1756. if (val.type == 'upload') {
  1757. val.imageSaveList = Object.assign([], val.imagelist);
  1758. }
  1759. if (val.type == 'selectArea' && val.content != '') {
  1760. var temp = val.content.split('/')
  1761. // console.log(temp);
  1762. for (var i = 0; i < $scope.areaDropDown.length; i++) {
  1763. $scope.areaDropDown[i].selectName = temp[i];
  1764. }
  1765. }
  1766. })
  1767. }
  1768. if ($stateParams.comfrom == 'resubmit') {
  1769. $scope.id = $stateParams.id;
  1770. $scope.reSubmit();
  1771. }
  1772. var dealWidthData = function () {
  1773. console.log($scope.formList);
  1774. var tempImages = [];
  1775. angular.forEach($scope.formList, function (val, index) {
  1776. if (val.type == 'upload' || val.type == 'uploadcard') {
  1777. // 处理照片
  1778. // if(val.imagelist.length>0){
  1779. // val.imageSaveList=Object.assign([],val.imagelist);
  1780. // }
  1781. val.content = '';
  1782. var temp = Object.assign([], val.imageSaveList);
  1783. angular.forEach(val.imageSaveList, function (v) {
  1784. tempImages.push(v);
  1785. })
  1786. if (val.imageDeleteList.length > 0) {
  1787. angular.forEach(val.imageDeleteList, function (value) {
  1788. tempImages.push(value);
  1789. temp.push(value)
  1790. })
  1791. }
  1792. val.content = JSON.stringify(temp);
  1793. } else if (val.type == 'select' || val.type == 'selectDomain' || val.type == 'affiliatedOrg' || val.type == 'companyTaskSelect') {
  1794. $scope.tempData[val.saveKey] = val.key;
  1795. } else if (val.type == 'selectArea') {
  1796. $scope.tempData[val.saveKey] = val.content;
  1797. $scope.tempData.regionsid = val.code;
  1798. } else if (val.type == 'toggle') {
  1799. if (val.content == '是' || val.content == '否') {
  1800. val.content = val.content == '是' ? 10502 : 10501;
  1801. }
  1802. $scope.tempData[val.saveKey] = val.content;
  1803. } else {
  1804. $scope.tempData[val.saveKey] = val.content;
  1805. }
  1806. })
  1807. console.log('这是处理的照片', tempImages);
  1808. $scope.tempData.images = JSON.stringify(tempImages);
  1809. }
  1810. // 发布任务
  1811. // 获取connid
  1812. var getConnid = function () {
  1813. var def = $q.defer();
  1814. $scope.requestModel = {
  1815. data: {
  1816. orgtype: 10104,
  1817. templettype: 4,
  1818. title: $scope.formList[0].content,
  1819. organizationInfo: {
  1820. orgtype: 10104,
  1821. name: $scope.formList[0].content,
  1822. id: $scope.orgid ? $scope.orgid : 0
  1823. },
  1824. userModel: {
  1825. userid: UserService.id
  1826. }
  1827. },
  1828. node: UserService.node,
  1829. userid: UserService.id
  1830. }
  1831. console.log($scope.requestModel);
  1832. dataToolsService.saveOrganizationInfo($scope.requestModel).then(function (response) {
  1833. console.log(response);
  1834. if (response.code == 3350) {
  1835. def.resolve(response.data);
  1836. } else {
  1837. def.reject('错误');
  1838. }
  1839. })
  1840. return def.promise;
  1841. }
  1842. var submitTaskAction = false;
  1843. $scope.submitTask = function () {
  1844. if (submitTaskAction) {
  1845. return;
  1846. }
  1847. submitTaskAction = true;
  1848. $scope.tempData = $scope.tempData ? $scope.tempData : {};
  1849. for (var i = 0; i < $scope.formList.length; i++) {
  1850. var val = $scope.formList[i];
  1851. if (val.remarkType == 'manage' && $scope.formList[i - 1].type == 'toggle' && ($scope.formList[i - 1].content == '10502' || $scope.formList[i - 1].content == '否')) {
  1852. continue;
  1853. }
  1854. // if(!$scope.orgid){
  1855. // if($scope.app){
  1856. // UtilService.showMess('所属企业请输入关键字,从列表中选择');
  1857. // }else{
  1858. // CommonService.showMessage('所属企业请输入关键字,从列表中选择',$scope);
  1859. // }
  1860. // submitTaskAction=false;
  1861. // return;
  1862. // }
  1863. if (val.needed && (val.content === '' || (val.type == 'upload' && val.imagelist.length == 0))) {
  1864. if (val.type == 'upload') {
  1865. if ($scope.app) {
  1866. UtilService.showMess('请上传' + val.title);
  1867. } else {
  1868. CommonService.showMessage('请上传' + val.title, $scope);
  1869. }
  1870. } else if (val.type == 'select' || val.type == 'affiliatedOrg' || val.type == 'selectArea' || val.type == 'selectDomain' || val.type == 'companyTaskSelect') {
  1871. if ($scope.app) {
  1872. UtilService.showMess('请选择' + val.title);
  1873. } else {
  1874. CommonService.showMessage('请选择' + val.title, $scope);
  1875. }
  1876. } else {
  1877. if ($scope.app) {
  1878. UtilService.showMess('请填写' + val.title);
  1879. } else {
  1880. CommonService.showMessage('请填写' + val.title, $scope);
  1881. }
  1882. }
  1883. submitTaskAction = false;
  1884. return;
  1885. }
  1886. }
  1887. if (opentype == 5311 && $scope.releaseToWhoList.length == 0) {
  1888. if ($scope.app) {
  1889. UtilService.showMess('请至少选择一位邀请接单人员!');
  1890. } else {
  1891. CommonService.showMessage('请至少选择一位邀请接单人员!', $scope);
  1892. }
  1893. submitTaskAction = false;
  1894. return;
  1895. }
  1896. dealWidthData();
  1897. $scope.tempData.opentype = opentype;
  1898. $scope.tempData.creator = UserService.id;
  1899. // console.log($scope.tempData);
  1900. var array = [];
  1901. angular.forEach($scope.releaseToWhoList, function (val) {
  1902. array.push(val.userid);
  1903. })
  1904. $scope.tempData.opentowho = array.join(',');
  1905. $scope.showLoadingToast();
  1906. getConnid().then(function (data) {
  1907. console.log(data);
  1908. $scope.tempData.connid = data.id;
  1909. $scope.tempData.orgid = data.organizationInfo.id;
  1910. $scope.tempData.companyid = data.organizationInfo.id;
  1911. console.log($scope.tempData);
  1912. $scope.tempData.images = $scope.tempData.images == '[]' ? '' : $scope.tempData.images;
  1913. var senddata = {
  1914. data: $scope.tempData,
  1915. node: UserService.node
  1916. }
  1917. if (senddata.capitalScale == NaN || senddata.capitalScale == null || senddata.capitalScale == undefined) {
  1918. senddata.capitalScale = 0;
  1919. }
  1920. if (senddata.tel == -1 || senddata.tel == null || senddata.tel == undefined) {
  1921. senddata.tel = "";
  1922. }
  1923. console.log(senddata);
  1924. taskModuleService.releaseOrEditTask(senddata).then(function (res) {
  1925. console.log(res);
  1926. if (res.code == 3350) {
  1927. if (JSON.stringify($stateParams.data) != '{}') {
  1928. $scope.go('taskDetail', {
  1929. actions: "5322,5325",
  1930. comefrom: "taskHoll",
  1931. node: UserService.node,
  1932. opentowho: JSON.stringify($scope.releaseToWhoList),
  1933. opentype: res.data.opentype,
  1934. resid: $stateParams.data.resid,
  1935. restype: 1,
  1936. taskid: res.data.id,
  1937. taskstatus: 5300,
  1938. title: $stateParams.data.title
  1939. })
  1940. } else {
  1941. $scope.goback();
  1942. }
  1943. }
  1944. $scope.hideLoadingToast();
  1945. })
  1946. })
  1947. }
  1948. // 保存对接信息
  1949. // 获取connid
  1950. var getDockingConnid = function () {
  1951. var def = $q.defer();
  1952. $scope.requestModel = {
  1953. data: {
  1954. templettype: 16,
  1955. title: $scope.formList[0].content,
  1956. organizationInfo: {
  1957. name: $scope.formList[0].content,
  1958. id: $scope.orgid ? $scope.orgid : 0
  1959. },
  1960. userModel: {
  1961. userid: UserService.id
  1962. }
  1963. },
  1964. node: UserService.node,
  1965. userid: UserService.id
  1966. }
  1967. console.log($scope.requestModel);
  1968. dataToolsService.saveOrganizationInfo($scope.requestModel).then(function (response) {
  1969. console.log(response);
  1970. if (response.code == 3350) {
  1971. def.resolve(response.data);
  1972. } else {
  1973. def.reject('错误');
  1974. }
  1975. })
  1976. return def.promise;
  1977. }
  1978. var submitTaskDocking = false;
  1979. $scope.submitTaskDocking = function () {
  1980. if (submitTaskDocking) {
  1981. return;
  1982. }
  1983. submitTaskDocking = true;
  1984. $scope.tempData = $scope.tempData ? $scope.tempData : {};
  1985. for (var i = 0; i < $scope.formList.length; i++) {
  1986. var val = $scope.formList[i];
  1987. if (val.remarkType == 'manage' && $scope.formList[i - 1].type == 'toggle' && ($scope.formList[i - 1].content == '10502' || $scope.formList[i - 1].content == '否')) {
  1988. continue;
  1989. }
  1990. if (val.needed && (val.content === '' || (val.type == 'upload' && val.imagelist.length == 0))) {
  1991. if (val.type == 'upload') {
  1992. if ($scope.app) {
  1993. UtilService.showMess('请上传' + val.title);
  1994. } else {
  1995. CommonService.showMessage('请上传' + val.title, $scope);
  1996. }
  1997. } else if (val.type == 'select' || val.type == 'affiliatedOrg' || val.type == 'selectArea' || val.type == 'selectDomain' || val.type == 'companyTaskSelect') {
  1998. if ($scope.app) {
  1999. UtilService.showMess('请选择' + val.title);
  2000. } else {
  2001. CommonService.showMessage('请选择' + val.title, $scope);
  2002. }
  2003. } else {
  2004. if ($scope.app) {
  2005. UtilService.showMess('请填写' + val.title);
  2006. } else {
  2007. CommonService.showMessage('请填写' + val.title, $scope);
  2008. }
  2009. }
  2010. submitTaskDocking = false;
  2011. return;
  2012. }
  2013. }
  2014. dealWidthData();
  2015. $scope.tempData.companyid = $scope.orgid;
  2016. $scope.tempData.action = 5322;
  2017. $scope.tempData.creator = UserService.id;
  2018. // var senddata={
  2019. // data:$scope.tempData,
  2020. // node:UserService.node
  2021. // }
  2022. $scope.showLoadingToast();
  2023. getDockingConnid().then(function (data) {
  2024. console.log(data);
  2025. $scope.tempData.connid = data.id;
  2026. $scope.tempData.orgid = data.organizationInfo.id;
  2027. $scope.tempData.companyid = data.organizationInfo.id;
  2028. $scope.tempData.taskid = $stateParams.taskid;
  2029. var senddata = {
  2030. data: $scope.tempData,
  2031. node: UserService.node
  2032. }
  2033. console.log(senddata);
  2034. taskModuleService.saveOrupdatetaskDocking(senddata).then(function (res) {
  2035. console.log(res);
  2036. if (res.code == 3350) {
  2037. $scope.goback();
  2038. }
  2039. $scope.hideLoadingToast();
  2040. })
  2041. })
  2042. }
  2043. var submitFormAction = false;
  2044. $scope.submitForm = function () {
  2045. // if(!$scope.isChecked){
  2046. // return;
  2047. // }
  2048. console.log('【******】', $scope.formList)
  2049. // if (submitFormAction) {
  2050. // return;
  2051. // }
  2052. submitFormAction = true;
  2053. // 先处理数据 判断非空
  2054. $scope.tempData = $scope.tempData ? $scope.tempData : {};
  2055. /*if (!$scope.readCommit) {
  2056. if ($scope.app) {
  2057. UtilService.showMess('您尚未接受《技术经纪人认证承诺书》!');
  2058. } else {
  2059. CommonService.showMessage('您尚未接受《技术经纪人认证承诺书》!', $scope);
  2060. }
  2061. submitFormAction = false;
  2062. return;
  2063. }*/
  2064. for (var i = 0; i < $scope.formList.length; i++) {
  2065. var val = $scope.formList[i];
  2066. if (val.remarkType == 'manage' && $scope.formList[i - 1].type == 'toggle' && ($scope.formList[i - 1].content == '10502' || $scope.formList[i - 1].content == '否')) {
  2067. continue;
  2068. }
  2069. if (val.type == 'upload' || val.type == 'uploadcard') {
  2070. if (val.needed && val.imagelist.length == 0) {
  2071. if ($scope.app) {
  2072. UtilService.showMess('请上传证书');
  2073. } else {
  2074. CommonService.showMessage('请上传证书', $scope);
  2075. }
  2076. submitFormAction = false;
  2077. return;
  2078. }
  2079. } else {
  2080. if (val.needed && (val.content == null || val.content == '' || val.content == 0)) {
  2081. if (val.type !== 'upload' && val.type !== 'uploadcard') {
  2082. if ($scope.app) {
  2083. if (val.title == "单位") {
  2084. UtilService.showMess('请填写工作单位');
  2085. } else {
  2086. UtilService.showMess(val.placeholder);
  2087. }
  2088. } else {
  2089. if (val.title == "单位") {
  2090. CommonService.showMessage('请填写工作单位', $scope);
  2091. } else {
  2092. CommonService.showMessage(val.placeholder, $scope);
  2093. }
  2094. }
  2095. }
  2096. submitFormAction = false;
  2097. return;
  2098. }
  2099. }
  2100. }
  2101. dealWidthData();
  2102. console.log($scope.tempData);
  2103. $scope.tempData.applytype = $scope.code;
  2104. $scope.tempData.creator = UserService.id;
  2105. $scope.tempData.authenstatus = 5101;
  2106. $scope.tempData.userid = UserService.id;
  2107. $scope.tempData.usercomefrom = UserService.node;
  2108. $scope.tempData.orgid = $scope.orgid;
  2109. console.log($scope.tempData);
  2110. $scope.showLoadingToast();
  2111. AccountService.submitAuthMessageInfo($scope.tempData).then(function (res) {
  2112. console.log(res.code);
  2113. $scope.hideLoadingToast();
  2114. if (res.code == 3351) {
  2115. if ($scope.app) {
  2116. UtilService.showMess(res.message);
  2117. } else {
  2118. CommonService.showMessage(res.message, $scope);
  2119. }
  2120. return;
  2121. }
  2122. if (res.code == 3350) {
  2123. $scope.go('identifyStatus', {
  2124. action: "submit",
  2125. code: $scope.tempData.applytype,
  2126. companyName: '',
  2127. id: res.data.id,
  2128. pageTitle: $stateParams.pageTitle,
  2129. pagenum: 1,
  2130. pagesize: 15,
  2131. type: $scope.tempData.authenstatus,
  2132. comfrom: $stateParams.url ? $stateParams.url : $stateParams.comfrom,
  2133. })
  2134. }
  2135. })
  2136. }
  2137. $scope.agreeClick = function () {
  2138. if ($scope.node == '330122000') {
  2139. $scope.agree = 1;
  2140. } else {
  2141. $scope.agree = true;
  2142. }
  2143. }
  2144. $scope.rollClick = function () {
  2145. $scope.agree = -2;
  2146. }
  2147. $scope.rejectClick = function () {
  2148. if ($scope.node == '330122000') {
  2149. $scope.agree = -1;
  2150. } else {
  2151. $scope.agree = false;
  2152. }
  2153. }
  2154. $scope.goToMyCommit = function () {
  2155. $scope.go('commitment', { formlist: $scope.formList });
  2156. }
  2157. var submitCheckAction = false;
  2158. $scope.submitCheck = function () {
  2159. // console.log('id', UserService.id);
  2160. /*if (submitCheckAction) {
  2161. return;
  2162. }*/
  2163. submitCheckAction = true;
  2164. $scope.checkData = { ...$scope.identifyFormList, ...$scope.checkData }; // $scope.identifyFormList 必须在前,否则会覆盖原有数据
  2165. console.log('id', $scope.checkData, $scope.node);
  2166. if ($scope.node == '330122000') {
  2167. $scope.checkData.authenstatus = ($scope.agree == 1 ? 5102 : ($scope.agree == -1 ? 5103 : 5104));
  2168. $scope.checkData.refusereason = ($scope.agree == 1 ? '' : $scope.checkData.refusereason);
  2169. } else {
  2170. $scope.checkData.authenstatus = $scope.agree ? 5102 : 5103;
  2171. $scope.checkData.refusereason = $scope.agree ? '' : $scope.checkData.refusereason;
  2172. }
  2173. $scope.checkData.authorityid = UserService.id;
  2174. console.log('eeeeee', $scope.checkData);
  2175. if ($scope.checkData.authenstatus == 5103 || $scope.checkData.authenstatus == 5104) {
  2176. if ($scope.checkData.refusereason == "" || $scope.checkData.refusereason == null) {
  2177. if ($scope.app) {
  2178. if ($scope.checkData.authenstatus == 5103) {
  2179. UtilService.showMess("请填写拒绝理由");
  2180. }
  2181. if ($scope.checkData.authenstatus == 5104) {
  2182. UtilService.showMess("请填写退回理由");
  2183. }
  2184. } else {
  2185. if ($scope.checkData.authenstatus == 5103) {
  2186. CommonService.showMessage("请填写拒绝理由", $scope);
  2187. }
  2188. if ($scope.checkData.authenstatus == 5104) {
  2189. CommonService.showMessage("请填写退回理由", $scope);
  2190. }
  2191. }
  2192. return;
  2193. }
  2194. }
  2195. $scope.showLoadingToast();
  2196. console.log('canshu', $scope.checkData, $scope.identifyFormList);
  2197. AccountService.submitAuthCheckInfo($scope.checkData).then(function (res) {
  2198. $scope.hideLoadingToast();
  2199. // console.log(res);
  2200. if (res.code == 3350) {
  2201. $state.go('identifyDetail', { pageTitle: '认证审核', code: $scope.code, action: 'check' });
  2202. }
  2203. })
  2204. }
  2205. //点击图片放大
  2206. $scope.bigImage = false; //初始默认大图是隐藏的
  2207. $scope.hideBigImage = function () {
  2208. $timeout(function () {
  2209. $scope.bigImage = false;
  2210. }, 400);
  2211. };
  2212. $scope.shouBigImage = function (index, outerIndex) { //传递一个参数(图片的URl)
  2213. // console.log('aaa');
  2214. $(function () {
  2215. $('div.pinch-zoom').each(function () {
  2216. new RTP.PinchZoom($(this), {});
  2217. });
  2218. });
  2219. $scope.imagelist = $scope.formList[outerIndex].imagelist;
  2220. $scope.bigImage = true;//显示大图
  2221. $ionicSlideBoxDelegate.update();//重绘,让图片显示出来
  2222. //图片总数量
  2223. setTimeout(function () {
  2224. $ionicSlideBoxDelegate.$getByHandle('slide_detail').slide(index, -10);
  2225. //获取图片
  2226. var imgObj = document.getElementsByClassName('bigimage');
  2227. var n;
  2228. for (n = 0; n < imgObj.length; n++) {
  2229. // 获取图片的原始高度和宽度
  2230. var oldWid = imgObj[n].naturalWidth;
  2231. var oldHei = imgObj[n].naturalHeight;
  2232. var screen = document.body.offsetWidth;
  2233. var screenH = window.innerHeight;
  2234. // console.log(oldWid / oldHei);
  2235. // console.log(screen);
  2236. var rate = oldWid / oldHei;
  2237. if (oldWid >= screen && oldHei >= screenH) {
  2238. var tw = screen;
  2239. var th = tw / rate;
  2240. if (th < screenH) {
  2241. imgObj[n].style.width = tw + 'px';
  2242. imgObj[n].style.height = th + 'px';
  2243. imgObj[n].style.marginTop = (screenH - th) / 2 + 'px';
  2244. } else {
  2245. imgObj[n].style.width = screenH * rate + 'px';
  2246. imgObj[n].style.height = screenH + 'px';
  2247. imgObj[n].style.marginLeft = (screen - screenH * rate) / 2 + 'px';
  2248. }
  2249. } else if (oldWid >= screen && oldHei <= screenH) {
  2250. imgObj[n].style.width = screen + 'px';
  2251. imgObj[n].style.height = screen / rate + 'px';
  2252. imgObj[n].style.marginTop = (screenH - screen / rate) / 2 + 'px';
  2253. } else if (oldWid <= screen && oldHei >= screenH) {
  2254. // var hh=screenH;
  2255. // var ww=screenH*rate;
  2256. imgObj[n].style.width = screenH * rate + 'px';
  2257. imgObj[n].style.height = screenH + 'px';
  2258. imgObj[n].style.marginLeft = (screen - screenH * rate) / 2 + 'px';
  2259. } else {
  2260. imgObj[n].style.width = oldWid + 'px';
  2261. imgObj[n].style.height = oldHei + 'px';
  2262. imgObj[n].style.marginLeft = (screen - oldWid) / 2 + 'px';
  2263. imgObj[n].style.marginTop = (screenH - oldHei) / 2 + 'px';
  2264. }
  2265. }
  2266. }, 500);
  2267. };
  2268. window.addEventListener("resize", function () {
  2269. var domWidth = window.document.documentElement.getBoundingClientRect().width;
  2270. if (domWidth > 540) {
  2271. $scope.viewscreen = 'browser';
  2272. } else {
  2273. $scope.viewscreen = 'app';
  2274. }
  2275. })
  2276. // 任务邀请页面
  2277. var taskInviteModal = function () {
  2278. $ionicModal.fromTemplateUrl('./modules/common/views/taskInviteModal.html', {
  2279. scope: $scope,
  2280. animation: 'slide-in-left'
  2281. }).then(function (modal) {
  2282. $scope.taskInvite = modal;
  2283. });
  2284. }
  2285. taskInviteModal();
  2286. // 选择热门标签
  2287. $scope.selectLable = function (index, label) {
  2288. $scope.formList[index].content = label;
  2289. }
  2290. console.log($scope.formList)
  2291. // angular.forEach($scope.formList, function (val) {
  2292. // if (val.title == '涉及领域') {
  2293. // console.log(val)
  2294. // ResourceLibraryService.getCategoryByCode(val.content).then(function (res) {
  2295. // if (res.code == 3350) {
  2296. // val.content = res.data.name;
  2297. // }
  2298. // })
  2299. // }
  2300. // })
  2301. })