@ -146,10 +146,10 @@
< / e l - f o r m >
< el -form :inline ="true" label -position = " top " :model ="modalData" :rules ="rules" style = "margin-left: 7px;margin-top: -5px;" >
< el -form -item prop = "methodNo" :rules ="rules.methodNoType" >
< span slot = "label" @click ="queryMethodList" > < a > 方法编码 < / a > < / span >
< span slot = "label" @click ="queryMethodList" > < a > 检验 方法编码< / a > < / span >
< el -input v-model ="modalData.methodNo" style="width: 143px" > < / el -input >
< / e l - f o r m - i t e m >
< el -form -item label = "方法名称" prop = "methodName" :rules ="rules.methodNameType" >
< el -form -item label = "检验 方法名称" prop = "methodName" :rules ="rules.methodNameType" >
< el -input v-model ="modalData.methodName" disabled style="width: 300px" > < / el -input >
< / e l - f o r m - i t e m >
< / e l - f o r m >
@ -171,6 +171,15 @@
< el -input v-model ="modalData.samplingLevelDesc" disabled style="width: 300px" > < / el -input >
< / e l - f o r m - i t e m >
< / e l - f o r m >
< el -form :inline ="true" label -position = " top " :model ="modalData" :rules ="rules" style = "margin-left: 7px;margin-top: -5px;" >
< el -form -item prop = "defectLevelCode" :rules ="rules.defectLevelCodeType" >
< span slot = "label" @click ="getBaseList(211)" > < a herf = "#" > 缺陷等级编码 < / a > < / span >
< el -input v-model ="modalData.defectLevelCode" style="width: 143px" > < / el -input >
< / e l - f o r m - i t e m >
< el -form -item label = "缺陷等级名称" prop = "defectLevelDescription" :rules ="rules.defectLevelDescriptionType" >
< el -input v-model ="modalData.defectLevelDescription" disabled style="width: 300px" > < / el -input >
< / e l - f o r m - i t e m >
< / e l - f o r m >
< el -form :inline ="true" label -position = " top " :model ="modalData" style = "margin-left: 7px;margin-top: -5px;" >
< el -form -item label = "参照值" >
< el -input v-model ="modalData.defaultValue" style="width: 143px" > < / el -input >
@ -191,35 +200,6 @@
< el -form -item label = "抽样比例%" >
< el -input v-model ="modalData.defaultSamplingProportion" type="number" style="width: 143px" > < / el -input >
< / e l - f o r m - i t e m >
< el -form -item label = " " style = "margin-left: 34px;margin-top: -5px" >
< el -checkbox v-model ="modalData.collectionFlag" true-label="Y" > 采集标记 < / el -checkbox >
< / e l - f o r m - i t e m >
< / e l - f o r m >
< el -form :inline ="true" label -position = " top " :model ="modalData" style = "margin-left: 7px;margin-top: -5px;" >
< el -form -item label = "采集数据来源" >
< el -select multiple v-model ="modalData.collectionSourceList" style="width: 160px" >
< el -option label = "值0" value = "value0" > < / e l - o p t i o n >
< el -option label = "值1" value = "value1" > < / e l - o p t i o n >
< el -option label = "值2" value = "value2" > < / e l - o p t i o n >
< el -option label = "值3" value = "value3" > < / e l - o p t i o n >
< el -option label = "值4" value = "value4" > < / e l - o p t i o n >
< el -option label = "值5" value = "value5" > < / e l - o p t i o n >
< el -option label = "值6" value = "value6" > < / e l - o p t i o n >
< el -option label = "值7" value = "value7" > < / e l - o p t i o n >
< el -option label = "值8" value = "value8" > < / e l - o p t i o n >
< el -option label = "值9" value = "value9" > < / e l - o p t i o n >
< / e l - s e l e c t >
< / e l - f o r m - i t e m >
< el -form -item label = "采集数据方式" >
< el -select multiple v-model ="modalData.collectionMethodList" style="width: 160px" >
< el -option label = "PLC" value = "plc" > < / e l - o p t i o n >
< el -option label = "文件" value = "file" > < / e l - o p t i o n >
< el -option label = "图片" value = "image" > < / e l - o p t i o n >
< / e l - s e l e c t >
< / e l - f o r m - i t e m >
< el -form -item label = "采集条件路径" >
< el -input v-model ="modalData.collectionCondition" style="width: 107px" > < / el -input >
< / e l - f o r m - i t e m >
< / e l - f o r m >
< el -footer style = "height:40px;margin-top: 20px;text-align:center" >
< el -button type = "primary" @click ="saveData()" > 保存 < / el -button >
@ -231,10 +211,10 @@
< el -dialog title = "检验方法清单" :close-on-click-modal ="false" v -drag :visible.sync ="methodModelFlag" width = "520px" >
< div class = "rq" >
< el -form :inline ="true" label -position = " top " :model ="methodData" >
< el -form -item :label ="'方法编码'" >
< el -form -item :label ="'检验 方法编码'" >
< el -input v-model ="methodData.methodNo" clearable style="width: 120px" > < / el -input >
< / e l - f o r m - i t e m >
< el -form -item :label ="'方法名称'" >
< el -form -item :label ="'检验 方法名称'" >
< el -input v-model ="methodData.methodName" clearable style="width: 120px" > < / el -input >
< / e l - f o r m - i t e m >
<!-- < el -form -item :label ="'检验类型'" > -- >
@ -373,12 +353,8 @@
samplingLevelNo : '' ,
samplingLevelDesc : '' ,
defaultSamplingProportion : '' ,
collectionFlag : '' ,
collectionSource : '' ,
collectionSourceList : [ ] ,
collectionMethod : '' ,
collectionMethodList : [ ] ,
collectionCondition : ''
defectLevelCode : '' ,
defectLevelDescription : ''
} ,
/ / 检 验 项 目 展 示 标 头
columnList : [
@ -749,7 +725,21 @@
message : ' ' ,
trigger : [ 'blur' , 'change' ]
}
]
] ,
defectLevelCodeType : [
{
required : true ,
message : ' ' ,
trigger : [ 'blur' , 'change' ]
}
] ,
defectLevelDescriptionType : [
{
required : true ,
message : ' ' ,
trigger : [ 'blur' , 'change' ]
}
] ,
} ,
options : [ ] ,
methodData : {
@ -871,6 +861,16 @@
this . $refs . baseList . init ( val , strVal , conSql )
}
}
if ( val === 211 ) {
strVal = this . modalData . defectLevelCode
if ( this . modalData . bu === null || this . modalData . bu === '' ) {
this . $message . warning ( "请选择BU!" )
return
} else {
conSql = " and bu_no = '" + this . modalData . bu . split ( '_' ) [ 1 ] + "'"
this . $refs . baseList . init ( val , strVal , conSql )
}
}
if ( val === 1036 ) {
strVal = this . modalData . methodNo
this . $refs . baseList . init ( val , strVal )
@ -917,6 +917,10 @@
this . modalData . samplingLevelNo = val . sampling_level_no
this . modalData . samplingLevelDesc = val . sampling_level_desc
}
if ( this . tagNo === 211 ) {
this . modalData . defectLevelCode = val . defect_level_code
this . modalData . defectLevelDescription = val . defect_level_description
}
} ,
/ / 获 取 数 据 列 表
@ -955,12 +959,8 @@
samplingLevelNo : '' ,
samplingLevelDesc : '' ,
defaultSamplingProportion : '' ,
collectionFlag : '' ,
collectionSource : '' ,
collectionSourceList : [ ] ,
collectionMethod : '' ,
collectionMethodList : [ ] ,
collectionCondition : ''
defectLevelCode : '' ,
defectLevelDescription : ''
}
this . modalDisableFlag = false
this . modalFlag = true
@ -990,12 +990,8 @@
samplingLevelNo : row . samplingLevelNo ,
samplingLevelDesc : row . samplingLevelDesc ,
defaultSamplingProportion : row . defaultSamplingProportion ,
collectionFlag : row . collectionFlag ,
collectionSource : row . collectionSource ,
collectionSourceList : row . collectionSource == null || row . collectionSource === '' ? [ ] : row . collectionSource . split ( ',' ) ,
collectionMethod : row . collectionMethod ,
collectionMethodList : row . collectionMethod == null || row . collectionMethod === '' ? [ ] : row . collectionMethod . split ( ',' ) ,
collectionCondition : row . collectionCondition
defectLevelCode : row . defectLevelCode ,
defectLevelDescription : row . defectLevelDescription
}
this . modalDisableFlag = true
this . modalFlag = true
@ -1048,32 +1044,14 @@
this . $message . warning ( '请选择检验方法!' )
return
}
/ / i f ( ( t h i s . m o d a l D a t a . s a m p l i n g P r o g r a m m e N o = = = ' ' | | t h i s . m o d a l D a t a . s a m p l i n g P r o g r a m m e N o = = n u l l ) & & ( t h i s . m o d a l D a t a . i t e m S a m p l i n g Q u a n t i t y = = = ' ' | | t h i s . m o d a l D a t a . i t e m S a m p l i n g Q u a n t i t y = = n u l l ) & & ( t h i s . m o d a l D a t a . d e f a u l t S a m p l i n g P r o p o r t i o n = = = ' ' | | t h i s . m o d a l D a t a . d e f a u l t S a m p l i n g P r o p o r t i o n = = n u l l ) ) {
/ / t h i s . $ m e s s a g e . w a r n i n g ( ' 抽 样 方 案 、 抽 样 数 量 、 抽 样 比 例 至 少 选 择 一 项 ! ' )
/ / r e t u r n
/ / }
if ( ( this . modalData . samplingProgrammeNo !== '' && this . modalData . samplingProgrammeNo != null ) && ( this . modalData . samplingLevelNo === '' || this . modalData . samplingLevelNo == null ) ) {
this . $message . warning ( '请选择检验水平!' )
return
}
if ( this . modalData . collectionFlag === 'Y' && ( this . modalData . collectionSourceList == null || this . modalData . collectionSourceList . length === 0 ) ) {
this . $message . warning ( '请选择采集数据来源!' )
return
}
if ( this . modalData . collectionFlag === 'Y' && ( this . modalData . collectionMethodList == null || this . modalData . collectionMethodList . length === 0 ) ) {
this . $message . warning ( '请选择采集数据方式!' )
return
}
if ( this . modalData . collectionFlag === 'Y' && this . modalData . collectionSourceList . length !== this . modalData . collectionMethodList . length ) {
this . $message . warning ( '采集数据来源和方式不对应!' )
return
}
if ( this . modalData . collectionFlag === 'Y' && ( this . modalData . collectionCondition == null || this . modalData . collectionCondition === '' ) ) {
this . $message . warning ( '请填写采集条件路径!' )
if ( this . modalData . defectLevelCode === '' || this . modalData . defectLevelCode == null ) {
this . $message . warning ( '请选择缺陷等级!' )
return
}
this . modalData . collectionSource = this . modalData . collectionSourceList . join ( ',' )
this . modalData . collectionMethod = this . modalData . collectionMethodList . join ( ',' )
if ( this . modalData . flag === '1' ) {
qcItemSave ( this . modalData ) . then ( ( { data } ) => {
if ( data && data . code === 0 ) {