index.js 1002 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import { REFER } from "@/components/popover-select/api";
  2. // 币种
  3. export const currency = async (prop) => {
  4. try {
  5. // try
  6. const { code, rows } = await REFER({
  7. search: prop,
  8. type: "CURRENCY_PARAM",
  9. });
  10. if (code === 200) {
  11. return rows[0] || {};
  12. }
  13. } catch (err) {
  14. // catch
  15. console.error(err);
  16. } finally {
  17. // finally
  18. }
  19. };
  20. // 税率
  21. export const tax = async (prop) => {
  22. try {
  23. // try
  24. const { code, rows } = await REFER({
  25. search: prop,
  26. type: "TAX_RATE_PARAM",
  27. });
  28. if (code === 200) {
  29. return rows[0] || {};
  30. }
  31. } catch (err) {
  32. // catch
  33. console.error(err);
  34. } finally {
  35. // finally
  36. }
  37. };
  38. // 单位
  39. export const unit = async (prop) => {
  40. try {
  41. // try
  42. const { code, rows } = await REFER({
  43. search: prop,
  44. type: "UNIT_PARAM",
  45. });
  46. if (code === 200) {
  47. return rows[0] || {};
  48. }
  49. } catch (err) {
  50. // catch
  51. console.error(err);
  52. } finally {
  53. // finally
  54. }
  55. };