@ -34,7 +34,8 @@
size = "mini"
size = "mini"
@ click = "handleAdd"
@ click = "handleAdd"
v - hasPermi = "['mes:processInfo:add']"
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 >
< / e l - c o l >
< el -col :span ="1.5" >
< el -col :span ="1.5" >
< el -button
< el -button
@ -45,7 +46,8 @@
: disabled = "single"
: disabled = "single"
@ click = "handleUpdate"
@ click = "handleUpdate"
v - hasPermi = "['mes:processInfo:edit']"
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 >
< / e l - c o l >
< el -col :span ="1.5" >
< el -col :span ="1.5" >
< el -button
< el -button
@ -56,7 +58,8 @@
: disabled = "multiple"
: disabled = "multiple"
@ click = "handleDelete"
@ click = "handleDelete"
v - hasPermi = "['mes:processInfo:remove']"
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 >
< / e l - c o l >
< el -col :span ="1.5" >
< el -col :span ="1.5" >
< el -button
< el -button
@ -66,7 +69,8 @@
size = "mini"
size = "mini"
@ click = "handleExport"
@ click = "handleExport"
v - hasPermi = "['mes:processInfo:export']"
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 >
< / 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 >
< / e l - r o w >
@ -81,7 +85,11 @@
< dict -tag :options ="dict.type.process_type" :value ="scope.row.processType" / >
< dict -tag :options ="dict.type.process_type" :value ="scope.row.processType" / >
< / template >
< / template >
< / e l - t a b l e - c o l u m n >
< / 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 = "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" >
< el -table -column label = "激活标识" align = "center" prop = "activeFlag" v-if ="columns[5].visible" >
< template slot -scope = " scope " >
< template slot -scope = " scope " >
< dict -tag :options ="dict.type.active_flag" :value ="scope.row.activeFlag" / >
< dict -tag :options ="dict.type.active_flag" :value ="scope.row.activeFlag" / >
@ -114,13 +122,15 @@
type = "text"
type = "text"
icon = "el-icon-circle-plus"
icon = "el-icon-circle-plus"
@ click = "handleProdLineUpdate(scope.row)"
@ click = "handleProdLineUpdate(scope.row)"
> 关联产线 < / e l - b u t t o n >
> 关联产线
< / e l - b u t t o n >
< el -button
< el -button
size = "mini"
size = "mini"
type = "text"
type = "text"
icon = "el-icon-s-check"
icon = "el-icon-s-check"
@ click = "handleUserUpdate(scope.row)"
@ click = "handleUserUpdate(scope.row)"
> 关联人员 < / e l - b u t t o n >
> 关联人员
< / e l - b u t t o n >
< / template >
< / template >
< / e l - t a b l e - c o l u m n >
< / e l - t a b l e - c o l u m n >
@ -153,8 +163,16 @@
> < / e l - o p t i o n >
> < / e l - o p t i o n >
< / e l - s e l e c t >
< / e l - s e l e c t >
< / e l - f o r m - i t e m >
< / e l - f o r m - i t e m >
< el -form -item label = "标准工时(分钟)" prop = "productionTime" >
< el -form -item label = "标准工时" prop = "productionTime" >
< el -input -number v -model = " form.productionTime " placeholder = "请输入标准工时(分钟)" / >
< 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 >
< / e l - f o r m - i t e m >
< el -form -item label = "激活标识" prop = "activeFlag" >
< el -form -item label = "激活标识" prop = "activeFlag" >
< el -radio -group v-model ="form.activeFlag" >
< el -radio -group v-model ="form.activeFlag" >
@ -203,13 +221,16 @@
< el -divider content -position = " center " > 工序关联产线信息 < / e l - d i v i d e r >
< el -divider content -position = " center " > 工序关联产线信息 < / e l - d i v i d e r >
< el -row :gutter ="10" class = "mb8" >
< el -row :gutter ="10" class = "mb8" >
< el -col :span ="1.5" >
< 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 >
< / e l - c o l >
< el -col :span ="1.5" >
< 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 - c o l >
< / e l - r o w >
< / e l - r o w >
< el -table :data ="mesBaseProcessProdlineList" :row-class-name ="rowMesBaseProcessProdlineIndex" @selection-change ="handleMesBaseProcessProdlineSelectionChange" ref = "mesBaseProcessProdline" >
< 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 type = "selection" width = "50" align = "center" / >
< el -table -column label = "序号" align = "center" prop = "index" / >
< el -table -column label = "序号" align = "center" prop = "index" / >
<!-- < el -table -column label = "工序主键" align = "center" prop = "processId" / > -- >
<!-- < el -table -column label = "工序主键" align = "center" prop = "processId" / > -- >
@ -252,13 +273,16 @@
< el -divider content -position = " center " > 工序关联人员信息 < / e l - d i v i d e r >
< el -divider content -position = " center " > 工序关联人员信息 < / e l - d i v i d e r >
< el -row :gutter ="10" class = "mb8" >
< el -row :gutter ="10" class = "mb8" >
< el -col :span ="1.5" >
< 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 >
< / e l - c o l >
< el -col :span ="1.5" >
< 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 - c o l >
< / e l - r o w >
< / e l - r o w >
< el -table :data ="mesBaseProcessUserList" :row-class-name ="rowMesBaseProcessUserIndex" @selection-change ="handleMesBaseProcessUserSelectionChange" ref = "mesBaseProcessUser" >
< 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 type = "selection" width = "50" align = "center" / >
< el -table -column label = "序号" align = "center" prop = "index" / >
< el -table -column label = "序号" align = "center" prop = "index" / >
< el -table -column label = "关联人员" align = "center" prop = "prodlineId" >
< el -table -column label = "关联人员" align = "center" prop = "prodlineId" >
@ -361,7 +385,7 @@ export default {
{ key : 1 , label : ` 工序编号 ` , visible : true } ,
{ key : 1 , label : ` 工序编号 ` , visible : true } ,
{ key : 2 , label : ` 工序名称 ` , visible : true } ,
{ key : 2 , label : ` 工序名称 ` , visible : true } ,
{ key : 3 , label : ` 工序类别 ` , visible : true } ,
{ key : 3 , label : ` 工序类别 ` , visible : true } ,
{ key : 4 , label : ` 标准工时 (分钟) ` , visible : true } ,
{ key : 4 , label : ` 标准工时 ` , visible : true } ,
{ key : 5 , label : ` 激活标识 ` , visible : false } ,
{ key : 5 , label : ` 激活标识 ` , visible : false } ,
{ key : 6 , label : ` 备注 ` , visible : true } ,
{ key : 6 , label : ` 备注 ` , visible : true } ,
{ key : 7 , label : ` 创建人 ` , visible : false } ,
{ key : 7 , label : ` 创建人 ` , visible : false } ,
@ -409,6 +433,9 @@ export default {
processName : null ,
processName : null ,
processType : null ,
processType : null ,
productionTime : null ,
productionTime : null ,
productionTimeDays : 0 ,
productionTimeHours : 0 ,
productionTimeMinutes : 0 ,
activeFlag : '1' ,
activeFlag : '1' ,
remark : null ,
remark : null ,
createBy : null ,
createBy : null ,
@ -429,6 +456,24 @@ export default {
this . resetForm ( "queryForm" ) ;
this . resetForm ( "queryForm" ) ;
this . handleQuery ( ) ;
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 ) {
isProdlineDisabled ( prodlineId ) {
/ / 返 回 t r u e 表 示 禁 用 , f a l s e 表 示 可 用
/ / 返 回 t r u e 表 示 禁 用 , f a l s e 表 示 可 用
return this . mesBaseProcessProdlineList . some ( item => item . prodlineId === prodlineId ) ;
return this . mesBaseProcessProdlineList . some ( item => item . prodlineId === prodlineId ) ;
@ -457,6 +502,7 @@ export default {
getProcessInfo ( processId ) . then ( response => {
getProcessInfo ( processId ) . then ( response => {
this . form = response . data ;
this . form = response . data ;
this . mesBaseProcessProdlineList = response . data . mesBaseProcessProdlineList ;
this . mesBaseProcessProdlineList = response . data . mesBaseProcessProdlineList ;
this . convertToTime ( ) ;
this . open = true ;
this . open = true ;
this . title = "修改工序信息" ;
this . title = "修改工序信息" ;
} ) ;
} ) ;
@ -486,6 +532,13 @@ export default {
this . $refs [ "form" ] . validate ( valid => {
this . $refs [ "form" ] . validate ( valid => {
if ( valid ) {
if ( valid ) {
this . form . mesBaseProcessProdlineList = this . mesBaseProcessProdlineList ;
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 ) {
if ( this . form . processId != null ) {
updateProcessInfo ( this . form ) . then ( response => {
updateProcessInfo ( this . form ) . then ( response => {
this . $modal . msgSuccess ( "修改成功" ) ;
this . $modal . msgSuccess ( "修改成功" ) ;
@ -527,7 +580,8 @@ export default {
} ) . then ( ( ) => {
} ) . then ( ( ) => {
this . getList ( ) ;
this . getList ( ) ;
this . $modal . msgSuccess ( "删除成功" ) ;
this . $modal . msgSuccess ( "删除成功" ) ;
} ) . catch ( ( ) => { } ) ;
} ) . catch ( ( ) => {
} ) ;
} ,
} ,
/** 工序关联产线序号 */
/** 工序关联产线序号 */
rowMesBaseProcessProdlineIndex ( { row , rowIndex } ) {
rowMesBaseProcessProdlineIndex ( { row , rowIndex } ) {