|
|
|
|
@ -4,7 +4,7 @@ |
|
|
|
|
<div class="box"> |
|
|
|
|
<el-scrollbar> |
|
|
|
|
<basic-container> |
|
|
|
|
<avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" /> |
|
|
|
|
<avue-tree ref="tree" :option="treeOption" :data="treeData" @node-click="nodeClick" /> |
|
|
|
|
</basic-container> |
|
|
|
|
</el-scrollbar> |
|
|
|
|
</div> |
|
|
|
|
@ -194,8 +194,8 @@ |
|
|
|
|
<el-form-item label="简称" prop="shortName"> |
|
|
|
|
<el-input :disabled="eqiupType == 'edit' ? false : iDisabled" v-model="ruleForm.shortName"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="厂家" prop="brand"> |
|
|
|
|
<el-input :disabled="eqiupType == 'edit' ? false : iDisabled" v-model="ruleForm.brand"></el-input> |
|
|
|
|
<el-form-item label="简称" prop="shortName"> |
|
|
|
|
<el-input :disabled="eqiupType == 'edit' ? false : iDisabled" v-model="ruleForm.shortName"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="使用时间" prop="useStartTime"> |
|
|
|
|
<el-date-picker :disabled="eqiupType == 'edit' ? false : iDisabled" format="yyyy-MM-dd" |
|
|
|
|
@ -206,6 +206,9 @@ |
|
|
|
|
<el-form-item label="具体位置" prop="location"> |
|
|
|
|
<el-input :disabled="eqiupType == 'edit' ? false : iDisabled" v-model="ruleForm.location"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="固定资产编号" prop="inventarNummer"> |
|
|
|
|
<el-input :disabled="eqiupType == 'edit' ? false : iDisabled" v-model="ruleForm.inventarNummer"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="维保人" prop="tendingUser"> |
|
|
|
|
<el-input :disabled="eqiupType == 'edit' ? false : iDisabled" v-model="ruleForm.tendingUser"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
@ -217,6 +220,19 @@ |
|
|
|
|
<el-date-picker :disabled="eqiupType == 'edit' ? false : iDisabled" v-model="ruleForm.tendingTime" type="datetime" placeholder="选择维保时间"> |
|
|
|
|
</el-date-picker> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="设备图片"> |
|
|
|
|
<el-upload |
|
|
|
|
:class="(imgList.length >= 5 || eqiupType == 'look') ? 'hide' : ''" |
|
|
|
|
action="/api/blade-desk/oss/put-file" |
|
|
|
|
list-type="picture-card" |
|
|
|
|
:on-success="handleSuccess" |
|
|
|
|
:before-remove="beforeRemove" |
|
|
|
|
:on-remove="handleRemove" |
|
|
|
|
:limit="5" |
|
|
|
|
:file-list="fileList"> |
|
|
|
|
<i class="el-icon-plus"></i> |
|
|
|
|
</el-upload> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
@ -242,7 +258,8 @@ |
|
|
|
|
getQy, |
|
|
|
|
getLc, |
|
|
|
|
getQy1, |
|
|
|
|
getLc1 |
|
|
|
|
getLc1, |
|
|
|
|
saveImg |
|
|
|
|
} from "@/api/equipment/index"; |
|
|
|
|
import { |
|
|
|
|
mapGetters |
|
|
|
|
@ -257,7 +274,7 @@ |
|
|
|
|
return { |
|
|
|
|
options: [], |
|
|
|
|
iDisabled: true, |
|
|
|
|
equipType:"",//操作状态 |
|
|
|
|
eqiupType:"",//操作状态 |
|
|
|
|
build: [], //区域选项 |
|
|
|
|
floored: [], //楼层选项 |
|
|
|
|
props: { |
|
|
|
|
@ -495,7 +512,7 @@ |
|
|
|
|
currentPage: 1, |
|
|
|
|
total: 0 |
|
|
|
|
}, |
|
|
|
|
treeDeptId: '', |
|
|
|
|
treeDeptId: this.$route.query.classCode ? this.$route.query.classCode : '', |
|
|
|
|
treeData: [], |
|
|
|
|
treeOption: { |
|
|
|
|
nodeKey: 'id', |
|
|
|
|
@ -504,6 +521,7 @@ |
|
|
|
|
const parentId = (node.level === 0) ? 0 : node.data.id; |
|
|
|
|
getDeptLazyTree(parentId).then(res => { |
|
|
|
|
resolve(res.data.data.map(item => { |
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
...item, |
|
|
|
|
leaf: !item.hasChildren |
|
|
|
|
@ -566,6 +584,10 @@ |
|
|
|
|
label: "投入使用时间", |
|
|
|
|
prop: "useStartTime", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "固定资产编号", |
|
|
|
|
prop: "inventarNummer", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "更新时间", |
|
|
|
|
prop: "updateTime", |
|
|
|
|
@ -620,7 +642,9 @@ |
|
|
|
|
span: 24, |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
imgList:[], |
|
|
|
|
fileList:[] |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
watch: {}, |
|
|
|
|
@ -641,7 +665,6 @@ |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
console.log('kkkk') |
|
|
|
|
getDeptLazyTree2().then(res => { |
|
|
|
|
let data = res.data.data; |
|
|
|
|
for(let i=0;i<data.length;i++){ |
|
|
|
|
@ -684,6 +707,26 @@ |
|
|
|
|
this.selectionList = []; |
|
|
|
|
this.$refs.crud.toggleSelection(); |
|
|
|
|
}, |
|
|
|
|
// 图片上传成功 |
|
|
|
|
handleSuccess(response, file, fileList){ |
|
|
|
|
console.log(response) |
|
|
|
|
if(response.code == 200){ |
|
|
|
|
this.imgList.push(response.data.link) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
beforeRemove(file,fileList){ |
|
|
|
|
if(this.eqiupType == 'look'){ |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
handleRemove(file,fileList){ |
|
|
|
|
console.log(file) |
|
|
|
|
if(file.response){ |
|
|
|
|
this.imgList = this.imgList.filter(item => item !== file.response.data.link) |
|
|
|
|
}else{ |
|
|
|
|
this.imgList = this.imgList.filter(item => item !== file.url.slice(file.url)) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 点击删除 |
|
|
|
|
handleDelete() { |
|
|
|
|
if (this.selectionList.length === 0) { |
|
|
|
|
@ -749,6 +792,7 @@ |
|
|
|
|
// 首次加载数据、查询、翻页方法 |
|
|
|
|
onLoad(page, params = {}) { |
|
|
|
|
this.loading = true; |
|
|
|
|
console.log(this.treeDeptId) |
|
|
|
|
getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId).then(res => { |
|
|
|
|
const data = res.data.data; |
|
|
|
|
this.page.total = data.total; |
|
|
|
|
@ -762,17 +806,27 @@ |
|
|
|
|
this.equipmentBox = true; |
|
|
|
|
this.iDisabled = false; |
|
|
|
|
this.eqiupType = type; |
|
|
|
|
console.log(this.eqiupType,type) |
|
|
|
|
this.fileList = [] |
|
|
|
|
if (type == "add") { |
|
|
|
|
// 新增 |
|
|
|
|
this.equipmentTit = "新增设备"; |
|
|
|
|
} else if (type == "edit") { |
|
|
|
|
// 编辑 |
|
|
|
|
this.equipmentTit = "编辑设备"; |
|
|
|
|
|
|
|
|
|
getDetails(row.id).then((res) => { |
|
|
|
|
this.ruleForm = res.data.data; |
|
|
|
|
console.log('data',this.ruleForm) |
|
|
|
|
this.ruleForm.images.map(item =>{ |
|
|
|
|
this.fileList.push({url:item.filePath}) |
|
|
|
|
this.imgList.push(item.filePath) |
|
|
|
|
}) |
|
|
|
|
console.log('设备编辑',this.ruleForm); |
|
|
|
|
getQy1(this.ruleForm.area).then(res => { |
|
|
|
|
this.build = res.data.data; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
// getLc(this.ruleForm.area).then(res => { |
|
|
|
|
// this.floored = res.data.data; |
|
|
|
|
@ -784,6 +838,10 @@ |
|
|
|
|
this.equipmentTit = "查看设备"; |
|
|
|
|
getDetails(row.id).then((res) => { |
|
|
|
|
this.ruleForm = res.data.data; |
|
|
|
|
this.ruleForm.images.map(item =>{ |
|
|
|
|
this.fileList.push({url:item.filePath}) |
|
|
|
|
this.imgList.push(item.filePath) |
|
|
|
|
}) |
|
|
|
|
getQy1(this.ruleForm.area).then(res => { |
|
|
|
|
this.build = res.data.data; |
|
|
|
|
}); |
|
|
|
|
@ -811,11 +869,33 @@ |
|
|
|
|
if (!this.iDisabled) { |
|
|
|
|
this.$refs[formName].validate((valid) => { |
|
|
|
|
if (valid) { |
|
|
|
|
add(this.ruleForm).then(res => { |
|
|
|
|
this.resetForm('ruleForm'); |
|
|
|
|
this.page.currentPage = 1; |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
}); |
|
|
|
|
let data = [] |
|
|
|
|
if(this.imgList.length !== 0){ |
|
|
|
|
this.imgList.map(item =>{ |
|
|
|
|
data.push({ |
|
|
|
|
equipCode:this.ruleForm.code, |
|
|
|
|
filePath:item |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
saveImg(data).then(res =>{ |
|
|
|
|
if(res.data.code == 200){ |
|
|
|
|
add(this.ruleForm).then(res => { |
|
|
|
|
this.resetForm('ruleForm'); |
|
|
|
|
this.page.currentPage = 1; |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
// }else{ |
|
|
|
|
// add(this.ruleForm).then(res => { |
|
|
|
|
// this.resetForm('ruleForm'); |
|
|
|
|
// this.page.currentPage = 1; |
|
|
|
|
// this.onLoad(this.page); |
|
|
|
|
// }); |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
@ -916,4 +996,12 @@ |
|
|
|
|
.btn { |
|
|
|
|
margin-top: 50px; |
|
|
|
|
} |
|
|
|
|
/deep/.el-input{ |
|
|
|
|
width: 220px; |
|
|
|
|
} |
|
|
|
|
.hide{ |
|
|
|
|
/deep/ .el-upload--picture-card { |
|
|
|
|
display: none; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|
|