tools.js 58 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482
  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 || e == 0) {
  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. } else if (val == 8) {
  1836. return "加急60个工作日";
  1837. }
  1838. },
  1839. //审核状态
  1840. getStatus: function (val) {
  1841. if (val == 0) {
  1842. return "未提交";
  1843. } else if (val == 1) {
  1844. return "处理中";
  1845. } else if (val == 2) {
  1846. return "通过";
  1847. } else if (val == 3) {
  1848. return "拒绝";
  1849. } else if (val == 4) {
  1850. return "撤销";
  1851. }
  1852. },
  1853. //项目状态
  1854. getProjectStatus: function (e) {
  1855. let arr = projectStatusList.filter(v => {
  1856. return v.value === e
  1857. });
  1858. if (arr.length) {
  1859. return arr[0].value == 29 ? <Tag color="#FF0000">{arr[0].label}</Tag> : <span>{arr[0].label}</span>
  1860. }
  1861. return '';
  1862. },
  1863. //流程状态
  1864. getProcessStatus: function (e, name, state) {
  1865. if (e || e == 0) {
  1866. let str = e.toString();
  1867. let theType = "";
  1868. let theName = "(" + name + ")"
  1869. processStatus.map(function (item) {
  1870. if (item.value == str) {
  1871. theType = item.key;
  1872. }
  1873. });
  1874. if (e == 0 || e == 6 || e == 7 || !name) {
  1875. theName = ""
  1876. } else if (e == 4) {
  1877. // if (state == "1" || state == "2" || state == "3") {
  1878. // theName = "(公司/部门管理)"
  1879. // } else
  1880. if (state == "4" || state == "5" || state == "6") {
  1881. theName = "(董事长)"
  1882. }
  1883. // else if (state == "7" || state == "8" || state == "9") {
  1884. // theName = "(副总裁)"
  1885. // }
  1886. }
  1887. return theType + theName;
  1888. }
  1889. },
  1890. //结算状态
  1891. getLiquidationStatus: function (e) {
  1892. if (e || e == 0) {
  1893. let str = e.toString();
  1894. let theType = "";
  1895. liquidationStatus.map(function (item) {
  1896. if (item.value == str) {
  1897. theType = item.key;
  1898. }
  1899. });
  1900. return theType;
  1901. }
  1902. },
  1903. //新项目类型
  1904. getNewOrderType: function (e) {
  1905. if (e || e == 0) {
  1906. let str = e.toString();
  1907. let theType = "";
  1908. newOrderType.map(function (item) {
  1909. if (item.value == str) {
  1910. theType = item.key;
  1911. }
  1912. });
  1913. return theType;
  1914. }
  1915. },
  1916. //技术员发款类型
  1917. getJsyPaymentType: function (e) {
  1918. if (e || e == 0) {
  1919. let str = e.toString();
  1920. let theType = "";
  1921. jsyPaymentType.map(function (item) {
  1922. if (item.value == str) {
  1923. theType = item.key;
  1924. }
  1925. });
  1926. return theType;
  1927. }
  1928. },
  1929. //奖金发放状态
  1930. getBonusState: function (e) {
  1931. if (e || e == 0) {
  1932. let str = e.toString();
  1933. let theType = "";
  1934. bonusState.map(function (item) {
  1935. if (item.value == str) {
  1936. theType = item.key;
  1937. }
  1938. });
  1939. return theType;
  1940. }
  1941. },
  1942. //技术员发款类型
  1943. getCustomerType: function (e) {
  1944. if (e || e == 0) {
  1945. let str = e.toString();
  1946. let theType = "";
  1947. customerType.map(function (item) {
  1948. if (item.value == str) {
  1949. theType = item.key;
  1950. }
  1951. });
  1952. return theType;
  1953. }
  1954. },
  1955. //技术员发款类型
  1956. getOrderTypes: function (e) {
  1957. if (e || e == 0) {
  1958. let str = e.toString();
  1959. let theType = "";
  1960. orderTypes.map(function (item) {
  1961. if (item.value == str) {
  1962. theType = item.key;
  1963. }
  1964. });
  1965. return theType;
  1966. }
  1967. },
  1968. //技术员发款类型
  1969. getjiedian: function (e) {
  1970. if (e || e == 0) {
  1971. let str = e.toString();
  1972. let theType = "";
  1973. jiedian.map(function (item) {
  1974. if (item.value == str) {
  1975. theType = item.key;
  1976. }
  1977. });
  1978. return theType;
  1979. }
  1980. },
  1981. //省内外
  1982. getProvinceA: function (e) {
  1983. if (e || e == 0) {
  1984. let str = e.toString();
  1985. let theType = "";
  1986. province.map(function (item) {
  1987. if (item.value == str) {
  1988. theType = item.key;
  1989. }
  1990. });
  1991. return theType;
  1992. }
  1993. },
  1994. //开票状态
  1995. // getInvoiceStatus: function (e, record) {
  1996. // if (record && record.approval == 1) {
  1997. // return "特批待审核";
  1998. // } else {
  1999. // if (e || e == 0) {
  2000. // let str = e.toString();
  2001. // let theType = "";
  2002. // invoiceStatus.map(function (item) {
  2003. // if (item.value == str) {
  2004. // theType = item.key;
  2005. // }
  2006. // });
  2007. // return theType;
  2008. // }
  2009. // }
  2010. // },
  2011. // approval(0非特批 1待审核 2审核通过) status(0未提交 1处理中 2通过 3拒绝 4撤销)
  2012. getInvoiceStatus: function (e, record) {
  2013. let theType = "";
  2014. let name = "(" + record.examineName + ")"
  2015. if (!record.examineName) {
  2016. name = ""
  2017. }
  2018. if (record) {
  2019. if (record.status === 4) {
  2020. theType = "撤销"
  2021. }
  2022. if (record.approval === 1) {
  2023. theType = "特批审核中"
  2024. if (record.status === 3) {
  2025. theType = "特批被拒"
  2026. }
  2027. } else {
  2028. if (record.status === 1) {
  2029. theType = "开票处理中"
  2030. } else if (record.status === 2) {
  2031. theType = "已完成"
  2032. } else if (record.status === 3) {
  2033. theType = "开票被拒"
  2034. }
  2035. }
  2036. } else {
  2037. theType = "";
  2038. }
  2039. return theType + name;
  2040. },
  2041. getApprovalA: function (e) {
  2042. if (e || e == 0) {
  2043. let str = e.toString();
  2044. let theType = "";
  2045. approvalA.map(function (item) {
  2046. if (item.value == str) {
  2047. theType = item.key;
  2048. }
  2049. });
  2050. return theType;
  2051. }
  2052. },
  2053. getProcessStatusNew: function (name, pro, status) {
  2054. let names = "(" + name + ")";
  2055. // if (!name || pro == 0 || pro == 8 || pro == 9 || pro == 10) {
  2056. if (!name) {
  2057. names = ""
  2058. }
  2059. let str = "";
  2060. if (pro == 0) {
  2061. str = "营销员";
  2062. } else if (pro == 1) {
  2063. str = "营销经理";
  2064. } else if (pro == 2) {
  2065. str = "营销管理员";
  2066. } else if (pro == 3) {
  2067. str = "咨询师";
  2068. } else if (pro == 4) {
  2069. str = "咨询师经理";
  2070. } else if (pro == 5) {
  2071. str = "咨询师总监";
  2072. } else if (pro == 6) {
  2073. str = "财务专员";
  2074. } else if (pro == 7) {
  2075. str = "财务总监";
  2076. } else if (pro == 8) {
  2077. str = "运营保障";
  2078. } else if (pro == 9) {
  2079. str = "公司/部门管理";
  2080. } else if (pro == 10) {
  2081. str = "董事长";
  2082. }
  2083. // else if (pro == 11) {
  2084. // str = "副总裁";
  2085. // }
  2086. let num = "";
  2087. if (status == 0) {
  2088. num = "发起";
  2089. } else if (status == 1) {
  2090. num = "审核中";
  2091. } else if (status == 2) {
  2092. num = "通过";
  2093. } else if (status == 3) {
  2094. num = "驳回";
  2095. return num + "到" + str + names;
  2096. }
  2097. // else if (status == 4) {
  2098. // num = "完成";
  2099. // }
  2100. else if (status == 5) {
  2101. num = "取消变更";
  2102. } else if (status == 6) {
  2103. num = "待上传附件";
  2104. }
  2105. if (pro == 8 && status == 2) {
  2106. return `订单变更退票中 (${name}处理中)`;
  2107. } else if (pro == 9 && status == 2) {
  2108. return `订单变更退票中 (${name}处理中)`;
  2109. } else if (pro == 10 && status == 2) {
  2110. return `订单变更退票中 (${name}处理中)`;
  2111. } else if (status == 4) {
  2112. return "订单变更已完成";
  2113. } else if (pro >= 8 && status == 6) {
  2114. return "待上传附件(营销员处理中)";
  2115. } else {
  2116. return str + names + num;
  2117. }
  2118. },
  2119. getContractChangeStatus: function (e) {
  2120. if (e || e == 0) {
  2121. let str = e.toString();
  2122. let theType = "";
  2123. contractChangeStatus.map(function (item) {
  2124. if (item.value == str) {
  2125. theType = item.key;
  2126. }
  2127. });
  2128. return theType;
  2129. }
  2130. },
  2131. // 咨询师以及咨询师经理审核内容显示
  2132. shenghePeo(name, status) {
  2133. if (status == 3) {
  2134. let str = "咨询师(";
  2135. str = str + name;
  2136. return str + ")审核中";
  2137. } else if (status == 4) {
  2138. let str = "咨询师经理(";
  2139. str = str + name;
  2140. return str + ")审核中";
  2141. }
  2142. },
  2143. moneyVerify(e) {
  2144. if (!/^\d{1,3}(,?\d{3})*(\.\d{1,6})?$/.test(e)) {
  2145. message.warning("输入金额不符合规范");
  2146. return true;
  2147. }
  2148. },
  2149. // 消息提醒函数接口
  2150. ShowModal(fn) {
  2151. let flag = true;
  2152. $.ajax({
  2153. method: "get",
  2154. dataType: "json",
  2155. crossDomain: false,
  2156. url: globalConfig.context + "/api/admin/notice/unreadCount",
  2157. data: {},
  2158. success: function (data) {
  2159. if (data.data != 0) {
  2160. fn.setState({
  2161. showModal: true,
  2162. });
  2163. } else {
  2164. fn.setState({
  2165. showModal: false,
  2166. });
  2167. }
  2168. },
  2169. });
  2170. // return flag
  2171. },
  2172. getType(e) {
  2173. if (e || e == 0) {
  2174. let str = e.toString();
  2175. let theType = "";
  2176. typeList.map(function (item) {
  2177. if (item.value == str) {
  2178. theType = item.key;
  2179. }
  2180. });
  2181. return theType;
  2182. }
  2183. },
  2184. changeColor(e) {
  2185. return (
  2186. <span style={{ color: "red", fontWeight: 900, fontSize: 16 }}>{e}</span>
  2187. );
  2188. },
  2189. //
  2190. getProjectName(e) {
  2191. let arr = projectStatusList.filter(v => {
  2192. return v.value === e
  2193. });
  2194. if (arr.length) {
  2195. return arr[0].value == 29 ? <Tag color="#FF0000">{arr[0].label}</Tag> : <span>{arr[0].label}</span>
  2196. }
  2197. return '';
  2198. },
  2199. // 详情--满意度调查
  2200. getFormRetrieve(e, showColor = true) {
  2201. let arr = formRetrieveList.filter(v => {
  2202. return v.value === e
  2203. });
  2204. if (arr.length) {
  2205. return <span style={{ color: showColor && arr[0].color }}>{arr[0].label}</span>
  2206. }
  2207. return '';
  2208. },
  2209. // 列表--满意度调查
  2210. getFormRetrieves(e, i) {
  2211. let str1 = ["未发送", "已发送,未回收", "已回收", "其他"][e]
  2212. let str2 = ""
  2213. if (e == 2) {
  2214. str2 = i == 0
  2215. ? "(非常满意)" : i == 1
  2216. ? "(满意)" : i == 2
  2217. ? "(一般)" : i == 3 && "(不满意)"
  2218. }
  2219. return str1 + str2;
  2220. },
  2221. download(fileName, deleteLv = true) {
  2222. window.open(globalConfig.context + `${'/open/download?fileName=' + fileName + '&delete=' + deleteLv}`);
  2223. },
  2224. getClockState(id, journal = false) {
  2225. let arr = journal ? clockJournalState.filter(v => v.id === id) : clockState.filter(v => v.id === id);
  2226. if (arr.length > 0) {
  2227. return arr[0];
  2228. } else {
  2229. return {};
  2230. }
  2231. },
  2232. // 处理级别层数
  2233. getBarLevel: function (val) {
  2234. let arr = []
  2235. if (!val) {
  2236. arr = ["", "", "", "", ""]
  2237. } else {
  2238. arr = val.split(',')
  2239. }
  2240. let leg = 5 - arr.length
  2241. if (arr.length < 5) {
  2242. for (var i = 0; i < leg; i++) {
  2243. arr.push("")
  2244. }
  2245. }
  2246. return arr
  2247. },
  2248. // 树状数据处理 num需要显示的最低lvl从0开始 默认全部显示
  2249. newTreeData(treeData, num = 6) {
  2250. let newData = [];
  2251. treeData.map(item => {
  2252. let treeObj = item;
  2253. treeObj.children = (item.children && item.lvl < num) ? obj.newTreeData(item.children, num) : [];
  2254. newData.push(treeObj)
  2255. })
  2256. return newData
  2257. },
  2258. // 获取巴权限
  2259. getRole: function (e) {
  2260. if (e || e == 0) {
  2261. let arr = e.split(',')
  2262. let theType = [];
  2263. for (var i = 0; i < roleList.length; i++) {
  2264. for (var j = 0; j < arr.length; j++) {
  2265. if (roleList[i].value == arr[j]) {
  2266. theType.push(roleList[i].key)
  2267. }
  2268. }
  2269. }
  2270. return theType.toString();
  2271. }
  2272. },
  2273. // 项目状态
  2274. // 项目暂停类型 0暂停 1重启
  2275. // 项目暂停状态 0发起 1通过 2拒绝
  2276. getStopStatus(type, status) {
  2277. let str = ""
  2278. str = type == 0 ? "暂停" : "重启"
  2279. if (status == 0) {
  2280. return <span>{"项目" + str + "待审核"}</span>
  2281. } else if (status == 1) {
  2282. return <span style={{ color: "green" }}>{"项目已" + str}</span>
  2283. } else if (status == 2) {
  2284. return <span style={{ color: "red" }}>{"项目" + str + "拒绝"}</span>
  2285. }
  2286. },
  2287. //
  2288. stopStatus(type, status) {
  2289. if (type == 0) {
  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. } else if (type == 1) {
  2298. if (status == 0) {
  2299. return <span style={{ color: "red" }}>重启待审核</span>
  2300. } else if (status == 1) {
  2301. return <span style={{ color: "red" }}>项目已重启</span>
  2302. } else if (status == 2) {
  2303. return <span style={{ color: "red" }}>重启被驳回,重新申请重启</span>
  2304. }
  2305. }
  2306. },
  2307. // 获取报销申请类型
  2308. getAccountName(type, other = "其他") {
  2309. let theType = "";
  2310. accountType.map(function (item) {
  2311. if (item.value == type) {
  2312. theType = item.label;
  2313. if (item.value == 0) {
  2314. theType = "其他(" + other + ")"
  2315. }
  2316. }
  2317. });
  2318. return theType;
  2319. },
  2320. getSecondaryAccountName(type, other = "其他") {
  2321. let theType = "";
  2322. typeLists.map(function (item) {
  2323. if (item.value == type) {
  2324. theType = item.label;
  2325. if (item.value == 0) {
  2326. theType = "其他(" + other + ")"
  2327. }
  2328. }
  2329. });
  2330. return theType;
  2331. },
  2332. // 获取交通工具类型
  2333. getVehicleName(type, other = "其他") {
  2334. let theType = "";
  2335. vehiclelist.map(function (item) {
  2336. if (item.value == type) {
  2337. theType = item.label;
  2338. if (item.value == 0) {
  2339. theType = "其他(" + other + ")"
  2340. }
  2341. }
  2342. });
  2343. return theType;
  2344. },
  2345. // 获取报销费用类型
  2346. getTypeName(type, other = "其他") {
  2347. let theType = "";
  2348. typeLists.map(function (item) {
  2349. if (item.value == type) {
  2350. theType = item.label;
  2351. if (item.value == 0) {
  2352. theType = "其他(" + other + ")"
  2353. }
  2354. }
  2355. });
  2356. return theType;
  2357. },
  2358. // 解决小数求和问题
  2359. commonAdd(number1, number2) {
  2360. let result = 0;
  2361. if (Number.isInteger(number1) && Number.isInteger(number2)) {
  2362. result = number1 + number2;
  2363. } else {
  2364. //
  2365. const number1Array = (number1).toString().split('.');
  2366. const number2Array = (number2).toString().split('.');
  2367. Number.isInteger(number1) && number1Array.push("0")
  2368. Number.isInteger(number2) && number2Array.push("0")
  2369. //最大的除数位数
  2370. let maxBit = 1;
  2371. if (number1Array[1].length >= number2Array[1].length) {
  2372. maxBit = number1Array[1].length + 1;
  2373. } else {
  2374. maxBit = number2Array[1].length + 1;
  2375. }
  2376. const divisor = parseInt('1'.padEnd(maxBit, 0));
  2377. result = (number1 * divisor + number2 * divisor) / divisor;
  2378. }
  2379. return result;
  2380. },
  2381. /** 数字金额大写转换(可以处理整数,小数,负数) */
  2382. dealBigMoney(n) {
  2383. var fraction = ['角', '分'];
  2384. var digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
  2385. var unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
  2386. var head = n < 0 ? '欠' : '';
  2387. n = Math.abs(n);
  2388. var s = '';
  2389. for (var i = 0; i < fraction.length; i++) {
  2390. s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
  2391. }
  2392. s = s || '整';
  2393. n = Math.floor(n);
  2394. for (var i = 0; i < unit[0].length && n > 0; i++) {
  2395. var p = '';
  2396. for (var j = 0; j < unit[1].length && n > 0; j++) {
  2397. p = digit[n % 10] + unit[1][j] + p;
  2398. n = Math.floor(n / 10);
  2399. }
  2400. s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
  2401. }
  2402. return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整');
  2403. },
  2404. getToday(status) {
  2405. // status 1 今日 2 昨日 3 近7日 4 近15日 5 近30日
  2406. let list = []
  2407. let startTime = "";
  2408. let endTime = moment().format("YYYY-MM-DD");
  2409. if (status == 1) {
  2410. startTime = moment().format("YYYY-MM-DD");
  2411. } else if (status == 2) {
  2412. startTime = moment().subtract(1, 'days').format("YYYY-MM-DD");
  2413. endTime = moment().subtract(1, 'days').format("YYYY-MM-DD");
  2414. } else if (status == 3) {
  2415. startTime = moment().subtract(7, 'days').format("YYYY-MM-DD");
  2416. } else if (status == 4) {
  2417. startTime = moment().subtract(15, 'days').format("YYYY-MM-DD");
  2418. } else if (status == 5) {
  2419. startTime = moment().subtract(30, 'days').format("YYYY-MM-DD");
  2420. }
  2421. list.push(startTime, endTime)
  2422. return list
  2423. },
  2424. // 特批类型
  2425. getApprovedType: function (e, other, s = 0) {
  2426. if (!!e && e.length > 0) {
  2427. let theType = "";
  2428. for (var i = 0; i < e.length; i++) {
  2429. let item = Number(e[i])
  2430. for (var j = 0; j < approvalOptions.length; j++) {
  2431. if (item == approvalOptions[j].value && item != 0) {
  2432. theType = theType + (theType ? "," : "") + approvalOptions[j].label
  2433. } else if (item == approvalOptions[j].value && item == 0) {
  2434. theType = theType + (theType ? "," : "") + `其他(${other})`
  2435. }
  2436. }
  2437. }
  2438. if (s == 1) {
  2439. return !!theType ? ("(" + theType + ")") : theType
  2440. } else {
  2441. return theType;
  2442. }
  2443. }
  2444. },
  2445. compare: function (a, b) {
  2446. if (a === 0 || b === 0) {
  2447. return a === 0 ? 1 : -1;
  2448. }
  2449. return a - b;
  2450. },
  2451. // 数组重组
  2452. getNewArray: function (array, key) {
  2453. let arr = []
  2454. if (array && array.length > 0) {
  2455. array.forEach(e => {
  2456. arr.push(e[key])
  2457. });
  2458. }
  2459. return arr
  2460. },
  2461. };
  2462. module.exports = obj