新增修改查询

This commit is contained in:
17630416519 2026-01-30 17:41:46 +08:00
parent 811c063f79
commit 9ccc2eaa07

View File

@ -1,6 +1,22 @@
<template>
<div>
<el-form :model="queryParams" label-position="right" inline ref="queryRef" v-show="showSearch" @submit.prevent>
<el-form-item label="产品型号" prop="productModel">
<el-input v-model="queryParams.productModel" placeholder="请输入产品型号" clearable />
</el-form-item>
<el-form-item label="产品名称" prop="productName">
<el-input v-model="queryParams.productName" placeholder="请输入产品名称" clearable />
</el-form-item>
<el-form-item label="工站名称" prop="workstationName">
<el-input v-model="queryParams.workstationName" placeholder="请输入工站名称" clearable />
</el-form-item>
<el-form-item label="筛选日期" prop="timeRange">
<el-date-picker :clearable="false" v-model="queryParams.timeRange" type="daterange" range-separator=""
start-placeholder="开始时间" end-placeholder="结束时间" placeholder="请选择日期区间" />
</el-form-item>
<el-form-item label="产品编码" prop="productCode">
<el-input v-model="queryParams.productCode" placeholder="请输入产品编码" clearable />
</el-form-item>
<el-form-item>
<el-button icon="search" type="primary" @click="handleQuery">{{ $t('btn.search') }}</el-button>
<el-button icon="refresh" @click="resetQuery">{{ $t('btn.reset') }}</el-button>
@ -25,13 +41,15 @@
highlight-current-row
@sort-change="sortChange"
>
<el-table-column label="序号" type="index" width="70" align="center" />
<el-table-column label="序号" fixed="left" type="index" width="70" align="center" />
<el-table-column prop="lineCode" label="产线编号" min-width="100" align="center" :show-overflow-tooltip="true" />
<el-table-column prop="plcIp" label="PLC IP地址" min-width="130" align="center" :show-overflow-tooltip="true" />
<!-- <el-table-column prop="plcIp" label="PLC IP地址" min-width="130" align="center" :show-overflow-tooltip="true" /> -->
<el-table-column prop="productCode" label="产品编码" min-width="100" align="center" :show-overflow-tooltip="true" />
<el-table-column prop="productName" label="产品名称"min-width="100" align="center" :show-overflow-tooltip="true" />
<el-table-column prop="paramName" label="参数名称"min-width="100" align="center" :show-overflow-tooltip="true" />
<el-table-column prop="paramValue" label="参数值"min-width="100" align="center" :show-overflow-tooltip="true" />
<el-table-column prop="workstationName" label="工站名称"min-width="120" align="center" :show-overflow-tooltip="true" />
<el-table-column prop="workstationCode" label="工站编码"min-width="120" align="center" :show-overflow-tooltip="true" />
<!-- <el-table-column prop="paramName" label="参数名称"min-width="100" align="center" :show-overflow-tooltip="true" />
<el-table-column prop="paramValue" label="参数值"min-width="100" align="center" :show-overflow-tooltip="true" /> -->
<el-table-column prop="occurTime" label="数据发生时间"min-width="120" :show-overflow-tooltip="true" />
<el-table-column prop="qualificationFlag" label="合格标志"min-width="100" align="center" :show-overflow-tooltip="true" />
<el-table-column prop="reworkFlag" label="返工标志" min-width="100"align="center" :show-overflow-tooltip="true" />
@ -54,9 +72,9 @@
<dict-tag :options=" options.onlineStatusOptions" :value="scope.row.onlineStatus" />
</template> -->
</el-table-column>
<el-table-column prop="workstationCode" label="工站编码"min-width="120" align="center" :show-overflow-tooltip="true" />
<el-table-column prop="productModel" label="产品型号"min-width="120" align="center" :show-overflow-tooltip="true" />
<el-table-column prop="workstationName" label="工站名称"min-width="120" align="center" :show-overflow-tooltip="true" />
<el-table-column prop="sn1" label="条码查询" align="center"min-width="120" :show-overflow-tooltip="true" />
<el-table-column prop="sn2" label="结果上传条码" align="center"min-width="120" :show-overflow-tooltip="true" />
<el-table-column prop="cameraResult" label="相机结果"min-width="120" align="center" :show-overflow-tooltip="true" />
@ -140,11 +158,11 @@
</el-form-item>
</el-col>
<el-col :lg="12">
<!-- <el-col :lg="12">
<el-form-item label="PLC IP地址" prop="plcIp">
<el-input v-model="form.plcIp" placeholder="请输入PLC IP地址" />
</el-form-item>
</el-col>
</el-col> -->
<el-col :lg="12">
<el-form-item label="产品编码" prop="productCode">
@ -158,7 +176,7 @@
</el-form-item>
</el-col>
<el-col :lg="12">
<!-- <el-col :lg="12">
<el-form-item label="参数名称" prop="paramName">
<el-input v-model="form.paramName" placeholder="请输入参数名称" />
</el-form-item>
@ -168,7 +186,7 @@
<el-form-item label="参数值" prop="paramValue">
<el-input v-model="form.paramValue" placeholder="请输入参数值" />
</el-form-item>
</el-col>
</el-col> -->
<el-col :lg="12">
<el-form-item label="数据发生时间" prop="occurTime">
@ -682,11 +700,20 @@ import { listPlcProductionData,
updatePlcProductionData,getPlcProductionData,
}
from '@/api/mes/plcproductiondata.js'
import { start } from 'nprogress';
const { proxy } = getCurrentInstance()
const ids = ref([])
const loading = ref(false)
const showSearch = ref(true)
function getCurrentDate() {
const now = new Date();
const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, '0');
const day = String(now.getDate()).padStart(2, '0');
return new Date(`${year}-${month}-${day}`);
}
const queryParams = reactive({
timeRange: [getCurrentDate(), getCurrentDate()],
pageNum: 1,
pageSize: 10,
sort: '',
@ -790,10 +817,28 @@ const defaultTime = ref([new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23,
var dictParams = [
]
function getList() {
const formatDateTime = (date) => {
if (!date) return '';
const d = new Date(date);
const year = d.getFullYear();
const month = String(d.getMonth() + 1).padStart(2, '0');
const day = String(d.getDate()).padStart(2, '0');
function getList(){
loading.value = true
listPlcProductionData(queryParams).then(res => {
return `${year}-${month}-${day}`;
};
let params = {
...queryParams,
startTime: queryParams.timeRange && queryParams.timeRange[0] ? formatDateTime(queryParams.timeRange[0]) : '',
endTime: queryParams.timeRange && queryParams.timeRange[1] ? formatDateTime(queryParams.timeRange[1]) : ''
};
delete params.timeRange;
loading.value = true,
listPlcProductionData(params).then(res => {
const { code, data } = res
if (code == 200) {
dataList.value = data.result
@ -802,7 +847,6 @@ function getList(){
}
})
}
//
function handleQuery() {
queryParams.pageNum = 1