Commit 785bed3b authored by 沈翠玲's avatar 沈翠玲

第一个报表和第二个报表

parent e391393f
import request from '@/utils/request'
// 生产报工记录:明细界面
export function getList(query) {
return request({
url: "/report/pro/feedback/getList",
method: "get",
params: query,
});
}
// 生产报工记录:统计方式工序
export function getListByProcess(query) {
return request({
url: '/report/pro/feedback/getListByProcess',
method: "get",
params: query
});
}
// 生产报工记录:统计方式用户
export function getListByUser(query) {
return request({
url: '/report/pro/feedback/getListByUser',
method: "get",
params: query
});
}
// 生产报工记录:统计方式车间
export function getListByWorkshop(query) {
return request({
url: '/report/pro/feedback/getListByWorkshop',
method: "get",
params: query
});
}
// 生产报工记录:统计方式工单
export function getListByWorkOrder(query) {
return request({
url: '/report/pro/feedback/getListByWorkOrder',
method: "get",
params: query
});
}
// 生产报工记录:统计方式工作中心
export function getListByWorkstation(query) {
return request({
url: '/report/pro/feedback/getListByWorkstation',
method: "get",
params: query
});
}
// 生产报工记录:统计方式工作单元
export function getListByWorkunit(query) {
return request({
url: '/report/pro/feedback/getListByWorkunit',
method: "get",
params: query
});
}
// 生产报工记录:统计方式不合格原因
export function getListByDefect(query) {
return request({
url: '/report/pro/feedback/getListByDefect',
method: "get",
params: query
});
}
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<el-dialog :title="$t('工序查询页面')" <el-dialog :title="$t('工序查询页面')"
v-if="showFlag" v-if="showFlag"
:visible.sync="showFlag" :visible.sync="showFlag"
:modal= false :modal= showModal
width="80%" width="80%"
> >
<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" label-width="100px">
...@@ -79,7 +79,11 @@ ...@@ -79,7 +79,11 @@
processId: null, processId: null,
processCode: null, processCode: null,
workstationId: null, workstationId: null,
workstationCode: null workstationCode: null,
showModal: {
type: Boolean,
default: false
}
}, },
watch: { watch: {
workorderId(v){ workorderId(v){
......
<template>
<el-dialog :title="$t('不合格原因')"
v-if="showFlag"
:visible.sync="showFlag"
:modal="showModal"
width="80%"
center
>
<el-row :gutter="20">
<!--设备数据-->
<el-col :span="24" :xs="24">
<el-form :model="queryParams" @submit.native.prevent ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item :label="$t('不合格原因')" prop="abnormalReason">
<el-input
v-model="queryParams.abnormalReason"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('common.search') }}</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('common.reset') }}</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="machineryList" @current-change="handleCurrent" @row-dblclick="handleRowDbClick">
<el-table-column width="50" align="center" >
<template v-slot="scope">
<el-radio v-model="selectedMachineryId" :label="scope.row.abnormalId" @change="handleRowChange(scope.row)">{{""}}</el-radio>
</template>
</el-table-column>
<el-table-column :label="$t('不合格原因')" width = "120" align="center" key="abnormalReason" prop="abnormalReason">
</el-table-column>
<el-table-column :label="$t('备注')" min-width="120" align="left" key="remark" prop="remark" :show-overflow-tooltip="true" />
<el-table-column :label="$t('创建人')" min-width="120" align="left" key="createBy" prop="createBy" :show-overflow-tooltip="true" />
<el-table-column :label="$t('创建时间')" min-width="120" align="left" key="createTime" prop="createTime" :show-overflow-tooltip="true" />
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="confirmSelect">{{ $t('common.confirm') }}</el-button>
<el-button @click="showFlag=false">{{ $t('common.cancel') }}</el-button>
</div>
</el-dialog>
</template>
<script>
import { listInformation } from "@/api/mes/qc/abnormal";
import { getToken } from "@/utils/auth";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
name: "MachinerySelectSingle",
dicts: ['sys_yes_no','mes_machinery_status'],
props: {
showModal: {
type: Boolean,
default: false
}
},
data() {
return {
showFlag: false,
// 遮罩层
loading: true,
// 选中数组
selectedMachineryId: undefined,
selectedRows: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 物料产品表格数据
machineryList: [],
// 弹出层标题
title: "",
// 设备类型树选项
machineryTypeOptions: [],
//车间选项
workshopOptions:[],
// 是否显示弹出层
open: false,
// 设备类型名称
machineryTypeName: undefined,
//自动生成物料编码标识
autoGenFlag: false,
// 表单参数
form: {},
defaultProps: {
children: "children",
label: "machineryTypeName"
},
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
abnormalReason: null
}
};
},
watch: {
// 根据设备分类名称筛选分类树
machineryTypeName(val) {
this.$refs.tree.filter(val);
}
},
created() {
this.getList();
},
methods: {
/** 查询物料编码列表 */
getList() {
this.loading = true;
const params = {
...this.queryParams,
abnormalType: 'UNQUALIFIED_REASON'
}
listInformation(this.queryParams).then(response => {
this.machineryList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
/** 转换设备类型数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
}
return {
id: node.machineryTypeId,
label: node.machineryTypeName,
children: node.children
};
},
// 筛选节点
filterNode(value, data) {
if (!value) return true;
return data.machineryTypeName.indexOf(value) !== -1;
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
handleCurrent(row){
if(row){
this.selectedRows = row;
}
},
//双击选中
handleRowDbClick(row){
if(row){
this.selectedRows = row;
this.$emit('onSelected',this.selectedRows);
this.showFlag = false;
}
},
// 单选选中数据
handleRowChange(row) {
if(row){
this.selectedRows = row;
}
},
//确定选中
confirmSelect(){
if(this.selectedMachineryId == null || this.selectedMachineryId == 0){
this.$notify({
title:this.$t('提示'),
type:'warning',
message: this.$t('请至少选择一条数据!')
});
return;
}
this.$emit('onSelected',this.selectedRows);
this.showFlag = false;
}
}
};
</script>
\ No newline at end of file
<template>
<el-dialog :title="$t('车间选择')"
v-if="showFlag"
:visible.sync="showFlag"
:modal="showModal"
width="80%"
center
>
<el-row :gutter="20">
<!--设备数据-->
<el-col :span="24" :xs="24">
<el-form :model="queryParams" @submit.native.prevent ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item :label="$t('车间编码')" prop="workshopCode">
<el-input
v-model="queryParams.workshopCode"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item :label="$t('车间名称')" prop="workshopName">
<el-input
v-model="queryParams.workshopName"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('common.search') }}</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('common.reset') }}</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="machineryList" @current-change="handleCurrent" @row-dblclick="handleRowDbClick">
<el-table-column width="50" align="center" >
<template v-slot="scope">
<el-radio v-model="selectedMachineryId" :label="scope.row.workshopId" @change="handleRowChange(scope.row)">{{""}}</el-radio>
</template>
</el-table-column>
<el-table-column :label="$t('车间编码')" width = "120" align="center" key="workshopCode" prop="workshopCode">
</el-table-column>
<el-table-column :label="$t('车间名称')" min-width="120" align="left" key="workshopName" prop="workshopName" :show-overflow-tooltip="true" />
<el-table-column :label="$t('创建人')" min-width="120" align="left" key="createBy" prop="createBy" :show-overflow-tooltip="true" />
<el-table-column :label="$t('创建时间')" min-width="120" align="left" key="createTime" prop="createTime" :show-overflow-tooltip="true" />
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="confirmSelect">{{ $t('common.confirm') }}</el-button>
<el-button @click="showFlag=false">{{ $t('common.cancel') }}</el-button>
</div>
</el-dialog>
</template>
<script>
import { listWorkshop } from "@/api/mes/md/workshop";
import { getToken } from "@/utils/auth";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
name: "MachinerySelectSingle",
dicts: ['sys_yes_no','mes_machinery_status'],
components: { Treeselect },
props: {
showModal: {
type: Boolean,
default: false
}
},
data() {
return {
showFlag: false,
// 遮罩层
loading: true,
// 选中数组
selectedMachineryId: undefined,
selectedRows: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 物料产品表格数据
machineryList: [],
// 弹出层标题
title: "",
// 设备类型树选项
machineryTypeOptions: [],
//车间选项
workshopOptions:[],
// 是否显示弹出层
open: false,
// 设备类型名称
machineryTypeName: undefined,
//自动生成物料编码标识
autoGenFlag: false,
// 表单参数
form: {},
defaultProps: {
children: "children",
label: "machineryTypeName"
},
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
workshopCode: null,
workshopName: null,
machineryBrand: null,
machinerySpec: null,
machineryTypeId: null,
machineryTypeCode: null,
machineryTypeName: null,
workshopId: null,
status: null
}
};
},
watch: {
// 根据设备分类名称筛选分类树
machineryTypeName(val) {
this.$refs.tree.filter(val);
}
},
created() {
this.getList();
},
methods: {
/** 查询物料编码列表 */
getList() {
this.loading = true;
listWorkshop(this.queryParams).then(response => {
this.machineryList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
/** 转换设备类型数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
}
return {
id: node.machineryTypeId,
label: node.machineryTypeName,
children: node.children
};
},
// 筛选节点
filterNode(value, data) {
if (!value) return true;
return data.machineryTypeName.indexOf(value) !== -1;
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
handleCurrent(row){
if(row){
this.selectedRows = row;
}
},
//双击选中
handleRowDbClick(row){
if(row){
this.selectedRows = row;
this.$emit('onSelected',this.selectedRows);
this.showFlag = false;
}
},
// 单选选中数据
handleRowChange(row) {
if(row){
this.selectedRows = row;
}
},
//确定选中
confirmSelect(){
if(this.selectedMachineryId == null || this.selectedMachineryId == 0){
this.$notify({
title:this.$t('提示'),
type:'warning',
message: this.$t('请至少选择一条数据!')
});
return;
}
this.$emit('onSelected',this.selectedRows);
this.showFlag = false;
}
}
};
</script>
\ No newline at end of file
<template> <template>
<el-dialog :title="$t('工作中心选择')" v-if="showFlag" :visible.sync="showFlag" :modal="false" width="80%" center> <el-dialog :title="$t('工作中心选择')" v-if="showFlag" :visible.sync="showFlag" :modal="showModal" width="80%" center>
<el-form :model="queryParams" @submit.native.prevent ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px"> <el-form :model="queryParams" @submit.native.prevent ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
<el-row> <el-row>
...@@ -135,6 +135,10 @@ export default { ...@@ -135,6 +135,10 @@ export default {
type: Number | undefined, type: Number | undefined,
default: undefined, default: undefined,
}, },
showModal: {
type: Boolean,
default: false
}
}, },
created() { created() {
this.getList(); this.getList();
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
:title="$t('common.choose_workunit')" :title="$t('common.choose_workunit')"
v-if="showFlag" v-if="showFlag"
:visible.sync="showFlag" :visible.sync="showFlag"
:modal="false" :modal="showModal"
width="80%" width="80%"
> >
<el-form <el-form
...@@ -108,6 +108,10 @@ export default { ...@@ -108,6 +108,10 @@ export default {
type: String | Number, type: String | Number,
default: "", default: "",
}, },
showModal: {
type: Boolean,
default: false,
},
workunitId: { workunitId: {
type: Number | undefined, type: Number | undefined,
default: undefined, default: undefined,
......
...@@ -3002,5 +3002,31 @@ ...@@ -3002,5 +3002,31 @@
"完工作业": "完工作业", "完工作业": "完工作业",
"完工作业成功": "完工作业成功", "完工作业成功": "完工作业成功",
"取消排产": "取消排产", "取消排产": "取消排产",
"工单是否确认取消排产": "工单是否确认取消排产" "工单是否确认取消排产": "工单是否确认取消排产",
"车间选择": "车间选择",
"请选择状态": "请选择状态",
"请输入项目号": "请输入项目号",
"请输入订单号": "请输入订单号",
"请输入生产工单": "请输入生产工单",
"请输入任务号": "请输入任务号",
"请输入产品编码": "请输入产品编码",
"明细": "明细",
"统计": "统计",
"统计方式": "统计方式",
"请选择统计方式": "请选择统计方式",
"工单": "工单",
"工序任务": "工序任务",
"工作中心编码": "工作中心编码",
"工作单元编码": "工作单元编码",
"工作单元名称": "工作单元名称",
"报工人员编码": "报工人员编码",
"报工人员名称": "报工人员名称",
"派工数量": "派工数量",
"不合格原因": "不合格原因",
"实际工时": "实际工时",
"计划完成时间": "计划完成时间",
"合格率": "合格率",
"车间编号": "车间编号",
"不合格时间": "不合格时间",
"不合格备注": "不合格备注"
} }
<template>
<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-item :label="$t('项目号')" prop="customerProjectNo">
<el-input v-model="queryParams.customerProjectNo" :placeholder="$t('请输入项目号')" />
</el-form-item>
<el-form-item :label="$t('订单号')" prop="orderCode">
<el-input v-model="queryParams.orderCode" :placeholder="$t('请输入订单号')" />
</el-form-item>
<el-form-item :label="$t('生产工单')" prop="workorderCode">
<el-input v-model="queryParams.workorderCode" :placeholder="$t('请输入生产工单')" />
</el-form-item>
<el-form-item :label="$t('产品编码')" prop="productCode">
<el-input v-model="queryParams.productCode" :placeholder="$t('请输入产品编码')" />
</el-form-item>
<el-form-item :label="$t('产品名称')" 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="$t('不合格原因')" prop="abnormalReason">
<el-input v-model="queryParams.abnormalReason" >
<el-button slot="append" @click="$refs.reasonSelect.showFlag = true" icon="el-icon-search"></el-button>
</el-input>
</el-form-item>
<el-form-item :label="$t('不合格时间')">
<el-date-picker v-model="daterangePurchaseDate" value-format="yyyy-MM-dd" type="daterange" range-separator="-"
:start-placeholder="$t('common.start_date')" :end-placeholder="$t('common.end_date')"></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{$t('搜索')}}</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{$t('重置')}}</el-button>
</el-form-item>
</el-form>
<el-tabs type="border-card" @tab-click="tabClick">
<el-tab-pane :label="$t('明细')">
<el-table v-loading="loading" :data="tbodys">
<!-- <el-table-column :label="$t('工单类型')" align="center" prop="workorderType" v-if="item.value==='workorderType'">
<template slot-scope="scope">
<dict-tag :options="dict.type.mes_workorder_type" :value="scope.row.workorderType" />
</template>
</el-table-column> -->
<el-table-column :label="item.label" align="center" :prop="item.value" 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>{{ 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="$t('统计')">
<el-row align="center" style="line-height: 40px;">
<el-col :span="1">{{$t('统计方式')}}</el-col>
<el-col :span="4">
<el-select v-model="statisisType" clearable :placeholder="$t('请选择统计方式')">
<el-option v-for="item in statisisList"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
</el-col>
<el-col :span="1">
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{$t('查询')}}</el-button>
</el-col>
</el-row>
<el-table v-loading="loading" :data="tbodys">
<el-table-column :label="item.label" align="center" :prop="item.value" 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>{{ 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"/>
<reasonSelect ref="reasonSelect" showModal @onSelected="onReasonSelected"></reasonSelect>
</div>
</template>
<script>
import i18n from '../../../../i18n/index'
import { getList, getListByProcess, getListByUser, getListByWorkshop, getListByDefect, getListByWorkOrder, getListByWorkstation, getListByWorkunit } from "@/api/mes/proTable/statistAnaly";
import ProcessSelect from "@/components/process/taskSelectSingle.vue";
import ItemSelect from "@/components/itemSelect/single.vue";
import workshopSelect from "@/components/workshopSelect/single.vue";
import WorkuintSelect from "@/components/workunitSelect/single.vue";
import WorkstationSelect from "@/components/workstationSelect/simpletableSingle.vue"
import UserSingleSelect from "@/components/userSelect/single.vue"
import reasonSelect from "@/components/reasonSelect/single.vue"
export default {
name: "ScheduleSetupRule",
components: {UserSingleSelect,ProcessSelect, ItemSelect, workshopSelect, WorkuintSelect, WorkstationSelect,reasonSelect},
dicts: [
"mes_workorder_type",
],
data() {
return {
showQueryLPN: false,
// 遮罩层
loading: true,
selectedRows: [],
tabIndex: 0,
// 选中数组
ids: [],
//dta列表
dtaOptions: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 排产换型对照信息表格数据
tbodys: [],
theaders: [],
// 弹出层标题
title: "",
statisisType: null,
statisisList: [i18n.t('不合格原因'), i18n.t('工单'), i18n.t('车间'), i18n.t('工作中心'), i18n.t('工作单元'), i18n.t('工序'), i18n.t('人员')],
// 是否显示弹出层
open: false,
daterangePurchaseDate: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
defectStatus: true,
"customerProjectNo": null,
"endDate": null,
"orderCode": null,
"processName": null,
"processCode": null,
"processId": null,
"productCode": null,
"productId": null,
"productName": null,
"startDate": null,
"taskCode": null,
"abnormalReason": null,
"workorderCode": null,
"workorderType": null,
"workshopId": null,
"workshopName": null,
"workstationId": null,
"workstationName": null,
"workunitId": null,
"workunitName": null
},
// 表单参数
form: {},
};
},
created() {
this.getList();
},
watch: {
tabIndex: {
handler(val){
if(Number(val) === 0) {
this.theaders = [
{label: i18n.t('工单类型'), value: 'workorderType'},
{label: i18n.t('项目号'), value: 'customerProjectNo'},
{label: i18n.t('订单号'), value: 'orderCode'},
{label: i18n.t('生产工单'), value: 'workorderCode'},
{label: i18n.t('产品编码'), value: 'productCode'},
{label: i18n.t('产品名称'), value: 'productName'},
{label: i18n.t('工序任务'), value: 'taskCode'},
{label: i18n.t('工序名称'), value: 'processName'},
{label: i18n.t('工作中心编码'), value: 'workstationCode'},
{label: i18n.t('工作中心名称'), value: 'workstationName'},
{label: i18n.t('工作单元编码'), value: 'workunitCode'},
{label: i18n.t('工作单元名称'), value: 'workunitName'},
{label: i18n.t('报工人员编码'), value: 'userName'},
{label: i18n.t('报工人员名称'), value: 'nickName'},
{label: i18n.t('派工数量'), value: 'quantity'},
{label: i18n.t('报工数量'), value: 'quantityFeedback'},
{label: i18n.t('合格数量'), value: 'quantityQualify'},
{label: i18n.t('不合格数量'), value: 'quantityUnqualify'},
{label: i18n.t('不合格原因'), value: 'abnormalReason'},
{label: i18n.t('不合格时间'), value: 'feedbackTime'}
]
this.handleQuery()
} else {
this.statisisType = null
this.theaders = []
this.total = 0
}
},
immediate: true
}
},
methods: {
onReasonSelected(row){
if (row != undefined) {
this.queryParams.abnormalReason = row.abnormalReason;
}
},
onWorkstationSelect(row) {
if (row != undefined) {
this.queryParams.workstationName = row.workstationName;
}
},
onWorkunitSelect(row){
if (row != undefined) {
this.queryParams.workunitName = row.workunitName;
}
},
onworkshopSelect(row){
if (row != undefined) {
this.queryParams.workshopName = row.workshopName;
}
},
tabClick(val){
console.log('this.tabIndex', this.tabIndex, val)
this.tabIndex = val.index
},
onItemSelect(row) {
if (row != undefined) {
this.queryParams.productName = row.itemName;
}
},
/** 查询排产换型对照信息列表 */
getList() {
this.loading = true;
this.queryParams['defectStatus'] = true
if (this.daterangePurchaseDate && this.daterangePurchaseDate.length > 0) {
this.queryParams['startDate'] = this.daterangePurchaseDate[0]
this.queryParams['endDate'] = this.daterangePurchaseDate[1]
}
let api = getList
if (Number(this.tabIndex) === 1) {
if(this.statisisType === i18n.t('工单')){
api = getListByWorkOrder
this.theaders = [
{label: i18n.t('工单编码'), value: 'workorderCode'},
{label: i18n.t('工单名称'), value: 'workorderName'},
{label: i18n.t('报工数量'), value: 'quantityFeedback'},
{label: i18n.t('合格数量'), value: 'quantityQualify'},
{label: i18n.t('不合格数量'), value: 'quantityUnqualify'},
{label: i18n.t('合格率'), value: 'qualificationRate'}
]
} else if(this.statisisType === i18n.t('不合格原因')){
api = getListByDefect
this.theaders = [
{label: i18n.t('不合格原因'), value: 'abnormalReason'},
{label: i18n.t('不合格备注'), value: 'abnormalRemark'},
{label: i18n.t('报工数量'), value: 'quantityFeedback'},
{label: i18n.t('合格数量'), value: 'quantityQualify'},
{label: i18n.t('不合格数量'), value: 'quantityUnqualify'},
{label: i18n.t('合格率'), value: 'qualificationRate'}
]
} else if(this.statisisType === i18n.t('车间')){
this.theaders = [
{label: i18n.t('车间编号'), value: 'workshopCode'},
{label: i18n.t('车间名称'), value: 'workshopName'},
{label: i18n.t('报工数量'), value: 'quantityFeedback'},
{label: i18n.t('合格数量'), value: 'quantityQualify'},
{label: i18n.t('不合格数量'), value: 'quantityUnqualify'},
{label: i18n.t('合格率'), value: 'qualificationRate'}
]
api = getListByWorkshop
} else if(this.statisisType === i18n.t('工作中心')){
this.theaders = [
{label: i18n.t('工作中心编号'), value: 'workstationCode'},
{label: i18n.t('工作中心名称'), value: 'workstationName'},
{label: i18n.t('报工数量'), value: 'quantityFeedback'},
{label: i18n.t('合格数量'), value: 'quantityQualify'},
{label: i18n.t('不合格数量'), value: 'quantityUnqualify'},
{label: i18n.t('合格率'), value: 'qualificationRate'}
]
api = getListByWorkstation
} else if(this.statisisType === i18n.t('工作单元')){
this.theaders = [
{label: i18n.t('工作单元编码'), value: 'workunitCode'},
{label: i18n.t('工作单元名称'), value: 'workunitName'},
{label: i18n.t('报工数量'), value: 'quantityFeedback'},
{label: i18n.t('合格数量'), value: 'quantityQualify'},
{label: i18n.t('不合格数量'), value: 'quantityUnqualify'},
{label: i18n.t('合格率'), value: 'qualificationRate'}
]
api = getListByWorkunit
} else if(this.statisisType === i18n.t('工序')){
this.theaders = [
{label: i18n.t('工序编码'), value: 'processCode'},
{label: i18n.t('工序名称'), value: 'processName'},
{label: i18n.t('报工数量'), value: 'quantityFeedback'},
{label: i18n.t('合格数量'), value: 'quantityQualify'},
{label: i18n.t('不合格数量'), value: 'quantityUnqualify'},
{label: i18n.t('合格率'), value: 'qualificationRate'}
]
api = getListByProcess
} else if(this.statisisType === i18n.t('人员')){
this.theaders = [
{label: i18n.t('报工人员编码'), value: 'userName'},
{label: i18n.t('报工人员名称'), value: 'nickName'},
{label: i18n.t('报工数量'), value: 'quantityFeedback'},
{label: i18n.t('合格数量'), value: 'quantityQualify'},
{label: i18n.t('不合格数量'), value: 'quantityUnqualify'},
{label: i18n.t('合格率'), value: 'qualificationRate'}
]
api = getListByUser
}
}
api(this.queryParams).then(response => {
this.tbodys = response.rows;
this.total = response.total;
this.loading = false;
});
},
/** 搜索按钮操作 */
handleQuery() {
if (Number(this.tabIndex) === 1 && !this.statisisType) this.$modal.msgWarnning(this.$t(i18n.t('请选择统计方式')));
this.queryParams.pageNum = 1;
this.getList();
},
onBrandSelected(row){
if (Object.values(row).length > 0) {
this.queryParams.itemTypeId = row.itemTypeId;
this.queryParams.itemTypeName = row.itemTypeName;
}
},
onBrandProcess(row){
if (Object.values(row).length > 0) {
this.queryParams.processName = row.processName;
}
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.selectedRows = selection
this.ids = selection.map(item => item.ruleId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 导出按钮操作 */
handleExport() {
const row = this.selectedRows[0]
this.download('pro/serial/lpn/record/export', {
salesVoucher: row.salesVoucher,
salesVoucherItem: row.salesVoucherItem,
}, `dta_${new Date().getTime()}.xlsx`)
}
}
};
</script>
<template>
<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-item :label="$t('工单类型')" prop="workorderType">
<el-select v-model="queryParams.workorderType" clearable :placeholder="$t('请选择状态')" >
<el-option v-for="dict in dict.type.mes_workorder_type"
:key="dict.value"
:label="dict.label"
:value="dict.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('项目号')" prop="customerProjectNo">
<el-input v-model="queryParams.customerProjectNo" :placeholder="$t('请输入项目号')" />
</el-form-item>
<el-form-item :label="$t('订单号')" prop="orderCode">
<el-input v-model="queryParams.orderCode" :placeholder="$t('请输入订单号')" />
</el-form-item>
<el-form-item :label="$t('生产工单')" prop="workorderCode">
<el-input v-model="queryParams.workorderCode" :placeholder="$t('请输入生产工单')" />
</el-form-item>
<el-form-item :label="$t('任务号')" prop="taskCode">
<el-input v-model="queryParams.taskCode" :placeholder="$t('请输入任务号')" />
</el-form-item>
<el-form-item :label="$t('产品编码')" prop="productCode">
<el-input v-model="queryParams.productCode" :placeholder="$t('请输入产品编码')" />
</el-form-item>
<el-form-item :label="$t('产品名称')" 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="$t('工序')" 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="$t('车间')" 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="$t('common.workstation')" 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="$t('common.workunit')" 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="$t('报工人员')" 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="$t('报工时间')">
<el-date-picker v-model="daterangePurchaseDate" value-format="yyyy-MM-dd" type="daterange" range-separator="-"
:start-placeholder="$t('common.start_date')" :end-placeholder="$t('common.end_date')"></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{$t('搜索')}}</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{$t('重置')}}</el-button>
</el-form-item>
</el-form>
<el-tabs type="border-card" @tab-click="tabClick">
<el-tab-pane :label="$t('明细')">
<el-table v-loading="loading" :data="tbodys">
<!-- <el-table-column :label="$t('工单类型')" align="center" prop="workorderType" v-if="item.value==='workorderType'">
<template slot-scope="scope">
<dict-tag :options="dict.type.mes_workorder_type" :value="scope.row.workorderType" />
</template>
</el-table-column> -->
<el-table-column :label="item.label" align="center" :prop="item.value" 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>{{ 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="$t('统计')">
<el-row align="center" style="line-height: 40px;">
<el-col :span="1">{{$t('统计方式')}}</el-col>
<el-col :span="4">
<el-select v-model="statisisType" clearable :placeholder="$t('请选择统计方式')">
<el-option v-for="item in statisisList"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
</el-col>
<el-col :span="1">
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{$t('查询')}}</el-button>
</el-col>
</el-row>
<el-table v-loading="loading" :data="tbodys">
<el-table-column :label="item.label" align="center" :prop="item.value" 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>{{ 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 i18n from '../../../../i18n/index'
import { getList, getListByProcess, getListByUser, getListByWorkshop, getListByWorkOrder, getListByWorkstation, getListByWorkunit } from "@/api/mes/proTable/statistAnaly";
import ProcessSelect from "@/components/process/taskSelectSingle.vue";
import ItemSelect from "@/components/itemSelect/single.vue";
import workshopSelect from "@/components/workshopSelect/single.vue";
import WorkuintSelect from "@/components/workunitSelect/single.vue";
import WorkstationSelect from "@/components/workstationSelect/simpletableSingle.vue"
import UserSingleSelect from "@/components/userSelect/single.vue"
export default {
name: "ScheduleSetupRule",
components: {UserSingleSelect,ProcessSelect, ItemSelect, workshopSelect, WorkuintSelect, WorkstationSelect},
dicts: [
"mes_workorder_type",
],
data() {
return {
showQueryLPN: false,
// 遮罩层
loading: true,
selectedRows: [],
tabIndex: 0,
// 选中数组
ids: [],
//dta列表
dtaOptions: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 排产换型对照信息表格数据
tbodys: [],
theaders: [],
// 弹出层标题
title: "",
statisisType: null,
statisisList: [i18n.t('工单'), i18n.t('车间'), i18n.t('工作中心'), i18n.t('工作单元'), i18n.t('工序'), i18n.t('人员')],
// 是否显示弹出层
open: false,
daterangePurchaseDate: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
"customerProjectNo": null,
"endDate": null,
"orderCode": null,
"processName": null,
"processCode": null,
"processId": null,
"productCode": null,
"productId": null,
"productName": null,
"startDate": null,
"taskCode": null,
"userName": null,
"nickName": null,
"workorderCode": null,
"workorderType": null,
"workshopId": null,
"workshopName": null,
"workstationId": null,
"workstationName": null,
"workunitId": null,
"workunitName": null
},
// 表单参数
form: {},
};
},
created() {
this.getList();
},
watch: {
tabIndex: {
handler(val){
if(Number(val) === 0) {
this.theaders = [
{label: i18n.t('工单类型'), value: 'workorderType'},
{label: i18n.t('项目号'), value: 'customerProjectNo'},
{label: i18n.t('订单号'), value: 'orderCode'},
{label: i18n.t('生产工单'), value: 'workorderCode'},
{label: i18n.t('产品编码'), value: 'productCode'},
{label: i18n.t('产品名称'), value: 'productName'},
{label: i18n.t('工序任务'), value: 'taskCode'},
{label: i18n.t('工序名称'), value: 'processName'},
{label: i18n.t('工作中心编码'), value: 'workstationCode'},
{label: i18n.t('工作中心名称'), value: 'workstationName'},
{label: i18n.t('工作单元编码'), value: 'workunitCode'},
{label: i18n.t('工作单元名称'), value: 'workunitName'},
{label: i18n.t('报工人员编码'), value: 'userName'},
{label: i18n.t('报工人员名称'), value: 'nickName'},
{label: i18n.t('派工数量'), value: 'quantity'},
{label: i18n.t('报工数量'), value: 'quantityFeedback'},
{label: i18n.t('合格数量'), value: 'quantityQualify'},
{label: i18n.t('不合格数量'), value: 'quantityUnqualify'},
{label: i18n.t('不合格原因'), value: 'abnormalReason'},
{label: i18n.t('标准工时'), value: 'stdWorkingTime'},
{label: i18n.t('实际工时'), value: 'machineTime'},
{label: i18n.t('计划完成时间'), value: 'scheduleEndDate'},
{label: i18n.t('报工时间'), value: 'feedbackTime'}
]
this.handleQuery()
} else {
this.statisisType = null
this.theaders = []
this.total = 0
}
},
immediate: true
}
},
methods: {
onUserSelected(row){
if (row != undefined) {
console.log('rrr', row)
this.queryParams.nickName = row.nickName;
}
},
onWorkstationSelect(row) {
if (row != undefined) {
this.queryParams.workstationName = row.workstationName;
}
},
onWorkunitSelect(row){
if (row != undefined) {
this.queryParams.workunitName = row.workunitName;
}
},
onworkshopSelect(row){
if (row != undefined) {
this.queryParams.workshopName = row.workshopName;
}
},
tabClick(val){
console.log('this.tabIndex', this.tabIndex, val)
this.tabIndex = val.index
},
onItemSelect(row) {
if (row != undefined) {
this.queryParams.productName = row.itemName;
}
},
/** 查询排产换型对照信息列表 */
getList() {
this.loading = true;
if (this.daterangePurchaseDate && this.daterangePurchaseDate.length > 0) {
this.queryParams['startDate'] = this.daterangePurchaseDate[0]
this.queryParams['endDate'] = this.daterangePurchaseDate[1]
}
let api = getList
if (Number(this.tabIndex) === 1) {
if(this.statisisType === i18n.t('工单')){
api = getListByWorkOrder
this.theaders = [
{label: i18n.t('工单编码'), value: 'workorderCode'},
{label: i18n.t('工单名称'), value: 'workorderName'},
{label: i18n.t('报工数量'), value: 'quantityFeedback'},
{label: i18n.t('合格数量'), value: 'quantityQualify'},
{label: i18n.t('不合格数量'), value: 'quantityUnqualify'},
{label: i18n.t('合格率'), value: 'qualificationRate'}
]
} else if(this.statisisType === i18n.t('车间')){
this.theaders = [
{label: i18n.t('车间编号'), value: 'workshopCode'},
{label: i18n.t('车间名称'), value: 'workshopName'},
{label: i18n.t('报工数量'), value: 'quantityFeedback'},
{label: i18n.t('合格数量'), value: 'quantityQualify'},
{label: i18n.t('不合格数量'), value: 'quantityUnqualify'},
{label: i18n.t('合格率'), value: 'qualificationRate'}
]
api = getListByWorkshop
} else if(this.statisisType === i18n.t('工作中心')){
this.theaders = [
{label: i18n.t('工作中心编号'), value: 'workstationCode'},
{label: i18n.t('工作中心名称'), value: 'workstationName'},
{label: i18n.t('报工数量'), value: 'quantityFeedback'},
{label: i18n.t('合格数量'), value: 'quantityQualify'},
{label: i18n.t('不合格数量'), value: 'quantityUnqualify'},
{label: i18n.t('合格率'), value: 'qualificationRate'}
]
api = getListByWorkstation
} else if(this.statisisType === i18n.t('工作单元')){
this.theaders = [
{label: i18n.t('工作单元编码'), value: 'workunitCode'},
{label: i18n.t('工作单元名称'), value: 'workunitName'},
{label: i18n.t('报工数量'), value: 'quantityFeedback'},
{label: i18n.t('合格数量'), value: 'quantityQualify'},
{label: i18n.t('不合格数量'), value: 'quantityUnqualify'},
{label: i18n.t('合格率'), value: 'qualificationRate'}
]
api = getListByWorkunit
} else if(this.statisisType === i18n.t('工序')){
this.theaders = [
{label: i18n.t('工序编码'), value: 'processCode'},
{label: i18n.t('工序名称'), value: 'processName'},
{label: i18n.t('报工数量'), value: 'quantityFeedback'},
{label: i18n.t('合格数量'), value: 'quantityQualify'},
{label: i18n.t('不合格数量'), value: 'quantityUnqualify'},
{label: i18n.t('合格率'), value: 'qualificationRate'}
]
api = getListByProcess
} else if(this.statisisType === i18n.t('人员')){
this.theaders = [
{label: i18n.t('报工人员编码'), value: 'userName'},
{label: i18n.t('报工人员名称'), value: 'nickName'},
{label: i18n.t('报工数量'), value: 'quantityFeedback'},
{label: i18n.t('合格数量'), value: 'quantityQualify'},
{label: i18n.t('不合格数量'), value: 'quantityUnqualify'},
{label: i18n.t('合格率'), value: 'qualificationRate'}
]
api = getListByUser
}
}
api(this.queryParams).then(response => {
this.tbodys = response.rows;
this.total = response.total;
this.loading = false;
});
},
/** 搜索按钮操作 */
handleQuery() {
if (Number(this.tabIndex) === 1 && !this.statisisType) this.$modal.msgWarnning(this.$t(i18n.t('请选择统计方式')));
this.queryParams.pageNum = 1;
this.getList();
},
onBrandSelected(row){
if (Object.values(row).length > 0) {
this.queryParams.itemTypeId = row.itemTypeId;
this.queryParams.itemTypeName = row.itemTypeName;
}
},
onBrandProcess(row){
if (Object.values(row).length > 0) {
this.queryParams.processName = row.processName;
}
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.selectedRows = selection
this.ids = selection.map(item => item.ruleId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 导出按钮操作 */
handleExport() {
const row = this.selectedRows[0]
this.download('pro/serial/lpn/record/export', {
salesVoucher: row.salesVoucher,
salesVoucherItem: row.salesVoucherItem,
}, `dta_${new Date().getTime()}.xlsx`)
}
}
};
</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