@@ -1,576 +1,455 @@
< template >
< div class = "app-container" >
< el-row >
< el-col style = "width: 29 0px" >
< el-card >
< el-row >
< el-button type = "distribution" style = "m argin: 10px 10px 3px 0 " i con= "el-icon-circle-plus-outline" size = "small" @click ="addProcessClassification()" > 新增 < / el -button >
< el-button size = "small" style = "margin: 10px 10px 3px 0" type = "warning " icon = "el-icon-edit -outline" plain @click ="editProcessClassification ()"> 编辑 < / el -button >
< el-button size = "small" s tyl e= "margin: 10px 0 3px 0 " typ e= "danger " icon = "el-icon-delete" plain @click ="delProcessClassification ()" > 删除 < / el -button >
< el-table v-loading = "loading1" ref="multipleTable" :data="tableData1" size="mini" highlight-current-row stripe border tooltip-effect="dark" style="width: 100%" height="600" >
< el -table -column align = "center" label = " " width = "50px" >
< template slot -scope = " scope " >
< el-radio :label = "scope.row.工艺分类流水号" v-model = "radio" @change.native="getCurrentRow(scope.row.工艺分类流水号, scope.row.工艺分类名称)" >
{{ a }}
< / el -radio >
< / template >
< / el-table-column >
< el-table-column align = "center " label = "工艺分类 " >
< template slot -scope = " scope " >
{ { scope . row . 工艺分类名称 } }
< / template >
< / el-table-column >
< / el-table >
< / el-row >
< / el-card >
< / el-col >
< el-col style = "width: 550px;" >
< el-card >
< el-button type = "primary" plain styl e = "margin: 10px 0 3px 0" icon = "el-icon-circle-plus-outline" size = "small" @click ="addProcess" > 新增工艺名称 < / el -button >
< el-table :data = "tableData2" :row-key = "getRowKeys" size = "mini" highlight -current -row stripe border height = "600 " width = "100% " >
<!-- < el-table-column ty pe ="expand" label = "详情" > -- >
<!-- < template slot -scope = " scope " > -- >
<!-- < el-table :data = "tableData3" class = "subTableHeader" border stripe size = "mini" style = "width: 40%" > -- >
<!-- < el-table-column label = "工艺要求" align = "center" > -- >
<!-- < template slot -scope = " scope " > -- >
<!-- { { scope . row . 工艺要求 } } -- >
<!-- < / template > -- >
<!-- < / el-table-column > -- >
<!-- < el-table-column label = "操作" align = "center" > -- >
<!-- < template slot -scope = " scope " > -- >
<!-- < el-tooltip effect = "dark" content = "编辑" placement = "top" > -- >
<!-- < div style = "display: inline-block" > -- >
<!-- < el-button-- >
<!-- size = "mini" -- >
<!-- type = "text" -- >
<!-- icon = "el-icon-edit-outline" -- >
<!-- @ click = "editTechnologicalRequirements(scope.row)" / > -- >
<!-- < / div > -- >
<!-- < / el-tooltip > -- >
<!-- < el-tooltip effect = "dark" content = "删除" placement = "top "> -- >
<!-- < div styl e ="display: inline-block "> -- >
<!-- < el-button-- >
<!-- size = "mini" -- >
<!-- type = "text" -- >
<!-- style = "margin-left: 20px" -- >
<!-- icon = "el-icon-delete" -- >
<!-- @ click = "delTechnologicalRequirements(scope.row)" / > -- >
<!-- < / div > -- >
<!-- < / el-tooltip > -- >
<!-- < / template > -- >
<!-- < / el-table-column > -- >
<!-- < / el-table > -- >
<!-- < / template > -- >
<!-- < / el-table-column > -- >
< el-table-column label = "工艺名称 " align = "center" width = "200" >
< template slot -scope = " scope " >
{ { scope . row . 工艺名称 } }
< / template >
< / el-table-column >
< el-table-column label = "工艺要求 " align = "center" width = "200" >
< template slot -scope = " scope " >
{ { scope . row . 工艺要求 } }
< / template >
< / el-table-column >
< el-table-column align = "center" label = "操作" >
< template slot -scope = " scope " >
< el-tooltip :open-delay = "1200" effect = "dark" content = "编辑" placement = "top" >
< div style = "display: inline-block" >
< el-button type = "text" size = "mini" icon = "el-icon-edit-outline" style = "margin-left: 10px" @click ="editProcess(scope.row)" / >
< / div >
< / el -tooltip >
< el-tooltip :open-delay = "1200" effect = "dark " content = "删除" placement = "top " >
< div style = "display: inline-block " >
< el-button type = "text" size = "mini" icon = "el-icon-delete" style = "margin-left: 10px" @click ="delProcess(scope.row)" / >
< /div >
< / el-tooltip >
<!-- < el-button size = "mini " typ e = "primary" plain icon = "el-icon-circle-plus-outline" @click ="addTechnologicalRequirements(scope.row)" > 新增要求 < / el -button > -- >
< / template >
< / el-table-column >
< / el-table >
< / el-card >
< / el-col >
< / el-row >
< el-dialog v-el-drag-dialog :visible.sync = "dialogFormVisible1" title = "新增工艺分类" center style = "min-height: 300px" width = "400px" >
< el-form ref = "form1" :model = "form1" :rules = "rules1" label -position = " left " label -width = " 110px " >
< el-form-item label = "工艺分类" prop = "ProcessClassification" >
< el-input v-model = "form1.ProcessClassification" size="small" clearable style="width:200px" / >
</ el -form -item >
< el-card style = "padding: 3px" >
< el-input v-model = "equipmentName" placeholder="设备名称" size="small" clearable style="width:200px;margin-left: 0px" / >
< ! - - < el -button type = "success" size = "small" icon = "el-icon-search" style = "margin-left:30px;background: #ecf5ff;border-color: #2d72d5;color: #2d72d5;" @click ="pageCurrent = 1;fetchData()" > 查询 < / el -button > -- >
< el-button type = "primary" icon = "el-icon-search" size = "small" style = "margin-left: 20px" plain @click ="PageSize = 10;PageCurrent = 1;fetchData()" > 查询 < / el -button >
< el-tooltip effect = "d ark " content = "添加新设备" placement = "top" >
< el-button class = "button111 " icon = "el-icon-circle-plus -outline" size = "small" style = "margin-left: 10px" @click ="ADD ()"> 新增 < / el -button >
<!-- < el-button typ e = "primary " siz e= "small " icon = "el-icon-circle-plus-outline" plain style = "margin-left:10px;background: #fdf6ec;border-color: #ff9759;color: #ff9759;" @click ="handleAdd ()" > 新增 < / el -button > -- >
< / el-tooltip >
<!-- < span style = "margin-left: 40px" > 有效时间 : < / span > -- >
<!-- < el-date-picker-- >
<!-- v - model = "time" -- >
<!-- type = "date" -- >
<!-- size = "small" -- >
<!-- value - format = "yyyy-MM-dd" -- >
<!-- placeholder = "选择日期" / > -- >
<!-- < el-tooltip :open-delay = "1200" effect = "dark" content = "设定设备参数有效时间 " p lacement = "top " > -- >
<!-- & lt ; ! & ndash ; < el-button type = "primary" size = "small" icon = "el-icon-setting" style = "margin-left:10px;background: #fdf6ec;border-color: #ff9759;color: #ff9759;" @click ="setUp" > 设定 < / el -button > & ndash ; & gt ; -- >
<!-- < el-button type = "warning" size = "small" icon = "el-icon-setting" plain style = "margin-left:10px" @click ="setUp" > 设定 < / el -button > -- >
<!-- < / el-tooltip > -- >
<!-- < el-tooltip effect = "dark" content = "生成有效时间内设备加工能力" placement = "top" > -- >
<!-- & lt ; ! & ndash ; < el-button type = "success" size = "small" icon = "el-icon-edit-outline" style = "margin-left:10px;background: #ecf5ff;border-color: #2d72d5;color: #2d72d5;" @click ="generate" > 生成设备加工能力 < / el -button > & ndash ; & gt ; -- >
<!-- < el-button type = "primary" size = "small" icon = "el-icon-edit-outline" plain style = "margin-left:10px" @click ="generate" > 生成设备加工能力 < / el-button > -- >
<!-- < / el-tooltip > -- >
< / el-card >
< el-card >
< el-table :data = "List" border siz e = "s mall" stripe highlight -current -row height = "700px" style = "width: 570px" >
< el-table-column label = "设备名称" prop = "设备名称" align = "center " width = "120px " >
< template slot -sco pe =" scope " >
{ { scope . row . 设备名称 } }
< / template >
< / el-table-column >
< el-table-column label = "设备编号" prop = "设备编号" align = "center" width = "120px " >
< template slot -scope = " scope " >
{ { scope . row . 设备编号 } }
< / template >
< / el-table-column >
< el-table-column label = "设备型号" rop = "设备型号" align = "center" width = "120px " >
< template slot -scope = " scope " >
{ { scope . row . 设备型号 } }
< / template >
< / el-table-column >
<!-- < el-table-column label = "设备性能指标" align = "center" > -- >
<!-- < template slot -scope = " scope " > -- >
<!-- { { scope . row . 设备性能指标 } } -- >
<!-- < / template > -- >
<!-- < / el-table-column > -- >
<!-- < el-table-column label = "设备加工能力" align = "center " > -- >
<!-- < template slot -scop e =" scope "> p -- >
<!-- { { scope . row . 设备加工能力工时 } } -- >
<!-- < / template > -- >
<!-- < / el-table-column > -- >
< el-table-column label = "设备加工工艺" align = "center" width = "1 20px" >
< template slot -scope = " scope " >
{ { scope . row . 工艺属性 } }
< / template >
< / el-table-column >
<!-- < el-table-column label = "班次类型" align = "center" > -- >
<!-- < template slot -scope = " scope " > -- >
<!-- { { scope . row . 班次类型 } } -- >
<!-- < / template > -- >
<!-- < / el-table-column > -- >
<!-- < el-table-column label = "设备工时系数 " align = "center" > -- >
<!-- < template slot -scope = " scope " > -- >
<!-- { { scope . row . 设备工时系数 } } -- >
<!-- < / template > -- >
<!-- < / el-table-column > -- >
<!-- < el-table-column label = "整改工时系数 " align = "center" > -- >
<!-- < template slot -scope = " scope " > -- >
<!-- { { scope . row . 整改工时比例 } } -- >
<!-- < / template > -- >
<!-- < / el-table-column > -- >
<!-- < el-table-column label = "预留工时系数" align = "center" > -- >
<!-- < template slot -scope = " scope " > -- >
<!-- { { scope . row . 设备预留工时系数 } } -- >
<!-- < / template > -- >
<!-- < / el-table-column > -- >
< el-table-column label = "操作" align = "center" width = "70px" >
< template slot -scope = " scope " >
< el-button type = "text" size = "mini " i con= "el-icon-edit" style = "margin-left:5px" @click ="handleEdit(scope.row) " / >
< el -button type = "text" size = "mini" icon = "el-icon-delete" style = "margin-left:5px" @click ="handleDelete(scope.row) "/ >
< / template >
< /el -table -column >
< / el-table >
<!-- < div class = "block " s tyl e= "margin-top: 10px;" > -- >
<!-- < el-pagination-- >
<!-- : current - page = "pageCurrent" -- >
<!-- : page - sizes = "[10, 20, 30, 40]" -- >
<!-- : page - size = "pageSize" -- >
<!-- : total = "total" -- >
<!-- layout = "total, sizes, prev, pager, next, jumper" -- >
<!-- @ size - change = "handleSizeChange" -- >
<!-- @ current - change = "handleCurrentChange" / > -- >
<!-- < / div > -- >
< / el-card >
<!-- <el-card > -- >
<!-- < span > 有效时间 : < / span > -- >
<!-- < el-date-picker-- >
<!-- v - model = "time" -- >
<!-- type = "date" -- >
<!-- size = "small" -- >
<!-- value - format = "yyyy-MM-dd" -- >
<!-- placeholder = "选择日期" / > -- >
<!-- < el-tooltip :open-delay = "1200" effect = "dark" content = "设定设备参数有效时间" placement = "top" > -- >
<!-- < el-button type = "primary" size = "small" icon = "el-icon-setting" style = "margin-left:10px" @click ="setUp" > 设定 < / el -button > -- >
<!-- < / el-tooltip > -- >
<!-- < el-tooltip effect = "dark" content = "生成有效时间内设备加工能力" placement = "top" > -- >
<!-- < el-button type = "success" size = "small" icon = "el-icon-edit-outline" style = "margin-left:10px" @click ="generate" > 生成设备加工能力 < / el -button > -- >
<!-- < / el-tooltip > -- >
<!-- < / el-card > -- >
< el-dialog v-el-drag-dialog :title = "title" :visible.sync = "dialogFormVisible" center style = "min-height: 300px" width = "800px" >
< el-form ref = "form" :model = "form" :rules = "rules" label -position = " left " label -width = " 120px " class = "demo-ruleForm" >
< el-row >
< el-col : span = "12" >
< el-form-item label = "设备名称" prop = "设备名称" >
< el-input v-model = "form.设备名称" placeholder="设备名称" size="small" style="width:200px" clearable / >
< / el-form-item >
< / el-col >
< el-col : span = "12" >
< el-form-item label = "设备编号" prop = "设备编号" >
< el-input v-model = "form.设备编号" placeholder="设备编号" size="small" style="width:200px" clearable / >
< / el-form-item >
< / el-col >
< / el-row >
< el-row >
< el-col : span = "12" >
< el-form-item label = "设备型号" prop = "设备型号" >
< el-input v-model = "form.设备型号" placeholder="设备型号" size="small" style="width:200px" clearable / >
< / el-form-item >
< / el-col >
< el-col : span = "12" >
< el-form-item label = "设备加工工艺" prop = "设备加工工艺" >
< el-select v-model = "form.设备加工工艺" placeholder="设备加工工艺" filterable size="small" style="width:200px" clearable >
< el-option
v-for = "item in processingName"
:key = "item.value"
:label = "item.label"
:value = "item.value" / >
< / el-select >
< / el-form-item >
< / el-col >
< / el-row >
< el-row v-show = "false" >
< el -col : span = "12" >
< el-form-item label = "设备加工能力" prop = "设备加工能力" >
< el-input v-model = "form.设备加工能力" placeholder="设备加工能力" size="small" style="width:200px" clearable / >
< / el-form-item >
< / el-col >
< el-col : span = "12" >
< el-form-item label = "设备性能指标" prop = "设备性能指标" >
< el-input v-model = "form.设备性能指标" placeholder="设备性能指标" size="small" style="width:200px" clearable / >
< / el-form-item >
< / el-col >
< / el-row >
< el-row v-show = "false" >
< el -col : span = "12" >
< el-form-item label = "班次类型" prop = "班次类型" >
< el-select v-model = "form.班次类型" placeholder="班次类型" size="small" style="width:200px" clearable >
< el-option
v-for = "item in typeOfShift"
:key = "item.value"
:label = "item.label"
:value = "item.value" / >
< / el-select >
< / el-form-item >
< / el-col >
< el-col : span = "12" >
< el-form-item label = "设备工时系数" prop = "设备工时系数" >
< el-input v-model = "form.设备工时系数" placeholder="设备工时系数" size="small" style="width:200px" clearable / >
< / el-form-item >
< / el-col >
< / el-row >
< el-row v-show = "false" >
< el -col : span = "12" >
< el-form-item label = "整改工时系数" prop = "整改工时系数" >
< el-input v-model = "form.整改工时系数" placeholder="整改工时系数" size="small" style="width:200px" clearable / >
< / el-form-item >
< / el-col >
< el-col : span = "12" >
< el-form-item label = "预留工时系数" prop = "预留工时系数" >
< el-input v-model = "form.预留工时系数" placeholder="预留工时系数" size="small" style="width:200px" clearable / >
< / el-form-item >
< / el-col >
< / el-row >
< / el-form >
< div slot = "footer" class = "dialog-footer" >
< el-button @click ="callo ff" > 取 消 < / el -button >
< el-button type = "primary" @click ="submit1 ('form1 ')" > 确 定 < / el -button >
< / div >
< / el-dialog >
< el-dialog v-el-drag-dialog :visible.sync = "dialogFormVisible2" title = "编辑工艺分类" center style = "min-height: 300px" width = "400px" >
< el-form ref = "form1" :model = "form1" :rules = "rules1" label -position = " left " label -width = " 110px " >
< el-form-item label = "工艺分类" prop = "ProcessClassification" >
< el-input v-model = "form1.ProcessClassification" size="small" clearable style="width:200px" />
< / el -form -item >
< / el-form >
< div slot = "footer" class = "dialog-footer" >
< el-button @click ="calloff" > 取 消 < / el -button >
< el-button type = "primary" @click ="submit1('form1')" > 确 定 < / el -button >
< / div >
< / el-dialog >
< el-dialog v-el-drag-dialog :visible.sync = "dialogFormVisible3" title = "新增工艺" center style = "min-height: 300px" width = "400px" >
< el-form ref = "form2" :model = "form2" :rules = "rules2" label -position = " left " label -width = " 110px " >
< el-form-item label = "工艺名称" prop = "Process" >
< el-input v-model = "form2.Process" size="small" clearable style="width:200px" />
< / el -form -item >
< el-form-item label = "工艺名称简称" prop = "ProcessShort" >
< el-input v-model = "form2.ProcessShort" size="small" clearable style="width:200px" />
< / el -form -item >
< / el-form >
< div slot = "footer" class = "dialog-footer" >
< el-button @click ="calloff" > 取 消 < / el -button >
< el-button type = "primary" @click ="submit1('form2')" > 确 定 < / el -button >
< / div >
< / el-dialog >
< el-dialog v-el-drag-dialog :visible.sync = "dialogFormVisible4" title = "编辑工艺" center style = "min-height: 300px" width = "400px" >
< el-form ref = "form2" :model = "form2" :rules = "rules2" label -position = " left " label -width = " 110px " >
< el-form-item label = "工艺名称" prop = "Process" >
< el-input v-model = "form2.Process" size="small" clearable style="width:200px" />
< / el -form -item >
< el-form-item label = "工艺名称简称" prop = "ProcessShort" >
< el-input v-model = "form2.ProcessShort" size="small" clearable style="width:200px" />
< / el -form -item >
< el-form-item label = "工艺要求" prop = "Process" >
< el-input v-model = "form2.Requirement" size="small" clearable style="width:200px" />
< / el -form -item >
< / el-form >
< div slot = "footer" class = "dialog-footer" >
< el-button @click ="calloff" > 取 消 < / el -button >
< el-button type = "primary" @click ="submit1('form2')" > 确 定 < / el -button >
< / div >
< / el-dialog >
< el-dialog v-el-drag-dialog :visible.sync = "dialogFormVisible5" title = "新增工艺要求" center style = "min-height: 300px" width = "400px" >
< el-form ref = "form3" :model = "form3" :rules = "rules3" label -position = " left " label -width = " 110px " >
< el-form-item label = "工艺要求" prop = "Process" >
< el-input v-model = "form3.TechnologicalRequirements" size="small" clearable style="width:200px" />
< / el -form -item >
< / el-form >
< div slot = "footer" class = "dialog-footer" >
< el-button @click ="calloff" > 取 消 < / el -button >
< el-button type = "primary" @click ="submit1('form3')" > 确 定 < / el -button >
< / div >
< / el-dialog >
< el-dialog v-el-drag-dialog :visible.sync = "dialogFormVisible6" title = "编辑工艺要求" center style = "min-height: 300px" width = "400px" >
< el-form ref = "form3" :model = "form3" :rules = "rules3" label -position = " left " label -width = " 110px " >
< el-form-item label = "工艺要求" prop = "TechnologicalRequirements" >
< el-input v-model = "form3.TechnologicalRequirements" size="small" clearable style="width:200px" />
< / el -form -item >
< / el-form >
< div slot = "footer" class = "dialog-footer" >
< el-button @click ="calloff" > 取 消 < / el -button >
< el-button type = "primary" @click ="submit1('form3')" > 确 定 < / el -button >
< el-button @click ="callO ff('form') " > 取消 < / el -button >
< el-button type = "primary" @click ="submit('form')" > 确定 < / el -button >
< / div >
< / el-dialog >
< / div >
< / template >
< script >
import { searchProcessClassification , searchProcessNameOfProcessClassification , searchTechnologicalRequirementsOfProcessNum , searchProcessClassificationOfProcessClassificationNum , addProcessClassification , editProcessClassification , delProcessClassification , addProcess , delProcess , editProcess , addTechnologicalRequirements , editTechnologicalRequirements , delTechnologicalRequirements } from '@/api/BasicData/WorkshopProcessMaintenance '
import { getData , initProcessing , addTable , editTable , deleteTable , setUp , generate } from '@/api/ManufacturingCenter/WorkshopEquipmentManagement '
import { getNowTime } from '@/utils/tool'
export default {
data ( ) {
return {
// 工艺分类所需变量
a : '' ,
expands : [ ] ,
tableData1 : [ ] ,
ProcessNum : '' ,
loading1 : false ,
loading2 : false ,
loading3 : false ,
ProcessClassificationNum : '' ,
radio : null ,
dialogFormVisible1 : false ,
dialogFormVisible2 : false ,
dialogFormVisible3 : false ,
dialogFormVisible4 : false ,
dialogFormVisible5 : false ,
dialogFormVisible6 : false ,
temp : null ,
ProcessClassificationNumS : '' ,
form1 : {
ProcessClassification : ''
equipmentName : '' , // 设备名称
List : [ ] ,
check : 0 ,
time : '' ,
pageCurrent : 1 ,
pageSize : 10 ,
total : null ,
title : '' ,
dialogFormVisible : false ,
processingName : [ ] ,
processing1 : '' , // 工艺名称简称
equipmentSerialNumber : '' , // 设备流水号
typeOfShift : [
{ value : '0' , label : 0 } ,
{ value : '1' , label : 1 } ,
{ value : '2' , label : 2 } ,
{ value : '3' , label : 3 } ,
{ value : '4' , label : 4 } ] ,
form : {
设备名称 : '' ,
设备编号 : '' ,
设备型号 : '' ,
设备性能指标 : '' ,
设备加工能力 : '' ,
设备加工工艺 : '' ,
班次类型 : '' ,
设备工时系数 : '' ,
整改工时系数 : '' ,
预留工时系数 : ''
} ,
form2 : {
Process : '' ,
ProcessShort : '' ,
Requirement : ''
} ,
form3 : {
TechnologicalRequirements : ''
} ,
rules1 : {
ProcessClassification : [ { required : true , message : '请输入工艺分类名称' , trigger : 'blur' } ]
} ,
rules2 : {
Process : [ { required : true , message : '请输入工艺名称' , trigger : 'blur' } ] ,
ProcessShort : [ { required : true , message : '请输入工艺名称简称' , trigger : 'blur' } ]
} ,
rules3 : {
TechnologicalRequirements : [ { required : true , message : '请输入工艺要求' , trigger : 'blur' } ]
} ,
tableData2 : [ ] ,
tableData3 : [ ] ,
Num : [ ] ,
maxNum : '' ,
max : [ ] ,
code : ''
rules : {
设备名称 : [ { required : true , message : '请选择设备名称' , change : 'blur' } ] ,
设备编号 : [ { required : true , message : '请选择设备编号' , change : 'blur' } ] ,
设备型号 : [ { required : true , message : '请选择设备型号' , change : 'blur' } ] ,
设备加工工艺 : [ { required : true , message : '请选择设备加工工艺' , trigger : 'blur' } ]
// 设备加工能力: [{ required: true, message: '请选择设备加工能力', change: 'blur' }],
// 班次类型: [{ required: true, message: '请选择班次类型', trigger: 'blur' }],
// 设备工时系数: [{ required: true, message: '请选择设备工时系数', change: 'blur' }],
// 整改工时系数: [{ required: true, message: '请选择整改工时系数', change: 'blur' }],
// 预留工时系数: [{ required: true, message: '请选择预留工时系数', change: 'blur' }]
}
}
} ,
created ( ) {
this . searchProcessClassific ation( )
this . initializ ation( )
this . fetchData ( )
} ,
methods : {
searchProcessClassification ( ) {
this . loading1 = true
searchProcessClassification ( ) . then ( response => {
this . loading1 = false
this . tableData1 = response . data
this . total1 = response . data
return this . tableData1
} ) . then ( data => {
this . Num = data
this . max = [ ]
for ( let i = 0 ; i < this . Num . length ; i ++ ) {
this . max . push ( this . Num [ i ] . 工艺分类流水号 )
}
return this . max
} ) . then ( data => {
const a = data
this . maxNum = a [ 0 ]
for ( let j = 0 ; j < a . length ; j ++ ) {
if ( this . maxNum < a [ j ] ) {
this . maxNum = a [ j ]
}
}
return this . maxNum
} ) . then ( data => {
const b = data
this . radio = b
return this . radio
} ) . then ( data => {
const c = data
this . loading2 = true
searchProcessNameOfProcessClassification ( c ) . then ( response => {
this . loading2 = false
this . tableData2 = response . data
} )
} )
} ,
addProcessClassification ( ) {
if ( this . $refs [ 'form1' ] !== undefined ) {
this . $refs [ 'form1' ] . resetFields ( )
}
this . form1 = { }
this . dialogFormVisible1 = true
this . temp = 1
} ,
editProcessClassification ( ) {
if ( this . radio !== '' ) {
this . temp = 2
this . dialogFormVisible2 = true
searchProcessClassificationOfProcessClassificationNum ( this . radio ) . then ( response => {
this . form1 . ProcessClassification = response . data [ 0 ] . 工艺分类名称
} )
fetchData ( ) {
this . List = [ ]
if ( this . equipmentName !== '' ) {
this . check = 1
} else {
this . $message . warning ( '请选择工艺分类' )
this . check = 0
}
getData ( this . check , this . equipmentName , this . pageCurrent , this . pageSize ) . then ( response => {
this . List = response . data
// this.total = response.data.total
} )
} ,
submitProcessClassific ation( ) {
ed itProcessClassification ( this . radio , this . form1 . ProcessClassification ) . then ( response => {
i f ( response . data [ 0 ] . result === '1' ) {
this . $message . success ( '信息更新成功' )
this . dialogFormVisible2 = false
this . searchProcessClassification ( )
} else {
this . $message . error ( '信息更新失败' )
initializ ation( ) {
in itProcessing ( ) . then ( response => {
for ( let i = 0 ; i < response . data . length ; i ++ ) {
this . processingName . push ( {
label : response . data [ i ] . 工艺名称 ,
value : response . data [ i ] . 工艺编号 ,
processing : response . data [ i ] . 工艺名称简称
} )
}
} )
} ,
submitaddProcessClassification ( ) {
addProcessClassification ( this . form1 . ProcessClassification ) . then ( response => {
if ( response . data [ 0 ] . result === '1' ) {
this . $message . success ( '增加成功' )
this . searchProcessClassification ( )
this . dialogFormVisible1 = false
} else { this . $message . error ( '增加失败' ) }
} )
handleAdd ( ) {
if ( this . $refs [ 'form' ] !== undefined ) {
this . $ refs [ 'form' ] . resetFields ( )
}
this . title = '新增车间设备'
this . form = {
设备名称 : '' ,
设备编号 : '' ,
设备型号 : '' ,
设备加工工艺 : ''
}
this . form . 设备性能指标 = 1
this . form . 设备加工能力 = 1
this . form . 班次类型 = 1
this . form . 设备工时系数 = 1
this . form . 整改工时系数 = 0
this . form . 预留工时系数 = 0
this . dialogFormVisible = true
} ,
subm it1 ( formName ) {
handleEd it( row ) {
if ( this . $refs [ 'form' ] !== undefined ) {
this . $refs [ 'form' ] . resetFields ( )
}
this . title = '编辑'
this . dialogFormVisible = true
this . form . 设备名称 = row . 设备名称
this . form . 设备编号 = row . 设备编号
this . form . 设备型号 = row . 设备型号
this . form . 设备性能指标 = row . 设备性能指标
this . form . 设备加工能力 = row . 设备加工能力工时
this . form . 设备加工工艺 = parseInt ( row . 工艺属性代码 )
this . form . 班次类型 = row . 班次类型
this . form . 设备工时系数 = row . 设备工时系数
this . form . 整改工时系数 = row . 整改工时比例
this . form . 预留工时系数 = row . 设备预留工时系数
this . equipmentSerialNumber = row . 设备流水号
} ,
submit ( formName ) {
console . log ( this . title )
this . $refs [ formName ] . validate ( ( valid ) => {
if ( valid ) {
if ( this . temp === 1 ) {
this . submita ddProcessClassification ( )
this . form1 = {
ProcessClassification : ''
}
this . temp = null
} else if ( this . temp === 2 ) {
this . submitProcessClassification ( )
this . form1 = {
ProcessClassification : ''
}
this . temp = null
} else if ( this . temp === 3 ) {
this . submitaddProcess ( )
this . form2 = {
Process : '' ,
ProcessShort : ''
}
this . temp = null
} else if ( this . temp === 4 ) {
this . submiteditProcess ( )
this . form2 = {
Process : '' ,
ProcessShort : '' ,
Requirement : ''
}
this . temp = null
} else if ( this . temp === 5 ) {
this . submitTechnologicalRequirements ( )
this . form3 = {
TechnologicalRequirements : ''
}
this . temp = null
} else if ( this . temp === 6 ) {
this . submiteditTechnologicalRequirements ( )
this . form3 = {
TechnologicalRequirements : ''
}
this . temp = null
if ( this . title === '增加' ) {
this . submitA dd ( )
} else if ( this . title === '编辑' ) {
this . submitEdit ( )
}
}
} )
} ,
delProcessClassification ( ) {
i f ( this . radio !== '' ) {
this . $confirm ( '此操作将永久删除该行, 是否继续?' , '提示' , {
confirmButtonText : '确定' ,
cancelButtonText : '取消' ,
type : 'warning'
} ) . then ( ( ) => {
delProcessClassification ( this . radio ) . then ( response => {
if ( response . data [ 0 ] . result === '1' ) {
this . searchProcessClassification ( )
this . $message . success ( '删除成功' )
} else {
this . $message . error ( '删除失败' )
}
} )
} )
} else {
this . $message . warning ( '请选择工艺分类' )
submitAdd ( ) {
for ( let i = 0 ; i < this . processingName . length ; i ++ ) {
if ( this. form . 设备加工工艺 === this . processingName [ i ] . value ) {
this . processing1 = this . processingName [ i ] . processing
}
}
} ,
calloff ( ) {
this . dialogFormVisible1 = false
this . dialogFormVisible2 = false
this . dialogFormVisible3 = false
this . dialogFormVisible4 = false
this . dialogFormVisible5 = false
this . dialogFormVisible6 = false
this . form1 = {
ProcessClassification : ''
}
this . form2 = {
Process : '' ,
ProcessShort : ''
}
this . form3 = {
TechnologicalRequirements : ''
}
} ,
getCurrentRow ( row ) {
searchProcessClassificationOfProcessClassificationNum ( this . radio ) . then ( response => {
this . form1 . ProcessClassification = response . data [ 0 ] . 工艺分类名称
} )
this . loading2 = true
searchProcessNameOfProcessClassification ( row ) . then ( response => {
this . loading2 = false
this . tableData2 = response . data
} )
} ,
searchTechnologicalRequirementsOfProcessNum ( row , expandedRows ) {
// this.expands = []
// this.expands.push(row.工艺编号)
if ( expandedRows . length > 1 ) {
expandedRows . shift ( )
}
this . loading3 = true
searchTechnologicalRequirementsOfProcessNum ( row . 工艺编号 ) . then ( response => {
this . loading3 = false
this . tableData3 = response . data
} )
} ,
addProcess ( ) {
if ( this . $refs [ 'form2' ] !== undefined ) {
this . $refs [ 'form2' ] . resetFields ( )
}
if ( this . radio !== '' ) {
this . form2 . Process = ''
this . form2 . ProcessShort = ''
this . dialogFormVisible3 = true
this . temp = 3
} else {
this . $message . warning ( '请选择一个工艺分类' )
}
} ,
submitaddProcess ( ) {
addProcess ( this . radio , this . form2 . Process , this . form2 . ProcessShort ) . then ( response => {
addTable ( this . form . 设备名称 , this . form . 设备型号 , this . form . 设备性能指标 , this . form . 设备加工能力 , this . form . 设备工时系数 , this . processing1 , this . form . 设备加工工艺 , this . form . 班次类型 , this . form . 整改工时系数 , this . form . 设备编号 , this . form . 预留工时系数 ) . then ( response => {
if ( response . data [ 0 ] . result === '1' ) {
this . $message . success ( '增加成功' )
this . loading2 = true
searchProcessNameOfProcessClassification ( this . radio ) . then ( response => {
this . loading2 = false
this . tableData2 = response . data
this . $notify ( {
title : '成功' ,
message : '信息添加成功' ,
type : 'success'
} )
this . dialogFormVisible3 = false
} else { this . $message . error ( '增加失败' ) }
} )
} ,
editProcess ( row ) {
this . dialogFormVisible4 = true
this . temp = 4
this . form2 . Process = row . 工艺名称
this . form2 . ProcessShort = row . 工艺名称简称
this . ProcessNum = row . 工艺编号
} ,
submiteditProcess ( ) {
editProcess ( this . ProcessNum , this . form2 . Process , this . form2 . ProcessShort , this . form2 . Requirement ) . then ( response => {
if ( response . data [ 0 ] . result === '1' ) {
this . $message . success ( '信息更新成功' )
this . dialogFormVisible4 = true
searchProcessNameOfProcessClassification ( this . radio ) . then ( response => {
this . loading2 = false
this . tableData2 = response . data
} )
this . dialogFormVisible4 = false
this . dialogFormVisible = false
this . fetchData ( )
} else {
this . $message . error ( '信息更新 失败' )
this . $message . error ( '信息添加 失败' )
}
} )
} ,
getRowKeys ( row ) {
return row . 工艺编号
ADD ( ) {
this . addForm ( 'form' )
this . dialogFormVisible = true
this . form . contractSigningDate = getNowTime ( ) // new Date()
this . temp = 1
this . title = '增加'
} ,
delProcess ( row ) {
this . $confirm ( '此操作将永久删除' + row . 工艺名称 + '行, 是否继续?' , '提示' , {
confirmButtonText : '确定' ,
cancelButtonText : '取消' ,
type : 'warning'
} ) . then ( ( ) => {
delProcess ( row . 工艺编号 ) . then ( response => {
if ( response . data [ 0 ] . result === '1' ) {
this . loading2 = true
searchProcessNameOfProcessClassification ( this . radio ) . then ( response => {
this . loading2 = false
this . tableData2 = response . data
} )
this . $message . success ( '删除成功' )
} else {
this . $message . error ( '删除失败' )
}
} )
} )
} ,
addTechnologicalRequirements ( row ) {
if ( this . $refs [ 'form3' ] !== undefined ) {
this . $refs [ 'form3' ] . resetFields ( )
}
this . ProcessNum = row . 工艺编号
this . form3 . TechnologicalRequirements = ''
this . dialogFormVisible5 = true
this . temp = 5
} ,
submitTechnologicalRequirements ( ) {
if ( this . form3 . TechnologicalRequirements !== '' ) {
addTechnologicalRequirements ( this . ProcessNum , this . form3 . TechnologicalRequirements ) . then ( response => {
if ( response . data [ 0 ] . result === '1' ) {
this . $message . success ( '增加成功' )
this . loading3 = true
searchTechnologicalRequirementsOfProcessNum ( this . ProcessNum ) . then ( response => {
this . loading3 = false
this . tableData3 = response . data
} )
this . dialogFormVisible5 = false
} else { this . $message . error ( '增加失败' ) }
} )
} else {
this . $message . error ( '请输入工艺要求' )
this . dialogFormVisible5 = false
}
} ,
editTechnologicalRequirements ( row ) {
this . temp = 6
this . dialogFormVisible6 = true
this . form3 . TechnologicalRequirements = row . 工艺要求
this . code = row . 工艺要求流水号
this . ProcessNum = row . 工艺编号
} ,
submiteditTechnologicalRequirements ( ) {
editTechnologicalRequirements ( this . code , this . form3 . TechnologicalRequirements ) . then ( response => {
submitEdit ( ) {
console . log ( 2323 )
editTable ( this . equipmentSerialNumber , this . form . 设备名称 , this . form . 设备型号 , this . form . 设备性能指标 , this . form . 设备加工能力 , this . form . 设备工时系数 , this . form . 班次类型 , this . form . 设备加工工艺 , this . form . 整改工时系数 , this . form . 设备编号 , this . form . 预留工时系数 ) . then ( response => {
if ( response . data [ 0 ] . result === '1' ) {
this . $message . success ( '信息更新成功' )
this . loading3 = true
searchTechnologicalRequirementsOfProcessNum ( this . ProcessNum ) . then ( response => {
this . loading3 = false
this . tableData3 = response . data
this . $notify ( {
title : '成功' ,
message : '信息编辑成功' ,
type : 'success'
} )
this . dialogFormVisible6 = false
this . dialogFormVisible = false
this . title = ''
this . fetchData ( )
} else {
this . $message . error ( '信息更新 失败' )
this . $message . error ( '信息编辑 失败' )
}
} )
} ,
delTechnologicalRequirements ( row ) {
callOff ( formName ) {
this . dialogFormVisible = false
this . $refs [ formName ] . resetFields ( )
} ,
handleDelete ( row ) {
this . $confirm ( '此操作将永久删除该行, 是否继续?' , '提示' , {
confirmButtonText : '确定' ,
cancelButtonText : '取消' ,
type : 'warning'
} ) . then ( ( ) => {
delTechnologicalRequirements ( row . 工艺要求流水号 ) . then ( response => {
if ( this . List && this . List . length === 1 && this . pageCurrent > 1 ) {
this . pageCurrent --
}
deleteTable ( row . 设备流水号 ) . then ( response => {
if ( response . data [ 0 ] . result === '1' ) {
this . loading3 = true
searchTechnologicalRequirementsOfProcessNum ( row . 工艺编号 ) . then ( response => {
this . loading3 = false
this . tableData3 = response . data
} )
this . $message . success ( '删除成功' )
} else {
this . $message . error ( '删除失败' )
}
this . fetchData ( )
} else { this . $message . error ( '删除失败' ) }
})
} ) . catch ( ( ) => {
this . $message ( {
type : 'info' ,
message : '已取消删除'
} )
} )
} ,
setUp ( ) {
if ( this . time !== '' ) {
setUp ( this . time ) . then ( response => {
if ( response . data [ 0 ] . result === '1' ) {
this . $message . success ( '设定成功' )
} else { this . $message . error ( '设定失败' ) }
} )
} else {
this . $message . warning ( '请选择有效时间' )
}
} ,
generate ( ) {
generate ( ) . then ( response => {
if ( response . data [ 0 ] . result === '1' ) {
this . $message . success ( '生成成功' )
} else { this . $message . error ( '生成失败' ) }
} )
} ,
handleSizeChange ( val ) {
this . pageSize = val
this . pageCurrent = 1
this . fetchData ( )
} ,
handleCurrentChange ( val ) {
this . pageCurrent = val
this . fetchData ( )
}
}
}
< / script >
< style scoped >
/*.el-card {*/
/* margin-top: 15px;*/
/* margin-left: 15px;*/
/* }!**! */
. el - card {
margin- bottom : 1 px ;
}
/*.el-button--success { */
/* background: #ecf5ff;*/
/* border-color: #2d72d5;*/
/* color: #2d72d5;*/
/*}*/
/*.el-button--primary {*/
/* background: #fdf6ec;*/
/* border-color: #ff9759;*/
/* color: #ff9759;*/
/*}*/
< / style >
< style lang = "scss" >
. subTableHeader {
th {
background : # 8 ff4ea ! important ;
color : black ;
. button111 {
background : rgb ( 253 , 246 , 236 ) ;
border - color : # ff9759 ;
color : # ff9759 ;
& : hover {
background : # ff9759 ;
border - color : # ff9759 ;
color : white ;
}
tr . el - table _ _row td {
background - color : # d8e5f6 ! important ;
}
tr . el - table _ _row . el - table _ _row -- striped td {
background : # e9f0f9 ! important ;
& : focus {
background : # ff9759 ;
border - color : # ff9759 ;
color : white ;
}
}
< / style >