2023年11月19日 星期日

V80E01 - TreeView挑選人員 - 利用Get_pickTree_btn0

 目的: V80E01 - TreeView挑選人員 - 利用Get_pickTree_btn0

 處理說明: 1> 利用  Get_pickTree_btn0  - 產生 TreeView挑選人員 Button
                   2>var cmp_pick_EMPLYID 
           = get_pickTree_btn0('挑選員工編號', 's_btn_EMPLYID', 's_EMPLYID', 's_EMPLYID_');
              //get_pickTree_btn0(挑選視窗標題,按鈕id,傳回員工編號欄位(s_EMPLYID),
                                                                                          傳回員工姓名欄位(s_EMPLYID_),  )


1>*.js

 // panel11  
    var cmp_EMPLYID = get_cmp_txt1('員工編號', 's_EMPLYID', 80, 100);
    var cmp_EMPLYID_ = get_cmp_cal0('s_EMPLYID_', 100);
    //取得 TreeView 人員挑選
    var cmp_pick_EMPLYID = get_pickTree_btn0('挑選員工編號', 's_btn_EMPLYID',                                                                                                's_EMPLYID', 's_EMPLYID_');
    cmp_EMPLYID.items.push(cmp_EMPLYID_,cmp_pick_EMPLYID);


    //篩選條件畫面
    var Query = new Ext.FormPanel({
        id: 's_form',
        layout: { type: 'hbox', align: 'stretch' },
        fieldDefaults: { labelAlign: 'right' },
        defaults: { margin: { top: 3 } },
        items: [
            {
                xtype: 'panel', id: 'panel1', layout: { type: 'hbox', align: 'stretch' }, flex: 14, border: 0,
                items: [
                    {
                 xtype: 'panel', id: 'panel11', layout: { type: 'vbox', align: 'stretch' }, flex: 25, border: 0,
                        items: [cmp_EMPLYID,],
                    },  // end of panel11
                    {
                        xtype: 'panel', id: 'panel12', layout: { type: 'vbox', align: 'stretch' }, flex: 30, border: 0,
                        items: [],
                    },   // end of panel12 , flex:16                                        
                ]
            },  // end of panel1            

2023年11月9日 星期四

V80203 – 計算日期差異天數 - Days

 目的: V80203 – 計算日期差異天數

處理說明: 1> (Tmp_DT1 - Tmp_DT2).Days


1>*.js
DateTime Tmp_STARTDT;
int Tmp_Days;
Tmp_STARTDT = DateTime.Parse(dr["STARTDT"].ToString());
Tmp_Days = (DateTime.Today - Tmp_STARTDT).Days;
dr["DAYIN_"] = Tmp_Days.ToString();

2023年11月8日 星期三

V80203 – checkbox –勾選[V]已完工,則 [ ]未完工 不勾選 - onChangeEvent - V80202 -[V]TP工單,則[ ]非 TP工單不勾選

目的 : V80203 – checkbox –勾選[V]已完工, [ ]未完工  -–勾選[V]未完工, [ ]已完工 

           V80202 -[V]TP工單,則[ ]非 TP工單不勾選

處理說明: 1>get_cmp_xxx - s_chk_AMMSTS Object - 為一般Objext - 沒有 Ext onchange屬性
                      var cmp_chk_AMMSTS1 = get_cmp_chk0('已完工', 's_chk_AMMSTS', 50, '1');
                      --> Object  cmp_chk_AMMSTS1  - 為一般Object,並沒有 onchange event 的屬性
    
              2>get_cmp_XXX --> 加入 Query(Ext.FormPanel) 後, 才有 Ext 的各種屬性(onchange/.. )
                  var Query = new Ext.FormPanel({
                  id: 's_form',
                  items: [
                 {
                xtype: 'panel', id: 'panel1', layout: { type: 'hbox', align: 'stretch' }, flex: 14, border: 0,
                items: [                  
                   {
                        xtype: 'panel', id: 'panel15', layout: { type: 'vbox', align: 'stretch' }, flex: 15, border: 0,
                        items: [cmp_chk_AMMSTS, cmp_ISROOT, cmp_ISBOMIN, cmp_ISWAITNSN],
                    },   // end of panel15 , flex:16                        

           3> [V]已完工 [ ]未完工的 true/false 控制
    Ext.getCmp("s_chk_AMMSTS").items.items[0].on('change', function (me, newValue, oldValue, eOpts) {
        if (newValue) {
            Ext.getCmp("s_chk_AMMSTS").items.items[1].setValue(false);
        }
    }
    );  // end of  cmp_chk_AMMSTS.items[0].on("change"
    Ext.getCmp("s_chk_AMMSTS").items.items[1].on('change', function (me, newValue, oldValue, eOpts) {
        if (newValue) {
            Ext.getCmp("s_chk_AMMSTS").items.items[0].setValue(false);
        }
    }
    );  // end of  cmp_chk_AMMSTS.items[0].on("change"



1>*.js
    //單況: 已完工/未完工
    var cmp_chk_AMMSTS = get_cmp_chkgrp1('單況', 's_chk_AMMSTS', 50);    
    var cmp_chk_AMMSTS1 = get_cmp_chk0('已完工', 's_chk_AMMSTS', 50, '1');
    var cmp_chk_AMMSTS2 = get_cmp_chk0('未完工', 's_chk_AMMSTS', 50, '2');
    cmp_chk_AMMSTS.items.push(cmp_chk_AMMSTS1, cmp_chk_AMMSTS2);
    cmp_chk_AMMSTS1.checked = true;    

  var Query = new Ext.FormPanel({
        id: 's_form',
        layout: { type: 'hbox', align: 'stretch' },
        fieldDefaults: { labelAlign: 'right' },
        defaults: { margin: { top: 3 } },
        items: [
            {
                xtype: 'panel', id: 'panel1', layout: { type: 'hbox', align: 'stretch' }, flex: 14, border: 0,
                items: [
                    {
                        xtype: 'panel', id: 'panel11', layout: { type: 'vbox', align: 'stretch' }, flex: 25, border: 0,
                        items: [cmp_EOECN, cmp_ACNO,cmp_AMMNO, cmp_AMMSTS, cmp_PN1, cmp_EM_SN,],
                    },  // end of panel11
                    {
                        xtype: 'panel', id: 'panel12', layout: { type: 'vbox', align: 'stretch' }, flex: 25, border: 0,
                        items: [cmp_RMK, cmp_PROJID, cmp_SAPNO, cmp_SAPMAN, cmp_STARTVAL, cmp_CHARG,],
                    },   // end of panel12 , flex:16                    
                    {
                        xtype: 'panel', id: 'panel13', layout: { type: 'vbox', align: 'stretch' }, flex: 25, border: 0,
                        items: [cmp_PN, cmp_PROCWC, cmp_MKDT,  cmp_SROTP, cmp_FACWC,],
                    },   // end of panel13 , flex:16              
                    {
                        xtype: 'panel', id: 'panel14', layout: { type: 'vbox', align: 'stretch' }, flex: 30, border: 0,
                        items: [cmp_WBSNO, cmp_ACAREA, cmp_LWA, cmp_MK,cmp_SAPDT1,],
                    },   // end of panel14 , flex:16                               
                    {
                        xtype: 'panel', id: 'panel15', layout: { type: 'vbox', align: 'stretch' }, flex: 15, border: 0,
                        items: [cmp_chk_AMMSTS, cmp_ISROOT, cmp_ISBOMIN, cmp_ISWAITNSN],
                    },   // end of panel15 , flex:16                            

    console.log("cmp_chk_AMMSTS2:", cmp_chk_AMMSTS2);
    console.log("Ext.getCmp('s_chk_AMMSTS').items.items[1]", Ext.getCmp('s_chk_AMMSTS').items.items[1]);
    Ext.getCmp("s_chk_AMMSTS").items.items[0].on('change', function (me, newValue, oldValue, eOpts) {
        if (newValue) {
            Ext.getCmp("s_chk_AMMSTS").items.items[1].setValue(false);
        }
    }
    );  // end of  cmp_chk_AMMSTS.items[0].on("change"
    Ext.getCmp("s_chk_AMMSTS").items.items[1].on('change', function (me, newValue, oldValue, eOpts) {
        if (newValue) {
            Ext.getCmp("s_chk_AMMSTS").items.items[0].setValue(false);
        }
    }
    );  // end of  cmp_chk_AMMSTS.items[0].on("change"




1>*.js
   //若按[TP工單],則 [非TP工單].checked=false;
    Ext.getCmp("s_chk_TP").items.items[0].on('change', function (me, newValue, oldValue, eOpts) {
        if (newValue) {
            Ext.getCmp("s_chk_TP").items.items[1].setValue(false);
        }
    }
    );  // end of  cmp_chk_TP.items[0].on("change"
    Ext.getCmp("s_chk_TP").items.items[1].on('change', function (me, newValue, oldValue, eOpts) {
        if (newValue) {
            Ext.getCmp("s_chk_TP").items.items[0].setValue(false);
        }
    }

V80203- 子畫面 – Grid -顯示 Grid子畫面 - store.onload - load - store - proxy - cur_rec

 目的: V80203- 工單需求物料查詢 顯示 Grid子畫面

處理說明: 1>呼叫子畫面函式: Call_V80203B();
                  2>子畫面處理:
    var win = getMyWindow("顯示原始需求物料", sub_BackFlds, sub_BackFlds_Btns);
    Ext.getCmp('sub_Grid').store.getProxy().url = '../../api/V80203BAPI/get_sub_data1',
    Ext.getCmp('sub_Grid').store.getProxy().extraParams = np; //分頁OK,篩選條件OK    
    Ext.getCmp('sub_Grid').store.load();                
                                
    win.show();    





1>V80203.js
{
            xtype: 'button', text: '顯示原始需求物料', id: 'Call_V80203B_Btn',
            listeners: {
                click: function () {
                    //mysuccessalert(" call BatAddBtn_click() ");
                    Call_V80203B();
                }
            }
        },        


2>V80203B.js
function Call_V80203B() {
    //按鈕 : [離開]  
    var sub_BackFlds_Btns = [
        {
            xtype: 'button', text: '離開', id: 'sub_BackFlds_CancelBtn',
            listeners: {
                click: function () {
                    //mysuccessalert("mysub2_取消");
                    var Tmp_win = this.up("window");
                    if (Tmp_win == undefined) {
                        Ext.Msg.alert("取消時未取到Window Object");
                    }
                    this.up("window").close();
                    this.up("window").destroy();
                }
            }
        },
    ];
    
    //sub_ Grid
    var sub_Grid = Ext.create('TMGrid', {
        grid_id: 'sub_Grid',
        columns: sub_B_Columns,
        autoScroll: true,
        flex: 1,
        store: Ext.create('gridstore', { model: sub_B_Fields }),
    });
    console.log("step2.5");

    // [顯示原始需求物料]鈕  - 子畫面欄位
    var sub_BackFlds = [
        {
            type: 'panel', bodyStyle: "background-color:transparent;", border: 0, padding: "5",
            flex: 100,
            //layout: { type: 'vbox', align: 'stretch' }, 
            layout: 'border',
            items: [
                {
                    xtype: 'panel',
                    id: 'sub_panel1',
                    region: 'north',
                    layout: { type: 'hbox', align: 'stretch' },
                    //flex: 0,
                    //border: 1,
                    items: []
                },  //end of panel1                    
                {
                    xtype: 'panel',
                    id: 'sub_panel2',
                    //title: 'sub_panel2',
                    region: 'center',
                    layout: 'fit',
                    //flex: 60,
                    //border: 20,
                    items: [sub_Grid]
                },
            ] // end of   layout: "vbox", padding: "5", items: [
        }  //end of  my_Sub2 , items[{
    ]      //end of  my_Sub2 , items[

    Ext.getCmp('sub_Grid').store.on("load", function (me, records, successful, eOpts) {
        if (successful) {
            console.log("Ext.getCmp('sub_Grid').store", Ext.getCmp('sub_Grid').store);
            console.log("Ext.getCmp('sub_Grid').store.data", Ext.getCmp('sub_Grid').store.data);
        }
    }
    );

    var win = getMyWindow("顯示原始需求物料", sub_BackFlds, sub_BackFlds_Btns);
    //var win = getMyWindow("歸還登記", sub_BackFlds);
    win.width = 800;
    win.heigh = 400;
    var cur_recs = Ext.getCmp('grid_M').getSelectionModel().getSelection();
    if (cur_recs.length == 0) {
        var Tmp_Str = "請先選擇資料";
        mywarnalert(Tmp_Str);
        return ;
    }
    var cur_rec = cur_recs[0];
    var Tmp_AMMNO = cur_rec.data['AMMNO'].toString();
    var np = {};
    np["AMMNO"] = Tmp_AMMNO;    
    var is_Ok = true;
    //顯示 store 的資料
    Ext.getCmp('sub_Grid').store.getProxy().url = '../../api/V80203BAPI/get_sub_data1',
    Ext.getCmp('sub_Grid').store.getProxy().extraParams = np; //分頁OK,篩選條件OK    
    Ext.getCmp('sub_Grid').store.load();               
                                
    win.show();    
    console.log("step6");
} // end of   function LendBtn_click() {

2023年11月3日 星期五

V80203 – checkbox – 過濾條件加文字輸入欄位 - checkboxgroup

目的: V80203 – checkbox – 加文字輸入欄位  - checkboxgroup

處理說明: 1>checkboxGroup - 內含 checkbox
                       //已完工/未完工
                      var cmp_chk_AMMSTS = get_cmp_chkgrp1('單況', 's_chk_AMMSTS', 50);    
                      var cmp_chk_AMMSTS1 = get_cmp_chk0('已完工', 's_chk_AMMSTS', 50, '1');
                      var cmp_chk_AMMSTS2 = get_cmp_chk0('未完工', 's_chk_AMMSTS', 50, '2');
                      cmp_chk_AMMSTS.items.push(cmp_chk_AMMSTS1, cmp_chk_AMMSTS2);
                 2>單一checkbox 
                     var cmp_ISROOT = get_cmp_chk1('機務工單', 's_ISROOT', 80, 'Y', '0 0 0 50');                                   3>checkbox 後接文字欄位  : 利用 panel 當 fieldcontainer
                        //預估到件率>xx
                       var cmp_RT = get_cmp_panel1(0);
                       var cmp_RT1 = get_cmp_chk1('預估到件率>', 's_RT', 80, 'Y','0 5 0 0');
                       var cmp_RT2 = get_cmp_txt0('s_RT1', 30);
                        cmp_RT.items.push(cmp_RT1,cmp_RT2);

                4>checkboxgroup 必需先 getValue ,再傳入 np 



1>*.js
//單況: 已完工/未完工
var cmp_chk_AMMSTS = get_cmp_chkgrp1('單況', 's_chk_AMMSTS', 50);
var cmp_chk_AMMSTS1 = get_cmp_chk0('已完工', 's_chk_AMMSTS', 50, '1');
var cmp_chk_AMMSTS2 = get_cmp_chk0('未完工', 's_chk_AMMSTS', 50, '2');
cmp_chk_AMMSTS.items.push(cmp_chk_AMMSTS1, cmp_chk_AMMSTS2);

//機務工單
var cmp_ISROOT = get_cmp_chk1('機務工單', 's_ISROOT', 80, 'Y', '0 0 0 50');

//超過xx天
    var cmp_STARTDT = get_cmp_panel1(0);
    var cmp_STARTDT1 = get_cmp_chk1('超過', 's_START', 80, 'Y', '0 5 0 0');
    var cmp_STARTDT2 = get_cmp_txt0('s_STARTDT1', 30);
    var cmp_STARTDT3 = get_cmp_lbl0('天', 30);
    cmp_STARTDT.items.push(cmp_STARTDT1, cmp_STARTDT2, cmp_STARTDT3,);

    var cmp_RT = get_cmp_panel1(0);
    var cmp_RT1 = get_cmp_chk1('預估到件率>', 's_RT', 80, 'Y','0 5 0 0');
    var cmp_RT2 = get_cmp_txt0('s_RT1', 30);
    cmp_RT.items.push(cmp_RT1,cmp_RT2);

      //顯示資料
       var np = s_JSON('s_form'); //TMFunction.js, 組合form上的查詢條件為json參數傳遞             
       //已完工,未完工 //若同時勾選[v]已發工[v]已完工 , 則欄位值 Array of  :  ['1','2']
       np["s_chk_AMMSTS"] = Ext.getCmp('s_chk_AMMSTS').getValue();                            
        var gridstore = Ext.getCmp('grid_M').store;      
        gridstore.getProxy().url = '../api/V80203API/getGridData_M';
        gridstore.getProxy().extraParams = np; //分頁OK,篩選條件OK
        Ext.getCmp('grid_M').reloadGridData();


2>*.cs
              //已完工/未完工 AMMSTS
            if (!myfunc.checkisnull(Tmp_chk_AMMSTS))
            {
                if (Tmp_chk_AMMSTS=="1")  //已完工
                    Tmp_Sql = Tmp_Sql + " AND   AMMSTS  IN ('F','G','H','I')  ";
                if (Tmp_chk_AMMSTS == "2")  //未完工
                    Tmp_Sql = Tmp_Sql + " AND   AMMSTS  < 'F'  ";
            };
            //機務工單 - ISROOT
            if (!myfunc.checkisnull(Tmp_ISROOT))
            {
                if (Tmp_ISROOT== "true" )
                   Tmp_Sql = Tmp_Sql + " AND   ISROOT=" + myfunc.AA("Y");                
            };

             //預估到件率> xx
            if (!myfunc.checkisnull(Tmp_ISRT))
            {
                if (Tmp_ISRT == "true")
                    Tmp_Sql = Tmp_Sql + " AND   RT>= "+myfunc.AA(Tmp_RT1);
            };


2023年11月2日 星期四

V80203 – 過濾條件– checkbox 後接著 text輸入欄位

 目的: V80203 – 工單需求物料查詢 – checkbox 後接著 text輸入欄位

處理說明:  1>利用 panel 當 container , 包含 checkbox + text 欄位


1>*.js
//預估到件率>xx
    var cmp_RT = get_cmp_panel1(0);
    var cmp_RT1 = get_cmp_chk1('預估到件率>', 's_RT', 80, 'Y','0 5 0 0');
    var cmp_RT2 = get_cmp_txt0('s_RT1', 30);
    cmp_RT.items.push(cmp_RT1,cmp_RT2);
    
//超過xx天
    var cmp_STARTDT = get_cmp_panel1(0);
    var cmp_STARTDT1 = get_cmp_chk1('超過', 's_START', 80, 'Y', '0 5 0 0');
    var cmp_STARTDT2 = get_cmp_txt0('s_STARTDT1', 30);
    var cmp_STARTDT3 = get_cmp_lbl0('天', 30);
    cmp_STARTDT.items.push(cmp_STARTDT1, cmp_STARTDT2, cmp_STARTDT3,);




2023年11月1日 星期三

GOCO專案 - WPM(全機模組)和AMM系統的界面關係

 目的: 了解  全機模組(WPM)和 AMM系統的界面關係

處理說明: 1>WPM全機模組,以專案的角度,看整個專案的需求物料
                  2>AMM模組, 以單一張工單的角度,看該工單物料的滿足情況


WPM(全機模組)AMM系統的界面關係: - GOCO專案

.WPM系統

1>R108 – 整機交修單維護

1>>系統件維修(交修單號) – 母工單

-        子工單1

-        子工單2

        2>>全機維修(交修單號)  - 機務工單

-        子工單

 

    2>R201- 缺點單維護  : 機種+機號+年度

      缺點項次/缺點代碼/缺點說明/處理代碼/

        處理代碼02(MDR): AES處理

               04(SOR): SAP處理

               08(代客戶提料) : 只幫客戶提料

 

 3>R207 – 缺點單申料維護由技令BOM挑選需求物料

   依缺點項次 申請物料(1~999)

   [料源批次修訂]

   [物料籌補清冊匯出] 彙整缺點單.項目的申料項目屬於採購件號的項目 綜整匯出

      每一件號編 PK全機彙整管制號碼 (IRCTRL=’Y’)

à 提供給GOCO器材組, 以便器材組人員去 TLS供售模組執行採購作業( SAP系統採購)

   TLS供售模組有[物料管制號碼] vs WPM.[全機彙整管制號碼]

è 第二次專案人員確認缺點單物料時,會再新建申請物料(尚未彙整 IRCTRL=’N’)

è [物料籌補清冊匯出], 只針對新建的申請物料-採購(尚未彙整 IRCTRL=’N’) 匯出

è 每一件號編 PK全機彙整管制號碼 (IRCTRL=’Y’)

所以由WPM.[全機彙整管制號碼] à TLS.[物料管制號碼]

知道[器材組]人員針對該[全機彙整管制號碼]是否已於 TLS 供售模組提供物料申請

 

è PDM系統編輯 OSM(施工步序)

è BM146 à 發工

 

.AMM系統

即時針對 目前工單的需求物料是否滿足進行分析

[物料籌補清冊]的清單沒有關係

à

[物料籌補清冊]的清單 TLS系統的供售模組處理