zhejiang_2005.js 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /**
  2. * Created by CSL on 2019/09/11. 江西计算程序、基数 等覆盖。
  3. */
  4. let isZJ2005 = true;
  5. // 一般计税取不含税市场价、不含税定额价。简易计税取含税市场价、含税定额价。打开项目时,4个价格根据计税类型只载入其二,所以这里可不作区分。
  6. function overwriteRationCalcBases (taxType){
  7. if (typeof rationCalcBases == 'undefined') return;
  8. for (let key in rationCalcBases) delete rationCalcBases[key];
  9. // let isJY = taxType == '2';
  10. rationCalcBases['人工费'] = function (node, isTender) {
  11. return calcTools.rationBaseFee(node, [gljType.LABOUR], priceTypes.ptMarketPrice, isTender);
  12. };
  13. rationCalcBases['材料费'] = function (node, isTender) {
  14. return calcTools.rationBaseFee(node, baseMaterialTypes, priceTypes.ptMarketPrice, isTender);
  15. };
  16. rationCalcBases['施工机械费使用费'] = function (node, isTender) {
  17. return calcTools.rationBaseFee(node, baseMachineTypes, priceTypes.ptMarketPrice, isTender);
  18. };
  19. };
  20. (function overwriteFeeTypes() {
  21. if (typeof cpFeeTypes == 'undefined') return;
  22. cpFeeTypes = [
  23. {type: 'directWork', name: '直接工程费'},
  24. {type: 'direct', name: '直接费'},
  25. {type: 'marketLabour', name: '人工费'},
  26. {type: 'marketMaterial', name: '材料费'},
  27. {type: 'marketMachine', name: '施工机械使用费'},
  28. {type: 'otherDirect', name: '其他直接费'},
  29. {type: 'local', name: '现场经费'},
  30. {type: 'indirect', name: '间接费'},
  31. {type: 'profit', name: '计划利润'},
  32. {type: 'tax', name: '税金'},
  33. {type: 'composite', name: '年度经费综合费'},
  34. {type: 'common', name: '养护工程费'}
  35. ];
  36. })();
  37. if(typeof gljUtil !== 'undefined'){
  38. gljUtil.getCodeSortMath = getCodeSortMath
  39. }
  40. if(typeof module !== 'undefined'){
  41. let _= require('lodash');
  42. module.exports = {
  43. sortRationGLJ: function(list){
  44. list = _.sortByAll(list, [function (item) {
  45. return getMainType(item.gljType?item.gljType:item.type);
  46. }, getCodeSortMath()]);
  47. return list;
  48. function getMainType(type) {
  49. let str = type + "";
  50. return parseInt(str.substr(0,1));
  51. }
  52. }
  53. };
  54. }
  55. function getCodeSortMath() {
  56. return function (item) {
  57. let arr = item.code.split('-');
  58. return parseInt(arr[0])
  59. }
  60. }