Compare commits
No commits in common. "067cd4765ed7e8e65bba7bbee8d39dcbb9c0fe54" and "ab5867c4fd94f07e03a23ee09f7ddc42bf887302" have entirely different histories.
067cd4765e
...
ab5867c4fd
@ -1,3 +1,3 @@
|
|||||||
.dockerignore
|
.dockerignore
|
||||||
#dist
|
dist
|
||||||
node_modules
|
node_modules
|
||||||
|
59
.drone.yml
59
.drone.yml
@ -1,59 +0,0 @@
|
|||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: default
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: build
|
|
||||||
image: node:16-alpine
|
|
||||||
pull: if_not_exists
|
|
||||||
environment:
|
|
||||||
NODE_ENV: ""
|
|
||||||
commands:
|
|
||||||
#- yarn install --frozen-lockfile
|
|
||||||
- yarn install
|
|
||||||
- env ${NODE_ENV} yarn build:prod
|
|
||||||
|
|
||||||
- name: publish
|
|
||||||
image: docker:dind
|
|
||||||
pull: if_not_exists
|
|
||||||
volumes:
|
|
||||||
- name: dockersock
|
|
||||||
path: /var/run/docker.sock
|
|
||||||
- name: dockerconfig
|
|
||||||
path: /root/.docker
|
|
||||||
commands:
|
|
||||||
- docker build -t hub.kszny.picaiba.com/kszny/xcac-ui ./
|
|
||||||
- docker push hub.kszny.picaiba.com/kszny/xcac-ui
|
|
||||||
depends_on:
|
|
||||||
- build
|
|
||||||
|
|
||||||
- name: deploy
|
|
||||||
image: appleboy/drone-ssh
|
|
||||||
pull: if-not-exists
|
|
||||||
settings:
|
|
||||||
host:
|
|
||||||
- 172.24.145.74
|
|
||||||
username: root
|
|
||||||
password: Root@123
|
|
||||||
port: 22
|
|
||||||
command_timeout: 2m
|
|
||||||
script:
|
|
||||||
- docker pull hub.kszny.picaiba.com/kszny/xcac-ui
|
|
||||||
- docker run --rm -v /data/www/xcac:/tmp hub.kszny.picaiba.com/kszny/xcac-ui sh -c "rm -rf /tmp/* && mv -f /html /tmp"
|
|
||||||
depends_on:
|
|
||||||
- publish
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
- name: dockersock
|
|
||||||
host:
|
|
||||||
path: /var/run/docker.sock
|
|
||||||
- name: dockerconfig
|
|
||||||
host:
|
|
||||||
path: /root/.docker
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
branch:
|
|
||||||
- projects/mesxc-test
|
|
||||||
event:
|
|
||||||
- push
|
|
24
Dockerfile
24
Dockerfile
@ -1,3 +1,21 @@
|
|||||||
FROM busybox
|
FROM node:16-alpine as build-stage
|
||||||
LABEL maintainer thomas.hairong@gmail.com
|
|
||||||
COPY dist /html/
|
WORKDIR /admim
|
||||||
|
|
||||||
|
COPY .npmrc package.json yarn.lock ./
|
||||||
|
RUN --mount=type=cache,id=yarn-store,target=/root/.yarn-store \
|
||||||
|
yarn install --frozen-lockfile
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
ARG NODE_ENV=""
|
||||||
|
RUN env ${NODE_ENV} yarn build:prod
|
||||||
|
|
||||||
|
## -- stage: dist => nginx --
|
||||||
|
FROM nginx:alpine
|
||||||
|
|
||||||
|
ENV TZ=Asia/Shanghai
|
||||||
|
|
||||||
|
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
|
COPY --from=build-stage /admim/dist /usr/share/nginx/html
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* @Author: Do not edit
|
* @Author: Do not edit
|
||||||
* @Date: 2023-12-08 10:26:48
|
* @Date: 2023-12-08 10:26:48
|
||||||
* @LastEditTime: 2024-04-24 16:31:37
|
* @LastEditTime: 2023-12-13 17:16:00
|
||||||
* @LastEditors: DY
|
* @LastEditors: DY
|
||||||
* @Description:
|
* @Description:
|
||||||
*/
|
*/
|
||||||
@ -59,39 +59,3 @@ export function exportGlasscExcel(query) {
|
|||||||
responseType: 'blob'
|
responseType: 'blob'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 生产月报查询--冷端生产线
|
|
||||||
export function productionMonthY(data) {
|
|
||||||
return request({
|
|
||||||
url: '/extend/customized-reports/productionMonthY',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 生产月报查询--深加工生产线
|
|
||||||
export function productionMonthD(data) {
|
|
||||||
return request({
|
|
||||||
url: '/extend/customized-reports/productionMonthD',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 生产年报查询--冷端生产线
|
|
||||||
export function productionYearY(data) {
|
|
||||||
return request({
|
|
||||||
url: '/extend/customized-reports/productionYearY',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 生产年报查询--冷端生产线
|
|
||||||
export function productionYearD(data) {
|
|
||||||
return request({
|
|
||||||
url: '/extend/customized-reports/productionYearD',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
@ -1,243 +1,140 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Author: Do not edit
|
* @Author: Do not edit
|
||||||
* @Date: 2024-04-22 15:49:56
|
* @Date: 2024-04-22 15:49:56
|
||||||
* @LastEditTime: 2024-04-25 08:39:13
|
* @LastEditTime: 2024-04-23 17:06:16
|
||||||
* @LastEditors: DY
|
* @LastEditors: DY
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<div class="weekly">
|
<div class="weekly">
|
||||||
<el-form
|
<el-form :inline="true" :model="listQuery" class="blueTip">
|
||||||
:inline="true"
|
<el-form-item label="月" prop="reportTime">
|
||||||
:model="listQuery"
|
<el-date-picker v-model="reportTime" type="month" size="small" @change="changeTime" placeholder="选择月">
|
||||||
class="blueTip">
|
</el-date-picker>
|
||||||
<el-form-item
|
|
||||||
label="月"
|
|
||||||
prop="reportTime">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="listQuery.time"
|
|
||||||
value-format="yyyy-MM-dd HH:mm:ss"
|
|
||||||
type="month"
|
|
||||||
size="small"
|
|
||||||
placeholder="选择月"></el-date-picker>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-button
|
<el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" size="small" @click="search()">
|
||||||
v-if="this.$auth.hasPermi('base:report-auto-production:query')"
|
|
||||||
type="primary"
|
|
||||||
size="small"
|
|
||||||
@click="getList">
|
|
||||||
查询
|
查询
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button v-if="this.$auth.hasPermiAnd(['base:report-auto-original-glass:export', 'base:report-auto-production:export'])" type="primary" size="small" plain
|
||||||
v-if="
|
@click="handleExport">导出</el-button>
|
||||||
this.$auth.hasPermiAnd([
|
|
||||||
'base:report-auto-original-glass:export',
|
|
||||||
'base:report-auto-production:export',
|
|
||||||
])
|
|
||||||
"
|
|
||||||
type="primary"
|
|
||||||
size="small"
|
|
||||||
plain
|
|
||||||
@click="handleExport">
|
|
||||||
导出
|
|
||||||
</el-button>
|
|
||||||
</el-form>
|
</el-form>
|
||||||
<base-table
|
<monthWeek v-if="glassWeekShow" ref="monthWeek" :product="false" :params="listQuery" />
|
||||||
:table-props="tableProps"
|
<proMonth v-if="proWeekShow" ref="proMonth" :product="false" :params="listQuery" />
|
||||||
:table-data="tableData"
|
|
||||||
:span-method="objectSpanMethod1"
|
|
||||||
@emitFun="handleEmitFun"
|
|
||||||
:max-height="tableH" />
|
|
||||||
<!-- <monthWeek v-if="glassWeekShow" ref="monthWeek" :product="false" :params="listQuery" />
|
|
||||||
<proMonth v-if="proWeekShow" ref="proMonth" :product="false" :params="listQuery" /> -->
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// import monthWeek from '../glass/month.vue'
|
import monthWeek from '../glass/month.vue'
|
||||||
// import proMonth from '../productionMonthReport/index.vue'
|
import proMonth from '../productionMonthReport/index.vue'
|
||||||
import { productionMonthY } from '@/api/report/glass';
|
|
||||||
import { parseTime } from '../../core/mixins/code-filter';
|
import { parseTime } from '../../core/mixins/code-filter';
|
||||||
import FileSaver from 'file-saver';
|
|
||||||
import * as XLSX from 'xlsx/xlsx.mjs';
|
|
||||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
// components: { monthWeek, proMonth },
|
components: { monthWeek, proMonth },
|
||||||
mixins: [tableHeightMixin],
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
heightNum: 240,
|
|
||||||
listQuery: {
|
listQuery: {
|
||||||
time: parseTime(new Date()),
|
// pageSize: 10,
|
||||||
|
// pageNo: 1,
|
||||||
|
// total: 0,
|
||||||
|
reportType: 4,
|
||||||
|
reportTime: []
|
||||||
},
|
},
|
||||||
// startTimeStamp: '',
|
startTimeStamp: '',
|
||||||
// endTimeStamp: '',
|
endTimeStamp: '',
|
||||||
// reportTime: '',
|
reportTime: '',
|
||||||
// glassWeekShow: false,
|
glassWeekShow: false,
|
||||||
// proWeekShow: false,
|
proWeekShow: false
|
||||||
tableData: [],
|
}
|
||||||
tableProps: [
|
|
||||||
{
|
|
||||||
prop: 'lineName',
|
|
||||||
label: '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'paramsName',
|
|
||||||
label: '',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
resData: [],
|
|
||||||
span1: [], //表格1的合并规则
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
// this.getCurrentMonthFirst()
|
this.getCurrentMonthFirst()
|
||||||
// this.glassWeekShow = true
|
this.glassWeekShow = true
|
||||||
// this.proWeekShow = true
|
this.proWeekShow = true
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async getList() {
|
getCurrentMonthFirst() {
|
||||||
this.tableData = [];
|
const date = new Date();
|
||||||
this.tableProps = [
|
date.setDate(1);
|
||||||
{
|
this.reportTime = date
|
||||||
prop: 'lineName',
|
// console.log(date)
|
||||||
label: '',
|
this.changeTime(date)
|
||||||
fixed: true,
|
// console.log(date.valueOf());
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'paramsName',
|
|
||||||
label: '',
|
|
||||||
fixed: true,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
await productionMonthY(this.listQuery).then((res) => {
|
|
||||||
this.resData = res.data;
|
|
||||||
// 设置表头
|
|
||||||
Object.keys(this.resData).forEach((item) => {
|
|
||||||
this.tableProps.push({
|
|
||||||
prop: item,
|
|
||||||
label: item,
|
|
||||||
'show-overflow-tooltip': true,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
this.buildTableData(this.resData);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 设置表格数据
|
|
||||||
buildTableData(data) {
|
|
||||||
let keys = Object.keys(data);
|
|
||||||
let tempData = [];
|
|
||||||
let subKeys = Object.keys(data[keys[0]]);
|
|
||||||
let sub2Keys = Object.keys(data[keys[0]][subKeys[0]]);
|
|
||||||
for (let i = 0; i < keys.length; i++) {
|
|
||||||
if (i === 0) {
|
|
||||||
for (let j = 0; j < subKeys.length; j++) {
|
|
||||||
for (let k = 0; k < sub2Keys.length; k++) {
|
|
||||||
let obj = {};
|
|
||||||
obj.lineName = subKeys[j];
|
|
||||||
obj.paramsName = sub2Keys[k];
|
|
||||||
obj[keys[0]] = data[keys[0]][subKeys[j]][sub2Keys[k]];
|
|
||||||
tempData.push(obj);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (let j = 0; j < subKeys.length; j++) {
|
|
||||||
for (let k = 0; k < sub2Keys.length; k++) {
|
|
||||||
for (let v = 0; v < tempData.length; v++) {
|
|
||||||
if (
|
|
||||||
tempData[v].lineName === subKeys[j] &&
|
|
||||||
tempData[v].paramsName === sub2Keys[k]
|
|
||||||
) {
|
|
||||||
tempData[v][keys[i]] = data[keys[i]][subKeys[j]][sub2Keys[k]];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.tableData = tempData;
|
|
||||||
this.getSpanArr(this.tableData);
|
|
||||||
},
|
|
||||||
// 获取合并行
|
|
||||||
getSpanArr(data) {
|
|
||||||
this.span1 = [];
|
|
||||||
for (var i = 0; i < data.length; i++) {
|
|
||||||
if (i === 0) {
|
|
||||||
this.span1.push(1);
|
|
||||||
this.index = 0;
|
|
||||||
} else {
|
|
||||||
if (data[i].lineName === data[i - 1].lineName) {
|
|
||||||
this.span1[this.index] += 1;
|
|
||||||
this.span1.push(0);
|
|
||||||
} else {
|
|
||||||
this.span1.push(1);
|
|
||||||
this.index = i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
objectSpanMethod1({ rowIndex, columnIndex }) {
|
|
||||||
if (columnIndex === 0) {
|
|
||||||
const _row = this.span1[rowIndex];
|
|
||||||
return {
|
|
||||||
rowspan: _row,
|
|
||||||
colspan: 1,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
handleExport() {
|
handleExport() {
|
||||||
const xlsxParam = { raw: true };
|
this.$nextTick(() => {
|
||||||
let workbook = XLSX.utils.book_new();
|
this.$refs['monthWeek'].handleExport()
|
||||||
var ws = XLSX.utils.table_to_sheet(
|
this.$refs['proMonth'].handleExport()
|
||||||
document.querySelector('#exportTable'),
|
})
|
||||||
xlsxParam
|
},
|
||||||
);
|
search() {
|
||||||
XLSX.utils.book_append_sheet(workbook, ws, '许昌安彩月原片生产汇总');
|
this.$nextTick(() => {
|
||||||
var prows = XLSX.utils.table_to_sheet(
|
this.$refs['monthWeek'].getDataList()
|
||||||
document.querySelector('#exportproductionTable'),
|
this.$refs['proMonth'].getDataList()
|
||||||
xlsxParam
|
})
|
||||||
);
|
},
|
||||||
XLSX.utils.book_append_sheet(workbook, prows, '许昌安彩月成品生产汇总');
|
changeTime(val) {
|
||||||
let fileName = '生产数据汇总表-月报.xlsx';
|
console.log(val)
|
||||||
var wbout = XLSX.write(workbook, {
|
if(val) {
|
||||||
bookType: 'xlsx',
|
const timeStamp = val.getMonth(); //标准时间转为时间戳,毫秒级别
|
||||||
bookSST: true,
|
const fullyear = val.getFullYear()
|
||||||
type: 'array',
|
let days = 0
|
||||||
});
|
switch (timeStamp) {
|
||||||
try {
|
case 0:
|
||||||
FileSaver.saveAs(
|
case 2:
|
||||||
new Blob([wbout], { type: 'application/octet-stream' }),
|
case 4:
|
||||||
fileName
|
case 6:
|
||||||
);
|
case 7:
|
||||||
this.$message.success('导出成功');
|
case 9:
|
||||||
} catch (e) {
|
case 11:
|
||||||
if (typeof console !== 'undefined') console.log(e, wbout);
|
days = 31
|
||||||
|
break
|
||||||
|
case 3:
|
||||||
|
case 4:
|
||||||
|
case 8:
|
||||||
|
case 10:
|
||||||
|
days = 30
|
||||||
|
break
|
||||||
|
case 1:
|
||||||
|
if ((fullyear % 400 === 0) || (fullyear % 4 === 0 && fullyear % 100 !== 0)) {
|
||||||
|
days = 29
|
||||||
|
} else {
|
||||||
|
days = 28
|
||||||
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
this.startTimeStamp = this.timeFun(new Date(fullyear, timeStamp, 1, 7, 0, 1).getTime()); //开始时间
|
||||||
|
this.endTimeStamp = this.timeFun(new Date(fullyear, timeStamp, days, 7, 0, 0).getTime()); //结束时间
|
||||||
|
console.log(this.startTimeStamp, this.endTimeStamp)
|
||||||
|
this.listQuery.reportTime[0] = parseTime(new Date(fullyear, timeStamp, 1, 7, 0, 1).getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||||
|
this.listQuery.reportTime[1] = parseTime(new Date(fullyear, timeStamp, days, 7, 0, 0).getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||||
|
} else {
|
||||||
|
this.listQuery.reportTime = []
|
||||||
}
|
}
|
||||||
return wbout;
|
|
||||||
},
|
},
|
||||||
handleEmitFun(payload) {
|
//时间戳转为yy-mm-dd hh:mm:ss
|
||||||
console.log('payload', payload);
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.weekly {
|
.weekly {
|
||||||
padding: 16px;
|
padding-top: 16px;
|
||||||
}
|
}
|
||||||
.blueTip::before{
|
.blueTip::before{
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
content: '';
|
content: '';
|
||||||
width: 4px;
|
width: 4px;
|
||||||
height: 18px;
|
height: 18px;
|
||||||
background: #0b58ff;
|
background: #0B58FF;
|
||||||
border-radius: 1px;
|
border-radius: 1px;
|
||||||
margin-right: 8px;
|
margin-right: 8PX;
|
||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
margin-left: 16px;
|
margin-left: 16px;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Author: Do not edit
|
* @Author: Do not edit
|
||||||
* @Date: 2024-04-22 15:49:56
|
* @Date: 2024-04-22 15:49:56
|
||||||
* @LastEditTime: 2024-04-24 15:28:44
|
* @LastEditTime: 2024-04-23 15:43:36
|
||||||
* @LastEditors: DY
|
* @LastEditors: DY
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
@ -28,9 +28,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import glassWeek from '../glass/weekly.vue'
|
import glassWeek from '../glass/weekly.vue'
|
||||||
import proWeek from '../productionWeekReport/index.vue'
|
import proWeek from '../productionWeekReport/index.vue'
|
||||||
import { parseTime } from '../../core/mixins/code-filter'
|
import { parseTime } from '../../core/mixins/code-filter';
|
||||||
import FileSaver from 'file-saver'
|
|
||||||
import * as XLSX from 'xlsx/xlsx.mjs'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { glassWeek, proWeek },
|
components: { glassWeek, proWeek },
|
||||||
@ -47,8 +45,7 @@ export default {
|
|||||||
endTimeStamp: '',
|
endTimeStamp: '',
|
||||||
reportTime: '',
|
reportTime: '',
|
||||||
glassWeekShow: false,
|
glassWeekShow: false,
|
||||||
proWeekShow: false,
|
proWeekShow: false
|
||||||
proTabaleData: []
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@ -57,35 +54,11 @@ export default {
|
|||||||
this.proWeekShow = true
|
this.proWeekShow = true
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// handleExport() {
|
|
||||||
// this.$nextTick(() => {
|
|
||||||
// this.$refs['glassWeek'].handleExport()
|
|
||||||
// this.$refs['proWeek'].handleExport()
|
|
||||||
// })
|
|
||||||
// },
|
|
||||||
handleExport() {
|
handleExport() {
|
||||||
const xlsxParam = { raw: true }
|
this.$nextTick(() => {
|
||||||
let workbook = XLSX.utils.book_new()
|
this.$refs['glassWeek'].handleExport()
|
||||||
var ws = XLSX.utils.table_to_sheet( document.querySelector('#exportTable'), xlsxParam)
|
this.$refs['proWeek'].handleExport()
|
||||||
XLSX.utils.book_append_sheet(workbook, ws, '许昌安彩周原片生产汇总')
|
})
|
||||||
var prows = XLSX.utils.table_to_sheet( document.querySelector('#exportproductionTable'), xlsxParam)
|
|
||||||
XLSX.utils.book_append_sheet(workbook, prows, '许昌安彩周成品生产汇总')
|
|
||||||
let fileName = '生产数据汇总表-周报.xlsx';
|
|
||||||
var wbout = XLSX.write(workbook, {
|
|
||||||
bookType: 'xlsx',
|
|
||||||
bookSST: true,
|
|
||||||
type: 'array',
|
|
||||||
});
|
|
||||||
try {
|
|
||||||
FileSaver.saveAs(
|
|
||||||
new Blob([wbout], { type: 'application/octet-stream' }),
|
|
||||||
fileName
|
|
||||||
);
|
|
||||||
this.$message.success('导出成功');
|
|
||||||
} catch (e) {
|
|
||||||
if (typeof console !== 'undefined') console.log(e, wbout);
|
|
||||||
}
|
|
||||||
return wbout;
|
|
||||||
},
|
},
|
||||||
search() {
|
search() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Author: Do not edit
|
* @Author: Do not edit
|
||||||
* @Date: 2024-04-22 15:49:56
|
* @Date: 2024-04-22 15:49:56
|
||||||
* @LastEditTime: 2024-04-24 15:49:32
|
* @LastEditTime: 2024-04-23 17:16:11
|
||||||
* @LastEditors: DY
|
* @LastEditors: DY
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
@ -28,9 +28,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import glassYear from '../glass/year.vue'
|
import glassYear from '../glass/year.vue'
|
||||||
import proYear from '../productionYearReport/index.vue'
|
import proYear from '../productionYearReport/index.vue'
|
||||||
import { parseTime } from '../../core/mixins/code-filter'
|
import { parseTime } from '../../core/mixins/code-filter';
|
||||||
import FileSaver from 'file-saver'
|
|
||||||
import * as XLSX from 'xlsx/xlsx.mjs'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { glassYear, proYear },
|
components: { glassYear, proYear },
|
||||||
@ -57,28 +55,10 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleExport() {
|
handleExport() {
|
||||||
const xlsxParam = { raw: true }
|
this.$nextTick(() => {
|
||||||
let workbook = XLSX.utils.book_new()
|
this.$refs['glassYear'].handleExport()
|
||||||
var ws = XLSX.utils.table_to_sheet( document.querySelector('#exportTable'), xlsxParam)
|
this.$refs['proYear'].handleExport()
|
||||||
XLSX.utils.book_append_sheet(workbook, ws, '许昌安彩年原片生产汇总')
|
})
|
||||||
var prows = XLSX.utils.table_to_sheet( document.querySelector('#exportproductionTable'), xlsxParam)
|
|
||||||
XLSX.utils.book_append_sheet(workbook, prows, '许昌安彩年成品生产汇总')
|
|
||||||
let fileName = '生产数据汇总表-年报.xlsx';
|
|
||||||
var wbout = XLSX.write(workbook, {
|
|
||||||
bookType: 'xlsx',
|
|
||||||
bookSST: true,
|
|
||||||
type: 'array',
|
|
||||||
});
|
|
||||||
try {
|
|
||||||
FileSaver.saveAs(
|
|
||||||
new Blob([wbout], { type: 'application/octet-stream' }),
|
|
||||||
fileName
|
|
||||||
);
|
|
||||||
this.$message.success('导出成功');
|
|
||||||
} catch (e) {
|
|
||||||
if (typeof console !== 'undefined') console.log(e, wbout);
|
|
||||||
}
|
|
||||||
return wbout;
|
|
||||||
},
|
},
|
||||||
search() {
|
search() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Author: zhp
|
* @Author: zhp
|
||||||
* @Date: 2023-12-12 13:45:25
|
* @Date: 2023-12-12 13:45:25
|
||||||
* @LastEditTime: 2024-04-24 15:27:49
|
* @LastEditTime: 2024-04-23 16:58:06
|
||||||
* @LastEditors: DY
|
* @LastEditors: DY
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
@ -26,7 +26,7 @@
|
|||||||
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
|
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
<el-table id="exportproductionTable" :data="list" style="width: 100%" :header-cell-style="{
|
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
|
||||||
background: '#F2F4F9',
|
background: '#F2F4F9',
|
||||||
color: '#606266'
|
color: '#606266'
|
||||||
}">
|
}">
|
||||||
@ -496,7 +496,7 @@ export default {
|
|||||||
/* 从表生成工作簿对象 */
|
/* 从表生成工作簿对象 */
|
||||||
import('xlsx').then(excel => {
|
import('xlsx').then(excel => {
|
||||||
var wb = excel.utils.table_to_book(
|
var wb = excel.utils.table_to_book(
|
||||||
document.querySelector("#exportproductionTable"),
|
document.querySelector("#exportTable"),
|
||||||
xlsxParam
|
xlsxParam
|
||||||
);
|
);
|
||||||
/* 获取二进制字符串作为输出 */
|
/* 获取二进制字符串作为输出 */
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Author: zhp
|
* @Author: zhp
|
||||||
* @Date: 2023-12-12 13:45:25
|
* @Date: 2023-12-12 13:45:25
|
||||||
* @LastEditTime: 2024-04-24 15:29:21
|
* @LastEditTime: 2024-04-23 16:58:12
|
||||||
* @LastEditors: DY
|
* @LastEditors: DY
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
@ -28,7 +28,7 @@
|
|||||||
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
|
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
<el-table id="exportproductionTable" :data="list" style="width: 100%" :header-cell-style="{
|
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
|
||||||
background: '#F2F4F9',
|
background: '#F2F4F9',
|
||||||
color: '#606266'
|
color: '#606266'
|
||||||
}">
|
}">
|
||||||
@ -517,7 +517,7 @@ export default {
|
|||||||
/* 从表生成工作簿对象 */
|
/* 从表生成工作簿对象 */
|
||||||
import('xlsx').then(excel => {
|
import('xlsx').then(excel => {
|
||||||
var wb = excel.utils.table_to_book(
|
var wb = excel.utils.table_to_book(
|
||||||
document.querySelector("#exportproductionTable"),
|
document.querySelector("#exportTable"),
|
||||||
xlsxParam
|
xlsxParam
|
||||||
);
|
);
|
||||||
/* 获取二进制字符串作为输出 */
|
/* 获取二进制字符串作为输出 */
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Author: zhp
|
* @Author: zhp
|
||||||
* @Date: 2023-12-12 13:45:25
|
* @Date: 2023-12-12 13:45:25
|
||||||
* @LastEditTime: 2024-04-24 15:28:10
|
* @LastEditTime: 2024-04-23 17:21:04
|
||||||
* @LastEditors: DY
|
* @LastEditors: DY
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
@ -30,7 +30,7 @@
|
|||||||
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
|
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
<el-table id="exportproductionTable" :data="list" style="width: 100%" :header-cell-style="{
|
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
|
||||||
background: '#F2F4F9',
|
background: '#F2F4F9',
|
||||||
color: '#606266'
|
color: '#606266'
|
||||||
}">
|
}">
|
||||||
@ -452,7 +452,7 @@ export default {
|
|||||||
/* 从表生成工作簿对象 */
|
/* 从表生成工作簿对象 */
|
||||||
import('xlsx').then(excel => {
|
import('xlsx').then(excel => {
|
||||||
var wb = excel.utils.table_to_book(
|
var wb = excel.utils.table_to_book(
|
||||||
document.querySelector("#exportproductionTable"),
|
document.querySelector("#exportTable"),
|
||||||
xlsxParam
|
xlsxParam
|
||||||
);
|
);
|
||||||
/* 获取二进制字符串作为输出 */
|
/* 获取二进制字符串作为输出 */
|
||||||
|
Loading…
Reference in New Issue
Block a user