@ -34,7 +34,8 @@
size = "mini"
@ click = "handleAdd"
v - hasPermi = "['mes:processInfo:add']"
> 新增 < / e l - b u t t o n >
> 新增
< / e l - b u t t o n >
< / e l - c o l >
< el -col :span ="1.5" >
< el -button
@ -45,7 +46,8 @@
: disabled = "single"
@ click = "handleUpdate"
v - hasPermi = "['mes:processInfo:edit']"
> 修改 < / e l - b u t t o n >
> 修改
< / e l - b u t t o n >
< / e l - c o l >
< el -col :span ="1.5" >
< el -button
@ -56,7 +58,8 @@
: disabled = "multiple"
@ click = "handleDelete"
v - hasPermi = "['mes:processInfo:remove']"
> 删除 < / e l - b u t t o n >
> 删除
< / e l - b u t t o n >
< / e l - c o l >
< el -col :span ="1.5" >
< el -button
@ -66,23 +69,28 @@
size = "mini"
@ click = "handleExport"
v - hasPermi = "['mes:processInfo:export']"
> 导出 < / e l - b u t t o n >
> 导出
< / 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 >
< 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="processInfoList" @selection-change="handleSelectionChange" >
< el -table -column type = "selection" width = "55" align = "center" / >
< el -table -column type = "selection" width = "55" align = "center" / >
< el -table -column label = "主键标识" align = "center" prop = "processId" v -if = " columns [ 0 ] .visible " / >
< el -table -column label = "工序编号" align = "center" prop = "processCode" v -if = " columns [ 1 ] .visible " / >
< el -table -column label = "工序名称" align = "center" prop = "processName" v -if = " columns [ 2 ] .visible " / >
< el -table -column label = "工序类别" align = "center" prop = "processType" v -if = " columns [ 3 ] .visible " >
< el -table -column label = "工序类别" align = "center" prop = "processType" v-if ="columns[3].visible" >
< template slot -scope = " scope " >
< dict -tag :options ="dict.type.process_type" :value ="scope.row.processType" / >
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column label = "标准工时(分钟)" align = "center" prop = "productionTime" v -if = " columns [ 4 ] .visible " / >
< el -table -column label = "激活标识" align = "center" prop = "activeFlag" v -if = " columns [ 5 ] .visible " >
< el -table -column label = "标准工时" align = "center" prop = "productionTime" v-if ="columns[4].visible" >
< template slot -scope = " scope " >
< span > { { formatDayHourMinutes ( scope . row . productionTime ) } } < / span >
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column label = "激活标识" align = "center" prop = "activeFlag" v-if ="columns[5].visible" >
< template slot -scope = " scope " >
< dict -tag :options ="dict.type.active_flag" :value ="scope.row.activeFlag" / >
< / template >
@ -91,36 +99,38 @@
< el -table -column label = "创建人" align = "center" prop = "createBy" v -if = " columns [ 7 ] .visible " / >
< el -table -column label = "创建时间" align = "center" prop = "createTime" width = "180" v-if ="columns[8].visible" >
< template slot -scope = " scope " >
< span > { { parseTime ( scope . row . createTime , '{y}-{m}-{d} {h}:{i}:{s}' ) } } < / span >
< span > { { parseTime ( scope . row . createTime , '{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 = "updateBy" v -if = " columns [ 9 ] .visible " / >
< el -table -column label = "更新时间" align = "center" prop = "updateTime" width = "180" v-if ="columns[10].visible" >
< template slot -scope = " scope " >
< span > { { parseTime ( scope . row . updateTime , '{y}-{m}-{d} {h}:{i}:{s}' ) } } < / span >
< span > { { parseTime ( scope . row . updateTime , '{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" 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:processInfo:edit']" -- >
<!-- > 修改 < / e l - b u t t o n > - - >
<!-- < el -button - - >
<!-- size = "mini" -- >
<!-- type = "text" -- >
<!-- icon = "el-icon-edit" -- >
<!-- @ click = "handleUpdate(scope.row)" -- >
<!-- v - hasPermi = "['mes:processInfo:edit']" -- >
<!-- > 修改 < / e l - b u t t o n > - - >
< el -button
size = "mini"
type = "text"
icon = "el-icon-circle-plus"
@ click = "handleProdLineUpdate(scope.row)"
> 关联产线 < / e l - b u t t o n >
> 关联产线
< / e l - b u t t o n >
< el -button
size = "mini"
type = "text"
icon = "el-icon-s-check"
@ click = "handleUserUpdate(scope.row)"
> 关联人员 < / e l - b u t t o n >
> 关联人员
< / e l - b u t t o n >
< / template >
< / e l - t a b l e - c o l u m n >
@ -138,10 +148,10 @@
< el -dialog :title ="title" :visible.sync ="open" width = "500px" append -to -body >
< el -form ref = "form" :model ="form" :rules ="rules" label -width = " 110px " >
< el -form -item label = "工序编号" prop = "processCode" >
< el -input v -model = " form.processCode " placeholder = "请输入工序编号" / >
< el -input v -model = " form.processCode " placeholder = "请输入工序编号" / >
< / e l - f o r m - i t e m >
< el -form -item label = "工序名称" prop = "processName" >
< el -input v -model = " form.processName " placeholder = "请输入工序名称" / >
< el -input v -model = " form.processName " placeholder = "请输入工序名称" / >
< / e l - f o r m - i t e m >
< el -form -item label = "工序类别" prop = "processType" >
< el -select v-model ="form.processType" placeholder="请选择工序类别" >
@ -153,8 +163,16 @@
> < / 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 = "标准工时(分钟)" prop = "productionTime" >
< el -input -number v -model = " form.productionTime " placeholder = "请输入标准工时(分钟)" / >
< el -form -item label = "标准工时" prop = "productionTime" >
< el -input -number v -model = " form.productionTimeDays " placeholder = "请输入天数" :min ="0" :max ="10000"
: controls = "false" : style = "{ width: '50px' }" / >
天
< el -input -number v -model = " form.productionTimeHours " placeholder = "请输入小时" :min ="0" :max ="23"
: controls = "false" : style = "{ width: '50px' }" / >
小时
< el -input -number v -model = " form.productionTimeMinutes " placeholder = "请输入分钟" :min ="0" :max ="59"
: controls = "false" : style = "{ width: '50px' }" / >
分钟
< / e l - f o r m - i t e m >
< el -form -item label = "激活标识" prop = "activeFlag" >
< el -radio -group v-model ="form.activeFlag" >
@ -167,7 +185,7 @@
< / 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 = "请输入内容" / >
< 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" >
@ -180,43 +198,46 @@
< el -form ref = "form" :model ="form" :rules ="rules" label -width = " 100px " >
< el -row :gutter ="10" class = "mb8" >
< el -col :span ="1.5" >
< el -form -item label = "工序编号" prop = "processCode" >
< el -input v -model = " form.processCode " placeholder = "请输入工序编号" :disabled ="true" / >
< / e l - f o r m - i t e m >
< el -form -item label = "工序编号" prop = "processCode" >
< el -input v -model = " form.processCode " placeholder = "请输入工序编号" :disabled ="true" / >
< / e l - f o r m - i t e m >
< / e l - c o l >
< el -col :span ="1.5" >
< el -form -item label = "工序名称" prop = "processName" >
< el -input v -model = " form.processName " placeholder = "请输入工序名称" :disabled ="true" / >
< / e l - f o r m - i t e m >
< el -form -item label = "工序名称" prop = "processName" >
< el -input v -model = " form.processName " placeholder = "请输入工序名称" :disabled ="true" / >
< / e l - f o r m - i t e m >
< / e l - c o l >
< / e l - r o w >
<!-- < el -form -item label = "工序类别" prop = "processType" > -- >
<!-- < el -select v-model ="form.processType" placeholder="请选择工序类别" :disabled ="true" > - - >
<!-- < el -option - - >
<!-- v - for = "dict in dict.type.process_type" -- >
<!-- : 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 = "工序类别" prop = "processType" > -- >
<!-- < el -select v-model ="form.processType" placeholder="请选择工序类别" :disabled ="true" > - - >
<!-- < el -option - - >
<!-- v - for = "dict in dict.type.process_type" -- >
<!-- : 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 -divider content -position = " center " > 工序关联产线信息 < / e l - d i v i d e r >
< el -row :gutter ="10" class = "mb8" >
< el -col :span ="1.5" >
< el -button type = "primary" icon = "el-icon-plus" size = "mini" @click ="handleAddMesBaseProcessProdline" > 添 加 产 线 < / el -button >
< el -button type = "primary" icon = "el-icon-plus" size = "mini" @click ="handleAddMesBaseProcessProdline" > 添 加 产 线
< / e l - b u t t o n >
< / e l - c o l >
< el -col :span ="1.5" >
< el -button type = "danger" icon = "el-icon-delete" size = "mini" @click ="handleDeleteMesBaseProcessProdline" > 删 除 < / el -button >
< el -button type = "danger" icon = "el-icon-delete" size = "mini" @click ="handleDeleteMesBaseProcessProdline" > 删 除
< / e l - b u t t o n >
< / e l - c o l >
< / e l - r o w >
< el -table :data ="mesBaseProcessProdlineList" :row-class-name ="rowMesBaseProcessProdlineIndex" @selection-change ="handleMesBaseProcessProdlineSelectionChange" ref = "mesBaseProcessProdline" >
< el -table -column type = "selection" width = "50" align = "center" / >
< el -table -column label = "序号" align = "center" prop = "index" / >
<!-- < el -table -column label = "工序主键" align = "center" prop = "processId" / > -- >
<!-- < el -table -column label = "工序名称" align = "center" prop = "processName" / > -- >
< el -table -column label = "关联产线" align = "center" prop = "prodlineId" >
< el -table :data ="mesBaseProcessProdlineList" :row-class-name ="rowMesBaseProcessProdlineIndex"
@ selection - change = "handleMesBaseProcessProdlineSelectionChange" ref = "mesBaseProcessProdline" >
< el -table -column type = "selection" width = "50" align = "center" / >
< el -table -column label = "序号" align = "center" prop = "index" / >
<!-- < el -table -column label = "工序主键" align = "center" prop = "processId" / > -- >
<!-- < el -table -column label = "工序名称" align = "center" prop = "processName" / > -- >
< el -table -column label = "关联产线" align = "center" prop = "prodlineId" >
< template slot -scope = " scope " >
< el -select v -model = " scope.row.prodlineId " placeholder = "请选择关联产线" clearable >
< el -select v -model = " scope.row.prodlineId " placeholder = "请选择关联产线" clearable >
< el -option
v - for = "item in prodLineList"
: key = "item.prodlineId"
@ -252,18 +273,21 @@
< el -divider content -position = " center " > 工序关联人员信息 < / e l - d i v i d e r >
< el -row :gutter ="10" class = "mb8" >
< el -col :span ="1.5" >
< el -button type = "primary" icon = "el-icon-plus" size = "mini" @click ="handleAddMesBaseProcessUser" > 添 加 人 员 < / el -button >
< el -button type = "primary" icon = "el-icon-plus" size = "mini" @click ="handleAddMesBaseProcessUser" > 添 加 人 员
< / e l - b u t t o n >
< / e l - c o l >
< el -col :span ="1.5" >
< el -button type = "danger" icon = "el-icon-delete" size = "mini" @click ="handleDeleteMesBaseProcessUser" > 删 除 < / el -button >
< el -button type = "danger" icon = "el-icon-delete" size = "mini" @click ="handleDeleteMesBaseProcessUser" > 删 除
< / e l - b u t t o n >
< / e l - c o l >
< / e l - r o w >
< el -table :data ="mesBaseProcessUserList" :row-class-name ="rowMesBaseProcessUserIndex" @selection-change ="handleMesBaseProcessUserSelectionChange" ref = "mesBaseProcessUser" >
< el -table -column type = "selection" width = "50" align = "center" / >
< el -table -column label = "序号" align = "center" prop = "index" / >
< el -table -column label = "关联人员" align = "center" prop = "prodlineId" >
< el -table :data ="mesBaseProcessUserList" :row-class-name ="rowMesBaseProcessUserIndex"
@ selection - change = "handleMesBaseProcessUserSelectionChange" ref = "mesBaseProcessUser" >
< el -table -column type = "selection" width = "50" align = "center" / >
< el -table -column label = "序号" align = "center" prop = "index" / >
< el -table -column label = "关联人员" align = "center" prop = "prodlineId" >
< template slot -scope = " scope " >
< el -select v -model = " scope.row.userId " filterable placeholder = "请选择关联人员" clearable >
< el -select v -model = " scope.row.userId " filterable placeholder = "请选择关联人员" clearable >
< el -option
v - for = "item in userList"
: key = "item.userId"
@ -298,7 +322,7 @@ import {findUserList} from "@//api/system/user";
export default {
name : "ProcessInfo" ,
dicts : [ 'process_type' , 'active_flag' ] ,
dicts : [ 'process_type' , 'active_flag' ] ,
data ( ) {
return {
/ / 遮 罩 层
@ -347,27 +371,27 @@ export default {
/ / 表 单 校 验
rules : {
processName : [
{ required : true , message : "工序名称不能为空" , trigger : "blur" }
{ required : true , message : "工序名称不能为空" , trigger : "blur" }
] ,
processType : [
{ required : true , message : "工序类别不能为空" , trigger : "change" }
{ required : true , message : "工序类别不能为空" , trigger : "change" }
] ,
activeFlag : [
{ required : true , message : "激活标识不能为空" , trigger : "blur" }
{ required : true , message : "激活标识不能为空" , trigger : "blur" }
] ,
} ,
columns : [
{ key : 0 , label : ` 主键标识 ` , visible : false } ,
{ key : 1 , label : ` 工序编号 ` , visible : true } ,
{ key : 2 , label : ` 工序名称 ` , visible : true } ,
{ key : 3 , label : ` 工序类别 ` , visible : true } ,
{ key : 4 , label : ` 标准工时 (分钟) ` , visible : true } ,
{ key : 5 , label : ` 激活标识 ` , visible : false } ,
{ key : 6 , label : ` 备注 ` , visible : true } ,
{ key : 7 , label : ` 创建人 ` , visible : false } ,
{ key : 8 , label : ` 创建时间 ` , visible : true } ,
{ key : 9 , label : ` 更新人 ` , visible : false } ,
{ key : 10 , label : ` 更新时间 ` , visible : true } ,
{ key : 0 , label : ` 主键标识 ` , visible : false } ,
{ key : 1 , label : ` 工序编号 ` , visible : true } ,
{ key : 2 , label : ` 工序名称 ` , visible : true } ,
{ key : 3 , label : ` 工序类别 ` , visible : true } ,
{ key : 4 , label : ` 标准工时 ` , visible : true } ,
{ key : 5 , label : ` 激活标识 ` , visible : false } ,
{ key : 6 , label : ` 备注 ` , visible : true } ,
{ key : 7 , label : ` 创建人 ` , visible : false } ,
{ key : 8 , label : ` 创建时间 ` , visible : true } ,
{ key : 9 , label : ` 更新人 ` , visible : false } ,
{ key : 10 , label : ` 更新时间 ` , visible : true } ,
] ,
/ / 产 线 选 项
prodLineList : [ ] ,
@ -409,6 +433,9 @@ export default {
processName : null ,
processType : null ,
productionTime : null ,
productionTimeDays : 0 ,
productionTimeHours : 0 ,
productionTimeMinutes : 0 ,
activeFlag : '1' ,
remark : null ,
createBy : null ,
@ -429,6 +456,24 @@ export default {
this . resetForm ( "queryForm" ) ;
this . handleQuery ( ) ;
} ,
/** 天小时分钟转换为秒 */
convertToSeconds ( ) {
const daysInSeconds = this . form . productionTimeDays * 24 * 60 * 60 ;
const hoursInSeconds = this . form . productionTimeHours * 60 * 60 ;
const minutesInSeconds = this . form . productionTimeMinutes * 60 ;
this . form . productionTime = daysInSeconds + hoursInSeconds + minutesInSeconds ;
} ,
/** 秒转换为天小时分钟 */
convertToTime ( ) {
const totalSeconds = this . form . productionTime ;
const days = Math . floor ( totalSeconds / ( 24 * 60 * 60 ) ) ;
const hours = Math . floor ( ( totalSeconds % ( 24 * 60 * 60 ) ) / 3600 ) ;
const minutes = Math . floor ( ( totalSeconds % 3600 ) / 60 ) ;
/ / 更 新 到 表 单 中
this . form . productionTimeDays = days ;
this . form . productionTimeHours = hours ;
this . form . productionTimeMinutes = minutes ;
} ,
isProdlineDisabled ( prodlineId ) {
/ / 返 回 t r u e 表 示 禁 用 , f a l s e 表 示 可 用
return this . mesBaseProcessProdlineList . some ( item => item . prodlineId === prodlineId ) ;
@ -441,7 +486,7 @@ export default {
handleSelectionChange ( selection ) {
this . ids = selection . map ( item => item . processId )
this . idNames = selection . map ( item => item . processCode )
this . single = selection . length !== 1
this . single = selection . length !== 1
this . multiple = ! selection . length
} ,
/** 新增按钮操作 */
@ -457,6 +502,7 @@ export default {
getProcessInfo ( processId ) . then ( response => {
this . form = response . data ;
this . mesBaseProcessProdlineList = response . data . mesBaseProcessProdlineList ;
this . convertToTime ( ) ;
this . open = true ;
this . title = "修改工序信息" ;
} ) ;
@ -486,6 +532,13 @@ export default {
this . $refs [ "form" ] . validate ( valid => {
if ( valid ) {
this . form . mesBaseProcessProdlineList = this . mesBaseProcessProdlineList ;
if ( ! /^[0-9]\d*$/ . test ( this . form . productionTimeDays )
|| ! /^[0-9]\d*$/ . test ( this . form . productionTimeHours )
|| ! /^[0-9]\d*$/ . test ( this . form . productionTimeMinutes ) ) {
this . $modal . msgError ( "标准工时天、小时、分钟需为大于等于0的正整数! " ) ;
return ;
}
this . convertToSeconds ( ) ;
if ( this . form . processId != null ) {
updateProcessInfo ( this . form ) . then ( response => {
this . $modal . msgSuccess ( "修改成功" ) ;
@ -522,19 +575,20 @@ export default {
handleDelete ( row ) {
const processIds = row . processId || this . ids ;
const processCodes = row . processCode || this . idNames ;
this . $modal . confirm ( '是否确认删除工序编号为"' + processCodes + '"的数据项?' ) . then ( function ( ) {
this . $modal . confirm ( '是否确认删除工序编号为"' + processCodes + '"的数据项?' ) . then ( function ( ) {
return delProcessInfo ( processIds ) ;
} ) . then ( ( ) => {
this . getList ( ) ;
this . $modal . msgSuccess ( "删除成功" ) ;
} ) . catch ( ( ) => { } ) ;
} ) . catch ( ( ) => {
} ) ;
} ,
/** 工序关联产线序号 */
rowMesBaseProcessProdlineIndex ( { row , rowIndex } ) {
/** 工序关联产线序号 */
rowMesBaseProcessProdlineIndex ( { row , rowIndex } ) {
row . index = rowIndex + 1 ;
} ,
/** 工序关联产线序号 */
rowMesBaseProcessUserIndex ( { row , rowIndex } ) {
rowMesBaseProcessUserIndex ( { row , rowIndex } ) {
row . index = rowIndex + 1 ;
} ,
/** 工序关联产线添加按钮操作 */
@ -549,7 +603,7 @@ export default {
} else {
const mesBaseProcessProdlineList = this . mesBaseProcessProdlineList ;
const checkedMesBaseProcessProdline = this . checkedMesBaseProcessProdline ;
this . mesBaseProcessProdlineList = mesBaseProcessProdlineList . filter ( function ( item ) {
this . mesBaseProcessProdlineList = mesBaseProcessProdlineList . filter ( function ( item ) {
return checkedMesBaseProcessProdline . indexOf ( item . index ) == - 1
} ) ;
}
@ -571,7 +625,7 @@ export default {
} else {
const mesBaseProcessUserList = this . mesBaseProcessUserList ;
const checkedMesBaseProcessUser = this . checkedMesBaseProcessUser ;
this . mesBaseProcessUserList = mesBaseProcessUserList . filter ( function ( item ) {
this . mesBaseProcessUserList = mesBaseProcessUserList . filter ( function ( item ) {
return checkedMesBaseProcessUser . indexOf ( item . index ) == - 1
} ) ;
}