@ -30,10 +30,77 @@
< / e l - f o r m >
< el -row >
< el -col :span ="12" >
< h4 class = "form-header h4" > 已选采购订单 < / h4 >
< el -form :model ="allocatePurchaseOrderQueryParams" ref = "allocateMaterialQueryForm" size = "small" :inline ="true"
v - show = "showSearch"
<!-- < el -col :span ="12" > -- >
<!-- < h4 class = "form-header h4" > 已选采购订单 < / h4 > -- >
<!-- < el -form :model ="allocatePurchaseOrderQueryParams" ref = "allocateMaterialQueryForm" size = "small" :inline ="true" - - >
<!-- v - show = "showSearch" -- >
<!-- label - width = "68px" > -- >
<!-- < el -form -item label = "订单编号" prop = "poNo" > -- >
<!-- < el -input - - >
<!-- v - model = "allocatePurchaseOrderQueryParams.poNo" -- >
<!-- placeholder = "请输入物料编码" -- >
<!-- style = "width:140px;" -- >
<!-- clearable -- >
<!-- @ keyup . enter . native = "handleAllocateMaterialQuery" -- >
<!-- / > - - >
<!-- < / e l - f o r m - i t e m > - - >
<!-- < el -form -item label = "物料编码" prop = "materialCode" > -- >
<!-- < el -input - - >
<!-- v - model = "allocatePurchaseOrderQueryParams.materialCode" -- >
<!-- placeholder = "请输入物料编码" -- >
<!-- style = "width:140px;" -- >
<!-- clearable -- >
<!-- @ keyup . enter . native = "handleAllocateMaterialQuery" -- >
<!-- / > - - >
<!-- < / e l - f o r m - i t e m > - - >
<!-- < el -form -item label = "物料名称" prop = "materialName" > -- >
<!-- < el -input - - >
<!-- v - model = "allocatePurchaseOrderQueryParams.materialName" -- >
<!-- placeholder = "请输入物料名称" -- >
<!-- style = "width:140px;" -- >
<!-- clearable -- >
<!-- @ keyup . enter . native = "handleAllocateMaterialQuery" -- >
<!-- / > - - >
<!-- < / e l - f o r m - i t e m > - - >
<!-- < el -form -item > -- >
<!-- < el -button type = "primary" icon = "el-icon-search" size = "mini" @click ="handleAllocateMaterialQuery" > 搜 索 - - >
<!-- < / e l - b u t t o n > - - >
<!-- < el -button icon = "el-icon-refresh" size = "mini" @click ="resetAllocateMaterialQuery" > 重 置 < / el -button > -- >
<!-- < el -button - - >
<!-- type = "danger" -- >
<!-- plain -- >
<!-- icon = "el-icon-delete" -- >
<!-- size = "mini" -- >
<!-- @ click = "handleUnallocateBarCodes" -- >
<!-- v - hasPermi = "['mes:saleOrder:bind']" -- >
<!-- > 删除 -- >
<!-- < / e l - b u t t o n > - - >
<!-- < / e l - f o r m - i t e m > - - >
<!-- < / e l - f o r m > - - >
<!-- < el -table v -loading = " allocateLoading " :data ="allocatePurchaseOrderList" - - >
<!-- @ selection - change = "handleAllocateMaterialSelectionChange" > -- >
<!-- < el -table -column type = "selection" width = "55" align = "center" / > -- >
<!-- < el -table -column label = "订单编号" align = "center" prop = "poNo" / > -- >
<!-- < el -table -column label = "物料编码" align = "center" prop = "materialCode" / > -- >
<!-- < el -table -column label = "物料名称" align = "center" prop = "materialName" / > -- >
<!-- < el -table -column label = "物料规格" align = "center" prop = "materialSpec" / > -- >
<!-- < el -table -column label = "规格参数" align = "center" prop = "specificationParameter" :show-overflow-tooltip ="true" / > -- >
<!-- < el -table -column label = "数量" align = "center" prop = "orderAmount" / > -- >
<!-- < / e l - t a b l e > - - >
<!-- < pagination - - >
<!-- v - show = "allocatePurchaseOrderTotal>0" -- >
<!-- : total = "allocatePurchaseOrderTotal" -- >
<!-- : page . sync = "allocatePurchaseOrderQueryParams.pageNum" -- >
<!-- : limit . sync = "allocatePurchaseOrderQueryParams.pageSize" -- >
<!-- @ pagination = "getAllocatePurchaseOrderList" -- >
<!-- / > - - >
<!-- < / e l - c o l > - - >
<!-- < el -col :span ="12" > -- >
< h4 class = "form-header h4" > 可选采购订单 < / h4 >
< el -form :model ="purchaseOrderQueryParams" ref = "materialQueryForm" size = "small" :inline ="true" v -show = " showSearch "
label - width = "68px" >
< el -form -item label = "订单编号" prop = "poNo" >
< el -input
@ -46,84 +113,35 @@
< / e l - f o r m - i t e m >
< el -form -item label = "物料编码" prop = "materialCode" >
< el -input
v - model = " allocateP urchaseOrderQueryParams.materialCode"
v - model = " p urchaseOrderQueryParams.materialCode"
placeholder = "请输入物料编码"
style = "width:140px;"
clearable
@ keyup . enter . native = "handle AllocateMaterial Query"
@ keyup . enter . native = "handle PurchaseOrder Query"
/ >
< / e l - f o r m - i t e m >
< el -form -item label = "物料名称" prop = "materialName" >
< el -input
v - model = " allocateP urchaseOrderQueryParams.materialName"
v - model = " p urchaseOrderQueryParams.materialName"
placeholder = "请输入物料名称"
style = "width:140px;"
clearable
@ keyup . enter . native = "handleAllocateMaterialQuery"
/ >
< / e l - f o r m - i t e m >
< el -form -item >
< el -button type = "primary" icon = "el-icon-search" size = "mini" @click ="handleAllocateMaterialQuery" > 搜 索
< / e l - b u t t o n >
< el -button icon = "el-icon-refresh" size = "mini" @click ="resetAllocateMaterialQuery" > 重 置 < / el -button >
< el -button
type = "danger"
plain
icon = "el-icon-delete"
size = "mini"
@ click = "handleUnallocateBarCodes"
v - hasPermi = "['mes:productOrder:bind']"
> 删除
< / e l - b u t t o n >
< / e l - f o r m - i t e m >
< / e l - f o r m >
< el -table v -loading = " allocateLoading " :data ="allocatePurchaseOrderList"
@ selection - change = "handleAllocateMaterialSelectionChange" >
< el -table -column type = "selection" width = "55" align = "center" / >
< el -table -column label = "订单编号" align = "center" prop = "poNo" / >
< el -table -column label = "物料编码" align = "center" prop = "materialCode" / >
< el -table -column label = "物料名称" align = "center" prop = "materialName" / >
< el -table -column label = "物料规格" align = "center" prop = "materialSpec" / >
< el -table -column label = "规格参数" align = "center" prop = "specificationParameter" :show-overflow-tooltip ="true" / >
< el -table -column label = "数量" align = "center" prop = "orderAmount" / >
< / e l - t a b l e >
< pagination
v - show = "allocatePurchaseOrderTotal>0"
: total = "allocatePurchaseOrderTotal"
: page . sync = "allocatePurchaseOrderQueryParams.pageNum"
: limit . sync = "allocatePurchaseOrderQueryParams.pageSize"
@ pagination = "getAllocatePurchaseOrderList"
/ >
< / e l - c o l >
< el -col :span ="12" >
< h4 class = "form-header h4" > 可选采购订单 < / h4 >
< el -form :model ="purchaseOrderQueryParams" ref = "materialQueryForm" size = "small" :inline ="true" v -show = " showSearch "
label - width = "68px" >
< el -form -item label = "订单编号" prop = "poNo" >
< el -input
v - model = "allocatePurchaseOrderQueryParams.poNo"
placeholder = "请输入物料编码"
style = "width:140px;"
clearable
@ keyup . enter . native = "handleAllocateMaterialQuery"
@ keyup . enter . native = "handlePurchaseOrderQuery"
/ >
< / e l - f o r m - i t e m >
< el -form -item label = "物料 编码" prop = "materialCode ">
< el -form -item label = "物料规格" prop = "materialSpec" >
< el -input
v - model = "purchaseOrderQueryParams.material Code "
placeholder = "请输入物料 编码 "
v - model = "purchaseOrderQueryParams.materialSpec"
placeholder = "请输入物料规格"
style = "width:140px;"
clearable
@ keyup . enter . native = "handlePurchaseOrderQuery"
/ >
< / e l - f o r m - i t e m >
< el -form -item label = " 物料名称" prop = "materialName ">
< el -form -item label = "规格参数" prop = "specificationParameter" >
< el -input
v - model = "purchaseOrderQueryParams. materialName "
placeholder = "请输入 物料名称 "
v - model = "purchaseOrderQueryParams.specificationParameter"
placeholder = "请输入规格参数"
style = "width:140px;"
clearable
@ keyup . enter . native = "handlePurchaseOrderQuery"
@ -137,24 +155,46 @@
plain
icon = "el-icon-plus"
size = "mini"
: disabled = " allocateBarCodeBtnDisab le"
: disabled = " multip le"
@ click = "submitForm"
v - hasPermi = "['mes: product Order:bind']"
v - hasPermi = "['mes: sale Order:bind']"
> 保存
< / e l - b u t t o n >
< el -button
type = "danger"
plain
icon = "el-icon-delete"
size = "mini"
@ click = "handleUnallocateBarCodes"
v - hasPermi = "['mes:saleOrder:bind']"
> 删除
< / e l - b u t t o n >
< / e l - f o r m - i t e m >
< / e l - f o r m >
< el -table v -loading = " selectableLoading " :data ="purchaseOrderList"
@ selection - change = "handleMaterialSelectionChange" >
< el -table v -loading = " selectableLoading "
: data = "purchaseOrderList"
@ selection - change = "handleMaterialSelectionChange"
: row - class - name = "rowSerialNumberProcess"
: row - style = "getRowStyle" >
< el -table -column type = "selection" width = "55" align = "center" / >
< el -table -column label = "序号" align = "center" prop = "serialNumber" / >
< el -table -column label = "订单编号" align = "center" prop = "poNo" / >
< el -table -column label = "物料编码" align = "center" prop = "materialCode" / >
< el -table -column label = "物料名称" align = "center" prop = "materialName" / >
< el -table -column label = "物料规格" align = "center" prop = "materialSpec" / >
< el -table -column label = "规格参数" align = "center" prop = "specificationParameter" :show-overflow-tooltip ="true" / >
< el -table -column label = "数量" align = "center" prop = "orderAmount" / >
< el -table -column label = "订单数" align = "center" prop = "orderAmount" / >
< el -table -column label = "已绑定数" align = "center" prop = "boundAmount" / >
< el -table -column label = "销售订单绑定数" align = "center" prop = "saleBindAmount" / >
< el -table -column label = "更新绑定数" align = "center" prop = "updateAmount" width = "150" >
< template slot -scope = " scope " >
< el -input -number v -model = " scope.row.updateAmount " size = "mini" / >
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column label = "安全库存数" align = "center" prop = "safeAmount" / >
< el -table -column label = "条码数" align = "center" prop = "barcodeAmount" / >
< / e l - t a b l e >
< pagination
@ -164,7 +204,7 @@
: limit . sync = "purchaseOrderQueryParams.pageSize"
@ pagination = "getUnbindPurchaseOrderList"
/ >
< / e l - c o l >
<!-- < / e l - c o l > - - >
< / e l - r o w >
< / div >
@ -192,6 +232,8 @@ export default {
barcodeInfos : [ ] ,
/ / 可 选 采 购 订 单 I D 选 中 数 组
purchaseOrderIds : [ ] ,
/ / 可 选 采 购 订 单 对 象 选 中 数 组
purchaseOrderSelectableList : [ ] ,
/ / 已 选 采 购 订 单 非 单 个 禁 用
allocateMaterialSingle : true ,
/ / 已 选 采 购 订 单 非 多 个 禁 用
@ -202,6 +244,8 @@ export default {
materialMultiple : true ,
/ / 显 示 搜 索 条 件
showSearch : true ,
single : true ,
multiple : true ,
/ / 已 选 采 购 订 单 总 条 数
allocatePurchaseOrderTotal : 0 ,
/ / 可 选 采 购 订 单 总 条 数
@ -231,6 +275,7 @@ export default {
saleOrderId : null ,
materialCode : null ,
materialName : null ,
specificationParameter : null ,
poNo : null
} ,
} ;
@ -240,16 +285,14 @@ export default {
const saleOrderId = this . $route . params && this . $route . params . saleOrderId ;
let saleorderCode = this . $route . query && this . $route . query . saleorderCode ;
this . purchaseOrderQueryParams . saleOrderId = saleOrderId ;
/ / t h i s . p u r c h a s e O r d e r Q u e r y P a r a m s . s a l e o r d e r C o d e = s a l e o r d e r C o d e ;
this . allocatePurchaseOrderQueryParams . saleOrderId = saleOrderId ;
/ / t h i s . a l l o c a t e P u r c h a s e O r d e r Q u e r y P a r a m s . s a l e o r d e r C o d e = s a l e o r d e r C o d e ;
this . saleOrderForm . saleorderCode = saleorderCode ;
this . saleOrderForm . saleOrderId = saleOrderId ;
this . saleOrderForm . materialCode = this . $route . query && this . $route . query . materialCode ;
this . saleOrderForm . materialName = this . $route . query && this . $route . query . materialName ;
this . saleOrderForm . materialModel = this . $route . query && this . $route . query . materialModel ;
this . getAllocatePurchaseOrderList ( ) ;
/ / t h i s . g e t A l l o c a t e P u r c h a s e O r d e r L i s t ( ) ;
this . getUnbindPurchaseOrderList ( ) ;
} ,
methods : {
@ -278,6 +321,9 @@ export default {
this . allocatePurchaseOrderQueryParams . pageNum = 1 ;
this . getAllocatePurchaseOrderList ( ) ;
} ,
getRowStyle ( { row } ) {
return row . saleBindAmount > 0 ? { backgroundColor : '#8ee38e' } : { } ;
} ,
/** 已选采购订单重置按钮操作 */
resetAllocateMaterialQuery ( ) {
this . resetForm ( "allocateMaterialQueryForm" ) ;
@ -286,8 +332,7 @@ export default {
/** 已选采购订单多选框选中数据 */
handleAllocateMaterialSelectionChange ( selection ) {
this . orderBindIds = selection . map ( item => item . orderBindId )
this . allocatePoNos = selection . map ( item => item . poNo )
this . single = selection . length !== 1
/ / t h i s . s i n g l e = s e l e c t i o n . l e n g t h ! = = 1
this . multiple = ! selection . length
} ,
/** 可选采购订单搜索按钮操作 */
@ -303,20 +348,25 @@ export default {
/ / 可 选 采 购 订 单 多 选 框 选 中 数 据
handleMaterialSelectionChange ( selection ) {
this . purchaseOrderIds = selection . map ( item => item . purchaseOrderId )
this . allocatePoNos = selection . map ( item => item . poNo )
this . purchaseOrderSelectableList = selection . map ( item => item )
this . single = selection . length !== 1
this . multiple = ! selection . length
} ,
rowSerialNumberProcess ( { row , rowIndex } ) {
row . serialNumber = rowIndex + 1 ;
} ,
handleUnallocateBarCodes ( ) {
const orderBindIds = this . orderBindIds . join ( "," ) ;
const purchaseOrderIds = this . purchaseOrder Ids. join ( "," ) ;
const allocatePoNos = this . allocatePoNos ;
const params = {
orderBindIds : orderBindIds
saleOrderId : this . saleOrderForm . saleOrderId ,
purchaseOrderIds : purchaseOrderIds ,
}
this . $modal . confirm ( '是否确认删除采购订单编号为"' + allocatePoNos + '"的数据项?' ) . then ( function ( ) {
return removeSalesBindPurchase ( params ) ;
} ) . then ( ( ) => {
this . getAllocatePurchaseOrderList ( ) ;
/ / t h i s . g e t A l l o c a t e P u r c h a s e O r d e r L i s t ( ) ;
this . getUnbindPurchaseOrderList ( ) ;
this . $modal . msgSuccess ( "删除成功" ) ;
} ) . catch ( ( ) => {
@ -325,19 +375,39 @@ export default {
/** 提交按钮 */
submitForm ( ) {
this . allocateBarCodeBtnDisable = true ;
const saleOrderId = this . saleOrderForm . saleOrderId ;
const purchaseOrderIds = this . purchaseOrderIds . join ( "," ) ;
saveSalesBindPurchase ( {
saleOrderId : saleOrderId ,
purchaseOrderIds : purchaseOrderIds
} ) . then ( ( response ) => {
/ / c o n s t p u r c h a s e O r d e r I d s = t h i s . p u r c h a s e O r d e r I d s . j o i n ( " , " ) ;
for ( let obj of this . purchaseOrderSelectableList ) {
obj . saleOrderId = this . saleOrderForm . saleOrderId ;
const orderAmount = obj . orderAmount ;
const boundAmount = obj . boundAmount ;
const saleBindAmount = obj . saleBindAmount ;
const safeAmount = obj . safeAmount ;
const barcodeAmount = obj . barcodeAmount ;
const updateAmount = obj . updateAmount ;
if ( updateAmount == null ) {
this . $modal . msgWarning ( "订单编号:" + obj . poNo + "请输入更新绑定数" ) ;
return ;
}
/ / ( 已 绑 定 总 数 - 销 售 订 单 已 绑 定 数 + 更 新 绑 定 数 量 ) 需 要 小 于 等 于 采 购 订 单 数 量
/ / i f ( ( b o u n d A m o u n t - s a l e B i n d A m o u n t + u p d a t e A m o u n t ) > o r d e r A m o u n t ) {
/ / t h i s . $ m o d a l . m s g W a r n i n g ( " 订 单 编 号 : " + o b j . p o N o + " 总 绑 定 数 大 于 订 单 数 " ) ;
/ / r e t u r n ;
/ / }
/ / i f ( u p d a t e A m o u n t > b a r c o d e A m o u n t ) {
/ / t h i s . $ m o d a l . m s g W a r n i n g ( " 订 单 编 号 : " + o b j . p o N o + " 绑 定 数 不 能 大 于 条 码 数 " ) ;
/ / r e t u r n ;
/ / }
/ / o b j . s a l e B i n d A m o u n t = u p d a t e A m o u n t ;
}
saveSalesBindPurchase ( this . purchaseOrderSelectableList ) . then ( ( response ) => {
this . $modal . msgSuccess ( "保存成功" ) ;
this . selectBarCodeAllocationWarehouse ( ) ;
this . getAllocatePurchaseOrderList ( ) ;
this . getUnbindPurchaseOrderList ( ) ;
/ / t h i s . g e t A l l o c a t e P u r c h a s e O r d e r L i s t ( ) ;
this . allocateBarCodeBtnDisable = false ;
} ) . catch ( ( ) => {
this . getAllocatePurchaseOrderList ( ) ;
this . getUnbindPurchaseOrderList ( ) ;
/ / t h i s . g e t A l l o c a t e P u r c h a s e O r d e r L i s t ( ) ;
/ / t h i s . g e t U n b i n d P u r c h a s e O r d e r L i s t ( ) ;
this . allocateBarCodeBtnDisable = false ;
} ) ;
} ,