1
lzhe
2024-06-05 dcf9c9e0410fe1186239e3f8d6f7bdc789c08010
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