tools.js 58 KB

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