gaoshp
2024-11-03 dcc4992bd51e9ee4a97099cd3a15085f7e247f23
src/views/console/basic-data/tpmComp2.vue
@@ -1,7 +1,7 @@
<!--
 * @Date: 2024-06-23 21:32:05
 * @LastEditors: Sneed
 * @LastEditTime: 2024-06-23 23:45:09
 * @LastEditTime: 2024-06-23 23:47:43
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/console/basic-data/tpmComp2.vue
-->
<template>
@@ -124,8 +124,8 @@
        </scDialog>
        <!-- 保养项目 -->
        <scDialog v-model="visibleMaintain">
            <scFormTable ref="table1" v-model="talbeDataM" stripe hideDelete :addTemplate="addTemplateM"
                @row-click="getMlistChild">
            <scFormTable highlight-current-row :current-row-key="selectMRow.id" ref="table1" v-model="talbeDataM" stripe
                hideDelete :addTemplate="addTemplateM" @row-click="getMlistChild">
                <el-table-column label="保养项目编号" prop="code">
                    <template #default="scope">
                        <el-input v-if="scope.row.isEdit" v-model="scope.row.code"></el-input>
@@ -204,7 +204,7 @@
            <el-select v-model="itemId" style="width: 100%;">
                <el-option v-for=" (item, index) in options1" :key="index" :label="item.code" :value="item.id">{{
                    item.code
                    }}</el-option>
                }}</el-option>
            </el-select>
            <template #footer>
                <div>
@@ -228,8 +228,8 @@
                keyWord: '',
                status: 1,
            },
            exportUrlTpl: '/api/blade-cps/device-types/export/template',
            uploadUrl: '/api/blade-cps/device-types/excel/import',
            exportUrlTpl: '/api/smis/device-types/export/template',
            uploadUrl: '/api/smis/device-types/excel/import',
            visible: false,
            config: {
                labelWidth: 120,
@@ -300,7 +300,7 @@
                        ...data,
                        ...this.params
                    }
                    return await this.$HTTP.get(`/api/blade-cps/device-types/page`, {}, { params }).then(res => {
                    return await this.$HTTP.get(`/api/smis/device-types/page`, {}, { params }).then(res => {
                        res.data.records = res?.data?.records.map(v => {
                            return {
                                ...v,
@@ -340,10 +340,10 @@
    },
    methods: {
        init() {
            this.$HTTP.get(`/api/blade-cps/check-project/page?key=&current=1&size=-1`).then(res => {
            this.$HTTP.get(`/api/smis/check-project/page?key=&current=1&size=-1`).then(res => {
                this.options = res.data.records
            })
            this.$HTTP.get(`/api/blade-cps/maintain-item/list?keyWord=`).then(res => {
            this.$HTTP.get(`/api/smis/maintain-item/list?keyWord=`).then(res => {
                this.options1 = res.data
            })
        },
@@ -358,7 +358,7 @@
            this.visible = true
        },
        exportData() {
            this.$HTTP.post(`/api/blade-cps/device-types/excel/export`, {}, { params: this.params }).then(res => {
            this.$HTTP.post(`/api/smis/device-types/excel/export`, {}, { params: this.params }).then(res => {
                if (res.success) {
                    window.open(res.data.link)
                }
@@ -368,7 +368,7 @@
            this.$refs.table.reload()
        },
        table_del(selection, type) {
            this.$HTTP.delete(`/api/blade-cps/device-types?type=${type}`, {}, {
            this.$HTTP.delete(`/api/smis/device-types?type=${type}`, {}, {
                data: {
                    idList: selection.map(v => v.id),
                }
@@ -389,14 +389,14 @@
        },
        submit() {
            if (!this.form.id) {
                this.$HTTP.post(`/api/blade-cps/device-types`, this.form).then(res => {
                this.$HTTP.post(`/api/smis/device-types`, this.form).then(res => {
                    if (res.success) {
                        this.visible = false
                        this.search()
                    }
                })
            } else {
                this.$HTTP.put(`/api/blade-cps/device-types`, this.form).then(res => {
                this.$HTTP.put(`/api/smis/device-types`, this.form).then(res => {
                    if (res.success) {
                        this.visible = false
                        this.search()
@@ -415,7 +415,7 @@
        },
        getCheckList() {
            let row = this.selectRow
            return this.$HTTP.get(`/api/blade-cps/device-type-check-projects/page?id=${row.id}`).then(res => {
            return this.$HTTP.get(`/api/smis/device-type-check-projects/page?id=${row.id}`).then(res => {
                if (res.success) {
                    this.tabledata = res.data
                    this.getCheckListChild(this.tabledata[0])
@@ -426,7 +426,7 @@
        },
        getCheckListChild(row) {
            if (!row?.checkProjectId) return this.tableDataList = []
            this.$HTTP.get(`/api/blade-cps/check-item/list?projectId=${row.checkProjectId}`).then(res => {
            this.$HTTP.get(`/api/smis/check-item/list?projectId=${row.checkProjectId}`).then(res => {
                if (res.success) {
                    this.tableDataList = res.data
                } else {
@@ -442,7 +442,7 @@
            this.tabledata.splice(index, 1)
        },
        delCheck(row) {
            this.$HTTP.delete(`/api/blade-cps/device-type-check-projects`, {}, {
            this.$HTTP.delete(`/api/smis/device-type-check-projects`, {}, {
                data: {
                    ids: [row.id]
                }
@@ -453,7 +453,7 @@
            })
        },
        addCheck(row) {
            this.$HTTP.post(`/api/blade-cps/device-type-check-projects`, {
            this.$HTTP.post(`/api/smis/device-type-check-projects`, {
                deviceTypeId: this.selectRow.id,
                checkProjectId: [row.checkProjectId],
                intervalTime: row.intervalTime
@@ -474,7 +474,7 @@
            })
        },
        getMList() {
            return this.$HTTP.get(`/api/blade-cps/maintain-project/list?deviceTypeId=${this.selectRow.id}`).then(res => {
            return this.$HTTP.get(`/api/smis/maintain-project/list?deviceTypeId=${this.selectRow.id}`).then(res => {
                if (res.success) {
                    this.talbeDataM = res.data
                    this.getMlistChild(this.talbeDataM?.[0])
@@ -486,7 +486,7 @@
        getMlistChild(row) {
            this.selectMRow = row
            if (!row?.id) return this.talbeDataMChild = []
            this.$HTTP.get(`/api/blade-cps/maintain-project-item/item-list?projectId=${row.id}`).then(res => {
            this.$HTTP.get(`/api/smis/maintain-project-item/item-list?projectId=${row.id}`).then(res => {
                if (res) {
                    this.talbeDataMChild = res
                } else {
@@ -496,7 +496,7 @@
        },
        // 
        addM(row) {
            this.$HTTP.post(`/api/blade-cps/maintain-project/create-maintain-project`, {
            this.$HTTP.post(`/api/smis/maintain-project/create-maintain-project`, {
                code: row.code,
                deviceTypeId: this.selectRow.id,
                deviceTypeName: row.deviceTypeName,
@@ -513,7 +513,7 @@
            })
        },
        delM(row) {
            this.$HTTP.post(`/api/blade-cps/maintain-project/delete-maintain-project`, {}, {
            this.$HTTP.post(`/api/smis/maintain-project/delete-maintain-project`, {}, {
                params: {
                    id: row.id
                }
@@ -525,7 +525,7 @@
        },
        delMChild(row) {
            this.$HTTP.post(`/api/blade-cps/maintain-project-item/delete-maintain-project-item?id=${row.id}`).then(res => {
            this.$HTTP.post(`/api/smis/maintain-project-item/delete-maintain-project-item?id=${row.id}`).then(res => {
                if (res.success) {
                    this.getMlistChild(this.selectMRow)
                } else {
@@ -538,7 +538,7 @@
            this.visibleAdd = true
        },
        saveAdd() {
            this.$HTTP.post(`/api/blade-cps/maintain-project-item/create-maintain-project-item`, {
            this.$HTTP.post(`/api/smis/maintain-project-item/create-maintain-project-item`, {
                itemId: this.itemId,
                projectId: this.selectMRow.id
            }).then(res => {