tools.js 57 KB

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