This commit is contained in:
朱文强 2025-02-27 13:54:28 +08:00
parent c83a7afadb
commit 8e9b2f6444
36 changed files with 881 additions and 624 deletions

View File

@ -1,3 +1,10 @@
/*
* @Author: zwq
* @Date: 2024-10-29 09:47:40
* @LastEditors: zwq
* @LastEditTime: 2025-02-26 16:27:48
* @Description:
*/
import request from '@/utils/request' import request from '@/utils/request'
// 创建实时数据采集配置 // 创建实时数据采集配置
@ -52,3 +59,11 @@ export function exportEquipmentPlcExcel(query) {
responseType: 'blob' responseType: 'blob'
}) })
} }
// 获得code
export function getCode() {
return request({
url: '/base/equipment-group/getCode',
method: 'get'
})
}

View File

@ -42,3 +42,13 @@ export function schedulingPage(query) {
params: query params: query
}) })
} }
// 导出Excel
export function exportSchedulingExcel(query) {
return request({
url: '/base/group-team-scheduling/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -42,11 +42,11 @@ export function getProductAuto(data) {
} }
// 班组自动报表分页 // 班组自动报表分页
export function getTeamReportPage(query) { export function getTeamReportPage(data) {
return request({ return request({
url: '/monitoring/team-auto-report/page', url: '/monitoring/team-auto-report/page',
method: 'get', method: 'post',
params: query data: data
}) })
} }

View File

@ -1,4 +1,4 @@
<!-- <!--
filename: dialogForm.vue filename: dialogForm.vue
author: liubin author: liubin
date: 2023-08-15 10:32:36 date: 2023-08-15 10:32:36
@ -92,13 +92,13 @@
{{ col.uploadTips || '只能上传jpg/png文件, 大小不超过2MB' }} {{ col.uploadTips || '只能上传jpg/png文件, 大小不超过2MB' }}
</div> </div>
</el-upload> </el-upload>
<uploadedFile <uploadedFile
class="file" class="file"
v-for="file in form[col.prop] || []" v-for="file in form[col.prop] || []"
:file="file" :file="file"
:key="file.fileUrl" :key="file.fileUrl"
@delete="handleDeleteFile(file)" /> @delete="handleDeleteFile(file)"
@Preview="handlePreview(file)" />
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -138,6 +138,9 @@ const uploadedFile = {
handleDelete() { handleDelete() {
this.$emit('delete', this.file); this.$emit('delete', this.file);
}, },
handlePreview() {
this.$emit('Preview', this.file);
},
}, },
mounted() {}, mounted() {},
render: function (h) { render: function (h) {
@ -156,7 +159,7 @@ const uploadedFile = {
cursor: 'pointer', cursor: 'pointer',
display: 'inline-block', display: 'inline-block',
}}> }}>
{this.file.fileName} <el-button onClick={this.handlePreview}>{this.file.fileName}</el-button>
<el-button <el-button
type="text" type="text"
icon="el-icon-close" icon="el-icon-close"
@ -256,6 +259,20 @@ export default {
resetFields(args) { resetFields(args) {
return this.$refs.form.resetFields(args); return this.$refs.form.resetFields(args);
}, },
async handlePreview(file) {
const data = await this.$axios({
url: file.fileUrl,
method: 'get',
responseType: 'blob',
});
const link = document.createElement('a');
link.href = window.URL.createObjectURL(new Blob([data]));
link.download = file.fileName;
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
window.URL.revokeObjectURL(link.href);
},
// getCode // getCode
async getCode(url) { async getCode(url) {
const response = await this.$axios(url); const response = await this.$axios(url);
@ -355,7 +372,9 @@ export default {
if (!promiseList.length) this.formLoading = false; if (!promiseList.length) this.formLoading = false;
}, },
// //
beforeUpload() {}, beforeUpload(file) {
console.log(file)
},
// bind // bind
handleUploadSuccess(response, file, fileList) { handleUploadSuccess(response, file, fileList) {
this.form.files.push({ this.form.files.push({

View File

@ -253,6 +253,7 @@ export default {
pageSize: 10, pageSize: 10,
workshopSectionId: null, workshopSectionId: null,
equipmentId: null, equipmentId: null,
equipmentName: null,
factoryId: null, factoryId: null,
productionLineId: [], productionLineId: [],
}, },
@ -307,7 +308,7 @@ export default {
this.queryParams.pageSize = 10; this.queryParams.pageSize = 10;
this.queryParams.name = val.name; this.queryParams.name = val.name;
this.queryParams.workshopSectionId = val.workshopSectionId || undefined; this.queryParams.workshopSectionId = val.workshopSectionId || undefined;
this.queryParams.equipmentId = val.equipmentId || undefined; this.queryParams.equipmentName = val.equipmentName || undefined;
this.queryParams.factoryId = val.factoryId || undefined; this.queryParams.factoryId = val.factoryId || undefined;
this.queryParams.productionLineId = val.productionLineId || []; this.queryParams.productionLineId = val.productionLineId || [];
this.handleQuery(); this.handleQuery();

View File

@ -0,0 +1,109 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2025-02-26 16:37:29
* @Description:
-->
<template>
<el-row :gutter="20">
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="80px">
<el-col :span="12">
<el-form-item label="关联表名" prop="plcTableName">
<el-input
v-model="dataForm.plcTableName"
clearable
placeholder="请输入关联表名" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="编码" prop="code">
<el-input
v-model="dataForm.code"
clearable
placeholder="请输入编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="标识" prop="name">
<el-input
v-model="dataForm.name"
clearable
placeholder="请输入标识" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="英文名" prop="enName">
<el-input
v-model="dataForm.enName"
clearable
placeholder="请输入英文名" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否采集" prop="collection">
<el-switch
v-model="dataForm.collection"
:active-value="1"
:inactive-value="0"></el-switch>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="描述" prop="description">
<el-input
v-model="dataForm.description"
clearable
placeholder="请输入描述" />
</el-form-item>
</el-col>
</el-form>
</el-row>
</template>
<script>
import basicAdd from '@/mixins/basic-add';
import {
createEquipmentPlc,
updateEquipmentPlc,
getEquipmentPlc,
getCode,
} from '@/api/base/equipmentPlc';
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
isGetCode: true,
codeURL: getCode,
createURL: createEquipmentPlc,
updateURL: updateEquipmentPlc,
infoURL: getEquipmentPlc,
},
dataForm: {
id: undefined,
plcTableName: undefined,
code: undefined,
name: undefined,
enName: undefined,
collection: 1,
description: undefined,
},
dataRule: {
plcTableName: [
{ required: true, message: '关联表名不能为空', trigger: 'blur' },
],
code: [{ required: true, message: '编码不能为空', trigger: 'blur' }],
name: [{ required: true, message: '标识不能为空', trigger: 'blur' }],
},
};
},
methods: {},
};
</script>

View File

@ -1,59 +1,53 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <search-bar
<SearchBar :formConfigs="formConfig"
:formConfigs="searchBarFormConfig" ref="searchBarForm"
ref="search-bar" @headBtnClick="buttonClick" />
@headBtnClick="handleSearchBarBtnClick" />
<!-- 列表 -->
<base-table <base-table
v-loading="dataListLoading"
:table-props="tableProps" :table-props="tableProps"
:page="queryParams.pageNo" :page="listQuery.pageNo"
:limit="queryParams.pageSize" :limit="listQuery.pageSize"
:table-data="list" :table-data="tableData"
ref="pageTable"
@emitFun="handleEmitFun"> @emitFun="handleEmitFun">
<method-btn <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
:width="120"
label="操作" label="操作"
:method-list="tableBtn" :method-list="tableBtn"
@clickBtn="handleTableBtnClick" /> @clickBtn="handleClick" />
</base-table> </base-table>
<!-- 分页组件 -->
<pagination <pagination
v-show="total > 0" :limit.sync="listQuery.pageSize"
:total="total" :page.sync="listQuery.pageNo"
:page.sync="queryParams.pageNo" :total="listQuery.total"
:limit.sync="queryParams.pageSize" @pagination="getDataList" />
@pagination="getList" />
<!-- 对话框(添加 / 修改) -->
<base-dialog <base-dialog
:dialogTitle="title" :dialogTitle="addOrEditTitle"
:dialogVisible="open" :dialogVisible="addOrUpdateVisible"
width="700px" @cancel="handleCancel"
@close="cancel" @confirm="handleConfirm"
@cancel="cancel" :before-close="handleCancel"
@confirm="submitForm"> width="50%">
<DialogForm v-if="open" ref="form" v-model="form" :rows="rows" /> <add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog> </base-dialog>
</div> </div>
</template> </template>
<script> <script>
import AddOrUpdate from './add-or-updata';
import basicPage from '@/mixins/basic-page';
import { parseTime } from '@/filter/code-filter';
import { import {
createEquipmentPlc,
updateEquipmentPlc,
deleteEquipmentPlc, deleteEquipmentPlc,
getEquipmentPlc,
getEquipmentPlcPage, getEquipmentPlcPage,
exportEquipmentPlcExcel, exportEquipmentPlcExcel,
updateEquipmentPlc,
} from '@/api/base/equipmentPlc'; } from '@/api/base/equipmentPlc';
import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
const switchBtn = { const switchBtn = {
name: 'SwitchBtn', name: 'SwitchBtn',
@ -90,49 +84,45 @@ const switchBtn = {
); );
}, },
}; };
const tableProps = [
{ prop: 'code', label: '编码', width: 220 },
{ prop: 'plcTableName', label: '关联表名' },
{ prop: 'name', label: '标识名称' },
{ prop: 'enName', label: '英文名称' },
{
prop: 'collection',
label: '是否采集',
subcomponent: switchBtn,
},
{ prop: 'description', label: '描述' },
];
export default { export default {
name: 'EquipmentPlc', mixins: [basicPage],
mixins: [basicPageMixin],
components: {},
data() { data() {
return { return {
tableKey: Math.random(), urlOptions: {
searchBarKeys: ['name', 'plcTableName'], getDataListURL: getEquipmentPlcPage,
deleteURL: deleteEquipmentPlc,
exportURL: exportEquipmentPlcExcel,
},
tableProps,
tableBtn: [ tableBtn: [
this.$auth.hasPermi('base:equipment-plc:update') this.$auth.hasPermi(`base:equipment-plc:update`)
? { ? {
type: 'edit', type: 'edit',
btnName: '修改', btnName: '编辑',
} }
: undefined, : undefined,
this.$auth.hasPermi('base:equipment-plc:delete') this.$auth.hasPermi(`base:equipment-plc:delete`)
? { ? {
type: 'delete', type: 'delete',
btnName: '删除', btnName: '删除',
} }
: undefined, : undefined,
].filter((v) => v), ].filter((v) => v),
tableProps: [ tableData: [],
// { formConfig: [
// prop: 'createTime',
// label: '',
// fixed: true,
// width: 180,
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
// },
{ prop: 'code', label: '编码' },
{ prop: 'plcTableName', label: '关联表名' },
{ prop: 'name', label: '标识名称' },
{ prop: 'enName', label: '英文名称' },
{
prop: 'collection',
label: '是否采集',
subcomponent: switchBtn,
},
{ prop: 'description', label: '描述' },
],
searchBarFormConfig: [
{ {
type: 'input', type: 'input',
label: '表名', label: '表名',
@ -147,231 +137,86 @@ export default {
}, },
{ {
type: 'button', type: 'button',
btnName: '查询', btnName: '搜索',
name: 'search', name: 'search',
color: 'primary', color: 'primary',
}, },
// {
// type: 'separate',
// },
// {
// type: 'button',
// btnName: '',
// name: 'reset',
// },
{ {
type: 'separate', type: 'separate',
}, },
{ {
// type: this.$auth.hasPermi('base:equipment-plc:create') type: this.$auth.hasPermi('base:factory:create') ? 'button' : '',
// ? 'button'
// : '',
type: 'button',
btnName: '新增', btnName: '新增',
name: 'add', name: 'add',
plain: true,
color: 'success', color: 'success',
plain: true,
}, },
// { // {
// type: this.$auth.hasPermi('base:equipment-plc:export') ? 'button' : '', // type: this.$auth.hasPermi('base:factory:create') ? 'separate' : '',
// },
// {
// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
// btnName: '', // btnName: '',
// name: 'export', // name: 'export',
// color: 'warning', // color: 'warning',
// }, // },
], ],
rows: [
[
{
input: true,
label: '关联表名',
prop: 'plcTableName',
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
// bind: {
// disabled: true, // some condition, like detail mode...
// }
},
{
input: true,
label: '编码',
prop: 'code',
url: '/base/equipment-group/getCode',
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
},
],
[
{
input: true,
label: '标识',
prop: 'name',
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
// bind: {
// disabled: true, // some condition, like detail mode...
// }
},
{
input: true,
label: '英文名',
prop: 'enName',
},
],
[
{
switch: true,
label: '是否采集', // 0 , 1
prop: 'collection',
value: 1,
bind: {
'active-value': 1,
'inactive-value': 0,
},
},
],
[
{
textarea: true,
label: '描述',
prop: 'description',
bind: {
placeholder: '请输入备注',
},
},
],
],
//
open: false,
//
queryParams: {
pageNo: 1,
pageSize: 10,
plcTableName: null,
name: null,
},
//
form: {},
}; };
}, },
created() { components: {
this.getList(); AddOrUpdate,
}, },
created() {},
methods: { methods: {
/** 覆盖 handleEmitFun 的默认实现 */ /** 覆盖 handleEmitFun 的默认实现 */
handleEmitFun({ action, payload }) { handleEmitFun({ action, payload }) {
console.log(payload)
switch (action) { switch (action) {
case 'update-collect': case 'update-collect':
this.reset(); updateEquipmentPlc(payload).then((response) => {
const tempForm = {};
Object.keys(this.form).forEach((key) => {
tempForm[key] = payload[key];
});
updateEquipmentPlc(tempForm).then((response) => {
this.$modal.msgSuccess('修改成功'); this.$modal.msgSuccess('修改成功');
this.open = false; this.getDataList();
this.getList();
}); });
break; break;
} }
}, },
/** 查询列表 */ buttonClick(val) {
getList() { switch (val.btnName) {
this.loading = true; case 'search':
// this.listQuery.pageNo = 1;
getEquipmentPlcPage(this.queryParams).then((response) => { this.listQuery.pageSize = 10;
this.list = response.data.list; this.listQuery.name = val.name;
this.total = response.data.total; this.listQuery.plcTableName = val.plcTableName;
this.loading = false; this.getDataList();
// this.tableKey = Math.random(); // method 1 break;
}); case 'reset':
}, this.$refs.searchBarForm.resetForm();
/** 取消按钮 */ this.listQuery = {
cancel() { pageSize: 10,
this.open = false; pageNo: 1,
this.reset(); total: 1,
}, };
/** 表单重置 */ this.getDataList();
reset() { break;
this.form = { case 'add':
id: undefined, this.addOrEditTitle = '新增';
plcTableName: undefined, this.addOrUpdateVisible = true;
code: undefined, this.addOrUpdateHandle();
name: undefined, break;
enName: undefined, case 'export':
description: undefined, this.handleExport();
collection: undefined, break;
}; default:
this.resetForm('form'); console.log(val);
}, }
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm('queryForm');
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = '添加实时数据采集配置';
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
getEquipmentPlc(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = '修改实时数据采集配置';
});
},
/** 提交按钮 */
submitForm() {
this.$refs['form'].validate((valid) => {
if (!valid) {
return;
}
//
if (this.form.id != null) {
updateEquipmentPlc(this.form).then((response) => {
this.$modal.msgSuccess('修改成功');
this.open = false;
this.getList();
});
return;
}
//
createEquipmentPlc(this.form).then((response) => {
this.$modal.msgSuccess('新增成功');
this.open = false;
this.getList();
});
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal
.confirm('是否确认删除实时数据采集配置编号为"' + id + '"的数据项?')
.then(function () {
return deleteEquipmentPlc(id);
})
.then(() => {
this.getList();
this.$modal.msgSuccess('删除成功');
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
//
let params = { ...this.queryParams };
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal
.confirm('是否确认导出所有实时数据采集配置数据项?')
.then(() => {
this.exportLoading = true;
return exportEquipmentPlcExcel(params);
})
.then((response) => {
this.$download.excel(response, '实时数据采集配置.xls');
this.exportLoading = false;
})
.catch(() => {});
}, },
}, },
}; };

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2024-04-30 10:01:41 * @LastEditTime: 2025-02-25 16:11:14
* @Description: * @Description:
--> -->
<template> <template>

View File

@ -134,11 +134,10 @@ export default {
yAxis: [ yAxis: [
{ {
type: 'value', type: 'value',
name: '节拍', name: '节拍 pcs/min',
min: 0, min: 0,
interval: 20,
axisLabel: { axisLabel: {
formatter: '{value} pcs/min', formatter: '{value}',
}, },
}, },
], ],

View File

@ -59,24 +59,36 @@
<i class="el-icon-delete"></i> <i class="el-icon-delete"></i>
</div> --> </div> -->
<div <div
class="file-list__item"
v-for="(file, index) in files" v-for="(file, index) in files"
:key="file.fileName" :key="file.fileName"
:style="{ style="width: 100%">
background: isPicMode <div
? `url(${file.fileUrl}) no-repeat` class="file-list__item"
: `url(${defaultBg}) no-repeat`, v-if="!isPicMode"
backgroundSize: isPicMode ? '100% 100%' : '64px', :style="{
backgroundPosition: isPicMode ? '0% 0%' : 'center', background: isPicMode
}" ? `url(${file.fileUrl}) no-repeat`
:data-name="file.fileName"> : `url(${defaultBg}) no-repeat`,
<el-button backgroundSize: isPicMode ? '100% 100%' : '64px',
v-if="!disabled" backgroundPosition: isPicMode ? '0% 0%' : 'center',
type="text" }"
class="el-icon-delete" @click="handleDownload(file)"
style="padding: 0" :data-name="file.fileName">
@click="(e) => handleDelete(file)" /> <el-button
</div> v-if="!disabled"
type="text"
class="el-icon-delete"
style="padding: 0"
@click="(e) => handleDelete(file)" />
</div>
<el-image
v-else
class="file-list__item"
style="width: 100%"
:src="file.fileUrl"
:preview-src-list="files.map((item) => item.fileUrl)"></el-image>
</div>
</section> </section>
</div> </div>
</template> </template>
@ -277,6 +289,32 @@ export default {
// Array // Array
this.$emit('update-filelist', this.appendFilelist); this.$emit('update-filelist', this.appendFilelist);
}, },
async handleDownload(file) {
if (this.isPicMode) {
// this.$emit('preview', file);
const link = document.createElement('a');
link.href = file.fileUrl;
link.target = '_blank';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
} else {
// this.$emit('download', file);
const data = await this.$axios({
url: file.fileUrl,
method: 'get',
responseType: 'blob',
});
const link = document.createElement('a');
link.href = window.URL.createObjectURL(new Blob([data]));
link.download = file.fileName;
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
window.URL.revokeObjectURL(link.href);
}
},
}, },
}; };
</script> </script>

View File

@ -1,4 +1,4 @@
<!-- <!--
filename: dialogForm.vue filename: dialogForm.vue
author: liubin author: liubin
date: 2023-08-15 10:32:36 date: 2023-08-15 10:32:36
@ -44,7 +44,7 @@
<el-date-picker <el-date-picker
v-if="col.datetime" v-if="col.datetime"
v-model="form[col.prop]" v-model="form[col.prop]"
type="datetime" type="date"
:placeholder="`请选择${col.label}`" :placeholder="`请选择${col.label}`"
value-format="timestamp" value-format="timestamp"
v-bind="col.bind"></el-date-picker> v-bind="col.bind"></el-date-picker>

View File

@ -82,7 +82,7 @@
<el-date-picker <el-date-picker
v-model="form.productionTime" v-model="form.productionTime"
:disabled="disabled" :disabled="disabled"
type="datetime" type="date"
placeholder="请选择生产日期" placeholder="请选择生产日期"
value-format="timestamp"></el-date-picker> value-format="timestamp"></el-date-picker>
</el-form-item> </el-form-item>
@ -92,7 +92,7 @@
<el-date-picker <el-date-picker
v-model="form.enterTime" v-model="form.enterTime"
:disabled="disabled" :disabled="disabled"
type="datetime" type="date"
placeholder="请选择进场日期" placeholder="请选择进场日期"
value-format="timestamp"></el-date-picker> value-format="timestamp"></el-date-picker>
</el-form-item> </el-form-item>
@ -317,7 +317,7 @@ export default {
this.form this.form
); );
// //
if ('fileNames' in this.form) this.form.fileNames.push(file.name); if ('fileNames' in this.form) this.form.fileNames.push(file.name+Date.now());
// //
if ('fileUrls' in this.form) this.form.fileUrls.push(response.data); if ('fileUrls' in this.form) this.form.fileUrls.push(response.data);
this.$modal.msgSuccess('上传成功'); this.$modal.msgSuccess('上传成功');

View File

@ -38,7 +38,7 @@
@cancel="cancel" @cancel="cancel"
width="60%" width="60%"
@confirm="submitForm"> @confirm="submitForm">
<DialogForm <DialogForm1
v-if="open" v-if="open"
key="index-dialog-form" key="index-dialog-form"
ref="form" ref="form"
@ -78,7 +78,7 @@
queryParams: { queryParams: {
equipmentId: form.id, equipmentId: form.id,
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 20,
}, },
tableBtn: [ tableBtn: [
this.$auth.hasPermi('base:equipment-attr:update') this.$auth.hasPermi('base:equipment-attr:update')
@ -107,6 +107,7 @@
import moment from 'moment'; import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import EquipmentDrawer from './components/EquipmentDrawer'; import EquipmentDrawer from './components/EquipmentDrawer';
import DialogForm1 from './components/DialogForm';
import { import {
createEquipment, createEquipment,
@ -124,6 +125,7 @@ export default {
components: { components: {
Editor, Editor,
EquipmentDrawer, EquipmentDrawer,
DialogForm1,
}, },
mixins: [basicPageMixin], mixins: [basicPageMixin],
data() { data() {
@ -157,7 +159,12 @@ export default {
width: 180, width: 180,
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'), filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
}, },
{ width: 200,showOverflowtooltip :true, prop: 'name', label: '设备名称' }, {
width: 200,
showOverflowtooltip: true,
prop: 'name',
label: '设备名称',
},
{ width: 256, prop: 'code', label: '设备编码' }, { width: 256, prop: 'code', label: '设备编码' },
{ prop: 'equipmentType', label: '设备类型' }, { prop: 'equipmentType', label: '设备类型' },
{ prop: 'enName', label: '英文名称' }, { prop: 'enName', label: '英文名称' },
@ -436,7 +443,7 @@ export default {
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 20,
code: '', code: '',
name: '', name: '',
}, },
@ -562,6 +569,7 @@ export default {
return; return;
} }
// //
this.form.files = [];
createEquipment(this.form).then((response) => { createEquipment(this.form).then((response) => {
this.$modal.msgSuccess('新增成功'); this.$modal.msgSuccess('新增成功');
this.open = false; this.open = false;

View File

@ -240,25 +240,6 @@ export default {
const id = row.id; const id = row.id;
getEquipmentType(id).then((response) => { getEquipmentType(id).then((response) => {
this.form = response.data; this.form = response.data;
// this.form = {
// code: 'SBLX20230925184444000041',
// name: '131',
// remark: '',
// id: '1706258479729336322',
// files: [
// { fileName: '1.png', fileUrl: '', fileType: 2 },
// { fileName: '1.asdfaslkjfkasdf.png', fileUrl: '', fileType: 2 },
// { fileName: '2.txt', fileUrl: '', fileType: 2 },
// { fileName: '1.rar', fileUrl: '', fileType: 2 },
// { fileName: '1.kkk', fileUrl: '', fileType: 2 },
// { fileName: 'test.file', fileUrl: '', fileType: 2 },
// { fileName: '222', fileUrl: '', fileType: 2 },
// { fileName: 'g', fileUrl: '', fileType: 2 },
// ],
// createTime: 1695638697000,
// parentId: '1701869972319584257',
// };
// debugger;
this.open = true; this.open = true;
this.title = '修改设备类型'; this.title = '修改设备类型';
}); });

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-08-03 14:09:18 * @Date: 2023-08-03 14:09:18
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2024-11-29 13:29:28 * @LastEditTime: 2025-02-24 15:21:07
* @Description: * @Description:
--> -->
<template> <template>
@ -17,7 +17,7 @@
v-for="opt in getDictDatas(DICT_TYPE.PROCESS_TYPE)" v-for="opt in getDictDatas(DICT_TYPE.PROCESS_TYPE)"
:key="opt.value" :key="opt.value"
:label="opt.label" :label="opt.label"
:value="opt.value + '+' + opt.label"></el-option> :value="opt.value"></el-option>
</el-select> </el-select>
<div style="text-align: right; margin: 0"> <div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="visible = false"> <el-button size="mini" type="text" @click="visible = false">
@ -53,18 +53,21 @@ export default {
visible: false, visible: false,
}; };
}, },
mounted() {}, mounted() {
},
methods: { methods: {
changeInput() { changeInput() {
const processDictName = this.getDictDatas(this.DICT_TYPE.PROCESS_TYPE).find(item=>
item.value == this.list.processDict
)
const data = { const data = {
id: this.list.id, id: this.list.id,
processDict: this.list.processDict.split('+')[0], processDict: this.list.processDict,
processDictName: this.list.processDict.split('+')[1], processDictName: processDictName.label,
}; };
switchLineBindProcess(data).then((response) => { switchLineBindProcess(data).then((response) => {
this.$modal.msgSuccess('修改成功'); this.$modal.msgSuccess('修改成功');
this.visible = false; this.visible = false;
this.list.processDictName = this.list.processDict.split('+')[1];
this.$emit('emitData'); this.$emit('emitData');
}); });
}, },

View File

@ -72,19 +72,37 @@
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="规格" prop="specifications"> <el-form-item label="原片规格" prop="originalSpecifications">
<el-input <el-input
:disabled="isdetail" :disabled="isdetail"
v-model="dataForm.specifications" v-model="dataForm.originalSpecifications"
placeholder="请输入规格" /> placeholder="请输入原片规格" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="单位平方数" prop="area"> <el-form-item label="原片单位平方数" prop="originalArea">
<el-input
:disabled="isdetail"
v-model="dataForm.originalArea"
placeholder="请输入原片单位平方数" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="深加工规格" prop="specifications">
<el-input
:disabled="isdetail"
v-model="dataForm.specifications"
placeholder="请输入深加工规格" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="深加工单位平方数" prop="area">
<el-input <el-input
:disabled="isdetail" :disabled="isdetail"
v-model="dataForm.area" v-model="dataForm.area"
placeholder="请输入单位平方数" /> placeholder="请输入深加工单位平方数" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -222,11 +240,13 @@ export default {
id: null, id: null,
name: '', // name: '', //
code: '', // code: '', //
area: 0, // (float only) area: 0, // (float only)
typeDictValue: null, // id typeDictValue: null, // id
processTime: null, // (s) processTime: null, // (s)
specifications: '', // specifications: '', //
unitDictValue: '', // id unitDictValue: '', // id
originalSpecifications: '', //
originalArea: 0, //
}, },
listQuery: { listQuery: {
pageSize: 10, pageSize: 10,

View File

@ -1,8 +1,8 @@
<!-- <!--
* @Author: zwq * @Author: zwq
* @Date: 2023-08-01 14:55:51 * @Date: 2023-08-01 14:55:51
* @LastEditors: DY * @LastEditors: zwq
* @LastEditTime: 2023-10-13 10:27:00 * @LastEditTime: 2025-02-24 16:06:59
* @Description: * @Description:
--> -->
<template> <template>
@ -49,27 +49,31 @@ import {
const tableProps = [ const tableProps = [
{ {
prop: 'code', prop: 'createTime',
label: '产品编码' label: '创建时间',
filter: parseTime
}, },
{ {
prop: 'name', prop: 'name',
label: '产品名称' label: '产品名称'
}, },
{
prop: 'code',
label: '产品编码'
},
{
prop: 'originalSpecifications',
label: '原片规格'
},
{ {
prop: 'specifications', prop: 'specifications',
label: '规格' label: '深加工规格'
}, },
{ {
prop: 'unitDictValue', prop: 'unitDictValue',
label: '单位', label: '单位',
subcomponent: unitDict, subcomponent: unitDict,
}, },
{
prop: 'createTime',
label: '创建时间',
filter: parseTime
},
]; ];
export default { export default {

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-08-01 13:52:10 * @Date: 2023-08-01 13:52:10
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2024-11-22 14:02:59 * @LastEditTime: 2025-02-24 15:32:45
* @Description: * @Description:
--> -->
<template> <template>
@ -81,6 +81,17 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="描述" prop="description">
<el-input
v-model="dataForm.description"
type="textarea"
placeholder="请输入内容" />
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input <el-input
@ -90,17 +101,6 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row>
<el-col>
<el-form-item label="描述" prop="description">
<el-input
v-model="dataForm.description"
type="textarea"
placeholder="请输入内容" />
</el-form-item>
</el-col>
</el-row>
</el-form> </el-form>
</template> </template>
@ -160,6 +160,7 @@ export default {
], ],
tvalue: [ tvalue: [
{ {
required: true,
type: 'number', type: 'number',
message: '请输入正确的数字', message: '请输入正确的数字',
trigger: 'change', trigger: 'change',

View File

@ -102,11 +102,10 @@ export default {
yAxis: [ yAxis: [
{ {
type: 'value', type: 'value',
name: '投入/产出', name: '投入/产出',
min: 0, min: 0,
interval: 100,
axisLabel: { axisLabel: {
formatter: '{value}', formatter: '{value}',
}, },
}, },
{ {

View File

@ -69,26 +69,32 @@ import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
import ButtonNav from '@/components/ButtonNav'; import ButtonNav from '@/components/ButtonNav';
import baseTableS from './baseTable.vue'; import baseTableS from './baseTable.vue';
import barChart from './BarChart.vue'; import barChart from './BarChart.vue';
import * as XLSX from 'xlsx';
import FileSaver from 'file-saver';
const tableProps = [ const tableProps = [
{ {
prop: 'factoryName', prop: 'factoryName',
label: '工厂', label: '工厂',
fixed: true
}, },
{ {
prop: 'lineName', prop: 'lineName',
label: '产线', label: '产线',
fixed: true
}, },
{ {
prop: 'sizes', prop: 'sizes',
label: '规格', label: '规格',
width: 105, width: 105,
showOverflowtooltip: true, showOverflowtooltip: true,
fixed: true
}, },
{ {
prop: 'inputN', prop: 'inputN',
label: '投入', label: '投入',
align: 'center',
children: [ children: [
{ {
prop: 'inputNum', prop: 'inputNum',
@ -103,6 +109,7 @@ const tableProps = [
{ {
prop: 'outputN', prop: 'outputN',
label: '产出', label: '产出',
align: 'center',
children: [ children: [
{ {
prop: 'outputNum', prop: 'outputNum',
@ -118,6 +125,7 @@ const tableProps = [
{ {
prop: 'lossN', prop: 'lossN',
label: '不良', label: '不良',
align: 'center',
children: [ children: [
{ {
prop: 'lossNum', prop: 'lossNum',
@ -148,10 +156,12 @@ const tableProps = [
{ {
prop: 'lossD', prop: 'lossD',
label: '不良详情', label: '不良详情',
align: 'center',
children: [ children: [
{ {
prop: 'original', prop: 'original',
label: '原片', label: '原片',
align: 'center',
children: [ children: [
{ {
prop: 'originalLossNum', prop: 'originalLossNum',
@ -167,6 +177,7 @@ const tableProps = [
{ {
prop: 'edge', prop: 'edge',
label: '磨边', label: '磨边',
align: 'center',
children: [ children: [
{ {
prop: 'edgeLossNum', prop: 'edgeLossNum',
@ -182,6 +193,7 @@ const tableProps = [
{ {
prop: 'drill', prop: 'drill',
label: '打孔', label: '打孔',
align: 'center',
children: [ children: [
{ {
prop: 'drillLossNum', prop: 'drillLossNum',
@ -197,6 +209,7 @@ const tableProps = [
{ {
prop: 'coating', prop: 'coating',
label: '镀膜', label: '镀膜',
align: 'center',
children: [ children: [
{ {
prop: 'coatingLossNum', prop: 'coatingLossNum',
@ -212,6 +225,7 @@ const tableProps = [
{ {
prop: 'silk', prop: 'silk',
label: '丝印', label: '丝印',
align: 'center',
children: [ children: [
{ {
prop: 'silkLossNum', prop: 'silkLossNum',
@ -227,6 +241,7 @@ const tableProps = [
{ {
prop: 'tempering', prop: 'tempering',
label: '钢化', label: '钢化',
align: 'center',
children: [ children: [
{ {
prop: 'temperingLossNum', prop: 'temperingLossNum',
@ -242,6 +257,7 @@ const tableProps = [
{ {
prop: 'packing', prop: 'packing',
label: '包装', label: '包装',
align: 'center',
children: [ children: [
{ {
prop: 'packingLossNum', prop: 'packingLossNum',
@ -480,6 +496,7 @@ export default {
tables.removeChild(tables.querySelector('.el-table__fixed-right')); tables.removeChild(tables.querySelector('.el-table__fixed-right'));
} }
let exportTable = XLSX.utils.table_to_book(tables); let exportTable = XLSX.utils.table_to_book(tables);
exportTable.Sheets.Sheet1.A1.v = '序号' //
var exportTableOut = XLSX.write(exportTable, { var exportTableOut = XLSX.write(exportTable, {
bookType: 'xlsx', bookType: 'xlsx',
@ -492,7 +509,7 @@ export default {
new Blob([exportTableOut], { new Blob([exportTableOut], {
type: 'application/octet-stream', type: 'application/octet-stream',
}), }),
this.fileName + '产线统计数据查询-当前.xlsx' '产线统计数据.xlsx'
); );
} catch (e) { } catch (e) {
if (typeof console !== 'undefined') console.log(e, exportTableOut); if (typeof console !== 'undefined') console.log(e, exportTableOut);

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: Do not edit * @Author: Do not edit
* @Date: 2023-08-29 14:59:29 * @Date: 2023-08-29 14:59:29
* @LastEditTime: 2025-01-14 09:53:23 * @LastEditTime: 2025-02-24 14:51:47
* @LastEditors: zwq * @LastEditors: zwq
* @Description: * @Description:
--> -->
@ -42,34 +42,41 @@ const tableProps = [
{ {
prop: 'reportType', prop: 'reportType',
label: '报表类型', label: '报表类型',
fixed: true
}, },
{ {
prop: 'reportDate', prop: 'reportDate',
label: '日期', label: '日期',
width: 130, width: 130,
fixed: true
}, },
{ {
prop: 'factoryName', prop: 'factoryName',
label: '工厂', label: '工厂',
fixed: true
}, },
{ {
prop: 'lineName', prop: 'lineName',
label: '产线', label: '产线',
fixed: true
}, },
{ {
prop: 'sizes', prop: 'sizes',
label: '规格', label: '规格',
width: 105, width: 105,
showOverflowtooltip: true, showOverflowtooltip: true,
fixed: true
}, },
{ {
prop: 'process', prop: 'process',
label: '产品工艺', label: '产品工艺',
fixed: true
}, },
{ {
prop: 'inputN', prop: 'inputN',
label: '投入', label: '投入',
align: 'center',
children: [ children: [
{ {
prop: 'inputNum', prop: 'inputNum',
@ -78,12 +85,14 @@ const tableProps = [
{ {
prop: 'inputArea', prop: 'inputArea',
label: '投入面积/m²', label: '投入面积/m²',
filter: (val) => (val != null ? val.toFixed(2) : '-'),
}, },
], ],
}, },
{ {
prop: 'outputN', prop: 'outputN',
label: '产出', label: '产出',
align: 'center',
children: [ children: [
{ {
prop: 'outputNum', prop: 'outputNum',
@ -99,6 +108,7 @@ const tableProps = [
{ {
prop: 'lossN', prop: 'lossN',
label: '不良', label: '不良',
align: 'center',
children: [ children: [
{ {
prop: 'lossNum', prop: 'lossNum',
@ -129,10 +139,12 @@ const tableProps = [
{ {
prop: 'lossD', prop: 'lossD',
label: '不良详情', label: '不良详情',
align: 'center',
children: [ children: [
{ {
prop: 'original', prop: 'original',
label: '原片', label: '原片',
align: 'center',
children: [ children: [
{ {
prop: 'originalLossNum', prop: 'originalLossNum',
@ -148,6 +160,7 @@ const tableProps = [
{ {
prop: 'edge', prop: 'edge',
label: '磨边', label: '磨边',
align: 'center',
children: [ children: [
{ {
prop: 'edgeLossNum', prop: 'edgeLossNum',
@ -163,6 +176,7 @@ const tableProps = [
{ {
prop: 'drill', prop: 'drill',
label: '打孔', label: '打孔',
align: 'center',
children: [ children: [
{ {
prop: 'drillLossNum', prop: 'drillLossNum',
@ -178,6 +192,7 @@ const tableProps = [
{ {
prop: 'coating', prop: 'coating',
label: '镀膜', label: '镀膜',
align: 'center',
children: [ children: [
{ {
prop: 'coatingLossNum', prop: 'coatingLossNum',
@ -193,6 +208,7 @@ const tableProps = [
{ {
prop: 'silk', prop: 'silk',
label: '丝印', label: '丝印',
align: 'center',
children: [ children: [
{ {
prop: 'silkLossNum', prop: 'silkLossNum',
@ -208,6 +224,7 @@ const tableProps = [
{ {
prop: 'tempering', prop: 'tempering',
label: '钢化', label: '钢化',
align: 'center',
children: [ children: [
{ {
prop: 'temperingLossNum', prop: 'temperingLossNum',
@ -223,6 +240,7 @@ const tableProps = [
{ {
prop: 'packing', prop: 'packing',
label: '包装', label: '包装',
align: 'center',
children: [ children: [
{ {
prop: 'packingLossNum', prop: 'packingLossNum',

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: Do not edit * @Author: Do not edit
* @Date: 2023-08-29 14:59:29 * @Date: 2023-08-29 14:59:29
* @LastEditTime: 2025-01-09 10:45:41 * @LastEditTime: 2025-02-26 16:42:12
* @LastEditors: zwq * @LastEditors: zwq
* @Description: * @Description:
--> -->
@ -42,28 +42,34 @@ const tableProps1 = [
prop: 'processType', prop: 'processType',
label: '工艺类型', label: '工艺类型',
filter: (val) => (val === 1 ? '面板' : '背板'), filter: (val) => (val === 1 ? '面板' : '背板'),
fixed: true
}, },
{ {
prop: 'reportType', prop: 'reportType',
label: '报表类型', label: '报表类型',
fixed: true
}, },
{ {
prop: 'reportDate', prop: 'reportDate',
label: '日期', label: '日期',
width: 130, width: 130,
fixed: true
}, },
{ {
prop: 'factoryName', prop: 'factoryName',
label: '工厂', label: '工厂',
fixed: true
}, },
{ {
prop: 'process', prop: 'process',
label: '产品工艺', label: '产品工艺',
fixed: true
}, },
{ {
prop: 'all', prop: 'all',
label: '合计', label: '合计',
align: 'center',
children: [ children: [
{ {
prop: 'inputArea', prop: 'inputArea',
@ -228,6 +234,7 @@ export default {
tables.removeChild(tables.querySelector('.el-table__fixed-right')); tables.removeChild(tables.querySelector('.el-table__fixed-right'));
} }
let exportTable = XLSX.utils.table_to_book(tables); let exportTable = XLSX.utils.table_to_book(tables);
exportTable.Sheets.Sheet1.A1.v = '序号' //
var exportTableOut = XLSX.write(exportTable, { var exportTableOut = XLSX.write(exportTable, {
bookType: 'xlsx', bookType: 'xlsx',
@ -295,6 +302,7 @@ export default {
item['processingRatio' + index] = prop.processingRatio; item['processingRatio' + index] = prop.processingRatio;
const subprop = { const subprop = {
label: prop.lineName, label: prop.lineName,
align: 'center',
children: [ children: [
{ {
prop: 'inputArea' + index, prop: 'inputArea' + index,

View File

@ -1,4 +1,4 @@
<!-- <!--
filename: pieChart.vue filename: pieChart.vue
author: liubin author: liubin
date: 2023-09-06 15:02:49 date: 2023-09-06 15:02:49
@ -10,7 +10,7 @@
<div <div
class="pie-chart" class="pie-chart"
ref="pieChart" ref="pieChart"
style="overflow: inherit;" style="overflow: inherit"
:data-eqname="value.equipmentName || 'Default'"></div> :data-eqname="value.equipmentName || 'Default'"></div>
<div class="data-view"> <div class="data-view">
<div class="data-view__item"> <div class="data-view__item">
@ -64,7 +64,7 @@ export default {
}, },
subtext: '设备', //<========= subtext: '设备', //<=========
subtextStyle: { subtextStyle: {
fontSize: 14, fontSize: 13,
}, },
}, },
color: ['#3da8fd', '#8ef0ab', '#6b5cfd', '#FFC72A', 'transparent'], color: ['#3da8fd', '#8ef0ab', '#6b5cfd', '#FFC72A', 'transparent'],
@ -194,22 +194,31 @@ export default {
mttr, mttr,
} = item; } = item;
this.config.title.text = lineName; this.config.title.text = lineName;
this.config.title.subtext = equipmentName; // '-'
let firstDashIndex = equipmentName.indexOf('-');
// '-'
let secondDashIndex = equipmentName.indexOf('-', firstDashIndex + 1);
// '-'
let result = equipmentName.substring(secondDashIndex + 1);
this.config.title.subtext = result ? result : '-';
this.config.series[0].data = [ this.config.series[0].data = [
{ name: '工作时长', value: workTime }, { name: '工作时长', value: workTime ? workTime.toFixed(2) : '0.00' },
{ name: '停机时长', value: stopTime }, { name: '停机时长', value: stopTime ? stopTime.toFixed(2) : '0.00' },
{ name: '故障时长', value: downTime }, { name: '故障时长', value: downTime ? downTime.toFixed(2) : '0.00' },
]; ];
this.config.series[1].data = [ this.config.series[1].data = [
{ name: '速度开动率', value: peEfficiency }, {
name: '速度开动率',
value: peEfficiency ? peEfficiency.toFixed(2) : '0.00',
},
{ name: '', value: Math.ceil(peEfficiency) - peEfficiency }, { name: '', value: Math.ceil(peEfficiency) - peEfficiency },
]; ];
//
this.textData = { this.textData = {
workTime: +workTime.toFixed(2), workTime: workTime ? workTime.toFixed(2) : '0.00',
stopTime: +stopTime.toFixed(2), stopTime: stopTime ? stopTime.toFixed(2) : '0.00',
downTime: +downTime.toFixed(2), downTime: downTime ? downTime.toFixed(2) : '0.00',
peEfficiency: +peEfficiency.toFixed(2), peEfficiency: peEfficiency ? peEfficiency.toFixed(2) : '0.00',
}; };
}, },
}, },

View File

@ -91,10 +91,11 @@
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin'; import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
import PieChart from './components/pieChart.vue'; import PieChart from './components/pieChart.vue';
import { parseTime } from '@/filter/code-filter';
export default { export default {
name: 'EfficiencyAnalysis', name: 'EfficiencyAnalysis',
mixins: [basicPageMixin,tableHeightMixin], mixins: [basicPageMixin, tableHeightMixin],
components: { PieChart }, components: { PieChart },
props: {}, props: {},
data() { data() {
@ -120,8 +121,18 @@ export default {
tableProps: [ tableProps: [
{ prop: 'factoryName', label: '工厂' }, { prop: 'factoryName', label: '工厂' },
{ prop: 'lineName', label: '产线' }, { prop: 'lineName', label: '产线' },
{ prop: 'sectionName', width:120,showOverflowtooltip :true,label: '工段' }, {
{ prop: 'equipmentName',width:150,showOverflowtooltip :true, label: '设备' }, prop: 'sectionName',
width: 120,
showOverflowtooltip: true,
label: '工段',
},
{
prop: 'equipmentName',
width: 150,
showOverflowtooltip: true,
label: '设备',
},
{ {
label: '有效时间', label: '有效时间',
children: [ children: [
@ -148,9 +159,12 @@ export default {
label: '停机时长[h]', label: '停机时长[h]',
filter: (val) => (val != null ? val.toFixed(2) : '-'), filter: (val) => (val != null ? val.toFixed(2) : '-'),
}, },
{ width: 128, prop: 'stopRate', label: '百分比[%]', {
filter: (val) => (val != null ? val.toFixed(2) : '-'), width: 128,
}, prop: 'stopRate',
label: '百分比[%]',
filter: (val) => (val != null ? val.toFixed(2) : '-'),
},
], ],
}, },
{ {
@ -162,9 +176,12 @@ export default {
label: '故障时长[h]', label: '故障时长[h]',
filter: (val) => (val != null ? val.toFixed(2) : '-'), filter: (val) => (val != null ? val.toFixed(2) : '-'),
}, },
{ width: 128, prop: 'downRate', label: '百分比[%]' , {
filter: (val) => (val != null ? val.toFixed(2) : '-'), width: 128,
}, prop: 'downRate',
label: '百分比[%]',
filter: (val) => (val != null ? val.toFixed(2) : '-'),
},
{ {
width: 128, width: 128,
prop: 'timeEfficiency', prop: 'timeEfficiency',
@ -180,13 +197,13 @@ export default {
width: 128, width: 128,
prop: 'realProcSpeed', prop: 'realProcSpeed',
label: '实际加工速度', label: '实际加工速度',
filter: (val) => (val != null ? val.toFixed(2) : '-'), filter: (val) => (val != null ? val.toFixed(2) : '-'),
}, },
{ {
width: 128, width: 128,
prop: 'designProcSpeed', prop: 'designProcSpeed',
label: '理论加工速度', label: '理论加工速度',
filter: (val) => (val != null ? val.toFixed(2) : '-'), filter: (val) => (val != null ? val.toFixed(2) : '-'),
}, },
{ {
width: 128, width: 128,
@ -334,6 +351,20 @@ export default {
}; };
}, },
created() { created() {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 1);
this.queryParams.recordTime[0] =
parseTime(start).substr(0, 10) + ' 00:00:00';
this.queryParams.recordTime[1] = parseTime(end).substr(0, 10) + ' 00:00:00';
this.$nextTick(() => {
this.searchBarFormConfig[2].extraOptions[0].startPlaceholder = parseTime(
start
).substr(0, 10);
this.searchBarFormConfig[2].extraOptions[0].endPlaceholder = parseTime(
end
).substr(0, 10);
});
this.getFactory(); this.getFactory();
this.getLine(); this.getLine();
this.getList(); this.getList();
@ -384,6 +415,7 @@ export default {
/** 查询列表 */ /** 查询列表 */
async getList() { async getList() {
this.loading = true; this.loading = true;
this.list = [];
const { code, data } = await this.$axios({ const { code, data } = await this.$axios({
url: '/analysis/equipment-analysis/efficiency', url: '/analysis/equipment-analysis/efficiency',
method: 'get', method: 'get',
@ -395,7 +427,6 @@ export default {
}, },
handleSearchBarBtnClick({ btnName, ...payload }) { handleSearchBarBtnClick({ btnName, ...payload }) {
console.log('handleSearchBarBtnClick', btnName, payload);
if (btnName == 'visualization') { if (btnName == 'visualization') {
// //
this.visualizationOpen = true; this.visualizationOpen = true;
@ -405,12 +436,26 @@ export default {
this.queryParams.factoryId = payload.factoryId || null; this.queryParams.factoryId = payload.factoryId || null;
this.queryParams.lineId = payload.lineId || null; this.queryParams.lineId = payload.lineId || null;
if (0 == payload.dateFilterType) { if (0 == payload.dateFilterType) {
this.queryParams.recordTime = payload.timerange; if (payload.timerange) {
this.searchBarFormConfig[2].extraOptions[0].startPlaceholder =
'开始时间';
this.searchBarFormConfig[2].extraOptions[0].endPlaceholder =
'结束时间';
this.queryParams.recordTime = payload.timerange;
}
} else if (1 == payload.dateFilterType) { } else if (1 == payload.dateFilterType) {
this.queryParams.recordTime = [ this.searchBarFormConfig[2].extraOptions[0].startPlaceholder =
`${payload.timeday} 00:00:00`, '开始时间';
`${payload.timeday} 23:59:59`, this.searchBarFormConfig[2].extraOptions[0].endPlaceholder =
]; '结束时间';
if (payload.timeday) {
this.queryParams.recordTime = [
`${payload.timeday} 00:00:00`,
`${payload.timeday} 23:59:59`,
];
} else {
this.queryParams.recordTime = null;
}
} }
} else { } else {
this.queryParams.recordTime = null; this.queryParams.recordTime = null;

View File

@ -27,11 +27,6 @@
<el-input v-model="form.code" disabled></el-input> <el-input v-model="form.code" disabled></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark"></el-input>
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="班次开始时间" prop="startTime"> <el-form-item label="班次开始时间" prop="startTime">
<el-time-picker <el-time-picker
@ -64,6 +59,11 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark"></el-input>
</el-form-item>
</el-col>
</el-row> </el-row>
</el-form> </el-form>
</template> </template>
@ -98,7 +98,7 @@ export default {
name: [{ required: true, message: '请输入班组名称', trigger: 'blur' }], name: [{ required: true, message: '请输入班组名称', trigger: 'blur' }],
code: [{ required: true, message: '请输入编码', trigger: 'blur' }], code: [{ required: true, message: '请输入编码', trigger: 'blur' }],
startTime: [ startTime: [
{ required: true, message: '请输入生效时间', trigger: 'change' }, { required: true, message: '请选择班次开始时间', trigger: 'change' },
], ],
endTime: [ endTime: [
{ required: true, message: '请选择班次结束时间', trigger: 'change' }, { required: true, message: '请选择班次结束时间', trigger: 'change' },

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2024-07-01 14:53:55 * @Date: 2024-07-01 14:53:55
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2025-01-15 13:15:05 * @LastEditTime: 2025-02-24 16:02:39
* @Description: * @Description:
--> -->
<template> <template>
@ -257,8 +257,12 @@ export default {
type: 'warning', type: 'warning',
} }
).then(function () { ).then(function () {
return _this.$modal return _this
.delConfirm(row.name) .$confirm(`是否确认删除 ${row.name} 的数据项?`, '系统提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(function () { .then(function () {
return deleteGroupClasses(row.id); return deleteGroupClasses(row.id);
}) })

View File

@ -236,6 +236,11 @@ export default {
.baseTable .el-icon-refresh { .baseTable .el-icon-refresh {
cursor: pointer; cursor: pointer;
} }
.baseTable >>> .el-table .el-table__cell {
padding: 0;
height: 35px;
border: 1px solid rgb(220, 220, 220);
}
</style> </style>
<style> <style>
.baseTable .el-table__body tr.current-row > td.el-table__cell { .baseTable .el-table__body tr.current-row > td.el-table__cell {

View File

@ -2,30 +2,36 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-08-24 14:47:58 * @Date: 2023-08-24 14:47:58
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2025-01-15 10:20:20 * @LastEditTime: 2025-02-25 14:03:40
* @Description: * @Description:
--> -->
<template> <template>
<div> <div>
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<el-table <el-table
id="detail"
:data="tableData" :data="tableData"
:header-cell-style="{ :header-cell-style="{
background: '#F2F4F9', background: '#F2F4F9',
color: '#606266', color: '#606266',
}" }"
border border
:span-method="arraySpanMethod" :span-method="arraySpanMethod"
v-loading="dataListLoading" v-loading="dataListLoading"
style="width: 100%" style="width: 100%"
ref="dataList"> ref="dataList">
<el-table-column prop="lineName" label="产线" /> <el-table-column prop="lineName" label="产线" align="center" />
<el-table-column <el-table-column
prop="sizes" prop="sizes"
width="105" width="105"
showOverflowtooltip showOverflowtooltip
align="center"
label="规格" /> label="规格" />
<el-table-column prop="process" label="产品工艺" /> <el-table-column prop="process" label="产品工艺" align="center" />
<el-table-column prop="inputN" label="投入"> <el-table-column prop="inputN" label="投入" align="center">
<el-table-column prop="inputNum" label="投入数量/片" /> <el-table-column prop="inputNum" label="投入数量/片" />
<el-table-column prop="inputArea" label="投入面积/m²"> <el-table-column prop="inputArea" label="投入面积/m²">
<template v-slot="scope"> <template v-slot="scope">
@ -39,7 +45,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column prop="outputN" label="产出"> <el-table-column prop="outputN" label="产出" align="center">
<el-table-column prop="outputNum" label="产出数量/片" /> <el-table-column prop="outputNum" label="产出数量/片" />
<el-table-column prop="outputArea" label="产出面积/m²"> <el-table-column prop="outputArea" label="产出面积/m²">
<template v-slot="scope"> <template v-slot="scope">
@ -53,151 +59,147 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column prop="lossN" label="不良"> <el-table-column prop="lossN" label="不良" align="center">
<el-table-column prop="lossNum" label="不良数量/片" /> <el-table-column prop="lossNum" label="不良数量/片" />
<el-table-column prop="lossArea" label="不良面积/m²"> <el-table-column prop="lossArea" label="不良面积/m²">
<template v-slot="scope"> <template v-slot="scope">
<span> <span>
{{ {{
scope.row.lossArea != null scope.row.lossArea != null ? scope.row.lossArea.toFixed(2) : '-'
? scope.row.lossArea.toFixed(2)
: '-'
}} }}
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column prop="lossRatio" label="不良率/%"> <el-table-column prop="lossRatio" label="不良率/%">
<template v-slot="scope"> <template v-slot="scope">
<span> <span>
{{ {{
scope.row.lossRatio != null scope.row.lossRatio != null ? scope.row.lossRatio.toFixed(2) : '-'
? scope.row.lossRatio.toFixed(2) }}
: '-' </span>
}} </template>
</span> </el-table-column>
</template>
</el-table-column>
<el-table-column prop="outputRatio" label="投入产出率/%"> <el-table-column prop="outputRatio" label="投入产出率/%">
<template v-slot="scope"> <template v-slot="scope">
<span> <span>
{{ {{
scope.row.outputRatio != null scope.row.outputRatio != null
? scope.row.outputRatio.toFixed(2) ? scope.row.outputRatio.toFixed(2)
: '-' : '-'
}} }}
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="processingRatio" label="加工成品率/%"> <el-table-column prop="processingRatio" label="加工成品率/%">
<template v-slot="scope"> <template v-slot="scope">
<span> <span>
{{ {{
scope.row.processingRatio != null scope.row.processingRatio != null
? scope.row.processingRatio.toFixed(2) ? scope.row.processingRatio.toFixed(2)
: '-' : '-'
}} }}
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="lossD" label="不良详情"> <el-table-column prop="lossD" label="不良详情" align="center">
<el-table-column prop="original" label="原片"> <el-table-column prop="original" label="原片" align="center">
<el-table-column prop="originalLossNum" label="原片不良/片" /> <el-table-column prop="originalLossNum" label="原片不良/片" />
<el-table-column prop="originalLossArea" label="原片不良/m²"> <el-table-column prop="originalLossArea" label="原片不良/m²">
<template v-slot="scope"> <template v-slot="scope">
<span> <span>
{{ {{
scope.row.originalLossArea != null scope.row.originalLossArea != null
? scope.row.originalLossArea.toFixed(2) ? scope.row.originalLossArea.toFixed(2)
: '-' : '-'
}} }}
</span> </span>
</template> </template>
</el-table-column>
</el-table-column> </el-table-column>
</el-table-column> <el-table-column prop="edge" label="磨边" align="center">
<el-table-column prop="edge" label="磨边">
<el-table-column prop="edgeLossNum" label="磨边不良/片" /> <el-table-column prop="edgeLossNum" label="磨边不良/片" />
<el-table-column prop="edgeLossArea" label="磨边不良/m²"> <el-table-column prop="edgeLossArea" label="磨边不良/m²">
<template v-slot="scope"> <template v-slot="scope">
<span> <span>
{{ {{
scope.row.edgeLossArea != null scope.row.edgeLossArea != null
? scope.row.edgeLossArea.toFixed(2) ? scope.row.edgeLossArea.toFixed(2)
: '-' : '-'
}} }}
</span> </span>
</template> </template>
</el-table-column>
</el-table-column> </el-table-column>
</el-table-column> <el-table-column prop="drill" label="打孔" align="center">
<el-table-column prop="drill" label="打孔">
<el-table-column prop="drillLossNum" label="打孔不良/片" /> <el-table-column prop="drillLossNum" label="打孔不良/片" />
<el-table-column prop="drillLossArea" label="打孔不良/m²"> <el-table-column prop="drillLossArea" label="打孔不良/m²">
<template v-slot="scope"> <template v-slot="scope">
<span> <span>
{{ {{
scope.row.drillLossArea != null scope.row.drillLossArea != null
? scope.row.drillLossArea.toFixed(2) ? scope.row.drillLossArea.toFixed(2)
: '-' : '-'
}} }}
</span> </span>
</template> </template>
</el-table-column>
</el-table-column> </el-table-column>
</el-table-column> <el-table-column prop="coating" label="镀膜" align="center">
<el-table-column prop="coating" label="镀膜">
<el-table-column prop="coatingLossNum" label="镀膜不良/片" /> <el-table-column prop="coatingLossNum" label="镀膜不良/片" />
<el-table-column prop="coatingLossArea" label="镀膜不良/m²"> <el-table-column prop="coatingLossArea" label="镀膜不良/m²">
<template v-slot="scope"> <template v-slot="scope">
<span> <span>
{{ {{
scope.row.coatingLossArea != null scope.row.coatingLossArea != null
? scope.row.coatingLossArea.toFixed(2) ? scope.row.coatingLossArea.toFixed(2)
: '-' : '-'
}} }}
</span> </span>
</template> </template>
</el-table-column>
</el-table-column> </el-table-column>
</el-table-column> <el-table-column prop="silk" label="丝印" align="center">
<el-table-column prop="silk" label="丝印">
<el-table-column prop="silkLossNum" label="丝印不良/片" /> <el-table-column prop="silkLossNum" label="丝印不良/片" />
<el-table-column prop="silkLossArea" label="丝印不良/m²"> <el-table-column prop="silkLossArea" label="丝印不良/m²">
<template v-slot="scope"> <template v-slot="scope">
<span> <span>
{{ {{
scope.row.silkLossArea != null scope.row.silkLossArea != null
? scope.row.silkLossArea.toFixed(2) ? scope.row.silkLossArea.toFixed(2)
: '-' : '-'
}} }}
</span> </span>
</template> </template>
</el-table-column>
</el-table-column> </el-table-column>
</el-table-column> <el-table-column prop="tempering" label="钢化" align="center">
<el-table-column prop="tempering" label="钢化">
<el-table-column prop="temperingLossNum" label="钢化不良/片" /> <el-table-column prop="temperingLossNum" label="钢化不良/片" />
<el-table-column prop="temperingLossArea" label="钢化不良/m²"> <el-table-column prop="temperingLossArea" label="钢化不良/m²">
<template v-slot="scope"> <template v-slot="scope">
<span> <span>
{{ {{
scope.row.temperingLossArea != null scope.row.temperingLossArea != null
? scope.row.temperingLossArea.toFixed(2) ? scope.row.temperingLossArea.toFixed(2)
: '-' : '-'
}} }}
</span> </span>
</template> </template>
</el-table-column>
</el-table-column> </el-table-column>
</el-table-column> <el-table-column prop="packing" label="包装" align="center">
<el-table-column prop="packing" label="包装">
<el-table-column prop="packingLossNum" label="包装不良/片" /> <el-table-column prop="packingLossNum" label="包装不良/片" />
<el-table-column prop="packingLossArea" label="包装不良/m²"> <el-table-column prop="packingLossArea" label="包装不良/m²">
<template v-slot="scope"> <template v-slot="scope">
<span> <span>
{{ {{
scope.row.packingLossArea != null scope.row.packingLossArea != null
? scope.row.packingLossArea.toFixed(2) ? scope.row.packingLossArea.toFixed(2)
: '-' : '-'
}} }}
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -206,6 +208,8 @@
<script> <script>
import { getTeamReportPageDet } from '@/api/core/monitoring/auto'; import { getTeamReportPageDet } from '@/api/core/monitoring/auto';
import * as XLSX from 'xlsx';
import FileSaver from 'file-saver';
export default { export default {
components: {}, components: {},
@ -213,6 +217,15 @@ export default {
return { return {
tableData: [], tableData: [],
dataListLoading: false, dataListLoading: false,
formConfig: [
{
// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
type: 'button',
btnName: '导出',
name: 'export',
color: 'warning',
},
],
}; };
}, },
components: {}, components: {},
@ -238,25 +251,57 @@ export default {
item.temperingLossArea = item.tempering?.lossArea; item.temperingLossArea = item.tempering?.lossArea;
item.packingLossNum = item.packing?.lossNum; item.packingLossNum = item.packing?.lossNum;
item.packingLossArea = item.packing?.lossArea; item.packingLossArea = item.packing?.lossArea;
if(item.isSummaryReport){ if (item.isSummaryReport) {
item.lineName = '合计' item.lineName = '合计';
} }
return item; return item;
}); });
this.dataListLoading = false; this.dataListLoading = false;
}); });
}, },
arraySpanMethod({ row, column, rowIndex, columnIndex }) { arraySpanMethod({ row, column, rowIndex, columnIndex }) {
if (row.isSummaryReport) { if (row.isSummaryReport) {
if (columnIndex === 0) { if (columnIndex === 0) {
return [1, 3]; return [1, 3];
} else if (columnIndex === 1) { } else if (columnIndex === 1) {
return [0, 0]; return [0, 0];
}else if (columnIndex === 2) { } else if (columnIndex === 2) {
return [0, 0]; return [0, 0];
} }
} }
}, },
buttonClick(val) {
switch (val.btnName) {
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
handleExport() {
let tables = document.querySelector('#detail').cloneNode(true);
let exportTable = XLSX.utils.table_to_book(tables);
var exportTableOut = XLSX.write(exportTable, {
bookType: 'xlsx',
bookSST: true,
type: 'array',
});
// sheetjs.xlsx
try {
FileSaver.saveAs(
new Blob([exportTableOut], {
type: 'application/octet-stream',
}),
'班组生产报表-详情.xlsx'
);
} catch (e) {
if (typeof console !== 'undefined') console.log(e, exportTableOut);
}
return exportTableOut;
},
}, },
}; };
</script> </script>

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: Do not edit * @Author: Do not edit
* @Date: 2023-08-29 14:59:29 * @Date: 2023-08-29 14:59:29
* @LastEditTime: 2025-01-15 10:24:05 * @LastEditTime: 2025-02-25 14:26:04
* @LastEditors: zwq * @LastEditors: zwq
* @Description: * @Description:
--> -->
@ -65,69 +65,81 @@ import { getGroupTeamPage } from '@/api/base/groupTeam';
import * as XLSX from 'xlsx'; import * as XLSX from 'xlsx';
import FileSaver from 'file-saver'; import FileSaver from 'file-saver';
import baseTableS from './baseTable.vue'; import baseTableS from './baseTable.vue';
import { parseTime } from '@/utils/ruoyi'; import { parseTime } from '@/filter/code-filter';
const tableProps = [ const tableProps = [
{ {
prop: 'reportType', prop: 'reportType',
label: '报表类型', label: '报表类型',
fixed: true
}, },
{ {
prop: 'reportStartTime', prop: 'reportName',
label: '日期', label: '日期',
filter: (val) => (val ? parseTime(val, '{y}-{m}-{d}') : '-'), width: 180,
width: 130, fixed: true
}, },
{ {
prop: 'factoryName', prop: 'factoryName',
label: '工厂', label: '工厂',
fixed: true
}, },
{ {
prop: 'teamName', prop: 'teamName',
label: '班组', label: '班组',
fixed: true
}, },
{ {
prop: 'inputN', prop: 'inputN',
label: '投入', label: '投入',
align: 'center',
children: [ children: [
{ {
prop: 'inputNum', prop: 'inputNum',
label: '投入数量/片', label: '投入数量/片',
width:100
}, },
{ {
prop: 'inputArea', prop: 'inputArea',
label: '投入面积/m²', label: '投入面积/m²',
width:100
}, },
], ],
}, },
{ {
prop: 'outputN', prop: 'outputN',
label: '产出', label: '产出',
align: 'center',
children: [ children: [
{ {
prop: 'outputNum', prop: 'outputNum',
label: '产出数量/片', label: '产出数量/片',
width:100
}, },
{ {
prop: 'outputArea', prop: 'outputArea',
label: '产出面积/㎡', label: '产出面积/㎡',
filter: (val) => (val != null ? val.toFixed(2) : '-'), filter: (val) => (val != null ? val.toFixed(2) : '-'),
width:100
}, },
], ],
}, },
{ {
prop: 'lossN', prop: 'lossN',
label: '不良', label: '不良',
align: 'center',
children: [ children: [
{ {
prop: 'lossNum', prop: 'lossNum',
label: '不良数量/片', label: '不良数量/片',
width:100
}, },
{ {
prop: 'lossArea', prop: 'lossArea',
label: '不良面积/㎡', label: '不良面积/㎡',
filter: (val) => (val != null ? val.toFixed(2) : '-'), filter: (val) => (val != null ? val.toFixed(2) : '-'),
width:100
}, },
], ],
}, },
@ -135,123 +147,148 @@ const tableProps = [
prop: 'lossRatio', prop: 'lossRatio',
label: '不良率/%', label: '不良率/%',
filter: (val) => (val != null ? val.toFixed(2) : '-'), filter: (val) => (val != null ? val.toFixed(2) : '-'),
width:100
}, },
{ {
prop: 'outputRatio', prop: 'outputRatio',
label: '投入产出率/%', label: '投入产出率/%',
filter: (val) => (val != null ? val.toFixed(2) : '-'), filter: (val) => (val != null ? val.toFixed(2) : '-'),
width:110
}, },
{ {
prop: 'processingRatio', prop: 'processingRatio',
label: '加工成品率/%', label: '加工成品率/%',
filter: (val) => (val != null ? val.toFixed(2) : '-'), filter: (val) => (val != null ? val.toFixed(2) : '-'),
width:110
}, },
{ {
prop: 'lossD', prop: 'lossD',
label: '不良详情', label: '不良详情',
align: 'center',
children: [ children: [
{ {
prop: 'original', prop: 'original',
label: '原片', label: '原片',
align: 'center',
children: [ children: [
{ {
prop: 'originalLossNum', prop: 'originalLossNum',
label: '原片不良/片', label: '原片不良/片',
width:100
}, },
{ {
prop: 'originalLossArea', prop: 'originalLossArea',
label: '原片不良/㎡', label: '原片不良/㎡',
filter: (val) => (val != null ? val.toFixed(2) : '-'), filter: (val) => (val != null ? val.toFixed(2) : '-'),
width:100
}, },
], ],
}, },
{ {
prop: 'edge', prop: 'edge',
label: '磨边', label: '磨边',
align: 'center',
children: [ children: [
{ {
prop: 'edgeLossNum', prop: 'edgeLossNum',
label: '磨边不良/片', label: '磨边不良/片',
width:100
}, },
{ {
prop: 'edgeLossArea', prop: 'edgeLossArea',
label: '磨边不良/㎡', label: '磨边不良/㎡',
filter: (val) => (val != null ? val.toFixed(2) : '-'), filter: (val) => (val != null ? val.toFixed(2) : '-'),
width:100
}, },
], ],
}, },
{ {
prop: 'drill', prop: 'drill',
label: '打孔', label: '打孔',
align: 'center',
children: [ children: [
{ {
prop: 'drillLossNum', prop: 'drillLossNum',
label: '打孔不良/片', label: '打孔不良/片',
width:100
}, },
{ {
prop: 'drillLossArea', prop: 'drillLossArea',
label: '打孔不良/㎡', label: '打孔不良/㎡',
filter: (val) => (val != null ? val.toFixed(2) : '-'), filter: (val) => (val != null ? val.toFixed(2) : '-'),
width:100
}, },
], ],
}, },
{ {
prop: 'coating', prop: 'coating',
label: '镀膜', label: '镀膜',
align: 'center',
children: [ children: [
{ {
prop: 'coatingLossNum', prop: 'coatingLossNum',
label: '镀膜不良/片', label: '镀膜不良/片',
width:100
}, },
{ {
prop: 'coatingLossArea', prop: 'coatingLossArea',
label: '镀膜不良/㎡', label: '镀膜不良/㎡',
filter: (val) => (val != null ? val.toFixed(2) : '-'), filter: (val) => (val != null ? val.toFixed(2) : '-'),
width:100
}, },
], ],
}, },
{ {
prop: 'silk', prop: 'silk',
label: '丝印', label: '丝印',
align: 'center',
children: [ children: [
{ {
prop: 'silkLossNum', prop: 'silkLossNum',
label: '丝印不良/片', label: '丝印不良/片',
width:100
}, },
{ {
prop: 'silkLossArea', prop: 'silkLossArea',
label: '丝印不良/㎡', label: '丝印不良/㎡',
filter: (val) => (val != null ? val.toFixed(2) : '-'), filter: (val) => (val != null ? val.toFixed(2) : '-'),
width:100
}, },
], ],
}, },
{ {
prop: 'tempering', prop: 'tempering',
label: '钢化', label: '钢化',
align: 'center',
children: [ children: [
{ {
prop: 'temperingLossNum', prop: 'temperingLossNum',
label: '钢化不良/片', label: '钢化不良/片',
width:100
}, },
{ {
prop: 'temperingLossArea', prop: 'temperingLossArea',
label: '钢化不良/㎡', label: '钢化不良/㎡',
filter: (val) => (val != null ? val.toFixed(2) : '-'), filter: (val) => (val != null ? val.toFixed(2) : '-'),
width:100
}, },
], ],
}, },
{ {
prop: 'packing', prop: 'packing',
label: '包装', label: '包装',
align: 'center',
children: [ children: [
{ {
prop: 'packingLossNum', prop: 'packingLossNum',
label: '包装不良/片', label: '包装不良/片',
width:100
}, },
{ {
prop: 'packingLossArea', prop: 'packingLossArea',
label: '包装不良/㎡', label: '包装不良/㎡',
filter: (val) => (val != null ? val.toFixed(2) : '-'), filter: (val) => (val != null ? val.toFixed(2) : '-'),
width:100
}, },
], ],
}, },
@ -270,6 +307,7 @@ export default {
getDataListURL: getTeamReportPage, getDataListURL: getTeamReportPage,
}, },
listQuery: { listQuery: {
reportType: 1,
pageSize: 10, pageSize: 10,
pageNo: 1, pageNo: 1,
total: 1, total: 1,
@ -291,7 +329,12 @@ export default {
label: '工厂', label: '工厂',
selectOptions: [], selectOptions: [],
param: 'factoryId', param: 'factoryId',
onchange: true, },
{
type: 'select',
label: '班组',
selectOptions: [],
param: 'teamId',
}, },
{ {
type: 'select', type: 'select',
@ -314,20 +357,15 @@ export default {
name: '年', name: '年',
}, },
], ],
defaultSelect: 1,
param: 'reportType', param: 'reportType',
}, },
{
type: 'select',
label: '班组',
selectOptions: [],
param: 'teamId',
},
{ {
type: 'datePicker', type: 'datePicker',
label: '报表开始时间', label: '时间范围',
dateType: 'daterange', dateType: 'daterange',
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd HH:mm:ss', valueFormat: 'timestamp',
rangeSeparator: '-', rangeSeparator: '-',
startPlaceholder: '开始时间', startPlaceholder: '开始时间',
endPlaceholder: '结束时间', endPlaceholder: '结束时间',
@ -364,15 +402,9 @@ export default {
// 23:59:59 // 23:59:59
const end = new Date(yesterday.getTime()); const end = new Date(yesterday.getTime());
end.setHours(23, 59, 59, 59); end.setHours(23, 59, 59, 59);
this.listQuery.reportStartTime = [ this.listQuery.reportStartTime = [yesterday.getTime(),end.getTime()];
parseTime(yesterday, '{y}-{m}-{d} {h}:{i}:{s}'),
parseTime(end, '{y}-{m}-{d} {h}:{i}:{s}'),
];
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.searchBarForm.formInline.timeVal = [ this.$refs.searchBarForm.formInline.timeVal = [yesterday.getTime(),end.getTime()];
parseTime(yesterday, '{y}-{m}-{d} {h}:{i}:{s}'),
parseTime(end, '{y}-{m}-{d} {h}:{i}:{s}'),
];
}); });
this.getDataList(); this.getDataList();
this.getPdLineList(); this.getPdLineList();
@ -389,6 +421,7 @@ export default {
tables.removeChild(tables.querySelector('.el-table__fixed-right')); tables.removeChild(tables.querySelector('.el-table__fixed-right'));
} }
let exportTable = XLSX.utils.table_to_book(tables); let exportTable = XLSX.utils.table_to_book(tables);
exportTable.Sheets.Sheet1.A1.v = '序号' //
var exportTableOut = XLSX.write(exportTable, { var exportTableOut = XLSX.write(exportTable, {
bookType: 'xlsx', bookType: 'xlsx',
@ -414,7 +447,7 @@ export default {
pageNo: 1, pageNo: 1,
}; };
getGroupTeamPage(params).then((res) => { getGroupTeamPage(params).then((res) => {
this.formConfig[2].selectOptions = res.data.list || []; this.formConfig[1].selectOptions = res.data.list || [];
}); });
getFactoryPage(params).then((res) => { getFactoryPage(params).then((res) => {
this.formConfig[0].selectOptions = res.data.list || []; this.formConfig[0].selectOptions = res.data.list || [];
@ -445,11 +478,11 @@ export default {
this.dataListLoading = true; this.dataListLoading = true;
const arr = ['日', '周', '月', '年']; const arr = ['日', '周', '月', '年'];
this.urlOptions.getDataListURL(this.listQuery).then((response) => { this.urlOptions.getDataListURL(this.listQuery).then((response) => {
if(!response.data.list){ if (!response.data.list) {
this.showData = [] this.showData = [];
this.dataListLoading = false; this.dataListLoading = false;
return return;
} }
this.tableData = response.data?.list.map((item, index) => { this.tableData = response.data?.list.map((item, index) => {
item.reportType = arr[item.reportType - 1]; item.reportType = arr[item.reportType - 1];
item.originalLossNum = item.original?.lossNum; item.originalLossNum = item.original?.lossNum;
@ -475,13 +508,16 @@ export default {
}, },
handleClick(val) { handleClick(val) {
this.addOrUpdateVisible = true; this.addOrUpdateVisible = true;
const time = val.data.reportName?val.data.reportName:'- '
const teamName = val.data.teamName?val.data.teamName:'- '
const teamLeader = val.data.teamLeader?val.data.teamLeader:'- '
this.addOrEditTitle = this.addOrEditTitle =
'时间:' + '时间:' +
val.data?.reportName + time +
' 班组:' + ' 班组:' +
val.data?.teamName + teamName +
' 组长:' + ' 组长:' +
val.data?.teamLeader + teamLeader +
' 详情'; ' 详情';
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.grDetail.init(val.data.id); this.$refs.grDetail.init(val.data.id);

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2024-07-01 14:54:06 * @Date: 2024-07-01 14:54:06
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2025-01-15 13:23:17 * @LastEditTime: 2025-02-26 15:12:16
* @Description: * @Description:
--> -->
<template> <template>
@ -438,7 +438,8 @@ export default {
} }
.class1, .class1,
.class2, .class2,
.class3 { .class3,
.class4 {
padding: 0; padding: 0;
font-weight: 600; font-weight: 600;
margin-bottom: 2px; margin-bottom: 2px;
@ -528,6 +529,22 @@ export default {
background-color: #e0ffee; background-color: #e0ffee;
} }
} }
.class4 {
.selectDiv {
.toggle-icon,
.toggle-icon-hide {
background-color: #5c2fb1;
}
.el-input--small .el-input__inner {
color: #381689;
background-color: #e2a6eb;
}
}
.labelClass {
color: #381689;
background-color: #e2a6eb;
}
}
} }
} }
</style> </style>

View File

@ -1,3 +1,10 @@
<!--
* @Author: zwq
* @Date: 2025-01-15 11:20:41
* @LastEditors: zwq
* @LastEditTime: 2025-02-25 09:37:50
* @Description:
-->
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
@ -24,7 +31,7 @@
<script> <script>
import { parseTime } from '@/utils/ruoyi'; import { parseTime } from '@/utils/ruoyi';
import tableHeightMixin from '@/mixins/tableHeightMixin'; import tableHeightMixin from '@/mixins/tableHeightMixin';
import { schedulingPage } from '@/api/base/groupTeamScheduling'; import { schedulingPage,exportSchedulingExcel } from '@/api/base/groupTeamScheduling';
import { getFactoryPage } from '@/api/core/base/factory'; import { getFactoryPage } from '@/api/core/base/factory';
import { import {
getGroupClassesPage, getGroupClassesPage,
@ -139,36 +146,20 @@ export default {
this.getPdLineList(); this.getPdLineList();
}, },
methods: { methods: {
handleExport() { /** 导出按钮操作 */
let tables = document.querySelector('.el-table').cloneNode(true); handleExport() {
const fix = tables.querySelector('.el-table__fixed'); //
const fixRight = tables.querySelector('.el-table__fixed-right'); let params = { ...this.queryParams };
if (fix) { params.pageNo = undefined;
tables.removeChild(tables.querySelector('.el-table__fixed')); params.pageSize = undefined;
} this.$modal.confirm('是否确认导出所有数据项?').then(() => {
if (fixRight) { this.exportLoading = true;
tables.removeChild(tables.querySelector('.el-table__fixed-right')); return exportSchedulingExcel(params);
} }).then(response => {
let exportTable = XLSX.utils.table_to_book(tables); this.$download.excel(response, '上班记录报表.xls');
this.exportLoading = false;
var exportTableOut = XLSX.write(exportTable, { }).catch(() => { });
bookType: 'xlsx', },
bookSST: true,
type: 'array',
});
// sheetjs.xlsx
try {
FileSaver.saveAs(
new Blob([exportTableOut], {
type: 'application/octet-stream',
}),
this.fileName + '班组上班记录.xlsx'
);
} catch (e) {
if (typeof console !== 'undefined') console.log(e, exportTableOut);
}
return exportTableOut;
},
getPdLineList() { getPdLineList() {
const params = { const params = {
pageSize: 100, pageSize: 100,
@ -197,6 +188,13 @@ export default {
this.getList(); this.getList();
break; break;
case 'export': case 'export':
this.queryParams.pageNo = 1;
this.queryParams.factoryId = val.factoryId || undefined;
this.queryParams.classesId = val.classesId || undefined;
this.queryParams.teamName = val.teamId || undefined;
this.queryParams.startDay = val.timeVal
? val.timeVal
: undefined;
this.handleExport(); this.handleExport();
break; break;
default: default:

View File

@ -44,7 +44,7 @@
border-radius: 100%; border-radius: 100%;
background: #26b9de; background: #26b9de;
"></span> "></span>
成本管理系统 智能监控分析系统
</p> </p>
</div> </div>
<video <video
@ -103,37 +103,18 @@
line-height: 54px; line-height: 54px;
letter-spacing: 2px; letter-spacing: 2px;
"> ">
成本管理系统 智能监控分析系统
</h3> </h3>
</h2> </h2>
<!-- 表单 --> <!-- 表单 -->
<div class="form-cont"> <div class="form-cont" style="margin-top: 60px;">
<el-tabs
class="form"
v-model="loginForm.loginType"
style="float: none">
<el-tab-pane label="账号密码登录" name="uname"></el-tab-pane>
<el-tab-pane label="短信验证码登录" name="sms"></el-tab-pane>
</el-tabs>
<div style=""> <div style="">
<el-form <el-form
ref="loginForm" ref="loginForm"
:model="loginForm" :model="loginForm"
:rules="LoginRules" :rules="LoginRules"
class="login-form"> class="login-form">
<el-form-item prop="tenantName" v-if="tenantEnable">
<el-input
v-model="loginForm.tenantName"
type="text"
auto-complete="off"
placeholder="租户">
<!-- <svg-icon
slot="prefix"
icon-class="tree"
class="el-input__icon input-icon" /> -->
</el-input>
</el-form-item>
<!-- 账号密码登录 --> <!-- 账号密码登录 -->
<div v-if="loginForm.loginType === 'uname'"> <div v-if="loginForm.loginType === 'uname'">
<el-form-item prop="username"> <el-form-item prop="username">

View File

@ -91,19 +91,19 @@ export default {
{ prop: 'productionLine', label: '产线' }, { prop: 'productionLine', label: '产线' },
{ prop: 'workshopSection', label: '工段' }, { prop: 'workshopSection', label: '工段' },
{ prop: 'equipment', label: '设备名称' }, { prop: 'equipment', label: '设备名称' },
{ // {
width: 90, // width: 90,
prop: 'alarmGrade', // prop: 'alarmGrade',
label: '报警级别', // label: '',
filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL), // filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL),
}, // },
{ {
prop: 'createTime', prop: 'createTime',
label: '报警时间', label: '报警时间',
width: 180, width: 180,
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'), filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
}, },
{ prop: 'alarmContent', label: '报警内容' }, // { prop: 'alarmContent', label: '' },
// { // {
// _action: 'equipment-group-show-alert', // _action: 'equipment-group-show-alert',
// label: '', // label: '',
@ -167,7 +167,7 @@ export default {
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 20,
factoryId: undefined, factoryId: undefined,
createTime: [], createTime: [],
}, },

View File

@ -126,10 +126,10 @@ export default {
}, },
mounted() { mounted() {
if (this.id) this.$set(this.queryParams, 'equipmentId', this.id); if (this.id) this.$set(this.queryParams, 'equipmentId', this.id);
if (this.code)
this.$set(this.searchBarFormConfig[0], 'defaultSelect', this.code);
if (this.name) if (this.name)
this.$set(this.searchBarFormConfig[1], 'defaultSelect', this.name); this.$set(this.searchBarFormConfig[0], 'defaultSelect', this.name);
if (this.code)
this.$set(this.searchBarFormConfig[1], 'defaultSelect', this.code);
const end = new Date(); const end = new Date();
const start = new Date() - 1800 * 1000; const start = new Date() - 1800 * 1000;
this.queryParams.recordTime = [parseTime(start), parseTime(end)]; this.queryParams.recordTime = [parseTime(start), parseTime(end)];

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2025-02-10 09:15:55 * @Date: 2025-02-10 09:15:55
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2025-02-19 09:41:10 * @LastEditTime: 2025-02-25 15:48:59
* @Description: * @Description:
--> -->
<template> <template>
@ -63,6 +63,7 @@ export default {
selectOptions: [], selectOptions: [],
param: 'lineId', param: 'lineId',
multiple: true, multiple: true,
width: 410
}, },
{ {
type: 'button', type: 'button',

View File

@ -3958,6 +3958,11 @@ dashdash@^1.12.0:
dependencies: dependencies:
assert-plus "^1.0.0" assert-plus "^1.0.0"
dayjs@^1.8.25:
version "1.11.13"
resolved "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.13.tgz"
integrity sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==
debug@^2.2.0: debug@^2.2.0:
version "2.6.9" version "2.6.9"
resolved "https://registry.npmmirror.com/debug/-/debug-2.6.9.tgz" resolved "https://registry.npmmirror.com/debug/-/debug-2.6.9.tgz"
@ -4418,6 +4423,14 @@ ejs@^2.6.1:
resolved "https://registry.npmmirror.com/ejs/-/ejs-2.7.4.tgz" resolved "https://registry.npmmirror.com/ejs/-/ejs-2.7.4.tgz"
integrity sha512-7vmuyh5+kuUyJKePhQfRQBhXV5Ce+RnaeeQArKu1EAMpL3WbgMt5WG6uQZpEVvYSSsxMXRKOewtDk9RaTKXRlA== integrity sha512-7vmuyh5+kuUyJKePhQfRQBhXV5Ce+RnaeeQArKu1EAMpL3WbgMt5WG6uQZpEVvYSSsxMXRKOewtDk9RaTKXRlA==
el-tree-transfer@^2.4.7:
version "2.4.7"
resolved "https://registry.npmmirror.com/el-tree-transfer/-/el-tree-transfer-2.4.7.tgz"
integrity sha512-wcjQyqzmiJMDhF3qHR1NcqXp27Q65Td1EsMOVkqqOo9Z2mkVC+cGJEu3V4L90x8c1XgEciQL7tMuSjCP7/8G4g==
dependencies:
lodash "^4.17.20"
wl-core "^1.1.4"
electron-to-chromium@^1.4.431: electron-to-chromium@^1.4.431:
version "1.4.473" version "1.4.473"
resolved "https://registry.npmmirror.com/electron-to-chromium/-/electron-to-chromium-1.4.473.tgz" resolved "https://registry.npmmirror.com/electron-to-chromium/-/electron-to-chromium-1.4.473.tgz"
@ -11568,6 +11581,14 @@ which@^2.0.1:
dependencies: dependencies:
isexe "^2.0.0" isexe "^2.0.0"
wl-core@^1.1.4:
version "1.1.9"
resolved "https://registry.npmmirror.com/wl-core/-/wl-core-1.1.9.tgz"
integrity sha512-7L83qEnrVW3YmPVqSwnlagoWJyVq/uSXkCFzND64nwtSdDm7o1RZQWiVgQcEilZxE0qLrRQKmjuAihNT6fWCjA==
dependencies:
big.js "^5.2.2"
dayjs "^1.8.25"
wmf@~1.0.1: wmf@~1.0.1:
version "1.0.2" version "1.0.2"
resolved "https://registry.npmmirror.com/wmf/-/wmf-1.0.2.tgz" resolved "https://registry.npmmirror.com/wmf/-/wmf-1.0.2.tgz"