tools.js 54 KB

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