tools.js 50 KB

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