139 lines
5.2 KiB
Vue
139 lines
5.2 KiB
Vue
<template>
|
|
<div>
|
|
<el-card>
|
|
<el-alert type="info" :closable="false" style="margin-bottom:12px"
|
|
title="待审核签字:列出已满足前置签字(操作工已签;若需检验则检验员已 OK)的工艺步骤,由审核人按工艺配置的审核角色(如班组长/工艺员)复核。审核通过=放行;审核不通过=退回操作工重做(撤销该步骤已有的操作工/检验员签字,进入新一轮)。" />
|
|
|
|
<el-form inline>
|
|
<el-form-item label="产品工号"><el-input v-model="orderNo" placeholder="可空=全部" clearable style="width:200px" @keyup.enter="load" /></el-form-item>
|
|
<el-form-item label="工件SN"><el-input v-model="sn" placeholder="可空=全部" clearable style="width:200px" @keyup.enter="load" /></el-form-item>
|
|
<el-form-item><el-button type="primary" :loading="loading" @click="load">查询</el-button></el-form-item>
|
|
<el-form-item><el-button @click="resetFilters">重置</el-button></el-form-item>
|
|
</el-form>
|
|
</el-card>
|
|
|
|
<el-card style="margin-top:12px">
|
|
<template #header><div class="hd"><span class="t">待审核任务</span><span class="sub">共 {{ total }} 条</span></div></template>
|
|
<el-table :data="list" border size="small" v-loading="loading" empty-text="暂无待审核任务">
|
|
<el-table-column prop="sn" label="工件SN" min-width="180" show-overflow-tooltip />
|
|
<el-table-column prop="orderNo" label="产品工号" min-width="170" show-overflow-tooltip />
|
|
<el-table-column prop="stationNo" label="工位" width="80" align="center" />
|
|
<el-table-column prop="stepName" label="工序" min-width="160" show-overflow-tooltip />
|
|
<el-table-column label="操作工" min-width="120">
|
|
<template #default="{ row }">{{ row.operatorSigner || row.signedBy || '-' }}</template>
|
|
</el-table-column>
|
|
<el-table-column label="操作工签字时间" min-width="160">
|
|
<template #default="{ row }">{{ row.operatorSignedAt || row.signedAt || '-' }}</template>
|
|
</el-table-column>
|
|
<el-table-column label="操作" width="130" align="center" fixed="right">
|
|
<template #default="{ row }">
|
|
<el-button type="success" size="small" :loading="row._doing" @click="approve(row)">审核通过</el-button>
|
|
<el-button type="warning" size="small" :loading="row._doing" @click="reject(row)">退回重做</el-button>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
<el-pagination v-if="total > pageSize" style="margin-top:12px;justify-content:flex-end"
|
|
layout="prev,pager,next,total" :total="total" :page-size="pageSize"
|
|
:current-page="page" @current-change="onPage" />
|
|
</el-card>
|
|
</div>
|
|
<PageHelp :data="helpAudit" page="AuditPending" />
|
|
</template>
|
|
|
|
<script setup>
|
|
import { ref, onMounted } from 'vue'
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
import request from '../utils/request'
|
|
import PageHelp from '../components/PageHelp.vue'
|
|
import { helpAudit } from '../help'
|
|
|
|
const list = ref([])
|
|
const total = ref(0)
|
|
const page = ref(1)
|
|
const pageSize = ref(50)
|
|
const loading = ref(false)
|
|
const orderNo = ref('')
|
|
const sn = ref('')
|
|
function resetFilters() {
|
|
orderNo.value = ''
|
|
sn.value = ''
|
|
load()
|
|
}
|
|
|
|
async function load() {
|
|
loading.value = true
|
|
try {
|
|
const data = await request.get('/signs/audit-pending', {
|
|
params: { orderNo: orderNo.value, sn: sn.value, page: page.value, pageSize: pageSize.value }
|
|
})
|
|
list.value = (data.list || []).map((r) => Object.assign({}, r, { _doing: false }))
|
|
total.value = data.total || 0
|
|
} catch {
|
|
list.value = []
|
|
total.value = 0
|
|
} finally {
|
|
loading.value = false
|
|
}
|
|
}
|
|
|
|
function onPage(p) {
|
|
page.value = p
|
|
load()
|
|
}
|
|
|
|
async function approve(row) {
|
|
try {
|
|
await ElMessageBox.confirm('确认审核通过?该操作将记录审核人签字并放行工序。', '审核通过', {
|
|
confirmButtonText: '确认通过', cancelButtonText: '取消', type: 'warning'
|
|
})
|
|
} catch {
|
|
return // 取消
|
|
}
|
|
row._doing = true
|
|
try {
|
|
await request.post('/signs/auditor', {
|
|
sn: row.sn, orderNo: row.orderNo, stationNo: row.stationNo, stepId: row.stepId, result: 'OK', remark: ''
|
|
})
|
|
ElMessage.success('审核通过')
|
|
load()
|
|
} catch {
|
|
/* 拦截器已提示 */
|
|
} finally {
|
|
row._doing = false
|
|
}
|
|
}
|
|
|
|
async function reject(row) {
|
|
let remark = ''
|
|
try {
|
|
const { value } = await ElMessageBox.prompt('退回原因(将记录并退回操作工重做)', '退回重做', {
|
|
confirmButtonText: '确认退回', cancelButtonText: '取消', inputType: 'textarea',
|
|
inputValidator: (v) => (v && v.trim() ? true : '请填写退回原因')
|
|
})
|
|
remark = v.trim()
|
|
} catch {
|
|
return // 取消
|
|
}
|
|
row._doing = true
|
|
try {
|
|
await request.post('/signs/auditor', {
|
|
sn: row.sn, orderNo: row.orderNo, stationNo: row.stationNo, stepId: row.stepId, result: 'NG', remark
|
|
})
|
|
ElMessage.success('已退回重做')
|
|
load()
|
|
} catch {
|
|
/* 拦截器已提示 */
|
|
} finally {
|
|
row._doing = false
|
|
}
|
|
}
|
|
|
|
onMounted(load)
|
|
</script>
|
|
|
|
<style scoped>
|
|
.hd { display: flex; align-items: baseline; gap: 12px; }
|
|
.hd .t { font-size: 16px; font-weight: 600; }
|
|
.hd .sub { color: #6b7280; font-size: 13px; }
|
|
</style>
|