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. 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. let theType = "";
  195. patentTypeList.map(function (item) {
  196. if (item.value == e) {
  197. theType = item.key;
  198. }
  199. });
  200. return theType;
  201. },
  202. getPatentTypeva: function (e) {
  203. if (e) {
  204. let theType = "";
  205. patentTypeList.map(function (item) {
  206. if (item.key == e) {
  207. theType = item.value;
  208. }
  209. });
  210. return theType;
  211. }
  212. },
  213. getPatentState: function (e) {
  214. if (e) {
  215. let theState = "";
  216. patentStateList.map(function (item) {
  217. if (item.value == e) {
  218. theState = item.key;
  219. }
  220. });
  221. return theState;
  222. }
  223. },
  224. getPatentField: function (e) {
  225. if (e) {
  226. let theState = "";
  227. patentFieldList.map(function (item) {
  228. if (item.value == e) {
  229. theState = item.key;
  230. }
  231. });
  232. return theState;
  233. }
  234. },
  235. getTechnicalSource: function (e) {
  236. if (e) {
  237. let theSource = "";
  238. technicalSourceList.map(function (item) {
  239. if (item.value == e) {
  240. theSource = item.key;
  241. }
  242. });
  243. return theSource;
  244. }
  245. },
  246. getCatagory: function (e) {
  247. if (e) {
  248. let theType = "";
  249. catagoryList.map(function (item) {
  250. if (item.value == e) {
  251. theType = item.key;
  252. }
  253. });
  254. return theType;
  255. }
  256. },
  257. getIntellectualObtainWay: function (e) {
  258. if (e) {
  259. let theType = "";
  260. intellectualGetList.map(function (item) {
  261. if (item.value == e) {
  262. theType = item.key;
  263. }
  264. });
  265. return theType;
  266. }
  267. },
  268. getConversionForm: function (e) {
  269. if (e) {
  270. let theType = "";
  271. conversionFormList.map(function (item) {
  272. if (item.value == e) {
  273. theType = item.key;
  274. }
  275. });
  276. return theType;
  277. }
  278. },
  279. getAnnualReportState: function (e) {
  280. if (e) {
  281. let theType = "";
  282. annualReportStateList.map(function (item) {
  283. if (item.value == e) {
  284. theType = item.key;
  285. }
  286. });
  287. return theType;
  288. }
  289. },
  290. getCognizanceState: function (e) {
  291. if (e) {
  292. let theType = "";
  293. cognizanceStateList.map(function (item) {
  294. if (item.value == e) {
  295. theType = item.key;
  296. }
  297. });
  298. return theType;
  299. }
  300. },
  301. getTechnologyState: function (e) {
  302. if (e) {
  303. let theType = "";
  304. technologyStateList.map(function (item) {
  305. if (item.value == e) {
  306. theType = item.key;
  307. }
  308. });
  309. return theType;
  310. }
  311. },
  312. //显示用户认证状态
  313. getAuditState: function (e) {
  314. if (e) {
  315. let theType = "";
  316. auditStatusList.map(function (item) {
  317. if (item.value == e) {
  318. theType = item.key;
  319. }
  320. });
  321. return theType;
  322. }
  323. },
  324. getCopyrightState: function (e) {
  325. if (e) {
  326. let theType = "";
  327. copyrightStateList.map(function (item) {
  328. if (item.value == e) {
  329. theType = item.key;
  330. }
  331. });
  332. return theType;
  333. }
  334. },
  335. downloadFile: function (path, fileName) {
  336. window.open(
  337. globalConfig.context +
  338. "/open/downloadFile?path=" +
  339. path +
  340. "&fileName=" +
  341. fileName
  342. );
  343. },
  344. techDownloadFile: function (url, id) {
  345. window.open(globalConfig.context + url + "?id=" + id);
  346. },
  347. copyrightDownloadFile: function (id, sign, url) {
  348. window.open(globalConfig.context + url + "?id=" + id + "&sign=" + sign);
  349. },
  350. newDownloadFile: function (id, sign, url, type) {
  351. if (!type) {
  352. window.open(globalConfig.context + url + "?id=" + id + "&sign=" + sign);
  353. }
  354. if (type) {
  355. window.open(
  356. globalConfig.context +
  357. url +
  358. "?id=" +
  359. id +
  360. "&sign=" +
  361. sign +
  362. "&type=" +
  363. type
  364. );
  365. }
  366. },
  367. companySearch(input, option) {
  368. return option.props.children.indexOf(input) >= 0;
  369. },
  370. getVacations(ccccc) {
  371. let now = new Date();
  372. let theYear = now.getFullYear();
  373. $.ajax({
  374. type: "get",
  375. dataType: "json",
  376. crossDomain: false,
  377. url: globalConfig.context + "/open/html/json/vacations" + theYear,
  378. success: (data) => {
  379. if (data) {
  380. ccccc(data);
  381. }
  382. },
  383. });
  384. },
  385. getInUrgentTime(date, inUrgent, vocations) {
  386. if (vocations && vocations.length) {
  387. let now = new Date(date);
  388. for (var i = 1; i <= inUrgent; ) {
  389. now.setDate(now.getDate() + 1);
  390. let thebool = true;
  391. vocations.map((item) => {
  392. if (item == getKey(now)) {
  393. thebool = false;
  394. }
  395. });
  396. if (thebool) {
  397. i++;
  398. }
  399. }
  400. return now;
  401. }
  402. function getKey(date) {
  403. var year = date.getFullYear(),
  404. month = date.getMonth() + 1,
  405. day = date.getDate();
  406. year = "" + year;
  407. month = (month > 9 ? "" : "0") + month;
  408. day = (day > 9 ? "" : "0") + day;
  409. return year + month + day;
  410. }
  411. },
  412. //各种通过接口获取下拉列表
  413. setPatentStateOption(permission) {
  414. let theArr = [];
  415. patentStateList.map(function (item) {
  416. for (let i = 0; i < permission.length; i++) {
  417. if (item.value == permission[i]) {
  418. theArr.push(item);
  419. }
  420. }
  421. });
  422. return theArr;
  423. },
  424. setUserContactsList() {
  425. let theOption = [];
  426. $.ajax({
  427. method: "get",
  428. dataType: "json",
  429. crossDomain: false,
  430. url: globalConfig.context + "/api/user/getContacts",
  431. success: function (data) {
  432. if (!data.data) {
  433. if (data.error && data.error.length) {
  434. message.warning(data.error[0].message);
  435. }
  436. return;
  437. }
  438. for (let item in data.data) {
  439. let theData = data.data[item];
  440. theOption.push(
  441. <Select.Option value={item} key={theData}>
  442. {theData}
  443. </Select.Option>
  444. );
  445. }
  446. },
  447. });
  448. return theOption;
  449. },
  450. setAdminContactsList(uid) {
  451. let theOption = [];
  452. $.ajax({
  453. method: "get",
  454. dataType: "json",
  455. crossDomain: false,
  456. url: globalConfig.context + "/api/admin/getContacts",
  457. data: { uid: uid },
  458. success: function (data) {
  459. if (!data.data) {
  460. if (data.error && data.error.length) {
  461. message.warning(data.error[0].message);
  462. }
  463. return;
  464. }
  465. for (let item in data.data) {
  466. let theData = data.data[item];
  467. theOption.push(
  468. <Select.Option value={item} key={theData}>
  469. {theData}
  470. </Select.Option>
  471. );
  472. }
  473. },
  474. });
  475. return theOption;
  476. },
  477. //高企培育资料完成情况(比重)
  478. getProportion(uid, callback) {
  479. $.ajax({
  480. method: "get",
  481. dataType: "json",
  482. crossDomain: false,
  483. url: globalConfig.context + "/api/admin/proportion",
  484. data: { uid: uid },
  485. success: function (data) {
  486. if (!data.data) {
  487. if (data.error && data.error.length) {
  488. message.warning(data.error[0].message);
  489. }
  490. data.data = {};
  491. callback(data.data);
  492. }
  493. callback(data.data);
  494. },
  495. });
  496. },
  497. //保存高企培育资料完成情况
  498. saveProportion(id, uid, sign, status) {
  499. $.ajax({
  500. method: "post",
  501. dataType: "json",
  502. crossDomain: false,
  503. url: globalConfig.context + "/api/admin/confirmProportion",
  504. data: {
  505. id: id,
  506. uid: uid,
  507. sign: sign,
  508. status: status,
  509. },
  510. success: function (data) {
  511. if (!data.data) {
  512. if (data.error && data.error.length) {
  513. message.warning(data.error[0].message);
  514. }
  515. return;
  516. }
  517. },
  518. });
  519. },
  520. //获取window.location.search传的值
  521. getSearchUrl(e) {
  522. let searchURL = e;
  523. let theObj = {};
  524. searchURL = searchURL.substring(1, searchURL.length);
  525. theObj[searchURL.split("&")[0].split("=")[0]] = searchURL
  526. .split("&")[0]
  527. .split("=")[1];
  528. if (searchURL.split("&")[1]) {
  529. theObj[searchURL.split("&")[1].split("=")[0]] = searchURL
  530. .split("&")[1]
  531. .split("=")[1];
  532. if (searchURL.split("&")[2]) {
  533. theObj[searchURL.split("&")[2].split("=")[0]] = searchURL
  534. .split("&")[2]
  535. .split("=")[1];
  536. }
  537. }
  538. return theObj;
  539. },
  540. //预览接口
  541. getPreview(id, url, sign, callback) {
  542. $.ajax({
  543. method: "get",
  544. dataType: "json",
  545. crossDomain: false,
  546. url: globalConfig.context + "/api/admin/preview/" + url,
  547. data: {
  548. id: id,
  549. sign: sign,
  550. },
  551. success: function (data) {
  552. if (!data.data) {
  553. if (data.error && data.error.length) {
  554. message.warning(data.error[0].message);
  555. }
  556. }
  557. callback(
  558. "https://view.officeapps.live.com/op/view.aspx?src=" +
  559. encodeURIComponent(
  560. location.origin +
  561. globalConfig.context +
  562. "/open/preview?" +
  563. data.data
  564. )
  565. );
  566. console.log(
  567. "https://view.officeapps.live.com/op/view.aspx?src=" +
  568. (location.origin +
  569. globalConfig.context +
  570. "/open/preview?" +
  571. data.data)
  572. );
  573. console.log(
  574. "https://view.officeapps.live.com/op/view.aspx?src=" +
  575. encodeURIComponent(
  576. location.origin +
  577. globalConfig.context +
  578. "/open/preview?" +
  579. data.data
  580. )
  581. );
  582. },
  583. });
  584. },
  585. //预览接口
  586. getPreviews(id, url, sign, callback) {
  587. $.ajax({
  588. method: "get",
  589. dataType: "json",
  590. crossDomain: false,
  591. url: globalConfig.context + "/api/admin/customer/" + url,
  592. data: {
  593. id: id,
  594. sign: sign,
  595. },
  596. success: function (data) {
  597. if (!data.data) {
  598. if (data.error && data.error.length) {
  599. message.warning(data.error[0].message);
  600. }
  601. }
  602. callback(
  603. "https://view.officeapps.live.com/op/view.aspx?src=" +
  604. encodeURIComponent(
  605. location.origin +
  606. globalConfig.context +
  607. "/open/preview?" +
  608. data.data
  609. )
  610. );
  611. console.log(
  612. "https://view.officeapps.live.com/op/view.aspx?src=" +
  613. (location.origin +
  614. globalConfig.context +
  615. "/open/preview?" +
  616. data.data)
  617. );
  618. console.log(
  619. "https://view.officeapps.live.com/op/view.aspx?src=" +
  620. encodeURIComponent(
  621. location.origin +
  622. globalConfig.context +
  623. "/open/preview?" +
  624. data.data
  625. )
  626. );
  627. },
  628. });
  629. },
  630. //获取企业规模
  631. getScaleState(e) {
  632. if (e) {
  633. let theType = "";
  634. scaleList.map(function (item) {
  635. if (item.value == e) {
  636. theType = item.key;
  637. }
  638. });
  639. return theType;
  640. }
  641. },
  642. //获取企业类型
  643. getCompanyType(type1, type2) {
  644. let companyTypeList = [];
  645. for (let i = 0; i < companyType.length; i++) {
  646. companyTypeList.push({
  647. value: companyType[i].value,
  648. label: companyType[i].label,
  649. });
  650. if (companyType[i].children) {
  651. for (let j = 0; j < companyType[i].children.length; j++) {
  652. companyTypeList.push({
  653. value: companyType[i].children[j].value,
  654. label: companyType[i].children[j].label,
  655. });
  656. }
  657. }
  658. }
  659. companyTypeList.sort(function (a, b) {
  660. return a.value - b.value;
  661. });
  662. let typeKey = "";
  663. companyTypeList.map(function (item) {
  664. if (type1 == item.value) {
  665. typeKey = item.label;
  666. }
  667. if (type2 == item.value) {
  668. typeKey = typeKey + "/" + item.label;
  669. }
  670. });
  671. return typeKey;
  672. },
  673. //获取企业行业
  674. getIndustryType(e) {
  675. if (e) {
  676. let theType = "";
  677. industryList.map(function (item) {
  678. if (item.value == e) {
  679. theType = item.key;
  680. }
  681. });
  682. return theType;
  683. }
  684. },
  685. //获取合同状态
  686. getContractType: function (e) {
  687. if (e) {
  688. let theType = "";
  689. contractTypeList.map(function (item) {
  690. if (item.value == e) {
  691. theType = item.key;
  692. }
  693. });
  694. return theType;
  695. }
  696. },
  697. //获取合同类型
  698. getContractState: function (e) {
  699. if (e) {
  700. let theType = "";
  701. contractStateList.map(function (item) {
  702. if (item.value == e) {
  703. theType = item.key;
  704. }
  705. });
  706. return theType;
  707. }
  708. },
  709. //获取需求类型
  710. getDemandType: function (e) {
  711. if (e) {
  712. let theType = "";
  713. demandTypeList.map(function (item) {
  714. if (item.value == e) {
  715. theType = item.key;
  716. }
  717. });
  718. return theType;
  719. }
  720. },
  721. //获取成果类型
  722. getAchievementCategory: function (e) {
  723. if (e) {
  724. let theType = "";
  725. achievementCategoryList.map(function (item) {
  726. if (item.value == e) {
  727. theType = item.key;
  728. }
  729. });
  730. return theType;
  731. }
  732. },
  733. //获取需求和成果审核状态
  734. getTechAuditStatus: function (e) {
  735. if (e) {
  736. let theType = "";
  737. techAuditStatusList.map(function (item) {
  738. if (item.value == e) {
  739. theType = item.key;
  740. }
  741. });
  742. return theType;
  743. }
  744. },
  745. //获取政策审核状态
  746. getauditStatus: function (e) {
  747. if (e || e >= 0) {
  748. let tt = e.toString();
  749. let theType = "";
  750. auditStatusLists.map(function (item) {
  751. if (item.value == tt) {
  752. theType = item.key;
  753. }
  754. });
  755. return theType;
  756. }
  757. },
  758. //获取需求和成果审核状态
  759. getMaturity: function (e) {
  760. if (e) {
  761. let theType = "";
  762. maturityList.map(function (item) {
  763. if (item.value == e) {
  764. theType = item.key;
  765. }
  766. });
  767. return theType;
  768. }
  769. },
  770. //获取需求和成果审核状态
  771. getTransferMode: function (e) {
  772. if (e) {
  773. let theType = "";
  774. transferModeList.map(function (item) {
  775. if (item.value == e) {
  776. theType = item.key;
  777. }
  778. });
  779. return theType;
  780. }
  781. },
  782. //获取创新度状态
  783. getInnovation: function (e) {
  784. if (e) {
  785. let theType = "";
  786. innovationList.map(function (item) {
  787. if (item.value == e) {
  788. theType = item.key;
  789. }
  790. });
  791. return theType;
  792. }
  793. },
  794. //获取创新度状态
  795. getOrderStatus: function (e) {
  796. if (e) {
  797. let theType = "";
  798. orderStatusList.map(function (item) {
  799. if (item.value == e) {
  800. theType = item.key;
  801. }
  802. });
  803. return theType;
  804. }
  805. },
  806. //科技管理
  807. //活动圈后台管理
  808. getActivityType: function (e) {
  809. if (e) {
  810. let theType = "";
  811. activityType.map(function (item) {
  812. if (item.value == e) {
  813. theType = item.key;
  814. }
  815. });
  816. return theType;
  817. }
  818. },
  819. getActivityForm: function (e) {
  820. if (e) {
  821. let theType = "";
  822. activityForm.map(function (item) {
  823. if (item.value == e) {
  824. theType = item.key;
  825. }
  826. });
  827. return theType;
  828. }
  829. },
  830. //是否展示在首页
  831. gethot: function (e) {
  832. if (e) {
  833. let theType = "";
  834. hot.map(function (item) {
  835. if (item.value == e) {
  836. theType = item.key;
  837. }
  838. });
  839. return theType;
  840. }
  841. },
  842. //是否精品
  843. getboutique: function (e) {
  844. if (e) {
  845. let theType = "";
  846. boutique.map(function (item) {
  847. if (item.value == e) {
  848. theType = item.key;
  849. }
  850. });
  851. return theType;
  852. }
  853. },
  854. //客户类型
  855. getcustomerTyp: function (e) {
  856. if (e) {
  857. let theType = "";
  858. customerTyp.map(function (item) {
  859. if (item.value == e) {
  860. theType = item.key;
  861. }
  862. });
  863. return theType;
  864. }
  865. },
  866. //省份
  867. getcityArr: function (e) {
  868. if (e) {
  869. let theType = "";
  870. cityArr.map(function (item) {
  871. if (item.value == e) {
  872. theType = item.key;
  873. }
  874. });
  875. return theType;
  876. }
  877. },
  878. //与后端一致省份
  879. getNewDiccityArr: function (e) {
  880. if (e) {
  881. let theType = "";
  882. provinceList.map(function (item) {
  883. if (item.id === e) {
  884. theType = item.name;
  885. }
  886. });
  887. return theType;
  888. }
  889. },
  890. //客户状态
  891. getcustomerStatue: function (e) {
  892. if (e || e == 0) {
  893. let theType = "";
  894. customerStatus.map(function (item) {
  895. if (item.value == e) {
  896. theType = item.key;
  897. }
  898. });
  899. return theType;
  900. }
  901. },
  902. //账户状态
  903. getStatuslist: function (e) {
  904. if (e) {
  905. let theType = "";
  906. statuslist.map(function (item) {
  907. if (item.value == e) {
  908. theType = item.key;
  909. }
  910. });
  911. return theType;
  912. }
  913. },
  914. //意向服务
  915. getCompanyIntention: function (e) {
  916. if (e) {
  917. let theType = "";
  918. intentionalService.map(function (item) {
  919. if (item.value == e) {
  920. theType = item.key;
  921. }
  922. });
  923. return theType;
  924. }
  925. },
  926. //客户标签
  927. getTag: function (e) {
  928. if (e) {
  929. let theType = "";
  930. tag.map(function (item) {
  931. if (item.value == e) {
  932. theType = item.key;
  933. }
  934. });
  935. return theType;
  936. }
  937. },
  938. //最新跟进
  939. getfllowSituation: function (e) {
  940. if (e || e == 0) {
  941. let theType = "";
  942. newFollow.map(function (item) {
  943. if (item.value == e) {
  944. theType = item.key;
  945. }
  946. });
  947. return theType;
  948. }
  949. },
  950. //性别
  951. getsex: function (e) {
  952. if (e) {
  953. let theType = "";
  954. sex.map(function (item) {
  955. if (item.value == e) {
  956. theType = item.key;
  957. }
  958. });
  959. return theType;
  960. }
  961. },
  962. //联系方式
  963. getcontact: function (e) {
  964. if (e) {
  965. let theType = "";
  966. contact.map(function (item) {
  967. if (item.value == e) {
  968. theType = item.key;
  969. }
  970. });
  971. return theType;
  972. }
  973. },
  974. //是否文字与数字转换
  975. getWhether: function (e) {
  976. if (e) {
  977. let theType = "";
  978. Whether.map(function (item) {
  979. if (item.value == e) {
  980. theType = item.key;
  981. }
  982. });
  983. return theType;
  984. }
  985. },
  986. //是否实名认证
  987. getCertification: function (e) {
  988. if (e) {
  989. let theType = "";
  990. Certification.map(function (item) {
  991. if (item.value == e) {
  992. theType = item.key;
  993. }
  994. });
  995. return theType;
  996. }
  997. },
  998. //会员状态
  999. getCurrentMember: function (e) {
  1000. if (e) {
  1001. let theType = "";
  1002. currentMember.map(function (item) {
  1003. if (item.value == e) {
  1004. theType = item.key;
  1005. }
  1006. });
  1007. return theType;
  1008. }
  1009. },
  1010. //会员等级
  1011. getLvl: function (e) {
  1012. if (e) {
  1013. let theType = "";
  1014. lvl.map(function (item) {
  1015. if (item.value == e) {
  1016. theType = item.key;
  1017. }
  1018. });
  1019. return theType;
  1020. }
  1021. },
  1022. //省份转换
  1023. getprovince: function (e) {
  1024. let nub = parseInt(e);
  1025. let theType = "";
  1026. if (nub <= 34) {
  1027. provinceList.map(function (item) {
  1028. if (item.id == nub) {
  1029. theType = item.name;
  1030. }
  1031. });
  1032. }
  1033. if (nub > 34 && nub < 380) {
  1034. provinceList.map(function (item) {
  1035. item.cityList.map(function (city) {
  1036. if (city.id == nub) {
  1037. theType = city.name;
  1038. }
  1039. });
  1040. });
  1041. }
  1042. if (nub >= 380) {
  1043. provinceList.map(function (item) {
  1044. item.cityList.map(function (city) {
  1045. city.areaList.map(function (areas) {
  1046. if (areas.id == nub) {
  1047. theType = areas.name;
  1048. }
  1049. });
  1050. });
  1051. });
  1052. }
  1053. return theType;
  1054. },
  1055. //我的业务跟进状态
  1056. getStatusFollow: function (e) {
  1057. let theType = "";
  1058. if (e) {
  1059. theType = "跟进中";
  1060. } else {
  1061. theType = "停止跟进";
  1062. }
  1063. return theType;
  1064. },
  1065. //我的业务跟进状态
  1066. getContactType: function (e) {
  1067. if (!isNaN(parseInt(e))) {
  1068. let theType = "";
  1069. contactType.map(function (item) {
  1070. if (item.value == e) {
  1071. theType = item.key;
  1072. }
  1073. });
  1074. return theType;
  1075. }
  1076. },
  1077. //社会属性
  1078. getSocialAttribute: function (e) {
  1079. if (!isNaN(parseInt(e))) {
  1080. let theType = "";
  1081. socialAttribute.map(function (item) {
  1082. if (item.value == e) {
  1083. theType = item.key;
  1084. }
  1085. });
  1086. return theType;
  1087. }else{
  1088. return '未知';
  1089. }
  1090. },
  1091. //获取外联分配状态名
  1092. getChannelAllocationStatus: function (e,isTag) {
  1093. if (!isNaN(parseInt(e))) {
  1094. let theType = "";
  1095. let color = "";
  1096. channelAllocationStatus.map(function (item) {
  1097. if (item.value == e) {
  1098. theType = item.key;
  1099. color = item.color;
  1100. }
  1101. });
  1102. if(isTag){
  1103. return <Tag color={color}>{theType}</Tag>
  1104. }else{
  1105. return theType;
  1106. }
  1107. }else{
  1108. if(isTag){
  1109. return <Tag color='#000'>未知</Tag>
  1110. }else{
  1111. return '未知';
  1112. }
  1113. }
  1114. },
  1115. //获取消息提醒状态
  1116. getMessageReminderStart: function (e,isTag) {
  1117. if (!isNaN(parseInt(e))) {
  1118. let theType = "";
  1119. let color = "";
  1120. messageReminderStart.map(function (item) {
  1121. if (item.value == e) {
  1122. theType = item.key;
  1123. color = item.color;
  1124. }
  1125. });
  1126. if(isTag){
  1127. return <Tag color={color}>{theType}</Tag>
  1128. }else{
  1129. return theType;
  1130. }
  1131. }else{
  1132. if(isTag){
  1133. return <Tag color='#000'>未知</Tag>
  1134. }else{
  1135. return '未知';
  1136. }
  1137. }
  1138. },
  1139. //获取分配状态名称
  1140. getTransferType:function (id){
  1141. if (!isNaN(parseInt(id))) {
  1142. let typeName = '';
  1143. transferType.map(function (item) {
  1144. if (item.value == id) {
  1145. typeName = item.label
  1146. }
  1147. });
  1148. return typeName;
  1149. }
  1150. },
  1151. //行业
  1152. getIndustry: function (e) {
  1153. if (e) {
  1154. let theType = "";
  1155. industry.map(function (item) {
  1156. if (item.value == e) {
  1157. theType = item.key;
  1158. }
  1159. });
  1160. return theType;
  1161. }
  1162. },
  1163. //岗位
  1164. getStation: function (e) {
  1165. if (e) {
  1166. let theType = "";
  1167. station.map(function (item) {
  1168. if (item.value == e) {
  1169. theType = item.key;
  1170. }
  1171. });
  1172. return theType;
  1173. }
  1174. },
  1175. //职务
  1176. getPost: function (e) {
  1177. if (e) {
  1178. let theType = "";
  1179. post.map(function (item) {
  1180. if (item.value == e) {
  1181. theType = item.key;
  1182. }
  1183. });
  1184. return theType;
  1185. }
  1186. },
  1187. //组织类型
  1188. getPattern: function (e) {
  1189. if (e) {
  1190. let theType = "";
  1191. patternOrganization.map(function (item) {
  1192. if (item.value == e) {
  1193. theType = item.key;
  1194. }
  1195. });
  1196. return theType;
  1197. }
  1198. },
  1199. //组织状态
  1200. getCondition: function (e) {
  1201. if (e) {
  1202. let theType = "";
  1203. conditionOrganization.map(function (item) {
  1204. if (item.value == e) {
  1205. theType = item.key;
  1206. }
  1207. });
  1208. return theType;
  1209. }
  1210. },
  1211. //品类状态
  1212. getCategoryState: function (e) {
  1213. if (e) {
  1214. let theType = "";
  1215. categoryState.map(function (item) {
  1216. if (item.value == e) {
  1217. theType = item.key;
  1218. }
  1219. });
  1220. return theType;
  1221. }
  1222. },
  1223. //实名认证
  1224. getAuditStatus: function (index) {
  1225. let e = index ? index.toString() : "";
  1226. if (e) {
  1227. let theType = "";
  1228. auditStatusL.map(function (item) {
  1229. if (item.value == e) {
  1230. theType = item.key;
  1231. }
  1232. });
  1233. return theType;
  1234. }
  1235. },
  1236. //品类状态
  1237. getGameState: function (index) {
  1238. let e = index ? index.toString() : "";
  1239. if (e) {
  1240. let theType = "";
  1241. gameState.map(function (item) {
  1242. if (item.value == e) {
  1243. theType = item.key;
  1244. }
  1245. });
  1246. return theType;
  1247. }
  1248. },
  1249. //消息类型
  1250. getMessageType: function (index) {
  1251. let e = index ? index.toString() : "";
  1252. if (e) {
  1253. let theType = "";
  1254. messageType.map(function (item) {
  1255. if (item.value == e) {
  1256. theType = item.key;
  1257. }
  1258. });
  1259. return theType;
  1260. }
  1261. },
  1262. //发送目标
  1263. getDesignated: function (index) {
  1264. let e = index ? index.toString() : "";
  1265. if (e) {
  1266. let theType = "";
  1267. designated.map(function (item) {
  1268. if (item.value == e) {
  1269. theType = item.key;
  1270. }
  1271. });
  1272. return theType;
  1273. }
  1274. },
  1275. //客户端
  1276. getClient: function (index) {
  1277. let e = index ? index.toString() : "";
  1278. if (e) {
  1279. let theType = "";
  1280. client.map(function (item) {
  1281. if (item.value == e) {
  1282. theType = item.key;
  1283. }
  1284. });
  1285. return theType;
  1286. }
  1287. },
  1288. //是否置顶
  1289. getStick: function (index) {
  1290. let e = index ? index.toString() : "";
  1291. if (e) {
  1292. let theType = "";
  1293. stick.map(function (item) {
  1294. if (item.value == e) {
  1295. theType = item.key;
  1296. }
  1297. });
  1298. return theType;
  1299. }
  1300. },
  1301. getFeatured: function (index) {
  1302. let e = index ? index.toString() : "";
  1303. if (e) {
  1304. let theType = "";
  1305. featured.map(function (item) {
  1306. if (item.value == e) {
  1307. theType = item.key;
  1308. }
  1309. });
  1310. return theType;
  1311. }
  1312. },
  1313. getActives: function (e) {
  1314. if (e) {
  1315. let theType = "";
  1316. actives.map(function (item) {
  1317. if (item.value == e) {
  1318. theType = item.key;
  1319. }
  1320. });
  1321. return theType;
  1322. }
  1323. },
  1324. //意向进度
  1325. getIntentProgress: function (e) {
  1326. if (e) {
  1327. let theType = "";
  1328. intentProgress.map(function (item) {
  1329. if (item.value == e) {
  1330. theType = item.key;
  1331. }
  1332. });
  1333. return theType;
  1334. }
  1335. },
  1336. //交易进度
  1337. getTransactionProgress: function (e) {
  1338. if (e) {
  1339. let theType = "";
  1340. transactionProgress.map(function (item) {
  1341. if (item.value == e) {
  1342. theType = item.key;
  1343. }
  1344. });
  1345. return theType;
  1346. }
  1347. },
  1348. //合同进度
  1349. getContractProgress: function (e) {
  1350. debugger
  1351. console.log(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. // approval(0非特批 1待审核 2审核通过) status(0未提交 1处理中 2通过 3拒绝 4撤销)
  1928. getInvoiceStatus: function (e, record) {
  1929. let theType = "";
  1930. if (record) {
  1931. if (record.status === 4) {
  1932. theType = "撤销"
  1933. }
  1934. if (record.approval === 1) {
  1935. theType = "特批审核中"
  1936. if(record.status === 3){
  1937. theType = "特批被拒"
  1938. }
  1939. } else {
  1940. if (record.status === 1) {
  1941. theType = "开票处理中"
  1942. } else if (record.status === 2) {
  1943. theType = "已完成"
  1944. } else if (record.status === 3) {
  1945. theType = "开票被拒"
  1946. }
  1947. }
  1948. } else {
  1949. theType = "-";
  1950. }
  1951. return theType;
  1952. },
  1953. getApprovalA: function (e) {
  1954. if (e || e == 0) {
  1955. let str = e.toString();
  1956. let theType = "";
  1957. approvalA.map(function (item) {
  1958. if (item.value == str) {
  1959. theType = item.key;
  1960. }
  1961. });
  1962. return theType;
  1963. }
  1964. },
  1965. getProcessStatusNew: function (pro, status) {
  1966. // if (e||e==0) {
  1967. // let str=e.toString()
  1968. // let theType = '';
  1969. // processStatusNew.map(function (item) {
  1970. // if (item.value == str) {
  1971. // theType = item.key;
  1972. // };
  1973. // });
  1974. // return theType;
  1975. // }
  1976. let str = "";
  1977. if (pro == 0) {
  1978. str = "营销员";
  1979. } else if (pro == 1) {
  1980. str = "营销管理员";
  1981. } else if (pro == 2) {
  1982. str = "咨询师";
  1983. } else if (pro == 3) {
  1984. str = "咨询师经理";
  1985. } else if (pro == 4) {
  1986. str = "咨询师总监";
  1987. } else if (pro == 5) {
  1988. str = "财务专员";
  1989. } else if (pro == 6) {
  1990. str = "财务总监";
  1991. } else if (pro == 7) {
  1992. str = "总裁";
  1993. } else if (pro == 8) {
  1994. str = "董事长";
  1995. }
  1996. let num = "";
  1997. if (status == 0) {
  1998. num = "发起";
  1999. } else if (status == 1) {
  2000. num = "审核中";
  2001. } else if (status == 2) {
  2002. num = "通过";
  2003. } else if (status == 3) {
  2004. num = "驳回";
  2005. return num + "到" + str;
  2006. } else if (status == 4) {
  2007. num = "完成";
  2008. } else if (status == 5) {
  2009. num = "取消变更";
  2010. }else if(status == 6) {
  2011. num = "待上传附件";
  2012. }
  2013. if (pro == 7 && status == 2) {
  2014. return "订单变更退票中 (财务处理中)";
  2015. } else if (pro == 8 && status == 2) {
  2016. return "订单变更退票中 (财务处理中)";
  2017. } else if (pro >= 7 && status == 4) {
  2018. return "订单变更已完成";
  2019. }else if(pro >= 7 && status == 6) {
  2020. return "待上传附件(营销员处理中)";
  2021. } else {
  2022. return str + num;
  2023. }
  2024. },
  2025. getContractChangeStatus: function (e) {
  2026. if (e || e == 0) {
  2027. let str = e.toString();
  2028. let theType = "";
  2029. contractChangeStatus.map(function (item) {
  2030. if (item.value == str) {
  2031. theType = item.key;
  2032. }
  2033. });
  2034. return theType;
  2035. }
  2036. },
  2037. // 咨询师以及咨询师经理审核内容显示
  2038. shenghePeo(arr, status) {
  2039. debugger
  2040. if (status == 2) {
  2041. arr = arr || [];
  2042. let str = "咨询师(";
  2043. for (let a = 0; a < arr.length; a++) {
  2044. if (arr[a].status == 0) {
  2045. str += arr[a].name + ",";
  2046. }
  2047. }
  2048. str = str.substr(0, str.length - 1);
  2049. return str + ")审核中";
  2050. }
  2051. if (status == 3) {
  2052. arr = arr || [];
  2053. let str = "咨询师经理(";
  2054. for (let a = 0; a < arr.length; a++) {
  2055. if (arr[a].status == 0) {
  2056. str += arr[a].name + ",";
  2057. }
  2058. }
  2059. str = str.substr(0, str.length - 1);
  2060. return str + ")审核中";
  2061. }
  2062. },
  2063. moneyVerify(e) {
  2064. if (!/^\d{1,3}(,?\d{3})*(\.\d{1,6})?$/.test(e)) {
  2065. message.warning("输入金额不符合规范");
  2066. return true;
  2067. }
  2068. },
  2069. // 消息提醒函数接口
  2070. ShowModal(fn) {
  2071. let flag = true;
  2072. $.ajax({
  2073. method: "get",
  2074. dataType: "json",
  2075. crossDomain: false,
  2076. url: globalConfig.context + "/api/admin/notice/unreadCount",
  2077. data: {},
  2078. success: function (data) {
  2079. if (data.data != 0) {
  2080. console.log(data);
  2081. fn.setState({
  2082. showModal: true,
  2083. });
  2084. }
  2085. },
  2086. });
  2087. // return flag
  2088. },
  2089. getType(e) {
  2090. if (e || e == 0) {
  2091. let str = e.toString();
  2092. let theType = "";
  2093. typeList.map(function (item) {
  2094. if (item.value == str) {
  2095. theType = item.key;
  2096. }
  2097. });
  2098. return theType;
  2099. }
  2100. },
  2101. changeColor(e) {
  2102. return (
  2103. <span style={{ color: "red", fontWeight: 900, fontSize: 16 }}>{e}</span>
  2104. );
  2105. },
  2106. getProjectName(e) {
  2107. let arr = projectStatusList.filter(v=>{
  2108. return v.value === e
  2109. });
  2110. if(arr.length){
  2111. return arr[0].label
  2112. }
  2113. return '';
  2114. },
  2115. download(fileName,deleteLv= true) {
  2116. window.open(globalConfig.context +`${'/open/download?fileName='+fileName+'&delete='+deleteLv}`);
  2117. },
  2118. getClockState(id,journal = false) {
  2119. let arr = journal ? clockJournalState.filter(v=>v.id === id) : clockState.filter(v=>v.id === id);
  2120. if(arr.length > 0){
  2121. return arr[0];
  2122. }else{
  2123. return {};
  2124. }
  2125. }
  2126. };