tools.js 54 KB

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