tools.js 51 KB

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