tools.js 55 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379
  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. dealBigMoney(n) {
  2337. var fraction = ['角', '分'];
  2338. var digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
  2339. var unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
  2340. var head = n < 0 ? '欠' : '';
  2341. n = Math.abs(n);
  2342. var s = '';
  2343. for (var i = 0; i < fraction.length; i++) {
  2344. s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
  2345. }
  2346. s = s || '整';
  2347. n = Math.floor(n);
  2348. for (var i = 0; i < unit[0].length && n > 0; i++) {
  2349. var p = '';
  2350. for (var j = 0; j < unit[1].length && n > 0; j++) {
  2351. p = digit[n % 10] + unit[1][j] + p;
  2352. n = Math.floor(n / 10);
  2353. }
  2354. s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
  2355. }
  2356. return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整');
  2357. }
  2358. };
  2359. module.exports = obj