update code

dev
haha 2024-05-09 22:01:48 +08:00
parent cc39bab608
commit d6adcdab70
5 changed files with 146 additions and 69 deletions

View File

@ -16,7 +16,15 @@ const getList=(data,pageSize,pageNum)=>{
}) })
} }
const groupCheckType=data=>{
return request({
url: `bgscreen/checkDetection/groupCheckType`,
method: 'post',
data:data
})
}
export default{ export default{
groupByCheckType, groupByCheckType,
getList getList,
groupCheckType
} }

View File

@ -7,14 +7,23 @@ const groupMeasureInfo=(data)=> {
data:data data:data
}) })
} }
const getList=data=>{ const getList=(data,pageSize,pageNum)=>{
return request({ return request({
url: `bgscreen/measure/getList`, url: `bgscreen/measure/getList?pageNum=${pageNum}&pageSize=${pageSize}`,
method: 'post', method: 'post',
data:data data:data
}) })
} }
const groupMeasureType=data=>{
return request({
url: `bgscreen/measure/groupMeasureType`,
method: 'post',
data:data
})
};
export default{ export default{
groupMeasureInfo, groupMeasureInfo,
getList getList,
groupMeasureType
} }

View File

@ -94,20 +94,9 @@
style="position: absolute; cursor: pointer; right: 12px; top: 12px" @click="doShowCheckDetectionDlg" /> style="position: absolute; cursor: pointer; right: 12px; top: 12px" @click="doShowCheckDetectionDlg" />
<div class="warning-info"> <div class="warning-info">
<div class="warning-info-title"> <div class="warning-info-title">
<div :class="samplingNav == 0 ? 'active' : ''" @click="checkDetection(0)"> <div :class="samplingNav == it.id ? 'active' : ''" @click="checkDetection(it.id)"
汇总 v-for="(it, idx) in detectionCheckType" :key="idx">
</div> {{ it.text }}
<div :class="samplingNav == 1 ? 'active' : ''" @click="checkDetection(1)">
钢筋原材料
</div>
<div :class="samplingNav == 2 ? 'active' : ''" @click="checkDetection(2)">
钢筋试拉件
</div>
<div :class="samplingNav == 3 ? 'active' : ''" @click="checkDetection(3)">
混凝土试件
</div>
<div :class="samplingNav == 4 ? 'active' : ''" @click="checkDetection(4)">
其他
</div> </div>
</div> </div>
<div class="equipment-list-max quality-target-index"> <div class="equipment-list-max quality-target-index">
@ -214,27 +203,9 @@
<img src="images/icon2001.png" v-if="prjs.length > 1" <img src="images/icon2001.png" v-if="prjs.length > 1"
style="position: absolute; cursor: pointer; right: 12px; top: 12px" @click="doShowMeasuredDlg" /> style="position: absolute; cursor: pointer; right: 12px; top: 12px" @click="doShowMeasuredDlg" />
<div class="warning-info-title warning-info-title_div measured-data-list" <div class="warning-info-title warning-info-title_div measured-data-list"
style="padding-left: 2px; position: relative; z-index: 9"> style="padding-left: 12px; position: relative; z-index: 9">
<div :class="measuredNav == 0 ? 'active' : ''" @click="doMeasuredNav(0, '汇总')"> <div :class="measuredNav == it.id ? 'active' : ''" v-for="(it,idx) in measureTypes" :key="idx" @click="doMeasuredNav(it.id,it.text)">
汇总 {{it.text.replace("工程","") }}
</div>
<div :class="measuredNav == 1 ? 'active' : ''" @click="doMeasuredNav(1, '混凝土')">
混凝土
</div>
<div :class="measuredNav == 6 ? 'active' : ''" @click="doMeasuredNav(6, '钢筋工程')">
钢筋工程
</div>
<div :class="measuredNav == 2 ? 'active' : ''" @click="doMeasuredNav(2, '二次结构')">
二次结构
</div>
<div :class="measuredNav == 3 ? 'active' : ''" @click="doMeasuredNav(3, '房间尺寸')">
房间尺寸
</div>
<div :class="measuredNav == 4 ? 'active' : ''" @click="doMeasuredNav(4, '装饰装修')">
装饰装修
</div>
<div :class="measuredNav == 5 ? 'active' : ''" @click="doMeasuredNav(5, '其它')">
其它
</div> </div>
</div> </div>
<project-overview-chart :sp="'\n'" :maintitle="measuredTotal" :legend-opt="legendOptCheck" txtTop="12" <project-overview-chart :sp="'\n'" :maintitle="measuredTotal" :legend-opt="legendOptCheck" txtTop="12"
@ -400,6 +371,8 @@ export default {
], ],
}, },
prjs: [], prjs: [],
detectionCheckType: [],//
measureTypes:[],//
}; };
}, },
created() { created() {
@ -432,6 +405,24 @@ export default {
this.legendOptCheck = { ...obj }; this.legendOptCheck = { ...obj };
this.materialLegendOpt = { ...obj }; this.materialLegendOpt = { ...obj };
this.materialLegendOpt.itemWidth = 50; this.materialLegendOpt.itemWidth = 50;
this.$api.dict("check_detection_check_type").then(d => {
let tmps = (d || []).map(it => {
return {
text: it.dictLabel,
id: +it.dictValue
}
});
this.detectionCheckType = [{ text: '汇总', id: 0 }, ...tmps]
});
this.$api.dict("project_measure_type").then(d=>{
let tmps = (d || []).map(it => {
return {
text: it.dictLabel,
id: +it.dictValue
}
});
this.measureTypes = [{ text: '汇总', id: 0 }, ...tmps]
});
}, },
mounted() { mounted() {
let dt1 = this.$dt((+new Date()) - 30 * 24 * 3600 * 1000); let dt1 = this.$dt((+new Date()) - 30 * 24 * 3600 * 1000);
@ -489,6 +480,7 @@ export default {
deptId: this.dept?.id || 0, deptId: this.dept?.id || 0,
projectId: this.projectInfo.id, projectId: this.projectInfo.id,
checkType: this.samplingNav, checkType: this.samplingNav,
types:this.detectionCheckType,
data: this.chkDetection data: this.chkDetection
}); });
}, },
@ -496,6 +488,7 @@ export default {
this.$refs.measuredDlg.showDialog({ this.$refs.measuredDlg.showDialog({
deptId: this.dept?.id || 0, deptId: this.dept?.id || 0,
projectId: this.projectInfo.id, projectId: this.projectInfo.id,
types:this.measureTypes,
measureType: this.measuredNav, measureType: this.measuredNav,
}); });
}, },

View File

@ -35,8 +35,7 @@
</i> </i>
</div> </div>
<div class="head-title-tab" style="padding: 10px 0px;max-width: unset;margin-top:10px;margin-left:40px;"> <div class="head-title-tab" style="padding: 10px 0px;max-width: unset;margin-top:10px;margin-left:40px;">
<div :class="nav == 0 ? 'head-nav active' : 'head-nav'" @click="doNav(0)">({{ total1}})</div> <div :class="nav == it.id ? 'head-nav active' : 'head-nav'" v-for="(it,idx) in types" @click="doNav(it.id)" :key="idx">{{it.text}}({{ it.count}})</div>
<div :class="nav == 1 ? 'head-nav active' : 'head-nav'" @click="doNav(1)">({{ total2}})</div>
</div> </div>
<template v-if="dataTable.length>0"> <template v-if="dataTable.length>0">
<div class="data-list scroll" style="max-height:670px;overflow-y: auto;margin:12px 0px;overflow-x: hidden;" > <div class="data-list scroll" style="max-height:670px;overflow-y: auto;margin:12px 0px;overflow-x: hidden;" >
@ -177,8 +176,7 @@ export default {
show: false, show: false,
dataTable: [], dataTable: [],
opt:{}, opt:{},
total1:0, types:[],
total2:0,
}; };
}, },
@ -196,32 +194,48 @@ export default {
this.index = n; this.index = n;
this.loadData(); this.loadData();
}, },
toggleNav(n) {
this.nav = n;
},
doNav(n){ doNav(n){
this.nav=n; this.nav=n;
this.index=1;
this.title="材料进场取样复试-"+['汇总','钢筋原材料','钢筋试拉件','混凝土试件','其他'][this.nav||0];
this.loadData(); this.loadData();
}, },
showDialog(opt) { showDialog(opt) {
this.show = true this.show = true
this.nav=0; this.nav=opt.checkType;
this.title="材料进场取样复试-"+['汇总','钢筋原材料','钢筋试拉件','混凝土试件','其他'][this.nav||0];
this.opt=opt; this.opt=opt;
this.total1=opt.data.chk1*1-opt.data.chk3*1; this.types=(opt.types||[]).map(it=>{
this.total2=opt.data.chk3; let obj={...it,count:0};
return obj;
});
this.loadData(); this.loadData();
this.getCount();
},
getCount(){
this.$api.checkDetection.groupCheckType({...this.opt}).then(d=>{
let sum=0;
(d.data||[]).forEach(it=>{
let tmps=this.types.filter(item=>item.id==it.id);
if(tmps.length>0){
tmps[0].count=it.projectId*1;
}
sum+=it.projectId*1;
});
this.types[0].count=sum;
});
}, },
loadData(){ loadData(){
this.$api.checkDetection.getList({ let optData={
detectionResult:this.nav==0?0:1,
...this.opt ...this.opt
},this.size,this.index).then(d=>{ };
optData.checkType=this.nav;
this.$api.checkDetection.getList(optData,this.size,this.index).then(d=>{
this.total=d.total||0; this.total=d.total||0;
this.dataTable=(d.rows||[]).map(it=>{ this.dataTable=(d.rows||[]).map(it=>{
it.attachmentFiles=this.$tryToJson(it.attachment,[]); it.attachmentFiles=this.$tryToJson(it.attachment,[]);
return it; return it;
}); });
this.title="材料进场取样复试-"+['汇总','钢筋原材料','钢筋试拉件','混凝土试件','其他'][this.opt.checkType||0]+`[${this.dataTable.length}]`;
}); });
} }
}, },

View File

@ -34,7 +34,11 @@
</svg> </svg>
</i> </i>
</div> </div>
<div class="data-list scroll" style="max-height:770px;overflow-y: auto;margin:12px 0px;overflow-x: hidden;" v-if="dataTable.length>0"> <div class="head-title-tab" style="padding: 10px 0px;max-width: unset;margin-top:10px;margin-left:40px;">
<div :class="nav == it.id ? 'head-nav active' : 'head-nav'" v-for="(it,idx) in types" :key="idx" @click="doNav(it.id)">{{it.text}}({{ it.count}})</div>
</div>
<template v-if="dataTable.length>0">
<div class="data-list scroll" style="max-height:670px;overflow-y: auto;margin:12px 0px;overflow-x: hidden;" >
<div v-for="(it, idx) in dataTable" :key="idx" class="data-item" <div v-for="(it, idx) in dataTable" :key="idx" class="data-item"
:class="it.timeout ? 'time-out' : ''"> :class="it.timeout ? 'time-out' : ''">
<div class="item-left"> <div class="item-left">
@ -111,6 +115,10 @@
</div> </div>
</div> </div>
</div> </div>
<el-pagination layout="total,prev, pager, next" :hide-on-single-page="true"
@current-change="handleCurrentChange" :total="total" :page-size="size" :current-page.sync="index"
class="bg-pagination"></el-pagination>
</template>
<div v-else style="text-align: center;margin-top: 200px;"> <div v-else style="text-align: center;margin-top: 200px;">
<img src="images/nodata.png" style="width: 240px;"> <img src="images/nodata.png" style="width: 240px;">
<div style="text-align: center;">暂无数据</div> <div style="text-align: center;">暂无数据</div>
@ -131,25 +139,70 @@ export default {
fontSize: 0, fontSize: 0,
title:'', title:'',
show: false, show: false,
dataTable: [] dataTable: [],
total:0,
size:10,
index:1,
nav:0,
types:[],
opt:{}
}; };
}, },
mounted() { mounted() {
}, },
methods: { methods: {
toggleNav(n) { handleCurrentChange(n) {
this.index = n;
this.loadData();
},
doNav(n) {
this.nav = n; this.nav = n;
this.title="实测实量-"+['汇总','混泥土工程','二次构建','房间尺寸','抹灰工程','其它'][this.nav||0];
this.loadData();
}, },
showDialog(opt) { showDialog(opt) {
this.opt=opt;
this.nav=opt.measureType
this.title="实测实量-"+['汇总','混泥土工程','二次构建','房间尺寸','抹灰工程','其它'][this.nav||0];
this.types=(opt.types||[]).map(it=>{
let obj={...it,count:0};
return obj;
});
this.show = true this.show = true
this.$api.measure.getList(opt).then(d=>{ this.getCount();
this.dataTable=(d.data||[]).map(it=>{ this.loadData();
},
getCount(){
let postData={
deptId:this.opt.deptId,
projectId:this.opt.projectId
};
this.$api.measure.groupMeasureType(postData).then(d=>{
let sum=0;
(d.data||[]).forEach(it=>{
let tmps=this.types.filter(item=>item.id==it.id);
if(tmps.length>0){
tmps[0].count=it.projectId*1;
}
sum+=it.projectId*1;
});
this.types[0].count=sum;
});
},
loadData(){
let optData={
deptId:this.opt.deptId,
projectId:this.opt.projectId,
measureType:this.nav
}
this.$api.measure.getList(optData,this.size,this.index).then(d=>{
this.total=d.total||0;
this.dataTable=(d.rows||[]).map(it=>{
it.images=(it.imageUrls||"").split(",").filter(it=>it); it.images=(it.imageUrls||"").split(",").filter(it=>it);
return it; return it;
}); });
this.title="实测实量-"+['汇总','混泥土工程','二次构建','房间尺寸','抹灰工程','其它'][opt.checkType||0]+`[${this.dataTable.length}]`;
}); });
} }
}, },
@ -229,7 +282,7 @@ export default {
background-size: 100% 100%; background-size: 100% 100%;
display: inline-block; display: inline-block;
width: auto; width: auto;
padding: 0px 24px; padding: 0px 32px;
} }
} }