更新
This commit is contained in:
BIN
src/assets/img/cold-data-board-msg1.png
Normal file
BIN
src/assets/img/cold-data-board-msg1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
BIN
src/assets/img/cold-data-board-msg2.png
Normal file
BIN
src/assets/img/cold-data-board-msg2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
BIN
src/assets/img/home-bg.png
Normal file
BIN
src/assets/img/home-bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 MiB |
BIN
src/assets/img/home-progress-bg.png
Normal file
BIN
src/assets/img/home-progress-bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 936 B |
@@ -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 = '总成本统计-按规格';
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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
423
src/views/cost/index.vue
Normal 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;
|
||||
">
|
||||
© 中建材智能自动化研究院有限公司
|
||||
</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>
|
||||
199
src/views/cost/indexDetail.vue
Normal file
199
src/views/cost/indexDetail.vue
Normal 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>
|
||||
@@ -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();
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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,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;
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2025-10-11 14:27:37
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-10-15 16:47:28
|
||||
* @LastEditTime: 2025-10-29 17:12:04
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -12,6 +12,9 @@
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
ref="groupTableRef"
|
||||
:id="'groupTableSelectRef'"
|
||||
row-key="id"
|
||||
:selectWidth="55"
|
||||
@selection-change="selectChange"
|
||||
:table-props="tableProps"
|
||||
@@ -46,6 +49,7 @@ const tableProps = [
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注',
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
];
|
||||
|
||||
@@ -84,22 +88,52 @@ export default {
|
||||
name: '',
|
||||
},
|
||||
selectedList: [],
|
||||
deptId: undefined
|
||||
selectedArr: [], //已选的班组,从父组件传过来的
|
||||
deptId: undefined,
|
||||
};
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
init(id){
|
||||
this.deptId = id
|
||||
this.getDataList()
|
||||
},
|
||||
init(id, tableData) {
|
||||
this.deptId = id;
|
||||
this.selectedArr = tableData || [];
|
||||
this.$nextTick(() => {
|
||||
this.getDataList();
|
||||
});
|
||||
},
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.urlOptions
|
||||
.getDataListURL(this.deptId)
|
||||
.then((response) => {
|
||||
this.tableData = response.data;
|
||||
this.urlOptions.getDataListURL(this.deptId).then((response) => {
|
||||
this.tableData = response.data;
|
||||
this.$nextTick(() => {
|
||||
if (this.selectedArr.length > 0) {
|
||||
this.setSelectedRows();
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
setSelectedRows() {
|
||||
const table = this.$refs.groupTableRef.$children[0];
|
||||
|
||||
// 先清空选择
|
||||
table.clearSelection();
|
||||
|
||||
this.selectedArr.forEach((item) => {
|
||||
const rowInTable = this.tableData.find((i) => i.id === item.id);
|
||||
if (rowInTable) {
|
||||
//这里一定要用table.tableData,这样才是指向同一个数组
|
||||
this.$set(table.store.states, 'selection', [
|
||||
...table.store.states.selection,
|
||||
table.tableData.find((i) => i.id === item.id),
|
||||
]);
|
||||
}
|
||||
});
|
||||
|
||||
// 强制更新视图
|
||||
this.$nextTick(() => {
|
||||
table.$forceUpdate();
|
||||
this.$forceUpdate();
|
||||
});
|
||||
},
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
@@ -115,9 +149,25 @@ export default {
|
||||
selectChange(val) {
|
||||
this.selectedList = val;
|
||||
},
|
||||
// 判断两个数组是否有重复的 id
|
||||
hasDuplicateIds(arr1, arr2) {
|
||||
const idSet = new Set(arr1.map((item) => item.id));
|
||||
return arr2.some((item) => idSet.has(item.id));
|
||||
},
|
||||
|
||||
dataFormSubmit() {
|
||||
if (this.selectedList && this.selectedList.length > 0) {
|
||||
const haveData = this.hasDuplicateIds(
|
||||
this.selectedArr,
|
||||
this.selectedList
|
||||
);
|
||||
if (haveData) {
|
||||
this.$message('请不要重复添加数组');
|
||||
return;
|
||||
}
|
||||
this.$emit('refreshTableData', this.selectedList);
|
||||
} else if (this.selectedArr.length > 0) {
|
||||
this.$message('请不要重复添加数组');
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2025-10-13 15:07:24
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-10-24 09:19:17
|
||||
* @LastEditTime: 2025-10-29 15:28:52
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -111,7 +111,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="6" v-if="dataForm.shiftType>1">
|
||||
<el-form-item label="同班次连排" prop="shiftSustainedNum">
|
||||
<el-input
|
||||
v-model="dataForm.shiftSustainedNum"
|
||||
@@ -289,6 +289,7 @@
|
||||
:dialogVisible="addOrUpdateVisible1"
|
||||
@cancel="cancel1"
|
||||
@confirm="handleConfirm1"
|
||||
:before-close="cancel1"
|
||||
:destroy-on-close="true"
|
||||
append-to-body
|
||||
width="40%">
|
||||
@@ -301,6 +302,7 @@
|
||||
:dialogVisible="addOrUpdateVisible2"
|
||||
@cancel="cancel2"
|
||||
@confirm="handleConfirm2"
|
||||
:before-close="cancel2"
|
||||
:destroy-on-close="true"
|
||||
append-to-body
|
||||
width="40%">
|
||||
@@ -313,6 +315,7 @@
|
||||
:dialogVisible="addOrUpdateVisible3"
|
||||
@cancel="cancel3"
|
||||
@confirm="handleConfirm3"
|
||||
:before-close="cancel3"
|
||||
:destroy-on-close="true"
|
||||
append-to-body
|
||||
width="50%">
|
||||
@@ -391,6 +394,7 @@ const tableProps2 = [
|
||||
{
|
||||
prop: 'lineName',
|
||||
label: '产线及工段',
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
];
|
||||
|
||||
@@ -510,6 +514,16 @@ export default {
|
||||
{
|
||||
type: 'bind',
|
||||
btnName: '绑定产线',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'equal',
|
||||
name: 'isProduction',
|
||||
value: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'delete',
|
||||
@@ -640,6 +654,12 @@ export default {
|
||||
this.$message('部门不能为空');
|
||||
return;
|
||||
}
|
||||
const compareDate = this.compareDates(this.dataForm.startDay,this.dataForm.endDay)
|
||||
|
||||
if (compareDate > 0 ) {
|
||||
this.$message('开始时间不能大于结束时间');
|
||||
return;
|
||||
}
|
||||
createStepOne(this.dataForm).then((res) => {
|
||||
if (!this.dataForm.id) {
|
||||
this.dataForm.id = res.data;
|
||||
@@ -754,6 +774,19 @@ export default {
|
||||
setDataForm() {
|
||||
this.$refs.deptSelect.setID(this.dataForm.deptId);
|
||||
},
|
||||
//比较时间,开始时间在结束时间前
|
||||
compareDates(date1, date2) {
|
||||
const d1 = date1;
|
||||
const d2 = date2;
|
||||
|
||||
if (d1 === d2) {
|
||||
return 0; // 日期相等
|
||||
} else if (d1 < d2) {
|
||||
return -1; // date1 在 date2 之前
|
||||
} else {
|
||||
return 1; // date1 在 date2 之后
|
||||
}
|
||||
},
|
||||
//第二步
|
||||
//设置第二部班次
|
||||
setTWOclass() {
|
||||
@@ -830,7 +863,7 @@ export default {
|
||||
addNewGroup() {
|
||||
this.addOrUpdateVisible2 = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addGroupRef.init(this.dataForm.deptId);
|
||||
this.$refs.addGroupRef.init(this.dataForm.deptId,this.tableData2);
|
||||
});
|
||||
},
|
||||
cancel1() {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-10-16 16:37:40
|
||||
* @LastEditTime: 2025-10-30 10:47:09
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -16,7 +16,7 @@
|
||||
pid="pid"
|
||||
:defaultProps="{ label: 'name' }"
|
||||
height="450px"
|
||||
style="padding-bottom:20px"
|
||||
style="padding-bottom: 20px"
|
||||
:mode="mode"
|
||||
filter
|
||||
openAll></tree-transfer>
|
||||
@@ -39,7 +39,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
init(val) {
|
||||
this._pageIndex = val._pageIndex-1;
|
||||
this._pageIndex = val._pageIndex - 1;
|
||||
this.fromData = [];
|
||||
this.toData = [];
|
||||
getGroupPlanTree().then((res) => {
|
||||
@@ -47,21 +47,41 @@ export default {
|
||||
this.fromData.forEach((item) => {
|
||||
item.productionLineId = 0;
|
||||
});
|
||||
this.$nextTick(() => {
|
||||
this.toData = val.bindLineTree || [];
|
||||
this.getFilterLeftData(this.fromData, this.toData); //编辑时组件有bug,左边相同数据不消失
|
||||
});
|
||||
});
|
||||
},
|
||||
// 监听穿梭框组件添加
|
||||
add(fromData, toData, obj) {
|
||||
console.log('fromData:', fromData);
|
||||
console.log('toData:', toData,obj);
|
||||
console.log('toData:', toData, obj);
|
||||
},
|
||||
// 监听穿梭框组件移除
|
||||
remove(fromData, toData, obj) {
|
||||
console.log('fromData:', fromData);
|
||||
console.log('toData:', toData);
|
||||
},
|
||||
/** 消除组件左边与右边选中数据相同项 */
|
||||
// 处理过滤数据
|
||||
getFilterLeftData(data, selData) {
|
||||
for (let i = data.length - 1; i >= 0; i--) {
|
||||
for (let j = selData.length - 1; j >= 0; j--) {
|
||||
if (data[i] && data[i].id === selData[j].id) {
|
||||
// 当id相等可以删除的情况 即:没有子级可以删除;
|
||||
if (!data[i].children || data[i].children.length == 0) {
|
||||
data.splice(i, 1);
|
||||
} else {
|
||||
this.getFilterLeftData(data[i].children, selData[j].children);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$emit('refreshTableData', this._pageIndex,this.toData);
|
||||
this.$emit('refreshTableData', this._pageIndex, this.toData);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2025-10-11 14:27:37
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-10-23 16:31:41
|
||||
* @LastEditTime: 2025-10-29 14:50:16
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -59,12 +59,14 @@
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
v-hasPermi="['base:group-scheduling-plan:query']"
|
||||
@click="buttonClick({ btnName: 'search' })">
|
||||
查询
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<span class="separateStyle"></span>
|
||||
<span class="separateStyle"
|
||||
v-hasPermi="['base:group-scheduling-plan:query']"></span>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button size="small" @click="buttonClick({ btnName: 'reset' })">
|
||||
@@ -72,13 +74,15 @@
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<span class="separateStyle"></span>
|
||||
<span class="separateStyle"
|
||||
v-hasPermi="['base:group-scheduling-plan:create']"></span>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="success"
|
||||
size="small"
|
||||
:plain="true"
|
||||
v-hasPermi="['base:group-scheduling-plan:create']"
|
||||
@click="buttonClick({ btnName: 'add' })">
|
||||
新增
|
||||
</el-button>
|
||||
@@ -264,6 +268,7 @@ export default {
|
||||
},
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:group-scheduling-plan:update')?
|
||||
{
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
@@ -277,7 +282,8 @@ export default {
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
}:undefined,
|
||||
this.$auth.hasPermi('base:group-scheduling-plan:delete')?
|
||||
{
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
@@ -291,7 +297,8 @@ export default {
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
}:undefined,
|
||||
this.$auth.hasPermi('base:group-scheduling-plan:query')?
|
||||
{
|
||||
type: 'detail',
|
||||
btnName: '查看',
|
||||
@@ -305,7 +312,8 @@ export default {
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
}:undefined,
|
||||
this.$auth.hasPermi('base:group-scheduling-plan:delete')?
|
||||
{
|
||||
type: 'cancel',
|
||||
btnName: '作废',
|
||||
@@ -319,7 +327,8 @@ export default {
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
}:undefined,
|
||||
this.$auth.hasPermi('base:group-holiday:update')?
|
||||
{
|
||||
type: 'sync',
|
||||
btnName: '同步节假日',
|
||||
@@ -332,17 +341,18 @@ export default {
|
||||
value: 2,
|
||||
},
|
||||
{
|
||||
type: 'updateFlag',
|
||||
name: 'status',
|
||||
type: 'equal',
|
||||
name: 'updateFlag',
|
||||
value: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
}:undefined,
|
||||
this.$auth.hasPermi('base:group-scheduling-plan:create')?
|
||||
{
|
||||
type: 'copy',
|
||||
btnName: '复制',
|
||||
},
|
||||
}:undefined,
|
||||
].filter((v) => v),
|
||||
tableData: [],
|
||||
options: [
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-10-13 15:44:18
|
||||
* @LastEditTime: 2025-10-29 14:47:33
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -33,7 +33,7 @@
|
||||
<el-col :span="8">
|
||||
<el-form-item label="部门">
|
||||
<dept-select
|
||||
style="width: 200px"
|
||||
style="width: 100%"
|
||||
ref="deptSelect"
|
||||
@DeptId="setDeptId"></dept-select>
|
||||
</el-form-item>
|
||||
@@ -41,8 +41,10 @@
|
||||
<el-col :span="8">
|
||||
<el-form-item label="组长" prop="leaderId">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="dataForm.leaderId"
|
||||
@change="setLeaderName"
|
||||
filterable
|
||||
placeholder="请选择组长">
|
||||
<el-option
|
||||
v-for="item in leaderArr"
|
||||
@@ -57,12 +59,14 @@
|
||||
<el-input
|
||||
v-model="dataForm.leaderPhone"
|
||||
clearable
|
||||
maxlength="11"
|
||||
placeholder="请输入组长电话" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="班组人数" prop="num">
|
||||
<el-input-number
|
||||
style="width: 100%"
|
||||
v-model="dataForm.num"
|
||||
:step="1"
|
||||
:min="0"
|
||||
@@ -72,6 +76,7 @@
|
||||
<el-col :span="8">
|
||||
<el-form-item label="生产班组" prop="isProduction">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="dataForm.isProduction"
|
||||
placeholder="请选择是否为生产班组">
|
||||
<el-option
|
||||
@@ -157,6 +162,13 @@ export default {
|
||||
isProduction: [
|
||||
{ required: true, message: '生产班组不能为空', trigger: 'change' },
|
||||
],
|
||||
leaderPhone: [
|
||||
{
|
||||
pattern: /^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/,
|
||||
message: "请输入正确的手机号码",
|
||||
trigger: "blur"
|
||||
}
|
||||
]
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2025-10-11 14:27:37
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-10-24 09:11:11
|
||||
* @LastEditTime: 2025-10-29 14:44:41
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -25,7 +25,7 @@
|
||||
<dept-select
|
||||
style="width: 200px"
|
||||
ref="deptSelect"
|
||||
@DeptId="setDeptId"></dept-select>
|
||||
@DeptId="setDeptId"></dept-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="班组名称" prop="name">
|
||||
<el-input
|
||||
@@ -45,12 +45,15 @@
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
v-hasPermi="['base:group-team:query']"
|
||||
@click="buttonClick({ btnName: 'search' })">
|
||||
查询
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<span class="separateStyle"></span>
|
||||
<span
|
||||
class="separateStyle"
|
||||
v-hasPermi="['base:group-team:query']"></span>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button size="small" @click="buttonClick({ btnName: 'reset' })">
|
||||
@@ -58,13 +61,16 @@
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<span class="separateStyle"></span>
|
||||
<span
|
||||
class="separateStyle"
|
||||
v-hasPermi="['base:group-team:create']"></span>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="success"
|
||||
size="small"
|
||||
:plain="true"
|
||||
v-hasPermi="['base:group-team:create']"
|
||||
@click="buttonClick({ btnName: 'add' })">
|
||||
新增
|
||||
</el-button>
|
||||
@@ -97,7 +103,7 @@
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
:destroy-on-close="true"
|
||||
:destroy-on-close="true"
|
||||
width="50%">
|
||||
<add-or-update
|
||||
ref="addOrUpdate"
|
||||
@@ -118,16 +124,16 @@ const tableProps = [
|
||||
{
|
||||
prop: 'code',
|
||||
label: '班组编号',
|
||||
width: 140,
|
||||
width: 210,
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
label: '班组名称',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
prop: 'deptName',
|
||||
label: '所属部门',
|
||||
width: 110,
|
||||
},
|
||||
{
|
||||
prop: 'leaderName',
|
||||
@@ -136,6 +142,7 @@ const tableProps = [
|
||||
{
|
||||
prop: 'leaderPhone',
|
||||
label: '组长电话',
|
||||
width: 110,
|
||||
},
|
||||
{
|
||||
prop: 'num',
|
||||
@@ -145,12 +152,15 @@ const tableProps = [
|
||||
{
|
||||
prop: 'isProduction',
|
||||
label: '是否生产班组',
|
||||
filter: val=>{return val?'是':'否'},
|
||||
filter: (val) => {
|
||||
return val ? '是' : '否';
|
||||
},
|
||||
width: 110,
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注',
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'createTime',
|
||||
@@ -175,10 +185,12 @@ export default {
|
||||
},
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
{
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
},
|
||||
this.$auth.hasPermi('base:group-team:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
tableData: [],
|
||||
formInline: {
|
||||
@@ -231,9 +243,9 @@ export default {
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
setDeptId(val){
|
||||
this.formInline.deptId = val
|
||||
}
|
||||
setDeptId(val) {
|
||||
this.formInline.deptId = val;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2024-07-01 14:54:06
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-10-23 13:52:52
|
||||
* @LastEditTime: 2025-10-27 10:18:54
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -46,10 +46,14 @@
|
||||
size="small"
|
||||
type="primary"
|
||||
style="margin-right: 10px"
|
||||
v-hasPermi="['base:group-holiday:create']"
|
||||
@click="addHoliday">
|
||||
新增节假日
|
||||
</el-button>
|
||||
<el-button size="small" @click="holidayLog">
|
||||
<el-button
|
||||
size="small"
|
||||
v-hasPermi="['base:group-holiday-log:query']"
|
||||
@click="holidayLog">
|
||||
节假日变更记录
|
||||
</el-button>
|
||||
</div>
|
||||
@@ -73,7 +77,7 @@
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="startDay = new Date(),getHolidayPage()">
|
||||
@click="(startDay = new Date()), getHolidayPage()">
|
||||
跳转到今天
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
@@ -203,6 +207,7 @@
|
||||
size="small"
|
||||
type="primary"
|
||||
class="btnTextStyle"
|
||||
v-hasPermi="['base:group-holiday:update']"
|
||||
@click="editHoliday">
|
||||
修改
|
||||
</el-button>
|
||||
@@ -210,6 +215,7 @@
|
||||
v-if="detail"
|
||||
class="btnTextStyle"
|
||||
size="small"
|
||||
v-hasPermi="['base:group-holiday:delete']"
|
||||
@click="deleteHoliday">
|
||||
删除
|
||||
</el-button>
|
||||
|
||||
Reference in New Issue
Block a user