gaoshp
2024-05-07 27e0f5db64f77584a86f753f245ac4c6eb048a71
选择
已修改2个文件
50 ■■■■ 文件已修改
src/views/tpm/MachineTab.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tpm/machine/Dialog.vue 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tpm/MachineTab.vue
@@ -1,7 +1,7 @@
<!--
 * @Date: 2024-04-27 20:04:34
 * @LastEditors: Sneed
 * @LastEditTime: 2024-05-07 22:23:47
 * @LastEditTime: 2024-05-07 22:40:21
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/tpm/MachineTab.vue
-->
<template>
@@ -138,10 +138,12 @@
            this.$refs.table.reload(this.params)
        },
        table_add() {
            this.$refs.dialog.open('add')
            this.$refs.dialog.open('add', {
                groupId: this.params.groupId
            })
        },
        table_edit(row) {
            this.$refs.dialog.open('add', { id: row.id })
            this.$refs.dialog.open('edit', { id: row.id })
        },
        success() {
            this.getTreeData()
src/views/tpm/machine/Dialog.vue
@@ -107,7 +107,9 @@
                </el-col>
                <el-col :span="8">
                    <el-form-item label="所属机器组" prop="groupId">
                        <el-input style="width: 240px" v-model="form.groupId" placeholder="所属机器组" clearable></el-input>
                        <!-- <el-input style="width: 240px" v-model="form.groupId" placeholder="所属机器组" clearable></el-input> -->
                        <el-tree-select v-model="form.groupId" node-key="id" :props="props" :data="options.groupId"
                            filterable style="width: 240px" />
                    </el-form-item>
                </el-col>
                <el-col :span="8">
@@ -219,8 +221,8 @@
                </el-col>
                <el-col :span="8">
                    <el-form-item label="使用部门" prop="organizationId">
                        <el-input style="width: 240px" v-model="form.organizationId" placeholder="使用部门"
                            clearable></el-input>
                        <el-tree-select v-model="form.organizationId" node-key="id" :props="props"
                            :data="options.organizationId" filterable style="width: 240px" />
                    </el-form-item>
                </el-col>
                <el-col :span="8">
@@ -247,7 +249,9 @@
                </el-col>
                <el-col :span="8">
                    <el-form-item label="责任人" prop="employeeId">
                        <el-input style="width: 240px" v-model="form.employeeId" placeholder="责任人" clearable></el-input>
                        <!-- <el-input style="width: 240px" v-model="form.employeeId" placeholder="责任人" clearable></el-input> -->
                        <el-tree-select v-model="form.employeeId" node-key="id" :props="props"
                            :data="options.employeeId" filterable style="width: 240px" />
                    </el-form-item>
                </el-col>
                <el-col :span="8">
@@ -294,6 +298,9 @@
    },
    data() {
        return {
            props: {
                label: 'name',
            },
            options: {
                machineTypeId: [],
                machineLifeStatus: [],
@@ -317,7 +324,10 @@
                        value: 0
                    }
                ],
                machineUseStatus: []
                machineUseStatus: [],
                employeeId: [],
                groupId: [],
                organizationId: []
            },
            mode: "add",
            titleMap: {
@@ -476,6 +486,21 @@
                    }))
                }
            })
            this.$HTTP.get('/api/blade-cps/employee/tree').then(res => {
                if (res.code === 200) {
                    this.options.employeeId = res.data
                }
            })
            this.$HTTP.get('/api/blade-cps/group/tree?groupCategory=1&groupType=group_machine').then(res => {
                if (res.code === 200) {
                    this.options.groupId = res.data
                }
            })
            this.$HTTP.get('/api/blade-cps/organization/tree?groupType=group_organization&groupCategory=1').then(res => {
                if (res.code === 200) {
                    this.options.organizationId = res.data
                }
            })
        },
        //显示
        open(mode = 'add', params) {
@@ -486,7 +511,7 @@
            Object.keys(this.form).forEach(item => {
                this.form[item] = ''
            })
            if (params) {
            if (params.id) {
                this.$HTTP.get(`/api/blade-cps/machine/detail/${params.id}`).then(res => {
                    if (res.code === 200) {
                        this.form = {
@@ -495,6 +520,11 @@
                        }
                    }
                })
            } else {
                this.form = {
                    ...this.form,
                    ...params
                }
            }
            return this