fix: 中建四局(沙湖)BUG修改

This commit is contained in:
kun 2024-02-23 17:22:02 +08:00
parent bf6c920ff2
commit c1e84751e3
2 changed files with 77 additions and 56 deletions

View File

@ -4,12 +4,29 @@
<div class="person">
<div class="typeName">材料类别</div>
<div>
<el-select v-model="typeId" placeholder="请选择" @change="checkTypes" style="background: transparent; width: 120px">
<el-option v-for="item in typesList" :key="item.id" :label="item.name" :value="item.id"> </el-option>
<el-select
v-model="typeId"
placeholder="请选择"
@change="checkTypes"
style="background: transparent; width: 120px"
>
<el-option
v-for="item in typesList"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</div>
<div style="margin-left: 20px" class="curs">
<el-date-picker v-model="checkDate" type="month" value-format="yyyy-MM" placeholder="选择月" @change="timeChange">
<el-date-picker
v-model="checkDate"
type="month"
value-format="yyyy-MM"
placeholder="选择月"
@change="timeChange"
>
</el-date-picker>
</div>
</div>
@ -36,84 +53,87 @@
</template>
<script>
import bus from '@/util/eventBus.js'
import Card from '../components/Card.vue'
import bus from "@/util/eventBus.js";
import Card from "../components/Card.vue";
import {
getMaterialTypeApi, //
getDetailsStatisticsApi //
} from '@/assets/js/api/zhongjianFourth.js'
getDetailsStatisticsApi, //
} from "@/assets/js/api/zhongjianFourth.js";
import moment from "moment";
export default {
components: { Card },
data() {
return {
messageList: {},
sn: '',
sn: "",
typesList: [],
dateList: [],
typeValue: '',
checkDate: '',
typeId: ''
}
typeValue: "",
checkDate: "",
typeId: "",
};
},
mounted() {
bus.$on('selectRightTypeId', typeId => {
this.typeId = typeId
this.getData()
})
bus.$on('timeYear', yearTime => {
this.checkDate = yearTime
this.getData()
})
this.getList()
bus.$on("selectRightTypeId", (typeId) => {
this.typeId = typeId;
this.getData();
});
bus.$on("timeYear", (yearTime) => {
this.checkDate = yearTime;
this.getData();
});
this.getList();
},
methods: {
//
timeChange(val) {
bus.$emit('timeMoth', val)
this.getData()
bus.$emit("timeMoth", val);
this.getData();
},
//
checkTypes(val) {
bus.$emit('selectLeftTypeId', val)
this.getData()
bus.$emit("selectLeftTypeId", val);
this.getData();
},
//
getList() {
this.sn = this.$store.state.projectSn
getMaterialTypeApi({ projectSn: this.sn }).then(res => {
this.typesList = res.result
this.sn = this.$store.state.projectSn;
getMaterialTypeApi({ projectSn: this.sn }).then((res) => {
this.typesList = res.result;
if (res.result.length >= 1) {
if (COMPANY == 'pssh') {
this.typeId = res.result[0].id
if (COMPANY == "pssh") {
this.typeId = res.result[0].id;
} else {
res.result.forEach(element => {
if (element.name === '混凝土(m³)') {
this.typeId = element.id
res.result.forEach((element) => {
if (element.name === "幕墙(㎡)") {
this.typeId = element.id;
}
})
});
}
this.checkDate = '2023-01'
this.getData()
const currentDate = new Date(); //
// 11
currentDate.setMonth(0);
this.checkDate = moment(currentDate).format("YYYY-MM");
this.getData();
}
console.log('查询材料类别', res)
})
console.log("查询材料类别", res);
});
},
//
getData() {
getDetailsStatisticsApi({
date: this.checkDate,
typeId: this.typeId
}).then(res => {
console.log('查询年月', res)
this.dateList = res.result
this.messageList = res.result
})
}
}
}
typeId: this.typeId,
}).then((res) => {
console.log("查询年月", res);
this.dateList = res.result;
this.messageList = res.result;
});
},
},
};
</script>
<style lang="less" scoped>
@ -232,7 +252,7 @@ export default {
}
.blueline::after {
position: absolute;
content: '';
content: "";
width: 30px;
height: 2px;
border-radius: 10%;
@ -283,7 +303,7 @@ export default {
.photovoltaicOne {
width: 180px;
height: 130px;
background-image: url('../assets/images/carbon/kwh1.png');
background-image: url("../assets/images/carbon/kwh1.png");
background-repeat: no-repeat;
background-size: 100% 100%;
text-align: center;
@ -291,7 +311,7 @@ export default {
.photovoltaicTwo {
width: 180px;
height: 130px;
background-image: url('../assets/images/carbon/kwh2.png');
background-image: url("../assets/images/carbon/kwh2.png");
background-repeat: no-repeat;
background-size: 100% 100%;
margin-left: 100px;
@ -301,7 +321,7 @@ export default {
margin-top: 40px;
width: 180px;
height: 130px;
background-image: url('../assets/images/carbon/kwh4.png');
background-image: url("../assets/images/carbon/kwh4.png");
background-repeat: no-repeat;
background-size: 100% 100%;
text-align: center;
@ -310,7 +330,7 @@ export default {
margin-top: 40px;
width: 180px;
height: 130px;
background-image: url('../assets/images/carbon/kwh3.png');
background-image: url("../assets/images/carbon/kwh3.png");
background-repeat: no-repeat;
background-size: 100% 100%;
margin-left: 100px;

View File

@ -61,7 +61,7 @@ import {
import {
getMaterialTypeApi //
} from '@/assets/js/api/zhongjianFourth.js'
import moment from "moment";
export default {
components: {
Card
@ -379,12 +379,13 @@ export default {
this.typeId = res.result[0].id
} else {
res.result.forEach(element => {
if (element.name === '混凝土(m³)') {
if (element.name === '幕墙(㎡)') {
this.typeId = element.id
}
})
}
this.checkDate = '2023'
const currentDate = new Date(); //
this.checkDate = moment(currentDate).format("YYYY");
this.getgetPassConsumeRatioList()
this.isblock = true
}