|
|
|
@ -259,7 +259,8 @@ |
|
|
|
getLc, |
|
|
|
getLc, |
|
|
|
getQy1, |
|
|
|
getQy1, |
|
|
|
getLc1, |
|
|
|
getLc1, |
|
|
|
saveImg |
|
|
|
saveImg, |
|
|
|
|
|
|
|
getDetail |
|
|
|
} from "@/api/equipment/index"; |
|
|
|
} from "@/api/equipment/index"; |
|
|
|
import { |
|
|
|
import { |
|
|
|
mapGetters |
|
|
|
mapGetters |
|
|
|
@ -665,6 +666,14 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
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 => { |
|
|
|
getDeptLazyTree2().then(res => { |
|
|
|
let data = res.data.data; |
|
|
|
let data = res.data.data; |
|
|
|
for(let i=0;i<data.length;i++){ |
|
|
|
for(let i=0;i<data.length;i++){ |
|
|
|
@ -713,6 +722,7 @@ |
|
|
|
if(response.code == 200){ |
|
|
|
if(response.code == 200){ |
|
|
|
this.imgList.push(response.data.link) |
|
|
|
this.imgList.push(response.data.link) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
console.log(this.imgList) |
|
|
|
}, |
|
|
|
}, |
|
|
|
beforeRemove(file,fileList){ |
|
|
|
beforeRemove(file,fileList){ |
|
|
|
if(this.eqiupType == 'look'){ |
|
|
|
if(this.eqiupType == 'look'){ |
|
|
|
@ -726,6 +736,7 @@ |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
this.imgList = this.imgList.filter(item => item !== file.url.slice(file.url)) |
|
|
|
this.imgList = this.imgList.filter(item => item !== file.url.slice(file.url)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
console.log(this.imgList) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 点击删除 |
|
|
|
// 点击删除 |
|
|
|
handleDelete() { |
|
|
|
handleDelete() { |
|
|
|
@ -806,7 +817,7 @@ |
|
|
|
this.equipmentBox = true; |
|
|
|
this.equipmentBox = true; |
|
|
|
this.iDisabled = false; |
|
|
|
this.iDisabled = false; |
|
|
|
this.eqiupType = type; |
|
|
|
this.eqiupType = type; |
|
|
|
console.log(this.eqiupType,type) |
|
|
|
this.imgList = [] |
|
|
|
this.fileList = [] |
|
|
|
this.fileList = [] |
|
|
|
if (type == "add") { |
|
|
|
if (type == "add") { |
|
|
|
// 新增 |
|
|
|
// 新增 |
|
|
|
@ -869,15 +880,18 @@ |
|
|
|
if (!this.iDisabled) { |
|
|
|
if (!this.iDisabled) { |
|
|
|
this.$refs[formName].validate((valid) => { |
|
|
|
this.$refs[formName].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
if (valid) { |
|
|
|
let data = [] |
|
|
|
// let data = [] |
|
|
|
if(this.imgList.length !== 0){ |
|
|
|
// if(this.imgList.length !== 0){ |
|
|
|
this.imgList.map(item =>{ |
|
|
|
// this.imgList.map(item =>{ |
|
|
|
data.push({ |
|
|
|
// data.push({ |
|
|
|
equipCode:this.ruleForm.code, |
|
|
|
// equipCode:this.ruleForm.code, |
|
|
|
filePath:item |
|
|
|
// filePath:item |
|
|
|
}) |
|
|
|
// }) |
|
|
|
}) |
|
|
|
// }) |
|
|
|
} |
|
|
|
// } |
|
|
|
|
|
|
|
console.log(this.imgList) |
|
|
|
|
|
|
|
let data = {equipCode:this.ruleForm.code,filepaths:this.imgList.join(',')} |
|
|
|
|
|
|
|
console.log(data) |
|
|
|
saveImg(data).then(res =>{ |
|
|
|
saveImg(data).then(res =>{ |
|
|
|
if(res.data.code == 200){ |
|
|
|
if(res.data.code == 200){ |
|
|
|
add(this.ruleForm).then(res => { |
|
|
|
add(this.ruleForm).then(res => { |
|
|
|
|