tools.js 51 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252
  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].value == 29 ? <Tag color="#FF0000">{arr[0].label}</Tag> : <span>{arr[0].label}</span>
  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 == 6 || e == 7 || !name) {
  1839. theName = ""
  1840. } else if (e == 4) {
  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 == 8 || pro == 9) {
  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. } else if (pro == 9) {
  2048. str = "董事长";
  2049. }
  2050. let num = "";
  2051. if (status == 0) {
  2052. num = "发起";
  2053. } else if (status == 1) {
  2054. num = "审核中";
  2055. } else if (status == 2) {
  2056. num = "通过";
  2057. } else if (status == 3) {
  2058. num = "驳回";
  2059. return num + "到" + str + names;
  2060. }
  2061. // else if (status == 4) {
  2062. // num = "完成";
  2063. // }
  2064. else if (status == 5) {
  2065. num = "取消变更";
  2066. } else if (status == 6) {
  2067. num = "待上传附件";
  2068. }
  2069. if (pro == 8 && status == 2) {
  2070. return `订单变更退票中 (${name}处理中)`;
  2071. } else if (pro == 9 && status == 2) {
  2072. return `订单变更退票中 (${name}处理中)`;
  2073. } else if (status == 4) {
  2074. return "订单变更已完成";
  2075. } else if (pro >= 8 && status == 6) {
  2076. return "待上传附件(营销员处理中)";
  2077. } else {
  2078. return str + names + num;
  2079. }
  2080. },
  2081. getContractChangeStatus: function (e) {
  2082. if (e || e == 0) {
  2083. let str = e.toString();
  2084. let theType = "";
  2085. contractChangeStatus.map(function (item) {
  2086. if (item.value == str) {
  2087. theType = item.key;
  2088. }
  2089. });
  2090. return theType;
  2091. }
  2092. },
  2093. // 咨询师以及咨询师经理审核内容显示
  2094. shenghePeo(name, status) {
  2095. if (status == 3) {
  2096. let str = "咨询师(";
  2097. str = str + name;
  2098. return str + ")审核中";
  2099. } else if (status == 4) {
  2100. let str = "咨询师经理(";
  2101. str = str + name;
  2102. return str + ")审核中";
  2103. }
  2104. },
  2105. moneyVerify(e) {
  2106. if (!/^\d{1,3}(,?\d{3})*(\.\d{1,6})?$/.test(e)) {
  2107. message.warning("输入金额不符合规范");
  2108. return true;
  2109. }
  2110. },
  2111. // 消息提醒函数接口
  2112. ShowModal(fn) {
  2113. let flag = true;
  2114. $.ajax({
  2115. method: "get",
  2116. dataType: "json",
  2117. crossDomain: false,
  2118. url: globalConfig.context + "/api/admin/notice/unreadCount",
  2119. data: {},
  2120. success: function (data) {
  2121. if (data.data != 0) {
  2122. // console.log(data);
  2123. fn.setState({
  2124. showModal: true,
  2125. });
  2126. }
  2127. },
  2128. });
  2129. // return flag
  2130. },
  2131. getType(e) {
  2132. if (e || e == 0) {
  2133. let str = e.toString();
  2134. let theType = "";
  2135. typeList.map(function (item) {
  2136. if (item.value == str) {
  2137. theType = item.key;
  2138. }
  2139. });
  2140. return theType;
  2141. }
  2142. },
  2143. changeColor(e) {
  2144. return (
  2145. <span style={{ color: "red", fontWeight: 900, fontSize: 16 }}>{e}</span>
  2146. );
  2147. },
  2148. getProjectName(e) {
  2149. let arr = projectStatusList.filter(v => {
  2150. return v.value === e
  2151. });
  2152. if (arr.length) {
  2153. return arr[0].value == 29 ? <Tag color="#FF0000">{arr[0].label}</Tag> : <span>{arr[0].label}</span>
  2154. }
  2155. return '';
  2156. },
  2157. download(fileName, deleteLv = true) {
  2158. window.open(globalConfig.context + `${'/open/download?fileName=' + fileName + '&delete=' + deleteLv}`);
  2159. },
  2160. getClockState(id, journal = false) {
  2161. let arr = journal ? clockJournalState.filter(v => v.id === id) : clockState.filter(v => v.id === id);
  2162. if (arr.length > 0) {
  2163. return arr[0];
  2164. } else {
  2165. return {};
  2166. }
  2167. },
  2168. // 处理级别层数
  2169. getBarLevel: function (val) {
  2170. let arr = []
  2171. if (!val) {
  2172. arr = ["", "", "", "", ""]
  2173. } else {
  2174. arr = val.split(',')
  2175. }
  2176. let leg = 5 - arr.length
  2177. if (arr.length < 5) {
  2178. for (var i = 0; i < leg; i++) {
  2179. arr.push("")
  2180. }
  2181. }
  2182. return arr
  2183. },
  2184. // 树状数据处理 num需要显示的最低lvl从0开始 默认全部显示
  2185. newTreeData(treeData, num = 6) {
  2186. let newData = [];
  2187. treeData.map(item => {
  2188. let treeObj = item;
  2189. treeObj.children = (item.children && item.lvl < num) ? obj.newTreeData(item.children, num) : [];
  2190. newData.push(treeObj)
  2191. })
  2192. return newData
  2193. },
  2194. // 获取巴权限
  2195. getRole: function (e) {
  2196. if (e || e == 0) {
  2197. let arr = e.split(',')
  2198. let theType = [];
  2199. for (var i = 0; i < roleList.length; i++) {
  2200. for (var j = 0; j < arr.length; j++) {
  2201. if (roleList[i].value == arr[j]) {
  2202. theType.push(roleList[i].key)
  2203. }
  2204. }
  2205. }
  2206. return theType.toString();
  2207. }
  2208. },
  2209. // 项目状态
  2210. // 项目暂停类型 0暂停 1重启
  2211. // 项目暂停状态 0发起 1通过 2拒绝
  2212. getStopStatus(type, status) {
  2213. let str = ""
  2214. str = type == 0 ? "暂停" : "重启"
  2215. if (status == 0) {
  2216. return <span>{"项目" + str + "待审核"}</span>
  2217. } else if (status == 1) {
  2218. return <span style={{ color: "green" }}>{"项目已" + str}</span>
  2219. } else if (status == 2) {
  2220. return <span style={{ color: "red" }}>{"项目" + str + "拒绝"}</span>
  2221. }
  2222. },
  2223. //
  2224. stopStatus(type, status) {
  2225. if (type == 0) {
  2226. if (status == 0) {
  2227. return <span style={{ color: "red" }}>暂停待审核</span>
  2228. } else if (status == 1) {
  2229. return <span style={{ color: "red" }}>项目已暂停,需重启</span>
  2230. } else if (status == 2) {
  2231. return <span style={{ color: "red" }}>暂停被驳回,重新申请暂停</span>
  2232. }
  2233. } else if (type == 1) {
  2234. if (status == 0) {
  2235. return <span style={{ color: "red" }}>重启待审核</span>
  2236. } else if (status == 1) {
  2237. return <span style={{ color: "red" }}>项目已重启</span>
  2238. } else if (status == 2) {
  2239. return <span style={{ color: "red" }}>重启被驳回,重新申请重启</span>
  2240. }
  2241. }
  2242. },
  2243. };
  2244. module.exports = obj