tools.js 35 KB

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