identifyFormCtrl.js 87 KB

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