|
@@ -8,6 +8,32 @@
|
|
|
* @version
|
|
|
*/
|
|
|
|
|
|
+function generateChapterHtml(data) {
|
|
|
+ const html = [];
|
|
|
+ if (data) {
|
|
|
+ for (const d of data) {
|
|
|
+ html.push('<tr>');
|
|
|
+ if (d.code) {
|
|
|
+ html.push('<td>', d.code, '</td>');
|
|
|
+ html.push('<td>', d.name, '</td>');
|
|
|
+ } else {
|
|
|
+ html.push('<td colspan="2">', d.name, '</td>');
|
|
|
+ }
|
|
|
+ html.push('<td class="text-right">', d.deal_bills_tp ? d.deal_bills_tp : '', '</td>');
|
|
|
+ html.push('<td class="text-right">', d.total_price ? d.total_price : '', '</td>');
|
|
|
+ html.push('<td class="text-right">', d.contract_tp ? d.contract_tp : '', '</td>');
|
|
|
+ html.push('<td class="text-right">', d.qc_tp ? d.qc_tp : '', '</td>');
|
|
|
+ html.push('<td class="text-right">', d.gather_tp ? d.gather_tp : '', '</td>');
|
|
|
+ html.push('<td class="text-right">', d.end_contract_tp ? d.end_contract_tp : '', '</td>');
|
|
|
+ html.push('<td class="text-right">', d.end_qc_tp ? d.end_qc_tp : '', '</td>');
|
|
|
+ html.push('<td class="text-right">', d.end_gather_tp ? d.end_gather_tp : '', '</td>');
|
|
|
+ html.push('<td class="text-right">', d.end_final_tp ? d.end_final_tp : '', '</td>');
|
|
|
+ html.push('</tr>');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $('#chapter-list').html(html.join(''));
|
|
|
+}
|
|
|
+
|
|
|
$(document).ready(function () {
|
|
|
let per = _.toNumber(getLocalCache('StageGatherOverPercent'));
|
|
|
if (per && !_.isNaN(per)) {
|
|
@@ -46,16 +72,6 @@ $(document).ready(function () {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- // 上下窗口resizer
|
|
|
- $.divResizer({
|
|
|
- select: '#main-resize',
|
|
|
- callback: function () {
|
|
|
- gclSpread.refresh();
|
|
|
- let bcontent = $(".bcontent-wrap") ? $(".bcontent-wrap").height() : 0;
|
|
|
- $(".sp-wrap").height(bcontent-40);
|
|
|
- leafXmjSpread.refresh();
|
|
|
- }
|
|
|
- });
|
|
|
// 解析清单汇总数据
|
|
|
gclGatherModel.loadLedgerData(ledger, curLedgerData, preLedgerData);
|
|
|
gclGatherModel.loadPosData(pos, curPosData, prePosData);
|
|
@@ -111,4 +127,72 @@ $(document).ready(function () {
|
|
|
setLocalCache('StageGatherOverPercent', this.value);
|
|
|
checkOverRange();
|
|
|
});
|
|
|
+ const chapterData = gclGatherModel.gatherChapterData(chapter, ['total_price', 'contract_tp', 'qc_tp', 'pre_contract_tp', 'pre_qc_tp']);
|
|
|
+ for (const c of chapterData) {
|
|
|
+ c.gather_tp = ZhCalc.add(c.contract_tp, c.qc_tp);
|
|
|
+ c.end_contract_tp = ZhCalc.add(c.contract_tp, c.pre_contract_tp);
|
|
|
+ c.end_qc_tp = ZhCalc.add(c.qc_tp, c.pre_qc_tp);
|
|
|
+ c.end_gather_tp = ZhCalc.add(c.end_contract_tp, c.end_qc_tp);
|
|
|
+ c.end_final_tp = ZhCalc.add(c.end_qc_tp, c.total_price);
|
|
|
+ }
|
|
|
+ generateChapterHtml(chapterData);
|
|
|
+
|
|
|
+ // 展开收起附件
|
|
|
+ $('a', '.right-nav').bind('click', function () {
|
|
|
+ const tab = $(this), tabPanel = $(tab.attr('content'));
|
|
|
+ const showTools = function (show) {
|
|
|
+ const left = $('#left-view'), right = $('#right-view'), parent = left.parent();
|
|
|
+ if (show) {
|
|
|
+ right.show();
|
|
|
+ autoFlashHeight();
|
|
|
+ /**
|
|
|
+ * right.show()后, parent被撑开成2倍left.height, 导致parent.width减少了10px
|
|
|
+ * 第一次left.width调整后,parent的缩回left.height, 此时parent.width又增加了10px
|
|
|
+ * 故需要通过最终的parent.width再计算一次left.width
|
|
|
+ *
|
|
|
+ * Q: 为什么不通过先计算left.width的宽度,以避免计算两次left.width?
|
|
|
+ * A: 右侧工具栏不一定显示,当右侧工具栏显示过一次后,就必须使用parent和right来计算left.width
|
|
|
+ *
|
|
|
+ */
|
|
|
+ //left.css('width', parent.width() - right.outerWidth());
|
|
|
+ //left.css('width', parent.width() - right.outerWidth());
|
|
|
+ const percent = 100 - right.outerWidth() /parent.width() * 100;
|
|
|
+ left.css('width', percent + '%');
|
|
|
+ } else {
|
|
|
+ right.hide();
|
|
|
+ left.css('width', '100%');
|
|
|
+ }
|
|
|
+ };
|
|
|
+ if (!tab.hasClass('active')) {
|
|
|
+ $('a', '.side-menu').removeClass('active');
|
|
|
+ $('.tab-content .tab-select-show').removeClass('active');
|
|
|
+ tab.addClass('active');
|
|
|
+ tabPanel.addClass('active');
|
|
|
+ showTools(tab.hasClass('active'));
|
|
|
+ } else {
|
|
|
+ tab.removeClass('active');
|
|
|
+ tabPanel.removeClass('active');
|
|
|
+ showTools(tab.hasClass('active'));
|
|
|
+ }
|
|
|
+ gclSpread.refresh();
|
|
|
+ leafXmjSpread.refresh();
|
|
|
+ });
|
|
|
+
|
|
|
+ // 上下窗口resizer
|
|
|
+ $.divResizer({
|
|
|
+ select: '#main-resize',
|
|
|
+ callback: function () {
|
|
|
+ gclSpread.refresh();
|
|
|
+ let bcontent = $(".bcontent-wrap") ? $(".bcontent-wrap").height() : 0;
|
|
|
+ $(".sp-wrap").height(bcontent-40);
|
|
|
+ leafXmjSpread.refresh();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $.divResizer({
|
|
|
+ select: '#right-spr',
|
|
|
+ callback: function () {
|
|
|
+ gclSpread.refresh();
|
|
|
+ leafXmjSpread.refresh();
|
|
|
+ }
|
|
|
+ });
|
|
|
});
|