refactor:header registered branch
This commit is contained in:
parent
c76dd473bb
commit
2fbf4edf36
3 changed files with 25 additions and 3 deletions
|
|
@ -24,6 +24,7 @@ defineProps<{
|
|||
dense?: boolean;
|
||||
outlined?: boolean;
|
||||
readonly?: boolean;
|
||||
readOnlybranchOption?: boolean;
|
||||
separator?: boolean;
|
||||
isType?: boolean;
|
||||
disableCode?: boolean;
|
||||
|
|
@ -77,10 +78,11 @@ watch(
|
|||
v-model="registeredBranchId"
|
||||
id="input-source-nationality"
|
||||
for="input-source-nationality"
|
||||
:disable="!readonly"
|
||||
:dense="dense"
|
||||
:readonly="readonly"
|
||||
:readonly="readonly || readOnlybranchOption"
|
||||
:options="branchOptions"
|
||||
:hide-dropdown-icon="readonly"
|
||||
:hide-dropdown-icon="readonly || readOnlybranchOption"
|
||||
:label="$t('productService.service.registeredBranch')"
|
||||
:rules="[
|
||||
(val) => {
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ const {
|
|||
} = productServiceStore;
|
||||
|
||||
const { workNameItems } = storeToRefs(productServiceStore);
|
||||
|
||||
const readOnlybranchOption = ref<boolean>(false);
|
||||
const allStat = ref<{ mode: string; count: number }[]>([]);
|
||||
const stat = ref<
|
||||
{
|
||||
|
|
@ -847,6 +847,7 @@ function undoProductGroup() {
|
|||
registeredBranchId: previousValue.value.registeredBranchId,
|
||||
};
|
||||
isEdit.value = false;
|
||||
readOnlybranchOption.value = false;
|
||||
flowStore.rotate();
|
||||
}
|
||||
|
||||
|
|
@ -863,6 +864,22 @@ async function assignFormDataGroup(data: ProductGroup) {
|
|||
code: data.code,
|
||||
registeredBranchId: data.registeredBranchId,
|
||||
};
|
||||
|
||||
const tempValue = branchOption.value.find(
|
||||
(v) => v.id === data.registeredBranchId,
|
||||
);
|
||||
|
||||
if (tempValue !== undefined) {
|
||||
readOnlybranchOption.value = false;
|
||||
} else {
|
||||
readOnlybranchOption.value = true;
|
||||
branchOption.value = [
|
||||
{
|
||||
id: data.registeredBranch.id,
|
||||
name: data.registeredBranch.name,
|
||||
},
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
const prevService = ref<ServiceCreate>({
|
||||
|
|
@ -3175,10 +3192,12 @@ watch(
|
|||
style="overflow-y: auto"
|
||||
>
|
||||
<!-- :isType="productMode === 'type'" -->
|
||||
|
||||
<BasicInformation
|
||||
id="info-group"
|
||||
dense
|
||||
:readonly="!isEdit"
|
||||
:readOnlybranchOption="!readOnlybranchOption"
|
||||
v-model:options-branch="branchOption"
|
||||
v-model:registered-branch-id="formDataGroup.registeredBranchId"
|
||||
v-model:remark="formDataGroup.remark"
|
||||
|
|
|
|||
|
|
@ -196,6 +196,7 @@ export type ProductGroup = {
|
|||
remark: string;
|
||||
status: Status;
|
||||
registeredBranchId: string;
|
||||
registeredBranch: { id: string; name: string };
|
||||
createdBy: CreatedBy;
|
||||
createdAt: string;
|
||||
updatedBy: UpdatedBy;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue