12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087 |
- angular.module('push')
- .controller('visitModularFormCtrl', function ($scope, $q, $stateParams, UserService, UtilService, roleService, $ionicActionSheet,
- ConstantService, $timeout, $ionicScrollDelegate, $ionicHistory,
- ActivityService, ConfigService, TechnicalBrokerPublishTrainService, dataToolsService, CommonService, $interval, ResourceLibraryService) {
- var split = window.location.href.split('#/');
- //TODO 放开注释
- if ($scope.app) {
- if (device.platform != "Android") {
- $scope.isIos = true;
- } else {
- $scope.isIos = false;
- }
- }
- $scope.node = UserService.node;
- $scope.defaultLan = UserService.defaultLan;
- var innertype = $stateParams.innertype;
- if ($scope.app && device.platform == "Android") {
- window.addEventListener('native.keyboardshow', function (e) {
- })
- }
- $scope.showMess = function (msg) {
- if ($scope.app) {
- UtilService.showMess(msg);
- } else {
- CommonService.showMessage(msg, $scope);
- }
- }
- UserService.isRewardFlag = 1;
- // 对应的是0新增/1编辑/2复制
- $scope.isedit = $stateParams.isedit;
- $scope.pageTitle = $stateParams.pageTitle;
- var toggleInfo = [
- {
- savename: '保存企业基本信息',
- text: '<a class="action-sheet-push">企业</a>',
- title: '企业基本信息',
- orgtype: $stateParams.orgtype,
- id: $stateParams.pageid,
- select: true,
- }, {
- savename: '保存高校基本信息',
- text: '<a class="action-sheet-push">高校</a>',
- title: '高校基本信息',
- orgtype: $stateParams.orgtype,
- id: $stateParams.pageid,
- select: false
- }
- ]
- // 获取走访录入界面的传参
- // console.log($stateParams.orgtype);
- $scope.rolePageModel = $stateParams.orgtype == 10104 ? toggleInfo[0] : toggleInfo[1];
- // console.log($scope.rolePageModel);
- // {
- // //TODO
- // id: $stateParams.pageid,// 模版id
- // orgtype: $stateParams.orgtype// 走访对应的机构类型
- // // id: 1,// 模版id
- // // orgtype: 10104,// 模版id
- // };
- //根据模版获取所有模块
- var hasSearchData = [];
- // console.log($stateParams);
- var getAllData = function () {
- var def = $q.defer();
- if ($stateParams.comfrom == 'resource') {
- ResourceLibraryService.getPrivateResourceDetail($stateParams.connid, $stateParams.restype, $stateParams.node).then(function (res) {
- if (res.code == 3350) {
- console.log(res.data);
- def.resolve(res.data);
- } else {
- def.reject('错误');
- }
- })
- } else if ($stateParams.comfrom == 'resourceCommonDetailsPage') {
- ResourceLibraryService.getPrivateResourceDetail($stateParams.connid, $stateParams.restype, $stateParams.node).then(function (res) {
- if (res.code == 3350) {
- console.log(res.data);
- ResourceLibraryService.getOtherDetail($stateParams.connid, $stateParams.restype, $stateParams.node).then(function (response) {
- console.log(response.data);
- if (response.code == 3350) {
- var data = {};
- if (res.data.id) {
- if (response.data.id) {
- data = response.data;
- data.infoSectionList = Object.assign(data.infoSectionList, res.data.infoSectionList);
- } else {
- data = res.data;
- }
- }
- angular.forEach(response.data.infoSectionList, function (val) {
- data.infoSectionList.push(val);
- });
- data.typecodemap = Object.assign(data.typecodemap, response.data.typecodemap);
- console.log(data);
- def.resolve(data);
- } else {
- def.reject('错误');
- }
- })
- } else {
- def.reject('错误');
- }
- })
- } else {
- dataToolsService.getDetailEdit($stateParams.connid, 1000002, $stateParams.node).then(function (res) {
- if (res.code == 3350) {
- console.log(res.data);
- dataToolsService.getConnectionOtherInfoDetail($stateParams.connid, 1000002, 0, $stateParams.node).then(function (response) {
- console.log(response);
- if (response.code == 3350) {
- var data = {};
- if (res.data.id) {
- if (response.data.id) {
- data = response.data;
- data.infoSectionList = Object.assign(data.infoSectionList, res.data.infoSectionList);
- } else {
- data = res.data;
- }
- }
- angular.forEach(response.data.infoSectionList, function (val) {
- data.infoSectionList.push(val);
- });
- data.typecodemap = Object.assign(data.typecodemap, response.data.typecodemap);
- console.log(data);
- def.resolve(data);
- } else {
- def.reject('错误');
- }
- })
- } else {
- def.reject('错误');
- }
- })
- }
- return def.promise;
- }
- // console.log($scope.rolePageModel);
- var getRolePageSectionList = function () {
- $scope.showLoadingToast();
- if ($stateParams.comfrom == 'resource') {
- $scope.rolePageModel = {
- id: 13
- }
- }
- // console.log($scope.rolePageModel);
- roleService.getRolePageSectionList($scope.rolePageModel).then(function (response) {
- // console.log("==============================");
- // console.log(response.data);
- $scope.activity = [];
- // 基本信息
- $scope.sectionList = response.data.sectionList;
- if (UtilService.isDefined($scope.sectionList)) {
- angular.forEach($scope.sectionList, function (value, index) {
- var baseactivity = {
- className: '',
- headerName: '',
- restype: ''
- };
- // console.log(value);
- baseactivity.className = value.seccode;// 模块编号
- baseactivity.headerName = value.secname;// 模块名称
- baseactivity.restype = value.lktablecode;// 模块名称
- $scope.activity.push(baseactivity);
- if ($scope.activity.length > 0) {
- $scope.act = $scope.activity[0].className;
- }
- });
- for (var i = 0; i < $scope.activity.length; i++) {
- hasSearchData[i] = true;
- }
- console.log($scope.activity);
- if ($scope.isedit == 1 || $scope.isedit == 2) {
- getAllData().then(function (response) {
- console.log(response);
- angular.forEach($scope.activity, function (val, index) {
- if (val.headerName == "对接录入") {
- goToTaskAction(response, 5322)
- }
- if (val.headerName == "人才信息") {
- innertype = 38;
- } else if (val.headerName == "专家信息") {
- innertype = 8;
- } else {
- innertype = $stateParams.innertype;
- }
- getData(val.headerName, val.restype, index, innertype, response);
- })
- })
- } else {
- angular.forEach($scope.activity, function (val, index) {
- if (val.headerName == "对接录入") {
- goToTaskAction(response, 5322)
- }
- if (val.headerName == "人才信息") {
- innertype = 38;
- } else if (val.headerName == "专家信息") {
- innertype = 8;
- } else {
- innertype = $stateParams.innertype;
- }
- getData(val.headerName, val.restype, index, innertype);
- })
- }
- }
- }, function () {
- })
- };
- //调试
- getRolePageSectionList();
- var goToTaskAction = function (list, action) {
- console.log(list);
- console.log(action);
- if (!ConfigService.islogin) {
- if (localStorage.wxFlag == "true") {
- if (localStorage.isUserFocusXW == 0) {
- var title = localStorage.appidStr;
- $ionicPopup.alert({
- title: '提示',
- template: '请先关注微信公众号"' + title + '"!'
- });
- return;
- } else {
- if (localStorage.isUserBindWx == 0) {
- var wxFlag = JSON.parse(localStorage.params);
- if (wxFlag.weChatModel) {
- $scope.go('bindPhone', {
- params: localStorage.params,
- comfrom: 'maincontroller',
- url: window.location.href.split('#/')[1]
- });
- } else {
- $scope.go('login');
- return;
- }
- } else {
- $scope.go('login');
- return;
- }
- }
- } else {
- $scope.go('login');
- return;
- }
- return;
- }
- // if (action == 5322) {
- // // 对接录入
- // $scope.go('dockingInput', {
- // comfrom: 'dockingInput',
- // /*taskTitle: list.title,
- // taskid: $stateParams.taskid,*/
- // companyName: list.baseInfoModel.title,
- // companyid: list.baseInfoModel.oid,
- // })
- // }
- }
- var getCascadList = function (arr, index, key) {
- // console.log(index);
- // console.log(arr);
- dataToolsService.getWebCascade(key, 1).then(function (response) {
- if (UtilService.isDefined(response.data) && response.data.length > 0) {
- console.log(response);
- arr[index].content = response.data[0].name;
- arr[index + 1].dictionary = response.data[0].code;
- dataToolsService.getWebCascade(response.data[0].code, 0).then(function (res) {
- var temp = res.data.filter(function (val) {
- return val.code == key;
- })
- if (temp.length > 0) {
- arr[index + 1].content = temp[0].name;
- }
- })
- }
- }, function () {
- })
- }
- //切换到对应页面
- $scope.activity = [];
- $scope.visitType = 0;//0:高校走企业 ,1:政府走企业,2:术经纪人或服务机构走企业,3:企业走高校,4:政府走高校、技术经纪人或服务机构走高校
- var lastNum = 0;
- $scope.tempData = [];
- //从后台获取数据
- // 默认显示内容
- $scope.getDataFromBackground = {
- detailList: [],
- addList: [],
- pagecode: 0,
- title: '',
- tcname: '',
- itemvalue: '',
- tablename: '',
- templettype: 0,
- };
- $scope.getFirstPage = true;
- var getData = function (title, restype, num, innertype, response) {
- if ($stateParams.pageid == 3) {
- innertype = $scope.rolePageModel.orgtype;
- } else if ($stateParams.pageid == 30 || $stateParams.pageid == 31 || $stateParams.pageid == 32 || $stateParams.pageid == 33 || $stateParams.pageid == 34) {
- innertype = $stateParams.pageid
- }
- var tempArray = {};
- //调试
- dataToolsService.getFormStructure($stateParams.pagecode, restype, innertype, $stateParams.node, $stateParams.resourcetype).then(function (res) {
- // dataToolsService.getFormStructure(1000030,30001,innertype,$stateParams.node).then(function(res){
- if (res.code == 3350) {
- if ($stateParams.title) {
- angular.forEach(res.data.infoSectionList[0].unitItems[0], function (val) {
- if (val.tcname == 'orgname' || val.tcname == 'companyid' || val.tcname == 'title') {
- val.content = $stateParams.title;
- }
- })
- }
- tempArray.detailList = res.data.infoSectionList[0].unitItems[0];
- tempArray.addList = res.data.infoSectionList[0].subItems;
- angular.forEach(tempArray.detailList, function (vv) {
- if (vv.addimg) {
- vv.tempimagelist = [];
- vv.imagelist = [];
- vv.orgimages = [];
- }
- });
- angular.forEach(tempArray.addList, function (val) {
- angular.forEach(val.unitItems[0], function (value) {
- if (value.addimg) {
- value.tempimagelist = [];
- value.imagelist = [];
- value.orgimages = [];
- }
- })
- })
- // tempArray.pagecode=res.data.infoSectionList[0].pagecode;
- tempArray.pagecode = $stateParams.pagecode;
- tempArray.title = title;
- tempArray.tcname = res.data.infoSectionList[0].tcname;
- tempArray.restype = restype;
- tempArray.tablename = res.data.infoSectionList[0].tablename;
- tempArray.orgid = 0;
- if ($scope.isedit == 1 || $scope.isedit == 2) {
- var data = response.infoSectionList;
- var baseInfo = response.baseInfoModel;
- tempArray.oid = response.baseInfoModel.oid;
- if (tempArray.addList && tempArray.addList.length > 0) {
- angular.forEach(tempArray.addList, function (ta) {
- var temp = data.filter(function (da) {
- if (da.innertype) {
- return da.itemvalue == ta.itemvalue && da.innertype == ta.innertype;
- } else {
- return da.itemvalue == ta.itemvalue;
- }
- })
- if (temp.length > 0) {
- // console.log(temp);
- // return;
- var dd = Object.assign([], ta.unitItems[0]);
- ta.unitItems = [];
- // var length=temp[0].count?temp[0].count:0;
- var division = temp[0].count ? temp[0].unitlist.length / temp[0].count : 0;
- if (division) {
- for (var k = 0; k < temp[0].unitlist.length; k++) {
- var tt = Object.assign([], dd);
- var detail = temp[0].unitlist.slice(k, k + division);
- k = k + division - 1;
- angular.forEach(detail, function (vv) {
- for (var i = 0; i < tt.length; i++) {
- if (tt[i].tcname == vv.tcname) {
- // console.log(tt[i]);
- tt[i].content = tt[i].type == 'number' ? Number(vv.content) : vv.content;
- break;
- }
- }
- });
- // console.log(tt);
- ta.unitItems.push(JSON.parse(JSON.stringify(tt)));
- tt = [];
- }
- }
- angular.forEach(tempArray.addList, function (v, i) {
- angular.forEach(v.unitItems, function (val, ind) {
- angular.forEach(val, function (value, index) {
- if (value.addimg) {
- var tempImg = value.content ? JSON.parse(value.content) : [];
- if ($scope.isedit == 2) {
- angular.forEach(tempImg, function (v) {
- v.id = 0;
- })
- }
- value.imagelist = Object.assign([], tempImg);
- // value.imagelist=[];
- // value.orgimages=Object.assign([],tempImg);
- value.orgimages = [];
- value.tempimagelist = Object.assign([], tempImg);
- }
- if (value.toggle) {
- value.togglecontent = value.content == '1';
- value.content = value.content == '1' ? '是' : '否';
- }
- })
- })
- })
- }
- })
- }
- if (tempArray.detailList && tempArray.detailList.length > 0) {
- var temp = data.filter(function (vv1) {
- return vv1.itemvalue == restype
- })
- var companyTemp = data.filter(function (vvv) {
- return vvv.itemvalue == 30030;
- })
- if (temp.length > 0) {
- if (companyTemp.length > 0) {
- temp[0].unitlist = temp[0].unitlist.concat(companyTemp[0].unitlist)
- }
- angular.forEach(temp[0].unitlist, function (vv2) {
- for (var i = 0; i < tempArray.detailList.length; i++) {
- var td = tempArray.detailList[i];
- if (td.rescode == vv2.rescode || td.title == vv2.title) {
- // td.content=vv2.content;
- // if(vv2.toggle){
- // console.log(vv2);
- // }
- td.content = td.type == 'number' ? Number(vv2.content) : vv2.content;
- break;
- }
- }
- })
- angular.forEach(tempArray.detailList, function (v1, indx) {
- if (v1.addimg) {
- var tempImg = v1.content ? JSON.parse(v1.content) : [];
- v1.imagelist = Object.assign([], tempImg);
- // v1.imagelist=[];
- // v1.orgimages=Object.assign([],tempImg);
- v1.orgimages = [];
- v1.tempimagelist = Object.assign([], tempImg);
- }
- if (v1.toggle) {
- // console.log(v1);
- v1.togglecontent = v1.content == '1';
- v1.content = v1.content == '1' ? '是' : '否';
- }
- // if(v1.type=='cascade'){
- if (v1.tcname == 'category') {
- // console.log(v1);
- if (v1.dictionary == '30') {
- dataToolsService.getWebCascade(30, 0).then(function (re) {
- if (re.code == 3350) {
- var tem = re.data.filter(function (ve) {
- return ve.code == v1.content;
- })
- if (tem.length > 0) {
- v1.content = tem[0].name;
- }
- }
- })
- } else {
- getCascadList(tempArray.detailList, indx, v1.content)
- }
- }
- })
- // console.log($scope.isedit);
- for (var i = 0; i < tempArray.detailList.length; i++) {
- if (tempArray.detailList[i].tcname == 'orglogo') {
- tempArray.detailList[i].content = baseInfo.logo;
- }
- if (tempArray.detailList[i].tcname == 'orgname') {
- tempArray.detailList[i].content = baseInfo.title;
- }
- if (tempArray.detailList[i].tcname == 'companyid') {
- tempArray.detailList[i].content = baseInfo.title;
- }
- }
- }
- }
- if ($scope.getFirstPage && num == 0) {
- $scope.getDataFromBackground = tempArray;
- $scope.getFirstPage = false;
- $scope.hideLoadingToast();
- }
- $scope.tempData[num] = tempArray;
- } else {
- if ($scope.getFirstPage && num == 0) {
- $scope.getDataFromBackground = tempArray;
- $scope.getFirstPage = false;
- $scope.hideLoadingToast();
- }
- $scope.tempData[num] = tempArray;
- }
- if ($scope.tempData[0] != undefined && $scope.tempData[0].title == "导师信息") {
- angular.forEach($scope.tempData[0].addList, function (val, index) {
- if (val.title == "添加人才") {
- val.title = "添加导师";
- }
- angular.forEach(val.unitItems[0], function (value, index) {
- if (value.title == "人才简介") {
- value.title = "导师简介";
- value.placeholder = "请输入导师简介";
- }
- })
- })
- }
- if (title == "导师信息") {
- var list = [];
- angular.forEach($scope.tempData[0].addList[0].unitItems[0], function (val, index) {
- if (val.title != "职位" && val.title != "学位" && val.title != "所属领域") {
- list.push(val);
- }
- })
- $scope.tempData[0].addList[0].unitItems[0] = list;
- }
- } else {
- console.error('网络错误')
- }
- })
- }
- $scope.carryout = {}
- //调试
- // getData('基本信息',30001,0);
- $scope.changeInfoStyle = function () {
- if ($scope.isedit == 0) {
- $scope.isTapChange = !$scope.isTapChange;
- // 选取身份证弹框
- $ionicActionSheet.show({
- buttons: toggleInfo,
- cancelText: '取消',
- buttonClicked: function (index) {
- var tginfo = [
- {
- savename: '保存企业基本信息',
- text: '<a class="action-sheet-push">企业</a>',
- title: '企业基本信息',
- orgtype: 10104,
- id: $stateParams.pageid,
- select: true,
- }, {
- savename: '保存高校基本信息',
- text: '<a class="action-sheet-push">高校</a>',
- title: '高校基本信息',
- orgtype: 10105,
- id: $stateParams.pageid,
- select: false
- }
- ]
- $scope.rolePageModel = tginfo[index];
- $scope.getFirstPage = true;
- // getData($scope.activity[0].headerName,$scope.activity[0].restype,0);
- getRolePageSectionList();
- return true;
- }
- });
- }
- };
- // 点击页头切换页面
- $scope.changeAct = function (num) {
- /************ sarah ****************/
- $scope.tempData[lastNum] = null;
- $scope.tempData[lastNum] = Object.assign({}, $scope.getDataFromBackground);
- lastNum = num;
- // console.log($scope.tempData);
- // 基本信息的联想
- if ($scope.tempData[num].title == '人力资源' && $scope.tempData[0].orgid && hasSearchData[num]) {
- hasSearchData[num] = false;
- $scope.showLoadingToast();
- dataToolsService.getHrResource($scope.tempData[0].orgid, $scope.tempData[0].pagecode, 0).then(function (res) {
- $scope.hideLoadingToast();
- if (res.code == 3350) {
- // $scope.tempData[num].detailList=res.data;
- angular.forEach($scope.tempData[num].detailList, function (val) {
- for (var key in res.data) {
- if (key == val.tcname) {
- val.content = res.data[key];
- if (val.toggle) {
- val.content = res.data[key] ? '是' : '否';
- val.togglecontent = res.data[key] ? true : false;
- }
- // if(val.type=='number'){
- // val.content=res.data[key];
- // }
- }
- }
- })
- }
- })
- } else if ($scope.tempData[0].orgid && hasSearchData[num]) {
- console.log(1);
- console.log($scope.tempData[0]);
- hasSearchData[num] = false;
- angular.forEach($scope.tempData[num].detailList, function (value) {
- for (var key in $scope.tempData[0].conpanyInfo) {
- if (key == value.tcname) {
- if (value.tcname != 'id' && value.restype != 3760) {
- value.content = $scope.tempData[0].conpanyInfo[key];
- }
- if (value.toggle) {
- value.content = $scope.tempData[0].conpanyInfo[key] ? '是' : '否';
- value.togglecontent = $scope.tempData[0].conpanyInfo[key] ? true : false;
- }
- }
- }
- })
- }
- console.log('$scope.tempData', $scope.tempData)
- if ($scope.tempData[num]) {
- $scope.getDataFromBackground = $scope.tempData[num];
- } else {
- // 从后台获取表单信息
- getData($scope.activity[num].restype);
- }
- /************2018****************/
- $ionicScrollDelegate.$getByHandle('mainScroll').scrollTop();
- $timeout(function () {
- $("#orgname").prop("disabled", true);
- }, 50);
- $scope.act = $scope.activity[num].className;
- var tablength = $scope.activity.length;//标题个数
- var middlewidth = $(window).width() / 2;//获取当前手机屏幕宽度一般
- var OffLeft = $(".main-select").eq(num).offset().left;//获取当前点击标题距离父容器左边框的距离
- var SelfWidth = $(".main-select").eq(num).width();//获取当前点击标题宽度
- var startTranform = $(".visitModule_header .scroll").offset().left + 25;
- var movewidth = OffLeft - middlewidth + SelfWidth / 2;
- startTranform -= movewidth;
- if (startTranform <= 0) {
- if (num < tablength - 1) {
- $('.visitModule_header .scroll').css({
- 'transform': 'translate3d(' + startTranform + 'px,0,0)'
- });
- }
- } else if (num < 4) {
- $('.visitModule_header .scroll').css({
- 'transform': 'translate3d(0,0,0)'
- });
- }
- $(".main-select").eq(num).addClass("arrange_borderBottom").siblings().removeClass("arrange_borderBottom");
- };
- //保存企业信息表
- $scope.connEnterpriseModuleModel = {
- id: 0,
- organizationInfo: {
- id: 0
- }
- };
- // 控制多次点击保存不触发
- var saveflg = 0;
- // var tempimages = [];
- var basicArr = [];//基本信息
- var projectInfo = [];//项目信息
- var comProduct = [];//企业产品
- var basicOperate = [];
- var basicIPR = [];
- var basicContact = [];
- var projectTransformation = {};
- var basicIUS = {};
- var temp = {};
- /************ sarah ****************/
- // 处理数组
- var handleArray = function (arr, delarr) {
- console.log(delarr);
- console.log(arr);
- if (delarr != 'other' && delarr && delarr.length > 0) {
- angular.forEach(delarr, function (v, i) {
- angular.forEach(v, function (vv) {
- if (vv.tcname == 'isenabled') {
- vv.content = '2';
- }
- })
- arr.push(v);
- })
- }
- if (arr && arr.length > 0) {
- var array = [];
- // 全部为空,则舍弃该组数据
- for (var i = 0; i < arr.length; i++) {
- for (var j = 0; j < arr[i].length; j++) {
- if (arr[i][j].content != '' || (arr[i][j].imagelist != undefined && arr[i][j].imagelist.length > 0)) break;
- }
- if (j == arr[i].length) {
- arr.splice(i, 1);
- i--;
- }
- ;
- }
- // 赋初始值
- for (var k = 0; k < arr.length; k++) {
- for (var m = 0; m < arr[k].length; m++) {
- if (arr[k][m].content == '') {
- arr[k][m].content = arr[k][m].defaultvalue;
- }
- }
- }
- if (arr.length == 0) {
- return [];
- }
- // console.log(arr);
- angular.forEach(arr, function (val, index) {
- temp = {};
- isSon = true;
- // angular.forEach(val,function(value,ind){
- for (var i = 0; i < val.length; i++) {
- var value = val[i];
- if (value.fathermodel != '') {
- temp[value.fathermodel] = typeof temp[value.fathermodel] == 'object' ? temp[value.fathermodel] : {};
- if (value.fathercolumnname != '') {
- if (value.addimg) {
- if (value.orgimages.length > 0) {
- value.imagelist = value.imagelist.concat(value.orgimages);
- }
- temp[value.fathermodel][value.fathercolumnname] = JSON.stringify(value.imagelist);
- } else if (value.selectaction) {
- temp[value.fathermodel][value.fathercolumnname] = value.itemIndex;
- } else if (value.toggle) {
- temp[value.fathermodel][value.fathercolumnname] = value.content == '是' ? 1 : 0;
- } else {
- // temp[value.fathermodel][value.fathercolumnname] = value.content;
- if (value.content != '') {
- temp[value.fathermodel][value.fathercolumnname] = value.content;
- } else {
- continue;
- }
- }
- } else {
- if (value.addimg) {
- if (value.orgimages.length > 0) {
- value.imagelist = value.imagelist.concat(value.orgimages);
- }
- temp[value.fathermodel][value.tcname] = JSON.stringify(value.imagelist);
- } else if (value.selectaction) {
- temp[value.fathermodel][value.tcname] = value.itemIndex;
- } else if (value.toggle) {
- temp[value.fathermodel][value.tcname] = value.content == '是' ? 1 : 0;
- } else {
- // temp[value.fathermodel][value.tcname] = value.content;
- if (value.content != '') {
- temp[value.fathermodel][value.tcname] = value.content;
- } else {
- continue;
- }
- }
- }
- if (value.ismain == 1) {
- if (value.addimg) {
- if (value.orgimages.length > 0) {
- value.imagelist = value.imagelist.concat(value.orgimages);
- }
- temp[value.tcname] = JSON.stringify(value.imagelist);
- } else if (value.selectaction) {
- temp[value.tcname] = value.itemIndex;
- } else if (value.toggle) {
- temp[value.tcname] = value.content == '是' ? 1 : 0;
- } else {
- // temp[value.tcname] = value.content;
- if (value.content != '') {
- temp[value.tcname] = value.content;
- } else {
- continue;
- }
- }
- }
- } else {
- if (value.addimg) {
- if (value.orgimages.length > 0) {
- value.imagelist = value.imagelist.concat(value.orgimages);
- }
- if (value.restype == 3760 && delarr !== false) {//等于其他信息
- temp.imagelists = JSON.stringify(value.imagelist);
- } else if (value.restype != 3760) {
- temp[value.tcname] = JSON.stringify(value.imagelist);
- }
- } else if (value.selectaction) {
- temp[value.tcname] = value.itemIndex;
- } else if (value.toggle) {
- temp[value.tcname] = value.content == '是' ? 1 : 0;
- } else {
- // temp[value.tcname] = value.content;
- if (value.content != '' && value.restype != 3760) {
- temp[value.tcname] = value.content;
- } else if (value.restype == 3760 && delarr !== false) {
- temp[value.tcname] = value.content;
- } else {
- continue;
- }
- }
- }
- }
- // });
- if (delarr === false) {
- array.push(temp);
- // array=[temp];
- console.log(array);
- } else {
- // if($scope.isedit==1||$scope.isedit==2){
- // temp.connid=$stateParams.connid;
- // }else{
- // temp.connid=$scope.connid;
- // }
- temp.connid = $scope.connid;
- temp.companyid = $scope.connEnterpriseModuleModel.organizationInfo.id;
- temp.creator = UserService.id;
- temp.updater = UserService.id;
- temp.isenabled = (temp.isenabled == '' || temp.isenabled == undefined) ? 1 : temp.isenabled;
- temp.id = (temp.id == '' || temp.id == undefined) ? 0 : temp.id;
- if ($scope.isedit == 2) {
- temp.id = 0;
- }
- // array=[temp];
- console.log(temp);
- array.push(temp);
- console.log(array);
- }
- });
- console.log(array);
- return array;
- } else {
- return [];
- }
- };
- var feedbackItem = {};
- $scope.saveCompanyInfo = function () {
- var pagecode = $scope.tempData[0].pagecode;
- if ($scope.tempData[0].addList != null) {
- if ($scope.tempData[0].addList[0] == undefined) {
- var bakeinfoList = $scope.tempData[0].detailList;
- } else {
- var bakeinfoList = $scope.tempData[0].addList[0].unitItems[0];
- }
- } else {
- var bakeinfoList = $scope.tempData[0].detailList;
- }
- var flag = 0;
- angular.forEach(bakeinfoList, function (val) {
- if (val.title == "姓名" && val.content == "") {
- CommonService.showMessage('请输入导师姓名!', $scope);
- flag = 1;
- }
- })
- if (flag == 0) {
- var orgName = "";
- if ($scope.tempData[0].detailList != null && $scope.tempData[0].detailList != undefined) {
- angular.forEach($scope.tempData[0].detailList, function (val) {
- if (val.title == "企业名称") {
- orgName = val.content;
- }
- });
- }
- if (pagecode == 1000030 && orgName != "") {
- dataToolsService.judgeOrgExistResource(orgName, UserService.node).then(function (response) {
- var message = response.message;
- if (message == "已存在该企业") {
- CommonService.showMessage('已存在该企业,请重新输入!', $scope);
- } else if (message == "该企业不存在") {
- newSaveCompanyInfo();
- }
- });
- }
- newSaveCompanyInfo();
- }
- };
- var newSaveCompanyInfo = function () {
- if ($stateParams.pageid == 30 || $stateParams.pageid == 31 || $stateParams.pageid == 32 || $stateParams.pageid == 33 || $stateParams.pageid == 34) {
- console.log($scope.tempData);
- for (var i = 0; i < $scope.tempData[0].detailList.length; i++) {
- if ($scope.tempData[0].detailList[i].needed && $scope.tempData[0].detailList[i].content == '') {
- if ($scope.app) {
- UtilService.showMess($scope.tempData[0].detailList[i].title + '是必填项');
- } else {
- CommonService.showMessage($scope.tempData[0].detailList[i].title + '是必填项', $scope);
- }
- $scope.hideLoadingToast();
- saveflg = 0;
- return;
- }
- }
- var params = handleArray([$scope.tempData[0].detailList], false)[0];
- if (params) {
- params.id = params.id ? params.id : 0;
- params.isenabled = params.isenabled ? params.isenabled : 1;
- params.comfrom = $stateParams.node;
- params.creator = UserService.id;
- params.restype = $stateParams.pageid;
- console.log(params);
- var data = {
- data: params,
- node: $stateParams.node
- }
- // return;
- console.log(data);
- dataToolsService.saveWebInfo(data).then(function (res) {
- console.log($scope.isedit);
- if (res.code == 3350) {
- // if($scope.isedit==0){
- $scope.goback();
- // }else{
- // $scope.go('resourceCommonDetailsPage', {
- // recourceid: $stateParams.connid,
- // recourcetype: $stateParams.restype,
- // recourcecomefrom: $stateParams.node,
- // creator: '',
- // title:$stateParams.title,
- // orgtype:$stateParams.orgtype,
- // // comfrom:$scope.comfrom,
- // pagecode:$stateParams.pagecode
- // });
- // }
- }
- })
- } else {
- saveflg = 0;
- if ($scope.app) {
- UtilService.showMess('请填写相关数据');
- } else {
- CommonService.showMessage('请填写相关数据', $scope);
- }
- }
- return;
- }
- if ($stateParams.comfrom == 'activityDetail') {
- console.log($scope.tempData[0]);
- for (var i = 0; i < $scope.tempData[0].detailList.length; i++) {
- if ($scope.tempData[0].detailList[i].needed && $scope.tempData[0].detailList[i].content == '') {
- if ($scope.app) {
- UtilService.showMess($scope.tempData[0].detailList[i].title + '是必填项');
- } else {
- CommonService.showMessage($scope.tempData[0].detailList[i].title + '是必填项', $scope);
- }
- $scope.hideLoadingToast();
- saveflg = 0;
- return;
- }
- }
- var params1 = handleArray([$scope.tempData[0].detailList], false)[0];
- if (params1) {
- var images = JSON.parse(params1.images);
- angular.forEach(images, function (val) {
- val.doctype = 4913;
- })
- var data1 = {
- "activityid": $stateParams.companyid,
- "title": params1.title,
- "content": params1.content,
- "creator": UserService.id,
- "images": JSON.stringify(images)
- }
- dataToolsService.saveActivityBroadcastInfo({data: data1}).then(function (res) {
- console.log(res);
- if (res.code == 3350) {
- $scope.hideLoadingToast();
- $scope.go('activityDetail', {activityid: $stateParams.companyid})
- }
- })
- }
- return;
- }
- // 获取企业基本信息数组
- console.log($scope.tempData);
- basicArr = $scope.tempData.filter(function (val, i, arr) {
- return val.title == '企业基本信息' || '高校基本信息';
- })[0];
- projectInfo = $scope.tempData.filter(function (val, i, arr) {
- return val.title == '项目信息';
- })[0] || {addList: []};
- comProduct = $scope.tempData.filter(function (val, i, arr) {
- return val.title == '企业产品';
- })[0] || {addList: []};
- // 经营情况
- basicOperate = $scope.tempData.filter(function (val) {
- return val.title == '经营情况';
- })[0];
- // 知识产权
- basicIPR = $scope.tempData.filter(function (val) {
- return val.title == '知识产权';
- })[0];
- // 产学研信息 industry-university-research
- basicIUS = $scope.tempData.filter(function (val) {
- return val.title == '产学研信息';
- })[0];
- // 联系方式 contact
- basicContact = $scope.tempData.filter(function (val) {
- return val.title == '联系方式';
- })[0];
- projectTransformation = $scope.tempData.filter(function (val) {
- return val.title == '促成成果转化项目';
- })[0];
- // if($stateParams.node=='320117005'||$stateParams.node=='320117003'||$stateParams.node=='320117002'||$stateParams.node=='320117001'||$stateParams.node=='320117004'){
- // basicArr=$scope.tempData[0];
- // }
- if (saveflg != 0) {
- return;
- }
- saveflg = 1;
- $scope.showLoadingToast();
- saveInfo();
- };
- console.log('---------', $scope.rolePageModel);
- // 保存企业信息
- var saveInfo = function () {
- basicArr = basicArr ? basicArr : $scope.tempData[0];
- // 判断必填项
- for (var i = 0; i < basicArr.detailList.length; i++) {
- if (basicArr.detailList[i].needed && basicArr.detailList[i].content == '') {
- if ($scope.app) {
- UtilService.showMess(basicArr.detailList[i].title + '是必填项');
- } else {
- CommonService.showMessage(basicArr.detailList[i].title + '是必填项', $scope);
- }
- $scope.hideLoadingToast();
- saveflg = 0;
- return;
- }
- }
- if (basicArr.addList.length != 0) {
- for (var i = 0; i < basicArr.addList[0].unitItems.length; i++) {
- for (var s = 0; s < basicArr.addList[0].unitItems[i].length; s++) {
- if (basicArr.addList[0].unitItems[i][s].needed && basicArr.addList[i].unitItems[i][s].content == '') {
- if ($scope.app) {
- UtilService.showMess(basicArr.addList[0].unitItems[i][s].title + '是必填项');
- } else {
- CommonService.showMessage(basicArr.addList[0].unitItems[i][s].title + '是必填项', $scope);
- }
- $scope.hideLoadingToast();
- saveflg = 0;
- return;
- }
- }
- }
- }
- // 处理数据
- var allbasicArr = [];
- for (var i = 0; i < $scope.tempData.length; i++) {
- if ($scope.tempData[i].title != '人力资源') {
- for (var j = 0; j < $scope.tempData[i].detailList.length; j++) {
- if ($scope.tempData[i].detailList[j].type == 'hidden' && $scope.tempData[i].detailList[j].restype != 3760) {
- if ($scope.tempData[i].title != '基本信息' || $scope.tempData[i].title != '高校基本信息')
- $scope.tempData[i].detailList.splice(j, 1);
- }
- }
- allbasicArr = allbasicArr.concat($scope.tempData[i].detailList);
- // console.log(allbasicArr);
- }
- }
- console.log('$scope.tempData', $scope.tempData)
- // var allbasicArr=basicArr.detailList;
- // if(basicOperate.detailList&&basicOperate.detailList.length>0){
- // allbasicArr=allbasicArr.concat(basicOperate.detailList);
- // }
- // if(basicIPR.detailList&&basicIPR.detailList.length>0){
- // allbasicArr=allbasicArr.concat(basicIPR.detailList);
- // }
- // if(basicIUS.detailList&&basicIUS.detailList.length>0){
- // allbasicArr=allbasicArr.concat(basicIUS.detailList);
- // }
- // if(basicContact.detailList&&basicContact.detailList.length>0){
- // allbasicArr=allbasicArr.concat(basicContact.detailList);
- // }
- if (String(allbasicArr) != '') {
- console.log('一段逻辑', allbasicArr)
- $scope.connEnterpriseModuleModel = handleArray([allbasicArr], false)[0];
- }
- // 企业图片
- $scope.requestModel = {
- data: [],
- node: $stateParams.node,
- pagecode: $stateParams.pagecode,
- }
- // 走访履历表中需记录机构信息
- $scope.connEnterpriseModuleModel.isenabled = 1;
- $scope.connEnterpriseModuleModel.userModel = {
- userid: UserService.id
- };
- // console.log($scope.connEnterpriseModuleModel);
- // if($scope.connEnterpriseModuleModel.organizationInfo.name){
- // }else{
- // var str='';
- // angular.forEach(projectTransformation.addList[0].unitItems,function(val){
- // angular.forEach(val,function(value){
- // if(value.tcname=='projectname'){
- // str+=value.content+' ';
- // }
- // })
- // })
- // $scope.connEnterpriseModuleModel.title =str
- // }
- console.log('$stateParams.pageid',$stateParams.pageid)
- if ($stateParams.pageid == 18) {
- $scope.connEnterpriseModuleModel.organizationInfoList = [];
- if (basicArr.addList.length > 0 && basicArr.addList[0].unitItems.length > 0) {
- $scope.connEnterpriseModuleModel.organizationInfoList = basicArr.addList[0].unitItems;
- }
- $scope.connEnterpriseModuleModel.organizationInfo = {};
- $scope.connEnterpriseModuleModel.organizationInfo.name = $scope.connEnterpriseModuleModel.affiliatedorg;
- $scope.connEnterpriseModuleModel.organizationInfo.title = $scope.connEnterpriseModuleModel.title;
- } else if ($stateParams.pageid == 20) {
- $scope.connEnterpriseModuleModel.organizationInfo.name = $scope.connEnterpriseModuleModel.organizationInfo.name;
- $scope.connEnterpriseModuleModel.organizationInfo.about = $scope.connEnterpriseModuleModel.orgcontent;// 企业logo
- $scope.connEnterpriseModuleModel.organizationInfo.orgtype = $scope.rolePageModel.orgtype;// 机构类型
- } else {
- $scope.connEnterpriseModuleModel.title = $scope.connEnterpriseModuleModel.organizationInfo.name;
- $scope.connEnterpriseModuleModel.organizationInfo.about = $scope.connEnterpriseModuleModel.orgcontent;// 企业logo
- $scope.connEnterpriseModuleModel.organizationInfo.orgtype = (basicArr.conpanyInfo && basicArr.conpanyInfo.orgtype) ? basicArr.conpanyInfo.orgtype : $scope.rolePageModel.orgtype;// 机构类型
- }
- $scope.connEnterpriseModuleModel.orgtype = (basicArr.conpanyInfo && basicArr.conpanyInfo.orgtype) ? basicArr.conpanyInfo.orgtype : $scope.rolePageModel.orgtype;// 机构类型
- $scope.connEnterpriseModuleModel.templettype = $stateParams.pageid;
- $scope.connEnterpriseModuleModel.pagecode = basicArr.pagecode;
- if ($scope.isedit == 2 || $scope.isedit == 0) {
- $scope.connEnterpriseModuleModel.id = 0;
- $scope.connEnterpriseModuleModel.organizationInfo.id = 0;
- }
- //编辑功能
- if ($scope.isedit == 1) {
- $scope.connEnterpriseModuleModel.id = $stateParams.connid;
- }
- // if($scope.isedit==0){
- // $scope.connEnterpriseModuleModel.id = 0;
- // $scope.connEnterpriseModuleModel.organizationInfo.id=0;
- // }
- // 传参格式
- $scope.requestModel.data = JSON.parse(JSON.stringify($scope.connEnterpriseModuleModel));
- $scope.requestModel.pagecode = basicArr.pagecode;
- $scope.requestModel.pagetitle = $stateParams.pageTitle;
- console.log('$scope.requestModel', $scope.requestModel);
- dataToolsService.saveOrganizationInfo($scope.requestModel).then(function (response) {
- // console.log(response);
- if (response.code == ConstantService.INTERFACE_STATUS_CODE_3350) {
- // 保存走访基本信息 后保存其他内容
- // 取得记录id
- $scope.connid = response.data.id;
- feedbackItem.connid = response.data.id;
- // if($scope.isedit==1||$scope.isedit==2){
- // $scope.connid=$stateParams.connid;
- // };
- // 取得机构id
- $scope.connEnterpriseModuleModel.organizationInfo.id = response.data.organizationInfo.id;
- // 1保存走访研发投入
- saveCompanyYearMultipleoptions1();
- } else {
- // console.log(ConstantService.INTERFACE_MESSAGE_ERROR);
- if ($scope.app) {
- UtilService.showMess(ConstantService.INTERFACE_MESSAGE_ERROR);
- } else {
- CommonService.showMessage(ConstantService.INTERFACE_MESSAGE_ERROR, $scope);
- }
- saveflg = 0;
- }
- }, function () {
- CommonService.showMessage(ConstantService.INTERFACE_MESSAGE_ERROR, $scope);
- // UtilService.showMess(ConstantService.INTERFACE_MESSAGE_ERROR);
- // $scope.hideLoadingToast();
- saveflg = 0;
- });
- };
- // 1保存走访研发投入 企业基本信息->研发投入
- var saveCompanyYearMultipleoptions1 = function () {
- $scope.requestModel = {
- data: [],
- node: $stateParams.node,
- pagecode: $stateParams.pagecode,
- };
- // 获取研发投入数据
- if (basicArr.addList && basicArr.addList.length > 0) {
- var tempArr = basicArr.addList.filter(function (value, j, arr) {
- return value.title == '研发投入'
- })[0];
- if (tempArr) {
- $scope.requestModel.data = handleArray(tempArr.unitItems, tempArr.deletUnitItems);
- }
- }
- console.log($scope.requestModel.data);
- console.log(2);
- if (String($scope.requestModel.data) == '') {
- saveCompanyYearMultipleoptions2();
- } else {
- dataToolsService.insertOrUpdateCompanyYearMultipleoptions($scope.requestModel).then(function (response) {
- // 保存销售收入、净利润、上缴税收
- saveCompanyYearMultipleoptions2();
- // console.log(response);
- }, function () {
- if ($scope.app) {
- UtilService.showMess(ConstantService.INTERFACE_MESSAGE_ERROR);
- } else {
- CommonService.showMessage(ConstantService.INTERFACE_MESSAGE_ERROR, $scope);
- }
- })
- }
- };
- // console.log(2);
- // 2保存走访销售收入、净利润、上缴税收 企业基本信息->实际收入/预计投入情况
- var saveCompanyYearMultipleoptions2 = function () {
- // 保存多条信息需要的格式
- $scope.requestModel = {
- data: [],
- node: $stateParams.node,
- pagecode: $stateParams.pagecode,
- };
- // 保存走访销售收入、净利润、上缴税收
- if (basicArr.addList && basicArr.addList.length > 0) {
- var tempArr = basicArr.addList.filter(function (value, j, arr) {
- return value.title == '实际收入/预计投入情况'
- })[0];
- if (tempArr) {
- $scope.requestModel.data = handleArray(tempArr.unitItems, tempArr.deletUnitItems);
- }
- }
- // console.log(2);
- // console.log($scope.requestModel);
- console.log(3);
- if (String($scope.requestModel.data) == '') {
- saveCompanyYearMultipleoptions3();
- } else {
- dataToolsService.insertOrUpdateCompanyYearMultipleoptions($scope.requestModel).then(function (response) {
- // 保存走访工程中心情况
- // console.log(response);
- saveCompanyYearMultipleoptions3();
- }, function () {
- CommonService.showMessage(ConstantService.INTERFACE_MESSAGE_ERROR, $scope);
- // UtilService.showMess(ConstantService.INTERFACE_MESSAGE_ERROR);
- })
- }
- };
- // 3保存走访工程中心情况 企业基本信息->工程中心信息
- var saveCompanyYearMultipleoptions3 = function () {
- // 保存多条信息需要的格式
- $scope.requestModel = {
- data: [],
- node: $stateParams.node,
- pagecode: $stateParams.pagecode,
- };
- if (basicArr.addList && basicArr.addList.length > 0) {
- var tempArr = basicArr.addList.filter(function (value, j, arr) {
- return value.title == '工程中心信息'
- })[0];
- if (tempArr) {
- $scope.requestModel.data = handleArray(tempArr.unitItems, tempArr.deletUnitItems);
- }
- }
- if (basicIPR) {
- var temp = basicIPR.addList.filter(function (val) {
- return val.title == '添加专利申请';
- })
- if (temp.length > 0) {
- $scope.requestModel.data = handleArray(temp[0].unitItems, temp[0].deletUnitItems);
- }
- }
- // console.log('abc');
- // console.log($scope.requestModel.data);
- console.log(4);
- if (String($scope.requestModel.data) == '') {
- saveCompanyTechrequirement();
- } else {
- dataToolsService.insertOrUpdateCompanyYearMultipleoptions($scope.requestModel).then(function (response) {
- // console.log(response);
- // 保存关联需求表
- saveCompanyTechrequirement();
- }, function () {
- if ($scope.app) {
- UtilService.showMess(ConstantService.INTERFACE_MESSAGE_ERROR);
- } else {
- CommonService.showMessage(ConstantService.INTERFACE_MESSAGE_ERROR, $scope);
- }
- })
- }
- };
- // 4保存关联需求表 企业需求
- var saveCompanyTechrequirement = function () {
- // 保存多条信息需要的格式
- $scope.requestModel = {
- data: [],
- node: $stateParams.node,
- pagecode: $stateParams.pagecode,
- };
- var demand = $scope.tempData.filter(function (val, i, arr) {
- return val.title == '企业需求';
- })[0];
- // if($stateParams.node=='320117005'||$stateParams.node=='320117003'||$stateParams.node=='320117002'||$stateParams.node=='320117001'||$stateParams.node=='320117004'){
- // demand=$scope.tempData[0];
- // }
- console.log(demand);
- if (demand) {
- $scope.requestModel.data = handleArray(demand.addList[0].unitItems, demand.addList[0].deletUnitItems);
- }
- // console.log(4);
- // console.log($scope.requestModel);
- console.log(5);
- console.log($scope.requestModel);
- if (String($scope.requestModel.data) == '') {
- saveCompanyDeclareproject();
- } else {
- dataToolsService.insertOrUpdateCompanyTechrequirement($scope.requestModel).then(function (response) {
- // console.log(response);
- feedbackItem.demand = response.data;
- // 5保存走访申报项目接口
- saveCompanyDeclareproject();
- }, function () {
- if ($scope.app) {
- UtilService.showMess(ConstantService.INTERFACE_MESSAGE_ERROR);
- } else {
- CommonService.showMessage(ConstantService.INTERFACE_MESSAGE_ERROR, $scope);
- }
- })
- }
- };
- // 5保存走访申报项目接口 项目信息->项目建议
- var saveCompanyDeclareproject = function () {
- // 保存多条信息需要的格式
- $scope.requestModel = {
- data: [],
- node: $stateParams.node,
- pagecode: $stateParams.pagecode,
- };
- if (projectInfo.addList) {
- var tempArr = projectInfo.addList.filter(function (value, j, arr) {
- return value.title == '添加项目建议'
- })[0];
- if (tempArr) {
- $scope.requestModel.data = handleArray(tempArr.unitItems, tempArr.deletUnitItems);
- }
- }
- console.log(6);
- if (String($scope.requestModel.data) == '') {
- saveCompanyHighleveltalents();
- } else {
- dataToolsService.insertOrUpdateCompanyDeclareproject($scope.requestModel).then(function (response) {
- // console.log(response);
- // 6保存高端人才信息表
- saveCompanyHighleveltalents();
- }, function () {
- if ($scope.app) {
- UtilService.showMess(ConstantService.INTERFACE_MESSAGE_ERROR);
- } else {
- CommonService.showMessage(ConstantService.INTERFACE_MESSAGE_ERROR, $scope);
- }
- })
- }
- };
- // 6保存高端人才信息表 人才信息
- var saveCompanyHighleveltalents = function () {
- // 保存多条信息需要的格式
- $scope.requestModel = {
- data: [],
- node: $stateParams.node,
- pagecode: $stateParams.pagecode,
- };
- var talentPerson = $scope.tempData.filter(function (val, i, arr) {
- return val.title == '人才信息' || val.title == '专家信息';
- })[0];
- if (talentPerson) {
- $scope.requestModel.data = handleArray(talentPerson.addList[0].unitItems, talentPerson.addList[0].deletUnitItems);
- for (var i = 0; i < $scope.tempData.length; i++) {
- if ($scope.tempData[i].title == "人才信息") {
- for (var j = 0; j < $scope.requestModel.data.length; j++) {
- $scope.requestModel.data[j].restype = 38;
- }
- }
- if ($scope.tempData[i].title == "专家信息") {
- for (var j = 0; j < $scope.requestModel.data.length; j++) {
- $scope.requestModel.data[j].restype = 8;
- }
- }
- }
- }
- console.log(7);
- if (String($scope.requestModel.data) == '') {
- saveCompanyHignendproduct();
- } else {
- dataToolsService.insertOrUpdateCompanyHighleveltalents($scope.requestModel).then(function (response) {
- // console.log(response);
- // 7保存高端产品
- saveCompanyHignendproduct();
- }, function () {
- if ($scope.app) {
- UtilService.showMess(ConstantService.INTERFACE_MESSAGE_ERROR);
- } else {
- CommonService.showMessage(ConstantService.INTERFACE_MESSAGE_ERROR, $scope);
- }
- })
- }
- };
- // 7保存高端产品 企业产品->高新产品
- var saveCompanyHignendproduct = function () {
- // 保存多条信息需要的格式
- $scope.requestModel = {
- data: [],
- node: $stateParams.node,
- pagecode: $stateParams.pagecode,
- };
- if (comProduct.addList) {
- var tempArr = comProduct.addList.filter(function (value, j, arr) {
- return value.title == '添加高新产品'
- })[0];
- if (tempArr) {
- $scope.requestModel.data = handleArray(tempArr.unitItems, tempArr.deletUnitItems);
- }
- }
- console.log(8);
- if (String($scope.requestModel.data) == '') {
- saveCompanyIur();
- } else {
- dataToolsService.insertOrUpdateCompanyHignendproduct($scope.requestModel).then(function (response) {
- // console.log(response);
- // 8保存产学研
- saveCompanyIur();
- }, function () {
- if ($scope.app) {
- UtilService.showMess(ConstantService.INTERFACE_MESSAGE_ERROR);
- } else {
- CommonService.showMessage(ConstantService.INTERFACE_MESSAGE_ERROR, $scope);
- }
- })
- }
- };
- // 溧水录入产学研分块保存
- var saveIUSInfo = function (arr) {
- var def = $q.defer();
- var saveStatus = [];
- for (var i = 0; i < arr.length; i++) {
- saveStatus[i] = false;
- var requestModel = {
- data: [],
- node: $stateParams.node,
- pagecode: $stateParams.pagecode,
- }
- requestModel.data = handleArray(arr[i].unitItems, arr[i].deletUnitItems);
- if (String(requestModel.data) == '') {
- continue;
- } else {
- console.log(requestModel.data);
- if (arr[i].tcname == 'company_iur_lk') {
- dataToolsService.insertOrUpdateCompanyIur(requestModel).then(function (response) {
- // console.log(response);
- saveStatus[i] = true;
- }, function () {
- if ($scope.app) {
- UtilService.showMess(ConstantService.INTERFACE_MESSAGE_ERROR);
- } else {
- CommonService.showMessage(ConstantService.INTERFACE_MESSAGE_ERROR, $scope);
- }
- })
- } else {
- dataToolsService.insertOrUpdateCompanyYearMultipleoptions(requestModel).then(function (response) {
- // console.log(response);
- saveStatus[i] = true;
- }, function () {
- if ($scope.app) {
- UtilService.showMess(ConstantService.INTERFACE_MESSAGE_ERROR);
- } else {
- CommonService.showMessage(ConstantService.INTERFACE_MESSAGE_ERROR, $scope);
- }
- })
- }
- }
- }
- var timer = $interval(function () {
- var j = 0
- for (; j < saveStatus.length; j++) {
- if (!saveStatus) break;
- }
- if (j == saveStatus.length) {
- $interval.cancel(timer);
- def.resolve(true);
- }
- }, 300)
- return def.promise;
- }
- // 8保存产学研 项目信息->产学研经验
- var saveCompanyIur = function () {
- // 保存多条信息需要的格式
- $scope.requestModel = {
- data: [],
- node: $stateParams.node,
- pagecode: $stateParams.pagecode,
- };
- if ($stateParams.pagecode == 1000003) {
- var tempArr = projectInfo.addList.filter(function (value, j, arr) {
- return value.title == '添加产学研经验'
- })[0];
- if (tempArr) {
- $scope.requestModel.data = handleArray(tempArr.unitItems, tempArr.deletUnitItems);
- }
- console.log(9);
- if (String($scope.requestModel.data) == '') {
- saveCompanyYearMultipleoptions4();
- } else {
- dataToolsService.insertOrUpdateCompanyIur($scope.requestModel).then(function (response) {
- // console.log(response);
- // 9保存重大科研项目
- saveCompanyYearMultipleoptions4();
- }, function () {
- if ($scope.app) {
- UtilService.showMess(ConstantService.INTERFACE_MESSAGE_ERROR);
- } else {
- CommonService.showMessage(ConstantService.INTERFACE_MESSAGE_ERROR, $scope);
- }
- })
- }
- } else if (basicIUS) {
- saveIUSInfo(basicIUS.addList).then(function (data) {
- if (data) {
- saveCompanyYearMultipleoptions4();
- }
- })
- } else {
- saveCompanyYearMultipleoptions4();
- }
- };
- // 9保存重大科研项目 项目信息->重大科研项目
- var saveCompanyYearMultipleoptions4 = function () {
- // 保存多条信息需要的格式
- $scope.requestModel = {
- data: [],
- node: $stateParams.node,
- pagecode: $stateParams.pagecode,
- };
- if (projectInfo.addList) {
- var tempArr = projectInfo.addList.filter(function (value, j, arr) {
- return value.title == '添加重大科研项目'
- })[0];
- if (tempArr) {
- $scope.requestModel.data = handleArray(tempArr.unitItems, tempArr.deletUnitItems);
- }
- }
- console.log(10);
- if (String($scope.requestModel.data) == '') {
- saveCompanyProduct();
- } else {
- dataToolsService.insertOrUpdateCompanyYearMultipleoptions($scope.requestModel).then(function (response) {
- // console.log(response);
- // 10保存公司产品
- saveCompanyProduct();
- }, function () {
- if ($scope.app) {
- UtilService.showMess(ConstantService.INTERFACE_MESSAGE_ERROR);
- } else {
- CommonService.showMessage(ConstantService.INTERFACE_MESSAGE_ERROR, $scope);
- }
- })
- }
- };
- // 10保存公司产品 企业产品->产品
- var saveCompanyProduct = function () {
- // 保存多条信息需要的格式
- $scope.requestModel = {
- data: [],
- node: $stateParams.node,
- pagecode: $stateParams.pagecode,
- };
- if (comProduct && comProduct.addList) {
- var tempArr = comProduct.addList.filter(function (value, j, arr) {
- return value.title == '添加产品'
- })[0];
- if (tempArr) {
- $scope.requestModel.data = handleArray(tempArr.unitItems, tempArr.deletUnitItems);
- }
- }
- console.log(11);
- console.log($scope.requestModel);
- if (String($scope.requestModel.data) == '') {
- saveCompanyIntellectualproperty();
- } else {
- dataToolsService.insertOrUpdateCompanyProduct($scope.requestModel).then(function (response) {
- // console.log(response);
- // 11保存专利信息
- saveCompanyIntellectualproperty();
- }, function () {
- if ($scope.app) {
- UtilService.showMess(ConstantService.INTERFACE_MESSAGE_ERROR);
- } else {
- CommonService.showMessage(ConstantService.INTERFACE_MESSAGE_ERROR, $scope);
- }
- })
- }
- };
- // 11保存专利信息 专利信息
- var saveCompanyIntellectualproperty = function () {
- // 保存多条信息需要的格式
- $scope.requestModel = {
- data: [],
- node: $stateParams.node,
- pagecode: $stateParams.pagecode,
- };
- var patent = $scope.tempData.filter(function (val, i, arr) {
- return (val.title == '专利信息' || val.title == '知识产权信息');
- })[0];
- if (patent) {
- $scope.requestModel.data = handleArray(patent.addList[0].unitItems, patent.addList[0].deletUnitItems);
- }
- if (basicIPR && basicIPR.addList) {
- var patent = basicIPR.addList.filter(function (val) {
- return val.title == '添加知识产权'
- })[0];
- if (patent) {
- $scope.requestModel.data = handleArray(patent.unitItems, patent.deletUnitItems);
- }
- }
- console.log($scope.requestModel);
- if (String($scope.requestModel.data) == '') {
- saveCompanyResearchfinding();
- } else {
- dataToolsService.insertOrUpdateCompanyIntellectualproperty($scope.requestModel).then(function (response) {
- // console.log(response);
- feedbackItem.patent = response.data;
- // 12保存成果信息
- saveCompanyResearchfinding();
- }, function () {
- if ($scope.app) {
- UtilService.showMess(ConstantService.INTERFACE_MESSAGE_ERROR);
- } else {
- CommonService.showMessage(ConstantService.INTERFACE_MESSAGE_ERROR, $scope);
- }
- })
- }
- };
- // 12保存成果信息 高校->成果
- var saveCompanyResearchfinding = function () {
- // 保存多条信息需要的格式
- $scope.requestModel = {
- data: [],
- node: $stateParams.node,
- pagecode: $stateParams.pagecode,
- };
- var achievement = $scope.tempData.filter(function (val, i, arr) {
- return val.title == '成果信息';
- })[0];
- if (achievement) {
- $scope.requestModel.data = handleArray(achievement.addList[0].unitItems, achievement.addList[0].deletUnitItems);
- }
- console.log(13);
- if (String($scope.requestModel.data) == '') {
- saveCompanySpecialty();
- } else {
- dataToolsService.insertOrUpdateCompanyResearchfinding($scope.requestModel).then(function (response) {
- console.log(response);
- feedbackItem.achievement = response.data;
- // 13保存特色专业信息表
- saveCompanySpecialty();
- }, function () {
- if ($scope.app) {
- UtilService.showMess(ConstantService.INTERFACE_MESSAGE_ERROR);
- } else {
- CommonService.showMessage(ConstantService.INTERFACE_MESSAGE_ERROR, $scope);
- }
- })
- }
- };
- // 13保存特色专业信息表
- var saveCompanySpecialty = function () {
- // 保存多条信息需要的格式
- $scope.requestModel = {
- data: [],
- node: $stateParams.node,
- pagecode: $stateParams.pagecode,
- };
- // 保存特色专业信息
- var specialty = $scope.tempData.filter(function (val, i, arr) {
- return val.title == '特色专业信息';
- })[0];
- if (specialty) {
- $scope.requestModel.data = handleArray(specialty.addList[0].unitItems, specialty.addList[0].deletUnitItems);
- }
- console.log(14);
- if (String($scope.requestModel.data) == '') {
- savebusinessCircumstance();
- } else {
- dataToolsService.insertOrUpdateCompanySpecialty($scope.requestModel).then(function (response) {
- // console.log(response);
- // 14保存实验室信息表
- savebusinessCircumstance();
- }, function () {
- if ($scope.app) {
- UtilService.showMess(ConstantService.INTERFACE_MESSAGE_ERROR);
- } else {
- CommonService.showMessage(ConstantService.INTERFACE_MESSAGE_ERROR, $scope);
- }
- })
- }
- };
- // 14保存经营情况
- var savebusinessCircumstance = function () {
- // 保存多条信息需要的格式
- $scope.requestModel = {
- data: [],
- node: $stateParams.node,
- pagecode: $stateParams.pagecode,
- };
- if (basicOperate) {
- $scope.requestModel.data = handleArray(basicOperate.addList[0].unitItems, basicOperate.addList[0].deletUnitItems);
- }
- console.log(15);
- if (String($scope.requestModel.data) == '') {
- saveHR();
- } else {
- dataToolsService.insertOrUpdateCompanyYearMultipleoptions($scope.requestModel).then(function (response) {
- // console.log(response);
- // 10保存公司产品
- saveHR();
- }, function () {
- if ($scope.app) {
- UtilService.showMess(ConstantService.INTERFACE_MESSAGE_ERROR);
- } else {
- CommonService.showMessage(ConstantService.INTERFACE_MESSAGE_ERROR, $scope);
- }
- })
- }
- };
- // 15保存人力资源
- var saveHR = function () {
- // 保存多条信息需要的格式
- $scope.requestModel = {
- data: [],
- node: $stateParams.node,
- pagecode: $stateParams.pagecode,
- };
- var tempArr = $scope.tempData.filter(function (value, j, arr) {
- return value.title == '人力资源'
- })[0];
- if (tempArr) {
- $scope.requestModel.data = handleArray([tempArr.detailList], 'other');
- }
- console.log(16);
- // console.log($scope.requestModel.data);
- // console.log(String($scope.requestModel.data));
- if (String($scope.requestModel.data) == '') {
- saveProjectTransformation();
- } else {
- // console.log($scope.requestModel);
- dataToolsService.insertOrUpdateCompanyHR($scope.requestModel).then(function (response) {
- // console.log(response);
- // 10保存公司产品
- saveProjectTransformation();
- }, function () {
- if ($scope.app) {
- UtilService.showMess(ConstantService.INTERFACE_MESSAGE_ERROR);
- } else {
- CommonService.showMessage(ConstantService.INTERFACE_MESSAGE_ERROR, $scope);
- }
- })
- }
- };
- // 保存促成成果转化项目信息
- var saveProjectTransformation = function () {
- $scope.requestModel = {
- data: [],
- node: $stateParams.node,
- pagecode: $stateParams.pagecode,
- };
- // var projectTransformation=$scope.tempData.filter(function(val,i,arr){
- // return val.title=='促成成果转化项目';
- // })[0];
- if (projectTransformation) {
- $scope.requestModel.data = handleArray(projectTransformation.addList[0].unitItems, projectTransformation.addList[0].deletUnitItems);
- }
- if (String($scope.requestModel.data) == '') {
- saveOtherinformation();
- } else {
- console.log($scope.requestModel);
- dataToolsService.insertOrUpdateProjectTransformation($scope.requestModel).then(function (response) {
- // console.log(response);
- saveOtherinformation();
- }, function () {
- if ($scope.app) {
- UtilService.showMess(ConstantService.INTERFACE_MESSAGE_ERROR);
- } else {
- CommonService.showMessage(ConstantService.INTERFACE_MESSAGE_ERROR, $scope);
- }
- })
- }
- }
- // 保存其他信息
- var saveOtherinformation = function () {
- $scope.requestModel = {
- data: [],
- node: $stateParams.node,
- pagecode: $stateParams.pagecode,
- };
- console.log($scope.tempData)
- var Otherinformation = $scope.tempData.filter(function (val, i, arr) {
- return val.title == '其他信息';
- })[0];
- console.log(Otherinformation)
- if (Otherinformation) {
- if (Otherinformation.detailList.length > 0) {
- $scope.requestModel.data = handleArray([Otherinformation.detailList], Otherinformation.detailList[0].deletUnitItems);
- }
- }
- console.log("333", Otherinformation)
- if (String($scope.requestModel.data) == '') {
- saveCompanyLab();
- } else {
- console.log("444", $scope.requestModel);
- dataToolsService.saveOtherinformationapi($scope.requestModel).then(function (response) {
- console.log(response);
- saveCompanyLab();
- }, function () {
- if ($scope.app) {
- UtilService.showMess(ConstantService.INTERFACE_MESSAGE_ERROR);
- } else {
- CommonService.showMessage(ConstantService.INTERFACE_MESSAGE_ERROR, $scope);
- }
- })
- }
- }
- // 16保存实验室信息表
- var saveCompanyLab = function () {
- var pagetitle = $stateParams.pageTitle;
- // 保存多条信息需要的格式
- $scope.requestModel = {
- data: [],
- node: $stateParams.node,
- pagecode: $stateParams.pagecode,
- };
- // 保存实验室信息表
- var labInfo = $scope.tempData.filter(function (val, i, arr) {
- return val.title == '实验室信息';
- })[0];
- if (labInfo) {
- $scope.requestModel.data = handleArray(labInfo.addList[0].unitItems, labInfo.addList[0].deletUnitItems);
- }
- console.log(17);
- if (String($scope.requestModel.data) == '') {
- var patt = /录入/g;
- if ($scope.pageTitle != "新建录入" && patt.test($scope.pageTitle)) {
- // $scope.go("recordInfoAccount");
- $scope.hideLoadingToast();
- if ($stateParams.comfrom == 'activityApply' || $stateParams.comfrom == 'participantList') {
- localStorage.feedbackItem = JSON.stringify(feedbackItem);
- $scope.go('activityApply', {
- settingItems: localStorage.settingItems,
- comfrom: $stateParams.comfrom
- });
- // }if($stateParams.comfrom=='activityDetail'){
- // var params={
- // data:{
- // "activityid":$stateParams.companyid,
- // "otherid":$scope.connid,
- // "creator":UserService.id
- // }
- // }
- // dataToolsService.saveActivityBroadcastInfo(params).then(function(res){
- // $scope.go('activityApply',{activityid:$stateParams.companyid});
- // });
- } else {
- $scope.go("recordInfoAccount");
- }
- } else {
- var getBasicInfo = function () {
- var def = $q.defer();
- dataToolsService.getConnectioninfoDetailByConnid($scope.connid, 1000002, 0, $stateParams.node).then(function (response) {
- if (response.code == 3350) {
- def.resolve(response.data);
- } else {
- def.reject('错误');
- }
- }, function () {
- });
- return def.promise;
- };
- getBasicInfo().then(function (data) {
- dataToolsService.getConnectionOtherInfoDetail($scope.connid, 1000002, 0, $stateParams.node).then(function (res) {
- $scope.hideLoadingToast();
- if (data.typecodemap || res.data.typecodemap) {
- localStorage.feedbackItem = JSON.stringify(feedbackItem);
- data.typecodemap = data.typecodemap ? Object.assign(data.typecodemap, res.data.typecodemap) : res.data.typecodemap;
- if (pagetitle != "新建导师" && pagetitle != "新建创新创业联盟库") {
- // $scope.go("selectFieldsToSet", {
- // comfrom: $stateParams.comfrom,
- // typecodemap: data.typecodemap,
- // resid: $stateParams.resid,
- // typecode: ConstantService.TABLE_CODE_30003,
- // templettype: $stateParams.templettype,
- // title: $stateParams.title,
- // node: $stateParams.node,
- // pagetitle: $stateParams.pageTitle,
- // });
- $ionicHistory.goBack(-1)
- } else {
- if (pagetitle == "新建导师") {
- $scope.go('wujingTeacher');
- }
- if (pagetitle == "新建创新创业联盟库") {
- $scope.go('wujingTechnical');
- }
- }
- }
- })
- })
- }
- } else {
- dataToolsService.insertOrUpdateCompanyLab($scope.requestModel).then(function (response) {
- // 添加成功后先查询保存的走访履历,再把typecodemap传递并跳转到 设置权限 界面
- // 获取走访履历详情
- if ($scope.app) {
- UtilService.showMess("添加成功");
- } else {
- CommonService.showMessage("添加成功", $scope);
- }
- // $timeout(function () {
- var patt = /录入/g;
- if (patt.test($scope.pageTitle)) {
- $scope.hideLoadingToast();
- if ($stateParams.comfrom == 'activityApply' || $stateParams.comfrom == 'participantList') {
- localStorage.feedbackItem = JSON.stringify(feedbackItem);
- $scope.go('activityApply', {
- settingItems: localStorage.settingItems,
- comfrom: $stateParams.comfrom
- });
- } else {
- $scope.go("recordInfoAccount");
- }
- } else {
- var getBasicInfo = function () {
- var def = $q.defer();
- dataToolsService.getConnectioninfoDetailByConnid($scope.connid, 1000002, 0, $stateParams.node).then(function (response) {
- if (response.code == 3350) {
- def.resolve(response.data);
- } else {
- def.reject('错误');
- }
- }, function () {
- })
- return def.promise;
- };
- getBasicInfo().then(function (data) {
- dataToolsService.getConnectionOtherInfoDetail($scope.connid, 1000002, 0, $stateParams.node).then(function (res) {
- $scope.hideLoadingToast();
- if (data.typecodemap || res.data.typecodemap) {
- data.typecodemap = data.typecodemap ? Object.assign(data.typecodemap, res.data.typecodemap) : res.data.typecodemap;
- $scope.go("selectFieldsToSet", {
- comfrom: $stateParams.comfrom,
- typecodemap: data.typecodemap,
- resid: $stateParams.resid,
- typecode: ConstantService.TABLE_CODE_30003,
- templettype: $stateParams.templettype,
- title: $stateParams.title,
- node: $stateParams.node,
- pagetitle: $stateParams.pageTitle,
- });
- }
- })
- })
- }
- // console.log($scope.connEnterpriseModuleModel.id);
- // console.log(15);
- // dataToolsService.getConnectioninfoDetailByConnid($scope.connEnterpriseModuleModel.id,$stateParams.pagecode,0,$stateParams.node).then(function (response) {
- // // console.log("==============================");
- // // console.log(response);
- // $scope.hideLoadingToast();
- // // 走访履历详情
- // $scope.connInfoDetail = response.data;
- // $timeout(function () {
- // gotoSelectFieldsToSet();
- // }, 500);
- // }, 500);
- // }, function () {
- // })
- }, function () {
- if ($scope.app) {
- UtilService.showMess(ConstantService.INTERFACE_MESSAGE_ERROR);
- } else {
- CommonService.showMessage(ConstantService.INTERFACE_MESSAGE_ERROR, $scope);
- }
- })
- }
- };
- }
- ).directive('stringToNumber', function () {
- return {
- require: 'ngModel',
- link: function (scope, element, attrs, ngModel) {
- ngModel.$parsers.push(function (value) {
- return '' + value;
- });
- ngModel.$formatters.push(function (value) {
- return parseInt(value);
- });
- }
- };
- }).directive('stringToNumber2', function () {
- return {
- require: 'ngModel',
- link: function (scope, element, attrs, ngModel) {
- ngModel.$parsers.push(function (value) {
- return '' + value;
- });
- ngModel.$formatters.push(function (value) {
- return parseInt(value);
- });
- }
- };
- });
|