123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427 |
- /**
- * Created by pushkeji on 2018/8/16.
- */
- angular.module('push')
- .controller('techDemandCheckAgainCtrl', ['$scope', '$stateParams', '$ionicActionSheet', '$ionicLoading', '$ionicScrollDelegate', 'UtilService', 'dataToolsService', '$sce', 'AccountService', 'UserService', '$ionicSlideBoxDelegate', '$timeout', '$state', '$http', 'ConfigService', 'CommonService', '$ionicPopup', 'ResourceLibraryService', 'taskModuleService', 'ScienceCircleService', '$ionicModal', '$q', 'ionicDatePicker', function ($scope, $stateParams, $ionicActionSheet, $ionicLoading, $ionicScrollDelegate, UtilService, dataToolsService, $sce, AccountService, UserService, $ionicSlideBoxDelegate, $timeout, $state, $http, ConfigService, CommonService, $ionicPopup, ResourceLibraryService, taskModuleService, ScienceCircleService, $ionicModal, $q, ionicDatePicker) {
- console.log($stateParams);
- // 弹出任务邀请框
- $scope.tempData = {};
- $scope.node = UserService.node;
- $scope.resubmitData = $stateParams.resubmitData;
- $scope.defaultLan = UserService.defaultLan;
- if ($scope.node == '330122000') {
- $scope.agree = 1;
- } else {
- $scope.agree = true;
- }
- $scope.index = 0;
- var permissionvalue = "1";
- $scope.labelList = [{
- itemvalue: 0,
- itemkey: '全部',
- isSelected: true
- }, {
- itemvalue: 6,
- itemkey: '服务机构认证',
- isSelected: false
- }];
- $scope.taskTypeList = [{
- name: '公开',
- isSelected: true,
- value: 1
- }, {
- name: '仅管理员可见',
- isSelected: false,
- value: 4
- }, {
- name: '部分公开',
- isSelected: false,
- value: 5
- }];
- $scope.sonTaskTypeList = [{
- name: '技术经纪人可见',
- isSelected: false,
- value: 2
- }, {
- name: '高校院所专家可见',
- isSelected: 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: true,
- content: '',
- type: 'input',
- needed: true,
- saveKey: 'applyname',
- }, {
- title: '所属机构',
- placeholder: '请填写所属机构',
- 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'
- },
- ];
- 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'
- },
- ];
- 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') {
- $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',
- 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: 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') {
- $scope.formList = [
- {
- title: '技术需求单位',
- placeholder: '请填写技术需求单位全称',
- fuzzyQuery: true,
- content: $scope.resubmitData ? $scope.resubmitData.companyName : '',
- type: 'input',
- needed: true,
- saveKey: 'companyid',
- rowMargin: true
- }, {
- title: '需求名称',
- placeholder: '请填写需求名称',
- content: $scope.resubmitData ? $scope.resubmitData.projectname : '',
- type: 'input',
- needed: true,
- saveKey: 'projectname',
- }, {
- title: '投入预算(w)',
- placeholder: '请填写预算',
- content: $scope.resubmitData ? $scope.resubmitData.capitalScale : 0,
- type: 'input',
- needed: false,
- saveKey: 'capitalScale',
- inputType: 'number',
- }, {
- title: '合作类型',
- placeholder: '请选择合作类型',
- content: $scope.resubmitData ? $scope.resubmitData.cooperationmodelInfo : '',
- selectkey: 'cooperationmodel',
- type: 'select',
- needed: false,
- saveKey: 'cooperationmodel',
- key: ''
- }, {
- title: '需求介绍',
- placeholder: '请填写需求介绍',
- type: 'textarea',
- maxlength: 500,
- content: $scope.resubmitData ? $scope.resubmitData.taskintroduction : '',
- needed: true,
- saveKey: 'taskintroduction',
- }, {
- title: '企业认可证明',
- content: $scope.resubmitData ? $scope.resubmitData.photo : '[]',
- type: 'upload',
- needed: true,
- imagelist: [],
- imageSaveList: [],
- imageDeleteList: [],
- doctype: 4911,
- remarkType: 'add',
- rowMargin: true
- }, {
- title: '关键字',
- placeholder: '请请写关键字,多个请用逗号分隔',
- content: '',
- type: 'input',
- needed: false,
- saveKey: 'labelname',
- }
- ];
- }
- 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') {
- val.content = JSON.stringify($stateParams.data.images);
- val.imagelist = $stateParams.data.images;
- val.imageSaveList = $stateParams.data.images;
- }
- 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.content = item.content;
- if (val.type == 'upload') {
- var temp = JSON.parse(item.content);
- 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) :
- "";
- })
- }
- // 接单类型
- 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 temp = new Date(val).toLocaleString().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, outerIndex, innerIndex) {
- // console.log(1);
- $scope.timeIndex = Index;
- $scope.type = type;
- if (type == 'date') {
- ionicDatePicker.openDatePicker(datePickerObj);
- } else {
- $scope.showTimePicker = true;
- }
- };
- 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).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
- })
- })
- } else {
- }
- })
- }
- })
- $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') {
- // 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].doctype == va.doctype;
- })
- $scope.formList[i].imageSaveList = arr.filter(function (va, ind) {
- return $scope.formList[i].doctype == va.doctype;
- })
- $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') {
- // 获取认证信息
- // console.log($scope.code);
- AccountService.getAuthMessageInfo($scope.code).then(function (res) {
- console.log(res);
- if (res.code == 3350) {
- // $scope.dataList=res.data;
- // console.log(res);
- // console.log($stateParams);
- var temp = res.data.filter(function (val, index, arr) {
- return val.id == $stateParams.id;
- })[0];
- $scope.id = temp.id;
- dealWithData(temp);
- }
- })
- } else if ($scope.action == 'check') {
- // console.log(2);
- AccountService.getAuthCheckInfo($stateParams.pagenum, $stateParams.pagesize, '', 0, 0).then(function (res) {
- // console.log(res);
- if (res.code == 3350) {
- // $scope.dataList=res.data;
- var temp = res.data.filter(function (val, index, arr) {
- return val.id == $stateParams.id;
- })[0];
- console.log(temp);
- $scope.checkData = temp;
- $scope.agree = $scope.checkData.authenstatus != 5103
- dealWithData(temp);
- }
- })
- }
- }
- $scope.selectItems = function (index) {
- // console.log(index);
- if ($scope.formList[index].type == 'select' || $scope.formList[index].type == 'selectDomain' || $scope.formList[index].type == 'affiliatedOrg' || $scope.formList[index].type == 'companyTaskSelect') {
- 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') {
- 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 == 'applyname' || $scope.formList[i].saveKey == 'companyid') {
- $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);
- 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 list = [
- {text: '<a class="action-sheet-push">从相册上传</a>'},
- ];
- var clickfunction = function (indx) {
- if (indx == 0) {
- var files = document.getElementById('file');
- files.click();
- $(files).unbind().on('change', function (e) {
- // console.log(e);
- if ($scope.formList[listIndex].imagelist.length > 1) {
- if ($scope.app) {
- UtilService.showMess('只能上传一张照片');
- } else {
- CommonService.showMessage('只能上传一张照片', $scope);
- }
- 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: "",
- 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: "",
- 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') {
- $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 == '是' ? 10502 : 10501;
- }
- $scope.tempData[val.saveKey] = val.content;
- } else {
- $scope.tempData[val.saveKey] = val.content;
- }
- })
- console.log(tempImages);
- $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;
- }
- var submitTaskAction = false;
- $scope.submitTask = function () {
- 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') {
- 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 = "";
- }
- senddata.data.permissionvalue = permissionvalue;
- console.log(senddata);
- taskModuleService.releaseOrEditTask(senddata).then(function (res) {
- console.log(res);
- if (res.code == 3350) {
- if (res.data.remark == "已存在同名需求") {
- if ($scope.app) {
- UtilService.showMess("已存在同名需求!");
- } else {
- CommonService.showMessage("已存在同名需求!", $scope);
- }
- } else {
- if (JSON.stringify($stateParams.data) != '{}') {
- $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.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;
- }
- var submitTaskDocking = false;
- $scope.submitTaskDocking = function () {
- if (submitTaskDocking) {
- return;
- }
- submitTaskDocking = 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 (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') {
- 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);
- }
- }
- submitTaskDocking = false;
- 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;
- $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();
- }
- $scope.hideLoadingToast();
- })
- })
- }
- 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' && ($scope.formList[i - 1].content == '10502' || $scope.formList[i - 1].content == '否')) {
- continue;
- }
- if (val.type == 'upload') {
- console.log(val.content == '');
- console.log(val.type == 'upload');
- console.log(val.imagelist.length == 0);
- }
- 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;
- }
- }
- 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($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;
- // console.log($scope.agree);
- 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;
- }
- $scope.checkData.authorityid = UserService.id;
- // console.log($scope.checkData);
- $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 (index, outerIndex) { //传递一个参数(图片的URl)
- // console.log('aaa');
- $(function () {
- $('div.pinch-zoom').each(function () {
- new RTP.PinchZoom($(this), {});
- });
- });
- $scope.imagelist = $scope.formList[outerIndex].imagelist;
- $scope.bigImage = true;//显示大图
- $ionicSlideBoxDelegate.update();//重绘,让图片显示出来
- //图片总数量
- setTimeout(function () {
- $ionicSlideBoxDelegate.$getByHandle('slide_detail').slide(index, -10);
- //获取图片
- var imgObj = document.getElementsByClassName('bigimage');
- var n;
- for (n = 0; n < imgObj.length; n++) {
- // 获取图片的原始高度和宽度
- var oldWid = imgObj[n].naturalWidth;
- var oldHei = imgObj[n].naturalHeight;
- var screen = document.body.offsetWidth;
- var screenH = window.innerHeight;
- // console.log(oldWid / oldHei);
- // console.log(screen);
- var rate = oldWid / oldHei;
- if (oldWid >= screen && oldHei >= screenH) {
- var tw = screen;
- var th = tw / rate;
- if (th < screenH) {
- imgObj[n].style.width = tw + 'px';
- imgObj[n].style.height = th + 'px';
- imgObj[n].style.marginTop = (screenH - th) / 2 + 'px';
- } else {
- imgObj[n].style.width = screenH * rate + 'px';
- imgObj[n].style.height = screenH + 'px';
- imgObj[n].style.marginLeft = (screen - screenH * rate) / 2 + 'px';
- }
- } else if (oldWid >= screen && oldHei <= screenH) {
- imgObj[n].style.width = screen + 'px';
- imgObj[n].style.height = screen / rate + 'px';
- imgObj[n].style.marginTop = (screenH - screen / rate) / 2 + 'px';
- } else if (oldWid <= screen && oldHei >= screenH) {
- // var hh=screenH;
- // var ww=screenH*rate;
- imgObj[n].style.width = screenH * rate + 'px';
- imgObj[n].style.height = screenH + 'px';
- imgObj[n].style.marginLeft = (screen - screenH * rate) / 2 + 'px';
- } else {
- imgObj[n].style.width = oldWid + 'px';
- imgObj[n].style.height = oldHei + 'px';
- imgObj[n].style.marginLeft = (screen - oldWid) / 2 + 'px';
- imgObj[n].style.marginTop = (screenH - oldHei) / 2 + 'px';
- }
- }
- }, 500);
- };
- 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;
- }
- }])
- ;
|