Parcourir la source

材料调差spread生成提交

laiguoran il y a 5 ans
Parent
commit
c3eb90f277
5 fichiers modifiés avec 32 ajouts et 1558 suppressions
  1. 17 17
      app/const/spread.js
  2. 4 16
      app/controller/material_controller.js
  3. 7 1522
      app/public/js/material.js
  4. 3 2
      app/view/material/info.ejs
  5. 1 1
      config/web.js

+ 17 - 17
app/const/spread.js

@@ -419,23 +419,23 @@ measure.compare.pos = {
 const material = {
     bill: {
         cols: [
-            {title: '调差类型', colSpan: '1', rowSpan: '2', field: 'b_code', hAlign: 0, width: 80, formatter: '@'},
-            {title: '编号', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 60, formatter: '@'},
-            {title: '名称', colSpan: '1', rowSpan: '2', field: 'unit', hAlign: 1, width: 230, formatter: '@', cellType: 'unit'},
-            {title: '单位', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 60, type: 'Number'},
-            {title: '规格', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 60, type: 'Number'},
-            {title: '工料分类', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 60, type: 'Number'},
-            {title: '本期应耗数量', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 60, type: 'Number'},
-            {title: '基准价', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 60, type: 'Number'},
-            {title: '基准时间', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 60, type: 'Number'},
-            {title: '本期信息价|单价', colSpan: '3|1', rowSpan: '1|1', field: 'deal_bills_qty', hAlign: 2, width: 60, type: 'Number'},
-            {title: '|时间', colSpan: '|1', rowSpan: '|1', field: 'deal_bills_tp', hAlign: 2, width: 60, type: 'Number'},
-            {title: '|价差', colSpan: '1', rowSpan: '1|1', field: 'quantity', hAlign: 2, width: 60, type: 'Number'},
-            {title: '本期材料调差|风险幅度(%)', colSpan: '3|1', rowSpan: '1|1', field: 'contract_qty', hAlign: 2, width: 60, type: 'Number'},
-            {title: '|有效价差', colSpan: '|1', rowSpan: '|1', field: 'contract_tp', hAlign: 2, width: 60, type: 'Number'},
-            {title: '|调整金额', colSpan: '|1', rowSpan: '1|1', field: 'qc_qty', hAlign: 2, width: 60, type: 'Number'},
-            {title: '截止上期调差金额', colSpan: '|1', rowSpan: '|1', field: 'qc_tp', hAlign: 2, width: 60, type: 'Number'},
-            {title: '备注', colSpan: '|1', rowSpan: '|1', field: 'qc_tp_bgl', hAlign: 2, width: 60, formatter: '@'},
+            {title: '调差类型', colSpan: '1', rowSpan: '2', field: 't_type', hAlign: 0, width: 80, formatter: '@'},
+            {title: '编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 60, formatter: '@'},
+            {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 1, width: 180, formatter: '@', cellType: 'unit'},
+            {title: '单位', colSpan: '1', rowSpan: '2', field: 'unit', hAlign: 2, width: 60, type: 'Number'},
+            {title: '规格', colSpan: '1', rowSpan: '2', field: 'spec', hAlign: 2, width: 230, type: 'Number'},
+            {title: '工料分类', colSpan: '1', rowSpan: '2', field: 'm_type', hAlign: 2, width: 60, type: 'Number'},
+            {title: '本期应耗数量', colSpan: '1', rowSpan: '2', field: 'quantity', hAlign: 2, width: 100, type: 'Number'},
+            {title: '基准价', colSpan: '1', rowSpan: '2', field: 'basic_price', hAlign: 2, width: 60, type: 'Number'},
+            {title: '基准时间', colSpan: '1', rowSpan: '2', field: 'basic_times', hAlign: 2, width: 60, type: 'Number'},
+            {title: '本期信息价|单价', colSpan: '3|1', rowSpan: '1|1', field: 'msg_tp', hAlign: 2, width: 60, type: 'Number'},
+            {title: '|时间', colSpan: '|1', rowSpan: '|1', field: 'msg_times', hAlign: 2, width: 60, type: 'Number'},
+            {title: '|价差', colSpan: '1', rowSpan: '1|1', field: 'msg_spread', hAlign: 2, width: 60, type: 'Number'},
+            {title: '本期材料调差|风险幅度(%)', colSpan: '3|1', rowSpan: '1|1', field: 'm_risk', hAlign: 2, width: 100, type: 'Number'},
+            {title: '|有效价差', colSpan: '|1', rowSpan: '|1', field: 'm_spread', hAlign: 2, width: 80, type: 'Number'},
+            {title: '|调整金额', colSpan: '|1', rowSpan: '1|1', field: 'm_tp', hAlign: 2, width: 80, type: 'Number'},
+            {title: '截止上期调差金额', colSpan: '1', rowSpan: '2', field: 'pre_tp', hAlign: 2, width: 120, type: 'Number'},
+            {title: '备注', colSpan: '1', rowSpan: '2', field: 'remark', hAlign: 2, width: 60, formatter: '@'},
         ],
         emptyRows: 0,
         headRows: 2,

+ 4 - 16
app/controller/material_controller.js

@@ -203,24 +203,12 @@ module.exports = app => {
                     col.formatter = formatter;
                 }
             }
-            // const tpFormatter = this.ctx.helper.getNumberFormatter(this.ctx.tender.info.decimal.tp);
-            // const upFormatter = this.ctx.helper.getNumberFormatter(2);
-            const tender = this.ctx.tender, stage = this.ctx.stage;
-            const stageSetting = tender.data.measure_type === measureType.tz.value ? spreadConst.stageTz :
-                (tender.info.display.ledger.clQty ? spreadConst.stageCl : spreadConst.stageNoCl);
-            const ledger = JSON.parse(JSON.stringify(stageSetting.ledger));
-            // setColFormat(ledger.cols, 'unit_price', upFormatter);
-            // setColFormat(ledger.cols, 'total_price', tpFormatter);
-            // setColFormat(ledger.cols, 'tp', tpFormatter);
-            if (!tender.info.display.ledger.dgnQty) {
-                removeFieldCols(ledger, spreadConst.filterCols.stageDgnCols);
-            }
-            const pos = JSON.parse(JSON.stringify(stageSetting.pos));
+            const billsSetting = spreadConst.material;
+            const ledger = JSON.parse(JSON.stringify(billsSetting.bill));
             if (this.ctx.material.readOnly) {
                 ledger.readOnly = true;
-                pos.readOnly = true;
             }
-            return [ledger, pos];
+            return [ledger];
         }
 
         /**
@@ -254,7 +242,7 @@ module.exports = app => {
             try {
                 await this._getMaterialAuditViewData(ctx);
                 const renderData = await this._getDefaultRenderData(ctx);
-                // [renderData.ledgerSpread, renderData.posSpread] = this._getSpreadSetting();
+                [renderData.billsSpread] = this._getSpreadSetting();
                 // renderData.ledgerData = await ctx.service.ledger.getData(ctx.tender.id);
                 renderData.jsFiles = this.app.jsFiles.common.concat(this.app.jsFiles.material.info);
                 await this.layout('material/info.ejs', renderData, 'material/info_modal.ejs');

Fichier diff supprimé car celui-ci est trop grand
+ 7 - 1522
app/public/js/material.js


+ 3 - 2
app/view/material/info.ejs

@@ -12,13 +12,13 @@
             </div>
         </div>
     </div>
-    <div class="content-wrap pr-46">
+    <div class="content-wrap">
         <div class="c-header p-0">
         </div>
         <div class="row w-100 sub-content">
             <div id="main-view" class="c-body" style="width: 100%">
                 <!--上部分-->
-                <div class="sjs-height-1" id="material-ledger">
+                <div class="sjs-height-1" id="material-spread">
                 </div>
                 <!--下部分-->
                 <div class="bcontent-wrap">
@@ -47,6 +47,7 @@
 <% if (ctx.material.status === auditConst.status.uncheck && ctx.session.sessionUser.accountId === ctx.material.user_id) {%>
 <script>
     const accountList = JSON.parse('<%- JSON.stringify(accountList) %>');
+    const billsSpreadSetting = JSON.parse('<%- JSON.stringify(billsSpread) %>');
 </script>
 <% } %>
 <script>

+ 1 - 1
config/web.js

@@ -318,7 +318,7 @@ const JsFiles = {
                     "/public/js/spreadjs_rela/spreadjs_zh.js",
                     "/public/js/zh_calc.js",
                     "/public/js/path_tree.js",
-                    // "/public/js/material.js",
+                    "/public/js/material.js",
                     "/public/js/material_audit.js",
                 ],
                 mergeFile: 'material',