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