tools.js 45 KB

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