Commit fdfe300a authored by 谭俊忻's avatar 谭俊忻

fix: 完成报工统计分析表完成修改

parent 33bfff04
...@@ -21,47 +21,47 @@ export function getListByProcess(query) { ...@@ -21,47 +21,47 @@ export function getListByProcess(query) {
// 生产报工记录:统计方式用户 // 生产报工记录:统计方式用户
export function getListByUser(query) { export function getListByUser(query) {
return request({ return request({
url: '/report/pro/feedback/getListByUser', url: '/report/pro/feedback/getListByUser',
method: "get", method: "get",
params: query params: query
}); });
} }
// 生产报工记录:统计方式车间 // 生产报工记录:统计方式车间
export function getListByWorkshop(query) { export function getListByWorkshop(query) {
return request({ return request({
url: '/report/pro/feedback/getListByWorkshop', url: '/report/pro/feedback/getListByWorkshop',
method: "get", method: "get",
params: query params: query
}); });
} }
// 生产报工记录:统计方式工单 // 生产报工记录:统计方式工单
export function getListByWorkOrder(query) { export function getListByWorkOrder(query) {
return request({ return request({
url: '/report/pro/feedback/getListByWorkOrder', url: '/report/pro/feedback/getListByWorkOrder',
method: "get", method: "get",
params: query params: query
}); });
} }
// 生产报工记录:统计方式工作中心 // 生产报工记录:统计方式工作中心
export function getListByWorkstation(query) { export function getListByWorkstation(query) {
return request({ return request({
url: '/report/pro/feedback/getListByWorkstation', url: '/report/pro/feedback/getListByWorkstation',
method: "get", method: "get",
params: query params: query
}); });
} }
// 生产报工记录:统计方式工作单元 // 生产报工记录:统计方式工作单元
export function getListByWorkunit(query) { export function getListByWorkunit(query) {
return request({ return request({
url: '/report/pro/feedback/getListByWorkunit', url: '/report/pro/feedback/getListByWorkunit',
method: "get", method: "get",
params: query params: query
}); });
} }
// 生产报工记录:统计方式不合格原因 // 生产报工记录:统计方式不合格原因
export function getListByDefect(query) { export function getListByDefect(query) {
...@@ -70,4 +70,40 @@ export function getListByDefect(query) { ...@@ -70,4 +70,40 @@ export function getListByDefect(query) {
method: "get", method: "get",
params: query params: query
}); });
} }
\ No newline at end of file
// 生产报工报表:计划达成率统计表
export function getAchievementRateApi(query) {
return request({
url: '/report/pro/feedback/getAchievementRate',
method: "get",
params: query
});
}
// 生产报工报表:效率统计表
export function getEfficiencyRateApi(query) {
return request({
url: '/report/pro/feedback/getEfficiencyRate',
method: "get",
params: query
});
}
// 生产报工报表:产品不良分析统计表
export function getFeedDefRateApi(query) {
return request({
url: '/report/pro/feedback/getFeedDefRate',
method: "get",
params: query
});
}
// 生产报工报表:生产力统计表
export function getProductivityRateApi(query) {
return request({
url: '/report/pro/feedback/getProductivityRate',
method: "get",
params: query
});
}
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
</el-row> </el-row>
<el-table v-loading="loading" :max-height="tableHeight" :data="tbodys"> <el-table v-loading="loading" :max-height="tableHeight" :data="tbodys">
<el-table-column :label="item.label" align="center" :prop="item.value" :width="item.width" <el-table-column :label="item.label" align="center" :prop="item.value" :width="item.width"
v-for="(item, index) in theaders" :key="index"> :min-width="item.minWidth" v-for="(item, index) in theaders" :key="index">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="item.value == 'operationType'">{{ operationTypeData[scope.row[item.value]] }}</span> <span v-if="item.value == 'operationType'">{{ operationTypeData[scope.row[item.value]] }}</span>
<span v-else>{{ scope.row[item.value] }}</span> <span v-else>{{ scope.row[item.value] }}</span>
...@@ -60,8 +60,8 @@ ...@@ -60,8 +60,8 @@
</el-col> --> </el-col> -->
</el-row> </el-row>
<el-table v-loading="loading" :max-height="tableHeight" :data="tbodys1"> <el-table v-loading="loading" :max-height="tableHeight" :data="tbodys1">
<el-table-column :label="item.label" align="center" :prop="item.value" :width="item.width" v-for="(item, index) in theaders1" <el-table-column :label="item.label" align="center" :prop="item.value" :width="item.width"
:key="index"> :min-width="item.minWidth" v-for="(item, index) in theaders1" :key="index">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="item.value == 'warning10' || item.value == 'warning30'">{{ scope.row[item.value] ? '是' : '否' <span v-if="item.value == 'warning10' || item.value == 'warning30'">{{ scope.row[item.value] ? '是' : '否'
}}</span> }}</span>
...@@ -189,23 +189,23 @@ export default { ...@@ -189,23 +189,23 @@ export default {
let api = getListApi let api = getListApi
if (Number(this.tabIndex) === 0) { if (Number(this.tabIndex) === 0) {
this.theaders = [ this.theaders = [
{ label: '物料编码', value: 'sapItemCode', width: '200px' }, { label: '物料编码', value: 'sapItemCode', minWidth: '200px' },
{ label: '刀模SN', value: 'toolCode', width: '150px' }, { label: '刀模SN', value: 'toolCode', minWidth: '120px' },
{ label: '履历状态', value: 'operationType', width: '120px' }, { label: '履历状态', value: 'operationType', width: '120px' },
{ label: '关联单据类型', value: 'orderType', width: '120px' }, { label: '关联单据类型', value: 'orderType', width: '120px' },
{ label: '增减寿命值(次)', value: 'quantityDifference', width: '140px' }, { label: '增减寿命值(次)', value: 'quantityDifference', width: '140px' },
{ label: '剩余次数', value: 'lifeTime', width: '80px' }, { label: '剩余次数', value: 'lifeTime', width: '80px' },
{ label: '所在位置', value: 'location', width: '100px' }, { label: '所在位置', value: 'location', width: '100px' },
{ label: '操作人', value: 'createBy', width: '120px' }, { label: '操作人', value: 'createBy', width: '120px' },
{ label: '操作时间', value: 'createTime', width: '160px' }, { label: '操作时间', value: 'createTime', width: '180px' },
] ]
} }
if (Number(this.tabIndex) === 1) { if (Number(this.tabIndex) === 1) {
if (this.statisisType === '物料维保预警统计') { if (this.statisisType === '物料维保预警统计') {
api = getMaterialMaintenanceListApi api = getMaterialMaintenanceListApi
this.theaders1 = [ this.theaders1 = [
{ label: '物料编码', value: 'sapItemCode', width: '200px' }, { label: '物料编码', value: 'sapItemCode', minWidth: '200px' },
{ label: '物料名称', value: 'itemName', width: '200px' }, { label: '物料名称', value: 'itemName', minWidth: '200px' },
{ label: 'SN数量', value: 'sum', width: '100px' }, { label: 'SN数量', value: 'sum', width: '100px' },
{ label: '寿命低于30%数量', value: 'warning30Sum', width: '140px' }, { label: '寿命低于30%数量', value: 'warning30Sum', width: '140px' },
{ label: '寿命低于30%占比', value: 'warning30Proportion', width: '140px' }, { label: '寿命低于30%占比', value: 'warning30Proportion', width: '140px' },
...@@ -234,7 +234,7 @@ export default { ...@@ -234,7 +234,7 @@ export default {
api = getSnMaintenanceListApi api = getSnMaintenanceListApi
} else if (this.statisisType === 'SN生命周期统计') { } else if (this.statisisType === 'SN生命周期统计') {
this.theaders1 = [ this.theaders1 = [
{ label: '刀模SN', value: 'toolCode', width: '150px' }, { label: '刀模SN', value: 'toolCode' },
{ label: '创建时间', value: 'createTime', width: '140px' }, { label: '创建时间', value: 'createTime', width: '140px' },
{ label: '初始寿命', value: 'initialLifeTime', width: '120px' }, { label: '初始寿命', value: 'initialLifeTime', width: '120px' },
{ label: '累计使用次数', value: 'countSum', width: '140px' }, { label: '累计使用次数', value: 'countSum', width: '140px' },
......
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" @submit.native.prevent ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px"> <el-form :model="queryParams" @submit.native.prevent ref="queryForm" size="small" :inline="true" v-show="showSearch"
<el-form-item :label="'工单类型'" prop="workorderType"> label-width="100px">
<el-select v-model="queryParams.workorderType" clearable :placeholder="'请选择状态'" > <el-form-item :label="'工单类型'" prop="workorderType">
<el-option v-for="dict in dict.type.mes_workorder_type" <el-select v-model="queryParams.workorderType" clearable :placeholder="'请选择状态'">
:key="dict.value" <el-option v-for="dict in dict.type.mes_workorder_type" :key="dict.value" :label="dict.label"
:label="dict.label" :value="dict.value">
:value="dict.value"> </el-option>
</el-option> </el-select>
</el-form-item>
<el-form-item :label="'生产工单'" prop="workorderCode">
<el-input v-model="queryParams.workorderCode" :placeholder="'请输入生产工单'" />
</el-form-item>
<el-form-item :label="'任务号'" prop="taskCode">
<el-input v-model="queryParams.taskCode" :placeholder="'请输入任务号'" />
</el-form-item>
<el-form-item :label="'产品编码'" prop="productCode">
<el-input v-model="queryParams.productCode" :placeholder="'请输入产品编码'" />
</el-form-item>
<el-form-item :label="'产品名称'" prop="productName">
<el-input v-model="queryParams.productName">
<el-button slot="append" icon="el-icon-search" @click="$refs['ItemSelectRef'].showFlag = true"></el-button>
</el-input>
</el-form-item>
<el-form-item :label="'工序'" prop="processName">
<el-input v-model="queryParams.processName">
<el-button slot="append" @click="$refs.brSelectpro.showFlag = true" icon="el-icon-search"></el-button>
</el-input>
</el-form-item>
<el-form-item :label="'车间'" prop="workshopName">
<el-input v-model="queryParams.workshopName">
<el-button slot="append" @click="$refs.workshopSelectRef.showFlag = true" icon="el-icon-search"></el-button>
</el-input>
</el-form-item>
<el-form-item :label="'工作中心'" prop="workstationName">
<el-input v-model="queryParams.workstationName">
<el-button slot="append" icon="el-icon-search"
@click="$refs['WorkstationSelect'].showFlag = true"></el-button>
</el-input>
</el-form-item>
<el-form-item :label="'工作单元'" prop="workunitId">
<el-input v-model="queryParams.workunitName">
<el-button slot="append" icon="el-icon-search" @click="$refs['WorkunitSelect'].showFlag = true"></el-button>
</el-input>
</el-form-item>
<el-form-item :label="'报工人员'" prop="workunitId">
<el-input v-model="queryParams.nickName">
<el-button slot="append" icon="el-icon-search" @click="$refs.userSelect.showFlag = true"></el-button>
</el-input>
</el-form-item>
<el-form-item :label="'报工时间'">
<el-date-picker v-model="daterangePurchaseDate" value-format="yyyy-MM-dd" type="daterange" range-separator="-"
:start-placeholder="'开始日期'" :end-placeholder="'结束日期'"></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{ '搜索' }}</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ '重置' }}</el-button>
</el-form-item>
</el-form>
<el-tabs type="border-card" @tab-click="tabClick">
<el-tab-pane :label="'明细'">
<el-row style="margin-bottom: 10px;">
<el-button type="primary" size="mini" @click="handleExport">{{ '导出' }}</el-button>
</el-row>
<el-table v-loading="loading" :max-height="tableHeight" :data="tbodys">
<el-table-column :label="item.label" align="center" :prop="item.value" :width="item.width"
v-for="(item, index) in theaders" :key="index">
<template slot-scope="scope">
<dict-tag :options="dict.type.mes_workorder_type" :value="scope.row.workorderType"
v-if="item.value === 'workorderType'" />
<div v-else>{{ item.value === 'machineTime' ? scope.row[item.value] ?
Number(scope.row[item.value]).toFixed(2) : scope.row[item.value] : scope.row[item.value] }}</div>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" @pagination="getList" />
</el-tab-pane>
<el-tab-pane :label="'统计'">
<el-row align="center" style="line-height: 40px;">
<el-col :span="7">{{ '统计内容' }}
<el-select v-model="tableType" clearable :placeholder="'请选择统计内容'">
<el-option v-for="item in statisisOption" :key="item" :label="item" :value="item">
</el-option>
</el-select> </el-select>
</el-form-item> </el-col>
<el-form-item :label="'生产工单'" prop="workorderCode"> <el-col :span="7">{{ '范围样式' }}
<el-input v-model="queryParams.workorderCode" :placeholder="'请输入生产工单'" /> <el-select v-model="statisisType" clearable :placeholder="'请选择范围样式'">
</el-form-item> <el-option v-for="(item, index) in statisisList" :key="index" :label="item.label" :value="item.value">
<el-form-item :label="'任务号'" prop="taskCode"> </el-option>
<el-input v-model="queryParams.taskCode" :placeholder="'请输入任务号'" /> </el-select>
</el-form-item> </el-col>
<el-form-item :label="'产品编码'" prop="productCode"> <el-col :span="4">
<el-input v-model="queryParams.productCode" :placeholder="'请输入产品编码'" /> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{ '查询' }}</el-button>
</el-form-item> <el-button type="primary" size="mini" @click="handleExport">{{ '导出' }}</el-button>
<el-form-item :label="'产品名称'" prop="productName"> </el-col>
<el-input v-model="queryParams.productName" > </el-row>
<el-button slot="append" icon="el-icon-search" @click="$refs['ItemSelectRef'].showFlag = true" ></el-button> <el-table v-loading="loading" :max-height="tableHeight" :data="tbodys1">
</el-input> <el-table-column :label="item.label" align="center" :prop="item.value" v-for="(item, index) in theaders1"
</el-form-item> :key="index">
<el-form-item :label="'工序'" prop="processName"> <template slot-scope="scope">
<el-input v-model="queryParams.processName" > <dict-tag :options="dict.type.mes_workorder_type" :value="scope.row.workorderType"
<el-button slot="append" @click="$refs.brSelectpro.showFlag = true" icon="el-icon-search"></el-button> v-if="item.value === 'workorderType'" />
</el-input> <div v-else>{{ item.value === 'machineTime' ? scope.row[item.value] ?
</el-form-item> Number(scope.row[item.value]).toFixed(2) : scope.row[item.value] : scope.row[item.value] }}</div>
<el-form-item :label="'车间'" prop="workshopName"> </template>
<el-input v-model="queryParams.workshopName" > </el-table-column>
<el-button slot="append" @click="$refs.workshopSelectRef.showFlag = true" icon="el-icon-search"></el-button> </el-table>
</el-input>
</el-form-item> <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
<el-form-item :label="'工作中心'" prop="workstationName"> :limit.sync="queryParams.pageSize" @pagination="getList" />
<el-input </el-tab-pane>
v-model="queryParams.workstationName" </el-tabs>
>
<el-button <ItemSelect ref="ItemSelectRef" @onSelected="onItemSelect" />
slot="append" <workshopSelect ref="workshopSelectRef" showModal @onSelected="onworkshopSelect" />
icon="el-icon-search" <WorkuintSelect ref="WorkunitSelect" showModal @onSelected="onWorkunitSelect" />
@click="$refs['WorkstationSelect'].showFlag = true" <WorkstationSelect ref="WorkstationSelect" showModal @onSelected="onWorkstationSelect" />
></el-button> <ProcessSelect ref="brSelectpro" showModal @onSelected="onBrandProcess"></ProcessSelect>
</el-input> <UserSingleSelect ref="userSelect" showModal @onSelected="onUserSelected"></UserSingleSelect>
</el-form-item> </div>
<el-form-item :label="'工作单元'" prop="workunitId"> </template>
<el-input v-model="queryParams.workunitName">
<el-button <script>
slot="append"
icon="el-icon-search"
@click="$refs['WorkunitSelect'].showFlag = true"
></el-button>
</el-input>
</el-form-item>
<el-form-item :label="'报工人员'" prop="workunitId">
<el-input v-model="queryParams.nickName">
<el-button
slot="append"
icon="el-icon-search"
@click="$refs.userSelect.showFlag = true"
></el-button>
</el-input>
</el-form-item>
<el-form-item :label="'报工时间'">
<el-date-picker v-model="daterangePurchaseDate" value-format="yyyy-MM-dd" type="daterange" range-separator="-"
:start-placeholder="'开始日期'" :end-placeholder="'结束日期'"></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{'搜索'}}</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{'重置'}}</el-button>
</el-form-item>
</el-form>
<el-tabs type="border-card" @tab-click="tabClick">
<el-tab-pane :label="'明细'">
<el-row style="margin-bottom: 10px;">
<el-button type="primary" size="mini" @click="handleExport">{{'导出'}}</el-button>
</el-row>
<el-table v-loading="loading" :max-height="tableHeight" :data="tbodys" >
<el-table-column :label="item.label" align="center" :prop="item.value" :width="item.width" v-for="(item, index) in theaders" :key="index">
<template slot-scope="scope">
<dict-tag :options="dict.type.mes_workorder_type" :value="scope.row.workorderType" v-if="item.value==='workorderType'" />
<div v-else>{{ item.value === 'machineTime' ? scope.row[item.value] ? Number(scope.row[item.value]).toFixed(2) : scope.row[item.value] : scope.row[item.value] }}</div>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-tab-pane>
<el-tab-pane :label="'统计'">
<el-row align="center" style="line-height: 40px;">
<el-col :span="7">{{'统计方式'}}
<el-select v-model="statisisType" clearable :placeholder="'请选择统计方式'">
<el-option v-for="item in statisisList"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
</el-col>
<el-col :span="3">
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{'查询'}}</el-button>
<el-button type="primary" size="mini" @click="handleExport">{{'导出'}}</el-button>
</el-col>
</el-row>
<el-table v-loading="loading" :max-height="tableHeight" :data="tbodys1">
<el-table-column :label="item.label" align="center" :prop="item.value" v-for="(item, index) in theaders1" :key="index">
<template slot-scope="scope">
<dict-tag :options="dict.type.mes_workorder_type" :value="scope.row.workorderType" v-if="item.value==='workorderType'" />
<div v-else>{{ item.value === 'machineTime' ? scope.row[item.value] ? Number(scope.row[item.value]).toFixed(2) : scope.row[item.value] : scope.row[item.value] }}</div>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-tab-pane>
</el-tabs>
<ItemSelect ref="ItemSelectRef" @onSelected="onItemSelect"/>
<workshopSelect ref="workshopSelectRef" showModal @onSelected="onworkshopSelect"/>
<WorkuintSelect
ref="WorkunitSelect"
showModal
@onSelected="onWorkunitSelect"
/>
<WorkstationSelect
ref="WorkstationSelect"
showModal
@onSelected="onWorkstationSelect"
/>
<ProcessSelect
ref="brSelectpro"
showModal
@onSelected="onBrandProcess"
></ProcessSelect>
<UserSingleSelect ref="userSelect" showModal @onSelected="onUserSelected"></UserSingleSelect>
</div>
</template>
<script>
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { getList, getListByProcess, getListByUser, getListByWorkshop, getListByWorkOrder, getListByWorkstation, getListByWorkunit } from "@/api/mes/proTable/statistAnaly"; import { getList, getListByProcess, getListByUser, getListByWorkshop, getListByWorkOrder, getListByWorkstation, getListByWorkunit, getAchievementRateApi, getEfficiencyRateApi, getFeedDefRateApi, getProductivityRateApi } from "@/api/mes/proTable/statistAnaly";
import ProcessSelect from "@/components/process/taskSelectSingle.vue"; import ProcessSelect from "@/components/process/taskSelectSingle.vue";
import ItemSelect from "@/components/itemSelect/single.vue"; import ItemSelect from "@/components/itemSelect/single.vue";
import workshopSelect from "@/components/workshopSelect/single.vue"; import workshopSelect from "@/components/workshopSelect/single.vue";
import WorkuintSelect from "@/components/workunitSelect/single.vue"; import WorkuintSelect from "@/components/workunitSelect/single.vue";
import WorkstationSelect from "@/components/workstationSelect/simpletableSingle.vue" import WorkstationSelect from "@/components/workstationSelect/simpletableSingle.vue"
import UserSingleSelect from "@/components/userSelect/single1.vue" import UserSingleSelect from "@/components/userSelect/single1.vue"
export default { export default {
name: "ScheduleSetupRule", name: "ScheduleSetupRule",
components: {UserSingleSelect,ProcessSelect, ItemSelect, workshopSelect, WorkuintSelect, WorkstationSelect}, components: { UserSingleSelect, ProcessSelect, ItemSelect, workshopSelect, WorkuintSelect, WorkstationSelect },
dicts: [ dicts: [
"mes_workorder_type", "mes_workorder_type",
], ],
data() { data() {
return { return {
showQueryLPN: false, showQueryLPN: false,
// 遮罩层 // 遮罩层
loading: true, loading: true,
selectedRows: [], selectedRows: [],
tabIndex: 0, tabIndex: 0,
// 选中数组 // 选中数组
ids: [], ids: [],
//dta列表 //dta列表
dtaOptions: [], dtaOptions: [],
// 非单个禁用 // 非单个禁用
single: true, single: true,
// 非多个禁用 // 非多个禁用
multiple: true, multiple: true,
// 显示搜索条件 // 显示搜索条件
showSearch: true, showSearch: true,
// 总条数 // 总条数
total: 0, total: 0,
// 排产换型对照信息表格数据 // 排产换型对照信息表格数据
tbodys: [], tbodys: [],
theaders: [], theaders: [],
tbodys1: [], tbodys1: [],
theaders1: [], theaders1: [],
// 弹出层标题 // 弹出层标题
title: "", title: "",
statisisType: null, statisisType: 1,
statisisList: ['工单', '车间', '工作中心', '工作单元', '工序', '人员'], // statisisList: ['工单', '车间', '工作中心', '工作单元', '工序', '人员'],
// 是否显示弹出层 statisisList: [{
open: false, label: '工作单元',
tableHeight: 0, value: 1
daterangePurchaseDate: [dayjs().startOf('month').format('YYYY-MM-DD'), dayjs().endOf('month').format('YYYY-MM-DD')], }, {
// 查询参数 label: '工作中心',
queryParams: { value: 2
pageNum: 1, }, {
pageSize: 10, label: '车间',
"customerProjectNo": null, value: 3
"endDate": null, }],
"orderCode": null, tableType: '计划达成统计表',
"processName": null, statisisOption: ['计划达成统计表', '效率统计表', '生产力统计表', '产品不良分析统计表'],
"processCode": null, // 是否显示弹出层
"processId": null, open: false,
"productCode": null, tableHeight: 0,
"productId": null, daterangePurchaseDate: [dayjs().startOf('month').format('YYYY-MM-DD'), dayjs().endOf('month').format('YYYY-MM-DD')],
"productName": null, // 查询参数
"startDate": null, queryParams: {
"taskCode": null, pageNum: 1,
"userName": null, pageSize: 10,
"nickName": null, "customerProjectNo": null,
"workorderCode": null, "endDate": null,
"workorderType": null, "orderCode": null,
"workshopId": null, "processName": null,
"workshopName": null, "processCode": null,
"workstationId": null, "processId": null,
"workstationName": null, "productCode": null,
"workunitId": null, "productId": null,
"workunitName": null "productName": null,
}, "startDate": null,
// 表单参数 "taskCode": null,
form: {}, "userName": null,
}; "nickName": null,
"workorderCode": null,
"workorderType": null,
"workshopId": null,
"workshopName": null,
"workstationId": null,
"workstationName": null,
"workunitId": null,
"workunitName": null
},
// 表单参数
form: {},
};
},
mounted() {
this.$nextTick(() => {
this._resizeHandler()
})
this._resizeHandler = () => {
const arr = document.getElementsByClassName('el-form')
const height = arr[0].offsetHeight
const arr1 = document.getElementsByClassName('app-main')
const height1 = arr1[0].offsetHeight
console.log('this.tabIndex', this.tabIndex)
this.tableHeight = height1 - height - (this.tabIndex ? 200 : 170)
}
window.addEventListener('resize', this._resizeHandler)
},
beforeDestroy() {
window.removeEventListener('resize', this._resizeHandler)
},
created() {
this.getList();
},
watch: {
tabIndex: {
handler(val) {
if (Number(val) === 0) {
this.theaders = [
{ label: '工单类型', value: 'workorderType', width: '80px' },
{ label: '生产工单', value: 'workorderCode', width: '140px' },
{ label: '产品编码', value: 'productCode', width: '120px' },
{ label: '产品名称', value: 'productName', width: '240px' },
{ label: '工序任务', value: 'taskCode', width: '120px' },
{ label: '工序名称', value: 'processName', width: '80px' },
{ label: '工作中心编码', value: 'workstationCode', width: '100px' },
{ label: '工作中心名称', value: 'workstationName', width: '140px' },
{ label: '工作单元编码', value: 'workunitCode', width: '100px' },
{ label: '工作单元名称', value: 'workunitName', width: '280px' },
{ label: '报工人员编码', value: 'userName', width: '140px' },
{ label: '报工人员名称', value: 'nickName', width: '140px' },
{ label: '派工数量', value: 'quantity', width: '80px' },
{ label: '报工数量', value: 'quantityFeedback', width: '80px' },
{ label: '合格数量', value: 'quantityQualify', width: '80px' },
{ label: '不合格数量', value: 'quantityUnqualify', width: '90px' },
{ label: '不合格原因', value: 'abnormalReason', width: '90px' },
{ label: '标准工时', value: 'stdWorkingTime', width: '80px' },
{ label: '实际工时', value: 'machineTime', width: '80px' },
{ label: '计划完成时间', value: 'scheduleEndDate', width: '100px' },
{ label: '报工时间', value: 'feedbackTime', width: '100px' }
]
this.handleQuery()
}
},
immediate: true
}
},
methods: {
onUserSelected(row) {
if (row != undefined) {
console.log('rrr', row)
this.queryParams.nickName = row.nickName;
}
}, },
mounted(){ onWorkstationSelect(row) {
this.$nextTick(()=>{ if (row != undefined) {
this._resizeHandler() this.queryParams.workstationName = row.workstationName;
})
this._resizeHandler = () => {
const arr = document.getElementsByClassName('el-form')
const height = arr[0].offsetHeight
const arr1 = document.getElementsByClassName('app-main')
const height1 = arr1[0].offsetHeight
console.log('this.tabIndex', this.tabIndex)
this.tableHeight = height1 - height - (this.tabIndex ? 200 : 170)
} }
window.addEventListener('resize', this._resizeHandler)
}, },
beforeDestroy() { onWorkunitSelect(row) {
window.removeEventListener('resize', this._resizeHandler) if (row != undefined) {
this.queryParams.workunitName = row.workunitName;
}
}, },
created() { onworkshopSelect(row) {
this.getList(); if (row != undefined) {
this.queryParams.workshopName = row.workshopName;
}
}, },
watch: { tabClick(val) {
tabIndex: { console.log('this.tabIndex', this.tabIndex, val)
handler(val){ this.tabIndex = val.index
if(Number(val) === 0) { this.$nextTick(() => {
this.theaders = [ this._resizeHandler()
{label: '工单类型', value: 'workorderType', width: '80px'}, })
{label: '生产工单', value: 'workorderCode', width: '140px'}, },
{label: '产品编码', value: 'productCode', width: '120px'}, onItemSelect(row) {
{label: '产品名称', value: 'productName', width: '240px'}, if (row != undefined) {
{label: '工序任务', value: 'taskCode', width: '120px'}, this.queryParams.productName = row.itemName;
{label: '工序名称', value: 'processName', width: '80px'},
{label: '工作中心编码', value: 'workstationCode', width: '100px'},
{label: '工作中心名称', value: 'workstationName', width: '140px'},
{label: '工作单元编码', value: 'workunitCode', width: '100px'},
{label: '工作单元名称', value: 'workunitName', width: '280px'},
{label: '报工人员编码', value: 'userName', width: '140px'},
{label: '报工人员名称', value: 'nickName', width: '140px'},
{label: '派工数量', value: 'quantity', width: '80px'},
{label: '报工数量', value: 'quantityFeedback', width: '80px'},
{label: '合格数量', value: 'quantityQualify', width: '80px'},
{label: '不合格数量', value: 'quantityUnqualify', width: '90px'},
{label: '不合格原因', value: 'abnormalReason', width: '90px'},
{label: '标准工时', value: 'stdWorkingTime', width: '80px'},
{label: '实际工时', value: 'machineTime', width: '80px'},
{label: '计划完成时间', value: 'scheduleEndDate', width: '100px'},
{label: '报工时间', value: 'feedbackTime', width: '100px'}
]
this.handleQuery()
}
},
immediate: true
} }
}, },
methods: { /** 查询排产换型对照信息列表 */
onUserSelected(row){ getList() {
if (row != undefined) { this.loading = true;
console.log('rrr', row) if (this.daterangePurchaseDate && this.daterangePurchaseDate.length > 0) {
this.queryParams.nickName = row.nickName; this.queryParams['startDate'] = this.daterangePurchaseDate[0]
} this.queryParams['endDate'] = this.daterangePurchaseDate[1]
}, } else {
onWorkstationSelect(row) { this.queryParams['startDate'] = null
if (row != undefined) { this.queryParams['endDate'] = null
this.queryParams.workstationName = row.workstationName; }
} let api = getList
}, if (Number(this.tabIndex) === 1) {
onWorkunitSelect(row){ if (this.tableType === '计划达成统计表') {
if (row != undefined) { api = getAchievementRateApi
this.queryParams.workunitName = row.workunitName; this.theaders1 = [
} { label: '任务条数', value: 'taskWorkunitCount' },
}, { label: '任务完工条数', value: 'taskWorkunitFinshed' },
onworkshopSelect(row){ { label: '达成任务率', value: 'taskWorkunitCountRate' },
if (row != undefined) { { label: '任务计划数', value: 'quantitySum' },
this.queryParams.workshopName = row.workshopName; { label: '实际报工数', value: 'feedQuantity' },
} { label: '达成任务数率', value: 'feedQuantityRate' }
}, ]
tabClick(val){ } else if (this.tableType === '效率统计表') {
console.log('this.tabIndex', this.tabIndex, val) api = getEfficiencyRateApi
this.tabIndex = val.index this.theaders1 = [
this.$nextTick(() => { { label: '计划工时(毫秒)', value: 'planWorkTime' },
this._resizeHandler() { label: '延误工时(毫秒)', value: 'delayWorkTime' },
}) { label: '投入工时(毫秒)', value: 'workTime' },
}, { label: '产出工时(毫秒)', value: 'feedWorkTime' },
onItemSelect(row) { { label: '效率值', value: 'efficiencyRate' }
if (row != undefined) { ]
this.queryParams.productName = row.itemName; } else if (this.tableType === '生产力统计表') {
api = getProductivityRateApi
this.theaders1 = [
{ label: '计划工时(毫秒)', value: 'planWorkTime' },
{ label: '延误工时(毫秒)', value: 'delayWorkTime' },
{ label: '投入工时(毫秒)', value: 'workTime' },
{ label: '产出工时(毫秒)', value: 'feedWorkTime' },
{ label: '效率值', value: 'efficiencyRate' }
]
} else if (this.tableType === '产品不良分析统计表') {
api = getFeedDefRateApi
this.theaders1 = [
{ label: '不良名称与编码', value: 'defectCodes' },
{ label: '任务条数', value: 'taskWorkunitCount' },
{ label: '不良任务工单条数', value: 'taskWorkunitDefCount' },
{ label: '任务不良发生率', value: 'taskWorkunitCountRate' },
{ label: '不良条数', value: 'feedDefSum' },
{ label: '任务数量', value: 'quantitySum' },
{ label: '不良数量', value: 'quantityUnSum' },
{ label: '数量不良率', value: 'quantityRate' }
]
} }
}, // if (this.statisisType === '工单') {
/** 查询排产换型对照信息列表 */ // api = getListByWorkOrder
getList() { // this.theaders1 = [
this.loading = true; // { label: '工单编码', value: 'workorderCode' },
if (this.daterangePurchaseDate && this.daterangePurchaseDate.length > 0) { // { label: '工单名称', value: 'workorderName' },
this.queryParams['startDate'] = this.daterangePurchaseDate[0] // { label: '报工数量', value: 'quantityFeedback' },
this.queryParams['endDate'] = this.daterangePurchaseDate[1] // { label: '合格数量', value: 'quantityQualify' },
} else { // { label: '不合格数量', value: 'quantityUnqualify' },
this.queryParams['startDate'] = null // { label: '合格率', value: 'qualificationRate' }
this.queryParams['endDate'] = null // ]
// } else if (this.statisisType === '车间') {
// this.theaders1 = [
// { label: '车间编号', value: 'workshopCode' },
// { label: '车间名称', value: 'workshopName' },
// { label: '报工数量', value: 'quantityFeedback' },
// { label: '合格数量', value: 'quantityQualify' },
// { label: '不合格数量', value: 'quantityUnqualify' },
// { label: '合格率', value: 'qualificationRate' }
// ]
// api = getListByWorkshop
// } else if (this.statisisType === '工作中心') {
// this.theaders1 = [
// { label: '工作中心编号', value: 'workstationCode' },
// { label: '工作中心名称', value: 'workstationName' },
// { label: '报工数量', value: 'quantityFeedback' },
// { label: '合格数量', value: 'quantityQualify' },
// { label: '不合格数量', value: 'quantityUnqualify' },
// { label: '合格率', value: 'qualificationRate' }
// ]
// api = getListByWorkstation
// } else if (this.statisisType === '工作单元') {
// this.theaders1 = [
// { label: '工作单元编码', value: 'workunitCode' },
// { label: '工作单元名称', value: 'workunitName' },
// { label: '报工数量', value: 'quantityFeedback' },
// { label: '合格数量', value: 'quantityQualify' },
// { label: '不合格数量', value: 'quantityUnqualify' },
// { label: '合格率', value: 'qualificationRate' }
// ]
// api = getListByWorkunit
// } else if (this.statisisType === '工序') {
// this.theaders1 = [
// { label: '工序编码', value: 'processCode' },
// { label: '工序名称', value: 'processName' },
// { label: '报工数量', value: 'quantityFeedback' },
// { label: '合格数量', value: 'quantityQualify' },
// { label: '不合格数量', value: 'quantityUnqualify' },
// { label: '合格率', value: 'qualificationRate' }
// ]
// api = getListByProcess
// } else if (this.statisisType === '人员') {
// this.theaders1 = [
// { label: '报工人员编码', value: 'userName' },
// { label: '报工人员名称', value: 'nickName' },
// { label: '报工数量', value: 'quantityFeedback' },
// { label: '合格数量', value: 'quantityQualify' },
// { label: '不合格数量', value: 'quantityUnqualify' },
// { label: '合格率', value: 'qualificationRate' }
// ]
// api = getListByUser
// }
}
let params = this.queryParams;
if (Number(this.tabIndex) === 1) {
params = {
...this.queryParams,
checkIndex: this.statisisType
} }
let api = getList }
api(params).then(response => {
if (Number(this.tabIndex) === 1) { if (Number(this.tabIndex) === 1) {
if(this.statisisType === '工单'){ this.tbodys1 = response.rows
api = getListByWorkOrder
this.theaders1 = [
{label: '工单编码', value: 'workorderCode'},
{label: '工单名称', value: 'workorderName'},
{label: '报工数量', value: 'quantityFeedback'},
{label: '合格数量', value: 'quantityQualify'},
{label: '不合格数量', value: 'quantityUnqualify'},
{label: '合格率', value: 'qualificationRate'}
]
} else if(this.statisisType === '车间'){
this.theaders1 = [
{label: '车间编号', value: 'workshopCode'},
{label: '车间名称', value: 'workshopName'},
{label: '报工数量', value: 'quantityFeedback'},
{label: '合格数量', value: 'quantityQualify'},
{label: '不合格数量', value: 'quantityUnqualify'},
{label: '合格率', value: 'qualificationRate'}
]
api = getListByWorkshop
} else if(this.statisisType === '工作中心'){
this.theaders1 = [
{label: '工作中心编号', value: 'workstationCode'},
{label: '工作中心名称', value: 'workstationName'},
{label: '报工数量', value: 'quantityFeedback'},
{label: '合格数量', value: 'quantityQualify'},
{label: '不合格数量', value: 'quantityUnqualify'},
{label: '合格率', value: 'qualificationRate'}
]
api = getListByWorkstation
} else if(this.statisisType === '工作单元'){
this.theaders1 = [
{label: '工作单元编码', value: 'workunitCode'},
{label: '工作单元名称', value: 'workunitName'},
{label: '报工数量', value: 'quantityFeedback'},
{label: '合格数量', value: 'quantityQualify'},
{label: '不合格数量', value: 'quantityUnqualify'},
{label: '合格率', value: 'qualificationRate'}
]
api = getListByWorkunit
} else if(this.statisisType === '工序'){
this.theaders1 = [
{label: '工序编码', value: 'processCode'},
{label: '工序名称', value: 'processName'},
{label: '报工数量', value: 'quantityFeedback'},
{label: '合格数量', value: 'quantityQualify'},
{label: '不合格数量', value: 'quantityUnqualify'},
{label: '合格率', value: 'qualificationRate'}
]
api = getListByProcess
} else if(this.statisisType === '人员'){
this.theaders1 = [
{label: '报工人员编码', value: 'userName'},
{label: '报工人员名称', value: 'nickName'},
{label: '报工数量', value: 'quantityFeedback'},
{label: '合格数量', value: 'quantityQualify'},
{label: '不合格数量', value: 'quantityUnqualify'},
{label: '合格率', value: 'qualificationRate'}
]
api = getListByUser
}
}
api(this.queryParams).then(response => {
if (Number(this.tabIndex) === 1) {
this.tbodys1 = response.rows
}
else {
this.tbodys = response.rows
}
this.total = response.total;
this.loading = false;
});
},
/** 搜索按钮操作 */
handleQuery() {
if (Number(this.tabIndex) === 1 && !this.statisisType) this.$message.warning('请选择统计方式');
this.queryParams.pageNum = 1;
this.getList();
},
onBrandSelected(row){
if (Object.values(row).length > 0) {
this.queryParams.itemTypeId = row.itemTypeId;
this.queryParams.itemTypeName = row.itemTypeName;
} }
}, else {
onBrandProcess(row){ this.tbodys = response.rows
if (Object.values(row).length > 0) {
this.queryParams.processName = row.processName;
} }
}, this.total = response.total;
/** 重置按钮操作 */ this.loading = false;
resetQuery() { });
this.resetForm("queryForm"); },
this.handleQuery(); /** 搜索按钮操作 */
}, handleQuery() {
// 多选框选中数据 if (Number(this.tabIndex) === 1 && !this.statisisType) this.$message.warning('请选择统计方式');
handleSelectionChange(selection) { this.queryParams.pageNum = 1;
this.selectedRows = selection this.getList();
this.ids = selection.map(item => item.ruleId) },
this.single = selection.length!==1 onBrandSelected(row) {
this.multiple = !selection.length if (Object.values(row).length > 0) {
}, this.queryParams.itemTypeId = row.itemTypeId;
handleExport(){ this.queryParams.itemTypeName = row.itemTypeName;
let apiName = '' }
if (Number(this.tabIndex) === 0) { },
apiName = 'report/pro/feedback/getList/export' onBrandProcess(row) {
} else if(this.statisisType === '车间'){ if (Object.values(row).length > 0) {
apiName = 'report/pro/feedback/getListByWorkshop/export' this.queryParams.processName = row.processName;
} else if(this.statisisType === '工作中心'){ }
apiName = 'report/pro/feedback/getListByWorkstation/export' },
} else if(this.statisisType === '工作单元'){ /** 重置按钮操作 */
apiName = 'report/pro/feedback/getListByWorkunit/export' resetQuery() {
} else if(this.statisisType === '工序'){ this.resetForm("queryForm");
apiName = 'report/pro/feedback/getListByProcess/export' this.handleQuery();
} else if(this.statisisType === '人员'){ },
apiName = 'report/pro/feedback/getListByUser/export' // 多选框选中数据
} else if(this.statisisType === '工单') { handleSelectionChange(selection) {
apiName = 'report/pro/feedback/getListByWorkOrder/export' this.selectedRows = selection
this.ids = selection.map(item => item.ruleId)
this.single = selection.length !== 1
this.multiple = !selection.length
},
handleExport() {
let apiName = ''
if (Number(this.tabIndex) === 0) {
apiName = 'report/pro/feedback/getList/export'
} else if (this.tableType === '计划达成统计表') {
apiName = 'report/pro/feedback/getAchievementRate/export'
} else if (this.tableType === '效率统计表') {
apiName = 'report/pro/feedback/getEfficiencyRate/export'
} else if (this.tableType === '生产力统计表') {
apiName = 'report/pro/feedback/getFeedDefRate/export'
} else if (this.tableType === '产品不良分析统计表') {
apiName = 'report/pro/feedback/getProductivityRate/export'
}
// else if (this.statisisType === '车间') {
// apiName = 'report/pro/feedback/getListByWorkshop/export'
// } else if (this.statisisType === '工作中心') {
// apiName = 'report/pro/feedback/getListByWorkstation/export'
// } else if (this.statisisType === '工作单元') {
// apiName = 'report/pro/feedback/getListByWorkunit/export'
// } else if (this.statisisType === '工序') {
// apiName = 'report/pro/feedback/getListByProcess/export'
// } else if (this.statisisType === '人员') {
// apiName = 'report/pro/feedback/getListByUser/export'
// } else if (this.statisisType === '工单') {
// apiName = 'report/pro/feedback/getListByWorkOrder/export'
// }
let params = this.queryParams;
if (Number(this.tabIndex) === 1) {
params = {
...this.queryParams,
checkIndex: this.statisisType
} }
this.download(
apiName,
{
...this.queryParams,
},
`statistAnaly_${new Date().getTime()}.xlsx`
);
} }
this.download(
apiName,
params,
`statistAnaly_${new Date().getTime()}.xlsx`
);
} }
}; }
</script> };
</script>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment