Showing
9 changed files
with
84 additions
and
2 deletions
| @@ -31,7 +31,7 @@ import { getEntitiesId } from '/@/api/dashboard/index'; | @@ -31,7 +31,7 @@ import { getEntitiesId } from '/@/api/dashboard/index'; | ||
| 31 | import { useRole } from '/@/hooks/business/useRole'; | 31 | import { useRole } from '/@/hooks/business/useRole'; |
| 32 | import { useLocaleStore } from './locale'; | 32 | import { useLocaleStore } from './locale'; |
| 33 | 33 | ||
| 34 | -export const TARGET_TENANT_ID = '0414df80-f01d-11f0-9cb8-e3376d1e7978'; | 34 | +export const TARGET_TENANT_ID = 'bdae06d0-bceb-11ef-8689-8dadda196010'; |
| 35 | 35 | ||
| 36 | export function isTargetTenantId(tenantId?: string | null) { | 36 | export function isTargetTenantId(tenantId?: string | null) { |
| 37 | return tenantId === TARGET_TENANT_ID; | 37 | return tenantId === TARGET_TENANT_ID; |
| 1 | import { useI18n } from '/@/hooks/web/useI18n'; | 1 | import { useI18n } from '/@/hooks/web/useI18n'; |
| 2 | 2 | ||
| 3 | const { t } = useI18n(); | 3 | const { t } = useI18n(); |
| 4 | -import { FormSchema } from '/@/components/Table'; | 4 | +import { FormSchema, useComponentRegister } from '/@/components/Form'; |
| 5 | +import { OrgTreeSelect } from '/@/views/common/OrgTreeSelect'; | ||
| 6 | + | ||
| 7 | +useComponentRegister('OrgTreeSelect', OrgTreeSelect); | ||
| 5 | 8 | ||
| 6 | //表单字段 | 9 | //表单字段 |
| 7 | export const schemas: FormSchema[] = [ | 10 | export const schemas: FormSchema[] = [ |
| @@ -13,6 +16,13 @@ export const schemas: FormSchema[] = [ | @@ -13,6 +16,13 @@ export const schemas: FormSchema[] = [ | ||
| 13 | colProps: { span: 18 }, | 16 | colProps: { span: 18 }, |
| 14 | }, | 17 | }, |
| 15 | { | 18 | { |
| 19 | + field: 'organizationId', | ||
| 20 | + label: t('business.affiliatedOrganizationText'), | ||
| 21 | + component: 'OrgTreeSelect', | ||
| 22 | + required: true, | ||
| 23 | + colProps: { span: 18 }, | ||
| 24 | + }, | ||
| 25 | + { | ||
| 16 | field: 'cagegoryOrder', | 26 | field: 'cagegoryOrder', |
| 17 | label: t('equipment.category.orderText'), | 27 | label: t('equipment.category.orderText'), |
| 18 | component: 'Input', | 28 | component: 'Input', |
| 1 | import {FormSchema} from "/@/components/Form"; | 1 | import {FormSchema} from "/@/components/Form"; |
| 2 | import {useI18n} from "/@/hooks/web/useI18n"; | 2 | import {useI18n} from "/@/hooks/web/useI18n"; |
| 3 | import {BasicColumn} from "/@/components/Table"; | 3 | import {BasicColumn} from "/@/components/Table"; |
| 4 | +import { useComponentRegister } from '/@/components/Form'; | ||
| 5 | +import { OrgTreeSelect } from '/@/views/common/OrgTreeSelect'; | ||
| 4 | const { t } = useI18n(); | 6 | const { t } = useI18n(); |
| 5 | 7 | ||
| 8 | +useComponentRegister('OrgTreeSelect', OrgTreeSelect); | ||
| 6 | 9 | ||
| 7 | const statusOptions = [ | 10 | const statusOptions = [ |
| 8 | { label: t('equipment.checkPlan.enableText'), value: 'ENABLE' }, | 11 | { label: t('equipment.checkPlan.enableText'), value: 'ENABLE' }, |
| @@ -91,6 +94,13 @@ export const schemas: FormSchema[] = [ | @@ -91,6 +94,13 @@ export const schemas: FormSchema[] = [ | ||
| 91 | }, | 94 | }, |
| 92 | }, | 95 | }, |
| 93 | { | 96 | { |
| 97 | + field: 'organizationId', | ||
| 98 | + label: t('business.affiliatedOrganizationText'), | ||
| 99 | + component: 'OrgTreeSelect', | ||
| 100 | + colProps: { span: 21 }, | ||
| 101 | + required: true, | ||
| 102 | + }, | ||
| 103 | + { | ||
| 94 | field: 'type', | 104 | field: 'type', |
| 95 | label: t('equipment.checkPlan.typeText'), | 105 | label: t('equipment.checkPlan.typeText'), |
| 96 | component: 'RadioButtonGroup', | 106 | component: 'RadioButtonGroup', |
| 1 | import {FormSchema} from "/@/components/Form"; | 1 | import {FormSchema} from "/@/components/Form"; |
| 2 | import {useI18n} from "/@/hooks/web/useI18n"; | 2 | import {useI18n} from "/@/hooks/web/useI18n"; |
| 3 | import {BasicColumn} from "/@/components/Table"; | 3 | import {BasicColumn} from "/@/components/Table"; |
| 4 | +import { useComponentRegister } from '/@/components/Form'; | ||
| 5 | +import { OrgTreeSelect } from '/@/views/common/OrgTreeSelect'; | ||
| 4 | const { t } = useI18n(); | 6 | const { t } = useI18n(); |
| 7 | + | ||
| 8 | +useComponentRegister('OrgTreeSelect', OrgTreeSelect); | ||
| 5 | const statusOptions = [ | 9 | const statusOptions = [ |
| 6 | { label: t('equipment.errorReason.enableText'), value: 'ENABLE' }, | 10 | { label: t('equipment.errorReason.enableText'), value: 'ENABLE' }, |
| 7 | { label: t('equipment.errorReason.disabledText'), value: 'DISABLE' }, | 11 | { label: t('equipment.errorReason.disabledText'), value: 'DISABLE' }, |
| @@ -64,6 +68,13 @@ export const schemas: FormSchema[] = [ | @@ -64,6 +68,13 @@ export const schemas: FormSchema[] = [ | ||
| 64 | }, | 68 | }, |
| 65 | }, | 69 | }, |
| 66 | { | 70 | { |
| 71 | + field: 'organizationId', | ||
| 72 | + label: t('business.affiliatedOrganizationText'), | ||
| 73 | + component: 'OrgTreeSelect', | ||
| 74 | + colProps: { span: 21 }, | ||
| 75 | + required: true, | ||
| 76 | + }, | ||
| 77 | + { | ||
| 67 | field: 'status', | 78 | field: 'status', |
| 68 | label: t('equipment.errorReason.statusText'), | 79 | label: t('equipment.errorReason.statusText'), |
| 69 | component: 'RadioButtonGroup', | 80 | component: 'RadioButtonGroup', |
| @@ -72,6 +72,13 @@ export function getFormSchema(isTargetTenant: boolean): BFormSchema[] { | @@ -72,6 +72,13 @@ export function getFormSchema(isTargetTenant: boolean): BFormSchema[] { | ||
| 72 | }, | 72 | }, |
| 73 | }, | 73 | }, |
| 74 | { | 74 | { |
| 75 | + field: 'organizationId', | ||
| 76 | + label: t('business.affiliatedOrganizationText'), | ||
| 77 | + component: 'OrgTreeSelect', | ||
| 78 | + colProps: { span: 24 }, | ||
| 79 | + required: true, | ||
| 80 | + }, | ||
| 81 | + { | ||
| 75 | field: 'categoryId', | 82 | field: 'categoryId', |
| 76 | label: t('equipment.category.categoryText'), | 83 | label: t('equipment.category.categoryText'), |
| 77 | colProps: { span: 24 }, | 84 | colProps: { span: 24 }, |
| 1 | import {FormSchema} from "/@/components/Form"; | 1 | import {FormSchema} from "/@/components/Form"; |
| 2 | import {useI18n} from "/@/hooks/web/useI18n"; | 2 | import {useI18n} from "/@/hooks/web/useI18n"; |
| 3 | import {BasicColumn} from "/@/components/Table"; | 3 | import {BasicColumn} from "/@/components/Table"; |
| 4 | +import { useComponentRegister } from '/@/components/Form'; | ||
| 5 | +import { OrgTreeSelect } from '/@/views/common/OrgTreeSelect'; | ||
| 4 | 6 | ||
| 5 | const { t } = useI18n(); | 7 | const { t } = useI18n(); |
| 8 | + | ||
| 9 | +useComponentRegister('OrgTreeSelect', OrgTreeSelect); | ||
| 6 | export const searchFormSchema: FormSchema[] = [ | 10 | export const searchFormSchema: FormSchema[] = [ |
| 7 | { | 11 | { |
| 8 | field: 'name', | 12 | field: 'name', |
| @@ -59,6 +63,13 @@ export const schemas: FormSchema[] = [ | @@ -59,6 +63,13 @@ export const schemas: FormSchema[] = [ | ||
| 59 | }, | 63 | }, |
| 60 | }, | 64 | }, |
| 61 | { | 65 | { |
| 66 | + field: 'organizationId', | ||
| 67 | + label: t('business.affiliatedOrganizationText'), | ||
| 68 | + component: 'OrgTreeSelect', | ||
| 69 | + colProps: { span: 21 }, | ||
| 70 | + required: true, | ||
| 71 | + }, | ||
| 72 | + { | ||
| 62 | field: 'contacts', | 73 | field: 'contacts', |
| 63 | label: t('equipment.supplier.contactsName'), | 74 | label: t('equipment.supplier.contactsName'), |
| 64 | component: 'Input', | 75 | component: 'Input', |
| @@ -58,6 +58,15 @@ | @@ -58,6 +58,15 @@ | ||
| 58 | </a-select> | 58 | </a-select> |
| 59 | </a-form-item> | 59 | </a-form-item> |
| 60 | </a-col> | 60 | </a-col> |
| 61 | + <a-col :span="12"> | ||
| 62 | + <a-form-item label="所属组织" name="organizationId"> | ||
| 63 | + <OrgTreeSelect | ||
| 64 | + :value="form.organizationId" | ||
| 65 | + @change="(value) => (form.organizationId = value)" | ||
| 66 | + :disabled="isViewMode" | ||
| 67 | + /> | ||
| 68 | + </a-form-item> | ||
| 69 | + </a-col> | ||
| 61 | </a-row> | 70 | </a-row> |
| 62 | <a-row :gutter="16"> | 71 | <a-row :gutter="16"> |
| 63 | <a-col :span="24"> | 72 | <a-col :span="24"> |
| @@ -169,6 +178,7 @@ | @@ -169,6 +178,7 @@ | ||
| 169 | import {onMounted, ref, watch, reactive} from "vue"; | 178 | import {onMounted, ref, watch, reactive} from "vue"; |
| 170 | import {getLedgerList} from "/@/api/equipment/ledger"; | 179 | import {getLedgerList} from "/@/api/equipment/ledger"; |
| 171 | import {getPlanList} from "/@/api/equipment/chenkPlan"; | 180 | import {getPlanList} from "/@/api/equipment/chenkPlan"; |
| 181 | +import { OrgTreeSelect } from '/@/views/common/OrgTreeSelect'; | ||
| 172 | import { useUserStore } from '/@/store/modules/user'; | 182 | import { useUserStore } from '/@/store/modules/user'; |
| 173 | import { BasicTable, useTable } from '/@/components/Table'; | 183 | import { BasicTable, useTable } from '/@/components/Table'; |
| 174 | const Options = ref([]); | 184 | const Options = ref([]); |
| @@ -185,6 +195,7 @@ const props = defineProps({ | @@ -185,6 +195,7 @@ const props = defineProps({ | ||
| 185 | enabled: '', | 195 | enabled: '', |
| 186 | startTime: '', | 196 | startTime: '', |
| 187 | endTime: '', | 197 | endTime: '', |
| 198 | + organizationId: '', | ||
| 188 | remark: '', | 199 | remark: '', |
| 189 | }, | 200 | }, |
| 190 | tableData: [], | 201 | tableData: [], |
| @@ -247,6 +258,7 @@ const rules = { | @@ -247,6 +258,7 @@ const rules = { | ||
| 247 | { required: true, message: '请输入', trigger: 'blur' }, | 258 | { required: true, message: '请输入', trigger: 'blur' }, |
| 248 | ], | 259 | ], |
| 249 | status: [{ required: true, message: '请选择', trigger: 'change' }], | 260 | status: [{ required: true, message: '请选择', trigger: 'change' }], |
| 261 | + organizationId: [{ required: true, message: '请选择', trigger: 'change' }], | ||
| 250 | }; | 262 | }; |
| 251 | const visible = ref(props.visible); | 263 | const visible = ref(props.visible); |
| 252 | const isViewMode = ref(props.isViewMode); | 264 | const isViewMode = ref(props.isViewMode); |
| @@ -404,6 +416,7 @@ const resetForm = () => { | @@ -404,6 +416,7 @@ const resetForm = () => { | ||
| 404 | enabled: '', | 416 | enabled: '', |
| 405 | startTime: '', | 417 | startTime: '', |
| 406 | endTime: '', | 418 | endTime: '', |
| 419 | + organizationId: '', | ||
| 407 | remark: '', | 420 | remark: '', |
| 408 | }; | 421 | }; |
| 409 | tableData.value = []; | 422 | tableData.value = []; |
| @@ -42,6 +42,15 @@ | @@ -42,6 +42,15 @@ | ||
| 42 | <a-input v-model:value="form.frequency" :disabled="isViewMode" /> | 42 | <a-input v-model:value="form.frequency" :disabled="isViewMode" /> |
| 43 | </a-form-item> | 43 | </a-form-item> |
| 44 | </a-col> | 44 | </a-col> |
| 45 | + <a-col :span="12"> | ||
| 46 | + <a-form-item label="所属组织" name="organizationId"> | ||
| 47 | + <OrgTreeSelect | ||
| 48 | + :value="form.organizationId" | ||
| 49 | + @change="(value) => (form.organizationId = value)" | ||
| 50 | + :disabled="isViewMode" | ||
| 51 | + /> | ||
| 52 | + </a-form-item> | ||
| 53 | + </a-col> | ||
| 45 | </a-row> | 54 | </a-row> |
| 46 | <a-form-item | 55 | <a-form-item |
| 47 | label="保养明细" | 56 | label="保养明细" |
| @@ -147,6 +156,7 @@ import { getPlanList } from "/@/api/equipment/chenkPlan"; | @@ -147,6 +156,7 @@ import { getPlanList } from "/@/api/equipment/chenkPlan"; | ||
| 147 | import { useI18n } from "/@/hooks/web/useI18n"; | 156 | import { useI18n } from "/@/hooks/web/useI18n"; |
| 148 | import { useUserStore } from '/@/store/modules/user'; | 157 | import { useUserStore } from '/@/store/modules/user'; |
| 149 | import { BasicTable, useTable } from '/@/components/Table'; | 158 | import { BasicTable, useTable } from '/@/components/Table'; |
| 159 | +import { OrgTreeSelect } from '/@/views/common/OrgTreeSelect'; | ||
| 150 | 160 | ||
| 151 | const Options = ref([]); | 161 | const Options = ref([]); |
| 152 | const planOptions = ref([]); | 162 | const planOptions = ref([]); |
| @@ -163,6 +173,7 @@ const props = defineProps({ | @@ -163,6 +173,7 @@ const props = defineProps({ | ||
| 163 | status: '', | 173 | status: '', |
| 164 | times: '', | 174 | times: '', |
| 165 | frequency: '', | 175 | frequency: '', |
| 176 | + organizationId: '', | ||
| 166 | }, | 177 | }, |
| 167 | tableData: [], | 178 | tableData: [], |
| 168 | }), | 179 | }), |
| @@ -199,6 +210,7 @@ const rules = { | @@ -199,6 +210,7 @@ const rules = { | ||
| 199 | { required: true, message: '请输入', trigger: 'blur' }, | 210 | { required: true, message: '请输入', trigger: 'blur' }, |
| 200 | ], | 211 | ], |
| 201 | status: [{ required: true, message: '请选择', trigger: 'change' }], | 212 | status: [{ required: true, message: '请选择', trigger: 'change' }], |
| 213 | + organizationId: [{ required: true, message: '请选择', trigger: 'change' }], | ||
| 202 | preserveDetailList: [{ required: true, message: '请选择', trigger: 'change' }], | 214 | preserveDetailList: [{ required: true, message: '请选择', trigger: 'change' }], |
| 203 | 215 | ||
| 204 | }; | 216 | }; |
| @@ -400,6 +412,7 @@ const resetForm = () => { | @@ -400,6 +412,7 @@ const resetForm = () => { | ||
| 400 | status: '', | 412 | status: '', |
| 401 | times: '', | 413 | times: '', |
| 402 | frequency: '', | 414 | frequency: '', |
| 415 | + organizationId: '', | ||
| 403 | }; | 416 | }; |
| 404 | tableData.value = []; | 417 | tableData.value = []; |
| 405 | isViewMode.value = false; | 418 | isViewMode.value = false; |
| @@ -189,6 +189,13 @@ export const schemas: FormSchema[] = [ | @@ -189,6 +189,13 @@ export const schemas: FormSchema[] = [ | ||
| 189 | }, | 189 | }, |
| 190 | }, | 190 | }, |
| 191 | { | 191 | { |
| 192 | + field: 'organizationId', | ||
| 193 | + label: t('business.affiliatedOrganizationText'), | ||
| 194 | + component: 'OrgTreeSelect', | ||
| 195 | + colProps: { span: 21 }, | ||
| 196 | + required: true, | ||
| 197 | + }, | ||
| 198 | + { | ||
| 192 | field: 'reportDate', | 199 | field: 'reportDate', |
| 193 | label: t('repair.order.time'), | 200 | label: t('repair.order.time'), |
| 194 | component: 'DatePicker', | 201 | component: 'DatePicker', |