diff --git a/src/views/modules/kpi/kpisubpositiondetail.vue b/src/views/modules/kpi/kpisubpositiondetail.vue index 91fc25b8..55572a29 100644 --- a/src/views/modules/kpi/kpisubpositiondetail.vue +++ b/src/views/modules/kpi/kpisubpositiondetail.vue @@ -6,60 +6,60 @@ {{index+1}}、 {{item.label}}:
-
- {{index1+1}}) {{item1.label}} -
- - - - - - - - - - - - -
1~6张图
-
- - - 点击上传 -
支持扩展名.rar.zip.doc.docx、PDF、Excel...文件
-
-
-
+
+ {{index1+1}}) {{item1.label}} +
+ + + + + + + + + + + + +
1~6张图
+
+ + + 点击上传 +
支持扩展名.rar.zip.doc.docx、PDF、Excel...文件
+
+
+
- + + - + {{"返回"}} - {{ $t('confirm') }} + {{ $t('confirm') }} + 初审 + 验收 + + @@ -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 } }