feat: update mes management reports

This commit is contained in:
2026-06-26 16:21:09 +08:00
parent f6dce5daa8
commit abf822fd2c
13 changed files with 1554 additions and 36 deletions

View File

@@ -21,10 +21,13 @@
</el-select>
<!-- <el-input v-model="opName" placeholder="工位" size="small" clearable style="width:200px;margin-left: 0px"/> -->
<el-button type="primary" icon="el-icon-search" size="small" style="margin-left: 20px" plain @click="pageSize = 20;pageCurrent = 1;searchTable()">查询</el-button>
<el-button type="primary" icon="el-icon-check" size="small" style="margin-left: 10px" plain :loading="batchConfirming" :disabled="selectedConfirmRows.length === 0" @click="handleBatchConfirm">批量确认</el-button>
<el-button type="danger" icon="el-icon-circle-close" size="small" style="margin-left: 10px" plain :loading="batchClosing" :disabled="selectedCloseRows.length === 0" @click="handleBatchClose">批量关闭</el-button>
</div>
<div>
<el-table :data="tableData" border size="small" stripe highlight-current-row height="740px">
<el-table :data="tableData" border size="small" stripe highlight-current-row height="740px" @selection-change="handleSelectionChange">
<el-table-column type="selection" align="center" width="55" :selectable="isRowSelectable" />
<el-table-column label="订单编号" prop="订单编号" align="center" width="80px" />
<el-table-column label="合同号" prop="合同号" align="center" width="120px" />
<el-table-column label="产品编码" prop="产品编码" align="center" width="250px" />
@@ -77,6 +80,9 @@ export default {
original: '',
tableData: [], // 设备信息表
multipleSelection: [],
batchConfirming: false,
batchClosing: false
}
},
@@ -84,7 +90,13 @@ export default {
...mapGetters([
'id',
'token'
])
]),
selectedConfirmRows() {
return this.multipleSelection.filter(row => this.isRowConfirmable(row))
},
selectedCloseRows() {
return this.multipleSelection.filter(row => this.isRowCloseSelectable(row))
}
},
created() {
this.searchTable()
@@ -105,35 +117,163 @@ export default {
})
},
handleDelete(row) {
isRowConfirmable(row) {
return row.确认状态 != 1
},
isRowCloseSelectable(row) {
return row.确认状态 == 1 && row.单据状态 !== '已关闭'
},
isRowSelectable(row) {
return this.isRowConfirmable(row) || this.isRowCloseSelectable(row)
},
handleSelectionChange(val) {
this.multipleSelection = val
},
async confirmOrder(row) {
var param = []
param[0] = ['订单号', row.订单编号]
var Data = this.CreateData('12', '计划排产_生产订单关闭_确认订单', param)
const response = await this.ExecDatabase(Data)
const result = response.data && response.data[0] ? response.data[0] : {}
if (String(result.result) === '1') {
return { success: true }
}
return {
success: false,
message: result.提示信息 || '确认失败'
}
},
async closeOrder(row) {
var param = []
param[0] = ['订单号', row.订单编号]
var Data = this.CreateData('11', '计划排产_生产订单关闭_关闭订单', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === 1) {
const response = await this.ExecDatabase(Data)
const result = response.data && response.data[0] ? response.data[0] : {}
if (String(result.result) === '1') {
await patchB1('/ProductionOrders(' + row.订单编号 + ')', {
AbsoluteEntry: row.订单编号,
ProductionOrderStatus: 'boposClosed'
})
return { success: true }
}
return {
success: false,
message: result.提示信息 || '关闭失败'
}
},
async handleDelete(row) {
try {
const result = await this.closeOrder(row)
if (result.success) {
this.$message.success('关闭成功')
this.pageCurrent = 1
this.searchTable()
patchB1("/ProductionOrders("+row.订单编号+")",{
"AbsoluteEntry": row.订单编号,
"ProductionOrderStatus": 'boposClosed',
})
} else {
this.$message.error(`${response.data[0].提示信息}`)
this.$message.error(result.message)
}
})
} catch (error) {
this.$message.error(error.message || '关闭失败')
}
},
handledo(row){
var param = []
param[0] = ['订单号', row.订单编号]
var Data = this.CreateData('12', '计划排产_生产订单关闭_确认订单', param)
this.ExecDatabase(Data).then(response => {
if (response.data[0].result === '1') {
this.$message.success('确认成功')
this.pageCurrent = 1
this.searchTable()
}
})
async handleBatchClose() {
const rows = this.selectedCloseRows
if (rows.length === 0) {
this.$message.warning('请选择可关闭的订单')
return
}
const confirmResult = await this.$confirm(`确认批量关闭选中的 ${rows.length} 个订单吗?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).catch(() => false)
if (!confirmResult) {
return
}
this.batchClosing = true
const failedOrders = []
for (const row of rows) {
try {
const result = await this.closeOrder(row)
if (!result.success) {
failedOrders.push(`${row.订单编号}:${result.message}`)
}
} catch (error) {
failedOrders.push(`${row.订单编号}:${error.message || '关闭失败'}`)
}
}
this.batchClosing = false
this.multipleSelection = []
this.pageCurrent = 1
this.searchTable()
const successCount = rows.length - failedOrders.length
if (failedOrders.length === 0) {
this.$message.success(`批量关闭成功,共 ${successCount} 个订单`)
return
}
this.$message.warning(`批量关闭完成,成功 ${successCount} 个,失败 ${failedOrders.length} 个:${failedOrders.join('')}`)
},
async handledo(row){
try {
const result = await this.confirmOrder(row)
if (result.success) {
this.$message.success('确认成功')
this.pageCurrent = 1
this.searchTable()
} else {
this.$message.error(result.message)
}
} catch (error) {
this.$message.error(error.message || '确认失败')
}
},
async handleBatchConfirm() {
const rows = this.selectedConfirmRows
if (rows.length === 0) {
this.$message.warning('请选择可确认的订单')
return
}
const confirmResult = await this.$confirm(`确认批量确认选中的 ${rows.length} 个订单吗?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).catch(() => false)
if (!confirmResult) {
return
}
this.batchConfirming = true
const failedOrders = []
for (const row of rows) {
try {
const result = await this.confirmOrder(row)
if (!result.success) {
failedOrders.push(`${row.订单编号}:${result.message}`)
}
} catch (error) {
failedOrders.push(`${row.订单编号}:${error.message || '确认失败'}`)
}
}
this.batchConfirming = false
this.multipleSelection = []
this.pageCurrent = 1
this.searchTable()
const successCount = rows.length - failedOrders.length
if (failedOrders.length === 0) {
this.$message.success(`批量确认成功,共 ${successCount} 个订单`)
return
}
this.$message.warning(`批量确认完成,成功 ${successCount} 个,失败 ${failedOrders.length} 个:${failedOrders.join('')}`)
},
handleSizeChanges(val) {
this.pageCurrent = 1
@@ -147,4 +287,8 @@ export default {
}
}
</script>
<style>
.el-button {
width: auto !important;
}
</style>

View File

@@ -142,10 +142,14 @@
</div>
</div>
<div style="display: flex;">
<div>
<div style="width: 50%;">
<span style="width: 35%;font-size: 10px;">物料编码</span>
<span style="font-size: 10px;">{{ printData.orderInfo.零件图号 }}</span>
</div>
<div style="width: 50%;">
<span style="width: 35%;font-size: 10px;">原料编码</span>
<span style="font-size: 10px;">{{ printData.orderInfo.原料编码 }}</span>
</div>
</div>
<!-- 显示页码 -->
@@ -286,6 +290,18 @@ export default {
if (!date) return ''
return date.split(' ').length > 1 ? date.split(' ')[0] : date
},
async getRawMaterialCodes(orderNo) {
const param = []
param.push(['订单编号', orderNo])
const Data = this.CreateData('11', '工艺管理_获取物料原料信息', param)
const response = await this.ExecDatabase(Data)
const rawMaterialCodes = (response.data || [])
.filter(element => element.U_MoType === '机加件' && element.子件编码)
.map(element => String(element.子件编码))
return Array.from(new Set(rawMaterialCodes)).join('、')
},
handleRowClick(row) {
this.selectedRow = row
@@ -351,7 +367,10 @@ export default {
const response = await this.ExecDatabase(Data)
if (response.data && response.data.length > 0) {
const orderInfo = response.data[0]
const orderInfo = {
...response.data[0],
原料编码: await this.getRawMaterialCodes(item.订单编号)
}
const processList = []
// 为整个订单生成二维码
@@ -799,4 +818,4 @@ export default {
height: auto !important;
}
}
</style>
</style>

View File

@@ -333,11 +333,11 @@
<div style="width: 10%">
<div class="bottombox">
<div
class="grid-btn"
:class="['grid-btn', { 'grid-btn-disabled': workStartLoading }]"
style="width: 100%; margin-top: 30px"
@click="workStart()"
>
开始
{{ workStartLoading ? '开始中...' : '开始' }}
</div>
<div
class="grid-btn"
@@ -1891,6 +1891,7 @@ export default {
workStartData: {},
workStartNum: 0,
workStartVisible: false,
workStartLoading: false,
firstCheckData: {},
firstCheckNumber: false,
firstCheckVisible: false,
@@ -2885,6 +2886,9 @@ getUserId() {
// 开始按钮 - 记录人员开始时间
// 开始按钮 - 记录人员开始时间
async workStart() {
if (this.workStartLoading) {
return;
}
var row = this.selectedRow;
if (!row) {
this.$message.warning("请先选择一行数据");
@@ -2900,6 +2904,7 @@ async workStart() {
return;
}
this.workStartLoading = true;
try {
// 记录开始时间到数据库
const params = [];
@@ -2928,6 +2933,8 @@ async workStart() {
}
} catch (error) {
this.$message.error("开始操作失败: " + error.message);
} finally {
this.workStartLoading = false;
}
},
@@ -4740,6 +4747,13 @@ async workendForm() {
box-shadow: 2px 5px 10px #1474d7;
}
.grid-btn-disabled {
cursor: not-allowed;
opacity: 0.65;
box-shadow: none;
pointer-events: none;
}
.workstatus {
display: block;
font-size: 18px;
@@ -4863,4 +4877,4 @@ async workendForm() {
font-weight: bold;
margin-top: 10px;
}
</style>
</style>

View File

@@ -0,0 +1,290 @@
<template>
<div>
<el-card>
<div class="search-container" @keyup.enter="searchTable">
<span class="show-text">任务ID:</span>
<el-input
v-model="TaskAID"
clearable
placeholder="请输入任务ID"
style="width: 140px; margin-right: 10px"
/>
<span class="show-text">生产订单:</span>
<el-input
v-model="orderNo"
clearable
placeholder="请输入生产订单"
style="width: 140px; margin-right: 10px"
/>
<span class="show-text">计划号:</span>
<el-input
v-model="planNo"
clearable
placeholder="请输入计划号"
style="width: 140px; margin-right: 10px"
/>
<span class="show-text">销售订单:</span>
<el-input
v-model="saleNo"
clearable
placeholder="请输入销售订单"
style="width: 140px; margin-right: 10px"
/>
<span class="show-text">物料编码:</span>
<el-input
v-model="productCode"
clearable
placeholder="请输入物料编码"
style="width: 150px; margin-right: 10px"
/>
<span class="show-text">物料名称:</span>
<el-input
v-model="productName"
clearable
placeholder="请输入物料名称"
style="width: 150px; margin-right: 10px"
/>
<span class="show-text">任务状态:</span>
<el-select
v-model="productionStatus"
clearable
placeholder="请选择状态"
style="width: 130px; margin-right: 10px"
>
<el-option label="全部" value="10" />
<el-option label="待执行" value="0" />
<el-option label="可执行" value="1" />
<el-option label="已开工" value="2" />
<el-option label="已完成" value="4" />
</el-select>
<el-button
:disabled="loading"
icon="el-icon-search"
plain
type="primary"
@click="searchTable"
>查询</el-button>
</div>
<el-table
v-loading="loading"
:data="tableData"
:height="'80vh'"
:row-class-name="tableRowClassName"
border
element-loading-background="rgba(0, 0, 0, 0.2)"
element-loading-spinner="el-icon-loading"
highlight-current-row
size="mini"
style="width: 100%; margin-top: 20px"
tooltip-effect="dark"
>
<el-table-column align="center" fixed label="序号" type="index" width="50" />
<el-table-column align="center" fixed label="生产订单" prop="订单号" width="90" />
<el-table-column align="center" label="销售订单" prop="合同号" width="100" />
<el-table-column align="center" label="计划号" prop="计划号" width="90" />
<el-table-column align="center" label="物料编码" prop="零件编码" width="170" />
<el-table-column align="center" label="物料名称" prop="零件名称" width="170" />
<el-table-column align="center" label="齐套" width="80">
<template slot-scope="scope">
<div :style="getStatusStyle(scope.row.齐套)" class="score-cell">
{{ scope.row.齐套 }}
</div>
</template>
</el-table-column>
<el-table-column align="center" label="发料状态" width="90">
<template slot-scope="scope">
<div :style="getStatusStyle(scope.row.发料状态)" class="score-cell">
{{ scope.row.发料状态 }}
</div>
</template>
</el-table-column>
<el-table-column align="center" label="发料齐套时间" width="150">
<template slot-scope="scope">{{ formatDate(scope.row.发料齐套时间) }}</template>
</el-table-column>
<el-table-column align="center" label="拣配" width="80">
<template slot-scope="scope">
<div :style="getStatusStyle(scope.row.拣配状态)" class="score-cell">
{{ scope.row.拣配状态 }}
</div>
</template>
</el-table-column>
<el-table-column align="center" label="加急数量" prop="加急总数" width="100" />
<el-table-column align="center" label="分配数" prop="分配数" width="70" />
<el-table-column align="center" label="送检数" prop="完成数量" width="70" />
<el-table-column align="center" label="任务状态" width="90">
<template slot-scope="scope">
<div :style="getStatusStyle(scope.row.任务状态)" class="score-cell">
{{ scope.row.任务状态 }}
</div>
</template>
</el-table-column>
<el-table-column align="center" label="指派对象" prop="指派对象" width="90" />
<el-table-column align="center" label="计划开始" width="120">
<template slot-scope="scope">{{ formatDate(scope.row.计划开始) }}</template>
</el-table-column>
<el-table-column align="center" label="计划完成" width="120">
<template slot-scope="scope">{{ formatDate(scope.row.计划完成) }}</template>
</el-table-column>
<el-table-column align="center" label="二次派工" prop="二次派工名称" width="120" />
<el-table-column align="center" label="工序名称" prop="工序名称" width="90" />
<el-table-column align="center" label="上序合格数" prop="上序合格数" width="90" />
<el-table-column align="center" label="入库数量" prop="入库数量" width="90" />
<el-table-column align="center" label="手续确认" fixed="right" width="120">
<template slot-scope="scope">
<el-button
:loading="confirmingTaskAID === scope.row.TaskAID"
size="mini"
type="primary"
@click="confirmProcedure(scope.row)"
>已完成</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
export default {
name: 'FormalityConfirmReport',
data() {
return {
TaskAID: '',
orderNo: '',
planNo: '',
saleNo: '',
productCode: '',
productName: '',
productionStatus: '10',
tableData: [],
loading: false,
confirmingTaskAID: null
}
},
created() {
this.searchTable()
},
methods: {
async searchTable() {
this.loading = true
this.tableData = []
const param = []
param.push(['TaskAID', this.TaskAID || -1])
param.push(['订单号', this.orderNo || -1])
param.push(['零件编号', this.productCode])
param.push(['零件名称', this.productName])
param.push(['计划开工_Start', ''])
param.push(['计划开工_End', ''])
param.push(['生产状态', this.productionStatus || 10])
param.push(['工位名称', ''])
param.push(['计划号', this.planNo])
param.push(['销售订单', this.saleNo])
const data = this.CreateData('11', '生产管理_手续确认报表_查询', param)
try {
const response = await this.ExecDatabase(data)
this.tableData = response.data || []
} catch (error) {
console.error('查询失败:', error)
this.$message.error('查询失败')
} finally {
this.loading = false
}
},
confirmProcedure(row) {
this.$confirm('确认该任务手续已完成?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
confirmButtonClass: 'confirm-confirm-button',
cancelButtonClass: 'confirm-cancel-button',
type: 'warning'
}).then(async() => {
this.confirmingTaskAID = row.TaskAID
const param = []
param.push(['TaskAID', row.TaskAID])
param.push(['订单号', row.订单号])
param.push(['确认人', this.$store.getters.name || ''])
param.push(['备注', ''])
const data = this.CreateData('12', '生产管理_手续确认报表_确认', param)
try {
const response = await this.ExecDatabase(data)
const result = response.data && response.data[0]
if (result && String(result.result) === '1') {
this.$message.success('确认成功')
this.searchTable()
} else {
this.$message.error((result && (result.msg || result.提示信息)) || '确认失败')
}
} catch (error) {
console.error('确认失败:', error)
this.$message.error('确认失败')
} finally {
this.confirmingTaskAID = null
}
}).catch(() => {
this.$message.info('取消操作')
})
},
tableRowClassName({ row }) {
if (row.加急 === '加急') {
return 'priority-row'
}
return ''
},
getStatusStyle(value) {
if (value === '可执行' || value === '是' || value === '发料齐套' || value === '已拣配') {
return {
backgroundColor: '#f0f9eb',
color: '#67c23a'
}
}
if (value === '已完成') {
return {
backgroundColor: '#ecf5ff',
color: '#409eff'
}
}
if (value === '已开工' || value === '否' || value === '发料缺件' || value === '未拣配') {
return {
backgroundColor: '#fdf6ec',
color: '#e6a23c'
}
}
return {}
},
formatDate(value) {
if (!value) return ''
return String(value).split('T')[0].split(' ')[0]
}
}
}
</script>
<style scoped>
.search-container {
margin-bottom: 20px;
}
.show-text {
margin-right: 5px;
line-height: 32px;
}
.score-cell {
border-radius: 3px;
padding: 2px 4px;
}
::v-deep .priority-row {
background-color: #f56c6c !important;
color: #000000 !important;
}
::v-deep .priority-row td {
background-color: #f56c6c !important;
color: #000000 !important;
border: #f56c6c;
}
</style>

View File

@@ -148,7 +148,7 @@
<div class="status-light" :class="scope.row.优先级 === '是' ? 'status-light-green' : 'status-light-gray'" />
</template>
</el-table-column>
<el-table-column align="center" prop="当前序" label="当前序" width="80" />
<el-table-column align="center" prop="当前序" label="当前序" width="120" />
<el-table-column align="center" label="工艺路线" width="550">
<template slot-scope="scope">
<div class="process-route" v-html="formatProcessRoute(scope.row)" />
@@ -298,6 +298,62 @@ export default {
const num = Number(value)
return Number.isFinite(num) ? num : 0
},
isValidProcessDate(date) {
if (!date) return false
const processDate = new Date(date)
return !Number.isNaN(processDate.getTime()) && processDate > new Date('1900-01-01 00:00:00')
},
isProcessComplete(process) {
const progress = this.toProcessNumber(process.进度)
const planCount = this.toProcessNumber(process.计划数量)
const finishCount = this.toProcessNumber(process.完成数量)
const checkedCount = this.toProcessNumber(process.收检合格数) + this.toProcessNumber(process.收检不合格数)
return progress >= 100 ||
(planCount > 0 && finishCount >= planCount) ||
(planCount > 0 && checkedCount >= planCount)
},
isProcessStarted(process) {
const statusNum = this.getProcessStatusNum(process.加工状态)
return this.isValidProcessDate(process.开工时间) ||
this.isValidProcessDate(process.开始时间) ||
this.toProcessNumber(process.进度) > 0 ||
this.toProcessNumber(process.完成数量) > 0 ||
this.toProcessNumber(process.收检合格数) + this.toProcessNumber(process.收检不合格数) > 0 ||
[2, 3, 4, 5, 6].includes(statusNum)
},
getCurrentProcessText(processes) {
if (!Array.isArray(processes) || processes.length === 0) {
return ''
}
const sortedProcesses = [...processes].sort((a, b) => {
const rowA = parseInt(a.订单行号 || 0)
const rowB = parseInt(b.订单行号 || 0)
return rowA - rowB
})
const pendingIndex = sortedProcesses.findIndex(process => !this.isProcessComplete(process))
if (pendingIndex === -1) {
const lastProcess = sortedProcesses[sortedProcesses.length - 1]
return lastProcess && lastProcess.工序名称 ? `${lastProcess.工序名称}` : ''
}
const currentProcess = sortedProcesses[pendingIndex]
if (this.isProcessStarted(currentProcess)) {
return currentProcess.工序名称 ? `${currentProcess.工序名称}` : ''
}
if (pendingIndex === 0) {
return ''
}
const previousProcess = sortedProcesses[pendingIndex - 1]
if (!previousProcess.工序名称 || !currentProcess.工序名称) {
return ''
}
return `${previousProcess.工序名称}毕待${currentProcess.工序名称}`
},
escapeProcessHtml(value) {
return String(value == null ? '' : value)
.replace(/&/g, '&amp;')
@@ -602,11 +658,6 @@ export default {
}
}
})
if (item.收检合格数 > 0) {
existingItem.当前序 = item.工序名称
}
if (item.优先级 == '是') {
existingItem.优先级 = item.优先级
}
@@ -624,6 +675,17 @@ export default {
}
})
orderMap.forEach(item => {
if (Array.isArray(item.子数据)) {
item.子数据.sort((a, b) => {
const rowA = parseInt(a.订单行号 || 0)
const rowB = parseInt(b.订单行号 || 0)
return rowA - rowB
})
}
item.当前序 = this.getCurrentProcessText(item.子数据)
})
// 应用过滤条件
let filteredData = Array.from(orderMap.values()).map(item => ({
订单号: item.订单号,

View File

@@ -227,7 +227,11 @@
label="收检合格数量"
width="110"
prop="检验数量_6"
/>
>
<template slot-scope="scope">
{{ scope.row.检验数量_6 - scope.row.不合格数 }}
</template>
</el-table-column>
<el-table-column
align="center"
label="收检不合格数量"

View File

@@ -0,0 +1,216 @@
<template>
<div>
<el-card>
<div class="search-container" @keyup.enter="searchTable">
<span class="show-text">生产订单:</span>
<el-input
v-model="orderNo"
placeholder="请输入生产订单"
clearable
style="width: 150px; margin-right: 10px"
@click="searchTable()"
/>
<span class="show-text">销售订单:</span>
<el-input
v-model="contractNo"
placeholder="请输入销售订单"
clearable
style="width: 150px; margin-right: 10px"
/>
<span class="show-text">物料名称:</span>
<el-input
v-model="partName"
placeholder="请输入物料名称"
clearable
style="width: 150px; margin-right: 10px"
/>
<span class="show-text">物料编码:</span>
<el-input
v-model="partNo"
placeholder="请输入物料编号"
clearable
style="width: 150px; margin-right: 10px"
/>
<span class="show-text">属性</span>
<el-select
v-model="attribute"
style="width: 150px; margin-right: 10px"
filterable
>
<el-option label="装配" value="2" />
<el-option label="机加" value="1" />
<el-option label="全部" value="0" />
</el-select>
<span class="show-text">检测结果</span>
<el-select
v-model="inspectionResult"
clearable
style="width: 150px; margin-right: 10px"
filterable
>
<el-option label="合格" value="1" />
<el-option label="不合格" value="0" />
</el-select>
<span class="show-text">检测人:</span>
<el-select
v-model="checker"
placeholder="请选择检测人"
clearable
style="width: 150px; margin-right: 10px"
filterable
>
<el-option
v-for="item in checkerList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<el-button
:disabled="loading"
icon="el-icon-search"
plain
type="primary"
@click="searchTable()"
>查询</el-button>
</div>
<el-table
v-loading="loading"
:data="tableData"
:height="'67vh'"
border
element-loading-background="rgba(0, 0, 0, 0.2)"
element-loading-spinner="el-icon-loading"
highlight-current-row
size="mini"
style="width: 100%; margin-top: 20px"
tooltip-effect="dark"
:row-class-name="tableRowClassName"
>
<el-table-column align="center" label="序号" type="index" width="50" fixed />
<el-table-column align="center" label="销售订单" width="100" prop="合同号" />
<el-table-column align="center" label="生产订单" width="100" prop="计划号" />
<el-table-column align="center" label="物料名称" width="100" prop="零件名称" />
<el-table-column align="center" label="物料编码" width="100" prop="零件编码" />
<el-table-column align="center" label="工序名称" width="80" prop="工序名称" />
<el-table-column align="center" label="工位名称" width="80" prop="工位名称" />
<el-table-column align="center" label="供应商" width="80" prop="供应商" />
<el-table-column align="center" label="采购收货单" width="100" prop="采购收货单" />
<el-table-column align="center" label="加急数量" width="120" prop="加急总数" />
<el-table-column align="center" label="完成数量" width="100" prop="完成数量" />
<el-table-column align="center" label="检验数量" width="120" prop="检验数量" />
<el-table-column align="center" label="检验合格数量" width="110" prop="合格数" />
<el-table-column align="center" label="检验不合格数量" width="120" prop="不合格数" />
<el-table-column align="center" label="检验操作人" width="130" prop="检测人" />
<el-table-column align="center" label="检验时间" width="180" prop="检测时间" />
<el-table-column align="center" label="报工结束时间" width="180" prop="结束时间" />
<el-table-column align="center" label="超期天数" width="90" prop="超期天数" />
<el-table-column align="center" label="检测说明" width="180" prop="检测说明" />
</el-table>
</el-card>
</div>
</template>
<script>
export default {
name: 'PunctualInspectionReport',
data() {
return {
contractNo: '',
orderNo: '',
partNo: '',
partName: '',
completionTime: '',
inspectionDate: '',
checker: '',
checkerList: [],
inspectionResult: '',
tableData: [],
loading: false,
attribute: '0'
}
},
created() {
this.getCheckerList()
this.searchTable()
},
methods: {
getCheckerList() {
this.checkerList = []
const data = this.CreateData('11', '人员管理_人员信息查询_质检部门_查询')
this.ExecDatabase(data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.checkerList.push({
label: response.data[i].Personnel_Name,
value: response.data[i].Personnel_Number
})
}
})
},
tableRowClassName({ row }) {
if (row.加急状态 === 1) {
return 'priority-row'
}
return ''
},
async searchTable() {
this.loading = true
this.tableData = []
const param = []
param.push(['合同号', this.contractNo])
param.push(['订单号', this.orderNo])
param.push(['零件编号', this.partNo])
param.push(['零件名称', this.partName])
param.push(['完工日期_Start', this.completionTime ? this.completionTime[0] : ''])
param.push(['完工日期_End', this.completionTime ? this.completionTime[1] : ''])
param.push(['检测日期_Start', this.inspectionDate ? this.inspectionDate[0] : ''])
param.push(['检测日期_End', this.inspectionDate ? this.inspectionDate[1] : ''])
param.push(['检测结果', this.inspectionResult])
const selectedChecker = this.checkerList.find(item => item.value === this.checker)
param.push(['检测人', selectedChecker ? selectedChecker.label : ''])
param.push(['检测类别', ''])
param.push(['属性', this.attribute])
const data = this.CreateData('11', '质量管理_及时检验报表_查询', param)
try {
const response = await this.ExecDatabase(data)
const list = response.data || []
this.tableData = list
if (this.tableData.length === 0) {
this.$message.info('未查询到超过2天未检验的数据')
}
} catch (error) {
console.error('查询失败:', error)
this.$message.error('查询失败')
} finally {
this.loading = false
}
}
}
}
</script>
<style scoped>
.search-container {
margin-bottom: 20px;
}
.show-text {
margin-right: 5px;
line-height: 32px;
}
::v-deep .priority-row {
background-color: #f56c6c !important;
color: #000000 !important;
}
::v-deep .priority-row td {
background-color: #f56c6c !important;
color: #000000 !important;
border: #f56c6c;
}
</style>

View File

@@ -24,6 +24,17 @@
<el-option label="来料检验" value="2" />
<el-option label="退库检验" value="3" />
</el-select>
<span class="show-text">放行:</span>
<el-select
v-model="releaseStatus"
clearable
placeholder="请选择"
style="width: 100px; margin-right: 10px"
>
<el-option label="全部" value="" />
<el-option label="是" value="1" />
<el-option label="否" value="0" />
</el-select>
<span class="show-text">质检日期起:</span>
<el-date-picker
v-model="startDate"
@@ -72,6 +83,7 @@
<el-table-column align="center" prop="检验数量" label="检验数量" width="120" />
<el-table-column align="center" prop="合格数" label="合格数" width="120" />
<el-table-column align="center" prop="不合格数" label="不合格数" width="120" />
<el-table-column align="center" prop="放行数量" label="放行数量" width="120" />
<el-table-column align="center" prop="检测人" label="检测人" width="100" />
<el-table-column align="center" label="检测时间" width="160">
<template slot-scope="scope">
@@ -114,6 +126,7 @@ export default {
contractNo:'',
productCode:'',
productName:'',
releaseStatus:'',
// 表格数据
@@ -169,6 +182,7 @@ export default {
param.push(["合同号", this.normalizeQueryValue(this.contractNo) ]);
param.push(["零件编码", this.normalizeQueryValue(this.productCode) ]);
param.push(["零件名称", this.normalizeQueryValue(this.productName) ]);
param.push(["放行", this.normalizeReleaseStatusValue(this.releaseStatus) ]);
this.exporting = true
const Data = this.CreateData('2001', '质量管理_质检明细_导出', param)
@@ -249,6 +263,7 @@ export default {
param.push(['PageSize', this.pageSize])
param.push(['PageCount', '1111', 'int', '1'])
param.push(['ItemCount', '1111', 'int', '1'])
param.push(["放行", this.normalizeReleaseStatusValue(this.releaseStatus) ]);
var Data = this.CreateData('11', '质量管理_质检明细_查询', param)
this.ExecDatabase(Data).then(response => {
@@ -267,6 +282,10 @@ export default {
return value === null || value === undefined || value === '' ? '0' : value
},
normalizeReleaseStatusValue(value) {
return value === null || value === undefined || value === '' ? null : value
},
getCurrentUser() {
return this.$store.state.user.name