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

View File

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