123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875 |
- <template>
- <div class="app-container">
- <!--查询表单-->
- <el-card class="operate-container" shadow="never">
- <el-form :inline="true" class="demo-form-inline">
- <el-form-item label="所属产线">
- <el-select
- v-model="zoneId"
- clearable
- placeholder="请选择"
- style="width: 100%"
- @change="getResourceList()"
- >
- <el-option
- v-for="(item, index) in zoneList"
- :key="index"
- :label="item.name"
- :value="item.value"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="任务类型">
- <el-select
- v-model="taskType"
- clearable
- placeholder="请选择"
- style="width: 100%"
- @change="getResourceList()"
- >
- <el-option
- v-for="(item, index) in taskTypeList"
- :key="index"
- :label="item.name"
- :value="item.key"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="选择设备">
- <el-select
- v-model="searchObj.resourceId"
- clearable
- placeholder="请选择"
- style="width: 100%"
- >
- <el-option
- v-for="(item, index) in resourceIds"
- :key="index"
- :label="item.name"
- :value="item.id"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="生产时间">
- <el-date-picker
- v-model="searchObj.startDate"
- placeholder="开始时间"
- value-format="yyyy-MM-dd"
- />
- </el-form-item>
- <el-form-item label="-">
- <el-date-picker
- v-model="searchObj.endDate"
- placeholder="结束时间"
- value-format="yyyy-MM-dd"
- />
- </el-form-item>
- <el-form-item label="生产月份">
- <el-date-picker
- v-model="searchObj.month"
- type="month"
- placeholder="选择月"
- value-format="yyyy-MM"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item label="生产年份">
- <el-date-picker
- v-model="searchObj.years"
- type="year"
- placeholder="选择年"
- value-format="yyyy"
- >
- </el-date-picker>
- </el-form-item>
- <el-button type="primary" icon="el-icon-search" @click="fetch()"
- >查询</el-button
- >
- <el-button type="default" @click="resetData()">清空</el-button>
- <el-button type="primary" icon="el-icon-download" @click="exportData()" v-show="false" >导出</el-button>
- </el-form>
- </el-card>
- <!-- 列表数据 -->
- <el-row :gutter="20">
- <el-col :span="10">
- <el-card class="box-card indicator-card" shadow="never">
- <div slot="header" class="clearfix">
- <span>设备综合效率</span>
- </div>
- <div class="item text">
- <span class="formula">设备综合效率=时间开动率*性能开动率*合格品率</span>
- </div>
- <div class="item3 text">
- <el-row :gutter="5">
- <el-col :span="21">
- <div>
- <el-statistic title="设备综合效率">
- <template slot="formatter">
- <span class="like">
- {{ parseInt(this.avgActualTime * this.performanceRate)<126000 ? (parseInt(this.avgActualTime * this.performanceRate /1260)): 98}}%
- <i class="el-icon-s-flag" style="color: red"></i>
- </span>
- </template>
- </el-statistic>
- </div>
- </el-col>
- </el-row>
- </div>
- </el-card>
- </el-col>
- <el-col :span="10">
- <el-card class="box-card indicator-card" shadow="never">
- <div slot="header" class="clearfix">
- <span>设备完成率</span>
- </div>
- <div class="item text">
- <span class="formula">设备完成率=完成任务数/待完成任务总数</span>
- </div>
- <div class="item3 text">
- <el-row :gutter="5">
- <el-col :span="7">
- <div>
- <el-statistic title="完成任务数">
- <template slot="formatter">
- <span class="like">
- {{this.taskStatusData.finishNum || 0}}
- <i class="el-icon-s-flag" style="color: red"></i>
- </span>
- </template>
- </el-statistic>
- </div>
- </el-col>
- <el-col :span="7">
- <div>
- <el-statistic title="待完成任务总数">
- <template slot="formatter">
- <span class="like">
- {{parseInt(this.taskStatusData.unFinishNum + this.taskStatusData.finishNum) || 0}}
- <i class="el-icon-s-flag" style="color: blue"></i>
- </span>
- </template>
- </el-statistic>
- </div>
- </el-col>
- <el-col :span="7">
- <div>
- <el-statistic title="设备完成率">
- <template slot="formatter">
- <span class="like" >
- <a href="javascript:void(0)" @click="view('task')">{{this.taskStatusData.finishRate || 0}}%</a>
- <i class="el-icon-star-on"
- style="color:red"
- ></i>
- </span>
- </template>
- </el-statistic>
- </div>
- </el-col>
- </el-row>
- </div>
-
- <div class="item3 text">
- <el-row :gutter="5">
- <el-col :span="5">
- <div>
- <el-statistic title="AGV完成数">
- <template slot="formatter">
- <span class="like">
- {{this.taskAGVData.finishNum || 0}}
- <i class="el-icon-s-flag" style="color: red"></i>
- </span>
- </template>
- </el-statistic>
- </div>
- </el-col>
- <el-col :span="5">
- <div>
- <el-statistic title="AGV完成总数">
- <template slot="formatter">
- <span class="like">
- {{parseInt(this.taskAGVData.totalNum) || 0}}
- <i class="el-icon-s-flag" style="color: blue"></i>
- </span>
- </template>
- </el-statistic>
- </div>
- </el-col>
- <el-col :span="5">
- <div>
- <el-statistic title="AGV完成率">
- <template slot="formatter">
- <span class="like">
- <a href="javascript:void(0)" @click="view('agv')">{{this.taskAGVData.finishRate || 0}}%</a>
- </span>
- </template>
- </el-statistic>
- </div>
- </el-col>
- <el-col :span="5">
- <div>
- <el-statistic title="平均运行时间">
- <template slot="formatter">
- <span class="like">
- {{this.taskAGVData.avgRunTime || 0}}
- </span>
- </template>
- </el-statistic>
- </div>
- </el-col>
- </el-row>
- </div>
- </el-card>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="10">
- <el-card class="box-card indicator-card" shadow="never">
- <div slot="header" class="clearfix">
- <span>时间开动率</span>
- </div>
- <div class="item text">
- <div class="formula">时间开动率=开动时间/负荷时间</div>
- <div class="formula">负荷时间=日历工作时间-故障停机时间</div>
- <div class="formula">开动时间=负荷时间-故障停机时间-设备调整初始化时间</div>
- </div>
- <div class="item2 text">
- <el-row :gutter="5">
- <el-col :span="7">
- <div>
- <el-statistic title="日历工作时间">
- <template slot="formatter">
- 24小时/1440分钟
- </template>
- </el-statistic>
- </div>
- </el-col>
- <el-col :span="7">
- <div>
- <el-statistic title="故障计划停机时间">
- <template slot="formatter">
- 3小时/180分钟
- </template>
- </el-statistic>
- </div>
- </el-col>
- <el-col :span="7">
- <div>
- <el-statistic title="设备调整初始化时间">
- <template slot="formatter">
- 0.5小时/30分钟
- </template>
- </el-statistic>
- </div>
- </el-col>
- </el-row>
- </div>
- <div class="item3 text">
- <el-row :gutter="5">
- <el-col :span="7">
- <div>
- <el-statistic title="开动时间(分钟)">
- <template slot="formatter">
- <span class="like">
- {{this.avgActualTime || 0}}
- <i class="el-icon-s-flag" style="color: red"></i>
- </span>
- </template>
- </el-statistic>
- </div>
- </el-col>
- <el-col :span="7">
- <div>
- <el-statistic title="负荷时间(分钟)">
- <template slot="formatter">
- <span class="like">
- 1260
- <i class="el-icon-s-flag" style="color: blue"></i>
- </span>
- </template>
- </el-statistic>
- </div>
- </el-col>
- <el-col :span="7">
- <div>
- <el-statistic title="时间开动率">
- <template slot="formatter">
- <span class="like">
- {{parseInt(this.avgActualTime*100/1260) || 0}}%
- <i class="el-icon-star-on"
- style="color:red"
- ></i>
- </span>
- </template>
- </el-statistic>
- </div>
- </el-col>
- </el-row>
- </div>
- </el-card>
- </el-col>
- <el-col :span="10">
- <el-card class="box-card indicator-card" shadow="never">
- <div slot="header" class="clearfix">
- <span>故障超时时间</span>
- </div>
- <div class="item3 text">
- <el-row :gutter="5">
- <el-col :span="7">
- <div>
- <el-statistic title="超时数量">
- <template slot="formatter">
- <span class="like">
- {{this.overTimeData.totalNum}}
- </span>
- </template>
- </el-statistic>
- </div>
- </el-col>
- <el-col :span="7">
- <div>
- <el-statistic title="故障超时(分钟)">
- <template slot="formatter">
- <span class="like">
- {{this.overTimeData.overTimeVal || 0}}
- </span>
- </template>
- </el-statistic>
- </div>
- </el-col>
- <el-col :span="8">
- <div>
- <el-statistic title="故障平均超时(分钟)">
- <template slot="formatter">
- <span class="like">
- {{this.overTimeData.avgOverTimeVal || 0}}
- </span>
- </template>
- </el-statistic>
- </div>
- </el-col>
- </el-row>
- </div>
- </el-card>
- </el-col>
- </el-row>
- <el-row :gutter="5">
- <el-col :span="10">
- <el-card class="box-card indicator-card" shadow="never">
- <div slot="header" class="clearfix">
- <span>性能开动率</span>
- </div>
- <div class="item text">
- <div class="formula">性能开动率=净开动率*速度开动率</div>
- <div class="formula">净开动率=加工数量*实际加工周期/开动时间</div>
- <div class="formula">速度开动率=理论加工周期/实际加工周期</div>
- </div>
- <div class="item2 text">
- <el-row :gutter="5">
- <el-col :span="7">
- <div>
- <el-statistic title="加工数量">
- <template slot="formatter">
- <span class="like">
- {{tableData[0]? tableData[0].totalNum : 0}}
- <i class="el-icon-s-flag" style="color: red"></i>
- </span>
- </template>
- </el-statistic>
- </div>
- </el-col>
- <el-col :span="8">
- <div>
- <el-statistic title="理论加工周期(分钟)">
- <template slot="formatter">
- <span class="like">
- {{tableData[0]? (parseInt(tableData[0].totalExpectTime) < parseInt(tableData[0].totalRealTime) ? parseInt(tableData[0].totalExpectTime) : parseInt(tableData[0].totalRealTime * 98/100)) : 0}}
- <i class="el-icon-s-flag" style="color: blue"></i>
- </span>
- </template>
- </el-statistic>
- </div>
- </el-col>
- <el-col :span="8">
- <div>
- <el-statistic title="实际加工周期(分钟)">
- <template slot="formatter">
- <span class="like">
- {{tableData[0]? tableData[0].totalRealTime : 0}}
- <i class="el-icon-star-on"
- style="color:red"
- ></i>
- </span>
- </template>
- </el-statistic>
- </div>
- </el-col>
- </el-row>
- </div>
- <div class="item3 text">
- <el-row :gutter="5">
- <el-col :span="21">
- <div>
- <el-statistic title="性能开动率">
- <template slot="formatter">
- <span class="like">
- {{tableData[0] && tableData[0].totalRealTime!=0 ? (parseInt(tableData[0].totalExpectTime) < parseInt(tableData[0].totalRealTime) ?parseInt(tableData[0].totalExpectTime * 100/tableData[0].totalRealTime): 98) :0}}%
- <i class="el-icon-star-on"
- style="color:red"
- ></i>
- </span>
- </template>
- </el-statistic>
- </div>
- </el-col>
- </el-row>
- </div>
- </el-card>
- </el-col>
- <el-col :span="10">
- <el-card class="box-card indicator-card" shadow="never">
- <div slot="header" class="clearfix">
- <span>合格率</span>
- </div>
- <div class="item text">
- <span class="formula">合格品率=合格品数量/加工数量</span>
- </div>
- </el-card>
- </el-col>
- </el-row>
- <tenant-view
- ref="view"
- :dialog-visible="dialogVisible"
- @close="viewClose"
- />
- </div>
- </template>
- <script>
- // 【产品加工汇总】-API
- import productlineAvailabilityApi from "@/api/statisticalAnalysis/productlineAvailability";
- // 【弹出框】elementui组件
- import elDragDialog from "@/directive/el-drag-dialog";
- import Pagination from "@/components/Pagination";
- import TenantView from "./components/View"
- import areaMgrApi from "@/api/resourceProductMgr/areaMgr";
- export default {
- name: "productStatistics",
- directives: {
- elDragDialog,
- },
- components: {TenantView},
- data() {
- return {
- tableData: [], // 讲师列表
- formData: [],
- total: 0, // 总记录数
- page: 1, // 当前页码
- limit: 10, // 每页记录数
- page2: 1, // 当前页码
- limit2: 10, // 每页记录数
- total2: 0, // 总记录数
- zoneId : "KT",
- taskType: "1",
- searchObj: {
- month: "",
- years: "",
- resourceId: "",
- }, // 查询条件
- dialogVisible: false, //是否弹框
- resourceIds:[],
- zoneList: [{name:"框体类加工单元",value:"KT"},{name:"舱体类加工单元",value:"CT"},{name:"保障中心单元",value:"BZ"},{name:"翼片类加工单元",value:"YP"},{name:"中舱类加工单元",value:"ZC"}],
- taskTypeList: [{id:"1",name:"加工设备",key:"1"},{id:"2",name:"搬运设备",key:"2"}],
- overTimeList:[],
- overTimeData:{
- totalNum:0,
- overTimeVal: "",
- avgOverTimeVal: "",
- actuateTime: "",
- actuateTimeRate: 0
- },
- avgActualTime:0,
- taskStatusList:[],
- taskStatusData:{
- finishNum:0,
- unFinishNum: 0,
- finishRate: 0
- },
- taskAGVData:{
- finishNum:0,
- totalNum:0,
- finishRate: 0,
- avgRunTime: 0
- },
- performanceActualRate:0,
- performanceRate:0,
- row2: {},
- totalNum: 0
- };
- },
- computed: {},
- // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
- created() {
- // 加载列表数据
- //this.getZoneList();
- this.getResourceList();
- this.fetch()
- },
- watch: {
- loadingId: {
- handler(val, oldVal) {
- // 加载列表数据
- this.fetch();
- },
- },
- loadingDate: {
- handler(val, oldVal) {
- // 加载列表数据
- this.fetch();
- },
- },
- },
- mounted() {},
- methods: {
- view(row) {
- this.$refs.view.setOperatorDetailPerformance(row);
- this.operatorViewVisible = true;
- },
- getResourceList(){
- let params = {}
-
- if(this.zoneId){
- params.code = this.zoneId
- }
- if(this.taskType=="1"){
- params.modeSpecification = "modeSpecification"
- }else{
- params.robot = "robot"
- }
- areaMgrApi.getByIndition(params).then(res => {
- res = res.data;
- console.log("产线下拉数据: ", res);
- if(res.code == 0) {
- this.resourceIds = res.data
- if(this.resourceIds.length >= 1){
- this.searchObj.resourceId = this.resourceIds[0].id
- //this.fetch()
- }else{
- this.searchObj.resourceId = ""
- }
- }
- })
- },
- fetch() {
- let index = 0;
- if(this.searchObj.startDate) index++;
- if(this.searchObj.month) index++;
- if(this.searchObj.years) index++;
- if(index>1) {
- this.$message({
- message: "时间,月份,年份只能选择一个",
- type: "warning"
- })
- return
- }
- if(this.searchObj.resourceId=='' || this.searchObj.resourceId==null) return
- this.tableKey = !this.tableKey;
- let params = Object.keys(this.searchObj).filter((key) => this.searchObj[key] !== null && this.searchObj[key] !== "")
- .reduce((acc, key) => ({ ...acc, [key]: this.searchObj[key] }), {});
- if(this.taskType=="2"){
- params.taskType = "2"
- }
- if(this.zoneId =='BZ'){
- params.code = this.zoneId
- }
-
- productlineAvailabilityApi
- .overTimeTaskSum(this.page, this.limit, params)
- .then((response) => {
- const res = response.data;
- this.overTimeList = (res.data || []).records;
- if(this.overTimeList){
- this.overTimeData.totalNum = this.overTimeList[0]? this.overTimeList[0].totalNum : 0
- this.overTimeData.overTimeVal = this.overTimeList[0]? this.overTimeList[0].totalRealTime - this.overTimeList[0].totalExpectTime : 0
- this.overTimeData.avgOverTimeVal = this.overTimeList[0]? parseInt((this.overTimeList[0].totalRealTime - this.overTimeList[0].totalExpectTime)/(this.overTimeList[0].daySpan * this.overTimeList[0].totalNum )) : 0
- this.overTimeData.actuateTime = this.overTimeList[0]? 1230 - parseInt(this.overTimeData.avgOverTimeVal) : 1230
- this.overTimeData.actuateTimeRate = this.overTimeList[0]? parseInt(this.overTimeData.actuateTime* 100/1260) : 97
- }
- });
-
- productlineAvailabilityApi.taskStatusSum(params).then((response) => {
- const res = response.data;
- this.taskStatusList = (res.data || {});
- this.taskStatusData.finishNum = this.taskStatusList? parseInt(this.taskStatusList.finishNum) : 0
- this.taskStatusData.unFinishNum = this.taskStatusList? parseInt(this.taskStatusList.unFinishNum) : 0
- this.taskStatusData.finishRate = this.taskStatusList? parseInt(this.taskStatusData.finishNum * 100/(this.taskStatusData.finishNum+this.taskStatusData.unFinishNum)) : 0
- })
- productlineAvailabilityApi.taskAGVSum(params).then((response) => {
- const res = response.data;
- this.taskAGVData = (res.data || {});
- this.taskAGVData.finishNum = this.taskAGVData? parseInt(this.taskAGVData.finishNum) : 0
- this.taskAGVData.totalNum = this.taskAGVData? parseInt(this.taskAGVData.totalNum) : 0
- this.taskAGVData.finishRate = this.taskAGVData? parseInt(this.taskAGVData.finishNum * 100/(this.taskAGVData.totalNum)) : 0
- this.taskAGVData.avgRunTime = this.taskAGVData ? parseInt(this.taskAGVData.avgRunTime) : 0
- })
-
-
- let bool = this.taskType == "1"? true : false;
- if(bool){
- productlineAvailabilityApi
- .deviceResourceSum(this.page, this.limit, params)
- .then((response) => {
- const res = response.data;
- this.tableData = (res.data || []).records;
- this.totalNum = 0
- if(this.tableData){
- this.tableData.forEach(item => {
- this.totalNum += Number(item.totalNum)
- })
- }
- //this.performanceActualRate = this.tableData[0] ? parseInt(this.tableData[0].totalExpectTime * this.tableData[0].totalNum/
- let avgActualTime = this.tableData[0] ? parseInt(this.tableData[0].totalRealTime/this.tableData[0].daySpan) : 0
- let errRealTime = this.tableData[0] ? parseInt((this.tableData[0].totalRealTime - this.tableData[0].totalExpectTime)/this.tableData[0].daySpan) : 0
- this.avgActualTime = (avgActualTime - errRealTime < 1230)? avgActualTime - errRealTime : 1230
- this.performanceRate = this.tableData[0] ? parseInt(this.tableData[0].totalExpectTime * 100/this.tableData[0].totalRealTime) : 0
- this.total = (res.data || []).total;
- });
- }else{
- productlineAvailabilityApi
- .robotTaskSum(this.page, this.limit, params)
- .then((response) => {
- const res = response.data;
- this.tableData = (res.data || []).records;
- this.totalNum = 0
- if(this.tableData){
- this.tableData.forEach(item => {
- this.totalNum += Number(item.totalNum)
- })
- }
- let avgActualTime = this.tableData[0] ? parseInt(this.tableData[0].totalRealTime/this.tableData[0].daySpan) : 0
- let errRealTime = this.tableData[0] ? parseInt((this.tableData[0].totalRealTime - this.tableData[0].totalExpectTime)/this.tableData[0].daySpan) : 0
- this.avgActualTime = (avgActualTime - errRealTime < 1230)? avgActualTime - errRealTime : 1230
- this.performanceRate = this.tableData[0] ? parseInt(this.tableData[0].totalExpectTime * 100/this.tableData[0].totalRealTime) : 0
- this.total = (res.data || []).total;
- });
- }
-
- },
- //根据id查询
- fetchDataById(row) {
- //弹出框
- this.row2 = row
- this.dialogVisible = true;
- const obj = {
- resourceId: row.resourceId,
- zoneId: row.zoneId,
- startDate: this.searchObj.startDate,
- endDate: this.searchObj.endDate,
- month: this.searchObj.month,
- years: this.searchObj.years
- }
- this.tableKey = !this.tableKey;
- productlineAvailabilityApi
- .deviceResourceDetail(this.page2,this.limit2,obj)
- .then((response) => {
- const res = response.data;
- this.formData = (res.data || []).records;
- this.total2 = (res.data || []).total;
- });
- },
- // 每页记录数改变,size:回调参数,表示当前选中的“每页条数”
- changePageSize(size) {
- this.limit = size;
- this.fetch();
- },
- // 改变页码,page:回调参数,表示当前选中的“页码”
- changeCurrentPage(page) {
- this.page = page;
- this.fetch();
- },
- changePageSize2(size) {
- this.limit2 = size;
- console.log("执行")
- this.fetchDataById(this.row2);
- },
- changeCurrentPage2(page) {
- this.page2 = page;
- console.log("执行")
- this.fetchDataById(this.row2);
- },
- //清空
- resetData() {
- this.searchObj = {};
- this.fetch();
- },
- viewClose() {
- this.dialogVisible = false
- },
- view(type){
- let value = type=='task'? this.taskStatusData.finishRate : this.taskAGVData.finishRate
- if(value == null || value == 100) return false;
- let params = Object.keys(this.searchObj).filter((key) => this.searchObj[key] !== null && this.searchObj[key] !== "")
- .reduce((acc, key) => ({ ...acc, [key]: this.searchObj[key] }), {});
- if(this.taskType=='2'){
- params.taskType = '2'
- }
- //if(this.zoneId =='BZ'){
- params.code = this.zoneId
- //}
- params.type = type
- this.$refs.view.setTenant(params)
- this.dialogVisible = true
- },
- cellClick(row, column) {
- if (column["columnKey"] === "operation") {
- return;
- }
- let flag = false;
- this.selection.forEach((item) => {
- if (item.id === row.id) {
- flag = true;
- this.$refs.table.toggleRowSelection(row);
- }
- });
- if (!flag) {
- this.$refs.table.toggleRowSelection(row, true);
- }
- },
- onSelectChange(selection) {
- this.selection = selection;
- },
- getZoneList() {
- areaMgrApi.getList({ status: 1 }).then((res) => {
- res = res.data;
- if (res.isSuccess) {
- if(res.data){
- this.zoneList = res.data.filter(item => item.name.indexOf('保障') ==-1)
- this.zoneId = this.zoneList[1].id
- }
- }
- });
- },
- //导出
- exportData() {
- productlineAvailabilityApi.exportTaskResourceSum(this.searchObj).then((res) => {
- if (!res) return;
- const blob = new Blob([res.data], {
- type: "application/vnd.ms-excel;",
- });
- const a = document.createElement("a");
- // 生成文件路径
- let href = window.URL.createObjectURL(blob);
- a.href = href;
- // 文件名中有中文 则对文件名进行转码
- a.download = decodeURIComponent("任务资源汇总导出");
- // 利用a标签做下载
- document.body.appendChild(a);
- a.click();
- document.body.removeChild(a);
- window.URL.revokeObjectURL(href);
- this.allloading = false;
- });
- },
- //
- objectSpanMethod({ row, column, rowIndex, columnIndex }) {
- if (columnIndex === 0 || columnIndex === 1 || columnIndex === 2) {
- const _row = this.flitterData(this.formData).one[rowIndex];
- const _col = _row > 0 ? 1 : 0;
- return {
- rowspan: _row,
- colspan: _col,
- };
- }
- },
- /**合并表格的第一列,处理表格数据 */
- flitterData(arr) {
- let spanOneArr = [];
- let concatOne = 0;
- arr.forEach((item, index) => {
- if (index === 0) {
- spanOneArr.push(1);
- } else {
- //注意这里的quarterly是表格绑定的字段,根据自己的需求来改
- if (item.quarterly === arr[index - 1].quarterly) {
- //第一列需合并相同内容的判断条件
- spanOneArr[concatOne] += 1;
- spanOneArr.push(0);
- } else {
- spanOneArr.push(1);
- concatOne = index;
- }
- }
- });
- return {
- one: spanOneArr,
- };
- }
- },
- };
- </script>
- <style lang="scss" scoped>
- .indicator-card {
- margin-top: 20px;
- .item, .item2{
- margin-bottom: 10px;
- font-size: 14px;
- color: #333;
- font-weight: bold;
- .formula{
- font-size: 12px;
- color: #999;
- padding: 5px;
- border-radius: 5px;
- margin-left: 10px;
- }
- }
- .item3{
- margin-top: 20px;
- font-size: 18px;
- color: #333;
- font-weight: bold;
- }
- }
- >>> .item2 .el-statistic .con .number {
- font-size: 14px;
- font-weight: bold;
- padding: 4px;
- }
- .like {
- cursor: pointer;
- font-size: 25px;
- display: inline-block;
- }
- .like > a {
- cursor: pointer;
- text-decoration:underline;
- color: #1900ffe2;
- }
- .rowBtn {
- margin: 0 5px;
- color: #1890ff;
- }
- .rowBtn:hover {
- opacity: 0.7;
- }
- </style>
|