contract.js 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. 'use strict';
  2. /**
  3. * 合同管理
  4. *
  5. * @author ELlisran
  6. * @date 2019/10/20
  7. * @version
  8. */
  9. // 类型
  10. const type = {
  11. expenses: 1,
  12. income: 2,
  13. };
  14. const typeMap = {
  15. 1: 'expenses',
  16. 2: 'income',
  17. };
  18. const typeName = {
  19. 1: '支付',
  20. 2: '回款',
  21. };
  22. const colSet = {
  23. [type.expenses]: [
  24. { name: '合同类型', field: 'type', fixed: ['alias'], gd: true },
  25. { name: '甲方', field: 'party_a', fixed: ['alias'], gd: true },
  26. { name: '乙方', field: 'party_b', fixed: ['alias'], gd: true },
  27. { name: '结算金额', field: 'settle_price', fixed: ['alias'], gd: true },
  28. { name: '累计应付', field: 'yf_price', fixed: ['alias'] },
  29. { name: '应付进度', field: 'stackedBar', fixed: ['alias'] },
  30. { name: '累计实付', field: 'sf_price', fixed: ['alias'] },
  31. { name: '实付进度', field: 'stackedBarSf', fixed: ['alias'] },
  32. { name: '备注1', field: 'remark1', fixed: [] },
  33. { name: '备注2', field: 'remark2', fixed: [] },
  34. { name: '计算1', field: 'calc', fixed: [] },
  35. { name: '计算2', field: 'calc2', fixed: [] },
  36. ],
  37. [type.income]: [
  38. { name: '合同类型', field: 'type', fixed: ['alias'], gd: true },
  39. { name: '甲方', field: 'party_a', fixed: ['alias'], gd: true },
  40. { name: '乙方', field: 'party_b', fixed: ['alias'], gd: true },
  41. { name: '结算金额', field: 'settle_price', fixed: ['alias'], gd: true },
  42. { name: '累计应回', field: 'yf_price', fixed: ['alias'] },
  43. { name: '应回进度', field: 'stackedBar', fixed: ['alias'] },
  44. { name: '累计实回', field: 'sf_price', fixed: ['alias'] },
  45. { name: '实回进度', field: 'stackedBarSf', fixed: ['alias'] },
  46. { name: '备注1', field: 'remark1', fixed: [] },
  47. { name: '备注2', field: 'remark2', fixed: [] },
  48. { name: '计算1', field: 'calc', fixed: [] },
  49. { name: '计算2', field: 'calc2', fixed: [] },
  50. ],
  51. };
  52. const defaultColSet = {
  53. [type.expenses]: [
  54. { field: 'type', show: 1, gd: true },
  55. { field: 'party_a', show: 0, gd: true },
  56. { field: 'party_b', show: 0, gd: true },
  57. { field: 'settle_price', show: 0, gd: true },
  58. { field: 'yf_price', show: 1 },
  59. { field: 'stackedBar', show: 1 },
  60. { field: 'sf_price', show: 0 },
  61. { field: 'stackedBarSf', show: 0 },
  62. { field: 'remark1', show: 0, alias: '备注1' },
  63. { field: 'remark2', show: 0, alias: '备注2' },
  64. { field: 'calc', show: 0, alias: '计算1' },
  65. { field: 'calc2', show: 0, alias: '计算2' },
  66. ],
  67. [type.income]: [
  68. { field: 'type', show: 1, gd: true },
  69. { field: 'party_a', show: 0, gd: true },
  70. { field: 'party_b', show: 0, gd: true },
  71. { field: 'settle_price', show: 0, gd: true },
  72. { field: 'yf_price', show: 1 },
  73. { field: 'stackedBar', show: 1 },
  74. { field: 'sf_price', show: 0 },
  75. { field: 'stackedBarSf', show: 0 },
  76. { field: 'remark1', show: 0, alias: '备注1' },
  77. { field: 'remark2', show: 0, alias: '备注2' },
  78. { field: 'calc', show: 0, alias: '计算1' },
  79. { field: 'calc2', show: 0, alias: '计算2' },
  80. ],
  81. };
  82. const attributeSet = [
  83. { name: '数值', field: 'num_val', fixed: [], type: 'number', type_name: '数字' },
  84. { name: '丙方', field: 'party_c', fixed: [], type: 'text', type_name: '文本' },
  85. { name: '丁方', field: 'party_d', fixed: [], type: 'text', type_name: '文本' },
  86. { name: '文本', field: 'text', fixed: [], type: 'text', type_name: '文本' },
  87. { name: '合同内容', field: 'contract_content', fixed: [], type: 'long_text', type_name: '长文本', tip: '独占一行,上限1000' },
  88. { name: '支付条件', field: 'pay_condition', fixed: [], type: 'long_text', type_name: '长文本', tip: '独占一行,上限1000' },
  89. ];
  90. const defaultAttributeSet = [
  91. { field: 'num_val', show: 0, alias: '数值' },
  92. { field: 'party_c', show: 0, alias: '丙方' },
  93. { field: 'party_d', show: 0, alias: '丁方' },
  94. { field: 'text', show: 0, alias: '文本' },
  95. { field: 'contract_content', show: 0, alias: '合同内容' },
  96. { field: 'pay_condition', show: 0, alias: '支付条件' },
  97. ];
  98. const defaultAttribute = {
  99. num_val: null,
  100. party_c: '',
  101. party_d: '',
  102. text: '',
  103. contract_content: '',
  104. pay_condition: '',
  105. };
  106. module.exports = {
  107. type,
  108. typeMap,
  109. typeName,
  110. colSet,
  111. defaultColSet,
  112. attributeSet,
  113. defaultAttributeSet,
  114. defaultAttribute,
  115. };