@ -3,14 +3,14 @@
< j -form -container :disabled ="formDisabled" >
< a -form :form ="form" slot = "detail" >
< a -row >
< a -col :span ="8" >
< a -form -item label = "流程表单号" :labelCol ="labelCol" :wrapperCol ="wrapperCol" >
< a -input v -decorator = " [ ' processId ' ] " placeholder = "请输入流程表单号" / >
< / a - f o r m - i t e m >
< / a - c o l >
<!-- < a -col :span ="8" > -- >
<!-- < a -form -item label = "流程表单号" :labelCol ="labelCol" :wrapperCol ="wrapperCol" > -- >
<!-- < a -input v -decorator = " [ ' processId ' ] " placeholder = "请输入流程表单号" / > -- >
<!-- < / a - f o r m - i t e m > - - >
<!-- < / a - c o l > - - >
< a -col :span ="8" >
< a -form -item label = "供应商" :labelCol ="labelCol" :wrapperCol ="wrapperCol" >
< a -input v -decorator = " [ ' supplierId ' ] " placeholder = "请输入供应商" / >
< a -input v -decorator = " [ ' supplierId ' ] " placeholder = "请输入供应商" disabled / >
< / a - f o r m - i t e m >
< / a - c o l >
<!-- < a -col :span ="8" > -- >
@ -20,16 +20,40 @@
<!-- < / a - c o l > - - >
< a -col :span ="8" >
< a -form -item label = "物料组" :labelCol ="labelCol" :wrapperCol ="wrapperCol" >
< a -input v -decorator = " [ ' descriptionId ' ] " type = "list" :trigger-change ="true" placeholder = "请输入物料组" / >
< a -input v -decorator = " [ ' descriptionId ' ] " type = "list" :trigger-change ="true" placeholder = "请输入物料组" disabled / >
<!-- < a -select v -decorator = " [ ' descriptionId ' ] " placeholder = "请选择物料组" > -- >
<!-- < a -select -option v-for ="(item,index) in bigId" :key="index" :value="item.itemGroup" > {{ item.itemGroup }} < / a -select -option > -- >
<!-- < / a - s e l e c t > - - >
< / a - f o r m - i t e m >
< / a - c o l >
< a -col :span ="8" >
< a -form -item label = "物料号" :labelCol ="labelCol" :wrapperCol ="wrapperCol" >
< a -input v -decorator = " [ ' materialsNumber ' ] " type = "list" :trigger-change ="true" placeholder = "请输入物料组" disabled / >
<!-- < a -select v -decorator = " [ ' descriptionId ' ] " placeholder = "请选择物料组" > -- >
<!-- < a -select -option v-for ="(item,index) in bigId" :key="index" :value="item.itemGroup" > {{ item.itemGroup }} < / a -select -option > -- >
<!-- < / a - s e l e c t > - - >
< / a - f o r m - i t e m >
< / a - c o l >
< a -col :span ="8" >
< a -form -item label = "物料名称" :labelCol ="labelCol" :wrapperCol ="wrapperCol" >
< a -input v -decorator = " [ ' merchandiseNewsId ' ] " type = "list" :trigger-change ="true" placeholder = "请输入物料" / >
<!-- < a -input v -decorator = " [ ' merchandiseNewsId ' ] " type = "list" :trigger-change ="true" placeholder = "请输入物料" @change ="getActions" / > -- >
< a -select
show - search
placeholder = "请输入物料名称"
option - filter - prop = "children"
style = "width: 273px "
@ search = "getActions($event)"
@ focus = "handleFocus"
@ blur = "handleBlur"
@ change = "handleChange"
v - decorator = "['merchandiseNewsId',validatorRules.merchandiseNewsId]"
>
< a -select -option v-for ="(item,index) in bigId" :key="index" :value="item.id" > {{ item.merchandiseName }} < / a -select -option >
<!-- : filter - option = "filterOption" -- >
< / a - s e l e c t >
< / a - f o r m - i t e m >
< / a - c o l >
<!-- < a -col :span ="8" > -- >
@ -39,34 +63,39 @@
<!-- < / a - c o l > - - >
< a -col :span ="8" >
< a -form -item label = "计量单位(只 )" :labelCol ="labelCol" :wrapperCol ="wrapperCol" >
< a -input v -decorator = " [ ' unitMeasurement ' ] " type = "list" :trigger-change ="true" placeholder = "请输入计量单位" / >
< / a - f o r m - i t e m >
< / a - c o l >
< a -col :span ="8" >
< a -form -item label = "数量" :labelCol ="labelCol" :wrapperCol ="wrapperCol" >
< a -input v -decorator = " [ ' materialQuantity ' ] " placeholder = "请输入数量" / >
< a -input v -decorator = " [ ' unitMeasurement ' ] " type = "list" :trigger-change ="true" placeholder = "请输入计量单位" disabled / >
< / a - f o r m - i t e m >
< / a - c o l >
< a -col :span ="8" >
< a -form -item label = "单价(元) " :labelCol ="labelCol" :wrapperCol ="wrapperCol" >
< a -input v -decorator = " [ ' materialPrice ' ] " placeholder = "请输入单价(元)" / >
< a -form -item label = "批次" :labelCol ="labelCol" :wrapperCol ="wrapperCol" >
< a -input v -decorator = " [ ' supplierBatch ' ] " type = "list" :trigger-change ="true" placeholder = "请选择批次" / >
< / a - f o r m - i t e m >
< / a - c o l >
< a -col :span ="8" >
< a -form -item label = "金额(元) " :labelCol ="labelCol" :wrapperCol ="wrapperCol" >
< a -input v -decorator = " [ ' rates ' ] " placeholder = "请输入金额(元) " / >
< a -form -item label = "数量 " :labelCol ="labelCol" :wrapperCol ="wrapperCol" >
< a -input v -decorator = " [ ' materialQuantity ' , validatorRules.materialQuantity ] " placeholder = "请输入数量" @change ="getNum " / >
< / a - f o r m - i t e m >
< / a - c o l >
< a -col :span ="8" >
< a -form -item label = "仓储地点 " :labelCol ="labelCol" :wrapperCol ="wrapperCol" >
< a -input v -decorator = " [ ' unitWasteWarehouseCodeId ' ] " type = "list" :trigger-change ="true" placeholder = "请选择仓储地点" / >
< a -form -item label = "单价(元) " :labelCol ="labelCol" :wrapperCol ="wrapperCol" >
< a -input v -decorator = " [ ' materialPrice ' , validatorRules.materialPrice ] " placeholder = "请输入单价(元)" @change ="getPrice" / >
< / a - f o r m - i t e m >
< / a - c o l >
< a -col :span ="8" >
< a -form -item label = "存储仓位 " :labelCol ="labelCol" :wrapperCol ="wrapperCol" >
< a -input v -decorator = " [ ' freightSpace ' ] " ty pe= "list" :trigger-change ="true" placeholder = "请选择储存仓位" / >
< a -form -item label = "金额(元) " :labelCol ="labelCol" :wrapperCol ="wrapperCol" >
< a -input v -decorator = " [ ' rates ' ] " plac eholder = "请输入金额(元)" disabled / >
< / a - f o r m - i t e m >
< / a - c o l >
<!-- < a -col :span ="8" > -- >
<!-- < a -form -item label = "仓储地点" :labelCol ="labelCol" :wrapperCol ="wrapperCol" > -- >
<!-- < a -input v -decorator = " [ ' unitWasteWarehouseCodeId ' ] " type = "list" :trigger-change ="true" placeholder = "请选择仓储地点" / > -- >
<!-- < / a - f o r m - i t e m > - - >
<!-- < / a - c o l > - - >
<!-- < a -col :span ="8" > -- >
<!-- < a -form -item label = "存储仓位" :labelCol ="labelCol" :wrapperCol ="wrapperCol" > -- >
<!-- < a -input v -decorator = " [ ' freightSpace ' ] " type = "list" :trigger-change ="true" placeholder = "请选择储存仓位" / > -- >
<!-- < / a - f o r m - i t e m > - - >
<!-- < / a - c o l > - - >
< a -col :span ="8" >
< a -form -item label = "生产时间" :labelCol ="labelCol" :wrapperCol ="wrapperCol" >
< j -date placeholder = "请选择生产时间" v -decorator = " [ ' productionTime ' ] " :trigger-change ="true" style = "width: 100%" / >
@ -74,38 +103,38 @@
< / a - c o l >
< a -col :span ="8" >
< a -form -item label = "保质期" :labelCol ="labelCol" :wrapperCol ="wrapperCol" >
< a -input placeholder = "请选择保质期" v -decorator = " [ ' expirationDate ' ] " :trigger-change ="true" / >
< / a - f o r m - i t e m >
< / a - c o l >
< a -col :span ="8" >
< a -form -item label = "批次" :labelCol ="labelCol" :wrapperCol ="wrapperCol" >
< a -input v -decorator = " [ ' supplierBatch ' ] " type = "list" :trigger-change ="true" placeholder = "请选择批次" / >
< / a - f o r m - i t e m >
< / a - c o l >
< a -col :span ="8" >
< a -form -item label = "到货情况" :labelCol ="labelCol" :wrapperCol ="wrapperCol" >
<!-- < a -input v -decorator = " [ ' arrivalNotice ' ] " dict = "" placeholder = "请选择到货情况" / > -- >
< a -select v -decorator = " [ ' arrivalNotice ' ] " placeholder = "请选择到货情况" >
< a -select -option v-for ="(item,index) in bigId" :key="index" :value="item.arrivalNotice" > {{ item.arrivalNotice }} < / a -select -option >
< / a - s e l e c t >
< / a - f o r m - i t e m >
< / a - c o l >
< a -col :span ="8" >
< a -form -item label = "入库时间" :labelCol ="labelCol" :wrapperCol ="wrapperCol" >
< j -date placeholder = "请选择入库时间" v -decorator = " [ ' storageTime ' ] " :trigger-change ="true" style = "width: 100%" / >
< / a - f o r m - i t e m >
< / a - c o l >
< a -col :span ="8" >
< a -form -item label = "入库人" :labelCol ="labelCol" :wrapperCol ="wrapperCol" >
<!-- < a -input v -decorator = " [ ' librarySign ' ] " type = "list" :trigger-change ="true" placeholder = "请选择入库人" / > -- >
< a -select v -decorator = " [ ' librarySign ' ] " placeholder = "请选择入库人" >
< a -select -option v-for ="(item,index) in bigId" :key="index" :value="item.librarySign" > {{ item.librarySign }} < / a -select -option >
< / a - s e l e c t >
< a -input placeholder = "请填写保质期" v -decorator = " [ ' expirationDate ' ] " :trigger-change ="true" / >
< / a - f o r m - i t e m >
< / a - c o l >
<!-- < a -col :span ="8" > -- >
<!-- < a -form -item label = "到货情况" :labelCol ="labelCol" :wrapperCol ="wrapperCol" > -- >
<!-- & lt ; ! & ndash ; < a -input v -decorator = " [ ' arrivalNotice ' ] " dict = "" placeholder = "请选择到货情况" / > & ndash ; & gt ; -- >
<!-- < a -select v -decorator = " [ ' arrivalNotice ' ] " placeholder = "请选择到货情况" > -- >
<!-- < a -select -option v-for ="(item,index) in bigId" :key="index" :value="item.arrivalNotice" > {{ item.arrivalNotice }} < / a -select -option > -- >
<!-- < / a - s e l e c t > - - >
<!-- < / a - f o r m - i t e m > - - >
<!-- < / a - c o l > - - >
<!-- < a -col :span ="8" > -- >
<!-- < a -form -item label = "入库时间" :labelCol ="labelCol" :wrapperCol ="wrapperCol" > -- >
<!-- < j -date placeholder = "请选择入库时间" v -decorator = " [ ' storageTime ' ] " :trigger-change ="true" style = "width: 100%" / > -- >
<!-- < / a - f o r m - i t e m > - - >
<!-- < / a - c o l > - - >
<!-- < a -col :span ="8" > -- >
<!-- < a -form -item label = "入库人" :labelCol ="labelCol" :wrapperCol ="wrapperCol" > -- >
<!-- < a -input v -decorator = " [ ' librarySign ' ] " :trigger-change ="true" placeholder = "请输入入库人" / > -- >
<!-- & lt ; ! & ndash ; < a -select v -decorator = " [ ' librarySign ' ] " placeholder = "请选择入库人" > & ndash ; & gt ; -- >
<!-- & lt ; ! & ndash ; < a -select -option v-for ="(item,index) in bigId" :key="index" :value="item.librarySign" > {{ item.librarySign }} < / a -select -option > & ndash ; & gt ; -- >
<!-- & lt ; ! & ndash ; < / a - s e l e c t > & n d a s h ; & g t ; - - >
<!-- < / a - f o r m - i t e m > - - >
<!-- < / a - c o l > - - >
< a -col :span ="8" >
< a -form -item label = "核算属性" :labelCol ="labelCol" :wrapperCol ="wrapperCol" >
< a -input v -decorator = " [ ' accountingAttributes ' ] " type = "list" :trigger-change ="true" placeholder = "请选择核算属性" / >
< a -form -item label = "物资类型" :labelCol ="labelCol" :wrapperCol ="wrapperCol" >
< j -dict -select -tag type = "list" v -decorator = " [ ' accountingAttributes ' , validatorRules.accountingAttributes ] "
: trigger - change = "true" dictCode = "material_type"
placeholder = "请选择物资类型" / >
<!-- < a -input v -decorator = " [ ' accountingAttributes ' ] " type = "list" :trigger-change ="true" placeholder = "请选择核算属性" / > -- >
< / a - f o r m - i t e m >
< / a - c o l >
< a -col v-if ="showFlowSubmitButton" :span="24" style="text-align: center" >
@ -161,20 +190,38 @@
bigId : [ ] ,
labelCol : {
xs : { span : 24 } ,
sm : { span : 5 } ,
sm : { span : 7 } ,
} ,
wrapperCol : {
xs : { span : 24 } ,
sm : { span : 16 } ,
} ,
confirmLoading : false ,
validatorRules : {
} ,
url : {
add : "/suppliesstronger/processSuppliesStronger/add" ,
edit : "/suppliesstronger/processSuppliesStronger/edit" ,
queryById : "/suppliesstronger/processSuppliesStronger/queryById"
}
queryById : "/suppliesstronger/processSuppliesStronger/queryById" ,
merchandiseNewsList : '/merchandisenews/processMerchandiseNews/merchandiseNewsList' ,
} ,
/ / 表 单 校 验
validatorRules : {
/ / ' b l u r ' 是 鼠 标 失 去 焦 点 的 时 候 会 触 发 验 证
accountingAttributes : { rules : [ { required : true , message : '请选择物资类型!' } ] } ,
merchandiseNewsId : { rules : [ { required : true , message : '请选择需求时间!' } ] } ,
materialQuantity : { rules : [ { required : true , message : '请输入数量!' } ] } ,
materialPrice : { rules : [ { required : true , message : '请输入单价!' } ] } ,
/ / p r o d u c t i o n T i m e : { r u l e s : [ { r e q u i r e d : t r u e , m e s s a g e : ' 请 选 择 生 产 时 间 ! ' } ] } ,
/ / n e e d T i m e : { r u l e s : [ { r e q u i r e d : t r u e , m e s s a g e : ' 请 选 择 需 求 时 间 ! ' } ] } ,
/ / n e e d T i m e : { r u l e s : [ { r e q u i r e d : t r u e , m e s s a g e : ' 请 选 择 需 求 时 间 ! ' } ] } ,
/ / n e e d T i m e : { r u l e s : [ { r e q u i r e d : t r u e , m e s s a g e : ' 请 选 择 需 求 时 间 ! ' } ] } ,
/ / p r o c e s s P l a n : { r u l e s : [ { r e q u i r e d : t r u e , m e s s a g e : ' 请 选 择 流 程 计 划 ! ' } ] } ,
/ / s o r t : {
/ / r u l e s : [ { r e q u i r e d : t r u e , t y p e : ' n u m b e r ' , m a x : 9 9 9 9 9 9 9 9 9 9 9 9 , m e s s a g e : ' 请 输 入 序 号 ! ( 0 ~ 1 2 个 数 字 ) ' }
/ / / / { t y p e : ' n u m b e r ' , m a x : 9 9 9 9 9 9 9 9 9 9 9 9 , m e s s a g e : ' 长 度 在 0 到 1 2 个 字 符 ' }
/ / / / { v a l i d a t o r : t h i s . l e n g t h C h e c k }
/ / ]
/ / }
} ,
}
} ,
computed : {
@ -199,8 +246,81 @@
created ( ) {
/ / 如 果 流 程 中 表 单 , 则 需 要 加 载 流 程 表 单 d a t a
this . showFlowData ( ) ;
this . getActions ( ) ;
} ,
methods : {
/ / 选 择 触 发
handleChange ( value ) {
/ / c o n s o l e . l o g ( ` s e l e c t e d $ { v a l u e } ` ) ;
this . bigId . forEach ( item => {
if ( item . id === value ) {
this . form . setFieldsValue ( {
descriptionId : item . materialClassify ,
supplierId : item . supplierId ,
unitMeasurement : item . materialsUnit ,
materialsNumber : item . materialsNumber ,
} )
}
} ) ;
} ,
handleBlur ( ) {
console . log ( 'blur' ) ;
} ,
handleFocus ( ) {
console . log ( 'focus' ) ;
} ,
filterOption ( input , option ) {
return (
option . componentOptions . children [ 0 ] . text . toLowerCase ( ) . indexOf ( input . toLowerCase ( ) ) >= 0
) ;
} ,
getNum ( e ) {
var sVal = e . target . value
/ / c o n s o l e . l o g ( " 数 量 " , s V a l ) ;
this . form . validateFields ( ( err , values ) => {
/ / 这 里 做 逻 辑 处 理
console . log ( values . materialPrice ) / / { u s e r n a m e : ' ' }
if ( ! ! values . materialPrice ) {
this . form . setFieldsValue ( {
rates : values . materialPrice * sVal
} )
}
} )
} ,
getPrice ( e ) {
var sVal = e . target . value
/ / c o n s o l e . l o g ( " 价 格 " , s V a l ) ;
this . form . validateFields ( ( err , values ) => {
/ / 这 里 做 逻 辑 处 理
console . log ( values . materialQuantity ) ; / / { u s e r n a m e : ' ' }
if ( ! ! values . materialQuantity ) {
this . form . setFieldsValue ( {
rates : values . materialQuantity * sVal
} )
}
} )
} ,
/ / 商 品 信 息
getActions ( e ) {
/ / v a r s V a l = e . t a r g e t . v a l u e
/ / c o n s o l e . l o g ( " r o w " , e ) ;
if ( ! ! e ) {
let par = {
delFlag : 0 ,
materialsNumber : e ,
/ / i d : i d
}
getAction ( this . url . merchandiseNewsList , par ) . then ( ( res ) => {
console . log ( '12312' , res . result ) ;
if ( res . success ) {
this . bigId = res . result ;
}
} )
}
} ,
add ( ) {
this . edit ( { } ) ;
} ,