setup.ts 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /**
  2. * 管理 - 财务审核
  3. */
  4. import { ResultInfo } from "@/common/methods/request";
  5. /**
  6. * 通过ContractType判断 如果是采购就是收票 如果是销售就是开票
  7. * @param type
  8. */
  9. export function invoiceStatusName(type: number): string {
  10. let result = "--";
  11. switch (type) {
  12. case 1:
  13. result = "收票"
  14. break;
  15. case -1:
  16. result = "开票"
  17. break;
  18. }
  19. return result
  20. }
  21. /**
  22. * 操作申请类型 - 1:点价 2:结算登记 3:款项登记 4:发票登记
  23. * @param type
  24. */
  25. export function operateApplyTypeName(type: number): string {
  26. let result = "--";
  27. switch (type) {
  28. case 1:
  29. result = "点价"
  30. break;
  31. case 2:
  32. result = "结算登记"
  33. break;
  34. case 3:
  35. result = "款项登记"
  36. break;
  37. case 4:
  38. result = "发票登记"
  39. break;
  40. }
  41. return result
  42. }
  43. /**
  44. * 款项类型名称
  45. * @param kxtype: number;//款项类型 1-收付款(PayAmount字段有值) 2-退款(DeductAmount字段有值) 3-收付款/退款(2个字段都有)
  46. */
  47. export function kxtypeName(type: number): string {
  48. // contracttype: number;//现货合同类型 - 1:采购 -1:销售
  49. let result = "--";
  50. if (type === 1) {
  51. result = "付款"
  52. } else {
  53. result = "收款"
  54. }
  55. return result
  56. }
  57. /**
  58. * 付款
  59. * @param deductamount
  60. * @param contracttype
  61. */
  62. export function stateName(deductamount: number, contracttype: number) {
  63. let result = "--";
  64. if (deductamount === undefined || deductamount === 0) {
  65. if (contracttype === 1) { // 采购
  66. result = "付款"
  67. } else {
  68. result = "收款"
  69. }
  70. } else {
  71. result = "退款"
  72. }
  73. return result;
  74. }
  75. // 提示
  76. export const financeSign = new Map<number, ResultInfo>([
  77. [2, ['审核通过成功', '审核失败:']],
  78. [3, ['审核拒绝成功', '审核失败:']],
  79. [4, ['撤销成功', '撤销失败:']],
  80. ])