fix:首检管理
This commit is contained in:
parent
5899b2de39
commit
62d2a78bdb
@ -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) {
|
||||
// 在实际应用中实现排序逻辑
|
||||
|
||||
@ -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';
|
||||
// 使用ref和reactive初始化响应式数据
|
||||
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
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@ -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([
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user