tools.js 48 KB

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