fix:首检管理

This commit is contained in:
17630416519 2025-11-18 20:26:41 +08:00
parent 5899b2de39
commit 62d2a78bdb
3 changed files with 202 additions and 83 deletions

View File

@ -75,7 +75,20 @@
<div>
</div>
<!-- 导出 -->
<el-dialog v-model="exportDialog.open" title="导出" @close="handleCloseWorkOrder" width="500" draggable
:close-on-click-modal="false">
<el-form>
<el-form-item label="选择日期" prop="createWorkOrderDate">
<el-date-picker v-model="dateRange" type="daterange" range-separator="至" start-placeholder="开始日期"
end-placeholder="结束日期" />
</el-form-item>
</el-form>
<template #footer>
<el-button text @click="handleCloseWorkOrder">{{ $t('btn.cancel') }}</el-button>
<el-button type="primary" @click="submitExport">{{ $t('btn.submit') }}</el-button>
</template>
</el-dialog>
</div>
</template>
@ -126,17 +139,44 @@ function getList() {
}
})
}
//
const exportDialog = reactive({
open: false,
title: '',
url: '/mes/ProcessParameter/export'
})
//
function handleDownload() {
proxy
.$confirm('是否确定要导出数据吗?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(async () => {
await proxy.downFile('/mes/MaterialInfo/export', { ...queryParams })
})
exportDialog.open = true
const today = new Date();
dateRange.value = [today, today];
}
function handleCloseWorkOrder() {
exportDialog.open = false
const today = new Date();
dateRange.value = [today, today];
}
//
function formatDate(date) {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
}
function submitExport() {
if (!dateRange.value || dateRange.value.length !== 2) {
ElMessage.warning('请选择完整的日期范围')
return
}
const [startDate, endDate] = dateRange.value
const startTime = formatDate(startDate)
const endTime = formatDate(endDate)
console.log(import.meta.env.VITE_APP_BASE_API, '请求地址');
const exportUrl = `${exportDialog.url}?pageNum=${queryParams.pageNum}&pageSize=${queryParams.pageSize}&startTime=${startTime}&endTime=${endTime}`
proxy.download(exportUrl, '工单数据.xlsx')
handleCloseWorkOrder()
}
//
const columns = ref([
@ -177,7 +217,17 @@ function resetQuery() {
queryParams.pageSize = 10
handleQuery()
}
//
const dateRange = ref([
new Date(),
new Date()
])
//
onMounted(() => {
const today = new Date();
dateRange.value = [today, today];
})
//
function sortChange(column) {
//

View File

@ -23,30 +23,19 @@
</el-form-item>
<el-row :gutter="15" class="mb10">
<el-col :span="1.5">
<!-- <el-button type="primary" v-hasPermi="['business:processmodeloperation:add']" plain icon="plus"
@click="handleAdd">
{{ $t('btn.add') }}
</el-button> -->
<!-- <el-button class="tool-box" color="#626aef" icon="Download" @click="handleImport"> 导入
</el-button> -->
<el-button class="tool-box" color="#00aa00" icon="Upload" @click="handleDownload"> 导出
</el-button>
<!-- <el-button class="tool-box" color="#ff0000" icon="Delete" @click="handleDeletes"> 删除
</el-button> -->
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"
:columns="columns"></right-toolbar>
</el-row>
</el-form>
<!-- 工具区域 -->
<el-row :gutter="15" class="mb10">
</el-row>
<el-table :data="dataList" v-loading="loading" ref="table" border
header-cell-class-name="el-table-header-cell" @selection-change="handleSelectionChange"
highlight-current-row @sort-change="sortChange">
<!-- <el-table-column type="selection" width="55">
</el-table-column> -->
<el-table-column prop="workOrderCode" label="工单编码" align="center" :show-overflow-tooltip="true" />
<el-table-column prop="lineName" label="产线名称" align="center" :show-overflow-tooltip="true" />
<el-table-column prop="lineCode" label="产线编号" align="center" :show-overflow-tooltip="true" />
@ -72,9 +61,6 @@
<el-table-column prop="updateTime" label="更新时间" align="center" :show-overflow-tooltip="true" />
<el-table-column label="操作" width="100" align="center">
<template #default="scope">
<!-- <el-button type="success" size="small" icon="edit" title="编辑"
v-hasPermi="['business:processmodeloperation:edit']"
@click="handleUpdate(scope.row)"></el-button> -->
<el-button type="danger" size="small" icon="delete" title="删除"
v-hasPermi="['business:processmodeloperation:delete']"
@click="handleDelete(scope.row)"></el-button>
@ -181,6 +167,20 @@
<el-button type="primary" @click="submitFileForm">{{ $t('btn.submit') }}</el-button>
</template>
</el-dialog>
<!-- 导出 -->
<el-dialog v-model="exportDialog.open" title="导出" @close="handleCloseWorkOrder" width="500" draggable
:close-on-click-modal="false">
<el-form>
<el-form-item label="选择日期" prop="createWorkOrderDate">
<el-date-picker v-model="dateRange" type="daterange" range-separator="至" start-placeholder="开始日期"
end-placeholder="结束日期" />
</el-form-item>
</el-form>
<template #footer>
<el-button text @click="handleCloseWorkOrder">{{ $t('btn.cancel') }}</el-button>
<el-button type="primary" @click="submitExport">{{ $t('btn.submit') }}</el-button>
</template>
</el-dialog>
</div>
</template>
@ -188,13 +188,13 @@
import { ElMessageBox, ElMessage } from 'element-plus'
import { getProcessInfoList, getProcessInfoById, addProcessInfo, updateProcessInfo, delProcessInfo, getLineName } from "@/api/ticketInquiry/index"
import useUserStore from '@/store/modules/user'
import { getToken } from '@/utils/auth'
const dialogTableVisible = ref(false)
const userStore = useUserStore()
const userId = userStore.userId
const userName = userStore.userName
console.log(userStore.userId, 'userStore.userId')
import { ref, reactive, getCurrentInstance, watch, toRefs } from 'vue';
import { ref, reactive, getCurrentInstance, watch, toRefs, onMounted } from 'vue';
import { start } from 'nprogress';
// 使refreactive
const { proxy } = getCurrentInstance()
const ids = ref([])
@ -202,12 +202,11 @@ const loading = ref(false)
const showSearch = ref(true)
const show = ref(false)
const dataList = ref([])
import { getToken } from '@/utils/auth'
//
const queryParams = reactive({
pageNum: 1,
pageSize: 10,
// materialCode: '',
// materialName: '',
})
//
const queryParamsDetail = reactive({
@ -222,8 +221,6 @@ const upload = reactive({
open: false,
title: '导入数据',
isUploading: false,
// updateSupport: 0,
// uploadType: 1,
headers: { Authorization: 'Bearer ' + getToken() },
url: import.meta.env.VITE_APP_BASE_API + `/mes/MaterialInfo/ImportMaterialInfo?userId=${userStore.userId}&userName=${userStore.userName}`
})
@ -245,7 +242,6 @@ function getList() {
dataList.value = res.data.result
total.value = res.data.totalNum
}
})
}
@ -276,10 +272,6 @@ const handleFileSuccess = (response, file, fileList) => {
show.value = false
upload.isUploading = false
proxy.$refs['uploadRef'].clearFiles()
// dialogVisibleActualAssembly.value = true
// proxy.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + `${data}` + '</div>', '', {
// dangerouslyUseHTMLString: true
// })
if (code == 200) {
ElMessage({
message: '导入成功',
@ -296,6 +288,26 @@ const handleFileError = (error, file, fileList) => {
return
}
}
//
const exportDialog = reactive({
open: false,
title: '',
url: '/mes/WorkOrder/export'
})
//
const dateRange = ref([
new Date(),
new Date()
])
//
onMounted(() => {
const today = new Date();
dateRange.value = [today, today];
})
//
function submitFileForm() {
proxy.$refs['uploadRef'].submit()
@ -322,20 +334,42 @@ function handleImport() {
function importTemplate() {
proxy.download('/mes/MaterialInfo/importTemplate', '导入模板')
}
//
function handleDownload() {
proxy
.$confirm('是否确定要导出数据吗?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(async () => {
await proxy.downFile('/mes/MaterialInfo/export', { ...queryParams })
})
exportDialog.open = true
const today = new Date();
dateRange.value = [today, today];
}
function handleCloseWorkOrder() {
exportDialog.open = false
const today = new Date();
dateRange.value = [today, today];
}
//
function formatDate(date) {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
}
function submitExport() {
if (!dateRange.value || dateRange.value.length !== 2) {
ElMessage.warning('请选择完整的日期范围')
return
}
const [startDate, endDate] = dateRange.value
const startTime = formatDate(startDate)
const endTime = formatDate(endDate)
console.log(import.meta.env.VITE_APP_BASE_API, '请求地址');
const exportUrl = `${exportDialog.url}?pageNum=${queryParams.pageNum}&pageSize=${queryParams.pageSize}&startTime=${startTime}&endTime=${endTime}`
proxy.download(exportUrl, '工单数据.xlsx')
handleCloseWorkOrder()
}
//
function handleQuery() {
@ -346,8 +380,9 @@ function handleQuery() {
//
function resetQuery() {
proxy.resetForm('queryRef')
queryParams.materialCode = null
queryParams.materialName = null
queryParams.workOrderCode = null
queryParams.lineName = null
queryParams.lineCode = null
queryParams.orderDate = null
queryParams.pageSize = 10
handleQuery()
@ -355,7 +390,6 @@ function resetQuery() {
//
function sortChange(column) {
//
console.log('排序字段:', column.prop, '排序方式:', column.order)
}
@ -390,17 +424,7 @@ const ticketStatusoptions = ref([
{ label: '已取消', value: 3 }
])
const { form, rules } = toRefs(state)
//
// watch(() => form.value.processName, (newLineName) => {
// if (newLineName) {
// const selectedLine = productionLine.value.find(item => item.label === newLineName);
// if (selectedLine) {
// form.value.processCode = selectedLine.value;
// }
// } else {
// form.value.processCode = '';
// }
// });
//
function cancel() {
open.value = false
@ -411,21 +435,17 @@ function cancel() {
function reset() {
form.value = {
id: null,
materialCode: '',
materialName: '',
materialModel: '',
materialType: '',
parameter: '',
brand: '',
supplier: '',
deviceId: '',
feature: '',
remark: '',
processName: '',
processCode: '',
lineCode: '',
workOrderCode: '',
lineName: '',
orderDate: new Date().toISOString().split('T')[0],
lineCode: '',
orderDate: new Date(),
productCode: '',
productName: '',
totalQty: '',
okQty: '',
ngQty: '',
defectReason: '',
orderStatus: ''
}
proxy.resetForm('formRef')
}
@ -488,7 +508,6 @@ function submitForm() {
})
}
open.value = false
}
})
}

View File

@ -68,7 +68,19 @@
<div>
</div>
<el-dialog v-model="exportDialog.open" title="导出" @close="handleCloseWorkOrder" width="500" draggable
:close-on-click-modal="false">
<el-form>
<el-form-item label="选择日期" prop="createWorkOrderDate">
<el-date-picker v-model="dateRange" type="daterange" range-separator="至" start-placeholder="开始日期"
end-placeholder="结束日期" />
</el-form-item>
</el-form>
<template #footer>
<el-button text @click="handleCloseWorkOrder">{{ $t('btn.cancel') }}</el-button>
<el-button type="primary" @click="submitExport">{{ $t('btn.submit') }}</el-button>
</template>
</el-dialog>
</div>
</template>
@ -125,15 +137,53 @@ function getList() {
}
//
function handleDownload() {
proxy
.$confirm('是否确定要导出数据吗?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(async () => {
await proxy.downFile('/mes/MaterialInfo/export', { ...queryParams })
})
exportDialog.open = true
const today = new Date();
dateRange.value = [today, today];
}
//
const exportDialog = reactive({
open: false,
title: '',
url: '/mes/WorkOrderItem/export'
})
//
const dateRange = ref([
new Date(),
new Date()
])
//
onMounted(() => {
const today = new Date();
dateRange.value = [today, today];
})
//
function formatDate(date) {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
}
function handleCloseWorkOrder() {
exportDialog.open = false
const today = new Date();
dateRange.value = [today, today];
}
function submitExport() {
if (!dateRange.value || dateRange.value.length !== 2) {
ElMessage.warning('请选择完整的日期范围')
return
}
const [startDate, endDate] = dateRange.value
const startTime = formatDate(startDate)
const endTime = formatDate(endDate)
console.log(import.meta.env.VITE_APP_BASE_API, '请求地址');
const exportUrl = `${exportDialog.url}?pageNum=${queryParams.pageNum}&pageSize=${queryParams.pageSize}&startTime=${startTime}&endTime=${endTime}`
proxy.download(exportUrl, '工单数据.xlsx')
handleCloseWorkOrder()
}
//
const columns = ref([