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