tools.js 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085
  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. secretType,
  94. buyAuditType,
  95. categoryType,
  96. categoryPatent,
  97. maturityType,
  98. indateType,
  99. } from './dataDic.js';
  100. import { provinceList } from './NewDicProvinceList.js';
  101. // 东北(黑龙江省、吉林省、辽宁省);
  102. // 华东(上海市、江苏省、浙江省、安徽省、福建省、江西省、山东省、台湾省);
  103. // 华北(北京市、天津市、山西省、河北省、内蒙古自治区);
  104. // 华中(河南省、湖北省、湖南省);
  105. // 华南(广东省、广西壮族自治区、海南省、香港特别行政区、澳门特别行政区);
  106. // 西南(四川省、贵州省、云南省、重庆市、西藏自治区);
  107. // 西北(陕西省、甘肃省、青海省、宁夏回族自治区、新疆维吾尔自治区)
  108. module.exports = {
  109. placeList: [
  110. {
  111. place: "东北",
  112. children: ["黑龙江", "吉林", "辽宁"],
  113. value: "1"
  114. },
  115. {
  116. place: "华东",
  117. children: ["上海", "江苏", "浙江", "安徽", "福建", "江西", "山东", "台湾"],
  118. value: "2"
  119. },
  120. {
  121. place: "华北",
  122. children: ["北京", "天津", "山西", "河北", "内蒙古"],
  123. value: "3"
  124. },
  125. {
  126. place: "华中",
  127. children: ["河南", "湖北", "湖南"],
  128. value: "4"
  129. },
  130. {
  131. place: "华南",
  132. children: ["广东", "广西", "海南", "香港", "澳门"],
  133. value: "5"
  134. },
  135. {
  136. place: "西南",
  137. children: ["四川", "贵州", "云南", "重庆", "西藏"],
  138. value: "6"
  139. },
  140. {
  141. place: "西北",
  142. children: ["陕西", "甘肃", "青海", "宁夏", "新疆"],
  143. value: "7"
  144. }
  145. ],
  146. provinceStatus: [
  147. {
  148. value: "7",
  149. key: "安徽"
  150. },
  151. {
  152. value: "15",
  153. key: "北京"
  154. },
  155. {
  156. value: "27",
  157. key: "重庆"
  158. },
  159. {
  160. value: "8",
  161. key: "福建"
  162. },
  163. {
  164. value: "30",
  165. key: "甘肃"
  166. },
  167. {
  168. value: "24",
  169. key: "广东"
  170. },
  171. {
  172. value: "20",
  173. key: "广西"
  174. },
  175. {
  176. value: "25",
  177. key: "贵州"
  178. },
  179. {
  180. value: "21",
  181. key: "海南"
  182. },
  183. {
  184. value: "13",
  185. key: "河北"
  186. },
  187. {
  188. value: "1",
  189. key: "黑龙江"
  190. },
  191. {
  192. value: "19",
  193. key: "河南"
  194. },
  195. {
  196. value: "22",
  197. key: "香港"
  198. },
  199. {
  200. value: "17",
  201. key: "湖北"
  202. },
  203. {
  204. value: "18",
  205. key: "湖南"
  206. },
  207. {
  208. value: "5",
  209. key: "江苏"
  210. },
  211. {
  212. value: "9",
  213. key: "江西"
  214. },
  215. {
  216. value: "3",
  217. key: "辽宁"
  218. },
  219. {
  220. value: "2",
  221. key: "吉林"
  222. },
  223. {
  224. value: "23",
  225. key: "澳门"
  226. },
  227. {
  228. value: "14",
  229. key: "内蒙古"
  230. },
  231. {
  232. value: "32",
  233. key: "宁夏"
  234. },
  235. {
  236. value: "31",
  237. key: "青海"
  238. },
  239. {
  240. value: "10",
  241. key: "山东"
  242. },
  243. {
  244. value: "4",
  245. key: "上海"
  246. },
  247. {
  248. value: "12",
  249. key: "山西"
  250. },
  251. {
  252. value: "34",
  253. key: "陕西"
  254. },
  255. {
  256. value: "29",
  257. key: "四川"
  258. },
  259. {
  260. value: "11",
  261. key: "台湾"
  262. },
  263. {
  264. value: "16",
  265. key: "天津"
  266. },
  267. {
  268. value: "33",
  269. key: "新疆"
  270. },
  271. {
  272. value: "28",
  273. key: "西藏"
  274. },
  275. {
  276. value: "26",
  277. key: "云南"
  278. },
  279. {
  280. value: "6",
  281. key: "浙江"
  282. },
  283. ],
  284. province: [
  285. "黑龙江",
  286. "吉林",
  287. "辽宁",
  288. "上海",
  289. "江苏",
  290. "浙江",
  291. "安徽",
  292. "福建",
  293. "江西",
  294. "山东",
  295. "台湾",
  296. "北京",
  297. "天津",
  298. "山西",
  299. "河北",
  300. "内蒙古",
  301. "河南",
  302. "湖北",
  303. "湖南",
  304. "广东",
  305. "广西",
  306. "海南",
  307. "香港",
  308. "澳门",
  309. "四川",
  310. "贵州",
  311. "云南",
  312. "重庆",
  313. "西藏",
  314. "陕西",
  315. "甘肃",
  316. "青海",
  317. "宁夏",
  318. "新疆"
  319. ],
  320. splitUrl: function (string, i, url) {
  321. let theList = [];
  322. let theArr = [];
  323. if (string && string.length) {
  324. theArr = string.split(i);
  325. theArr.map(function (item, i) {
  326. theList.push({
  327. uid: -i - 1,
  328. url: url + item,
  329. response: {
  330. data: item
  331. }
  332. });
  333. });
  334. }
  335. return theList;
  336. },
  337. getBase64: function (img, callback) {
  338. const reader = new FileReader();
  339. reader.addEventListener("load", () => callback(reader.result));
  340. reader.readAsDataURL(img);
  341. },
  342. beforeUpload: function (file) {
  343. const isLt2M = file.size / 1024 / 1024 < 2;
  344. if (!isLt2M) {
  345. message.error("图片小大必须小于2MB!");
  346. }
  347. return isLt2M;
  348. },
  349. beforeUploadFile: function (file) {
  350. const isImage = file.type.split('/');
  351. //判断是否是图片类型
  352. // if (isImage[0] === 'image') {
  353. // let compressThreshold = 1, isPictureCompress = true, pictureQuality = 0.92;
  354. // let fileSize = file.size / 1024 / 1024;
  355. // //当开启图片压缩且图片大小大于等于压缩阈值,进行压缩
  356. // if ((fileSize >= compressThreshold) && isPictureCompress) {
  357. // //判断浏览器内核是否支持base64图片压缩
  358. // if (typeof (FileReader) === 'undefined') {
  359. // return file;
  360. // } else {
  361. // try {
  362. // // this.setState({
  363. // // spinLoading: true
  364. // // });
  365. // return new Promise(resolve => {
  366. // //声明FileReader文件读取对象
  367. // const reader = new FileReader();
  368. // reader.readAsDataURL(file);
  369. // reader.onload = () => {
  370. // // 生成canvas画布
  371. // const canvas = document.createElement('canvas');
  372. // // 生成img
  373. // const img = document.createElement('img');
  374. // img.src = reader.result;
  375. // img.onload = () => {
  376. // const ctx = canvas.getContext('2d');
  377. // //原始图片宽度、高度
  378. // let originImageWidth = img.width, originImageHeight = img.height;
  379. // //默认最大尺度的尺寸限制在(1920 * 1080)
  380. // let maxWidth = 1920, maxHeight = 1080, ratio = maxWidth / maxHeight;
  381. // //目标尺寸
  382. // let targetWidth = originImageWidth, targetHeight = originImageHeight;
  383. // //当图片的宽度或者高度大于指定的最大宽度或者最大高度时,进行缩放图片
  384. // if (originImageWidth > maxWidth || originImageHeight > maxHeight) {
  385. // //超过最大宽高比例
  386. // if ((originImageWidth / originImageHeight) > ratio) {
  387. // //宽度取最大宽度值maxWidth,缩放高度
  388. // targetWidth = maxWidth;
  389. // targetHeight = Math.round(maxWidth * (originImageHeight / originImageWidth));
  390. // } else {
  391. // //高度取最大高度值maxHeight,缩放宽度
  392. // targetHeight = maxHeight;
  393. // targetWidth = Math.round(maxHeight * (originImageWidth / originImageHeight));
  394. // }
  395. // }
  396. // // canvas对图片进行缩放
  397. // canvas.width = targetWidth;
  398. // canvas.height = targetHeight;
  399. // // 清除画布
  400. // ctx.clearRect(0, 0, targetWidth, targetHeight);
  401. // // 绘制图片
  402. // ctx.drawImage(img, 0, 0, targetWidth, targetHeight);
  403. // // quality值越小,图像越模糊,默认图片质量为0.92
  404. // const imageDataURL = canvas.toDataURL(file.type || 'image/jpeg', pictureQuality);
  405. // // 去掉URL的头,并转换为byte
  406. // const imageBytes = window.atob(imageDataURL.split(',')[1]);
  407. // // 处理异常,将ascii码小于0的转换为大于0
  408. // const arrayBuffer = new ArrayBuffer(imageBytes.length);
  409. // const uint8Array = new Uint8Array(arrayBuffer);
  410. // for (let i = 0; i < imageBytes.length; i++) {
  411. // uint8Array[i] = imageBytes.charCodeAt(i);
  412. // }
  413. // let mimeType = imageDataURL.split(',')[0].match(/:(.*?);/)[1];
  414. // let newFile = new File([uint8Array], file.name, { type: mimeType || 'image/jpeg' });
  415. // resolve(newFile);
  416. // };
  417. // };
  418. // reader.onerror = () => {
  419. // // this.setState({
  420. // // spinLoading: false
  421. // // });
  422. // return file;
  423. // }
  424. // }).then(res => {
  425. // // this.setState({
  426. // // spinLoading: false
  427. // // });
  428. // return res;
  429. // }).catch(() => {
  430. // // this.setState({
  431. // // spinLoading: false
  432. // // });
  433. // return file;
  434. // });
  435. // } catch (e) {
  436. // // this.setState({
  437. // // spinLoading: false
  438. // // });
  439. // //压缩出错,直接返回原file对象
  440. // return file;
  441. // }
  442. // }
  443. // } else {
  444. // //不需要压缩,直接返回原file对象
  445. // return file;
  446. // }
  447. // } else {
  448. // //非图片文件,不进行压缩,直接返回原file对象
  449. // return file;
  450. // }
  451. },
  452. getTime: function (e, t) {
  453. if (e && !t) {
  454. var d = new Date(e);
  455. d =
  456. d.getFullYear() +
  457. "-" +
  458. (d.getMonth() + 1 < 10 ? "0" + (d.getMonth() + 1) : d.getMonth() + 1) +
  459. "-" +
  460. (d.getDate() < 10 ? "0" + d.getDate() : d.getDate()) +
  461. " ";
  462. // + (d.getHours() < 10 ? "0" + d.getHours() : d.getHours()) + ":" +
  463. // (d.getMinutes() < 10 ? "0" + d.getMinutes() : d.getMinutes()) + ":" +
  464. // (d.getSeconds() < 10 ? "0" + d.getSeconds() : d.getSeconds());
  465. return d;
  466. } else if (e && t) {
  467. var d1 = new Date(e);
  468. var d2 = new Date(e);
  469. d2 = d2.setMonth(d1.getMonth() + t);
  470. d2 = new Date(d2);
  471. d2 =
  472. d2.getFullYear() +
  473. "-" +
  474. (d2.getMonth() + 1 < 10
  475. ? "0" + (d2.getMonth() + 1)
  476. : d2.getMonth() + 1) +
  477. "-" +
  478. (d2.getDate() < 10 ? "0" + d2.getDate() : d2.getDate()) +
  479. " ";
  480. return d2;
  481. } else {
  482. return "";
  483. }
  484. },
  485. getPatentType: function (e) {
  486. if (e) {
  487. let theType = "";
  488. patentTypeList.map(function (item) {
  489. if (item.value == e) {
  490. theType = item.key;
  491. }
  492. });
  493. return theType;
  494. }
  495. },
  496. getPatentState: function (e) {
  497. if (e) {
  498. let theState = "";
  499. patentStateList.map(function (item) {
  500. if (item.value == e) {
  501. theState = item.key;
  502. }
  503. });
  504. return theState;
  505. }
  506. },
  507. getPatentField: function (e) {
  508. if (e) {
  509. let theState = "";
  510. patentFieldList.map(function (item) {
  511. if (item.value == e) {
  512. theState = item.key;
  513. }
  514. });
  515. return theState;
  516. }
  517. },
  518. getTechnicalSource: function (e) {
  519. if (e) {
  520. let theSource = "";
  521. technicalSourceList.map(function (item) {
  522. if (item.value == e) {
  523. theSource = item.key;
  524. }
  525. });
  526. return theSource;
  527. }
  528. },
  529. getCatagory: function (e) {
  530. if (e) {
  531. let theType = "";
  532. catagoryList.map(function (item) {
  533. if (item.value == e) {
  534. theType = item.key;
  535. }
  536. });
  537. return theType;
  538. }
  539. },
  540. getIntellectualObtainWay: function (e) {
  541. if (e) {
  542. let theType = "";
  543. intellectualGetList.map(function (item) {
  544. if (item.value == e) {
  545. theType = item.key;
  546. }
  547. });
  548. return theType;
  549. }
  550. },
  551. getConversionForm: function (e) {
  552. if (e) {
  553. let theType = "";
  554. conversionFormList.map(function (item) {
  555. if (item.value == e) {
  556. theType = item.key;
  557. }
  558. });
  559. return theType;
  560. }
  561. },
  562. getAnnualReportState: function (e) {
  563. if (e) {
  564. let theType = "";
  565. annualReportStateList.map(function (item) {
  566. if (item.value == e) {
  567. theType = item.key;
  568. }
  569. });
  570. return theType;
  571. }
  572. },
  573. getCognizanceState: function (e) {
  574. if (e) {
  575. let theType = "";
  576. cognizanceStateList.map(function (item) {
  577. if (item.value == e) {
  578. theType = item.key;
  579. }
  580. });
  581. return theType;
  582. }
  583. },
  584. getTechnologyState: function (e) {
  585. if (e) {
  586. let theType = "";
  587. technologyStateList.map(function (item) {
  588. if (item.value == e) {
  589. theType = item.key;
  590. }
  591. });
  592. return theType;
  593. }
  594. },
  595. //显示用户认证状态
  596. getAuditState: function (e) {
  597. if (e) {
  598. let theType = "";
  599. auditStatusList.map(function (item) {
  600. if (item.value == e) {
  601. theType = item.key;
  602. }
  603. });
  604. return theType;
  605. }
  606. },
  607. getCopyrightState: function (e) {
  608. if (e) {
  609. let theType = "";
  610. copyrightStateList.map(function (item) {
  611. if (item.value == e) {
  612. theType = item.key;
  613. }
  614. });
  615. return theType;
  616. }
  617. },
  618. downloadFile: function (path, fileName) {
  619. window.open(
  620. globalConfig.context +
  621. "/open/downloadFile?path=" +
  622. path +
  623. "&fileName=" +
  624. fileName
  625. );
  626. },
  627. techDownloadFile: function (url, id) {
  628. window.open(globalConfig.context + url + "?id=" + id);
  629. },
  630. copyrightDownloadFile: function (id, sign, url) {
  631. window.open(globalConfig.context + url + "?id=" + id + "&sign=" + sign);
  632. },
  633. newDownloadFile: function (id, sign, url, type) {
  634. if (!type) {
  635. window.open(globalConfig.context + url + "?id=" + id + "&sign=" + sign);
  636. }
  637. if (type) {
  638. window.open(
  639. globalConfig.context +
  640. url +
  641. "?id=" +
  642. id +
  643. "&sign=" +
  644. sign +
  645. "&type=" +
  646. type
  647. );
  648. }
  649. },
  650. companySearch(input, option) {
  651. return option.props.children.indexOf(input) >= 0;
  652. },
  653. getVacations(ccccc) {
  654. let now = new Date();
  655. let theYear = now.getFullYear();
  656. $.ajax({
  657. type: "get",
  658. dataType: "json",
  659. crossDomain: false,
  660. url: globalConfig.context + "/open/html/json/vacations" + theYear,
  661. success: data => {
  662. if (data) {
  663. ccccc(data);
  664. }
  665. }
  666. });
  667. },
  668. getInUrgentTime(date, inUrgent, vocations) {
  669. if (vocations && vocations.length) {
  670. let now = new Date(date),
  671. addNum = 0;
  672. for (var i = 1; i <= inUrgent;) {
  673. now.setDate(now.getDate() + 1);
  674. let thebool = true;
  675. vocations.map(item => {
  676. if (item == getKey(now)) {
  677. thebool = false;
  678. }
  679. });
  680. if (thebool) {
  681. i++;
  682. }
  683. }
  684. return now;
  685. }
  686. function getKey(date) {
  687. var year = date.getFullYear(),
  688. month = date.getMonth() + 1,
  689. day = date.getDate();
  690. year = "" + year;
  691. month = (month > 9 ? "" : "0") + month;
  692. day = (day > 9 ? "" : "0") + day;
  693. return year + month + day;
  694. }
  695. },
  696. //各种通过接口获取下拉列表
  697. setPatentStateOption(permission) {
  698. let theArr = [];
  699. patentStateList.map(function (item) {
  700. for (let i = 0; i < permission.length; i++) {
  701. if (item.value == permission[i]) {
  702. theArr.push(item);
  703. }
  704. }
  705. });
  706. return theArr;
  707. },
  708. setUserContactsList() {
  709. let theOption = [];
  710. $.ajax({
  711. method: "get",
  712. dataType: "json",
  713. crossDomain: false,
  714. url: globalConfig.context + "/api/user/getContacts",
  715. success: function (data) {
  716. if (!data.data) {
  717. if (data.error && data.error.length) {
  718. message.warning(data.error[0].message);
  719. }
  720. return;
  721. }
  722. for (let item in data.data) {
  723. let theData = data.data[item];
  724. theOption.push(
  725. <Select.Option value={item} key={theData}>
  726. {theData}
  727. </Select.Option>
  728. );
  729. }
  730. }
  731. });
  732. return theOption;
  733. },
  734. setAdminContactsList(uid) {
  735. let theOption = [];
  736. $.ajax({
  737. method: "get",
  738. dataType: "json",
  739. crossDomain: false,
  740. url: globalConfig.context + "/api/admin/getContacts",
  741. data: { uid: uid },
  742. success: function (data) {
  743. if (!data.data) {
  744. if (data.error && data.error.length) {
  745. message.warning(data.error[0].message);
  746. }
  747. return;
  748. }
  749. for (let item in data.data) {
  750. let theData = data.data[item];
  751. theOption.push(
  752. <Select.Option value={item} key={theData}>
  753. {theData}
  754. </Select.Option>
  755. );
  756. }
  757. }
  758. });
  759. return theOption;
  760. },
  761. //高企培育资料完成情况(比重)
  762. getProportion(uid, callback) {
  763. $.ajax({
  764. method: "get",
  765. dataType: "json",
  766. crossDomain: false,
  767. url: globalConfig.context + "/api/admin/proportion",
  768. data: { uid: uid },
  769. success: function (data) {
  770. if (!data.data) {
  771. if (data.error && data.error.length) {
  772. message.warning(data.error[0].message);
  773. }
  774. data.data = {};
  775. callback(data.data);
  776. }
  777. callback(data.data);
  778. }
  779. });
  780. },
  781. //保存高企培育资料完成情况
  782. saveProportion(id, uid, sign, status) {
  783. $.ajax({
  784. method: "post",
  785. dataType: "json",
  786. crossDomain: false,
  787. url: globalConfig.context + "/api/admin/confirmProportion",
  788. data: {
  789. id: id,
  790. uid: uid,
  791. sign: sign,
  792. status: status
  793. },
  794. success: function (data) {
  795. if (!data.data) {
  796. if (data.error && data.error.length) {
  797. message.warning(data.error[0].message);
  798. }
  799. return;
  800. }
  801. }
  802. });
  803. },
  804. //获取window.location.search传的值
  805. getSearchUrl(e) {
  806. let searchURL = e;
  807. let theObj = {};
  808. searchURL = searchURL.substring(1, searchURL.length);
  809. theObj[searchURL.split("&")[0].split("=")[0]] = searchURL
  810. .split("&")[0]
  811. .split("=")[1];
  812. if (searchURL.split("&")[1]) {
  813. theObj[searchURL.split("&")[1].split("=")[0]] = searchURL
  814. .split("&")[1]
  815. .split("=")[1];
  816. if (searchURL.split("&")[2]) {
  817. theObj[searchURL.split("&")[2].split("=")[0]] = searchURL
  818. .split("&")[2]
  819. .split("=")[1];
  820. }
  821. }
  822. return theObj;
  823. },
  824. //预览接口
  825. getPreview(id, url, sign, callback) {
  826. $.ajax({
  827. method: "get",
  828. dataType: "json",
  829. crossDomain: false,
  830. url: globalConfig.context + "/api/admin/preview/" + url,
  831. data: {
  832. id: id,
  833. sign: sign
  834. },
  835. success: function (data) {
  836. if (!data.data) {
  837. if (data.error && data.error.length) {
  838. message.warning(data.error[0].message);
  839. }
  840. }
  841. callback(
  842. "https://view.officeapps.live.com/op/view.aspx?src=" +
  843. encodeURIComponent(
  844. location.origin +
  845. globalConfig.context +
  846. "/open/preview?" +
  847. data.data
  848. )
  849. );
  850. }
  851. });
  852. },
  853. //获取企业规模
  854. getScaleState(e) {
  855. if (e) {
  856. let theType = "";
  857. scaleList.map(function (item) {
  858. if (item.value == e) {
  859. theType = item.key;
  860. }
  861. });
  862. return theType;
  863. }
  864. },
  865. //获取企业类型
  866. getCompanyType(type1, type2) {
  867. let companyTypeList = [];
  868. for (let i = 0; i < companyType.length; i++) {
  869. companyTypeList.push({
  870. value: companyType[i].value,
  871. label: companyType[i].label
  872. });
  873. if (companyType[i].children) {
  874. for (let j = 0; j < companyType[i].children.length; j++) {
  875. companyTypeList.push({
  876. value: companyType[i].children[j].value,
  877. label: companyType[i].children[j].label
  878. });
  879. }
  880. }
  881. }
  882. companyTypeList.sort(function (a, b) {
  883. return a.value - b.value;
  884. });
  885. let typeKey = "";
  886. companyTypeList.map(function (item) {
  887. if (type1 == item.value) {
  888. typeKey = item.label;
  889. }
  890. if (type2 == item.value) {
  891. typeKey = typeKey + "/" + item.label;
  892. }
  893. });
  894. return typeKey;
  895. },
  896. //获取企业行业
  897. getIndustryType(e) {
  898. if (e) {
  899. let theType = "";
  900. industryList.map(function (item) {
  901. if (item.value == e) {
  902. theType = item.key;
  903. }
  904. });
  905. return theType;
  906. }
  907. },
  908. //获取合同状态
  909. getContractType: function (e) {
  910. if (e) {
  911. let theType = "";
  912. contractTypeList.map(function (item) {
  913. if (item.value == e) {
  914. theType = item.key;
  915. }
  916. });
  917. return theType;
  918. }
  919. },
  920. //获取合同类型
  921. getContractState: function (e) {
  922. if (e) {
  923. let theType = "";
  924. contractStateList.map(function (item) {
  925. if (item.value == e) {
  926. theType = item.key;
  927. }
  928. });
  929. return theType;
  930. }
  931. },
  932. //获取需求类型
  933. getDemandType: function (e) {
  934. if (e || e == 0) {
  935. let str = e.toString();
  936. let theType = "";
  937. demandTypeList.map(function (item) {
  938. if (item.value == str) {
  939. theType = item.key;
  940. }
  941. });
  942. return theType;
  943. }
  944. },
  945. //获取成果类型
  946. getAchievementCategory: function (e) {
  947. if (e || e == "0") {
  948. let theType = "";
  949. achievementCategoryList.map(function (item) {
  950. if (item.value == e) {
  951. theType = item.key;
  952. }
  953. });
  954. return theType;
  955. }
  956. },
  957. //获取需求和成果审核状态
  958. getTechAuditStatus: function (e) {
  959. if (e) {
  960. let theType = "";
  961. techAuditStatusList.map(function (item) {
  962. if (item.value == e) {
  963. theType = item.key;
  964. }
  965. });
  966. return theType;
  967. }
  968. },
  969. //获取政策审核状态
  970. getauditStatus: function (e) {
  971. if (e || e >= 0) {
  972. let tt = e.toString();
  973. let theType = "";
  974. auditStatusLists.map(function (item) {
  975. if (item.value == tt) {
  976. theType = item.key;
  977. }
  978. });
  979. return theType;
  980. }
  981. },
  982. //获取需求和成果审核状态
  983. getMaturity: function (e) {
  984. if (e) {
  985. let theType = "";
  986. maturityList.map(function (item) {
  987. if (item.value == e) {
  988. theType = item.key;
  989. }
  990. });
  991. return theType;
  992. }
  993. },
  994. //获取需求和成果审核状态
  995. getTransferMode: function (e) {
  996. if (e) {
  997. let theType = "";
  998. transferModeList.map(function (item) {
  999. if (item.value == e) {
  1000. theType = item.key;
  1001. }
  1002. });
  1003. return theType;
  1004. }
  1005. },
  1006. //获取创新度状态
  1007. getInnovation: function (e) {
  1008. if (e || e == "0") {
  1009. let theType = "";
  1010. innovationList.map(function (item) {
  1011. if (item.value == e) {
  1012. theType = item.key;
  1013. }
  1014. });
  1015. return theType;
  1016. }
  1017. },
  1018. //获取创新度状态
  1019. getOrderStatus: function (e) {
  1020. if (e) {
  1021. let theType = "";
  1022. orderStatusList.map(function (item) {
  1023. if (item.value == e) {
  1024. theType = item.key;
  1025. }
  1026. });
  1027. return theType;
  1028. }
  1029. },
  1030. //科技管理
  1031. //活动圈后台管理
  1032. getActivityType: function (e) {
  1033. if (e) {
  1034. let theType = "";
  1035. activityType.map(function (item) {
  1036. if (item.value == e) {
  1037. theType = item.key;
  1038. }
  1039. });
  1040. return theType;
  1041. }
  1042. },
  1043. getActivityForm: function (e) {
  1044. if (e) {
  1045. let theType = "";
  1046. activityForm.map(function (item) {
  1047. if (item.value == e) {
  1048. theType = item.key;
  1049. }
  1050. });
  1051. return theType;
  1052. }
  1053. },
  1054. //是否展示在首页
  1055. gethot: function (e) {
  1056. if (e) {
  1057. let theType = "";
  1058. hot.map(function (item) {
  1059. if (item.value == e) {
  1060. theType = item.key;
  1061. }
  1062. });
  1063. return theType;
  1064. }
  1065. },
  1066. //是否精品
  1067. getboutique: function (e) {
  1068. if (e) {
  1069. let theType = "";
  1070. boutique.map(function (item) {
  1071. if (item.value == e) {
  1072. theType = item.key;
  1073. }
  1074. });
  1075. return theType;
  1076. }
  1077. },
  1078. //客户类型
  1079. getcustomerTyp: function (e) {
  1080. if (e) {
  1081. let theType = "";
  1082. customerTyp.map(function (item) {
  1083. if (item.value == e) {
  1084. theType = item.key;
  1085. }
  1086. });
  1087. return theType;
  1088. }
  1089. },
  1090. //省份
  1091. getcityArr: function (e) {
  1092. if (e) {
  1093. let theType = "";
  1094. cityArr.map(function (item) {
  1095. if (item.value == e) {
  1096. theType = item.key;
  1097. }
  1098. });
  1099. return theType;
  1100. }
  1101. },
  1102. //客户状态
  1103. getcustomerStatue: function (e) {
  1104. if (e || e == 0) {
  1105. let theType = "";
  1106. customerStatus.map(function (item) {
  1107. if (item.value == e) {
  1108. theType = item.key;
  1109. }
  1110. });
  1111. return theType;
  1112. }
  1113. },
  1114. //账户状态
  1115. getStatuslist: function (e) {
  1116. if (e) {
  1117. let theType = "";
  1118. statuslist.map(function (item) {
  1119. if (item.value == e) {
  1120. theType = item.key;
  1121. }
  1122. });
  1123. return theType;
  1124. }
  1125. },
  1126. //意向服务
  1127. getCompanyIntention: function (e) {
  1128. if (e) {
  1129. let theType = "";
  1130. intentionalService.map(function (item) {
  1131. if (item.value == e) {
  1132. theType = item.key;
  1133. }
  1134. });
  1135. return theType;
  1136. }
  1137. },
  1138. //客户标签
  1139. getTag: function (e) {
  1140. if (e) {
  1141. let theType = "";
  1142. tag.map(function (item) {
  1143. if (item.value == e) {
  1144. theType = item.key;
  1145. }
  1146. });
  1147. return theType;
  1148. }
  1149. },
  1150. //最新跟进
  1151. getfllowSituation: function (e) {
  1152. if (e || e == 0) {
  1153. let theType = "";
  1154. newFollow.map(function (item) {
  1155. if (item.value == e) {
  1156. theType = item.key;
  1157. }
  1158. });
  1159. return theType;
  1160. }
  1161. },
  1162. //性别
  1163. getsex: function (e) {
  1164. if (e) {
  1165. let theType = "";
  1166. sex.map(function (item) {
  1167. if (item.value == e) {
  1168. theType = item.key;
  1169. }
  1170. });
  1171. return theType;
  1172. }
  1173. },
  1174. //联系方式
  1175. getcontact: function (e) {
  1176. if (e) {
  1177. let theType = "";
  1178. contact.map(function (item) {
  1179. if (item.value == e) {
  1180. theType = item.key;
  1181. }
  1182. });
  1183. return theType;
  1184. }
  1185. },
  1186. //是否文字与数字转换
  1187. getWhether: function (e) {
  1188. if (e) {
  1189. let theType = "";
  1190. Whether.map(function (item) {
  1191. if (item.value == e) {
  1192. theType = item.key;
  1193. }
  1194. });
  1195. return theType;
  1196. }
  1197. },
  1198. //是否实名认证
  1199. getCertification: function (e) {
  1200. if (e) {
  1201. let theType = "";
  1202. Certification.map(function (item) {
  1203. if (item.value == e) {
  1204. theType = item.key;
  1205. }
  1206. });
  1207. return theType;
  1208. }
  1209. },
  1210. //会员状态
  1211. getCurrentMember: function (e) {
  1212. if (e) {
  1213. let theType = "";
  1214. currentMember.map(function (item) {
  1215. if (item.value == e) {
  1216. theType = item.key;
  1217. }
  1218. });
  1219. return theType;
  1220. }
  1221. },
  1222. //会员等级
  1223. getLvl: function (e) {
  1224. if (e) {
  1225. let theType = "";
  1226. lvl.map(function (item) {
  1227. if (item.value == e) {
  1228. theType = item.key;
  1229. }
  1230. });
  1231. return theType;
  1232. }
  1233. },
  1234. //省份转换
  1235. getprovince: function (e) {
  1236. let nub = parseInt(e);
  1237. let theType = "";
  1238. if (nub <= 34) {
  1239. provinceList.map(function (item) {
  1240. if (item.id == nub) {
  1241. theType = item.name;
  1242. }
  1243. });
  1244. }
  1245. if (nub > 34 && nub < 380) {
  1246. provinceList.map(function (item) {
  1247. item.cityList.map(function (city) {
  1248. if (city.id == nub) {
  1249. theType = city.name;
  1250. }
  1251. });
  1252. });
  1253. }
  1254. if (nub >= 380) {
  1255. provinceList.map(function (item) {
  1256. item.cityList.map(function (city) {
  1257. city.areaList.map(function (areas) {
  1258. if (areas.id == nub) {
  1259. theType = areas.name;
  1260. }
  1261. });
  1262. });
  1263. });
  1264. }
  1265. return theType;
  1266. },
  1267. //我的业务跟进状态
  1268. getStatusFollow: function (e) {
  1269. let theType = "";
  1270. if (e) {
  1271. theType = "跟进中";
  1272. } else {
  1273. theType = "停止跟进";
  1274. }
  1275. return theType;
  1276. },
  1277. //我的业务跟进状态
  1278. getContactType: function (e) {
  1279. if (e) {
  1280. let theType = "";
  1281. contactType.map(function (item) {
  1282. if (item.value == e) {
  1283. theType = item.key;
  1284. }
  1285. });
  1286. return theType;
  1287. }
  1288. },
  1289. //社会属性
  1290. getSocialAttribute: function (e) {
  1291. if (e) {
  1292. let theType = "";
  1293. socialAttribute.map(function (item) {
  1294. if (item.value == e) {
  1295. theType = item.key;
  1296. }
  1297. });
  1298. return theType;
  1299. }
  1300. },
  1301. //行业
  1302. getIndustry: function (e) {
  1303. if (e) {
  1304. let theType = "";
  1305. industry.map(function (item) {
  1306. if (item.value == e) {
  1307. theType = item.key;
  1308. }
  1309. });
  1310. return theType;
  1311. }
  1312. },
  1313. //岗位
  1314. getStation: function (e) {
  1315. if (e) {
  1316. let theType = "";
  1317. station.map(function (item) {
  1318. if (item.value == e) {
  1319. theType = item.key;
  1320. }
  1321. });
  1322. return theType;
  1323. }
  1324. },
  1325. //职务
  1326. getPost: function (e) {
  1327. if (e) {
  1328. let theType = "";
  1329. post.map(function (item) {
  1330. if (item.value == e) {
  1331. theType = item.key;
  1332. }
  1333. });
  1334. return theType;
  1335. }
  1336. },
  1337. //组织类型
  1338. getPattern: function (e) {
  1339. if (e) {
  1340. let theType = "";
  1341. patternOrganization.map(function (item) {
  1342. if (item.value == e) {
  1343. theType = item.key;
  1344. }
  1345. });
  1346. return theType;
  1347. }
  1348. },
  1349. //组织状态
  1350. getCondition: function (e) {
  1351. if (e) {
  1352. let theType = "";
  1353. conditionOrganization.map(function (item) {
  1354. if (item.value == e) {
  1355. theType = item.key;
  1356. }
  1357. });
  1358. return theType;
  1359. }
  1360. },
  1361. //品类状态
  1362. getCategoryState: function (e) {
  1363. if (e) {
  1364. let theType = "";
  1365. categoryState.map(function (item) {
  1366. if (item.value == e) {
  1367. theType = item.key;
  1368. }
  1369. });
  1370. return theType;
  1371. }
  1372. },
  1373. //实名认证
  1374. getAuditStatus: function (index) {
  1375. let e = index ? index.toString() : "";
  1376. if (e) {
  1377. let theType = "";
  1378. auditStatusL.map(function (item) {
  1379. if (item.value == e) {
  1380. theType = item.key;
  1381. }
  1382. });
  1383. return theType;
  1384. }
  1385. },
  1386. //品类状态
  1387. getGameState: function (index) {
  1388. if (index || index == 0) {
  1389. let theType = "";
  1390. gameState.map(function (item) {
  1391. if (item.value == index) {
  1392. theType = item.key;
  1393. }
  1394. });
  1395. return theType;
  1396. }
  1397. },
  1398. //消息类型
  1399. getMessageType: function (index) {
  1400. if (index || index == 0) {
  1401. let theType = "";
  1402. gameState.map(function (item) {
  1403. if (item.value == index) {
  1404. theType = item.key;
  1405. }
  1406. });
  1407. return theType;
  1408. }
  1409. },
  1410. //发送目标
  1411. getDesignated: function (index) {
  1412. let e = index ? index.toString() : "";
  1413. if (e) {
  1414. let theType = "";
  1415. designated.map(function (item) {
  1416. if (item.value == e) {
  1417. theType = item.key;
  1418. }
  1419. });
  1420. return theType;
  1421. }
  1422. },
  1423. //客户端
  1424. getClient: function (index) {
  1425. let e = index ? index.toString() : "";
  1426. if (e) {
  1427. let theType = "";
  1428. client.map(function (item) {
  1429. if (item.value == e) {
  1430. theType = item.key;
  1431. }
  1432. });
  1433. return theType;
  1434. }
  1435. },
  1436. //是否置顶
  1437. getStick: function (index) {
  1438. let e = index ? index.toString() : "";
  1439. if (e) {
  1440. let theType = "";
  1441. stick.map(function (item) {
  1442. if (item.value == e) {
  1443. theType = item.key;
  1444. }
  1445. });
  1446. return theType;
  1447. }
  1448. },
  1449. getFeatured: function (index) {
  1450. let e = index ? index.toString() : "";
  1451. if (e) {
  1452. let theType = "";
  1453. featured.map(function (item) {
  1454. if (item.value == e) {
  1455. theType = item.key;
  1456. }
  1457. });
  1458. return theType;
  1459. }
  1460. },
  1461. getActives: function (e) {
  1462. if (e) {
  1463. let theType = "";
  1464. actives.map(function (item) {
  1465. if (item.value == e) {
  1466. theType = item.key;
  1467. }
  1468. });
  1469. return theType;
  1470. }
  1471. },
  1472. //意向进度
  1473. getIntentProgress: function (e) {
  1474. if (e) {
  1475. let theType = "";
  1476. intentProgress.map(function (item) {
  1477. if (item.value == e) {
  1478. theType = item.key;
  1479. }
  1480. });
  1481. return theType;
  1482. }
  1483. },
  1484. //交易进度
  1485. getTransactionProgress: function (e) {
  1486. if (e) {
  1487. let theType = "";
  1488. transactionProgress.map(function (item) {
  1489. if (item.value == e) {
  1490. theType = item.key;
  1491. }
  1492. });
  1493. return theType;
  1494. }
  1495. },
  1496. //合同进度
  1497. getContractProgress: function (e) {
  1498. if (e) {
  1499. let theType = "";
  1500. contractProgress.map(function (item) {
  1501. if (item.value == e) {
  1502. theType = item.key;
  1503. }
  1504. });
  1505. return theType;
  1506. }
  1507. },
  1508. //项目进度
  1509. getProjectProgress: function (e) {
  1510. if (e) {
  1511. let theType = "";
  1512. projectProgress.map(function (item) {
  1513. if (item.value == e) {
  1514. theType = item.key;
  1515. }
  1516. });
  1517. return theType;
  1518. }
  1519. },
  1520. //订单类型
  1521. getOrderType: function (e) {
  1522. if (e || e == 0) {
  1523. let str = e.toString();
  1524. let theType = "";
  1525. orderType.map(function (item) {
  1526. if (item.value == str) {
  1527. theType = item.key;
  1528. }
  1529. });
  1530. return theType;
  1531. }
  1532. },
  1533. //订单阶段
  1534. getOrderStage: function (e) {
  1535. if (e || e == 0) {
  1536. let str = e.toString();
  1537. let theType = "";
  1538. orderStage.map(function (item) {
  1539. if (item.value == str) {
  1540. theType = item.key;
  1541. }
  1542. });
  1543. return theType;
  1544. }
  1545. },
  1546. //订单状态o
  1547. getOrderState: function (e) {
  1548. if (e || e == 0) {
  1549. let str = e.toString();
  1550. let theType = "";
  1551. orderState.map(function (item) {
  1552. if (item.value == str) {
  1553. theType = item.key;
  1554. }
  1555. });
  1556. return theType;
  1557. }
  1558. },
  1559. //付款状态
  1560. getPaymentState: function (e) {
  1561. if (e || e == 0) {
  1562. let str = e.toString();
  1563. let theType = "";
  1564. paymentState.map(function (item) {
  1565. if (item.value == str) {
  1566. theType = item.key;
  1567. }
  1568. });
  1569. return theType;
  1570. }
  1571. },
  1572. //订单渠道
  1573. getOrderChannel: function (e) {
  1574. if (e || e == 0) {
  1575. let str = e.toString();
  1576. let theType = "";
  1577. orderChannel.map(function (item) {
  1578. if (item.value == str) {
  1579. theType = item.key;
  1580. }
  1581. });
  1582. return theType;
  1583. }
  1584. },
  1585. //特批状态
  1586. getApprovedState: function (e) {
  1587. if (e || e == 0) {
  1588. let str = e.toString();
  1589. let theType = "";
  1590. approvedState.map(function (item) {
  1591. if (item.value == str) {
  1592. theType = item.key;
  1593. }
  1594. });
  1595. return theType;
  1596. }
  1597. },
  1598. //锁定或废除
  1599. getLock: function (e) {
  1600. if (e || e == 0) {
  1601. let str = e.toString();
  1602. let theType = "";
  1603. lock.map(function (item) {
  1604. if (item.value == str) {
  1605. theType = item.key;
  1606. }
  1607. });
  1608. return theType;
  1609. }
  1610. },
  1611. //支付方式
  1612. getPaymentMethod: function (e) {
  1613. if (e || e == 0) {
  1614. let str = e.toString();
  1615. let theType = "";
  1616. paymentMethod.map(function (item) {
  1617. if (item.value == str) {
  1618. theType = item.key;
  1619. }
  1620. });
  1621. return theType;
  1622. }
  1623. },
  1624. //交易渠道 transactionProject
  1625. getTransactionChannel: function (e) {
  1626. if (e || e == 0) {
  1627. let str = e.toString();
  1628. let theType = "";
  1629. transactionChannel.map(function (item) {
  1630. if (item.value == str) {
  1631. theType = item.key;
  1632. }
  1633. });
  1634. return theType;
  1635. }
  1636. },
  1637. //交易科目
  1638. getTransactionProject: function (e) {
  1639. if (e || e == 0) {
  1640. let str = e.toString();
  1641. let theType = "";
  1642. transactionProject.map(function (item) {
  1643. if (item.value == str) {
  1644. theType = item.key;
  1645. }
  1646. });
  1647. return theType;
  1648. }
  1649. },
  1650. //项目状态
  1651. getProjectState: function (e) {
  1652. if (e || e == 0) {
  1653. let str = e.toString();
  1654. let theType = "";
  1655. projectState.map(function (item) {
  1656. if (item.value == str) {
  1657. theType = item.key;
  1658. }
  1659. });
  1660. return theType;
  1661. }
  1662. },
  1663. //任务状态
  1664. getTaskStatus: function (e) {
  1665. if (e || e == 0) {
  1666. let str = e.toString();
  1667. let theType = "";
  1668. taskStatus.map(function (item) {
  1669. if (item.value == str) {
  1670. theType = item.key;
  1671. }
  1672. });
  1673. return theType;
  1674. }
  1675. },
  1676. //公示状态
  1677. getPublishStatus: function (e) {
  1678. if (e || e == 0) {
  1679. let str = e.toString();
  1680. let theType = "";
  1681. publishStatus.map(function (item) {
  1682. if (item.value == str) {
  1683. theType = item.key;
  1684. }
  1685. });
  1686. return theType;
  1687. }
  1688. },
  1689. //变更状态
  1690. getChangeState: function (e) {
  1691. if (e || e == 0) {
  1692. let str = e.toString();
  1693. let theType = "";
  1694. changeState.map(function (item) {
  1695. if (item.value == str) {
  1696. theType = item.key;
  1697. }
  1698. });
  1699. return theType;
  1700. }
  1701. },
  1702. //分派情况
  1703. getDistributeState: function (e) {
  1704. if (e || e == 0) {
  1705. let str = e.toString();
  1706. let theType = "";
  1707. distributeState.map(function (item) {
  1708. if (item.value == str) {
  1709. theType = item.key;
  1710. }
  1711. });
  1712. return theType;
  1713. }
  1714. },
  1715. //客户来源
  1716. getCustomerSource: function (e) {
  1717. if (e || e == 0) {
  1718. let str = e.toString();
  1719. let theType = "";
  1720. customerSource.map(function (item) {
  1721. if (item.value == str) {
  1722. theType = item.key;
  1723. }
  1724. });
  1725. return theType;
  1726. }
  1727. },
  1728. /* g个人中心开发 */
  1729. //发布状态
  1730. getReleaseStateList: function (e) {
  1731. if (e || e == 0) {
  1732. let str = e.toString();
  1733. let theType = "";
  1734. releaseStateList.map(function (item) {
  1735. if (item.value == str) {
  1736. theType = item.key;
  1737. }
  1738. });
  1739. return theType;
  1740. }
  1741. },
  1742. //需求发布位置;
  1743. getReleasePositionList: function (e = []) {
  1744. if (e) {
  1745. let theType = [];
  1746. e.map(item => {
  1747. releasePosition.map(function (atem) {
  1748. if (atem.value == item) {
  1749. theType.push(atem.key);
  1750. }
  1751. });
  1752. });
  1753. return theType.join(" - ");
  1754. }
  1755. },
  1756. //政策发布位置
  1757. getPolicyPosition: function (e = []) {
  1758. if (e) {
  1759. let theType = [];
  1760. e.map(item => {
  1761. policyPosition.map(function (atem) {
  1762. if (atem.value == item) {
  1763. theType.push(atem.key);
  1764. }
  1765. });
  1766. });
  1767. return theType.join(" - ");
  1768. }
  1769. },
  1770. //成果发布位置;
  1771. getAchievementPosition: function (e = []) {
  1772. if (e) {
  1773. let theType = [];
  1774. e.map(item => {
  1775. achievementPosition.map(function (atem) {
  1776. if (atem.value == item) {
  1777. theType.push(atem.key);
  1778. }
  1779. });
  1780. });
  1781. return theType.join(" - ");
  1782. }
  1783. },
  1784. //新闻发布位置
  1785. getNewPosition: function (e = []) {
  1786. if (e) {
  1787. let theType = [];
  1788. e.map(item => {
  1789. newsPosition.map(function (atem) {
  1790. if (atem.value == item) {
  1791. theType.push(atem.key);
  1792. }
  1793. });
  1794. });
  1795. return theType.join(" - ");
  1796. }
  1797. },
  1798. //成果类型;
  1799. getAchievementType: function (e) {
  1800. if (e || e == 0) {
  1801. let str = e.toString();
  1802. let theType = "";
  1803. achievementType.map(function (item) {
  1804. if (item.value == str) {
  1805. theType = item.key;
  1806. }
  1807. });
  1808. return theType;
  1809. }
  1810. },
  1811. //成果交易形式;
  1812. getTransaction: function (e) {
  1813. if (e || e == 0) {
  1814. let str = e.toString();
  1815. let theType = "";
  1816. transaction.map(function (item) {
  1817. if (item.value == str) {
  1818. theType = item.key;
  1819. }
  1820. });
  1821. return theType;
  1822. }
  1823. },
  1824. //新闻类型
  1825. getNewType: function (e) {
  1826. if (e || e == 0) {
  1827. let str = e.toString();
  1828. let theType = "";
  1829. newType.map(function (item) {
  1830. if (item.value == str) {
  1831. theType = item.key;
  1832. }
  1833. });
  1834. return theType;
  1835. }
  1836. },
  1837. //顾问类型
  1838. getAdviserType: function (e) {
  1839. if (e || e == 0) {
  1840. let str = e.toString();
  1841. let theType = "";
  1842. adviserType.map(function (item) {
  1843. if (item.value == str) {
  1844. theType = item.key;
  1845. }
  1846. });
  1847. return theType;
  1848. }
  1849. },
  1850. //认证状态
  1851. getAuthState: function (e) {
  1852. if (e || e == 0) {
  1853. let str = e.toString();
  1854. let theType = "";
  1855. authState.map(function (item) {
  1856. if (item.value == str) {
  1857. theType = item.key;
  1858. }
  1859. });
  1860. return theType;
  1861. }
  1862. },
  1863. //认证状态
  1864. getTypeModule: function (e) {
  1865. if (e || e == 0) {
  1866. let str = e.toString();
  1867. let theType = "";
  1868. typeModule.map(function (item) {
  1869. if (item.value == str) {
  1870. theType = item.key;
  1871. }
  1872. });
  1873. return theType;
  1874. }
  1875. },
  1876. //律师类型
  1877. getLowType: function (e) {
  1878. if (e || e == 0) {
  1879. let str = e.toString();
  1880. let theType = "";
  1881. lowType.map(function (item) {
  1882. if (item.value == str) {
  1883. theType = item.key;
  1884. }
  1885. });
  1886. return theType;
  1887. }
  1888. },
  1889. //消息推送搜索类型转换ziYuanType
  1890. getMsgType: function (e) {
  1891. if (e) {
  1892. let str = e.toString();
  1893. let theType = "";
  1894. msgType.map(function (item) {
  1895. if (item.value == str) {
  1896. theType = item.key;
  1897. }
  1898. });
  1899. return theType;
  1900. }
  1901. },
  1902. //消息推送搜索类型转换数字couponAuthState
  1903. getZiYuanType: function (e) {
  1904. if (e) {
  1905. let str = e.toString();
  1906. let theType = "";
  1907. ziYuanType.map(function (item) {
  1908. if (item.key == str) {
  1909. theType = item.value;
  1910. }
  1911. });
  1912. return theType;
  1913. }
  1914. },
  1915. //抵用券状态
  1916. getCouponAuthState: function (e) {
  1917. if (e) {
  1918. let str = e.toString();
  1919. let theType = "";
  1920. couponAuthState.map(function (item) {
  1921. if (item.key == str) {
  1922. theType = item.value;
  1923. }
  1924. });
  1925. return theType;
  1926. }
  1927. },
  1928. //抵用券来源
  1929. // getCouponCome:function(e){
  1930. // if (e) {
  1931. // let str=e.toString();
  1932. // let theType = '';
  1933. // couponCome.map(function (item) {
  1934. // if (item.key == str) {
  1935. // theType = item.value;
  1936. // };
  1937. // });
  1938. // return theType;
  1939. // }
  1940. // }
  1941. //抵用券来源
  1942. getCouponCome: function (e) {
  1943. if (e || e == "0") {
  1944. let theType = "";
  1945. couponCome.map(function (item) {
  1946. if (item.value == e) {
  1947. theType = item.key;
  1948. }
  1949. });
  1950. return theType;
  1951. }
  1952. },
  1953. //抵用券状态
  1954. getCouponAuthState: function (e) {
  1955. if (e || e == "0") {
  1956. let theType = "";
  1957. couponAuthState.map(function (item) {
  1958. if (item.value == e) {
  1959. theType = item.key;
  1960. }
  1961. });
  1962. return theType;
  1963. }
  1964. },
  1965. //抵用券状态
  1966. getCouponAuthStates: function (e) {
  1967. if (e || e == "0") {
  1968. let theType = "";
  1969. couponAuthStates.map(function (item) {
  1970. if (item.value == e) {
  1971. theType = item.key;
  1972. }
  1973. });
  1974. return theType;
  1975. }
  1976. },
  1977. //采购信息密级
  1978. getSecretType: function (e) {
  1979. if (e || e == "0") {
  1980. let theType = "";
  1981. secretType.map(function (item) {
  1982. if (item.value == e) {
  1983. theType = item.key;
  1984. }
  1985. });
  1986. return theType;
  1987. }
  1988. },
  1989. //采购信息审核状态
  1990. getBuyAuditType: function (e) {
  1991. if (e || e == "0") {
  1992. let theType = "";
  1993. buyAuditType.map(function (item) {
  1994. if (item.value == e) {
  1995. theType = item.key;
  1996. }
  1997. });
  1998. return theType;
  1999. }
  2000. },
  2001. //军转民分类列表
  2002. getCategoryType: function (e) {
  2003. if (e || e == "0") {
  2004. let theType = "";
  2005. categoryType.map(function (item) {
  2006. if (item.value == e) {
  2007. theType = item.key;
  2008. }
  2009. });
  2010. return theType;
  2011. }
  2012. },
  2013. //军转民分类列表
  2014. getCategoryType: function (e) {
  2015. if (e || e == "0") {
  2016. let theType = "";
  2017. categoryType.map(function (item) {
  2018. if (item.value == e) {
  2019. theType = item.key;
  2020. }
  2021. });
  2022. return theType;
  2023. }
  2024. },
  2025. //军转民类型列表
  2026. getCategoryPatent: function (e) {
  2027. if (e || e == "0") {
  2028. let theType = "";
  2029. categoryPatent.map(function (item) {
  2030. if (item.value == e) {
  2031. theType = item.key;
  2032. }
  2033. });
  2034. return theType;
  2035. }
  2036. },
  2037. //军转民类型列表
  2038. getMaturityType: function (e) {
  2039. if (e || e == "0") {
  2040. let theType = "";
  2041. maturityType.map(function (item) {
  2042. if (item.value == e) {
  2043. theType = item.key;
  2044. }
  2045. });
  2046. return theType;
  2047. }
  2048. },
  2049. //军转民类型列表
  2050. getIndateType: function (e) {
  2051. if (e || e == "0") {
  2052. let theType = "";
  2053. indateType.map(function (item) {
  2054. if (item.value == e) {
  2055. theType = item.key;
  2056. }
  2057. });
  2058. return theType;
  2059. }
  2060. },
  2061. getPicPath: function (path, e) {
  2062. return path + e;
  2063. }
  2064. };