<template>
|
<view>
|
<view>
|
<uni-card>
|
<view>
|
<u-row customStyle="margin-bottom: 10px">
|
<u-col span="2">
|
<label>检验单号:</label>
|
</u-col>
|
<u-col span="4">
|
<label>{{item.RELEASE_NO}}</label>
|
</u-col>
|
</u-row>
|
<u-row customStyle="margin-bottom: 10px">
|
<u-col span="2">
|
<label>到货批次:</label>
|
</u-col>
|
<u-col span="4">
|
<label>{{item.LOT_NO}}</label>
|
</u-col>
|
</u-row>
|
<u-row customStyle="margin-bottom: 10px">
|
<u-col span="2">
|
<label>到货数量:</label>
|
</u-col>
|
<u-col span="4">
|
<label>{{item.FBATCH_QTY}} {{item.FNUMBER}}</label>
|
</u-col>
|
</u-row>
|
<u-row customStyle="margin-bottom: 10px">
|
<u-col span="2">
|
<label>送检时间:</label>
|
</u-col>
|
<u-col span="4">
|
<label>{{item.CREATE_DATE}}</label>
|
</u-col>
|
</u-row>
|
<u-row customStyle="margin-bottom: 10px">
|
<u-col span="2">
|
<label>产品名称:</label>
|
</u-col>
|
<u-col span="4">
|
<label>{{item.ITEM_NO}} | {{item.ITEM_NAME}}</label>
|
</u-col>
|
</u-row>
|
<u-row customStyle="margin-bottom: 10px">
|
<u-col span="2">
|
<label>供应商编号:</label>
|
</u-col>
|
<u-col>
|
<label>{{item.SUPP_NO}} / {{item.SUPP_NAME}}</label>
|
</u-col>
|
</u-row>
|
<u-row customStyle="margin-bottom: 10px">
|
<u-col span="2">
|
<label>物料规格:</label>
|
</u-col>
|
<u-col>
|
<label>{{item.ITEM_MODEL}}</label>
|
</u-col>
|
</u-row>
|
<u-button text="生成检验资料" type="primary" :plain="true" style="width: 200px;height: 100px;position: absolute;top: 10%;right: 10%;" @click="generate()"></u-button>
|
<!-- <u-button text="查询关联条码" type="primary" :plain="true" style="width: 200px;height: 100px;position: absolute;top: 55%;right: 10%;" @click="selectBarcode()"></u-button> -->
|
</view>
|
|
<view class="container">
|
<button @click="fetchDrawingNumber">调取图纸</button>
|
</view>
|
|
</uni-card>
|
</view>
|
|
<view>
|
<uni-table border stripe emptyText="暂无更多数据" style="margin-left: 5px;margin-right: 5px;">
|
<!-- 表头行 -->
|
<uni-tr>
|
<uni-th align="center" width="80">检验项目</uni-th>
|
<uni-th align="center" width="90">检验工具</uni-th>
|
<uni-th align="center" width="220">检验项目描述</uni-th>
|
<uni-th align="center" width="130">抽检数/合格数</uni-th>
|
<uni-th align="center" width="95">是否合格</uni-th>
|
<uni-th align="center" width="120">记录(点击)</uni-th>
|
</uni-tr>
|
<!-- 表格数据行 -->
|
<uni-tr v-for="(item,index) in table" style="height: 60px;" >
|
<uni-td align="center">{{item.FCHECK_ITEM}}</uni-td>
|
<uni-td align="center">{{item.FCHECK_TOOL}}</uni-td>
|
<uni-td align="center">{{item.FCHECK_ITEM_DESC}}</uni-td>
|
<uni-td align="center" @row-click="showJudge(item)" style="font-size:25px;">
|
<div v-if="parseFloat(item.CHECK_QYT)!=(parseFloat(item.FENTER_QTY)-parseFloat(item.FNG_QTY))" style="color: #E47470;font-size:25px;">{{item.CHECK_QYT}} / {{parseFloat(item.FENTER_QTY)-parseFloat(item.FNG_QTY)}}</div>
|
<div v-else style="color: #90BA87;font-size:25px;">{{item.CHECK_QYT}} / {{parseFloat(item.FENTER_QTY)-parseFloat(item.FNG_QTY)}}</div>
|
</uni-td>
|
<uni-td align="center" style="font-size:25px;">
|
<div v-if="item.FCHECK_RESU=='合格'" style="color: #90BA87;">{{item.FCHECK_RESU}}</div>
|
<div style="color: #E47470;" v-else>{{item.FCHECK_RESU}}</div>
|
</uni-td>
|
<uni-td align="center" style="font-size:25px;" @row-click="handleRowClick(item)">
|
<div v-if="item.TOTAL!=null && item.YL==item.TOTAL" style="color: #90BA87">{{item.TOTAL+ '/' + item.YL}}</div>
|
<div v-else-if="item.TOTAL!=null && item.YL<item.TOTAL" style="color: #E47470">{{item.TOTAL+ '/' + item.YL}}</div>
|
<div v-else>-</div>
|
</uni-td>
|
</uni-tr>
|
</uni-table>
|
</view>
|
|
<view class="judge">
|
<u-modal :show="show" :title="title" @confirm="confirm" @cancel="cancel" showCancelButton>
|
<view>
|
<label>抽检数:{{choose.CHECK_QYT}} 允收:{{choose.FAC_QTY}} 拒收:{{choose.FRE_QTY}}</label>
|
</view>
|
<view style="margin-top: 20px;">
|
<u-number-box class="bjq" v-model="fng_qty" :min="0" :max="choose.CHECK_QYT"></u-number-box>
|
</view>
|
</u-modal>
|
</view>
|
|
<!-- <view class="barcode">
|
<u-modal :show="barcodeShow" title="检验关联条码" @confirm="barcodeConfirm" @cancel="barcodeCancel" showCancelButton>
|
<uni-table border stripe emptyText="暂无更多数据" style="margin-left: 5px;margin-right: 5px;height: 500px;">
|
<uni-tr>
|
<uni-th align="center">项次</uni-th>
|
<uni-th align="center" width="80">关联条码</uni-th>
|
<uni-th align="center" width="200">物料名称</uni-th>
|
<uni-th align="center" width="100">数量</uni-th>
|
<uni-th align="center" width="130">工单</uni-th>
|
</uni-tr>
|
<uni-tr v-for="(item,index) in barcode" style="height: 100px;" >
|
<uni-td align="center"># {{item.IDX}}</uni-td>
|
<uni-td align="center">{{item.ITEM_BARCODE}}</uni-td>
|
<uni-td align="center">{{item.ITEM_NAME}}</uni-td>
|
<uni-td align="center">{{item.QUANTITY}}</uni-td>
|
<uni-td align="center">{{item.PBILL_NO}}</uni-td>
|
</uni-tr>
|
</uni-table>
|
</u-modal>
|
</view> -->
|
|
<view class="barcode">
|
<u-modal :show="drawingShow" title="图纸明细" @confirm="drawingConfirm" @cancel="drawingCancel" showCancelButton>
|
<uni-table border stripe emptyText="暂无更多数据" style="margin-left: 5px;margin-right: 5px;height: 500px;">
|
<uni-tr>
|
<uni-th align="center">相关文档</uni-th>
|
<uni-th align="center" width="90">有无关联PDF文件</uni-th>
|
<uni-th align="center" width="150">操作(点击)</uni-th>
|
</uni-tr>
|
<uni-tr v-for="(item,index) in drawing" style="height: 100px;">
|
<uni-td align="center">{{item.fName}}</uni-td>
|
<uni-td align="center" style="font-size:25px;">
|
<div v-if="item.fRelevantObject==' '" style="color: #E47470;">×</div>
|
<div style="color: #90BA87;" v-else>√</div>
|
</uni-td>
|
<uni-td align="center" class="click-wd" @row-click="openDrawings(item)">打开文档</uni-td>
|
</uni-tr>
|
</uni-table>
|
</u-modal>
|
</view>
|
|
<view style="margin-top: 10px;">
|
<u-row style="margin-bottom: 5px;">
|
<u--text type="info" text="不良描述"></u--text>
|
</u-row>
|
<u-row>
|
<u--textarea v-model="remark" placeholder="请输入内容"></u--textarea>
|
</u-row>
|
</view>
|
|
<!-- 弹出窗口 -->
|
<view v-if="pdfVisible" class="modal">
|
<view class="modal-content">
|
<view class="modal-header">
|
<text>PDF预览</text>
|
<button @click="closeModal">关闭</button>
|
</view>
|
<view class="pdf-view">
|
<iframe :src="pdfLink" width="100%" height="100%"></iframe>
|
</view>
|
</view>
|
</view>
|
|
<u-button text="提交" type="primary" style="margin-top: 10px;height: 55px;" @click="submit()"></u-button>
|
<div style="height: 30px;"></div>
|
<u-toast ref="uToast" />
|
</view>
|
</template>
|
|
<script>
|
import {getIqcInspectionItems,saveIqcBadQty,saveIqc,getIqcBarCode,generateIqcInfo} from '../../api/iqc'
|
import {baseUrl} from '../../config.js'
|
export default {
|
data() {
|
return {
|
item: {},
|
table: [],
|
barcode:[],
|
drawing:[],
|
name: '',
|
remark: '',
|
pdfVisible: false, //在这里声明 pdfVisible
|
pdfLink: '', //也声明 pdfLink,确保它们是响应式的
|
show: false,
|
barcodeShow:false,
|
drawingShow:false,
|
title:'录入不良数',
|
list: [],
|
choose:{},
|
fng_qty:0
|
}
|
},
|
onLoad(option) {
|
let item = JSON.parse(decodeURIComponent(option.item));
|
this.item = item
|
console.log(this.item)
|
this.getInspection(item.RELEASE_NO)
|
this.name = uni.getStorageSync('userInfo').username
|
},
|
onNavigationBarButtonTap(e) {
|
let that = this
|
uni.chooseImage({
|
count: 1,
|
sizeType: ['original', 'compressed'],
|
sourceType: ['camera'],
|
success: chooseImage => {
|
const tempFilePaths = chooseImage.tempFilePaths;
|
uni.uploadFile({
|
url: 'http://192.168.0.100:8080/ycmes' + '/hkFile/upload?mid=' + that.item.RELEASE_NO +
|
'&username=' + uni.getStorageSync('userInfo').code,
|
filePath: tempFilePaths[0],
|
name: 'file',
|
success: (uploadFileRes) => {
|
console.log(uploadFileRes.data);
|
},
|
fail: (res) => {
|
console.log(res)
|
}
|
});
|
}
|
})
|
},
|
options: {
|
styleIsolation: 'shared'
|
},
|
methods: {
|
//检验明细
|
getInspection(checkNo) {
|
getIqcInspectionItems(checkNo).then(res => {
|
if(!res.result) {
|
this.$refs.uToast.show({
|
message: res.msg,
|
type: 'error'
|
})
|
return
|
}
|
this.table=res.data
|
})
|
},
|
//跳转记录页
|
handleRowClick(item) {
|
if(item.TOTAL!=null){
|
uni.navigateTo({
|
url:'/pages/iqc/iqcSampleResult?detail='+ encodeURIComponent(JSON.stringify(item).replace(/\%/g, '%25').replace(/\ /g,'%20').replace(/\?/g,'%3F').replace(/\+/g,'%2B').replace(/\&/g,'%26')) ,
|
})
|
}
|
},
|
//打开录入不良页面
|
showJudge(item){
|
if(item.TOTAL==null){
|
this.choose=item
|
this.fng_qty=item.FNG_QTY
|
this.show=true
|
}
|
},
|
//确认不良数
|
confirm() {
|
if(this.fng_qty===this.choose.FNG_QTY){
|
console.log(1)
|
}else{
|
saveFqcBadQty({"RELEASE_NO":this.choose.RELEASE_NO,"PID":this.choose.ID,"ngCount":this.fng_qty}).then(res => {
|
if(!res.result) {
|
this.$refs.uToast.show({
|
message: res.msg,
|
type: 'error'
|
})
|
return
|
}else{
|
this.getInspection(this.item.RELEASE_NO)
|
}
|
})
|
}
|
this.show = false
|
},
|
//取消
|
cancel(){
|
this.show=false
|
},
|
// barcodeConfirm(){
|
// this.barcodeShow=false
|
// },
|
// barcodeCancel(){
|
// this.barcodeShow=false
|
// },
|
//重新加载页面
|
reload(){
|
this.$nextTick(()=>{
|
this.$refs.uToast.show({
|
message: "保存成功",
|
type: 'success'
|
})
|
this.getInspection(this.item.RELEASE_NO)
|
})
|
},
|
|
//提交检验
|
submit() {
|
if (this.table.length == 0) {
|
this.$refs.uToast.show({
|
message: "提交失败,请维护检验项目",
|
type: 'error'
|
})
|
return
|
} else {
|
if (this.check()) {
|
saveIqc(this.item.RELEASE_NO,this.remark).then(res => {
|
if (!res.result) {
|
this.$refs.uToast.show({
|
message: res.msg,
|
type: 'error'
|
})
|
return
|
} else {
|
let pages = getCurrentPages();
|
let beforePage = pages[pages.length - 2];
|
uni.navigateBack({
|
delta: 1, //返回的页面数,如果为1表示返回上一页
|
success: (event) => {
|
beforePage.$vm.reload()
|
}
|
});
|
}
|
})
|
}else{
|
this.$refs.uToast.show({
|
message: '有检验项目值未录入完全!',
|
type: 'error'
|
})
|
}
|
}
|
},
|
|
//生产检验资料
|
generate() {
|
generateIqcInfo(this.item.RELEASE_NO).then(res => {
|
if (!res.result) {
|
this.$refs.uToast.show({
|
message: res.msg,
|
type: 'error'
|
})
|
return
|
} else {
|
this.$refs.uToast.show({
|
message: "更新成功",
|
type: 'success'
|
})
|
this.table.splice(0, this.table.length)
|
this.getInspection(this.item.RELEASE_NO)
|
}
|
})
|
},
|
|
//查询检验单关联条码
|
/*selectBarcode(){
|
getIqcBarCode(this.item.RELEASE_NO).then(res => {
|
if(!res.result) {
|
this.$refs.uToast.show({
|
message: res.msg,
|
type: 'error'
|
})
|
return
|
}
|
this.barcode=res.data
|
console.log(this.barcode)
|
})
|
this.barcodeShow=true
|
},*/
|
|
//提交前判断是否录入完成
|
check() {
|
try{
|
this.table.forEach(item=>{
|
if (item.TOTAL != null && item.TOTAL !=item.YL ) {
|
throw new Error()
|
}
|
})
|
return true
|
}catch(e){
|
return false
|
}
|
},
|
|
drawingConfirm(){
|
this.drawingShow=false
|
},
|
drawingCancel(){
|
this.drawingShow=false
|
},
|
//调取图纸按钮
|
fetchDrawingNumber() {
|
const item = this.item.ITEM_NO;
|
console.log(item);
|
const url = "http://localhost:10054/api/PLM/RetrieveDrawings?ItemNo="+item
|
uni.request({
|
url: url,
|
method: 'POST',
|
success: (response) => {
|
this.drawing=response.data.data
|
console.log(this.drawing)
|
},
|
fail: (error) => {
|
console.log(error)
|
uni.showToast({
|
title: '请求图纸链接失败',
|
icon: 'none'
|
});
|
}
|
});
|
this.drawingShow=true
|
},
|
|
//图纸相关文档
|
openDrawings(item){
|
if (item.fRelevantObject.length>2) {
|
console.log(item);
|
const url = "http://localhost:10054/api/PLM/OpenDrawings?fileId="+item.fRelevantObject+'&fName='+ encodeURIComponent(item.fName.replace(/\%/g, '%25').replace(/\ /g,'%20').replace(/\#/g,'%23').replace(/\?/g,'%3F').replace(/\+/g,'%2B').replace(/\//g,'%2F').replace(/\&/g,'%26'))
|
uni.request({
|
url: url,
|
method: 'POST',
|
responseType: 'arraybuffer',
|
success: (response) => {
|
console.log(response.data)
|
if(!response){
|
uni.showToast({
|
title:"协议预览失败",
|
duration:2000
|
});
|
}
|
let pdfData = response.data; //pdfData是后端返回的文件流
|
let blob = new Blob([pdfData], { type: 'application/pdf;charset=UTF-8' })
|
pdfData = window.URL.createObjectURL(blob) //创建预览路径
|
this.agreementUrl = encodeURIComponent(pdfData)
|
uni.navigateTo({
|
url: '/pages/pdfView/pdfView?url=' + this.agreementUrl
|
})
|
},
|
fail: (error) => {
|
console.log(error)
|
uni.showToast({
|
title: '请求预览链接失败',
|
icon: 'none'
|
});
|
}
|
});
|
}else{
|
uni.showToast({
|
title: '无对应PDF文件,打开失败',
|
icon: 'none'
|
});
|
}
|
},
|
|
closeModal() {
|
this.pdfVisible = false;
|
}
|
},
|
}
|
</script>
|
|
<style>
|
.wrap {
|
padding: 12px;
|
}
|
|
.demo-layout {
|
height: 25px;
|
border-radius: 4px;
|
}
|
|
.bg-purple {
|
background: #CED7E1;
|
}
|
|
.bg-purple-light {
|
background: #e5e9f2;
|
}
|
|
.bg-purple-dark {
|
background: #99a9bf;
|
}
|
|
.text {
|
font-size: x-large;
|
}
|
|
.red {
|
color: red;
|
}
|
|
|
.modal {
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
position: absolute;
|
top: 10%;
|
left: 0;
|
width: 100%;
|
height: 100%;
|
background-color: rgba(0, 0, 0, 0.5);
|
z-index: 1000;
|
}
|
|
.modal-content {
|
background-color: white;
|
padding: 20px;
|
border-radius: 10px;
|
width: 80%;
|
height: 80%;
|
}
|
|
.pdf-view {
|
width: 100%;
|
height: 100%;
|
}
|
|
.judge .u-modal{
|
width: 500px !important;
|
}
|
.judge .u-modal__content {
|
font-size: 30px;
|
height: 200px;
|
padding: initial;
|
align-items: center;
|
flex-direction: column;
|
justify-content: start;
|
}
|
.judge .u-modal__button-group{
|
align-items: center;
|
height: 70px;
|
}
|
.judge .bjq .u-number-box__input{
|
height: 100px !important;
|
width: 230px !important;
|
font-size: 70px;
|
}
|
.judge .bjq .u-number-box__minus{
|
height: 100px !important;
|
width: 100px;
|
}
|
.judge .bjq .u-number-box__plus{
|
height: 100px !important;
|
width: 100px;
|
}
|
|
.container button {
|
background-color: #4CAF50;
|
color: white;
|
border: none;
|
padding: 10px 20px;
|
text-align: center;
|
text-decoration: none;
|
display: inline-block;
|
font-size: 16px;
|
margin: 4px 2px;
|
cursor: pointer;
|
}
|
|
.container button:hover {
|
background-color: #45a049;
|
}
|
.click-wd{
|
color: #056cba;
|
font-size: 1.25rem;
|
text-decoration: underline;
|
}
|
</style>
|