2022年12月7日 星期三

V120501– 顯示子畫面 - [新增領用登記] - Form - 子視窗

目的: V120501– 開啟子視窗 - [新增領用登記]  - Form

處理說明: 1>開啟子視窗 - 
                       var win = getMyWindow("新增領用登記", J_formFields_Sub1mySub1_Btns);        
                  2>定義子視窗_button
                      var mySub1_Btns = [
                         {
                            xtype: 'button', text: '確定', id: 'OkBtn_mySub1',
                           listeners: {
                               click: function () {  ..  }
                           
                  3>定義子視窗_欄位
                      var J_formFields_Sub1 = [
                  {
                           bodyStyle: "background-color:transparent;", border: false, layout: "vbox", padding: "5", items: [
                  {        



1>*.js

 //按鈕 : [新增領用登記] [掃描登記][查詢領用記錄]
    var BtnAry = [
        {
            xtype: 'button', text: '新增領用登記', id: 'UseRegBtn',
            listeners: {
                click: function () {
                    AddRegBtn_click();                    
                }
            }
        },

//新增 [新增領用登記]鈕    
    function AddRegBtn_click() {
        console.log(" 1 inside - AddRegBtn_Click 新增領用登記: ");
        //1>檢核資料是否正確 - 是否有選擇資料        
        var cur_recs = Ext.getCmp('grid_Single').getSelectionModel().getSelection(); //grid select指向選擇的第一筆        
        var cur_rec = cur_recs[0];
        console.log("cur_rec[raw][QTY]:", cur_rec["raw"]["QTY"]);
        var np1 = {};
        np1["CPNO"] = cur_rec["raw"]["CPNO"];
        np1["MATNR"] = cur_rec["raw"]["MATNR"];
        np1["WH"] = cur_rec["raw"]["WH"];
        np1["SP"] = cur_rec["raw"]["SP"];        
        np1["QTY"] = cur_rec["raw"]["QTY"];
        np1["RQTY"] = cur_rec["raw"]["RQTY"];
        np1["UNIT"] = cur_rec["raw"]["UNIT"];
        np1["CHARG"] = cur_rec["raw"]["CHARG"];        
        np1["NOTE"] = cur_rec["raw"]["NOTE"];
        np1["COMPER"] = loginInfo.id;        
        np1["PQTY"] = "";
        //2>顯示子畫面 - [新增領用登記]
        var mySub1_Btns = [
            {
                xtype: 'button', text: '確定', id: 'OkBtn_mySub1',
                listeners: {
                    click: function () {
                        //1>更新資料庫資料(AMM_COMPQTY)
                        var Tmp_Str = "";
                        if (checkisnull(Ext.getCmp("sub1_PQTY").getValue())){
                            Tmp_Str = "領用數量不可空白<br>"
                                            + " 敬請檢核 !!";
                            mywarnalert(Tmp_Str);
                            return;
                        }
                        if (Number(Ext.getCmp("sub1_PQTY").getValue()) > Number(Ext.getCmp("sub1_RQTY").getValue())) {
                            Tmp_Str = "領用數量(" + Ext.getCmp("sub1_PQTY").getValue() + ")不可大於剩餘數量(" + Ext.getCmp("sub1_RQTY").getValue() + ")<br>"
                                + " 敬請檢核 !!";
                            mywarnalert(Tmp_Str);
                            return;
                        }
                        np1["PQTY"] = Ext.getCmp("sub1_PQTY").getValue();
                        np1["SAPNO"] = Ext.getCmp("sub1_SAPNO").getValue();
                        np1["NOTE"] = Ext.getCmp("sub1_NOTE").getValue();
                        np1["COMPER"] = Ext.getCmp("sub1_COMPER").getValue();
                        np1["COMPDT"] = cnow();                      
                        Ext.Ajax.request({
                            method: 'POST',
                            params: np1,
                            async: false, //將非同步功能關閉
                            url: '../../api/V120501API/Add_AMMCOMPQTY_1',
                            success: function (response, opts) {
                                var obj = Ext.decode(response.responseText);
                                var Tmp_Str = obj["Rtn_Msg"];
                                var Tmp_success = obj["success"];
                                if (Tmp_success) {
                                    Tmp_Str = "[新增領用登記]成功 !!<br>"
                                                    + Tmp_Str;
                                    mysuccessalert(Tmp_Str);                                    
                                }
                                else {
                                    Tmp_Str = "[新增領用登記]失敗 !! <BR> "
                                                     + Tmp_Str;
                                    mywarnalert(Tmp_Str);                                    
                                }
                            },
                            failure: function (response, opts) {
                                var obj = Ext.decode(response.responseText);
                                var Tmp_Str = obj["Rtn_Msg"];
                                Tmp_Str = "[新增領用登記]失敗 !!<br>"                                    
                                                + Tmp_Str;
                                mywarnalert(Tmp_Str);                                
                                return;
                            }
                        });  // end of  Ext.Ajax.Request  for Email
                        //2> close windows
                        this.up("window").close();
                        this.up("window").destroy();
                        //3>重新更新 MDBGrid
                        Ext.getCmp("btn_Show").fireHandler();                        
                    }
                }
            },
            {
                xtype: 'button', text: '取消', id: 'CancelBtn_mySub1',
                listeners: {
                    click: function () {
                        this.up("window").close();
                        this.up("window").destroy();
                    }
                }
            },
        ];
        
        var win = getMyWindow("新增領用登記", J_formFields_Sub1, mySub1_Btns);        
        win.onshow = Sub1_onShow(np1);
        win.width = 600;
        win.height = 450;        
        win.show();
    };

2>V120201_json.js  -  子畫面欄位
// [新增領用登記]鈕  
var J_formFields_Sub1 = [
{
bodyStyle: "background-color:transparent;", border: false, layout: "vbox", padding: "5", items: [
{
xtype: "fieldcontainer", fieldLabel: "編號", labelWidth: 100, layout: "hbox", items: [
{ id: "sub1_CPNO", name: "sub1_CPNO", xtype: "textfield", width: 100, padding: "0 4 0 0", readOnly: true, fieldCls: "readonly", },
]
},  //end of 編號
{
xtype: "fieldcontainer", fieldLabel: "件號", labelWidth: 100, layout: "hbox", items: [
{ id: "sub1_MATNR", name: "sub1_MATNR", xtype: "textfield", width: 100, padding: "0 4 0 0", readOnly: true, fieldCls: "readonly", },
]
},   // end of 件號
{
xtype: "fieldcontainer", fieldLabel: "庫房", labelWidth: 100, layout: "hbox", items: [
{ id: "sub1_WH", name: "sub1_WH", xtype: "textfield", width: 100, padding: "0 4 0 0", readOnly: true, fieldCls: "readonly", },
]
}, // end of 庫房
{
xtype: "fieldcontainer", fieldLabel: "數量", labelWidth: 100, layout: "hbox", items: [
{ id: "sub1_QTY", name: "sub1_QTY", xtype: "textfield", width: 100, padding: "0 4 0 0", readOnly: true, fieldCls: "readonly",},
]
},  // end of 數量
{
xtype: "fieldcontainer", fieldLabel: "剩餘數量", labelWidth: 100, layout: "hbox", items: [
{ id: "sub1_RQTY", name: "sub1_RQTY", xtype: "textfield", width: 100, padding: "0 4 0 0", readOnly: true, fieldCls: "readonly", },
]
},  // end of 剩餘數量
{
xtype: "fieldcontainer", fieldLabel: "單位", labelWidth: 100, layout: "hbox", items: [
{ id: "sub1_UNIT", name: "sub1_UNIT", xtype: "textfield", width: 100, padding: "0 4 0 0", readOnly: true,fieldCls: "readonly", },
]
}, // end of 單位
{
xtype: "fieldcontainer", fieldLabel: "批次", labelWidth: 100, layout: "hbox", items: [
{ id: "sub1_CHARG", name: "sub1_CHARG", xtype: "textfield", width: 100, padding: "0 4 0 0", readOnly: true, fieldCls: "readonly", },
] // end of 批次.items
}, // end of 批次
{
xtype: "fieldcontainer", fieldLabel: "儲存位置", labelWidth: 100, layout: "hbox", items: [
{ id: "sub1_SP", name: "sub1_SP", xtype: "textfield", width: 100, padding: "0 4 0 0", readOnly: true, fieldCls: "readonly", },
]
}, // end of 儲存位置
{
xtype: "fieldcontainer", fieldLabel: "領用數量", labelWidth: 100, layout: "hbox", items: [
{ id: "sub1_PQTY", name: "sub1_PQTY", xtype: "textfield", width: 100, padding: "0 4 0 0", fieldCls: "required",  },
]
}, // end of 領用數量
{
xtype: "fieldcontainer", fieldLabel: "領用人員", labelWidth: 100, layout: "hbox", items: [
{ id: "sub1_COMPER", name: "sub1_COMPER", xtype: "textfield", width: 100, padding: "0 4 0 0", fieldCls: "required", },
{ id: "sub1_COMPER_", name: "sub1_COMPER_", xtype: "textfield", width: 100, padding: "0 4 0 0", fieldCls: "readonly", },
{
id: "btn_sub1_COMPER", name: "btn_sub1_COMPER", xtype: "button", text: "...",
//員工編號挑選 , TreeView 挑選    
handler: function () {
console.log(" btn_sub1_COMPER on click");
var treepanel = Ext.create('EmployeeTree', {
id: 'myEmployeeTree',
listeners: {
itemclick: function (view, record, item, index, e) {
if (record.raw.leaf) {
var info = record.raw.text;
var newStr = info.split(":");
Ext.getCmp('sub1_COMPER').setValue(newStr[0]);
Ext.getCmp('sub1_COMPER_').setValue(newStr[1]);
win_tree.close();
}
}
}
});
var win_tree = getWindow('領用人員挑選', treepanel);
win_tree.height = 400;
win_tree.show();
} // end of handler of  btn_sub1_comper
},
]
}, // end of 領用人員
{
xtype: "fieldcontainer", fieldLabel: "領用工號", labelWidth: 100, layout: "hbox", items: [
{ id: "sub1_SAPNO", name: "sub1_SAPNO", xtype: "textfield", width: 100, padding: "0 4 0 0",  },
]
}, // end of 領用工號
{
xtype: "fieldcontainer", fieldLabel: "備註(使用架次)", labelWidth: 100, layout: "hbox", items: [
{ id: "sub1_NOTE", name: "sub1_NOTE", xtype: "textarea", width: 200, padding: "0 4 0 0",  },
]
}, // end of 備註
] // end of   layout: "vbox", padding: "5", items: [
}  //end of  J_formFields_Sub1 , items[{
]      //end of  J_formFields_Sub1 , items[

V80201 – [編審狀態]異動時, 依目前編審狀態改變 radioGroup選項

目的: V80201 – [編審狀態]異動時, 依目前編審狀態改變 radioGroup選項

處理說明: 1>[編審狀態]欄位的 EditPick 的 isSuspendevent 必需設為 false,
                      當[編審狀態]欄位異動時, change event 才會觸發
                  2>設定 radio1.setCheck(true);



2>*.js
{xtype: "fieldcontainer", fieldLabel: "編審狀態", labelWidth: 70, layout: "hbox", flex: 2,
             items: [
          { xtype: "textfield", id: "s_STAT", name: "s_STAT", width: 30, padding: "0 4 0 0", value: "C" },
          { xtype: "textfield", id: "s_STAT_NM_", name: "s_STAT_NM_", width: 80, padding: "0 4 0 0", readOnly: true, fieldCls: "readonly", value: "已核准" },
          {
             xtype: "button", id: "s_btn_STAT", name: "s_btn_STAT", text: "...",
             handler: function () {
                  //isSupendevent=false; 才會觸發 event 
                      var win = EditPickx('編審狀態', '../api/V80201API/get_s_STATPick', ['STAT', 'DESCPT'], ['s_STAT', 's_STAT_NM_'], J_pickstore_s_STAT, J_pickcolumns_s_STAT,
                                                true, false);
                                            win.show();
                                        }
                                    },
                                ]
                            },// end of s_編審狀態                    



Ext.getCmp("s_STAT").on("change", function (me, newValue, oldValue, eopts) {
    //Ext.getCmp("s_STAT").on("blur", function () {
        console.log("狀態 s_STAT change !!");
        var Tmp_STAT = Ext.getCmp('s_STAT').getValue();
        if (Tmp_STAT == "C") {  //已核准 - 處理完成日期
            Ext.getCmp("s_radio1").setValue(true);
            Ext.getCmp("s_radio2").setValue(false);
        }
        else {  //未核准 - 預計編審完成日期
            Ext.getCmp("s_radio1").setValue(false);
            Ext.getCmp("s_radio2").setValue(true);
        }
    });

2022年12月6日 星期二

V80201 - WebService 定義呼叫 操作說明 & 顯示傳回資料說明 - 若資料空白,則顯示"無符合的資料!!" - 錯誤訊息: 找到多個合約端點組態

 目的: V80201 - WebService 呼叫 & 顯示傳回資料說明  - AMM_PDM04

處理說明: 呼叫 WebService的步驟
                  1>將 WebService 的網址加入 專案  
                       - 方案總管 --> 參考  --> 加入服務參考
                       Ex: http://enovia/AMM/Service.asmx Method: AMM_PDM04
                  2>完成後, 
                       - 方案總管 --> Connect Service  --> 多一 AMM_PDM04
                  3>web.config 移除重複 endpoint 
                       - web.config  --> 移除重複 endpoint of AMM_PDM04
                  4>呼叫 AMM_PDM04 函式  
                       AMM_PDM04.ServiceSoapClient PDM04 = new AMM_PDM04.ServiceSoapClient();
                       DataSet ds = PDM04.AMM_PDM04("10-43-0301-001", "","AJT", "A", "0011", 
                                                                                     "",  "C", "2000/01/01","2022/12/05","", 
                                                                                     "");
                   5>若無符合條件的資料,則顯示訊息
                         if (gridstore.data.getCount() == 0) {
                                    mywarnalert("無符合條件的資料!!");
                                }

                   6>WebService 傳回 ds.tables , 修改成 T1 & T1C


1>Visual Studio 2019 IDE 操作畫面

1.    方案總管 à 參考 à 按右鍵 à 加入服務參考

Ex:  http://enovia/AMM/Service.asmx

    Method: AMM_PDM04



 

 

 

 

 

 

 

 

 

2.於加入服務參考視窗設置參數如下圖

    Ex:    AMM_PDM01



3.確定後可至方案總管 à Connected Service查看


  

4.web.config à 將重複的endpoint 移除

  --> 否則執行時,會出現 以致出現錯誤訊息(xx找到多個該合約的端點組態xx)

  --> 將其中一個 AMM_PLM04 刪除即可

   <endpoint address="http://enovia/AMM/Service.asmx" binding="customBinding"

        bindingConfiguration="ServiceSoap122" contract="AMM_PDM01.ServiceSoap"

        name="ServiceSoap12" />





   

4.呼叫webservice所提供之function



 

程式範例

ZRFC_ZM66.ZRFC_ZM66SoapClient sap = new ZRFC_ZM66.ZRFC_ZM66SoapClient();

DataSet ds = sap.CALL_Z_RFC_ZM66("1", MATNR, null, null, null, null, null, null, null, null, null, null, null, null, null);

DataTable dt = ds.Tables[0];

 

 

Sample2:  *.cs





using TLSWEB_AMM.AMM_PDM04;

AMM_PDM04.ServiceSoapClient PDM04 = new AMM_PDM04.ServiceSoapClient();

            DataSet ds = PDM04.AMM_PDM04("10-43-0301-001", "","AJT", "A", "0011",

                     "",  "C", "2000/01/01","2022/12/05","",

                                         "");

             //將 WebService 取得的 ds , 改成 TMGrid的格式 T1 & T1C

            DataTable dt = ds.Tables[0];
            dt.TableName = "T1";
            DataTable dt1 = ds.Tables.Add("T1C");
            dt1.Columns.Add("TOTAL", typeof(Int32));
            DataRow dr = ds.Tables["T1C"].NewRow();
            dr["TOTAL"] = dt.Rows.Count;
            ds.Tables["T1C"].Rows.Add(dr);
            return ds;




實例: Web改版:  V80201 - 呼叫WebService AMM_PDM04






4>
{
                        xtype: 'button',
                        id: 'btn_Show',
                        flex: 2,
                        border: 1,
                        text: '資料顯示',
                        iconCls: 'icon-search',
                        handler: function () {
                            //檢核 [專案配置][生產工廠]不可均空白
                            var Tmp_PDM_CONFIG = Ext.getCmp('s_PDM_CONFIG').getValue();
                            var Tmp_FACWC = Ext.getCmp('s_FACWC').getValue();
                            var Tmp_Str = "";
                            if ((checkisnull(Tmp_PDM_CONFIG)) && (checkisnull(Tmp_FACWC))) {
                                Tmp_Str = "[專案配置][生產工廠]不可均空白, 敬請檢核";
                                mywarnalert(Tmp_Str);
                                return;
                            }
                         var np = s_JSON('s_form'); //TMFunction.js, 組合form上的查詢條件為json參數傳遞                            
                            np["s_STAT"] = Ext.getCmp('s_STAT').getValue();
                            console.log(" np[s_STAT]  : ", np["s_STAT"]);
                            gridstore.getProxy().url = '../api/V80201API/getWebService_M';
                            gridstore.getProxy().extraParams = np; //分頁OK,篩選條件OK                                                        
                            gridstore.on("load", function () {
                                console.log("gridstore.onload !!");
                                if (gridstore.data.getCount() == 0) {
                                    mywarnalert("無符合條件的資料!!");
                                }
                            });
                            gridstore.load();
                        }    //end of  顯示資料.handler                       
                    },  // end of 顯示資料

2022年12月4日 星期日

V80201 – 自訂挑選欄位值 – RunTime新增欄位值

目的: V80201 – 生工OSM查詢 自訂挑選欄位值 – RunTime新增欄位值

 處理說明: 1> DataSet ds = setupPickDs(n, Tmp_Sql, new string[] { "KEYCODE" });
                        var Tmp_STAT ,Tmp_DESCPT = "";
                        DataRow dr = ds.Tables["T1"].NewRow();
                        dr["STAT"] = "A";
                       dr["DESCPT"] = "未審核";
                       ds.Tables["T1"].Rows.Add(dr);
           


1>*.cs
//過濾欄位 [編審狀態(STAT)]挑選

        [HttpPost]
        public dynamic get_s_STATPick(string STAT = "", int isComplete = 0)
        {
            string Tmp_Sql = " SELECT  DISTINCT KEY_CODE AS STAT ,DESCPT  "
                                       + "  FROM   KEYCODE "
                                       + "  WHERE  1=2 "
                                       + "    AND      KEY_CODE IS NOT NULL "
                                       + " ORDER  BY  KEY_CODE ";
            string n = funId + "s_STAT";
            DataSet ds = setupPickDs(n, Tmp_Sql, new string[] { "KEYCODE" });
            var Tmp_STAT = "";
            var Tmp_DESCPT = "";
            DataRow dr = ds.Tables["T1"].NewRow();
            dr["STAT"] = "A";
            dr["DESCPT"] = "未審核";
            ds.Tables["T1"].Rows.Add(dr);
            dr = ds.Tables["T1"].NewRow();
            dr["STAT"] = "B";
            dr["DESCPT"] = "審核中";
            ds.Tables["T1"].Rows.Add(dr);
            dr = ds.Tables["T1"].NewRow();
            dr["STAT"] = "C";
            dr["DESCPT"] = "已審核";
            ds.Tables["T1"].Rows.Add(dr);
            if (STAT != null && !STAT.Equals(""))
            {
                if (isComplete == 1)
                {
                    ds = getPickDsbyCondi(n, "STAT='" + STAT + "'");
                }
                else
                {
                    ds = getPickDsbyCondi(n, "STAT  LIKE '%" + STAT + "%'");
                }
            }
            return ds;
        }  // end of  get_s_STATPick



2022年11月30日 星期三

V20301 –Master結構圖

 目的: V20301 –Master結構圖說明

處理說明: 1> V20301 –Master結構圖說明








V80209 – MD畫面 – 顯示 Detail 資料 - grid.on("selectionchange",function(){}.. ) - Grid 選擇資料改變

 目的: V80209 – MD畫面 – 顯示 Detail 資料

處理說明:1> Ext.getCmp('grid_M').on("selectionchange", function (view, selections, options) {
                      1>>取得目前畫面的過濾條件
                          var np = s_JSON('s_form'); //TMFunction.js, 組合form上的查詢條件為json參數傳遞 
                      2>>取得目前 Master PK欄位值
                             var cur_recs = Ext.getCmp('grid_M').selModel.getSelection();
                              var cur_rec = cur_recs[0];
                              np["RVNO"] = cur_rec.data["RVNO"];
                       3>設定 Detail .store.proxy
                           gridstore.getProxy().url = '../api/V80209API/getGridData_D';
                           gridstore.getProxy().extraParams = np; //分頁OK,篩選條件OK
                       Ext.getCmp('grid_D').reloadGridData(false);  //若Detail資料空白時,不顯示無資料訊息



1>*.js
Ext.getCmp('grid_M').on("selectionchange", function (view, selections, options) {
        var np = s_JSON('s_form'); //TMFunction.js, 組合form上的查詢條件為json參數傳遞
        //console.log("Ext.getCmp('s_STAT') : ", Ext.getCmp('s_STAT'));
        var gridstore = Ext.getCmp('grid_D').store;        
        var cur_recs = Ext.getCmp('grid_M').selModel.getSelection();
        if (cur_recs.length == 0) {
            //Tmp_Str = "請先選擇要查詢的資料<br>";
            //mywarnalert(Tmp_Str);
            return;
        }
        var cur_rec = cur_recs[0];
        np["RVNO"] = cur_rec.data["RVNO"];
        np["s_VRCODE"] = Ext.getCmp('s_VRCODE').getValue();        
        np["s_UPDREC"] = Ext.getCmp('s_UPDREC').getValue();        
        np["s_UPDDT1"] = Ext.getCmp('s_UPDDT1').getValue();        
        np["s_UPDDT2"] = Ext.getCmp('s_UPDDT2').getValue();        
        console.log(" np[s_VRCODE]  : ", np["s_VRCODE"]);
        console.log(" np[s_UPDDT1]  : ", np["s_UPDDT1"]);
        console.log(" np[s_UPDDT2]  : ", np["s_UPDDT2"]);
        gridstore.getProxy().url = '../api/V80209API/getGridData_D';
        gridstore.getProxy().extraParams = np; //分頁OK,篩選條件OK
        Ext.getCmp('grid_D').reloadGridData(false); //若Detail資料空白時,不顯示無資料訊息
    });


2>*.cs   - getGridData_D()
[HttpPost]
        public dynamic getGridData_D()
        {
            var c = HttpContext.Current;
            NameValueCollection nvc = c.Request.Form;
            OracleCommand cmd = new OracleCommand();

            setDBTable("AMM_FRO3F16D");
            string Tmp_RVNO = nvc["RVNO"];
            string Tmp_VRCODE = nvc["s_VRCODE"];
            string Tmp_UPDREC = nvc["s_UPDREC"];
            string Tmp_UPDDT1 = nvc["s_UPDDT1"];
            string Tmp_UPDDT2 = nvc["s_UPDDT2"];
            //string csSQL = " AND RVNO = :RVNO ";
            //cmd.CommandText = csSQL;
            //cmd.Parameters.Add(":RVNO", RVNO);
            //setDBTable("AMM_FRO3F16D");
            //DataSet ds = getGridDataPage(cmd);

            string Tmp_Sql1 = "", Tmp_Sql2 = "";  //for 日期起迄
string Tmp_Sql = "  SELECT  RNK,RVNO,ITM,REER,INDDT,OUTDDT,NOTE,VRCODE,PN,SN,QDRNO,DIRNO,ACNO,MKTM "
                        + "  FROM   ( SELECT  dense_rank()  over(order by  RVNO,ITM) as RNK,"
                                       + "  RVNO,ITM,REER,INDDT,OUTDDT,NOTE,VRCODE,PN,SN,QDRNO,DIRNO,ACNO,MKTM "
                                      + "   FROM     AMM_FRO3F16D "
                                       + "   WHERE  1=1 ";
            //拆移編號
            if (!myfunc.checkisnull(Tmp_RVNO))
            {
                Tmp_Sql = Tmp_Sql + " AND    RVNO=" + myfunc.AA(Tmp_RVNO);
            };
            //異動原因
            if (!myfunc.checkisnull(Tmp_VRCODE))
            {
                if (Tmp_VRCODE != "ALL")
                   Tmp_Sql = Tmp_Sql + " AND    VRCODE=" + myfunc.AA(Tmp_VRCODE);
            };
            //異動記錄
            if (!myfunc.checkisnull(Tmp_UPDREC))
            {
                if (Tmp_UPDREC != "ALL")
                    Tmp_Sql = Tmp_Sql + " AND    (RVNO,ITM)  IN ( SELECT  RVNO,MAX(ITM)  "
                                                                                                    +" FROM    AMM_FRO3F16D "
                                                                           +" WHERE  RVNO="+myfunc.AA(Tmp_RVNO)
                                                                                                    +" GROUP BY RVNO "
                                                                                                   +" ) ";
            };
            //異動日期

            if (!(myfunc.checkisnull(Tmp_UPDDT1) && myfunc.checkisnull(Tmp_UPDDT2)))
            {                
                if (!myfunc.checkisnull(Tmp_UPDDT1))
               {
                  Tmp_Sql1 = Tmp_Sql1 + " (trunc(INDDT)>= " + myfunc.AA(Tmp_UPDDT1) + ")";
                  Tmp_Sql2 = Tmp_Sql2 + " (trunc(OUTDDT)>= " + myfunc.AA(Tmp_UPDDT1) + ")";
              };
            if (!myfunc.checkisnull(Tmp_UPDDT2))
            {
                if (!myfunc.checkisnull(Tmp_Sql1))
                {
                    Tmp_Sql1 = Tmp_Sql1 + " AND ";
                    Tmp_Sql2 = Tmp_Sql2 + " AND ";
                }
                Tmp_Sql1 = Tmp_Sql1 + "  (trunc(INDDT)<= " + myfunc.AA(Tmp_UPDDT2) + ")";
                Tmp_Sql2 = Tmp_Sql2 + "  (trunc(OUTDDT)<= " + myfunc.AA(Tmp_UPDDT2) + ")";
            }; // end of   if (!myfunc.checkisnull(Tmp_UPDDT2))

            Tmp_Sql = Tmp_Sql 
                            +" AND ( " 
                            + "("+ Tmp_Sql1+")"
                           + " OR " 
                           + "("+Tmp_Sql2 +")"
                           + ") ";
        };  //  if (!(myfunc.checkisnull(Tmp_UPDDT1) || myfunc.checkisnull(Tmp_UPDDT2)))
        Tmp_Sql = Tmp_Sql + " ) ";
            cmd.CommandText = Tmp_Sql;
            string countSql = " SELECT COUNT(*) as total FROM (" + Tmp_Sql + ")";
            DataSet ds = getDataTable(cmd, countSql);            

            //新增  CaluField 欄位  - [異動碼]            
            getKeyCode("VRCODE", ref ds);
            //新增  CaluField 欄位  - [處理人員姓名]            
            Tmp_Sql = " SELECT  EMPLYID AS REER,EMPLYNM "
                           + "  FROM   HR_EMPLYM ";
            getKeyCode("REER", ref ds,Tmp_Sql);

            return ds;
        }

2022年11月29日 星期二

V80209 – MD畫面 結構圖, 設定 Master的高度加大 - 調整高度

 目的: V80209 – MD畫面結構圖, 設定 Master的高度加大

處理說明: 1>加大 Master 的高度
                        Ext.getCmp('Detail').flex = 2;






2>高度放大後的高度

1>*.js
  //加大 Master 的高度
    Ext.getCmp('Detail').flex = 2;


2>*.js  TMMDViewEdit

Ext.define('TMMDViewEdit', {
    extend: 'Ext.Panel',
    layout: 'border',
    id: 'TMMDViewEdit',
    setTemplateBtnVisible: function (isVisible) {
        Ext.getCmp('btn_add').setVisible(isVisible);
        Ext.getCmp('btn_edit').setVisible(isVisible);
        Ext.getCmp('btn_del').setVisible(isVisible);
    },
     :
     :
    initComponent: function () {
        var me = this;
        me.items = [{
            region: 'center',
            layout: {
                type: 'vbox',
                align: 'stretch'
            },
            autoScroll: true,
            id: 'Detail' + unique,
            flex: 1,
            border: false,
            items: [Ext.create('MDViewEdit_M')]
        },
        {
            region: 'south',
            flex: 1,
            layout: {
                type: 'vbox',
                align: 'stretch'
            },
            border: false,
            split: true,
            items: [Ext.create('TabPanel_D')]
        }];
        me.callParent();
    }
});