signDemandContractCtrl.js 97 KB

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