enumsName.ts 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459
  1. import { getItemEnumName } from '@/services/bus/allEnum';
  2. /**
  3. * 获取证件类型枚举名称
  4. * @param enumdicid
  5. * @returns
  6. */
  7. export function getCardTypeEnumItemName(enumdicid: number): string {
  8. return getItemEnumName('certificatetype', enumdicid)
  9. }
  10. /**
  11. *获取仓登录状态枚举名称
  12. */
  13. export function getLoginStatusEnumItemName(enumdicid: number): string {
  14. return getItemEnumName('loginstatus', enumdicid)
  15. }
  16. /**
  17. *获取单位枚举名称
  18. */
  19. export function getGoodsUnitEnumItemName(enumdicid: number): string {
  20. return getItemEnumName('goodsunit', enumdicid)
  21. }
  22. /**
  23. *获取仓库类型枚举名称
  24. */
  25. export function getWarehouseTypeEnumItemName(enumdicid: number): string {
  26. return getItemEnumName('warehouseinfoType', enumdicid)
  27. }
  28. /**
  29. *获取币种类型枚举名称
  30. */
  31. export function getPayCurrencyTypeEnumItemName(enumdicid: number): string {
  32. return getItemEnumName('paycurrency', enumdicid)
  33. }
  34. /**
  35. *获取套保计划类型枚举名称
  36. */
  37. export function getSpotContractTypeEnumItemName(enumdicid: number): string {
  38. return getItemEnumName('spotContractType', enumdicid)
  39. }
  40. /**************** 页面枚举 *******************/
  41. /**
  42. * 获取客户资料状态
  43. * @param state
  44. */
  45. export function getStatusName(state: number): string {
  46. let result = "--";
  47. switch (state) {
  48. case 1:
  49. result = "待激活";
  50. break
  51. case 2:
  52. result = "待审核";
  53. break
  54. case 3:
  55. result = "待复审";
  56. break
  57. case 4:
  58. result = "正常";
  59. break
  60. case 5:
  61. result = "审核拒绝";
  62. break
  63. case 6:
  64. result = "停用(注销)";
  65. break
  66. case 7:
  67. result = "注销(删除)";
  68. break
  69. }
  70. return result
  71. }
  72. /**
  73. * 网上开户表里面的状态枚举
  74. * @param state
  75. */
  76. export function getWSKHStatusName(state: number): string {
  77. let result = "--";
  78. switch (state) {
  79. case 1:
  80. result = "未提交";
  81. break
  82. case 2:
  83. result = "待初审";
  84. break
  85. case 3:
  86. result = "初审拒绝";
  87. break
  88. case 4:
  89. result = "待复审";
  90. break
  91. case 5:
  92. result = "复审拒绝";
  93. break
  94. case 6:
  95. result = "测评不通过";
  96. break
  97. }
  98. return result
  99. }
  100. /**
  101. * 获取现货品种状态
  102. * @param type :未激活 1:正常
  103. */
  104. export function getValidName(type: number) {
  105. let result = "--";
  106. switch (type) {
  107. case 0:
  108. result = "未激活";
  109. break
  110. case 1:
  111. result = "正常";
  112. break
  113. }
  114. return result
  115. }
  116. /**
  117. * 定价类型 - 1:一口价 2:点价 3:暂定价
  118. * @param pricetype 定价类型
  119. */
  120. export function getPriceTypeName(pricetype: number): string {
  121. let result = "--";
  122. switch (pricetype) {
  123. case 1:
  124. result = "一口价";
  125. break
  126. case 2:
  127. result = "点价";
  128. break
  129. case 3:
  130. result = "暂定价";
  131. break
  132. }
  133. return result
  134. }
  135. /**
  136. * 现货合同状态返回
  137. * @param state
  138. * //合同状态 - number;
  139. //0:未提交 1:待审核 2:执行中 3:正常完结 4:审核拒绝 5:异常完结 6:已撤回
  140. */
  141. export function getContractStatusName(state: number): string {
  142. let result = "--";
  143. switch (state) {
  144. case 0:
  145. result = "未提交";
  146. break;
  147. case 1:
  148. result = "待审核";
  149. break
  150. case 2:
  151. result = "执行中";
  152. break
  153. case 3:
  154. result = "正常完结";
  155. break
  156. case 4:
  157. result = "审核拒绝";
  158. break
  159. case 5:
  160. result = "异常完结";
  161. break
  162. case 6:
  163. result = "已撤回";
  164. break
  165. }
  166. return result
  167. }
  168. /**
  169. * 业务类型返回 业务类型 1-套保 2-套利
  170. * @param state
  171. */
  172. export function getBizTypeName(state: number): string {
  173. let result = "--";
  174. switch (state) {
  175. case 1:
  176. result = "套保";
  177. break
  178. case 2:
  179. result = "套利";
  180. break
  181. }
  182. return result
  183. }
  184. /**
  185. * 获取合同类型名称 现货合同类型 - 1:采购 -1:销售
  186. */
  187. export function getContractTypeName(type: number): string {
  188. let result = "--";
  189. switch (type) {
  190. case 1:
  191. result = "采购"
  192. break;
  193. case -1:
  194. result = "销售"
  195. break;
  196. }
  197. return result
  198. }
  199. /**
  200. * 业务审核-点价-状态
  201. * @param type 申请状态 - 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回
  202. */
  203. export function getApplyStatusName(type: number): string {
  204. let result = "--";
  205. switch (type) {
  206. case 1:
  207. result = "待审核";
  208. break
  209. case 2:
  210. result = "审核通过";
  211. break
  212. case 3:
  213. result = "审核拒绝";
  214. break
  215. case 4:
  216. result = "处理失败";
  217. break
  218. case 5:
  219. result = "已撤回";
  220. break
  221. }
  222. return result
  223. }
  224. /**
  225. * 千海金-提货申请-状态
  226. * @param type 1:备货中 2:待取货(自提) 3:已取货(自提) 4:待收货(邮寄) 5:已收货(邮寄) 6:自动收货(邮寄) 7:已拒绝 8:已撤销
  227. */
  228. export function getPickUpStateName(type: number): string {
  229. let result = "--";
  230. switch (type) {
  231. case 1:
  232. result = "备货中";
  233. break
  234. case 2:
  235. result = "待取货";
  236. break
  237. case 3:
  238. result = "已取货";
  239. break
  240. case 4:
  241. result = "待收货";
  242. break
  243. case 5:
  244. result = "已收货";
  245. break
  246. case 6:
  247. result = "自动收货";
  248. break
  249. case 7:
  250. result = "已拒绝";
  251. break
  252. case 8:
  253. result = "已撤销";
  254. break
  255. }
  256. return result
  257. }
  258. /**
  259. * 千海金-收货方式
  260. * @param type 2:自提 3:配送(邮寄)
  261. */
  262. export function getTakeStateName(type: number): string {
  263. let result = "--";
  264. switch (type) {
  265. case 2:
  266. result = "自提";
  267. break
  268. case 3:
  269. result = "配送(邮寄)";
  270. break
  271. }
  272. return result
  273. }
  274. /**
  275. * 千海金-策略状态
  276. * @param type 1:正常 2:暂停 3:终止
  277. */
  278. export function getRegularStateName(type: number): string {
  279. let result = "--";
  280. switch (type) {
  281. case 1:
  282. result = "正常";
  283. break
  284. case 2:
  285. result = "暂停";
  286. break
  287. case 3:
  288. result = "终止";
  289. break
  290. }
  291. return result
  292. }
  293. //1:待确认 2:已确认 3:确认拒绝 4:已支付保证金 5:已激活 6:已违约 7:到期结束 8:延期结束 9:违约结束 10:已注销 11:已关闭 99:未提交
  294. export function getContractName(type: number): string {
  295. let result = "--";
  296. switch (type) {
  297. case 1:
  298. result = "待确认";
  299. break
  300. case 2:
  301. result = "已确认";
  302. break
  303. case 3:
  304. result = "确认拒绝";
  305. break
  306. case 4:
  307. result = "已支付保证金";
  308. break
  309. case 5:
  310. result = "已激活";
  311. break
  312. case 6:
  313. result = "已违约";
  314. break
  315. case 7:
  316. result = "到期结束";
  317. break
  318. case 8:
  319. result = "延期结束";
  320. break
  321. case 9:
  322. result = "违约结束";
  323. break
  324. case 10:
  325. result = "已注销";
  326. break
  327. case 11:
  328. result = "已关闭";
  329. break
  330. case 99:
  331. result = "未提交";
  332. break
  333. }
  334. return result
  335. }
  336. //委托状态 - 1: 委托请求 2:待冻结 3:委托成功 4: 委托失败 5:配对成功 6: 已撤销 7:部分成交 8:已成交 9:部成部撤 10:成交失败 11:已拒绝 12:经过摘牌(先摘后挂专用-先摘后挂已摘过) 13:冻结成功(通道交易专用) 14:通道已撤 15:通道部成部撤 16:成交失败违约(荷兰式竞拍专用)
  337. export function getOrderStatusName(type: number): string {
  338. let result = "--";
  339. switch (type) {
  340. case 1:
  341. result = "委托请求";
  342. break
  343. case 2:
  344. result = "待冻结";
  345. break
  346. case 3:
  347. result = "委托成功";
  348. break
  349. case 4:
  350. result = "委托失败";
  351. break
  352. case 5:
  353. result = "配对成功";
  354. break
  355. case 6:
  356. result = "已撤销";
  357. break
  358. case 7:
  359. result = "部分成交";
  360. break
  361. case 8:
  362. result = "已成交";
  363. break
  364. case 9:
  365. result = "部成部撤";
  366. break
  367. case 10:
  368. result = "成交失败";
  369. break
  370. case 11:
  371. result = "已拒绝";
  372. break
  373. case 12:
  374. result = "经过摘牌";
  375. break
  376. case 13:
  377. result = "冻结成功";
  378. break
  379. case 14:
  380. result = "通道已撤";
  381. break
  382. case 15:
  383. result = "通道部成部撤";
  384. break
  385. case 16:
  386. result = "成交失败违约";
  387. break
  388. case 17:
  389. result = "冻结PD成功";
  390. break
  391. case 18:
  392. result = "冻结PD失败";
  393. break
  394. case 19:
  395. result = "冻结能量成功";
  396. break
  397. case 20:
  398. result = "冻结能量失败";
  399. break
  400. case 21:
  401. result = "预约已报价";
  402. break
  403. case 22:
  404. result = "过期未付";
  405. break
  406. case 23:
  407. result = "优惠券处理中";
  408. break
  409. }
  410. return result
  411. }
  412. /**
  413. * 中文weekday
  414. * @param type
  415. */
  416. export function getWeekName(type: string): string {
  417. let result = "--";
  418. switch (type) {
  419. case "1":
  420. result = "周一";
  421. break
  422. case "2":
  423. result = "周二";
  424. break
  425. case "3":
  426. result = "周三";
  427. break
  428. case "4":
  429. result = "周四";
  430. break
  431. case "5":
  432. result = "周五";
  433. break
  434. }
  435. return result
  436. }