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{
groupByCheckType,
getList
getList,
groupCheckType
}

View File

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

View File

@ -94,20 +94,9 @@
style="position: absolute; cursor: pointer; right: 12px; top: 12px" @click="doShowCheckDetectionDlg" />
<div class="warning-info">
<div class="warning-info-title">
<div :class="samplingNav == 0 ? 'active' : ''" @click="checkDetection(0)">
汇总
</div>
<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 :class="samplingNav == it.id ? 'active' : ''" @click="checkDetection(it.id)"
v-for="(it, idx) in detectionCheckType" :key="idx">
{{ it.text }}
</div>
</div>
<div class="equipment-list-max quality-target-index">
@ -214,27 +203,9 @@
<img src="images/icon2001.png" v-if="prjs.length > 1"
style="position: absolute; cursor: pointer; right: 12px; top: 12px" @click="doShowMeasuredDlg" />
<div class="warning-info-title warning-info-title_div measured-data-list"
style="padding-left: 2px; position: relative; z-index: 9">
<div :class="measuredNav == 0 ? 'active' : ''" @click="doMeasuredNav(0, '汇总')">
汇总
</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, '其它')">
其它
style="padding-left: 12px; position: relative; z-index: 9">
<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>
<project-overview-chart :sp="'\n'" :maintitle="measuredTotal" :legend-opt="legendOptCheck" txtTop="12"
@ -400,6 +371,8 @@ export default {
],
},
prjs: [],
detectionCheckType: [],//
measureTypes:[],//
};
},
created() {
@ -429,9 +402,27 @@ export default {
},
},
}
this.legendOptCheck = {...obj};
this.materialLegendOpt = {...obj};
this.materialLegendOpt.itemWidth=50;
this.legendOptCheck = { ...obj };
this.materialLegendOpt = { ...obj };
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() {
let dt1 = this.$dt((+new Date()) - 30 * 24 * 3600 * 1000);
@ -472,7 +463,7 @@ export default {
this.$refs.msListDlg.showDialog({
deptId: this.dept?.id || 0,
projectId: this.projectInfo?.id || 0,
data:this.materialData
data: this.materialData
});
},
initMe() {
@ -489,13 +480,15 @@ export default {
deptId: this.dept?.id || 0,
projectId: this.projectInfo.id,
checkType: this.samplingNav,
data:this.chkDetection
types:this.detectionCheckType,
data: this.chkDetection
});
},
doShowMeasuredDlg() {
this.$refs.measuredDlg.showDialog({
deptId: this.dept?.id || 0,
projectId: this.projectInfo.id,
types:this.measureTypes,
measureType: this.measuredNav,
});
},

View File

@ -35,8 +35,7 @@
</i>
</div>
<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 == 1 ? 'head-nav active' : 'head-nav'" @click="doNav(1)">({{ total2}})</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>
<template v-if="dataTable.length>0">
<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,
dataTable: [],
opt:{},
total1:0,
total2:0,
types:[],
};
},
@ -195,33 +193,49 @@ export default {
handleCurrentChange(n) {
this.index = n;
this.loadData();
},
toggleNav(n) {
this.nav = n;
},
},
doNav(n){
this.nav=n;
this.index=1;
this.title="材料进场取样复试-"+['汇总','钢筋原材料','钢筋试拉件','混凝土试件','其他'][this.nav||0];
this.loadData();
},
showDialog(opt) {
this.show = true
this.nav=0;
this.nav=opt.checkType;
this.title="材料进场取样复试-"+['汇总','钢筋原材料','钢筋试拉件','混凝土试件','其他'][this.nav||0];
this.opt=opt;
this.total1=opt.data.chk1*1-opt.data.chk3*1;
this.total2=opt.data.chk3;
this.types=(opt.types||[]).map(it=>{
let obj={...it,count:0};
return obj;
});
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(){
this.$api.checkDetection.getList({
detectionResult:this.nav==0?0:1,
let optData={
...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.dataTable=(d.rows||[]).map(it=>{
it.attachmentFiles=this.$tryToJson(it.attachment,[]);
return it;
});
this.title="材料进场取样复试-"+['汇总','钢筋原材料','钢筋试拉件','混凝土试件','其他'][this.opt.checkType||0]+`[${this.dataTable.length}]`;
});
}
},

View File

@ -34,7 +34,11 @@
</svg>
</i>
</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"
:class="it.timeout ? 'time-out' : ''">
<div class="item-left">
@ -111,6 +115,10 @@
</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;">
<img src="images/nodata.png" style="width: 240px;">
<div style="text-align: center;">暂无数据</div>
@ -131,25 +139,70 @@ export default {
fontSize: 0,
title:'',
show: false,
dataTable: []
dataTable: [],
total:0,
size:10,
index:1,
nav:0,
types:[],
opt:{}
};
},
mounted() {
},
methods: {
toggleNav(n) {
handleCurrentChange(n) {
this.index = n;
this.loadData();
},
doNav(n) {
this.nav = n;
this.title="实测实量-"+['汇总','混泥土工程','二次构建','房间尺寸','抹灰工程','其它'][this.nav||0];
this.loadData();
},
showDialog(opt) {
this.show = true
this.$api.measure.getList(opt).then(d=>{
this.dataTable=(d.data||[]).map(it=>{
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.getCount();
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);
return it;
});
this.title="实测实量-"+['汇总','混泥土工程','二次构建','房间尺寸','抹灰工程','其它'][opt.checkType||0]+`[${this.dataTable.length}]`;
});
}
},
@ -229,7 +282,7 @@ export default {
background-size: 100% 100%;
display: inline-block;
width: auto;
padding: 0px 24px;
padding: 0px 32px;
}
}