|
@@ -33,17 +33,6 @@
|
|
class="!w-240px"
|
|
class="!w-240px"
|
|
/>
|
|
/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <!--
|
|
|
|
- <el-form-item label="状态" prop="status">
|
|
|
|
- <el-select
|
|
|
|
- v-model="queryParams.status"
|
|
|
|
- placeholder="请选择状态"
|
|
|
|
- clearable
|
|
|
|
- class="!w-240px"
|
|
|
|
- >
|
|
|
|
- <el-option label="请选择字典生成" value="" />
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item> -->
|
|
|
|
<el-form-item :label="t('operationFill.createTime')" prop="createTime">
|
|
<el-form-item :label="t('operationFill.createTime')" prop="createTime">
|
|
<el-date-picker
|
|
<el-date-picker
|
|
v-model="queryParams.createTime"
|
|
v-model="queryParams.createTime"
|
|
@@ -93,7 +82,12 @@
|
|
<el-table-column :label="t('iotMaintain.PersonInCharge')" align="center" prop="responsiblePersonName" />
|
|
<el-table-column :label="t('iotMaintain.PersonInCharge')" align="center" prop="responsiblePersonName" />
|
|
<el-table-column :label="t('maintain.status')" align="center" prop="status" >
|
|
<el-table-column :label="t('maintain.status')" align="center" prop="status" >
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
- <dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
|
|
|
|
|
|
+ <el-switch
|
|
|
|
+ v-model="scope.row.status"
|
|
|
|
+ :active-value="0"
|
|
|
|
+ :inactive-value="1"
|
|
|
|
+ @change="handleStatusChange(scope.row)"
|
|
|
|
+ />
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column
|
|
<el-table-column
|
|
@@ -121,16 +115,6 @@
|
|
>
|
|
>
|
|
{{ t('maintain.view') }}
|
|
{{ t('maintain.view') }}
|
|
</el-button>
|
|
</el-button>
|
|
- <!--
|
|
|
|
- <el-button
|
|
|
|
- link
|
|
|
|
- type="danger"
|
|
|
|
- @click="handleDelete(scope.row.id)"
|
|
|
|
- v-hasPermi="['rq:iot-maintenance-plan:delete']"
|
|
|
|
- >
|
|
|
|
- 删除
|
|
|
|
- </el-button>
|
|
|
|
- -->
|
|
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -144,8 +128,6 @@
|
|
</ContentWrap>
|
|
</ContentWrap>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
- <!-- 表单弹窗:添加/修改 -->
|
|
|
|
-<!-- <IotMaintenancePlanForm ref="formRef" @success="getList" />-->
|
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
@@ -153,7 +135,7 @@ import { dateFormatter } from '@/utils/formatTime'
|
|
import download from '@/utils/download'
|
|
import download from '@/utils/download'
|
|
import { IotMaintenancePlanApi, IotMaintenancePlanVO } from '@/api/pms/maintenance'
|
|
import { IotMaintenancePlanApi, IotMaintenancePlanVO } from '@/api/pms/maintenance'
|
|
import DeptTree from "@/views/system/user/DeptTree.vue";
|
|
import DeptTree from "@/views/system/user/DeptTree.vue";
|
|
-import {DICT_TYPE} from "@/utils/dict";
|
|
|
|
|
|
+import {CommonStatusEnum} from "@/utils/constants";
|
|
const { push } = useRouter() // 路由跳转
|
|
const { push } = useRouter() // 路由跳转
|
|
|
|
|
|
/** 保养计划 列表 */
|
|
/** 保养计划 列表 */
|
|
@@ -223,6 +205,17 @@ const openForm = (type: string, id?: number) => {
|
|
push({ name: 'IotAddMainPlan', params:{} })
|
|
push({ name: 'IotAddMainPlan', params:{} })
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+const handleStatusChange = async (row: IotMaintenancePlanVO) => {
|
|
|
|
+ try {
|
|
|
|
+ const text = row.status === CommonStatusEnum.ENABLE ? '启用' : '停用';
|
|
|
|
+ await message.confirm('确认要"' + text + '""' + row.name + '" 保养计划吗?');
|
|
|
|
+ await IotMaintenancePlanApi.updatePlanStatus(row.id, row.status);
|
|
|
|
+ await getList();
|
|
|
|
+ } catch {
|
|
|
|
+ row.status = row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE : CommonStatusEnum.ENABLE;
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+
|
|
/** 删除按钮操作 */
|
|
/** 删除按钮操作 */
|
|
const handleDelete = async (id: number) => {
|
|
const handleDelete = async (id: number) => {
|
|
try {
|
|
try {
|