glj_col.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. /**
  2. * Created by zhang on 2018/7/3.
  3. */
  4. let gljCol = {
  5. ration_glj_setting: {
  6. header: [
  7. {headerName: "编码", headerWidth: 110, dataCode: "code", dataType: "String", formatter: "@"},
  8. {headerName: "名称", headerWidth: 160, dataCode: "name", dataType: "String",cellType:'tipsCell'},
  9. {headerName: "规格型号", headerWidth: 120, dataCode: "specs", dataType: "String", hAlign: "left",cellType:'tipsCell'},
  10. {headerName: "单位", headerWidth: 45, dataCode: "unit", dataType: "String", hAlign: "center"},
  11. {headerName: "市场价", headerWidth: 65, dataCode: "marketPrice", dataType: "Number", hAlign: "right"},//, decimalField: "glj.unitPrice"
  12. {headerName: "调整价", headerWidth: 65, dataCode: "adjustPrice", dataType: "Number", hAlign: "right"},//, decimalField: "glj.unitPrice"1
  13. {headerName: "自定消耗", headerWidth: 65, dataCode: "customQuantity", dataType: "Number", hAlign: "right", decimalField: "glj.quantity"},
  14. {headerName: "消耗量", headerWidth: 65, dataCode: "quantity", dataType: "Number", hAlign: "right", decimalField: "glj.quantity"},
  15. {headerName: "定额价", headerWidth: 65, dataCode: "basePrice", dataType: "Number", hAlign: "right"},//, decimalField: "glj.unitPrice"
  16. {headerName: "定额消耗", headerWidth: 65, dataCode: "rationItemQuantity", dataType: "Number", hAlign: "right", decimalField: "glj.quantity"}, // dataType: "Number", formatter: "0.00"
  17. {headerName: "总消耗量", headerWidth: 80, dataCode: "totalQuantity", dataType: "Number", hAlign: "right", decimalField: "glj.quantity"},
  18. {headerName: "暂估", headerWidth: 45, dataCode: "isEstimate", dataType: "String", hAlign: "center", vAlign: "center", cellType: "checkBox"}
  19. ],
  20. view: {
  21. lockColumns: [ "adjustPrice", "rationItemQuantity", "quantity", "totalQuantity", "isEstimate"],//这里以后改成dataCode好一点
  22. rowHeaderWidth:25
  23. },
  24. getStyle:function (data) {
  25. if(data&&data.type == gljType.MAIN_MATERIAL){//是主材的话字体蓝色显示
  26. return {foreColor:"#4D7BFF"};
  27. }
  28. return null;
  29. },
  30. navigationRightCol:['name','specs','unit'],//选中这几列时,按enter键跳到右边一列
  31. // 工料机类型是混凝土、砂浆、配合比、机械台班时,价格不可编辑。
  32. editedTyep:[GLJTypeConst.MAIN_MATERIAL,GLJTypeConst.EQUIPMENT]//主材设备
  33. },
  34. project_glj_setting:{
  35. header: [
  36. {headerName: "编码", headerWidth: 80, dataCode: "code", dataType: "String"},
  37. {headerName: "名称", headerWidth: 160, dataCode: "name", dataType: "String",cellType:'tipsCell'},
  38. {headerName: "规格型号", headerWidth: 120, dataCode: "specs", hAlign: "left", dataType: "String",cellType:'tipsCell'},
  39. {headerName: "单位", headerWidth: 45, dataCode: "unit", hAlign: "center", dataType: "String"},
  40. {headerName: "类型", headerWidth: 45, dataCode: "short_name", hAlign: "center", dataType: "String"},
  41. {headerName: "市场价", headerWidth: 70, dataCode: "marketPrice", hAlign: "right", dataType: "Number",validator:"number"},//,decimalField:"glj.unitPrice"
  42. {headerName: "调整价", headerWidth: 70, dataCode: "adjustPrice", hAlign: "right", dataType: "Number"},//,decimalField:"glj.unitPrice"
  43. {headerName: "定额价", headerWidth: 70, dataCode: "basePrice", hAlign: "right", dataType: "Number",validator:"number"},//decimalField:'glj.unitPrice',
  44. {headerName: "总消耗量", headerWidth: 90, dataCode: "quantity", hAlign: "right", dataType: "Number",decimalField:'glj.quantity'},
  45. {headerName: "暂估", headerWidth: 45, dataCode: "is_evaluate", hAlign: "center", dataType: "String",cellType:'checkBox'},
  46. {headerName: "主要\n材料", headerWidth: 45, dataCode: "is_main_material", hAlign: "center", dataType: "String",cellType:'checkBox'},
  47. {headerName: "不调价", headerWidth: 55, dataCode: "is_adjust_price", dataType: "String",cellType: "checkBox"},
  48. {headerName: "不计税设备", headerWidth: 55, dataCode: "no_tax_eqp", dataType: "String",cellType: "checkBox"},
  49. {headerName: "评标材料", headerWidth: 35, dataCode: "is_eval_material", dataType: "String",cellType: "checkBox"},
  50. {headerName: "供货方式", headerWidth: 70, dataCode: "supply", hAlign: "center", dataType: "String",cellType:'comboBox',editorValueType:true,options:supplyComboMap},
  51. {headerName: "甲供数量", headerWidth: 90, dataCode: "supply_quantity", hAlign: "right", dataType: "Number",validator:"number",decimalField:'glj.quantity'},
  52. {headerName: "三材类别", headerWidth: 70, dataCode: "materialType", hAlign: "center", dataType: "String",cellType:'comboBox',editorValueType:true,options:materialComboMap},
  53. {headerName: "三材系数", headerWidth: 70, dataCode: "materialCoe", hAlign: "right", dataType: "Number",validator:"number"},//,decimalField:'material'
  54. {headerName: "交货方式", headerWidth: 70, dataCode: "delivery", hAlign: "left", dataType: "String"},
  55. {headerName: "送达地点", headerWidth: 70, dataCode: "delivery_address", hAlign: "left", dataType: "String"},
  56. {headerName: "产地", headerWidth: 80, dataCode: "originPlace", hAlign: "left", dataType: "String"},
  57. {headerName: "厂家", headerWidth: 80, dataCode: "vender", hAlign: "left", dataType: "String"},
  58. {headerName: "质量等级", headerWidth: 80, dataCode: "qualityGrace", hAlign: "left", dataType: "String"},
  59. {headerName: "品牌", headerWidth: 80, dataCode: "brand", hAlign: "left", dataType: "String"},
  60. {headerName: "备注", headerWidth: 100, dataCode: "remark", hAlign: "left", dataType: "String"}
  61. ],
  62. view: {
  63. lockColumns: ["code","name","specs","unit","short_name","tenderPrice","adjustPrice","quantity","tenderQuantity"]
  64. },
  65. frozenCols:4
  66. },
  67. mixRatio_Setting:{
  68. header:[
  69. {headerName: "编码", headerWidth: 80, dataCode: "code", dataType: "String"},
  70. {headerName: "名称", headerWidth: 240, dataCode: "name", dataType: "String"},
  71. {headerName: "规格型号", headerWidth: 190, dataCode: "specs", dataType: "String"},
  72. {headerName: "单位", headerWidth: 45, dataCode: "unit", hAlign: "center", dataType: "String"},
  73. {headerName: "类型", headerWidth: 45, dataCode: "short_name", hAlign: "center", dataType: "String"},
  74. {headerName: "定额价", headerWidth: 80, dataCode: "basePrice", hAlign: "right", dataType: "Number",validator:"number"},//,decimalField:'glj.unitPrice'
  75. {headerName: "调整价", headerWidth: 80, dataCode: "adjustPrice", hAlign: "right", dataType: "Number"},//,decimalField:"glj.unitPrice"
  76. {headerName: "市场价", headerWidth: 80, dataCode: "marketPrice", hAlign: "right", dataType: "Number",validator:"number"},//,decimalField:"glj.unitPrice"
  77. {headerName: "消耗量", headerWidth: 80, dataCode: "consumption", hAlign: "right", dataType: "Number",decimalField:"glj.quantity",validator:"number"}
  78. ],
  79. view: {
  80. lockColumns: [0,1,2,3,4,5,6,7]
  81. }
  82. },
  83. scopeSetting:{
  84. "emptyRows":0,
  85. "headRows":1,
  86. "headRowHeight":[30],
  87. "defaultRowHeight": 21,
  88. "treeCol": 1,
  89. "cols":[
  90. {
  91. "width":40,
  92. "readOnly": true,
  93. "head":{
  94. "titleNames":["选择"],
  95. "spanCols":[1],
  96. "spanRows":[1],
  97. "vAlign":[1],
  98. "hAlign":[1],
  99. "font":["Arial"]
  100. },
  101. "data":{
  102. "field":"selected",
  103. "vAlign":1,
  104. "hAlign":1,
  105. "font":"Arial",
  106. "cellType":function (node) {
  107. return new GC.Spread.Sheets.CellTypes.CheckBox();
  108. }
  109. }
  110. },
  111. {
  112. "width":140,
  113. "readOnly": true,
  114. "head":{
  115. "titleNames":["编号"],
  116. "spanCols":[1],
  117. "spanRows":[1],
  118. "vAlign":[1],
  119. "hAlign":[1],
  120. "font":["Arial"]
  121. },
  122. "data":{
  123. "field":"code",
  124. "vAlign":1,
  125. "hAlign":0,
  126. "font":"Arial"
  127. }
  128. },
  129. {
  130. "width":240,
  131. "readOnly": true,
  132. "head":{
  133. "titleNames":["名称"],
  134. "spanCols":[1],
  135. "spanRows":[1],
  136. "vAlign":[1],
  137. "hAlign":[1],
  138. "font":["Arial"]
  139. },
  140. "data":{
  141. "field":"name",
  142. "vAlign":0,
  143. "hAlign":0,
  144. "font":"Arial"
  145. }
  146. },
  147. {
  148. "width":70,
  149. "readOnly": true,
  150. "head":{
  151. "titleNames":["单位"],
  152. "spanCols":[1],
  153. "spanRows":[1],
  154. "vAlign":[1],
  155. "hAlign":[1],
  156. "font":["Arial"]
  157. },
  158. "data":{
  159. "field":"unit",
  160. "vAlign":1,
  161. "hAlign":1,
  162. "font":"Arial"
  163. }
  164. },
  165. {
  166. "width":80,
  167. "readOnly": true,
  168. "head":{
  169. "titleNames":["工程量"],
  170. "spanCols":[1],
  171. "spanRows":[1],
  172. "vAlign":[1],
  173. "hAlign":[1],
  174. "font":["Arial"]
  175. },
  176. "data":{
  177. "field":"quantity",
  178. "vAlign":1,
  179. "hAlign":2,
  180. "font":"Arial"
  181. }
  182. },
  183. {
  184. "width":80,
  185. "readOnly": true,
  186. "head":{
  187. "titleNames":["单价"],
  188. "spanCols":[1],
  189. "spanRows":[1],
  190. "vAlign":[1],
  191. "hAlign":[1],
  192. "font":["Arial"]
  193. },
  194. "data":{
  195. "field":"unitPrice",
  196. "vAlign":1,
  197. "hAlign":2,
  198. "font":"Arial"
  199. }
  200. },
  201. {
  202. "width":80,
  203. "readOnly": true,
  204. "head":{
  205. "titleNames":["金额"],
  206. "spanCols":[1],
  207. "spanRows":[1],
  208. "vAlign":[1],
  209. "hAlign":[1],
  210. "font":["Arial"]
  211. },
  212. "data":{
  213. "field":"totalPrice",
  214. "vAlign":1,
  215. "hAlign":2,
  216. "font":"Arial"
  217. }
  218. }
  219. ]
  220. },
  221. removeCol:function (dataCode,setting) {
  222. let colIndex = _.findIndex(setting.header,{'dataCode':dataCode});
  223. if(colIndex != -1){
  224. setting.header.splice(colIndex,1);//去掉列;
  225. let newArray = [];
  226. for(let l of setting.view.lockColumns){
  227. if(_.isString(l)) return;//如果是用dataCode表示的,不用处理
  228. if(l == colIndex) continue;
  229. if(l > colIndex) l = l -1;
  230. newArray.push(l);
  231. }
  232. setting.view.lockColumns = newArray;
  233. }
  234. },
  235. initGljCol:function (showAdjustPrice) {
  236. let me = gljCol;
  237. if(showAdjustPrice !== true){
  238. me.removeCol('adjustPrice',me.ration_glj_setting);
  239. me.removeCol('adjustPrice',me.project_glj_setting);
  240. me.removeCol('adjustPrice',me.mixRatio_Setting);
  241. }
  242. gljOprObj.setting = me.ration_glj_setting;
  243. projectGljObject.projectGljSetting = me.project_glj_setting;
  244. projectGljObject.mixRatioSetting = me.mixRatio_Setting;
  245. me.setScopeFormater();
  246. gljOprObj.scopeSetting = me.scopeSetting;
  247. },
  248. setScopeFormater:function () {
  249. // 综合单价、综合合价,小数部分应补0对齐。 CSL
  250. for(let col of this.scopeSetting.cols){
  251. if (col.data.field=="totalPrice") col.data.formatter = MainTreeCol.getNumberFormatter(decimalObj.ration.totalPrice, true);
  252. if (col.data.field== "unitPrice") col.data.formatter = MainTreeCol.getNumberFormatter(decimalObj.ration.unitPrice, true);
  253. }
  254. }
  255. };
  256. /*
  257. $(function () {
  258. $('#fullpath').click(function () {
  259. checkfeeRate();
  260. });
  261. })
  262. async function checkfeeRate() {
  263. let result = await ajaxPost('/feeRates/checkFeeRateName', data = {name: '编辑工程量表达式', rootProjectID: 3163});
  264. console.log(result);
  265. }*/