Kaynağa Gözat

优化统计模板

wulanhaote
liuminjian 2 yıl önce
ebeveyn
işleme
2ba9f28c56
1 değiştirilmiş dosya ile 102 ekleme ve 88 silme
  1. +102
    -88
      src/views/sunVillage_info/statistical_report_edit.vue

+ 102
- 88
src/views/sunVillage_info/statistical_report_edit.vue Dosyayı Görüntüle

@@ -206,21 +206,15 @@
</van-action-sheet>

<van-action-sheet v-model="popObj.templateVisbile" duration="0.2" >
<van-picker
title="模板"
:columns="templateOptions"
show-toolbar
@confirm="templateConfirm"
@cancel="templateCancel"
:loading="loading"
>
<template #option="option">
<div style="display: flex; flex-direction: column; align-items: center;">
<div>{{ option.label }}</div>
</div>
</template>
</van-picker>

<van-cascader
v-model="cascaderValue"
title="请选择所在地区"
:options="statisticsProject"
@close="popObj.templateVisbile = false"
@finish="projectOnFinish"
@change="projectOnChange"
:field-names="fieldNames"
/>
</van-action-sheet>
</div>
</template>
@@ -232,7 +226,6 @@ export default {
name: "statisticalReportEdit",
data() {
return {
stepperValue:1,
from:{
applyTime:null,
applyUserId:null,
@@ -270,9 +263,16 @@ export default {
// 申报类型ID字典
declarationTypeIdOptions: [],
declarationTypeValue:'请选择',
loading:true,
//模板list
//申报大项--列表
templateOptions:[],
loading:true
statisticsProject:[],
cascaderValue:null,
fieldNames:{
text: 'dictLabel',
value: 'dictValue',
children: 'children',
}
@@ -299,31 +299,31 @@ export default {
if(res.code == 200){
let content = res.data;
let obj = {
applyTime:content.content,
applyTime:content.applyTime,
applyUserId:content.pplyUserId,
applyUserName:content.applyUserName,
auditStatus:content.auditStatus,
createBy:content.createBy,
createTime:content.createTime,
deptId:content.deptId,
id:content.id,
instanceId:content.instanceId,
processKey:content.processKey,
remark:content.remark,
statisticsTypeId:content.statisticsTypeId,
templateId:content.templateId, //模板id
updateBy:content.updateBy,
updateTime:content.updateTime,
templateName:content.templateName, //模板名称
declarationTypeId:content.declarationTypeId, //申报类型 1
principalName:content.principalName, //单位负责人 1
preparer:content.preparer, //填表人 1
preparerDeptName:content.preparerDeptName, //填报单位 1
time:content.time,
tEntityStatisticsNumberList:content.tEntityStatisticsNumberList
}
// let obj = {
// applyTime:content.content,
// applyTime:content.applyTime,
// applyUserId:content.pplyUserId,
// applyUserName:content.applyUserName,
// auditStatus:content.auditStatus,
// createBy:content.createBy,
// createTime:content.createTime,
// deptId:content.deptId,
// id:content.id,
// instanceId:content.instanceId,
// processKey:content.processKey,
// remark:content.remark,
// statisticsTypeId:content.statisticsTypeId,
// templateId:content.templateId, //模板id
// updateBy:content.updateBy,
// updateTime:content.updateTime,
// templateName:content.templateName, //模板名称
// declarationTypeId:content.declarationTypeId, //申报类型 1
// principalName:content.principalName, //单位负责人 1
// preparer:content.preparer, //填表人 1
// preparerDeptName:content.preparerDeptName, //填报单位 1
// time:content.time,
// tEntityStatisticsNumberList:content.tEntityStatisticsNumberList
// }

//当前选择模板
this.tEntityStatisticsNumberList = content.tEntityStatisticsNumberList;
@@ -337,50 +337,75 @@ export default {

// this.loading =false;
this.declarationTypeValue = declarationTypeObj.dictLabel;
this.from = obj;
this.from = res.data;
}

})
}
//查看
entityStatisticsTemplate({statisticsTypeId:1}).then((response)=>{
if(response.code == 200){
let content = response.data;

this.templateOptions = content.map(item => {
const recursionFileMap = obj => {
obj.forEach((v,i)=>{

if(v.currentYearNumber == null){
v.currentYearNumber = 0;
}
if (v.children && v.children != null) {
recursionFileMap(v.children)
}
})
}
recursionFileMap(item.tEntityStatisticsNumberList)

return {
value:item.templateName,
label: item.templateName,
templateForm:item,
// templateForm:{
// templateId:item.id,
// templateName:item.templateName,
// declarationTypeId:item.declarationTypeId,
// tEntityStatisticsNumberList:item.tEntityStatisticsNumberList
// }
};
});
this.loading =false;

this.getDicts("newBusinessEntity_statistics_project").then(res => {
if(res.code == 200){
let content = res.data;
content.forEach((v)=>{
v.children = [];
})
this.statisticsProject = content;
}
})
});
},
methods: {
projectOnFinish(data){

let content = data.selectedOptions[data.selectedOptions.length -1]
console.log(content)

this.tEntityStatisticsNumberList = content.templateForm.tEntityStatisticsNumberList;
this.templateValue = content.dictLabel;
// // this.from.templateName = data.label;
this.from = content.templateForm;
this.popObj.templateVisbile = false;
},
projectOnChange(value){
if(value.tabIndex == 0){
//查看
entityStatisticsTemplate({statisticsTypeId:value.selectedOptions[0].dictValue}).then((response)=>{
if(response.code == 200){
let content = response.data;

this.statisticsProject[Number(value.value)-1].children = content.map(item => {
const recursionFileMap = obj => {
obj.forEach((v,i)=>{

if(v.currentYearNumber == null){
v.currentYearNumber = 0;
}
if (v.children && v.children != null) {
recursionFileMap(v.children)
}
})
}
recursionFileMap(item.tEntityStatisticsNumberList)
return {
dictLabel:item.templateName,
dictValue: item.templateId,
templateForm:item,
// templateForm:{
// templateId:item.id,
// templateName:item.templateName,
// declarationTypeId:item.declarationTypeId,
// tEntityStatisticsNumberList:item.tEntityStatisticsNumberList
// }
};
});
this.loading =false;

}
})
}
},
submitFrom(){
this.from.tEntityStatisticsNumberList = this.tEntityStatisticsNumberList;
this.from.tentityStatisticsNumberList = this.tEntityStatisticsNumberList;
@@ -430,18 +455,7 @@ export default {
},
templateClick(){
this.popObj.templateVisbile = true;
},
templateConfirm(data,index){
this.tEntityStatisticsNumberList = data.templateForm.tEntityStatisticsNumberList;
this.templateValue = data.label;
// this.from.templateName = data.label;
this.from = data.templateForm;
this.popObj.templateVisbile = false;
},
templateCancel(){
this.popObj.templateVisbile = false;
}

},
}


Yükleniyor…
İptal
Kaydet