tools.js 49 KB

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