fix(04): branch id select label

This commit is contained in:
puriphatt 2024-07-30 05:29:36 +00:00
parent 1661ce4b4a
commit fba8992419
3 changed files with 16 additions and 21 deletions

View file

@ -1,4 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { QSelect } from 'quasar';
import { getRole } from 'src/services/keycloak'; import { getRole } from 'src/services/keycloak';
import { selectFilterOptionRefMod } from 'src/stores/utils'; import { selectFilterOptionRefMod } from 'src/stores/utils';
import { ref, onMounted } from 'vue'; import { ref, onMounted } from 'vue';
@ -15,7 +16,7 @@ const registeredBranchId = defineModel<string>('registeredBranchId');
const codeOption = ref<{ id: string; name: string }[]>([]); const codeOption = ref<{ id: string; name: string }[]>([]);
const optionsBranch = defineModel<{ id: string; name: string }[]>( const optionsBranch = defineModel<{ id: string; name: string }[]>(
'optionsBranch', 'optionsBranch',
{ required: true }, { default: [] },
); );
defineProps<{ defineProps<{
@ -87,7 +88,6 @@ const branchFilter = selectFilterOptionRefMod(
</q-item> </q-item>
</template> </template>
</q-select> </q-select>
<q-select <q-select
outlined outlined
clearable clearable

View file

@ -1,15 +1,12 @@
<script setup lang="ts"> <script setup lang="ts">
import { QSelect } from 'quasar';
import { getRole } from 'src/services/keycloak'; import { getRole } from 'src/services/keycloak';
import useOptionStore from 'src/stores/options';
import { selectFilterOptionRefMod } from 'src/stores/utils'; import { selectFilterOptionRefMod } from 'src/stores/utils';
import { ref } from 'vue'; import { ref } from 'vue';
const optionStore = useOptionStore();
const remark = defineModel<string>('remark'); const remark = defineModel<string>('remark');
const detail = defineModel<string>('detail'); const detail = defineModel<string>('detail');
const name = defineModel<string>('name'); const name = defineModel<string>('name');
const code = defineModel<string>('code');
const serviceCode = defineModel<string>('serviceCode'); const serviceCode = defineModel<string>('serviceCode');
const serviceName = defineModel<string>('serviceNameTh'); const serviceName = defineModel<string>('serviceNameTh');
@ -19,7 +16,7 @@ const registeredBranchId = defineModel<string | null>('registeredBranchId');
const optionsBranch = defineModel<{ id: string; name: string }[]>( const optionsBranch = defineModel<{ id: string; name: string }[]>(
'optionsBranch', 'optionsBranch',
{ required: true }, { default: [] },
); );
defineProps<{ defineProps<{

View file

@ -1397,9 +1397,9 @@ watch(
padding="xs" padding="xs"
icon="mdi-folder-multiple-plus" icon="mdi-folder-multiple-plus"
@click=" @click="
() => { async () => {
clearFormProduct(); clearFormProduct();
fetchListOfOptionBranch(); await fetchListOfOptionBranch();
dialogProduct = true; dialogProduct = true;
} }
" "
@ -1413,10 +1413,10 @@ watch(
padding="xs" padding="xs"
icon="mdi-folder-multiple-plus" icon="mdi-folder-multiple-plus"
@click=" @click="
() => { async () => {
clearFormGroup(); clearFormGroup();
clearFormService(); clearFormService();
fetchListOfOptionBranch(); await fetchListOfOptionBranch();
currentServiceTab = 'serviceInformation'; currentServiceTab = 'serviceInformation';
dialogService = true; dialogService = true;
} }
@ -2884,6 +2884,7 @@ watch(
flat flat
@click.stop=" @click.stop="
async () => { async () => {
await fetchListOfOptionBranch();
if (props.row.type === 'product') { if (props.row.type === 'product') {
currentIdProduct = props.row.id; currentIdProduct = props.row.id;
assignFormDataProduct(props.row); assignFormDataProduct(props.row);
@ -2895,7 +2896,6 @@ watch(
assignFormDataProductService(props.row.id); assignFormDataProductService(props.row.id);
dialogServiceEdit = true; dialogServiceEdit = true;
} }
await fetchListOfOptionBranch();
} }
" "
/> />
@ -2915,6 +2915,7 @@ watch(
:id="`view-detail-btn-${props.row.name}-view`" :id="`view-detail-btn-${props.row.name}-view`"
@click.stop=" @click.stop="
async () => { async () => {
await fetchListOfOptionBranch();
if (props.row.type === 'product') { if (props.row.type === 'product') {
currentIdProduct = props.row.id; currentIdProduct = props.row.id;
assignFormDataProduct(props.row); assignFormDataProduct(props.row);
@ -2928,7 +2929,6 @@ watch(
); );
dialogServiceEdit = true; dialogServiceEdit = true;
} }
await fetchListOfOptionBranch();
} }
" "
v-close-popup v-close-popup
@ -2957,6 +2957,7 @@ watch(
style="white-space: nowrap" style="white-space: nowrap"
@click=" @click="
async () => { async () => {
await fetchListOfOptionBranch();
if (props.row.type === 'product') { if (props.row.type === 'product') {
currentIdProduct = props.row.id; currentIdProduct = props.row.id;
infoProductEdit = true; infoProductEdit = true;
@ -2971,8 +2972,6 @@ watch(
); );
dialogServiceEdit = true; dialogServiceEdit = true;
} }
await fetchListOfOptionBranch();
} }
" "
> >
@ -3073,6 +3072,7 @@ watch(
" "
@menuViewDetail=" @menuViewDetail="
async () => { async () => {
await fetchListOfOptionBranch();
if (row.type === 'product') { if (row.type === 'product') {
currentIdProduct = row.id; currentIdProduct = row.id;
assignFormDataProduct(row); assignFormDataProduct(row);
@ -3084,11 +3084,11 @@ watch(
assignFormDataProductService(row.id); assignFormDataProductService(row.id);
dialogServiceEdit = true; dialogServiceEdit = true;
} }
await fetchListOfOptionBranch();
} }
" "
@menuEdit=" @menuEdit="
async () => { async () => {
await fetchListOfOptionBranch();
if (row.type === 'product') { if (row.type === 'product') {
currentIdProduct = row.id; currentIdProduct = row.id;
infoProductEdit = true; infoProductEdit = true;
@ -3101,8 +3101,6 @@ watch(
assignFormDataProductService(row.id); assignFormDataProductService(row.id);
dialogServiceEdit = true; dialogServiceEdit = true;
} }
await fetchListOfOptionBranch();
} }
" "
/> />
@ -3202,7 +3200,6 @@ watch(
<BasicInformation <BasicInformation
dense dense
:isType="productMode === 'type'" :isType="productMode === 'type'"
v-model:options-branch="branchOption"
v-model:remark="formDataGroup.remark" v-model:remark="formDataGroup.remark"
v-model:name="formDataGroup.name" v-model:name="formDataGroup.name"
v-model:detail="formDataGroup.detail" v-model:detail="formDataGroup.detail"
@ -3262,7 +3259,6 @@ watch(
dense dense
:isType="productMode === 'type'" :isType="productMode === 'type'"
:readonly="!isEdit" :readonly="!isEdit"
v-model:options-branch="branchOption"
v-model:remark="formDataGroup.remark" v-model:remark="formDataGroup.remark"
v-model:name="formDataGroup.name" v-model:name="formDataGroup.name"
v-model:code="formDataGroup.code" v-model:code="formDataGroup.code"
@ -3817,8 +3813,10 @@ watch(
v-ripple v-ripple
v-close-popup v-close-popup
@click.stop=" @click.stop="
() => { async () => {
if (!currentNode) return; if (!currentNode) return;
await fetchListOfOptionBranch();
if (currentNode.type === 'type') { if (currentNode.type === 'type') {
editByTree = 'type'; editByTree = 'type';
currentStatusProduct = currentNode.status === 'INACTIVE'; currentStatusProduct = currentNode.status === 'INACTIVE';