目的: V60202 – 編輯欄位 [庫房]– 挑選
處理說明: 1> 加入挑選 btn{
xtype: "fieldcontainer", fieldLabel: "庫房", labelWidth: 128, layout: "hbox", items: [
{ id: "WH", name: "WH", xtype: "textfield", width: 100, padding: "0 4 0 0", maxLength: 10 },
{ id: "btn_WH", name: "btn_WH", xtype: "button", text: "..." }
]
},
xtype: "fieldcontainer", fieldLabel: "庫房", labelWidth: 128, layout: "hbox", items: [
{ id: "WH", name: "WH", xtype: "textfield", width: 100, padding: "0 4 0 0", maxLength: 10 },
{ id: "btn_WH", name: "btn_WH", xtype: "button", text: "..." }
]
},
2>設定挑選資料
Ext.getCmp('btn_WH').on("click", function () {
var win = EditPickx('庫房', '../api/V60202API/get_WHPick', ['WH'], ['WH'],
J_pickstore_WH, J_pickcolumns_WH);
win.show();
});
3>挑選資料
//- [庫房(WH)]欄位挑選
[HttpPost]
public dynamic get_WHPick(string WH = "", int isComplete = 0)
{
string Tmp_Sql = " SELECT DISTINCT WH "
+ " FROM AMM_COMP "
+ " WHERE 1=1 "
+ " AND WH IS NOT NULL "
+ " AND STAT='A' "
+ " ORDER BY WH ";
string n = funId + "s_WH";
DataSet ds = setupPickDs(n, Tmp_Sql, new string[] { "AMM_COMP" });
if (WH != null && !WH.Equals(""))
{
if (isComplete == 1)
{
ds = getPickDsbyCondi(n, "WH='" + WH + "'");
}
else
{
ds = getPickDsbyCondi(n, "WH LIKE '%" + WH + "%'");
}
}
return ds;
} // end of get_WHPick
1>*_json.js
{
xtype: "fieldcontainer", fieldLabel: "規範", labelWidth: 128, layout: "hbox", items: [
{ id: "NORM", name: "NORM", xtype: "textfield", width: 200, padding: "0 4 0 0", maxLength: 50 }
]
},
{
xtype: "fieldcontainer", fieldLabel: "庫房", labelWidth: 128, layout: "hbox", items: [
{ id: "WH", name: "WH", xtype: "textfield", width: 100, padding: "0 4 0 0", maxLength: 10 },
{ id: "btn_WH", name: "btn_WH", xtype: "button", text: "..." }
]
},
//SP - 儲存位置 - 依畫面.庫房 - 過濾SP
Ext.getCmp('btn_SP').on("click", function () {
var Tmp_WH = Ext.getCmp("WH").getValue();
var Tmp_url = '../api/V60202API/get_SPPick?WH=' + Tmp_WH;
var win = EditPickx('儲存位置', Tmp_url, ['SP',], ['SP'], J_pickstore_SP, J_pickcolumns_SP);
win.show();
});
//CLASS - 類別
Ext.getCmp('btn_CLASS').on("click", function () {
var win = EditPickx('類別', '../api/V60202API/get_CLASSPick', ['CLASS','CLASS_'], ['CLASS','CLASS_'], J_pickstore_CLASS, J_pickcolumns_CLASS);
win.show();
});
2>*.cs
//編輯欄位 - 挑選
//- [庫房(WH)]欄位挑選
[HttpPost]
public dynamic get_WHPick(string WH = "", int isComplete = 0)
{
string Tmp_Sql = " SELECT DISTINCT WH "
+ " FROM AMM_COMP "
+ " WHERE 1=1 "
+ " AND WH IS NOT NULL "
+ " AND STAT='A' "
+ " ORDER BY WH ";
string n = funId + "s_WH";
DataSet ds = setupPickDs(n, Tmp_Sql, new string[] { "AMM_COMP" });
if (WH != null && !WH.Equals(""))
{
if (isComplete == 1)
{
ds = getPickDsbyCondi(n, "WH='" + WH + "'");
}
else
{
ds = getPickDsbyCondi(n, "WH LIKE '%" + WH + "%'");
}
}
return ds;
} // end of get_WHPick
//- [儲存位置(SP)]欄位挑選 - 依畫面.庫房過濾
[HttpPost]
public dynamic get_SPPick(string SP = "", string WH="" ,int isComplete = 0)
{
string Tmp_Sql = " SELECT DISTINCT SP , WH "
+ " FROM AMM_COMP "
+ " WHERE 1=1 "
+ " AND SP IS NOT NULL "
+ " AND STAT='A' ";
if (!myfunc.checkisnull(WH))
Tmp_Sql = Tmp_Sql + " AND WH=" + myfunc.AA(WH);
Tmp_Sql = Tmp_Sql + " ORDER BY SP ";
string n = funId + "s_SP";
DataSet ds = setupPickDs(n, Tmp_Sql, new string[] { "AMM_COMP" });
if (SP != null && !SP.Equals(""))
{
if (isComplete == 1)
{
ds = getPickDsbyCondi(n, "SP='" + SP + "'");
}
else
{
ds = getPickDsbyCondi(n, "SP LIKE '%" + SP + "%'");
}
}
return ds;
} // end of get_SPPick
//編輯欄位- [類別(CLASS)]欄位挑選
[HttpPost]
public dynamic get_CLASSPick(string CLASS = "", int isComplete = 0)
{
string Tmp_Sql = " SELECT KEY_CODE as CLASS ,DESCPT as CLASS_ "
+ " FROM KEYCODE "
+ " WHERE TBL_NAME = 'AMM_COMP' "
+ " AND KEY_NAME = 'CLASS' ";
string n = funId + "s_CLASS";
DataSet ds = setupPickDs(n, Tmp_Sql, new string[] { "KEYCODE" });
if (CLASS != null && !CLASS.Equals(""))
{
if (isComplete == 1)
{
ds = getPickDsbyCondi(n, "CLASS='" + CLASS + "'");
}
else
{
ds = getPickDsbyCondi(n, "CLASS LIKE '%" + CLASS + "%'");
}
}
return ds;
} // end of get_CLASSPick
沒有留言:
張貼留言