| | |
| | | {{ getDictLabel(row.status, dictObj.deviceStatus) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="yxzt" show-overflow-tooltip width="116" label="出库状态"> |
| | | <template v-slot="{ row }"> |
| | | {{ getDictLabel(row.trackStatus, trackStatusOptions) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" class-name="operation-btns"> |
| | | <template v-slot="{ row }"> |
| | | <el-link @click="handleView(row)">查看</el-link> |
| | | <el-link @click="handleEdit(row)">编辑</el-link> |
| | | <el-link @click="outbound(row)">出库</el-link> |
| | | <el-link v-if="row.trackStatus === 0" @click="outbound(row)">出库</el-link> |
| | | <el-link v-else @click="returnDevice(row)">归还</el-link> |
| | | <el-link @click="scrap(row)" v-if="row.status !== 3">报废</el-link> |
| | | <!-- <el-link @click="handleDelete(row)" type="danger">删除</el-link>--> |
| | | </template> |
| | |
| | | import { onMounted, ref } from 'vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { exportFwDeviceApi, fwDevicePageApi, fwDeviceRemoveApi } from '@/views/basicManage/deviceStock/fwDevice' |
| | | import { fwDeviceUpdateTrackStatusApi } from '@/views/basicManage/deviceStock/fwDeviceTrackApi' |
| | | import FormDiaLog from './FormDiaLog.vue' |
| | | import { getDictionaryByCode } from '@/api/system/dictbiz' |
| | | import { getDeptTree } from '@/api/system/dept' |
| | |
| | | provide('dictObj', dictObj) |
| | | provide('deptTree', deptTree) |
| | | |
| | | // 出库状态 |
| | | const trackStatusOptions = ref([ |
| | | { dictKey: 0, dictValue: '未出库' }, |
| | | { dictKey: 1, dictValue: '已出库' } |
| | | ]) |
| | | |
| | | // 获取列表 |
| | | async function getList() { |
| | | const range = dateRangeFormat(dateRange.value) |
| | |
| | | outboundDialogRef.value?.open({ mode: 'edit', row: { ...row } }) |
| | | } |
| | | |
| | | // 归还 |
| | | async function returnDevice(row) { |
| | | await ElMessageBox.confirm(`确认归还吗?`, '提示', { |
| | | type: 'warning', |
| | | customClass: 'command-page-view-message-box', |
| | | confirmButtonClass: 'command-message-box-confirm', |
| | | cancelButtonClass: 'command-message-box-cancel', |
| | | }) |
| | | const payload = { |
| | | deviceId: row.id |
| | | } |
| | | await fwDeviceUpdateTrackStatusApi(payload) |
| | | ElMessage.success('归还成功') |
| | | getList() |
| | | } |
| | | |
| | | function scrap(row) { |
| | | scrapDialogRef.value?.open({ mode: 'edit', row: { ...row } }) |
| | | } |