更新
This commit is contained in:
parent
b28816f515
commit
3e13028f9f
@ -15,7 +15,7 @@ export function updatecostOriginRatioHis(data) {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 获得原片良品率
|
||||
// 获得原片产线良品率
|
||||
export function getcostOriginRatioHisPage(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-origin-ratio-his/page',
|
||||
@ -24,6 +24,15 @@ export function getcostOriginRatioHisPage(query) {
|
||||
})
|
||||
}
|
||||
|
||||
// 获得原片工段良品率
|
||||
export function getcostOriginWSRatioHisPage(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-origin-ratio-his/page-ws',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 导出原片良品率 Excel
|
||||
export function exportcostOriginRatioHisExcel(query) {
|
||||
return request({
|
||||
@ -34,3 +43,14 @@ export function exportcostOriginRatioHisExcel(query) {
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 导出原片良品率 工段Excel
|
||||
export function exportcostOriginWSRatioHisExcel(query) {
|
||||
return request({
|
||||
url: '/monitoring/cost-origin-ratio-his/export-excel-ws',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2024-09-05 15:33:16
|
||||
* @LastEditTime: 2025-06-13 10:59:54
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -15,7 +15,9 @@
|
||||
label-width="80px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产线" prop="bindObjectName">
|
||||
<el-form-item
|
||||
:label="activeName === 'his' ? '产线' : '工段'"
|
||||
prop="bindObjectName">
|
||||
<el-input
|
||||
style="width: 100%"
|
||||
v-model="dataForm.bindObjectName"
|
||||
@ -33,7 +35,7 @@
|
||||
placeholder="选择所属日期"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-col :span="12" v-if="activeName === 'his'">
|
||||
<el-form-item label="厚度" prop="thick">
|
||||
<el-input-number
|
||||
:min="0"
|
||||
@ -43,7 +45,7 @@
|
||||
placeholder="请输入厚度" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-col :span="12" v-if="activeName === 'his'">
|
||||
<el-form-item label="在线速度" prop="speed">
|
||||
<el-input-number
|
||||
:min="0"
|
||||
@ -53,7 +55,7 @@
|
||||
placeholder="请输入在线速度" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-col :span="12" v-if="activeName === 'his'">
|
||||
<el-form-item label="掰边宽度" prop="width">
|
||||
<el-input-number
|
||||
:min="0"
|
||||
@ -64,25 +66,27 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="拉引量" prop="inArea">
|
||||
<el-form-item
|
||||
:label="activeName === 'his' ? '拉引量' : '进片数'"
|
||||
prop="inArea">
|
||||
<el-input-number
|
||||
:min="0"
|
||||
style="width: 85%"
|
||||
v-model="dataForm.inArea"
|
||||
clearable
|
||||
placeholder="请输入拉引量" />
|
||||
(m²)
|
||||
clearable />
|
||||
{{ activeName === 'his' ? '(m²)' : '片' }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="下片面积" prop="outArea">
|
||||
<el-form-item
|
||||
:label="activeName === 'his' ? '下片面积' : '出片数'"
|
||||
prop="outArea">
|
||||
<el-input-number
|
||||
:min="0"
|
||||
style="width: 85%"
|
||||
v-model="dataForm.outArea"
|
||||
clearable
|
||||
placeholder="请输入下片面积" />
|
||||
(m²)
|
||||
clearable />
|
||||
{{ activeName === 'his' ? '(m²)' : '片' }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@ -129,10 +133,12 @@ export default {
|
||||
recTime: undefined,
|
||||
},
|
||||
dataRule: {},
|
||||
activeName: 'his',
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init(val, statisticType) {
|
||||
init(val, statisticType, activeName) {
|
||||
this.activeName = activeName;
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields();
|
||||
@ -148,17 +154,22 @@ export default {
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
const udata = {
|
||||
let udata = {
|
||||
id: this.dataForm.id,
|
||||
statisticType: this.dataForm.statisticType,
|
||||
modifyThick: this.dataForm.thick,
|
||||
modifySpeed: this.dataForm.speed,
|
||||
modifyWidth: this.dataForm.width,
|
||||
modifyInArea: this.dataForm.inArea,
|
||||
modifyOutArea: this.dataForm.outArea,
|
||||
modifyRatio:
|
||||
this.dataForm.ratio >= 0 ? this.dataForm.ratio / 100 : '',
|
||||
};
|
||||
if (this.activeName === 'his') {
|
||||
udata = {
|
||||
...udata,
|
||||
modifyThick: this.dataForm.thick,
|
||||
modifySpeed: this.dataForm.speed,
|
||||
modifyWidth: this.dataForm.width,
|
||||
};
|
||||
}
|
||||
// 修改的提交
|
||||
this.urlOptions.updateURL(udata).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
|
@ -1,42 +1,71 @@
|
||||
<template>
|
||||
<div class="app-container energyOverlimitLog">
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="listQuery.pageNo"
|
||||
:limit="listQuery.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="tableData"
|
||||
:max-height="tableH">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="80"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
</base-table>
|
||||
<pagination
|
||||
:page.sync="listQuery.pageNo"
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList" />
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width="50%">
|
||||
<add-or-update
|
||||
ref="addOrUpdate"
|
||||
:name-arr="formConfig[1].selectOptions"
|
||||
@refreshDataList="successSubmit"></add-or-update>
|
||||
</base-dialog>
|
||||
<div>
|
||||
<div style="background: #f2f4f9; height: 40px; width: 100%">
|
||||
<ButtonNav :menus="['产线良品率', '工段良品率']" @change="currentMenu">
|
||||
<template v-slot:tab1>
|
||||
<div>产线良品率</div>
|
||||
</template>
|
||||
<template v-slot:tab2>
|
||||
<div>工段良品率</div>
|
||||
</template>
|
||||
</ButtonNav>
|
||||
</div>
|
||||
<div class="app-container energyOverlimitLog">
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<!-- 列表 -->
|
||||
<div v-if="activeName === 'his'">
|
||||
<base-table
|
||||
:page="listQuery.pageNo"
|
||||
:limit="listQuery.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="tableData"
|
||||
:max-height="tableH">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="80"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
</base-table>
|
||||
</div>
|
||||
<div v-if="activeName === 'now'">
|
||||
<base-table
|
||||
:page="listQuery.pageNo"
|
||||
:limit="listQuery.pageSize"
|
||||
:table-props="tableProps2"
|
||||
:table-data="tableData2"
|
||||
:max-height="tableH">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="80"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
</base-table>
|
||||
</div>
|
||||
<pagination
|
||||
:page.sync="listQuery.pageNo"
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:total="listQuery.total"
|
||||
@pagination="getNavDataList" />
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width="50%">
|
||||
<add-or-update
|
||||
ref="addOrUpdate"
|
||||
:name-arr="formConfig[1].selectOptions"
|
||||
@refreshDataList="successSubmit"></add-or-update>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -44,9 +73,17 @@
|
||||
import AddOrUpdate from './add-or-updata';
|
||||
import basicPage from '@/mixins/basic-page';
|
||||
import { getLinePage } from '@/api/base/productionLine';
|
||||
import { getcostOriginRatioHisPage,exportcostOriginRatioHisExcel } from '@/api/cost/costOriginRatioHis';
|
||||
import {
|
||||
getcostOriginRatioHisPage,
|
||||
getcostOriginWSRatioHisPage,
|
||||
exportcostOriginWSRatioHisExcel,
|
||||
exportcostOriginRatioHisExcel,
|
||||
} from '@/api/cost/costOriginRatioHis';
|
||||
import { parseTime } from '@/filter/code-filter';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
import ButtonNav from '@/components/ButtonNav';
|
||||
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'time',
|
||||
@ -93,6 +130,41 @@ const tableProps = [
|
||||
filter: (val) => (val ? Number(val * 100).toFixed(2) + '%' : '-'),
|
||||
},
|
||||
];
|
||||
const tableProps2 = [
|
||||
{
|
||||
prop: 'time',
|
||||
label: '日期',
|
||||
width:130,
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注',
|
||||
},
|
||||
{
|
||||
prop: 'bindObjectName',
|
||||
label: '工段',
|
||||
width:145,
|
||||
},
|
||||
{
|
||||
prop: 'spec',
|
||||
label: '规格',
|
||||
},
|
||||
{
|
||||
prop: 'inArea',
|
||||
label: '进片数',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'outArea',
|
||||
label: '出片数',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'ratio',
|
||||
label: '良品率',
|
||||
filter: (val) => (val ? Number(val * 100).toFixed(2) + '%' : '-'),
|
||||
},
|
||||
];
|
||||
export default {
|
||||
name: 'costOriginRatioHis',
|
||||
mixins: [basicPage, tableHeightMixin],
|
||||
@ -124,13 +196,15 @@ export default {
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间范围',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
dateType: 'datetimerange',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
defaultTime: ['08:30:00', '08:30:00'],
|
||||
param: 'searchTime',
|
||||
width: 350,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@ -151,23 +225,27 @@ export default {
|
||||
listQuery: {
|
||||
statisticType: 1,
|
||||
},
|
||||
activeName: 'his',
|
||||
tableProps,
|
||||
tableProps2,
|
||||
tableBtn: [{
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
].filter((v) => v),
|
||||
tableData: [],
|
||||
tableData2: [],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
ButtonNav,
|
||||
},
|
||||
created() {
|
||||
const params ={
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
pdType: 1
|
||||
pdType: 0
|
||||
}
|
||||
getLinePage(params).then((response) => {
|
||||
this.formConfig[1].selectOptions = response.data.list;
|
||||
@ -183,9 +261,13 @@ export default {
|
||||
this.listQuery.statisticType = val.statisticType || 1;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
? val.searchTime[1]
|
||||
: null;
|
||||
this.getDataList();
|
||||
if (this.activeName === 'his') {
|
||||
this.getDataList();
|
||||
} else {
|
||||
this.getDataList2();
|
||||
}
|
||||
break;
|
||||
case 'add':
|
||||
this.addOrUpdateHandle();
|
||||
@ -197,7 +279,7 @@ export default {
|
||||
this.listQuery.statisticType = val.statisticType || 1;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
? val.searchTime[1]
|
||||
: null;
|
||||
this.handleExport();
|
||||
break;
|
||||
@ -205,23 +287,74 @@ export default {
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
currentMenu(val) {
|
||||
this.activeName = val === '产线良品率' ? 'his' : 'now';
|
||||
if (this.activeName === 'his') {
|
||||
this.$refs.searchBarForm.resetForm();
|
||||
this.listQuery.bindObjectId = null;
|
||||
this.listQuery.startTime = null;
|
||||
this.listQuery.endTime = null;
|
||||
this.listQuery.statisticType = 1;
|
||||
this.listQuery.pageNo = 1;
|
||||
this.getDataList();
|
||||
} else {
|
||||
this.$refs.searchBarForm.resetForm();
|
||||
this.listQuery.bindObjectId = null;
|
||||
this.listQuery.startTime = null;
|
||||
this.listQuery.endTime = null;
|
||||
this.listQuery.statisticType = 1;
|
||||
this.listQuery.pageNo = 1;
|
||||
this.getDataList2();
|
||||
}
|
||||
},
|
||||
// 获取数据2列表
|
||||
getDataList2() {
|
||||
getcostOriginWSRatioHisPage(this.listQuery).then((response) => {
|
||||
this.tableData2 = response.data.list;
|
||||
this.listQuery.total = response.data.total;
|
||||
});
|
||||
},
|
||||
//tableBtn点击
|
||||
handleClick(val) {
|
||||
if (val.type === 'edit') {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrEditTitle = '编辑';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(val.data, this.listQuery.statisticType);
|
||||
this.$refs.addOrUpdate.init(
|
||||
val.data,
|
||||
this.listQuery.statisticType,
|
||||
this.activeName
|
||||
);
|
||||
});
|
||||
} else {
|
||||
this.otherMethods(val);
|
||||
}
|
||||
},
|
||||
getNavDataList(){
|
||||
if (this.activeName === 'his') {
|
||||
this.getDataList();
|
||||
} else {
|
||||
this.getDataList2();
|
||||
}
|
||||
},
|
||||
successSubmit() {
|
||||
this.handleCancel();
|
||||
if (this.activeName === 'his') {
|
||||
this.getDataList();
|
||||
} else {
|
||||
this.getDataList2();
|
||||
}
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
let exportURL, title;
|
||||
if (this.activeName === 'his') {
|
||||
exportURL = exportcostOriginRatioHisExcel;
|
||||
title = '原片成本-原片良品率';
|
||||
title = '原片-产线良品率';
|
||||
} else {
|
||||
exportURL = exportcostOriginWSRatioHisExcel;
|
||||
title = '原片-工段良品率';
|
||||
}
|
||||
// 处理查询参数
|
||||
let params = { ...this.listQuery };
|
||||
params.pageNo = undefined;
|
||||
|
Loading…
Reference in New Issue
Block a user