tools.js 45 KB

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