tools.js 50 KB

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