| | |
| | | <template> |
| | | <GlobalWindow :title="param.id ? '编辑设备' : '新建设备'" :confirmWorking="subLoading" :visible.sync="isShowModal" width="600px" @close="close" |
| | | @confirm="handleSub"> |
| | | <GlobalWindow :title="param.id ? '编辑设备' : '新建设备'" :confirmWorking="subLoading" :visible.sync="isShowModal" |
| | | width="600px" @close="close" @confirm="handleSub"> |
| | | <el-form :model="param" ref="paramRef" :rules="rules"> |
| | | <el-form-item label="设备编码" prop="code"> |
| | | <el-input v-model="param.code" placeholder="请输入" v-trim /> |
| | |
| | | <el-input v-model="param.modelNo" placeholder="请输入" v-trim /> |
| | | </el-form-item> |
| | | <el-form-item label="设备分类" prop=""> |
| | | <el-cascader v-model="param.areaIds" @change="changeSel" placeholder="请选择巡检区域" clearable :options="cateList" |
| | | <el-cascader v-model="param.areaIds" @change="changeSel" placeholder="请选择设备分类" clearable :options="cateList" |
| | | :props="{ |
| | | label: 'name', |
| | | value: 'id', |
| | | children: 'childCategoryList', |
| | | checkStrictly: true |
| | | children: 'childCategoryList' |
| | | }"></el-cascader> |
| | | </el-form-item> |
| | | <el-form-item label="设备管理员" prop=""> |
| | | <el-select v-model="param.realName" filterable clearable> |
| | | <el-option value="0" label="xxx"></el-option> |
| | | <el-select v-model="param.userId" clearable filterable class="w400"> |
| | | <el-option v-for="item in staffList" :label="item.realname" :value="item.id"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="所在位置" prop=""> |
| | |
| | | import UploadAvatarImage from '@/components/common/UploadAvatarImage' |
| | | import { fetchList } from '@/api/business/category' |
| | | import { create, updateById } from '@/api/Inspection/device' |
| | | import { getUserList } from '@/api/system/user' |
| | | import { Message } from 'element-ui' |
| | | export default { |
| | | components: { GlobalWindow, UploadAvatarImage }, |
| | |
| | | name: [{ required: true, message: '请输入' }], |
| | | code: [{ required: true, message: '请输入' }] |
| | | }, |
| | | staffList: [] |
| | | |
| | | } |
| | | }, |
| | |
| | | } |
| | | }) |
| | | }, |
| | | getStaff() { |
| | | getUserList({}).then(res => { |
| | | this.staffList = res |
| | | }) |
| | | }, |
| | | initData() { |
| | | fetchList({ |
| | | model: { type: 5 }, |
| | |
| | | }).then(res => { |
| | | this.cateList = res.records || [] |
| | | }) |
| | | |
| | | this.getStaff() |
| | | }, |
| | | changeSel(e) { |
| | | if (e && e.length == 1) { |
| | | this.$set(this.param, 'catePId', e[0]) |
| | | this.$set(this.param, 'cateId', '') |
| | | } else if (e && e.length == 2) { |
| | | this.$set(this.param, 'catePId', e[0]) |
| | | this.$set(this.param, 'cateId', e[1]) |
| | | if (e && e.length == 2) { |
| | | this.$set(this.param, 'areaId', e[1]) |
| | | } else { |
| | | this.$set(this.param, 'catePId', '') |
| | | this.$set(this.param, 'cateId', '') |
| | | this.$set(this.param, 'areaId', '') |
| | | } |
| | | this.search() |
| | | }, |
| | | uploadAvatarSuccess(file) { |
| | | this.$set(this.param, 'imgurl', file.imgurl) |
| | |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped></style> |
| | | </script> |