tools.js 42 KB

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