tools.js 44 KB

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