techDemandCheckAgainCtrl.js 98 KB

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