tools.js 54 KB

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