| | |
| | | <!-- |
| | | * @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> |
| | |
| | | </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> |
| | |
| | | <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> |
| | |
| | | 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, |
| | |
| | | ...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, |
| | |
| | | }, |
| | | methods: { |
| | | init() { |
| | | this.$HTTP.get(`/api/blade-cps/check-project/page?key=¤t=1&size=-1`).then(res => { |
| | | this.$HTTP.get(`/api/smis/check-project/page?key=¤t=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 |
| | | }) |
| | | }, |
| | |
| | | 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) |
| | | } |
| | |
| | | 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), |
| | | } |
| | |
| | | }, |
| | | 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() |
| | |
| | | }, |
| | | 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]) |
| | |
| | | }, |
| | | 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 { |
| | |
| | | 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] |
| | | } |
| | |
| | | }) |
| | | }, |
| | | 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 |
| | |
| | | }) |
| | | }, |
| | | 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]) |
| | |
| | | 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 { |
| | |
| | | }, |
| | | // |
| | | 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, |
| | |
| | | }) |
| | | }, |
| | | 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 |
| | | } |
| | |
| | | }, |
| | | |
| | | 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 { |
| | |
| | | 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 => { |