tools.js 47 KB

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