<template>
|
<div class="forInspectionDetail-main">
|
<div class="for-inspction-detail-header">
|
<div class="header-left">报检编号:</div>
|
<div class="header-right">
|
<el-form class="rightBtn" :inline="true">
|
<el-form-item class="createBtn">
|
<el-button type="error" icon="el-icon-plus">作废申请</el-button>
|
</el-form-item>
|
<el-form-item class="getDataBtn">
|
<el-button type="primary" icon="el-icon-download">提交申请</el-button>
|
</el-form-item>
|
</el-form>
|
</div>
|
</div>
|
<div class="content-main">
|
<div class="card-main">
|
<div class="tips-main">
|
<div class="tips">
|
<span />
|
<div>基本信息</div>
|
</div>
|
<!-- <div class="tips-btn">
|
<span><i class="el-icon-edit" />操作:</span>
|
<el-button type="text">编辑</el-button>
|
</div> -->
|
</div>
|
<div class="message">
|
<!-- <div class="message-item"><span><i class="el-icon-edit" />试验方法:</span></div> -->
|
<div class="message-item">
|
<span><i class="el-icon-edit" />检验类型:
|
<span v-if="inspectionDetail.type===0">原材料检验</span>
|
<span v-else-if="inspectionDetail.type===1">半成品检验</span>
|
<span v-else-if="inspectionDetail.type===2">成品检验</span>
|
</span>
|
</div>
|
<div class="message-item">
|
<span><i class="el-icon-edit" />登记人:<el-tag>{{ inspectionDetail.userName }}</el-tag></span></div>
|
<div class="message-item">
|
<span><i class="el-icon-edit" />登记日期:{{ inspectionDetail.createTime }}</span></div>
|
</div>
|
</div>
|
<div class="card-main sample-list">
|
<div class="tips-main">
|
<div class="tips">
|
<span />
|
<div>样品相关</div>
|
</div>
|
<div class="tips-btn" :style="{marginBottom: '10px'}">
|
<!-- <span><i class="el-icon-edit" />操作:</span> -->
|
<el-button type="primary" icon="el-icon-download" @click="addSampleVisible = true">添加样品</el-button>
|
</div>
|
</div>
|
<div class="table-box">
|
<el-table
|
ref="sampleTable"
|
:max-height="800"
|
:cell-style="{textAlign: 'center'}"
|
:header-cell-style="{border:'0px',background:'#f5f7fa',color:'#606266',boxShadow: 'inset 0 1px 0 #ebeef5',textAlign: 'center'}"
|
:data="sampleTable"
|
style="width: 100%"
|
>
|
<el-table-column
|
prop="materialNum"
|
label="物料编号"
|
min-width="200"
|
/>
|
<el-table-column
|
prop="materialName"
|
label="物料名称"
|
min-width="200"
|
/>
|
<el-table-column
|
prop="objectofInspection"
|
label="物料属性"
|
min-width="200"
|
/>
|
<el-table-column
|
prop="materialBatch"
|
label="批次"
|
min-width="200"
|
/>
|
<el-table-column
|
prop="materialReelNumber"
|
label="盘号"
|
min-width="200"
|
/>
|
<el-table-column
|
prop="specificationsSerialNumber"
|
label="型号"
|
min-width="200"
|
/>
|
<el-table-column
|
prop="registrant"
|
label="规格"
|
min-width="200"
|
/>
|
<el-table-column
|
prop="applicationTime"
|
label="入库数量"
|
min-width="200"
|
/>
|
<el-table-column
|
prop="materialNum"
|
label="送样数量"
|
min-width="200"
|
/>
|
<el-table-column
|
label="操作"
|
min-width="200"
|
fixed="right"
|
>
|
<template slot-scope="scope">
|
<el-button type="text" size="small" @click="openChangeMaterial(scope.row)">编辑</el-button>
|
<el-button type="text" size="small">删除</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
<!-- 分页器 -->
|
<div>
|
<el-pagination
|
:current-page="pageParams.pageNo"
|
:page-sizes="[10, 20, 30, 40]"
|
:page-size="pageParams.pageSize"
|
layout="total, sizes, prev, pager, next, jumper"
|
/>
|
</div>
|
</div>
|
|
</div>
|
</div>
|
<el-drawer
|
title="新增样品"
|
:visible.sync="addSampleVisible"
|
:direction="direction"
|
size="50%"
|
>
|
<div class="demo-drawer__content">
|
<el-form label-position="top" label-width="120px" :model="addSampleFrom">
|
<el-form-item>
|
<el-button type="primary" @click="chooseMaterialVisible = true">选择物料</el-button>
|
</el-form-item>
|
<div class="materialParams-card">
|
<el-row class="materialParams-top">
|
<el-col :span="12">
|
<el-form-item>
|
<el-input placeholder="--">
|
<template slot="prepend">物料编号</template>
|
</el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item>
|
<el-input placeholder="--">
|
<template slot="prepend">物料名称</template>
|
</el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row class="materialParams-bottom">
|
<el-col :span="12">
|
<el-form-item>
|
<el-input placeholder="--">
|
<template slot="prepend">物料规格</template>
|
</el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item>
|
<el-input placeholder="--">
|
<template slot="prepend">供应商 </template>
|
</el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
</div>
|
<el-row :gutter="100" :style="{marginTop:'24px'}">
|
<el-col :span="12">
|
<el-form-item label="批次">
|
<el-input placeholder="" />
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="数量">
|
<el-input placeholder="" />
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row :gutter="100">
|
<el-col :span="12">
|
<el-form-item label="盘号">
|
<el-input placeholder="" />
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="存放地">
|
<el-input placeholder="" />
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row :gutter="100">
|
<el-col :span="12">
|
<el-form-item label="规格/型号名称">
|
<el-input placeholder="" />
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="主线心截面">
|
<el-input placeholder="" />
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row :gutter="100">
|
<el-col :span="12">
|
<el-form-item label="生产指令号">
|
<el-input placeholder="" />
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="主线芯芯数">
|
<el-input placeholder="" />
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row :gutter="100">
|
<el-col :span="12">
|
<el-form-item label="电压等级">
|
<el-input placeholder="" />
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row :gutter="100" :style="{flex:'1'}">
|
<el-col :span="24">
|
<el-form-item label="备注">
|
<el-input
|
type="textarea"
|
rows="2"
|
placeholder="请输入内容"
|
/>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-form-item>
|
<el-button type="primary">立即创建</el-button>
|
<el-button>取消</el-button>
|
</el-form-item>
|
</el-form>
|
</div>
|
</el-drawer>
|
<el-dialog title="选择物料" :visible.sync="chooseMaterialVisible">
|
<div class="dialog-content">
|
<!-- Left side tree structure -->
|
<div class="tree-container">
|
<span class="all"> 全部</span>
|
<el-tree :data="treeData" />
|
</div>
|
<!-- Right side material list -->
|
<div class="table-container">
|
<el-table
|
ref="todoListRef"
|
:data="selectedNodeMaterials"
|
style="width: 100%"
|
highlight-current-row
|
:header-row-class-name="headerBg"
|
@row-click="handleSelectionChange"
|
>
|
<el-table-column
|
label="物料编号"
|
prop="number"
|
>
|
<template slot-scope="scope">
|
<el-radio v-model="radioSelected" :label="scope.row.number" @change.native="handleSelectionChange(scope.row)"> </el-radio>
|
</template>
|
</el-table-column>
|
<el-table-column prop="name" label="物料名称" />
|
</el-table>
|
<el-pagination
|
:current-page="pageParams.pageNo"
|
:page-sizes="[10, 20, 30, 40]"
|
:page-size="pageParams.pageSize"
|
:total="pageParams.total"
|
layout="total, sizes, prev, pager, next, jumper"
|
@size-change="handleSizeChange"
|
@current-change="handleCurrentChange"
|
/>
|
</div>
|
</div>
|
<div slot="footer" class="dialog-footer">
|
<el-button @click="chooseMaterialVisible = false">取 消</el-button>
|
<el-button type="primary">确定选择</el-button>
|
</div>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
import { getInspectionMaterialListById } from '@/api/rawMaterials/reportForInspection'
|
export default {
|
data() {
|
return {
|
sampleTable: [],
|
pageParams: {
|
pageNo: 1,
|
pageSize: 1,
|
total: 3
|
},
|
addSampleVisible: false,
|
chooseMaterialVisible: false,
|
direction: 'rtl',
|
addSampleFrom: {},
|
treeData: [{
|
id: 1,
|
label: '一级 1',
|
children: [{
|
id: 4,
|
label: '二级 1-1',
|
children: [{
|
id: 9,
|
label: '三级 1-1-1'
|
}, {
|
id: 10,
|
label: '三级 1-1-2'
|
}]
|
}]
|
}, {
|
id: 2,
|
label: '一级 2',
|
children: [{
|
id: 4,
|
label: '二级 2-1',
|
children: [{
|
id: 9,
|
label: '三级 2-1-1'
|
}, {
|
id: 10,
|
label: '三级 2-1-2'
|
}]
|
}]
|
|
}],
|
selectedNodeMaterials: [
|
{
|
number: '12345',
|
name: '测试数据1'
|
},
|
{
|
number: 'Y111111',
|
name: '测试数据2'
|
}],
|
radioSelected: null,
|
multipleSelection: '',
|
inspectionDetail: {}
|
}
|
},
|
created() {
|
// console.log(this.$route.query) 传递的申请单对象详情
|
this.inspectionDetail = JSON.parse(this.$route.query.inspectionDetail)
|
this.getMaterialList()
|
},
|
methods: {
|
openChangeMaterial(row) {
|
console.log(row)
|
},
|
async getMaterialList() {
|
const res = await getInspectionMaterialListById({ inspectionId: this.inspectionDetail.id })
|
// console.log(res)
|
this.sampleTable = res.data
|
},
|
handleSelectionChange(val) {
|
console.log(val)
|
this.radioSelected = val.number // 选中行的number
|
this.multipleSelection = val // 选中的一行数据
|
},
|
handleSizeChange(pageSize) {
|
this.pageParams.pageSize = pageSize
|
},
|
handleCurrentChange(pageNo) {
|
this.pageParams.pageNo = pageNo
|
},
|
headerBg({ row, rowIndex }) {
|
console.log('rowIndex', rowIndex)
|
if (rowIndex === 0) {
|
return 'headerBgClass'
|
}
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.dialog-content{
|
display: flex;
|
.tree-container{
|
flex: 30%;
|
// background-color: #bfa;
|
margin-right: 12px;
|
margin-left: 12px;
|
.all{
|
display: block;
|
color: #0077DB;
|
padding: 5px;
|
}
|
}
|
.table-container{
|
flex: 70%;
|
// background-color: #0077DB;
|
margin-left: 12px;
|
.el-table{
|
.el-table__header_wrapper{
|
.has-gutter{
|
.headerBgClass{
|
background-color: #606266;
|
}
|
}
|
}
|
}
|
.el-pagination{
|
margin-top: 12px;
|
}
|
}
|
}
|
.forInspectionDetail-main{
|
min-height: calc(100vh - 88px);
|
display: flex;
|
flex-direction: column;
|
}
|
.for-inspction-detail-header{
|
width: 100%;
|
background: #fff;
|
// height: 42px;
|
display: flex;
|
border-bottom: 1px solid #f0f2f5;
|
padding: 8px 24px 12px 24px;
|
justify-content: space-between;
|
align-items: center;
|
.header-left{
|
font-size: 20px;
|
color: #303133;
|
}
|
.header-right{
|
.el-form-item{
|
margin-bottom: 0px !important;
|
}
|
.rightBtn {
|
display: flex;
|
justify-content: flex-end;
|
}
|
}
|
}
|
.content-main{
|
display: flex;
|
flex: 1;
|
flex-direction: column;
|
.sample-list{
|
flex: 1;
|
display: flex;
|
flex-direction: column;
|
.table-box{
|
padding: 20px;
|
flex: 1;
|
display: flex;
|
flex-direction: column;
|
.el-table{
|
flex: 1;
|
display: flex;
|
flex-direction: column;
|
::v-deep .el-table__body-wrapper{
|
flex: 1 !important;
|
}
|
}
|
>div:nth-child(2){
|
display: flex;
|
justify-content: end;
|
margin: 10px 0;
|
}
|
}
|
}
|
.card-main{
|
background: #fff;
|
// padding: 10px 20px 10px 20px;
|
margin: 0;
|
margin-bottom: 12px;
|
border-radius: 6px;
|
overflow: hidden;
|
.tips-main{
|
// margin: ;
|
padding: 10px 20px 0px 20px;
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
height: 50px;
|
// height: ;
|
&:hover{
|
background: #85bff810;
|
.tips-btn{
|
display: block;
|
left: 0;
|
opacity:1;
|
}
|
}
|
.tips-btn{
|
height: 100%;
|
// display: none;
|
position: relative;
|
opacity:0;
|
left: 100px;
|
transition: all 0.3s ease-in-out;
|
}
|
.tips{
|
height: 100%;
|
display: flex;
|
height: 24px;
|
align-items: center;
|
font-size: 16px;
|
// margin-bottom: 12px;
|
>span{
|
display: inline-block;
|
margin-right: 10px;
|
width: 4px;
|
height: 16px;
|
background: #0077DB;
|
}
|
>div{
|
height: 100%;
|
line-height: 26px;
|
}
|
.el-button{
|
padding: 0;
|
}
|
}
|
}
|
|
// 基本信息和企业信息的每一个信息项样式
|
.message{
|
padding: 0px 20px 10px 20px;
|
|
display: flex;
|
flex-wrap: wrap;
|
border-top: 1px solid #F2F6FC;
|
// border-top: 1px solid #F2F6FC;
|
>div{
|
flex: 50%;
|
max-width: 50%;
|
padding: 8px;
|
color: #606266;
|
align-items: center;
|
// height: 65px;
|
font-size: 12px;
|
height: 52px;
|
display: flex;
|
align-items: center;
|
>span{
|
color: #303133;
|
font-size: 16px;
|
//
|
>i{
|
margin-right: 8px;
|
}
|
}
|
}
|
// >div:nth-child(5){
|
// flex: 60%;
|
// max-width: 60%;
|
// }
|
}
|
}
|
}
|
|
.demo-drawer__content{
|
padding: 24px;
|
height: 100%;
|
.el-form{
|
height: 100%;
|
display: flex;
|
flex-direction: column;
|
}
|
::v-deep .el-textarea__inner{
|
max-height: 100px !important;
|
}
|
::v-deep .el-form--label-top .el-form-item__label{
|
padding: 0px !important;
|
}
|
.materialParams-card{
|
box-shadow: rgba(100, 100, 111, 0.2) 0px 5px 15px;
|
// box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
|
// box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
|
::v-deep .el-form-item{
|
.el-form-item__content{
|
margin-left:0px !important;
|
}
|
}
|
::v-deep .el-input{
|
>div{
|
width: 120px;
|
text-align: center;
|
}
|
}
|
}
|
.materialParams-bottom{
|
.el-form-item{
|
margin-bottom: 0px !important;
|
::v-deep .el-input{
|
>div,>input{
|
border-bottom: 0px !important;
|
border-left: 0px !important;
|
border-right: 0px !important;
|
// border-top: 1px solid #DCDFE6;
|
border-radius: 0px !important;
|
}
|
}
|
}
|
}
|
.materialParams-top{
|
.el-form-item{
|
margin-bottom: 0px !important;
|
::v-deep .el-input{
|
>div,>input{
|
border: 0px !important;
|
border-radius: 0px !important;
|
}
|
}
|
}
|
.el-col:nth-child(1){
|
//
|
::v-deep .el-input{
|
>div,>input{
|
border-bottom: 0px !important;
|
border-right: 0px !important;
|
border-radius: 0px !important;
|
}
|
}
|
}
|
}
|
}
|
|
</style>
|