tools.js 45 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718
  1. import { message,Select } from 'antd';
  2. import React from 'react';
  3. import $ from 'jquery/src/ajax';
  4. import {
  5. patentTypeList,
  6. patentStateList,
  7. patentFieldList,
  8. technicalSourceList,
  9. catagoryList,
  10. intellectualGetList,
  11. conversionFormList,
  12. annualReportStateList,
  13. cognizanceStateList,
  14. technologyStateList,
  15. copyrightStateList,
  16. auditStatusList,
  17. scaleList,
  18. companyType,
  19. industryList,
  20. contractTypeList,
  21. contractStateList,
  22. demandTypeList,
  23. achievementCategoryList,
  24. techAuditStatusList,
  25. auditStatusLists,
  26. maturityList,
  27. transferModeList,
  28. innovationList,
  29. orderStatusList,
  30. activityForm,
  31. activityType,
  32. boutique,
  33. hot,
  34. statuslist,
  35. customerTyp,
  36. cityArr,
  37. customerStatus,
  38. intentionalService,
  39. newFollow,
  40. sex,
  41. tag,
  42. contactType,
  43. contact,
  44. intentionalServiceOn,
  45. newFollowOn,
  46. customerStatusOn,
  47. Whether,
  48. Certification,
  49. currentMember,
  50. lvl,
  51. industry,
  52. socialAttribute,
  53. station,
  54. post,
  55. patternOrganization,
  56. conditionOrganization,
  57. categoryState,
  58. auditStatusL,
  59. gameState,
  60. messageType,
  61. designated,
  62. featured,
  63. actives,
  64. intentProgress,
  65. transactionProgress,
  66. contractProgress,
  67. projectProgress,
  68. orderType, orderStage, orderState,paymentState, orderChannel, approvedState, lock,paymentMethod,transactionChannel,projectState,transactionProject,
  69. client,
  70. stick,
  71. taskStatus,
  72. publishStatus,
  73. changeState,
  74. distributeState,
  75. customerSource,
  76. releaseStateList,
  77. releasePosition,
  78. achievementPosition,
  79. achievementType,
  80. transaction,
  81. newsPosition,
  82. policyPosition,
  83. newType,
  84. adviserType,
  85. authState,
  86. typeModule,
  87. lowType,
  88. msgType,
  89. ziYuanType,
  90. couponAuthState,
  91. couponAuthStates,
  92. couponCome,
  93. videoType,
  94. videoStatus,
  95. videoPosition,
  96. specialType,
  97. productType,
  98. proStatus
  99. } from './dataDic.js';
  100. import { provinceList} from './NewDicProvinceList.js';
  101. module.exports = {
  102. splitUrl: function (string, i, url) {
  103. let theList = [];
  104. let theArr = [];
  105. if (string && string.length) {
  106. theArr = string.split(i);
  107. theArr.map(function (item, i) {
  108. theList.push({
  109. uid: -i-1,
  110. url: url + item,
  111. response: {
  112. data: item
  113. }
  114. });
  115. });
  116. }
  117. return theList;
  118. },
  119. getBase64: function (img, callback) {
  120. const reader = new FileReader();
  121. reader.addEventListener('load', () => callback(reader.result));
  122. reader.readAsDataURL(img);
  123. },
  124. beforeUpload: function (file) {
  125. const isLt2M = file.size / 1024 / 1024 < 2;
  126. if (!isLt2M) {
  127. message.error('图片小大必须小于2MB!');
  128. }
  129. return isLt2M;
  130. },
  131. beforeUploadFile: function (file) {
  132. // debugger
  133. // const isJPG = file.type === 'image/jpeg/document';
  134. // if (!isJPG) {
  135. // message.error('You can only upload JPG file!');
  136. // }
  137. // const isLt2M = file.size / 1024 / 1024 < 2;
  138. // if (!isLt2M) {
  139. // message.error('Image must smaller than 2MB!');
  140. // }
  141. // return isJPG && isLt2M;
  142. },
  143. getTime: function (e, t) {
  144. if (e && !t) {
  145. var d = new Date(e);
  146. d = d.getFullYear() + "-" +
  147. ((d.getMonth() + 1) < 10 ? '0' + (d.getMonth() + 1) : (d.getMonth() + 1)) + "-" +
  148. (d.getDate() < 10 ? '0' + d.getDate() : d.getDate()) + " ";
  149. // + (d.getHours() < 10 ? "0" + d.getHours() : d.getHours()) + ":" +
  150. // (d.getMinutes() < 10 ? "0" + d.getMinutes() : d.getMinutes()) + ":" +
  151. // (d.getSeconds() < 10 ? "0" + d.getSeconds() : d.getSeconds());
  152. return d;
  153. } else if (e && t) {
  154. var d1 = new Date(e);
  155. var d2 = new Date(e);
  156. d2 = d2.setMonth(d1.getMonth() + t);
  157. d2 = new Date(d2)
  158. d2 = d2.getFullYear() + "-" +
  159. ((d2.getMonth() + 1) < 10 ? '0' + (d2.getMonth() + 1) : (d2.getMonth() + 1)) + "-" +
  160. (d2.getDate() < 10 ? '0' + d2.getDate() : d2.getDate()) + " ";
  161. return d2;
  162. } else {
  163. return '';
  164. }
  165. },
  166. getPatentType: function (e) {
  167. if (e) {
  168. let theType = '';
  169. patentTypeList.map(function (item) {
  170. if (item.value == e) {
  171. theType = item.key;
  172. };
  173. });
  174. return theType;
  175. }
  176. },
  177. getPatentState: function (e) {
  178. if (e) {
  179. let theState = '';
  180. patentStateList.map(function (item) {
  181. if (item.value == e) {
  182. theState = item.key;
  183. };
  184. });
  185. return theState;
  186. }
  187. },
  188. getPatentField: function (e) {
  189. if (e) {
  190. let theState = '';
  191. patentFieldList.map(function (item) {
  192. if (item.value == e) {
  193. theState = item.key;
  194. };
  195. });
  196. return theState;
  197. }
  198. },
  199. getTechnicalSource: function (e) {
  200. if (e) {
  201. let theSource = '';
  202. technicalSourceList.map(function (item) {
  203. if (item.value == e) {
  204. theSource = item.key;
  205. };
  206. });
  207. return theSource;
  208. }
  209. },
  210. getCatagory: function (e) {
  211. if (e) {
  212. let theType = '';
  213. catagoryList.map(function (item) {
  214. if (item.value == e) {
  215. theType = item.key;
  216. };
  217. });
  218. return theType;
  219. }
  220. },
  221. getIntellectualObtainWay: function (e) {
  222. if (e) {
  223. let theType = '';
  224. intellectualGetList.map(function (item) {
  225. if (item.value == e) {
  226. theType = item.key;
  227. };
  228. });
  229. return theType;
  230. }
  231. },
  232. getConversionForm: function (e) {
  233. if (e) {
  234. let theType = '';
  235. conversionFormList.map(function (item) {
  236. if (item.value == e) {
  237. theType = item.key;
  238. };
  239. });
  240. return theType;
  241. }
  242. },
  243. getAnnualReportState: function (e) {
  244. if (e) {
  245. let theType = '';
  246. annualReportStateList.map(function (item) {
  247. if (item.value == e) {
  248. theType = item.key;
  249. };
  250. });
  251. return theType;
  252. }
  253. },
  254. getCognizanceState: function (e) {
  255. if (e) {
  256. let theType = '';
  257. cognizanceStateList.map(function (item) {
  258. if (item.value == e) {
  259. theType = item.key;
  260. };
  261. });
  262. return theType;
  263. }
  264. },
  265. getTechnologyState: function (e) {
  266. if (e) {
  267. let theType = '';
  268. technologyStateList.map(function (item) {
  269. if (item.value == e) {
  270. theType = item.key;
  271. };
  272. });
  273. return theType;
  274. }
  275. },
  276. //显示用户认证状态
  277. getAuditState: function (e) {
  278. if (e) {
  279. let theType = '';
  280. auditStatusList.map(function (item) {
  281. if (item.value == e) {
  282. theType = item.key;
  283. };
  284. });
  285. return theType;
  286. }
  287. },
  288. getCopyrightState: function (e) {
  289. if (e) {
  290. let theType = '';
  291. copyrightStateList.map(function (item) {
  292. if (item.value == e) {
  293. theType = item.key;
  294. };
  295. });
  296. return theType;
  297. }
  298. },
  299. downloadFile: function (path, fileName) {
  300. window.open(globalConfig.context + '/open/downloadFile?path=' + path + '&fileName=' + fileName)
  301. },
  302. techDownloadFile: function (url, id) {
  303. window.open(globalConfig.context + url + '?id=' + id)
  304. },
  305. copyrightDownloadFile: function (id, sign, url) {
  306. window.open(globalConfig.context + url + '?id=' + id + '&sign=' + sign)
  307. },
  308. newDownloadFile: function (id, sign, url,type) {
  309. if (!type ) {
  310. window.open(globalConfig.context + url + '?id=' + id + '&sign=' + sign);
  311. };
  312. if ( type ) {
  313. window.open(globalConfig.context + url + '?id=' + id + '&sign=' + sign + '&type=' + type);
  314. };
  315. },
  316. companySearch(input, option) {
  317. return option.props.children.indexOf(input) >= 0
  318. },
  319. getVacations(ccccc){
  320. let now = new Date();
  321. let theYear = now.getFullYear();
  322. $.ajax({
  323. type: "get",
  324. dataType: "json",
  325. crossDomain: false,
  326. url: globalConfig.context + '/open/html/json/vacations' + theYear,
  327. success: (data)=>{
  328. if (data) {
  329. ccccc(data);
  330. };
  331. }
  332. });
  333. },
  334. getInUrgentTime(date, inUrgent,vocations) {
  335. if ( vocations && vocations.length ){
  336. let now = new Date(date),addNum = 0;
  337. for (var i = 1; i <= inUrgent;) {
  338. now.setDate(now.getDate() + 1);
  339. let thebool = true;
  340. vocations.map((item)=>{
  341. if ( item == getKey(now)) {
  342. thebool= false;
  343. }
  344. });
  345. if ( thebool ) {
  346. i++
  347. };
  348. };
  349. return now;
  350. };
  351. function getKey(date) {
  352. var year = date.getFullYear(),
  353. month = date.getMonth() + 1,
  354. day = date.getDate();
  355. year = "" + year;
  356. month = (month > 9 ? "" : "0") + month;
  357. day = (day > 9 ? "" : "0") + day;
  358. return year + month + day;
  359. }
  360. },
  361. //各种通过接口获取下拉列表
  362. setPatentStateOption(permission) {
  363. let theArr = [];
  364. patentStateList.map(function (item) {
  365. for (let i = 0; i < permission.length; i++) {
  366. if (item.value == permission[i]) {
  367. theArr.push(item);
  368. };
  369. };
  370. });
  371. return theArr;
  372. },
  373. setUserContactsList(){
  374. let theOption = [];
  375. $.ajax({
  376. method: "get",
  377. dataType: "json",
  378. crossDomain: false,
  379. url: globalConfig.context + '/api/user/getContacts',
  380. success: function (data) {
  381. if (!data.data) {
  382. if ( data.error && data.error.length ) {
  383. message.warning(data.error[0].message);
  384. };
  385. return;
  386. };
  387. for (let item in data.data) {
  388. let theData = data.data[item];
  389. theOption.push(
  390. <Select.Option value={item} key={theData}>{theData}</Select.Option>
  391. );
  392. };
  393. }
  394. });
  395. return theOption;
  396. },
  397. setAdminContactsList(uid){
  398. let theOption = [];
  399. $.ajax({
  400. method: "get",
  401. dataType: "json",
  402. crossDomain: false,
  403. url: globalConfig.context + '/api/admin/getContacts',
  404. data:{ "uid": uid },
  405. success: function (data) {
  406. if (!data.data) {
  407. if ( data.error && data.error.length ) {
  408. message.warning(data.error[0].message);
  409. };
  410. return;
  411. };
  412. for (let item in data.data) {
  413. let theData = data.data[item];
  414. theOption.push(
  415. <Select.Option value={item} key={theData}>{theData}</Select.Option>
  416. );
  417. };
  418. }
  419. });
  420. return theOption;
  421. },
  422. //高企培育资料完成情况(比重)
  423. getProportion(uid,callback){
  424. $.ajax({
  425. method: "get",
  426. dataType: "json",
  427. crossDomain: false,
  428. url: globalConfig.context + '/api/admin/proportion',
  429. data:{ "uid": uid },
  430. success: function (data) {
  431. if (!data.data) {
  432. if ( data.error && data.error.length ) {
  433. message.warning(data.error[0].message);
  434. };
  435. data.data = {}
  436. callback(data.data);
  437. };
  438. callback(data.data);
  439. }
  440. });
  441. },
  442. //保存高企培育资料完成情况
  443. saveProportion(id,uid,sign,status){
  444. $.ajax({
  445. method: "post",
  446. dataType: "json",
  447. crossDomain: false,
  448. url: globalConfig.context + '/api/admin/confirmProportion',
  449. data:{
  450. "id": id,
  451. "uid":uid,
  452. "sign":sign,
  453. "status":status
  454. },
  455. success: function (data) {
  456. if (!data.data) {
  457. if ( data.error && data.error.length ) {
  458. message.warning(data.error[0].message);
  459. };
  460. return;
  461. };
  462. }
  463. });
  464. },
  465. //获取window.location.search传的值
  466. getSearchUrl(e){
  467. let searchURL = e;
  468. let theObj = {};
  469. searchURL = searchURL.substring(1, searchURL.length);
  470. theObj[searchURL.split("&")[0].split("=")[0]] = searchURL.split("&")[0].split("=")[1];
  471. if ( searchURL.split("&")[1] ) {
  472. theObj[searchURL.split("&")[1].split("=")[0]] = searchURL.split("&")[1].split("=")[1];
  473. if ( searchURL.split("&")[2] ) {
  474. theObj[searchURL.split("&")[2].split("=")[0]] = searchURL.split("&")[2].split("=")[1];
  475. };
  476. };
  477. return theObj;
  478. },
  479. //预览接口
  480. getPreview(id,url,sign,callback){
  481. $.ajax({
  482. method: "get",
  483. dataType: "json",
  484. crossDomain: false,
  485. url: globalConfig.context + "/api/admin/preview/" + url,
  486. data:{
  487. "id": id,
  488. "sign": sign
  489. },
  490. success: function (data) {
  491. if (!data.data) {
  492. if ( data.error && data.error.length ) {
  493. message.warning(data.error[0].message);
  494. };
  495. };
  496. callback('https://view.officeapps.live.com/op/view.aspx?src=' + encodeURIComponent(location.origin + globalConfig.context + "/open/preview?" + data.data));
  497. }
  498. });
  499. },
  500. //获取企业规模
  501. getScaleState(e) {
  502. if (e) {
  503. let theType = '';
  504. scaleList.map(function (item) {
  505. if (item.value == e) {
  506. theType = item.key;
  507. };
  508. });
  509. return theType;
  510. }
  511. },
  512. //获取企业类型
  513. getCompanyType(type1, type2) {
  514. let companyTypeList = [];
  515. for (let i = 0; i < companyType.length; i++) {
  516. companyTypeList.push({
  517. value: companyType[i].value,
  518. label: companyType[i].label
  519. });
  520. if (companyType[i].children) {
  521. for (let j = 0; j < companyType[i].children.length; j++) {
  522. companyTypeList.push({
  523. value: companyType[i].children[j].value,
  524. label: companyType[i].children[j].label
  525. });
  526. };
  527. }
  528. };
  529. companyTypeList.sort(function (a, b) {
  530. return a.value - b.value
  531. });
  532. let typeKey = "";
  533. companyTypeList.map(function (item) {
  534. if (type1 == item.value) {
  535. typeKey = item.label;
  536. };
  537. if (type2 == item.value) {
  538. typeKey = typeKey + "/" + item.label;
  539. };
  540. });
  541. return typeKey;
  542. },
  543. //获取企业行业
  544. getIndustryType(e) {
  545. if (e) {
  546. let theType = '';
  547. industryList.map(function (item) {
  548. if (item.value == e) {
  549. theType = item.key;
  550. };
  551. });
  552. return theType;
  553. }
  554. },
  555. //获取合同状态
  556. getContractType: function (e) {
  557. if (e) {
  558. let theType = '';
  559. contractTypeList.map(function (item) {
  560. if (item.value == e) {
  561. theType = item.key;
  562. };
  563. });
  564. return theType;
  565. }
  566. },
  567. //获取合同类型
  568. getContractState: function (e) {
  569. if (e) {
  570. let theType = '';
  571. contractStateList.map(function (item) {
  572. if (item.value == e) {
  573. theType = item.key;
  574. };
  575. });
  576. return theType;
  577. }
  578. },
  579. //获取需求类型
  580. getDemandType: function (e) {
  581. if (e||e==0) {
  582. let str=e.toString()
  583. let theType = '';
  584. demandTypeList.map(function (item) {
  585. if (item.value == str) {
  586. theType = item.key;
  587. };
  588. });
  589. return theType;
  590. }
  591. },
  592. //获取成果类型
  593. getAchievementCategory: function (e) {
  594. if (e||e=='0') {
  595. let theType = '';
  596. achievementCategoryList.map(function (item) {
  597. if (item.value == e) {
  598. theType = item.key;
  599. };
  600. });
  601. return theType;
  602. }
  603. },
  604. //获取需求和成果审核状态
  605. getTechAuditStatus: function (e) {
  606. if (e) {
  607. let theType = '';
  608. techAuditStatusList.map(function (item) {
  609. if (item.value == e) {
  610. theType = item.key;
  611. };
  612. });
  613. return theType;
  614. }
  615. },
  616. //获取政策审核状态
  617. getauditStatus: function (e) {
  618. if (e||e>=0) {
  619. let tt=e.toString()
  620. let theType = '';
  621. auditStatusLists.map(function (item) {
  622. if (item.value == tt) {
  623. theType = item.key;
  624. };
  625. });
  626. return theType;
  627. }
  628. },
  629. //获取需求和成果审核状态
  630. getMaturity: function (e) {
  631. if (e) {
  632. let theType = '';
  633. maturityList.map(function (item) {
  634. if (item.value == e) {
  635. theType = item.key;
  636. };
  637. });
  638. return theType;
  639. }
  640. },
  641. //获取需求和成果审核状态
  642. getTransferMode: function (e) {
  643. if (e) {
  644. let theType = '';
  645. transferModeList.map(function (item) {
  646. if (item.value == e) {
  647. theType = item.key;
  648. };
  649. });
  650. return theType;
  651. }
  652. },
  653. //获取创新度状态
  654. getInnovation: function (e) {
  655. if (e||e=='0') {
  656. let theType = '';
  657. innovationList.map(function (item) {
  658. if (item.value == e) {
  659. theType = item.key;
  660. };
  661. });
  662. return theType;
  663. }
  664. },
  665. //获取创新度状态
  666. getOrderStatus: function (e) {
  667. if (e) {
  668. let theType = '';
  669. orderStatusList.map(function (item) {
  670. if (item.value == e) {
  671. theType = item.key;
  672. };
  673. });
  674. return theType;
  675. }
  676. },
  677. //科技管理
  678. //活动圈后台管理
  679. getActivityType: function (e) {
  680. if (e) {
  681. let theType = '';
  682. activityType.map(function (item) {
  683. if (item.value == e) {
  684. theType = item.key;
  685. };
  686. });
  687. return theType;
  688. }
  689. },
  690. getActivityForm: function (e) {
  691. if (e) {
  692. let theType = '';
  693. activityForm.map(function (item) {
  694. if (item.value == e) {
  695. theType = item.key;
  696. };
  697. });
  698. return theType;
  699. }
  700. },
  701. //是否展示在首页
  702. gethot: function (e) {
  703. if (e) {
  704. let theType = '';
  705. hot.map(function (item) {
  706. if (item.value == e) {
  707. theType = item.key;
  708. };
  709. });
  710. return theType;
  711. }
  712. },
  713. //是否精品
  714. getboutique: function (e) {
  715. if (e) {
  716. let theType = '';
  717. boutique.map(function (item) {
  718. if (item.value == e) {
  719. theType = item.key;
  720. };
  721. });
  722. return theType;
  723. }
  724. },
  725. //客户类型
  726. getcustomerTyp: function (e) {
  727. if (e) {
  728. let theType = '';
  729. customerTyp.map(function (item) {
  730. if (item.value == e) {
  731. theType = item.key;
  732. };
  733. });
  734. return theType;
  735. }
  736. },
  737. //省份
  738. getcityArr: function (e) {
  739. if (e) {
  740. let theType = '';
  741. cityArr.map(function (item) {
  742. if (item.value == e) {
  743. theType = item.key;
  744. }
  745. });
  746. return theType;
  747. }
  748. },
  749. //客户状态
  750. getcustomerStatue: function (e) {
  751. if (e||e==0) {
  752. let theType = '';
  753. customerStatus.map(function (item) {
  754. if (item.value == e) {
  755. theType = item.key;
  756. };
  757. });
  758. return theType;
  759. }
  760. },
  761. //账户状态
  762. getStatuslist: function (e) {
  763. if (e) {
  764. let theType = '';
  765. statuslist.map(function (item) {
  766. if (item.value == e) {
  767. theType = item.key;
  768. };
  769. });
  770. return theType;
  771. }
  772. },
  773. //意向服务
  774. getCompanyIntention: function (e) {
  775. if (e) {
  776. let theType = '';
  777. intentionalService.map(function (item) {
  778. if (item.value == e) {
  779. theType = item.key;
  780. };
  781. });
  782. return theType;
  783. }
  784. },
  785. //客户标签
  786. getTag: function (e) {
  787. if (e) {
  788. let theType = '';
  789. tag.map(function (item) {
  790. if (item.value == e) {
  791. theType = item.key;
  792. };
  793. });
  794. return theType;
  795. }
  796. },
  797. //最新跟进
  798. getfllowSituation: function (e) {
  799. if (e||e==0) {
  800. let theType = '';
  801. newFollow.map(function (item) {
  802. if (item.value == e) {
  803. theType = item.key;
  804. };
  805. });
  806. return theType;
  807. }
  808. },
  809. //性别
  810. getsex: function (e) {
  811. if (e) {
  812. let theType = '';
  813. sex.map(function (item) {
  814. if (item.value == e) {
  815. theType = item.key;
  816. };
  817. });
  818. return theType;
  819. }
  820. },
  821. //联系方式
  822. getcontact: function (e) {
  823. if (e) {
  824. let theType = '';
  825. contact.map(function (item) {
  826. if (item.value == e) {
  827. theType = item.key;
  828. };
  829. });
  830. return theType;
  831. }
  832. },
  833. //是否文字与数字转换
  834. getWhether: function (e) {
  835. if (e) {
  836. let theType = '';
  837. Whether.map(function (item) {
  838. if (item.value == e) {
  839. theType = item.key;
  840. };
  841. });
  842. return theType;
  843. }
  844. },
  845. //是否实名认证
  846. getCertification: function (e) {
  847. if (e) {
  848. let theType = '';
  849. Certification.map(function (item) {
  850. if (item.value == e) {
  851. theType = item.key;
  852. };
  853. });
  854. return theType;
  855. }
  856. },
  857. //会员状态
  858. getCurrentMember: function (e) {
  859. if (e) {
  860. let theType = '';
  861. currentMember.map(function (item) {
  862. if (item.value == e) {
  863. theType = item.key;
  864. };
  865. });
  866. return theType;
  867. }
  868. },
  869. //会员等级
  870. getLvl: function (e) {
  871. if (e) {
  872. let theType = '';
  873. lvl.map(function (item) {
  874. if (item.value == e) {
  875. theType = item.key;
  876. };
  877. });
  878. return theType;
  879. }
  880. },
  881. //省份转换
  882. getprovince:function(e){
  883. let nub=parseInt(e);
  884. let theType = '';
  885. if (nub<=34) {
  886. provinceList.map(function (item) {
  887. if (item.id == nub) {
  888. theType = item.name;
  889. };
  890. });
  891. }
  892. if(nub>34&&nub<380){
  893. provinceList.map(function (item) {
  894. item.cityList.map(function (city) {
  895. if (city.id == nub) {
  896. theType = city.name;
  897. };
  898. });
  899. });
  900. }
  901. if(nub>=380){
  902. provinceList.map(function (item) {
  903. item.cityList.map(function (city) {
  904. city.areaList.map(function (areas) {
  905. if (areas.id == nub) {
  906. theType = areas.name;
  907. };
  908. });
  909. });
  910. })
  911. }
  912. return theType;
  913. },
  914. //我的业务跟进状态
  915. getStatusFollow:function(e){
  916. let theType = '';
  917. if(e){
  918. theType ='跟进中' ;
  919. }else{
  920. theType ='停止跟进';
  921. }
  922. return theType;
  923. },
  924. //我的业务跟进状态
  925. getContactType:function(e){
  926. if (e) {
  927. let theType = '';
  928. contactType.map(function (item) {
  929. if (item.value == e) {
  930. theType = item.key;
  931. };
  932. });
  933. return theType;
  934. }
  935. },
  936. //社会属性
  937. getSocialAttribute:function(e){
  938. if (e) {
  939. let theType = '';
  940. socialAttribute.map(function (item) {
  941. if (item.value == e) {
  942. theType = item.key;
  943. };
  944. });
  945. return theType;
  946. }
  947. },
  948. //行业
  949. getIndustry:function(e){
  950. if (e) {
  951. let theType = '';
  952. industry.map(function (item) {
  953. if (item.value == e) {
  954. theType = item.key;
  955. };
  956. });
  957. return theType;
  958. }
  959. },
  960. //岗位
  961. getStation:function(e){
  962. if (e) {
  963. let theType = '';
  964. station.map(function (item) {
  965. if (item.value == e) {
  966. theType = item.key;
  967. };
  968. });
  969. return theType;
  970. }
  971. },
  972. //职务
  973. getPost:function(e){
  974. if (e) {
  975. let theType = '';
  976. post.map(function (item) {
  977. if (item.value == e) {
  978. theType = item.key;
  979. };
  980. });
  981. return theType;
  982. }
  983. },
  984. //组织类型
  985. getPattern:function(e){
  986. if (e) {
  987. let theType = '';
  988. patternOrganization.map(function (item) {
  989. if (item.value == e) {
  990. theType = item.key;
  991. };
  992. });
  993. return theType;
  994. }
  995. },
  996. //组织状态
  997. getCondition:function(e){
  998. if (e) {
  999. let theType = '';
  1000. conditionOrganization.map(function (item) {
  1001. if (item.value == e) {
  1002. theType = item.key;
  1003. };
  1004. });
  1005. return theType;
  1006. }
  1007. },
  1008. //品类状态
  1009. getCategoryState:function(e){
  1010. if (e) {
  1011. let theType = '';
  1012. categoryState.map(function (item) {
  1013. if (item.value == e) {
  1014. theType = item.key;
  1015. };
  1016. });
  1017. return theType;
  1018. }
  1019. },
  1020. //实名认证
  1021. getAuditStatus:function(index){
  1022. let e=index?index.toString():'';
  1023. if (e) {
  1024. let theType = '';
  1025. auditStatusL.map(function (item) {
  1026. if (item.value == e) {
  1027. theType = item.key;
  1028. };
  1029. });
  1030. return theType;
  1031. }
  1032. },
  1033. //品类状态
  1034. getGameState:function(index){
  1035. if (index||index==0) {
  1036. let theType = '';
  1037. gameState.map(function (item) {
  1038. if (item.value == index) {
  1039. theType = item.key;
  1040. };
  1041. });
  1042. return theType;
  1043. }
  1044. },
  1045. //消息类型
  1046. getMessageType:function(index){
  1047. if (index||index==0) {
  1048. let theType = '';
  1049. gameState.map(function (item) {
  1050. if (item.value == index) {
  1051. theType = item.key;
  1052. };
  1053. });
  1054. return theType;
  1055. }
  1056. },
  1057. //发送目标
  1058. getDesignated:function(index){
  1059. let e=index?index.toString():'';
  1060. if (e) {
  1061. let theType = '';
  1062. designated.map(function (item) {
  1063. if (item.value == e) {
  1064. theType = item.key;
  1065. };
  1066. });
  1067. return theType;
  1068. }
  1069. },
  1070. //客户端
  1071. getClient:function(index){
  1072. let e=index?index.toString():'';
  1073. if (e) {
  1074. let theType = '';
  1075. client.map(function (item) {
  1076. if (item.value == e) {
  1077. theType = item.key;
  1078. };
  1079. });
  1080. return theType;
  1081. }
  1082. },
  1083. //是否置顶
  1084. getStick:function(index){
  1085. let e=index?index.toString():'';
  1086. if (e) {
  1087. let theType = '';
  1088. stick.map(function (item) {
  1089. if (item.value == e) {
  1090. theType = item.key;
  1091. };
  1092. });
  1093. return theType;
  1094. }
  1095. },
  1096. getFeatured:function(index){
  1097. let e=index?index.toString():'';
  1098. if (e) {
  1099. let theType = '';
  1100. featured.map(function (item) {
  1101. if (item.value == e) {
  1102. theType = item.key;
  1103. };
  1104. });
  1105. return theType;
  1106. }
  1107. },
  1108. getActives:function(e){
  1109. if (e) {
  1110. let theType = '';
  1111. actives.map(function (item) {
  1112. if (item.value == e) {
  1113. theType = item.key;
  1114. };
  1115. });
  1116. return theType;
  1117. }
  1118. },
  1119. //意向进度
  1120. getIntentProgress:function(e){
  1121. if (e) {
  1122. let theType = '';
  1123. intentProgress.map(function (item) {
  1124. if (item.value == e) {
  1125. theType = item.key;
  1126. };
  1127. });
  1128. return theType;
  1129. }
  1130. },
  1131. //交易进度
  1132. getTransactionProgress:function(e){
  1133. if (e) {
  1134. let theType = '';
  1135. transactionProgress.map(function (item) {
  1136. if (item.value == e) {
  1137. theType = item.key;
  1138. };
  1139. });
  1140. return theType;
  1141. }
  1142. },
  1143. //合同进度
  1144. getContractProgress:function(e){
  1145. if (e) {
  1146. let theType = '';
  1147. contractProgress.map(function (item) {
  1148. if (item.value == e) {
  1149. theType = item.key;
  1150. };
  1151. });
  1152. return theType;
  1153. }
  1154. },
  1155. //项目进度
  1156. getProjectProgress:function(e){
  1157. if (e) {
  1158. let theType = '';
  1159. projectProgress.map(function (item) {
  1160. if (item.value == e) {
  1161. theType = item.key;
  1162. };
  1163. });
  1164. return theType;
  1165. }
  1166. },
  1167. //订单类型
  1168. getOrderType:function(e){
  1169. if (e||e==0) {
  1170. let str=e.toString()
  1171. let theType = '';
  1172. orderType.map(function (item) {
  1173. if (item.value == str) {
  1174. theType = item.key;
  1175. };
  1176. });
  1177. return theType;
  1178. }
  1179. },
  1180. //订单阶段
  1181. getOrderStage:function(e){
  1182. if (e||e==0) {
  1183. let str=e.toString()
  1184. let theType = '';
  1185. orderStage.map(function (item) {
  1186. if (item.value == str) {
  1187. theType = item.key;
  1188. };
  1189. });
  1190. return theType;
  1191. }
  1192. },
  1193. //订单状态o
  1194. getOrderState:function(e){
  1195. if (e||e==0) {
  1196. let str=e.toString()
  1197. let theType = '';
  1198. orderState.map(function (item) {
  1199. if (item.value == str) {
  1200. theType = item.key;
  1201. };
  1202. });
  1203. return theType;
  1204. }
  1205. },
  1206. //付款状态
  1207. getPaymentState:function(e){
  1208. if (e||e==0) {
  1209. let str=e.toString()
  1210. let theType = '';
  1211. paymentState.map(function (item) {
  1212. if (item.value == str) {
  1213. theType = item.key;
  1214. };
  1215. });
  1216. return theType;
  1217. }
  1218. },
  1219. //订单渠道
  1220. getOrderChannel:function(e){
  1221. if (e||e==0) {
  1222. let str=e.toString()
  1223. let theType = '';
  1224. orderChannel.map(function (item) {
  1225. if (item.value == str) {
  1226. theType = item.key;
  1227. };
  1228. });
  1229. return theType;
  1230. }
  1231. },
  1232. //特批状态
  1233. getApprovedState:function(e){
  1234. if (e||e==0) {
  1235. let str=e.toString()
  1236. let theType = '';
  1237. approvedState.map(function (item) {
  1238. if (item.value == str) {
  1239. theType = item.key;
  1240. };
  1241. });
  1242. return theType;
  1243. }
  1244. },
  1245. //锁定或废除
  1246. getLock:function(e){
  1247. if (e||e==0) {
  1248. let str=e.toString()
  1249. let theType = '';
  1250. lock.map(function (item) {
  1251. if (item.value == str) {
  1252. theType = item.key;
  1253. };
  1254. });
  1255. return theType;
  1256. }
  1257. },
  1258. //支付方式
  1259. getPaymentMethod:function(e){
  1260. if (e||e==0) {
  1261. let str=e.toString()
  1262. let theType = '';
  1263. paymentMethod.map(function (item) {
  1264. if (item.value == str) {
  1265. theType = item.key;
  1266. };
  1267. });
  1268. return theType;
  1269. }
  1270. },
  1271. //交易渠道 transactionProject
  1272. getTransactionChannel:function(e){
  1273. if (e||e==0) {
  1274. let str=e.toString()
  1275. let theType = '';
  1276. transactionChannel.map(function (item) {
  1277. if (item.value == str) {
  1278. theType = item.key;
  1279. };
  1280. });
  1281. return theType;
  1282. }
  1283. },
  1284. //交易科目
  1285. getTransactionProject:function(e){
  1286. if (e||e==0) {
  1287. let str=e.toString()
  1288. let theType = '';
  1289. transactionProject.map(function (item) {
  1290. if (item.value == str) {
  1291. theType = item.key;
  1292. };
  1293. });
  1294. return theType;
  1295. }
  1296. },
  1297. //项目状态
  1298. getProjectState:function(e){
  1299. if (e||e==0) {
  1300. let str=e.toString()
  1301. let theType = '';
  1302. projectState.map(function (item) {
  1303. if (item.value == str) {
  1304. theType = item.key;
  1305. };
  1306. });
  1307. return theType;
  1308. }
  1309. },
  1310. //任务状态
  1311. getTaskStatus:function(e){
  1312. if (e||e==0) {
  1313. let str=e.toString()
  1314. let theType = '';
  1315. taskStatus.map(function (item) {
  1316. if (item.value == str) {
  1317. theType = item.key;
  1318. };
  1319. });
  1320. return theType;
  1321. }
  1322. },
  1323. //公示状态
  1324. getPublishStatus:function(e){
  1325. if (e||e==0) {
  1326. let str=e.toString()
  1327. let theType = '';
  1328. publishStatus.map(function (item) {
  1329. if (item.value == str) {
  1330. theType = item.key;
  1331. };
  1332. });
  1333. return theType;
  1334. }
  1335. },
  1336. //变更状态
  1337. getChangeState:function(e){
  1338. if (e||e==0) {
  1339. let str=e.toString()
  1340. let theType = '';
  1341. changeState.map(function (item) {
  1342. if (item.value == str) {
  1343. theType = item.key;
  1344. };
  1345. });
  1346. return theType;
  1347. }
  1348. },
  1349. //分派情况
  1350. getDistributeState:function(e){
  1351. if (e||e==0) {
  1352. let str=e.toString()
  1353. let theType = '';
  1354. distributeState.map(function (item) {
  1355. if (item.value == str) {
  1356. theType = item.key;
  1357. };
  1358. });
  1359. return theType;
  1360. }
  1361. },
  1362. //客户来源
  1363. getCustomerSource:function(e){
  1364. if (e||e==0) {
  1365. let str=e.toString()
  1366. let theType = '';
  1367. customerSource.map(function (item) {
  1368. if (item.value == str) {
  1369. theType = item.key;
  1370. };
  1371. });
  1372. return theType;
  1373. }
  1374. },
  1375. /* g个人中心开发 */
  1376. //发布状态
  1377. getReleaseStateList:function(e){
  1378. if (e||e==0) {
  1379. let str=e.toString()
  1380. let theType = '';
  1381. releaseStateList.map(function (item) {
  1382. if (item.value == str) {
  1383. theType = item.key;
  1384. };
  1385. });
  1386. return theType;
  1387. }
  1388. },
  1389. //需求发布位置;
  1390. getReleasePositionList:function(e=[]){
  1391. if (e) {
  1392. let theType = [];
  1393. e.map((item)=>{
  1394. releasePosition.map(function (atem) {
  1395. if (atem.value == item) {
  1396. theType.push(atem.key);
  1397. };
  1398. });
  1399. })
  1400. return theType.join(' - ');
  1401. }
  1402. },
  1403. //政策发布位置
  1404. getPolicyPosition:function(e=[]){
  1405. if (e) {
  1406. let theType = [];
  1407. e.map((item)=>{
  1408. policyPosition.map(function (atem) {
  1409. if (atem.value == item) {
  1410. theType.push(atem.key);
  1411. };
  1412. });
  1413. })
  1414. return theType.join(' - ');
  1415. }
  1416. },
  1417. //成果发布位置;
  1418. getAchievementPosition:function(e=[]){
  1419. if (e) {
  1420. let theType = [];
  1421. e.map((item)=>{
  1422. achievementPosition.map(function (atem) {
  1423. if (atem.value == item) {
  1424. theType.push(atem.key);
  1425. };
  1426. });
  1427. })
  1428. return theType.join(' - ');
  1429. }
  1430. },
  1431. //新闻发布位置
  1432. getNewPosition:function(e=[]){
  1433. if (e) {
  1434. let theType = [];
  1435. e.map((item)=>{
  1436. newsPosition.map(function (atem) {
  1437. if (atem.value == item) {
  1438. theType.push(atem.key);
  1439. };
  1440. });
  1441. })
  1442. return theType.join(' - ');
  1443. }
  1444. },
  1445. //成果类型;
  1446. getAchievementType:function(e){
  1447. if (e||e==0) {
  1448. let str=e.toString();
  1449. let theType = '';
  1450. achievementType.map(function (item) {
  1451. if (item.value == str) {
  1452. theType = item.key;
  1453. };
  1454. });
  1455. return theType;
  1456. }
  1457. },
  1458. //成果交易形式;
  1459. getTransaction:function(e){
  1460. if (e||e==0) {
  1461. let str=e.toString();
  1462. let theType = '';
  1463. transaction.map(function (item) {
  1464. if (item.value == str) {
  1465. theType = item.key;
  1466. };
  1467. });
  1468. return theType;
  1469. }
  1470. },
  1471. //新闻类型
  1472. getNewType:function(e){
  1473. if (e||e==0) {
  1474. let str=e.toString();
  1475. let theType = '';
  1476. newType.map(function (item) {
  1477. if (item.value == str) {
  1478. theType = item.key;
  1479. };
  1480. });
  1481. return theType;
  1482. }
  1483. },
  1484. //顾问类型
  1485. getAdviserType:function(e){
  1486. if (e||e==0) {
  1487. let str=e.toString();
  1488. let theType = '';
  1489. adviserType.map(function (item) {
  1490. if (item.value == str) {
  1491. theType = item.key;
  1492. };
  1493. });
  1494. return theType;
  1495. }
  1496. },
  1497. //认证状态
  1498. getAuthState:function(e){
  1499. if (e||e==0) {
  1500. let str=e.toString();
  1501. let theType = '';
  1502. authState.map(function (item) {
  1503. if (item.value == str) {
  1504. theType = item.key;
  1505. };
  1506. });
  1507. return theType;
  1508. }
  1509. },
  1510. //认证状态
  1511. getTypeModule:function(e){
  1512. if (e||e==0) {
  1513. let str=e.toString();
  1514. let theType = '';
  1515. typeModule.map(function (item) {
  1516. if (item.value == str) {
  1517. theType = item.key;
  1518. };
  1519. });
  1520. return theType;
  1521. }
  1522. },
  1523. //律师类型
  1524. getLowType:function(e){
  1525. if (e||e==0) {
  1526. let str=e.toString();
  1527. let theType = '';
  1528. lowType.map(function (item) {
  1529. if (item.value == str) {
  1530. theType = item.key;
  1531. };
  1532. });
  1533. return theType;
  1534. }
  1535. },
  1536. //消息推送搜索类型转换ziYuanType
  1537. getMsgType:function(e){
  1538. if (e) {
  1539. let str=e.toString();
  1540. let theType = '';
  1541. msgType.map(function (item) {
  1542. if (item.value == str) {
  1543. theType = item.key;
  1544. };
  1545. });
  1546. return theType;
  1547. }
  1548. },
  1549. //消息推送搜索类型转换数字couponAuthState
  1550. getZiYuanType:function(e){
  1551. if (e) {
  1552. let str=e.toString();
  1553. let theType = '';
  1554. ziYuanType.map(function (item) {
  1555. if (item.key == str) {
  1556. theType = item.value;
  1557. };
  1558. });
  1559. return theType;
  1560. }
  1561. },
  1562. //抵用券状态
  1563. getCouponAuthState:function(e){
  1564. if (e) {
  1565. let str=e.toString();
  1566. let theType = '';
  1567. couponAuthState.map(function (item) {
  1568. if (item.key == str) {
  1569. theType = item.value;
  1570. };
  1571. });
  1572. return theType;
  1573. }
  1574. },
  1575. //抵用券来源
  1576. // getCouponCome:function(e){
  1577. // if (e) {
  1578. // let str=e.toString();
  1579. // let theType = '';
  1580. // couponCome.map(function (item) {
  1581. // if (item.key == str) {
  1582. // theType = item.value;
  1583. // };
  1584. // });
  1585. // return theType;
  1586. // }
  1587. // }
  1588. //抵用券来源
  1589. getCouponCome: function (e) {
  1590. if (e||e=='0') {
  1591. let theType = '';
  1592. couponCome.map(function (item) {
  1593. if (item.value == e) {
  1594. theType = item.key;
  1595. };
  1596. });
  1597. return theType;
  1598. }
  1599. },
  1600. //抵用券状态
  1601. getCouponAuthState: function (e) {
  1602. if (e||e=='0') {
  1603. let theType = '';
  1604. couponAuthState.map(function (item) {
  1605. if (item.value == e) {
  1606. theType = item.key;
  1607. };
  1608. });
  1609. return theType;
  1610. }
  1611. },
  1612. //抵用券状态
  1613. getCouponAuthStates: function (e) {
  1614. if (e||e=='0') {
  1615. let theType = '';
  1616. couponAuthStates.map(function (item) {
  1617. if (item.value == e) {
  1618. theType = item.key;
  1619. };
  1620. });
  1621. return theType;
  1622. }
  1623. },
  1624. //视频类型
  1625. getVideoType: function (e) {
  1626. if (e||e=='0') {
  1627. let theType = '';
  1628. videoType.map(function (item) {
  1629. if (item.value == e) {
  1630. theType = item.key;
  1631. };
  1632. });
  1633. return theType;
  1634. }
  1635. },
  1636. //视频状态
  1637. getVideoStatus: function (e) {
  1638. if (e||e=='0') {
  1639. let theType = '';
  1640. videoStatus.map(function (item) {
  1641. if (item.value == e) {
  1642. theType = item.key;
  1643. };
  1644. });
  1645. return theType;
  1646. }
  1647. },
  1648. //视频状态
  1649. getVideoPosition: function (e) {
  1650. if (e||e=='0') {
  1651. let theType = '';
  1652. videoPosition.map(function (item) {
  1653. if (item.value == e) {
  1654. theType = item.key;
  1655. };
  1656. });
  1657. return theType;
  1658. }
  1659. },
  1660. //专栏状态
  1661. getSpecialType: function (e) {
  1662. if (e||e=='0') {
  1663. let theType = '';
  1664. specialType.map(function (item) {
  1665. if (item.value == e) {
  1666. theType = item.key;
  1667. };
  1668. });
  1669. return theType;
  1670. }
  1671. },
  1672. //产品状态
  1673. getProductType: function (e) {
  1674. if (e||e=='0') {
  1675. let theType = '';
  1676. productType.map(function (item) {
  1677. if (item.value == e) {
  1678. theType = item.key;
  1679. };
  1680. });
  1681. return theType;
  1682. }
  1683. },
  1684. //产品发布状态
  1685. getProStatus: function (e) {
  1686. if (e||e=='0') {
  1687. let theType = '';
  1688. proStatus.map(function (item) {
  1689. if (item.value == e) {
  1690. theType = item.key;
  1691. };
  1692. });
  1693. return theType;
  1694. }
  1695. },
  1696. getPicPath: function(path, e) {
  1697. return path + e;
  1698. }
  1699. }