tools.js 58 KB

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