projects/mesxc-zhp #252

Fusionnée
juzi a fusionné 3 révision(s) à partir de projects/mesxc-zhp vers projects/mesxc-test 2024-03-18 16:11:51 +08:00
27 fichiers modifiés avec 1005 ajouts et 369 suppressions

Voir le fichier

@ -1,7 +1,7 @@
/*
* @Author: zhp
* @Date: 2023-10-18 09:33:57
* @LastEditTime: 2023-11-03 09:31:17
* @LastEditTime: 2024-03-15 15:18:09
* @LastEditors: zhp
* @Description:
*/
@ -33,3 +33,12 @@ export function exportEnergyPlcExcel(query) {
responseType: 'blob'
})
}
export function exportEquipmentTraceabilityExcel(query) {
return request({
url: '/analysis/equipment-analysis/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

Voir le fichier

@ -104,7 +104,7 @@ export const DICT_TYPE = {
ORDER_PRIORITY: 'order_priority',
PACK_SPEC: 'pack_spec',
WORK_ORDER_STATUS: 'work_order_status',
// ============== EQUIPMENT - 设备模块 =============
MAINTAIN_TYPE: 'maintain_type',
FAULT_LEVEL: 'fault-level',
@ -116,7 +116,9 @@ export const DICT_TYPE = {
ENVIRONMENT_CHECK_UNIT: 'environment_check_unit',
// ============== GROUP - 班组模块 =============
WORK_SHOP: 'workshop'
WORK_SHOP: 'workshop',
// ============== GROUP - 质量模块 =============
MATERIAL_GRADE: 'material_grade'
}
/**

Voir le fichier

@ -210,8 +210,8 @@ export default {
mobileCodeTimer: 0,
loginForm: {
loginType: 'uname',
username: 'admin',
password: 'admin123',
username: '',
password: '',
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,

Voir le fichier

@ -107,7 +107,8 @@ export default {
},
{
prop: 'inspectionInfoList',
label: '检测内容',
label: '检测内容',
showOverflowtooltip: true,
}
],
//
@ -171,7 +172,7 @@ export default {
type: "warning",
})
.then(() => {
this.urlOptions.deleteURL(id).then(({ data }) => {
this.urlOptions.deleteURL(data.id).then(({ data }) => {
this.$message({
message: "操作成功",
type: "success",

Voir le fichier

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2024-01-30 10:53:32
* @LastEditTime: 2024-02-23 15:16:35
* @LastEditTime: 2024-03-15 14:07:15
* @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'"

Voir le fichier

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2024-01-30 10:52:01
* @LastEditTime: 2024-02-01 14:43:53
* @LastEditTime: 2024-03-15 14:06:55
* @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">

Voir le fichier

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2023-12-08 13:46:17
* @LastEditTime: 2024-03-12 14:54:05
* @LastEditTime: 2024-03-15 14:54:38
* @LastEditors: zhp
* @Description:
-->
@ -246,7 +246,9 @@ export default {
dataRule: {
// code: [{ required: true, message: "", trigger: "blur" }],
name: [{ required: true, message: "设备物料名称不能为空", trigger: "blur" }],
equipmentId: [{ required: true, message: "设备名称不能为空", trigger: "change" }],
equipmentId: [{ required: true, message: "设备名称不能为空", trigger: "change" }],
checkResult: [{ required: true, message: "判定结果不能为空", trigger: "change" }],
// : [{ required: true, message: "", trigger: "change" }],
// processTime: [{ required: true, message: "线", trigger: "blur" }]
}
@ -405,7 +407,7 @@ export default {
getSupplierList().then(res => {
this.supplierList = res.data
})
const res = await getDictDatas(this.DICT_TYPE.EQU_ALARM_LEVEL)
const res = await getDictDatas(this.DICT_TYPE.MATERIAL_GRADE)
console.log('111', res)
this.gradeList = res
},

Voir le fichier

@ -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: '备注', },

Voir le fichier

@ -29,7 +29,7 @@
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="30%">
width="40%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>

Voir le fichier

@ -1,13 +1,13 @@
<!--
* @Author: zhp
* @Date: 2023-11-06 15:15:30
* @LastEditTime: 2024-03-01 10:33:48
* @LastEditTime: 2024-03-15 14:31:10
* @LastEditors: zhp
* @Description:
-->
<template>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="auto">
<el-row :gutter="24">
<el-row :gutter="20">
<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 v-model="dataForm.logTime" type="datetime" value-format="timestamp" placeholder="选择日期">
<el-date-picker style="width: 100%;" v-model="dataForm.logTime" type="datetime" value-format="timestamp" placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>
@ -130,17 +130,16 @@ export default {
this.getDict()
console.log('我看看', this.dataForm)
// this.getCurrentTime()
this.getWorksectionById()
// this.dataForm.logTime = new Date()
},
methods: {
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 = year + "-" + month + "-" + day;
// // console.log(this.dataForm.logTime);
// },
async getDict() {
//
//
const res = await getList()
this.typeList = res.data
getWorkOrderList().then((res) => {

Voir le fichier

@ -1,7 +1,7 @@
/*
* @Author: zhp
* @Date: 2024-02-28 09:51:25
* @LastEditTime: 2024-03-08 13:46:46
* @LastEditTime: 2024-03-15 14:34:29
* @LastEditors: zhp
* @Description:
*/
@ -24,10 +24,25 @@ export default {
}
},
created() {
this.dataForm.logTime = this.format(new Date().getTime())
console.log(this.dataForm.logTime);
},
activated() {
mounted () {
},
// 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;
@ -41,6 +56,7 @@ 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) {

Voir le fichier

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2023-11-06 15:15:30
* @LastEditTime: 2024-03-01 10:18:39
* @LastEditTime: 2024-03-15 14:33:12
* @LastEditors: zhp
* @Description:
-->
@ -110,6 +110,7 @@ export default {
name: '自动',
}
],
sectionList:[],
visible:false,
dataForm: {
id: undefined,
@ -138,19 +139,18 @@ export default {
mounted() {
this.getDict()
console.log('我看看', this.dataForm)
this.getCurrentTime()
// this.getWorksectionById()
// this.getCurrentTime()
},
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()

Voir le fichier

@ -29,7 +29,7 @@
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="30%">
width="40%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>

Voir le fichier

@ -89,7 +89,9 @@
// 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],
@ -256,7 +258,7 @@ export default {
// parent: 'dateFilterType',
//
type: 'datePicker',
// label: '',
label: '时间段',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
@ -284,7 +286,13 @@ export default {
btnName: '查询',
name: 'search',
color: 'primary',
},
},
{
type: 'button',
btnName: '导出',
name: 'export',
color: 'warning',
},
// {
// type: 'separate',
// },
@ -372,7 +380,24 @@ 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() {
this.loading = true;
@ -404,7 +429,8 @@ export default {
`${payload.timeday} 23:59:59`,
];
}
} else {
} else {
this.handleExport()
this.queryParams.recordTime = null;
}
this.getList();

Voir le fichier

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2023-08-01 14:55:51
* @LastEditors: zhp
* @LastEditTime: 2023-12-01 16:43:10
* @LastEditTime: 2024-03-15 15:22:59
* @Description:
-->
<template>
@ -121,7 +121,7 @@ export default {
},
{
type: 'datePicker',
label: '工单开始时间',
label: '时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "yyyy-MM-dd",

Voir le fichier

@ -263,7 +263,7 @@ export default {
width: 90,
prop: 'source',
label: '来源',
filter: (val) => ['平板端', '网页端'][val],
filter: (val) => val == 1 ? '平板端' : '网页端',
},
],
// keys, queryParams pageNo, pageSize key
@ -457,7 +457,7 @@ export default {
return;
}
//
let str = this.form.checkPerson.join()
let str = this.form.checkPerson ? this.form.checkPerson.join() : null
this.form.checkPerson = str
if (this.form.id != null) {
updateQualityInspectionRecord(this.form).then((response) => {

Voir le fichier

@ -223,7 +223,7 @@ export default {
{
// width: 128,
prop: 'sumScrap',
label: '未检测总数',
label: '未通过检测总数',
},
{
// width: 128,

Voir le fichier

@ -1,13 +1,15 @@
<!--
* @Author: zhp
* @Date: 2024-01-24 15:15:24
* @LastEditTime: 2024-03-13 15:21:30
* @LastEditTime: 2024-03-18 16:00:41
* @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="选择日期">
@ -21,8 +23,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"
@ -37,7 +39,8 @@ 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() {
@ -79,45 +82,75 @@ export default {
},
//
multipliedByHundred(str) {
let floatVal = parseFloat(str);
if (isNaN(floatVal)) {
return 0;
// console.log(str)
if (str != 0) {
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);
}
floatVal = Math.round(str * 10000) / 100;
let strVal = floatVal.toString();
let searchVal = strVal.indexOf('.');
if (searchVal < 0) {
searchVal = strVal.length;
strVal += '.';
}
while (strVal.length <= searchVal + 2) {
strVal += '0';
}
return parseFloat(strVal);
},
async getDataList() {
this.dataListLoading = true;
await this.urlOptions.getDataListURL(this.listQuery).then(response => {
this.tableData = response.data.filter(item => {
this.proLineList.forEach(it => {
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.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
}
})
})
this.tableData = res.data
// this.tableData = response.data.filter(item => {
// this.proLineList.forEach(it => {
// if (item.lineId === it.id) {
// item.lineName = it.name
item.dailyOutputTrend = item.dailyOutputTrend ? parseFloat((item.dailyOutputTrend * 100).toFixed(2)) + '%' : null
item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
item.actualProductTrend = item.actualProductTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
item.originalGlassPassTrend = item.originalGlassPassTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
}
})
if (item.det === false) {
this.all = {
id: item.id,
remark: item.remark
}
}
return item.det === true
});
this.listQuery.total = response.data.length;
// }
// })
// if (item.det === false) {
// this.all = {
// id: item.id,
// remark: item.remark
// }
// }
// return item.det === true
// });
this.listQuery.total = res.data.length;
this.dataListLoading = false;
});
},
@ -142,6 +175,9 @@ 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);
@ -176,17 +212,33 @@ export default {
/** 导出按钮操作 */
handleExport() {
//
let params = { ...this.listQuery };
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
this.exportLoading = true;
return this.urlOptions.exportURL(params);
}).then(response => {
this.$download.excel(response, '原片生产日报.xls');
this.exportLoading = false;
}).catch(() => { });
}
var xlsxParam = { raw: true };
/* 从表生成工作簿对象 */
var wb = XLSX.utils.table_to_book(
document.querySelector("#exportTable"),
xlsxParam
);
/* 获取二进制字符串作为输出 */
var wbout = XLSX.write(wb, {
bookType: "xlsx",
bookSST: true,
type: "array",
});
try {
FileSaver.saveAs(
//Blob
//Blob JavaScript
//File Blob blob 使
// Blob
new Blob([wbout], { type: "application/octet-stream" }),
//
"许昌安彩日原片生产汇总.xlsx"
);
} catch (e) {
if (typeof console !== "undefined") console.log(e, wbout);
}
return wbout;
},
},
};
</script>

Voir le fichier

@ -1,7 +1,7 @@
<!--
* @Author: Do not edit
* @Date: 2023-12-13 14:10:04
* @LastEditTime: 2024-03-13 15:27:43
* @LastEditTime: 2024-03-18 09:57:30
* @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="edit= false">返回</el-button>
<el-button v-if="edit" size="small" @click="handleReturn()">返回</el-button>
<el-button v-if="edit" size="small" @click="updateData">保存</el-button>
</el-row>
<el-table :data="data" border show-summary style="width: 100%">
<el-table :id="id" :data="data" border 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,14 +20,16 @@
<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 v-else v-model="scope.row[y.prop]"></el-input>
<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>
</template>
</el-table-column>
</el-table-column>
</el-table-column>
</el-table>
<el-input type="textarea" v-model="sum.remark" placeholder="备注" :disabled="!edit"
:autosize="{ minRows: 2, maxRows: 6}"></el-input>
<el-input type="textarea" v-model="remark" placeholder="备注" :disabled="!edit" :autosize="{ minRows: 2, maxRows: 6}">
</el-input>
</div>
</template>
@ -112,7 +114,7 @@ const cols = [
label: '本周',
},
{
prop: 'originalGlassPassHis ',
prop: 'originalGlassPassHis',
label: '上周',
},
{
@ -130,6 +132,10 @@ const cols = [
type: Array,
default: () => [],
},
id: {
type: String,
default:'exportTable'
},
time: {
type: Array,
default: () => [],
@ -150,6 +156,7 @@ const cols = [
data() {
return {
cols,
remark:null,
edit: false,
};
},
@ -195,16 +202,44 @@ const cols = [
}
}
},
methods: {
methods: {
handleReturn() {
// this.disabled = true
this.edit = false
},
handleChange(e) {
// console.log(q)
console.log(e);
},
updateData() {
let obj = {}
this.data.forEach((ele, index) => {
if (ele.det === false) {
this.data[index].lineId = ''
this.data[index].remark = this.remark
obj = ele
delete this.data[index].dailyOutputTrend
delete this.data[index].originalGlassStatisticsTrend
delete this.data[index].actualProductTrend
delete this.data[index].originalGlassPassTrend
this.data.splice(index, 1)
}
})
let updateArr = this.data
updateArr.forEach((ele, index) => {
delete ele.dailyOutputTrend
delete ele.originalGlassStatisticsTrend
delete ele.actualProductTrend
delete ele.originalGlassPassTrend
});
updateGlass(this.data).then(response => {
updateGlassRemark(this.sum).then(res => {
// this.data.forEach((ele, index) => {
// delete ele.dailyOutputTrend
// delete ele.originalGlassStatisticsTrend
// delete ele.actualProductTrend
// delete ele.originalGlassPassTrend
// });
updateGlass(updateArr).then(response => {
updateGlassRemark(obj).then(res => {
this.$modal.msgSuccess("修改成功");
this.edit = false;
this.$emit("refreshDataList");

Voir le fichier

@ -29,7 +29,8 @@ import { parseTime } from '../../core/mixins/code-filter';
import { getGlassPage, exportGlasscExcel } from '@/api/report/glass';
import inputTable from './inputTable.vue';
import { getCorePLList } from '@/api/base/coreProductionLine';
import FileSaver from 'file-saver'
import * as XLSX from 'xlsx'
export default {
components: { inputTable },
data() {
@ -72,29 +73,61 @@ export default {
// console.log(date)
this.changeTime(date)
// console.log(date.valueOf());
},
multipliedByHundred(str) {
if (str) {
let floatVal = parseFloat(str);
if (isNaN(floatVal)) {
return 0;
}
floatVal = Math.round(str * 10000) / 100;
let strVal = floatVal.toString();
let searchVal = strVal.indexOf('.');
if (searchVal < 0) {
searchVal = strVal.length;
strVal += '.';
}
while (strVal.length <= searchVal + 2) {
strVal += '0';
}
return parseFloat(strVal);
}
},
//
async getDataList() {
this.dataListLoading = true;
await this.urlOptions.getDataListURL(this.listQuery).then(response => {
this.tableData = response.data.filter(item => {
this.proLineList.forEach(it => {
if (item.lineId === it.id) {
if (this.listQuery.reportTime.length == 0) {
this.$message({
message: '请选择时间',
type: 'warning'
})
return false
}
await this.urlOptions.getDataListURL(this.listQuery).then(res => {
res.data.forEach((ele, index) => {
if (ele.det === false) {
res.data[index].lineName = '合计'
this.remark = res.data[index].remark
res.data[index].dailyOutputTrend = res.data[index].dailyOutputTrend != 0 ? this.multipliedByHundred(res.data[index].dailyOutputTrend) + '%' : res.data[index].dailyOutputTrend == 0 ? 0 : undefined
res.data[index].originalGlassStatisticsTrend = res.data[index].originalGlassStatisticsTrend != 0 ? this.multipliedByHundred(res.data[index].originalGlassStatisticsTrend) + '%' : res.data[index].originalGlassStatisticsTrend == 0 ? 0 : undefined
res.data[index].actualProductTrend = res.data[index].actualProductTrend != 0 ? this.multipliedByHundred(res.data[index].actualProductTrend) + '%' : res.data[index].actualProductTrend == 0 ? 0 : undefined
res.data[index].originalGlassPassTrend = res.data[index].originalGlassPassTrend != 0 ? this.multipliedByHundred(res.data[index].originalGlassPassTrend) + '%' : res.data[index].originalGlassPassTrend == 0 ? 0 : undefined
}
})
res.data.forEach(item => {
this.proLineList.forEach(it => {
if (item.lineId === it.id) {
console.log(item)
item.lineName = it.name
item.dailyOutputTrend = item.dailyOutputTrend ? parseFloat((item.dailyOutputTrend * 100).toFixed(2)) + '%' : null
item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
item.actualProductTrend = item.actualProductTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
item.originalGlassPassTrend = item.originalGlassPassTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
}
})
if (item.det === false) {
this.all = {
id: item.id,
remark: item.remark
}
}
return item.det === true
});
item.dailyOutputTrend = item.dailyOutputTrend != 0 ? this.multipliedByHundred(item.dailyOutputTrend) + '%' : item.dailyOutputTrend == 0 ? 0 : undefined
item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend != 0 ? this.multipliedByHundred(item.originalGlassStatisticsTrend) + '%' : item.originalGlassStatisticsTrend == 0 ? 0 : undefined
item.actualProductTrend = item.actualProductTrend != 0 ? this.multipliedByHundred(item.actualProductTrend) + '%' : item.actualProductTrend == 0 ? 0 : undefined
item.originalGlassPassTrend = item.originalGlassPassTrend != 0 ? this.multipliedByHundred(item.originalGlassPassTrend) + '%' : item.originalGlassPassTrend == 0 ? 0 : undefined
}
})
})
this.tableData = res.data
this.listQuery.total = response.data.length;
this.dataListLoading = false;
});
@ -165,16 +198,32 @@ export default {
/** 导出按钮操作 */
handleExport() {
//
let params = { ...this.listQuery };
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
this.exportLoading = true;
return this.urlOptions.exportURL(params);
}).then(response => {
this.$download.excel(response, '原片生产周报.xls');
this.exportLoading = false;
}).catch(() => { });
var xlsxParam = { raw: true };
/* 从表生成工作簿对象 */
var wb = XLSX.utils.table_to_book(
document.querySelector("#exportTable"),
xlsxParam
);
/* 获取二进制字符串作为输出 */
var wbout = XLSX.write(wb, {
bookType: "xlsx",
bookSST: true,
type: "array",
});
try {
FileSaver.saveAs(
//Blob
//Blob JavaScript
//File Blob blob 使
// Blob
new Blob([wbout], { type: "application/octet-stream" }),
//
"许昌安彩月原片生产汇总.xlsx"
);
} catch (e) {
if (typeof console !== "undefined") console.log(e, wbout);
}
return wbout;
}
},
};

Voir le fichier

@ -31,7 +31,8 @@ import { parseTime } from '../../core/mixins/code-filter';
import { getGlassPage, exportGlasscExcel } from '@/api/report/glass';
import inputTable from './inputTable.vue';
import { getCorePLList } from '@/api/base/coreProductionLine';
import FileSaver from 'file-saver'
import * as XLSX from 'xlsx'
export default {
components: { inputTable },
data() {
@ -163,29 +164,61 @@ export default {
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
// this.changeTime(reportTime)
}
},
multipliedByHundred(str) {
if (str) {
let floatVal = parseFloat(str);
if (isNaN(floatVal)) {
return 0;
}
floatVal = Math.round(str * 10000) / 100;
let strVal = floatVal.toString();
let searchVal = strVal.indexOf('.');
if (searchVal < 0) {
searchVal = strVal.length;
strVal += '.';
}
while (strVal.length <= searchVal + 2) {
strVal += '0';
}
return parseFloat(strVal);
}
},
//
async getDataList() {
this.dataListLoading = true;
await this.urlOptions.getDataListURL(this.listQuery).then(response => {
this.tableData = response.data.filter(item => {
this.proLineList.forEach(it => {
if (item.lineId === it.id) {
if (this.listQuery.reportTime.length == 0) {
this.$message({
message: '请选择时间',
type: 'warning'
})
return false
}
await this.urlOptions.getDataListURL(this.listQuery).then(res => {
res.data.forEach((ele, index) => {
if (ele.det === false) {
res.data[index].lineName = '合计'
this.remark = res.data[index].remark
res.data[index].dailyOutputTrend = res.data[index].dailyOutputTrend != 0 ? this.multipliedByHundred(res.data[index].dailyOutputTrend) + '%' : res.data[index].dailyOutputTrend == 0 ? 0 : undefined
res.data[index].originalGlassStatisticsTrend = res.data[index].originalGlassStatisticsTrend != 0 ? this.multipliedByHundred(res.data[index].originalGlassStatisticsTrend) + '%' : res.data[index].originalGlassStatisticsTrend == 0 ? 0 : undefined
res.data[index].actualProductTrend = res.data[index].actualProductTrend != 0 ? this.multipliedByHundred(res.data[index].actualProductTrend) + '%' : res.data[index].actualProductTrend == 0 ? 0 : undefined
res.data[index].originalGlassPassTrend = res.data[index].originalGlassPassTrend != 0 ? this.multipliedByHundred(res.data[index].originalGlassPassTrend) + '%' : res.data[index].originalGlassPassTrend == 0 ? 0 : undefined
}
})
res.data.forEach(item => {
this.proLineList.forEach(it => {
if (item.lineId === it.id) {
console.log(item)
item.lineName = it.name
item.dailyOutputTrend = item.dailyOutputTrend ? parseFloat((item.dailyOutputTrend * 100).toFixed(2)) + '%' : null
item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
item.actualProductTrend = item.actualProductTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
item.originalGlassPassTrend = item.originalGlassPassTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
}
})
if (item.det === false) {
this.all = {
id: item.id,
remark: item.remark
}
}
return item.det === true
});
item.dailyOutputTrend = item.dailyOutputTrend != 0 ? this.multipliedByHundred(item.dailyOutputTrend) + '%' : item.dailyOutputTrend == 0 ? 0 : undefined
item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend != 0 ? this.multipliedByHundred(item.originalGlassStatisticsTrend) + '%' : item.originalGlassStatisticsTrend == 0 ? 0 : undefined
item.actualProductTrend = item.actualProductTrend != 0 ? this.multipliedByHundred(item.actualProductTrend) + '%' : item.actualProductTrend == 0 ? 0 : undefined
item.originalGlassPassTrend = item.originalGlassPassTrend != 0 ? this.multipliedByHundred(item.originalGlassPassTrend) + '%' : item.originalGlassPassTrend == 0 ? 0 : undefined
}
})
})
this.tableData = res.data
this.listQuery.total = response.data.length;
this.dataListLoading = false;
});
@ -230,16 +263,32 @@ export default {
/** 导出按钮操作 */
handleExport() {
//
let params = { ...this.listQuery };
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
this.exportLoading = true;
return this.urlOptions.exportURL(params);
}).then(response => {
this.$download.excel(response, '原片生产周报.xls');
this.exportLoading = false;
}).catch(() => { });
var xlsxParam = { raw: true };
/* 从表生成工作簿对象 */
var wb = XLSX.utils.table_to_book(
document.querySelector("#exportTable"),
xlsxParam
);
/* 获取二进制字符串作为输出 */
var wbout = XLSX.write(wb, {
bookType: "xlsx",
bookSST: true,
type: "array",
});
try {
FileSaver.saveAs(
//Blob
//Blob JavaScript
//File Blob blob 使
// Blob
new Blob([wbout], { type: "application/octet-stream" }),
//
"许昌安彩周原片生产汇总.xlsx"
);
} catch (e) {
if (typeof console !== "undefined") console.log(e, wbout);
}
return wbout;
}
},
};

Voir le fichier

@ -26,7 +26,8 @@ import { parseTime } from '../../core/mixins/code-filter';
import { getGlassPage, exportGlasscExcel } from '@/api/report/glass';
import inputTable from './inputTable.vue';
import { getCorePLList } from '@/api/base/coreProductionLine';
import FileSaver from 'file-saver'
import * as XLSX from 'xlsx'
export default {
components: { inputTable },
data() {
@ -74,29 +75,61 @@ export default {
// 线
const res = await getCorePLList();
this.proLineList = res.data;
},
},
multipliedByHundred(str) {
if (str) {
let floatVal = parseFloat(str);
if (isNaN(floatVal)) {
return 0;
}
floatVal = Math.round(str * 10000) / 100;
let strVal = floatVal.toString();
let searchVal = strVal.indexOf('.');
if (searchVal < 0) {
searchVal = strVal.length;
strVal += '.';
}
while (strVal.length <= searchVal + 2) {
strVal += '0';
}
return parseFloat(strVal);
}
},
//
async getDataList() {
this.dataListLoading = true;
await this.urlOptions.getDataListURL(this.listQuery).then(response => {
this.tableData = response.data.filter(item => {
this.proLineList.forEach(it => {
if (this.listQuery.reportTime.length == 0) {
this.$message({
message: '请选择时间',
type: 'warning'
})
return false
}
await this.urlOptions.getDataListURL(this.listQuery).then(res => {
res.data.forEach((ele, index) => {
if (ele.det === false) {
res.data[index].lineName = '合计'
this.remark = res.data[index].remark
res.data[index].dailyOutputTrend = res.data[index].dailyOutputTrend != 0 ? this.multipliedByHundred(res.data[index].dailyOutputTrend) + '%' : res.data[index].dailyOutputTrend == 0 ? 0 : undefined
res.data[index].originalGlassStatisticsTrend = res.data[index].originalGlassStatisticsTrend != 0 ? this.multipliedByHundred(res.data[index].originalGlassStatisticsTrend) + '%' : res.data[index].originalGlassStatisticsTrend == 0 ? 0 : undefined
res.data[index].actualProductTrend = res.data[index].actualProductTrend != 0 ? this.multipliedByHundred(res.data[index].actualProductTrend) + '%' : res.data[index].actualProductTrend == 0 ? 0 : undefined
res.data[index].originalGlassPassTrend = res.data[index].originalGlassPassTrend != 0 ? this.multipliedByHundred(res.data[index].originalGlassPassTrend) + '%' : res.data[index].originalGlassPassTrend == 0 ? 0 : undefined
}
})
res.data.forEach(item => {
this.proLineList.forEach(it => {
if (item.lineId === it.id) {
item.dailyOutputTrend = item.dailyOutputTrend ? parseFloat((item.dailyOutputTrend * 100).toFixed(2)) + '%' : null
item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
item.actualProductTrend = item.actualProductTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
item.originalGlassPassTrend = item.originalGlassPassTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
item.lineName = it.name
}
})
if (item.det === false) {
this.all = {
id: item.id,
remark: item.remark
}
}
return item.det === true
});
console.log(item)
item.lineName = it.name
item.dailyOutputTrend = item.dailyOutputTrend != 0 ? this.multipliedByHundred(item.dailyOutputTrend) + '%' : item.dailyOutputTrend == 0 ? 0 : undefined
item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend != 0 ? this.multipliedByHundred(item.originalGlassStatisticsTrend) + '%' : item.originalGlassStatisticsTrend == 0 ? 0 : undefined
item.actualProductTrend = item.actualProductTrend != 0 ? this.multipliedByHundred(item.actualProductTrend) + '%' : item.actualProductTrend == 0 ? 0 : undefined
item.originalGlassPassTrend = item.originalGlassPassTrend != 0 ? this.multipliedByHundred(item.originalGlassPassTrend) + '%' : item.originalGlassPassTrend == 0 ? 0 : undefined
}
})
})
this.tableData = res.data
this.listQuery.total = response.data.length;
this.dataListLoading = false;
});
@ -139,16 +172,32 @@ export default {
/** 导出按钮操作 */
handleExport() {
//
let params = { ...this.listQuery };
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
this.exportLoading = true;
return this.urlOptions.exportURL(params);
}).then(response => {
this.$download.excel(response, '原片生产周报.xls');
this.exportLoading = false;
}).catch(() => { });
var xlsxParam = { raw: true };
/* 从表生成工作簿对象 */
var wb = XLSX.utils.table_to_book(
document.querySelector("#exportTable"),
xlsxParam
);
/* 获取二进制字符串作为输出 */
var wbout = XLSX.write(wb, {
bookType: "xlsx",
bookSST: true,
type: "array",
});
try {
FileSaver.saveAs(
//Blob
//Blob JavaScript
//File Blob blob 使
// Blob
new Blob([wbout], { type: "application/octet-stream" }),
//
"许昌安彩年原片生产汇总.xlsx"
);
} catch (e) {
if (typeof console !== "undefined") console.log(e, wbout);
}
return wbout;
}
},
};

Voir le fichier

@ -1,13 +1,13 @@
<!--
* @Author: zhp
* @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-03-13 15:28:18
* @LastEditTime: 2024-03-18 15:24:10
* @LastEditors: zhp
* @Description:
-->
<template>
<div class="app-container">
<el-form :inline="true" :model="listQuery" class="demo-form-inline">
<el-form :inline="true" :model="listQuery" class="blueTip">
<el-form-item label="日" prop="reportTime">
<el-date-picker clearable v-model="reportTime" @change="changeTime" type="date" placeholder="选择日期">
</el-date-picker>
@ -17,10 +17,11 @@
@click="handleExport">导出</el-button>
</el-form>
<el-row style="float: right; margin-bottom: 5px">
<el-button size="small" @click="editDataList()">编辑</el-button>
<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" v-if="isSave" @click="saveDataList()">保存</el-button>
</el-row>
<el-table :data="list" style="width: 100%" :header-cell-style="{
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
background: '#F2F4F9',
color: '#606266'
}">
@ -46,9 +47,9 @@
</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>
undefined}} </span>
</template>
</el-table-column>
</el-table-column>
@ -69,10 +70,10 @@
</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>
'%' : undefined }} </span>
</template>
</el-table-column>
</el-table-column>
@ -80,57 +81,75 @@
<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 }} </span>
<span v-else>{{ scope.row.missCheckNow ? parseFloat((scope.row.missCheckNow *
100).toFixed(2)) +
'%' : undefined }}
</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 }} </span>
<span v-else>{{ scope.row.missCheckHis ? parseFloat((scope.row.missCheckHis *
100).toFixed(2)) +
'%' : undefined }}
</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 }} </span>
<span v-else>{{ scope.row.goodProductPassNow ? parseFloat((scope.row.goodProductPassNow *
100).toFixed(2)) +
'%' : undefined }}
</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 }} </span>
<span v-else>{{ scope.row.goodProductPassHis ? parseFloat((scope.row.goodProductPassHis *
100).toFixed(2)) +
'%' : undefined }}
</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>
<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>
</div>
<!-- 搜索工作栏 -->
<!-- <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" /> -->
@ -157,6 +176,8 @@ 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';
@ -432,6 +453,10 @@ export default {
this.getDict()
},
methods: {
handleReturn() {
this.disabled = true
this.isSave = false
},
format(shijianchuo) {
//shijianchuoparseInt
var time = moment(new Date(shijianchuo)).format('YYYY-MM-DD HH:mm:ss')
@ -457,23 +482,40 @@ 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
console.log(this.listQuery.reportTime);
this.timeTips = this.listQuery.reportTime[0] + ' - ' + this.listQuery.reportTime[1]
// console.log(this.listQuery.reportTime);
} else {
this.listQuery.reportTime = []
}
},
handleExport() {
//
let params = { ...this.listQuery };
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
this.exportLoading = true;
return this.urlOptions.exportURL(params);
}).then(response => {
this.$download.excel(response, '成品生产月报.xls');
this.exportLoading = false;
}).catch(() => { });
var xlsxParam = { raw: true };
/* 从表生成工作簿对象 */
var wb = XLSX.utils.table_to_book(
document.querySelector("#exportTable"),
xlsxParam
);
/* 获取二进制字符串作为输出 */
var wbout = XLSX.write(wb, {
bookType: "xlsx",
bookSST: true,
type: "array",
});
try {
FileSaver.saveAs(
//Blob
//Blob JavaScript
//File Blob blob 使
// Blob
new Blob([wbout], { type: "application/octet-stream" }),
//
"许昌安彩月成品生产汇总.xlsx"
);
} catch (e) {
if (typeof console !== "undefined") console.log(e, wbout);
}
return wbout;
},
// timeSelect() {
// // switch (this.queryParams.timeDim) {
@ -520,6 +562,7 @@ export default {
editDataList() {
this.disabled = false
this.isSave = true
this.getDataList()
},
async saveDataList() {
let obj = {}
@ -563,14 +606,19 @@ 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
// }
console.log(this.listQuery);
if (this.listQuery.reportTime.length == 0) {
this.$message({
message: '请选择时间',
type: 'warning'
})
return false
}
const res = await this.$axios({
url: '/base/report-auto-production/page',
@ -604,3 +652,19 @@ 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>

Voir le fichier

@ -1,17 +1,15 @@
<!--
* @Author: zhp
* @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-03-13 15:29:17
* @LastEditTime: 2024-03-18 15:27:53
* @LastEditors: zhp
* @Description:
-->
<template>
<div class="app-container">
<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-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-date-picker>
</el-form-item>
<el-button type="primary" @click="getDataList()">查询</el-button>
@ -19,10 +17,11 @@
@click="handleExport">导出</el-button>
</el-form>
<el-row style="float: right; margin-bottom: 5px">
<el-button size="small" @click="editDataList()">编辑</el-button>
<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" v-if="isSave" @click="saveDataList()">保存</el-button>
</el-row>
<el-table :data="list" style="width: 100%" :header-cell-style="{
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
background: '#F2F4F9',
color: '#606266'
}">
@ -48,9 +47,9 @@
</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>
100).toFixed(2)) + '%' : undefined }} </span>
</template>
</el-table-column>
</el-table-column>
@ -71,67 +70,86 @@
</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>
100).toFixed(2)) + '%' : undefined }} </span>
</template>
</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 }} </span>
<span v-else>{{ scope.row.missCheckNow ? parseFloat((scope.row.missCheckNow *
100).toFixed(2)) +
'%' : undefined }}
</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 }} </span>
<span v-else>{{ scope.row.missCheckHis ? parseFloat((scope.row.missCheckHis *
100).toFixed(2)) +
'%' : undefined }}
</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 }} </span>
<span v-else>{{ scope.row.goodProductPassNow ? parseFloat((scope.row.goodProductPassNow *
100).toFixed(2)) +
'%' : undefined }}
</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 }} </span>
<span v-else>{{ scope.row.goodProductPassHis ? parseFloat((scope.row.goodProductPassHis *
100).toFixed(2)) +
'%' : undefined }}
</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>
</div> -->
</el-table>
<div style="height: 50px;" class="remark">
<el-input placeholder="备注" v-model="remark" :disabled="disabled">
</el-input>
</div>
<!-- 搜索工作栏 -->
<!-- <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" /> -->
@ -159,8 +177,10 @@ 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 = [
{
@ -397,7 +417,8 @@ export default {
// explainText: undefined,
// remark: undefined,
// },
//
//
reportTime:'',
dataForm: {
// workOrderIdList:undefined,
// productionId: undefined,
@ -411,7 +432,7 @@ export default {
},
created() {
this.getCurrentMonthFirst()
this.getCurrentMonthLast()
// this.getCurrentMonthLast()
// this.getProductLineList();
},
mounted() {
@ -435,6 +456,11 @@ export default {
this.getDict()
},
methods: {
handleReturn() {
this.disabled = true
this.isSave = false
this.getDataList()
},
async getDict() {
// 线
const res = await getCorePLList();
@ -442,32 +468,89 @@ export default {
},
handleExport() {
//
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(() => { });
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;
},
getCurrentMonthFirst() {
const date = new Date();
date.setDate(1)
// date.setHours(7, 0, 1)
this.monthValue[0] = moment(date).format('YYYY-MM-DD')
console.log(date)
date.setDate(1);
this.reportTime = date
// console.log(date)
this.changeTime(date)
// console.log(date.valueOf());
},
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)
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)
},
timeSelect() {
// switch (this.queryParams.timeDim) {
@ -566,7 +649,13 @@ 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',
@ -601,3 +690,19 @@ 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>

Voir le fichier

@ -1,13 +1,13 @@
<!--
* @Author: zhp
* @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-03-15 13:42:59
* @LastEditTime: 2024-03-18 15:26:52
* @LastEditors: zhp
* @Description:
-->
<template>
<div class="app-container">
<el-form :inline="true" :model="dataForm" class="demo-form-inline">
<el-form :inline="true" :model="dataForm" class="blueTip">
<el-form-item>
<el-date-picker clearable v-model="reportTime" @change="changeTime" type="date" placeholder="选择日期">
</el-date-picker>
@ -17,10 +17,11 @@
<el-button v-if="isSave" type="success" @click="saveDataList()">保存</el-button> -->
</el-form>
<el-row style="float: right; margin-bottom: 5px">
<el-button size="small" @click="editDataList()">编辑</el-button>
<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" v-if="isSave" @click="saveDataList()">保存</el-button>
</el-row>
<el-table :data="list" style="width: 100%" :header-cell-style="{
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
background: '#F2F4F9',
color: '#606266'
}">
@ -70,11 +71,11 @@
</el-table-column>
<!-- <el-table-column label="完成良品产量"> -->
<el-table-column prop="customerId" align="center" label="用户">
<el-table-column prop="customerName" align="center" label="用户">
<template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.customerId" :disabled="disabled">
<el-input v-if="!disabled" v-model="scope.row.customerName" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.customerId }} </span>
<span v-else>{{ scope.row.customerName }} </span>
</template>
</el-table-column>
<el-table-column prop="packageType" align="center" label="包装形式">
@ -158,12 +159,16 @@
</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>
</div> -->
</el-table>
<div style="height: 50px;" class="remark">
<el-input placeholder="备注" v-model="remark" :disabled="disabled">
</el-input>
</div>
<!-- 搜索工作栏 -->
<!-- <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" /> -->
@ -191,6 +196,7 @@ 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';
@ -453,6 +459,11 @@ export default {
this.getDict()
},
methods: {
handleReturn() {
this.disabled = true
this.isSave = false
this.getDataList()
},
format(shijianchuo) {
//shijianchuoparseInt
var time = moment(new Date(shijianchuo)).format('YYYY-MM-DD HH:mm:ss')
@ -562,11 +573,19 @@ 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) => {
@ -594,3 +613,19 @@ 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>

Voir le fichier

@ -1,13 +1,13 @@
<!--
* @Author: zhp
* @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-03-13 15:29:26
* @LastEditTime: 2024-03-18 15:25:48
* @LastEditors: zhp
* @Description:
-->
<template>
<div class="app-container">
<el-form :inline="true" :model="dataForm" class="demo-form-inline">
<el-form :inline="true" :model="dataForm" class="blueTip">
<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,10 +20,11 @@
@click="handleExport">导出</el-button>
</el-form>
<el-row style="float: right; margin-bottom: 5px">
<el-button size="small" @click="editDataList()">编辑</el-button>
<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" v-if="isSave" @click="saveDataList()">保存</el-button>
</el-row>
<el-table :data="list" style="width: 100%" :header-cell-style="{
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
background: '#F2F4F9',
color: '#606266'
}">
@ -49,9 +50,9 @@
</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>
100).toFixed(2)) + '%' : undefined }} </span>
</template>
</el-table-column>
</el-table-column>
@ -72,67 +73,86 @@
</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>
100).toFixed(2)) + '%' : undefined }} </span>
</template>
</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 }} </span>
<span v-else>{{ scope.row.missCheckNow ? parseFloat((scope.row.missCheckNow *
100).toFixed(2)) +
'%' : undefined }}
</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 }} </span>
<span v-else>{{ scope.row.missCheckHis ? parseFloat((scope.row.missCheckHis *
100).toFixed(2)) +
'%' : undefined }}
</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 }} </span>
<span v-else>{{ scope.row.goodProductPassNow ? parseFloat((scope.row.goodProductPassNow *
100).toFixed(2)) +
'%' : undefined }}
</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 }} </span>
<span v-else>{{ scope.row.goodProductPassHis ? parseFloat((scope.row.goodProductPassHis *
100).toFixed(2)) +
'%' : undefined }}
</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>
</div> -->
</el-table>
<div style="height: 50px;" class="remark">
<el-input placeholder="备注" v-model="remark" :disabled="disabled">
</el-input>
</div>
<!-- 搜索工作栏 -->
<!-- <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" /> -->
@ -162,7 +182,8 @@ 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 = [
{
@ -377,6 +398,11 @@ export default {
this.getDict()
},
methods: {
handleReturn() {
this.disabled = true
this.isSave = false
this.getDataList()
},
async getDict() {
// 线
const res = await getCorePLList()
@ -399,6 +425,8 @@ 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)
@ -406,6 +434,8 @@ 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)
@ -413,6 +443,8 @@ 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)
@ -420,6 +452,8 @@ 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)
@ -427,6 +461,8 @@ 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)
@ -434,6 +470,8 @@ 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)
@ -441,21 +479,39 @@ 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() {
//
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(() => { });
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;
},
startWeek() {
// console.log(this.weekValue1);
@ -532,7 +588,8 @@ 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()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').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]
} else {
this.dataForm.reportTime = []
}
@ -551,8 +608,14 @@ 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;
//
@ -589,3 +652,19 @@ 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>

Voir le fichier

@ -1,13 +1,13 @@
<!--
* @Author: zhp
* @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-03-13 15:29:35
* @LastEditTime: 2024-03-18 15:25:54
* @LastEditors: zhp
* @Description:
-->
<template>
<div class="app-container">
<el-form :inline="true" :model="dataForm" class="demo-form-inline">
<el-form :inline="true" :model="dataForm" class="blueTip">
<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,10 +21,11 @@
<el-button v-if="isSave" type="success" @click="saveDataList()">保存</el-button> -->
</el-form>
<el-row style="float: right; margin-bottom: 5px">
<el-button size="small" @click="editDataList()">编辑</el-button>
<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" v-if="isSave" @click="saveDataList()">保存</el-button>
</el-row>
<el-table :data="list" style="width: 100%" :header-cell-style="{
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
background: '#F2F4F9',
color: '#606266'
}">
@ -51,9 +52,9 @@
</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>
100).toFixed(2)) + '%' : undefined }} </span>
</template>
</el-table-column>
</el-table-column>
@ -74,68 +75,86 @@
</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>
100).toFixed(2)) + '%' : undefined }} </span>
</template>
</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 }} </span>
<span v-else>{{ scope.row.missCheckNow ? parseFloat((scope.row.missCheckNow *
100).toFixed(2)) +
'%' : undefined }}
</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 }} </span>
<span v-else>{{ scope.row.missCheckHis ? parseFloat((scope.row.missCheckHis *
100).toFixed(2)) +
'%' : undefined }}
</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 }} </span>
<span v-else>{{ scope.row.goodProductPassNow ? parseFloat((scope.row.goodProductPassNow *
100).toFixed(2)) +
'%' : undefined }}
</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 }} </span>
<span v-else>{{ scope.row.goodProductPassHis ? parseFloat((scope.row.goodProductPassHis *
100).toFixed(2)) +
'%' : undefined }}
</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>
</div> -->
</el-table>
<div style="height: 50px;" class="remark">
<el-input placeholder="备注" v-model="remark" :disabled="disabled">
</el-input>
</div>
<!-- 搜索工作栏 -->
<!-- <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" /> -->
@ -165,7 +184,8 @@ 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,
@ -378,6 +398,11 @@ export default {
this.getDict()
},
methods: {
handleReturn() {
this.disabled = true
this.isSave = false
this.getDataList()
},
async getDict() {
// 线
const res = await getCorePLList()
@ -395,16 +420,32 @@ export default {
},
handleExport() {
//
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(() => { });
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;
},
// startYear() {
// if (this.yearValue2 && this.yearValue2 < this.yearValue1) {
@ -506,6 +547,13 @@ 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;
//
@ -542,3 +590,19 @@ 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>