This commit is contained in:
2025-10-30 13:37:52 +08:00
parent d859ba62c8
commit c9c8f82910
31 changed files with 1485 additions and 397 deletions

View File

@@ -1,6 +1,6 @@
<template>
<div>
<div style="background: #f2f4f9; height: 40px; width: 100%">
<!-- <div style="background: #f2f4f9; height: 40px; width: 100%">
<ButtonNav :menus="['按日期', '按规格']" @change="currentMenu">
<template v-slot:tab1>
<div>按日期</div>
@@ -9,7 +9,7 @@
<div>按规格</div>
</template>
</ButtonNav>
</div>
</div> -->
<div class="app-container energyOverlimitLog">
<div v-show="activeName === 'his'">
<!-- 搜索工作栏 -->
@@ -54,7 +54,7 @@
:page.sync="listQuery.pageNo"
:limit.sync="listQuery.pageSize"
:total="listQuery.total"
@pagination="getDataList" />
@pagination="getNavDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@@ -86,32 +86,36 @@ import ButtonNav from '@/components/ButtonNav';
const tableProps = [
{
prop: 'recTime',
prop: 'time',
label: '日期',
filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
},
{
prop: 'originArea',
label: '原片下片面积',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
{
prop: 'deepArea',
label: '深加工下片面积',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
{
prop: 'originPrice',
label: '原片成本/元',
align: 'right',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
{
prop: 'deepPrice',
label: '深加工成本/元',
align: 'right',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
{
prop: 'price',
label: '总成本/元',
align: 'right',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
];
const tableProps2 = [
@@ -244,19 +248,12 @@ export default {
},
methods: {
buttonClick(val) {
if (val.statisticType === 2) {
this.tableProps[0].filter = (val) =>
parseTime(val, '{y}年第{w}周');
}else{
this.tableProps[0].filter = (val) =>
parseTime(val, '{y}年{m}月{d}日');
}
this.formConfig2[0].startPlaceholder = '开始时间';
this.formConfig2[0].endPlaceholder = '结束时间';
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.pageSize = 20;
this.listQuery.bindObjectId = val.name || null;
this.listQuery.statisticType = val.statisticType || 1;
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
@@ -274,7 +271,7 @@ export default {
break;
case 'export':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.pageSize = 20;
this.listQuery.bindObjectId = val.name || null;
this.listQuery.statisticType = val.statisticType || 1;
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
@@ -334,12 +331,19 @@ export default {
this.otherMethods(val);
}
},
getNavDataList(){
if (this.activeName === 'his') {
this.getDataList();
} else {
this.getDataList2();
}
},
/** 导出按钮操作 */
handleExport() {
let exportURL, title;
if (this.activeName === 'his') {
exportURL = exportCostSumExcel;
title = '总成本统计-按日期';
title = '总成本统计';
} else {
exportURL = exportRawStatisticsRealtimeExcel;
title = '总成本统计-按规格';

View File

@@ -77,7 +77,7 @@ export default {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.pageSize = 20;
this.listQuery.name = val.name||null;
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
this.listQuery.endTime = val.searchTime
@@ -90,7 +90,7 @@ export default {
break;
case 'export':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.pageSize = 20;
this.listQuery.name = val.name;
this.listQuery.recTime = val.searchTime;
this.handleExport();

View File

@@ -54,7 +54,7 @@
:page.sync="listQuery.pageNo"
:limit.sync="listQuery.pageSize"
:total="listQuery.total"
@pagination="getDataList" />
@pagination="getNavDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@@ -86,24 +86,27 @@ import ButtonNav from '@/components/ButtonNav';
const tableProps = [
{
prop: 'recTime',
prop: 'time',
label: '日期',
filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
},
{
prop: 'remark',
label: '备注',
},
{
prop: 'energyTypeName',
label: '能源类型',
},
{
prop: 'bindObjectName',
label: '监控对象',
filter: (val) => (val != null ? val : '--'),
},
{
prop: 'meterName',
label: '抄表名',
filter: (val) => (val != null ? val : '--'),
},
// {
// prop: 'bindObjectName',
// label: '监控对象',
// filter: (val) => (val != null ? val : '--'),
// },
// {
// prop: 'meterName',
// label: '抄表名',
// filter: (val) => (val != null ? val : '--'),
// },
{
prop: 'quantity',
label: '累计使用量',
@@ -115,20 +118,24 @@ const tableProps = [
},
];
const tableProps2 = [
{
prop: 'remark',
label: '备注',
},
{
prop: 'energyTypeName',
label: '能源类型',
},
{
prop: 'bindObjectName',
label: '监控对象',
filter: (val) => (val != null ? val : '--'),
},
{
prop: 'meter',
label: '抄表名',
filter: (val) => (val != null ? val : '--'),
},
// {
// prop: 'bindObjectName',
// label: '监控对象',
// filter: (val) => (val != null ? val : '--'),
// },
// {
// prop: 'meter',
// label: '抄表名',
// filter: (val) => (val != null ? val : '--'),
// },
{
prop: 'quantity',
label: '累计使用量',
@@ -207,13 +214,16 @@ 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,
clearable: false,
},
{
type: 'button',
@@ -262,26 +272,18 @@ export default {
},
methods: {
buttonClick(val) {
if (val.statisticType === 2) {
this.tableProps[0].filter = (val) =>
parseTime(val, '{y}年第{w}周');
}else{
this.tableProps[0].filter = (val) =>
parseTime(val, '{y}年{m}月{d}日');
}
this.formConfig2[1].startPlaceholder = '开始时间';
this.formConfig2[1].endPlaceholder = '结束时间';
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.pageSize = 20;
this.listQuery.energyTypeId = val.name || null;
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'
: null;
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : null;
if (this.activeName === 'his') {
this.listQuery.endTime = val.searchTime
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
: null;
this.getDataList();
} else {
this.getDataList2();
@@ -292,13 +294,18 @@ export default {
break;
case 'export':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.pageSize = 20;
this.listQuery.energyTypeId = val.name || null;
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;
if (this.activeName === 'his') {
this.listQuery.endTime = val.searchTime
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
: null;
}
this.handleExport();
break;
default:
@@ -320,15 +327,26 @@ export default {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 00:00:00';
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 23:59:59';
this.formConfig2[1].startPlaceholder = parseTime(start).substr(0, 10);
this.formConfig2[1].endPlaceholder = parseTime(end).substr(0, 10);
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 08:30:00';
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 08:30:00';
this.$nextTick(() => {
this.$refs.searchBarForm2.formInline.searchTime = [
this.listQuery.startTime,
this.listQuery.endTime,
];
});
this.listQuery.name = null;
this.listQuery.pageNo = 1;
this.getDataList2();
}
},
getNavDataList(){
if (this.activeName === 'his') {
this.getDataList();
} else {
this.getDataList2();
}
},
// 获取数据2列表
getDataList2() {
if (this.listQuery.startTime) {

View File

@@ -54,7 +54,7 @@
:page.sync="listQuery.pageNo"
:limit.sync="listQuery.pageSize"
:total="listQuery.total"
@pagination="getDataList" />
@pagination="getNavDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@@ -87,9 +87,12 @@ import ButtonNav from '@/components/ButtonNav';
const tableProps = [
{
prop: 'recTime',
prop: 'time',
label: '日期',
filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
},
{
prop: 'remark',
label: '备注',
},
{
prop: 'otherCostName',
@@ -99,9 +102,14 @@ const tableProps = [
prop: 'price',
label: '总价(元)',
align: 'right',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
];
const tableProps2 = [
// {
// prop: 'remark',
// label: '备注',
// },
{
prop: 'otherCostName',
label: '成本名称',
@@ -110,6 +118,7 @@ const tableProps2 = [
prop: 'price',
label: '总价(元)',
align: 'right',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
];
export default {
@@ -182,13 +191,16 @@ 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,
clearable: false,
},
{
type: 'button',
@@ -237,26 +249,20 @@ export default {
},
methods: {
buttonClick(val) {
if (val.statisticType === 2) {
this.tableProps[0].filter = (val) =>
parseTime(val, '{y}年第{w}周');
}else{
this.tableProps[0].filter = (val) =>
parseTime(val, '{y}年{m}月{d}日');
}
this.formConfig2[1].startPlaceholder = '开始时间';
this.formConfig2[1].endPlaceholder = '结束时间';
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.pageSize = 20;
this.listQuery.name = val.name || null;
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;
if (this.activeName === 'his') {
this.listQuery.endTime = val.searchTime
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
: null;
this.getDataList();
} else {
this.getDataList2();
@@ -267,13 +273,18 @@ export default {
break;
case 'export':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.pageSize = 20;
this.listQuery.name = val.name || null;
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;
if (this.activeName === 'his') {
this.listQuery.endTime = val.searchTime
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
: null;
}
this.handleExport();
break;
default:
@@ -295,15 +306,26 @@ export default {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 00:00:00';
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 23:59:59';
this.formConfig2[1].startPlaceholder = parseTime(start).substr(0, 10);
this.formConfig2[1].endPlaceholder = parseTime(end).substr(0, 10);
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 08:30:00';
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 08:30:00';
this.$nextTick(() => {
this.$refs.searchBarForm2.formInline.searchTime = [
this.listQuery.startTime,
this.listQuery.endTime,
];
});
this.listQuery.name = null;
this.listQuery.pageNo = 1;
this.getDataList2();
}
},
getNavDataList(){
if (this.activeName === 'his') {
this.getDataList();
} else {
this.getDataList2();
}
},
// 获取数据2列表
getDataList2() {
getRawOthercostSunPage(this.listQuery).then((response) => {

View File

@@ -65,6 +65,7 @@ const tableProps = [
prop: 'price',
label: '成本金额',
align: 'right',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
{
prop: 'remark',
@@ -161,7 +162,7 @@ export default {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.pageSize = 20;
this.listQuery.name = val.name||null;
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
this.listQuery.endTime = val.searchTime
@@ -174,7 +175,7 @@ export default {
break;
case 'export':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.pageSize = 20;
this.listQuery.name = val.name||null;
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
this.listQuery.endTime = val.searchTime

View File

@@ -10,9 +10,9 @@
<span>
{{
injectData.type == 1
? `每天等价,${injectData.price}`
? `每天等价,${Number(injectData.price)}`
: injectData.type == 2
? `总价${injectData.price}元,年折旧率${injectData.ratio}%,折旧年限${injectData.timeLimit}`
? `总价${Number(injectData.price)}元,年折旧率${injectData.ratio}%,折旧年限${injectData.timeLimit}`
: '-'
}}
</span>

View File

@@ -52,7 +52,7 @@
:page.sync="listQuery.pageNo"
:limit.sync="listQuery.pageSize"
:total="listQuery.total"
@pagination="getDataList" />
@pagination="getNavDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@@ -85,9 +85,12 @@ import ButtonNav from '@/components/ButtonNav';
const tableProps = [
{
prop: 'recTime',
prop: 'time',
label: '日期',
filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
},
{
prop: 'remark',
label: '备注',
},
{
prop: 'productionLineName',
@@ -100,22 +103,27 @@ const tableProps = [
{
prop: 'innum',
label: '上片数量',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
{
prop: 'outnum',
label: '下片数量',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
{
prop: 'ratio',
label: '良品率',
filter: (val) => (val ? val * 100 + '%' : '-'),
filter: (val) => (val ? Number(val * 100).toFixed(2) + '%' : '-'),
},
];
const tableProps2 = [
{
prop: 'recTime',
prop: 'time',
label: '日期',
filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
},
{
prop: 'remark',
label: '备注',
},
{
prop: 'productionLineName',
@@ -128,15 +136,17 @@ const tableProps2 = [
{
prop: 'innum',
label: '进片数量',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
{
prop: 'outnum',
label: '出片数量',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
{
prop: 'ratio',
label: '良品率',
filter: (val) => (val ? val * 100 + '%' : '-'),
filter: (val) => (val ? Number(val * 100).toFixed(2) + '%' : '-'),
},
];
export default {
@@ -170,13 +180,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',
@@ -225,22 +237,15 @@ export default {
},
methods: {
buttonClick(val) {
if (val.statisticType === 2) {
this.tableProps[0].filter = (val) =>
parseTime(val, '{y}年第{w}周');
}else{
this.tableProps[0].filter = (val) =>
parseTime(val, '{y}年{m}月{d}日');
}
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.pageSize = 20;
this.listQuery.productionLineId = val.name || null;
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;
if (this.activeName === 'his') {
this.getDataList();
@@ -253,12 +258,12 @@ export default {
break;
case 'export':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.pageSize = 20;
this.listQuery.productionLineId = val.name || null;
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;
@@ -309,10 +314,20 @@ export default {
this.otherMethods(val);
}
},
getNavDataList(){
if (this.activeName === 'his') {
this.getDataList();
} else {
this.getDataList2();
}
},
successSubmit() {
this.handleCancel();
const val = this.activeName === 'his' ? '产线良品率' : 'now';
this.currentMenu(val);
if (this.activeName === 'his') {
this.getDataList();
} else {
this.getDataList2();
}
},
/** 导出按钮操作 */
handleExport() {

View File

@@ -54,7 +54,7 @@
:page.sync="listQuery.pageNo"
:limit.sync="listQuery.pageSize"
:total="listQuery.total"
@pagination="getDataList" />
@pagination="getNavDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@@ -87,9 +87,12 @@ import ButtonNav from '@/components/ButtonNav';
const tableProps = [
{
prop: 'recTime',
prop: 'time',
label: '时间',
filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
},
{
prop: 'remark',
label: '备注',
},
{
prop: 'bindObjectName',
@@ -102,33 +105,42 @@ const tableProps = [
{
prop: 'inCount',
label: '上片数量',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
{
prop: 'outCount',
label: '下片数量',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
{
prop: 'ratio',
label: '良品率',
filter: (val) => (val ? val * 100 + '%' : '-'),
filter: (val) => (val ? Number(val * 100).toFixed(2) + '%' : '-'),
},
{
prop: 'costSum',
label: '深加工成本/元',
align: 'right',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
{
prop: 'costPiece',
label: '单片成本/元',
align: 'right',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
{
prop: 'costArea',
label: '每平米成本/元',
align: 'right',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
];
const tableProps2 = [
{
prop: 'remark',
label: '备注',
},
{
prop: 'bindObjectName',
label: '产线',
@@ -140,30 +152,35 @@ const tableProps2 = [
{
prop: 'inCount',
label: '上片数量',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
{
prop: 'outCount',
label: '下片数量',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
{
prop: 'ratio',
label: '良品率',
filter: (val) => (val ? val * 100 + '%' : '-'),
filter: (val) => (val ? Number(val * 100).toFixed(2) + '%' : '-'),
},
{
prop: 'costSum',
label: '深加工成本/元',
align: 'right',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
{
prop: 'costPiece',
label: '单片成本/元',
align: 'right',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
{
prop: 'costArea',
label: '每平米成本/元',
align: 'right',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
];
export default {
@@ -225,13 +242,16 @@ 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,
clearable: false,
},
{
type: 'select',
@@ -288,26 +308,20 @@ export default {
},
methods: {
buttonClick(val) {
if (val.statisticType === 2) {
this.tableProps[0].filter = (val) =>
parseTime(val, '{y}年第{w}周');
}else{
this.tableProps[0].filter = (val) =>
parseTime(val, '{y}年{m}月{d}日');
}
this.formConfig2[0].startPlaceholder = '开始时间';
this.formConfig2[0].endPlaceholder = '结束时间';
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.pageSize = 20;
this.listQuery.bindObjectId = val.name || null;
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;
if (this.activeName === 'his') {
this.listQuery.endTime = val.searchTime
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
: null;
this.getDataList();
} else {
this.getDataList2();
@@ -318,13 +332,18 @@ export default {
break;
case 'export':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.pageSize = 20;
this.listQuery.bindObjectId = val.name || null;
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;
if (this.activeName === 'his') {
this.listQuery.endTime = val.searchTime
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
: null;
}
this.handleExport();
break;
default:
@@ -346,15 +365,26 @@ export default {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 00:00:00';
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 23:59:59';
this.formConfig2[0].startPlaceholder = parseTime(start).substr(0, 10);
this.formConfig2[0].endPlaceholder = parseTime(end).substr(0, 10);
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 08:30:00';
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 08:30:00';
this.$nextTick(() => {
this.$refs.searchBarForm2.formInline.searchTime = [
this.listQuery.startTime,
this.listQuery.endTime,
];
});
this.listQuery.name = null;
this.listQuery.pageNo = 1;
this.getDataList2();
}
},
getNavDataList(){
if (this.activeName === 'his') {
this.getDataList();
} else {
this.getDataList2();
}
},
// 获取数据2列表
getDataList2() {
if (this.listQuery.startTime) {

423
src/views/cost/index.vue Normal file
View File

@@ -0,0 +1,423 @@
<template>
<div class="home-page">
<div class="date-tabs">
<!-- @tab-click="handleClick" -->
<el-tabs v-model="activeName" @tab-click="timedayChange" :stretch="true">
<el-tab-pane
:label="'\u2002\u2002日\u2002\u2002'"
name="日"></el-tab-pane>
<el-tab-pane
:label="'\u2002\u2002周\u2002\u2002'"
name="周"></el-tab-pane>
<el-tab-pane
:label="'\u2002\u2002月\u2002\u2002'"
name="月"></el-tab-pane>
<el-tab-pane
:label="'\u2002\u2002年\u2002\u2002'"
name="年"></el-tab-pane>
</el-tabs>
<div class="detail">
<el-date-picker
v-model="timeday"
align="right"
type="date"
format="yyyy-MM-dd"
valueFormat="yyyy-MM-dd"
:clearable="false"
@change="timedayChange"
placeholder="选择日期"
:picker-options="pickerOptions"></el-date-picker>
</div>
</div>
<el-row class="main-top" :gutter="16">
<el-col :span="24" style="position: relative">
<div class="title">
<svg-icon icon-class="home-produce" />
<span class="title-inner">生产总成本</span>
</div>
<el-row class="box">
<el-col :span="4" class="num-box shadow">
<div class="num-style">{{ homeData.priceS }}万元</div>
<div class="unit-style">总计成本</div>
</el-col>
<el-col :span="4" class="num-box shadow">
<div class="num-style">{{ homeData.matPriceS }}万元</div>
<div class="unit-style">原料成本</div>
</el-col>
<el-col :span="4" class="num-box shadow">
<div class="num-style">{{ homeData.energyPriceS }}万元</div>
<div class="unit-style">能源成本</div>
</el-col>
<el-col :span="4" class="num-box shadow">
<div class="num-style">{{ homeData.otherPriceS }}万元</div>
<div class="unit-style">其他成本</div>
</el-col>
<!-- <el-col :span="4" class="num-box shadow">
<div class="num-style">{{ homeData.ratioS }}</div>
<div class="unit-style">综合良品率/%</div>
</el-col> -->
<el-col :span="4" class="num-box shadow">
<div class="num-style">{{ homeData.areaPriceS }}</div>
<div class="unit-style">综合每平米成本</div>
</el-col>
</el-row>
</el-col>
<el-col :span="24" style="position: relative">
<div class="title">
<svg-icon icon-class="home-produce" />
<span class="title-inner">原片成本</span>
</div>
<el-row class="box">
<el-col :span="4" class="num-box shadow">
<div class="num-style">{{ homeData.priceO }}万元</div>
<div class="unit-style">原片总成本</div>
</el-col>
<el-col :span="4" class="num-box shadow">
<div class="num-style">{{ homeData.matPriceO }}万元</div>
<div class="unit-style">原料成本</div>
</el-col>
<el-col :span="4" class="num-box shadow">
<div class="num-style">{{ homeData.energyPriceO }}万元</div>
<div class="unit-style">能源成本</div>
</el-col>
<el-col :span="4" class="num-box shadow">
<div class="num-style">{{ homeData.otherPriceO }}万元</div>
<div class="unit-style">其他成本</div>
</el-col>
<el-col :span="4" class="num-box shadow">
<div class="num-style">{{ homeData.ratioO }}</div>
<div class="unit-style">原片良品率/%</div>
</el-col>
<el-col :span="4" class="num-box shadow">
<div class="num-style">{{ homeData.areaPriceO }}</div>
<div class="unit-style">原片每平米成本</div>
</el-col>
</el-row>
</el-col>
<el-col :span="24" style="position: relative">
<div class="title">
<svg-icon icon-class="home-produce" />
<span class="title-inner">深加工成本</span>
</div>
<el-row class="box">
<el-col :span="4" class="num-box shadow">
<div class="num-style">{{ homeData.priceD }}万元</div>
<div class="unit-style">深加工总成本</div>
</el-col>
<el-col :span="4" class="num-box shadow">
<div class="num-style">{{ homeData.energyPriceD }}万元</div>
<div class="unit-style">能源成本</div>
</el-col>
<el-col :span="4" class="num-box shadow">
<div class="num-style">{{ homeData.otherPriceD }}万元</div>
<div class="unit-style">其他成本</div>
</el-col>
<el-col :span="4" class="num-box shadow">
<div class="num-style">{{ homeData.ratioD }}</div>
<div class="unit-style">深加工良品率/%</div>
</el-col>
<el-col :span="4" class="num-box shadow">
<div class="num-style">{{ homeData.areaPriceD }}</div>
<div class="unit-style">深加工每平米成本</div>
</el-col>
</el-row>
</el-col>
</el-row>
<el-row class="main-bottom" :gutter="16" v-if="false">
<el-col :span="9">
<div class="chart-wrapper">
<line-chart :chart-data="lineChartData" />
</div>
</el-col>
<el-col :span="7">
<div class="chart-wrapper">
<pie-chart />
</div>
</el-col>
<el-col :span="8">
<div class="chart-wrapper">
<bar-chart />
</div>
</el-col>
</el-row>
<div
class="main-footer"
style="
color: #c7c7c7;
user-select: none;
font-size: 14px;
letter-spacing: 1px;
height: 30px;
display: grid;
place-content: center;
">
&copy; 中建材智能自动化研究院有限公司
</div>
</div>
</template>
<script>
import moment from 'moment';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
import LineChart from '../dashboard/LineChart';
import PieChart from '../dashboard/PieChart';
import BarChart from '../dashboard/BarChart';
import PanelGroup from '../dashboard/PanelGroup';
import { getData } from '@/api/cost/allCost';
import { getUserProfile } from '@/api/system/user';
const lineChartData = {
newVisitis: {
expectedData: [100, 120, 161, 134, 105, 160, 165],
actualData: [120, 82, 91, 154, 162, 140, 145],
},
messages: {
expectedData: [200, 192, 120, 144, 160, 130, 140],
actualData: [180, 160, 151, 106, 145, 150, 130],
},
purchases: {
expectedData: [80, 100, 121, 104, 105, 90, 100],
actualData: [120, 90, 100, 138, 142, 130, 130],
},
shoppings: {
expectedData: [130, 140, 141, 142, 145, 150, 160],
actualData: [120, 82, 91, 154, 162, 140, 130],
},
};
export default {
name: 'Home',
mixins: [tableHeightMixin],
components: {
LineChart,
PieChart,
PanelGroup,
BarChart,
},
computed: {
gradientBackground() {
return {
'background-image':
'linear-gradient(90deg, #f0f0f0 25%, rgba(255, 255, 255, 0) 25%, rgba(255, 255, 255, 0) 50%, #f0f0f0 50%, #f0f0f0 75%, rgba(255, 255, 255, 0) 75%, rgba(255, 255, 255, 0))',
'background-size': '100px 100px', // 调整条纹的大小
};
},
},
data() {
return {
activeName: '日',
user: '',
lineChartData: lineChartData.newVisitis,
homeData: {},
timeday: moment(new Date()).subtract(1, 'days').format('YYYY-MM-DD'),
startTime:
moment(new Date()).subtract(0, 'days').format('YYYY-MM-DD') +
' 00:00:00',
endTime:
moment(new Date()).subtract(-1, 'days').format('YYYY-MM-DD') +
' 00:00:00',
pickerOptions: {
disabledDate(time) {
return time.getTime() + 3600 * 1000 * 24 > Date.now();
},
shortcuts: [
{
text: '今天',
onClick(picker) {
picker.$emit('pick', new Date());
},
},
{
text: '昨天',
onClick(picker) {
const date = new Date();
date.setTime(date.getTime() - 3600 * 1000 * 24);
picker.$emit('pick', date);
},
},
{
text: '一周前',
onClick(picker) {
const date = new Date();
date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit('pick', date);
},
},
],
},
};
},
created() {
},
beforeDestroy() {
},
methods: {
getData() {
let listQuery = {
//分页
pageSize: 10,
pageNo: 1,
statisticType: ['', '日', '周', '月', '年'].indexOf(this.activeName),
startTime: this.timeday + ' 00:00:00',
};
getData(listQuery).then((response) => {
this.homeData = response.data;
for (let i in this.homeData) {
this.homeData[i] = Number(this.homeData[i]).toFixed(2);
}
});
},
timedayChange() {
let listQuery = {
//分页
pageSize: 10,
pageNo: 1,
statisticType: ['', '日', '周', '月', '年'].indexOf(this.activeName),
startTime: this.timeday + ' 00:00:00',
};
getData(listQuery).then((response) => {
this.homeData = response.data;
for (let i in this.homeData) {
this.homeData[i] = Number(this.homeData[i]).toFixed(2);
}
});
},
goDetail() {
this.$router.push({ path: 'indexDetail' });
},
},
};
</script>
<style lang="scss" scoped>
.home-page::before {
background-image: url('~@/assets/img/home-bg.png');
background-size: cover;
background-repeat: no-repeat;
background-position: center;
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
transform: rotate(180deg);
}
.date-tabs {
padding-left: 40px;
padding-top: 20px;
position: relative;
margin-bottom: 20px;
}
:deep(.date-tabs) {
.el-tabs__header {
margin-bottom: 8px;
display: inline-block;
transform: translateY(-12px);
}
.el-tabs__content {
overflow: visible;
}
.el-tabs__item {
font-size: 18px;
color: #fff;
padding-left: 0 !important;
padding-right: 0 !important;
line-height: 36px !important;
height: 36px;
}
.el-tabs__item.is-active {
color: #0b58ff;
}
}
.detail {
display: inline-block;
position: absolute;
left: 260px;
top: 10px;
}
:deep(.detail) {
.el-input__inner {
background-color: transparent;
color: white;
}
}
// .current-date {
// color: #fff;
// font-size: 18px;
// position: absolute;
// left: 260px;
// top: 14px;
// }
.current-time {
color: #fff;
font-size: 18px;
position: absolute;
right: 38px;
top: 14px;
}
.main-top {
width: 100%;
padding: 0 20px 0 40px;
.title {
position: absolute;
left: 34px;
top: 20px;
width: 180px;
font-size: 32px;
z-index: 10;
.title-inner {
position: absolute;
left: 42px;
top: 5px;
font-size: calc(100vw * 20 / 1920);
}
}
.box {
background-color: #fff;
border-radius: 24px;
height: 192px;
padding: 40px 24px 32px 24px;
margin-bottom: 20px;
box-shadow: 0 8px 8px 0 gray;
.num-box {
height: 120px;
padding-top: 26px;
text-align: center;
.num-style {
color: #000;
font-size: calc(100vw * 40 / 1920);
}
.unit-style {
color: rgba(0, 0, 0, 0.7);
font-size: calc(100vw * 18 / 1920);
}
}
.shadow {
background: linear-gradient(90deg, #ffffff 80%, #f2f4f9 100%);
}
}
}
.main-bottom {
width: 100%;
margin-top: 20px;
.chart-wrapper {
margin-left: 10px;
height: 425px;
background: #fff;
border-radius: 5px;
box-shadow: 0 3px 3px 0 gray;
}
}
</style>
<style lang="scss">
.home-page {
.el-progress-bar__inner {
background-image: url('~@/assets/img/home-progress-bg.png');
background-size: cover;
}
}
</style>

View File

@@ -0,0 +1,199 @@
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
:table-props="tableProps1"
:page="1"
:limit="100"
:table-data="tableData1"></base-table>
<base-table
:table-props="tableProps2"
:page="1"
:limit="100"
:table-data="tableData2"></base-table>
</div>
</template>
<script>
import { getDetailData } from '@/api/cost/allCost';
import moment from 'moment';
const tableProps1 = [
{
prop: 'name',
label: '成本项目-原片',
},
{
prop: 'f1',
label: '本期领用',
children: [
{
prop: 'quantity',
label: '数量',
},
{
prop: 'price',
label: '单价',
},
{
prop: 'sumPrice',
label: '金额',
},
],
},
{
prop: 'sprice',
label: '单位成本',
},
];
const tableProps2 = [
{
prop: 'name',
label: '成本项目-加工',
},
{
prop: 'quantity',
label: '耗用数量',
},
{
prop: 'price',
label: '平均耗用单价',
},
{
prop: 'sumPrice',
label: '总成本',
},
{
prop: 'sprice',
label: '综合单位成本',
},
];
export default {
data() {
return {
tableProps1,
tableData1: [],
tableProps2,
tableData2: [],
listQuery: {
pageSize: 10,
pageNo: 1,
statisticType: 1,
},
activeName: '日',
startTime:
moment(new Date()).subtract(1, 'days').format('YYYY-MM-DD') +
' 00:00:00',
endTime:
moment(new Date()).subtract(-1, 'days').format('YYYY-MM-DD') +
' 00:00:00',
formConfig: [
{
type: 'select',
label: '维度',
selectOptions: [
{ id: 1, name: '日' },
{ id: 2, name: '周' },
{ id: 3, name: '月' },
{ id: 4, name: '年' },
],
param: 'statisticType',
defaultSelect: 1, // 默认值,
clearable: false,
},
{
// 日期选择
type: 'datePicker',
// label: '日期',
dateType: 'date',
placeholder: '选择日期',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd',
param: 'timeday',
clearable: false,
pickerOptions: {
disabledDate(time) {
return (time.getTime()+ 3600 * 1000 * 24) > Date.now();
},
shortcuts: [
{
text: '今天',
onClick(picker) {
picker.$emit('pick', new Date());
},
},
{
text: '昨天',
onClick(picker) {
const date = new Date();
date.setTime(date.getTime() - 3600 * 1000 * 24);
picker.$emit('pick', date);
},
},
{
text: '一周前',
onClick(picker) {
const date = new Date();
date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit('pick', date);
},
},
],
},
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: 'button',
btnName: '返回首页',
name: 'back',
color: 'warning',
},
],
};
},
created() {},
mounted() {
this.listQuery.startTime = this.startTime;
this.$refs.searchBarForm.formInline.timeday = this.startTime.substr(0, 10)
this.getDataList();
},
methods: {
// 获取数据列表
getDataList() {
getDetailData(this.listQuery).then((response) => {
this.tableData1 = response.data.odata;
this.tableData2 = response.data.ddata;
});
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
console.log(val.timeday)
this.listQuery.statisticType = val.statisticType || 1;
this.listQuery.startTime = val.timeday
? val.timeday + ' 00:00:00'
: null;
this.getDataList();
break;
case 'back':
this.$router.go(-1)
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@@ -77,7 +77,7 @@ export default {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.pageSize = 20;
this.listQuery.name = val.name||null;
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
this.listQuery.endTime = val.searchTime
@@ -90,7 +90,7 @@ export default {
break;
case 'export':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.pageSize = 20;
this.listQuery.name = val.name;
this.listQuery.recTime = val.searchTime;
this.handleExport();

View File

@@ -54,7 +54,7 @@
:page.sync="listQuery.pageNo"
:limit.sync="listQuery.pageSize"
:total="listQuery.total"
@pagination="getDataList" />
@pagination="getNavDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@@ -86,24 +86,27 @@ import ButtonNav from '@/components/ButtonNav';
const tableProps = [
{
prop: 'recTime',
prop: 'time',
label: '日期',
filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
},
{
prop: 'remark',
label: '备注',
},
{
prop: 'energyTypeName',
label: '能源类型',
},
{
prop: 'bindObjectName',
label: '监控对象',
filter: (val) => (val != null ? val : '--'),
},
{
prop: 'meterName',
label: '抄表名',
filter: (val) => (val != null ? val : '--'),
},
// {
// prop: 'bindObjectName',
// label: '监控对象',
// filter: (val) => (val != null ? val : '--'),
// },
// {
// prop: 'meterName',
// label: '抄表名',
// filter: (val) => (val != null ? val : '--'),
// },
{
prop: 'quantity',
label: '累计使用量',
@@ -115,20 +118,24 @@ const tableProps = [
},
];
const tableProps2 = [
{
prop: 'remark',
label: '备注',
},
{
prop: 'energyTypeName',
label: '能源类型',
},
{
prop: 'bindObjectName',
label: '监控对象',
filter: (val) => (val != null ? val : '--'),
},
{
prop: 'meter',
label: '抄表名',
filter: (val) => (val != null ? val : '--'),
},
// {
// prop: 'bindObjectName',
// label: '监控对象',
// filter: (val) => (val != null ? val : '--'),
// },
// {
// prop: 'meter',
// label: '抄表名',
// filter: (val) => (val != null ? val : '--'),
// },
{
prop: 'quantity',
label: '累计使用量',
@@ -207,13 +214,16 @@ 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,
clearable: false,
},
{
type: 'button',
@@ -237,10 +247,11 @@ export default {
activeName: 'his',
tableProps,
tableProps2,
tableBtn: [{
type: 'edit',
btnName: '编辑',
}
tableBtn: [
{
type: 'edit',
btnName: '编辑',
},
].filter((v) => v),
tableData: [],
tableData2: [],
@@ -262,26 +273,18 @@ export default {
},
methods: {
buttonClick(val) {
if (val.statisticType === 2) {
this.tableProps[0].filter = (val) =>
parseTime(val, '{y}年第{w}周');
}else{
this.tableProps[0].filter = (val) =>
parseTime(val, '{y}年{m}月{d}日');
}
this.formConfig2[1].startPlaceholder = '开始时间';
this.formConfig2[1].endPlaceholder = '结束时间';
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.pageSize = 20;
this.listQuery.energyTypeId = val.name || null;
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'
: null;
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : null;
if (this.activeName === 'his') {
this.listQuery.endTime = val.searchTime
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
: null;
this.getDataList();
} else {
this.getDataList2();
@@ -292,13 +295,16 @@ export default {
break;
case 'export':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.pageSize = 20;
this.listQuery.energyTypeId = val.name || null;
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'
: null;
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : null;
if (this.activeName === 'his') {
this.listQuery.endTime = val.searchTime
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
: null;
}
this.handleExport();
break;
default:
@@ -320,15 +326,26 @@ export default {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 00:00:00';
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 23:59:59';
this.formConfig2[1].startPlaceholder = parseTime(start).substr(0, 10);
this.formConfig2[1].endPlaceholder = parseTime(end).substr(0, 10);
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 08:30:00';
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 08:30:00';
this.$nextTick(() => {
this.$refs.searchBarForm2.formInline.searchTime = [
this.listQuery.startTime,
this.listQuery.endTime,
];
});
this.listQuery.name = null;
this.listQuery.pageNo = 1;
this.getDataList2();
}
},
getNavDataList() {
if (this.activeName === 'his') {
this.getDataList();
} else {
this.getDataList2();
}
},
// 获取数据2列表
getDataList2() {
if (this.listQuery.startTime) {

View File

@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2024-09-05 15:34:28
* @LastEditTime: 2024-12-27 09:18:43
* @Description:
-->
<template>
@@ -22,7 +22,7 @@
placeholder="请输入原料名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<!-- <el-col :span="12">
<el-form-item label="单价" prop="matPrice">
<el-input
v-model="dataForm.matPrice"
@@ -31,7 +31,7 @@
placeholder="请输入单价" />
(/)
</el-form-item>
</el-col>
</el-col> -->
<el-col :span="12">
<el-form-item label="累计用量" prop="quantity">
<el-input-number

View File

@@ -54,7 +54,7 @@
:page.sync="listQuery.pageNo"
:limit.sync="listQuery.pageSize"
:total="listQuery.total"
@pagination="getDataList" />
@pagination="getNavDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@@ -87,9 +87,12 @@ import ButtonNav from '@/components/ButtonNav';
const tableProps = [
{
prop: 'recTime',
prop: 'time',
label: '日期',
filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
},
{
prop: 'remark',
label: '备注',
},
{
prop: 'materialName',
@@ -97,13 +100,13 @@ const tableProps = [
},
{
prop: 'quantity',
label: '累计使用量()',
},
{
prop: 'matPrice',
label: '单价(元/吨)',
align: 'right',
label: '累计使用量(千克)',
},
// {
// prop: 'matPrice',
// label: '单价(元/千克)',
// align: 'right',
// },
{
prop: 'price',
label: '总价(元)',
@@ -111,6 +114,10 @@ const tableProps = [
},
];
const tableProps2 = [
// {
// prop: 'remark',
// label: '备注',
// },
{
prop: 'materialName',
label: '原料名称',
@@ -123,13 +130,13 @@ const tableProps2 = [
},
{
prop: 'quantity',
label: '累计使用量()',
},
{
prop: 'materialPrice',
label: '单价(元/吨)',
align: 'right',
label: '累计使用量(千克)',
},
// {
// prop: 'materialPrice',
// label: '单价(元/千克)',
// align: 'right',
// },
{
prop: 'price',
label: '总价(元)',
@@ -204,13 +211,16 @@ 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,
clearable: false,
},
{
type: 'button',
@@ -234,10 +244,11 @@ export default {
activeName: 'his',
tableProps,
tableProps2,
tableBtn: [{
type: 'edit',
btnName: '编辑',
}
tableBtn: [
{
type: 'edit',
btnName: '编辑',
},
].filter((v) => v),
tableData: [],
tableData2: [],
@@ -259,26 +270,20 @@ export default {
},
methods: {
buttonClick(val) {
if (val.statisticType === 2) {
this.tableProps[0].filter = (val) =>
parseTime(val, '{y}年第{w}周');
}else{
this.tableProps[0].filter = (val) =>
parseTime(val, '{y}年{m}月{d}日');
}
this.formConfig2[1].startPlaceholder = '开始时间';
this.formConfig2[1].endPlaceholder = '结束时间';
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.pageSize = 20;
this.listQuery.materialId = val.name || null;
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;
if (this.activeName === 'his') {
this.listQuery.endTime = val.searchTime
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
: null;
this.getDataList();
} else {
this.getDataList2();
@@ -289,13 +294,18 @@ export default {
break;
case 'export':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.pageSize = 20;
this.listQuery.materialId = val.name || null;
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;
if (this.activeName === 'his') {
this.listQuery.endTime = val.searchTime
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
: null;
}
this.handleExport();
break;
default:
@@ -317,15 +327,26 @@ export default {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 00:00:00';
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 23:59:59';
this.formConfig2[1].startPlaceholder = parseTime(start).substr(0, 10);
this.formConfig2[1].endPlaceholder = parseTime(end).substr(0, 10);
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 08:30:00';
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 08:30:00';
this.$nextTick(() => {
this.$refs.searchBarForm2.formInline.searchTime = [
this.listQuery.startTime,
this.listQuery.endTime,
];
});
this.listQuery.name = null;
this.listQuery.pageNo = 1;
this.getDataList2();
}
},
getNavDataList() {
if (this.activeName === 'his') {
this.getDataList();
} else {
this.getDataList2();
}
},
// 获取数据2列表
getDataList2() {
if (this.listQuery.startTime) {

View File

@@ -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="请输入拉引量" />
()
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="请输入下片面积" />
()
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('修改成功');

View File

@@ -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,16 +73,27 @@
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: 'recTime',
prop: 'time',
label: '日期',
filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
width:130,
},
{
prop: 'remark',
label: '备注',
},
{
prop: 'bindObjectName',
label: '产线',
@@ -62,27 +102,67 @@ const tableProps = [
{
prop: 'thick',
label: '厚度',
filter: (val) => (val != null ? Number(val).toFixed(1) : '-'),
},
{
prop: 'speed',
label: '在线速度',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
{
prop: 'width',
label: '掰边宽度',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
{
prop: 'inArea',
label: '拉引量/m²',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
{
prop: 'outArea',
label: '下片面积/m²',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
{
prop: 'ratio',
label: '良品率',
filter: (val) => (val ? val * 100 + '%' : '-'),
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 {
@@ -116,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',
@@ -143,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;
@@ -167,36 +253,33 @@ export default {
},
methods: {
buttonClick(val) {
if (val.statisticType === 2) {
this.tableProps[0].filter = (val) =>
parseTime(val, '{y}年第{w}周');
}else{
this.tableProps[0].filter = (val) =>
parseTime(val, '{y}年{m}月{d}日');
}
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.pageSize = 20;
this.listQuery.bindObjectId = val.name || null;
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();
break;
case 'export':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.pageSize = 20;
this.listQuery.bindObjectId = val.name || null;
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;
@@ -204,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;

View File

@@ -54,7 +54,7 @@
:page.sync="listQuery.pageNo"
:limit.sync="listQuery.pageSize"
:total="listQuery.total"
@pagination="getDataList" />
@pagination="getNavDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@@ -87,9 +87,12 @@ import ButtonNav from '@/components/ButtonNav';
const tableProps = [
{
prop: 'recTime',
prop: 'time',
label: '日期',
filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
},
{
prop: 'remark',
label: '备注',
},
{
prop: 'otherCostName',
@@ -102,6 +105,10 @@ const tableProps = [
},
];
const tableProps2 = [
// {
// prop: 'remark',
// label: '备注',
// },
{
prop: 'otherCostName',
label: '成本名称',
@@ -182,13 +189,16 @@ 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,
clearable: false,
},
{
type: 'button',
@@ -237,24 +247,20 @@ export default {
},
methods: {
buttonClick(val) {
if (val.statisticType === 2) {
this.tableProps[0].filter = (val) =>
parseTime(val, '{y}年第{w}周');
}else{
this.tableProps[0].filter = (val) =>
parseTime(val, '{y}年{m}月{d}日');
}
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.pageSize = 20;
this.listQuery.name = val.name || null;
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;
if (this.activeName === 'his') {
this.listQuery.endTime = val.searchTime
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
: null;
this.getDataList();
} else {
this.getDataList2();
@@ -265,13 +271,18 @@ export default {
break;
case 'export':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.pageSize = 20;
this.listQuery.name = val.name || null;
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;
if (this.activeName === 'his') {
this.listQuery.endTime = val.searchTime
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
: null;
}
this.handleExport();
break;
default:
@@ -297,6 +308,13 @@ export default {
this.getDataList2();
}
},
getNavDataList(){
if (this.activeName === 'his') {
this.getDataList();
} else {
this.getDataList2();
}
},
// 获取数据2列表
getDataList2() {
getRawOthercostSunPage(this.listQuery).then((response) => {

View File

@@ -65,6 +65,7 @@ const tableProps = [
prop: 'price',
label: '成本金额',
align: 'right',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
{
prop: 'remark',
@@ -161,7 +162,7 @@ export default {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.pageSize = 20;
this.listQuery.name = val.name||null;
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
this.listQuery.endTime = val.searchTime
@@ -174,7 +175,7 @@ export default {
break;
case 'export':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.pageSize = 20;
this.listQuery.name = val.name||null;
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
this.listQuery.endTime = val.searchTime

View File

@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2023-12-05 13:45:59
* @LastEditors: zwq
* @LastEditTime: 2024-04-15 17:12:03
* @LastEditTime: 2024-12-25 16:20:38
* @Description
-->
<template>
@@ -10,9 +10,9 @@
<span>
{{
injectData.type == 1
? `每天等价,${injectData.price}`
? `每天等价,${Number(injectData.price)}`
: injectData.type == 2
? `总价${injectData.price}元,年折旧率${injectData.ratio}%,折旧年限${injectData.timeLimit}`
? `总价${Number(injectData.price)}元,年折旧率${injectData.ratio}%,折旧年限${injectData.timeLimit}`
: '-'
}}
</span>

View File

@@ -54,7 +54,7 @@
:page.sync="listQuery.pageNo"
:limit.sync="listQuery.pageSize"
:total="listQuery.total"
@pagination="getDataList" />
@pagination="getNavDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@@ -87,9 +87,12 @@ import ButtonNav from '@/components/ButtonNav';
const tableProps = [
{
prop: 'recTime',
prop: 'time',
label: '时间',
filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
},
{
prop: 'remark',
label: '备注',
},
{
prop: 'bindObjectName',
@@ -98,32 +101,41 @@ const tableProps = [
{
prop: 'thick',
label: '厚度',
filter: (val) => (val != null ? Number(val).toFixed(1) : '-'),
},
{
prop: 'inArea',
label: '拉引量/m²',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
{
prop: 'outArea',
label: '下片面积/m²',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
{
prop: 'ratio',
label: '良品率',
filter: (val) => (val ? val * 100 + '%' : '-'),
filter: (val) => (val ? Number(val * 100).toFixed(2) + '%' : '-'),
},
{
prop: 'costSum',
label: '原片成本/元',
align: 'right',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
{
prop: 'costArea',
label: '每平米成本/元',
align: 'right',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
];
const tableProps2 = [
{
prop: 'remark',
label: '备注',
},
{
prop: 'bindObjectName',
label: '产线',
@@ -135,34 +147,40 @@ const tableProps2 = [
{
prop: 'inArea',
label: '拉引量/m²',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
{
prop: 'outArea',
label: '下片面积/m²',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
{
prop: 'outCount',
label: '下片数量',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
{
prop: 'ratio',
label: '良品率',
filter: (val) => (val ? val * 100 + '%' : '-'),
filter: (val) => (val ? Number(val * 100).toFixed(2) + '%' : '-'),
},
{
prop: 'costSum',
label: '原片成本/元',
align: 'right',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
{
prop: 'costPiece',
label: '单片成本/元',
align: 'right',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
{
prop: 'costArea',
label: '每平米成本/元',
align: 'right',
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
},
];
export default {
@@ -224,13 +242,16 @@ 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,
clearable: false,
},
{
type: 'select',
@@ -287,26 +308,20 @@ export default {
},
methods: {
buttonClick(val) {
if (val.statisticType === 2) {
this.tableProps[0].filter = (val) =>
parseTime(val, '{y}年第{w}周');
}else{
this.tableProps[0].filter = (val) =>
parseTime(val, '{y}年{m}月{d}日');
}
this.formConfig2[0].startPlaceholder = '开始时间';
this.formConfig2[0].endPlaceholder = '结束时间';
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.pageSize = 20;
this.listQuery.bindObjectId = val.name || null;
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;
if (this.activeName === 'his') {
this.listQuery.endTime = val.searchTime
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
: null;
this.getDataList();
} else {
this.getDataList2();
@@ -317,13 +332,18 @@ export default {
break;
case 'export':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.pageSize = 20;
this.listQuery.bindObjectId = val.name || null;
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;
if (this.activeName === 'his') {
this.listQuery.endTime = val.searchTime
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
: null;
}
this.handleExport();
break;
default:
@@ -345,15 +365,26 @@ export default {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 00:00:00';
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 23:59:59';
this.formConfig2[0].startPlaceholder = parseTime(start).substr(0, 10);
this.formConfig2[0].endPlaceholder = parseTime(end).substr(0, 10);
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 08:30:00';
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 08:30:00';
this.$nextTick(() => {
this.$refs.searchBarForm2.formInline.searchTime = [
this.listQuery.startTime,
this.listQuery.endTime,
];
});
this.listQuery.name = null;
this.listQuery.pageNo = 1;
this.getDataList2();
}
},
getNavDataList(){
if (this.activeName === 'his') {
this.getDataList();
} else {
this.getDataList2();
}
},
// 获取数据2列表
getDataList2() {
if (this.listQuery.startTime) {