identifyFormForTongLuCtrl.js 79 KB

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