Showing
8 changed files
with
59 additions
and
65 deletions
@@ -177,7 +177,7 @@ const handleSwitch = async (e: any, record: any) => { | @@ -177,7 +177,7 @@ const handleSwitch = async (e: any, record: any) => { | ||
177 | switchLoading.value = false; | 177 | switchLoading.value = false; |
178 | }, 1500); | 178 | }, 1500); |
179 | createMessage.success( | 179 | createMessage.success( |
180 | - `${!e ? t('common.disableText') : t('common.enableText')}${t('common.successText')}` | 180 | + `${e !== 'ENABLE' ? t('common.disableText') : t('common.enableText')}${t('common.successText')}` |
181 | ); | 181 | ); |
182 | handleReload(); | 182 | handleReload(); |
183 | }; | 183 | }; |
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | showFooter | 5 | showFooter |
6 | width="35%" | 6 | width="35%" |
7 | :maskClosable="true" | 7 | :maskClosable="true" |
8 | - :title="businessText" | 8 | + :title="titleText" |
9 | @register="registerDrawer" | 9 | @register="registerDrawer" |
10 | wrapClassName="report-drawer" | 10 | wrapClassName="report-drawer" |
11 | @ok="handleSubmit" | 11 | @ok="handleSubmit" |
@@ -14,8 +14,8 @@ | @@ -14,8 +14,8 @@ | ||
14 | <BasicForm @register="registerForm"> | 14 | <BasicForm @register="registerForm"> |
15 | </BasicForm> | 15 | </BasicForm> |
16 | <div style="display: flex;width: 70%;margin-left: 70px"> | 16 | <div style="display: flex;width: 70%;margin-left: 70px"> |
17 | - <div style="width: 122px;text-align: center"> | ||
18 | - 报修人 | 17 | + <div style="width: 115px;align-content: center;display: flex;justify-content: center;" class="inputTitle"> |
18 | + 负责人 | ||
19 | </div> | 19 | </div> |
20 | <a-input | 20 | <a-input |
21 | placeholder="请选择" | 21 | placeholder="请选择" |
@@ -62,7 +62,6 @@ import { useResetOrganizationTree, OrganizationIdTree } from '/@/views/common/or | @@ -62,7 +62,6 @@ import { useResetOrganizationTree, OrganizationIdTree } from '/@/views/common/or | ||
62 | const { | 62 | const { |
63 | setDefaultTime, | 63 | setDefaultTime, |
64 | disableCustomWeekly, | 64 | disableCustomWeekly, |
65 | - setPropsForModal, | ||
66 | removeFields, | 65 | removeFields, |
67 | } = useHooks(); | 66 | } = useHooks(); |
68 | const userInfo = useUserStore(); | 67 | const userInfo = useUserStore(); |
@@ -104,12 +103,14 @@ const [registerForm, { validate, resetFields, setFieldsValue, updateSchema }] = | @@ -104,12 +103,14 @@ const [registerForm, { validate, resetFields, setFieldsValue, updateSchema }] = | ||
104 | } | 103 | } |
105 | ); | 104 | ); |
106 | 105 | ||
106 | +const titleText = ref(''); | ||
107 | const businessText = ref(''); | 107 | const businessText = ref(''); |
108 | const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => { | 108 | const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => { |
109 | try { | 109 | try { |
110 | await nextTick(); | 110 | await nextTick(); |
111 | handleClose(); | 111 | handleClose(); |
112 | businessText.value = data.text; | 112 | businessText.value = data.text; |
113 | + titleText.value = data.text === 'add' ? '创建台账' : data.text === 'edit' ? '编辑台账' : '查看台账'; | ||
113 | if (!selectedItem.value) { | 114 | if (!selectedItem.value) { |
114 | selectedItem.value = { id: '', username: '' }; | 115 | selectedItem.value = { id: '', username: '' }; |
115 | } | 116 | } |
@@ -117,7 +118,6 @@ const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async ( | @@ -117,7 +118,6 @@ const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async ( | ||
117 | selectedItem.value.id = data?.record?.directorId || ''; | 118 | selectedItem.value.id = data?.record?.directorId || ''; |
118 | setFieldsValue(setDefaultTime()); | 119 | setFieldsValue(setDefaultTime()); |
119 | updateSchema(disableCustomWeekly(0)); | 120 | updateSchema(disableCustomWeekly(0)); |
120 | - setDrawerProps(setPropsForModal(businessText.value)); | ||
121 | if (businessText.value === 'add') return; | 121 | if (businessText.value === 'add') return; |
122 | const rest = await ledgerEditDetailPage({id: data.record?.id}); | 122 | const rest = await ledgerEditDetailPage({id: data.record?.id}); |
123 | restData.data = rest ?? {}; | 123 | restData.data = rest ?? {}; |
@@ -139,6 +139,11 @@ const resetValue = () => { | @@ -139,6 +139,11 @@ const resetValue = () => { | ||
139 | }; | 139 | }; |
140 | 140 | ||
141 | const handleSubmit = () => { | 141 | const handleSubmit = () => { |
142 | + if (businessText.value === 'view') { | ||
143 | + closeDrawer(); | ||
144 | + handleClose(); | ||
145 | + return; | ||
146 | + } | ||
142 | useThrottle(); | 147 | useThrottle(); |
143 | }; | 148 | }; |
144 | 149 | ||
@@ -151,6 +156,10 @@ const getValue = async () => { | @@ -151,6 +156,10 @@ const getValue = async () => { | ||
151 | setDrawerProps({ confirmLoading: true }); | 156 | setDrawerProps({ confirmLoading: true }); |
152 | const values = await validate(); | 157 | const values = await validate(); |
153 | if (!values) return; | 158 | if (!values) return; |
159 | + if (!selectedItem?.value?.id) { | ||
160 | + createMessage.warning('请选择负责人'); | ||
161 | + return; | ||
162 | + } | ||
154 | const data = { | 163 | const data = { |
155 | ...values, | 164 | ...values, |
156 | buyDate: values.buyDate?.format('YYYY-MM-DD hh:mm:ss'), | 165 | buyDate: values.buyDate?.format('YYYY-MM-DD hh:mm:ss'), |
@@ -211,3 +220,14 @@ const handleSelect = async (organizationId: string) => { | @@ -211,3 +220,14 @@ const handleSelect = async (organizationId: string) => { | ||
211 | }; | 220 | }; |
212 | 221 | ||
213 | </script> | 222 | </script> |
223 | +<style scoped> | ||
224 | +.inputTitle::before { | ||
225 | + display: inline-block; | ||
226 | + margin-right: 4px; | ||
227 | + color: #ff4d4f; | ||
228 | + font-size: 14px; | ||
229 | + font-family: SimSun, sans-serif; | ||
230 | + line-height: 1; | ||
231 | + content: '*'; | ||
232 | +} | ||
233 | +</style> |
@@ -27,13 +27,13 @@ export const searchFormSchema: FormSchema[] = [ | @@ -27,13 +27,13 @@ export const searchFormSchema: FormSchema[] = [ | ||
27 | }, | 27 | }, |
28 | }, | 28 | }, |
29 | { | 29 | { |
30 | - field: 'startTime', | 30 | + field: 'startTimeStart', |
31 | label: t('inspection.inspectionPlan.startTimeText'), | 31 | label: t('inspection.inspectionPlan.startTimeText'), |
32 | component: 'DatePicker', | 32 | component: 'DatePicker', |
33 | colProps: { span: 6 }, | 33 | colProps: { span: 6 }, |
34 | }, | 34 | }, |
35 | { | 35 | { |
36 | - field: 'endTime', | 36 | + field: 'endTimeEnd', |
37 | label: t('inspection.inspectionPlan.endTimeText'), | 37 | label: t('inspection.inspectionPlan.endTimeText'), |
38 | component: 'DatePicker', | 38 | component: 'DatePicker', |
39 | colProps: { span: 6 }, | 39 | colProps: { span: 6 }, |
@@ -72,12 +72,12 @@ | @@ -72,12 +72,12 @@ | ||
72 | </a-row> | 72 | </a-row> |
73 | <a-form-item label="巡检明细" name="tkInspectionDetailsDTOList"> | 73 | <a-form-item label="巡检明细" name="tkInspectionDetailsDTOList"> |
74 | <a-table bordered :data-source="tableData" :columns="columns"> | 74 | <a-table bordered :data-source="tableData" :columns="columns"> |
75 | - <template #tkDeviceAccountDTO="{ text, record, index }"> | 75 | + <template #tkDeviceAccountDTO="{record}"> |
76 | <div> | 76 | <div> |
77 | {{record?.tkDeviceAccountDTO?.name}} | 77 | {{record?.tkDeviceAccountDTO?.name}} |
78 | </div> | 78 | </div> |
79 | </template> | 79 | </template> |
80 | - <template #recordResult="{ text, record, index }"> | 80 | + <template #recordResult="{ record }"> |
81 | <div> | 81 | <div> |
82 | <a-select | 82 | <a-select |
83 | v-model:value="record.recordResult" | 83 | v-model:value="record.recordResult" |
@@ -87,7 +87,7 @@ | @@ -87,7 +87,7 @@ | ||
87 | /> | 87 | /> |
88 | </div> | 88 | </div> |
89 | </template> | 89 | </template> |
90 | - <template #operation="{ text, record, index }"> | 90 | + <template #operation="{ index }"> |
91 | <div> | 91 | <div> |
92 | <a-button type="link" @click="handleDelete(index)" :disabled="isViewMode">删除</a-button> | 92 | <a-button type="link" @click="handleDelete(index)" :disabled="isViewMode">删除</a-button> |
93 | </div> | 93 | </div> |
@@ -119,7 +119,6 @@ | @@ -119,7 +119,6 @@ | ||
119 | <script setup lang="ts"> | 119 | <script setup lang="ts"> |
120 | import {computed, onMounted, reactive, ref, unref, watch} from "vue"; | 120 | import {computed, onMounted, reactive, ref, unref, watch} from "vue"; |
121 | import {getInspectionPlanList, getInsPlanDetail} from "/@/api/inspection/inspectionPlan"; | 121 | import {getInspectionPlanList, getInsPlanDetail} from "/@/api/inspection/inspectionPlan"; |
122 | -import { ApiTreeSelect } from '/@/components/Form'; | ||
123 | import {OrganizationListItem} from "/@/api/system/model/systemModel"; | 122 | import {OrganizationListItem} from "/@/api/system/model/systemModel"; |
124 | import {getOrganizationList} from "/@/api/system/system"; | 123 | import {getOrganizationList} from "/@/api/system/system"; |
125 | import {getUserListByOrg} from "/@/api/equipment/ledger"; | 124 | import {getUserListByOrg} from "/@/api/equipment/ledger"; |
@@ -211,7 +210,7 @@ const needReload = ref(true); | @@ -211,7 +210,7 @@ const needReload = ref(true); | ||
211 | const { createMessage } = useMessage(); | 210 | const { createMessage } = useMessage(); |
212 | 211 | ||
213 | const searchInfo = reactive<Recordable>({}); | 212 | const searchInfo = reactive<Recordable>({}); |
214 | -const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo); | 213 | +const { organizationIdTreeRef } = useResetOrganizationTree(searchInfo); |
215 | const userVisible = ref(false); | 214 | const userVisible = ref(false); |
216 | const userModalTitle = ref('选人'); | 215 | const userModalTitle = ref('选人'); |
217 | const selectedItem = ref<{ id: number; username: string } | null>(null); | 216 | const selectedItem = ref<{ id: number; username: string } | null>(null); |
@@ -300,8 +299,9 @@ onMounted(() => { | @@ -300,8 +299,9 @@ onMounted(() => { | ||
300 | 299 | ||
301 | const fetchAgeOptions = async () => { | 300 | const fetchAgeOptions = async () => { |
302 | try { | 301 | try { |
303 | - const response = await getInspectionPlanList({ page: 1, pageSize: 999 }); // 调用接口 | ||
304 | - planOptions.value = response.items?.map((item: any) => { | 302 | + const _response = await getInspectionPlanList({ page: 1, pageSize: 999}); // 调用接口 |
303 | + const response = _response.items?.filter(item => item.status !== 'STOP'); | ||
304 | + planOptions.value = response?.map((item: any) => { | ||
305 | return { | 305 | return { |
306 | value: item?.id, | 306 | value: item?.id, |
307 | label: item?.name | 307 | label: item?.name |
@@ -312,49 +312,6 @@ const fetchAgeOptions = async () => { | @@ -312,49 +312,6 @@ const fetchAgeOptions = async () => { | ||
312 | } | 312 | } |
313 | }; | 313 | }; |
314 | 314 | ||
315 | -const getBindProps = computed<Recordable>(() => { | ||
316 | - const params = {} | ||
317 | - return { | ||
318 | - replaceFields: { children: 'children', key: 'id', title: 'name', value: 'id' }, | ||
319 | - getPopupContainer: () => document.body, | ||
320 | - placeholder: t('deviceManagement.device.organizationPlaceholderText'), | ||
321 | - maxLength: 250, | ||
322 | - value: form.orgId, | ||
323 | - dropdownStyle: { maxHeight: '300px' }, | ||
324 | - api: async (params: OrganizationListItem) => { | ||
325 | - try { | ||
326 | - const result = ((await getOrganizationList(params)) as unknown as Recordable[]) || []; | ||
327 | - orgList.value = result; | ||
328 | - needReload.value = false; | ||
329 | - return result; | ||
330 | - } catch (error) { | ||
331 | - return unref(orgList); | ||
332 | - } | ||
333 | - }, | ||
334 | - params: { | ||
335 | - ...params, | ||
336 | - _t: unref(timespan), | ||
337 | - }, | ||
338 | - onChange: async (...args: any[]) => { | ||
339 | - const _data = { | ||
340 | - page: '1', | ||
341 | - pageSize: '999', | ||
342 | - tenantId: userInfo.getUserInfo.tenantId!, | ||
343 | - organizationId: args?.[0] | ||
344 | - } | ||
345 | - const response = await getUserListByOrg(_data); // 调用接口 | ||
346 | - Options.value = response.items?.map((item: any) => { | ||
347 | - return { | ||
348 | - label: item.username, | ||
349 | - value: item.id, | ||
350 | - } | ||
351 | - }); | ||
352 | - form.orgId.value = args?.[0] | ||
353 | - | ||
354 | - }, | ||
355 | - }; | ||
356 | -}); | ||
357 | - | ||
358 | const handleChange = async (value: Value) => { | 315 | const handleChange = async (value: Value) => { |
359 | const res = await getInsPlanDetail({id:value}) | 316 | const res = await getInsPlanDetail({id:value}) |
360 | form.value.code = res.code | 317 | form.value.code = res.code |
@@ -362,7 +319,7 @@ const handleChange = async (value: Value) => { | @@ -362,7 +319,7 @@ const handleChange = async (value: Value) => { | ||
362 | return { | 319 | return { |
363 | checkDeviceId: item?.checkDeviceId || '', | 320 | checkDeviceId: item?.checkDeviceId || '', |
364 | recordResult: true, | 321 | recordResult: true, |
365 | - planDetails: item?.checkDeviceId || '', | 322 | + planDetails: item?.planDetails || '', |
366 | tkDeviceAccountDTO: item?.tkDeviceAccountDTO | 323 | tkDeviceAccountDTO: item?.tkDeviceAccountDTO |
367 | } | 324 | } |
368 | }) || [] | 325 | }) || [] |
@@ -164,14 +164,14 @@ | @@ -164,14 +164,14 @@ | ||
164 | const handleViewDetail = async (record?: any) => { | 164 | const handleViewDetail = async (record?: any) => { |
165 | let id = record.id; | 165 | let id = record.id; |
166 | modalTitle.value = '查看'; | 166 | modalTitle.value = '查看'; |
167 | + modalVisible.value = true; // 打开弹框 | ||
168 | + isViewMode.value = true; | ||
167 | try { | 169 | try { |
168 | const response = await getInsRecordDetail({id}) | 170 | const response = await getInsRecordDetail({id}) |
169 | initialData.value = { | 171 | initialData.value = { |
170 | form: response, // 表单数据 | 172 | form: response, // 表单数据 |
171 | tableData: response.tkInspectionDetailsDTOList, // 表格数据 | 173 | tableData: response.tkInspectionDetailsDTOList, // 表格数据 |
172 | }; | 174 | }; |
173 | - modalVisible.value = true; // 打开弹框 | ||
174 | - isViewMode.value = true; | ||
175 | }catch (error) { | 175 | }catch (error) { |
176 | throw error; | 176 | throw error; |
177 | }finally { | 177 | }finally { |
@@ -57,7 +57,7 @@ export const columns: BasicColumn[] = [ | @@ -57,7 +57,7 @@ export const columns: BasicColumn[] = [ | ||
57 | }, | 57 | }, |
58 | { | 58 | { |
59 | title: t('inspection.serviceRecord.createTimeText'), | 59 | title: t('inspection.serviceRecord.createTimeText'), |
60 | - dataIndex: 'createTime', | 60 | + dataIndex: 'preserveDate', |
61 | }, | 61 | }, |
62 | { | 62 | { |
63 | title: t('inspection.serviceRecord.preserveByName'), | 63 | title: t('inspection.serviceRecord.preserveByName'), |
@@ -16,7 +16,7 @@ export const columns: BasicColumn[] = [ | @@ -16,7 +16,7 @@ export const columns: BasicColumn[] = [ | ||
16 | }, | 16 | }, |
17 | { | 17 | { |
18 | title: t('repair.history.orderText'), | 18 | title: t('repair.history.orderText'), |
19 | - dataIndex: 'tkRepairOrderDTO', | 19 | + dataIndex: 'orderCode', |
20 | format: (text, record) => { | 20 | format: (text, record) => { |
21 | return record.tkRepairOrderDTO?.orderCode || '-' || text; | 21 | return record.tkRepairOrderDTO?.orderCode || '-' || text; |
22 | }, | 22 | }, |
@@ -27,7 +27,7 @@ export const columns: BasicColumn[] = [ | @@ -27,7 +27,7 @@ export const columns: BasicColumn[] = [ | ||
27 | }, | 27 | }, |
28 | { | 28 | { |
29 | title: t('repair.history.time'), | 29 | title: t('repair.history.time'), |
30 | - dataIndex: 'tkRepairOrderDTO', | 30 | + dataIndex: 'reportDate', |
31 | format: (text, record) => { | 31 | format: (text, record) => { |
32 | return record.tkRepairOrderDTO?.reportDate || '-' || text; | 32 | return record.tkRepairOrderDTO?.reportDate || '-' || text; |
33 | }, | 33 | }, |
@@ -12,7 +12,9 @@ | @@ -12,7 +12,9 @@ | ||
12 | <div> | 12 | <div> |
13 | <BasicForm @register="registerForm" /> | 13 | <BasicForm @register="registerForm" /> |
14 | <div style="display: flex; width: 70%; margin-left: 70px"> | 14 | <div style="display: flex; width: 70%; margin-left: 70px"> |
15 | - <div style="width: 122px; text-align: center"> 报修人 </div> | 15 | + <div style="display: flex;width: 115px;align-content: center;justify-content: center;" class="inputTitle"> |
16 | + 报修人 | ||
17 | + </div> | ||
16 | <a-input placeholder="请选择" :disabled="true" v-model:value="selectedUsername" /> | 18 | <a-input placeholder="请选择" :disabled="true" v-model:value="selectedUsername" /> |
17 | <a-button type="primary" @click="goChoose">选人</a-button> | 19 | <a-button type="primary" @click="goChoose">选人</a-button> |
18 | </div> | 20 | </div> |
@@ -152,6 +154,10 @@ | @@ -152,6 +154,10 @@ | ||
152 | const handleOk = async () => { | 154 | const handleOk = async () => { |
153 | await validate(); | 155 | await validate(); |
154 | let values = getFieldsValue(); | 156 | let values = getFieldsValue(); |
157 | + if (!selectedItem?.value?.id) { | ||
158 | + createMessage.warning('请选择报修人'); | ||
159 | + return; | ||
160 | + } | ||
155 | if (unref(isUpdate)) { | 161 | if (unref(isUpdate)) { |
156 | values = { | 162 | values = { |
157 | ...values, | 163 | ...values, |
@@ -204,3 +210,14 @@ | @@ -204,3 +210,14 @@ | ||
204 | Options.value = response.items; | 210 | Options.value = response.items; |
205 | }; | 211 | }; |
206 | </script> | 212 | </script> |
213 | +<style scoped> | ||
214 | +.inputTitle::before { | ||
215 | + display: inline-block; | ||
216 | + margin-right: 4px; | ||
217 | + color: #ff4d4f; | ||
218 | + font-size: 14px; | ||
219 | + font-family: SimSun, sans-serif; | ||
220 | + line-height: 1; | ||
221 | + content: '*'; | ||
222 | +} | ||
223 | +</style> |