feat: ยกเลิก การแก้ไขของ สินค้า ข้อมูล ย้อนกลับไปเป็นอันเก่า
This commit is contained in:
parent
a2ca765eb0
commit
771b3e8ab6
1 changed files with 22 additions and 2 deletions
|
|
@ -624,10 +624,23 @@ async function assignFormDataProductService(id: string) {
|
|||
}
|
||||
}
|
||||
|
||||
const prevProduct = ref<ProductCreate>({
|
||||
productTypeId: '',
|
||||
remark: '',
|
||||
serviceCharge: 0,
|
||||
agentPrice: 0,
|
||||
price: 0,
|
||||
process: 0,
|
||||
detail: '',
|
||||
name: '',
|
||||
code: '',
|
||||
image: undefined,
|
||||
});
|
||||
|
||||
function assignFormDataProduct(data: ProductList) {
|
||||
statusToggle.value = data.status === 'INACTIVE' ? false : true;
|
||||
|
||||
formDataProduct.value = {
|
||||
prevProduct.value = {
|
||||
productTypeId: data.productTypeId,
|
||||
remark: data.remark,
|
||||
serviceCharge: data.serviceCharge,
|
||||
|
|
@ -639,6 +652,8 @@ function assignFormDataProduct(data: ProductList) {
|
|||
code: data.code,
|
||||
image: undefined,
|
||||
};
|
||||
|
||||
formDataProduct.value = { ...prevProduct.value };
|
||||
}
|
||||
|
||||
function clearFormGroup() {
|
||||
|
|
@ -1715,7 +1730,12 @@ watch(currentStatus, async () => {
|
|||
noAddress
|
||||
:title="$t('editProduct')"
|
||||
:editData="() => (infoProductEdit = true)"
|
||||
:undo="() => (infoProductEdit = false)"
|
||||
:undo="
|
||||
() => {
|
||||
formDataProduct = { ...prevProduct };
|
||||
infoProductEdit = false;
|
||||
}
|
||||
"
|
||||
:deleteData="
|
||||
() => {
|
||||
deleteTypeOfProduct();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue