tools.js 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107
  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. if (e) {
  1351. let theType = "";
  1352. contractProgress.map(function (item) {
  1353. if (item.value == e) {
  1354. theType = item.key;
  1355. }
  1356. });
  1357. return theType;
  1358. }
  1359. },
  1360. //项目进度
  1361. getProjectProgress: function (e) {
  1362. if (e) {
  1363. let theType = "";
  1364. projectProgress.map(function (item) {
  1365. if (item.value == e) {
  1366. theType = item.key;
  1367. }
  1368. });
  1369. return theType;
  1370. }
  1371. },
  1372. //订单类型
  1373. getOrderType: function (e) {
  1374. if (e || e == 0) {
  1375. let str = e.toString();
  1376. let theType = "";
  1377. orderType.map(function (item) {
  1378. if (item.value == str) {
  1379. theType = item.key;
  1380. }
  1381. });
  1382. return theType;
  1383. }
  1384. },
  1385. //订单阶段
  1386. getOrderStage: function (e) {
  1387. if (e || e == 0) {
  1388. let str = e.toString();
  1389. let theType = "";
  1390. orderStage.map(function (item) {
  1391. if (item.value == str) {
  1392. theType = item.key;
  1393. }
  1394. });
  1395. return theType;
  1396. }
  1397. },
  1398. //订单状态o
  1399. getOrderState: function (e) {
  1400. if (e || e == 0) {
  1401. let str = e.toString();
  1402. let theType = "";
  1403. orderState.map(function (item) {
  1404. if (item.value == str) {
  1405. theType = item.key;
  1406. }
  1407. });
  1408. return theType;
  1409. }
  1410. },
  1411. //付款状态
  1412. getPaymentState: function (e) {
  1413. if (e || e == 0) {
  1414. let str = e.toString();
  1415. let theType = "";
  1416. paymentState.map(function (item) {
  1417. if (item.value == str) {
  1418. theType = item.key;
  1419. }
  1420. });
  1421. return theType;
  1422. }
  1423. },
  1424. //订单渠道
  1425. getOrderChannel: function (e) {
  1426. if (e || e == 0) {
  1427. let str = e.toString();
  1428. let theType = "";
  1429. orderChannel.map(function (item) {
  1430. if (item.value == str) {
  1431. theType = item.key;
  1432. }
  1433. });
  1434. return theType;
  1435. }
  1436. },
  1437. //特批状态
  1438. getApprovedState: function (e) {
  1439. if (e || e == 0) {
  1440. let str = e.toString();
  1441. let theType = "";
  1442. approvedState.map(function (item) {
  1443. if (item.value == str) {
  1444. theType = item.key;
  1445. }
  1446. });
  1447. return theType;
  1448. }
  1449. },
  1450. //锁定或废除
  1451. getLock: function (e) {
  1452. if (e || e == 0) {
  1453. let str = e.toString();
  1454. let theType = "";
  1455. lock.map(function (item) {
  1456. if (item.value == str) {
  1457. theType = item.key;
  1458. }
  1459. });
  1460. return theType;
  1461. }
  1462. },
  1463. //支付方式
  1464. getPaymentMethod: function (e) {
  1465. if (e || e == 0) {
  1466. let str = e.toString();
  1467. let theType = "";
  1468. paymentMethod.map(function (item) {
  1469. if (item.value == str) {
  1470. theType = item.key;
  1471. }
  1472. });
  1473. return theType;
  1474. }
  1475. },
  1476. //交易渠道
  1477. getTransactionChannel: function (e) {
  1478. if (e || e == 0) {
  1479. let str = e.toString();
  1480. let theType = "";
  1481. transactionChannel.map(function (item) {
  1482. if (item.value == str) {
  1483. theType = item.key;
  1484. }
  1485. });
  1486. return theType;
  1487. }
  1488. },
  1489. //交易科目
  1490. getTransactionProject: function (e) {
  1491. if (e || e == 0) {
  1492. let str = e.toString();
  1493. let theType = "";
  1494. transactionProject.map(function (item) {
  1495. if (item.value == str) {
  1496. theType = item.key;
  1497. }
  1498. });
  1499. return theType;
  1500. }
  1501. },
  1502. //项目状态
  1503. getProjectState: function (e) {
  1504. if (e || e == 0) {
  1505. let str = e.toString();
  1506. let theType = "";
  1507. projectState.map(function (item) {
  1508. if (item.value == str) {
  1509. theType = item.key;
  1510. }
  1511. });
  1512. return theType;
  1513. }
  1514. },
  1515. //任务状态
  1516. getTaskStatus: function (e) {
  1517. if (e || e == 0) {
  1518. let str = e.toString();
  1519. let theType = "";
  1520. taskStatus.map(function (item) {
  1521. if (item.value == str) {
  1522. theType = item.key;
  1523. }
  1524. });
  1525. return theType;
  1526. }
  1527. },
  1528. //公示状态
  1529. getPublishStatus: function (e) {
  1530. if (e || e == 0) {
  1531. let str = e.toString();
  1532. let theType = "";
  1533. publishStatus.map(function (item) {
  1534. if (item.value == str) {
  1535. theType = item.key;
  1536. }
  1537. });
  1538. return theType;
  1539. }
  1540. },
  1541. //变更状态
  1542. getChangeState: function (e) {
  1543. if (e || e == 0) {
  1544. let str = e.toString();
  1545. let theType = "";
  1546. changeState.map(function (item) {
  1547. if (item.value == str) {
  1548. theType = item.key;
  1549. }
  1550. });
  1551. return theType;
  1552. }
  1553. },
  1554. //分派情况
  1555. getDistributeState: function (e) {
  1556. if (e || e == 0) {
  1557. let str = e.toString();
  1558. let theType = "";
  1559. distributeState.map(function (item) {
  1560. if (item.value == str) {
  1561. theType = item.key;
  1562. }
  1563. });
  1564. return theType;
  1565. }
  1566. },
  1567. //客户来源
  1568. getCustomerSource: function (e) {
  1569. if (e || e == 0) {
  1570. let str = e.toString();
  1571. let theType = "";
  1572. customerSource.map(function (item) {
  1573. if (item.value == str) {
  1574. theType = item.key;
  1575. }
  1576. });
  1577. return theType;
  1578. }
  1579. },
  1580. //客户来源
  1581. getSlcRedit: function (e) {
  1582. if (e || e == 0) {
  1583. let str = e.toString();
  1584. let theType = "";
  1585. slcRedit.map(function (item) {
  1586. if (item.value == str) {
  1587. theType = item.key;
  1588. }
  1589. });
  1590. return theType;
  1591. }
  1592. },
  1593. //客户来源
  1594. getDataGrade: function (e) {
  1595. if (e || e == 0) {
  1596. let str = e.toString();
  1597. let theType = "";
  1598. dataGrade.map(function (item) {
  1599. if (item.value == str) {
  1600. theType = item.key;
  1601. }
  1602. });
  1603. return theType;
  1604. }
  1605. },
  1606. //客户等级
  1607. getLevel: function (e) {
  1608. if (e || e == 0) {
  1609. let str = e.toString();
  1610. let theType = "";
  1611. level.map(function (item) {
  1612. if (item.value == str) {
  1613. theType = item.key;
  1614. }
  1615. });
  1616. return theType;
  1617. }
  1618. },
  1619. //项目状态
  1620. getXiangmoState: function (e) {
  1621. if (e || e == 0) {
  1622. let str = e.toString();
  1623. let theType = "";
  1624. xiangmoState.map(function (item) {
  1625. if (item.value == str) {
  1626. theType = item.key;
  1627. }
  1628. });
  1629. return theType;
  1630. }
  1631. },
  1632. //订单状态
  1633. getNewOrderStatus: function (e) {
  1634. if (e || e == 0) {
  1635. let str = e.toString();
  1636. let theType = "";
  1637. newOrderStatus.map(function (item) {
  1638. if (item.value == str) {
  1639. theType = item.key;
  1640. }
  1641. });
  1642. return theType;
  1643. }
  1644. },
  1645. //催款状态
  1646. getCuikuan: function (e) {
  1647. if (e || e == 0) {
  1648. let str = e.toString();
  1649. let theType = "";
  1650. cuikuan.map(function (item) {
  1651. if (item.value == str) {
  1652. theType = item.key;
  1653. }
  1654. });
  1655. return theType;
  1656. }
  1657. },
  1658. //分配状态
  1659. // getAllotStatus:function (e) {
  1660. // if (e||e==0) {
  1661. // let str=e.toString()
  1662. // let theType = '';
  1663. // processStatus.map(function (item) {
  1664. // if (item.value == str) {
  1665. // theType = item.key;
  1666. // };
  1667. // });
  1668. // return theType;
  1669. // }
  1670. // },
  1671. //退单状态
  1672. getRefundStatus: function (e) {
  1673. if (e || e == 0) {
  1674. let str = e.toString();
  1675. let theType = "";
  1676. refundStatus.map(function (item) {
  1677. if (item.value == str) {
  1678. theType = item.key;
  1679. }
  1680. });
  1681. return theType;
  1682. }
  1683. },
  1684. //退单状态
  1685. getTaskStatus: function (e) {
  1686. if (e || e == 0) {
  1687. let str = e.toString();
  1688. let theType = "";
  1689. taskStatus.map(function (item) {
  1690. if (item.value == str) {
  1691. theType = item.key;
  1692. }
  1693. });
  1694. return theType;
  1695. }
  1696. },
  1697. //特批状态
  1698. getApproval: function (e, flag) {
  1699. if (flag) {
  1700. if (e == 0) {
  1701. return "非特批";
  1702. } else if (e == 1) {
  1703. return "特批待审核";
  1704. } else if (e == 2) {
  1705. return "特批通过";
  1706. } else if (e == 3) {
  1707. return "特批驳回";
  1708. } else {
  1709. return "未知";
  1710. }
  1711. }
  1712. if (e || e == 0) {
  1713. let str = e.toString();
  1714. let theType = "";
  1715. approval.map(function (item) {
  1716. if (item.value == str) {
  1717. theType = item.key;
  1718. }
  1719. });
  1720. return theType;
  1721. }
  1722. },
  1723. //流程状态
  1724. getPeople: function (val) {
  1725. if (val == 0) {
  1726. return "已派营销员";
  1727. } else if (val == 1) {
  1728. return "已派营销管理员";
  1729. } else if (val == 2) {
  1730. return "已派咨询师";
  1731. } else if (val == 3) {
  1732. return "已派咨询师经理";
  1733. } else if (val == 4) {
  1734. return "已派咨询师管理员";
  1735. } else if (val == 5) {
  1736. return "已派财务专员";
  1737. } else if (val == 6) {
  1738. return "已派财务总监";
  1739. }
  1740. },
  1741. //第三方信息状态----是否有材料
  1742. getMaterialStatus: function (val) {
  1743. if (val == 0) {
  1744. return "无材料";
  1745. } else if (val == 1) {
  1746. return "有材料";
  1747. }
  1748. },
  1749. //第三方信息状态----加急
  1750. getUrgentStatus: function (val) {
  1751. if (val == 0) {
  1752. return "无加急";
  1753. } else if (val == 1) {
  1754. return "加急3-5个工作日";
  1755. } else if (val == 2) {
  1756. return "加急6-10个工作日";
  1757. } else if (val == 3) {
  1758. return "加急11-15个工作日";
  1759. } else if (val == 4) {
  1760. return "加急16-20个工作日";
  1761. } else if (val == 5) {
  1762. return "加急21-25个工作日";
  1763. } else if (val == 6) {
  1764. return "加急26-30个工作日";
  1765. }
  1766. },
  1767. //审核状态
  1768. getStatus: function (val) {
  1769. if (val == 0) {
  1770. return "未提交";
  1771. } else if (val == 1) {
  1772. return "处理中";
  1773. } else if (val == 2) {
  1774. return "通过";
  1775. } else if (val == 3) {
  1776. return "拒绝";
  1777. } else if (val == 4) {
  1778. return "撤销";
  1779. }
  1780. },
  1781. //项目状态
  1782. getProjectStatus: function (e) {
  1783. let arr = projectStatusList.filter(v=>{
  1784. return v.value === e
  1785. });
  1786. if(arr.length){
  1787. return arr[0].label
  1788. }
  1789. return '';
  1790. },
  1791. //流程状态
  1792. getProcessStatus: function (e) {
  1793. if (e || e == 0) {
  1794. let str = e.toString();
  1795. let theType = "";
  1796. processStatus.map(function (item) {
  1797. if (item.value == str) {
  1798. theType = item.key;
  1799. }
  1800. });
  1801. return theType;
  1802. }
  1803. },
  1804. //结算状态
  1805. getLiquidationStatus: function (e) {
  1806. if (e || e == 0) {
  1807. let str = e.toString();
  1808. let theType = "";
  1809. liquidationStatus.map(function (item) {
  1810. if (item.value == str) {
  1811. theType = item.key;
  1812. }
  1813. });
  1814. return theType;
  1815. }
  1816. }, //
  1817. //新项目类型
  1818. getNewOrderType: function (e) {
  1819. if (e || e == 0) {
  1820. let str = e.toString();
  1821. let theType = "";
  1822. newOrderType.map(function (item) {
  1823. if (item.value == str) {
  1824. theType = item.key;
  1825. }
  1826. });
  1827. return theType;
  1828. }
  1829. },
  1830. //技术员发款类型
  1831. getJsyPaymentType: function (e) {
  1832. if (e || e == 0) {
  1833. let str = e.toString();
  1834. let theType = "";
  1835. jsyPaymentType.map(function (item) {
  1836. if (item.value == str) {
  1837. theType = item.key;
  1838. }
  1839. });
  1840. return theType;
  1841. } //
  1842. },
  1843. //奖金发放状态
  1844. getBonusState: function (e) {
  1845. if (e || e == 0) {
  1846. let str = e.toString();
  1847. let theType = "";
  1848. bonusState.map(function (item) {
  1849. if (item.value == str) {
  1850. theType = item.key;
  1851. }
  1852. });
  1853. return theType;
  1854. }
  1855. },
  1856. //技术员发款类型
  1857. getCustomerType: function (e) {
  1858. if (e || e == 0) {
  1859. let str = e.toString();
  1860. let theType = "";
  1861. customerType.map(function (item) {
  1862. if (item.value == str) {
  1863. theType = item.key;
  1864. }
  1865. });
  1866. return theType;
  1867. }
  1868. },
  1869. //技术员发款类型
  1870. getOrderTypes: function (e) {
  1871. if (e || e == 0) {
  1872. let str = e.toString();
  1873. let theType = "";
  1874. orderTypes.map(function (item) {
  1875. if (item.value == str) {
  1876. theType = item.key;
  1877. }
  1878. });
  1879. return theType;
  1880. }
  1881. },
  1882. //技术员发款类型
  1883. getjiedian: function (e) {
  1884. if (e || e == 0) {
  1885. let str = e.toString();
  1886. let theType = "";
  1887. jiedian.map(function (item) {
  1888. if (item.value == str) {
  1889. theType = item.key;
  1890. }
  1891. });
  1892. return theType;
  1893. }
  1894. },
  1895. //省内外
  1896. getProvinceA: function (e) {
  1897. if (e || e == 0) {
  1898. let str = e.toString();
  1899. let theType = "";
  1900. province.map(function (item) {
  1901. if (item.value == str) {
  1902. theType = item.key;
  1903. }
  1904. });
  1905. return theType;
  1906. }
  1907. },
  1908. //开票状态
  1909. getInvoiceStatus: function (e, record) {
  1910. if (record && record.approval == 1) {
  1911. return "特批待审核";
  1912. } else {
  1913. if (e || e == 0) {
  1914. let str = e.toString();
  1915. let theType = "";
  1916. invoiceStatus.map(function (item) {
  1917. if (item.value == str) {
  1918. theType = item.key;
  1919. }
  1920. });
  1921. return theType;
  1922. }
  1923. }
  1924. },
  1925. getApprovalA: function (e) {
  1926. if (e || e == 0) {
  1927. let str = e.toString();
  1928. let theType = "";
  1929. approvalA.map(function (item) {
  1930. if (item.value == str) {
  1931. theType = item.key;
  1932. }
  1933. });
  1934. return theType;
  1935. }
  1936. },
  1937. getProcessStatusNew: function (pro, status) {
  1938. // if (e||e==0) {
  1939. // let str=e.toString()
  1940. // let theType = '';
  1941. // processStatusNew.map(function (item) {
  1942. // if (item.value == str) {
  1943. // theType = item.key;
  1944. // };
  1945. // });
  1946. // return theType;
  1947. // }
  1948. let str = "";
  1949. if (pro == 0) {
  1950. str = "营销员";
  1951. } else if (pro == 1) {
  1952. str = "营销管理员";
  1953. } else if (pro == 2) {
  1954. str = "咨询师";
  1955. } else if (pro == 3) {
  1956. str = "咨询师经理";
  1957. } else if (pro == 4) {
  1958. str = "咨询师总监";
  1959. } else if (pro == 5) {
  1960. str = "财务专员";
  1961. } else if (pro == 6) {
  1962. str = "财务总监";
  1963. } else if (pro == 7) {
  1964. str = "总裁";
  1965. } else if (pro == 8) {
  1966. str = "董事长";
  1967. }
  1968. let num = "";
  1969. if (status == 0) {
  1970. num = "发起";
  1971. } else if (status == 1) {
  1972. num = "审核中";
  1973. } else if (status == 2) {
  1974. num = "通过";
  1975. } else if (status == 3) {
  1976. num = "驳回";
  1977. return num + "到" + str;
  1978. } else if (status == 4) {
  1979. num = "完成";
  1980. } else if (status == 5) {
  1981. num = "取消变更";
  1982. }
  1983. if (pro == 7 && status == 2) {
  1984. return "订单变更退票中 (财务处理中)";
  1985. } else if (pro == 8 && status == 2) {
  1986. return "订单变更退票中 (财务处理中)";
  1987. } else if (pro >= 7 && status == 4) {
  1988. return "订单变更已完成";
  1989. } else {
  1990. return str + num;
  1991. }
  1992. },
  1993. getContractChangeStatus: function (e) {
  1994. if (e || e == 0) {
  1995. let str = e.toString();
  1996. let theType = "";
  1997. contractChangeStatus.map(function (item) {
  1998. if (item.value == str) {
  1999. theType = item.key;
  2000. }
  2001. });
  2002. return theType;
  2003. }
  2004. },
  2005. // 咨询师以及咨询师经理审核内容显示
  2006. shenghePeo(arr, status) {
  2007. if (status == 2) {
  2008. arr = arr || [];
  2009. let str = "咨询师(";
  2010. for (let a = 0; a < arr.length; a++) {
  2011. if (arr[a].status == 0) {
  2012. str += arr[a].name + ",";
  2013. }
  2014. }
  2015. str = str.substr(0, str.length - 1);
  2016. return str + ")审核中";
  2017. }
  2018. if (status == 3) {
  2019. arr = arr || [];
  2020. let str = "咨询师经理(";
  2021. for (let a = 0; a < arr.length; a++) {
  2022. if (arr[a].status == 0) {
  2023. str += arr[a].name + ",";
  2024. }
  2025. }
  2026. str = str.substr(0, str.length - 1);
  2027. return str + ")审核中";
  2028. }
  2029. },
  2030. moneyVerify(e) {
  2031. if (!/^\d{1,3}(,?\d{3})*(\.\d{1,6})?$/.test(e)) {
  2032. message.warning("输入金额不符合规范");
  2033. return true;
  2034. }
  2035. },
  2036. // 消息提醒函数接口
  2037. ShowModal(fn) {
  2038. let flag = true;
  2039. $.ajax({
  2040. method: "get",
  2041. dataType: "json",
  2042. crossDomain: false,
  2043. url: globalConfig.context + "/api/admin/notice/unreadCount",
  2044. data: {},
  2045. success: function (data) {
  2046. if (data.data != 0) {
  2047. console.log(data);
  2048. fn.setState({
  2049. showModal: true,
  2050. });
  2051. }
  2052. },
  2053. });
  2054. // return flag
  2055. },
  2056. getType(e) {
  2057. if (e || e == 0) {
  2058. let str = e.toString();
  2059. let theType = "";
  2060. typeList.map(function (item) {
  2061. if (item.value == str) {
  2062. theType = item.key;
  2063. }
  2064. });
  2065. return theType;
  2066. }
  2067. },
  2068. changeColor(e) {
  2069. return (
  2070. <span style={{ color: "red", fontWeight: 900, fontSize: 16 }}>{e}</span>
  2071. );
  2072. },
  2073. getProjectName(e) {
  2074. let arr = projectStatusList.filter(v=>{
  2075. return v.value === e
  2076. });
  2077. if(arr.length){
  2078. return arr[0].label
  2079. }
  2080. return '';
  2081. },
  2082. download(fileName,deleteLv= true) {
  2083. window.open(globalConfig.context +`${'/open/download?fileName='+fileName+'&delete='+deleteLv}`);
  2084. },
  2085. getClockState(id,journal = false) {
  2086. let arr = journal ? clockJournalState.filter(v=>v.id === id) : clockState.filter(v=>v.id === id);
  2087. if(arr.length > 0){
  2088. return arr[0];
  2089. }else{
  2090. return {};
  2091. }
  2092. }
  2093. };