# modSupplierProduct 編輯供應商產品
Heading: 編輯產品 | supplier.modProduct
Template: basicEdit
DataLoad:
DmmService/getSupplierProduct 取得供應商產品資料載入
-- 傳入:
{
"ua_id":"string",
"s_id":"string",
"sp_id":"string"
}
其中
ua_id: 傳入的 ua_id
s_id : 供應商id
sp_id :產品id
-- 回傳:
{
"returnCode":"string",
"errorMessage": "string",
"sp_name":"string",
"sp_brand":"string",
"sp_model":"string",
"sp_weight":DECIMAL,
"sp_weight_unit":"string",
"sp_packing_quantity":DECIMAL,
"sp_packing_unit":"string",
"sp_pic_id":"string",
"img_new_file_name":"string",
"img_file_path":"string",
"sp_active":"string",
"cr_date_time":"string",
"cr_by":"string",
"lm_date_time":"string",
"lm_by":"string"
}
其中
sp_name :產品名
sp_brand:廠牌
sp_model:型號
sp_weight:重量: 0~9999
sp_weight_unit:重量單位
sp_packing_quantity:包裝數量: 0~9999
sp_packing_unit:包裝單位
sp_pic_id:產品圖片 id
img_new_file_name:產品圖片檔名
img_file_path:產品圖片路徑
sp_active:active: 啟用 inactive:不啟用
cr_date_time:建立日期時間
cr_by:建立人員id
lm_date_time:修改日期時間
lm_by:修改人員id
## 傳入參數
|varName|說明|預設值|
|---|---|---|
|id|供應商 id|--> s_id|
|sp_id|供應商產品 ID|--> sp_id|
## 編輯欄位
|i18n label|中文標題|varName|inputType|legnth|必填|option|validate|位置|
|---|---|---|---|---|---|---|---|---|
||供應商 id|s_id|hidden||||||
||供應商產品 ID|sp_id|hidden||||||
|supplier.ProductName|產品名稱|sp_name|text|200|Y||||
|odm.po_digital_file_brand|廠牌|sp_brand|text|200|N||||
|supplier.model|型號|sp_model|text|200|N||||
|supplier.weight|重量|sp_weight|text|20|Y||||
||重量單位|sp_weight_unit|text|50|Y|[Common.getCode('weight_unit')](#)|||
|common.qty|數量|sp_packing_quantity|text|20|Y||||
||包裝單位|sp_packing_unit|text|50|Y|[Common.getCode('packing_unit')](#)|||
|common.active|啟用狀態|sp_active|radio|20|Y||||
|||sp_pic_id|imageFile|50|N|[FileService.imageUpload](#)||右上方圖像|
## validation
|funtion|description|API|
|---|---|---|
## button 動作
|i18n label|中文標題|API/URL|
|---|---|---|
|btn.cancle|取消|[supplier/supplierProductList?id={s_id}](https://hackmd.io/Rs-GVsWRSC-XfzAOLTFAJQ)|
|btn.confirm|確認|[DmmService.modSupplierProduct](#)|
|supplier.delProduct|刪除產品|[DmmService.delSupplierProduct(s_id,sp_id)](#)|
## 編輯送出
DmmService/modSupplierProduct 更新供應商產品(Y12)
-- 傳入:
{"ua_id":"string",
"sp_id": "string",
"s_id": "string",
"sp_name": "string",
"sp_brand": "string",
"sp_model": "string",
"sp_weight": DECIMAL,
"sp_weight_unit": "string",
"sp_packing_quantity": DECIMAL,
"sp_packing_unit": "string",
"sp_pic_id": "string",
"sp_active": "string"
}
其中
ua_id: 傳入的 ua_id
sp_id : 傳入的產品id
s_id : 傳入的供應商id
sp_name : 傳入的產品名稱
sp_brand : 傳入的廠牌
sp_model : 傳入的型號
sp_weight : 傳入的重量
sp_weight_unit : 傳入的重量單位
sp_packing_quantity : 傳入的包裝數量
sp_packing_unit : 傳入的包裝單位
sp_pic_id : 傳入的產品圖片 id
sp_active : 傳入的啟用狀態
-- 回傳:
{
"returnCode":"string",
"errorMessage": "string"
}
其中
returnCode: 'SUCCESS','INVALID_USER_ACCOUNT_FOR_THE_DATA' ,'DEFAULT_ERROR_MESSAGE'
## 刪除送出
DmmService/delSupplierProduct 刪除供應商產品(Y17)
-- 傳入:
{
"ua_id":"string",
"s_id":"string",
"sp_id":"string"
}
其中
ua_id: 傳入的 ua_id
s_id : 供應商id
sp_id :產品id
-- 回傳:
{
"returnCode":"string",
"errorMessage": "string"
}
其中
returnCode: 'SUCCESS','INVALID_USER_ACCOUNT_FOR_THE_DATA' ,'DEFAULT_ERROR_MESSAGE'
## 多語
1.該產品已被補綴物類別使用,無法進行刪除('PRODUCT_USED')
2.編輯失敗,名稱已存在('DATA EXISTS')