新增修改查询
This commit is contained in:
parent
811c063f79
commit
9ccc2eaa07
@ -1,6 +1,22 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-form :model="queryParams" label-position="right" inline ref="queryRef" v-show="showSearch" @submit.prevent>
|
<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-form-item>
|
||||||
<el-button icon="search" type="primary" @click="handleQuery">{{ $t('btn.search') }}</el-button>
|
<el-button icon="search" type="primary" @click="handleQuery">{{ $t('btn.search') }}</el-button>
|
||||||
<el-button icon="refresh" @click="resetQuery">{{ $t('btn.reset') }}</el-button>
|
<el-button icon="refresh" @click="resetQuery">{{ $t('btn.reset') }}</el-button>
|
||||||
@ -25,13 +41,15 @@
|
|||||||
highlight-current-row
|
highlight-current-row
|
||||||
@sort-change="sortChange"
|
@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="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="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="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="workstationName" label="工站名称"min-width="120" 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="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="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="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" />
|
<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" />
|
<dict-tag :options=" options.onlineStatusOptions" :value="scope.row.onlineStatus" />
|
||||||
</template> -->
|
</template> -->
|
||||||
</el-table-column>
|
</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="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="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="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" />
|
<el-table-column prop="cameraResult" label="相机结果"min-width="120" align="center" :show-overflow-tooltip="true" />
|
||||||
@ -140,11 +158,11 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :lg="12">
|
<!-- <el-col :lg="12">
|
||||||
<el-form-item label="PLC IP地址" prop="plcIp">
|
<el-form-item label="PLC IP地址" prop="plcIp">
|
||||||
<el-input v-model="form.plcIp" placeholder="请输入PLC IP地址" />
|
<el-input v-model="form.plcIp" placeholder="请输入PLC IP地址" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col> -->
|
||||||
|
|
||||||
<el-col :lg="12">
|
<el-col :lg="12">
|
||||||
<el-form-item label="产品编码" prop="productCode">
|
<el-form-item label="产品编码" prop="productCode">
|
||||||
@ -158,7 +176,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :lg="12">
|
<!-- <el-col :lg="12">
|
||||||
<el-form-item label="参数名称" prop="paramName">
|
<el-form-item label="参数名称" prop="paramName">
|
||||||
<el-input v-model="form.paramName" placeholder="请输入参数名称" />
|
<el-input v-model="form.paramName" placeholder="请输入参数名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -168,7 +186,7 @@
|
|||||||
<el-form-item label="参数值" prop="paramValue">
|
<el-form-item label="参数值" prop="paramValue">
|
||||||
<el-input v-model="form.paramValue" placeholder="请输入参数值" />
|
<el-input v-model="form.paramValue" placeholder="请输入参数值" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col> -->
|
||||||
|
|
||||||
<el-col :lg="12">
|
<el-col :lg="12">
|
||||||
<el-form-item label="数据发生时间" prop="occurTime">
|
<el-form-item label="数据发生时间" prop="occurTime">
|
||||||
@ -682,11 +700,20 @@ import { listPlcProductionData,
|
|||||||
updatePlcProductionData,getPlcProductionData,
|
updatePlcProductionData,getPlcProductionData,
|
||||||
}
|
}
|
||||||
from '@/api/mes/plcproductiondata.js'
|
from '@/api/mes/plcproductiondata.js'
|
||||||
|
import { start } from 'nprogress';
|
||||||
const { proxy } = getCurrentInstance()
|
const { proxy } = getCurrentInstance()
|
||||||
const ids = ref([])
|
const ids = ref([])
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const showSearch = ref(true)
|
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({
|
const queryParams = reactive({
|
||||||
|
timeRange: [getCurrentDate(), getCurrentDate()],
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
sort: '',
|
sort: '',
|
||||||
@ -790,10 +817,28 @@ const defaultTime = ref([new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23,
|
|||||||
var dictParams = [
|
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');
|
||||||
|
|
||||||
|
return `${year}-${month}-${day}`;
|
||||||
|
};
|
||||||
|
|
||||||
function getList(){
|
let params = {
|
||||||
loading.value = true
|
...queryParams,
|
||||||
listPlcProductionData(queryParams).then(res => {
|
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
|
const { code, data } = res
|
||||||
if (code == 200) {
|
if (code == 200) {
|
||||||
dataList.value = data.result
|
dataList.value = data.result
|
||||||
@ -802,7 +847,6 @@ function getList(){
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询
|
// 查询
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
queryParams.pageNum = 1
|
queryParams.pageNum = 1
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user