tools.js 49 KB

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