1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881 |
- /**
- * Created by pushkeji on 2018/8/16.
- */
- 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) {
- // console.log($stateParams);
- // 弹出任务邀请框
- $scope.tempData = {};
- $scope.userIsBroker = $stateParams.userIsBroker;
- $scope.tasktitle = $stateParams.tasktitle;
- $scope.node = UserService.node;
- if ($scope.node == '330122000') {
- $scope.agree = 1;
- } else {
- $scope.agree = true;
- }
- if (UserService.user.data == null || UserService.user.data == undefined || UserService.user.data == "") {
- $scope.mobile = UserService.user.mobile;
- } else {
- $scope.mobile = UserService.user.data.mobile;
- }
- $scope.index = 0;
- $scope.downloadaffix = function () {
- window.open(ConfigService.imgurl + '/group3/M00/0B/1A/wKgBd14S2FCAII_KAABG7YwbFYc43.docx')
- }
- $scope.downloadlink = ConfigService.imgurl
- var permissionvalue = "1";
- $scope.labelList = [{
- itemvalue: 0,
- itemkey: '全部',
- isSelected: true
- }, {
- itemvalue: 6,
- itemkey: '服务机构认证',
- isSelected: false
- }];
- $scope.taskTypeList = [
- {
- name: '公开',
- isSelected: $stateParams.data ? ($stateParams.data.baseInfoModel ? ($stateParams.data.baseInfoModel.permission1 ? $stateParams.data.baseInfoModel.permission1 : true) : true) : true,
- value: 1
- },
- {
- name: '仅管理员可见',
- isSelected: $stateParams.data ? ($stateParams.data.baseInfoModel ? ($stateParams.data.baseInfoModel.permission4 ? $stateParams.data.baseInfoModel.permission4 : false) : false) : false,
- value: 4
- },
- {
- name: '部分公开',
- isSelected: false,
- value: 5
- }
- ];
- $scope.sonTaskTypeList = [{
- name: '技术经纪人可见',
- isSelected: $stateParams.data ? ($stateParams.data.baseInfoModel ? ($stateParams.data.baseInfoModel.permission2 ? $stateParams.data.baseInfoModel.permission2 : false) : false) : false,
- value: 2
- }, {
- name: '高校院所专家可见',
- isSelected: $stateParams.data ? ($stateParams.data.baseInfoModel ? ($stateParams.data.baseInfoModel.permission3 ? $stateParams.data.baseInfoModel.permission3 : false) : false) : false,
- value: 3
- }];
- $scope.url = 'http://pic.ubittc.com/group2/M00/03/B7/wKjIKluVD3OAfkH4AAA74dltjKY89.docx';
- $scope.alertInfo = function () {
- // CommonService.showMessage('请在电脑端下载打印',$scope)
- if ($scope.app) {
- $ionicPopup.alert({
- title: '提示',
- template: '《企业认证申请公函》请在电脑端下载打印,并加盖企业公章后上传。电脑端web网址:ubittc.com'
- });
- }
- }
- if ($scope.app) {
- $scope.url = '';
- // $scope.alertInfo()
- }
- if ($stateParams.pageTitle) {
- $scope.pageTitle = $stateParams.pageTitle;
- } else {
- $scope.pageTitle = sessionStorage.indentifyDetailTitle;
- }
- if ($stateParams.code) {
- $scope.code = $stateParams.code;
- } else {
- $scope.code = sessionStorage.indentifyDetailCode;
- }
- $scope.action = $stateParams.action;
- $scope.type = $stateParams.type;
- // console.log($stateParams);
- // console.log($scope.pageTitle,$scope.code,$scope.action);
- // if($stateParams.type=){
- // $scope.type=$stateParams.type;
- // }else{
- // $scope.type=sessionStorage.type;
- // }
- $scope.orgid = null;
- $scope.showNew = false;
- $scope.showHistory = false;
- $scope.showFinish = false;
- $scope.showReject = false;
- $scope.refusereason = '';
- if ($stateParams.type == 5100) {
- $scope.showNew = true;
- } else if ($stateParams.type == 5101 || $stateParams.type == 0 || $scope.action == 'check' || $stateParams.type == 5102 || $stateParams.type == 5103) {
- $scope.showHistory = true;
- if ($stateParams.type == 5102 || $stateParams.type == 5103) {
- $scope.showFinish = true;
- }
- if ($stateParams.type == 5103) {
- $scope.showReject = true;
- }
- }
- $scope.personalNotices = [
- {
- image: '1',
- title: '注意事项',
- item: [
- '1.每个证件只能绑定一个账号',
- '2.证件照不清晰或与输入的信息不匹配,将导致实名认证被驳回',
- '3.您提供的证件信息将受到严格保护,仅用于身份验证,未经本人许可不会用于其他用途'
- ]
- }, {
- image: '2',
- title: '证件要求',
- item: [
- '1.需上传本人二代身份证背面照+身份证反面照(不需手持)',
- '2.证件必须在有效期内,有效期需在一个月以上',
- ]
- }, {
- image: '2',
- title: '照片要求',
- item: [
- '1.证件照上信息需完整且清晰可辩(无反光、遮挡、水印、证件套、logo等)',
- '2.申请人填写的“真实姓名”和“证件号码”需和提交证件照片信息一致',
- '3.证件必须真实拍摄,不能使用复印件',
- '4.确保照片完整(不缺边角),证件周围不允许加上边角框(如:加上红框等)'
- ]
- },
- ];
- var personal = [
- {
- title: '真实姓名',
- placeholder: '请填写真实姓名',
- content: '',
- type: 'input',
- needed: true,
- saveKey: 'applyname',
- }, {
- title: '证件类型',
- placeholder: '请选择证件类型',
- // type:'certificateType',
- content: '',
- key: '',
- saveKey: 'idtype',
- type: 'select',
- selectkey: 'id_type',
- needed: true,
- }, {
- title: '证件号码',
- placeholder: '请填写证件号码',
- type: 'input',
- content: '',
- needed: true,
- saveKey: 'cardno',
- }, {
- title: '证件正面照',
- content: '[]',
- type: 'upload',
- needed: true,
- imagelist: [],
- imageSaveList: [],
- imageDeleteList: [],
- doctype: 4906,
- remarkType: 'identify',
- }, {
- title: '证件背面照',
- content: '[]',
- type: 'upload',
- needed: true,
- imagelist: [],
- imageSaveList: [],
- imageDeleteList: [],
- doctype: 4907,
- remarkType: 'identify',
- },
- ];
- var tecBroker = [
- {
- title: '挂靠机构',
- placeholder: '请填写挂靠机构',
- content: '',
- type: 'affiliatedOrg',
- needed: true,
- saveKey: 'attachedorg',
- }, {
- title: '姓名',
- placeholder: '请填写姓名',
- fuzzyQuery: false,
- content: '',
- type: 'input',
- needed: true,
- saveKey: 'applyname',
- }, {
- title: '证书号',
- placeholder: '请填写技术经纪人证书号',
- content: '',
- type: 'input',
- needed: true,
- saveKey: 'brokercertificate',
- }, {
- title: '联系方式',
- placeholder: '请填写联系方式',
- content: $scope.mobile,
- type: 'input',
- needed: true,
- saveKey: 'tel',
- }, {
- title: '所属机构',
- placeholder: '请填写所属机构',
- fuzzyQuery: true,
- content: '',
- type: 'input',
- needed: true,
- saveKey: 'department',
- }, {
- title: '研究领域',
- content: '',
- key: '',
- type: 'selectDomain',
- needed: true,
- saveKey: 'categoryid',
- }, {
- title: '所在地区',
- content: '',
- type: 'selectArea',
- needed: false,
- saveKey: 'district',
- code: ''
- }, {
- title: '学位',
- placeholder: '请选择学位',
- content: '',
- selectkey: 'academicdegree',
- type: 'select',
- needed: false,
- saveKey: 'degree',
- }, {
- title: '职称',
- placeholder: '请选择职称',
- content: '',
- type: 'select',
- needed: false,
- saveKey: 'positionaltitles',
- selectkey: 'positionaltitles',
- }, {
- title: '所获荣誉',
- placeholder: '请填写所获荣誉',
- content: '',
- type: 'input',
- needed: false,
- saveKey: 'honor',
- }, {
- title: '上传证书',
- content: '[]',
- type: 'upload',
- needed: true,
- imagelist: [],
- imageSaveList: [],
- imageDeleteList: [],
- doctype: 4910,
- remarkType: 'normal',
- }, {
- title: '补充文件',
- content: '[]',
- type: 'upload',
- needed: false,
- imagelist: [],
- imageSaveList: [],
- imageDeleteList: [],
- doctype: 4900,
- remarkType: 'add'
- },
- ];
- if (false) {
- var enterprise = [
- {
- title: '企业全称',
- placeholder: '请填写企业全称',
- fuzzyQuery: true,
- content: '',
- type: 'input',
- needed: true,
- saveKey: 'applyname',
- }, {
- title: '统一社会信用代码',
- placeholder: '请填写统一社会信用代码',
- content: '',
- type: 'input',
- needed: true,
- saveKey: 'orgcode',
- }, {
- title: '所属行业',
- placeholder: '请选择所属行业',
- content: '',
- key: '',
- type: 'selectDomain',
- needed: false,
- saveKey: 'categoryid',
- }, {
- title: '所在地区',
- content: '',
- type: 'selectArea',
- needed: false,
- saveKey: 'district',
- code: ''
- }, {
- title: '企业详细地址',
- placeholder: '请填写企业详细地址',
- content: '',
- type: 'input',
- needed: false,
- saveKey: 'detailaddress',
- }, {
- title: '企业法人',
- placeholder: '请填写企业法人',
- content: '',
- type: 'input',
- needed: false,
- saveKey: 'legalperson',
- }, {
- title: '职务',
- placeholder: '请填写职务',
- content: '',
- type: 'input',
- needed: true,
- saveKey: 'title',
- }, {
- title: '工作证明',
- content: '[]',
- type: 'upload',
- needed: true,
- imagelist: [],
- imageSaveList: [],
- imageDeleteList: [],
- doctype: 4903,
- remarkType: 'normal',
- }, {
- title: '是否认领机构管理员',
- type: 'toggle',
- content: '10502',
- togglecontent: false,
- saveKey: 'ifleader'
- }, {
- title: '机构管理运营确认函',
- content: '[]',
- type: 'upload',
- needed: true,
- imagelist: [],
- imageSaveList: [],
- imageDeleteList: [],
- doctype: 4908,
- remarkType: 'manage'
- }, {
- title: '补充文件',
- content: '[]',
- type: 'upload',
- needed: false,
- imagelist: [],
- imageSaveList: [],
- imageDeleteList: [],
- doctype: 4900,
- remarkType: 'add'
- },
- ];
- } else {
- var enterprise = [
- {
- title: '企业全称',
- placeholder: '请填写企业全称',
- fuzzyQuery: true,
- content: '',
- type: 'input',
- needed: true,
- saveKey: 'applyname',
- }, {
- title: '统一社会信用代码',
- placeholder: '请填写统一社会信用代码',
- content: '',
- type: 'input',
- needed: true,
- saveKey: 'orgcode',
- }, {
- title: '企业法人',
- placeholder: '请填写企业法人',
- content: '',
- type: 'input',
- needed: true,
- saveKey: 'legalperson',
- }, {
- title: '所属行业',
- placeholder: '请选择所属行业',
- content: '',
- key: '',
- type: 'selectDomain',
- needed: true,
- saveKey: 'categoryid',
- }, {
- title: '企业类型',
- placeholder: '请选择企业类型',
- content: '',
- key: '',
- type: 'selectorgtype',
- needed: false,
- saveKey: 'orgtype',
- }, {
- title: '企业规模',
- placeholder: '请选择企业规模',
- content: '',
- key: '',
- type: 'selectorgscale',
- needed: true,
- saveKey: 'orgscale',
- }, {
- title: '所在地区',
- content: '',
- type: 'selectArea',
- needed: true,
- saveKey: 'district',
- code: ''
- }, {
- title: '详细地址',
- placeholder: '请填写企业详细地址',
- content: '',
- type: 'input',
- needed: true,
- saveKey: 'detailaddress',
- }, {
- title: '联系人',
- placeholder: '请填写联系人',
- content: '',
- type: 'input',
- needed: true,
- saveKey: 'linkmanname',
- }, {
- title: '联系人身份证',
- placeholder: '请填写联系人身份证',
- content: '',
- type: 'input',
- needed: true,
- saveKey: 'linkmancardno',
- }, {
- title: '联系人手机',
- placeholder: '请填写联系人手机',
- content: '',
- type: 'input',
- needed: true,
- saveKey: 'tel',
- }, {
- title: '联系人电子邮箱',
- placeholder: '请填写联系人电子邮箱',
- content: '',
- type: 'input',
- needed: false,
- saveKey: 'linkmanmail',
- }, {
- title: '企业网址',
- placeholder: '请填写企业网址',
- content: '',
- type: 'input',
- needed: false,
- saveKey: 'orgwebsite',
- }, {
- title: '营业执照',
- content: '[]',
- type: 'upload',
- needed: true,
- imagelist: [],
- imageSaveList: [],
- imageDeleteList: [],
- doctype: 4903,
- remarkType: 'normal',
- }, {
- title: '补充文件',
- content: '[]',
- type: 'upload',
- needed: false,
- imagelist: [],
- imageSaveList: [],
- imageDeleteList: [],
- doctype: 4908,
- remarkType: 'add'
- }, {
- title: '是否认领机构管理员',
- type: 'toggle',
- content: '10502',
- togglecontent: false,
- saveKey: 'ifleader'
- }, {
- title: '上传机构管理员确认函',
- content: '[]',
- type: 'upload',
- needed: false,
- imagelist: [],
- imageSaveList: [],
- imageDeleteList: [],
- doctype: 4908,
- remarkType: 'manage'
- }
- ];
- }
- var college = [
- {
- title: '高校全称',
- placeholder: '请填写高校全称',
- fuzzyQuery: true,
- content: '',
- type: 'input',
- needed: true,
- saveKey: 'applyname',
- }, {
- title: '职务',
- placeholder: '请填写职务',
- content: '',
- type: 'input',
- needed: true,
- saveKey: 'title',
- }, {
- title: '所在地区',
- content: '',
- type: 'selectArea',
- needed: false,
- saveKey: 'district',
- code: ''
- }, {
- title: '所属领域',
- content: '',
- key: '',
- type: 'selectDomain',
- needed: true,
- saveKey: 'categoryid',
- }, {
- title: '工作证明',
- content: '[]',
- type: 'upload',
- needed: true,
- imagelist: [],
- imageSaveList: [],
- imageDeleteList: [],
- doctype: 4903,
- remarkType: 'normal',
- }, {
- title: '是否认领机构管理员',
- type: 'toggle',
- content: '10502',
- togglecontent: false,
- saveKey: 'ifleader'
- }, {
- title: '机构管理运营确认函',
- content: '[]',
- type: 'upload',
- needed: true,
- imagelist: [],
- imageSaveList: [],
- imageDeleteList: [],
- doctype: 4908,
- remarkType: 'manage'
- }, {
- title: '补充文件',
- content: '[]',
- type: 'upload',
- needed: false,
- imagelist: [],
- imageSaveList: [],
- imageDeleteList: [],
- doctype: 4900,
- remarkType: 'add'
- },
- ];
- var government = [
- {
- title: '政府全称',
- placeholder: '请填写政府全称',
- fuzzyQuery: true,
- content: '',
- type: 'input',
- needed: true,
- saveKey: 'applyname',
- }, {
- title: '职务',
- placeholder: '请填写职务',
- content: '',
- type: 'input',
- needed: true,
- saveKey: 'title',
- }, {
- title: '所在地区',
- content: '',
- type: 'selectArea',
- needed: false,
- saveKey: 'district',
- code: ''
- }, {
- title: '所在部门',
- placeholder: '请填写所在部门',
- content: '',
- type: 'input',
- needed: false,
- saveKey: 'department',
- }, {
- title: '工作证明',
- content: '[]',
- type: 'upload',
- needed: true,
- imagelist: [],
- imageSaveList: [],
- imageDeleteList: [],
- doctype: 4903,
- remarkType: 'normal',
- }, {
- title: '是否认领机构管理员',
- type: 'toggle',
- content: '10502',
- togglecontent: false,
- saveKey: 'ifleader'
- }, {
- title: '机构管理运营确认函',
- content: '[]',
- type: 'upload',
- needed: true,
- imagelist: [],
- imageSaveList: [],
- imageDeleteList: [],
- doctype: 4908,
- remarkType: 'manage'
- }, {
- title: '补充文件',
- content: '[]',
- type: 'upload',
- needed: false,
- imagelist: [],
- imageSaveList: [],
- imageDeleteList: [],
- doctype: 4900,
- remarkType: 'add'
- },
- ];
- var serviceorg = [
- {
- title: '服务机构全称',
- placeholder: '请填写服务机构全称',
- fuzzyQuery: true,
- content: '',
- type: 'input',
- needed: true,
- saveKey: 'applyname',
- }, {
- title: '统一社会信用代码',
- placeholder: '请填写统一社会信用代码',
- content: '',
- type: 'input',
- needed: true,
- saveKey: 'orgcode',
- }, {
- // title:'服务类型',
- // content:'',
- // type:'input',
- // needed:true,
- // saveKey:'categoryid',
- // dictionarytype:30050,
- // dictionary:0
- // },{
- title: '所在地区',
- content: '',
- type: 'selectArea',
- needed: false,
- saveKey: 'district',
- code: ''
- }, {
- title: '机构详细地址',
- placeholder: '请填写机构详细地址',
- content: '',
- type: 'input',
- needed: false,
- saveKey: 'detailaddress',
- }, {
- title: '企业法人',
- placeholder: '请填写企业法人',
- content: '',
- type: 'input',
- needed: false,
- saveKey: 'legalperson',
- }, {
- title: '职务',
- placeholder: '请填写职务',
- content: '',
- type: 'input',
- needed: true,
- saveKey: 'title',
- }, {
- title: '工作证明',
- content: '[]',
- type: 'upload',
- needed: true,
- imagelist: [],
- imageSaveList: [],
- imageDeleteList: [],
- doctype: 4903,
- remarkType: 'normal',
- }, {
- title: '是否认领机构管理员',
- type: 'toggle',
- content: '10502',
- togglecontent: false,
- saveKey: 'ifleader'
- }, {
- title: '机构管理运营确认函',
- content: '[]',
- type: 'upload',
- needed: true,
- imagelist: [],
- imageSaveList: [],
- imageDeleteList: [],
- doctype: 4908,
- remarkType: 'manage'
- }, {
- title: '补充文件',
- content: '[]',
- type: 'upload',
- needed: false,
- imagelist: [],
- imageSaveList: [],
- imageDeleteList: [],
- doctype: 4900,
- remarkType: 'add'
- },
- ];
- switch ($scope.code) {
- case 4800:
- $scope.formList = personal;
- break;
- case 4803:
- $scope.formList = enterprise;
- break;
- case 4801:
- $scope.formList = tecBroker;
- break;
- case 4804:
- $scope.formList = college;
- break;
- case 4805:
- $scope.formList = government;
- break;
- case 4806:
- $scope.formList = serviceorg;
- break;
- }
- // 对接录入
- if ($stateParams.comfrom == 'dockingInput') {
- if (UserService.node == '330122000') {
- if (!$scope.app) {
- $scope.formList = [
- {
- title: '企业',
- placeholder: '请填写企业全称',
- fuzzyQuery: true,
- content: '',
- type: 'input',
- needed: false,
- saveKey: 'companyid',
- rowMargin: true
- }, {
- title: '需求名称',
- placeholder: '请选择对接需求名称',
- content: null,
- selectkey: '',
- type: 'companyTaskSelect',
- needed: true,
- saveKey: 'taskid',
- key: null,
- list: []
- }, {
- title: '对接时间',
- placeholder: 'yyyy-mm-dd',
- content: null,
- selectkey: '',
- timeContent: '00:00',
- type: 'date',
- needed: true,
- saveKey: 'jointtime',
- key: null,
- list: []
- }, {
- title: '状态',
- placeholder: '请填写状态',
- content: '',
- type: 'input',
- needed: true,
- saveKey: 'title',
- recommend: '热门状态',
- recommendLable: ['洽谈', '签约', '合作中', '完成']
- }, {
- title: '内容',
- placeholder: '请填写对接内容',
- type: 'textarea',
- maxlength: 500,
- content: '',
- needed: true,
- saveKey: 'content',
- }, {
- title: '照片',
- content: '[]',
- type: 'upload',
- needed: true,
- imagelist: [],
- imageSaveList: [],
- imageDeleteList: [],
- doctype: 4900,
- remarkType: 'add',
- rowMargin: true
- }
- ]
- } else {
- $scope.formList = [
- {
- title: '企业',
- placeholder: '请填写企业全称',
- fuzzyQuery: true,
- content: '',
- type: 'input',
- needed: false,
- saveKey: 'companyid',
- saveKey: 'companyid',
- rowMargin: true
- }, {
- title: '需求名称',
- placeholder: '请选择对接需求名称',
- content: null,
- selectkey: '',
- type: 'companyTaskSelect',
- needed: true,
- saveKey: 'taskid',
- key: null,
- list: []
- }, {
- title: '状态',
- placeholder: '请填写状态',
- content: '',
- type: 'input',
- needed: true,
- saveKey: 'title',
- recommend: '热门状态',
- recommendLable: ['洽谈', '签约', '合作中', '完成']
- }, {
- title: '内容',
- placeholder: '请填写对接内容',
- type: 'textarea',
- maxlength: 500,
- content: '',
- needed: true,
- saveKey: 'content',
- }, {
- title: '照片',
- content: '[]',
- type: 'upload',
- needed: true,
- imagelist: [],
- imageSaveList: [],
- imageDeleteList: [],
- doctype: 4900,
- remarkType: 'add',
- rowMargin: true
- }
- ]
- }
- } else {
- $scope.formList = [
- {
- title: '企业',
- placeholder: '请填写企业全称',
- fuzzyQuery: true,
- content: '',
- type: 'input',
- needed: false,
- saveKey: 'companyid',
- rowMargin: true
- }, {
- title: '需求',
- placeholder: '请选择对接需求',
- content: null,
- selectkey: '',
- type: 'companyTaskSelect',
- needed: true,
- saveKey: 'taskid',
- key: null,
- list: []
- }, {
- title: '对接时间',
- placeholder: 'yyyy-mm-dd',
- content: null,
- selectkey: '',
- timeContent: '00:00',
- type: 'date',
- needed: true,
- saveKey: 'jointtime',
- key: null,
- list: []
- }, {
- title: '状态',
- placeholder: '请填写状态',
- content: '',
- type: 'input',
- needed: true,
- saveKey: 'title',
- recommend: '热门状态',
- recommendLable: ['洽谈', '签约', '合作中', '完成']
- }, {
- title: '内容',
- placeholder: '请填写对接内容',
- type: 'textarea',
- maxlength: 500,
- content: '',
- needed: true,
- saveKey: 'content',
- }, {
- title: '上传照片',
- content: '[]',
- type: 'upload',
- needed: false,
- imagelist: [],
- imageSaveList: [],
- imageDeleteList: [],
- doctype: 4900,
- remarkType: 'add',
- rowMargin: true
- }
- ]
- }
- for (var i = 0; i < $scope.formList.length; i++) {
- if ($scope.formList[i].saveKey == 'taskid') {
- $scope.formList[i].content = $stateParams.taskTitle;
- $scope.tempData.resourceid = $stateParams.taskid;
- }
- if ($scope.formList[i].saveKey == 'companyid') {
- $scope.formList[i].content = $stateParams.companyName;
- }
- }
- taskModuleService.searchCompanyTask($stateParams.companyid, 1, 200).then(function (res) {
- // console.log(res);
- if (res.code == 3350) {
- $scope.formList[1].listItem = [];
- angular.forEach(res.data, function (val) {
- $scope.formList[1].listItem.push({
- text: '<a class="action-sheet-push">' + val.projectname + '</a>',
- itemkey: val.id,
- itemvalue: val.projectname //名字
- })
- })
- }
- })
- }
- if ($stateParams.comfrom == 'taskRelease') {
- if (UserService.node != '330122000') {
- $scope.formList = [
- {
- title: '所属企业',
- placeholder: '请填写企业全称',
- fuzzyQuery: true,
- content: '',
- type: 'input',
- needed: true,
- saveKey: 'companyid',
- rowMargin: true
- }, {
- title: '需求名称',
- placeholder: '请填写需求名称',
- content: '',
- type: 'input',
- needed: true,
- saveKey: 'projectname',
- }, {
- title: '投入预算(w)',
- placeholder: '请填写预算',
- content: 0,
- type: 'input',
- needed: false,
- saveKey: 'capitalScale',
- inputType: 'number',
- }, {
- title: '联系人',
- placeholder: '请填写联系人',
- content: '',
- type: 'input',
- needed: false,
- saveKey: 'contactor',
- }, {
- title: '联系电话',
- placeholder: '请填联系电话',
- content: '',
- type: 'input',
- needed: false,
- saveKey: 'tel',
- inputType: 'number',
- }, {
- title: '合作模式',
- placeholder: '请选择合作模式',
- content: '',
- selectkey: 'cooperationmodel',
- type: 'select',
- needed: false,
- saveKey: 'cooperationmodel',
- key: ''
- }, {
- title: '需求类型',
- placeholder: '请选择需求类型',
- content: '',
- selectkey: 'usertask_type',
- type: 'select',
- needed: true,
- saveKey: 'tasktype',
- key: '',
- }, {
- title: '需求介绍',
- placeholder: '请填写需求介绍',
- type: 'textarea',
- maxlength: 500,
- content: '',
- needed: true,
- saveKey: 'taskintroduction',
- }, {
- title: '关键字',
- placeholder: '请请写关键字,多个请用逗号分隔',
- content: '',
- type: 'input',
- needed: false,
- saveKey: 'labelname',
- }, {
- title: '添加图片',
- content: '[]',
- type: 'upload',
- needed: false,
- imagelist: [],
- imageSaveList: [],
- imageDeleteList: [],
- doctype: 4911,
- remarkType: 'add',
- rowMargin: true
- }
- // ,{
- // title:'关键字',
- // placeholder:'请填写关键字,逗号隔开',
- // content:'',
- // type:'input',
- // needed:true,
- // saveKey:'',
- // },
- ];
- }
- if (UserService.node == '330122000') {
- //判断当前用户是否是技术经纪人
- if ($scope.userIsBroker) {
- //技术经纪人
- $scope.formList = [
- {
- title: '技术需求单位',
- placeholder: '请填写技术需求单位全称',
- fuzzyQuery: true,
- content: '',
- type: 'input',
- needed: true,
- saveKey: 'companyid',
- rowMargin: true
- }, {
- title: '需求名称',
- placeholder: '请填写需求名称',
- content: '',
- type: 'input',
- needed: true,
- saveKey: 'projectname',
- }, {
- title: '投入预算(w)',
- placeholder: '请填写预算',
- content: 0,
- type: 'input',
- needed: false,
- saveKey: 'capitalScale',
- inputType: 'number',
- }, {
- title: '合作类型',
- placeholder: '请选择合作类型',
- content: '',
- selectkey: 'cooperationmodel',
- type: 'select',
- needed: false,
- saveKey: 'cooperationmodel',
- key: ''
- }, {
- title: '需求介绍',
- placeholder: '请填写需求介绍',
- type: 'textarea',
- maxlength: 500,
- content: '',
- needed: true,
- saveKey: 'taskintroduction',
- }, {
- title: '企业认可证明',
- content: '[]',
- type: 'upload',
- needed: true,
- imagelist: [],
- imageSaveList: [],
- imageDeleteList: [],
- doctype: 4911,
- remarkType: 'add',
- rowMargin: true
- }, {
- title: '关键字',
- placeholder: '请请写关键字,多个请用逗号分隔',
- content: '',
- type: 'input',
- needed: false,
- saveKey: 'labelname',
- }
- // ,{
- // title:'关键字',
- // placeholder:'请填写关键字,逗号隔开',
- // content:'',
- // type:'input',
- // needed:true,
- // saveKey:'',
- // },
- ];
- } else {
- //不是技术经纪人
- $scope.formList = [
- {
- title: '技术需求单位',
- placeholder: '请填写技术需求单位全称',
- fuzzyQuery: true,
- content: '',
- type: 'input',
- needed: true,
- saveKey: 'companyid',
- rowMargin: true
- }, {
- title: '需求名称',
- placeholder: '请填写需求名称',
- content: '',
- type: 'input',
- needed: true,
- saveKey: 'projectname',
- }, {
- title: '投入预算(w)',
- placeholder: '请填写预算',
- content: 0,
- type: 'input',
- needed: false,
- saveKey: 'capitalScale',
- inputType: 'number',
- }, {
- title: '联系人',
- placeholder: '请填写联系人',
- content: '',
- type: 'input',
- needed: true,
- saveKey: 'contactor',
- }, {
- title: '联系电话',
- placeholder: '请填联系电话',
- content: '',
- type: 'input',
- needed: true,
- saveKey: 'tel',
- inputType: 'number',
- }, {
- title: '合作类型',
- placeholder: '请选择合作类型',
- content: '',
- selectkey: 'cooperationmodel',
- type: 'select',
- needed: false,
- saveKey: 'cooperationmodel',
- key: ''
- }, {
- title: '需求介绍',
- placeholder: '请填写需求介绍',
- type: 'textarea',
- maxlength: 500,
- content: '',
- needed: true,
- saveKey: 'taskintroduction',
- }, {
- title: '企业认可证明',
- content: '[]',
- type: 'upload',
- needed: true,
- imagelist: [],
- imageSaveList: [],
- imageDeleteList: [],
- doctype: 4911,
- remarkType: 'add',
- rowMargin: true
- }, {
- title: '关键字',
- placeholder: '请请写关键字,多个请用逗号分隔',
- content: '',
- type: 'input',
- needed: false,
- saveKey: 'labelname',
- }
- // ,{
- // title:'关键字',
- // placeholder:'请填写关键字,逗号隔开',
- // content:'',
- // type:'input',
- // needed:true,
- // saveKey:'',
- // },
- ];
- }
- }
- if (JSON.stringify($stateParams.data) != '{}') {
- // console.log($stateParams.data);
- $scope.formList[0].disable = true;
- $scope.orgid = $stateParams.data.baseInfoModel.oid;
- $scope.tempData.id = $stateParams.data.resid;
- angular.forEach($scope.formList, function (val) {
- if (val.type == 'upload' && $scope.node != "330122000") {
- val.content = JSON.stringify($stateParams.data.images);
- val.imagelist = $stateParams.data.images;
- val.imageSaveList = $stateParams.data.images;
- }
- if (val.type == 'upload' && $scope.node == "330122000") {
- val.content = JSON.stringify($stateParams.data.photolist);
- val.imagelist == $stateParams.data.photolist;
- val.imageSaveList == $stateParams.data.photolist;
- }
- for (var i = 0; i < $stateParams.data.infoSectionList[0].unitlist.length; i++) {
- var item = $stateParams.data.infoSectionList[0].unitlist[i];
- // console.log(item.tcname);
- if (val.saveKey == 'companyid' && item.tcname == 'oid') {
- val.content = item.content;
- }
- if (val.saveKey == item.tcname && val.saveKey != null && val.saveKey != undefined) {
- val.content = item.content;
- if (val.type == 'upload') {
- var temp = JSON.parse(item.content);//将一个 JSON 字符串转换为对象
- val.imagelist = temp;
- val.imageSaveList = temp;
- item.content = [];
- }
- }
- }
- // console.log(val);
- val.saveKey == 'projectname' ? val.content = $stateParams.data.title :
- val.saveKey == 'capitalScale' ? val.content = Number($stateParams.data.capitalScale) :
- val.saveKey == 'taskintroduction' ? val.content = $stateParams.data.content :
- val.saveKey == 'tel' ? val.content = Number($stateParams.data.tel) :
- "";
- })
- if ($stateParams.data.baseInfoModel.permission1) {
- angular.forEach($scope.taskTypeList, function (val, index) {
- val.isSelected = false;
- })
- angular.forEach($scope.sonTaskTypeList, function (val, index) {
- val.isSelected = false;
- })
- $scope.taskTypeList[0].isSelected = true;
- }
- if ($stateParams.data.baseInfoModel.permission2) {
- angular.forEach($scope.taskTypeList, function (val, index) {
- val.isSelected = false;
- })
- $scope.sonTaskTypeList[0].isSelected = true;
- $scope.taskTypeList[2].isSelected = true;
- }
- if ($stateParams.data.baseInfoModel.permission3) {
- angular.forEach($scope.taskTypeList, function (val, index) {
- val.isSelected = false;
- })
- $scope.sonTaskTypeList[1].isSelected = true;
- $scope.taskTypeList[2].isSelected = true;
- }
- if ($stateParams.data.baseInfoModel.permission4) {
- angular.forEach($scope.taskTypeList, function (val, index) {
- val.isSelected = false;
- })
- angular.forEach($scope.sonTaskTypeList, function (val, index) {
- val.isSelected = false;
- })
- $scope.taskTypeList[1].isSelected = true;
- }
- }
- // 接单类型
- dataToolsService.getTypeEntryListByTypeName('usertask_show').then(function (res) {
- console.log(res);
- if (res.code == 3350) {
- angular.forEach(res.data, function (val) {
- val.class = val.itemvalue == 5310 ? 'iconfont-single-select'
- : val.itemvalue == 5311 ? 'iconfont-add-person' : '';
- val.checked = false;
- })
- $scope.taskType = res.data;
- $scope.taskType[0].checked = true;
- if ($stateParams.data.opentowho && $stateParams.data.opentowho.length > 0) {
- $scope.taskType[0].checked = false;
- $scope.taskType[1].checked = true;
- $scope.releaseToWhoList = $stateParams.data.opentowho;
- }
- }
- })
- // $scope.taskType=[
- // {name:'自主接单',checked:true,class:'iconfont-single-select',id:5310},
- // {name:'邀请接单',checked:false,class:'iconfont-add-person',id:5311},
- // ];
- }
- $scope.addressList = false;
- $scope.releaseToWhoList = [];
- var opentype = 5310;
- $scope.selectOpentype = function (index) {
- // console.log(index);
- angular.forEach($scope.taskType, function (val) {
- val.checked = false;
- })
- $scope.taskType[index].checked = true;
- $scope.addressList = $scope.taskType[index].itemvalue == 5311;
- opentype = $scope.taskType[index].itemvalue;
- console.log(opentype);
- if ($scope.taskType[index].itemvalue == 5311) {
- $scope.taskInvite.show();
- }
- }
- $scope.selectOpentypeTonglu = function (index) {
- console.log(index);
- $scope.index = index;
- angular.forEach($scope.taskTypeList, function (val) {
- val.isSelected = false;
- })
- $scope.taskTypeList[index].isSelected = true;
- permissionvalue = "";
- angular.forEach($scope.taskTypeList, function (val) {
- if (val.isSelected) {
- permissionvalue = permissionvalue + "," + val.value;
- }
- })
- if ($scope.taskTypeList[2].isSelected) {
- permissionvalue = 5;
- angular.forEach($scope.sonTaskTypeList, function (val) {
- if (val.isSelected) {
- permissionvalue = permissionvalue + "," + val.value;
- }
- })
- }
- }
- $scope.selectSonOpentypeTonglu = function (index) {
- angular.forEach($scope.taskTypeList, function (val) {
- val.isSelected = false;
- })
- $scope.taskTypeList[2].isSelected = true;
- $scope.sonTaskTypeList[index].isSelected = !$scope.sonTaskTypeList[index].isSelected;
- permissionvalue = "";
- angular.forEach($scope.sonTaskTypeList, function (val) {
- if (val.isSelected) {
- permissionvalue = permissionvalue + "," + val.value;
- }
- })
- }
- // 日期选择
- $scope.validedTime = new Date();
- var datePickerObj = {
- //选择日期后的回掉
- callback: function (val) {
- if (typeof (val) === 'undefined') {
- } else {
- // var d = new Date(val);
- // console.log($filter('date')(new Date(val),'yyyy-MM-dd'))
- // console.log(val,new Date(),new Date().getTime(),new Date().toJSON())
- // console.log(new Date(val).toJSON().substr(0, 19).replace('T', ' ').replace(/-/g, '-'))
- var temp = new Date(val).toLocaleString().replace(/\//g, "-");
- // var temp = new Date(val).toLocaleString().split(' ')[0].replace(/\//g, "-");
- angular.forEach($scope.formList, function (value, index) {
- if (value.type == "date") {
- value.content = temp;
- }
- })
- datePickerObj.inputDate = new Date(val); //更新日期弹框上的日期
- }
- },
- disabledDates: [
- new Date(2016, 2, 16),
- new Date(2015, 3, 16),
- new Date(2015, 4, 16),
- new Date(2015, 5, 16),
- new Date('Wednesday, August 12, 2015'),
- new Date("2016-08-16"),
- new Date(1439676000000)
- ],
- from: new Date(1970, 1, 1),
- to: new Date(2050, 10, 30),
- inputDate: new Date(),
- mondayFirst: true,
- disableWeekdays: [], //设置不能选中
- closeOnSelect: false,
- dateFormat: 'yyyy-MM-dd',
- templateType: 'popup',
- };
- //打开日期选择框
- $scope.openDatePicker = function (type, Index) {
- $scope.timeIndex = Index;
- $scope.type = type;
- if (type == 'date') {
- ionicDatePicker.openDatePicker(datePickerObj);
- }
- };
- var getContacts = function () {
- ScienceCircleService.getContacts(0).then(function (res) {
- console.log(res);
- angular.forEach(res, function (val) {
- angular.forEach(val.userlist, function (value) {
- value.select = false;
- })
- });
- $scope.mailDatas = res;
- })
- }
- getContacts();
- $scope.closeAddressList = function () {
- $scope.addressList = false;
- }
- $scope.selectPeople = function (outerIndex, innerIndex) {
- $scope.mailDatas[outerIndex].userlist[innerIndex].select = !$scope.mailDatas[outerIndex].userlist[innerIndex].select;
- if ($scope.mailDatas[outerIndex].userlist[innerIndex].select) {
- $scope.releaseToWhoList.push($scope.mailDatas[outerIndex].userlist[innerIndex]);
- } else {
- for (var i = 0; i < $scope.releaseToWhoList.length; i++) {
- if ($scope.releaseToWhoList[i] == $scope.mailDatas[outerIndex].userlist[innerIndex].userid) {
- $scope.releaseToWhoList.splice(i, 1);
- }
- }
- }
- console.log($scope.releaseToWhoList);
- }
- $scope.deleteSelectedPerson = function (id, index) {
- for (var i = 0; i < $scope.mailDatas.length; i++) {
- if ($scope.mailDatas[i].userUpper == $scope.releaseToWhoList[index].userNamePinYin) {
- for (var j = 0; j < $scope.mailDatas[i].userlist.length; j++) {
- if ($scope.mailDatas[i].userlist[j].userid == id) {
- $scope.mailDatas[i].userlist[j].select = false;
- }
- }
- }
- }
- $scope.releaseToWhoList.splice(index, 1);
- }
- $scope.keyfilter = {
- key: ""
- }
- $scope.isShowSearchButton = true;
- $scope.showSearchButtonLeft = function () {
- // console.log('aaa');
- $scope.isShowSearchButton = false;
- $timeout(function () {
- $(".showSearchInput").focus();
- }, 300)
- };
- $scope.clearSearch = function () {
- $scope.isShowSearchButton = true;
- $scope.keyfilter.key = "";
- $scope.searchDatas = [];
- }
- $scope.getPersonData = function () {
- console.log(1)
- $scope.showLoadingToast();
- ScienceCircleService.searchUser($scope.keyfilter.key, 1).then(function (response) {
- console.log(response);
- $scope.searchDatas = response.data.user;
- // if ($scope.userList.length < 1) {
- // $scope.shownone = true;
- // } else {
- // $scope.shownone = false;
- // }
- if ($scope.searchDatas.length == 0) {
- if ($scope.app) {
- UtilService.showMess("未搜索到相关用户");
- } else {
- CommonService.showMessage("未搜索到相关用户", $scope);
- }
- }
- // toSelectUserList(response);
- }, function () {
- if ($scope.app) {
- UtilService.showMess("网络不给力,请重试");
- } else {
- CommonService.showMessage("网络不给力,请重试", $scope);
- }
- }).finally(function () {
- $scope.hideLoadingToast();
- });
- }
- $scope.selectSearchPeople = function (index) {
- $scope.releaseToWhoList.push($scope.searchDatas[index]);
- $scope.keyfilter.key = '';
- $scope.searchDatas = [];
- }
- // 模糊查询
- $scope.queryOrgName = function (index) {
- if ($scope.formList[index].fuzzyQuery) {
- if ($scope.formList[index].content) {
- var pagecode = $scope.code == 4803 ? 1000003 : 1000004;
- dataToolsService.getOrganizationModelByOrgname($scope.formList[index].content, pagecode, 0, 0).then(function (response) {
- // console.log(response);
- if (response.code == 3350) {
- $scope.orgList = response.data;
- $scope.isRelateUl = true;
- } else {
- $scope.orgList = [];
- $scope.isRelateUl = false;
- }
- }, function () {
- })
- } else {
- $scope.isRelateUl = false;
- $scope.orgList = [];
- }
- }
- }
- $scope.ttt = function (tmptitle) {
- return $sce.trustAsHtml(tmptitle);
- }
- var getSaveKeyContent = function (list, key, org) {
- for (var i = 0; i < list.length; i++) {
- if (list[i].tcname == key) {
- list[i].content = org[key];
- return;
- }
- ;
- }
- }
- if ($scope.code == 4803 && $stateParams.companyName != '') {
- $scope.formList[0].content = $stateParams.companyName;
- $scope.queryOrgName(0);
- }
- //*************选择区域
- $scope.areaDropDown = [
- {
- title: '省',
- code: '0',
- showList: false,
- list: [],
- selectName: '',
- }, {
- title: '市',
- code: '1',
- showList: false,
- list: [],
- selectName: '',
- }, {
- title: '区',
- showList: false,
- code: '1',
- list: [],
- selectName: '',
- }
- ]
- $scope.domainDropDown = [
- {
- title: '请选择',
- code: '0',
- showList: false,
- list: [],
- selectName: '',
- }, {
- title: '请选择',
- code: '1',
- showList: false,
- list: [],
- selectName: '',
- }, {
- title: '请选择',
- showList: false,
- code: '1',
- list: [],
- selectName: '',
- }
- ]
- var getAreaList = function (code, index) {
- AccountService.getAreaInfo(code).then(function (res) {
- if (res.code == 3350) {
- // console.log(res);
- // $scope.areaDropDown[index].list=res.data;
- $scope.areaDropDown[index].list = [];
- angular.forEach(res.data, function (val) {
- $scope.areaDropDown[index].list.push({
- text: '<a class="action-sheet-push">' + val.areaname + '</a>',
- itemkey: val.id,
- itemvalue: val.areaname //名字
- })
- })
- } else {
- }
- })
- }
- var getDomainList = function (code, index) {
- AccountService.getDomainInfo(code, UserService.node).then(function (res) {
- if (res.code == 3350) {
- // console.log(res);
- angular.forEach(res.data, function (val) {
- $scope.domainDropDown[index].list.push({
- text: '<a class="action-sheet-push">' + val.name + '</a>',
- itemkey: val.id,
- itemvalue: val.name, //名字,
- itemcode: val.code
- })
- })
- } else {
- }
- })
- }
- //获取所有节点列表
- var getNodeList = function () {
- };
- angular.forEach($scope.formList, function (val) {
- if (val.type == 'affiliatedOrg') {
- var pagecode = $scope.code == 4803 ? 1000003 : 1000004;
- dataToolsService.getOrganizationModelByOrgname(' ', pagecode, 0, 1).then(function (response) {
- console.log(response);
- if (response.data.length > 0) {
- if ($stateParams.type == 5100) {
- $scope.brokernode = UserService.node;
- if (UserService.node != '330122000') {
- val.content = '普适云平台';
- val.key = '123456';
- }
- }
- val.listItem = [];
- angular.forEach(response.data, function (value) {
- val.listItem.push({
- text: '<a class="action-sheet-push">' + value.name + '</a>',
- itemkey: value.id,
- itemvalue: value.name //名字
- })
- })
- }
- }, function () {
- });
- }
- if (val.type == 'select') {
- val.listItem = [];
- dataToolsService.getTypeEntryListByTypeName(val.selectkey).then(function (res) {
- if (res.code == 3350) {
- angular.forEach(res.data, function (value) {
- val.listItem.push({
- text: '<a class="action-sheet-push">' + value.itemkey + '</a>',
- itemkey: value.itemvalue,
- itemvalue: value.itemkey //名字
- })
- })
- $timeout(function () {
- if (val.content) {
- var temp = val.listItem.filter(function (vv) {
- return vv.itemvalue == val.content;
- })
- if (temp.length > 0) {
- val.key = temp[0].itemkey;
- }
- }
- }, 1000);
- }
- })
- }
- if (val.type == 'selectArea') {
- getAreaList(0, 0);
- }
- if (val.type == 'selectDomain') {
- // getDomainList(0,0);
- // console.log(val);
- val.listItem = [];
- AccountService.getDomainInfo(0, UserService.node).then(function (res) {
- if (res.code == 3350) {
- // console.log(res);
- angular.forEach(res.data, function (value) {
- val.listItem.push({
- text: '<a class="action-sheet-push">' + value.name + '</a>',
- itemkey: value.code,
- itemvalue: value.name, //名字,
- // itemcode:value.code
- })
- })
- }
- })
- }
- if (val.type == 'selectorgtype') {
- val.listItem = [];
- AccountService.getDomainInfo("enterprisequalification", UserService.node).then(function (res) {
- if (res.code == 3350) {
- angular.forEach(res.data, function (value) {
- val.listItem.push({
- text: '<a class="action-sheet-push">' + value.name + '</a>',
- itemkey: value.code,
- itemvalue: value.name, //名字,
- })
- })
- }
- })
- }
- if (val.type == 'selectorgscale') {
- val.listItem = [];
- AccountService.getDomainInfo("orgscale", UserService.node).then(function (res) {
- if (res.code == 3350) {
- angular.forEach(res.data, function (value) {
- val.listItem.push({
- text: '<a class="action-sheet-push">' + value.name + '</a>',
- itemkey: value.code,
- itemvalue: value.name, //名字,
- })
- })
- }
- })
- }
- })
- $timeout(function () {
- console.log($scope.formList);
- }, 4000)
- // 获取数据处理
- var dealWithData = function (temp) {
- console.log(temp);
- $scope.orgid = temp.orgid ? temp.orgid : 0;
- // 处理数据
- var arr = [];
- $scope.refusereason = temp.refusereason;
- if (temp.images != '' && temp.images != null) {
- arr = JSON.parse(temp.images);
- }
- // console.log(temp);
- for (var key in temp) {
- for (var i = 0; i < $scope.formList.length; i++) {
- if (key == $scope.formList[i].saveKey) {
- console.log(key);
- $scope.formList[i].content = temp[key];
- // if(key=='district'&&temp[key]!=''&&$scope.formList[i].type=='selectArea'){
- // console.log(temp[key]);
- // var tp=JSON.parse(temp[key]);
- // var str='';
- // angular.forEach(tp,function(val,index){
- // str+=val.name+' ';
- // })
- // $scope.formList[i].content=str;
- // }
- if ($scope.showNew == true && key == 'district' && temp[key] != '' && $scope.formList[i].type == 'selectArea') {
- var tempArry = temp[key].split('/')
- // console.log(temp);
- for (var j = 0; j < $scope.areaDropDown.length; j++) {
- $scope.areaDropDown[j].selectName = tempArry[j];
- }
- }
- 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') {
- // console.log($scope.formList[i]);
- // console.log(temp[key]);
- var tparr = $scope.formList[i].listItem.filter(function (vv) {
- return vv.itemkey == temp[key];
- })
- // console.log(tparr);
- $scope.formList[i].content = tparr.length > 0 ? tparr[0].itemvalue : '';
- $scope.formList[i].key = tparr.length > 0 ? tparr[0].itemkey : '';
- }
- if ($scope.formList[i].type == 'toggle') {
- $scope.formList[i].content = temp[key] == 10501 ? '是' : '否';
- $scope.formList[i].togglecontent = temp[key] == 10501 ? true : false;
- }
- }
- if ($scope.formList[i].type == 'upload' && arr.length > 0) {
- $scope.formList[i].imagelist = arr.filter(function (va, ind) {
- return $scope.formList[i].title == va.remark;
- })
- $scope.formList[i].imageSaveList = arr.filter(function (va, ind) {
- return $scope.formList[i].title == va.remark;
- })
- $scope.formList[i].content = '点击放大查看图片';
- }
- // if($scope.formList[i].type=='selectArea'){
- // console.log($scope.formList[i].content);
- // if($scope.formList[i].content!=''){
- // var tempArea=JSON.parse($scope.formList[i].content);
- // var str='';
- // angular.forEach(tempArea,function(val,index){
- // str+=val.name+' ';
- // })
- // $scope.formList[i].content=str;
- // }
- // }
- // if($scope.formList[i].type=='select'){
- // var tempArr=JSON.parse(temp[key]);
- //
- // }
- }
- }
- console.log($scope.formList);
- };
- $scope.checkData = {};
- $scope.agree = true;
- if ($scope.showHistory == true) {
- if ($scope.action == 'submit') {
- AccountService.getSingleAuthCheckInfo($stateParams.id).then(function (res) {
- $scope.id = res.id;
- dealWithData(res);
- })
- } else if ($scope.action == 'check') {
- // console.log(2);
- AccountService.getSingleAuthCheckInfo($stateParams.id).then(function (res) {
- $scope.checkData = res;
- $scope.agree = $scope.checkData.authenstatus != 5103;
- $timeout(function () {
- dealWithData(res);
- }, 0);
- })
- }
- }
- $scope.selectItems = function (index) {
- 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') {
- var list = $scope.formList[index].listItem;
- $ionicActionSheet.show({
- buttons: list,
- cancelText: '取消',
- buttonClicked: function (indx) {
- if ($stateParams.comfrom == 'dockingInput') {
- $stateParams.taskid = list[indx].itemkey
- }
- $scope.formList[index].key = list[indx].itemkey;
- $scope.formList[index].content = list[indx].itemvalue;
- return true;
- }
- })
- }
- }
- $scope.gobackpage = function () {
- $scope.goback();
- /*if(UserService.isTaskFlag == 1){
- $scope.go('taskHoll');
- UserService.isTaskFlag = 0;
- }else{
- goback();
- }*/
- }
- // 选中机构
- $scope.setOrgName = function (org) {
- // console.log(org);
- $scope.orgid = org.id;
- for (var key in org) {
- for (var i = 0; i < $scope.formList.length; i++) {
- if ($scope.formList[i].saveKey == key) {
- $scope.formList[i].content = org[key];
- 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') {
- var tparr = $scope.formList[i].listItem.filter(function (vv) {
- return vv.itemkey == org[key];
- })
- $scope.formList[i].content = tparr.length > 0 ? tparr[0].itemvalue : '';
- }
- }
- if ($scope.formList[i].saveKey == 'companyid' || $scope.formList[i].saveKey == 'department' || $scope.formList[i].saveKey == 'applyname') {
- $scope.formList[i].content = org.name;
- }
- }
- }
- // console.log($scope.formList);
- $scope.isRelateUl = false;
- if ($stateParams.comfrom == 'dockingInput') {
- taskModuleService.searchCompanyTask(org.id, 1, 200).then(function (res) {
- console.log(res);
- if (res.code == 3350) {
- $scope.formList[1].listItem = [];
- angular.forEach(res.data, function (val) {
- $scope.formList[1].listItem.push({
- text: '<a class="action-sheet-push">' + val.projectname + '</a>',
- itemkey: val.id,
- itemvalue: val.projectname //名字
- })
- })
- }
- })
- }
- }
- var hasArea = function () {
- angular.forEach($scope.formList, function (val, index) {
- if (val.type == 'selectArea') {
- if (val.content != '') {
- // var temp=JSON.parse(val.content);
- var temp = val.content.split('/');
- for (var i = 0; i < $scope.areaDropDown.length; i++) {
- // $scope.areaDropDown[i].code=temp[i].code;
- // $scope.areaDropDown[i].selectName=temp[i].name;
- $scope.areaDropDown[i].selectName = temp[i];
- // getAreaList(temp[i].code,i);
- }
- }
- return true
- }
- ;
- })
- return false;
- }
- $scope.showAreaList = function (index, outerIndex, arr, key) {
- console.log(arr);
- var list = arr[index].list;
- $ionicActionSheet.show({
- buttons: list,
- cancelText: '取消',
- buttonClicked: function (indx) {
- // 先清除
- if (index == 0) {
- arr[1].selectName = '';
- arr[2].selectName = '';
- arr[1].code = '';
- arr[2].code = '';
- } else if (index == 1) {
- arr[2].selectName = '';
- arr[2].code = '';
- }
- if (index < 2) {
- arr[index + 1].code = list[indx].itemkey;
- if (key == 'area') {
- getAreaList(list[indx].itemkey, index + 1);
- } else {
- getDomainList(list[indx].itemkey, index + 1);
- }
- }
- arr[index].selectName = list[indx].itemvalue;
- // var tempArr=[];
- // angular.forEach(arr,function(val,index){
- // tempArr.push({name:val.selectName,code:val.code});
- // })
- var tempArr = '';
- angular.forEach(arr, function (val, index) {
- tempArr += val.selectName + '/';
- })
- $scope.formList[outerIndex].code = list[indx].itemkey;
- if (index == 0) {
- $scope.formList[outerIndex].content = tempArr.slice(0, tempArr.length - 3);
- } else {
- $scope.formList[outerIndex].content = tempArr.slice(0, tempArr.length - 1);
- }
- // console.log($scope.formList[outerIndex].content);
- return true;
- }
- })
- }
- $scope.setAreaListCode = function (code, name, index, outerIndex) {
- // 先清除
- if (index == 0) {
- $scope.areaDropDown[1].selectName = '';
- $scope.areaDropDown[2].selectName = '';
- $scope.areaDropDown[1].code = '1';
- $scope.areaDropDown[2].code = '1';
- } else if (index == 1) {
- $scope.areaDropDown[2].selectName = '';
- $scope.areaDropDown[2].code = '1';
- }
- // 然后再新赋值,准备下一级别数据
- $scope.areaDropDown[index].showList = false;
- if (index + 1 < $scope.areaDropDown.length) {
- $scope.areaDropDown[index + 1].code = code;
- getAreaList(code, index + 1);
- }
- $scope.areaDropDown[index].selectName = name;
- var tempArr = [];
- angular.forEach($scope.areaDropDown, function (val, index) {
- tempArr.push({ name: val.selectName, code: val.code });
- })
- $scope.formList[outerIndex].content = JSON.stringify(tempArr);
- }
- // *************有效证件
- $scope.showCTList = false;
- // $scope.certificateType=[
- // {name:'身份证',code:1},
- // {name:'军官证',code:2},
- // ]
- $scope.showCertificateTypeList = function (index) {
- $scope.clickIndex = index;
- $scope.showCTList = true;
- }
- $scope.setCertificateType = function (index) {
- $scope.showCTList = false;
- $scope.formList[$scope.clickIndex].content = $scope.formList[$scope.clickIndex].listItem[index].itemkey;
- $scope.formList[$scope.clickIndex].itemvalue = $scope.formList[$scope.clickIndex].listItem[index].itemvalue;
- }
- // *************上传照片
- // 先从数据中读取照片
- angular.forEach($scope.formList, function (val, index) {
- if (val.type == 'upload') {
- if (val.content != '') {
- /*var temp = JSON.parse(val.content);*/
- if (val.content != null && val.content != undefined && val.content != "") {
- val.imagelist = Object.assign([], JSON.parse(val.content));
- val.imageSaveList = Object.assign([], JSON.parse(val.content));
- val.content = [];
- }
- console.log(val);
- }
- }
- ;
- })
- // console.log($scope.formList);
- //加载动画
- $scope.showLoadingToast = function () {
- $ionicLoading.show({
- template: '<ion-spinner icon="bubbles" class="spinner-calm"></ion-spinner>',
- content: '努力加载中',
- animation: 'fade-in',
- showBackdrop: true,//是否显示蒙层
- maxWidth: 150,
- showDelay: 0
- });
- // $timeout(function () {
- // $ionicLoading.hide();
- // }, 15000);
- };
- //关闭加载动画
- $scope.hideLoadingToast = function () {
- $ionicLoading.hide();
- };
- var listIndex = 1000;
- $scope.addImage = function (index) {
- listIndex = index;
- if ($scope.app) {
- var list = [
- { text: '<a class="action-sheet-push">拍照</a>' },
- { text: '<a class="action-sheet-push">从相册上传</a>' },
- ];
- var clickfunction = function (indx) {
- if (indx == 0) {
- $scope.openCamera();
- } else {
- getPictures();
- }
- return true;
- }
- } else {
- var files = document.getElementById('file');
- $timeout(function () {
- files.click();
- });
- $(files).unbind().on('change', function (e) {
- // console.log(e);
- if ($scope.formList[listIndex].imagelist.length > 8) {
- $ionicPopup.alert({
- title: '提示',
- template: '最多只能上传9个文件!'
- });
- return;
- }
- $.each(e.target.files, function (i, file) {
- var url = null;
- if (window.createObjectURL != undefined) { // basic
- url = window.createObjectURL(file);
- } else if (window.URL != undefined) { // mozilla(firefox)
- url = window.URL.createObjectURL(file);
- } else if (window.webkitURL != undefined) { // webkit or chrome
- url = window.webkitURL.createObjectURL(file);
- }
- $scope.formList[listIndex].imagelist.push({ photoName: url, originalName: url });
- })
- $.each(e.target.files, function (i, file) {
- var data = new FormData();
- data.append('file', file);
- CommonService.webUploadImage(data).then(function (res) {
- var temp = {
- id: 0,
- title: res.title,
- doctype: $scope.formList[listIndex].doctype,//文档类型 1图片,2文件,3pdf,4xls
- isenabled: 1,//是否可用:0-不可用,1-可用,2-已停用
- photoName: res.photoName,
- originalName: res.originalName,
- sourceName: res.sourceName,
- sourceSize: res.sourceSize
- }
- $scope.formList[listIndex].imageSaveList.push(temp);
- // console.log(temp);
- // console.log($scope.formList[listIndex]);
- })
- });
- })
- return true;
- }
- $ionicActionSheet.show({
- buttons: list,
- cancelText: '取消',
- buttonClicked: clickfunction
- })
- }
- $scope.openCamera = function () {
- if ($scope.formList[listIndex].imagelist.length >= 9) {
- if ($scope.app) {
- UtilService.showMess("最多选取9张图片");
- } else {
- CommonService.showMessage("最多选取9张图片", $scope)
- }
- return;
- }
- UtilService.getPicture(1).then(function (results) {
- $scope.showLoadingToast();
- $scope.formList[listIndex].imagelist.push({ photoName: results, originalName: results })
- UtilService.uploadFile([results], 0, "image/jpeg").then(function (response) {
- angular.forEach(response, function (value) {
- $scope.formList[listIndex].imageSaveList.push({
- id: 0,
- title: value.title,
- doctype: $scope.formList[listIndex].doctype,//文档类型 1图片,2文件,3pdf,4xls
- isenabled: 1,//是否可用:0-不可用,1-可用,2-已停用
- photoName: value.photoName,
- originalName: value.originalName,
- sourceName: value.sourceName,
- sourceSize: value.sourceSize
- })
- })
- $scope.hideLoadingToast();
- }, function () {
- $scope.hideLoadingToast();
- if ($scope.app) {
- UtilService.showMess("网络不给力,请重试");
- } else {
- CommonService.showMessage("网络不给力,请重试", $scope)
- }
- });
- $ionicScrollDelegate.$getByHandle("scrollimage").resize();
- }, function (err) {
- });
- }
- var getPictures = function () {
- if (device.platform == "Android") {
- verifyStorage();
- } else {
- getPic();
- }
- };
- var verifyStorage = function () {
- window.imagePicker.verifyStorage(
- function (results) {
- if (results == "1") {
- getPic();
- }
- }, function (error) {
- }
- );
- };
- var getPic = function () {
- var imagelistLength = $scope.formList[listIndex].imagelist.length;
- if (imagelistLength >= 9) {
- if ($scope.app) {
- UtilService.showMess("最多选取9张图片");
- } else {
- CommonService.showMessage("最多选取9张图片", $scope)
- }
- return;
- }
- UtilService.getPictureList(9 - imagelistLength).then(function (results) {
- $scope.showLoadingToast();
- angular.forEach(results, function (val, i) {
- $scope.formList[listIndex].imagelist.push({ photoName: val, originalName: val });
- })
- UtilService.uploadFile(results, 0, "image/jpeg").then(function (response) {
- angular.forEach(response, function (value) {
- if (value.status) {
- $scope.formList[listIndex].imageSaveList.push({
- id: 0,
- title: "",
- doctype: $scope.formList[listIndex].doctype,//文档类型 1图片,2文件,3pdf,4xls
- isenabled: 1,//是否可用:0-不可用,1-可用,2-已停用
- photoName: value.photoName,
- originalName: value.originalName,
- sourceName: value.sourceName,
- sourceSize: value.sourceSize
- });
- }
- })
- $scope.hideLoadingToast();
- }, function () {
- $scope.hideLoadingToast();
- if ($scope.app) {
- UtilService.showMess("网络不给力,请重试");
- } else {
- CommonService.showMessage("网络不给力,请重试", $scope)
- }
- });
- $ionicScrollDelegate.$getByHandle("scrollimage").resize();
- }, function (err) {
- });
- };
- //删除图片
- $scope.deletePhoto = function (index, outerIndex) {
- console.log($scope.formList[outerIndex]);
- if ($scope.formList[outerIndex].imageSaveList[index].id != 0) {
- $scope.formList[outerIndex].imageSaveList[index].isenabled = 2;
- $scope.formList[outerIndex].imageDeleteList.push($scope.formList[outerIndex].imageSaveList[index]);
- }
- $scope.formList[outerIndex].imagelist.splice(index, 1);
- $scope.formList[outerIndex].imageSaveList.splice(index, 1);
- // console.log($scope.formList[outerIndex].imagelist);
- // console.log($scope.formList[outerIndex].imageSaveList);
- // console.log($scope.formList[outerIndex].imageDeleteList);
- }
- $scope.uploadPic = function (e) {
- // console.log(2);
- // console.log(e.target);
- }
- // **************切换开关
- $scope.watchIsChange = function (index) {
- $scope.formList[index].content = $scope.formList[index].togglecontent ? "10501" : "10502";
- }
- // **************提交按钮
- $scope.checkNotice = function () {
- $scope.isChecked = !$scope.isChecked;
- }
- // 处理审核
- $scope.reSubmit = function () {
- $scope.showNew = true;
- $scope.showHistory = false;
- $scope.tempData = {};
- $scope.tempData.id = $scope.id;
- console.log($scope.formList);
- angular.forEach($scope.formList, function (val) {
- if (val.type == 'upload') {
- val.imageSaveList = Object.assign([], val.imagelist);
- }
- if (val.type == 'selectArea' && val.content != '') {
- var temp = val.content.split('/')
- // console.log(temp);
- for (var i = 0; i < $scope.areaDropDown.length; i++) {
- $scope.areaDropDown[i].selectName = temp[i];
- }
- }
- })
- }
- if ($stateParams.comfrom == 'resubmit') {
- $scope.id = $stateParams.id;
- $scope.reSubmit();
- }
- var dealWidthData = function () {
- console.log($scope.formList);
- var tempImages = [];
- angular.forEach($scope.formList, function (val, index) {
- if (val.type == 'upload') {
- // 处理照片
- // if(val.imagelist.length>0){
- // val.imageSaveList=Object.assign([],val.imagelist);
- // }
- val.content = '';
- var temp = Object.assign([], val.imageSaveList);
- angular.forEach(val.imageSaveList, function (v) {
- tempImages.push(v);
- })
- if (val.imageDeleteList.length > 0) {
- angular.forEach(val.imageDeleteList, function (value) {
- tempImages.push(value);
- temp.push(value)
- })
- }
- val.content = JSON.stringify(temp);
- } else if (val.type == 'select' || val.type == 'selectDomain' || val.type == 'affiliatedOrg' || val.type == 'companyTaskSelect' || val.type == 'selectorgtype' || val.type == 'selectorgscale') {
- $scope.tempData[val.saveKey] = val.key;
- } else if (val.type == 'selectArea') {
- $scope.tempData[val.saveKey] = val.content;
- $scope.tempData.regionsid = val.code;
- } else if (val.type == 'toggle') {
- if (val.content == '是' || val.content == '否') {
- val.content = (val.content == '是' ? 10501 : 10502);
- }
- $scope.tempData[val.saveKey] = val.content;
- } else {
- $scope.tempData[val.saveKey] = val.content;
- }
- })
- console.log(tempImages);
- angular.forEach(tempImages, function (value, index) {
- value.createtime = new Date().Format("yyyy-MM-dd hh:mm:ss");
- value.updatetime = new Date().Format("yyyy-MM-dd hh:mm:ss");
- })
- $scope.tempData.images = JSON.stringify(tempImages);
- }
- // 发布任务
- // 获取connid
- var getConnid = function () {
- var def = $q.defer();
- $scope.requestModel = {
- data: {
- orgtype: 10104,
- templettype: 4,
- title: $scope.formList[0].content,
- organizationInfo: {
- orgtype: 10104,
- name: $scope.formList[0].content,
- id: $scope.orgid ? $scope.orgid : 0
- },
- userModel: {
- userid: UserService.id
- }
- },
- node: UserService.node,
- userid: UserService.id
- }
- console.log($scope.requestModel);
- dataToolsService.saveOrganizationInfo($scope.requestModel).then(function (response) {
- console.log(response);
- if (response.code == 3350) {
- def.resolve(response.data);
- } else {
- def.reject('错误');
- }
- })
- return def.promise;
- }
- $scope.readCommit = false;
- $scope.readCommition = function () {
- $scope.readCommit = !$scope.readCommit;
- }
- $scope.goToMyCommit = function () {
- //$scope.commitmentCom.show();
- // permissionvalue = "";
- // angular.forEach($scope.taskTypeList, function (val) {
- // if (val.isSelected) {
- // permissionvalue = permissionvalue + "," + val.value;
- // }
- // })
- // if ($scope.taskTypeList[2].isSelected) {
- // permissionvalue = "";
- // angular.forEach($scope.sonTaskTypeList, function (val) {
- // if (val.isSelected) {
- // permissionvalue = permissionvalue + "," + val.value;
- // }
- // })
- // }
- // $scope.formList.permissionvalue = permissionvalue;
- $scope.go('commitment', { formlist: $scope.formList });
- }
- $scope.gobackToTashHoll = function () {
- $scope.go('taskHoll');
- }
- $scope.submitTask = function () {
- var submitTaskAction = false;
- if (!$scope.readCommit && $scope.node == '330122000') {
- if ($scope.app) {
- UtilService.showMess('您尚未接受《技术经纪人政策申报承诺书》!');
- } else {
- $ionicPopup.alert({
- title: '提示',
- template: '您尚未接受《技术经纪人政策申报承诺书》!'
- });
- /*CommonService.showMessage('您尚未接受《技术经纪人政策申报承诺书》!', $scope);*/
- }
- return;
- }
- angular.forEach($scope.formList, function (val) {
- if (val.title == "需求名称") {
- $scope.content = val.content;
- }
- })
- if (!$scope.content || $scope.content == "") {
- if ($scope.app) {
- UtilService.showMess('请填写需求名称!');
- } else {
- CommonService.showMessage('请填写需求名称!', $scope);
- }
- submitTaskAction = true;
- }
- ResourceLibraryService.getUserInfoList($scope.content, $stateParams.demandId).then(function (res) {
- if (res.code == 3350) {
- if (res.data) {
- if ($scope.app) {
- UtilService.showMess('需求名称已存在');
- } else {
- CommonService.showMessage('需求名称已存在', $scope);
- }
- submitTaskAction = true;
- }
- }
- if (submitTaskAction) {
- return;
- }
- submitTaskAction = true;
- $scope.tempData = $scope.tempData ? $scope.tempData : {};
- for (var i = 0; i < $scope.formList.length; i++) {
- var val = $scope.formList[i];
- if (val.remarkType == 'manage' && $scope.formList[i - 1].type == 'toggle' && ($scope.formList[i - 1].content == '10502' || $scope.formList[i - 1].content == '否')) {
- continue;
- }
- // if(!$scope.orgid){
- // if($scope.app){
- // UtilService.showMess('所属企业请输入关键字,从列表中选择');
- // }else{
- // CommonService.showMessage('所属企业请输入关键字,从列表中选择',$scope);
- // }
- // submitTaskAction=false;
- // return;
- // }
- if (val.needed && (val.content === '' || (val.type == 'upload' && val.imagelist.length == 0))) {
- if (val.type == 'upload') {
- if ($scope.app) {
- UtilService.showMess('请上传' + val.title);
- } else {
- CommonService.showMessage('请上传' + val.title, $scope);
- }
- } else if (val.type == 'select' || val.type == 'affiliatedOrg' || val.type == 'selectArea' || val.type == 'selectDomain' || val.type == 'companyTaskSelect' || val.type == 'selectorgtype' || val.type == 'selectorgscale') {
- if ($scope.app) {
- UtilService.showMess('请选择' + val.title);
- } else {
- CommonService.showMessage('请选择' + val.title, $scope);
- }
- } else {
- if ($scope.app) {
- UtilService.showMess('请填写' + val.title);
- } else {
- CommonService.showMessage('请填写' + val.title, $scope);
- }
- }
- submitTaskAction = false;
- return;
- }
- }
- if (permissionvalue == 5) {
- if ($scope.app) {
- UtilService.showMess('请至少选择一个部分公开项!');
- } else {
- CommonService.showMessage('请至少选择一个部分公开项!', $scope);
- }
- submitTaskAction = false;
- return;
- }
- if (opentype == 5311 && $scope.releaseToWhoList.length == 0) {
- if ($scope.app) {
- UtilService.showMess('请至少选择一位邀请接单人员!');
- } else {
- CommonService.showMessage('请至少选择一位邀请接单人员!', $scope);
- }
- submitTaskAction = false;
- return;
- }
- dealWidthData();
- $scope.tempData.opentype = opentype;
- $scope.tempData.creator = UserService.id;
- // console.log($scope.tempData);
- var array = [];
- angular.forEach($scope.releaseToWhoList, function (val) {
- array.push(val.userid);
- })
- $scope.tempData.opentowho = array.join(',');
- $scope.showLoadingToast();
- getConnid().then(function (data) {
- console.log(data);
- $scope.tempData.connid = data.id;
- $scope.tempData.orgid = data.organizationInfo.id;
- $scope.tempData.companyid = data.organizationInfo.id;
- console.log($scope.tempData);
- $scope.tempData.images = $scope.tempData.images == '[]' ? '' : $scope.tempData.images;
- var senddata = {
- data: $scope.tempData,
- node: UserService.node
- }
- if (senddata.capitalScale == NaN || senddata.capitalScale == null || senddata.capitalScale == undefined) {
- senddata.capitalScale = 0;
- }
- if (senddata.tel == -1 || senddata.tel == null || senddata.tel == undefined) {
- senddata.tel = "";
- }
- permissionvalue = "";
- angular.forEach($scope.taskTypeList, function (val) {
- if (val.isSelected) {
- permissionvalue = permissionvalue + "," + val.value;
- }
- })
- if ($scope.taskTypeList[2].isSelected) {
- permissionvalue = "";
- angular.forEach($scope.sonTaskTypeList, function (val) {
- if (val.isSelected) {
- permissionvalue = permissionvalue + "," + val.value;
- }
- })
- }
- senddata.data.permissionvalue = permissionvalue;
- senddata.data.id = $stateParams.data.id;
- console.log(senddata);
- taskModuleService.releaseOrEditTask(senddata).then(function (res) {
- console.log(res);
- if (res.code == 3350) {
- if (res.data.remark == "已存在同名需求") {
- submitTaskAction = false;
- $ionicPopup.alert({
- title: '提示',
- template: '已存在同名需求!'
- })
- } else {
- if (JSON.stringify($stateParams.data) != '{}') {
- if (UserService.node != "330122000") {
- $scope.go('taskDetail', {
- actions: "5322,5325",
- comefrom: "taskHoll",
- node: UserService.node,
- opentowho: JSON.stringify($scope.releaseToWhoList),
- opentype: res.data.opentype,
- resid: $stateParams.data.resid,
- restype: 1,
- taskid: res.data.id,
- taskstatus: 5300,
- title: $stateParams.data.title
- })
- } else {
- $scope.go('taskHoll');
- }
- } else {
- $scope.goback();
- }
- }
- $scope.hideLoadingToast();
- }
- })
- })
- })
- }
- // 保存对接信息
- // 获取connid
- var getDockingConnid = function () {
- var def = $q.defer();
- $scope.requestModel = {
- data: {
- templettype: 16,
- title: $scope.formList[0].content,
- organizationInfo: {
- name: $scope.formList[0].content,
- id: $scope.orgid ? $scope.orgid : 0
- },
- userModel: {
- userid: UserService.id
- }
- },
- node: UserService.node,
- userid: UserService.id
- }
- console.log($scope.requestModel);
- dataToolsService.saveOrganizationInfo($scope.requestModel).then(function (response) {
- console.log(response);
- if (response.code == 3350) {
- def.resolve(response.data);
- } else {
- def.reject('错误');
- }
- })
- return def.promise;
- }
- $scope.submitTaskDocking = function () {
- $scope.tempData = $scope.tempData ? $scope.tempData : {};
- for (var i = 0; i < $scope.formList.length; i++) {
- var val = $scope.formList[i];
- if (val.remarkType == 'manage' && $scope.formList[i - 1].type == 'toggle' && ($scope.formList[i - 1].content == '10502' || $scope.formList[i - 1].content == '否')) {
- continue;
- }
- if (val.needed && (val.content === '' || val.content == null || (val.type == 'upload' && val.imagelist.length == 0))) {
- if (val.type == 'upload') {
- if ($scope.app) {
- UtilService.showMess('请上传' + val.title);
- } else {
- CommonService.showMessage('请上传' + val.title, $scope);
- }
- } else if (val.type == 'select' || val.type == 'affiliatedOrg' || val.type == 'selectArea' || val.type == 'selectDomain' || val.type == 'companyTaskSelect' || val.type == 'selectorgtype' || val.type == 'selectorgscale') {
- if ($scope.app) {
- UtilService.showMess('请选择' + val.title);
- } else {
- CommonService.showMessage('请选择' + val.title, $scope);
- }
- } else {
- if ($scope.app) {
- UtilService.showMess('请填写' + val.title);
- } else {
- CommonService.showMessage('请填写' + val.title, $scope);
- }
- }
- return;
- }
- }
- dealWidthData();
- $scope.tempData.companyid = $scope.orgid;
- $scope.tempData.action = 5322;
- $scope.tempData.creator = UserService.id;
- // var senddata={
- // data:$scope.tempData,
- // node:UserService.node
- // }
- $scope.showLoadingToast();
- getDockingConnid().then(function (data) {
- console.log(data);
- $scope.tempData.connid = data.id;
- $scope.tempData.orgid = data.organizationInfo.id;
- $scope.tempData.companyid = data.organizationInfo.id;
- $scope.tempData.tasktitle = $scope.tasktitle;
- $scope.tempData.taskid = $stateParams.taskid;
- if ($scope.tempData.jointtime == null || $scope.tempData.jointtime == undefined || $scope.tempData.jointtime == "") {
- $scope.tempData.jointtime = new Date();
- } else {
- $scope.tempData.jointtime += ' 00:00:00';
- }
- var senddata = {
- data: $scope.tempData,
- node: UserService.node
- }
- console.log(senddata);
- taskModuleService.saveOrupdatetaskDocking(senddata).then(function (res) {
- console.log(res);
- if (res.code == 3350) {
- $scope.goback();
- } else {
- $ionicPopup.alert({
- title: '提示',
- template: "服务器错误"
- });
- }
- $scope.hideLoadingToast();
- }).catch(function (res) {
- $scope.hideLoadingToast();
- $ionicPopup.alert({
- title: '提示',
- template: "服务器错误"
- });
- })
- })
- }
- var submitFormAction = false;
- $scope.submitForm = function () {
- // if(!$scope.isChecked){
- // return;
- // }
- if (submitFormAction) {
- return;
- }
- submitFormAction = true;
- console.log($scope.formList);
- // 先处理数据 判断非空
- $scope.tempData = $scope.tempData ? $scope.tempData : {};
- for (var i = 0; i < $scope.formList.length; i++) {
- var val = $scope.formList[i];
- if (val.remarkType == 'manage' && $scope.formList[i - 1].type == 'toggle' && val.imagelist.length == 0 && $scope.formList[i - 1].togglecontent) {
- if ($scope.app) {
- UtilService.showMess('请上传' + val.title);
- } else {
- CommonService.showMessage('请上传' + val.title, $scope);
- }
- submitFormAction = false;
- return;
- }
- if (val.remarkType != 'manage') {
- if (val.needed && (val.content === '' || (val.type == 'upload' && val.imagelist.length == 0))) {
- if (val.type == 'upload') {
- if ($scope.app) {
- UtilService.showMess('请上传' + val.title);
- } else {
- CommonService.showMessage('请上传' + val.title, $scope);
- }
- } else {
- if ($scope.app) {
- UtilService.showMess('请填写' + val.title);
- } else {
- CommonService.showMessage('请填写' + val.title, $scope);
- }
- }
- submitFormAction = false;
- return;
- }
- }
- }
- angular.forEach($scope.formList, function (val) {
- if (val.type == "upload") {
- angular.forEach(val.imageSaveList, function (image) {
- image.remark = val.title;
- })
- }
- })
- dealWidthData();
- // console.log($scope.tempData);
- $scope.tempData.applytype = $scope.code;
- $scope.tempData.creator = UserService.id;
- $scope.tempData.authenstatus = 5101;
- $scope.tempData.userid = UserService.id;
- $scope.tempData.usercomefrom = UserService.node;
- $scope.tempData.orgid = $scope.orgid;
- console.log('ddddd', $scope.tempData);
- $scope.showLoadingToast();
- AccountService.submitAuthMessageInfo($scope.tempData).then(function (res) {
- console.log(res);
- $scope.hideLoadingToast();
- if (res.code == 3350) {
- $scope.go('identifyStatus', {
- action: "submit",
- code: $scope.tempData.applytype,
- companyName: '',
- id: res.data.id,
- pageTitle: $stateParams.pageTitle,
- pagenum: 1,
- pagesize: 15,
- type: $scope.tempData.authenstatus,
- comfrom: $stateParams.url ? $stateParams.url : $stateParams.comfrom,
- })
- }
- })
- }
- $scope.agreeClick = function () {
- if ($scope.node == '330122000') {
- $scope.agree = 1;
- } else {
- $scope.agree = true;
- }
- }
- $scope.rollClick = function () {
- $scope.agree = -2;
- }
- $scope.rejectClick = function () {
- if ($scope.node == '330122000') {
- $scope.agree = -1;
- } else {
- $scope.agree = false;
- }
- }
- var submitCheckAction = false;
- $scope.submitCheck = function () {
- /*if (submitCheckAction) {
- return;
- }
- submitCheckAction = true;*/
- if ($scope.node == '330122000') {
- $scope.checkData.authenstatus = $scope.agree == 1 ? 5102 : ($scope.agree == -1 ? 5103 : 5104);
- $scope.checkData.refusereason = $scope.agree == 1 ? '' : $scope.checkData.refusereason;
- } else {
- $scope.checkData.authenstatus = $scope.agree ? 5102 : 5103;
- $scope.checkData.refusereason = $scope.agree ? '' : $scope.checkData.refusereason;
- }
- //拒绝
- if ($scope.agree == -1) {
- if (!$scope.checkData.refusereason) {
- $ionicPopup.alert({
- title: '提示',
- template: '请填写拒绝理由!'
- });
- return;
- }
- }
- //退回
- if ($scope.agree == -2) {
- if (!$scope.checkData.refusereason) {
- $ionicPopup.alert({
- title: '提示',
- template: '请填写退回理由!'
- });
- return;
- }
- }
- $scope.checkData.authorityid = UserService.id;
- $scope.showLoadingToast();
- AccountService.submitAuthCheckInfo($scope.checkData).then(function (res) {
- $scope.hideLoadingToast();
- // console.log(res);
- if (res.code == 3350) {
- $state.go('identifyDetail', { pageTitle: '认证审核', code: $scope.code, action: 'check' });
- }
- })
- }
- //点击图片放大
- $scope.bigImage = false; //初始默认大图是隐藏的
- $scope.hideBigImage = function () {
- $timeout(function () {
- $scope.bigImage = false;
- }, 400);
- };
- $scope.shouBigImage = function (piclist, index) { //传递一个参数(图片的URl)
- window.open(ConfigService.imgurl + piclist[index].sourceName);
- return;
- };
- window.addEventListener("resize", function () {
- var domWidth = window.document.documentElement.getBoundingClientRect().width;
- if (domWidth > 540) {
- $scope.viewscreen = 'browser';
- } else {
- $scope.viewscreen = 'app';
- }
- })
- // 任务邀请页面
- var taskInviteModal = function () {
- $ionicModal.fromTemplateUrl('./modules/common/views/taskInviteModal.html', {
- scope: $scope,
- animation: 'slide-in-left'
- }).then(function (modal) {
- $scope.taskInvite = modal;
- });
- }
- taskInviteModal();
- // 选择热门标签
- $scope.selectLable = function (index, label) {
- $scope.formList[index].content = label;
- }
- }]);
|