contract.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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: 'yf_price', fixed: ['alias'] },
  28. { name: '应付进度', field: 'stackedBar', fixed: ['alias'] },
  29. { name: '累计实付', field: 'sf_price', fixed: ['alias'] },
  30. { name: '实付进度', field: 'stackedBarSf', fixed: ['alias'] },
  31. { name: '备注1', field: 'remark1', fixed: [] },
  32. { name: '备注2', field: 'remark2', fixed: [] },
  33. { name: '计算1', field: 'calc', fixed: [] },
  34. { name: '计算2', field: 'calc2', fixed: [] },
  35. ],
  36. [type.income]: [
  37. { name: '合同类型', field: 'type', fixed: ['alias'], gd: true },
  38. { name: '甲方', field: 'party_a', fixed: ['alias'], gd: true },
  39. { name: '乙方', field: 'party_b', fixed: ['alias'], gd: true },
  40. { name: '累计应回', field: 'yf_price', fixed: ['alias'] },
  41. { name: '应回进度', field: 'stackedBar', fixed: ['alias'] },
  42. { name: '累计实回', field: 'sf_price', fixed: ['alias'] },
  43. { name: '实回进度', field: 'stackedBarSf', fixed: ['alias'] },
  44. { name: '备注1', field: 'remark1', fixed: [] },
  45. { name: '备注2', field: 'remark2', fixed: [] },
  46. { name: '计算1', field: 'calc', fixed: [] },
  47. { name: '计算2', field: 'calc2', fixed: [] },
  48. ],
  49. };
  50. const defaultColSet = {
  51. [type.expenses]: [
  52. { field: 'type', show: 1, gd: true },
  53. { field: 'party_a', show: 0, gd: true },
  54. { field: 'party_b', show: 0, gd: true },
  55. { field: 'yf_price', show: 1 },
  56. { field: 'stackedBar', show: 1 },
  57. { field: 'sf_price', show: 0 },
  58. { field: 'stackedBarSf', show: 0 },
  59. { field: 'remark1', show: 0, alias: '备注1' },
  60. { field: 'remark2', show: 0, alias: '备注2' },
  61. { field: 'calc', show: 0, alias: '计算1' },
  62. { field: 'calc2', show: 0, alias: '计算2' },
  63. ],
  64. [type.income]: [
  65. { field: 'type', show: 1, gd: true },
  66. { field: 'party_a', show: 0, gd: true },
  67. { field: 'party_b', show: 0, gd: true },
  68. { field: 'yf_price', show: 1 },
  69. { field: 'stackedBar', show: 1 },
  70. { field: 'sf_price', show: 0 },
  71. { field: 'stackedBarSf', show: 0 },
  72. { field: 'remark1', show: 0, alias: '备注1' },
  73. { field: 'remark2', show: 0, alias: '备注2' },
  74. { field: 'calc', show: 0, alias: '计算1' },
  75. { field: 'calc2', show: 0, alias: '计算2' },
  76. ],
  77. };
  78. const attributeSet = [
  79. { name: '数值', field: 'num_val', fixed: [], type: 'int', type_name: '数字' },
  80. { name: '丙方', field: 'party_c', fixed: [], type: 'text', type_name: '文本' },
  81. { name: '丁方', field: 'party_d', fixed: [], type: 'text', type_name: '文本' },
  82. { name: '文本', field: 'text', fixed: [], type: 'text', type_name: '文本' },
  83. { name: '合同内容', field: 'contract_content', fixed: [], type: 'long_text', type_name: '长文本', tip: '独占一行,上限1000' },
  84. { name: '支付条件', field: 'pay_condition', fixed: [], type: 'long_text', type_name: '长文本', tip: '独占一行,上限1000' },
  85. ];
  86. const defaultAttributeSet = [
  87. { field: 'num_val', show: 0, alias: '数值' },
  88. { field: 'party_c', show: 0, alias: '丙方' },
  89. { field: 'party_d', show: 0, alias: '丁方' },
  90. { field: 'text', show: 0, alias: '文本' },
  91. { field: 'contract_content', show: 0, alias: '合同内容' },
  92. { field: 'pay_condition', show: 0, alias: '支付条件' },
  93. ];
  94. const defaultAttribute = {
  95. num_val: null,
  96. party_c: '',
  97. party_d: '',
  98. text: '',
  99. contract_content: '',
  100. pay_condition: '',
  101. };
  102. module.exports = {
  103. type,
  104. typeMap,
  105. typeName,
  106. colSet,
  107. defaultColSet,
  108. attributeSet,
  109. defaultAttributeSet,
  110. defaultAttribute,
  111. };