tools.js 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059
  1. import { message,Timeline,Select } from 'antd';
  2. import React from 'react';
  3. import ajax from 'jquery/src/ajax/xhr.js';
  4. import $ from 'jquery/src/ajax';
  5. import {
  6. patentTypeList,
  7. patentStateList,
  8. patentFieldList,
  9. technicalSourceList,
  10. catagoryList,
  11. intellectualGetList,
  12. conversionFormList,
  13. annualReportStateList,
  14. cognizanceStateList,
  15. technologyStateList,
  16. copyrightStateList,
  17. auditStatusList,
  18. scaleList,
  19. companyType,
  20. industryList,
  21. contractTypeList,
  22. contractStateList,
  23. demandTypeList,
  24. achievementCategoryList,
  25. techAuditStatusList,
  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. } from './dataDic.js';
  64. import { provinceList} from './NewDicProvinceList.js';
  65. module.exports = {
  66. splitUrl: function (string, i, url) {
  67. let theList = [];
  68. let theArr = [];
  69. if (string && string.length) {
  70. theArr = string.split(i);
  71. theArr.map(function (item, i) {
  72. theList.push({
  73. uid: -i-1,
  74. url: url + item,
  75. response: {
  76. data: item
  77. }
  78. });
  79. });
  80. }
  81. return theList;
  82. },
  83. getBase64: function (img, callback) {
  84. const reader = new FileReader();
  85. reader.addEventListener('load', () => callback(reader.result));
  86. reader.readAsDataURL(img);
  87. },
  88. beforeUpload: function (file) {
  89. // debugger
  90. // const isJPG = file.type === 'image/jpeg/document';
  91. // if (!isJPG) {
  92. // message.error('You can only upload JPG file!');
  93. // }
  94. // const isLt2M = file.size / 1024 / 1024 < 2;
  95. // if (!isLt2M) {
  96. // message.error('Image must smaller than 2MB!');
  97. // }
  98. // return isJPG && isLt2M;
  99. },
  100. beforeUploadFile: function (file) {
  101. // debugger
  102. // const isJPG = file.type === 'image/jpeg/document';
  103. // if (!isJPG) {
  104. // message.error('You can only upload JPG file!');
  105. // }
  106. // const isLt2M = file.size / 1024 / 1024 < 2;
  107. // if (!isLt2M) {
  108. // message.error('Image must smaller than 2MB!');
  109. // }
  110. // return isJPG && isLt2M;
  111. },
  112. getTime: function (e, t) {
  113. if (e && !t) {
  114. var d = new Date(e);
  115. d = d.getFullYear() + "-" +
  116. ((d.getMonth() + 1) < 10 ? '0' + (d.getMonth() + 1) : (d.getMonth() + 1)) + "-" +
  117. (d.getDate() < 10 ? '0' + d.getDate() : d.getDate()) + " ";
  118. // + (d.getHours() < 10 ? "0" + d.getHours() : d.getHours()) + ":" +
  119. // (d.getMinutes() < 10 ? "0" + d.getMinutes() : d.getMinutes()) + ":" +
  120. // (d.getSeconds() < 10 ? "0" + d.getSeconds() : d.getSeconds());
  121. return d;
  122. } else if (e && t) {
  123. var d1 = new Date(e);
  124. var d2 = new Date(e);
  125. d2 = d2.setMonth(d1.getMonth() + t);
  126. d2 = new Date(d2)
  127. d2 = d2.getFullYear() + "-" +
  128. ((d2.getMonth() + 1) < 10 ? '0' + (d2.getMonth() + 1) : (d2.getMonth() + 1)) + "-" +
  129. (d2.getDate() < 10 ? '0' + d2.getDate() : d2.getDate()) + " ";
  130. return d2;
  131. } else {
  132. return '';
  133. }
  134. },
  135. getPatentType: function (e) {
  136. if (e) {
  137. let theType = '';
  138. patentTypeList.map(function (item) {
  139. if (item.value == e) {
  140. theType = item.key;
  141. };
  142. });
  143. return theType;
  144. }
  145. },
  146. getPatentState: function (e) {
  147. if (e) {
  148. let theState = '';
  149. patentStateList.map(function (item) {
  150. if (item.value == e) {
  151. theState = item.key;
  152. };
  153. });
  154. return theState;
  155. }
  156. },
  157. getPatentField: function (e) {
  158. if (e) {
  159. let theState = '';
  160. patentFieldList.map(function (item) {
  161. if (item.value == e) {
  162. theState = item.key;
  163. };
  164. });
  165. return theState;
  166. }
  167. },
  168. getTechnicalSource: function (e) {
  169. if (e) {
  170. let theSource = '';
  171. technicalSourceList.map(function (item) {
  172. if (item.value == e) {
  173. theSource = item.key;
  174. };
  175. });
  176. return theSource;
  177. }
  178. },
  179. getCatagory: function (e) {
  180. if (e) {
  181. let theType = '';
  182. catagoryList.map(function (item) {
  183. if (item.value == e) {
  184. theType = item.key;
  185. };
  186. });
  187. return theType;
  188. }
  189. },
  190. getIntellectualObtainWay: function (e) {
  191. if (e) {
  192. let theType = '';
  193. intellectualGetList.map(function (item) {
  194. if (item.value == e) {
  195. theType = item.key;
  196. };
  197. });
  198. return theType;
  199. }
  200. },
  201. getConversionForm: function (e) {
  202. if (e) {
  203. let theType = '';
  204. conversionFormList.map(function (item) {
  205. if (item.value == e) {
  206. theType = item.key;
  207. };
  208. });
  209. return theType;
  210. }
  211. },
  212. getAnnualReportState: function (e) {
  213. if (e) {
  214. let theType = '';
  215. annualReportStateList.map(function (item) {
  216. if (item.value == e) {
  217. theType = item.key;
  218. };
  219. });
  220. return theType;
  221. }
  222. },
  223. getCognizanceState: function (e) {
  224. if (e) {
  225. let theType = '';
  226. cognizanceStateList.map(function (item) {
  227. if (item.value == e) {
  228. theType = item.key;
  229. };
  230. });
  231. return theType;
  232. }
  233. },
  234. getTechnologyState: function (e) {
  235. if (e) {
  236. let theType = '';
  237. technologyStateList.map(function (item) {
  238. if (item.value == e) {
  239. theType = item.key;
  240. };
  241. });
  242. return theType;
  243. }
  244. },
  245. //显示用户认证状态
  246. getAuditState: function (e) {
  247. if (e) {
  248. let theType = '';
  249. auditStatusList.map(function (item) {
  250. if (item.value == e) {
  251. theType = item.key;
  252. };
  253. });
  254. return theType;
  255. }
  256. },
  257. getCopyrightState: function (e) {
  258. if (e) {
  259. let theType = '';
  260. copyrightStateList.map(function (item) {
  261. if (item.value == e) {
  262. theType = item.key;
  263. };
  264. });
  265. return theType;
  266. }
  267. },
  268. downloadFile: function (path, fileName) {
  269. window.open(globalConfig.context + '/open/downloadFile?path=' + path + '&fileName=' + fileName)
  270. },
  271. techDownloadFile: function (url, id) {
  272. window.open(globalConfig.context + url + '?id=' + id)
  273. },
  274. copyrightDownloadFile: function (id, sign, url) {
  275. window.open(globalConfig.context + url + '?id=' + id + '&sign=' + sign)
  276. },
  277. newDownloadFile: function (id, sign, url,type) {
  278. if (!type ) {
  279. window.open(globalConfig.context + url + '?id=' + id + '&sign=' + sign);
  280. };
  281. if ( type ) {
  282. window.open(globalConfig.context + url + '?id=' + id + '&sign=' + sign + '&type=' + type);
  283. };
  284. },
  285. companySearch(input, option) {
  286. return option.props.children.indexOf(input) >= 0
  287. },
  288. getVacations(ccccc){
  289. let now = new Date();
  290. let theYear = now.getFullYear();
  291. $.ajax({
  292. type: "get",
  293. dataType: "json",
  294. crossDomain: false,
  295. url: globalConfig.context + '/open/html/json/vacations' + theYear,
  296. success: (data)=>{
  297. if (data) {
  298. ccccc(data);
  299. };
  300. }
  301. });
  302. },
  303. getInUrgentTime(date, inUrgent,vocations) {
  304. if ( vocations && vocations.length ){
  305. let now = new Date(date),addNum = 0;
  306. for (var i = 1; i <= inUrgent;) {
  307. now.setDate(now.getDate() + 1);
  308. let thebool = true;
  309. vocations.map((item)=>{
  310. if ( item == getKey(now)) {
  311. thebool= false;
  312. }
  313. });
  314. if ( thebool ) {
  315. i++
  316. };
  317. };
  318. return now;
  319. };
  320. function getKey(date) {
  321. var year = date.getFullYear(),
  322. month = date.getMonth() + 1,
  323. day = date.getDate();
  324. year = "" + year;
  325. month = (month > 9 ? "" : "0") + month;
  326. day = (day > 9 ? "" : "0") + day;
  327. return year + month + day;
  328. }
  329. },
  330. //各种通过接口获取下拉列表
  331. setPatentStateOption(permission) {
  332. let theArr = [];
  333. patentStateList.map(function (item) {
  334. for (let i = 0; i < permission.length; i++) {
  335. if (item.value == permission[i]) {
  336. theArr.push(item);
  337. };
  338. };
  339. });
  340. return theArr;
  341. },
  342. setUserContactsList(){
  343. let theOption = [];
  344. $.ajax({
  345. method: "get",
  346. dataType: "json",
  347. crossDomain: false,
  348. url: globalConfig.context + '/api/user/getContacts',
  349. success: function (data) {
  350. if (!data.data) {
  351. if ( data.error && data.error.length ) {
  352. message.warning(data.error[0].message);
  353. };
  354. return;
  355. };
  356. for (let item in data.data) {
  357. let theData = data.data[item];
  358. theOption.push(
  359. <Select.Option value={item} key={theData}>{theData}</Select.Option>
  360. );
  361. };
  362. }
  363. });
  364. return theOption;
  365. },
  366. setAdminContactsList(uid){
  367. let theOption = [];
  368. $.ajax({
  369. method: "get",
  370. dataType: "json",
  371. crossDomain: false,
  372. url: globalConfig.context + '/api/admin/getContacts',
  373. data:{ "uid": uid },
  374. success: function (data) {
  375. if (!data.data) {
  376. if ( data.error && data.error.length ) {
  377. message.warning(data.error[0].message);
  378. };
  379. return;
  380. };
  381. for (let item in data.data) {
  382. let theData = data.data[item];
  383. theOption.push(
  384. <Select.Option value={item} key={theData}>{theData}</Select.Option>
  385. );
  386. };
  387. }
  388. });
  389. return theOption;
  390. },
  391. //高企培育资料完成情况(比重)
  392. getProportion(uid,callback){
  393. $.ajax({
  394. method: "get",
  395. dataType: "json",
  396. crossDomain: false,
  397. url: globalConfig.context + '/api/admin/proportion',
  398. data:{ "uid": uid },
  399. success: function (data) {
  400. if (!data.data) {
  401. if ( data.error && data.error.length ) {
  402. message.warning(data.error[0].message);
  403. };
  404. data.data = {}
  405. callback(data.data);
  406. };
  407. callback(data.data);
  408. }
  409. });
  410. },
  411. //保存高企培育资料完成情况
  412. saveProportion(id,uid,sign,status){
  413. $.ajax({
  414. method: "post",
  415. dataType: "json",
  416. crossDomain: false,
  417. url: globalConfig.context + '/api/admin/confirmProportion',
  418. data:{
  419. "id": id,
  420. "uid":uid,
  421. "sign":sign,
  422. "status":status
  423. },
  424. success: function (data) {
  425. if (!data.data) {
  426. if ( data.error && data.error.length ) {
  427. message.warning(data.error[0].message);
  428. };
  429. return;
  430. };
  431. }
  432. });
  433. },
  434. //获取window.location.search传的值
  435. getSearchUrl(e){
  436. let searchURL = e;
  437. let theObj = {};
  438. searchURL = searchURL.substring(1, searchURL.length);
  439. theObj[searchURL.split("&")[0].split("=")[0]] = searchURL.split("&")[0].split("=")[1];
  440. if ( searchURL.split("&")[1] ) {
  441. theObj[searchURL.split("&")[1].split("=")[0]] = searchURL.split("&")[1].split("=")[1];
  442. if ( searchURL.split("&")[2] ) {
  443. theObj[searchURL.split("&")[2].split("=")[0]] = searchURL.split("&")[2].split("=")[1];
  444. };
  445. };
  446. return theObj;
  447. },
  448. //预览接口
  449. getPreview(id,url,sign,callback){
  450. $.ajax({
  451. method: "get",
  452. dataType: "json",
  453. crossDomain: false,
  454. url: globalConfig.context + "/api/admin/preview/" + url,
  455. data:{
  456. "id": id,
  457. "sign": sign
  458. },
  459. success: function (data) {
  460. if (!data.data) {
  461. if ( data.error && data.error.length ) {
  462. message.warning(data.error[0].message);
  463. };
  464. };
  465. callback('https://view.officeapps.live.com/op/view.aspx?src=' + encodeURIComponent(location.origin + globalConfig.context + "/open/preview?" + data.data));
  466. }
  467. });
  468. },
  469. //获取企业规模
  470. getScaleState(e) {
  471. if (e) {
  472. let theType = '';
  473. scaleList.map(function (item) {
  474. if (item.value == e) {
  475. theType = item.key;
  476. };
  477. });
  478. return theType;
  479. }
  480. },
  481. //获取企业类型
  482. getCompanyType(type1, type2) {
  483. let companyTypeList = [];
  484. for (let i = 0; i < companyType.length; i++) {
  485. companyTypeList.push({
  486. value: companyType[i].value,
  487. label: companyType[i].label
  488. });
  489. if (companyType[i].children) {
  490. for (let j = 0; j < companyType[i].children.length; j++) {
  491. companyTypeList.push({
  492. value: companyType[i].children[j].value,
  493. label: companyType[i].children[j].label
  494. });
  495. };
  496. }
  497. };
  498. companyTypeList.sort(function (a, b) {
  499. return a.value - b.value
  500. });
  501. let typeKey = "";
  502. companyTypeList.map(function (item) {
  503. if (type1 == item.value) {
  504. typeKey = item.label;
  505. };
  506. if (type2 == item.value) {
  507. typeKey = typeKey + "/" + item.label;
  508. };
  509. });
  510. return typeKey;
  511. },
  512. //获取企业行业
  513. getIndustryType(e) {
  514. if (e) {
  515. let theType = '';
  516. industryList.map(function (item) {
  517. if (item.value == e) {
  518. theType = item.key;
  519. };
  520. });
  521. return theType;
  522. }
  523. },
  524. //获取合同状态
  525. getContractType: function (e) {
  526. if (e) {
  527. let theType = '';
  528. contractTypeList.map(function (item) {
  529. if (item.value == e) {
  530. theType = item.key;
  531. };
  532. });
  533. return theType;
  534. }
  535. },
  536. //获取合同类型
  537. getContractState: function (e) {
  538. if (e) {
  539. let theType = '';
  540. contractStateList.map(function (item) {
  541. if (item.value == e) {
  542. theType = item.key;
  543. };
  544. });
  545. return theType;
  546. }
  547. },
  548. //获取需求类型
  549. getDemandType: function (e) {
  550. if (e) {
  551. let theType = '';
  552. demandTypeList.map(function (item) {
  553. if (item.value == e) {
  554. theType = item.key;
  555. };
  556. });
  557. return theType;
  558. }
  559. },
  560. //获取成果类型
  561. getAchievementCategory: function (e) {
  562. if (e) {
  563. let theType = '';
  564. achievementCategoryList.map(function (item) {
  565. if (item.value == e) {
  566. theType = item.key;
  567. };
  568. });
  569. return theType;
  570. }
  571. },
  572. //获取需求和成果审核状态
  573. getTechAuditStatus: function (e) {
  574. if (e) {
  575. let theType = '';
  576. techAuditStatusList.map(function (item) {
  577. if (item.value == e) {
  578. theType = item.key;
  579. };
  580. });
  581. return theType;
  582. }
  583. },
  584. //获取需求和成果审核状态
  585. getMaturity: function (e) {
  586. if (e) {
  587. let theType = '';
  588. maturityList.map(function (item) {
  589. if (item.value == e) {
  590. theType = item.key;
  591. };
  592. });
  593. return theType;
  594. }
  595. },
  596. //获取需求和成果审核状态
  597. getTransferMode: function (e) {
  598. if (e) {
  599. let theType = '';
  600. transferModeList.map(function (item) {
  601. if (item.value == e) {
  602. theType = item.key;
  603. };
  604. });
  605. return theType;
  606. }
  607. },
  608. //获取创新度状态
  609. getInnovation: function (e) {
  610. if (e) {
  611. let theType = '';
  612. innovationList.map(function (item) {
  613. if (item.value == e) {
  614. theType = item.key;
  615. };
  616. });
  617. return theType;
  618. }
  619. },
  620. //获取创新度状态
  621. getOrderStatus: function (e) {
  622. if (e) {
  623. let theType = '';
  624. orderStatusList.map(function (item) {
  625. if (item.value == e) {
  626. theType = item.key;
  627. };
  628. });
  629. return theType;
  630. }
  631. },
  632. //科技管理
  633. //活动圈后台管理
  634. getActivityType: function (e) {
  635. if (e) {
  636. let theType = '';
  637. activityType.map(function (item) {
  638. if (item.value == e) {
  639. theType = item.key;
  640. };
  641. });
  642. return theType;
  643. }
  644. },
  645. getActivityForm: function (e) {
  646. if (e) {
  647. let theType = '';
  648. activityForm.map(function (item) {
  649. if (item.value == e) {
  650. theType = item.key;
  651. };
  652. });
  653. return theType;
  654. }
  655. },
  656. //是否展示在首页
  657. gethot: function (e) {
  658. if (e) {
  659. let theType = '';
  660. hot.map(function (item) {
  661. if (item.value == e) {
  662. theType = item.key;
  663. };
  664. });
  665. return theType;
  666. }
  667. },
  668. //是否精品
  669. getboutique: function (e) {
  670. if (e) {
  671. let theType = '';
  672. boutique.map(function (item) {
  673. if (item.value == e) {
  674. theType = item.key;
  675. };
  676. });
  677. return theType;
  678. }
  679. },
  680. //客户类型
  681. getcustomerTyp: function (e) {
  682. if (e) {
  683. let theType = '';
  684. customerTyp.map(function (item) {
  685. if (item.value == e) {
  686. theType = item.key;
  687. };
  688. });
  689. return theType;
  690. }
  691. },
  692. //省份
  693. getcityArr: function (e) {
  694. if (e) {
  695. let theType = '';
  696. cityArr.map(function (item) {
  697. if (item.value == e) {
  698. theType = item.key;
  699. }
  700. });
  701. return theType;
  702. }
  703. },
  704. //客户状态
  705. getcustomerStatue: function (e) {
  706. if (e) {
  707. let theType = '';
  708. customerStatus.map(function (item) {
  709. if (item.value == e) {
  710. theType = item.key;
  711. };
  712. });
  713. return theType;
  714. }
  715. },
  716. //账户状态
  717. getStatuslist: function (e) {
  718. if (e) {
  719. let theType = '';
  720. statuslist.map(function (item) {
  721. if (item.value == e) {
  722. theType = item.key;
  723. };
  724. });
  725. return theType;
  726. }
  727. },
  728. //意向服务
  729. getCompanyIntention: function (e) {
  730. if (e) {
  731. let theType = '';
  732. intentionalService.map(function (item) {
  733. if (item.value == e) {
  734. theType = item.key;
  735. };
  736. });
  737. return theType;
  738. }
  739. },
  740. //客户标签
  741. getTag: function (e) {
  742. if (e) {
  743. let theType = '';
  744. tag.map(function (item) {
  745. if (item.value == e) {
  746. theType = item.key;
  747. };
  748. });
  749. return theType;
  750. }
  751. },
  752. //最新跟进
  753. getfllowSituation: function (e) {
  754. if (e) {
  755. let theType = '';
  756. newFollow.map(function (item) {
  757. if (item.value == e) {
  758. theType = item.key;
  759. };
  760. });
  761. return theType;
  762. }
  763. },
  764. //性别
  765. getsex: function (e) {
  766. if (e) {
  767. let theType = '';
  768. sex.map(function (item) {
  769. if (item.value == e) {
  770. theType = item.key;
  771. };
  772. });
  773. return theType;
  774. }
  775. },
  776. //联系方式
  777. getcontact: function (e) {
  778. if (e) {
  779. let theType = '';
  780. contact.map(function (item) {
  781. if (item.value == e) {
  782. theType = item.key;
  783. };
  784. });
  785. return theType;
  786. }
  787. },
  788. //是否文字与数字转换
  789. getWhether: function (e) {
  790. if (e) {
  791. let theType = '';
  792. Whether.map(function (item) {
  793. if (item.value == e) {
  794. theType = item.key;
  795. };
  796. });
  797. return theType;
  798. }
  799. },
  800. //是否实名认证
  801. getCertification: function (e) {
  802. if (e) {
  803. let theType = '';
  804. Certification.map(function (item) {
  805. if (item.value == e) {
  806. theType = item.key;
  807. };
  808. });
  809. return theType;
  810. }
  811. },
  812. //会员状态
  813. getCurrentMember: function (e) {
  814. if (e) {
  815. let theType = '';
  816. currentMember.map(function (item) {
  817. if (item.value == e) {
  818. theType = item.key;
  819. };
  820. });
  821. return theType;
  822. }
  823. },
  824. //会员等级
  825. getLvl: function (e) {
  826. if (e) {
  827. let theType = '';
  828. lvl.map(function (item) {
  829. if (item.value == e) {
  830. theType = item.key;
  831. };
  832. });
  833. return theType;
  834. }
  835. },
  836. //省份转换
  837. getprovince:function(e){
  838. let nub=parseInt(e);
  839. let theType = '';
  840. if (nub<=34) {
  841. provinceList.map(function (item) {
  842. if (item.id == nub) {
  843. theType = item.name;
  844. };
  845. });
  846. }
  847. if(nub>34&&nub<380){
  848. provinceList.map(function (item) {
  849. item.cityList.map(function (city) {
  850. if (city.id == nub) {
  851. theType = city.name;
  852. };
  853. });
  854. });
  855. }
  856. if(nub>=380){
  857. provinceList.map(function (item) {
  858. item.cityList.map(function (city) {
  859. city.areaList.map(function (areas) {
  860. if (areas.id == nub) {
  861. theType = areas.name;
  862. };
  863. });
  864. });
  865. })
  866. }
  867. return theType;
  868. },
  869. //我的业务跟进状态
  870. getStatusFollow:function(e){
  871. let theType = '';
  872. if(e){
  873. theType ='跟进中' ;
  874. }else{
  875. theType ='停止跟进';
  876. }
  877. return theType;
  878. },
  879. //我的业务跟进状态
  880. getContactType:function(e){
  881. if (e) {
  882. let theType = '';
  883. contactType.map(function (item) {
  884. if (item.value == e) {
  885. theType = item.key;
  886. };
  887. });
  888. return theType;
  889. }
  890. },
  891. //社会属性
  892. getSocialAttribute:function(e){
  893. if (e) {
  894. let theType = '';
  895. socialAttribute.map(function (item) {
  896. if (item.value == e) {
  897. theType = item.key;
  898. };
  899. });
  900. return theType;
  901. }
  902. },
  903. //行业
  904. getIndustry:function(e){
  905. if (e) {
  906. let theType = '';
  907. industry.map(function (item) {
  908. if (item.value == e) {
  909. theType = item.key;
  910. };
  911. });
  912. return theType;
  913. }
  914. },
  915. //岗位
  916. getStation:function(e){
  917. if (e) {
  918. let theType = '';
  919. station.map(function (item) {
  920. if (item.value == e) {
  921. theType = item.key;
  922. };
  923. });
  924. return theType;
  925. }
  926. },
  927. //职务
  928. getPost:function(e){
  929. if (e) {
  930. let theType = '';
  931. post.map(function (item) {
  932. if (item.value == e) {
  933. theType = item.key;
  934. };
  935. });
  936. return theType;
  937. }
  938. },
  939. //组织类型
  940. getPattern:function(e){
  941. if (e) {
  942. let theType = '';
  943. patternOrganization.map(function (item) {
  944. if (item.value == e) {
  945. theType = item.key;
  946. };
  947. });
  948. return theType;
  949. }
  950. },
  951. //组织状态
  952. getCondition:function(e){
  953. if (e) {
  954. let theType = '';
  955. conditionOrganization.map(function (item) {
  956. if (item.value == e) {
  957. theType = item.key;
  958. };
  959. });
  960. return theType;
  961. }
  962. },
  963. //品类状态
  964. getCategoryState:function(e){
  965. if (e) {
  966. let theType = '';
  967. categoryState.map(function (item) {
  968. if (item.value == e) {
  969. theType = item.key;
  970. };
  971. });
  972. return theType;
  973. }
  974. },
  975. //实名认证
  976. getAuditStatus:function(index){
  977. let e=index?index.toString():'';
  978. if (e) {
  979. let theType = '';
  980. auditStatusL.map(function (item) {
  981. if (item.value == e) {
  982. theType = item.key;
  983. };
  984. });
  985. return theType;
  986. }
  987. },
  988. //品类状态
  989. getGameState:function(index){
  990. let e=index?index.toString():'';
  991. if (e) {
  992. let theType = '';
  993. gameState.map(function (item) {
  994. if (item.value == e) {
  995. theType = item.key;
  996. };
  997. });
  998. return theType;
  999. }
  1000. },
  1001. //消息类型
  1002. getMessageType:function(index){
  1003. let e=index?index.toString():'';
  1004. if (e) {
  1005. let theType = '';
  1006. messageType.map(function (item) {
  1007. if (item.value == e) {
  1008. theType = item.key;
  1009. };
  1010. });
  1011. return theType;
  1012. }
  1013. },
  1014. //发送目标
  1015. getDesignated:function(index){
  1016. let e=index?index.toString():'';
  1017. if (e) {
  1018. let theType = '';
  1019. designated.map(function (item) {
  1020. if (item.value == e) {
  1021. theType = item.key;
  1022. };
  1023. });
  1024. return theType;
  1025. }
  1026. },
  1027. getFeatured:function(index){
  1028. let e=index?index.toString():'';
  1029. if (e) {
  1030. let theType = '';
  1031. featured.map(function (item) {
  1032. if (item.value == e) {
  1033. theType = item.key;
  1034. };
  1035. });
  1036. return theType;
  1037. }
  1038. },
  1039. }