@ -9,24 +9,6 @@
@ keyup . enter . native = "handleQuery"
/ >
< / e l - f o r m - i t e m >
< el -form -item label = "单据状态" prop = "documentStatus" >
< el -select v -model = " queryParams.documentStatus " placeholder = "请选择单据状态" clearable >
< el -option
v - for = "dict in dict.type.document_status"
: key = "dict.value"
: label = "dict.label"
: value = "dict.value"
/ >
< / e l - s e l e c t >
< / e l - f o r m - i t e m >
< el -form -item label = "物料ID" prop = "materialId" >
< el -input
v - model = "queryParams.materialId"
placeholder = "请输入物料ID"
clearable
@ keyup . enter . native = "handleQuery"
/ >
< / e l - f o r m - i t e m >
< el -form -item label = "物料编码" prop = "materialCode" >
< el -input
v - model = "queryParams.materialCode"
@ -43,10 +25,11 @@
@ keyup . enter . native = "handleQuery"
/ >
< / e l - f o r m - i t e m >
< el -form -item label = "订单状态" prop = "orderStatus" >
< el -select v -model = " queryParams.orderStatus " placeholder = "请选择订单状态" clearable >
< el -option
v - for = "dict in dict.type. order_status"
v - for = "dict in dict.type. mes_purchase_ order_status"
: key = "dict.value"
: label = "dict.label"
: value = "dict.value"
@ -54,133 +37,72 @@
< / e l - s e l e c t >
< / e l - f o r m - i t e m >
< el -form -item label = "源单编号" prop = "srcBillNo" >
< el -input
v - model = "queryParams.srcBillNo"
placeholder = "请输入源单编号"
clearable
@ keyup . enter . native = "handleQuery"
/ >
< / e l - f o r m - i t e m >
< el -form -item label = "京源项目" prop = "tondBase" >
< el -input
v - model = "queryParams.tondBase"
placeholder = "请输入京源项目"
clearable
@ keyup . enter . native = "handleQuery"
/ >
< / e l - f o r m - i t e m >
< el -form -item >
< el -button type = "primary" icon = "el-icon-search" size = "mini" @click ="handleQuery" > 搜 索 < / el -button >
< el -button icon = "el-icon-refresh" size = "mini" @click ="resetQuery" > 重 置 < / el -button >
< / e l - f o r m - i t e m >
< / e l - f o r m >
< el -row :gutter ="10" class = "mb8" >
<!-- < el -col :span ="1.5" > -- >
<!-- < el -button - - >
<!-- type = "primary" -- >
<!-- plain -- >
<!-- icon = "el-icon-plus" -- >
<!-- size = "mini" -- >
<!-- @ click = "handleAdd" -- >
<!-- v - hasPermi = "['mes:purchaseOrder:add']" -- >
<!-- > 新增 < / e l - b u t t o n > - - >
<!-- < / e l - c o l > - - >
<!-- < el -col :span ="1.5" > -- >
<!-- < el -button - - >
<!-- type = "success" -- >
<!-- plain -- >
<!-- icon = "el-icon-edit" -- >
<!-- size = "mini" -- >
<!-- : disabled = "single" -- >
<!-- @ click = "handleUpdate" -- >
<!-- v - hasPermi = "['mes:purchaseOrder:edit']" -- >
<!-- > 修改 < / e l - b u t t o n > - - >
<!-- < / e l - c o l > - - >
<!-- < el -col :span ="1.5" > -- >
<!-- < el -button - - >
<!-- type = "danger" -- >
<!-- plain -- >
<!-- icon = "el-icon-delete" -- >
<!-- size = "mini" -- >
<!-- : disabled = "multiple" -- >
<!-- @ click = "handleDelete" -- >
<!-- v - hasPermi = "['mes:purchaseOrder:remove']" -- >
<!-- > 删除 < / e l - b u t t o n > - - >
<!-- < / e l - c o l > - - >
< el -col :span ="1.5" >
< el -button
type = "warning"
plain
icon = "el-icon-download"
size = "mini"
@ click = "handleExport"
v - hasPermi = "['mes:purchaseOrder:export']"
> 导出 < / e l - b u t t o n >
< / e l - c o l >
< right -toolbar :showSearch.sync ="showSearch" @queryTable ="getList" :columns ="columns" > < / r i g h t - t o o l b a r >
< / e l - r o w >
< el -table v-loading ="loading" :data="purchaseOrderList" @selection-change="handleSelectionChange" >
< el -table -column type = "selection" width = "55" align = "center" / >
< el -table -column label = "主键标识" align = "center" prop = "purchaseOrderId" v -if = " columns [ 0 ] .visible " / >
< el -table -column label = "ERP主键信息" align = "center" prop = "erpId" v -if = " columns [ 1 ] .visible " / >
< el -table -column label = "金蝶ERP订单明细ID" align = "center" prop = "fentryId" v -if = " columns [ 2 ] .visible " / >
< el -table -column label = "采购订单编号" align = "center" prop = "poNo" v -if = " columns [ 3 ] .visible " / >
< el -table -column label = "单据状态" align = "center" prop = "documentStatus" v -if = " columns [ 4 ] .visible " >
< 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 = "orderAmount" / >
< el -table -column label = "审核日期" align = "center" prop = "approveDate" width = "180" >
< template slot -scope = " scope " >
< dict-tag :options ="dict.type.document_status" :value ="scope.row.documentStatus" / >
< span > { { parseTime ( scope . row . approveDate , '{y}-{m}-{d}' ) } } < / span >
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column label = "物料ID" align = "center" prop = "materialId" v -if = " columns [ 5 ] .visible " / >
< el -table -column label = "物料编码" align = "center" prop = "materialCode" v -if = " columns [ 6 ] .visible " / >
< el -table -column label = "物料名称" align = "center" prop = "materialName" v -if = " columns [ 7 ] .visible " / >
< el -table -column label = "订单计划数量" align = "center" prop = "orderAmount" v -if = " columns [ 8 ] .visible " / >
< el -table -column label = "完成采购数量" align = "center" prop = "completeAmount" v -if = " columns [ 9 ] .visible " / >
< el -table -column label = "审核日期" align = "center" prop = "approveDate" width = "180" v-if ="columns[10].visible" >
< el -table -column label = "ERP最后修改日期" align = "center" prop = "erpModifyDate" width = "180" >
< template slot -scope = " scope " >
< span > { { parseTime ( scope . row . approveDate, '{y}-{m}-{d} {h}:{i}:{s }') } } < / span >
< span > { { parseTime ( scope . row . erpModifyDate , '{y}-{m}-{d}' ) } } < / span >
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column label = " ERP最后修改 日期" align = "center" prop = " erpModif yDate" width = "180" v-if ="columns[11].visible" >
< el -table -column label = "计划交货日期" align = "center" prop = "planDeliveryDate" width = "180" >
< template slot -scope = " scope " >
< span > { { parseTime ( scope . row . erpModif yDate, '{y}-{m}-{d } {h}:{i}:{s }') } } < / span >
< span > { { parseTime ( scope . row . planDeliveryDate , '{y}-{m}-{d}' ) } } < / span >
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column label = " 计划交货日期" align = "center" prop = "planDeliveryDate" width = "180" v-if ="columns[12].visible" >
< el -table -column label = "订单状态" align = "center" prop = "orderStatus" >
< template slot -scope = " scope " >
< span > { { parseTime ( scope . row . planDeliveryDate , '{y}-{m}-{d} {h}:{i}:{s}' ) } } < / span >
< dict -tag :options ="dict.type.mes_purchase_order_status" :value ="scope.row.orderStatus" / >
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column label = " 计划开始日期" align = "center" prop = "beginDate" width = "180" v-if ="columns[13].visible" >
< el -table -column label = "完成日期" align = "center" prop = "completeDate" width = "180" >
< template slot -scope = " scope " >
< span > { { parseTime ( scope . row . beginDate, '{y}-{m}-{d} {h}:{i}:{s }') } } < / span >
< span > { { parseTime ( scope . row . completeDate , '{y}-{m}-{d}' ) } } < / span >
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column label = "计划结束日期" align = "center" prop = "endDate" width = "180" v-if ="columns[14].visible" >
< el -table -column label = "源单编号" align = "center" prop = "srcBillNo" / >
< el -table -column label = "京源项目" align = "center" prop = "tondBase" / >
< el -table -column label = "操作" align = "center" class -name = " small -padding fixed -width " >
< template slot -scope = " scope " >
< span > { { parseTime ( scope . row . endDate , '{y}-{m}-{d} {h}:{i}:{s}' ) } } < / span >
< el -button
size = "mini"
type = "text"
icon = "el-icon-edit"
@ click = "handleUpdate(scope.row)"
v - hasPermi = "['mes:purchaseOrder:edit']"
> 绑定 < / e l - b u t t o n >
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column label = "订单状态" align = "center" prop = "orderStatus" v -if = " columns [ 15 ] .visible " >
< template slot -scope = " scope " >
< dict -tag :options ="dict.type.order_status" :value ="scope.row.orderStatus" / >
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column label = "完成日期" align = "center" prop = "completeDate" width = "180" v-if ="columns[16].visible" >
< template slot -scope = " scope " >
< span > { { parseTime ( scope . row . completeDate , '{y}-{m}-{d} {h}:{i}:{s}' ) } } < / span >
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column label = "是否标识" align = "center" prop = "isFlag" v -if = " columns [ 17 ] .visible " >
< template slot -scope = " scope " >
< dict -tag :options ="dict.type.active_flag" :value ="scope.row.isFlag" / >
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column label = "备注" align = "center" prop = "remark" v -if = " columns [ 18 ] .visible " / >
<!-- < el -table -column label = "操作" align = "center" class -name = " small -padding fixed -width " > -- >
<!-- < template slot -scope = " scope " > -- >
<!-- < el -button - - >
<!-- size = "mini" -- >
<!-- type = "text" -- >
<!-- icon = "el-icon-edit" -- >
<!-- @ click = "handleUpdate(scope.row)" -- >
<!-- v - hasPermi = "['mes:purchaseOrder:edit']" -- >
<!-- > 修改 < / e l - b u t t o n > - - >
<!-- < el -button - - >
<!-- size = "mini" -- >
<!-- type = "text" -- >
<!-- icon = "el-icon-delete" -- >
<!-- @ click = "handleDelete(scope.row)" -- >
<!-- v - hasPermi = "['mes:purchaseOrder:remove']" -- >
<!-- > 删除 < / e l - b u t t o n > - - >
<!-- < / template > -- >
<!-- < / e l - t a b l e - c o l u m n > - - >
< / e l - t a b l e >
< pagination
@ -191,133 +113,24 @@
@ pagination = "getList"
/ >
<!-- 添加或修改采购订单信息对话框 -- >
< el -dialog :title ="title" :visible.sync ="open" width = "500px" append -to -body >
< el -form ref = "form" :model ="form" :rules ="rules" label -width = " 80px " >
< el -form -item label = "ERP主键信息" prop = "erpId" >
< el -input v -model = " form.erpId " placeholder = "请输入ERP主键信息" / >
< / e l - f o r m - i t e m >
< el -form -item label = "金蝶ERP订单明细ID" prop = "fentryId" >
< el -input v -model = " form.fentryId " placeholder = "请输入金蝶ERP订单明细ID" / >
< / e l - f o r m - i t e m >
< el -form -item label = "采购订单编号" prop = "poNo" >
< el -input v -model = " form.poNo " placeholder = "请输入采购订单编号" / >
< / e l - f o r m - i t e m >
< el -form -item label = "单据状态" prop = "documentStatus" >
< el -select v-model ="form.documentStatus" placeholder="请选择单据状态" >
< el -option
v - for = "dict in dict.type.document_status"
: key = "dict.value"
: label = "dict.label"
: value = "dict.value"
> < / 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 = "物料ID" prop = "materialId" >
< el -input v -model = " form.materialId " placeholder = "请输入物料ID" / >
< / e l - f o r m - i t e m >
< el -form -item label = "物料编码" prop = "materialCode" >
< el -input v -model = " form.materialCode " placeholder = "请输入物料编码" / >
< / e l - f o r m - i t e m >
< el -form -item label = "物料名称" prop = "materialName" >
< el -input v -model = " form.materialName " placeholder = "请输入物料名称" / >
< / e l - f o r m - i t e m >
< el -form -item label = "订单计划数量" prop = "orderAmount" >
< el -input v -model = " form.orderAmount " placeholder = "请输入订单计划数量" / >
< / e l - f o r m - i t e m >
< el -form -item label = "完成采购数量" prop = "completeAmount" >
< el -input v -model = " form.completeAmount " placeholder = "请输入完成采购数量" / >
< / e l - f o r m - i t e m >
< el -form -item label = "审核日期" prop = "approveDate" >
< el -date -picker clearable
v - model = "form.approveDate"
type = "date"
value - format = "yyyy-MM-dd"
placeholder = "请选择审核日期" >
< / e l - d a t e - p i c k e r >
< / e l - f o r m - i t e m >
< el -form -item label = "ERP最后修改日期" prop = "erpModifyDate" >
< el -date -picker clearable
v - model = "form.erpModifyDate"
type = "date"
value - format = "yyyy-MM-dd"
placeholder = "请选择ERP最后修改日期" >
< / e l - d a t e - p i c k e r >
< / e l - f o r m - i t e m >
< el -form -item label = "计划交货日期" prop = "planDeliveryDate" >
< el -date -picker clearable
v - model = "form.planDeliveryDate"
type = "date"
value - format = "yyyy-MM-dd"
placeholder = "请选择计划交货日期" >
< / e l - d a t e - p i c k e r >
< / e l - f o r m - i t e m >
< el -form -item label = "计划开始日期" prop = "beginDate" >
< el -date -picker clearable
v - model = "form.beginDate"
type = "date"
value - format = "yyyy-MM-dd"
placeholder = "请选择计划开始日期" >
< / e l - d a t e - p i c k e r >
< / e l - f o r m - i t e m >
< el -form -item label = "计划结束日期" prop = "endDate" >
< el -date -picker clearable
v - model = "form.endDate"
type = "date"
value - format = "yyyy-MM-dd"
placeholder = "请选择计划结束日期" >
< / e l - d a t e - p i c k e r >
< / e l - f o r m - i t e m >
< el -form -item label = "订单状态" prop = "orderStatus" >
< el -radio -group v-model ="form.orderStatus" >
< el -radio
v - for = "dict in dict.type.order_status"
: key = "dict.value"
: label = "dict.value"
> { { dict . label } } < / e l - r a d i o >
< / e l - r a d i o - g r o u p >
< / e l - f o r m - i t e m >
< el -form -item label = "完成日期" prop = "completeDate" >
< el -date -picker clearable
v - model = "form.completeDate"
type = "date"
value - format = "yyyy-MM-dd"
placeholder = "请选择完成日期" >
< / e l - d a t e - p i c k e r >
< / e l - f o r m - i t e m >
< el -form -item label = "是否标识" prop = "isFlag" >
< el -radio -group v-model ="form.isFlag" >
< el -radio
v - for = "dict in dict.type.active_flag"
: key = "dict.value"
: label = "dict.value"
> { { dict . label } } < / e l - r a d i o >
< / e l - r a d i o - g r o u p >
< / e l - f o r m - i t e m >
< el -form -item label = "备注" prop = "remark" >
< el -input v -model = " form.remark " type = "textarea" placeholder = "请输入内容" / >
< / e l - f o r m - i t e m >
< / e l - f o r m >
< div slot = "footer" class = "dialog-footer" >
< el -button type = "primary" @click ="submitForm" > 确 定 < / el -button >
< el -button @click ="cancel" > 取 消 < / el -button >
< / div >
< / e l - d i a l o g >
< / div >
< / template >
< script >
import { listPurchaseOrder , getPurchaseOrder , delPurchaseOrder , addPurchaseOrder , updatePurchaseOrder } from "@/api/mes/purchaseOrder" ;
import router from "@/router" ;
export default {
name : "PurchaseOrder" ,
dicts : [ 'active_flag' , ' order_status', 'document_status '] ,
dicts : [ 'active_flag' , 'mes_purchase_order_status' , 'document_status' , 'mes_safe_flag' ] ,
data ( ) {
return {
/ / 遮 罩 层
loading : true ,
/ / 选 中 数 组
ids : [ ] ,
/ / 子 表 选 中 数 据
checkedMesOrderBind : [ ] ,
/ / 非 单 个 禁 用
single : true ,
/ / 非 多 个 禁 用
@ -328,6 +141,8 @@ export default {
total : 0 ,
/ / 采 购 订 单 信 息 表 格 数 据
purchaseOrderList : [ ] ,
/ / 采 购 销 售 订 单 绑 定 信 息 ; 销 售 订 单 绑 定 采 购 订 单 明 细 信 息 表 格 数 据
mesOrderBindList : [ ] ,
/ / 弹 出 层 标 题
title : "" ,
/ / 是 否 显 示 弹 出 层
@ -353,46 +168,29 @@ export default {
orderStatus : null ,
completeDate : null ,
isFlag : null ,
unitId : null ,
stockUnitId : null ,
priceUnitId : null ,
auxPropId : null ,
srcBillNo : null ,
purchaseOrgId : null ,
tondBase : null ,
supplierId : null ,
} ,
/ / 表 单 参 数
form : { } ,
/ / 表 单 校 验
rules : {
materialCode : [
{ required : true , message : "物料编码不能为空" , trigger : "blur" }
{ required : true , message : "物料编码 ;对应FMaterialId.FNumber 不能为空", trigger : "blur" }
] ,
orderAmount : [
{ required : true , message : "订单计划数量 不能为空", trigger : "blur" }
{ required : true , message : "订单计划数量 ;对应FQty 不能为空", trigger : "blur" }
] ,
isFlag : [
{ required : true , message : "是否标识 不能为空", trigger : "change" }
{ required : true , message : "是否标识 : 1-是; 0-否 不能为空", trigger : "change" }
] ,
} ,
columns : [
{ key : 0 , label : ` 主键标识 ` , visible : true } ,
{ key : 1 , label : ` ERP主键信息 ` , visible : true } ,
{ key : 2 , label : ` 金蝶ERP订单明细ID ` , visible : true } ,
{ key : 3 , label : ` 采购订单编号 ` , visible : true } ,
{ key : 4 , label : ` 单据状态 ` , visible : true } ,
{ key : 5 , label : ` 物料ID ` , visible : true } ,
{ key : 6 , label : ` 物料编码 ` , visible : true } ,
{ key : 7 , label : ` 物料名称 ` , visible : true } ,
{ key : 8 , label : ` 订单计划数量 ` , visible : true } ,
{ key : 9 , label : ` 完成采购数量 ` , visible : true } ,
{ key : 10 , label : ` 审核日期 ` , visible : true } ,
{ key : 11 , label : ` ERP最后修改日期 ` , visible : true } ,
{ key : 12 , label : ` 计划交货日期 ` , visible : true } ,
{ key : 13 , label : ` 计划开始日期 ` , visible : true } ,
{ key : 14 , label : ` 计划结束日期 ` , visible : true } ,
{ key : 15 , label : ` 订单状态 ` , visible : true } ,
{ key : 16 , label : ` 完成日期 ` , visible : true } ,
{ key : 17 , label : ` 是否标识 ` , visible : true } ,
{ key : 18 , label : ` 备注 ` , visible : true } ,
{ key : 19 , label : ` 创建人 ` , visible : true } ,
{ key : 20 , label : ` 创建时间 ` , visible : true } ,
{ key : 21 , label : ` 更新人 ` , visible : true } ,
{ key : 22 , label : ` 更新时间 ` , visible : true } ,
] ,
}
} ;
} ,
created ( ) {
@ -434,12 +232,21 @@ export default {
orderStatus : null ,
completeDate : null ,
isFlag : null ,
unitId : null ,
stockUnitId : null ,
priceUnitId : null ,
auxPropId : null ,
srcBillNo : null ,
purchaseOrgId : null ,
tondBase : null ,
supplierId : null ,
remark : null ,
createBy : null ,
createTime : null ,
updateBy : null ,
updateTime : null
} ;
this . mesOrderBindList = [ ] ;
this . resetForm ( "form" ) ;
} ,
/** 搜索按钮操作 */
@ -466,18 +273,16 @@ export default {
} ,
/** 修改按钮操作 */
handleUpdate ( row ) {
this . reset ( ) ;
const purchaseOrderId = row . purchaseOrderId || this . ids
getPurchaseOrder ( purchaseOrderId ) . then ( response => {
this . form = response . data ;
this . open = true ;
this . title = "修改采购订单信息" ;
} ) ;
const purchaseOrderId = row . purchaseOrderId ;
const poNo = row . poNo ;
const params = { queryParams : this . queryParams } ;
this . $tab . openPage ( "订单绑定[" + poNo + "]" , '/mes/product-order/bind/' + purchaseOrderId , params ) ;
} ,
/** 提交按钮 */
submitForm ( ) {
this . $refs [ "form" ] . validate ( valid => {
if ( valid ) {
this . form . mesOrderBindList = this . mesOrderBindList ;
if ( this . form . purchaseOrderId != null ) {
updatePurchaseOrder ( this . form ) . then ( response => {
this . $modal . msgSuccess ( "修改成功" ) ;
@ -504,12 +309,49 @@ export default {
this . $modal . msgSuccess ( "删除成功" ) ;
} ) . catch ( ( ) => { } ) ;
} ,
/** 采购销售订单绑定信息;销售订单绑定采购订单明细信息序号 */
rowMesOrderBindIndex ( { row , rowIndex } ) {
row . index = rowIndex + 1 ;
} ,
/** 采购销售订单绑定信息;销售订单绑定采购订单明细信息添加按钮操作 */
handleAddMesOrderBind ( ) {
let obj = { } ;
obj . safeFlag = "" ;
obj . saleOrderId = "" ;
obj . productId = "" ;
obj . materialId = this . form . materialId ;
obj . bindAmount = "" ;
obj . remark = "" ;
this . mesOrderBindList . push ( obj ) ;
} ,
/** 采购销售订单绑定信息;销售订单绑定采购订单明细信息删除按钮操作 */
handleDeleteMesOrderBind ( ) {
if ( this . checkedMesOrderBind . length == 0 ) {
this . $modal . msgError ( "请先选择要删除的采购销售订单绑定信息;销售订单绑定采购订单明细信息数据" ) ;
} else {
const mesOrderBindList = this . mesOrderBindList ;
const checkedMesOrderBind = this . checkedMesOrderBind ;
this . mesOrderBindList = mesOrderBindList . filter ( function ( item ) {
return checkedMesOrderBind . indexOf ( item . index ) == - 1
} ) ;
}
} ,
/** 复选框选中数据 */
handleMesOrderBindSelectionChange ( selection ) {
this . checkedMesOrderBind = selection . map ( item => item . index )
} ,
/** 导出按钮操作 */
handleExport ( ) {
this . download ( 'mes/purchaseOrder/export' , {
... this . queryParams
} , ` purchaseOrder_ ${ new Date ( ) . getTime ( ) } .xlsx ` )
} ,
handleSaleOrderAdd ( ) {
}
}
} ;
< / script >