fix: แก้การแก้สถานะ
This commit is contained in:
parent
f6c87a6bde
commit
92454ca16a
1 changed files with 24 additions and 1 deletions
|
|
@ -420,6 +420,8 @@ async function assignFormDataProductService(id: string) {
|
||||||
function assignFormDataProduct(data: ProductList) {
|
function assignFormDataProduct(data: ProductList) {
|
||||||
console.log(data.detail);
|
console.log(data.detail);
|
||||||
|
|
||||||
|
statusToggle.value = data.status === 'INACTIVE' ? false : true;
|
||||||
|
|
||||||
formDataProduct.value = {
|
formDataProduct.value = {
|
||||||
productTypeId: data.productTypeId,
|
productTypeId: data.productTypeId,
|
||||||
remark: data.remark,
|
remark: data.remark,
|
||||||
|
|
@ -500,7 +502,10 @@ async function submitProduct() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dialogProductEdit.value) {
|
if (dialogProductEdit.value) {
|
||||||
await editProduct(currentIdProduct.value, formDataProduct.value);
|
await editProduct(currentIdProduct.value, {
|
||||||
|
...formDataProduct.value,
|
||||||
|
status: statusToggle.value ? 'ACTIVE' : 'INACTIVE',
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
clearFormProduct();
|
clearFormProduct();
|
||||||
|
|
@ -1033,6 +1038,7 @@ watch(currentStatus, async () => {
|
||||||
:price="i.price"
|
:price="i.price"
|
||||||
:process="i.process"
|
:process="i.process"
|
||||||
:id="i.id"
|
:id="i.id"
|
||||||
|
:status="i.status === 'INACTIVE' ? true : false"
|
||||||
@menuViewDetail="
|
@menuViewDetail="
|
||||||
() => {
|
() => {
|
||||||
currentIdProduct = i.id;
|
currentIdProduct = i.id;
|
||||||
|
|
@ -1200,6 +1206,7 @@ watch(currentStatus, async () => {
|
||||||
v-model:status-toggle="statusToggle"
|
v-model:status-toggle="statusToggle"
|
||||||
v-model:profile-submit="profileSubmit"
|
v-model:profile-submit="profileSubmit"
|
||||||
@input-file="inputFile.click()"
|
@input-file="inputFile.click()"
|
||||||
|
:hide-toggle="false"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -1255,7 +1262,23 @@ watch(currentStatus, async () => {
|
||||||
v-model:status-toggle="statusToggle"
|
v-model:status-toggle="statusToggle"
|
||||||
v-model:profile-submit="profileSubmit"
|
v-model:profile-submit="profileSubmit"
|
||||||
@input-file="inputFile.click()"
|
@input-file="inputFile.click()"
|
||||||
|
:label-status-toggle="'formDialogTitleProductStatus'"
|
||||||
|
:hide-toggle="false"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<div class="text-left q-pt-md" v-if="infoProductEdit">
|
||||||
|
<q-toggle
|
||||||
|
id="toggle-status"
|
||||||
|
dense
|
||||||
|
size="md"
|
||||||
|
v-model="statusToggle"
|
||||||
|
padding="none"
|
||||||
|
class="q-pr-md"
|
||||||
|
/>
|
||||||
|
<span>
|
||||||
|
{{ statusToggle ? $t('switchOnLabel') : $t('switchOffLabel') }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<AppBox class="col-10" bordered>
|
<AppBox class="col-10" bordered>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue