tools.js 40 KB

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