Compare commits
No commits in common. "8fcf6516a3c599f2753ee961c918f83a348a38f7" and "0c5245ef9b9f0defda4c30d1d3e72983ab60b368" have entirely different histories.
8fcf6516a3
...
0c5245ef9b
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: zhp
|
||||
* @Date: 2023-10-18 09:33:57
|
||||
* @LastEditTime: 2024-03-15 15:18:09
|
||||
* @LastEditTime: 2023-11-03 09:31:17
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
*/
|
||||
@ -33,12 +33,3 @@ export function exportEnergyPlcExcel(query) {
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
export function exportEquipmentTraceabilityExcel(query) {
|
||||
return request({
|
||||
url: '/analysis/equipment-analysis/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
@ -116,9 +116,7 @@ export const DICT_TYPE = {
|
||||
ENVIRONMENT_CHECK_UNIT: 'environment_check_unit',
|
||||
|
||||
// ============== GROUP - 班组模块 =============
|
||||
WORK_SHOP: 'workshop',
|
||||
// ============== GROUP - 质量模块 =============
|
||||
MATERIAL_GRADE: 'material_grade'
|
||||
WORK_SHOP: 'workshop'
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -4,23 +4,38 @@
|
||||
<el-col :span='12'>
|
||||
<el-form-item label="能源类型" prop="energyTypeId">
|
||||
<el-select v-model="form.energyTypeId" placeholder="请选择" style="width: 100%;" filterable>
|
||||
<el-option v-for="item in this.energyTypeList" :key="item.id" :label="item.name" :value="item.id">
|
||||
<el-option
|
||||
v-for="item in this.energyTypeList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label="抄表日期" prop="recordTime">
|
||||
<el-date-picker v-model="form.recordTime" type="date" format="yyyy-MM-dd" value-format="timestamp"
|
||||
placeholder="选择日期" style="width: 100%;">
|
||||
<el-date-picker
|
||||
v-model="form.recordTime"
|
||||
type="date"
|
||||
format="yyyy-MM-dd"
|
||||
value-format="timestamp"
|
||||
placeholder="选择日期"
|
||||
style="width: 100%;">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='24'>
|
||||
<base-table border :table-props="tableProps" :table-data="tableData" :add-button-show="addButtonShow"
|
||||
@emitFun="inputChange" @emitButtonClick="emitButtonClick" />
|
||||
<base-table
|
||||
border
|
||||
:table-props="tableProps"
|
||||
:table-data="tableData"
|
||||
:add-button-show="addButtonShow"
|
||||
@emitFun="inputChange"
|
||||
@emitButtonClick="emitButtonClick"
|
||||
/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
@ -33,12 +48,12 @@ import SelectArea from './SelectArea'
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'tableName',
|
||||
label: '表名*',
|
||||
label: '表名',
|
||||
subcomponent: SelectArea
|
||||
},
|
||||
{
|
||||
prop: 'readingQuantity',
|
||||
label: '抄表数*',
|
||||
label: '抄表数',
|
||||
subcomponent: InputArea
|
||||
}
|
||||
]
|
||||
|
@ -185,7 +185,7 @@ export default {
|
||||
break
|
||||
default:
|
||||
this.$modal.confirm('是否确认导出').then(() => {
|
||||
return energyQuantityManualExport({ energyTypeId: this.queryParams.energyTypeId, recordTime: this.queryParams.recordTime });
|
||||
return energyQuantityManualExport({ ...this.queryParams });
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '能源报表.xls');
|
||||
}).catch(() => { })
|
||||
|
@ -2,12 +2,27 @@
|
||||
<div class="app-container">
|
||||
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick"
|
||||
/>
|
||||
<!-- 列表 -->
|
||||
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list"
|
||||
:selectWidth="55" :max-height="tableH" @selection-change="selectChange" />
|
||||
<pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total"
|
||||
@pagination="getList" />
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:selectWidth="55"
|
||||
:max-height="tableH"
|
||||
@selection-change="selectChange"
|
||||
/>
|
||||
<pagination
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -56,8 +71,7 @@ export default {
|
||||
type: 'select',
|
||||
label: '能源类型',
|
||||
selectOptions: [],
|
||||
param: 'energyTypeId',
|
||||
filterable: true
|
||||
param: 'energyTypeId'
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
|
@ -127,11 +127,9 @@ export default {
|
||||
name: '',
|
||||
code: '',
|
||||
unit: '',
|
||||
singlePrice: 0,
|
||||
pricingMethod: 2,
|
||||
dim: '',
|
||||
push: false,
|
||||
description: ''
|
||||
leaderName: '',
|
||||
push: false
|
||||
},
|
||||
isEdit: false, //是否是编辑
|
||||
rules: {
|
||||
@ -164,15 +162,14 @@ export default {
|
||||
this.form.code = res.data.code
|
||||
this.form.unit = res.data.unit
|
||||
this.form.pricingMethod = res.data.pricingMethod
|
||||
this.form.leaderName = res.data.leaderName
|
||||
this.form.push = res.data.push ? true : false
|
||||
this.form.description = res.data.description
|
||||
switch (this.form.pricingMethod) {
|
||||
case 0:
|
||||
this.tableData1 = res.data.segPriceList || []
|
||||
break;
|
||||
case 1:
|
||||
this.tableData2 = res.data.usedPriceList || []
|
||||
this.form.dim = res.data.dim
|
||||
break;
|
||||
default:
|
||||
this.form.singlePrice = res.data.singlePrice || 0
|
||||
|
@ -210,8 +210,8 @@ export default {
|
||||
mobileCodeTimer: 0,
|
||||
loginForm: {
|
||||
loginType: 'uname',
|
||||
username: '',
|
||||
password: '',
|
||||
username: 'admin',
|
||||
password: 'admin123',
|
||||
captchaVerification: '',
|
||||
mobile: '',
|
||||
mobileCode: '',
|
||||
@ -297,9 +297,9 @@ export default {
|
||||
this.handleLogin({});
|
||||
},
|
||||
getCookie() {
|
||||
// const username = getUsername();
|
||||
// const password = getPassword();
|
||||
// const rememberMe = getRememberMe();
|
||||
const username = getUsername();
|
||||
const password = getPassword();
|
||||
const rememberMe = getRememberMe();
|
||||
const tenantName = getTenantName();
|
||||
this.loginForm = {
|
||||
...this.loginForm,
|
||||
|
@ -108,7 +108,6 @@ export default {
|
||||
{
|
||||
prop: 'inspectionInfoList',
|
||||
label: '检测内容',
|
||||
showOverflowtooltip: true,
|
||||
}
|
||||
],
|
||||
// 查询参数
|
||||
@ -172,7 +171,7 @@ export default {
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.urlOptions.deleteURL(data.id).then(({ data }) => {
|
||||
this.urlOptions.deleteURL(id).then(({ data }) => {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-01-30 10:53:32
|
||||
* @LastEditTime: 2024-03-15 14:07:15
|
||||
* @LastEditTime: 2024-02-23 15:16:35
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@ -31,7 +31,7 @@
|
||||
<el-col :span="12" style="border-left: 1px solid #ccc">
|
||||
<div class="select-list">
|
||||
<div class="sl__header" style="background: #f3f4fb; padding: 12px">
|
||||
<span style="">选择工段</span>
|
||||
<span style="">选择工序</span>
|
||||
</div>
|
||||
|
||||
<BomSelection ref="materialsBomList" :key="materialsBomList.equipmentId + 'materialsBomList'"
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-01-30 10:52:01
|
||||
* @LastEditTime: 2024-03-15 14:06:55
|
||||
* @LastEditTime: 2024-02-01 14:43:53
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@ -64,7 +64,7 @@
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" /> -->
|
||||
|
||||
<base-dialog dialogTitle="选择产线工段" :dialogVisible="open" width="45%" @close="cancel" @cancel="cancel"
|
||||
<base-dialog dialogTitle="选择产线工序" :dialogVisible="open" width="45%" @close="cancel" @cancel="cancel"
|
||||
@confirm="submitForm">
|
||||
<el-row>
|
||||
<el-form ref="dataForm" :model="dataForm" label-width="120px" :inline="true" class="demo-form-inline">
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-08 13:46:17
|
||||
* @LastEditTime: 2024-03-15 14:54:38
|
||||
* @LastEditTime: 2024-03-12 14:54:05
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@ -247,8 +247,6 @@ export default {
|
||||
// code: [{ required: true, message: "设备物料编码不能为空", trigger: "blur" }],
|
||||
name: [{ required: true, message: "设备物料名称不能为空", trigger: "blur" }],
|
||||
equipmentId: [{ required: true, message: "设备名称不能为空", trigger: "change" }],
|
||||
checkResult: [{ required: true, message: "判定结果不能为空", trigger: "change" }],
|
||||
|
||||
// : [{ required: true, message: "产品类型不能为空", trigger: "change" }],
|
||||
// processTime: [{ required: true, message: "产线生产单位用时不能为空", trigger: "blur" }]
|
||||
}
|
||||
@ -407,7 +405,7 @@ export default {
|
||||
getSupplierList().then(res => {
|
||||
this.supplierList = res.data
|
||||
})
|
||||
const res = await getDictDatas(this.DICT_TYPE.MATERIAL_GRADE)
|
||||
const res = await getDictDatas(this.DICT_TYPE.EQU_ALARM_LEVEL)
|
||||
console.log('111', res)
|
||||
this.gradeList = res
|
||||
},
|
||||
|
@ -145,7 +145,7 @@ export default {
|
||||
width: 180,
|
||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||
},
|
||||
{ prop: 'typeName', label: '检测类型', },
|
||||
{ prop: 'typeName', label: '类型名称', },
|
||||
{ prop: 'content', label: '检测内容', },
|
||||
{ prop: 'code', label: '检测编码', },
|
||||
{ prop: 'remark', label: '备注', },
|
||||
|
@ -29,7 +29,7 @@
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width="40%">
|
||||
width="30%">
|
||||
<add-or-update
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="successSubmit"></add-or-update>
|
||||
|
@ -1,13 +1,13 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-11-06 15:15:30
|
||||
* @LastEditTime: 2024-03-15 14:31:10
|
||||
* @LastEditTime: 2024-03-01 10:33:48
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="auto">
|
||||
<el-row :gutter="20">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="工单号" prop="workOrderId">
|
||||
<el-select v-model="dataForm.workOrderId" placeholder="请选择工单号">
|
||||
@ -22,7 +22,7 @@
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="报废时间" prop="logTime">
|
||||
<el-date-picker style="width: 100%;" v-model="dataForm.logTime" type="datetime" value-format="timestamp" placeholder="选择日期">
|
||||
<el-date-picker v-model="dataForm.logTime" type="datetime" value-format="timestamp" placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -130,14 +130,15 @@ export default {
|
||||
this.getDict()
|
||||
console.log('我看看', this.dataForm)
|
||||
// this.getCurrentTime()
|
||||
// this.dataForm.logTime = new Date()
|
||||
this.getWorksectionById()
|
||||
},
|
||||
methods: {
|
||||
// getCurrentTime() {
|
||||
// // new Date().Format("yyyy-MM-dd HH:mm:ss")
|
||||
// // this.dataForm.logTime = year + "-" + month + "-" + day;
|
||||
// // console.log(this.dataForm.logTime);
|
||||
// },
|
||||
getCurrentTime() {
|
||||
// new Date().Format("yyyy-MM-dd HH:mm:ss")
|
||||
this.dataForm.logTime = new Date()
|
||||
// this.dataForm.logTime = year + "-" + month + "-" + day;
|
||||
console.log(this.dataForm.logTime);
|
||||
},
|
||||
async getDict() {
|
||||
// 物料列表
|
||||
const res = await getList()
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: zhp
|
||||
* @Date: 2024-02-28 09:51:25
|
||||
* @LastEditTime: 2024-03-15 14:34:29
|
||||
* @LastEditTime: 2024-03-08 13:46:46
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
*/
|
||||
@ -24,25 +24,10 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.dataForm.logTime = this.format(new Date().getTime())
|
||||
console.log(this.dataForm.logTime);
|
||||
},
|
||||
mounted () {
|
||||
activated() {
|
||||
},
|
||||
// activated() {
|
||||
// },
|
||||
methods: {
|
||||
format(dataString) {
|
||||
//dataString是整数,否则要parseInt转换
|
||||
var time = new Date(dataString);
|
||||
var year = time.getFullYear();
|
||||
var month = time.getMonth() + 1;
|
||||
var day = time.getDate();
|
||||
var hour = time.getHours();
|
||||
var minute = time.getMinutes();
|
||||
var second = time.getSeconds();
|
||||
return year + '-' + (month < 10 ? '0' + month : month) + '-' + (day < 10 ? '0' + day : day) + ' ' + (hour < 10 ? '0' + hour : hour) + ':' + (minute < 10 ? '0' + minute : minute) + ':' + (second < 10 ? '0' + second : second)
|
||||
},
|
||||
init(id) {
|
||||
this.dataForm.id = id || "";
|
||||
this.visible = true;
|
||||
@ -56,7 +41,6 @@ export default {
|
||||
console.log(response)
|
||||
this.dataForm = response.data
|
||||
this.dataForm.detId = response.data.detIdList
|
||||
this.getWorksectionById(this.dataForm.lineId)
|
||||
this.dataForm.logTime = new Date(response.data.logTime)
|
||||
|
||||
// if (this.setData) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-11-06 15:15:30
|
||||
* @LastEditTime: 2024-03-15 14:33:12
|
||||
* @LastEditTime: 2024-03-01 10:18:39
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@ -110,7 +110,6 @@ export default {
|
||||
name: '自动',
|
||||
}
|
||||
],
|
||||
sectionList:[],
|
||||
visible:false,
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
@ -139,18 +138,19 @@ export default {
|
||||
mounted() {
|
||||
this.getDict()
|
||||
console.log('我看看', this.dataForm)
|
||||
// this.getCurrentTime()
|
||||
this.getCurrentTime()
|
||||
// this.getWorksectionById()
|
||||
},
|
||||
methods: {
|
||||
// init() {
|
||||
// this.dialogVisible = true
|
||||
// },
|
||||
// getCurrentTime() {
|
||||
// // new Date().Format("yyyy-MM-dd HH:mm:ss")
|
||||
// this.dataForm.logTime = new Date()
|
||||
// // this.dataForm.logTime = year + "-" + month + "-" + day;
|
||||
// console.log(this.dataForm.logTime);
|
||||
// },
|
||||
getCurrentTime() {
|
||||
// new Date().Format("yyyy-MM-dd HH:mm:ss")
|
||||
this.dataForm.logTime = new Date()
|
||||
// this.dataForm.logTime = year + "-" + month + "-" + day;
|
||||
console.log(this.dataForm.logTime);
|
||||
},
|
||||
async getDict() {
|
||||
// 物料列表
|
||||
const res = await getList()
|
||||
|
@ -29,7 +29,7 @@
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width="40%">
|
||||
width="30%">
|
||||
<add-or-update
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="successSubmit"></add-or-update>
|
||||
|
@ -89,9 +89,7 @@
|
||||
// import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import PieChart from './components/pieChart.vue';
|
||||
import {
|
||||
exportEquipmentTraceabilityExcel
|
||||
} from '@/api/quality/deviceParameters';
|
||||
|
||||
export default {
|
||||
name: 'EfficiencyAnalysis',
|
||||
mixins: [basicPageMixin],
|
||||
@ -258,7 +256,7 @@ export default {
|
||||
// parent: 'dateFilterType',
|
||||
// 时间段选择
|
||||
type: 'datePicker',
|
||||
label: '时间段',
|
||||
// label: '时间段',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
@ -286,12 +284,6 @@ export default {
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
color: 'warning',
|
||||
},
|
||||
// {
|
||||
// type: 'separate',
|
||||
@ -380,23 +372,6 @@ export default {
|
||||
this.trendOpen = true;
|
||||
break;
|
||||
}
|
||||
},
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = { ...this.queryParams };
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal
|
||||
.confirm('是否确认导出设备状态追溯?')
|
||||
.then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportEquipmentTraceabilityExcel(params);
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.excel(response, '设备状态追溯.xls');
|
||||
this.exportLoading = false;
|
||||
})
|
||||
.catch(() => { });
|
||||
},
|
||||
/** 查询列表 */
|
||||
async getList() {
|
||||
@ -430,7 +405,6 @@ export default {
|
||||
];
|
||||
}
|
||||
} else {
|
||||
this.handleExport()
|
||||
this.queryParams.recordTime = null;
|
||||
}
|
||||
this.getList();
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-01 14:55:51
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2024-03-15 15:22:59
|
||||
* @LastEditTime: 2023-12-01 16:43:10
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -121,7 +121,7 @@ export default {
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间段',
|
||||
label: '工单开始时间',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: "yyyy-MM-dd",
|
||||
|
@ -263,7 +263,7 @@ export default {
|
||||
width: 90,
|
||||
prop: 'source',
|
||||
label: '来源',
|
||||
filter: (val) => val == 1 ? '平板端' : '网页端',
|
||||
filter: (val) => ['平板端', '网页端'][val],
|
||||
},
|
||||
],
|
||||
// 搜索框需要的 keys, 与上面 queryParams 的除 pageNo, pageSize 之外的 key 一一对应
|
||||
@ -457,7 +457,7 @@ export default {
|
||||
return;
|
||||
}
|
||||
// 修改的提交
|
||||
let str = this.form.checkPerson ? this.form.checkPerson.join() : null
|
||||
let str = this.form.checkPerson.join()
|
||||
this.form.checkPerson = str
|
||||
if (this.form.id != null) {
|
||||
updateQualityInspectionRecord(this.form).then((response) => {
|
||||
|
@ -223,7 +223,7 @@ export default {
|
||||
{
|
||||
// width: 128,
|
||||
prop: 'sumScrap',
|
||||
label: '未通过检测总数',
|
||||
label: '未检测总数',
|
||||
},
|
||||
{
|
||||
// width: 128,
|
||||
|
@ -1,15 +1,13 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-01-24 15:15:24
|
||||
* @LastEditTime: 2024-03-18 16:00:41
|
||||
* @LastEditTime: 2024-03-13 15:21:30
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div>
|
||||
<!-- <el-alert title="自定义 close-text" type="warning" close-text="知道了">
|
||||
</el-alert> -->
|
||||
<el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
|
||||
<el-form-item label="日" prop="reportTime">
|
||||
<el-date-picker v-model="reportTime" @change="changeTime" type="date" placeholder="选择日期">
|
||||
@ -23,8 +21,8 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<inputTable :date="date" :data="tableData" :time="[startTimeStamp, endTimeStamp]" :sum="all"
|
||||
:type="listQuery.reportType" @refreshDataList="getDataList" />
|
||||
<inputTable :date="date" :data="tableData" :time="[startTimeStamp, endTimeStamp]" :sum="all" :type="listQuery.reportType"
|
||||
@refreshDataList="getDataList" />
|
||||
<!-- <pagination
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:page.sync="listQuery.pageNo"
|
||||
@ -39,8 +37,7 @@ import { getGlassPage, exportGlasscExcel } from '@/api/report/glass';
|
||||
import inputTable from './inputTable.vue';
|
||||
import { getCorePLList } from '@/api/base/coreProductionLine';
|
||||
import moment from 'moment'
|
||||
import FileSaver from 'file-saver'
|
||||
import * as XLSX from 'xlsx'
|
||||
|
||||
export default {
|
||||
components: { inputTable },
|
||||
data() {
|
||||
@ -82,8 +79,6 @@ export default {
|
||||
},
|
||||
// 获取数据列表
|
||||
multipliedByHundred(str) {
|
||||
// console.log(str)
|
||||
if (str != 0) {
|
||||
let floatVal = parseFloat(str);
|
||||
if (isNaN(floatVal)) {
|
||||
return 0;
|
||||
@ -99,58 +94,30 @@ export default {
|
||||
strVal += '0';
|
||||
}
|
||||
return parseFloat(strVal);
|
||||
}
|
||||
|
||||
},
|
||||
async getDataList() {
|
||||
this.dataListLoading = true
|
||||
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.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) {
|
||||
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
|
||||
|
||||
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
|
||||
}
|
||||
})
|
||||
})
|
||||
this.tableData = res.data
|
||||
// this.tableData = response.data.filter(item => {
|
||||
// this.proLineList.forEach(it => {
|
||||
// if (item.lineId === it.id) {
|
||||
// item.lineName = it.name
|
||||
|
||||
// }
|
||||
// })
|
||||
// if (item.det === false) {
|
||||
// this.all = {
|
||||
// id: item.id,
|
||||
// remark: item.remark
|
||||
// }
|
||||
// }
|
||||
// return item.det === true
|
||||
// });
|
||||
this.listQuery.total = res.data.length;
|
||||
if (item.det === false) {
|
||||
this.all = {
|
||||
id: item.id,
|
||||
remark: item.remark
|
||||
}
|
||||
}
|
||||
return item.det === true
|
||||
});
|
||||
this.listQuery.total = response.data.length;
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
@ -175,9 +142,6 @@ export default {
|
||||
// console.log(val.setHours(7, 0, 0))
|
||||
// console.log(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000)
|
||||
// let time = this.format(val.setHours(7, 0, 0))
|
||||
this.startTimeStamp = this.format(val.setHours(7, 0, 1)) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||
this.endTimeStamp = this.format(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||
// console.log(this.listQuery.reportTime);
|
||||
this.listQuery.reportTime[0] = this.format(val.setHours(7, 0, 1)) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||
this.listQuery.reportTime[1] = this.format(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||
console.log(this.listQuery.reportTime);
|
||||
@ -212,33 +176,17 @@ export default {
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
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);
|
||||
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(() => { });
|
||||
}
|
||||
return wbout;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-12-13 14:10:04
|
||||
* @LastEditTime: 2024-03-18 09:57:30
|
||||
* @LastEditTime: 2024-03-13 15:27:43
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@ -9,10 +9,10 @@
|
||||
<div>
|
||||
<el-row style="float: right; margin-bottom: 5px">
|
||||
<el-button v-if="!edit" size="small" @click="edit = true">编辑</el-button>
|
||||
<el-button v-if="edit" size="small" @click="handleReturn()">返回</el-button>
|
||||
<el-button v-if="edit" size="small" @click="edit= false">返回</el-button>
|
||||
<el-button v-if="edit" size="small" @click="updateData">保存</el-button>
|
||||
</el-row>
|
||||
<el-table :id="id" :data="data" border style="width: 100%">
|
||||
<el-table :data="data" border show-summary style="width: 100%">
|
||||
<el-table-column v-for="(item, index) in cols" :key="index" :prop="item.prop" :label="item.label"
|
||||
:align="item.align ? item.align : 'left'">
|
||||
<el-table-column v-for="(it, index1) in item.children" :key="index1" :prop="it.prop" :label="it.label"
|
||||
@ -20,16 +20,14 @@
|
||||
<el-table-column v-for="(y, index2) in it.children" :key="index2" :prop="y.prop" :label="y.label">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="!edit">{{ scope.row[y.prop] }}</span>
|
||||
<el-input @change="handleChange" :disabled="y.prop == 'dailyOutputTrend' || y.prop === 'originalGlassStatisticsTrend'
|
||||
|| y.prop === 'actualProductTrend' || y.prop === 'originalGlassPassTrend' || y.prop === 'originalGlassPassNow' || y.prop === 'originalGlassPassHis'
|
||||
" v-else v-model="scope.row[y.prop]"></el-input>
|
||||
<el-input v-else v-model="scope.row[y.prop]"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-input type="textarea" v-model="remark" placeholder="备注" :disabled="!edit" :autosize="{ minRows: 2, maxRows: 6}">
|
||||
</el-input>
|
||||
<el-input type="textarea" v-model="sum.remark" placeholder="备注" :disabled="!edit"
|
||||
:autosize="{ minRows: 2, maxRows: 6}"></el-input>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -132,10 +130,6 @@ const cols = [
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
id: {
|
||||
type: String,
|
||||
default:'exportTable'
|
||||
},
|
||||
time: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
@ -156,7 +150,6 @@ const cols = [
|
||||
data() {
|
||||
return {
|
||||
cols,
|
||||
remark:null,
|
||||
edit: false,
|
||||
};
|
||||
},
|
||||
@ -203,43 +196,15 @@ const cols = [
|
||||
}
|
||||
},
|
||||
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
|
||||
});
|
||||
// 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 => {
|
||||
updateGlass(this.data).then(response => {
|
||||
updateGlassRemark(this.sum).then(res => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.edit = false;
|
||||
this.$emit("refreshDataList");
|
||||
|
@ -29,8 +29,7 @@ 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() {
|
||||
@ -73,61 +72,29 @@ 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;
|
||||
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 => {
|
||||
await this.urlOptions.getDataListURL(this.listQuery).then(response => {
|
||||
this.tableData = response.data.filter(item => {
|
||||
this.proLineList.forEach(it => {
|
||||
if (item.lineId === it.id) {
|
||||
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
|
||||
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
|
||||
}
|
||||
})
|
||||
})
|
||||
this.tableData = res.data
|
||||
if (item.det === false) {
|
||||
this.all = {
|
||||
id: item.id,
|
||||
remark: item.remark
|
||||
}
|
||||
}
|
||||
return item.det === true
|
||||
});
|
||||
this.listQuery.total = response.data.length;
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
@ -198,32 +165,16 @@ export default {
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
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;
|
||||
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(() => { });
|
||||
}
|
||||
},
|
||||
};
|
||||
|
@ -31,8 +31,7 @@ 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() {
|
||||
@ -164,61 +163,29 @@ 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;
|
||||
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 => {
|
||||
await this.urlOptions.getDataListURL(this.listQuery).then(response => {
|
||||
this.tableData = response.data.filter(item => {
|
||||
this.proLineList.forEach(it => {
|
||||
if (item.lineId === it.id) {
|
||||
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
|
||||
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
|
||||
}
|
||||
})
|
||||
})
|
||||
this.tableData = res.data
|
||||
if (item.det === false) {
|
||||
this.all = {
|
||||
id: item.id,
|
||||
remark: item.remark
|
||||
}
|
||||
}
|
||||
return item.det === true
|
||||
});
|
||||
this.listQuery.total = response.data.length;
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
@ -263,32 +230,16 @@ export default {
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
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;
|
||||
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(() => { });
|
||||
}
|
||||
},
|
||||
};
|
||||
|
@ -26,8 +26,7 @@ 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() {
|
||||
@ -75,61 +74,29 @@ 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;
|
||||
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 => {
|
||||
await this.urlOptions.getDataListURL(this.listQuery).then(response => {
|
||||
this.tableData = response.data.filter(item => {
|
||||
this.proLineList.forEach(it => {
|
||||
if (item.lineId === it.id) {
|
||||
console.log(item)
|
||||
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
|
||||
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
|
||||
if (item.det === false) {
|
||||
this.all = {
|
||||
id: item.id,
|
||||
remark: item.remark
|
||||
}
|
||||
}
|
||||
return item.det === true
|
||||
});
|
||||
this.listQuery.total = response.data.length;
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
@ -172,32 +139,16 @@ export default {
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
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;
|
||||
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(() => { });
|
||||
}
|
||||
},
|
||||
};
|
||||
|
@ -1,13 +1,13 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-12 13:45:25
|
||||
* @LastEditTime: 2024-03-18 15:24:10
|
||||
* @LastEditTime: 2024-03-13 15:28:18
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :inline="true" :model="listQuery" class="blueTip">
|
||||
<el-form :inline="true" :model="listQuery" class="demo-form-inline">
|
||||
<el-form-item label="日" prop="reportTime">
|
||||
<el-date-picker clearable v-model="reportTime" @change="changeTime" type="date" placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
@ -17,11 +17,10 @@
|
||||
@click="handleExport">导出</el-button>
|
||||
</el-form>
|
||||
<el-row style="float: right; margin-bottom: 5px">
|
||||
<el-button v-if="!isSave" size="small" @click="editDataList()">编辑</el-button>
|
||||
<el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
|
||||
<el-button size="small" @click="editDataList()">编辑</el-button>
|
||||
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
|
||||
</el-row>
|
||||
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
|
||||
<el-table :data="list" style="width: 100%" :header-cell-style="{
|
||||
background: '#F2F4F9',
|
||||
color: '#606266'
|
||||
}">
|
||||
@ -47,7 +46,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="inputTrend" label="增减" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="!disabled"></el-input>
|
||||
<el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.inputTrend ? parseFloat((scope.row.inputTrend * 100).toFixed(2)) + '%' :
|
||||
undefined}} </span>
|
||||
</template>
|
||||
@ -70,7 +69,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductTrend" label="增减" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="!disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductTrend ? parseFloat((scope.row.goodProductTrend * 100).toFixed(2)) +
|
||||
'%' : undefined }} </span>
|
||||
@ -81,56 +80,42 @@
|
||||
<el-table-column prop="missCheckNow" label="今日" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.missCheckNow ? parseFloat((scope.row.missCheckNow *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
<span v-else>{{ scope.row.missCheckNow }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="missCheckHis" label="昨日" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.missCheckHis ? parseFloat((scope.row.missCheckHis *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
<span v-else>{{ scope.row.missCheckHis }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="missCheckTrend" label="增减" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="!disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.missCheckTrend ? parseFloat((scope.row.missCheckTrend *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
<span v-else>{{ scope.row.missCheckTrend ? parseFloat((scope.row.missCheckTrend * 100).toFixed(2)) + '%' :
|
||||
undefined }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="综合良品率" align="center">
|
||||
<el-table-column prop="goodProductPassNow" label="今日" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassNow" :disabled="!disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassNow" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassNow ? parseFloat((scope.row.goodProductPassNow *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
<span v-else>{{ scope.row.goodProductPassNow }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductPassHis" label="昨日" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassHis" :disabled="!disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassHis" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassHis ? parseFloat((scope.row.goodProductPassHis *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
<span v-else>{{ scope.row.goodProductPassHis }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductPassTrend" label="增减" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="!disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassTrend ? parseFloat((scope.row.goodProductPassTrend *
|
||||
100).toFixed(2)) +
|
||||
@ -140,16 +125,12 @@
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<!-- <div style="height: 50px;" class="remark" slot="append">
|
||||
<div style="height: 50px;" class="remark" slot="append">
|
||||
<el-input placeholder="备注" v-if="!disabled" v-model="remark" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ remark ? remark : '请输入备注' }} </span>
|
||||
</div> -->
|
||||
</el-table>
|
||||
<div style="height: 50px;" class="remark" >
|
||||
<el-input placeholder="备注" v-model="remark" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ remark }} </span>
|
||||
</div>
|
||||
</el-table>
|
||||
<!-- 搜索工作栏 -->
|
||||
<!-- <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" /> -->
|
||||
|
||||
@ -176,8 +157,6 @@ import {
|
||||
} from '@/api/report/production';
|
||||
// import Editor from '@/components/Editor';
|
||||
import moment from 'moment';
|
||||
import FileSaver from 'file-saver'
|
||||
import * as XLSX from 'xlsx'
|
||||
// import DialogForm from './dialogForm.vue';
|
||||
import { getCorePLList } from '@/api/base/coreProductionLine';
|
||||
// import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
@ -453,10 +432,6 @@ export default {
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
handleReturn() {
|
||||
this.disabled = true
|
||||
this.isSave = false
|
||||
},
|
||||
format(shijianchuo) {
|
||||
//shijianchuo是整数,否则要parseInt转换
|
||||
var time = moment(new Date(shijianchuo)).format('YYYY-MM-DD HH:mm:ss')
|
||||
@ -482,40 +457,23 @@ export default {
|
||||
// let time = this.format(val.setHours(7, 0, 0))
|
||||
this.listQuery.reportTime[0] = this.format(val.setHours(7, 0, 1)) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||
this.listQuery.reportTime[1] = this.format(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||
this.timeTips = this.listQuery.reportTime[0] + ' - ' + this.listQuery.reportTime[1]
|
||||
// console.log(this.listQuery.reportTime);
|
||||
console.log(this.listQuery.reportTime);
|
||||
} else {
|
||||
this.listQuery.reportTime = []
|
||||
}
|
||||
},
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
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;
|
||||
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(() => { });
|
||||
},
|
||||
// timeSelect() {
|
||||
// // switch (this.queryParams.timeDim) {
|
||||
@ -562,7 +520,6 @@ export default {
|
||||
editDataList() {
|
||||
this.disabled = false
|
||||
this.isSave = true
|
||||
this.getDataList()
|
||||
},
|
||||
async saveDataList() {
|
||||
let obj = {}
|
||||
@ -606,19 +563,14 @@ export default {
|
||||
// this.listQuery.reportTime[0] = this.transformTime(this.monthValue[0])
|
||||
// // this.queryParams.startTime = this.monthValue[0]
|
||||
// this.listQuery.reportTime[1] = this.transformTime(this.monthValue[1])
|
||||
// this.timeTips = moment(new Date()).format('YYYY-MM-DD') + ' - ' + moment(new Date().setHours(7, 0, 0) + 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
|
||||
this.timeTips = moment(new Date()).format('YYYY-MM-DD') + ' - ' + moment(new Date().setHours(7, 0, 0) + 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
|
||||
// console.log(this.timeTips);
|
||||
// } else {
|
||||
// // this.$modal.msgError('月范围不能为空')
|
||||
// // return false
|
||||
// }
|
||||
if (this.listQuery.reportTime.length == 0) {
|
||||
this.$message({
|
||||
message: '请选择时间',
|
||||
type: 'warning'
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
console.log(this.listQuery);
|
||||
|
||||
const res = await this.$axios({
|
||||
url: '/base/report-auto-production/page',
|
||||
@ -652,19 +604,3 @@ export default {
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
/* .blueTip { */
|
||||
/* padding-bottom: 10px; */
|
||||
/* } */
|
||||
.blueTip::before{
|
||||
display: inline-block;
|
||||
content: '';
|
||||
width: 4px;
|
||||
height: 18px;
|
||||
background: #0B58FF;
|
||||
border-radius: 1px;
|
||||
margin-right: 8PX;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
@ -1,15 +1,17 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-12 13:45:25
|
||||
* @LastEditTime: 2024-03-18 15:27:53
|
||||
* @LastEditTime: 2024-03-13 15:29:17
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :inline="true" :model="dataForm" class="blueTip">
|
||||
<el-form-item label="月" prop="reportTime">
|
||||
<el-date-picker v-model="reportTime" type="month" size="small" @change="changeTime" placeholder="选择月">
|
||||
<el-form :inline="true" :model="dataForm" class="demo-form-inline">
|
||||
<el-form-item>
|
||||
<el-date-picker v-model="monthValue" type="monthrange" range-separator="至" start-placeholder="开始日期"
|
||||
end-placeholder="结束日期" clearable :picker-options="pickerOptions" size="small" style='width:350px;'
|
||||
@change="timeSelect">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-button type="primary" @click="getDataList()">查询</el-button>
|
||||
@ -17,11 +19,10 @@
|
||||
@click="handleExport">导出</el-button>
|
||||
</el-form>
|
||||
<el-row style="float: right; margin-bottom: 5px">
|
||||
<el-button v-if="!isSave" size="small" @click="editDataList()">编辑</el-button>
|
||||
<el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
|
||||
<el-button size="small" @click="editDataList()">编辑</el-button>
|
||||
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
|
||||
</el-row>
|
||||
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
|
||||
<el-table :data="list" style="width: 100%" :header-cell-style="{
|
||||
background: '#F2F4F9',
|
||||
color: '#606266'
|
||||
}">
|
||||
@ -47,7 +48,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="inputTrend" label="增减" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="!disabled"></el-input>
|
||||
<el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.inputTrend ? parseFloat((scope.row.inputTrend *
|
||||
100).toFixed(2)) + '%' : undefined }} </span>
|
||||
</template>
|
||||
@ -70,7 +71,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductTrend" label="增减" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="!disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductTrend ? parseFloat((scope.row.goodProductTrend *
|
||||
100).toFixed(2)) + '%' : undefined }} </span>
|
||||
@ -78,78 +79,59 @@
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="原片漏检率" align="center">
|
||||
<el-table-column prop="missCheckNow" label="今日" align="center">
|
||||
<el-table-column prop="missCheckNow" label="本月" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.missCheckNow ? parseFloat((scope.row.missCheckNow *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
<span v-else>{{ scope.row.missCheckNow }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="missCheckHis" label="昨日" align="center">
|
||||
<el-table-column prop="missCheckHis" label="上月" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.missCheckHis ? parseFloat((scope.row.missCheckHis *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
<span v-else>{{ scope.row.missCheckHis }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="missCheckTrend" label="增减" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="!disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.missCheckTrend ? parseFloat((scope.row.missCheckTrend *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
100).toFixed(2)) +'%' : undefined }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="综合良品率" align="center">
|
||||
<el-table-column prop="goodProductPassNow" label="今日" align="center">
|
||||
<el-table-column prop="goodProductPassNow" label="本月" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassNow" :disabled="!disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassNow" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassNow ? parseFloat((scope.row.goodProductPassNow *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
<span v-else>{{ scope.row.goodProductPassNow }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductPassHis" label="昨日" align="center">
|
||||
<el-table-column prop="goodProductPassHis" label="上月" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassHis" :disabled="!disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassHis" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassHis ? parseFloat((scope.row.goodProductPassHis *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
<span v-else>{{ scope.row.goodProductPassHis }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductPassTrend" label="增减" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="!disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassTrend ? parseFloat((scope.row.goodProductPassTrend *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
100).toFixed(2))+ '%' :undefined }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<!-- <div style="height: 50px;" class="remark" slot="append">
|
||||
<div style="height: 50px;" class="remark" slot="append">
|
||||
<el-input placeholder="备注" v-if="!disabled" v-model="remark" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ remark }} </span>
|
||||
</div> -->
|
||||
</el-table>
|
||||
<div style="height: 50px;" class="remark">
|
||||
<el-input placeholder="备注" v-model="remark" :disabled="disabled">
|
||||
</el-input>
|
||||
</div>
|
||||
</el-table>
|
||||
<!-- 搜索工作栏 -->
|
||||
<!-- <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" /> -->
|
||||
|
||||
@ -177,10 +159,8 @@ import {
|
||||
// import Editor from '@/components/Editor';
|
||||
import moment from 'moment';
|
||||
// import DialogForm from './dialogForm.vue';
|
||||
import { parseTime } from '../../core/mixins/code-filter';
|
||||
import { getCorePLList } from '@/api/base/coreProductionLine'
|
||||
import FileSaver from 'file-saver'
|
||||
import * as XLSX from 'xlsx'
|
||||
|
||||
// import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
const tableProps = [
|
||||
{
|
||||
@ -418,7 +398,6 @@ export default {
|
||||
// remark: undefined,
|
||||
// },
|
||||
// 查询参数
|
||||
reportTime:'',
|
||||
dataForm: {
|
||||
// workOrderIdList:undefined,
|
||||
// productionId: undefined,
|
||||
@ -432,7 +411,7 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.getCurrentMonthFirst()
|
||||
// this.getCurrentMonthLast()
|
||||
this.getCurrentMonthLast()
|
||||
// this.getProductLineList();
|
||||
},
|
||||
mounted() {
|
||||
@ -456,11 +435,6 @@ export default {
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
handleReturn() {
|
||||
this.disabled = true
|
||||
this.isSave = false
|
||||
this.getDataList()
|
||||
},
|
||||
async getDict() {
|
||||
// 产线列表
|
||||
const res = await getCorePLList();
|
||||
@ -468,89 +442,32 @@ export default {
|
||||
},
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
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;
|
||||
let params = { ...this.dataForm };
|
||||
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(() => { });
|
||||
},
|
||||
getCurrentMonthFirst() {
|
||||
const date = new Date();
|
||||
date.setDate(1);
|
||||
this.reportTime = date
|
||||
// console.log(date)
|
||||
this.changeTime(date)
|
||||
date.setDate(1)
|
||||
// date.setHours(7, 0, 1)
|
||||
this.monthValue[0] = moment(date).format('YYYY-MM-DD')
|
||||
console.log(date)
|
||||
// console.log(date.valueOf());
|
||||
},
|
||||
changeTime(val) {
|
||||
console.log(val)
|
||||
if (val) {
|
||||
const timeStamp = val.getMonth(); //标准时间转为时间戳,毫秒级别
|
||||
const fullyear = val.getFullYear()
|
||||
let days = 0
|
||||
switch (timeStamp) {
|
||||
case 0:
|
||||
case 2:
|
||||
case 4:
|
||||
case 6:
|
||||
case 7:
|
||||
case 9:
|
||||
case 11:
|
||||
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.timeTips = this.startTimeStamp + '-' + this.endTimeStamp
|
||||
this.dataForm.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.dataForm.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.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)
|
||||
getCurrentMonthLast() {
|
||||
const date = new Date();
|
||||
const currentMonth = date.getMonth();
|
||||
const nextMonth = currentMonth + 1;
|
||||
const nextMonthFirstDay = new Date(date.getFullYear(), nextMonth, 1);
|
||||
const oneDay = 24 * 60 * 60 * 1000;
|
||||
this.monthValue[1] = new Date(nextMonthFirstDay - oneDay)
|
||||
},
|
||||
timeSelect() {
|
||||
// switch (this.queryParams.timeDim) {
|
||||
@ -649,13 +566,7 @@ export default {
|
||||
// this.$modal.msgError('月范围不能为空')
|
||||
// return false
|
||||
}
|
||||
if (this.dataForm.reportTime.length == 0) {
|
||||
this.$message({
|
||||
message: '请选择时间',
|
||||
type: 'warning'
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
console.log(this.dataForm);
|
||||
const res = await this.$axios({
|
||||
url: '/base/report-auto-production/page',
|
||||
@ -690,19 +601,3 @@ export default {
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
/* .blueTip { */
|
||||
/* padding-bottom: 10px; */
|
||||
/* } */
|
||||
.blueTip::before{
|
||||
display: inline-block;
|
||||
content: '';
|
||||
width: 4px;
|
||||
height: 18px;
|
||||
background: #0B58FF;
|
||||
border-radius: 1px;
|
||||
margin-right: 8PX;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
@ -1,13 +1,13 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-12 13:45:25
|
||||
* @LastEditTime: 2024-03-18 15:26:52
|
||||
* @LastEditTime: 2024-03-15 13:42:59
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :inline="true" :model="dataForm" class="blueTip">
|
||||
<el-form :inline="true" :model="dataForm" class="demo-form-inline">
|
||||
<el-form-item>
|
||||
<el-date-picker clearable v-model="reportTime" @change="changeTime" type="date" placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
@ -17,11 +17,10 @@
|
||||
<el-button v-if="isSave" type="success" @click="saveDataList()">保存</el-button> -->
|
||||
</el-form>
|
||||
<el-row style="float: right; margin-bottom: 5px">
|
||||
<el-button v-if="!isSave" size="small" @click="editDataList()">编辑</el-button>
|
||||
<el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
|
||||
<el-button size="small" @click="editDataList()">编辑</el-button>
|
||||
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
|
||||
</el-row>
|
||||
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
|
||||
<el-table :data="list" style="width: 100%" :header-cell-style="{
|
||||
background: '#F2F4F9',
|
||||
color: '#606266'
|
||||
}">
|
||||
@ -71,11 +70,11 @@
|
||||
</el-table-column>
|
||||
|
||||
<!-- <el-table-column label="完成良品产量"> -->
|
||||
<el-table-column prop="customerName" align="center" label="用户">
|
||||
<el-table-column prop="customerId" align="center" label="用户">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.customerName" :disabled="disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.customerId" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.customerName }} </span>
|
||||
<span v-else>{{ scope.row.customerId }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="packageType" align="center" label="包装形式">
|
||||
@ -159,16 +158,12 @@
|
||||
</el-table-column>
|
||||
|
||||
<!-- </el-table-column> -->
|
||||
<!-- <div style="height: 50px;" class="remark" slot="append">
|
||||
<div style="height: 50px;" class="remark" slot="append">
|
||||
<el-input placeholder="备注" v-if="!disabled" v-model="remark" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ remark }} </span>
|
||||
</div> -->
|
||||
</el-table>
|
||||
<div style="height: 50px;" class="remark">
|
||||
<el-input placeholder="备注" v-model="remark" :disabled="disabled">
|
||||
</el-input>
|
||||
</div>
|
||||
</el-table>
|
||||
<!-- 搜索工作栏 -->
|
||||
<!-- <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" /> -->
|
||||
|
||||
@ -196,7 +191,6 @@ import {
|
||||
} from '@/api/report/production';
|
||||
// import Editor from '@/components/Editor';
|
||||
import moment from 'moment';
|
||||
|
||||
// import DialogForm from './dialogForm.vue';
|
||||
import { getCorePLList } from '@/api/base/coreProductionLine'
|
||||
// import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
@ -459,11 +453,6 @@ export default {
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
handleReturn() {
|
||||
this.disabled = true
|
||||
this.isSave = false
|
||||
this.getDataList()
|
||||
},
|
||||
format(shijianchuo) {
|
||||
//shijianchuo是整数,否则要parseInt转换
|
||||
var time = moment(new Date(shijianchuo)).format('YYYY-MM-DD HH:mm:ss')
|
||||
@ -573,19 +562,11 @@ export default {
|
||||
async getDataList() {
|
||||
this.timeTips = moment(new Date()).format('YYYY-MM-DD') + ' - ' + moment(new Date().setHours(7, 0, 0) + 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
|
||||
console.log(this.dataForm);
|
||||
if (this.dataForm.reportTime.length == 0) {
|
||||
this.$message({
|
||||
message: '请选择时间',
|
||||
type: 'warning'
|
||||
})
|
||||
return false
|
||||
}
|
||||
const res = await this.$axios({
|
||||
url: 'base/report-auto-delive/listPlus',
|
||||
method: 'get',
|
||||
params: this.dataForm
|
||||
})
|
||||
|
||||
console.log(res)
|
||||
// let sum = undefined
|
||||
// res.data.list.forEach((ele, index) => {
|
||||
@ -613,19 +594,3 @@ export default {
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
/* .blueTip { */
|
||||
/* padding-bottom: 10px; */
|
||||
/* } */
|
||||
.blueTip::before{
|
||||
display: inline-block;
|
||||
content: '';
|
||||
width: 4px;
|
||||
height: 18px;
|
||||
background: #0B58FF;
|
||||
border-radius: 1px;
|
||||
margin-right: 8PX;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
@ -1,13 +1,13 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-12 13:45:25
|
||||
* @LastEditTime: 2024-03-18 15:25:48
|
||||
* @LastEditTime: 2024-03-13 15:29:26
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :inline="true" :model="dataForm" class="blueTip">
|
||||
<el-form :inline="true" :model="dataForm" class="demo-form-inline">
|
||||
<el-form-item>
|
||||
<el-date-picker v-model="reportTime" type="week" size="small" @change="changeTime"
|
||||
:picker-options="{firstDayOfWeek: 4}" :format="'yyyy 第 WW 周' + '\u3000' + startTimeStamp + '-' + endTimeStamp"
|
||||
@ -20,11 +20,10 @@
|
||||
@click="handleExport">导出</el-button>
|
||||
</el-form>
|
||||
<el-row style="float: right; margin-bottom: 5px">
|
||||
<el-button v-if="!isSave" size="small" @click="editDataList()">编辑</el-button>
|
||||
<el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
|
||||
<el-button size="small" @click="editDataList()">编辑</el-button>
|
||||
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
|
||||
</el-row>
|
||||
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
|
||||
<el-table :data="list" style="width: 100%" :header-cell-style="{
|
||||
background: '#F2F4F9',
|
||||
color: '#606266'
|
||||
}">
|
||||
@ -50,7 +49,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="inputTrend" label="增减" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="!disabled"></el-input>
|
||||
<el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.inputTrend ? parseFloat((scope.row.inputTrend *
|
||||
100).toFixed(2)) + '%' : undefined }} </span>
|
||||
</template>
|
||||
@ -73,7 +72,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductTrend" label="增减" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="!disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductTrend ? parseFloat((scope.row.goodProductTrend *
|
||||
100).toFixed(2)) + '%' : undefined }} </span>
|
||||
@ -81,78 +80,59 @@
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="原片漏检率" align="center">
|
||||
<el-table-column prop="missCheckNow" label="今日" align="center">
|
||||
<el-table-column prop="missCheckNow" label="本周" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.missCheckNow ? parseFloat((scope.row.missCheckNow *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
<span v-else>{{ scope.row.missCheckNow }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="missCheckHis" label="昨日" align="center">
|
||||
<el-table-column prop="missCheckHis" label="上周" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.missCheckHis ? parseFloat((scope.row.missCheckHis *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
<span v-else>{{ scope.row.missCheckHis }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="missCheckTrend" label="增减" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="!disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.missCheckTrend ? parseFloat((scope.row.missCheckTrend *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
100).toFixed(2)) + '%' : undefined }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="综合良品率" align="center">
|
||||
<el-table-column prop="goodProductPassNow" label="今日" align="center">
|
||||
<el-table-column prop="goodProductPassNow" label="本周" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassNow" :disabled="!disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassNow" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassNow ? parseFloat((scope.row.goodProductPassNow *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
<span v-else>{{ scope.row.goodProductPassNow }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductPassHis" label="昨日" align="center">
|
||||
<el-table-column prop="goodProductPassHis" label="上周" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassHis" :disabled="!disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassHis" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassHis ? parseFloat((scope.row.goodProductPassHis *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
<span v-else>{{ scope.row.goodProductPassHis }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductPassTrend" label="增减" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="!disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassTrend ? parseFloat((scope.row.goodProductPassTrend *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
100).toFixed(2)) + '%' :undefined }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<!-- <div style="height: 50px;" class="remark" slot="append">
|
||||
<div style="height: 50px;" class="remark" slot="append">
|
||||
<el-input placeholder="备注" v-if="!disabled" v-model="remark" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ remark }} </span>
|
||||
</div> -->
|
||||
</el-table>
|
||||
<div style="height: 50px;" class="remark">
|
||||
<el-input placeholder="备注" v-model="remark" :disabled="disabled">
|
||||
</el-input>
|
||||
</div>
|
||||
</el-table>
|
||||
<!-- 搜索工作栏 -->
|
||||
<!-- <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" /> -->
|
||||
|
||||
@ -182,8 +162,7 @@ import moment from 'moment';
|
||||
// import DialogForm from './dialogForm.vue';
|
||||
import { getCorePLList } from '@/api/base/coreProductionLine'
|
||||
import { parseTime } from '../../core/mixins/code-filter';
|
||||
import FileSaver from 'file-saver'
|
||||
import * as XLSX from 'xlsx'
|
||||
|
||||
// import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
const tableProps = [
|
||||
{
|
||||
@ -398,11 +377,6 @@ export default {
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
handleReturn() {
|
||||
this.disabled = true
|
||||
this.isSave = false
|
||||
this.getDataList()
|
||||
},
|
||||
async getDict() {
|
||||
// 产线列表
|
||||
const res = await getCorePLList()
|
||||
@ -425,8 +399,6 @@ export default {
|
||||
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间
|
||||
this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
|
||||
|
||||
// this.changeTime(reportTime)
|
||||
} else if (weekday[this.reportTime.getDay()] === 'Tuesday') {
|
||||
this.startTimeStamp = this.timeFun(new Date().getTime() - 5 * 24 * 60 * 60 * 1000)
|
||||
@ -434,8 +406,6 @@ export default {
|
||||
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间
|
||||
this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
|
||||
|
||||
// this.changeTime(reportTime)
|
||||
} else if (weekday[this.reportTime.getDay()] === 'Wednesday') {
|
||||
this.startTimeStamp = this.timeFun(new Date().getTime() - 6 * 24 * 60 * 60 * 1000)
|
||||
@ -443,8 +413,6 @@ export default {
|
||||
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间
|
||||
this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
|
||||
|
||||
// this.changeTime(reportTime)
|
||||
} else if (weekday[this.reportTime.getDay()] === 'Thursday') {
|
||||
this.startTimeStamp = this.timeFun(new Date().getTime() - 7 * 24 * 60 * 60 * 1000)
|
||||
@ -452,8 +420,6 @@ export default {
|
||||
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间
|
||||
this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
|
||||
|
||||
// this.changeTime(reportTime)
|
||||
} else if (weekday[this.reportTime.getDay()] === 'Friday') {
|
||||
this.startTimeStamp = this.timeFun(new Date().getTime() - 8 * 24 * 60 * 60 * 1000)
|
||||
@ -461,8 +427,6 @@ export default {
|
||||
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间
|
||||
this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
|
||||
|
||||
// this.changeTime(reportTime)
|
||||
} else if (weekday[this.reportTime.getDay()] === 'Saturday') {
|
||||
this.startTimeStamp = this.timeFun(new Date().getTime() - 9 * 24 * 60 * 60 * 1000)
|
||||
@ -470,8 +434,6 @@ export default {
|
||||
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间
|
||||
this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
|
||||
|
||||
// this.changeTime(reportTime)
|
||||
} else if (weekday[this.reportTime.getDay()] === 'Sunday') {
|
||||
this.startTimeStamp = this.timeFun(new Date().getTime() - 10 * 24 * 60 * 60 * 1000)
|
||||
@ -479,39 +441,21 @@ export default {
|
||||
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间
|
||||
this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
|
||||
|
||||
// this.changeTime(reportTime)
|
||||
}
|
||||
},
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
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;
|
||||
let params = { ...this.dataForm };
|
||||
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(() => { });
|
||||
},
|
||||
startWeek() {
|
||||
// console.log(this.weekValue1);
|
||||
@ -588,8 +532,7 @@ export default {
|
||||
this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 6); //结束时间
|
||||
console.log(this.startTimeStamp, this.endTimeStamp)
|
||||
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime())
|
||||
this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
|
||||
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||
} else {
|
||||
this.dataForm.reportTime = []
|
||||
}
|
||||
@ -608,14 +551,8 @@ export default {
|
||||
this.dataForm.reportTime[0] = moment(this.weekValue1).day(0).format('YYYY-MM-DD') + ' 07:00:01'
|
||||
// this.queryParams.startTime = this.monthValue[0]
|
||||
this.dataForm.reportTime[1] = moment(this.weekValue2).day(6).format('YYYY-MM-DD') + ' 07:00:00'
|
||||
this.timeTips = moment(this.weekValue1).day(0).format('YYYY-MM-DD') + ' - ' + moment(this.weekValue2).day(0).format('YYYY-MM-DD')
|
||||
} else {
|
||||
}
|
||||
if (this.dataForm.reportTime.length == 0) {
|
||||
this.$message({
|
||||
message: '请选择时间',
|
||||
type: 'warning'
|
||||
})
|
||||
return false
|
||||
}
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
@ -652,19 +589,3 @@ export default {
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
/* .blueTip { */
|
||||
/* padding-bottom: 10px; */
|
||||
/* } */
|
||||
.blueTip::before{
|
||||
display: inline-block;
|
||||
content: '';
|
||||
width: 4px;
|
||||
height: 18px;
|
||||
background: #0B58FF;
|
||||
border-radius: 1px;
|
||||
margin-right: 8PX;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
@ -1,13 +1,13 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-12 13:45:25
|
||||
* @LastEditTime: 2024-03-18 15:25:54
|
||||
* @LastEditTime: 2024-03-13 15:29:35
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :inline="true" :model="dataForm" class="blueTip">
|
||||
<el-form :inline="true" :model="dataForm" class="demo-form-inline">
|
||||
<el-form-item>
|
||||
<el-date-picker v-model="reportTime" type="year" size="small" @change="changeTime"
|
||||
:picker-options="{firstDayOfWeek: 1}" :format="'yyyy 年' + '\u3000' + startTimeStamp + '-' + endTimeStamp"
|
||||
@ -21,11 +21,10 @@
|
||||
<el-button v-if="isSave" type="success" @click="saveDataList()">保存</el-button> -->
|
||||
</el-form>
|
||||
<el-row style="float: right; margin-bottom: 5px">
|
||||
<el-button v-if="!isSave" size="small" @click="editDataList()">编辑</el-button>
|
||||
<el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
|
||||
<el-button size="small" @click="editDataList()">编辑</el-button>
|
||||
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
|
||||
</el-row>
|
||||
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
|
||||
<el-table :data="list" style="width: 100%" :header-cell-style="{
|
||||
background: '#F2F4F9',
|
||||
color: '#606266'
|
||||
}">
|
||||
@ -52,7 +51,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="inputTrend" label="增减" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="!disabled"></el-input>
|
||||
<el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.inputTrend ? parseFloat((scope.row.inputTrend *
|
||||
100).toFixed(2)) + '%' : undefined }} </span>
|
||||
</template>
|
||||
@ -75,7 +74,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductTrend" label="增减" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="!disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductTrend ? parseFloat((scope.row.goodProductTrend *
|
||||
100).toFixed(2)) + '%' : undefined }} </span>
|
||||
@ -83,78 +82,60 @@
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="原片漏检率" align="center">
|
||||
<el-table-column prop="missCheckNow" label="今日" align="center">
|
||||
<el-table-column prop="missCheckNow" label="今年" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.missCheckNow ? parseFloat((scope.row.missCheckNow *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
<span v-else>{{ scope.row.missCheckNow }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="missCheckHis" label="昨日" align="center">
|
||||
<el-table-column prop="missCheckHis" label="去年" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.missCheckHis ? parseFloat((scope.row.missCheckHis *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
<span v-else>{{ scope.row.missCheckHis }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="missCheckTrend" label="增减" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="!disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.missCheckTrend ? parseFloat((scope.row.missCheckTrend *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
100).toFixed(2)) + '%' : undefined }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="综合良品率" align="center">
|
||||
<el-table-column prop="goodProductPassNow" label="今日" align="center">
|
||||
<el-table-column prop="goodProductPassNow" label="今年" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassNow" :disabled="!disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassNow" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassNow ? parseFloat((scope.row.goodProductPassNow *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
<span v-else>{{ scope.row.goodProductPassNow }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductPassHis" label="昨日" align="center">
|
||||
<el-table-column prop="goodProductPassHis" label="去年" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassHis" :disabled="!disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassHis" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassHis ? parseFloat((scope.row.goodProductPassHis *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
</span>
|
||||
<span v-else>{{ scope.row.goodProductPassHis }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductPassTrend" label="增减" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="!disabled">
|
||||
<el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassTrend ? parseFloat((scope.row.goodProductPassTrend *
|
||||
100).toFixed(2)) +
|
||||
'%' : undefined }}
|
||||
100).toFixed(2)) + '%' : undefined }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<!-- <div style="height: 50px;" class="remark" slot="append">
|
||||
<div style="height: 50px;" class="remark" slot="append">
|
||||
<el-input placeholder="备注" v-if="!disabled" v-model="remark" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ remark }} </span>
|
||||
</div> -->
|
||||
</el-table>
|
||||
<div style="height: 50px;" class="remark">
|
||||
<el-input placeholder="备注" v-model="remark" :disabled="disabled">
|
||||
</el-input>
|
||||
</div>
|
||||
</el-table>
|
||||
<!-- 搜索工作栏 -->
|
||||
<!-- <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" /> -->
|
||||
|
||||
@ -184,8 +165,7 @@ import moment from 'moment';
|
||||
// import DialogForm from './dialogForm.vue';
|
||||
import { parseTime } from '../../core/mixins/code-filter';
|
||||
import { getCorePLList } from '@/api/base/coreProductionLine'
|
||||
import FileSaver from 'file-saver'
|
||||
import * as XLSX from 'xlsx'
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
// width: 128,
|
||||
@ -398,11 +378,6 @@ export default {
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
handleReturn() {
|
||||
this.disabled = true
|
||||
this.isSave = false
|
||||
this.getDataList()
|
||||
},
|
||||
async getDict() {
|
||||
// 产线列表
|
||||
const res = await getCorePLList()
|
||||
@ -420,32 +395,16 @@ export default {
|
||||
},
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
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;
|
||||
let params = { ...this.dataForm };
|
||||
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(() => { });
|
||||
},
|
||||
// startYear() {
|
||||
// if (this.yearValue2 && this.yearValue2 < this.yearValue1) {
|
||||
@ -547,13 +506,6 @@ export default {
|
||||
// this.dataForm.reportTime[0] = this.transformYear(this.yearValue1)
|
||||
// this.dataForm.reportTime[1] = this.transformYear(this.yearValue2)
|
||||
}
|
||||
}
|
||||
if (this.dataForm.reportTime.length == 0) {
|
||||
this.$message({
|
||||
message: '请选择时间',
|
||||
type: 'warning'
|
||||
})
|
||||
return false
|
||||
}
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
@ -590,19 +542,3 @@ export default {
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
/* .blueTip { */
|
||||
/* padding-bottom: 10px; */
|
||||
/* } */
|
||||
.blueTip::before{
|
||||
display: inline-block;
|
||||
content: '';
|
||||
width: 4px;
|
||||
height: 18px;
|
||||
background: #0B58FF;
|
||||
border-radius: 1px;
|
||||
margin-right: 8PX;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user