Browse Source

其他台账,部分调整

MaiXinRong 5 years ago
parent
commit
535d795710

+ 5 - 1
app/public/js/se_bonus.js

@@ -9,7 +9,7 @@
  */
 
 const isPre = function (data) {
-    return data.sid !== stageId;
+    return data && data.sid !== stageId;
 };
 $(document).ready(() => {
     autoFlashHeight();
@@ -22,6 +22,9 @@ $(document).ready(() => {
             {
                 title: '时间', colSpan: '1', rowSpan: '1', field: 'real_time', hAlign: 2, width: 150, readOnly: true,
                 formatter: 'yyyy-MM-dd', cellType: 'activeImageBtn', normalImg: '#ellipsis-icon', indent: 5,
+                showImage: function (data) {
+                    return data !== undefined && data !== null;
+                },
             },
             {title: '编号', colSpan: '1', rowSpan: '1', field: 'code', hAlign: 0, width: 150, formatter: '@', readOnly: isPre, },
             {title: '依据材料证明', colSpan: '1', rowSpan: '1', field: 'proof', hAlign: 0, width: 180, formatter: '@', readOnly: isPre, },
@@ -39,6 +42,7 @@ $(document).ready(() => {
         defaultRowHeight: 21,
         headerFont: '12px 微软雅黑',
         font: '12px 微软雅黑',
+        readOnly: readOnly,
         imageClick: function (data, hitinfo) {
             if (!data) return;
 

+ 26 - 25
app/public/js/se_jgcl.js

@@ -8,33 +8,34 @@
  * @version
  */
 
-const spreadSetting = {
-    cols: [
-        {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 185, formatter: '@'},
-        {title: '单位', colSpan: '1', rowSpan: '2', field: 'unit', hAlign: 1, width: 50, formatter: '@', cellType: 'unit'},
-        {title: '单价', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 60, type: 'Number'},
-        {title: '本期到场|数量',  colSpan: '2|1', rowSpan: '1|1', field: 'arrive_qty', hAlign: 2, width: 60, type: 'Number'},
-        {title: '|金额',  colSpan: '|1', rowSpan: '|1', field: 'arrive_tp', hAlign: 2, width: 60, type: 'Number'},
-        {title: '截止本期到场|数量', colSpan: '2|1', rowSpan: '1|1', field: 'end_arrive_qty', hAlign: 2, width: 60, type: 'Number', readOnly: true},
-        {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'end_arrive_tp', hAlign: 2, width: 60, type: 'Number', readOnly: true},
-        {title: '本期扣回|数量', colSpan: '2|1', rowSpan: '1|1', field: 'deduct_qty', hAlign: 2, width: 60, type: 'Number'},
-        {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'deduct_tp', hAlign: 2, width: 60, type: 'Number', readOnly: true},
-        {title: '截止本期扣回|数量', colSpan: '2|1', rowSpan: '1|1', field: 'end_deduct_qty', hAlign: 2, width: 60, type: 'Number', readOnly: true},
-        {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'end_deduct_tp', hAlign: 2, width: 60, type: 'Number', readOnly: true},
-        {title: '材料来源', colSpan: '1', rowSpan: '2', field: 'source', hAlign: 0, width: 80, formatter: '@'},
-        {title: '单据号', colSpan: '1', rowSpan: '2', field: 'bills_code', hAlign: 0, width: 80, formatter: '@'},
-        {title: '检验单编号', colSpan: '1', rowSpan: '2', field: 'check_code', hAlign: 0, width: 80, formatter: '@'},
-        {title: '备注', colSpan: '1', rowSpan: '2', field: 'memo', hAlign: 0, width: 100, formatter: '@', cellType: 'ellipsisAutoTip'}
-    ],
-    emptyRows: 3,
-    headRows: 2,
-    headRowHeight: [25, 25],
-    defaultRowHeight: 21,
-    headerFont: '12px 微软雅黑',
-    font: '12px 微软雅黑',
-};
 $(document).ready(() => {
     autoFlashHeight();
+    const spreadSetting = {
+        cols: [
+            {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 185, formatter: '@'},
+            {title: '单位', colSpan: '1', rowSpan: '2', field: 'unit', hAlign: 1, width: 50, formatter: '@', cellType: 'unit'},
+            {title: '单价', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 60, type: 'Number'},
+            {title: '本期到场|数量',  colSpan: '2|1', rowSpan: '1|1', field: 'arrive_qty', hAlign: 2, width: 60, type: 'Number'},
+            {title: '|金额',  colSpan: '|1', rowSpan: '|1', field: 'arrive_tp', hAlign: 2, width: 60, type: 'Number'},
+            {title: '截止本期到场|数量', colSpan: '2|1', rowSpan: '1|1', field: 'end_arrive_qty', hAlign: 2, width: 60, type: 'Number', readOnly: true},
+            {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'end_arrive_tp', hAlign: 2, width: 60, type: 'Number', readOnly: true},
+            {title: '本期扣回|数量', colSpan: '2|1', rowSpan: '1|1', field: 'deduct_qty', hAlign: 2, width: 60, type: 'Number'},
+            {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'deduct_tp', hAlign: 2, width: 60, type: 'Number', readOnly: true},
+            {title: '截止本期扣回|数量', colSpan: '2|1', rowSpan: '1|1', field: 'end_deduct_qty', hAlign: 2, width: 60, type: 'Number', readOnly: true},
+            {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'end_deduct_tp', hAlign: 2, width: 60, type: 'Number', readOnly: true},
+            {title: '材料来源', colSpan: '1', rowSpan: '2', field: 'source', hAlign: 0, width: 80, formatter: '@'},
+            {title: '单据号', colSpan: '1', rowSpan: '2', field: 'bills_code', hAlign: 0, width: 80, formatter: '@'},
+            {title: '检验单编号', colSpan: '1', rowSpan: '2', field: 'check_code', hAlign: 0, width: 80, formatter: '@'},
+            {title: '备注', colSpan: '1', rowSpan: '2', field: 'memo', hAlign: 0, width: 100, formatter: '@', cellType: 'ellipsisAutoTip'}
+        ],
+        emptyRows: 3,
+        headRows: 2,
+        headRowHeight: [25, 25],
+        defaultRowHeight: 21,
+        headerFont: '12px 微软雅黑',
+        font: '12px 微软雅黑',
+        readOnly: readOnly,
+    };
     const jgclSpread = SpreadJsObj.createNewSpread($('#jgcl-spread')[0]);
     const jgclSheet = jgclSpread.getActiveSheet();
     SpreadJsObj.initSheet(jgclSheet, spreadSetting);

+ 4 - 0
app/public/js/se_other.js

@@ -22,6 +22,9 @@ $(document).ready(() => {
             {
                 title: '时间', colSpan: '1', rowSpan: '1', field: 'real_time', hAlign: 2, width: 120, readOnly: true,
                 formatter: 'yyyy-MM-dd', cellType: 'activeImageBtn', normalImg: '#ellipsis-icon', indent: 5,
+                showImage: function (data) {
+                    return data !== undefined && data !== null;
+                }
             },
             {title: '备注', colSpan: '1', rowSpan: '1', field: 'memo', hAlign: 0, width: 180, formatter: '@', cellType: 'ellipsisAutoTip'}
         ],
@@ -31,6 +34,7 @@ $(document).ready(() => {
         defaultRowHeight: 21,
         headerFont: '12px 微软雅黑',
         font: '12px 微软雅黑',
+        readOnly: readOnly,
         getColor: function (sheet, data, row, col, defaultColor) {
             if (data) {
                 if (data.total_price) {

+ 29 - 1
app/public/js/spreadjs_rela/spreadjs_zh.js

@@ -389,6 +389,32 @@ const SpreadJsObj = {
             return backColor;
         }
     },
+    _loadRowStyle: function (sheet, row) {
+        sheet.zh_setting.cols.forEach(function (col, j) {
+            const cell = sheet.getCell(row, j);
+
+            if (col.font) {
+                cell.font(col.font);
+            }
+
+            if (col.foreColor && Object.prototype.toString.apply(col.foreColor) !== "[object Function]") {
+                cell.foreColor(col.foreColor);
+            }
+
+            if (col.readOnly && Object.prototype.toString.apply(col.readOnly) !== "[object Function]") {
+                cell.locked(col.readOnly || sheet.zh_setting.readOnly || false);
+            }
+            cell.vAlign(1).hAlign(col.hAlign);
+
+            if (col.formatter) {
+                cell.formatter(col.formatter);
+            } else if (col.type === 'Number') {
+                cell.formatter(SpreadJsObj.Formatter.getNumberFormatter('0.######'));
+            }
+
+            cell.setBorder(sheet.borderLine, {all: true});
+        });
+    },
     _loadRowData: function (sheet, data, row) {
         // 单元格重新写入数据
         if (!data) { return }
@@ -433,7 +459,6 @@ const SpreadJsObj = {
 
             cell.setBorder(sheet.borderLine, {all: true});
         });
-
     },
     _addActivePaintEvents: function (sheet, cellType) {
         if (!sheet.ActiveType) {
@@ -573,6 +598,9 @@ const SpreadJsObj = {
                     self._loadRowData(sheet, data, i);
                     sheet.setRowVisible(i, data.visible);
                 });
+                for (let iRow = sortData.length - 1; iRow < totalRow; iRow++) {
+                    self._loadRowStyle(sheet, iRow);
+                }
             }
             // 设置列单元格格式
             sheet.zh_setting.cols.forEach(function (col, j) {

+ 1 - 1
app/view/stage_extra/sub_menu_list.ejs

@@ -1,7 +1,7 @@
 <div class="nav-box">
     <ul class="nav-list list-unstyled">
         <li>
-            <a href="/tender/<%= ctx.tender.id %>/measure/stage/<%= ctx.stage.order %>"><span class="ml-3"><i class="fa fa-chevron-left "></i> 返回</span></a>
+            <a class="text-primary" href="/tender/<%= ctx.tender.id %>/measure/stage/<%= ctx.stage.order %>"><i class="fa fa-chevron-left"></i><span class="ml-1">返回</span></a>
         </li>
     </ul>
 </div>