lib_detail.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. 'use strict';
  2. /**
  3. * 指标库-项目节参数
  4. *
  5. * @author Mai
  6. * @date 2018/4/25
  7. * @version
  8. */
  9. $(document).ready(function() {
  10. const billsSpread = SpreadJsObj.createNewSpread($('#bills-spread')[0]);
  11. const billsTree = createNewPathTree({
  12. id: 'n_id',
  13. pid: 'n_pid',
  14. order: 'n_order',
  15. level: 'n_level',
  16. full_path: 'n_full_path',
  17. is_leaf: 'n_is_leaf',
  18. rootId: -1,
  19. keys: ['id', 'lib_id', 'n_id'],
  20. preUrl: '/lib/detail',
  21. });
  22. billsTree.loadDatas(bills);
  23. SpreadJsObj.initSheet(billsSpread.getActiveSheet(), {
  24. cols: [
  25. {title: '项目节编号', field: 'code', width: 120, cellType: 'tree'},
  26. {title: '清单编号', field: 'b_code', width: 80},
  27. {title: '名称', field: 'name', width: 200},
  28. {title: '单位', field: 'unit', width: 50},
  29. {title: '数量1', field: 'dgn_quantity1', width: 60, type: 'Number'},
  30. {title: '数量2', field: 'dgn_quantity2', width: 60, type: 'Number'},
  31. {title: '金额', field: 'total_price', width: 60, type: 'Number'},
  32. ],
  33. treeCol: 0,
  34. emptyRows: 3,
  35. headRows: 2,
  36. headRowHeight: [40, 40],
  37. defaultRowHeight: 21,
  38. });
  39. SpreadJsObj.loadSheetData(billsSpread.getActiveSheet(), 'tree', billsTree);
  40. });