Browse Source

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

master
weikai 5 years ago
parent
commit
477013312f
  1. 121
      src/views/modules/kpi/kpisubpositiondetail.vue

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

@ -9,7 +9,7 @@
<div style="margin: 20px">
{{index1+1}}) {{item1.label}}
</div>
<el-form label-width="370px" :model="item1" :rules="dataRule" ref="dataForm" >
<el-form label-width="370px" :model="item1" :disabled="pageDisabled" :rules="dataRule" ref="dataForm" >
<el-form-item label="描述:" label-width="90px" style="font-weight:bold;">
<el-input
type="textarea"
@ -59,7 +59,7 @@
</el-form-item>
</el-form>
</div>
<el-form v-if="index == 1" label-width="370px" :model="item" :rules="dataRule" ref="dataForm" >
<el-form v-if="item.childDiction.length == 0" label-width="370px" :disabled="pageDisabled" :model="item" :rules="dataRule" ref="dataForm" >
<el-form-item label="描述:" prop="content" label-width="90px" style="font-weight:bold;">
<el-input
type="textarea"
@ -108,13 +108,15 @@
</el-upload>
</el-form-item>
</el-form>
</div>
<el-form>
<el-form-item label="关联网格:" prop="content" label-width="90px" style="font-weight:bold;">
<el-form-item label="关联网格:" prop="content" label-width="90px" style="font-weight:bold">
<el-select
v-model="dataForm.grids"
multiple
style="width: 300px"
collapse-tags
placeholder="请选择">
<el-option
@ -129,11 +131,15 @@
<el-form>
<el-form-item style="margin-left:35px;">
<el-button type="primary" @click="backToUserRelationList">{{"返回"}}</el-button>
<el-button type="primary" :disabled="isAble" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
<el-button v-if="this.state === '0'" type="primary" :disabled="isAble" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
<el-button v-if="state === '2'" type="primary" @click="">初审</el-button>
<el-button v-if="state === '3'" type="primary" @click="">验收</el-button>
</el-form-item>
</el-form>
</div>
<!-- 初审弹框 -->
<trial v-if="trialVisible" ref="subpositioncheckinfoTrial" @refreshDataList="backToUserRelationList"></trial>
</el-card>
</template>
@ -141,6 +147,7 @@
import Cookies from "js-cookie";
import debounce from "lodash/debounce";
import MapSelect from "@/views/modules/workRecord/map-select";
import trial from "./subpositioncheckinfo-trial"
export default {
name: "kpisubpositiondetail",
@ -155,6 +162,7 @@ export default {
},
options :[],
isAble:false,
pageDisabled:false,
gridIds:[],
//
pageloading:true,
@ -171,6 +179,9 @@ export default {
hideUpload: false,
fileloading: false,
checkDiction:[],
state:'0',
//
trialVisible:false,
}
},
@ -187,18 +198,42 @@ export default {
this.uploadUrl = `http://219.146.91.110:10000/epdc-api/oss/file/uploadImg?token=${Cookies.get('token')}`
this.uploadFileUrl = `http://219.146.91.110:10000/epdc-api/oss/file/uploadAllFile?token=${Cookies.get('token')}`
this.getOptions();
this.getCheckInfo();
this.init();
},
mounted () {
if (this.$route.query.disabled === '0') {
if (this.$route.query.status === '1') {
//
this.pageDisabled = true;
} else {
}
},
methods: {
init () {
this.dataForm.id = this.$route.query.id
this.state = this.$route.query.state === undefined? '0':this.$route.query.state;
if (this.state === '1'){
this.isAble = true;
this.pageDisabled = true;
}
// this.$route.query.id
// '980b98f007278c1452867b7c208f3f75'
this.$nextTick(() => {
if (this.dataForm.id) {
this.$http.get(`/kpi/subdetail/getInfogrid/${this.dataForm.id}`).then(({ data: res }) => {
this.pageloading = false
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm.grids = res.data
}).catch(() => {})
this.getInfoById()
}else {
this.getCheckInfo();
}
})
},
beforeAvatarUpload (file) {
if (this.dataForm.length === 6) {
@ -302,9 +337,9 @@ export default {
},
//
backToUserRelationList () {
this.$emit('refreshDataList')
this.$parent.selectComponent = 'Weekrecordinfo'
this.$router.push({ path: '/workRecord-weekrecordinforoute' })
this.$emit('subpositioncheckinfo')
this.$parent.selectComponent = 'Subpositioncheckinfo'
this.$router.push({ path: '/kpi-subpositioncheckinforoute' })
},
getOptions () {
this.$http
@ -327,51 +362,44 @@ export default {
this.checkDiction = res.data
}).catch(() => {})
// this.checkDiction=[
// {
// id:'01f23eecdda4f20ef58fd2cb344ab3bf',
// label:'',
// childDiction:[
// {
// id:'009ff607df016a3fc1e15a08651c8977',
// label:'3'
// },
// {
// id:'2ff0833824d341e6bd26717c49e0ff33',
// label:''
// }
// ]
// },
// {
// id:'ae35fb5792b9ecaa316b1c238fbffd2b',
// label:'',
// childDiction:[
//
// ]
// }
// ]
},
getInfoById(){
this.$http.get(`/kpi/subdetail/getSubDetailInfoByInfoId/${this.dataForm.id}`).then(({ data: res }) => {
this.pageloading = false
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.checkDiction = res.data
}).catch(() => {})
},
//
trial(){
this.trialVisible = true
},
//
dataFormSubmitHandle: debounce(function () {
//
let subChild =[];
for (let i of this.checkDiction){
let laber = i.label;
let bigId = i.id;
let childSub = i.childDiction;
if (childSub.length>0) {
for (let j of childSub) {
//
console.log(j)
let childDesribe = j.describe;
//
let childUrl = j.images === undefined ? [] :j.images.url;
let childUrl = j.images.url === undefined? [] :j.images.url;
//
let thumbnail = j.images === undefined ? [] :j.images.thumbnail;
let thumbnail = j.images.thumbnail === undefined ? [] :j.images.thumbnail;
//
let childFile =j.files === undefined ? [] : j.files;
let childFile =j.files.name === undefined ? [] : j.files;
let littleId = j.id;
let m = {
id:j.infoId,
@ -386,8 +414,8 @@ export default {
}
}else {
let childDesribe = i.describe;
let childUrl = i.images === undefined ?[]:i.images.url;
let thumbnail = i.images === undefined ? [] :j.images.thumbnail;
let childUrl = i.images.url === undefined ?[]:i.images.url;
let thumbnail = i.images.thumbnail === undefined ? [] :j.images.thumbnail;
let childFile = i.files === undefined ?[]:i.files;
let ai = {
id:i.infoId,
@ -403,18 +431,25 @@ export default {
}
this.dataForm.subDetail =subChild
debugger
let pateDate={
infoId : this.dataForm.id,
gridIds:this.dataForm.grids,
infoDetail:subChild
}
console.log(pateDate)
console.log(pateDate);
this.$http[!this.dataForm.id ? 'post' : 'put'](`kpi/subdetail/addDetail`,pateDate).then(({ data: res }) => {
this.pageloading = false
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.backToUserRelationList();
}).catch(() => {})
}, 1000, { 'leading': true, 'trailing': false })
},
components: {
MapSelect
MapSelect,
trial
}
}
</script>

Loading…
Cancel
Save