index.ts 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /** ================================= 信息 - 现货商品信息 ================================**/
  2. import APP from '@/services';
  3. import { getUserId } from "@/services/bus/account";
  4. import { commonSearch_go } from '@/services/go/index';
  5. import {
  6. Ermcp3Brand, Ermcp3GoodsGroup, Ermcp3MiddleGoodsDetailEx,
  7. Ermcp3Wrstandard,
  8. ErmcpDeliveryGoodsDetailEx,
  9. ErmcpDeliveryGoodsReq,
  10. ErmcpDeliveryGoodsRsp, ErmcpMiddleGoodsModel
  11. } from './interface';
  12. /**
  13. * 查询现货商品 /Ermcp3/QueryDeliveryGoods
  14. * @param excluudecfg 排除已配置的现货商品 1-排除
  15. * @constructor
  16. */
  17. export function QueryDeliveryGoods(req: ErmcpDeliveryGoodsReq): Promise<ErmcpDeliveryGoodsRsp[]> {
  18. const areauserid = APP.get('userAccount').memberuserid; // 所属机构id
  19. return commonSearch_go('/Ermcp3/QueryDeliveryGoods', { areauserid, ...req }).catch((err) => {
  20. throw new Error(`查询现货商品: ${err.message}`);
  21. });
  22. }
  23. /**
  24. * 查询商品品类 /Ermcp3/QueryGoodsWrstandard
  25. * @param deliverygoodsid 现货商品id
  26. * @constructor
  27. */
  28. export function QueryGoodsWrstandard(deliverygoodsid: number): Promise<Ermcp3Wrstandard[]> {
  29. const areauserid = APP.get('userAccount').memberuserid; // 所属机构id
  30. return commonSearch_go('/Ermcp3/QueryGoodsWrstandard', { areauserid, deliverygoodsid }).catch((err) => {
  31. throw new Error(`查询商品品类: ${err.message}`);
  32. });
  33. }
  34. /**
  35. * 查询商品品牌 /Ermcp3/QueryGoodsbrand
  36. * @constructor
  37. */
  38. export function QueryGoodsbrand(): Promise<Ermcp3Brand[]> {
  39. const areauserid = APP.get('userAccount').memberuserid; // 所属机构id
  40. return commonSearch_go('/Ermcp3/QueryGoodsbrand', { areauserid }).catch((err) => {
  41. throw new Error(`查询商品品牌: ${err.message}`);
  42. });
  43. }
  44. /**
  45. * 查询现货商品详情 /Ermcp3/QueryDeliveryGoodsDetail
  46. * @param deliverygoodsid 现货商品id
  47. * @constructor
  48. */
  49. export function QueryDeliveryGoodsDetail(deliverygoodsid?: number): Promise<ErmcpDeliveryGoodsDetailEx[]> {
  50. const areauserid = APP.get('userAccount').memberuserid; // 所属机构id
  51. const param = deliverygoodsid ? { areauserid, deliverygoodsid } : { areauserid }
  52. return commonSearch_go('/Ermcp3/QueryDeliveryGoodsDetail', param).catch((err) => {
  53. throw new Error(`查询现货商品详情: ${err.message}`);
  54. });
  55. }
  56. /**
  57. * 查询期货商品组 /Ermcp3/QueryGoodsGroup
  58. * @param excludecfg 排除套保品中已关联的商品组 1-排除
  59. * @constructor
  60. */
  61. export function QueryGoodsfGroup(excludecfg?: number): Promise<Ermcp3GoodsGroup[]> {
  62. const areauserid = APP.get('userAccount').memberuserid; // 所属机构id
  63. const param = excludecfg ? { areauserid, excludecfg } : { areauserid }
  64. return commonSearch_go('/Ermcp3/QueryGoodsGroup', param).catch((err) => {
  65. throw new Error(`查询期货商品组: ${err.message}`);
  66. });
  67. }
  68. /** ================================= 信息 - 套保品种 ================================**/
  69. /**
  70. * 查询套保品种(菜单:套保品种) /Ermcp/QueryMiddleGoods
  71. * @param status 状态 0-停用 1-正常
  72. * @constructor
  73. */
  74. export function QueryMiddleGoods(status: number): Promise<ErmcpMiddleGoodsModel[]> {
  75. const userid = getUserId(); // 所属机构id
  76. return commonSearch_go('/Ermcp/QueryMiddleGoods', { userid, status }).catch((err) => {
  77. throw new Error(`查询套保品种: ${err.message}`);
  78. });
  79. }
  80. /**
  81. * 查询套保品种详情(套保品种/商品详情) /Ermcp3/QueryMiddleGoodsDetail
  82. * @param middlegoodsid 套保品种id
  83. * @constructor
  84. */
  85. export function QueryMiddleGoodsDetail(middlegoodsid: number): Promise<Ermcp3MiddleGoodsDetailEx[]> {
  86. const areauserid = APP.get('userAccount').memberuserid; // 所属机构id
  87. return commonSearch_go('/Ermcp3/QueryMiddleGoodsDetail', { areauserid, middlegoodsid }).catch((err) => {
  88. throw new Error(`查询套保品种详情(套保品种/商品详情): ${err.message}`);
  89. });
  90. }