contract.js 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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: 'yf_price', fixed: ['alias'] },
  26. { name: '应付进度', field: 'stackedBar', fixed: ['alias'] },
  27. { name: '累计实付', field: 'sf_price', fixed: ['alias'] },
  28. { name: '实付进度', field: 'stackedBarSf', fixed: ['alias'] },
  29. { name: '备注1', field: 'remark1', fixed: [] },
  30. { name: '备注2', field: 'remark2', fixed: [] },
  31. { name: '计算1', field: 'calc', fixed: [] },
  32. { name: '计算2', field: 'calc2', fixed: [] },
  33. ],
  34. [type.income]: [
  35. { name: '合同类型', field: 'type', fixed: ['alias'], gd: true },
  36. { name: '累计应回', field: 'yf_price', fixed: ['alias'] },
  37. { name: '应回进度', field: 'stackedBar', fixed: ['alias'] },
  38. { name: '累计实回', field: 'sf_price', fixed: ['alias'] },
  39. { name: '实回进度', field: 'stackedBarSf', fixed: ['alias'] },
  40. { name: '备注1', field: 'remark1', fixed: [] },
  41. { name: '备注2', field: 'remark2', fixed: [] },
  42. { name: '计算1', field: 'calc', fixed: [] },
  43. { name: '计算2', field: 'calc2', fixed: [] },
  44. ],
  45. };
  46. const defaultColSet = {
  47. [type.expenses]: [
  48. { field: 'type', show: 1, gd: true },
  49. { field: 'yf_price', show: 1 },
  50. { field: 'stackedBar', show: 1 },
  51. { field: 'sf_price', show: 0 },
  52. { field: 'stackedBarSf', show: 0 },
  53. { field: 'remark1', show: 0, alias: '备注1' },
  54. { field: 'remark2', show: 0, alias: '备注2' },
  55. { field: 'calc', show: 0, alias: '计算1' },
  56. { field: 'calc2', show: 0, alias: '计算2' },
  57. ],
  58. [type.income]: [
  59. { field: 'type', show: 1, gd: true },
  60. { field: 'yf_price', show: 1 },
  61. { field: 'stackedBar', show: 1 },
  62. { field: 'sf_price', show: 0 },
  63. { field: 'stackedBarSf', show: 0 },
  64. { field: 'remark1', show: 0, alias: '备注1' },
  65. { field: 'remark2', show: 0, alias: '备注2' },
  66. { field: 'calc', show: 0, alias: '计算1' },
  67. { field: 'calc2', show: 0, alias: '计算2' },
  68. ],
  69. };
  70. const defaultAttribute = [
  71. { name: '税率(%)', field: 'type', fixed: ['alias'], type: 'int' },
  72. { name: '数值', field: 'num_val', fixed: [], type: 'int' },
  73. { name: '丙方', field: 'third', fixed: [], type: 'text' },
  74. { name: '丁方', field: 'fourth', fixed: [], type: 'text' },
  75. { name: '文本', field: 'text', fixed: [], type: 'text' },
  76. { name: '合同内容', field: 'contract_content', fixed: [], type: 'long_text', tip: '独占一行,上限1000' },
  77. { name: '支付条件', field: 'pay_condition', fixed: [], type: 'long_text', tip: '独占一行,上限1000' },
  78. ];
  79. module.exports = {
  80. type,
  81. typeMap,
  82. typeName,
  83. colSet,
  84. defaultColSet,
  85. };