tools.js 52 KB

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