enumsName.ts 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  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. }
  67. return result
  68. }
  69. /**
  70. * 获取现货品种状态
  71. * @param type :未激活 1:正常
  72. */
  73. export function getValidName(type: number) {
  74. let result = "--";
  75. switch (type) {
  76. case 0:
  77. result = "未激活";
  78. break
  79. case 1:
  80. result = "正常";
  81. break
  82. }
  83. return result
  84. }
  85. /**
  86. * 定价类型 - 1:一口价 2:点价 3:暂定价
  87. * @param pricetype 定价类型
  88. */
  89. export function getPriceTypeName(pricetype: number): string {
  90. let result = "--";
  91. switch (pricetype) {
  92. case 1:
  93. result = "一口价";
  94. break
  95. case 2:
  96. result = "点价";
  97. break
  98. case 3:
  99. result = "暂定价";
  100. break
  101. }
  102. return result
  103. }
  104. /**
  105. * 现货合同状态返回
  106. * @param state
  107. * //合同状态 - number;
  108. //0:未提交 1:待审核 2:执行中 3:正常完结 4:审核拒绝 5:异常完结 6:已撤回
  109. */
  110. export function getContractStatusName(state: number): string {
  111. let result = "--";
  112. switch (state) {
  113. case 0:
  114. result = "未提交";
  115. break;
  116. case 1:
  117. result = "待审核";
  118. break
  119. case 2:
  120. result = "执行中";
  121. break
  122. case 3:
  123. result = "正常完结";
  124. break
  125. case 4:
  126. result = "审核拒绝";
  127. break
  128. case 5:
  129. result = "异常完结";
  130. break
  131. case 6:
  132. result = "已撤回";
  133. break
  134. }
  135. return result
  136. }
  137. /**
  138. * 业务类型返回 业务类型 1-套保 2-套利
  139. * @param state
  140. */
  141. export function getBizTypeName(state: number): string {
  142. let result = "--";
  143. switch (state) {
  144. case 1:
  145. result = "套保";
  146. break
  147. case 2:
  148. result = "套利";
  149. break
  150. }
  151. return result
  152. }
  153. /**
  154. * 获取合同类型名称 现货合同类型 - 1:采购 -1:销售
  155. */
  156. export function getContractTypeName(type: number): string {
  157. let result = "--";
  158. switch (type) {
  159. case 1:
  160. result = "采购"
  161. break;
  162. case -1:
  163. result = "销售"
  164. break;
  165. }
  166. return result
  167. }
  168. /**
  169. * 业务审核-点价-状态
  170. * @param type 申请状态 - 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回
  171. */
  172. export function getApplyStatusName(type: number): string {
  173. let result = "--";
  174. switch (type) {
  175. case 1:
  176. result = "待审核";
  177. break
  178. case 2:
  179. result = "审核通过";
  180. break
  181. case 3:
  182. result = "审核拒绝";
  183. break
  184. case 4:
  185. result = "处理失败";
  186. break
  187. case 5:
  188. result = "已撤回";
  189. break
  190. }
  191. return result
  192. }
  193. /**
  194. * 千海金-提货申请-状态
  195. * @param type 1:备货中 2:待取货(自提) 3:已取货(自提) 4:待收货(邮寄) 5:已收货(邮寄) 6:自动收货(邮寄) 7:已拒绝 8:已撤销
  196. */
  197. export function getPickUpStateName(type: number): string {
  198. let result = "--";
  199. switch (type) {
  200. case 1:
  201. result = "备货中";
  202. break
  203. case 2:
  204. result = "待取货(自提)";
  205. break
  206. case 3:
  207. result = "已取货(自提)";
  208. break
  209. case 4:
  210. result = "待收货(邮寄)";
  211. break
  212. case 5:
  213. result = "已收货(邮寄)";
  214. break
  215. case 6:
  216. result = "自动收货(邮寄)";
  217. break
  218. case 7:
  219. result = "已拒绝";
  220. break
  221. case 8:
  222. result = "已撤销";
  223. break
  224. }
  225. return result
  226. }
  227. /**
  228. * 千海金-收货方式
  229. * @param type 2:自提 3:配送(邮寄)
  230. */
  231. export function getTakeStateName(type: number): string {
  232. let result = "--";
  233. switch (type) {
  234. case 2:
  235. result = "自提";
  236. break
  237. case 3:
  238. result = "配送(邮寄)";
  239. break
  240. }
  241. return result
  242. }