diff --git a/src/views/equipment/index.vue b/src/views/equipment/index.vue index c2b6c29..21c7389 100644 --- a/src/views/equipment/index.vue +++ b/src/views/equipment/index.vue @@ -259,7 +259,8 @@ getLc, getQy1, getLc1, - saveImg + saveImg, + getDetail } from "@/api/equipment/index"; import { mapGetters @@ -665,6 +666,14 @@ } }, mounted() { + if(this.$route.query.code){ + getDetail({equipCode:this.$route.query.code}).then(res =>{ + console.log(res) + this.ruleForm = res.data.data; + this.equipmentBox = true; + this.eqiupType = 'look' + }) + } getDeptLazyTree2().then(res => { let data = res.data.data; for(let i=0;i item !== file.url.slice(file.url)) } + console.log(this.imgList) }, // 点击删除 handleDelete() { @@ -806,7 +817,7 @@ this.equipmentBox = true; this.iDisabled = false; this.eqiupType = type; - console.log(this.eqiupType,type) + this.imgList = [] this.fileList = [] if (type == "add") { // 新增 @@ -869,15 +880,18 @@ if (!this.iDisabled) { this.$refs[formName].validate((valid) => { if (valid) { - let data = [] - if(this.imgList.length !== 0){ - this.imgList.map(item =>{ - data.push({ - equipCode:this.ruleForm.code, - filePath:item - }) - }) - } + // let data = [] + // if(this.imgList.length !== 0){ + // this.imgList.map(item =>{ + // data.push({ + // equipCode:this.ruleForm.code, + // filePath:item + // }) + // }) + // } + console.log(this.imgList) + let data = {equipCode:this.ruleForm.code,filepaths:this.imgList.join(',')} + console.log(data) saveImg(data).then(res =>{ if(res.data.code == 200){ add(this.ruleForm).then(res => {