Selaa lähdekoodia

工程名称 工程材质

wangzhe 11 kuukautta sitten
vanhempi
commit
f1953de2ea

+ 2 - 2
src/api/zdsz/countIndustry.js

@@ -6,7 +6,7 @@ export function materialStatistics(query) {
     // url: '/zdsz/materialStatistics/list',
     url: '/zdsz/engineeringWasteMaterial/engineeringIndustryList',
     method: 'get',
-    data: query
+    params: query
   })
 }
 export function getAreaCompletionInformationList(query) {
@@ -20,7 +20,7 @@ export function getEnginMaterialQualityList() {
   return request({
     url: '/zdsz/enginMaterialQuality/getEnginMaterialQualityList',
     method: 'get',
-    params: {enginType:'基建工程'}
+    params: {enginType:'工业工程'}
   })
 }
 export function getEnginSpecificationsList(materId) {

+ 126 - 41
src/views/zdsz/enginee/industry/industry_statistics/index.vue

@@ -34,24 +34,27 @@
                         <!--</el-option>-->
                     <!--</el-select>-->
                 <!--</el-form-item>-->
-                <el-form-item label="工程类型" prop="enginType">
-                    <el-select v-model="queryParams.enginType" placeholder="请选择工程类型" clearable
-                               @change="enginTypeHasChangeds"
-                               @clear="currentEnginTypeChangeOptions1=[];queryParams.enginClassification=undefined;queryParams.enginType=undefined">
+                <el-form-item label="工程名称" prop="enginName">
+                    <el-input v-model="queryParams.enginName" placeholder="请输入工程名称" clearable></el-input>
+                </el-form-item>
+                <!--<el-form-item label="工程类型" prop="enginType">-->
+                    <!--<el-select v-model="queryParams.enginType" placeholder="请选择工程类型" clearable-->
+                               <!--@change="enginTypeHasChangeds"-->
+                               <!--@clear="currentEnginTypeChangeOptions1=[];queryParams.enginClassification=undefined;queryParams.enginType=undefined">-->
+                        <!--&lt;!&ndash;<el-option&ndash;&gt;-->
+                            <!--&lt;!&ndash;v-for="dict in enginTypeOption"&ndash;&gt;-->
+                            <!--&lt;!&ndash;:key="dict.value"&ndash;&gt;-->
+                            <!--&lt;!&ndash;:label="dict.label"&ndash;&gt;-->
+                            <!--&lt;!&ndash;:value="dict.value"&ndash;&gt;-->
+                        <!--&lt;!&ndash;/>&ndash;&gt;-->
                         <!--<el-option-->
-                            <!--v-for="dict in enginTypeOption"-->
+                            <!--v-for="dict in dict.type.industry_engin_type"-->
                             <!--:key="dict.value"-->
                             <!--:label="dict.label"-->
                             <!--:value="dict.value"-->
                         <!--/>-->
-                        <el-option
-                            v-for="dict in dict.type.industry_engin_type"
-                            :key="dict.value"
-                            :label="dict.label"
-                            :value="dict.value"
-                        />
-                    </el-select>
-                </el-form-item>
+                    <!--</el-select>-->
+                <!--</el-form-item>-->
                 <el-form-item label="工程分类" prop="enginClassification">
                     <el-select v-model="queryParams.enginClassification" placeholder="请选择工程分类" clearable
                                @change="nodeTypeHasChangeds"
@@ -94,17 +97,17 @@
                         ></el-option>
                     </el-select>
                 </el-form-item>
-                <el-form-item label="规格" prop="realitySpecifications"label-width="45px">
-                    <el-select v-model="queryParams.realitySpecifications" filterable clearable placeholder="请选择规格"
-                    >
-                        <el-option
-                            v-for="item in EnginSpecificationsList"
-                            :key="item.id"
-                            :label="item.name"
-                            :value="item.id">
-                        </el-option>
-                    </el-select>
-                </el-form-item>
+                <!--<el-form-item label="规格" prop="realitySpecifications"label-width="45px">-->
+                    <!--<el-select v-model="queryParams.realitySpecifications" filterable clearable placeholder="请选择规格"-->
+                    <!--&gt;-->
+                        <!--<el-option-->
+                            <!--v-for="item in EnginSpecificationsList"-->
+                            <!--:key="item.id"-->
+                            <!--:label="item.name"-->
+                            <!--:value="item.id">-->
+                        <!--</el-option>-->
+                    <!--</el-select>-->
+                <!--</el-form-item>-->
                 <!--                <el-form-item label="工程周期" prop="enginCycle" label-width="80px">-->
                 <!--                  <el-select v-model="queryParams.enginCycle" filterable clearable placeholder="请选择规格"-->
                 <!--                  >-->
@@ -333,6 +336,7 @@
                     realityQuality:undefined,
                     realitySpecifications:undefined,
                     enginClassification:undefined,
+                    enginName:undefined,
                     enginType:undefined,
                     nodeType:undefined,
                     enginCycle:0
@@ -412,38 +416,119 @@
                 }
                 return longestLength;
             },
-            getList()
-            {
-// 666
+            getList(){
+                this.queryParams.enginSort = this.queryParams.enginClassification; // 工程分类
+                this.queryParams.materialStatistics = this.queryParams.realityQuality; // 工程材质
+                console.log('this.queryParams=',this.queryParams)
                 materialStatistics(this.queryParams).then(res=>{
                     this.tableData=res.data;
                     let seriesData = [];
+                    let names = [];
+                    let dataG = [];
+                    let dataGP = [];
+                    let dataPE = [];
+                    let dataPEP = [];
+
                     for (let item in res.data) {
-                        seriesData.push({
-                            name: res.data[item].realityQuality+'\n'+res.data[item].realitySpecifications,
-                            type: 'bar',
-                            stack: res.data[item].realityQuality,
-                            label:{
-                                show:true,
-                                formatter:'{a}\n{c}米'
-                            },
-                            data: [res.data[item].realitySize]
-                        },);
+                        names.push(res.data[item].enginName)
+                        dataG.push(res.data[item].actualityIron)
+                        dataGP.push(res.data[item].percentageIron.replace("%",""))
+                        dataPE.push(res.data[item].actualityPE)
+                        dataPEP.push(res.data[item].percentagePE.replace("%",""))
                     }
+                    const colors = ['#5470C6', '#91CC75', '#EE6666'];
                     let option = {
+                        color: colors,
+                        tooltip: {
+                            trigger: 'axis',
+                            axisPointer: {
+                                type: 'cross'
+                            }
+                        },
+                        grid: {
+                            left:'10%',
+                            right: '10%'
+                        },
+                        toolbox: {
+                            feature: {
+                                saveAsImage: { show: true }
+                            }
+                        },
+                        legend: {
+                            data: ['Evaporation', 'Precipitation', 'Temperature']
+                        },
                         xAxis: [
                             {
                                 type: 'category',
-                                data: ['A'],
-                                show:false,
+                                axisTick: {
+                                    alignWithLabel: true
+                                },
+                                // prettier-ignore
+                                // data: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
+                                data: names
                             }
                         ],
                         yAxis: [
                             {
-                                type: 'value'
+                                type: 'value',
+                                name: '数量',
+                                position: 'right',
+                                alignTicks: true,
+                                axisLine: {
+                                    show: true,
+                                    lineStyle: {
+                                        color: colors[0]
+                                    }
+                                },
+                                axisLabel: {
+                                    formatter: '{value}'
+                                }
+                            },
+                            {
+                                type: 'value',
+                                name: '占比',
+                                position: 'left',
+                                alignTicks: true,
+                                axisLine: {
+                                    show: true,
+                                    lineStyle: {
+                                        color: colors[2]
+                                    }
+                                },
+                                axisLabel: {
+                                    formatter: '{value} %'
+                                }
                             }
                         ],
-                        series: seriesData
+                        series: [
+                            {
+                                name: '钢材实际用料',
+                                type: 'bar',
+                                // data: [
+                                //     2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3
+                                // ]
+                                data: dataG
+                            },
+                            {
+                                name: '钢材用料占比',
+                                type: 'line',
+                                yAxisIndex: 1,
+                                // data: [
+                                //     20,10,50,60
+                                // ]
+                                data: dataGP,
+                            },
+                            {
+                                name: 'PE实际用料',
+                                type: 'bar',
+                                data: dataPE
+                            },
+                            {
+                                name: 'PE用料占比',
+                                type: 'line',
+                                yAxisIndex: 1,
+                                data: dataPEP                            }
+                        ]
                     };
 
                     var myChart = echarts.init(document.getElementById('zhuzhuangtu'));