| | |
| | | import { getUserListApi } from '@/api/system/user' |
| | | import { fieldRules, getDictLabel } from '@ztzf/utils' |
| | | import { fwDeviceTrackPageApi } from '@/views/basicManage/deviceStock/fwDeviceTrackApi' |
| | | import { saveOperationLog } from '@ztzf/apis' |
| | | import { useRoute } from 'vue-router' |
| | | |
| | | const initForm = () => ({ |
| | | belongDept: '', // 所属部门 |
| | |
| | | const dictObj = inject('dictObj') |
| | | const deptTree = inject('deptTree') |
| | | const emit = defineEmits(['success']) |
| | | const route = useRoute() |
| | | const formRef = ref(null) // 表单实例 |
| | | const formData = ref(initForm()) // 表单数据 |
| | | const visible = ref(false) // 弹框显隐 |
| | |
| | | submitting.value = true |
| | | try { |
| | | await fwDeviceSubmitApi(formData.value) |
| | | const actionText = dialogMode.value === 'add' ? '建档' : '编辑' |
| | | saveOperationLog({ |
| | | requestUri: route.path, |
| | | title: `${route.name || '设备出入库'}-${actionText}`, |
| | | type: 1 |
| | | }) |
| | | ElMessage.success(dialogMode.value === 'add' ? '新增成功' : '更新成功') |
| | | visible.value = false |
| | | emit('success') |