目的: 讀取 Response.Cookie 的欄位值 - F12 讀取欄位值
2026年3月25日 星期三
2026年2月28日 星期六
2026年2月12日 星期四
V20108 – [匯出(人力資源)]鈕 – 設定 CELL 欄位邊框 - 水平置中/靠右
目的: V20108 – [匯出(人力資源)]鈕 – 設定 CELL 欄位邊框 & 水平靠右
處理說明: 1>設定欄位邊框
//cell.邊框 = 細線 & 黑色
CellRange cell = ws.Range[myfunc.GetExcelPos(k, cur_row)];
cell.Borders.LineStyle = LineStyleType.Thin;
cell.Borders.Color = Color.Black;
//cell.斜線 不顯示
cell.Borders[BordersLineType.DiagonalDown].LineStyle = LineStyleType.None;
cell.Borders[BordersLineType.DiagonalUp].LineStyle = LineStyleType.None;
2>設定欄位右靠
ws.Range[myfunc.GetExcelPos(0, cur_row)].Text = "□"; //EMPID
ws.Range[myfunc.GetExcelPos(0, cur_row)].Style.HorizontalAlignment = HorizontalAlignType.Right; //水平靠右
HorizontalAlignType.Center; //水平置中
1>*.cs
ws.Range[myfunc.GetExcelPos(0, cur_row)].Text = "□"; //EMPID
ws.Range[myfunc.GetExcelPos(0, cur_row)].Style.HorizontalAlignment = HorizontalAlignType.Right;
for (var k=0;k<=23;k++)
{
CellRange cell = ws.Range[myfunc.GetExcelPos(k, cur_row)];
cell.Borders.LineStyle = LineStyleType.Thin;
cell.Borders.Color = Color.Black;
cell.Borders[BordersLineType.DiagonalDown].LineStyle = LineStyleType.None;
cell.Borders[BordersLineType.DiagonalUp].LineStyle = LineStyleType.None;
}
{
CellRange cell = ws.Range[myfunc.GetExcelPos(k, cur_row)];
cell.Borders.LineStyle = LineStyleType.Thin;
cell.Borders.Color = Color.Black;
cell.Borders[BordersLineType.DiagonalDown].LineStyle = LineStyleType.None;
cell.Borders[BordersLineType.DiagonalUp].LineStyle = LineStyleType.None;
}
V20108 – 設定Panel的邊框寬度及顏色
目的: V20108 – 設定Panel的邊框寬度及顏色
處理說明: 1>cmp_Panel_D12.border = true;cmp_Panel_D12.style = {
// 邊框顏色 , // 邊框樣式 , // 邊框粗細
borderColor: 'red',
borderStyle: 'solid',
borderWidth: '2px'
};
2026年1月21日 星期三
V20301 – 非TLS品項交修件建檔 1>[刪除]鈕 – 將勾選資料s刪除 - PK_LIST
目的: V20301 – 非TLS品項交修件建檔 1>[刪除]鈕 – 將勾選資料s刪除 - PK_LIST
處理說明:1>[刪除]鈕 - Disable 原本Template.程式 - onclick
parent.onclick = function () { }; // 不使用 parent.onclick
2>刪除勾選資料
var Tmp_DataAry1 = [];
for (var i = 0; i < CHK_PK_OBJ.PK_LIST.length; i++) {cur_rec = CHK_PK_OBJ.ALL_LIST[i];Tmp_DataAry1.push(cur_rec);}let Tmp_DataString1 = JSON.stringify(Tmp_DataAry1);var np = {};np["DataString1"] = Tmp_DataString1;Tmp_url = '../../api/V20301API/Delete_1';Tmp_RtnStr = getUrlStr(Tmp_url, np, "刪除 勾選的[交修件單號] 資料");if (!checkRtnOK(Tmp_RtnStr)) {mywarnalert(Tmp_RtnStr);return;}elsemysuccessalert(Tmp_RtnStr);
3>[刪除]鈕 - 刪除勾選資料s - 刪除後,移除畫面的勾選資料
var toRemove = [];
Ext.getCmp('grid_Single').store.each(function (rec) {
if (rec.get('CHECK') == true)
toRemove.push(rec);
//gridstore.remove(rec); //畫面上隱藏刪除列 -->改成一次 remove all
});
gridstore.remove(toRemove); // remove all at once
Ext.getCmp('grid_Single').store.each(function (rec) {
if (rec.get('CHECK') == true)
toRemove.push(rec);
//gridstore.remove(rec); //畫面上隱藏刪除列 -->改成一次 remove all
});
gridstore.remove(toRemove); // remove all at once
1>*.js
Ext.getCmp("btn_del").on('click', function (me, e, eOpts) {
parent.onclick = function () { }; // 不使用 parent.onclick
parent.onclick = function () { }; // 不使用 parent.onclick
//var cur_recs = Ext.getCmp('grid_Single').getSelectionModel().getSelection();
var cur_recs = CHK_PK_OBJ.ALL_LIST;
var cur_rec;
if (cur_recs.length == 0)
{
buttonModel.modelType = 0;
mywarnalert('請先勾選要刪除的資料!!');
}
else {
me.delMessage = "確定刪除勾選的資料嗎?";
Ext.Msg.confirm('提醒', me.delMessage, callBackFunc);
function callBackFunc(id) {
if (id == 'yes') {
console.log("cur_recs.length:", cur_recs.length);
var gridstore = Ext.getCmp('grid_Single').store;
//刪除勾選.FMNO
var Tmp_DataAry1 = [];
for (var i = 0; i < CHK_PK_OBJ.PK_LIST.length; i++) {
cur_rec = CHK_PK_OBJ.ALL_LIST[i];
Tmp_DataAry1.push(cur_rec);
}
let Tmp_DataString1 = JSON.stringify(Tmp_DataAry1);
var np = {};
np["DataString1"] = Tmp_DataString1;
Tmp_url = '../../api/V20301API/Delete_1';
Tmp_RtnStr = getUrlStr(Tmp_url, np, "刪除 勾選的[交修件單號] 資料");
if (!checkRtnOK(Tmp_RtnStr)) {
mywarnalert(Tmp_RtnStr);
return;
}
else
mysuccessalert(Tmp_RtnStr);
//刪除後,移除畫面的勾選資料
var cur_recs = CHK_PK_OBJ.ALL_LIST;
var cur_rec;
if (cur_recs.length == 0)
{
buttonModel.modelType = 0;
mywarnalert('請先勾選要刪除的資料!!');
}
else {
me.delMessage = "確定刪除勾選的資料嗎?";
Ext.Msg.confirm('提醒', me.delMessage, callBackFunc);
function callBackFunc(id) {
if (id == 'yes') {
console.log("cur_recs.length:", cur_recs.length);
var gridstore = Ext.getCmp('grid_Single').store;
//刪除勾選.FMNO
var Tmp_DataAry1 = [];
for (var i = 0; i < CHK_PK_OBJ.PK_LIST.length; i++) {
cur_rec = CHK_PK_OBJ.ALL_LIST[i];
Tmp_DataAry1.push(cur_rec);
}
let Tmp_DataString1 = JSON.stringify(Tmp_DataAry1);
var np = {};
np["DataString1"] = Tmp_DataString1;
Tmp_url = '../../api/V20301API/Delete_1';
Tmp_RtnStr = getUrlStr(Tmp_url, np, "刪除 勾選的[交修件單號] 資料");
if (!checkRtnOK(Tmp_RtnStr)) {
mywarnalert(Tmp_RtnStr);
return;
}
else
mysuccessalert(Tmp_RtnStr);
//刪除後,移除畫面的勾選資料
var toRemove = [];
Ext.getCmp('grid_Single').store.each(function (rec) {
if (rec.get('CHECK') == true)
toRemove.push(rec);
//gridstore.remove(rec); //畫面上隱藏刪除列 -->改成一次 remove all
});
gridstore.remove(toRemove); // remove all at once
Ext.getCmp('grid_Single').getView().refresh();
buttonModel.modelType = 0;
} // end if (id == 'yes')
Ext.getCmp('grid_Single').store.each(function (rec) {
if (rec.get('CHECK') == true)
toRemove.push(rec);
//gridstore.remove(rec); //畫面上隱藏刪除列 -->改成一次 remove all
});
gridstore.remove(toRemove); // remove all at once
Ext.getCmp('grid_Single').getView().refresh();
buttonModel.modelType = 0;
} // end if (id == 'yes')
2026年1月20日 星期二
V20201A – 子畫面Grid -無符合條件的資料 –onload
目的: V20201A – 子畫面Grid -無符合條件的資料 –onload
處理說明: 1>Ext.getCmp('sub_Grid1').store.on("load", function (self, records, successful, operation, eOpts) {if ((successful) && (Ext.getCmp('sub_Grid1').store.data.getCount() == 0)) {
mywarnalert("無符合條件的資料!!");
}
}); // end of Ext.getCmp('sub_Grid1').store.on("load", function () {
-->進入子畫面,就觸發 onLoad event , 所以判斷先是否 successful ,
1>*.js
Ext.getCmp('sub_Grid1').store.on("load", function (self, records, successful, operation, eOpts) {
if ((successful) && (Ext.getCmp('sub_Grid1').store.data.getCount() == 0)) {
mywarnalert("無符合條件的資料!!");
}
}); // end of Ext.getCmp('sub_Grid1').store.on("load", function () {
--> 一進入子畫面時, successful=false
2025年12月30日 星期二
V20305O - 撥發單位查詢 -挑選欄位 SQL - SP_NSN@TLS_245 的處理 - @ 的不同資料庫 - 挑選欄位處理 - DBLINK
目的: V20305O - 撥發單位查詢 -挑選件號 SQL - SP_NSN@TLS_245
處理說明:1>設定 DBLINK = TLSEU
若為測試區,則會自動加 '5'
若為測試區,則會自動加 '5'
2>當成一般 Table 處理 SP_NSN
3>其他 挑選欄位時,DBLINK會自動還原 成預設值(AMMEU5)
4>SQL 修改如下, - 設定 DBLINK
string Tmp_Sql = " SELECT DISTINCT PN "+ " FROM SP_NSN "
+ " ORDER BY PN ";
string n = funId + "_sub_PN";
DBLINK = "TLSEU";
DataSet ds = setupPickDs(n, Tmp_Sql, new string[] { "SP_NSN" });
1>*.cs
[HttpPost]
public dynamic get_sub_PNPick(string PN = "", int isComplete = 0)
{
//列出所有申請單(PN)
string Tmp_Sql = "
SELECT DISTINCT PN
"
+ " FROM SP_NSN@TLS_245 "
+ " WHERE 1=1 "
+ " ORDER BY PN ";
DataSet ds = setupPickDs(n, Tmp_Sql, new string[] { "SP_NSN@TLS_245" });
public dynamic get_sub_PNPick(string PN = "", int isComplete = 0)
{
//列出所有申請單(PN)
+ " FROM SP_NSN@TLS_245 "
+ " ORDER BY PN ";
DataSet ds = setupPickDs(n, Tmp_Sql, new string[] { "SP_NSN@TLS_245" });
//--> 會出現錯誤訊息 , 修改如下藍字,即可 - DBLINK='TLSEU'
string Tmp_Sql = "
SELECT DISTINCT PN "
+ " FROM SP_NSN "
+ " WHERE 1=1 "
+ " ORDER BY PN ";
string n = funId + "_sub_PN";
DBLINK = "TLSEU";
DataSet ds = setupPickDs(n, Tmp_Sql, new string[] { "SP_NSN" });
if (PN != null && !PN.Equals(""))
{
if (isComplete == 1)
{
ds = getPickDsbyCondi(n, "PN='" + PN + "'");
}
else
{
ds = getPickDsbyCondi(n, "PN LIKE '%" + PN + "%'");
}
}
return ds;
} // end of get_V20305P_PNPick
+ " FROM SP_NSN "
+ " ORDER BY PN ";
string n = funId + "_sub_PN";
DBLINK = "TLSEU";
{
if (isComplete == 1)
{ds = getPickDsbyCondi(n, "PN='" + PN + "'");
}
else
{
ds = getPickDsbyCondi(n, "PN LIKE '%" + PN + "%'");
}
}
return ds;
} // end of get_V20305P_PNPick
訂閱:
意見 (Atom)


