technicalBrokerEditCompanyInfoCtrl.js 50 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384
  1. angular.module('push')
  2. .controller('technicalBrokerEditCompanyInfoCtrl', function ($scope,$stateParams,$ionicActionSheet,$ionicSlideBoxDelegate, UtilService,AccountService,ActivityService,
  3. UserService,$ionicScrollDelegate,$timeout,ModelService,CloudFolderService,
  4. DockingService, TechnicalBrokerPublishTrainService,
  5. $ionicModal,SqliteStorageService,$ionicPopup,ConfigService) {
  6. // 走企业记录id
  7. // TODO
  8. var connid = $stateParams.connid;
  9. // var connid = 1971;
  10. // 图片
  11. $scope.imagelist = [];
  12. // 删除的图片list
  13. var delimageidlist = [];
  14. var delimages = "";//删除的图片id,","分割
  15. // 删除的id集合
  16. var delproduceInfolist = [];//删除对接信息产品list
  17. var delgreatProduceInfolist = [];//删除高新产品
  18. var deltechrequirelist = [];//删除对接信息的需求
  19. var delprojectCenterInfolist = [];//删除工程中心信息
  20. var delresearchInfolist = [];//删除研发投入
  21. var delrealInfolist = [];//删除实际收入
  22. var delimportantProjectlist = [];//删除重大科研项目
  23. var deladviceInfolist = [];//删除项目建议
  24. var delexperienceInfolist = [];//删除对接信息产学研
  25. var deltalentInfolist = [];//删除高端人才
  26. var delintellectuallist = [];//删除专利信息
  27. var delproduceInfos = "";//删除对接信息产品id,","分割
  28. var delgreatProduceInfos = "";//删除高新产品
  29. var deltechrequires = "";//删除对接信息的需求
  30. var delprojectCenterInfos = "";//删除工程中心信息
  31. var delresearchInfos = "";//删除研发投入
  32. var delrealInfos = "";//删除实际收入
  33. var delimportantProjects = "";//删除重大科研项目
  34. var deladviceInfos="";//删除项目建议
  35. var delexperienceInfos="";//删除对接信息产学研id,","分割
  36. var deltalentInfos="";//删除高端人才
  37. var delintellectuals="";//删除专利信息
  38. //产品信息
  39. $scope.produceInfoList = [{
  40. id: 0,
  41. productname: "",// 产品名称
  42. productdescription: ""//产品描述
  43. }];
  44. //高新产品
  45. $scope.greatProduceInfoList= [{
  46. id: 0,
  47. productname: "",// 产品名称
  48. productdescription: ""//产品描述
  49. }];
  50. //需求信息
  51. $scope.demandInfoList=[{
  52. id: 0,
  53. companyid: 0,
  54. techtype: 0,
  55. techtypename: "",
  56. techrequirementname: "",
  57. cooperationmodel: "",
  58. cooperationmodelname: "",// 合作模式名称
  59. capital_scale: 0,
  60. techrequirementdetail: "",
  61. images: "", // 图片
  62. demandInfoimagelist:[],// app端图片插件进行传递的变量(需求图片)
  63. }];
  64. //工程中心信息
  65. $scope.projectCenterInfoList= [{
  66. id: 0,
  67. yid: 0,
  68. yearname: "",// 选择项名称
  69. yvalue1: ""// 金额
  70. }];
  71. //研发投入信息
  72. $scope.researchInfoList = [{
  73. id: 0,
  74. yid: 0,
  75. yearname: "",// 选择项名称
  76. yvalue1: ""// 金额
  77. }];
  78. //实际收入与预计投入信息
  79. $scope.realInfoList= [{
  80. id: 0,
  81. yid: 0,
  82. yearname: "",//选择项名称
  83. yvalue1: "",// 销售收入
  84. yvalue2: "",// 净利润
  85. yvalue3: "" // 上缴税收
  86. }];
  87. //重大科研项目信息
  88. $scope.importantProjectList= [{
  89. id: 0,
  90. yid: 0,
  91. yearname: "",// 选择项名称
  92. yvalue1: ""// 项目内容
  93. }];
  94. //项目建议
  95. $scope.adviceInfoList= [{
  96. id: 0,
  97. projectname: "",//
  98. projectdescription: "",//
  99. projectsuggest: ""// 申报项目建议
  100. }];
  101. //产学研经验
  102. $scope.experienceInfoList=[{
  103. id: 0,
  104. cooperateschool: "",// 合作院校
  105. cooperatedetail: ""// 合作内容
  106. }];
  107. //人才
  108. $scope.talentInfoList=[{
  109. id: 0,
  110. name: "",// 人才姓名
  111. tel: "",// 手机号
  112. position: "",// 职位
  113. academicdegree: 0,// 学位
  114. academicdegreename: "",// 学位名称
  115. responsible: "",// 负责工作
  116. about: ""// 人才简介
  117. }];
  118. //专利
  119. $scope.patentInfoList=[{
  120. id: 0,
  121. intellectualpropertyname: "",// 名称
  122. applyperson: "",// 主要完成人
  123. licensenumber: "",// 申请号/授权号
  124. // licensedate: ""// 授权日期
  125. }];
  126. //切换到对应页面
  127. var activity=['baseInfo','productInfo','demandInfo','projectInfo','personnelAbilityInfo','patentInfo'];
  128. $scope.act = activity[0];
  129. $scope.changeAct = function (num) {
  130. if (num == 0) {
  131. $scope.act = activity[num];
  132. } else if (num == 1) {
  133. $scope.act = activity[num];
  134. }else if (num == 2) {
  135. $scope.act = activity[num];
  136. }
  137. else if (num == 3) {
  138. $scope.act = activity[num];
  139. }
  140. else if (num == 4) {
  141. $scope.act = activity[num];
  142. }
  143. else if (num == 5) {
  144. $scope.act = activity[num];
  145. }
  146. };
  147. $scope.watchIsChange=function () {
  148. if($scope.connEnterpriseModuleModel.company.high==true){
  149. $scope.connEnterpriseModuleModel.company.ishighInfo="是";
  150. $scope.connEnterpriseModuleModel.company.ishigh=1;
  151. }else{
  152. $scope.connEnterpriseModuleModel.company.ishighInfo="否";
  153. $scope.connEnterpriseModuleModel.company.ishigh=0;
  154. }
  155. };
  156. // 初始化走企业信息
  157. var initCompanyInfo = function (connid) {
  158. // console.log(connid);
  159. TechnicalBrokerPublishTrainService.getConnCompanyInfo(connid).then(function (response) {
  160. console.log(response);
  161. //企业基本信息
  162. $scope.connEnterpriseModuleModel = {
  163. userid: response.userid,
  164. usercomefrom: response.usercomefrom,
  165. claid: response.claid,// 选中的文件夹id
  166. taskid: response.taskid,// 任务id
  167. id: response.id,// 记录id
  168. templettype: response.templettype,// 模板Id 默认1是通用模板,2是走企业模板
  169. company: {
  170. companyid: response.company.companyid,
  171. companyname: response.company.companyname,
  172. contact: response.company.contact,
  173. contactnum: response.company.contactnum,
  174. categoryid: response.company.categoryid,
  175. categoryName: response.company.categoryname,
  176. rdinstitutiontype: response.company.rdinstitutiontype,// 企业研发机构等级
  177. rdinstitutiontypeName: response.company.rdinstitutiontypename,// 企业研发机构等级
  178. ishigh: response.company.ishigh,// 是否高企
  179. logo: response.company.logo,// 企业logo
  180. high:response.company.ishigh == 1,
  181. ishighInfo:response.company.ishigh == 1 ? "是" : "否"
  182. }
  183. };
  184. $scope.produceInfoList = response.companyProductlist;
  185. $scope.greatProduceInfoList = response.companyHignendProductlist;
  186. $scope.demandInfoList = response.companyTechrequirementlist;
  187. $scope.projectCenterInfoList = response.projectCenterInfoList;
  188. $scope.researchInfoList = response.researchInfoList;
  189. $scope.realInfoList = response.realInfoList;
  190. $scope.importantProjectList = response.importantProjectList;
  191. $scope.adviceInfoList = response.companyDeclareprojectlist;
  192. $scope.experienceInfoList = response.companyIURlist;
  193. $scope.talentInfoList = response.companyHighleveltalentslist;
  194. $scope.patentInfoList = response.intellectualpropertylist;
  195. $scope.imagelist = response.company.piclist;
  196. console.log($scope.connEnterpriseModuleModel);
  197. console.log($scope.projectCenterInfoList);
  198. }, function () {
  199. })
  200. };
  201. initCompanyInfo(connid);
  202. //初始化云文件夹列表
  203. $scope.checkdefolder = [];
  204. var initCloudFolderList = function () {
  205. // 0,查询所有文件夹,1查询通用文件夹,2查询走企业模板文件夹
  206. var templettype = 2;
  207. DockingService.newGetComFolderList(templettype).then(function (response) {
  208. $scope.cloudFolderList = response.folderlist;
  209. ModelService.setCloudFolderList($scope.cloudFolderList);
  210. // 云文件夹
  211. $scope.folderlist = angular.copy(ModelService.getCloudFolderList());
  212. //默认选择文件夹
  213. console.log("1:"+$scope.folderlist.length);
  214. if($scope.folderlist.length > 0){
  215. $scope.checkdefolder = $scope.folderlist[0];
  216. $scope.checkfolder = $scope.folderlist[0].id + "";
  217. }
  218. }, function () {
  219. })
  220. };
  221. initCloudFolderList();
  222. // *******获取所有配置信息*******
  223. // 获取工程中心信息的通用年份配置列表
  224. var projectcenterinfoyearbuttons = [];
  225. var getProjectCenterInfoYearMultiSetupList = function () {
  226. TechnicalBrokerPublishTrainService.getYearMultiSetupList(3).then(function (response) {
  227. // console.log(response);
  228. if (UtilService.isDefined(response) && response.length > 0) {
  229. angular.forEach(response, function (value, index) {
  230. var temphtml = {
  231. text: '<a class="action-sheet-push">' + value.setupname + '</a>',
  232. yearsetupid: value.id,
  233. yearname: value.setupname
  234. };
  235. projectcenterinfoyearbuttons.push(temphtml);
  236. });
  237. }
  238. }, function () {
  239. })
  240. };
  241. getProjectCenterInfoYearMultiSetupList();
  242. //选择工程中心信息的通用年份配置列表
  243. $scope.showProjectCenterInfoYearSetup = function (ind) {
  244. $ionicActionSheet.show({
  245. buttons: projectcenterinfoyearbuttons,
  246. cancelText: '取消',
  247. buttonClicked: function (index) {
  248. $scope.projectCenterInfoList[ind].yid = projectcenterinfoyearbuttons[index].yearsetupid;
  249. $scope.projectCenterInfoList[ind].yearname = projectcenterinfoyearbuttons[index].yearname;
  250. return true;
  251. }
  252. });
  253. };
  254. // 获取研发投入的通用年份配置列表
  255. var researchinfoyearbuttons = [];
  256. var getResearchInfoYearMultiSetupList = function () {
  257. TechnicalBrokerPublishTrainService.getYearMultiSetupList(1).then(function (response) {
  258. // console.log(response);
  259. if (UtilService.isDefined(response) && response.length > 0) {
  260. angular.forEach(response, function (value, index) {
  261. var temphtml = {
  262. text: '<a class="action-sheet-push">' + value.setupname + '</a>',
  263. yearsetupid: value.id,
  264. yearname: value.setupname
  265. };
  266. researchinfoyearbuttons.push(temphtml);
  267. });
  268. }
  269. }, function () {
  270. })
  271. };
  272. getResearchInfoYearMultiSetupList();
  273. //选择研发投入的通用年份配置列表
  274. $scope.showResearchInfoYearSetup = function (ind) {
  275. $ionicActionSheet.show({
  276. buttons: researchinfoyearbuttons,
  277. cancelText: '取消',
  278. buttonClicked: function (index) {
  279. $scope.researchInfoList[ind].yid = researchinfoyearbuttons[index].yearsetupid;
  280. $scope.researchInfoList[ind].yearname = researchinfoyearbuttons[index].yearname;
  281. return true;
  282. }
  283. });
  284. };
  285. // 获取实际收入的通用年份配置列表
  286. var realinfoyearbuttons = [];
  287. var getRealInfoYearMultiSetupList = function () {
  288. TechnicalBrokerPublishTrainService.getYearMultiSetupList(2).then(function (response) {
  289. // console.log(response);
  290. if (UtilService.isDefined(response) && response.length > 0) {
  291. angular.forEach(response, function (value, index) {
  292. var temphtml = {
  293. text: '<a class="action-sheet-push">' + value.setupname + '</a>',
  294. yearsetupid: value.id,
  295. yearname: value.setupname
  296. };
  297. realinfoyearbuttons.push(temphtml);
  298. });
  299. }
  300. }, function () {
  301. })
  302. };
  303. getRealInfoYearMultiSetupList();
  304. //选择实际收入的通用年份配置列表
  305. $scope.showRealInfoYearSetup = function (ind) {
  306. $ionicActionSheet.show({
  307. buttons: realinfoyearbuttons,
  308. cancelText: '取消',
  309. buttonClicked: function (index) {
  310. $scope.realInfoList[ind].yid = realinfoyearbuttons[index].yearsetupid;
  311. $scope.realInfoList[ind].yearname = realinfoyearbuttons[index].yearname;
  312. return true;
  313. }
  314. });
  315. };
  316. // 获取重大科研项目的通用年份配置列表
  317. var importantprojectbuttons = [];
  318. var getImportantProjectYearMultiSetupList = function () {
  319. TechnicalBrokerPublishTrainService.getYearMultiSetupList(4).then(function (response) {
  320. // console.log(response);
  321. if (UtilService.isDefined(response) && response.length > 0) {
  322. angular.forEach(response, function (value, index) {
  323. var temphtml = {
  324. text: '<a class="action-sheet-push">' + value.setupname + '</a>',
  325. yearsetupid: value.id,
  326. yearname: value.setupname
  327. };
  328. importantprojectbuttons.push(temphtml);
  329. });
  330. }
  331. }, function () {
  332. })
  333. };
  334. getImportantProjectYearMultiSetupList();
  335. //选择重大科研项目的通用年份配置列表
  336. $scope.showImportantProjectYearSetup = function (ind) {
  337. $ionicActionSheet.show({
  338. buttons: importantprojectbuttons,
  339. cancelText: '取消',
  340. buttonClicked: function (index) {
  341. $scope.importantProjectList[ind].yid = importantprojectbuttons[index].yearsetupid;
  342. $scope.importantProjectList[ind].yearname = importantprojectbuttons[index].yearname;
  343. return true;
  344. }
  345. });
  346. };
  347. // 获取需求的合作模式列表
  348. var cooperationmodelbuttons = [];
  349. var getCooperationmodelList = function () {
  350. TechnicalBrokerPublishTrainService.getCooperationmodelList().then(function (response) {
  351. if (UtilService.isDefined(response) && response.length > 0) {
  352. angular.forEach(response, function (value, index) {
  353. var temphtml = {
  354. text: '<a class="action-sheet-push">' + value.itemkey + '</a>',
  355. cooperationmodel: value.itemvalue,
  356. cooperationmodelname: value.itemkey
  357. };
  358. cooperationmodelbuttons.push(temphtml);
  359. });
  360. // console.log(cooperationmodelbuttons);
  361. }
  362. }, function () {
  363. })
  364. };
  365. getCooperationmodelList();
  366. //选择需求的合作模式列表
  367. $scope.showCooperationmodelStatus = function (ind) {
  368. $ionicActionSheet.show({
  369. buttons: cooperationmodelbuttons,
  370. cancelText: '取消',
  371. buttonClicked: function (index) {
  372. $scope.demandInfoList[ind].cooperationmodel = cooperationmodelbuttons[index].cooperationmodel;
  373. $scope.demandInfoList[ind].cooperationmodelname = cooperationmodelbuttons[index].cooperationmodelname;
  374. return true;
  375. }
  376. });
  377. };
  378. // 获取需求的需求类型列表
  379. var techtypebuttons = [];
  380. var getTechtypeList = function () {
  381. TechnicalBrokerPublishTrainService.getTechtypeList().then(function (response) {
  382. if (UtilService.isDefined(response) && response.length > 0) {
  383. angular.forEach(response, function (value, index) {
  384. var temphtml = {
  385. text: '<a class="action-sheet-push">' + value.itemkey + '</a>',
  386. techtype: value.itemvalue,
  387. techtypename: value.itemkey
  388. };
  389. techtypebuttons.push(temphtml);
  390. });
  391. // console.log(cooperationmodelbuttons);
  392. }
  393. }, function () {
  394. })
  395. };
  396. getTechtypeList();
  397. //选择需求的需求类型
  398. $scope.showTechtype = function (ind) {
  399. $ionicActionSheet.show({
  400. buttons: techtypebuttons,
  401. cancelText: '取消',
  402. buttonClicked: function (index) {
  403. $scope.demandInfoList[ind].techtype = techtypebuttons[index].techtype;
  404. $scope.demandInfoList[ind].techtypename = techtypebuttons[index].techtypename;
  405. return true;
  406. }
  407. });
  408. };
  409. // 获取人才的学位列表
  410. var academicdegreebuttons = [];
  411. var getAcademicdegreeList = function () {
  412. TechnicalBrokerPublishTrainService.getAcademicdegreeList().then(function (response) {
  413. if (UtilService.isDefined(response) && response.length > 0) {
  414. angular.forEach(response, function (value, index) {
  415. var temphtml = {
  416. text: '<a class="action-sheet-push">' + value.itemkey + '</a>',
  417. academicdegree: value.itemvalue,
  418. academicdegreename: value.itemkey
  419. };
  420. academicdegreebuttons.push(temphtml);
  421. });
  422. // console.log(academicdegreebuttons);
  423. }
  424. }, function () {
  425. })
  426. };
  427. getAcademicdegreeList();
  428. //选择人才的学位列表
  429. $scope.showAcademicdegreeStatus = function (ind) {
  430. $ionicActionSheet.show({
  431. buttons: academicdegreebuttons,
  432. cancelText: '取消',
  433. buttonClicked: function (index) {
  434. $scope.talentInfoList[ind].academicdegree = academicdegreebuttons[index].academicdegree;
  435. $scope.talentInfoList[ind].academicdegreename = academicdegreebuttons[index].academicdegreename;
  436. return true;
  437. }
  438. });
  439. };
  440. //选择企业产业领域
  441. var buttonsIndustryStatus = [
  442. {text: "汽车制造",
  443. stausName:"汽车制造",
  444. stausId: "A"
  445. },
  446. {text: "能源及节能技术",
  447. stausName:"能源及节能技术",
  448. stausId: "B"
  449. },
  450. {text: "新材料",
  451. stausName:"新材料",
  452. stausId: "C"
  453. },
  454. {text: "生物与新医药",
  455. stausName:"生物与新医药",
  456. stausId: "D"
  457. },
  458. {text: "电子信息",
  459. stausName:"电子信息",
  460. stausId: "E"
  461. },
  462. {text: "先进制造及高端装备",
  463. stausName:"先进制造及高端装备",
  464. stausId: "F"
  465. },
  466. {text: "资源及环境技术",
  467. stausName:"资源及环境技术",
  468. stausId: "G"
  469. }
  470. ];
  471. $scope.showIndustryStatus=function () {
  472. $ionicActionSheet.show({
  473. cancelOnStateChange: true,
  474. cssClass: 'action_s',
  475. cancelText: '取消',
  476. buttons: buttonsIndustryStatus,
  477. buttonClicked: function (index) {
  478. $scope.connEnterpriseModuleModel.company.categoryid = buttonsIndustryStatus[index].stausId;
  479. $scope.connEnterpriseModuleModel.company.categoryName = buttonsIndustryStatus[index].stausName;
  480. return true;
  481. },
  482. destructiveButtonClicked: function () {
  483. return true;
  484. }
  485. });
  486. };
  487. //选择研发机构等级
  488. var buttonsResearchStatus = [
  489. { text: "国家级",
  490. ResearchStatusName:"国家级",
  491. ResearchStatusId: "1"
  492. },
  493. { text: "省级",
  494. ResearchStatusName:"省级",
  495. ResearchStatusId: "2"
  496. },
  497. { text: "市级",
  498. ResearchStatusName:"市级",
  499. ResearchStatusId: "3"
  500. },
  501. { text: "区级",
  502. ResearchStatusName:"区级",
  503. ResearchStatusId: "4"
  504. }
  505. ];
  506. $scope.showResearchStatus=function () {
  507. $ionicActionSheet.show({
  508. cancelOnStateChange: true,
  509. cssClass: 'action_s',
  510. cancelText: '取消',
  511. buttons: buttonsResearchStatus,
  512. buttonClicked: function (index) {
  513. $scope.connEnterpriseModuleModel.company.rdinstitutiontype = buttonsResearchStatus[index].ResearchStatusId;
  514. $scope.connEnterpriseModuleModel.company.rdinstitutiontypeName = buttonsResearchStatus[index].ResearchStatusName;
  515. return true;
  516. },
  517. destructiveButtonClicked: function () {
  518. return true;
  519. }
  520. });
  521. };
  522. // 添加、删除多选内容
  523. //添加、删除更多一般产品
  524. $scope.AddOrDelProductInfo = function (ind) {
  525. if (ind == 0) {
  526. $scope.produceInfoList.push({
  527. id: 0,
  528. productname: "",// 产品名称
  529. productdescription: ""//产品描述
  530. });
  531. } else {
  532. if ($scope.produceInfoList[ind].id != 0) {
  533. delproduceInfolist.push($scope.produceInfoList[ind].id);
  534. }
  535. $scope.produceInfoList.splice(ind, 1);
  536. }
  537. };
  538. //添加、删除更多高新产品
  539. $scope.AddOrDelGreatProductInfo = function (ind) {
  540. if (ind == 0) {
  541. $scope.greatProduceInfoList.push({
  542. id: 0,
  543. productname: "",// 产品名称
  544. productdescription: ""//产品描述
  545. });
  546. } else {
  547. if ($scope.greatProduceInfoList[ind].id != 0) {
  548. delgreatProduceInfolist.push($scope.greatProduceInfoList[ind].id);
  549. }
  550. $scope.greatProduceInfoList.splice(ind, 1);
  551. }
  552. };
  553. //添加、删除更多工程中心信息
  554. $scope.AddOrDelProjectInfo = function (ind) {
  555. if (ind == 0) {
  556. $scope.projectCenterInfoList.push({
  557. id: 0,
  558. yid: 0,
  559. yearname: "",//选择项名称
  560. yvalue1: ""
  561. });
  562. } else {
  563. if ($scope.projectCenterInfoList[ind].id != 0) {
  564. delprojectCenterInfolist.push($scope.projectCenterInfoList[ind].id);
  565. }
  566. $scope.projectCenterInfoList.splice(ind, 1);
  567. }
  568. };
  569. //添加、删除更多研发投入信息
  570. $scope.AddOrDelResearchInfo = function (ind) {
  571. if (ind == 0) {
  572. $scope.researchInfoList.push({
  573. id: 0,
  574. yid: 0,
  575. yearname: "",//选择项名称
  576. yvalue1: ""
  577. });
  578. } else {
  579. if ($scope.researchInfoList[ind].id != 0) {
  580. delresearchInfolist.push($scope.researchInfoList[ind].id);
  581. }
  582. $scope.researchInfoList.splice(ind, 1);
  583. }
  584. };
  585. //添加、删除更多实际研发与投入信息
  586. $scope.AddOrDelrealInfoInfo= function (ind) {
  587. if (ind == 0) {
  588. $scope.realInfoList.push({
  589. id: 0,
  590. yid: 0,
  591. yearname: "",//选择项名称
  592. yvalue1: "",
  593. yvalue2: "",
  594. yvalue3: ""
  595. });
  596. } else {
  597. if ($scope.realInfoList[ind].id != 0) {
  598. delrealInfolist.push($scope.realInfoList[ind].id);
  599. }
  600. $scope.realInfoList.splice(ind, 1);
  601. }
  602. };
  603. //添加、删除更多需求
  604. $scope.AddOrDelDemandInfo = function (ind) {
  605. if (ind == 0) {
  606. $scope.demandInfoList.push({
  607. ind: ind,// 索引值
  608. id: 0,
  609. companyid: 0,
  610. techtype: 0,
  611. techtypename: "",
  612. techrequirementname: "",
  613. cooperationmodel: "",
  614. capital_scale: 0,
  615. techrequirementdetail: "",
  616. images: "" // 图片
  617. });
  618. } else {
  619. if ($scope.demandInfoList[ind].id != 0) {
  620. deltechrequirelist.push($scope.demandInfoList[ind].id);
  621. }
  622. $scope.demandInfoList.splice(ind, 1);
  623. }
  624. };
  625. //添加、删除更多重大科研项目
  626. $scope.AddOrDelImportantProjectInfo = function (ind) {
  627. if (ind == 0) {
  628. $scope.importantProjectList.push({
  629. id: 0,
  630. yid: 0,
  631. yearname: "",//选择项名称
  632. yvalue1: ""
  633. });
  634. } else {
  635. if ($scope.importantProjectList[ind].id != 0) {
  636. delimportantProjectlist.push($scope.importantProjectList[ind].id);
  637. }
  638. $scope.importantProjectList.splice(ind, 1);
  639. }
  640. };
  641. //添加、删除更多项目建议
  642. $scope.AddOrDelAdviceInfo= function (ind) {
  643. if (ind == 0) {
  644. $scope.adviceInfoList.push({
  645. id: 0,
  646. projectname: "",//
  647. projectdescription: "",//
  648. projectsuggest: ""// 申报项目建议
  649. });
  650. } else {
  651. if ($scope.adviceInfoList[ind].id != 0) {
  652. deladviceInfolist.push($scope.adviceInfoList[ind].id);
  653. }
  654. $scope.adviceInfoList.splice(ind, 1);
  655. }
  656. };
  657. //添加、删除更多产学研经验
  658. $scope.AddOrexperienceInfo= function (ind) {
  659. if (ind == 0) {
  660. $scope.experienceInfoList.push({
  661. id: 0,
  662. cooperateschool: "",// 合作院校
  663. cooperatedetail: ""// 合作内容
  664. });
  665. } else {
  666. if ($scope.experienceInfoList[ind].id != 0) {
  667. delexperienceInfolist.push($scope.experienceInfoList[ind].id);
  668. }
  669. $scope.experienceInfoList.splice(ind, 1);
  670. }
  671. };
  672. //添加、删除更多人才信息
  673. $scope.AddOrDelTalentInfo= function (ind) {
  674. if (ind == 0) {
  675. $scope.talentInfoList.push({
  676. id: 0,
  677. name: "",// 人才姓名
  678. tel: "",// 手机号
  679. position: "",// 职位
  680. academicdegree: 0,// 学位
  681. academicdegreename: "",// 学位名称
  682. responsible: "",// 负责工作
  683. about: ""// 人才简介
  684. });
  685. } else {
  686. if ($scope.talentInfoList[ind].id != 0) {
  687. deltalentInfolist.push($scope.talentInfoList[ind].id);
  688. }
  689. $scope.talentInfoList.splice(ind, 1);
  690. }
  691. };
  692. //添加、删除更多专利
  693. $scope.AddOrDelpatentInfo= function (ind) {
  694. if (ind == 0) {
  695. $scope.patentInfoList.push({
  696. id: 0,
  697. intellectualpropertyname: "",// 名称
  698. applyperson: "",// 主要完成人
  699. licensenumber: "",// 申请号/授权号
  700. // licensedate: ""// 授权日期
  701. });
  702. } else {
  703. if ($scope.patentInfoList[ind].id != 0) {
  704. delintellectuallist.push($scope.patentInfoList[ind].id);
  705. }
  706. $scope.patentInfoList.splice(ind, 1);
  707. }
  708. };
  709. // 弹出获取企业logo
  710. $scope.show_logo = function () {
  711. $ionicActionSheet.show({
  712. cancelOnStateChange: true,
  713. cssClass: 'action_s',
  714. cancelText: '取消',
  715. buttons: [
  716. {text: "拍照"},
  717. {text: "从相册上传"}
  718. ],
  719. buttonClicked: function (index) {
  720. if (index == 0) {
  721. openCamera(1,1);
  722. } else {
  723. openCamera(0,1);
  724. }
  725. return true;
  726. },
  727. destructiveButtonClicked: function () {
  728. return true;
  729. }
  730. });
  731. };
  732. var openCamera = function (srcType) {
  733. var options = {
  734. // Some common settings are 20, 50, and 100
  735. quality: 50,
  736. destinationType: Camera.DestinationType.FILE_URI,
  737. // In this app, dynamically set the picture source, Camera or photo gallery
  738. sourceType: srcType,
  739. encodingType: Camera.EncodingType.JPEG,
  740. mediaType: Camera.MediaType.PICTURE,
  741. allowEdit: false,
  742. correctOrientation: true //Corrects Android orientation quirks
  743. };
  744. navigator.camera.getPicture(function (imageData) {
  745. $scope.imgurl = imageData;
  746. $scope.showLoadingToast();
  747. UtilService.uploadFile([imageData], 0, "image/jpeg").then(function (response) {
  748. // 企业logo
  749. $scope.connEnterpriseModuleModel.company.logo = response[0].userPhoto;
  750. $scope.hideLoadingToast();
  751. }, function () {
  752. $scope.hideLoadingToast();
  753. });
  754. }, function (message) {
  755. }, options);
  756. };
  757. // ****** 单信息图片 ******
  758. $scope.openCamera = function () {
  759. if ($scope.imagelist.length >= 9) {
  760. UtilService.showMess("最多选取9张图片");
  761. return;
  762. }
  763. UtilService.getPicture(1).then(function (results) {
  764. // console.log(results);
  765. $scope.imagelist.push({photo_name: results, original_name: results});
  766. $scope.totalImglength = 600 * $scope.imagelist.length;
  767. $ionicScrollDelegate.$getByHandle("scrollimage").resize();
  768. }, function (err) {
  769. });
  770. };
  771. $scope.show = function () {
  772. $ionicActionSheet.show({
  773. buttons: [
  774. {text: '<a class="action-sheet-push">相册中添加照片</a>'},
  775. {text: '<a class="action-sheet-push">拍照</a>'}
  776. ],
  777. cancelText: '取消',
  778. buttonClicked: function (index) {
  779. if (index == 0) {
  780. getPictures();
  781. } else if (index == 1) {
  782. $scope.openCamera();
  783. }
  784. return true;
  785. }
  786. });
  787. };
  788. var verifyStorage = function () {
  789. window.imagePicker.verifyStorage(
  790. function (results) {
  791. if (results == "1") {
  792. getPic();
  793. }
  794. }, function (error) {
  795. }
  796. );
  797. };
  798. var getPic = function () {
  799. if ($scope.imagelist.length >= 9) {
  800. UtilService.showMess("最多选取9张图片");
  801. return;
  802. }
  803. UtilService.getPictureList(9 - $scope.imagelist.length).then(function (results) {
  804. // console.log(results);
  805. angular.forEach(results, function (value, index) {
  806. $scope.imagelist.push({photo_name: value, original_name: value})
  807. });
  808. $scope.totalImglength = 600 * $scope.imagelist.length;
  809. $ionicScrollDelegate.$getByHandle("scrollimage").resize();
  810. }, function (err) {
  811. });
  812. };
  813. var getPictures = function () {
  814. if (device.platform == "Android") {
  815. verifyStorage();
  816. } else {
  817. getPic();
  818. }
  819. };
  820. //点击图片放大
  821. $scope.bigImage = false; //初始默认大图是隐藏的
  822. $scope.hideBigImage = function () {
  823. if($scope.app){
  824. $scope.setStatusBar(0);
  825. }
  826. $timeout(function () {
  827. $scope.bigImage = false;
  828. }, 400);
  829. };
  830. $scope.shouBigImage = function (index) { //传递一个参数(图片的URl)
  831. if($scope.app){
  832. $scope.setStatusBar(1);
  833. }
  834. $(function () {
  835. $('div.pinch-zoom').each(function () {
  836. new RTP.PinchZoom($(this), {});
  837. });
  838. });
  839. $scope.bigImage = true;//显示大图
  840. $ionicSlideBoxDelegate.update();//重绘,让图片显示出来
  841. //图片总数量
  842. setTimeout(function () {
  843. $ionicSlideBoxDelegate.$getByHandle('slide_detail').slide(index, -10);
  844. //获取图片
  845. var imgObj = document.getElementsByClassName('bigimage');
  846. var n;
  847. for (n = 0; n < imgObj.length; n++) {
  848. // 获取图片的原始高度和宽度
  849. var oldWid = imgObj[n].naturalWidth;
  850. var oldHei = imgObj[n].naturalHeight;
  851. var screen = document.body.offsetWidth;
  852. var screenH = window.innerHeight;
  853. // console.log(oldWid / oldHei);
  854. // console.log(screen);
  855. var cc = screen / (oldWid / oldHei);
  856. imgObj[n].style.height = cc + 'px';
  857. if (cc < screenH) {
  858. imgObj[n].style.marginTop = (screenH - cc) / 2 + 'px';
  859. // console.log("e:"+imgObj[n].style.marginTop);
  860. } else {
  861. imgObj[n].style.marginTop = 0 + 'px';
  862. // console.log((cc-screenH) +'px')
  863. }
  864. }
  865. }, 10);
  866. };
  867. //删除图片
  868. $scope.deletePhoto = function (index) {
  869. if ($scope.imagelist[index].id != 0) {
  870. delimageidlist.push($scope.imagelist[index].id);
  871. }
  872. $scope.imagelist.splice(index, 1);
  873. };
  874. //保存企业信息表
  875. var saveflg = 0;
  876. $scope.saveCompanyInfo = function () {
  877. // 基本信息
  878. if (!UtilService.isDefined($scope.connEnterpriseModuleModel.company.companyname)) {
  879. UtilService.showMess("请填写企业名称");
  880. return;
  881. }
  882. if ($scope.connEnterpriseModuleModel.company.companyname.length > 255) {
  883. UtilService.showMess("企业名称不能超过255个字");
  884. return;
  885. }
  886. if ($scope.connEnterpriseModuleModel.company.contact.length > 255) {
  887. UtilService.showMess("联系人不能超过255个字");
  888. return;
  889. }
  890. if ($scope.connEnterpriseModuleModel.company.contactnum.length > 255) {
  891. UtilService.showMess("联系方式不能超过255个字");
  892. return;
  893. }
  894. var result = 1;
  895. // 工程中心
  896. if ($scope.projectCenterInfoList.length > 0) {
  897. angular.forEach($scope.projectCenterInfoList, function (projectCenterInfoList,index) {
  898. if ($scope.projectCenterInfoList[index].yvalue1.length > 255) {
  899. result = 0;
  900. }
  901. });
  902. if(result == 0){
  903. UtilService.showMess("工程中心的年度情况不能超过255个字");
  904. return;
  905. }
  906. }
  907. // 研发投入
  908. if ($scope.researchInfoList.length > 0) {
  909. angular.forEach($scope.researchInfoList, function (researchInfoList,index) {
  910. if (result == 1 && $scope.researchInfoList[index].yvalue1.length > 255) {
  911. result = 0;
  912. }
  913. });
  914. if(result == 0){
  915. UtilService.showMess("研发投入的年度情况不能超过255个字");
  916. return;
  917. }
  918. }
  919. // 实际收入/预计投入
  920. if ($scope.realInfoList.length > 0) {
  921. angular.forEach($scope.realInfoList, function (realInfoList,index) {
  922. if (result == 1 &&
  923. ($scope.realInfoList[index].yvalue1.length > 255
  924. || $scope.realInfoList[index].yvalue2.length > 255
  925. || $scope.realInfoList[index].yvalue3.length > 255)) {
  926. result = 0;
  927. }
  928. });
  929. if(result == 0){
  930. UtilService.showMess("实际收入/预计投入的销售收入、净利润和上缴税收不能超过255个字");
  931. return;
  932. }
  933. }
  934. // 产品信息
  935. if ($scope.produceInfoList.length > 0) {
  936. angular.forEach($scope.produceInfoList, function (produceInfoList,index) {
  937. if (result == 1 && $scope.produceInfoList[index].productname.length > 255) {
  938. result = 0;
  939. }
  940. });
  941. if(result == 0){
  942. UtilService.showMess("产品信息的产品名称不能超过255个字");
  943. return;
  944. }
  945. }
  946. // 高新产品信息
  947. if ($scope.greatProduceInfoList.length > 0) {
  948. angular.forEach($scope.greatProduceInfoList, function (greatProduceInfoList,index) {
  949. if (result == 1 && $scope.greatProduceInfoList[index].productname.length > 255) {
  950. result = 0;
  951. }
  952. });
  953. if(result == 0){
  954. UtilService.showMess("高新产品信息的产品名称不能超过255个字");
  955. return;
  956. }
  957. }
  958. // 需求信息
  959. if ($scope.demandInfoList.length > 0) {
  960. angular.forEach($scope.demandInfoList, function (demandInfoList,index) {
  961. if (result == 1 &&
  962. ($scope.demandInfoList[index].techrequirementname.length > 255
  963. || $scope.demandInfoList[index].capital_scale.length > 255)) {
  964. result = 0;
  965. }
  966. });
  967. if(result == 0){
  968. UtilService.showMess("需求信息的需求名称和投入预算不能超过255个字");
  969. return;
  970. }
  971. }
  972. // 重大科研项目
  973. if ($scope.importantProjectList.length > 0) {
  974. angular.forEach($scope.importantProjectList, function (importantProjectList,index) {
  975. if (result == 1 && $scope.importantProjectList[index].yvalue1.length > 255) {
  976. result = 0;
  977. }
  978. });
  979. if(result == 0){
  980. UtilService.showMess("重大科研项目的项目名称不能超过255个字");
  981. return;
  982. }
  983. }
  984. // 项目建议
  985. if ($scope.adviceInfoList.length > 0) {
  986. angular.forEach($scope.adviceInfoList, function (adviceInfoList,index) {
  987. if (result == 1 && $scope.adviceInfoList[index].projectname.length > 255) {
  988. result = 0;
  989. }
  990. });
  991. if(result == 0){
  992. UtilService.showMess("项目建议的项目名称不能超过255个字");
  993. return;
  994. }
  995. }
  996. // 产学研经验
  997. if ($scope.experienceInfoList.length > 0) {
  998. angular.forEach($scope.experienceInfoList, function (experienceInfoList,index) {
  999. if (result == 1 && $scope.experienceInfoList[index].cooperateschool.length > 255) {
  1000. result = 0;
  1001. }
  1002. });
  1003. if(result == 0){
  1004. UtilService.showMess("产学研经验的已合作院校不能超过255个字");
  1005. return;
  1006. }
  1007. }
  1008. // 人才信息
  1009. if ($scope.talentInfoList.length > 0) {
  1010. angular.forEach($scope.talentInfoList, function (talentInfoList,index) {
  1011. if (result == 1 && $scope.talentInfoList[index].name.length > 50) {
  1012. result = 0;
  1013. }
  1014. if (result == 1 && $scope.talentInfoList[index].tel.length > 30) {
  1015. result = 2;
  1016. }
  1017. if (result == 1 && $scope.talentInfoList[index].position.length > 50) {
  1018. result = 3;
  1019. }
  1020. if (result == 1 && $scope.talentInfoList[index].responsible.length > 255) {
  1021. result = 4;
  1022. }
  1023. });
  1024. if(result == 0){
  1025. UtilService.showMess("人才信息的姓名不能超过50个字");
  1026. return;
  1027. }else if(result == 2){
  1028. UtilService.showMess("人才信息的联系方式不能超过30个字");
  1029. return;
  1030. }else if(result == 3){
  1031. UtilService.showMess("人才信息的职位不能超过50个字");
  1032. return;
  1033. }else if(result == 4){
  1034. UtilService.showMess("人才信息的负责工作不能超过255个字");
  1035. return;
  1036. }
  1037. }
  1038. // 专利信息
  1039. if ($scope.patentInfoList.length > 0) {
  1040. angular.forEach($scope.patentInfoList, function (patentInfoList,index) {
  1041. if (result == 1 && $scope.patentInfoList[index].intellectualpropertyname.length > 255) {
  1042. result = 0;
  1043. }
  1044. if (result == 1 && $scope.patentInfoList[index].applyperson.length > 255) {
  1045. result = 2;
  1046. }
  1047. if (result == 1 && $scope.patentInfoList[index].licensenumber.length > 255) {
  1048. result = 3;
  1049. }
  1050. });
  1051. if(result == 0){
  1052. UtilService.showMess("专利信息的名称不能超过255个字");
  1053. return;
  1054. }else if(result == 2){
  1055. UtilService.showMess("专利信息的主要完成人不能超过255个字");
  1056. return;
  1057. }else if(result == 3){
  1058. UtilService.showMess("专利信息的申请号/专利号不能超过255个字");
  1059. return;
  1060. }
  1061. }
  1062. if (saveflg != 0) {
  1063. return;
  1064. }
  1065. saveflg = 1;
  1066. $scope.showLoadingToast();
  1067. if ($scope.imagelist.length > 0) {
  1068. uploadImages();
  1069. } else {
  1070. saveInfo();
  1071. }
  1072. };
  1073. var tempimages = [];
  1074. var uploadImages = function () {
  1075. tempimages = [];
  1076. var upimages = [];
  1077. angular.forEach($scope.imagelist, function (data) {
  1078. upimages.push(data.photo_name);
  1079. });
  1080. UtilService.uploadFile(upimages, 0, "image/jpeg").then(function (response) {
  1081. // console.log(response);
  1082. angular.forEach(response, function (value) {
  1083. if (value.status) {
  1084. tempimages.push({
  1085. id: 0,
  1086. title: "",
  1087. photo_name: value.userPhoto,
  1088. original_name: value.originalPhoto,
  1089. source_name: value.sourcePhoto,
  1090. source_size: value.source_size
  1091. });
  1092. }
  1093. });
  1094. $timeout(function () {
  1095. saveInfo();
  1096. }, 100);
  1097. }, function () {
  1098. $scope.hideLoadingToast();
  1099. UtilService.showMess("网络不给力,请重试");
  1100. saveflg = 0;
  1101. })
  1102. };
  1103. // 保存企业信息
  1104. var saveInfo = function () {
  1105. // 需求
  1106. if ($scope.demandInfoList.length > 0) {
  1107. angular.forEach($scope.demandInfoList, function (demandInfoList,$index) {
  1108. if (!UtilService.isDefined($scope.demandInfoList[$index].techrequirementname)
  1109. && !UtilService.isDefined($scope.demandInfoList[$index].techrequirementdetail)
  1110. && !UtilService.isDefined($scope.demandInfoList[$index].cooperationmodelname)
  1111. && !UtilService.isDefined($scope.demandInfoList[$index].techtypename)
  1112. && !UtilService.isDefined($scope.demandInfoList[$index].capital_scale)) {
  1113. $scope.demandInfoList.splice($index, 1);
  1114. }
  1115. });
  1116. }
  1117. $scope.connEnterpriseModuleModel.techrequirelistJson = JSON.stringify($scope.demandInfoList);
  1118. // 工程中心
  1119. if ($scope.projectCenterInfoList.length > 0) {
  1120. angular.forEach($scope.projectCenterInfoList, function (projectCenterInfoList,$index) {
  1121. if (!UtilService.isDefined($scope.projectCenterInfoList[$index].yearname)
  1122. && !UtilService.isDefined($scope.projectCenterInfoList[$index].yvalue1)) {
  1123. $scope.projectCenterInfoList.splice($index, 1);
  1124. }
  1125. });
  1126. }
  1127. $scope.connEnterpriseModuleModel.projectCenterInfoListJson = JSON.stringify($scope.projectCenterInfoList);
  1128. // 研发投入
  1129. if ($scope.researchInfoList.length > 0) {
  1130. angular.forEach($scope.researchInfoList, function (researchInfoList,$index) {
  1131. if (!UtilService.isDefined($scope.researchInfoList[$index].yearname)
  1132. && !UtilService.isDefined($scope.researchInfoList[$index].yvalue1)) {
  1133. $scope.researchInfoList.splice($index, 1);
  1134. }
  1135. });
  1136. }
  1137. $scope.connEnterpriseModuleModel.researchInfoListJson = JSON.stringify($scope.researchInfoList);
  1138. // 实际收入
  1139. if ($scope.realInfoList.length > 0) {
  1140. angular.forEach($scope.realInfoList, function (realInfoList,$index) {
  1141. if (!UtilService.isDefined($scope.realInfoList[$index].yearname)
  1142. && !UtilService.isDefined($scope.realInfoList[$index].yvalue1)
  1143. && !UtilService.isDefined($scope.realInfoList[$index].yvalue2)
  1144. && !UtilService.isDefined($scope.realInfoList[$index].yvalue3)) {
  1145. $scope.realInfoList.splice($index, 1);
  1146. }
  1147. });
  1148. }
  1149. $scope.connEnterpriseModuleModel.realInfoListJson = JSON.stringify($scope.realInfoList);
  1150. // 产品信息
  1151. if ($scope.produceInfoList.length > 0) {
  1152. angular.forEach($scope.produceInfoList, function (produceInfoList,$index) {
  1153. if (!UtilService.isDefined($scope.produceInfoList[$index].productname)
  1154. && !UtilService.isDefined($scope.produceInfoList[$index].productdescription)) {
  1155. $scope.produceInfoList.splice($index, 1);
  1156. }
  1157. });
  1158. }
  1159. $scope.connEnterpriseModuleModel.produceInfoListJson = JSON.stringify($scope.produceInfoList);
  1160. // 高新产品
  1161. if ($scope.greatProduceInfoList.length > 0) {
  1162. angular.forEach($scope.greatProduceInfoList, function (greatProduceInfoList,$index) {
  1163. if (!UtilService.isDefined($scope.greatProduceInfoList[$index].productname)
  1164. && !UtilService.isDefined($scope.greatProduceInfoList[$index].productdescription)) {
  1165. $scope.greatProduceInfoList.splice($index, 1);
  1166. }
  1167. });
  1168. }
  1169. $scope.connEnterpriseModuleModel.greatProduceInfoListJson = JSON.stringify($scope.greatProduceInfoList);
  1170. // 重大科研项目
  1171. if ($scope.importantProjectList.length > 0) {
  1172. angular.forEach($scope.importantProjectList, function (importantProjectList,$index) {
  1173. if (!UtilService.isDefined($scope.importantProjectList[$index].yearname)
  1174. && !UtilService.isDefined($scope.importantProjectList[$index].yvalue1)) {
  1175. $scope.importantProjectList.splice($index, 1);
  1176. }
  1177. });
  1178. }
  1179. $scope.connEnterpriseModuleModel.importantProjectListJson = JSON.stringify($scope.importantProjectList);
  1180. // 申报项目建议
  1181. if ($scope.adviceInfoList.length > 0) {
  1182. angular.forEach($scope.adviceInfoList, function (adviceInfoList,$index) {
  1183. if (!UtilService.isDefined($scope.adviceInfoList[$index].projectname)
  1184. && !UtilService.isDefined($scope.adviceInfoList[$index].projectdescription)
  1185. && !UtilService.isDefined($scope.adviceInfoList[$index].projectsuggest)) {
  1186. $scope.adviceInfoList.splice($index, 1);
  1187. }
  1188. });
  1189. }
  1190. $scope.connEnterpriseModuleModel.adviceInfoListJson = JSON.stringify($scope.adviceInfoList);
  1191. // 产学研经验
  1192. if ($scope.experienceInfoList.length > 0) {
  1193. angular.forEach($scope.experienceInfoList, function (experienceInfoList,$index) {
  1194. if (!UtilService.isDefined($scope.experienceInfoList[$index].cooperateschool)
  1195. && !UtilService.isDefined($scope.experienceInfoList[$index].cooperatedetail)) {
  1196. $scope.experienceInfoList.splice($index, 1);
  1197. }
  1198. });
  1199. }
  1200. $scope.connEnterpriseModuleModel.experienceInfoListJson = JSON.stringify($scope.experienceInfoList);
  1201. // 人才
  1202. if ($scope.talentInfoList.length > 0) {
  1203. angular.forEach($scope.talentInfoList, function (talentInfoList,$index) {
  1204. if (!UtilService.isDefined($scope.talentInfoList[$index].name)
  1205. && !UtilService.isDefined($scope.talentInfoList[$index].tel)
  1206. && !UtilService.isDefined($scope.talentInfoList[$index].position)
  1207. && !UtilService.isDefined($scope.talentInfoList[$index].academicdegreename)
  1208. && !UtilService.isDefined($scope.talentInfoList[$index].responsible)
  1209. && !UtilService.isDefined($scope.talentInfoList[$index].about)) {
  1210. $scope.talentInfoList.splice($index, 1);
  1211. }
  1212. });
  1213. }
  1214. $scope.connEnterpriseModuleModel.talentInfoListJson = JSON.stringify($scope.talentInfoList);
  1215. // 专利
  1216. if ($scope.patentInfoList.length > 0) {
  1217. angular.forEach($scope.patentInfoList, function (patentInfoList,$index) {
  1218. if (!UtilService.isDefined($scope.patentInfoList[$index].intellectualpropertyname)
  1219. && !UtilService.isDefined($scope.patentInfoList[$index].applyperson)
  1220. && !UtilService.isDefined($scope.patentInfoList[$index].licensenumber)) {
  1221. $scope.patentInfoList.splice($index, 1);
  1222. }
  1223. });
  1224. }
  1225. $scope.connEnterpriseModuleModel.intellectualListJson = JSON.stringify($scope.patentInfoList);
  1226. // 所属文件夹
  1227. $scope.connEnterpriseModuleModel.claid = $scope.checkfolder;
  1228. // 任务id
  1229. $scope.connEnterpriseModuleModel.taskid = $scope.taskid;
  1230. // 企业图片
  1231. $scope.connEnterpriseModuleModel.company.images = JSON.stringify(tempimages);
  1232. $scope.connEnterpriseModuleModel.company.delimages = delimageidlist.join(",");
  1233. $scope.connEnterpriseModuleModel.delproduceInfos = delproduceInfolist.join(",");
  1234. $scope.connEnterpriseModuleModel.delgreatProduceInfos = delgreatProduceInfolist.join(",");
  1235. $scope.connEnterpriseModuleModel.deltechrequires = deltechrequirelist.join(",");
  1236. $scope.connEnterpriseModuleModel.delprojectCenterInfos = delprojectCenterInfolist.join(",");
  1237. $scope.connEnterpriseModuleModel.delresearchInfos = delresearchInfolist.join(",");
  1238. $scope.connEnterpriseModuleModel.delrealInfos = delrealInfolist.join(",");
  1239. $scope.connEnterpriseModuleModel.delimportantProjects = delimportantProjectlist.join(",");
  1240. $scope.connEnterpriseModuleModel.deladviceInfos = deladviceInfolist.join(",");
  1241. $scope.connEnterpriseModuleModel.delexperienceInfos = delexperienceInfolist.join(",");
  1242. $scope.connEnterpriseModuleModel.deltalentInfos = deltalentInfolist.join(",");
  1243. $scope.connEnterpriseModuleModel.delintellectuals = delintellectuallist.join(",");
  1244. console.log($scope.connEnterpriseModuleModel);
  1245. TechnicalBrokerPublishTrainService.updateCompanyInfo($scope.connEnterpriseModuleModel, tempimages).then(function (response) {
  1246. // console.log(response);
  1247. if (response.result == 1) {
  1248. UtilService.showMess("修改成功");
  1249. $timeout(function () {
  1250. // $scope.goback();
  1251. // 添加成功后跳入我的录入
  1252. $scope.go("technicalBrokerEnterCompanyInfo");
  1253. }, 1500);
  1254. } else {
  1255. UtilService.showMess("网络不给力,请重试");
  1256. }
  1257. $scope.hideLoadingToast();
  1258. saveflg = 0;
  1259. }, function () {
  1260. UtilService.showMess("网络不给力,请重试");
  1261. $scope.hideLoadingToast();
  1262. saveflg = 0;
  1263. })
  1264. };
  1265. // ********** 企业联想 ********
  1266. //关联相关企业
  1267. $scope.isRelateUl = false;
  1268. $scope.queryLikeName = function () {
  1269. if ($scope.connEnterpriseModuleModel.company.companyname.length == 0) {
  1270. $scope.companylist = [];
  1271. $scope.isRelateUl = false;
  1272. return;
  1273. }
  1274. DockingService.getCampanyListByName($scope.connEnterpriseModuleModel.company.companyname).then(function (response) {
  1275. // console.log(response);
  1276. $scope.companylist = response.companylist;
  1277. $scope.isRelateUl = true;
  1278. }, function () {
  1279. })
  1280. };
  1281. //选中企业
  1282. $scope.setCompanyName = function (company) {
  1283. //<b style='color:red;font-weight: normal;'>亚</b>
  1284. company.companyname = company.companyname.replace("<b style='color:red;font-weight: normal;'>", "");
  1285. company.companyname = company.companyname.replace("</b>", "");
  1286. $scope.connEnterpriseModuleModel.company.companyname = company.companyname;
  1287. $scope.connEnterpriseModuleModel.company.logo = company.logo;
  1288. $scope.connEnterpriseModuleModel.company.contact = company.contact;
  1289. $scope.connEnterpriseModuleModel.company.contactnum = company.contactnum;
  1290. $scope.connEnterpriseModuleModel.company.category = company.category;
  1291. $scope.connEnterpriseModuleModel.company.categoryName = company.categoryname;
  1292. $scope.connEnterpriseModuleModel.company.rdinstitutiontype = company.rdinstitutiontype;
  1293. $scope.connEnterpriseModuleModel.company.rdinstitutiontypeName = company.rdinstitutiontypename;
  1294. $scope.connEnterpriseModuleModel.company.ishigh = company.ishigh;
  1295. if($scope.connEnterpriseModuleModel.company.ishigh==1){
  1296. $scope.connEnterpriseModuleModel.company.ishighInfo="是";
  1297. $scope.connEnterpriseModuleModel.company.high=true;
  1298. }else if($scope.connEnterpriseModuleModel.company.ishigh==0){
  1299. $scope.connEnterpriseModuleModel.company.ishighInfo="否";
  1300. $scope.connEnterpriseModuleModel.company.high=false;
  1301. }
  1302. $scope.isRelateUl = false;
  1303. };
  1304. //页面销毁时 回收广播
  1305. $scope.$on('$destroy', function () {
  1306. reciveregplace();
  1307. });
  1308. }).directive('stringToNumber', function() {
  1309. return {
  1310. require: 'ngModel',
  1311. link: function(scope, element, attrs, ngModel) {
  1312. ngModel.$parsers.push(function(value) {
  1313. return '' + value;
  1314. });
  1315. ngModel.$formatters.push(function(value) {
  1316. return parseInt(value);
  1317. });
  1318. }
  1319. };
  1320. }).directive('stringToNumber2', function() {
  1321. return {
  1322. require: 'ngModel',
  1323. link: function(scope, element, attrs, ngModel) {
  1324. ngModel.$parsers.push(function(value) {
  1325. return '' + value;
  1326. });
  1327. ngModel.$formatters.push(function(value) {
  1328. return parseInt(value);
  1329. });
  1330. }
  1331. };
  1332. });