Просмотр исходного кода

1. 合同支付,计算基数相关
2. 项目概况,进度显示颜色、日期可delete删除

MaiXinRong 1 день назад
Родитель
Сommit
5018bb046b

+ 8 - 0
app/public/js/global.js

@@ -1297,6 +1297,14 @@ const spreadColor = {
     },
     revise: {
         used: '#F2F2F2',
+    },
+    sub_proj: {
+        done: '#28a745',
+        doing: '#da9500',
+        done_back: '#d4edda',
+        done_fore: '#155724',
+        doing_back: '#fff3cd',
+        doing_fore: '#856404',
     }
 };
 const featureShowCache = 'zh-feature-show';

+ 10 - 4
app/public/js/sp_progress.js

@@ -1,4 +1,10 @@
 const progressCombo = [{ text: '', value: '' }, { text: '进行中', value: '进行中' }, { text: '已完成', value: '已完成' }];
+const progressForeColor = function(data, defaultColor, col) {
+    if (!data || !col) return defaultColor;
+    if (data[col.field] === '进行中') return spreadColor.sub_proj.doing;
+    if (data[col.field] === '已完成') return spreadColor.sub_proj.done;
+    return defaultColor;
+};
 
 $(document).ready(() => {
     autoFlashHeight();
@@ -24,7 +30,7 @@ $(document).ready(() => {
                 cols: [
                     {title: '序号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 165, formatter: '@', cellType: 'tree'},
                     {title: '阶段/项目名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 210, formatter: '@', cellType: 'autoTip'},
-                    {title: '成果编制|进度', colSpan: '3|1', rowSpan: '1|1', field: 'edit_progress', hAlign: 1, width: 80, formatter: '@', cellType: 'customizeCombo', comboItems: progressCombo },
+                    {title: '成果编制|进度', colSpan: '3|1', rowSpan: '1|1', field: 'edit_progress', hAlign: 1, width: 80, formatter: '@', cellType: 'customizeCombo', comboItems: progressCombo, foreColor: progressForeColor },
                     {
                         title: '|日期', colSpan: '|1', rowSpan: '|1', field: 'edit_date', hAlign: 2, width: 80, readOnly: true,
                         formatter: 'yyyy-MM-dd', cellType: 'activeImageBtn', normalImg: '#ellipsis-icon', indent: 5,
@@ -33,7 +39,7 @@ $(document).ready(() => {
                         }
                     },
                     {title: '|部门', colSpan: '|1', rowSpan: '|1', field: 'edit_department', hAlign: 2, width: 120, formatter: '@', },
-                    {title: '报审情况|进度', colSpan: '3|1', rowSpan: '1|1', field: 'submit_progress', hAlign: 1, width: 80, formatter: '@', cellType: 'customizeCombo', comboItems: progressCombo },
+                    {title: '报审情况|进度', colSpan: '3|1', rowSpan: '1|1', field: 'submit_progress', hAlign: 1, width: 80, formatter: '@', cellType: 'customizeCombo', comboItems: progressCombo, foreColor: progressForeColor},
                     {
                         title: '|日期', colSpan: '|1', rowSpan: '|1', field: 'submit_date', hAlign: 2, width: 80, readOnly: true,
                         formatter: 'yyyy-MM-dd', cellType: 'activeImageBtn', normalImg: '#ellipsis-icon', indent: 5,
@@ -42,7 +48,7 @@ $(document).ready(() => {
                         }
                     },
                     {title: '|部门', colSpan: '|1', rowSpan: '|1', field: 'submit_department', hAlign: 2, width: 120, formatter: '@', },
-                    {title: '批复情况|进度', colSpan: '4|1', rowSpan: '1|1', field: 'reply_progress', hAlign: 1, width: 80, formatter: '@', cellType: 'customizeCombo', comboItems: progressCombo },
+                    {title: '批复情况|进度', colSpan: '4|1', rowSpan: '1|1', field: 'reply_progress', hAlign: 1, width: 80, formatter: '@', cellType: 'customizeCombo', comboItems: progressCombo, foreColor: progressForeColor },
                     {
                         title: '|日期', colSpan: '|1', rowSpan: '|1', field: 'reply_date', hAlign: 2, width: 80, readOnly: true,
                         formatter: 'yyyy-MM-dd', cellType: 'activeImageBtn', normalImg: '#ellipsis-icon', indent: 5,
@@ -399,7 +405,7 @@ $(document).ready(() => {
                 for (let iCol = sel.col; iCol < sel.col + sel.colCount; iCol++) {
                     const col = sheet.zh_setting.cols[iCol];
                     const style = sheet.getStyle(iRow, iCol);
-                    if (style.locked) continue;
+                    if (style.locked && col.field.indexOf('_date') < 0) continue;
 
                     data[col.field] = col.type === 'Number' ? 0 : '';
                     bDel = true;

+ 5 - 13
app/public/js/spreadjs_rela/spreadjs_zh.js

@@ -464,8 +464,8 @@ const SpreadJsObj = {
             cell.formatter(col.formatter);
         }
 
-        cell.backColor(SpreadJsObj._getBackColor(sheet, data, iRow, col));
-        cell.foreColor(SpreadJsObj._getForeColor(sheet, data, iRow, col));
+        cell.backColor(SpreadJsObj._getBackColor(sheet, data, iRow, col, cell.backColor()));
+        cell.foreColor(SpreadJsObj._getForeColor(sheet, data, iRow, col, cell.foreColor()));
 
         cell.setBorder(sheet.borderLine, {all: true});
     },
@@ -473,7 +473,7 @@ const SpreadJsObj = {
         let foreColor = sheet.getDefaultStyle().foreColor;
         if (col.foreColor) {
             if (Object.prototype.toString.apply(col.foreColor) === "[object Function]") {
-                foreColor = col.foreColor(data, foreColor);
+                foreColor = col.foreColor(data, foreColor, col);
             } else {
                 foreColor = col.foreColor || foreColor;
             }
@@ -602,14 +602,6 @@ const SpreadJsObj = {
             cell.font(font);
             if (col.textIndent) cell.textIndent(col.textIndent);
 
-            if (col.foreColor) {
-                if (Object.prototype.toString.apply(col.foreColor) === "[object Function]") {
-                    cell.foreColor(col.foreColor(data, sheet.getDefaultStyle().foreColor));
-                } else {
-                    cell.foreColor(col.foreColor);
-                }
-            }
-
             const readOnly1 = (sheet.zh_setting.readOnly && Object.prototype.toString.apply(sheet.zh_setting.readOnly) === "[object Function]")
                 ? sheet.zh_setting.readOnly(data) : (sheet.zh_setting.readOnly || false);
             const readOnly2 = (col.readOnly && Object.prototype.toString.apply(col.readOnly) === "[object Function]")
@@ -626,8 +618,8 @@ const SpreadJsObj = {
                 cell.formatter(col.formatter);
             }
 
-            cell.backColor(SpreadJsObj._getBackColor(sheet, data, row, col));
-            cell.foreColor(SpreadJsObj._getForeColor(sheet, data, row, col));
+            cell.backColor(SpreadJsObj._getBackColor(sheet, data, row, col, cell.backColor()));
+            cell.foreColor(SpreadJsObj._getForeColor(sheet, data, row, col, cell.foreColor()));
 
             cell.setBorder(sheet.borderLine, {all: true});
             if (col.visible === undefined) col.visible = 1;

+ 7 - 7
app/service/phase_pay.js

@@ -125,18 +125,18 @@ module.exports = app => {
                 result.pc_tp = this.ctx.helper.add(result.pc_tp, stage.pc_tp);
 
                 const qdSum = await this.ctx.service.stageBills.getSumTotalPriceGcl(stage);
-                result.qd_contract_tp = qdSum.contract_tp || 0;
-                result.qd_qc_tp = qdSum.qc_tp || 0;
-                result.qd_pc_tp = qdSum.pc_tp || 0;
+                result.qd_contract_tp = this.ctx.helper.add(qdSum.contract_tp || 0, result.qd_contract_tp);
+                result.qd_qc_tp = this.ctx.helper.add(qdSum.qc_tp || 0, result.qd_qc_tp);
+                result.qd_pc_tp = this.ctx.helper.add(qdSum.pc_tp || 0, result.qd_pc_tp);
 
                 const sumGcl = await this.ctx.service.stageBills.getSumTotalPriceGcl(stage, '^[^0-9]*([0-9]{0,2}-)?1[0-9]{2}(-|$)');
                 const sumPc = await this.ctx.service.stageBillsPc.getSumTotalPriceGcl(stage, '^[^0-9]*([0-9]{0,2}-)?1[0-9]{2}(-|$)');
-                result.gather_100_tp = this.ctx.helper.sum([sumGcl.contract_tp, sumGcl.qc_tp, sumPc.pc_tp]);
+                result.gather_100_tp = this.ctx.helper.sum([sumGcl.contract_tp, sumGcl.qc_tp, sumPc.pc_tp, result.gather_100_tp]);
 
                 const bg = await this.ctx.service.stage.getChangeSubtotal(stage);
-                result.common_bg_tp = bg.common || 0;
-                result.more_bg_tp = bg.more || 0;
-                result.great_bg_tp = bg.great || 0;
+                result.common_bg_tp = this.ctx.helper.add(bg.common || 0, result.common_bg_tp);
+                result.more_bg_tp = this.ctx.helper.add(bg.more || 0, result.more_bg_tp);
+                result.great_bg_tp = this.ctx.helper.add(bg.great || 0, result.great_bg_tp);
             }
             result.gather_tp = this.ctx.helper.sum([result.contract_tp, result.qc_tp, result.pc_tp]) || 0;
             result.qd_gather_tp = this.ctx.helper.sum([result.qd_contract_tp, result.qd_qc_tp, result.qd_pc_tp]) || 0;

+ 2 - 0
app/view/sub_proj/info.ejs

@@ -57,6 +57,8 @@
                                         <option value="改建" <%if (info.proj_quality === '改建') { %>selected<% } %>>改建</option>
                                         <option value="扩建" <%if (info.proj_quality === '扩建') { %>selected<% } %>>扩建</option>
                                         <option value="改扩建" <%if (info.proj_quality === '改扩建') { %>selected<% } %>>改扩建</option>
+                                        <option value="新改建" <%if (info.proj_quality === '新改建') { %>selected<% } %>>新改建</option>
+                                        <option value="新扩建" <%if (info.proj_quality === '新扩建') { %>selected<% } %>>新扩建</option>
                                     </select>
                                 </div>
                             </div>