| | |
| | | import { ElMessage } from 'element-plus' |
| | | import { fwDeviceDetailApi, fwDeviceSubmitApi } from '@/views/basicManage/deviceStock/fwDevice' |
| | | import { getUserListApi } from '@/api/system/user' |
| | | import { fieldRules, getDictLabel } from '@ztzf/utils' |
| | | import { contactPhoneRules, fieldRules, getDictLabel } from '@ztzf/utils' |
| | | import { fwDeviceTrackPageApi } from '@/views/basicManage/deviceStock/fwDeviceTrackApi' |
| | | import { saveOperationLog } from '@ztzf/apis' |
| | | import { useRoute } from 'vue-router' |
| | |
| | | source: fieldRules(true, 50), |
| | | purpose: fieldRules(true, 50), |
| | | belongDept: fieldRules(true), |
| | | contactPhone: fieldRules(true, 50), |
| | | contactPhone: contactPhoneRules(true, 50), |
| | | charger: fieldRules(true), |
| | | } |
| | | |
| | |
| | | const isValid = await formRef.value?.validate().catch(() => false) |
| | | if (!isValid) return |
| | | submitting.value = true |
| | | |
| | | let deviceSet = {} |
| | | |
| | | try { |
| | | await fwDeviceSubmitApi(formData.value) |
| | | const actionText = dialogMode.value === 'add' ? '建档' : '编辑' |
| | | deviceSet = dialogMode.value === 'add' ? { status: 0 } : {} |
| | | await fwDeviceSubmitApi({ |
| | | ...formData.value, |
| | | ...deviceSet |
| | | }) |
| | | saveOperationLog({ |
| | | requestUri: route.path, |
| | | title: `${route.name || '设备出入库'}-${actionText}`, |