<template>
|
<view class="inspection-sheet">
|
<!-- 头部信息 -->
|
<view class="sheet-header">
|
<h1>来料检验单</h1>
|
<view class="inspection-number">检验单号:{{formData.releaseNo}}</view>
|
<!-- 造梦者特殊功能 -->
|
<!-- <view style="text-align: right;" >
|
<a class="sysLike"v-if="this.current" @click="toSysSubmitFrom(formData.releaseNo)">实验室送检</a>
|
<a class="sysLike" @click="toYzxSubmitFrom(formData.releaseNo)">一致性核对</a>
|
</view> -->
|
</view>
|
|
<!-- 基本信息区 -->
|
<view class="basic-info">
|
<view class="info-row">
|
<span class="info-label">到货单号:</span>
|
<span class="info-value">{{formData.lotNo}}</span>
|
<span class="info-label">创建人:</span>
|
<span class="info-value">{{formData.createBy}}</span>
|
</view>
|
<view class="info-row">
|
<span class="info-label">创建时间:</span>
|
<span class="info-value">{{formData.createDate}}</span>
|
<span class="info-label"> 负责人:</span>
|
<span class="info-value">{{formData.userName}}</span>
|
</view>
|
</view>
|
|
<!-- 物料信息区 -->
|
<view class="material-info">
|
<view class="info-block">
|
<view class="info-label">物料编码:</view>
|
<view class="info-value">{{formData.itemNo}}</view>
|
<!-- 造梦者特殊功能 -->
|
<view class="doc-links">
|
<a class="doc-link" @click="toFileUrlByU9List(1,formData.itemNo)">图纸规格书</a>
|
<a class="doc-link" @click="toFileUrlByU9List(2,formData.itemNo)">进料检验文件</a>
|
</view>
|
|
</view>
|
<view class="info-block">
|
<view class="info-label">物料名称:</view>
|
<view class="info-value">{{formData.itemName}}</view>
|
</view>
|
<view class="info-block">
|
<view class="info-label">规格型号:</view>
|
<view class="info-value">{{formData.itemModel}}</view>
|
</view>
|
|
<view class="info-block">
|
|
<view class="info-label" v-if="formData.extendNo1!=null">技改状态:</view>
|
<view class="info-value" v-if="formData.extendNo1!=null">{{formData.extendNo1}}</view>
|
<view class="info-label">项目:</view>
|
<view class="info-value">{{formData.projectCodes}}</view>
|
|
<view class="info-label">数量:</view>
|
<view class="info-value highlight">{{formData.fcovertQty}}</view>
|
<view class="info-label">抽检:</view>
|
<view class="info-value highlight">{{formData.maxCheckQyt}}</view>
|
</view>
|
<view class="info-block" v-if="formData.fngDesc!=null">
|
<view class="info-label">不良描述:</view>
|
<view class="info-value">{{formData.fngDesc}}</view>
|
</view>
|
<view class="info-block" v-if="formData.newFngDesc!=null">
|
<view class="info-label">上次不良:</view>
|
<view class="info-value">{{formData.newFngDesc}}</view>
|
</view>
|
<view class="info-block" v-if="formData.lvli!=null &&this.current" >
|
<view class="info-label">往期检验履历:</view>
|
<view class="info-value">{{formData.lvli}}</view>
|
</view>
|
</view>
|
|
<!-- 操作按钮区 -->
|
<view class="action-buttons" >
|
<!-- <a class="sysLike"v-if="this.current" @click="toSysSubmitFrom(formData.releaseNo)">实验室送检</a>
|
<a class="sysLike" @click="toYzxSubmitFrom(formData.releaseNo)">一致性核对</a>
|
-->
|
<button class="secondary-btn" v-if="this.current" @click="toSysSubmitFrom(formData.releaseNo)">实验室送检</button>
|
<button class="secondary-btn" @click="toYzxSubmitFrom(formData.releaseNo)">一致性核对</button>
|
<button class="secondary-btn" v-if="this.current" @click="getInspectionItems">获取检验项目</button>
|
</view>
|
|
<!-- 检验项目表格 -->
|
<view class="inspection-table">
|
<table>
|
<thead>
|
<tr>
|
<th width="15%" style="text-align: center;">检验项目</th>
|
<th width="50%" style="text-align: center;">检验描述</th>
|
<th width="20%" style="text-align: center;">记录(点击)</th>
|
</tr>
|
</thead>
|
<tbody>
|
<tr v-for="(item, index) in tableData" :key="index">
|
<td>{{ item.fcheckItem }}</td>
|
<td>
|
<view v-if="item.fcheckResu=='合格'" class="watermark approved">{{ getStatusText(item.fcheckResu) }}</view>
|
<view v-if="item.fcheckResu=='不合格'" class="watermark rejected">{{ getStatusText(item.fcheckResu) }}</view>
|
<view v-if="item.fcheckResu==null" class="watermark pending">{{ getStatusText(item.fcheckResu) }}</view>
|
<view class="description-text">{{ item.fcheckItemDesc }}</view>
|
</td>
|
<td>
|
<button v-if="item.current" class="record-btn" @click="fillRecord(item,index)">填写</button>
|
<button v-if="!item.current" class="record-btn" @click="fillRecord(item,index)">查看</button>
|
</td>
|
</tr>
|
</tbody>
|
</table>
|
</view>
|
|
<!-- 操作按钮区 -->
|
<view class="action-buttons">
|
<button class="secondary-btn" @click="uploadImages">查看所有图片</button>
|
<button class="secondary-btn" @click="addDefectDescription">查看不良描述</button>
|
<button class="primary-btn" @click="submitInspection" v-if="this.current">检验提交</button>
|
</view>
|
<view v-if="remarksPopup" class="overlay">
|
<view class="popup">
|
<h3>修改不合格描述</h3>
|
<form>
|
<view class="form-group">
|
<label class="form-label">不合格描述:</label>
|
<input class="form-input" type="text" v-model="remarks" />
|
</view>
|
|
</form>
|
<button class="updateBut" @click="editRemarks">修改</button>
|
<button @click="remarksPopup = !remarksPopup">取消</button>
|
</view>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
formData: {
|
id: "",
|
releaseNo: "",
|
createBy: "",
|
createDate: "",
|
lotNo: "",
|
itemNo: "",
|
billNo: "",
|
fcovertQty: "",
|
detailMem: "",
|
taskNo: "",
|
fcheckResu: "",
|
boardModel: "",
|
planQty: "",
|
mocode: "",
|
boardStyle: ""
|
},
|
tableData: [],
|
remarksPopup: false,
|
current:true
|
}
|
},
|
onLoad(options) {
|
//options中包含了url附带的参数
|
let params = options;
|
|
if (params["id"]) {
|
this.formData.id = params["id"];
|
this.formData.releaseNo = params["releaseNo"];
|
this.formData.lotNo = params["lotNo"];
|
this.msgId = params["msgId"];
|
|
if(params["current"]==='A')
|
{
|
this.current=true;
|
}else if(params["current"]==='B'){
|
this.current=false;
|
}
|
|
if (this.msgId > 0) {
|
this.msgRead();
|
}
|
|
} else {
|
//初始化检验单号
|
this.$post({
|
url: "/LLJ/getMaxReleaseNo"
|
}).then(res => {
|
this.formData.releaseNo = res.data.tbBillList;
|
this.formData.createBy = this.$loginInfo.account;
|
this.formData.createDate = this.$getDate("yyyy-mm-dd");
|
});
|
|
}
|
|
},
|
methods: {
|
getStatusText(status) {
|
const statusMap = {
|
approved: '合格',
|
rejected: '不合格',
|
pending: '待确认'
|
}
|
if(status==null){
|
return statusMap['pending'] || ''
|
}else if(status=='合格'){
|
return statusMap['approved'] || ''
|
}else{
|
return statusMap['rejected'] || ''
|
}
|
|
},
|
getInspectionItems() {
|
// 获取检验项目的逻辑
|
this.$post({
|
url: "/LLJ/setJYItem",
|
data: {
|
itemNo: this.formData.itemNo,
|
quantity: this.formData.fcovertQty,
|
releaseNo: this.formData.releaseNo
|
}
|
}).then(res => {
|
if (res.status==0) {
|
uni.showToast({
|
title: res.message.toString(),
|
//将值设置为 success 或者直接不用写icon这个参数
|
icon: 'success',
|
//显示持续时间为 2秒
|
duration: 2000
|
})
|
// 如果有页面跳转,需要用定时器延迟
|
setTimeout(() => {
|
this.init();
|
}, 2000);
|
|
} else {
|
uni.showToast({
|
title: res.message.toString(),
|
//将值设置为 success 或者直接不用写icon这个参数
|
icon: 'error',
|
//显示持续时间为 2秒
|
duration: 2000
|
})
|
}
|
});
|
},
|
fillRecord(item,index) {
|
// 填写记录的逻辑
|
uni.navigateTo({
|
url: 'detail?mainId=' + item.id+'&formID='+this.formData.id+'&releaseNo='+this.formData.releaseNo+'&index='+index+'¤t='+this.current+'&itemNo='+this.formData.itemNo
|
});
|
},
|
uploadImages() {
|
// 上传/查看图片的逻辑
|
uni.navigateTo({
|
url: 'ImageItemALL?id=' + this.formData.releaseNo
|
});
|
},
|
addDefectDescription() {
|
// 添加不良描述的逻辑(现改为查看所有不良描述)
|
// this.remarksPopup = !this.remarksPopup;
|
// this.remarks = this.formData.remarks;
|
// 上传/查看图片的逻辑
|
uni.navigateTo({
|
url: 'Blms?id=' + this.formData.releaseNo
|
});
|
|
},
|
submitInspection() {
|
// 检验提交的逻辑
|
this.$post({
|
url: "/LLJ/IqcQaSubmit",
|
data: {
|
userNo: this.$loginInfo.account,
|
releaseNo: this.formData.releaseNo
|
}
|
}).then(res => {
|
if (res.status==0) {
|
|
uni.showToast({
|
title: res.message.toString(),
|
icon: 'success',
|
duration: 2000
|
})
|
// 如果有页面跳转,需要用定时器延迟
|
setTimeout(() => {
|
uni.navigateTo({
|
url: 'List'
|
});
|
}, 2000); // 保持与 duration 相同的时长
|
|
} else {
|
uni.showModal({
|
title: "提示",
|
content: res.message.toString(),
|
confirmText: "确定",
|
showCancel: false,
|
success: (res) => {
|
|
}
|
})
|
}
|
})
|
},
|
onShow() {
|
//每次进入页面都会执行的方法
|
if (this.formData.id) {
|
this.init();
|
}
|
},
|
init() {
|
let userName = this.$loginInfo.account;
|
|
this.$post({
|
url: "/LLJ/getPage",
|
data: {
|
id: this.formData.id,
|
createUser: userName,
|
pageIndex: 1,
|
limit: 1,
|
}
|
}).then(res => {
|
let data = res.data.tbBillList[0];
|
if (data) {
|
this.formData = data;
|
|
this.$post({
|
url: "/LLJ/getJYItem",
|
data: {
|
id: this.formData.id,
|
releaseNo: this.formData.releaseNo
|
}
|
}).then(res1 => {
|
let tableData = res1.data.tbBillList
|
//当已检验个数都不为空时按照检测结构排序
|
tableData.sort((a, b) => {
|
if (a.result === '未完成' && b.result === '合格') {
|
return -1;
|
} else if (a.result === '合格' && b.result === '未完成') {
|
return 1;
|
} else {
|
return 0;
|
}
|
});
|
this.tableData = tableData;
|
if (this.tableData.length === 0) {
|
this.isShowTable = true;
|
}
|
this.tableData.forEach((item, index) => {
|
this.$set(item, 'current', this.current);
|
|
});
|
|
})
|
}
|
});
|
},
|
msgRead() {
|
msgRead(this.msgId, this.$loginInfo.account);
|
},
|
//去文件列表页面(文件类型,物料编号)
|
toFileUrlByU9List(type,u9No){
|
if(type===1){
|
uni.navigateTo({
|
url: 'FileUrlByU9List?type=' + type+'&itemID='+u9No
|
});
|
}else{
|
uni.navigateTo({
|
url: 'FileUrlByU9List2?type=' + type+'&itemID='+u9No
|
});
|
}
|
},
|
toSysSubmitFrom(releaseNo){
|
uni.navigateTo({
|
url: 'SysSubmitFrom?releaseNo=' + releaseNo+'&userID='+this.$loginInfo.account
|
});
|
},
|
toYzxSubmitFrom(releaseNo){
|
uni.navigateTo({
|
url: 'yzxFrom?id=' +this.formData.id+'¤t='+this.current
|
});
|
},
|
editRemarks() {
|
if (this.remarks) {
|
//saveRemarksGid
|
this.$post({
|
url: "/LLJ/saveRemarksGid",
|
data: {
|
gid: this.formData.id,
|
remarks: this.remarks,
|
releaseNo: this.formData.releaseNo,
|
}
|
}).then(res => {
|
if (res.data.tbBillList > 0) {
|
this.formData.remarks = this.remarks;
|
this.remarksPopup = !this.remarksPopup;
|
this.$showMessage("保存成功");
|
}
|
})
|
}else{
|
this.$post({
|
url: "/LLJ/saveRemarksGid",
|
data: {
|
gid: this.formData.id,
|
remarks: '',
|
releaseNo: this.formData.releaseNo,
|
}
|
}).then(res => {
|
if (res.data.tbBillList > 0) {
|
this.formData.remarks = this.remarks;
|
this.remarksPopup = !this.remarksPopup;
|
this.$showMessage("保存成功");
|
}
|
})
|
}
|
},
|
}
|
}
|
</script>
|
|
<style>
|
/* 基础样式 */
|
.inspection-sheet {
|
font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif;
|
max-width: 1000px;
|
margin: 0 auto;
|
padding: 20px;
|
background-color: #fff;
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
}
|
|
/* 头部样式 */
|
.sheet-header {
|
text-align: center;
|
margin-bottom: 20px;
|
padding-bottom: 15px;
|
border-bottom: 2px solid #e0e0e0;
|
}
|
|
.sheet-header h1 {
|
color: #2c3e50;
|
font-size: 24px;
|
margin-bottom: 5px;
|
}
|
|
.inspection-number {
|
font-size: 16px;
|
font-weight: bold;
|
color: #3498db;
|
}
|
|
/* 基本信息区样式 */
|
.basic-info, .material-info {
|
margin-bottom: 20px;
|
}
|
|
.info-row {
|
display: flex;
|
margin-bottom: 10px;
|
flex-wrap: wrap;
|
}
|
|
.info-label {
|
font-weight: bold;
|
color: #34495e;
|
min-width: 80px;
|
margin-right: 5px;
|
}
|
|
.info-value {
|
color: #2c3e50;
|
margin-right: 20px;
|
}
|
|
.highlight {
|
font-weight: bold;
|
color: #e74c3c;
|
}
|
|
/* 物料信息区样式 */
|
.material-info {
|
border: 1px solid #eee;
|
padding: 15px;
|
border-radius: 5px;
|
}
|
|
.info-block {
|
display: flex;
|
align-items: center;
|
margin-bottom: 10px;
|
flex-wrap: wrap;
|
}
|
|
.doc-links {
|
margin-left: auto;
|
}
|
|
.doc-link {
|
color: #3498db;
|
text-decoration: none;
|
margin-left: 15px;
|
padding: 3px 8px;
|
border: 1px solid #3498db;
|
border-radius: 3px;
|
font-size: 12px;
|
}
|
|
.sysLike{
|
color: #3498db;
|
text-decoration: none;
|
margin-left: 15px;
|
padding: 3px 8px;
|
border-radius: 3px;
|
font-size: 12px;
|
}
|
|
.doc-link:hover {
|
background-color: #f0f8ff;
|
}
|
|
/* 表格样式 */
|
.inspection-table {
|
margin: 25px 0;
|
}
|
|
.inspection-table table {
|
width: 100%;
|
border-collapse: collapse;
|
}
|
|
.inspection-table th, .inspection-table td {
|
padding: 12px 15px;
|
border: 1px solid #ddd;
|
text-align: left;
|
}
|
|
.inspection-table th {
|
background-color: #f8f9fa;
|
font-weight: bold;
|
color: #34495e;
|
}
|
|
.inspection-table tr:nth-child(even) {
|
background-color: #f9f9f9;
|
}
|
|
.inspection-table tr:hover {
|
background-color: #f1f5f9;
|
}
|
|
/* 按钮样式 */
|
.action-buttons {
|
display: flex;
|
justify-content: flex-end;
|
gap: 10px;
|
margin-top: 20px;
|
}
|
|
.primary-btn, .secondary-btn {
|
padding: 10px 20px;
|
border: none;
|
border-radius: 4px;
|
font-size: 14px;
|
cursor: pointer;
|
transition: all 0.3s;
|
}
|
|
.primary-btn {
|
background-color: #3498db;
|
color: white;
|
}
|
|
.primary-btn:hover {
|
background-color: #2980b9;
|
}
|
|
.secondary-btn {
|
background-color: #ecf0f1;
|
color: #7f8c8d;
|
}
|
|
.secondary-btn:hover {
|
background-color: #d5dbdb;
|
}
|
|
.record-btn {
|
padding: 6px 12px;
|
background-color: #f8f9fa;
|
border: 1px solid #ddd;
|
/* border-radius: 3px; */
|
cursor: pointer;
|
transition: all 0.2s;
|
}
|
|
.record-btn:hover {
|
background-color: #e9ecef;
|
}
|
|
/* 水印样式 */
|
.watermark {
|
position: absolute;
|
font-size: 40px;
|
font-weight: bold;
|
opacity: 1;
|
z-index: 1;
|
pointer-events: none;
|
transform: rotate(-15deg);
|
width: 100%;
|
text-align: center;
|
top: 50%;
|
left: 50%;
|
transform: translate(-50%, -50%) rotate(-15deg);
|
}
|
|
.watermark.approved {
|
color: #2ecc71; /* 绿色 */
|
}
|
|
.watermark.rejected {
|
color: #e74c3c; /* 红色 */
|
}
|
|
.watermark.pending {
|
color: #f39c12; /* 橙色 */
|
}
|
|
/* 描述文本容器 */
|
.description-text {
|
position: relative;
|
z-index: 2;
|
padding: 25px;
|
background-color: rgba(255, 255, 255, 0.7);
|
}
|
|
/* 调整表格单元格 */
|
.inspection-table td:nth-child(2) {
|
position: relative;
|
overflow: hidden;
|
padding: 0;
|
}
|
.overlay {
|
position: fixed;
|
top: 0;
|
left: 0;
|
width: 100%;
|
height: 100%;
|
background-color: rgba(0, 0, 0, 0.5);
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
z-index: 10;
|
}
|
.popup {
|
background-color: #fff;
|
padding: 20px;
|
border: 1px solid #ccc;
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
width: 68vw;
|
/* 设置宽度为视口宽度的80% */
|
height: 25vh;
|
/* 设置高度为视口高度的80% */
|
}
|
.form-group {
|
display: flex;
|
align-items: center;
|
border-bottom: 1px solid #c9c9c9;
|
}
|
.updateBut{
|
background-color: #3498db;
|
color: white;
|
}
|
/* 响应式设计 */
|
@media (max-width: 500px) {
|
.info-row, .info-block {
|
flex-direction: column;
|
align-items: flex-start;
|
}
|
|
.doc-links {
|
margin-left: 0;
|
margin-top: 10px;
|
}
|
|
.action-buttons {
|
flex-direction: column;
|
}
|
|
.inspection-table table {
|
display: block;
|
overflow-x: auto;
|
}
|
}
|
|
|
</style>
|