-
+
{{ scope.row.goodProductPassNow }}
-
+
{{ scope.row.goodProductPassHis }}
-
+
{{ scope.row.goodProductPassTrend }}
@@ -126,7 +126,9 @@
@@ -363,9 +365,25 @@ export default {
// } else {
// this.searchBarFormConfig[0].defaultSelect = [];
// }
+ this.getCurrentWeekStartTimeAndEndTime()
this.getDataList()
},
methods: {
+ getCurrentWeekStartTimeAndEndTime() {
+ const current = new Date();
+ // current是本周的第几天
+ let nowDayOfWeek = current.getDay();
+ if (nowDayOfWeek === 0) nowDayOfWeek = 7;
+ const dayNum = 1 * 24 * 60 * 60 * 1000;
+ // 获取本周星期一的时间,星期一作为一周的第一天
+ const firstDate = new Date(current.valueOf() - (nowDayOfWeek - 1) * dayNum);
+ // 获取本周星期天的时间,星期天作为一周的最后一天
+ const lastDate = new Date(new Date(firstDate).valueOf() + 6 * dayNum);
+ // return {
+ this.weekValue1 = new Date(firstDate)
+ this.weekValue2 = new Date(lastDate)
+ // };
+ },
handleExport() {
// 处理查询参数
let params = { ...this.dataForm };
@@ -380,6 +398,7 @@ export default {
}).catch(() => { });
},
startWeek() {
+ // console.log(this.weekValue1);
if (this.weekValue1 && this.weekValue2) {
let a = new Date(this.weekValue1).getTime()
let b = new Date(this.weekValue2).getTime()
diff --git a/src/views/report/productionYearReport/index.vue b/src/views/report/productionYearReport/index.vue
index 3bb94621..441848cc 100644
--- a/src/views/report/productionYearReport/index.vue
+++ b/src/views/report/productionYearReport/index.vue
@@ -1,7 +1,7 @@
@@ -9,11 +9,9 @@
-
- -
-
+
查询
@@ -34,26 +32,26 @@
-
+
{{ scope.row.lineId }}
-
+
{{ scope.row.inputNow }}
-
+
{{ scope.row.inputHis }}
-
+
{{ scope.row.inputTrend }}
@@ -61,21 +59,21 @@
-
+
{{ scope.row.goodProductNow }}
-
+
{{ scope.row.goodProductHis }}
-
+
{{ scope.row.goodProductTrend }}
@@ -84,19 +82,19 @@
-
+
{{ scope.row.missCheckNow }}
-
+
{{ scope.row.missCheckHis }}
-
+
{{ scope.row.missCheckTrend }}
@@ -105,21 +103,21 @@
-
+
{{ scope.row.goodProductPassNow }}
-
+
{{ scope.row.goodProductPassHis }}
-
+
{{ scope.row.goodProductPassTrend }}
@@ -128,7 +126,9 @@
@@ -158,7 +158,7 @@ import {
// import Editor from '@/components/Editor';
import moment from 'moment';
// import DialogForm from './dialogForm.vue';
-
+import { parseTime } from '../../core/mixins/code-filter';
// import basicPageMixin from '@/mixins/lb/basicPageMixin';
const tableProps = [
{
@@ -265,6 +265,9 @@ export default {
yearValue2: null,
// dynamicProps: [],
tableProps,
+ reportTime: [],
+ startTimeStamp: '',
+ endTimeStamp: '',
dataForm: {
// workOrderIdList:undefined,
// productionId: undefined,
@@ -344,7 +347,9 @@ export default {
],
};
},
- created() {
+ created() {
+ this.getCurrentYearFirst()
+
// this.getProductLineList();
},
mounted() {
@@ -366,6 +371,16 @@ export default {
this.getDataList()
},
methods: {
+ getCurrentYearFirst() {
+ let date = new Date();
+ date.setDate(1);
+ date.setMonth(0);
+ this.reportTime = date;
+ this.startTimeStamp = this.timeFun(new Date(new Date().getFullYear(), 0, 1).getTime()); //开始时间
+ this.endTimeStamp = this.timeFun(new Date(new Date().getFullYear(), 11, 31, 23, 59, 59).getTime()); //结束时间
+ this.dataForm.reportTime[0] = parseTime(new Date(new Date().getFullYear(), 0, 1).getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
+ this.dataForm.reportTime[1] = parseTime(new Date(new Date().getFullYear(), 11, 31, 23, 59, 59).getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 100
+ },
handleExport() {
// 处理查询参数
let params = { ...this.dataForm };
@@ -379,34 +394,34 @@ export default {
this.exportLoading = false;
}).catch(() => { });
},
- startYear() {
- if (this.yearValue2 && this.yearValue2 < this.yearValue1) {
- this.$modal.msgError('开始时间不能晚于结束时间,请重新选择')
- this.yearValue1 = null
- return false
- }
- if (this.yearValue1 && this.yearValue2) {
- if (this.yearValue2 - this.yearValue1 > 10 * 365 * 24 * 3600000) {
- this.$modal.msgError('最大时间范围为10年,请重新选择')
- this.yearValue1 = null
- return false
- }
- }
- },
- endYear() {
- if (this.yearValue2 && this.yearValue2 < this.yearValue1) {
- this.$modal.msgError('结束时间不能早于开始时间,请重新选择')
- this.yearValue2 = null
- return false
- }
- if (this.yearValue1 && this.yearValue2) {
- if (this.yearValue2 - this.yearValue1 > 10 * 365 * 24 * 3600000) {
- this.$modal.msgError('最大时间范围为10年,请重新选择')
- this.yearValue2 = null
- return false
- }
- }
- },
+ // startYear() {
+ // if (this.yearValue2 && this.yearValue2 < this.yearValue1) {
+ // this.$modal.msgError('开始时间不能晚于结束时间,请重新选择')
+ // this.yearValue1 = null
+ // return false
+ // }
+ // if (this.yearValue1 && this.yearValue2) {
+ // if (this.yearValue2 - this.yearValue1 > 10 * 365 * 24 * 3600000) {
+ // this.$modal.msgError('最大时间范围为10年,请重新选择')
+ // this.yearValue1 = null
+ // return false
+ // }
+ // }
+ // },
+ // endYear() {
+ // if (this.yearValue2 && this.yearValue2 < this.yearValue1) {
+ // this.$modal.msgError('结束时间不能早于开始时间,请重新选择')
+ // this.yearValue2 = null
+ // return false
+ // }
+ // if (this.yearValue1 && this.yearValue2) {
+ // if (this.yearValue2 - this.yearValue1 > 10 * 365 * 24 * 3600000) {
+ // this.$modal.msgError('最大时间范围为10年,请重新选择')
+ // this.yearValue2 = null
+ // return false
+ // }
+ // }
+ // },
editDataList() {
this.disabled = false
this.isSave = true
@@ -442,15 +457,37 @@ export default {
let value = newData
return value
},
+ changeTime(val) {
+ console.log(val);
+ if (val) {
+ // let timeStamp = val.getTime(); //标准时间转为时间戳,毫秒级别
+ this.startTimeStamp = this.timeFun(new Date(val.getFullYear(), 0, 1).getTime()); //开始时间
+ this.endTimeStamp = this.timeFun(new Date(val.getFullYear(), 11, 31, 23, 59, 59).getTime()); //结束时间
+ this.dataForm.reportTime[0] = parseTime(new Date(val.getFullYear(), 0, 1).getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
+ this.dataForm.reportTime[1] = parseTime(new Date(val.getFullYear(), 11, 31, 23, 59, 59).getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
+ } else {
+ this.dataForm.reportTime = []
+ }
+ },
+
+ //时间戳转为yy-mm-dd hh:mm:ss
+ timeFun(unixtimestamp) {
+ var unixtimestamp = new Date(unixtimestamp);
+ var year = 1900 + unixtimestamp.getYear();
+ var month = "0" + (unixtimestamp.getMonth() + 1);
+ var date = "0" + unixtimestamp.getDate();
+ return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length)
+ },
async getDataList() {
+ console.log(this.yearValue1);
if (this.yearValue1 && this.yearValue2) {
if (this.yearValue2 < this.yearValue1) {
this.$modal.msgError('结束时间不能早于开始时间')
return false
} else {
- this.dataForm.reportTime[0] = this.transformYear(this.yearValue1)
- this.dataForm.reportTime[1] = this.transformYear(this.yearValue2)
- this.timeTips = this.transformYear(this.yearValue1) + " - " + this.transformYear(this.yearValue1)
+ // this.dataForm.reportTime[0] = this.transformYear(this.yearValue1)
+ // this.dataForm.reportTime[1] = this.transformYear(this.yearValue2)
+ // this.timeTips = this.transformYear(this.yearValue1) + " - " + this.transformYear(this.yearValue1)
}
}
this.loading = true;
From e6e280c930fcc6bfb0c30b937ed392ec14d7b538 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=98937886381=E2=80=99?= <‘937886381@qq.com’>
Date: Wed, 6 Mar 2024 11:01:31 +0800
Subject: [PATCH 09/46] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../OperationalOverview/processingBoard.vue | 36 +++++++++----------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/src/views/OperationalOverview/processingBoard.vue b/src/views/OperationalOverview/processingBoard.vue
index 02d0c829..56bb1bc5 100644
--- a/src/views/OperationalOverview/processingBoard.vue
+++ b/src/views/OperationalOverview/processingBoard.vue
@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-07-19 15:18:30
* @LastEditors: zhp
- * @LastEditTime: 2024-02-23 16:11:48
+ * @LastEditTime: 2024-03-06 10:57:52
* @Description:
-->
@@ -637,7 +637,7 @@ export default {
this.SJGInitWebSocket()
this.getTimes()
// this.$refs.EnergyMonitoringChart.initChart(['Y61', 'Y62', 'Y63', 'Y64', 'Y65',], [3134, 2323, 3232, 3233, 2321])
- // this.$refs.productLineChart.initChart(['Y61', 'Y62', 'Y63', 'Y64', 'Y65',], [98, 97, 98.7, 98.5, 98.3,], [3134, 2323, 3232, 3233, 2321])
+ this.$refs.productLineChart.initChart(['D61', 'D62', 'D63', 'D64', 'D65',], [98, 97, 98.7, 98.5, 98.3,], [3134, 2323, 3232, 3233, 2321])
const _this = this;
_this.beilv2 = document.documentElement.clientWidth / 1920
window.onresize = () => {
@@ -699,22 +699,22 @@ export default {
])
this.processConfig.data = processArr
this.$refs['processScrollBoard'].updateRows(processArr)
- if (res.data.length !==0) {
- let processArr = res.data.map((item, index) => [
- // console.log(item)
- `${index + 1 || ''}
- `,
- // formatDate(item.planStartTime) || '',
- `
- ${item.productionLineName || ''}
- `,
- `${item.sectionName || ''}`,
- `${item.count || ''}`,
- `${item.inspectionTypeName || ''}`,
- ])
- this.processConfig.data = processArr
- this.$refs['processScrollBoard'].updateRows(processArr)
- }
+ // if (res.data.length !==0) {
+ // let processArr = res.data.map((item, index) => [
+ // // console.log(item)
+ // `${index + 1 || ''}
+ // `,
+ // // formatDate(item.planStartTime) || '',
+ // `
+ // ${item.productionLineName || ''}
+ // `,
+ // `${item.sectionName || ''}`,
+ // `${item.count || ''}`,
+ // `${item.inspectionTypeName || ''}`,
+ // ])
+ // this.processConfig.data = processArr
+ // this.$refs['processScrollBoard'].updateRows(processArr)
+ // }
})
},
getTimes() {
From 39493549b972a05c4aa8898a34a1d1b8b021d0bf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=98937886381=E2=80=99?= <‘937886381@qq.com’>
Date: Thu, 7 Mar 2024 16:28:23 +0800
Subject: [PATCH 10/46] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../OperationalOverview/processingBoard.vue | 4 +-
src/views/report/glass/day.vue | 34 +++++++++---
src/views/report/glass/inputTable.vue | 20 ++++---
src/views/report/glass/month.vue | 47 ++++++++--------
src/views/report/glass/weekly.vue | 53 +++++++++----------
src/views/report/glass/year.vue | 50 ++++++++---------
.../report/productionDayReport/index.vue | 35 ++++++++----
.../report/productionMonthReport/index.vue | 27 ++++++++--
.../productionShipmentsReport/index.vue | 21 ++++++--
.../report/productionWeekReport/index.vue | 28 +++++++---
.../report/productionYearReport/index.vue | 30 ++++++++---
11 files changed, 221 insertions(+), 128 deletions(-)
diff --git a/src/views/OperationalOverview/processingBoard.vue b/src/views/OperationalOverview/processingBoard.vue
index 56bb1bc5..d332b7e3 100644
--- a/src/views/OperationalOverview/processingBoard.vue
+++ b/src/views/OperationalOverview/processingBoard.vue
@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-07-19 15:18:30
* @LastEditors: zhp
- * @LastEditTime: 2024-03-06 10:57:52
+ * @LastEditTime: 2024-03-06 12:01:10
* @Description:
-->
@@ -632,12 +632,12 @@ export default {
])
this.eqConfig.data = eqArr
this.$refs['eqScrollBoard'].updateRows(eqArr)
+ this.$refs.productLineChart.initChart(['D61', 'D62', 'D63', 'D64', 'D65',], [98, 97, 98.7, 98.5, 98.3,], [3134, 2323, 3232, 3233, 2321])
this.getList()
this.initWebSocket()
this.SJGInitWebSocket()
this.getTimes()
// this.$refs.EnergyMonitoringChart.initChart(['Y61', 'Y62', 'Y63', 'Y64', 'Y65',], [3134, 2323, 3232, 3233, 2321])
- this.$refs.productLineChart.initChart(['D61', 'D62', 'D63', 'D64', 'D65',], [98, 97, 98.7, 98.5, 98.3,], [3134, 2323, 3232, 3233, 2321])
const _this = this;
_this.beilv2 = document.documentElement.clientWidth / 1920
window.onresize = () => {
diff --git a/src/views/report/glass/day.vue b/src/views/report/glass/day.vue
index 844b5c83..aea1b8fc 100644
--- a/src/views/report/glass/day.vue
+++ b/src/views/report/glass/day.vue
@@ -1,7 +1,7 @@
@@ -21,7 +21,7 @@
-
@@ -92,6 +92,7 @@ const cols = [
{
prop: 'originalGlassStatisticsTrend',
label: '增减',
+ // filter:(v)=>{v + '%'}
}
]
},
@@ -111,6 +112,7 @@ const cols = [
{
prop: 'actualProductTrend',
label: '增减',
+ // filter: (v) => { v + '%' }
}
]
},
@@ -145,6 +147,10 @@ const cols = [
type: Array,
default: () => [],
},
+ date: {
+ type: String,
+ default:''
+ },
sum: {
type: Object,
default: () => {},
@@ -165,9 +171,9 @@ const cols = [
immediate: true,
handler(newv, oldv) {
if (newv[0] !== '') {
- this.cols[0].label = '许昌安彩周原片生产汇总' + '(' + newv[0] + '-' + newv[1] + ')'
+ this.cols[0].label = this.date + '(' + newv[0] + '-' + newv[1] + ')'
} else {
- this.cols[0].label = '许昌安彩周原片生产汇总'
+ this.cols[0].label = this.date
}
}
},
@@ -203,11 +209,11 @@ const cols = [
updateGlass(this.data).then(response => {
updateGlassRemark(this.sum).then(res => {
this.$modal.msgSuccess("修改成功");
- this.edit = false;
+ this.edit = false;
this.$emit("refreshDataList");
});
});
}
}
};
-
\ No newline at end of file
+
diff --git a/src/views/report/glass/month.vue b/src/views/report/glass/month.vue
index a1514fc1..0526bdf5 100644
--- a/src/views/report/glass/month.vue
+++ b/src/views/report/glass/month.vue
@@ -1,33 +1,27 @@
-
-
-
-
-
-
-
-
- 查询
- 导出
-
-
-
-
-
-
+
diff --git a/src/views/specialEquipment/components/SmallTitle.js b/src/views/specialEquipment/components/SmallTitle.js
new file mode 100644
index 00000000..d517c97e
--- /dev/null
+++ b/src/views/specialEquipment/components/SmallTitle.js
@@ -0,0 +1,32 @@
+//
+
+export default {
+ name: 'SmallTitle',
+ props: ['size'],
+ components: {},
+ data() {
+ return {};
+ },
+ methods: {},
+ render: function (h) {
+ return h(
+ 'span',
+ {
+ class: 'small-title',
+ style: {
+ fontSize: '18px',
+ lineHeight:
+ this.size == 'lg' ? '24px' : this.size == 'sm' ? '18px' : '20px',
+ fontWeight: 500,
+ fontFamily: '微软雅黑, Microsoft YaHei, Arial, Helvetica, sans-serif',
+ },
+ },
+ this.$slots.default
+ );
+ },
+};
diff --git a/src/views/specialEquipment/components/firefightingDrawer.vue b/src/views/specialEquipment/components/firefightingDrawer.vue
index 8339b653..78a2df74 100644
--- a/src/views/specialEquipment/components/firefightingDrawer.vue
+++ b/src/views/specialEquipment/components/firefightingDrawer.vue
@@ -121,35 +121,16 @@
diff --git a/src/views/report/glass/inputTable.vue b/src/views/report/glass/inputTable.vue
index d5d6614a..6a68c98e 100644
--- a/src/views/report/glass/inputTable.vue
+++ b/src/views/report/glass/inputTable.vue
@@ -1,7 +1,7 @@
@@ -9,10 +9,10 @@
编辑
- 返回
+ 返回
保存
-
+
{{ scope.row[y.prop] }}
-
+
-
+
+
@@ -112,7 +114,7 @@ const cols = [
label: '本周',
},
{
- prop: 'originalGlassPassHis ',
+ prop: 'originalGlassPassHis',
label: '上周',
},
{
@@ -130,6 +132,10 @@ const cols = [
type: Array,
default: () => [],
},
+ id: {
+ type: String,
+ default:'exportTable'
+ },
time: {
type: Array,
default: () => [],
@@ -150,6 +156,7 @@ const cols = [
data() {
return {
cols,
+ remark:null,
edit: false,
};
},
@@ -195,16 +202,44 @@ const cols = [
}
}
},
- methods: {
+ methods: {
+ handleReturn() {
+ // this.disabled = true
+ this.edit = false
+ },
+ handleChange(e) {
+ // console.log(q)
+ console.log(e);
+ },
updateData() {
+ let obj = {}
this.data.forEach((ele, index) => {
+ if (ele.det === false) {
+ this.data[index].lineId = ''
+ this.data[index].remark = this.remark
+ obj = ele
+ delete this.data[index].dailyOutputTrend
+ delete this.data[index].originalGlassStatisticsTrend
+ delete this.data[index].actualProductTrend
+ delete this.data[index].originalGlassPassTrend
+ this.data.splice(index, 1)
+ }
+ })
+ let updateArr = this.data
+ updateArr.forEach((ele, index) => {
delete ele.dailyOutputTrend
delete ele.originalGlassStatisticsTrend
delete ele.actualProductTrend
delete ele.originalGlassPassTrend
});
- updateGlass(this.data).then(response => {
- updateGlassRemark(this.sum).then(res => {
+ // this.data.forEach((ele, index) => {
+ // delete ele.dailyOutputTrend
+ // delete ele.originalGlassStatisticsTrend
+ // delete ele.actualProductTrend
+ // delete ele.originalGlassPassTrend
+ // });
+ updateGlass(updateArr).then(response => {
+ updateGlassRemark(obj).then(res => {
this.$modal.msgSuccess("修改成功");
this.edit = false;
this.$emit("refreshDataList");
diff --git a/src/views/report/glass/month.vue b/src/views/report/glass/month.vue
index 011a2c4b..9b099a73 100644
--- a/src/views/report/glass/month.vue
+++ b/src/views/report/glass/month.vue
@@ -29,7 +29,8 @@ import { parseTime } from '../../core/mixins/code-filter';
import { getGlassPage, exportGlasscExcel } from '@/api/report/glass';
import inputTable from './inputTable.vue';
import { getCorePLList } from '@/api/base/coreProductionLine';
-
+import FileSaver from 'file-saver'
+import * as XLSX from 'xlsx'
export default {
components: { inputTable },
data() {
@@ -72,29 +73,61 @@ export default {
// console.log(date)
this.changeTime(date)
// console.log(date.valueOf());
+ },
+ multipliedByHundred(str) {
+ if (str) {
+ let floatVal = parseFloat(str);
+ if (isNaN(floatVal)) {
+ return 0;
+ }
+ floatVal = Math.round(str * 10000) / 100;
+ let strVal = floatVal.toString();
+ let searchVal = strVal.indexOf('.');
+ if (searchVal < 0) {
+ searchVal = strVal.length;
+ strVal += '.';
+ }
+ while (strVal.length <= searchVal + 2) {
+ strVal += '0';
+ }
+ return parseFloat(strVal);
+ }
+
},
// 获取数据列表
async getDataList() {
this.dataListLoading = true;
- await this.urlOptions.getDataListURL(this.listQuery).then(response => {
- this.tableData = response.data.filter(item => {
- this.proLineList.forEach(it => {
- if (item.lineId === it.id) {
+ if (this.listQuery.reportTime.length == 0) {
+ this.$message({
+ message: '请选择时间',
+ type: 'warning'
+ })
+ return false
+ }
+ await this.urlOptions.getDataListURL(this.listQuery).then(res => {
+ res.data.forEach((ele, index) => {
+ if (ele.det === false) {
+ res.data[index].lineName = '合计'
+ this.remark = res.data[index].remark
+ res.data[index].dailyOutputTrend = res.data[index].dailyOutputTrend != 0 ? this.multipliedByHundred(res.data[index].dailyOutputTrend) + '%' : res.data[index].dailyOutputTrend == 0 ? 0 : undefined
+ res.data[index].originalGlassStatisticsTrend = res.data[index].originalGlassStatisticsTrend != 0 ? this.multipliedByHundred(res.data[index].originalGlassStatisticsTrend) + '%' : res.data[index].originalGlassStatisticsTrend == 0 ? 0 : undefined
+ res.data[index].actualProductTrend = res.data[index].actualProductTrend != 0 ? this.multipliedByHundred(res.data[index].actualProductTrend) + '%' : res.data[index].actualProductTrend == 0 ? 0 : undefined
+ res.data[index].originalGlassPassTrend = res.data[index].originalGlassPassTrend != 0 ? this.multipliedByHundred(res.data[index].originalGlassPassTrend) + '%' : res.data[index].originalGlassPassTrend == 0 ? 0 : undefined
+ }
+ })
+ res.data.forEach(item => {
+ this.proLineList.forEach(it => {
+ if (item.lineId === it.id) {
+ console.log(item)
item.lineName = it.name
- item.dailyOutputTrend = item.dailyOutputTrend ? parseFloat((item.dailyOutputTrend * 100).toFixed(2)) + '%' : null
- item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
- item.actualProductTrend = item.actualProductTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
- item.originalGlassPassTrend = item.originalGlassPassTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
- }
- })
- if (item.det === false) {
- this.all = {
- id: item.id,
- remark: item.remark
- }
- }
- return item.det === true
- });
+ item.dailyOutputTrend = item.dailyOutputTrend != 0 ? this.multipliedByHundred(item.dailyOutputTrend) + '%' : item.dailyOutputTrend == 0 ? 0 : undefined
+ item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend != 0 ? this.multipliedByHundred(item.originalGlassStatisticsTrend) + '%' : item.originalGlassStatisticsTrend == 0 ? 0 : undefined
+ item.actualProductTrend = item.actualProductTrend != 0 ? this.multipliedByHundred(item.actualProductTrend) + '%' : item.actualProductTrend == 0 ? 0 : undefined
+ item.originalGlassPassTrend = item.originalGlassPassTrend != 0 ? this.multipliedByHundred(item.originalGlassPassTrend) + '%' : item.originalGlassPassTrend == 0 ? 0 : undefined
+ }
+ })
+ })
+ this.tableData = res.data
this.listQuery.total = response.data.length;
this.dataListLoading = false;
});
@@ -165,16 +198,32 @@ export default {
/** 导出按钮操作 */
handleExport() {
// 处理查询参数
- let params = { ...this.listQuery };
- params.pageNo = undefined;
- params.pageSize = undefined;
- this.$modal.confirm('是否确认导出所有数据项?').then(() => {
- this.exportLoading = true;
- return this.urlOptions.exportURL(params);
- }).then(response => {
- this.$download.excel(response, '原片生产周报.xls');
- this.exportLoading = false;
- }).catch(() => { });
+ var xlsxParam = { raw: true };
+ /* 从表生成工作簿对象 */
+ var wb = XLSX.utils.table_to_book(
+ document.querySelector("#exportTable"),
+ xlsxParam
+ );
+ /* 获取二进制字符串作为输出 */
+ var wbout = XLSX.write(wb, {
+ bookType: "xlsx",
+ bookSST: true,
+ type: "array",
+ });
+ try {
+ FileSaver.saveAs(
+ //Blob 对象表示一个不可变、原始数据的类文件对象。
+ //Blob 表示的不一定是JavaScript原生格式的数据。
+ //File 接口基于Blob,继承了 blob 的功能并将其扩展使其支持用户系统上的文件。
+ //返回一个新创建的 Blob 对象,其内容由参数中给定的数组串联组成。
+ new Blob([wbout], { type: "application/octet-stream" }),
+ //设置导出文件名称
+ "许昌安彩月原片生产汇总.xlsx"
+ );
+ } catch (e) {
+ if (typeof console !== "undefined") console.log(e, wbout);
+ }
+ return wbout;
}
},
};
diff --git a/src/views/report/glass/weekly.vue b/src/views/report/glass/weekly.vue
index 8c85adbf..7df919b7 100644
--- a/src/views/report/glass/weekly.vue
+++ b/src/views/report/glass/weekly.vue
@@ -31,7 +31,8 @@ import { parseTime } from '../../core/mixins/code-filter';
import { getGlassPage, exportGlasscExcel } from '@/api/report/glass';
import inputTable from './inputTable.vue';
import { getCorePLList } from '@/api/base/coreProductionLine';
-
+import FileSaver from 'file-saver'
+import * as XLSX from 'xlsx'
export default {
components: { inputTable },
data() {
@@ -163,29 +164,61 @@ export default {
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间
// this.changeTime(reportTime)
}
+ },
+ multipliedByHundred(str) {
+ if (str) {
+ let floatVal = parseFloat(str);
+ if (isNaN(floatVal)) {
+ return 0;
+ }
+ floatVal = Math.round(str * 10000) / 100;
+ let strVal = floatVal.toString();
+ let searchVal = strVal.indexOf('.');
+ if (searchVal < 0) {
+ searchVal = strVal.length;
+ strVal += '.';
+ }
+ while (strVal.length <= searchVal + 2) {
+ strVal += '0';
+ }
+ return parseFloat(strVal);
+ }
+
},
// 获取数据列表
async getDataList() {
this.dataListLoading = true;
- await this.urlOptions.getDataListURL(this.listQuery).then(response => {
- this.tableData = response.data.filter(item => {
- this.proLineList.forEach(it => {
- if (item.lineId === it.id) {
+ if (this.listQuery.reportTime.length == 0) {
+ this.$message({
+ message: '请选择时间',
+ type: 'warning'
+ })
+ return false
+ }
+ await this.urlOptions.getDataListURL(this.listQuery).then(res => {
+ res.data.forEach((ele, index) => {
+ if (ele.det === false) {
+ res.data[index].lineName = '合计'
+ this.remark = res.data[index].remark
+ res.data[index].dailyOutputTrend = res.data[index].dailyOutputTrend != 0 ? this.multipliedByHundred(res.data[index].dailyOutputTrend) + '%' : res.data[index].dailyOutputTrend == 0 ? 0 : undefined
+ res.data[index].originalGlassStatisticsTrend = res.data[index].originalGlassStatisticsTrend != 0 ? this.multipliedByHundred(res.data[index].originalGlassStatisticsTrend) + '%' : res.data[index].originalGlassStatisticsTrend == 0 ? 0 : undefined
+ res.data[index].actualProductTrend = res.data[index].actualProductTrend != 0 ? this.multipliedByHundred(res.data[index].actualProductTrend) + '%' : res.data[index].actualProductTrend == 0 ? 0 : undefined
+ res.data[index].originalGlassPassTrend = res.data[index].originalGlassPassTrend != 0 ? this.multipliedByHundred(res.data[index].originalGlassPassTrend) + '%' : res.data[index].originalGlassPassTrend == 0 ? 0 : undefined
+ }
+ })
+ res.data.forEach(item => {
+ this.proLineList.forEach(it => {
+ if (item.lineId === it.id) {
+ console.log(item)
item.lineName = it.name
- item.dailyOutputTrend = item.dailyOutputTrend ? parseFloat((item.dailyOutputTrend * 100).toFixed(2)) + '%' : null
- item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
- item.actualProductTrend = item.actualProductTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
- item.originalGlassPassTrend = item.originalGlassPassTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
- }
- })
- if (item.det === false) {
- this.all = {
- id: item.id,
- remark: item.remark
- }
- }
- return item.det === true
- });
+ item.dailyOutputTrend = item.dailyOutputTrend != 0 ? this.multipliedByHundred(item.dailyOutputTrend) + '%' : item.dailyOutputTrend == 0 ? 0 : undefined
+ item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend != 0 ? this.multipliedByHundred(item.originalGlassStatisticsTrend) + '%' : item.originalGlassStatisticsTrend == 0 ? 0 : undefined
+ item.actualProductTrend = item.actualProductTrend != 0 ? this.multipliedByHundred(item.actualProductTrend) + '%' : item.actualProductTrend == 0 ? 0 : undefined
+ item.originalGlassPassTrend = item.originalGlassPassTrend != 0 ? this.multipliedByHundred(item.originalGlassPassTrend) + '%' : item.originalGlassPassTrend == 0 ? 0 : undefined
+ }
+ })
+ })
+ this.tableData = res.data
this.listQuery.total = response.data.length;
this.dataListLoading = false;
});
@@ -230,16 +263,32 @@ export default {
/** 导出按钮操作 */
handleExport() {
// 处理查询参数
- let params = { ...this.listQuery };
- params.pageNo = undefined;
- params.pageSize = undefined;
- this.$modal.confirm('是否确认导出所有数据项?').then(() => {
- this.exportLoading = true;
- return this.urlOptions.exportURL(params);
- }).then(response => {
- this.$download.excel(response, '原片生产周报.xls');
- this.exportLoading = false;
- }).catch(() => { });
+ var xlsxParam = { raw: true };
+ /* 从表生成工作簿对象 */
+ var wb = XLSX.utils.table_to_book(
+ document.querySelector("#exportTable"),
+ xlsxParam
+ );
+ /* 获取二进制字符串作为输出 */
+ var wbout = XLSX.write(wb, {
+ bookType: "xlsx",
+ bookSST: true,
+ type: "array",
+ });
+ try {
+ FileSaver.saveAs(
+ //Blob 对象表示一个不可变、原始数据的类文件对象。
+ //Blob 表示的不一定是JavaScript原生格式的数据。
+ //File 接口基于Blob,继承了 blob 的功能并将其扩展使其支持用户系统上的文件。
+ //返回一个新创建的 Blob 对象,其内容由参数中给定的数组串联组成。
+ new Blob([wbout], { type: "application/octet-stream" }),
+ //设置导出文件名称
+ "许昌安彩周原片生产汇总.xlsx"
+ );
+ } catch (e) {
+ if (typeof console !== "undefined") console.log(e, wbout);
+ }
+ return wbout;
}
},
};
diff --git a/src/views/report/glass/year.vue b/src/views/report/glass/year.vue
index c9146476..6bff74f9 100644
--- a/src/views/report/glass/year.vue
+++ b/src/views/report/glass/year.vue
@@ -26,7 +26,8 @@ import { parseTime } from '../../core/mixins/code-filter';
import { getGlassPage, exportGlasscExcel } from '@/api/report/glass';
import inputTable from './inputTable.vue';
import { getCorePLList } from '@/api/base/coreProductionLine';
-
+import FileSaver from 'file-saver'
+import * as XLSX from 'xlsx'
export default {
components: { inputTable },
data() {
@@ -74,29 +75,61 @@ export default {
// 产线列表
const res = await getCorePLList();
this.proLineList = res.data;
- },
+ },
+ multipliedByHundred(str) {
+ if (str) {
+ let floatVal = parseFloat(str);
+ if (isNaN(floatVal)) {
+ return 0;
+ }
+ floatVal = Math.round(str * 10000) / 100;
+ let strVal = floatVal.toString();
+ let searchVal = strVal.indexOf('.');
+ if (searchVal < 0) {
+ searchVal = strVal.length;
+ strVal += '.';
+ }
+ while (strVal.length <= searchVal + 2) {
+ strVal += '0';
+ }
+ return parseFloat(strVal);
+ }
+
+ },
// 获取数据列表
async getDataList() {
this.dataListLoading = true;
- await this.urlOptions.getDataListURL(this.listQuery).then(response => {
- this.tableData = response.data.filter(item => {
- this.proLineList.forEach(it => {
+ if (this.listQuery.reportTime.length == 0) {
+ this.$message({
+ message: '请选择时间',
+ type: 'warning'
+ })
+ return false
+ }
+ await this.urlOptions.getDataListURL(this.listQuery).then(res => {
+ res.data.forEach((ele, index) => {
+ if (ele.det === false) {
+ res.data[index].lineName = '合计'
+ this.remark = res.data[index].remark
+ res.data[index].dailyOutputTrend = res.data[index].dailyOutputTrend != 0 ? this.multipliedByHundred(res.data[index].dailyOutputTrend) + '%' : res.data[index].dailyOutputTrend == 0 ? 0 : undefined
+ res.data[index].originalGlassStatisticsTrend = res.data[index].originalGlassStatisticsTrend != 0 ? this.multipliedByHundred(res.data[index].originalGlassStatisticsTrend) + '%' : res.data[index].originalGlassStatisticsTrend == 0 ? 0 : undefined
+ res.data[index].actualProductTrend = res.data[index].actualProductTrend != 0 ? this.multipliedByHundred(res.data[index].actualProductTrend) + '%' : res.data[index].actualProductTrend == 0 ? 0 : undefined
+ res.data[index].originalGlassPassTrend = res.data[index].originalGlassPassTrend != 0 ? this.multipliedByHundred(res.data[index].originalGlassPassTrend) + '%' : res.data[index].originalGlassPassTrend == 0 ? 0 : undefined
+ }
+ })
+ res.data.forEach(item => {
+ this.proLineList.forEach(it => {
if (item.lineId === it.id) {
- item.dailyOutputTrend = item.dailyOutputTrend ? parseFloat((item.dailyOutputTrend * 100).toFixed(2)) + '%' : null
- item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
- item.actualProductTrend = item.actualProductTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
- item.originalGlassPassTrend = item.originalGlassPassTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
- item.lineName = it.name
- }
- })
- if (item.det === false) {
- this.all = {
- id: item.id,
- remark: item.remark
- }
- }
- return item.det === true
- });
+ console.log(item)
+ item.lineName = it.name
+ item.dailyOutputTrend = item.dailyOutputTrend != 0 ? this.multipliedByHundred(item.dailyOutputTrend) + '%' : item.dailyOutputTrend == 0 ? 0 : undefined
+ item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend != 0 ? this.multipliedByHundred(item.originalGlassStatisticsTrend) + '%' : item.originalGlassStatisticsTrend == 0 ? 0 : undefined
+ item.actualProductTrend = item.actualProductTrend != 0 ? this.multipliedByHundred(item.actualProductTrend) + '%' : item.actualProductTrend == 0 ? 0 : undefined
+ item.originalGlassPassTrend = item.originalGlassPassTrend != 0 ? this.multipliedByHundred(item.originalGlassPassTrend) + '%' : item.originalGlassPassTrend == 0 ? 0 : undefined
+ }
+ })
+ })
+ this.tableData = res.data
this.listQuery.total = response.data.length;
this.dataListLoading = false;
});
@@ -139,16 +172,32 @@ export default {
/** 导出按钮操作 */
handleExport() {
// 处理查询参数
- let params = { ...this.listQuery };
- params.pageNo = undefined;
- params.pageSize = undefined;
- this.$modal.confirm('是否确认导出所有数据项?').then(() => {
- this.exportLoading = true;
- return this.urlOptions.exportURL(params);
- }).then(response => {
- this.$download.excel(response, '原片生产周报.xls');
- this.exportLoading = false;
- }).catch(() => { });
+ var xlsxParam = { raw: true };
+ /* 从表生成工作簿对象 */
+ var wb = XLSX.utils.table_to_book(
+ document.querySelector("#exportTable"),
+ xlsxParam
+ );
+ /* 获取二进制字符串作为输出 */
+ var wbout = XLSX.write(wb, {
+ bookType: "xlsx",
+ bookSST: true,
+ type: "array",
+ });
+ try {
+ FileSaver.saveAs(
+ //Blob 对象表示一个不可变、原始数据的类文件对象。
+ //Blob 表示的不一定是JavaScript原生格式的数据。
+ //File 接口基于Blob,继承了 blob 的功能并将其扩展使其支持用户系统上的文件。
+ //返回一个新创建的 Blob 对象,其内容由参数中给定的数组串联组成。
+ new Blob([wbout], { type: "application/octet-stream" }),
+ //设置导出文件名称
+ "许昌安彩年原片生产汇总.xlsx"
+ );
+ } catch (e) {
+ if (typeof console !== "undefined") console.log(e, wbout);
+ }
+ return wbout;
}
},
};
diff --git a/src/views/report/productionDayReport/index.vue b/src/views/report/productionDayReport/index.vue
index 0d8e23d0..2dcd82e4 100644
--- a/src/views/report/productionDayReport/index.vue
+++ b/src/views/report/productionDayReport/index.vue
@@ -1,13 +1,13 @@
-
+
@@ -17,10 +17,11 @@
@click="handleExport">导出
- 编辑
+ 编辑
+ 返回
保存
-
@@ -46,9 +47,9 @@
-
+
{{ scope.row.inputTrend ? parseFloat((scope.row.inputTrend * 100).toFixed(2)) + '%' :
- undefined}}
+ undefined}}
@@ -69,10 +70,10 @@
-
+
{{ scope.row.goodProductTrend ? parseFloat((scope.row.goodProductTrend * 100).toFixed(2)) +
- '%' : undefined }}
+ '%' : undefined }}
@@ -80,57 +81,75 @@
- {{ scope.row.missCheckNow }}
+ {{ scope.row.missCheckNow ? parseFloat((scope.row.missCheckNow *
+ 100).toFixed(2)) +
+ '%' : undefined }}
+
- {{ scope.row.missCheckHis }}
+ {{ scope.row.missCheckHis ? parseFloat((scope.row.missCheckHis *
+ 100).toFixed(2)) +
+ '%' : undefined }}
+
-
+
- {{ scope.row.missCheckTrend ? parseFloat((scope.row.missCheckTrend * 100).toFixed(2)) + '%' :
- undefined }}
+ {{ scope.row.missCheckTrend ? parseFloat((scope.row.missCheckTrend *
+ 100).toFixed(2)) +
+ '%' : undefined }}
+
-
+
- {{ scope.row.goodProductPassNow }}
+ {{ scope.row.goodProductPassNow ? parseFloat((scope.row.goodProductPassNow *
+ 100).toFixed(2)) +
+ '%' : undefined }}
+
-
+
- {{ scope.row.goodProductPassHis }}
+ {{ scope.row.goodProductPassHis ? parseFloat((scope.row.goodProductPassHis *
+ 100).toFixed(2)) +
+ '%' : undefined }}
+
-
+
{{ scope.row.goodProductPassTrend ? parseFloat((scope.row.goodProductPassTrend *
- 100).toFixed(2)) +
- '%' : undefined }}
+ 100).toFixed(2)) +
+ '%' : undefined }}
-