tools.js 40 KB

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