Your Name
2022-08-01 1621b3719092d93e6c29f7a27e401529e0454420
src/views/doublePrevent/riskCheckManage/hiddenManagement/hiddenCheck/index.vue
文件名从 src/views/doublePrevent/hiddenManage/hiddenCheck/index.vue 修改
@@ -10,16 +10,7 @@
                </div>
                <div class="basic-line">
                    <span>整改部门:</span>
                    <el-cascader
                        :options="departmentList"
                        :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }"
                        placeholder="请选择部门"
                        clearable
                        filterable
                        class="input-box"
                        v-model="checkData.params.rectifyDepId"
                    >
                    </el-cascader>
                    <el-cascader :options="departmentList" :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" placeholder="请选择部门" clearable filterable class="input-box" v-model="checkData.params.rectifyDepId"> </el-cascader>
                </div>
                <el-button size="default" type="primary" class="ml10" v-throttle @click="handleSearch">
@@ -40,28 +31,23 @@
                </el-table-column>
                <el-table-column prop="liablePerson" label="整改责任人" show-overflow-tooltip min-width="150px"></el-table-column>
                <el-table-column prop="cost" label="整改资金" show-overflow-tooltip min-width="150px"></el-table-column>
                <el-table-column prop="cost" label="验收状态" show-overflow-tooltip min-width="150px"></el-table-column>
                <el-table-column prop="dangerStatus" label="验收状态" show-overflow-tooltip min-width="150px" align="center">
                    <template #default="scope">
                        <el-tag :type="scope.row.dangerStatus === 0 ? 'info' : scope.row.dangerStatus === 1 ? 'primary' : scope.row.dangerStatus === 2 ? 'warning' : scope.row.dangerStatus === 4 ? 'danger' : 'success'">
                            {{ parseNumber(scope.row.dangerStatus, '隐患整改状态') }}
                        </el-tag>
                    </template>
                </el-table-column>
                <el-table-column prop="checkAcceptPerson" label="验收人" show-overflow-tooltip min-width="150px"></el-table-column>
                <el-table-column label="操作" width="250" fixed="right" align="center">
                    <template #default="scope">
                        <el-button size="small" text type="primary" :icon="Check" @click="onOpenDialogRef('验收', scope.row)">验收</el-button>
                        <el-button size="small" text type="danger" :icon="Delete" @click="onDelProductionDevice(scope.row)">删除</el-button>
                        <el-button size="small" text type="primary" :icon="View" @click="onOpenDialogRef('查看', scope.row)">查看</el-button>
                        <el-button size="small" text type="primary" :icon="Check" v-show="scope.row.dangerStatus === 1" @click="onOpenDialogRef('验收', scope.row)">验收</el-button>
                    </template>
                </el-table-column>
            </el-table>
            <br />
            <el-pagination
                @size-change="onHandleSizeChange"
                @current-change="onHandleCurrentChange"
                :pager-count="5"
                :page-sizes="[10, 20, 30]"
                v-model:current-page="checkData.params.pageIndex"
                background
                v-model:page-size="checkData.params.pageSize"
                layout="total, sizes, prev, pager, next, jumper"
                :total="checkData.total"
                class="page-position"
            >
            </el-pagination>
            <el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" :pager-count="5" :page-sizes="[10, 20, 30]" v-model:current-page="checkData.params.pageIndex" background v-model:page-size="checkData.params.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="checkData.total" class="page-position"> </el-pagination>
            <br />
            <br />
        </el-card>
@@ -73,11 +59,9 @@
import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue';
import { ElMessageBox, ElMessage } from 'element-plus';
import checkDialog from './components/checkDialog.vue';
import { Check, Delete } from '@element-plus/icons-vue';
import { Check, Delete, View } from '@element-plus/icons-vue';
import { departmentApi } from '/@/api/department';
import { productionDeviceApi } from '/@/api/doublePreventSystem/productionDevice';
import { hiddenReportApi } from '/@/api/doublePreventSystem/report';
import { hiddenRectifyApi } from '/@/api/doublePreventSystem/rectify';
import { hiddenCheckApi } from '/@/api/doublePreventSystem/check';
// 定义接口来定义对象的类型
interface TableData {
@@ -113,7 +97,7 @@
export default defineComponent({
    name: 'check',
    components: { checkDialog, Check, Delete },
    components: { checkDialog, Check, Delete, View },
    setup() {
        const checkDialogRef = ref();
        const state = reactive<TableDataState>({
@@ -142,9 +126,10 @@
                { id: 9, name: '已验收' }
            ]
        });
        // 初始化表格数据
        const initCheckTableData = async () => {
            let res = await hiddenRectifyApi().getHiddenRectifyList(state.checkData.params);
            let res = await hiddenCheckApi().getHiddenCheckList(state.checkData.params);
            if (res.data.code === '200') {
                state.checkData.data = res.data.data;
                state.checkData.total = res.data.count;
@@ -171,32 +156,7 @@
        // 打开弹窗
        const onOpenDialogRef = (type: string, value: any) => {
            checkDialogRef.value.opencheckDialog(type, value, state.departmentList);
        };
        // 删除
        const onDelProductionDevice = (row: any) => {
            ElMessageBox.confirm(`此操作将永久删除该巡检点:“${row.code}”,是否继续?`, '提示', {
                confirmButtonText: '确认',
                cancelButtonText: '取消',
                type: 'warning'
            })
                .then(async () => {
                    let res = await hiddencheckApi().deleteHiddencheck({ id: row.id });
                    if (res.data.code === '200') {
                        ElMessage({
                            type: 'success',
                            duration: 2000,
                            message: '删除成功'
                        });
                        await initCheckTableData();
                    } else {
                        ElMessage({
                            type: 'warning',
                            message: res.data.msg
                        });
                    }
                })
                .catch(() => {});
            checkDialogRef.value.openCheckDialog(type, value, state.departmentList);
        };
        const parseNumber = (value: string | number, type: string) => {
@@ -229,11 +189,11 @@
        return {
            Check,
            Delete,
            View,
            parseNumber,
            handleSearch,
            onOpenDialogRef,
            onHandleSizeChange,
            onDelProductionDevice,
            onHandleCurrentChange,
            checkDialog,
            checkDialogRef,