1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732 |
- angular.module('push')
- .controller('technicalBrokerAddCompanyInfoCtrl', function ($scope,$stateParams,$ionicActionSheet,$ionicSlideBoxDelegate, UtilService,AccountService,ActivityService,
- UserService,$ionicScrollDelegate,$timeout,ModelService,CloudFolderService,
- DockingService, TechnicalBrokerPublishTrainService,
- $ionicModal,SqliteStorageService,$ionicPopup,ConfigService) {
- // 信息来源,1是企业自己填写,2是对接宝的走企业模板
- $scope.sourcetype = 2;
- // 图片总数
- $scope.pictotal = 0;
- // 由哪个任务进入
- $scope.taskid = $stateParams.taskid;
- // 传入的企业id
- $scope.companyid = $stateParams.companyid;
- $scope.imagelist = [];
- $scope.enterCompanyInfo={
- delproductInfo: "",// 删除的产品信息
- deldemandInfo: "",// 删除的产品信息
- productInfoimagelist:[],// app端图片插件进行传递的变量(产品图片)
- greatProduceInfoimagelist:[],// app端图片插件进行传递的变量(高新产品图片)
- demandInfoimagelist:[],// app端图片插件进行传递的变量(需求图片)
- talentInfoimagelist:[]// app端图片插件进行传递的变量(人才图片)
- };
- $scope.companyimagelist = [];
- $scope.delproductInfo = "";
- $scope.deldemandInfo = "";
- $scope.delresearchInfo = "";
- $scope.delprojectCenterInfo = "";
- $scope.delrealInfo = "";
- $scope.delgreatProduceInfoList = "";
- $scope.deladviceInfoList="";
- $scope.delexperienceInfoList="";
- $scope.delpatentInfoList="";
- $scope.deltalentInfoList="";
- //初始化云文件夹列表
- $scope.checkdefolder = [];
- var initCloudFolderList = function () {
- // 0,查询所有文件夹,1查询通用文件夹,2查询走企业模板文件夹
- var templettype = 2;
- DockingService.newGetComFolderList(templettype).then(function (response) {
- $scope.cloudFolderList = response.folderlist;
- ModelService.setCloudFolderList($scope.cloudFolderList);
- // 云文件夹
- $scope.folderlist = angular.copy(ModelService.getCloudFolderList());
- //默认选择文件夹
- console.log("1:"+$scope.folderlist.length);
- if($scope.folderlist.length > 0){
- $scope.checkdefolder = $scope.folderlist[0];
- $scope.checkfolder = $scope.folderlist[0].id + "";
- }
- }, function () {
- })
- };
- initCloudFolderList();
- //企业基本信息
- $scope.connEnterpriseModuleModel = {
- userid: 0,
- usercomefrom: "",
- claid: 0,// 选中的文件夹id
- taskid: 0,// 任务id
- yearsetupid: 0,
- yearsetupname: "",
- company: {
- companyid: 0,
- companyname: "",
- contact: "",
- contactnum: "",
- categoryid: "",
- categoryName: "",
- rdinstitutiontype: 0,// 企业研发机构等级
- rdinstitutiontypeName: "",// 企业研发机构等级
- ishigh: 0,// 是否高企
- logo: "",// 企业logo
- high:true,
- ishighInfo:"是",
- images: "",// 传到后台的图片json
- delimages: "",// 删除的图片
- imagelist: []// app端图片插件进行传递的变量
- },
- // 工程中心信息
- projectCenterInfoListJson: "",
- // 研发投入
- researchInfoListJson: "",
- // 实际收入
- realInfoListJson: "",
- // 产品信息
- produceInfoListJson: "",
- // 高新产品
- greatProduceInfoListJson: "",
- // 需求信息
- techrequirelistJson: "",
- // 重大科研项目
- importantProjectListJson: "",
- // 项目建议
- adviceInfoListJson: "",
- // 产学研经验
- experienceInfoListJson: "",
- // 人才
- talentInfoListJson: "",
- // 专利
- intellectualListJson: "",
- };
- $scope.connEnterpriseModuleModel1 = {
- userid: 0,
- usercomefrom: ""
- };
- //产品信息
- $scope.produceInfoList = [{
- id: 0,
- productname: "",// 产品名称
- productdescription: ""//产品描述
- }];
- //高新产品
- $scope.greatProduceInfoList= [{
- id: 0,
- productname: "",// 产品名称
- productdescription: ""//产品描述
- }];
- //需求信息
- $scope.demandInfoList=[{
- id: 0,
- companyid: 0,
- techtype: 0,
- techtypename: "",
- techrequirementname: "",
- cooperationmodel: "",
- cooperationmodelName: "",// 合作模式名称
- capitalScale: "",
- techrequirementdetail: "",
- images: "", // 图片
- demandInfoimagelist:[],// app端图片插件进行传递的变量(需求图片)
- }];
- //工程中心信息
- $scope.projectCenterInfoList= [{
- id: 0,
- yid: 0,
- yearsetupname: "",// 选择项名称
- yvalue1: ""// 金额
- }];
- //研发投入信息
- $scope.researchInfoList = [{
- id: 0,
- yid: 0,
- yearsetupname: "",// 选择项名称
- yvalue1: ""// 金额
- }];
- //实际收入与预计投入信息
- $scope.realInfoList= [{
- id: 0,
- yid: 0,
- yearsetupname: "",//选择项名称
- yvalue1: "",// 销售收入
- yvalue2: "",// 净利润
- yvalue3: "" // 上缴税收
- }];
- //重大科研项目信息
- $scope.importantProjectList= [{
- id: 0,
- yid: 0,
- yearsetupname: "",// 选择项名称
- yvalue1: ""// 项目内容
- }];
- //项目建议
- $scope.adviceInfoList= [{
- id: 0,
- projectname: "",//
- projectdescription: "",//
- projectsuggest: ""// 申报项目建议
- }];
- //产学研经验
- $scope.experienceInfoList=[{
- id: 0,
- cooperateschool: "",// 合作院校
- cooperatedetail: ""// 合作内容
- }];
- //人才
- $scope.talentInfoList=[{
- id: 0,
- name: "",// 人才姓名
- tel: "",// 手机号
- position: "",// 职位
- academicdegree: 0,// 学位
- academicdegreeName: "",// 学位名称
- responsible: "",// 负责工作
- about: ""// 人才简介
- }];
- //专利
- $scope.patentInfoList=[{
- id: 0,
- intellectualpropertyname: "",// 名称
- applyperson: "",// 主要完成人
- licensenumber: "",// 申请号/授权号
- // licensedate: ""// 授权日期
- }];
- //产品图片
- $scope.productInfoimagelist = [];
- //高新产品图片
- $scope.greatProduceInfoimagelist=[];
- //需求图片
- // $scope.demandInfoimagelist = [];
- //人才图片
- $scope.talentInfoimagelist = [];
- //切换到对应页面
- var activity=['baseInfo','productInfo','demandInfo','projectInfo','personnelAbilityInfo','patentInfo'];
- $scope.act = activity[0];
- $scope.changeAct = function (num) {
- if (num == 0) {
- $scope.act = activity[num];
- } else if (num == 1) {
- $scope.act = activity[num];
- }else if (num == 2) {
- $scope.act = activity[num];
- }
- else if (num == 3) {
- $scope.act = activity[num];
- }
- else if (num == 4) {
- $scope.act = activity[num];
- }
- else if (num == 5) {
- $scope.act = activity[num];
- }
- };
- $scope.watchIsChange=function () {
- if($scope.connEnterpriseModuleModel.company.high==true){
- $scope.connEnterpriseModuleModel.company.ishighInfo="是";
- $scope.connEnterpriseModuleModel.company.ishigh=1;
- }else{
- $scope.connEnterpriseModuleModel.company.ishighInfo="否";
- $scope.connEnterpriseModuleModel.company.ishigh=0;
- }
- };
- // 获取传入的企业id对应的企业信息
- var companyid = $scope.companyid;
- // 获取参与企业详细信息
- var getCompanyInfo = function () {
- $scope.showLoadingToast();
- ActivityService.getCompanyInfo(companyid).then(function (response) {
- // console.log(response);
- if (angular.isDefined(response.company) && response.company.length > 0) {
- $scope.company = response.company[0];
- $scope.connEnterpriseModuleModel.company.logo = $scope.company.logo;
- $scope.connEnterpriseModuleModel.company.companyname = $scope.company.companyname;
- $scope.connEnterpriseModuleModel.company.categoryName = $scope.company.categoryname;
- $scope.connEnterpriseModuleModel.company.contact = $scope.company.contact;
- $scope.connEnterpriseModuleModel.company.contactnum = $scope.company.contactnum;
- $scope.connEnterpriseModuleModel.company.rdinstitutiontypeName = $scope.company.rdinstitutiontypename;
- $scope.connEnterpriseModuleModel.company.ishigh = $scope.company.ishigh;
- if($scope.connEnterpriseModuleModel.company.ishigh==1){
- $scope.connEnterpriseModuleModel.company.ishighInfo="是";
- $scope.connEnterpriseModuleModel.company.high=true;
- }else if($scope.connEnterpriseModuleModel.company.ishigh==0){
- $scope.connEnterpriseModuleModel.company.ishighInfo="否";
- $scope.connEnterpriseModuleModel.company.high=false;
- }
- }
- $scope.hideLoadingToast();
- }, function () {
- $scope.hideLoadingToast();
- })
- };
- getCompanyInfo();
- // 获取工程中心信息的通用年份配置列表
- var projectcenterinfoyearbuttons = [];
- var getProjectCenterInfoYearMultiSetupList = function () {
- TechnicalBrokerPublishTrainService.getYearMultiSetupList(3).then(function (response) {
- // console.log(response);
- if (UtilService.isDefined(response) && response.length > 0) {
- angular.forEach(response, function (value, index) {
- var temphtml = {
- text: '<a class="action-sheet-push">' + value.setupname + '</a>',
- yearsetupid: value.id,
- yearsetupname: value.setupname
- };
- projectcenterinfoyearbuttons.push(temphtml);
- });
- }
- }, function () {
- })
- };
- getProjectCenterInfoYearMultiSetupList();
- //选择工程中心信息的通用年份配置列表
- $scope.showProjectCenterInfoYearSetup = function (ind) {
- $ionicActionSheet.show({
- buttons: projectcenterinfoyearbuttons,
- cancelText: '取消',
- buttonClicked: function (index) {
- $scope.projectCenterInfoList[ind].yid = projectcenterinfoyearbuttons[index].yearsetupid;
- $scope.projectCenterInfoList[ind].yearsetupname = projectcenterinfoyearbuttons[index].yearsetupname;
- return true;
- }
- });
- };
- // 获取研发投入的通用年份配置列表
- var researchinfoyearbuttons = [];
- var getResearchInfoYearMultiSetupList = function () {
- TechnicalBrokerPublishTrainService.getYearMultiSetupList(1).then(function (response) {
- // console.log(response);
- if (UtilService.isDefined(response) && response.length > 0) {
- angular.forEach(response, function (value, index) {
- var temphtml = {
- text: '<a class="action-sheet-push">' + value.setupname + '</a>',
- yearsetupid: value.id,
- yearsetupname: value.setupname
- };
- researchinfoyearbuttons.push(temphtml);
- });
- }
- }, function () {
- })
- };
- getResearchInfoYearMultiSetupList();
- //选择研发投入的通用年份配置列表
- $scope.showResearchInfoYearSetup = function (ind) {
- $ionicActionSheet.show({
- buttons: researchinfoyearbuttons,
- cancelText: '取消',
- buttonClicked: function (index) {
- $scope.researchInfoList[ind].yid = researchinfoyearbuttons[index].yearsetupid;
- $scope.researchInfoList[ind].yearsetupname = researchinfoyearbuttons[index].yearsetupname;
- return true;
- }
- });
- };
- // 获取实际收入的通用年份配置列表
- var realinfoyearbuttons = [];
- var getRealInfoYearMultiSetupList = function () {
- TechnicalBrokerPublishTrainService.getYearMultiSetupList(2).then(function (response) {
- // console.log(response);
- if (UtilService.isDefined(response) && response.length > 0) {
- angular.forEach(response, function (value, index) {
- var temphtml = {
- text: '<a class="action-sheet-push">' + value.setupname + '</a>',
- yearsetupid: value.id,
- yearsetupname: value.setupname
- };
- realinfoyearbuttons.push(temphtml);
- });
- }
- }, function () {
- })
- };
- getRealInfoYearMultiSetupList();
- //选择实际收入的通用年份配置列表
- $scope.showRealInfoYearSetup = function (ind) {
- $ionicActionSheet.show({
- buttons: realinfoyearbuttons,
- cancelText: '取消',
- buttonClicked: function (index) {
- $scope.realInfoList[ind].yid = realinfoyearbuttons[index].yearsetupid;
- $scope.realInfoList[ind].yearsetupname = realinfoyearbuttons[index].yearsetupname;
- return true;
- }
- });
- };
- // 获取重大科研项目的通用年份配置列表
- var importantprojectbuttons = [];
- var getImportantProjectYearMultiSetupList = function () {
- TechnicalBrokerPublishTrainService.getYearMultiSetupList(4).then(function (response) {
- // console.log(response);
- if (UtilService.isDefined(response) && response.length > 0) {
- angular.forEach(response, function (value, index) {
- var temphtml = {
- text: '<a class="action-sheet-push">' + value.setupname + '</a>',
- yearsetupid: value.id,
- yearsetupname: value.setupname
- };
- importantprojectbuttons.push(temphtml);
- });
- }
- }, function () {
- })
- };
- getImportantProjectYearMultiSetupList();
- //选择重大科研项目的通用年份配置列表
- $scope.showImportantProjectYearSetup = function (ind) {
- $ionicActionSheet.show({
- buttons: importantprojectbuttons,
- cancelText: '取消',
- buttonClicked: function (index) {
- $scope.importantProjectList[ind].yid = importantprojectbuttons[index].yearsetupid;
- $scope.importantProjectList[ind].yearsetupname = importantprojectbuttons[index].yearsetupname;
- return true;
- }
- });
- };
- // 获取需求的合作模式列表
- var cooperationmodelbuttons = [];
- var getCooperationmodelList = function () {
- TechnicalBrokerPublishTrainService.getCooperationmodelList().then(function (response) {
- if (UtilService.isDefined(response) && response.length > 0) {
- angular.forEach(response, function (value, index) {
- var temphtml = {
- text: '<a class="action-sheet-push">' + value.itemkey + '</a>',
- cooperationmodel: value.itemvalue,
- cooperationmodelName: value.itemkey
- };
- cooperationmodelbuttons.push(temphtml);
- });
- // console.log(cooperationmodelbuttons);
- }
- }, function () {
- })
- };
- getCooperationmodelList();
- //选择需求的合作模式列表
- $scope.showCooperationmodelStatus = function (ind) {
- $ionicActionSheet.show({
- buttons: cooperationmodelbuttons,
- cancelText: '取消',
- buttonClicked: function (index) {
- $scope.demandInfoList[ind].cooperationmodel = cooperationmodelbuttons[index].cooperationmodel;
- $scope.demandInfoList[ind].cooperationmodelName = cooperationmodelbuttons[index].cooperationmodelName;
- return true;
- }
- });
- };
- // 获取需求的需求类型列表
- var techtypebuttons = [];
- var getTechtypeList = function () {
- TechnicalBrokerPublishTrainService.getTechtypeList().then(function (response) {
- if (UtilService.isDefined(response) && response.length > 0) {
- angular.forEach(response, function (value, index) {
- var temphtml = {
- text: '<a class="action-sheet-push">' + value.itemkey + '</a>',
- techtype: value.itemvalue,
- techtypename: value.itemkey
- };
- techtypebuttons.push(temphtml);
- });
- // console.log(cooperationmodelbuttons);
- }
- }, function () {
- })
- };
- getTechtypeList();
- //选择需求的需求类型
- $scope.showTechtype = function (ind) {
- $ionicActionSheet.show({
- buttons: techtypebuttons,
- cancelText: '取消',
- buttonClicked: function (index) {
- $scope.demandInfoList[ind].techtype = techtypebuttons[index].techtype;
- $scope.demandInfoList[ind].techtypename = techtypebuttons[index].techtypename;
- return true;
- }
- });
- };
- // 获取人才的学位列表
- var academicdegreebuttons = [];
- var getAcademicdegreeList = function () {
- TechnicalBrokerPublishTrainService.getAcademicdegreeList().then(function (response) {
- if (UtilService.isDefined(response) && response.length > 0) {
- angular.forEach(response, function (value, index) {
- var temphtml = {
- text: '<a class="action-sheet-push">' + value.itemkey + '</a>',
- academicdegree: value.itemvalue,
- academicdegreeName: value.itemkey
- };
- academicdegreebuttons.push(temphtml);
- });
- // console.log(academicdegreebuttons);
- }
- }, function () {
- })
- };
- getAcademicdegreeList();
- //选择人才的学位列表
- $scope.showAcademicdegreeStatus = function (ind) {
- $ionicActionSheet.show({
- buttons: academicdegreebuttons,
- cancelText: '取消',
- buttonClicked: function (index) {
- $scope.talentInfoList[ind].academicdegree = academicdegreebuttons[index].academicdegree;
- $scope.talentInfoList[ind].academicdegreeName = academicdegreebuttons[index].academicdegreeName;
- return true;
- }
- });
- };
- // 弹出获取企业logo
- //!******************* logo上传图片 *******************
- $scope.show_logo = function () {
- $ionicActionSheet.show({
- cancelOnStateChange: true,
- cssClass: 'action_s',
- cancelText: '取消',
- buttons: [
- {text: "拍照"},
- {text: "从相册上传"}
- ],
- buttonClicked: function (index) {
- if (index == 0) {
- openCamera(1,1);
- } else {
- openCamera(0,1);
- }
- return true;
- },
- destructiveButtonClicked: function () {
- return true;
- }
- });
- };
- var openCamera = function (srcType) {
- var options = {
- // Some common settings are 20, 50, and 100
- quality: 50,
- destinationType: Camera.DestinationType.FILE_URI,
- // In this app, dynamically set the picture source, Camera or photo gallery
- sourceType: srcType,
- encodingType: Camera.EncodingType.JPEG,
- mediaType: Camera.MediaType.PICTURE,
- allowEdit: false,
- correctOrientation: true //Corrects Android orientation quirks
- };
- navigator.camera.getPicture(function (imageData) {
- $scope.imgurl = imageData;
- $scope.showLoadingToast();
- UtilService.uploadFile([imageData], 0, "image/jpeg").then(function (response) {
- // 企业logo
- $scope.connEnterpriseModuleModel.company.logo = response[0].userPhoto;
- $scope.hideLoadingToast();
- }, function () {
- $scope.hideLoadingToast();
- });
- }, function (message) {
- }, options);
- };
- // ****** 单信息图片 ******
- $scope.openCamera = function () {
- if ($scope.imagelist.length >= 9) {
- UtilService.showMess("最多选取9张图片");
- return;
- }
- UtilService.getPicture(1).then(function (results) {
- // console.log(results);
- $scope.imagelist.push({photo_name: results, original_name: results});
- $scope.totalImglength = 600 * $scope.imagelist.length;
- $ionicScrollDelegate.$getByHandle("scrollimage").resize();
- }, function (err) {
- });
- };
- $scope.show = function () {
- $ionicActionSheet.show({
- buttons: [
- {text: '<a class="action-sheet-push">相册中添加照片</a>'},
- {text: '<a class="action-sheet-push">拍照</a>'}
- ],
- cancelText: '取消',
- buttonClicked: function (index) {
- if (index == 0) {
- getPictures();
- } else if (index == 1) {
- $scope.openCamera();
- }
- return true;
- }
- });
- };
- var verifyStorage = function () {
- window.imagePicker.verifyStorage(
- function (results) {
- if (results == "1") {
- getPic();
- }
- }, function (error) {
- }
- );
- };
- var getPic = function () {
- if ($scope.imagelist.length >= 9) {
- UtilService.showMess("最多选取9张图片");
- return;
- }
- UtilService.getPictureList(9 - $scope.imagelist.length).then(function (results) {
- // console.log(results);
- angular.forEach(results, function (value, index) {
- $scope.imagelist.push({photo_name: value, original_name: value})
- });
- $scope.totalImglength = 600 * $scope.imagelist.length;
- $ionicScrollDelegate.$getByHandle("scrollimage").resize();
- }, function (err) {
- });
- };
- var getPictures = function () {
- if (device.platform == "Android") {
- verifyStorage();
- } else {
- getPic();
- }
- };
- //点击图片放大
- $scope.bigImage = false; //初始默认大图是隐藏的
- $scope.hideBigImage = function () {
- if($scope.app){
- $scope.setStatusBar(0);
- }
- $timeout(function () {
- $scope.bigImage = false;
- }, 400);
- };
- $scope.shouBigImage = function (index) { //传递一个参数(图片的URl)
- if($scope.app){
- $scope.setStatusBar(1);
- }
- $(function () {
- $('div.pinch-zoom').each(function () {
- new RTP.PinchZoom($(this), {});
- });
- });
- $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 cc = screen / (oldWid / oldHei);
- imgObj[n].style.height = cc + 'px';
- if (cc < screenH) {
- imgObj[n].style.marginTop = (screenH - cc) / 2 + 'px';
- // console.log("e:"+imgObj[n].style.marginTop);
- } else {
- imgObj[n].style.marginTop = 0 + 'px';
- // console.log((cc-screenH) +'px')
- }
- }
- }, 10);
- };
- //删除图片
- $scope.deletePhoto = function (index) {
- $scope.imagelist.splice(index, 1);
- };
- // ****** 多模块图片 ******
- /*// 弹出获取产品图片
- $scope.showProductImage = function () {
- $ionicActionSheet.show({
- cancelOnStateChange: true,
- cssClass: 'action_s',
- cancelText: '取消',
- buttons: [
- {text: "拍照"},
- {text: "从相册上传"}
- ],
- buttonClicked: function (index) {
- if (index == 0) {
- openCamera(1,2);
- } else {
- openCamera(0,2);
- }
- return true;
- },
- destructiveButtonClicked: function () {
- return true;
- }
- });
- };
- // 弹出获取需求图片
- $scope.showDemandImage = function () {
- $ionicActionSheet.show({
- cancelOnStateChange: true,
- cssClass: 'action_s',
- cancelText: '取消',
- buttons: [
- {text: "拍照"},
- {text: "从相册上传"}
- ],
- buttonClicked: function (index) {
- if (index == 0) {
- openCamera(1,3);
- } else {
- openCamera(0,3);
- }
- return true;
- },
- destructiveButtonClicked: function () {
- return true;
- }
- });
- };
- //!******************* 各区块加图片 *******************
- $scope.openCamera = function (ind) {
- if ($scope.demandInfoList.demandInfoimagelist.length >= 9) {
- UtilService.showMess("最多选取9张图片");
- return;
- }
- UtilService.getPicture(1).then(function (results) {
- // console.log(results);
- $scope.demandInfoList[ind].demandInfoimagelist.push({photo_name: results, original_name: results});
- $scope.totalImglength = 600 * $scope.demandInfoList[ind].demandInfoimagelist.length;
- $ionicScrollDelegate.$getByHandle("scrollimage").resize();
- }, function (err) {
- });
- };
- $scope.show = function (ind) {
- $ionicActionSheet.show({
- buttons: [
- {text: '<a class="action-sheet-push">相册中添加照片</a>'},
- {text: '<a class="action-sheet-push">拍照</a>'}
- ],
- cancelText: '取消',
- buttonClicked: function (index) {
- if (index == 0) {
- getPictures(ind);
- } else if (index == 1) {
- $scope.openCamera(ind);
- }
- return true;
- }
- });
- };
- var getPictures = function (ind) {
- if (device.platform == "Android") {
- verifyStorage(ind);
- } else {
- getPic(ind);
- }
- };
- var verifyStorage = function (ind) {
- window.imagePicker.verifyStorage(
- function (results) {
- if (results == "1") {
- getPic(ind);
- }
- }, function (error) {
- }
- );
- };
- var getPic = function (ind) {
- //产品图片
- if ($scope.productInfoimagelist.length >= 9) {
- UtilService.showMess("最多选取9张图片");
- return;
- }
- UtilService.getPictureList(9 - $scope.productInfoimagelist.length).then(function (results) {
- // console.log(results);
- angular.forEach(results, function (value, index) {
- $scope.productInfoimagelist.push({photo_name: value, original_name: value})
- });
- $scope.totalImglength = 600 * $scope.productInfoimagelist.length;
- $ionicScrollDelegate.$getByHandle("scrollimage").resize();
- }, function (err) {
- });
- //需求图片
- if ($scope.demandInfoList[ind].demandInfoimagelist.length >= 9) {
- UtilService.showMess("最多选取9张图片");
- return;
- }
- UtilService.getPictureList(9 - $scope.demandInfoList[ind].demandInfoimagelist.length).then(function (results) {
- // console.log(results);
- angular.forEach(results, function (value, index) {
- $scope.pictotal = $scope.pictotal + 1;
- $scope.demandInfoList[ind].demandInfoimagelist.push({photo_name: value, original_name: value});
- });
- $scope.totalImglength = 600 * $scope.demandInfoList[ind].demandInfoimagelist.length;
- $ionicScrollDelegate.$getByHandle("scrollimage").resize();
- }, function (err) {
- });
- };
- //点击产品图片放大
- $scope.bigImageProduct=false; //初始默认大图是隐藏的
- $scope.hideBigImageProduct = function () {
- $scope.setStatusBar(0);
- $timeout(function () {
- $scope.bigImageProduct = false;
- }, 400);
- };
- //点击需求图片放大
- $scope.bigImageDemand=false; //初始默认大图是隐藏的
- $scope.hideBigImageProduct = function () {
- $scope.setStatusBar(0);
- $timeout(function () {
- $scope.bigImageDemand = false;
- }, 400);
- };
- $scope.shouBigImage = function (index) { //传递一个参数(图片的URl)
- $scope.setStatusBar(1);
- $(function () {
- $('div.pinch-zoom').each(function () {
- new RTP.PinchZoom($(this), {});
- });
- });
- $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 cc = screen / (oldWid / oldHei);
- imgObj[n].style.height = cc + 'px';
- if (cc < screenH) {
- imgObj[n].style.marginTop = (screenH - cc) / 2 + 'px';
- // console.log("e:"+imgObj[n].style.marginTop);
- } else {
- imgObj[n].style.marginTop = 0 + 'px';
- // console.log((cc-screenH) +'px')
- }
- }
- }, 10);
- };
- //删除产品图片
- $scope.deleteProductPhoto = function (index) {
- $scope.productInfoInfoimagelist.splice(index, 1);
- };
- //删除需求图片
- $scope.deleteDemandPhoto = function (ind, index) {
- $scope.pictotal = $scope.pictotal - 1;
- $scope.demandInfoList[ind].demandInfoimagelist.splice(index, 1);
- };
- */
- //选择企业产业领域
- var buttonsIndustryStatus = [
- {text: "汽车制造",
- stausName:"汽车制造",
- stausId: "A"
- },
- {text: "能源及节能技术",
- stausName:"能源及节能技术",
- stausId: "B"
- },
- {text: "新材料",
- stausName:"新材料",
- stausId: "C"
- },
- {text: "生物与新医药",
- stausName:"生物与新医药",
- stausId: "D"
- },
- {text: "电子信息",
- stausName:"电子信息",
- stausId: "E"
- },
- {text: "先进制造及高端装备",
- stausName:"先进制造及高端装备",
- stausId: "F"
- },
- {text: "资源及环境技术",
- stausName:"资源及环境技术",
- stausId: "G"
- }
- ];
- $scope.showIndustryStatus=function () {
- $ionicActionSheet.show({
- cancelOnStateChange: true,
- cssClass: 'action_s',
- cancelText: '取消',
- buttons: buttonsIndustryStatus,
- buttonClicked: function (index) {
- $scope.connEnterpriseModuleModel.company.categoryid = buttonsIndustryStatus[index].stausId;
- $scope.connEnterpriseModuleModel.company.categoryName = buttonsIndustryStatus[index].stausName;
- return true;
- },
- destructiveButtonClicked: function () {
- return true;
- }
- });
- };
- //选择研发机构等级
- var buttonsResearchStatus = [
- { text: "国家级",
- ResearchStatusName:"国家级",
- ResearchStatusId: "1"
- },
- { text: "省级",
- ResearchStatusName:"省级",
- ResearchStatusId: "2"
- },
- { text: "市级",
- ResearchStatusName:"市级",
- ResearchStatusId: "3"
- },
- { text: "区级",
- ResearchStatusName:"区级",
- ResearchStatusId: "4"
- }
- ];
- $scope.showResearchStatus=function () {
- $ionicActionSheet.show({
- cancelOnStateChange: true,
- cssClass: 'action_s',
- cancelText: '取消',
- buttons: buttonsResearchStatus,
- buttonClicked: function (index) {
- $scope.connEnterpriseModuleModel.company.rdinstitutiontype = buttonsResearchStatus[index].ResearchStatusId;
- $scope.connEnterpriseModuleModel.company.rdinstitutiontypeName = buttonsResearchStatus[index].ResearchStatusName;
- return true;
- },
- destructiveButtonClicked: function () {
- return true;
- }
- });
- };
- //选择需求标签
- var demandLabels = [
- { text: "标签A",
- demandLabelName:"标签A",
- demandLabelId: "0"
- },
- { text: "标签B",
- demandLabelName:"标签B",
- demandLabelId: "1"
- },
- { text: "标签C",
- demandLabelName:"标签C",
- demandLabelId: "2"
- },
- { text: "标签D",
- demandLabelName:"标签D",
- demandLabelId: "3"
- }
- ];
- $scope.showDemandLabelName=function () {
- $ionicActionSheet.show({
- cancelOnStateChange: true,
- cssClass: 'action_s',
- cancelText: '取消',
- buttons: demandLabels,
- buttonClicked: function (index) {
- $scope.demandInfoList.demandLabelId = demandLabels[index].demandLabelId;
- $scope.demandInfoList.demandLabelName = demandLabels[index].demandLabelName;
- return true;
- },
- destructiveButtonClicked: function () {
- return true;
- }
- });
- };
- //添加、删除更多一般产品
- $scope.AddOrDelProductInfo = function (ind) {
- if (ind == 0) {
- $scope.produceInfoList.push({
- id: 0,
- productname: "",// 产品名称
- productdescription: ""//产品描述
- });
- } else {
- if ($scope.produceInfoList[ind].id != 0) {
- delproductInfo.push($scope.produceInfoList[ind].id);
- }
- $scope.produceInfoList.splice(ind, 1);
- }
- };
- //添加、删除更多高新产品
- $scope.AddOrDelGreatProductInfo = function (ind) {
- if (ind == 0) {
- $scope.greatProduceInfoList.push({
- id: 0,
- productname: "",// 产品名称
- productdescription: ""//产品描述
- });
- } else {
- if ($scope.greatProduceInfoList[ind].id != 0) {
- delgreatProduceInfoList.push($scope.greatProduceInfoList[ind].id);
- }
- $scope.greatProduceInfoList.splice(ind, 1);
- }
- };
- //添加、删除更多工程中心信息
- $scope.AddOrDelProjectInfo = function (ind) {
- if (ind == 0) {
- $scope.projectCenterInfoList.push({
- id: 0,
- yid: 0,
- yearsetupname: "",//选择项名称
- yvalue1: ""
- });
- } else {
- if ($scope.projectCenterInfoList[ind].id != 0) {
- delprojectCenterInfo.push($scope.projectCenterInfoList[ind].id);
- }
- $scope.projectCenterInfoList.splice(ind, 1);
- }
- };
- //添加、删除更多研发投入信息
- $scope.AddOrDelResearchInfo = function (ind) {
- if (ind == 0) {
- $scope.researchInfoList.push({
- id: 0,
- yid: 0,
- yearsetupname: "",//选择项名称
- yvalue1: ""
- });
- } else {
- if ($scope.researchInfoList[ind].id != 0) {
- delresearchInfo.push($scope.researchInfoList[ind].id);
- }
- $scope.researchInfoList.splice(ind, 1);
- }
- };
- //添加、删除更多实际研发与投入信息
- $scope.AddOrDelrealInfoInfo= function (ind) {
- if (ind == 0) {
- $scope.realInfoList.push({
- id: 0,
- yid: 0,
- yearsetupname: "",//选择项名称
- yvalue1: "",
- yvalue2: "",
- yvalue3: ""
- });
- } else {
- if ($scope.realInfoList[ind].id != 0) {
- delrealInfo.push($scope.realInfoList[ind].id);
- }
- $scope.realInfoList.splice(ind, 1);
- }
- };
- //添加、删除更多需求
- $scope.AddOrDelDemandInfo = function (ind) {
- if (ind == 0) {
- $scope.demandInfoList.push({
- ind: ind,// 索引值
- id: 0,
- companyid: 0,
- techtype: 0,
- techtypename: "",
- techrequirementname: "",
- cooperationmodel: "",
- capital_scale: "",
- techrequirementdetail: "",
- images: "" // 图片
- });
- } else {
- $scope.demandInfoList.splice(ind, 1);
- }
- };
- //添加、删除更多重大科研项目
- $scope.AddOrDelImportantProjectInfo = function (ind) {
- if (ind == 0) {
- $scope.importantProjectList.push({
- id: 0,
- yid: 0,
- yearsetupname: "",//选择项名称
- yvalue1: ""
- });
- } else {
- if ($scope.importantProjectList[ind].id != 0) {
- deldemandInfo.push($scope.importantProjectList[ind].id);
- }
- $scope.importantProjectList.splice(ind, 1);
- }
- };
- //添加、删除更多项目建议
- $scope.AddOrDelAdviceInfo= function (ind) {
- if (ind == 0) {
- $scope.adviceInfoList.push({
- id: 0,
- projectname: "",//
- projectdescription: "",//
- projectsuggest: ""// 申报项目建议
- });
- } else {
- if ($scope.adviceInfoList[ind].id != 0) {
- deladviceInfoList.push($scope.adviceInfoList[ind].id);
- }
- $scope.adviceInfoList.splice(ind, 1);
- }
- };
- //添加、删除更多产学研经验
- $scope.AddOrexperienceInfo= function (ind) {
- if (ind == 0) {
- $scope.experienceInfoList.push({
- id: 0,
- cooperateschool: "",// 合作院校
- cooperatedetail: ""// 合作内容
- });
- } else {
- if ($scope.experienceInfoList[ind].id != 0) {
- delexperienceInfoList.push($scope.experienceInfoList[ind].id);
- }
- $scope.experienceInfoList.splice(ind, 1);
- }
- };
- //添加、删除更多专利
- $scope.AddOrDelpatentInfo= function (ind) {
- if (ind == 0) {
- $scope.patentInfoList.push({
- id: 0,
- intellectualpropertyname: "",// 名称
- applyperson: "",// 主要完成人
- licensenumber: "",// 申请号/授权号
- // licensedate: ""// 授权日期
- });
- } else {
- if ($scope.patentInfoList[ind].id != 0) {
- delpatentInfoList.push($scope.patentInfoList[ind].id);
- }
- $scope.patentInfoList.splice(ind, 1);
- }
- };
- //添加、删除更多人才信息
- $scope.AddOrDelTalentInfo= function (ind) {
- if (ind == 0) {
- $scope.talentInfoList.push({
- id: 0,
- name: "",// 人才姓名
- tel: "",// 手机号
- position: "",// 职位
- academicdegree: 0,// 学位
- academicdegreeName: "",// 学位名称
- responsible: "",// 负责工作
- about: ""// 人才简介
- });
- } else {
- if ($scope.talentInfoList[ind].id != 0) {
- deltalentInfoList.push($scope.talentInfoList[ind].id);
- }
- $scope.talentInfoList.splice(ind, 1);
- }
- };
- //保存企业信息表
- var saveflg = 0;
- $scope.saveCompanyInfo = function () {
- // 基本信息
- if (!UtilService.isDefined($scope.connEnterpriseModuleModel.company.companyname)) {
- UtilService.showMess("请填写企业名称");
- return;
- }
- if ($scope.connEnterpriseModuleModel.company.companyname.length > 255) {
- UtilService.showMess("企业名称不能超过255个字");
- return;
- }
- if ($scope.connEnterpriseModuleModel.company.contact.length > 255) {
- UtilService.showMess("联系人不能超过255个字");
- return;
- }
- if ($scope.connEnterpriseModuleModel.company.contactnum.length > 255) {
- UtilService.showMess("联系方式不能超过255个字");
- return;
- }
- var result = 1;
- // 工程中心
- if ($scope.projectCenterInfoList.length > 0) {
- angular.forEach($scope.projectCenterInfoList, function (projectCenterInfoList,index) {
- if ($scope.projectCenterInfoList[index].yvalue1.length > 255) {
- result = 0;
- }
- });
- if(result == 0){
- UtilService.showMess("工程中心的年度情况不能超过255个字");
- return;
- }
- }
- // 研发投入
- if ($scope.researchInfoList.length > 0) {
- angular.forEach($scope.researchInfoList, function (researchInfoList,index) {
- if (result == 1 && $scope.researchInfoList[index].yvalue1.length > 255) {
- result = 0;
- }
- });
- if(result == 0){
- UtilService.showMess("研发投入的年度情况不能超过255个字");
- return;
- }
- }
- // 实际收入/预计投入
- if ($scope.realInfoList.length > 0) {
- angular.forEach($scope.realInfoList, function (realInfoList,index) {
- if (result == 1 &&
- ($scope.realInfoList[index].yvalue1.length > 255
- || $scope.realInfoList[index].yvalue2.length > 255
- || $scope.realInfoList[index].yvalue3.length > 255)) {
- result = 0;
- }
- });
- if(result == 0){
- UtilService.showMess("实际收入/预计投入的销售收入、净利润和上缴税收不能超过255个字");
- return;
- }
- }
- // 产品信息
- if ($scope.produceInfoList.length > 0) {
- angular.forEach($scope.produceInfoList, function (produceInfoList,index) {
- if (result == 1 && $scope.produceInfoList[index].productname.length > 255) {
- result = 0;
- }
- });
- if(result == 0){
- UtilService.showMess("产品信息的产品名称不能超过255个字");
- return;
- }
- }
- // 高新产品信息
- if ($scope.greatProduceInfoList.length > 0) {
- angular.forEach($scope.greatProduceInfoList, function (greatProduceInfoList,index) {
- if (result == 1 && $scope.greatProduceInfoList[index].productname.length > 255) {
- result = 0;
- }
- });
- if(result == 0){
- UtilService.showMess("高新产品信息的产品名称不能超过255个字");
- return;
- }
- }
- // 需求信息
- if ($scope.demandInfoList.length > 0) {
- angular.forEach($scope.demandInfoList, function (demandInfoList,index) {
- if (result == 1 &&
- ($scope.demandInfoList[index].techrequirementname.length > 255
- || $scope.demandInfoList[index].capital_scale.length > 255)) {
- result = 0;
- }
- });
- if(result == 0){
- UtilService.showMess("需求信息的需求名称和投入预算不能超过255个字");
- return;
- }
- }
- // 重大科研项目
- if ($scope.importantProjectList.length > 0) {
- angular.forEach($scope.importantProjectList, function (importantProjectList,index) {
- if (result == 1 && $scope.importantProjectList[index].yvalue1.length > 255) {
- result = 0;
- }
- });
- if(result == 0){
- UtilService.showMess("重大科研项目的项目名称不能超过255个字");
- return;
- }
- }
- // 项目建议
- if ($scope.adviceInfoList.length > 0) {
- angular.forEach($scope.adviceInfoList, function (adviceInfoList,index) {
- if (result == 1 && $scope.adviceInfoList[index].projectname.length > 255) {
- result = 0;
- }
- });
- if(result == 0){
- UtilService.showMess("项目建议的项目名称不能超过255个字");
- return;
- }
- }
- // 产学研经验
- if ($scope.experienceInfoList.length > 0) {
- angular.forEach($scope.experienceInfoList, function (experienceInfoList,index) {
- if (result == 1 && $scope.experienceInfoList[index].cooperateschool.length > 255) {
- result = 0;
- }
- });
- if(result == 0){
- UtilService.showMess("产学研经验的已合作院校不能超过255个字");
- return;
- }
- }
- // 人才信息
- if ($scope.talentInfoList.length > 0) {
- angular.forEach($scope.talentInfoList, function (talentInfoList,index) {
- if (result == 1 && $scope.talentInfoList[index].name.length > 50) {
- result = 0;
- }
- if (result == 1 && $scope.talentInfoList[index].tel.length > 30) {
- result = 2;
- }
- if (result == 1 && $scope.talentInfoList[index].position.length > 50) {
- result = 3;
- }
- if (result == 1 && $scope.talentInfoList[index].responsible.length > 255) {
- result = 4;
- }
- });
- if(result == 0){
- UtilService.showMess("人才信息的姓名不能超过50个字");
- return;
- }else if(result == 2){
- UtilService.showMess("人才信息的联系方式不能超过30个字");
- return;
- }else if(result == 3){
- UtilService.showMess("人才信息的职位不能超过50个字");
- return;
- }else if(result == 4){
- UtilService.showMess("人才信息的负责工作不能超过255个字");
- return;
- }
- }
- // 专利信息
- if ($scope.patentInfoList.length > 0) {
- angular.forEach($scope.patentInfoList, function (patentInfoList,index) {
- if (result == 1 && $scope.patentInfoList[index].intellectualpropertyname.length > 255) {
- result = 0;
- }
- if (result == 1 && $scope.patentInfoList[index].applyperson.length > 255) {
- result = 2;
- }
- if (result == 1 && $scope.patentInfoList[index].licensenumber.length > 255) {
- result = 3;
- }
- });
- if(result == 0){
- UtilService.showMess("专利信息的名称不能超过255个字");
- return;
- }else if(result == 2){
- UtilService.showMess("专利信息的主要完成人不能超过255个字");
- return;
- }else if(result == 3){
- UtilService.showMess("专利信息的申请号/专利号不能超过255个字");
- return;
- }
- }
- if (saveflg != 0) {
- return;
- }
- saveflg = 1;
- $scope.showLoadingToast();
- if ($scope.imagelist.length > 0) {
- uploadImages();
- } else {
- saveInfo();
- }
- };
- var tempimages = [];
- var uploadImages = function () {
- tempimages = [];
- var upimages = [];
- angular.forEach($scope.imagelist, function (data) {
- upimages.push(data.photo_name);
- });
- UtilService.uploadFile(upimages, 0, "image/jpeg").then(function (response) {
- // console.log(response);
- angular.forEach(response, function (value) {
- if (value.status) {
- tempimages.push({
- id: 0,
- title: "",
- photo_name: value.userPhoto,
- original_name: value.originalPhoto,
- source_name: value.sourcePhoto,
- source_size: value.source_size
- });
- }
- });
- $timeout(function () {
- saveInfo();
- }, 100);
- }, function () {
- $scope.hideLoadingToast();
- UtilService.showMess("网络不给力,请重试");
- saveflg = 0;
- })
- };
- // 保存企业信息
- var saveInfo = function () {
- // 需求
- if ($scope.demandInfoList.length > 0) {
- angular.forEach($scope.demandInfoList, function (demandInfoList,$index) {
- if (!UtilService.isDefined($scope.demandInfoList[$index].techrequirementname)
- && !UtilService.isDefined($scope.demandInfoList[$index].techrequirementdetail)
- && !UtilService.isDefined($scope.demandInfoList[$index].techtypename)
- && !UtilService.isDefined($scope.demandInfoList[$index].cooperationmodelName)
- && !UtilService.isDefined($scope.demandInfoList[$index].capital_scale)) {
- $scope.demandInfoList.splice($index, 1);
- }
- });
- }
- $scope.connEnterpriseModuleModel.techrequirelistJson = JSON.stringify($scope.demandInfoList);
- // 工程中心
- if ($scope.projectCenterInfoList.length > 0) {
- angular.forEach($scope.projectCenterInfoList, function (projectCenterInfoList,$index) {
- if (!UtilService.isDefined($scope.projectCenterInfoList[$index].yearsetupname)
- && !UtilService.isDefined($scope.projectCenterInfoList[$index].yvalue1)) {
- $scope.projectCenterInfoList.splice($index, 1);
- }
- });
- }
- $scope.connEnterpriseModuleModel.projectCenterInfoListJson = JSON.stringify($scope.projectCenterInfoList);
- // 研发投入
- if ($scope.researchInfoList.length > 0) {
- angular.forEach($scope.researchInfoList, function (researchInfoList,$index) {
- if (!UtilService.isDefined($scope.researchInfoList[$index].yearsetupname)
- && !UtilService.isDefined($scope.researchInfoList[$index].yvalue1)) {
- $scope.researchInfoList.splice($index, 1);
- }
- });
- }
- $scope.connEnterpriseModuleModel.researchInfoListJson = JSON.stringify($scope.researchInfoList);
- // 实际收入
- if ($scope.realInfoList.length > 0) {
- angular.forEach($scope.realInfoList, function (realInfoList,$index) {
- if (!UtilService.isDefined($scope.realInfoList[$index].yearsetupname)
- && !UtilService.isDefined($scope.realInfoList[$index].yvalue1)
- && !UtilService.isDefined($scope.realInfoList[$index].yvalue2)
- && !UtilService.isDefined($scope.realInfoList[$index].yvalue3)) {
- $scope.realInfoList.splice($index, 1);
- }
- });
- }
- $scope.connEnterpriseModuleModel.realInfoListJson = JSON.stringify($scope.realInfoList);
- // 产品信息
- if ($scope.produceInfoList.length > 0) {
- angular.forEach($scope.produceInfoList, function (produceInfoList,$index) {
- if (!UtilService.isDefined($scope.produceInfoList[$index].productname)
- && !UtilService.isDefined($scope.produceInfoList[$index].productdescription)) {
- $scope.produceInfoList.splice($index, 1);
- }
- });
- }
- $scope.connEnterpriseModuleModel.produceInfoListJson = JSON.stringify($scope.produceInfoList);
- // 高新产品
- if ($scope.greatProduceInfoList.length > 0) {
- angular.forEach($scope.greatProduceInfoList, function (greatProduceInfoList,$index) {
- if (!UtilService.isDefined($scope.greatProduceInfoList[$index].productname)
- && !UtilService.isDefined($scope.greatProduceInfoList[$index].productdescription)) {
- $scope.greatProduceInfoList.splice($index, 1);
- }
- });
- }
- $scope.connEnterpriseModuleModel.greatProduceInfoListJson = JSON.stringify($scope.greatProduceInfoList);
- // 重大科研项目
- if ($scope.importantProjectList.length > 0) {
- angular.forEach($scope.importantProjectList, function (importantProjectList,$index) {
- if (!UtilService.isDefined($scope.importantProjectList[$index].yearsetupname)
- && !UtilService.isDefined($scope.importantProjectList[$index].yvalue1)) {
- $scope.importantProjectList.splice($index, 1);
- }
- });
- }
- $scope.connEnterpriseModuleModel.importantProjectListJson = JSON.stringify($scope.importantProjectList);
- // 申报项目建议
- if ($scope.adviceInfoList.length > 0) {
- angular.forEach($scope.adviceInfoList, function (adviceInfoList,$index) {
- if (!UtilService.isDefined($scope.adviceInfoList[$index].projectname)
- && !UtilService.isDefined($scope.adviceInfoList[$index].projectdescription)
- && !UtilService.isDefined($scope.adviceInfoList[$index].projectsuggest)) {
- $scope.adviceInfoList.splice($index, 1);
- }
- });
- }
- $scope.connEnterpriseModuleModel.adviceInfoListJson = JSON.stringify($scope.adviceInfoList);
- // 产学研经验
- if ($scope.experienceInfoList.length > 0) {
- angular.forEach($scope.experienceInfoList, function (experienceInfoList,$index) {
- if (!UtilService.isDefined($scope.experienceInfoList[$index].cooperateschool)
- && !UtilService.isDefined($scope.experienceInfoList[$index].cooperatedetail)) {
- $scope.experienceInfoList.splice($index, 1);
- }
- });
- }
- $scope.connEnterpriseModuleModel.experienceInfoListJson = JSON.stringify($scope.experienceInfoList);
- // 人才
- if ($scope.talentInfoList.length > 0) {
- angular.forEach($scope.talentInfoList, function (talentInfoList,$index) {
- if (!UtilService.isDefined($scope.talentInfoList[$index].name)
- && !UtilService.isDefined($scope.talentInfoList[$index].tel)
- && !UtilService.isDefined($scope.talentInfoList[$index].position)
- && !UtilService.isDefined($scope.talentInfoList[$index].academicdegreeName)
- && !UtilService.isDefined($scope.talentInfoList[$index].responsible)
- && !UtilService.isDefined($scope.talentInfoList[$index].about)) {
- $scope.talentInfoList.splice($index, 1);
- }
- });
- }
- $scope.connEnterpriseModuleModel.talentInfoListJson = JSON.stringify($scope.talentInfoList);
- // 专利
- if ($scope.patentInfoList.length > 0) {
- angular.forEach($scope.patentInfoList, function (patentInfoList,$index) {
- if (!UtilService.isDefined($scope.patentInfoList[$index].intellectualpropertyname)
- && !UtilService.isDefined($scope.patentInfoList[$index].applyperson)
- && !UtilService.isDefined($scope.patentInfoList[$index].licensenumber)) {
- $scope.patentInfoList.splice($index, 1);
- }
- });
- }
- $scope.connEnterpriseModuleModel.intellectualListJson = JSON.stringify($scope.patentInfoList);
- // 所属文件夹
- $scope.connEnterpriseModuleModel.claid = $scope.checkfolder;
- // 任务id
- $scope.connEnterpriseModuleModel.taskid = $scope.taskid;
- // 企业图片
- $scope.connEnterpriseModuleModel.company.images = JSON.stringify(tempimages);
- // console.log($scope.connEnterpriseModuleModel);
- TechnicalBrokerPublishTrainService.saveCompanyInfo($scope.connEnterpriseModuleModel, tempimages).then(function (response) {
- // console.log(response);
- if (response.result == 1) {
- UtilService.showMess("添加成功");
- $timeout(function () {
- // $scope.goback();
- // 添加成功后跳入我的录入
- $scope.go("technicalBrokerEnterCompanyInfo");
- }, 1500);
- } else {
- UtilService.showMess("网络不给力,请重试");
- }
- $scope.hideLoadingToast();
- saveflg = 0;
- }, function () {
- UtilService.showMess("网络不给力,请重试");
- $scope.hideLoadingToast();
- saveflg = 0;
- })
- };
- // 自定义新建分类弹窗
- $scope.showPopup = function () {
- $ionicPopup.show({
- template: "<div style='height: 70px;'>" +
- "<input type='text' maxlength='20' ng-model='folder.name' style='border-radius:4px;border:1px solid #e9e9ea;text-indent: 11px;'>" +
- "<span class='pop_subtitle'>20个字以内,支持中英文,数字。</span>" +
- "</div>",
- title: '新建文件夹',
- scope: $scope,
- buttons: [
- {
- text: '取消',
- type: 'button-default',
- onTap: function () {
- $scope.folder.name = "";
- }
- },
- {
- text: '<span class="pop_right_button">创建</span>',
- type: 'button-positive',
- onTap: function (e) {
- if (!UtilService.isDefined($scope.folder.name)) {
- UtilService.showMess("文件夹名称不能为空");
- e.preventDefault();
- return;
- }
- if ($scope.folder.name == "默认文件夹") {
- UtilService.showMess("默认文件夹已存在");
- e.preventDefault();
- return;
- }
- createFolder();
- }
- }
- ]
- });
- };
- $ionicModal.fromTemplateUrl('templates/modal.html', {
- scope: $scope,
- animation: 'slide-in-up'
- }).then(function (modal) {
- $scope.modal = modal;
- });
- $scope.folder = {name: ""};
- //新建分类
- var crfoflg = 0;
- var createFolder = function () {
- if (crfoflg != 0) {
- return;
- }
- crfoflg = 1;
- var tempdate = UtilService.formatDate();
- var folder = {
- localid: tempdate.timestamp + "",//本地id
- id: 0,
- userid: UserService.id,
- usercomefrom: ConfigService.comefrom,
- name: $scope.folder.name,
- createtime: tempdate.formattime,
- status: 0,
- isCloud: 0,
- synchrotype: 1,// 0:已同步,1:新增,2:修改,3:逻辑删除,4:物理删除
- updatetime: tempdate.formattime,//修改时间
- counts: 0
- };
- SqliteStorageService.insertSingleData("conninfofolder", folder).then(function (response) {
- $scope.folderlist.push(folder);
- $scope.checkdefolder = folder;
- $scope.folder.name = "";
- $scope.modal.hide();
- ModelService.setLocalFolderList($scope.folderlist);
- ModelService.setCheckdeFolder(folder);
- SqliteStorageService.updateEditFlg(1);
- $timeout(function () {
- crfoflg = 0;
- }, 1000);
- }, function () {
- crfoflg = 0;
- });
- };
- //筛选选择文件夹
- angular.forEach($scope.folderlist, function (value, index) {
- if (value.id == $scope.checkdefolder.id) {
- $scope.folderlist[index].value = true;
- }
- });
- //选择分类
- $scope.chooseNewUndid = function (folder, index) {
- angular.forEach($scope.folderlist, function (value, ind) {
- $scope.folderlist[ind].value = false;
- });
- $scope.folderlist[index].value = true;
- $scope.checkdefolder = folder;
- $scope.checkfolder = folder.id + "";
- $scope.modal.hide();
- };
- //返回上一级目录
- $scope.backUpperFolder = function () {
- ModelService.deleteSelectLevelList($scope.level);
- $scope.level--;
- if ($scope.level == 0) {
- $scope.folderlist = angular.copy(ModelService.getCloudFolderList());
- } else {
- var tempfolder = ModelService.getSelectLevelList()[$scope.level];
- queryCloudFolder(tempfolder);
- $scope.currentfoldername = tempfolder.name;
- }
- $scope.checkfolder = "";
- };
- //打开下一级目录
- $scope.openNextFolder = function (folder) {
- $scope.currentfoldername = folder.name;
- $scope.folderlist = [];
- $scope.level = folder.level + 1;
- queryCloudFolder(folder);
- $scope.checkfolder = "";
- };
- //查询云子文件夹
- var queryCloudFolder = function (folder) {
- DockingService.newGetConnInfoList(folder.id, folder.level, 1).then(function (response) {
- // console.log(response);
- $scope.folderlist = response.connFolderlist;
- }, function () {
- })
- };
- //关联相关企业
- $scope.isRelateUl = false;
- $scope.queryLikeName = function () {
- if ($scope.connEnterpriseModuleModel.company.companyname.length == 0) {
- $scope.companylist = [];
- $scope.isRelateUl = false;
- return;
- }
- DockingService.getCampanyListByName($scope.connEnterpriseModuleModel.company.companyname).then(function (response) {
- // console.log(response);
- $scope.companylist = response.companylist;
- $scope.isRelateUl = true;
- }, function () {
- })
- };
- //选中企业
- $scope.setCompanyName = function (company) {
- //<b style='color:red;font-weight: normal;'>亚</b>
- company.companyname = company.companyname.replace("<b style='color:red;font-weight: normal;'>", "");
- company.companyname = company.companyname.replace("</b>", "");
- $scope.connEnterpriseModuleModel.company.companyname = company.companyname;
- $scope.connEnterpriseModuleModel.company.logo = company.logo;
- $scope.connEnterpriseModuleModel.company.contact = company.contact;
- $scope.connEnterpriseModuleModel.company.contactnum = company.contactnum;
- $scope.connEnterpriseModuleModel.company.category = company.category;
- $scope.connEnterpriseModuleModel.company.categoryName = company.categoryname;
- $scope.connEnterpriseModuleModel.company.rdinstitutiontype = company.rdinstitutiontype;
- $scope.connEnterpriseModuleModel.company.rdinstitutiontypeName = company.rdinstitutiontypename;
- $scope.connEnterpriseModuleModel.company.ishigh = company.ishigh;
- if($scope.connEnterpriseModuleModel.company.ishigh==1){
- $scope.connEnterpriseModuleModel.company.ishighInfo="是";
- $scope.connEnterpriseModuleModel.company.high=true;
- }else if($scope.connEnterpriseModuleModel.company.ishigh==0){
- $scope.connEnterpriseModuleModel.company.ishighInfo="否";
- $scope.connEnterpriseModuleModel.company.high=false;
- }
- $scope.isRelateUl = false;
- };
- });
|