fix: กด สร้าง ใหม่ไม่ล้างค่า

This commit is contained in:
Net 2024-06-20 13:21:50 +07:00
parent bbfa9e8dbd
commit 60b852761d

View file

@ -101,7 +101,7 @@ const profileUrl = ref<string | null>('');
const groupName = ref<string>('งาน MOU');
const dialogProductServiceType = ref<boolean>(false);
const dialogTotalProduct = ref<boolean>(true);
const dialogTotalProduct = ref<boolean>(false);
const productMode = ref<'group' | 'type' | 'service' | 'product'>('group');
const productGroup = ref<ProductGroup[]>();
@ -418,6 +418,8 @@ async function assignFormDataProductService(id: string) {
}
function assignFormDataProduct(data: ProductList) {
console.log(data.detail);
formDataProduct.value = {
productTypeId: data.productTypeId,
remark: data.remark,
@ -425,7 +427,7 @@ function assignFormDataProduct(data: ProductList) {
agentPrice: data.agentPrice,
price: data.price,
process: data.process,
detail: data.detail,
detail: data.detail === '' ? '-' : data.detail,
name: data.name,
code: data.code,
image: undefined,
@ -588,6 +590,7 @@ watch(currentStatus, async () => {
icon="mdi-folder-multiple-plus"
@click="
() => {
clearFormProduct();
dialogProduct = true;
}
"
@ -1048,6 +1051,7 @@ watch(currentStatus, async () => {
@viewDetail="
() => {
currentIdProduct = i.id;
infoProductEdit = false;
assignFormDataProduct(i);
dialogProductEdit = true;
}