feat(qc): 新增理化检验相关功能及优化质检流程
1. 新增化学成分明细和物理性能明细的API与管理页面 2. 在钢卷详情页添加检验信息展示模块 3. 优化质保书预览的签章显示逻辑,仅审批通过后显示 4. 重构质保书列表为表格形式,新增审批流程功能 5. 优化质保书选择弹窗的钢卷查询条件 6. 新增批量新增质保书明细时自动填充理化数据功能
This commit is contained in:
53
klp-ui/src/api/mes/qc/chemicalItem.js
Normal file
53
klp-ui/src/api/mes/qc/chemicalItem.js
Normal file
@@ -0,0 +1,53 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询质量的化学成分明细列表
|
||||
export function listChemicalItem(query) {
|
||||
return request({
|
||||
url: '/qc/chemicalItem/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询质量的化学成分明细详细
|
||||
export function getChemicalItem(itemId) {
|
||||
return request({
|
||||
url: '/qc/chemicalItem/' + itemId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增质量的化学成分明细
|
||||
export function addChemicalItem(data) {
|
||||
return request({
|
||||
url: '/qc/chemicalItem',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改质量的化学成分明细
|
||||
export function updateChemicalItem(data) {
|
||||
return request({
|
||||
url: '/qc/chemicalItem',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除质量的化学成分明细
|
||||
export function delChemicalItem(itemId) {
|
||||
return request({
|
||||
url: '/qc/chemicalItem/' + itemId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 批量新增质量的化学成分明细
|
||||
export function batchAddChemicalItem(data) {
|
||||
return request({
|
||||
url: '/qc/chemicalItem/batchImport',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
53
klp-ui/src/api/mes/qc/physicalItem.js
Normal file
53
klp-ui/src/api/mes/qc/physicalItem.js
Normal file
@@ -0,0 +1,53 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询物理性能明细列表
|
||||
export function listPhysicalItem(query) {
|
||||
return request({
|
||||
url: '/qc/physicalItem/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询物理性能明细详细
|
||||
export function getPhysicalItem(physicalId) {
|
||||
return request({
|
||||
url: '/qc/physicalItem/' + physicalId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增物理性能明细
|
||||
export function addPhysicalItem(data) {
|
||||
return request({
|
||||
url: '/qc/physicalItem',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改物理性能明细
|
||||
export function updatePhysicalItem(data) {
|
||||
return request({
|
||||
url: '/qc/physicalItem',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除物理性能明细
|
||||
export function delPhysicalItem(physicalId) {
|
||||
return request({
|
||||
url: '/qc/physicalItem/' + physicalId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 批量新增物理性能明细
|
||||
export function batchAddPhysicalItem(data) {
|
||||
return request({
|
||||
url: '/qc/physicalItem/batchImport',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
@@ -49,6 +49,14 @@
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="审批状态" prop="approveStatus">
|
||||
<el-select v-model="queryParams.approveStatus" placeholder="请选择审批状态" clearable>
|
||||
<el-option label="待审批" value="PENDING" />
|
||||
<el-option label="审批中" value="APPROVING" />
|
||||
<el-option label="已通过" value="PASSED" />
|
||||
<el-option label="已驳回" value="REJECTED" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
@@ -88,65 +96,58 @@
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<div v-loading="loading" class="certificate-list">
|
||||
<div
|
||||
v-for="item in certificateList"
|
||||
:key="item.certificateId"
|
||||
class="certificate-card"
|
||||
:class="{ 'certificate-card-selected': selectedIds.includes(item.certificateId) }"
|
||||
@click="handleCardClick(item)"
|
||||
>
|
||||
<div class="card-top-bar"></div>
|
||||
|
||||
<div class="card-title-row">
|
||||
<span class="card-doc-type">质量保证书</span>
|
||||
<span class="card-sep">|</span>
|
||||
<span class="card-env">MES-QC-{{ item.certificateNo || '' }}</span>
|
||||
</div>
|
||||
|
||||
<div class="card-cert-no">
|
||||
<span class="card-cert-no-label">No.</span>
|
||||
<span class="card-cert-no-value">{{ item.certificateNo }}</span>
|
||||
</div>
|
||||
|
||||
<div class="card-info-grid">
|
||||
<div class="card-info-item">
|
||||
<span class="card-info-label">合同号</span>
|
||||
<span class="card-info-value">{{ item.contractNo || '-' }}</span>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="certificateList"
|
||||
@selection-change="handleSelectionChange"
|
||||
border
|
||||
class="certificate-table"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="证明书号" align="center" prop="certificateNo">
|
||||
<template #default="scope">
|
||||
<span class="cert-no">{{ scope.row.certificateNo || '-' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合同号" align="center" prop="contractNo" />
|
||||
<el-table-column label="产品名称" align="center" prop="productName" />
|
||||
<el-table-column label="执行标准" align="center" prop="standard" />
|
||||
<el-table-column label="收货单位" align="center" prop="consignee" />
|
||||
<el-table-column label="生产厂家" align="center" prop="manufacturer" />
|
||||
<el-table-column label="签发日期" align="center" prop="issueDate">
|
||||
<template #default="scope">
|
||||
{{ parseTime(scope.row.issueDate, '{y}-{m}-{d}') }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="签发状态" align="center" prop="approveStatus" width="180">
|
||||
<template #default="scope">
|
||||
<el-tag :type="getStatusType(scope.row.approveStatus)" size="small">
|
||||
{{ getStatusText(scope.row.approveStatus) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审批信息" align="center" width="220">
|
||||
<template #default="scope">
|
||||
<div v-if="(scope.row.approveStatus || 'PENDING') === 'PASSED' || (scope.row.approveStatus || 'PENDING') === 'REJECTED'">
|
||||
<div>审批人: {{ scope.row.approveBy || '-' }}</div>
|
||||
<div>审批时间: {{ parseTime(scope.row.approveTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</div>
|
||||
</div>
|
||||
<div class="card-info-item">
|
||||
<span class="card-info-label">产品名称</span>
|
||||
<span class="card-info-value">{{ item.productName || '-' }}</span>
|
||||
</div>
|
||||
<div class="card-info-item">
|
||||
<span class="card-info-label">执行标准</span>
|
||||
<span class="card-info-value">{{ item.standard || '-' }}</span>
|
||||
</div>
|
||||
<div class="card-info-item">
|
||||
<span class="card-info-label">收货单位</span>
|
||||
<span class="card-info-value">{{ item.consignee || '-' }}</span>
|
||||
</div>
|
||||
<div class="card-info-item">
|
||||
<span class="card-info-label">生产厂家</span>
|
||||
<span class="card-info-value">{{ item.manufacturer || '-' }}</span>
|
||||
</div>
|
||||
<div class="card-info-item">
|
||||
<span class="card-info-label">签发日期</span>
|
||||
<span class="card-info-value">{{ parseTime(item.issueDate, '{y}-{m}-{d}') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-footer">
|
||||
<div class="card-stamp-placeholder">质检专用</div>
|
||||
<div class="card-actions">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click.stop="handleUpdate(item)">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click.stop="handleDelete(item)">删除</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-view" @click.stop="handlePreview(item)">预览</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-printer" @click.stop="handlePrint(item)">打印</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" align="center" width="220">
|
||||
<template #default="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" :disabled="(scope.row.approveStatus || 'PENDING') === 'APPROVING' || (scope.row.approveStatus || 'PENDING') === 'PASSED'">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-view" @click="handlePreview(scope.row)">预览</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-printer" @click="handlePrint(scope.row)">打印</el-button>
|
||||
<el-button v-if="(scope.row.approveStatus || 'PENDING') === 'PENDING' || (scope.row.approveStatus || 'PENDING') === 'REJECTED'" size="mini" type="text" icon="el-icon-upload" @click="handleSubmit(scope.row)">提交审批</el-button>
|
||||
<el-button v-hasPermi="['qc:certificate:approve']" v-if="(scope.row.approveStatus || 'PENDING') === 'APPROVING'" size="mini" type="text" icon="el-icon-check" @click="handleApprove(scope.row, 'PASSED')">通过</el-button>
|
||||
<el-button v-hasPermi="['qc:certificate:approve']" v-if="(scope.row.approveStatus || 'PENDING') === 'APPROVING'" size="mini" type="text" icon="el-icon-close" @click="handleApprove(scope.row, 'REJECTED')">驳回</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
@@ -269,6 +270,18 @@ export default {
|
||||
},
|
||||
form: {},
|
||||
rules: {
|
||||
},
|
||||
statusMap: {
|
||||
'PENDING': '待提交',
|
||||
'APPROVING': '审批中',
|
||||
'PASSED': '已通过',
|
||||
'REJECTED': '已驳回'
|
||||
},
|
||||
statusTypeMap: {
|
||||
'PENDING': 'info',
|
||||
'APPROVING': 'warning',
|
||||
'PASSED': 'success',
|
||||
'REJECTED': 'danger'
|
||||
}
|
||||
};
|
||||
},
|
||||
@@ -276,6 +289,17 @@ export default {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
getStatusText(status) {
|
||||
const actualStatus = status || 'PENDING';
|
||||
return this.statusMap[actualStatus] || '未知';
|
||||
},
|
||||
getStatusType(status) {
|
||||
const actualStatus = status || 'PENDING';
|
||||
return this.statusTypeMap[actualStatus] || 'info';
|
||||
},
|
||||
getActualStatus(status) {
|
||||
return status || 'PENDING';
|
||||
},
|
||||
/** 查询质量证明书主列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
@@ -321,29 +345,8 @@ export default {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
handleCardClick(item) {
|
||||
const index = this.selectedIds.indexOf(item.certificateId);
|
||||
if (index > -1) {
|
||||
this.selectedIds.splice(index, 1);
|
||||
} else {
|
||||
this.selectedIds.push(item.certificateId);
|
||||
}
|
||||
this.updateSelectionStatus();
|
||||
},
|
||||
handleCheckboxChange(certificateId, event) {
|
||||
if (event.target.checked) {
|
||||
if (!this.selectedIds.includes(certificateId)) {
|
||||
this.selectedIds.push(certificateId);
|
||||
}
|
||||
} else {
|
||||
const index = this.selectedIds.indexOf(certificateId);
|
||||
if (index > -1) {
|
||||
this.selectedIds.splice(index, 1);
|
||||
}
|
||||
}
|
||||
this.updateSelectionStatus();
|
||||
},
|
||||
updateSelectionStatus() {
|
||||
handleSelectionChange(val) {
|
||||
this.selectedIds = val.map(item => item.certificateId);
|
||||
this.ids = [...this.selectedIds];
|
||||
this.single = this.selectedIds.length !== 1;
|
||||
this.multiple = this.selectedIds.length === 0;
|
||||
@@ -380,7 +383,8 @@ export default {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
} else {
|
||||
addCertificate(this.form).then(response => {
|
||||
const newForm = { ...this.form, approveStatus: 'PENDING' };
|
||||
addCertificate(newForm).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
@@ -391,6 +395,43 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 提交审批 */
|
||||
handleSubmit(row) {
|
||||
this.$modal.confirm('确认提交审批?').then(() => {
|
||||
this.loading = true;
|
||||
const params = {
|
||||
certificateId: row.certificateId,
|
||||
approveStatus: 'APPROVING'
|
||||
};
|
||||
updateCertificate(params).then(response => {
|
||||
this.$modal.msgSuccess("提交成功");
|
||||
this.getList();
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 审批操作 */
|
||||
handleApprove(row, status) {
|
||||
const statusText = status === 'PASSED' ? '通过' : '驳回';
|
||||
this.$modal.confirm(`确认${statusText}该审批?`).then(() => {
|
||||
this.loading = true;
|
||||
const params = {
|
||||
certificateId: row.certificateId,
|
||||
approveStatus: status,
|
||||
approveBy: this.$store.getters.name,
|
||||
approveTime: this.parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}')
|
||||
};
|
||||
updateCertificate(params).then(response => {
|
||||
this.$modal.msgSuccess(`${statusText}成功`);
|
||||
this.getList();
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const certificateIds = row.certificateId || this.ids;
|
||||
@@ -482,176 +523,19 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.certificate-list {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
|
||||
gap: 18px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.preview-content-wrapper {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.certificate-card {
|
||||
background: #fcf9f2;
|
||||
border: 1px solid #d6cfc0;
|
||||
border-radius: 2px;
|
||||
padding: 18px 20px 14px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
position: relative;
|
||||
box-shadow:
|
||||
0 1px 3px rgba(0, 0, 0, 0.06),
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.8);
|
||||
.certificate-table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.card-top-bar {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 3px;
|
||||
background: linear-gradient(90deg, #3a3a3a 0%, #7a7a7a 50%, #3a3a3a 100%);
|
||||
}
|
||||
|
||||
.certificate-card:hover {
|
||||
border-color: #b8ad98;
|
||||
box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.certificate-card-selected {
|
||||
border-color: #7a6f5e;
|
||||
border-width: 2px;
|
||||
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
.card-checkbox {
|
||||
position: absolute;
|
||||
top: 14px;
|
||||
right: 14px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.card-title-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.card-doc-type {
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
color: #2a2a2a;
|
||||
letter-spacing: 2px;
|
||||
font-family: "SimSun", "Songti SC", "Noto Serif SC", serif;
|
||||
}
|
||||
|
||||
.card-sep {
|
||||
color: #c0b8a8;
|
||||
font-size: 14px;
|
||||
font-weight: 200;
|
||||
}
|
||||
|
||||
.card-env {
|
||||
font-size: 10px;
|
||||
color: #9a9080;
|
||||
letter-spacing: 0.5px;
|
||||
.cert-no {
|
||||
font-family: "Courier New", monospace;
|
||||
}
|
||||
|
||||
.card-cert-no {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 4px;
|
||||
margin-bottom: 14px;
|
||||
padding-bottom: 12px;
|
||||
border-bottom: 1px solid #ddd6c8;
|
||||
}
|
||||
|
||||
.card-cert-no-label {
|
||||
font-size: 11px;
|
||||
color: #8a8070;
|
||||
font-style: italic;
|
||||
font-family: "Times New Roman", serif;
|
||||
}
|
||||
|
||||
.card-cert-no-value {
|
||||
font-size: 20px;
|
||||
font-weight: 700;
|
||||
color: #1a1a1a;
|
||||
letter-spacing: 1px;
|
||||
font-family: "Courier New", "Times New Roman", monospace;
|
||||
}
|
||||
|
||||
.card-info-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 2px 16px;
|
||||
}
|
||||
|
||||
.card-info-item {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
padding: 5px 0;
|
||||
border-bottom: 1px dotted #e6dfd0;
|
||||
}
|
||||
|
||||
.card-info-item:nth-last-child(-n+2) {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.card-info-label {
|
||||
font-size: 11px;
|
||||
color: #8a8270;
|
||||
min-width: 58px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.card-info-value {
|
||||
font-size: 13px;
|
||||
color: #222;
|
||||
color: #1f79b9;
|
||||
font-weight: 500;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.card-footer {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-top: 12px;
|
||||
padding-top: 10px;
|
||||
border-top: 1px solid #ddd6c8;
|
||||
}
|
||||
|
||||
.card-stamp-placeholder {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
border: 1.5px solid #9a8a7a;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #9a8a7a;
|
||||
font-size: 9px;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
line-height: 1.2;
|
||||
font-family: "SimSun", serif;
|
||||
}
|
||||
|
||||
.card-actions {
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.card-actions .el-button {
|
||||
padding: 3px 6px;
|
||||
font-size: 12px;
|
||||
}
|
||||
</style>
|
||||
|
||||
350
klp-ui/src/views/mes/qc/certificate/chemistry.vue
Normal file
350
klp-ui/src/views/mes/qc/certificate/chemistry.vue
Normal file
@@ -0,0 +1,350 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="钢卷号" prop="coilNo">
|
||||
<el-input
|
||||
v-model="queryParams.coilNo"
|
||||
placeholder="请输入钢卷号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="炉号" prop="heatNo">
|
||||
<el-input
|
||||
v-model="queryParams.heatNo"
|
||||
placeholder="请输入炉号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<coil-selector :use-trigger="true" multiple @confirm="handleBatchAdd"
|
||||
:filters="{ selectType: 'product', status: 0 }">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini">批量新增</el-button>
|
||||
</coil-selector>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="chemicalItemList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="钢卷号" align="center" prop="coilNo" />
|
||||
<el-table-column label="炉号" align="center" prop="heatNo" />
|
||||
<el-table-column label="碳(%)" align="center" prop="c" />
|
||||
<el-table-column label="硅(%)" align="center" prop="si" />
|
||||
<el-table-column label="锰(%)" align="center" prop="mn" />
|
||||
<el-table-column label="磷(%)" align="center" prop="p" />
|
||||
<el-table-column label="硫(%)" align="center" prop="s" />
|
||||
<el-table-column label="酸溶铝(%)" align="center" prop="als" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改质量的化学成分明细对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="钢卷" prop="coilId">
|
||||
<coil-selector v-model="form.coilId" :use-trigger="true" @select="handleSelect"
|
||||
:filters="{ selectType: 'product', status: 0, dataType: 1 }" />
|
||||
</el-form-item>
|
||||
<el-form-item label="钢卷号" prop="coilNo">
|
||||
<el-input v-model="form.coilNo" placeholder="自动填写" />
|
||||
</el-form-item>
|
||||
<el-form-item label="炉号" prop="heatNo">
|
||||
<el-input v-model="form.heatNo" placeholder="请输入炉号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="碳(%)" prop="c">
|
||||
<el-input v-model="form.c" placeholder="请输入碳(%)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="硅(%)" prop="si">
|
||||
<el-input v-model="form.si" placeholder="请输入硅(%)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="锰(%)" prop="mn">
|
||||
<el-input v-model="form.mn" placeholder="请输入锰(%)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="磷(%)" prop="p">
|
||||
<el-input v-model="form.p" placeholder="请输入磷(%)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="硫(%)" prop="s">
|
||||
<el-input v-model="form.s" placeholder="请输入硫(%)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="酸溶铝(%)" prop="als">
|
||||
<el-input v-model="form.als" placeholder="请输入酸溶铝(%)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listChemicalItem, getChemicalItem, delChemicalItem, addChemicalItem, updateChemicalItem, batchAddChemicalItem } from "@/api/mes/qc/chemicalItem";
|
||||
import CoilSelector from "@/components/CoilSelector";
|
||||
|
||||
export default {
|
||||
name: "ChemicalItem",
|
||||
components: {
|
||||
CoilSelector
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 按钮loading
|
||||
buttonLoading: false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 质量的化学成分明细表格数据
|
||||
chemicalItemList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
coilNo: undefined,
|
||||
heatNo: undefined,
|
||||
c: undefined,
|
||||
si: undefined,
|
||||
mn: undefined,
|
||||
p: undefined,
|
||||
s: undefined,
|
||||
als: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
coilNo: [
|
||||
{ required: true, message: "钢卷号不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询质量的化学成分明细列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listChemicalItem(this.queryParams).then(response => {
|
||||
this.chemicalItemList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
itemId: undefined,
|
||||
certificateId: undefined,
|
||||
coilId: undefined,
|
||||
coilNo: undefined,
|
||||
heatNo: undefined,
|
||||
c: undefined,
|
||||
si: undefined,
|
||||
mn: undefined,
|
||||
p: undefined,
|
||||
s: undefined,
|
||||
als: undefined,
|
||||
remark: undefined,
|
||||
delFlag: undefined,
|
||||
createTime: undefined,
|
||||
createBy: undefined,
|
||||
updateTime: undefined,
|
||||
updateBy: undefined
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.itemId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加质量的化学成分明细";
|
||||
},
|
||||
handleSelect(coil) {
|
||||
this.form.coilId = coil.coilId;
|
||||
this.form.coilNo = coil.currentCoilNo;
|
||||
},
|
||||
handleBatchAdd(rows) {
|
||||
this.loading = true;
|
||||
this.buttonLoading = true;
|
||||
const payload = rows.map(coil => ({
|
||||
coilId: coil.coilId,
|
||||
coilNo: coil.currentCoilNo,
|
||||
}))
|
||||
batchAddChemicalItem(payload).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.loading = true;
|
||||
this.reset();
|
||||
const itemId = row.itemId || this.ids
|
||||
getChemicalItem(itemId).then(response => {
|
||||
this.loading = false;
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改质量的化学成分明细";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
if (this.form.itemId != null) {
|
||||
updateChemicalItem(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
} else {
|
||||
addChemicalItem(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const itemIds = row.itemId || this.ids;
|
||||
this.$modal.confirm('是否确认删除质量的化学成分明细编号为"' + itemIds + '"的数据项?').then(() => {
|
||||
this.loading = true;
|
||||
return delChemicalItem(itemIds);
|
||||
}).then(() => {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('qc/chemicalItem/export', {
|
||||
...this.queryParams
|
||||
}, `chemicalItem_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -111,10 +111,10 @@
|
||||
<td class="footer-content footer-remark-cell">
|
||||
<pre class="remark-text">{{ certificate.remark || '/' }}</pre>
|
||||
<div class="signature-area">
|
||||
<img src="@/assets/images/zhijian.png" class="stamp-image" alt="质检专用章" />
|
||||
<img v-if="certificate.approveStatus === 'PASSED'" src="@/assets/images/zhijian.png" class="stamp-image" alt="质检专用章" />
|
||||
<div class="signature-block">
|
||||
<div class="signature-label">质量负责人:</div>
|
||||
<img src="@/assets/images/yanghongyan.png" class="signature-image" alt="签名" />
|
||||
<img v-if="certificate.approveStatus === 'PASSED'" src="@/assets/images/yanghongyan.png" class="signature-image" alt="签名" />
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
@@ -24,7 +24,8 @@
|
||||
<div class="tab-info">请点击齿轮图标选择质保书</div>
|
||||
</div>
|
||||
</div>
|
||||
<button v-if="certificateList.length > 0 && queryParams.pageNum < totalPage" class="nav-btn next" @click="nextPage">
|
||||
<button v-if="certificateList.length > 0 && queryParams.pageNum < totalPage" class="nav-btn next"
|
||||
@click="nextPage">
|
||||
<i class="el-icon-arrow-right"></i>
|
||||
</button>
|
||||
</div>
|
||||
@@ -62,7 +63,8 @@
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="签发日期">
|
||||
<el-date-picker v-model="currentCertificateInfo.issueDate" type="date" @change="handleCertificateInfoChange" />
|
||||
<el-date-picker v-model="currentCertificateInfo.issueDate" type="date"
|
||||
@change="handleCertificateInfoChange" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -216,9 +218,14 @@
|
||||
|
||||
<el-dialog :title="'选择钢卷'" :visible.sync="coilDialogVisible" width="900px" append-to-body>
|
||||
<div class="dialog-toolbar">
|
||||
|
||||
<el-form :model="coilQueryParams" ref="coilQueryForm" size="small" :inline="true" label-width="68px">
|
||||
<el-form-item label="钢卷号" prop="coilNo">
|
||||
<el-input v-model="coilQueryParams.coilNo" placeholder="请输入钢卷号" clearable
|
||||
<el-form-item label="入场钢卷号" prop="enterCoilNo">
|
||||
<el-input v-model="coilQueryParams.enterCoilNo" placeholder="请输入入场钢卷号" clearable
|
||||
@keyup.enter.native="handleCoilQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="当前钢卷号" prop="currentCoilNo">
|
||||
<el-input v-model="coilQueryParams.currentCoilNo" placeholder="请输入当前钢卷号" clearable
|
||||
@keyup.enter.native="handleCoilQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="材质" prop="material">
|
||||
@@ -236,18 +243,20 @@
|
||||
</el-form>
|
||||
</div>
|
||||
<el-table v-loading="coilLoading" :data="coilList" height="350px" @row-click="handleCoilSelect">
|
||||
<el-table-column label="钢卷号" align="center" prop="currentCoilNo" />
|
||||
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo" />
|
||||
<el-table-column label="当前钢卷号" align="center" prop="currentCoilNo" />
|
||||
<el-table-column label="材质" align="center" prop="material" />
|
||||
<el-table-column label="规格" align="center" prop="specification" />
|
||||
<el-table-column label="重量(t)" align="center" prop="netWeight" />
|
||||
</el-table>
|
||||
<pagination v-show="coilTotal > 0" :total="coilTotal" :page.sync="coilQueryParams.pageNum"
|
||||
<pagination v-show="coilTotal > 0" :total="coilTotal" :page.sync="coilQueryParams.pageNum"
|
||||
:limit.sync="coilQueryParams.pageSize" @pagination="getCoilList" />
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :title="'选择质保书'" :visible.sync="certificateDialogVisible" width="900px" append-to-body>
|
||||
<div class="dialog-toolbar">
|
||||
<el-form :model="certificateQueryParams" ref="certificateQueryForm" size="small" :inline="true" label-width="68px">
|
||||
<el-form :model="certificateQueryParams" ref="certificateQueryForm" size="small" :inline="true"
|
||||
label-width="68px">
|
||||
<el-form-item label="证明书号" prop="certificateNo">
|
||||
<el-input v-model="certificateQueryParams.certificateNo" placeholder="请输入证明书号" clearable
|
||||
@keyup.enter.native="handleCertificateQuery" />
|
||||
@@ -278,9 +287,9 @@
|
||||
<span>{{ parseTime(scope.row.issueDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<!-- <el-table-column label="备注" align="center" prop="remark" /> -->
|
||||
</el-table>
|
||||
<pagination v-show="certificateTotal > 0" :total="certificateTotal" :page.sync="certificateQueryParams.pageNum"
|
||||
<pagination v-show="certificateTotal > 0" :total="certificateTotal" :page.sync="certificateQueryParams.pageNum"
|
||||
:limit.sync="certificateQueryParams.pageSize" @pagination="getCertificateList" />
|
||||
</el-dialog>
|
||||
|
||||
@@ -305,7 +314,8 @@
|
||||
<el-input v-model="certificateForm.manufacturer" placeholder="请输入生产厂家" />
|
||||
</el-form-item>
|
||||
<el-form-item label="签发日期" prop="issueDate">
|
||||
<el-date-picker v-model="certificateForm.issueDate" value-format="yyyy-MM-dd HH:mm:ss" type="date" placeholder="请选择签发日期" />
|
||||
<el-date-picker v-model="certificateForm.issueDate" value-format="yyyy-MM-dd HH:mm:ss" type="date"
|
||||
placeholder="请选择签发日期" />
|
||||
</el-form-item>
|
||||
<el-form-item label="质保证明说明" prop="note">
|
||||
<el-input v-model="certificateForm.note" type="textarea" placeholder="请输入内容" auto-height />
|
||||
@@ -320,20 +330,12 @@
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<CoilSelector
|
||||
:visible.sync="batchAddDialogVisible"
|
||||
:use-trigger="false"
|
||||
:multiple="true"
|
||||
@confirm="handleBatchAddConfirm"
|
||||
/>
|
||||
<CoilSelector :visible.sync="batchAddDialogVisible" :use-trigger="false" :multiple="true"
|
||||
@confirm="handleBatchAddConfirm" />
|
||||
|
||||
<!-- 隐藏的打印组件 -->
|
||||
<CertificatePrintPreview
|
||||
ref="certificatePrint"
|
||||
v-show="false"
|
||||
:certificate="printCertificateData"
|
||||
:items="printItemsData"
|
||||
/>
|
||||
<CertificatePrintPreview ref="certificatePrint" v-show="false" :certificate="printCertificateData"
|
||||
:items="printItemsData" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -341,6 +343,8 @@
|
||||
import { listCertificateItem, getCertificateItem, delCertificateItem, addCertificateItem, updateCertificateItem } from "@/api/mes/qc/certificateItem";
|
||||
import { listCertificate, getCertificate, updateCertificate, addCertificate } from "@/api/mes/qc/certificate";
|
||||
import { listMaterialCoil } from "@/api/wms/coil";
|
||||
import { listChemicalItem } from "@/api/mes/qc/chemicalItem";
|
||||
import { listPhysicalItem } from "@/api/mes/qc/physicalItem";
|
||||
import CoilSelector from "@/components/CoilSelector/index.vue";
|
||||
import CertificatePrintPreview from "./components/CertificatePrintPreview.vue";
|
||||
import { print as printPdf } from "./lib/printUtils";
|
||||
@@ -515,13 +519,27 @@ export default {
|
||||
};
|
||||
this.getCoilList();
|
||||
},
|
||||
handleCoilSelect(row) {
|
||||
async fetchLatestChemAndPhys(coilId) {
|
||||
if (!coilId) return {};
|
||||
const [chemRes, physRes] = await Promise.all([
|
||||
listChemicalItem({ coilId, pageNum: 1, pageSize: 1 }),
|
||||
listPhysicalItem({ coilId, pageNum: 1, pageSize: 1 })
|
||||
]);
|
||||
const chem = chemRes.rows && chemRes.rows[0] || {};
|
||||
const phys = physRes.rows && physRes.rows[0] || {};
|
||||
const { c, si, mn, p, s, als, yieldStrength, tensileStrength, elongation, hardness, bendingTest, surfaceQuality, surfaceStructure, edgeStatus } = { ...chem, ...phys };
|
||||
return { c, si, mn, p, s, als, yieldStrength, tensileStrength, elongation, hardness, bendingTest, surfaceQuality, surfaceStructure, edgeStatus };
|
||||
},
|
||||
async handleCoilSelect(row) {
|
||||
if (this.currentEditRow) {
|
||||
this.currentEditRow.coilNo = row.currentCoilNo;
|
||||
this.currentEditRow.materialType = row.material;
|
||||
this.currentEditRow.size = row.specification;
|
||||
this.currentEditRow.weight = row.netWeight;
|
||||
this.currentEditRow.pieces = 1;
|
||||
const editRow = this.currentEditRow;
|
||||
editRow.coilNo = row.currentCoilNo;
|
||||
editRow.materialType = row.material;
|
||||
editRow.size = row.specification;
|
||||
editRow.weight = row.netWeight;
|
||||
editRow.pieces = 1;
|
||||
const data = await this.fetchLatestChemAndPhys(row.coilId);
|
||||
Object.assign(editRow, data);
|
||||
}
|
||||
this.coilDialogVisible = false;
|
||||
this.currentEditRow = null;
|
||||
@@ -556,7 +574,7 @@ export default {
|
||||
openBatchAddDialog() {
|
||||
this.batchAddDialogVisible = true;
|
||||
},
|
||||
handleBatchAddConfirm(coils) {
|
||||
async handleBatchAddConfirm(coils) {
|
||||
if (!coils || coils.length === 0) {
|
||||
this.$message.warning('请选择钢卷');
|
||||
return;
|
||||
@@ -566,41 +584,36 @@ export default {
|
||||
let successCount = 0;
|
||||
let failCount = 0;
|
||||
|
||||
coils.forEach((coil, index) => {
|
||||
const newRow = {
|
||||
certificateId: this.currentCertificateId,
|
||||
itemSeqNo: this.certificateItemList.length + index + 1,
|
||||
coilNo: coil.currentCoilNo,
|
||||
materialType: coil.material,
|
||||
size: coil.specification,
|
||||
weight: coil.netWeight,
|
||||
pieces: 1
|
||||
};
|
||||
|
||||
addCertificateItem(newRow).then(() => {
|
||||
for (let index = 0; index < coils.length; index++) {
|
||||
const coil = coils[index];
|
||||
try {
|
||||
const data = await this.fetchLatestChemAndPhys(coil.coilId);
|
||||
const newRow = {
|
||||
certificateId: this.currentCertificateId,
|
||||
itemSeqNo: this.certificateItemList.length + index + 1,
|
||||
coilNo: coil.currentCoilNo,
|
||||
materialType: coil.material,
|
||||
size: coil.specification,
|
||||
weight: coil.netWeight,
|
||||
pieces: 1,
|
||||
...data
|
||||
};
|
||||
await addCertificateItem(newRow);
|
||||
successCount++;
|
||||
if (successCount + failCount === totalCount) {
|
||||
this.batchAddDialogVisible = false;
|
||||
if (successCount === totalCount) {
|
||||
this.$message.success(`批量新增成功,共新增 ${successCount} 条明细`);
|
||||
} else {
|
||||
this.$message.warning(`批量新增完成,成功 ${successCount} 条,失败 ${failCount} 条`);
|
||||
}
|
||||
this.getList();
|
||||
}
|
||||
}).catch(() => {
|
||||
} catch {
|
||||
failCount++;
|
||||
if (successCount + failCount === totalCount) {
|
||||
this.batchAddDialogVisible = false;
|
||||
if (failCount === totalCount) {
|
||||
this.$message.error('批量新增失败');
|
||||
} else {
|
||||
this.$message.warning(`批量新增完成,成功 ${successCount} 条,失败 ${failCount} 条`);
|
||||
}
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
this.batchAddDialogVisible = false;
|
||||
if (failCount === 0) {
|
||||
this.$message.success(`批量新增成功,共新增 ${successCount} 条明细`);
|
||||
} else if (successCount === 0) {
|
||||
this.$message.error('批量新增失败');
|
||||
} else {
|
||||
this.$message.warning(`批量新增完成,成功 ${successCount} 条,失败 ${failCount} 条`);
|
||||
}
|
||||
this.getList();
|
||||
},
|
||||
handleAddCertificate() {
|
||||
this.certificateForm = {
|
||||
|
||||
402
klp-ui/src/views/mes/qc/certificate/physics.vue
Normal file
402
klp-ui/src/views/mes/qc/certificate/physics.vue
Normal file
@@ -0,0 +1,402 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="钢卷号" prop="coilNo">
|
||||
<el-input
|
||||
v-model="queryParams.coilNo"
|
||||
placeholder="请输入钢卷号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="屈服强度(MPa)" prop="yieldStrength">
|
||||
<el-input
|
||||
v-model="queryParams.yieldStrength"
|
||||
placeholder="请输入拉伸试验-屈服强度(MPa)"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="抗拉强度(MPa)" prop="tensileStrength">
|
||||
<el-input
|
||||
v-model="queryParams.tensileStrength"
|
||||
placeholder="请输入拉伸试验-抗拉强度(MPa)"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="伸长率(%)" prop="elongation">
|
||||
<el-input
|
||||
v-model="queryParams.elongation"
|
||||
placeholder="请输入拉伸试验-伸长率(%)"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="硬度实验(HRB)" prop="hardness">
|
||||
<el-input
|
||||
v-model="queryParams.hardness"
|
||||
placeholder="请输入硬度实验(HRB)"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="弯曲试验" prop="bendingTest">
|
||||
<el-input
|
||||
v-model="queryParams.bendingTest"
|
||||
placeholder="请输入弯曲试验"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="表面质量" prop="surfaceQuality">
|
||||
<el-input
|
||||
v-model="queryParams.surfaceQuality"
|
||||
placeholder="请输入表面质量"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="表面结构" prop="surfaceStructure">
|
||||
<el-input
|
||||
v-model="queryParams.surfaceStructure"
|
||||
placeholder="请输入表面结构"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<coil-selector :use-trigger="true" multiple @confirm="handleBatchAdd"
|
||||
:filters="{ selectType: 'product', status: 0 }">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini">批量新增</el-button>
|
||||
</coil-selector>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="physicalItemList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="物理性能ID" align="center" prop="physicalId" v-if="false"/>
|
||||
<el-table-column label="钢卷号" align="center" prop="coilNo" />
|
||||
<el-table-column label="屈服强度(MPa)" align="center" prop="yieldStrength" />
|
||||
<el-table-column label="抗拉强度(MPa)" align="center" prop="tensileStrength" />
|
||||
<el-table-column label="伸长率(%)" align="center" prop="elongation" />
|
||||
<el-table-column label="硬度实验(HRB)" align="center" prop="hardness" />
|
||||
<el-table-column label="弯曲试验" align="center" prop="bendingTest" />
|
||||
<el-table-column label="表面质量" align="center" prop="surfaceQuality" />
|
||||
<el-table-column label="表面结构" align="center" prop="surfaceStructure" />
|
||||
<el-table-column label="边缘状态" align="center" prop="edgeStatus" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改物理性能明细对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="钢卷" prop="coilId">
|
||||
<coil-selector v-model="form.coilId" :use-trigger="true" @select="handleSelect"
|
||||
:filters="{ selectType: 'product', status: 0, dataType: 1 }" />
|
||||
</el-form-item>
|
||||
<el-form-item label="钢卷号" prop="coilNo">
|
||||
<el-input v-model="form.coilNo" placeholder="自动填写" />
|
||||
</el-form-item>
|
||||
<el-form-item label="屈服强度(MPa)" prop="yieldStrength">
|
||||
<el-input v-model="form.yieldStrength" placeholder="请输入屈服强度(MPa)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="抗拉强度(MPa)" prop="tensileStrength">
|
||||
<el-input v-model="form.tensileStrength" placeholder="请输入抗拉强度(MPa)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="伸长率(%)" prop="elongation">
|
||||
<el-input v-model="form.elongation" placeholder="请输入伸长率(%)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="硬度实验(HRB)" prop="hardness">
|
||||
<el-input v-model="form.hardness" placeholder="请输入硬度实验(HRB)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="弯曲试验" prop="bendingTest">
|
||||
<el-input v-model="form.bendingTest" placeholder="请输入弯曲试验" />
|
||||
</el-form-item>
|
||||
<el-form-item label="表面质量" prop="surfaceQuality">
|
||||
<el-input v-model="form.surfaceQuality" placeholder="请输入表面质量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="表面结构" prop="surfaceStructure">
|
||||
<el-input v-model="form.surfaceStructure" placeholder="请输入表面结构" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listPhysicalItem, getPhysicalItem, delPhysicalItem, addPhysicalItem, updatePhysicalItem, batchAddPhysicalItem } from "@/api/mes/qc/physicalItem";
|
||||
import CoilSelector from "@/components/CoilSelector";
|
||||
|
||||
export default {
|
||||
name: "PhysicalItem",
|
||||
components: {
|
||||
CoilSelector
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 按钮loading
|
||||
buttonLoading: false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 物理性能明细表格数据
|
||||
physicalItemList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
coilNo: undefined,
|
||||
yieldStrength: undefined,
|
||||
tensileStrength: undefined,
|
||||
elongation: undefined,
|
||||
hardness: undefined,
|
||||
bendingTest: undefined,
|
||||
surfaceQuality: undefined,
|
||||
surfaceStructure: undefined,
|
||||
edgeStatus: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
coilNo: [
|
||||
{ required: true, message: "钢卷号不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询物理性能明细列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listPhysicalItem(this.queryParams).then(response => {
|
||||
this.physicalItemList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
physicalId: undefined,
|
||||
certificateId: undefined,
|
||||
coilId: undefined,
|
||||
coilNo: undefined,
|
||||
yieldStrength: undefined,
|
||||
tensileStrength: undefined,
|
||||
elongation: undefined,
|
||||
hardness: undefined,
|
||||
bendingTest: undefined,
|
||||
surfaceQuality: undefined,
|
||||
surfaceStructure: undefined,
|
||||
edgeStatus: undefined,
|
||||
remark: undefined,
|
||||
delFlag: undefined,
|
||||
createTime: undefined,
|
||||
createBy: undefined,
|
||||
updateTime: undefined,
|
||||
updateBy: undefined
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.physicalId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加物理性能明细";
|
||||
},
|
||||
handleSelect(coil) {
|
||||
this.form.coilId = coil.coilId;
|
||||
this.form.coilNo = coil.currentCoilNo;
|
||||
},
|
||||
handleBatchAdd(rows) {
|
||||
this.loading = true;
|
||||
this.buttonLoading = true;
|
||||
const payload = rows.map(coil => ({
|
||||
coilId: coil.coilId,
|
||||
coilNo: coil.currentCoilNo,
|
||||
}))
|
||||
batchAddPhysicalItem(payload).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.loading = true;
|
||||
this.reset();
|
||||
const physicalId = row.physicalId || this.ids
|
||||
getPhysicalItem(physicalId).then(response => {
|
||||
this.loading = false;
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改物理性能明细";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
if (this.form.physicalId != null) {
|
||||
updatePhysicalItem(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
} else {
|
||||
addPhysicalItem(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const physicalIds = row.physicalId || this.ids;
|
||||
this.$modal.confirm('是否确认删除物理性能明细编号为"' + physicalIds + '"的数据项?').then(() => {
|
||||
this.loading = true;
|
||||
return delPhysicalItem(physicalIds);
|
||||
}).then(() => {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('qc/physicalItem/export', {
|
||||
...this.queryParams
|
||||
}, `physicalItem_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -711,7 +711,7 @@
|
||||
<div class="section sales-section">
|
||||
<div class="section-header">
|
||||
<span class="section-icon">💰</span>
|
||||
<span class="section-title">销售信息</span>
|
||||
<span class="section-title">生产合同信息</span>
|
||||
</div>
|
||||
<div class="section-body" v-if="salesInfo.orderId">
|
||||
<el-descriptions :column="3" border size="small">
|
||||
@@ -734,7 +734,7 @@
|
||||
|
||||
<div v-else class="empty-state">
|
||||
<i class="el-icon-document"></i>
|
||||
<span>未找到相关销售记录</span>
|
||||
<span>未找到相关生产合同信息</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -742,7 +742,7 @@
|
||||
<!-- 发货单信息 -->
|
||||
<div class="section-header">
|
||||
<span class="section-icon">💰</span>
|
||||
<span class="section-title">发货单对应的合同信息</span>
|
||||
<span class="section-title">发货合同信息</span>
|
||||
</div>
|
||||
<div class="section-body" v-if="deliveryOrderInfo.orderId">
|
||||
<el-descriptions :column="3" border size="small">
|
||||
@@ -765,7 +765,7 @@
|
||||
|
||||
<div v-else class="empty-state">
|
||||
<i class="el-icon-document"></i>
|
||||
<span>未找到相关发货单对应的合同信息记录</span>
|
||||
<span>未找到相关发货合同信息</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -807,7 +807,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="section combined-section">
|
||||
<div class="section-header">
|
||||
<span class="section-icon">📋</span>
|
||||
@@ -878,6 +877,79 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 检验信息 -->
|
||||
<div class="section inspection-section">
|
||||
<div class="section-header">
|
||||
<span class="section-icon">🔬</span>
|
||||
<span class="section-title">检验信息</span>
|
||||
</div>
|
||||
<div class="section-body">
|
||||
<el-table :data="inspectionTaskList" v-loading="inspectionLoading" size="small" border stripe style="width: 100%"
|
||||
@expand-change="handleInspectionExpand" :row-key="row => row.taskId">
|
||||
<el-table-column type="expand">
|
||||
<template slot-scope="props">
|
||||
<div v-loading="inspectionItemLoadingMap[props.row.taskId]" style="padding: 8px;">
|
||||
<el-table :data="inspectionItemMap[props.row.taskId] || []" size="mini" border stripe style="width: 100%">
|
||||
<el-table-column label="检验项目名称" align="center" prop="itemName" min-width="120" />
|
||||
<el-table-column label="标准值" align="center" prop="standardValue" width="80" />
|
||||
<el-table-column label="上限" align="center" prop="upperLimit" width="80" />
|
||||
<el-table-column label="下限" align="center" prop="lowerLimit" width="80" />
|
||||
<el-table-column label="单位" align="center" prop="unit" width="60" />
|
||||
<el-table-column label="定性/定量" align="center" prop="itemType" width="80" />
|
||||
<el-table-column label="检验值" align="center" prop="inspectValue" width="100" />
|
||||
<el-table-column label="是否合格" align="center" prop="isQualified" width="80" />
|
||||
<el-table-column label="判定结果" align="center" prop="judgeResult" width="100" />
|
||||
<el-table-column label="检验人" align="center" prop="inspectUser" width="80" />
|
||||
<el-table-column label="检验时间" align="center" prop="inspectTime" width="160">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.inspectTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" min-width="100" />
|
||||
</el-table>
|
||||
<div v-if="!inspectionItemMap[props.row.taskId] || inspectionItemMap[props.row.taskId].length === 0"
|
||||
style="text-align:center;padding:16px;color:#999;font-size:13px;">
|
||||
暂无检验明细
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务编号" align="center" prop="taskCode" width="160" />
|
||||
<el-table-column label="任务类型" align="center" prop="taskType" width="100" />
|
||||
<el-table-column label="所属单位" align="center" prop="belongCompany" width="120" />
|
||||
<el-table-column label="方案名称" align="center" prop="schemeName" min-width="120" />
|
||||
<el-table-column label="状态" align="center" prop="status" width="90">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.status === 0 || scope.row.status === '0'" type="info" size="small">待检验</el-tag>
|
||||
<el-tag v-else-if="scope.row.status === 1 || scope.row.status === '1'" type="warning" size="small">已检验</el-tag>
|
||||
<el-tag v-else-if="scope.row.status === 2 || scope.row.status === '2'" type="success" size="small">已审核</el-tag>
|
||||
<span v-else>{{ scope.row.status }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="检验人" align="center" prop="inspectUser" width="80" />
|
||||
<el-table-column label="审核人" align="center" prop="auditUser" width="80" />
|
||||
<el-table-column label="最终结果" align="center" prop="result" min-width="100" />
|
||||
<el-table-column label="关联钢卷" align="center" width="140">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.coilList && scope.row.coilList.length > 0"
|
||||
style="display: flex; flex-wrap: wrap; gap: 4px;">
|
||||
<div v-for="(coil, index) in scope.row.coilList" :key="coil.coilId || index">
|
||||
<CurrentCoilNo :currentCoilNo="coil.currentCoilNo || coil.coilNo || ''" />
|
||||
</div>
|
||||
</div>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" min-width="100" show-overflow-tooltip />
|
||||
</el-table>
|
||||
<div v-if="inspectionTaskList.length === 0 && !inspectionLoading"
|
||||
style="text-align:center;padding:24px 0;color:#999;font-size:14px;">
|
||||
<i class="el-icon-document" style="font-size:48px;display:block;margin-bottom:8px;color:#ddd;"></i>
|
||||
未找到相关检验信息
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 生产工艺数据图表 -->
|
||||
<div v-if="isColdHardCoil" class="section production-section">
|
||||
<div class="section-header">
|
||||
@@ -969,6 +1041,9 @@ import { getTimingSegByEncoilId, getTimingPlanDetailByHotcoilId, getTimingRealti
|
||||
import AbnormalTable from '@/views/wms/coil/components/AbnormalTable.vue';
|
||||
import FileList from "@/components/FileList";
|
||||
import CoilTraceResult from '@/views/wms/coil/panels/CoilTraceResult.vue';
|
||||
import { listInspectionTask } from "@/api/mes/qc/inspectionTask";
|
||||
import { listInspectionItem } from "@/api/mes/qc/inspectionItem";
|
||||
import CurrentCoilNo from "@/components/KLPService/Renderer/CurrentCoilNo.vue";
|
||||
|
||||
const TREND_GROUPS = [
|
||||
{
|
||||
@@ -1087,7 +1162,8 @@ export default {
|
||||
components: {
|
||||
AbnormalTable,
|
||||
FileList,
|
||||
CoilTraceResult
|
||||
CoilTraceResult,
|
||||
CurrentCoilNo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -1131,6 +1207,11 @@ export default {
|
||||
deliveryOrderInfo: {},
|
||||
// 销售异议信息
|
||||
salesObjectionInfo: [],
|
||||
// 检验信息
|
||||
inspectionTaskList: [],
|
||||
inspectionLoading: false,
|
||||
inspectionItemMap: {},
|
||||
inspectionItemLoadingMap: {},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -1159,6 +1240,7 @@ export default {
|
||||
await this.fetchDeliveryOrderInfo();
|
||||
this.mergeTransferList();
|
||||
await this.getSalesObjectionList();
|
||||
await this.getInspectionTasks();
|
||||
|
||||
// 如果是冷硬卷,加载生产数据
|
||||
if (this.isColdHardCoil) {
|
||||
@@ -1258,6 +1340,33 @@ export default {
|
||||
});
|
||||
this.tranferList = list;
|
||||
},
|
||||
async getInspectionTasks() {
|
||||
this.inspectionLoading = true;
|
||||
try {
|
||||
const res = await listInspectionTask({ coilIds: this.coilId, pageNum: 1, pageSize: 100 });
|
||||
this.inspectionTaskList = res.rows || [];
|
||||
} catch (e) {
|
||||
console.error('获取检验任务异常:', e);
|
||||
this.inspectionTaskList = [];
|
||||
} finally {
|
||||
this.inspectionLoading = false;
|
||||
}
|
||||
},
|
||||
async handleInspectionExpand(row, expandedRows) {
|
||||
if (!expandedRows || !expandedRows.includes(row)) return;
|
||||
const taskId = row.taskId;
|
||||
if (this.inspectionItemMap[taskId]) return;
|
||||
this.$set(this.inspectionItemLoadingMap, taskId, true);
|
||||
try {
|
||||
const res = await listInspectionItem({ taskId, pageNum: 1, pageSize: 100 });
|
||||
this.$set(this.inspectionItemMap, taskId, res.rows || []);
|
||||
} catch (e) {
|
||||
console.error('获取检验明细异常:', e);
|
||||
this.$set(this.inspectionItemMap, taskId, []);
|
||||
} finally {
|
||||
this.$set(this.inspectionItemLoadingMap, taskId, false);
|
||||
}
|
||||
},
|
||||
formatTime(timeStamp) {
|
||||
if (!timeStamp) return '-';
|
||||
const date = new Date(timeStamp);
|
||||
|
||||
Reference in New Issue
Block a user