@ -26,6 +26,36 @@
/ >
< / e l - f o r m - i t e m >
< el -form -item label = "物料规格" prop = "materialSpec" >
< el -input
v - model = "queryParams.materialSpec"
placeholder = "请输入物料规格"
clearable
@ keyup . enter . native = "handleQuery"
/ >
< / e l - f o r m - i t e m >
< el -form -item label = "规格参数" prop = "specificationParameter" >
< el -input
v - model = "queryParams.specificationParameter"
placeholder = "请输入规格参数"
clearable
@ keyup . enter . native = "handleQuery"
/ >
< / e l - f o r m - i t e m >
< el -form -item label = "常备物料" prop = "alwaysFlag" >
< el -select v -model = " queryParams.alwaysFlag " placeholder = "请选择常备物料标识" clearable >
< el -option
v - for = "dict in dict.type.mes_material_bind_flag"
: 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 = "订单状态" prop = "orderStatus" >
< el -select v -model = " queryParams.orderStatus " placeholder = "请选择订单状态" clearable >
< el -option
@ -37,22 +67,7 @@
< / 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 >
@ -62,47 +77,55 @@
< el -row :gutter ="10" class = "mb8" >
< el -col :span ="1.5" >
< el -button
type = " info "
type = " primary "
plain
icon = "el-icon-upload2"
size = "mini"
@ click = "handleImport"
> 采购申请单导入 < / e l - b u t t o n >
> 采购申请单导入
< / e l - b u t t o n >
< / e l - c o l >
< / e l - r o w >
< el -table v-loading ="loading" :data="purchaseOrderList" @selection-change="handleSelectionChange" >
< 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" >
< 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" width = "200" / >
< el -table -column label = "常备物料" align = "center" prop = "alwaysFlag" >
< template slot -scope = " scope " >
< dict -tag :options ="dict.type.mes_material_bind_flag" :value ="scope.row.alwaysFlag" / >
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column label = "订单状态" align = "center" prop = "orderStatus" >
< template slot -scope = " scope " >
< span > { { parseTime ( scope . row . approveDate , '{y}-{m}-{d}' ) } } < / 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 = "ERP最后修改日期" align = "center" prop = "erpModifyDate" width = "180" >
< el -table -column label = "订单数量" align = "center" prop = "orderAmount" / >
< el -table -column label = "完成数量" align = "center" prop = "completeAmount" / >
< el -table -column label = "审核日期" align = "center" prop = "approveDate" >
< template slot -scope = " scope " >
< span > { { parseTime ( scope . row . erpModifyDate , '{y}-{m}-{d}' ) } } < / span >
< span > { { parseTime ( scope . row . approveDate, '{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 = " planDeliv eryDate" width = "180 ">
< el -table -column label = " ERP最后修改 日期" align = "center" prop = " erpModif yDate">
< template slot -scope = " scope " >
< span > { { parseTime ( scope . row . planDeliveryDate, '{y}-{m}-{d }') } } < / span >
< span > { { parseTime ( scope . row . erpModifyDate, '{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 = "orderStatus ">
< el -table -column label = " 计划交货日期" align = "center" prop = "planDeliveryDate ">
< template slot -scope = " scope " >
< dict-tag :options ="dict.type.mes_purchase_order_status" :value ="scope.row.orderStatus" / >
< span> { { parseTime ( scope . row . planDeliveryDate , '{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 = "completeDate" width = "180" >
< el -table -column label = "完成日期" align = "center" prop = "completeDate" >
< template slot -scope = " scope " >
< span > { { parseTime ( scope . row . completeDate , '{y}-{m}-{d} ') } } < / span >
< 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 = "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 " >
< el -button
@ -110,8 +133,10 @@
type = "text"
icon = "el-icon-edit"
@ click = "handleUpdate(scope.row)"
v - hasPermi = "['mes:purchaseOrder:edit']"
> 绑定 < / e l - b u t t o n >
v - hasPermi = "['mes:purchaseOrder:bind']"
v - if = "scope.row.alwaysFlag === ALWAYS_FLAG.NO"
> 绑定
< / 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 >
@ -140,11 +165,11 @@
< i class = "el-icon-upload" > < / i >
< div class = "el-upload__text" > 将文件拖到此处 , 或 < em > 点击上传 < / em > < / div >
< div class = "el-upload__tip text-center" slot = "tip" >
<!-- < div class = "el-upload__tip" slot = "tip" > -- >
<!-- < el -checkbox v -model = " upload.updateSupport " / > 是否更新已经存在的用户数据 -- >
<!-- < / div > -- >
<!-- < div class = "el-upload__tip" slot = "tip" > -- >
<!-- < el -checkbox v -model = " upload.updateSupport " / > 是否更新已经存在的用户数据 -- >
<!-- < / div > -- >
< span > 仅允许导入xls 、 xlsx格式文件 。 < / span >
<!-- < el -link type = "primary" :underline ="false" style = "font-size:12px;vertical-align: baseline;" @click ="importTemplate" > 下 载 模 板 < / el -link > -- >
<!-- < el -link type = "primary" :underline ="false" style = "font-size:12px;vertical-align: baseline;" @click ="importTemplate" > 下 载 模 板 < / el -link > -- >
< / div >
< / e l - u p l o a d >
< div slot = "footer" class = "dialog-footer" >
@ -156,13 +181,19 @@
< / template >
< script >
import { listPurchaseOrder , getPurchaseOrder , delPurchaseOrder , addPurchaseOrder , updatePurchaseOrder } from "@/api/mes/purchaseOrder" ;
import {
listPurchaseOrder ,
getPurchaseOrder ,
delPurchaseOrder ,
addPurchaseOrder ,
updatePurchaseOrder
} from "@/api/mes/purchaseOrder" ;
import router from "@/router" ;
import { getToken } from "@/utils/auth" ;
export default {
name : "PurchaseOrder" ,
dicts : [ 'active_flag' , 'mes_purchase_order_status' , 'document_status' , 'mes_safe_flag' ] ,
dicts : [ 'active_flag' , 'mes_purchase_order_status' , 'document_status' , 'mes_safe _flag', 'mes_material_bind _flag'] ,
data ( ) {
return {
/ / 遮 罩 层
@ -198,6 +229,9 @@ export default {
materialId : null ,
materialCode : null ,
materialName : null ,
materialSpec : null ,
specificationParameter : null ,
alwaysFlag : null ,
orderAmount : null ,
completeAmount : null ,
approveDate : null ,
@ -229,21 +263,26 @@ export default {
/ / 是 否 更 新 已 经 存 在 的 用 户 数 据
updateSupport : 0 ,
/ / 设 置 上 传 的 请 求 头 部
headers : { Authorization : "Bearer " + getToken ( ) } ,
headers : { Authorization : "Bearer " + getToken ( ) } ,
/ / 上 传 的 地 址
url : process . env . VUE _APP _BASE _API + "/mes/import/purchaseRequisitionImportData"
} ,
/ / 表 单 校 验
rules : {
materialCode : [
{ required : true , message : "物料编码;对应FMaterialId.FNumber不能为空" , trigger : "blur" }
{ required : true , message : "物料编码;对应FMaterialId.FNumber不能为空" , trigger : "blur" }
] ,
orderAmount : [
{ required : true , message : "订单计划数量;对应FQty不能为空" , trigger : "blur" }
{ required : true , message : "订单计划数量;对应FQty不能为空" , trigger : "blur" }
] ,
isFlag : [
{ required : true , message : "是否标识: 1-是; 0-否不能为空" , trigger : "change" }
{ required : true , message : "是否标识: 1-是; 0-否不能为空" , trigger : "change" }
] ,
} ,
ALWAYS _FLAG : {
YES : "1" ,
NO : "0"
}
} ;
} ,
@ -316,7 +355,7 @@ export default {
/ / 多 选 框 选 中 数 据
handleSelectionChange ( selection ) {
this . ids = selection . map ( item => item . purchaseOrderId )
this . single = selection . length !== 1
this . single = selection . length !== 1
this . multiple = ! selection . length
} ,
/** 导入按钮操作 */
@ -326,8 +365,7 @@ export default {
} ,
/** 下载模板操作 */
importTemplate ( ) {
this . download ( 'system/user/importTemplate' , {
} , ` template_ ${ new Date ( ) . getTime ( ) } .xlsx ` )
this . download ( 'system/user/importTemplate' , { } , ` template_ ${ new Date ( ) . getTime ( ) } .xlsx ` )
} ,
/ / 文 件 上 传 中 处 理
handleFileUploadProgress ( event , file , fileList ) {
@ -338,7 +376,7 @@ export default {
this . upload . open = false ;
this . upload . isUploading = false ;
this . $refs . upload . clearFiles ( ) ;
this . $alert ( "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response . msg + "</div>" , "导入结果" , { dangerouslyUseHTMLString : true } ) ;
this . $alert ( "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response . msg + "</div>" , "导入结果" , { dangerouslyUseHTMLString : true } ) ;
this . getList ( ) ;
} ,
/ / 提 交 上 传 文 件
@ -354,9 +392,11 @@ export default {
/** 修改按钮操作 */
handleUpdate ( row ) {
const purchaseOrderId = row . purchaseOrderId ;
const materialSpec = row . materialSpec ;
const poNo = row . poNo ;
const params = { queryParams : this . queryParams } ;
this . $tab . openPage ( "订单绑定[" + poNo + "]" , '/mes/product-order/bind/' + purchaseOrderId , params ) ;
const params = { queryParams : this . queryParams , t : Date . now ( ) } ;
this . $tab . openPage ( "订单绑定[" + poNo + "]" , '/mes/purchase-order/bind/' + purchaseOrderId + '/' + materialSpec , params ) ;
} ,
/** 提交按钮 */
submitForm ( ) {
@ -382,15 +422,16 @@ export default {
/** 删除按钮操作 */
handleDelete ( row ) {
const purchaseOrderIds = row . purchaseOrderId || this . ids ;
this . $modal . confirm ( '是否确认删除采购订单信息编号为"' + purchaseOrderIds + '"的数据项?' ) . then ( function ( ) {
this . $modal . confirm ( '是否确认删除采购订单信息编号为"' + purchaseOrderIds + '"的数据项?' ) . then ( function ( ) {
return delPurchaseOrder ( purchaseOrderIds ) ;
} ) . then ( ( ) => {
this . getList ( ) ;
this . $modal . msgSuccess ( "删除成功" ) ;
} ) . catch ( ( ) => { } ) ;
} ) . catch ( ( ) => {
} ) ;
} ,
/** 采购销售订单绑定信息;销售订单绑定采购订单明细信息序号 */
rowMesOrderBindIndex ( { row , rowIndex } ) {
rowMesOrderBindIndex ( { row , rowIndex } ) {
row . index = rowIndex + 1 ;
} ,
/** 采购销售订单绑定信息;销售订单绑定采购订单明细信息添加按钮操作 */
@ -411,7 +452,7 @@ export default {
} else {
const mesOrderBindList = this . mesOrderBindList ;
const checkedMesOrderBind = this . checkedMesOrderBind ;
this . mesOrderBindList = mesOrderBindList . filter ( function ( item ) {
this . mesOrderBindList = mesOrderBindList . filter ( function ( item ) {
return checkedMesOrderBind . indexOf ( item . index ) == - 1
} ) ;
}
@ -428,7 +469,7 @@ export default {
} ,
handleSaleOrderAdd ( ) {
handleSaleOrderAdd ( ) {
}