Browse Source

【pc端 添加网格实体化指标详情】-【页面修改】-(魏凯)-2020/12/11

master
weikai 5 years ago
parent
commit
9e92d3af18
  1. 64
      src/views/modules/kpi/kpisubpositiondetail.vue

64
src/views/modules/kpi/kpisubpositiondetail.vue

@ -23,12 +23,12 @@
<el-form-item label="添加图片" v-loading="loading" prop="images" label-width="90px">
<el-upload
:action="uploadUrl"
:class="{hide:hideUpload}"
:class="{hide:hideUpload[(index+1)*(index1+99)]}"
list-type="picture-card"
:file-list="item1.images"
:limit=6
:on-preview="handlePictureCardPreview"
:on-remove="(file,fileList) =>handleRemove(file,fileList, index,0,2)"
:on-remove="(file,fileList) =>handleRemove(file,fileList, index,index1,2)"
:on-success="(res, file,fileList) => handleAvatarSuccess( res, file,fileList, index,index1,2)"
:on-error="handelError"
:before-upload="beforeAvatarUpload"
@ -73,7 +73,7 @@
<el-form-item label="添加图片" v-loading="loading" prop="images" label-width="90px">
<el-upload
:action="uploadUrl"
:class="{hide:hideUpload}"
:class="{hide:hideUploadBig[index]}"
list-type="picture-card"
:file-list="item.images"
:limit=6
@ -182,7 +182,9 @@ export default {
dialogImageUrl: '',
//
uploadFileUrl:'',
hideUpload: false,
hideUpload: [
],
hideUploadBig: [],
fileloading: false,
checkDiction:[],
status:'0',
@ -223,17 +225,14 @@ export default {
if (this.status === '1'){
this.isAble = true;
this.pageDisabled = true;
this.hideUpload = true;
}
if (this.status === '2'){
this.isAble = true;
this.pageDisabled = true;
this.hideUpload = true;
}
if (this.status === '3'){
this.isAble = true;
this.pageDisabled = true;
this.hideUpload = true;
}
this.$nextTick(() => {
if (this.dataForm.id) {
@ -302,13 +301,12 @@ export default {
}
if (type ===2){
this.checkDiction[index].childDiction[index1].images.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 1, name: res.data.fileName })
this.hideUpload[(index+1)*(index1+99)] = this.checkDiction[index].childDiction[index1].images.length >= 6
}else {
this.checkDiction[index].images.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 1, name: res.data.fileName })
this.hideUploadBig[index] = this.checkDiction[index].images.length >= 6
}
this.hideUpload = this.dataForm.images.length >= 6
},
handelError () {
this.loading = false
@ -332,9 +330,9 @@ export default {
let item = this.checkDiction[index].childDiction[index1].images[i]
if (item.url === file.url) {
this.checkDiction[index].childDiction[index1].images.splice(i, 1)
this.hideUpload = this.checkDiction[index].childDiction[index1].images.length >= 6
this.hideUpload[(index+1)*(index1+99)] = this.checkDiction[index].childDiction[index1].images.length >= 6
}
this.hideUpload = this.checkDiction[index].childDiction[index1].images.length >= 6
this.hideUpload[(index+1)*(index1+99)] = this.checkDiction[index].childDiction[index1].images.length >= 6
}
}else {
for (var i = 0; i < this.checkDiction[index].images.length; i++) {
@ -343,7 +341,7 @@ export default {
this.checkDiction[index].images.splice(i, 1)
}
}
this.hideUpload = this.checkDiction[index].images.length >= 6
this.hideUploadBig[index] = this.checkDiction[index].images.length >= 6
}
},
@ -457,28 +455,62 @@ export default {
return this.$message.error(res.msg)
}
this.checkDiction = res.data
for (let i =0;i< this.checkDiction.length;i++) {
let x = this.checkDiction[i].childDiction;
if (x.length>0){
for (let j = 0; j < x.length; j++) {
if (this.status === '1'){
this.hideUpload[(i+1)*(j+99)] = true;
}
if (this.status === '2'){
this.hideUpload[(i+1)*(j+99)] = true;
}
if (this.status === '3'){
this.hideUpload[(i+1)*(j+99)] = true;
}
if (x[j].images.length === 6){
this.hideUpload[(i+1)*(j+99)] = true;
}
}
}else {
if (this.status === '1'){
this.hideUploadBig[i] = true;
}
if (this.status === '2'){
this.hideUploadBig[i] = true;
}
if (this.status === '3'){
this.hideUploadBig[i] = true;
}
if (this.checkDiction[i].images.length === 6){
this.hideUploadBig[i] = true;
}
}
}
this.pageloading = false
}).catch(() => {})
},
//
dataFormSubmitHandle: debounce(function () {
console.log(this.hideUpload)
// 0
let remindInfo = ''
for (var i = 0; i < this.checkDiction.length; i++) {
let childSub = this.checkDiction[i].childDiction;
let label = this.checkDiction[i].label;
if (childSub.length>0){
for (let b = 0; b <childSub.length ; b++) {
let cds = childSub[b].describe;
if (cds === undefined || cds === ''){
remindInfo += '第' + (i + 1) + '大项有的描述、'
remindInfo += '【' +label + '】的描述、'
break;
}
}
}else {
let ds = this.checkDiction[i].describe;
if (ds === undefined || ds === ''){
remindInfo += '第' + (i + 1) + '大项有的描述、'
remindInfo += '【' +label + '】的描述、'
}
}
}
@ -570,7 +602,7 @@ export default {
}
</script>
<style scoped>
<style>
.hide .el-upload--picture-card {
display: none;
}

Loading…
Cancel
Save