吉安感知网项目-前端
chenyao
2026-01-28 d4b80c98fb7c910c5047c42b5c0d4af152fd9d12
applications/drone-command/src/views/basicManage/deviceStock/index.vue
@@ -86,11 +86,17 @@
                     {{ 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>
@@ -121,6 +127,7 @@
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'
@@ -162,6 +169,12 @@
provide('dictObj', dictObj)
provide('deptTree', deptTree)
// 出库状态
const trackStatusOptions = ref([
   { dictKey: 0, dictValue: '未出库' },
   { dictKey: 1, dictValue: '已出库' }
])
// 获取列表
async function getList() {
   const range = dateRangeFormat(dateRange.value)
@@ -204,6 +217,22 @@
   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 } })
}