Browse Source

更新部分配置

MaiXinRong 6 years ago
parent
commit
c3d51ed166

+ 39 - 4
app/const/spread.js

@@ -17,7 +17,7 @@ const ledgerSpread = {
         {title: '单价', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 60, type: 'Number'},
         {title: '数量', colSpan: '1', rowSpan: '2', field: 'quantity', hAlign: 2, width: 60, type: 'Number'},
         {title: '金额', colSpan: '1', rowSpan: '2', field: 'total_price', hAlign: 2, width: 60, type: 'Number'},
-        {title: '图(册)号', colSpan: '1', rowSpan: '2', field: 'drawingCode', hAlign: 0, width: 80, formatter: '@'},
+        {title: '图(册)号', colSpan: '1', rowSpan: '2', field: 'drawing_code', hAlign: 0, width: 80, formatter: '@'},
         {title: '备注', colSpan: '1', rowSpan: '2', field: 'memo', hAlign: 0, width: 100, formatter: '@'}
     ],
     emptyRows: 3,
@@ -26,6 +26,18 @@ const ledgerSpread = {
     defaultRowHeight: 21,
 };
 
+const ledgerPosSpread = {
+    cols: [
+        {title: '名称', colSpan: '1', rowSpan: '1', field: 'name', hAlign: 0, width: 230, formatter: '@'},
+        {title: '数量', colSpan: '1', rowSpan: '1', field: 'quantity', hAlign: 0, width: 60, type: 'Number'},
+        {title: '图册号', colSpan: '1', rowSpan: '1', field: 'drawing_code', hAlign: 0, width: 80, formatter: '@'},
+    ],
+    emptyRows: 3,
+    headRows: 1,
+    headRowHeight: [40],
+    defaultRowHeight: 21,
+}
+
 const measureSpread = {
     cols: [
         {title: '项目节编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 150, formatter: '@', readOnly: true, cellType: 'tree'},
@@ -35,11 +47,11 @@ const measureSpread = {
         {title: '单价', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
         {title: '0号台账合同|数量', colSpan: '2|1', rowSpan: '1|1', field: 'quantity', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
         {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'total_price', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
-        {title: '本合同计量|数量', colSpan: '2|1', rowSpan: '1|1', field: 'deal_quantity', hAlign: 2, width: 60, type: 'Number'},
+        {title: '本合同计量|数量', colSpan: '2|1', rowSpan: '1|1', field: 'deal_quantity', hAlign: 2, width: 60, type: 'Number'},
         {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'deal_totalprice', hAlign: 2, width: 60, type: 'Number'},
-        {title: '本数量变更|数量', colSpan: '2|1', rowSpan: '1|1', field: 'qc_quantity', hAlign: 2, width: 60, type: 'Number'},
+        {title: '本数量变更|数量', colSpan: '2|1', rowSpan: '1|1', field: 'qc_quantity', hAlign: 2, width: 60, type: 'Number'},
         {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'qc_totalprice', hAlign: 2, width: 60, type: 'Number'},
-        {title: '本完成计量|数量', colSpan: '2|1', rowSpan: '1|1', field: 'gather_quantity', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
+        {title: '本完成计量|数量', colSpan: '2|1', rowSpan: '1|1', field: 'gather_quantity', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
         {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'gather_totalprice', hAlign: 2, width: 60, readOnly: true, type: 'Number'},
         {title: '图(册)号', colSpan: '1', rowSpan: '2', field: 'drawing_code', hAlign: 0, width: 80, formatter: '@', readOnly: true},
         {title: '备注', colSpan: '1', rowSpan: '2', field: 'memo', hAlign: 0, width: 100, formatter: '@', readOnly: true},
@@ -50,7 +62,30 @@ const measureSpread = {
     defaultRowHeight: 21,
 };
 
+const measurePosSpread = {
+    cols: [
+        {title: '部位名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 230, formatter: '@', readOnly: true},
+        {title: '复核数量', colSpan: '1', rowSpan: '2', field: 'quantity', hAlign: 0, width: 60, formatter: '@', readOnly: true},
+        {title: '本期|合同计量', colSpan: '4|1', rowSpan: '1|1', field: 'deal_quantity', hAlign: 0, width: 60, formatter: '@', readOnly: true},
+        {title: '|数量变更计量', colSpan: '|1', rowSpan: '|1', field: 'qc_quantity', hAlign: 0, width: 60, formatter: '@', readOnly: true},
+        {title: '|变更令', colSpan: '|1', rowSpan: '|1', field: 'qc_bgl', hAlign: 0, width: 60, formatter: '@', readOnly: true},
+        {title: '|完成计量', colSpan: '|1', rowSpan: '|1', field: 'gather_quantity', hAlign: 0, width: 60, formatter: '@', readOnly: true},
+        {title: '截止|合同计量', colSpan: '4|1', rowSpan: '1|1', field: 'b_code', hAlign: 0, width: 60, formatter: '@', readOnly: true},
+        {title: '|数量变更计量', colSpan: '|1', rowSpan: '|1', field: 'b_code', hAlign: 0, width: 60, formatter: '@', readOnly: true},
+        {title: '|变更令', colSpan: '|1', rowSpan: '|1', field: 'b_code', hAlign: 0, width: 60, formatter: '@', readOnly: true},
+        {title: '|完成计量', colSpan: '|1', rowSpan: '|1', field: 'b_code', hAlign: 0, width: 60, formatter: '@', readOnly: true},
+        {title: '本期批注', colSpan: '1', rowSpan: '2', field: 'b_code', hAlign: 0, width: 80, formatter: '@', readOnly: true},
+        {title: '图册号', colSpan: '1', rowSpan: '2', field: 'b_code', hAlign: 0, width: 80, formatter: '@', readOnly: true},
+    ],
+    emptyRows: 3,
+    headRows: 2,
+    headRowHeight: [40, 40],
+    defaultRowHeight: 21,
+}
+
 module.exports = {
     ledgerSpread,
+    ledgerPosSpread,
     measureSpread,
+    measurePosSpread,
 }

+ 1 - 0
app/controller/ledger_controller.js

@@ -65,6 +65,7 @@ module.exports = app => {
                     content,
                     ledger: JSON.stringify(ledgerData),
                     ledgerSpreadSetting: JSON.stringify(spreadConst.ledgerSpread),
+                    posSpreadSetting: JSON.stringify(spreadConst.ledgerPosSpread),
                     tenderMenu,
                     preUrl: '/tender/' + tenderId,
                 };

+ 0 - 1
app/controller/tender_controller.js

@@ -151,7 +151,6 @@ module.exports = app => {
             try {
                 const tenderId = ctx.params.id;
                 const data = JSON.parse(ctx.request.body.data);
-                console.log(data);
                 await ctx.service.tenderInfo.saveTenderInfo(tenderId, data);
                 ctx.body = {err: 0, msg: '', data: data};
             } catch(err) {

+ 3 - 0
app/public/js/ledger.js

@@ -54,6 +54,9 @@ $(document).ready(function() {
     SpreadJsObj.initSheet(ledgerSpread.getActiveSheet(), ledgerSpreadSetting);
     SpreadJsObj.loadSheetData(ledgerSpread.getActiveSheet(), 'tree', ledgerTree);
 
+    const posSpread = SpreadJsObj.createNewSpread($('#pos-spread')[0]);
+    SpreadJsObj.initSheet(posSpread.getActiveSheet(), posSpreadSetting);
+
     const treeOperationObj = {
         getSelectNode: function (sheet) {
             if (!sheet || !sheet.zh_tree) {

+ 1 - 0
app/view/ledger/explode.ejs

@@ -158,6 +158,7 @@
     let ledgerSpreadSetting = '<%- ledgerSpreadSetting %>';
     ledgerSpreadSetting = JSON.parse(ledgerSpreadSetting);
     ledgerSpreadSetting.readOnly = <%- tender.user_id !== ctx.session.sessionUser.accountId || tender.ledger_status === auditConst.status.checking || tender.ledger_status === auditConst.status.checked %>;
+    let posSpreadSetting = JSON.parse('<%- posSpreadSetting %>');
 </script>
 <script src="/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js"></script>
 <script>

+ 1 - 1
config/config.test.js

@@ -46,7 +46,7 @@ module.exports = appInfo => {
     // session配置
     config.session = {
         key: 'ZHC_SESS',
-        maxAge: 5*1000, //8 * 3600 * 1000, // 8小时
+        maxAge: 8 * 3600 * 1000, // 8小时
         httpOnly: true,
         encrypt: true,
     };