eight
2024-09-29 7cfc44c35849fb5e29d1a34ab21ec214fe1f19a5
src/views/ecg/devmanage/index.vue
@@ -116,10 +116,7 @@
      <el-table-column label="型号" align="center" prop="model" />
      <el-table-column label="使用情况" align="center" prop="lost" >
        <template #default="scope">
          <span v-if="scope.row.state === 0">空闲</span>
          <span v-if="scope.row.state === 5">已领用</span>
          <span v-if="scope.row.state === 10">使用中</span>
          <span v-if="scope.row.state === 20">已遗失</span>
          <span>{{tranlateDevState(scope.row.state)}}</span>
        </template>
      </el-table-column>
      <el-table-column label="采购日期" align="center" prop="purchaseDate" :formatter="dateFormatter2" width="120px"/>
@@ -139,6 +136,14 @@
              v-hasPermi="['ecg:device:update']"
          >
            编辑
          </el-button>
          <el-button
              link
              type="primary"
              @click="openForm('devState', scope.row.id)"
              v-hasPermi="['ecg:device:update']"
          >
            设备状态
          </el-button>
          <el-button
              link
@@ -251,6 +256,15 @@
  }
}
const tranlateDevState = (state) => {
  if (state === 0) return "空闲";
  else if (state=== 5) return "已领用";
  else if (state=== 10) return "已装机";
  else if (state=== 20) return "已遗失";
  else if (state=== 30) return "维修中";
  else if (state=== 40) return "已报废";
}
/** 初始化 **/
onMounted(() => {
  getList()