tools.js 47 KB

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