From 559771a80cf779dc13a84ecd2f178e6ca5a8353a Mon Sep 17 00:00:00 2001
From: FUYU <fuyu@prec-tech.com>
Date: 星期五, 19 五月 2023 15:52:16 +0800
Subject: [PATCH] 备份省目标录入

---
 force-app/main/default/pages/SetProvinceTarget.page |   63 +++++++++++++++++++++++++------
 1 files changed, 51 insertions(+), 12 deletions(-)

diff --git a/force-app/main/default/pages/SetProvinceTarget.page b/force-app/main/default/pages/SetProvinceTarget.page
index 48ea85f..85fbdc4 100644
--- a/force-app/main/default/pages/SetProvinceTarget.page
+++ b/force-app/main/default/pages/SetProvinceTarget.page
@@ -1,4 +1,4 @@
-<apex:page id="Page" showHeader="false" sidebar="false" Controller="SetProvinceTargetController" action="{!init}">
+<apex:page id="Page" showHeader="false" sidebar="false" Controller="SetProvinceTargetController" action="{!init}" lightningStylesheets="true">
 <head>
 <title>鍚勭渷鐩爣璁惧畾</title>
     
@@ -8,6 +8,20 @@
 <apex:includeScript value="{!URLFOR($Resource.jqueryTableFix)}"/>
 
 <script type="text/javascript">
+function DisableAllButtons (actionText) {
+    var button = document.getElementById("Page:Form:headBlock:setTarget");
+    button.disabled = true;
+    button.classList.add("btnDisabled");
+}
+function UpdateJs(actionText) {
+    blockme();
+    if (window.confirm('纭畾瑕佸弽搴斿埌鐩爣鍚楋紵')) {
+        Update();
+        DisableAllButtons(actionText);
+    } else {
+        unblockUI();
+    }
+}
 function checkMoney(val, id) {
     // changeFlg銈汇儍銉�
     j$(escapeVfId('Page:Form:editBlock:changeFlg')).val(1);
@@ -29,6 +43,12 @@
 }
 
 function calc() {
+    debugger;
+     // DB202305259561 fy 20230517 start
+    // var JianDangfalg3 =j$(escapeVfId('Page:Form:editBlock:JianDangfalg')).value();
+    var JianDangfalg3 = '{!JianDangfalg}';
+     // DB202305259561 fy 20230517 end
+    // alert('sss= '+s);
     var isorgtbl = j$('div[name=bodyTable]');
     var tbl = document.getElementById('MainTable');
     var datarows = tbl.rows.length;
@@ -37,15 +57,21 @@
         datarows -= 2;
     }
     var allSum = 0;
-    var cols = [0, 0, 0, 0, 0, 0, 0, 0];
+    //DB202305277681 fy 20230517 start
+    // var cols = [0, 0, 0, 0, 0, 0, 0, 0];
+    var cols = [0, 0, 0, 0, 0, 0, 0, 0, 0];
+    //DB202305277681 fy 20230517 end
     // 琛�
     for (var i = 0; i < datarows; i++) {
         var rowSum = 0;
         // 鍒�
-        for (var j = 0; j < 8; j++) {
+        for (var j = 0; j < 9; j++) {
             var amount = 0;
-            
-            var raw = j$(escapeVfId('Page:Form:editBlock:dbRepeat:' + i + ':amountRepeat:' + j + ':inAmountValue')).value();
+            var x=j;
+            if(JianDangfalg3=='true'){
+                x=j+1;
+            }
+            var raw = j$(escapeVfId('Page:Form:editBlock:dbRepeat:' + i + ':amountRepeat:' + x + ':inAmountValue')).value();
             raw = (raw + '').replace(/[^0-9+\-Ee.]/g, '');
             
             var amount = localParseFloat(raw);
@@ -58,7 +84,7 @@
 
     }
     // 鍒�
-    for (var j = 0; j < 8; j++) {
+    for (var j = 0; j < 9; j++) {
         j$(escapeVfId('totalcol' + j)).text(toNumComma(cols[j]));
     }
     // 绶忚▓
@@ -125,6 +151,7 @@
 }
 function hiddeHalf(){
     var tbl = document.getElementById('MainTable');
+    console.warn('123123++++'+tbl.rows.length);
     for(var i = 0; i< tbl.rows.length;i++){
         //Page:Form:editBlock:dbRepeat:0:owner_mlktp
         if(document.getElementById("Page:Form:editBlock:dbRepeat:"+i+":owner_mlktp")){
@@ -195,6 +222,7 @@
          <apex:param name="csvData" value="" />
      </apex:actionFunction>
     <!--CHAN-BDQBLX  20210129 you end -->
+    <apex:actionFunction name="Update" action="{!UpdateBtn}" rerender="MessageP,dataBlock,ButtonTable" oncomplete="unblockUI();" />
     <apex:actionFunction name="save" action="{!saveBtn}" rerender="MessageP,editBlock" oncomplete="unblockUI();" />
     <apex:actionFunction name="next" action="{!next}" rerender="Form" oncomplete="unblockUI();">
         <apex:param name="saveFlg" assignTo="{!saveFlg}" value="" />
@@ -226,6 +254,7 @@
                 
                 <!--CHAN-BDQBLX  20210129 you start -->
                 <td align="center" width="10%">
+                    <apex:commandButton value="鍙嶅簲鍒扮洰鏍�" rerender="dummy" onclick="UpdateJs(this);return false;" rendered="{!Not(isPast)}" id="setTarget"/>
                     <apex:commandbutton onclick="exportJs();return false;" id="export" value="瀵煎嚭鏁版嵁妯℃澘">
                 </apex:commandbutton>
                     <apex:commandButton onclick="openPopupCSV(); return false;" value="瀵煎叆" rerender="Form"/>
@@ -237,7 +266,7 @@
             <tr>
                 <td width="15%"></td>
                 <td align="center">
-                    <apex:commandButton value="淇濆瓨" rerender="dummy" onclick="saveJs();return false;" rendered="{!Not(isPast) && loginUser.ProfileId == $Label.ProfileId_SystemAdmin}"/>
+                    <apex:commandButton value="淇濆瓨" rerender="dummy" onclick="saveJs();return false;" rendered="{!Not(isPast) && (loginUser.ProfileId == $Label.ProfileId_SystemAdmin || JianDangfalg)}"/>
                 </td>
                 <td width="15%" align="right"><apex:commandButton action="{!backBtn}" value="杩斿洖" rerender="dummy"/></td>
             </tr>    
@@ -261,7 +290,7 @@
                 <tr class="headerRow">
                     <th width="110px" class="headerRow  booleanColumn" id="baseName">閿�鍞湰閮�</th>
                     <th width="110px" class="headerRow  booleanColumn">鐪�</th>
-                    <th width="110px" class="headerRow  booleanColumn" id="NameHeader">鎷呭綋</th>
+                    <!-- <th width="110px" class="headerRow  booleanColumn" id="NameHeader">鎷呭綋</th> -->
                     <th width="30" class="headerRow  booleanColumn"></th>
                     <apex:repeat value="{!opportunity_category}" var="oc" id="opportunityCategoryRepeat">
                         <th width="85" class="headerRow  booleanColumn"><apex:outputText id="categoryValue" value="{!oc}"></apex:outputText></th>
@@ -271,11 +300,15 @@
             </thead>
             <tbody>
             <apex:variable value="{!1}" var="cnt" />
+                <apex:inputHidden id="JianDangfalg" value="{!JianDangfalg}"/>
                 <tr class="dataRow {!IF(MOD(cnt, 2)==0, 'odd', 'even')} {!IF(cnt==1, 'first', '')}" bgcolor="#AAAACC">
                     <td class="dataCell" ></td>
                     <td class="dataCell" ></td>
-                    <td class="dataCell" id="NameHold"></td>
+                    <!-- <td class="dataCell" id="NameHold"></td> -->
                     <td class="dataCell" style="text-align:center;">鍚堣</td>
+                    <apex:variable value="JianDangfalg" var="JianDangfalg2" rendered="{!IF(JianDangfalg, true, false)}" >
+                    <td class="dataCell" style="text-align:right;" id="totalcol9"></td>
+                    </apex:variable>
                     <td class="dataCell" style="text-align:right;" id="totalcol0"></td>
                     <td class="dataCell" style="text-align:right;" id="totalcol1"></td>
                     <td class="dataCell" style="text-align:right;" id="totalcol2"></td>
@@ -284,13 +317,19 @@
                     <td class="dataCell" style="text-align:right;" id="totalcol5"></td>
                     <td class="dataCell" style="text-align:right;" id="totalcol6"></td>
                     <td class="dataCell" style="text-align:right;" id="totalcol7"></td>
+                    <!-- DB202305277681 fy 20230517 start -->
+                    <td class="dataCell" style="text-align:right;" id="totalcol8"></td>
+                    <!-- DB202305277681 fy 20230517 end -->
                     <td class="dataCell" style="text-align:right;" id="totalAll"></td>
                 </tr>
                 <apex:repeat value="{!dataBeans}" var="dbs" id="dbRepeat">
                     <tr class="dataRow {!IF(MOD(cnt, 2)==0, 'odd', 'even')} {!IF(cnt==1, 'first', '')}">
                         <td class="dataCell">{!dbs.department}</td>
                         <td class="dataCell"><apex:outputField value="{!dbs.opportunity.SAP_Province__c}"></apex:outputField></td>
-                        <td class="dataCell" id="opportunity.Owner_System__c"><apex:inputField id="owner" value="{!dbs.opportunity.Owner_System__c}" onchange="checkOwner(this.value, this.id, {!cnt});" style="width:80%;"></apex:inputField></td>
+                        <!-- <td class="dataCell" id="opportunity.Owner_System__c">
+                            <apex:inputField id="owner" value="{!dbs.opportunity.Owner_System__c}" onchange="checkOwner(this.value, this.id, {!cnt});" style="width:80%;">
+                            </apex:inputField>
+                        </td> -->
                         <td class="dataCell" id="SumCal" >
                         </td>
                         <apex:variable value="{!1}" var="cnt2" />
@@ -320,8 +359,8 @@
 <script type="text/javascript">
 //鍒朵綔鍒嗗壊鏍忔晥鏋�
 j$(function() {
-    var blockHeight = j$(window).innerHeight() - j$(escapeVfId('Page:Form:headBlock')).height() - 60;
-    j$(escapeVfId('MainTable')).tablefix({height: blockHeight, fixRows: 2, fixCols: 4,id:"LeftTable"});
+    // var blockHeight = j$(window).innerHeight() - j$(escapeVfId('Page:Form:headBlock')).height() - 60;
+    // j$(escapeVfId('MainTable')).tablefix({height: blockHeight, fixRows: 2, fixCols: 4,id:"LeftTable"});
 });
 calc();
 hiddeHalf();

--
Gitblit v1.9.1