cxy
This commit is contained in:
305
src/views/BasicData/EquipmentCapabilitySetting/index.vue
Normal file
305
src/views/BasicData/EquipmentCapabilitySetting/index.vue
Normal file
@@ -0,0 +1,305 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<el-card>
|
||||
<span>设备名称:</span>
|
||||
<el-input v-model="equipmentName" clearable size="small" style="width:200px;margin:10px;"/>
|
||||
<el-button type="success" class="el-icon-search" size="small" @click="pageCurrent=1;pageSize=10;searchTable()">查询</el-button>
|
||||
<el-button type="primary" class="el-icon-circle-plus-outline" size="small" @click="handleAdd('form');param = 0">新增</el-button>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-table v-loading="loading" :data="tableData" height="580" style="width: 100%;" border highlight-current-row>
|
||||
<el-table-column
|
||||
label=" "
|
||||
align="center"
|
||||
type="index"
|
||||
width="50"/>
|
||||
<el-table-column label="设备名称" align="center" width="280px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.设备名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="设备编号" align="center" width="110px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.设备编号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="设备型号" align="center" width="280px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.设备型号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="设备性能指标" align="center" width="120px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.设备性能指标 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="设备加工能力" align="center" width="140px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.设备加工能力工时 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="设备工时系数" align="center" width="120px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.设备工时系数 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="设备加工工艺" align="center" width="230px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工艺属性 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="班次类型" align="center" width="110px">
|
||||
<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="150px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.设备预留工时系数 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="200px" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
class="el-icon-edit"
|
||||
@click="handleEdit(scope.row);param = 1">编辑</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
class="el-icon-delete"
|
||||
@click="handleDelete(scope.$index, scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
v-if="!loading"
|
||||
: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-dialog :title="title" :visible.sync="dialogFormVisible" center width="800px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="110px" class="demo-ruleForm" style="margin: auto">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="设备名称" prop="设备名称">
|
||||
<el-input v-model="form.设备名称" placeholder="设备名称" clearable size="small" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="设备型号" prop="设备型号">
|
||||
<el-input v-model="form.设备型号" placeholder="设备型号" clearable size="small" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="性能指标" prop="设备性能指标">
|
||||
<el-input v-model="form.设备性能指标" placeholder="性能指标" clearable size="small" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="加工能力" prop="设备加工能力工时">
|
||||
<el-input v-model="form.设备加工能力工时" placeholder="加工能力" clearable size="small" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="整改工时系数" prop="整改工时比例">
|
||||
<el-input v-model="form.整改工时比例" placeholder="设备整改工时系数" clearable size="small" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="设备编号" prop="设备编号">
|
||||
<el-input v-model="form.设备编号" placeholder="设备编号" clearable size="small" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工艺" prop="工艺属性代码">
|
||||
<el-select v-model="form.工艺属性代码" filterable size="small" style="width:230px;">
|
||||
<el-option
|
||||
v-for="item in Technology"
|
||||
: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-select v-model="form.班次类型" filterable size="small" style="width:230px;">
|
||||
<el-option
|
||||
v-for="item in ClassType"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工时系数" prop="设备工时系数">
|
||||
<el-input v-model="form.设备工时系数" placeholder="工时系数" clearable size="small" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="预留工时系数" prop="设备预留工时系数">
|
||||
<el-input v-model="form.设备预留工时系数" placeholder="设备预留工时系数" clearable size="small" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="callOff()">取消</el-button>
|
||||
<el-button v-show="title==='增加'" type="primary" @click="submitAdd()">确定</el-button>
|
||||
<el-button v-show="title==='编辑'" type="primary" @click="submitEdit()">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getTechnology, searchtable, edittype, handlechange, handledelete } from '@/api/BasicData/EquipmentCapabilitySetting'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
equipmentNum: '',
|
||||
num1: '',
|
||||
equipmentName: '',
|
||||
loading: false,
|
||||
tableData: [], // 表格数据
|
||||
pageSize: 10,
|
||||
pageCurrent: 1,
|
||||
total: 0,
|
||||
dialogFormVisible: false,
|
||||
title: '',
|
||||
Technology: [],
|
||||
ClassType: [{
|
||||
value: 0,
|
||||
label: 0
|
||||
}, {
|
||||
value: 1,
|
||||
label: 1
|
||||
}, {
|
||||
value: 2,
|
||||
label: 2
|
||||
}, {
|
||||
value: 3,
|
||||
label: 3
|
||||
}, {
|
||||
value: 4,
|
||||
label: 4
|
||||
}],
|
||||
form: {
|
||||
设备名称: '', // 设备名称
|
||||
设备型号: '', // 设备型号
|
||||
设备性能指标: '', // 性能指标
|
||||
设备加工能力工时: '', // 加工能力
|
||||
整改工时比例: '', // 设备整改工时指数
|
||||
设备编号: '', // 设备编号
|
||||
工艺属性代码: '', // 工艺
|
||||
班次类型: '', // 班次类型
|
||||
设备工时系数: '', // 工时系数
|
||||
设备预留工时系数: '' // 设备预留工时系数
|
||||
},
|
||||
rules: {
|
||||
设备名称: [{ required: true, message: '请输入设备名称', trigger: 'blur' }],
|
||||
设备型号: [{ required: true, message: '请输入设备型号', trigger: 'blur' }],
|
||||
设备性能指标: [{ required: true, message: '请输入性能指标', trigger: 'blur' }],
|
||||
设备加工能力工时: [{ required: true, message: '请输入加工能力', trigger: 'blur' }],
|
||||
整改工时比例: [{ required: true, message: '请输入设备整改工时指数', trigger: 'blur' }],
|
||||
设备编号: [{ required: true, message: '请输入设备编号', trigger: 'blur' }],
|
||||
工艺属性代码: [{ required: true, message: '请选择工艺', trigger: 'change' }],
|
||||
班次类型: [{ required: true, message: '请选择班次类型', trigger: 'change' }],
|
||||
设备工时系数: [{ required: true, message: '请输入工时系数', trigger: 'blur' }],
|
||||
设备预留工时系数: [{ required: true, message: '请输入设备预留工时系数', trigger: 'blur' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.searchTable()
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
// 初始化获取工艺
|
||||
fetchData() {
|
||||
this.getSelect(getTechnology, ['工艺名称', '工艺编号'], 'Technology')
|
||||
},
|
||||
// 查询
|
||||
searchTable() {
|
||||
this.loading = true
|
||||
this.equipmentName ? this.num1 = 1 : this.num1 = 0
|
||||
this.getTable(searchtable, [this.pageCurrent, this.pageSize, this.num1, this.equipmentName], ['tableData', 'total', 'loading'])
|
||||
},
|
||||
// 点击增加
|
||||
handleAdd() {
|
||||
this.dialogFormVisible = true
|
||||
this.title = '增加'
|
||||
this.addForm('form')
|
||||
},
|
||||
// 增加确定
|
||||
submitAdd() {
|
||||
this.addTable(edittype, [this.form.设备名称, this.form.设备型号, this.form.设备性能指标, this.form.设备工时系数, this.form.工艺属性代码, this.form.班次类型, this.form.设备加工能力工时, this.form.整改工时比例, this.form.设备编号, this.form.设备预留工时系数], 'form', function() { this.searchTable(); this.dialogFormVisible = false })
|
||||
},
|
||||
// 编辑打开
|
||||
handleEdit(row) {
|
||||
this.dialogFormVisible = true
|
||||
this.title = '编辑'
|
||||
this.equipmentNum = row.设备流水号
|
||||
this.editForm(row, 'form')
|
||||
},
|
||||
// 编辑确定
|
||||
submitEdit() {
|
||||
this.editTable(handlechange, [this.equipmentNum, this.form.设备名称, this.form.设备型号, this.form.设备性能指标, this.form.设备工时系数, this.form.工艺属性代码, this.form.班次类型, this.form.设备加工能力工时, this.form.整改工时比例, this.form.设备编号, this.form.设备预留工时系数], 'form', function() { this.searchTable(); this.dialogFormVisible = false })
|
||||
},
|
||||
// 重置表单
|
||||
callOff() {
|
||||
this.dialogFormVisible = false
|
||||
},
|
||||
// 删除
|
||||
handleDelete(index, row) {
|
||||
this.deleteRow(handledelete, row.设备流水号, function() { this.searchTable() })
|
||||
},
|
||||
// 分页
|
||||
handleSizeChange(val) {
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = val
|
||||
this.searchTable()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.searchTable()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-card{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.el-input{
|
||||
width: 200px!important;
|
||||
}
|
||||
</style>
|
||||
251
src/views/BasicData/MaintenanceEquipmentPerson/index.vue
Normal file
251
src/views/BasicData/MaintenanceEquipmentPerson/index.vue
Normal file
@@ -0,0 +1,251 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<span>设备名称:</span>
|
||||
<el-select v-model="equipmentNameValue" placeholder="设备名称" style="width:200px" size="small" clearable filterable>
|
||||
<el-option
|
||||
v-for="item in equipmentName"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span>操作者:</span>
|
||||
<el-input v-model="operator" placeholder="操作者" size="small" clearable style="width:200px" @dblclick.native="getOperator();param = 0"/>
|
||||
<el-button type="success" size="mini" icon="el-icon-search" style="margin-left:10px" @click="getTableData">查询</el-button>
|
||||
<el-button type="primary" size="mini" icon="el-icon-circle-plus-outline" @click="handleAdd">增加</el-button>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-table v-loading="loading" :data="tableData" highlight-current-row border style="height: 500px">
|
||||
<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">
|
||||
<el-button type="primary" size="mini" icon="el-icon-edit" style="margin-left:10px" @click="handleEdit(scope.row)">编辑</el-button>
|
||||
<el-button type="danger" size="mini" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="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-dialog :visible.sync="dialogFormVisible" title="选择人员" center style="min-height: 300px">
|
||||
<span>部门名称:</span>
|
||||
<el-select v-model="departmentValue" placeholder="部门名称" size="small" clearable style="width:180px" @change="getTablePeople">
|
||||
<el-option
|
||||
v-for="item in department"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-table
|
||||
:data="tablePeople"
|
||||
style="width:100%;max-height: 300px;margin-top: 20px"
|
||||
height="300"
|
||||
highlight-current-row
|
||||
@row-click="currentPeople">
|
||||
<el-table-column align="center" label="考勤编号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.考勤编号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="姓名">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="性别">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.性别 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工作岗位">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.岗位名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="dialogFormVisible = false">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :title="title" :visible.sync="dialogFormVisible_form" center style="min-height: 300px" width="400px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="110px" class="demo-ruleForm">
|
||||
<el-form-item label="设备名称" prop="设备名称">
|
||||
<el-select v-model="form.设备流水号" placeholder="设备名称" style="width:200px" size="small" clearable filterable>
|
||||
<el-option
|
||||
v-for="item in equipmentName"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="班次" prop="班次" >
|
||||
<el-select v-model="form.班次" placeholder="班次" style="width:200px" size="small" clearable filterable>
|
||||
<el-option
|
||||
v-for="item in staff"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="操作者" prop="操作者" >
|
||||
<el-input v-model="form.操作者" placeholder="操作者" size="small" style="width:200px" clearable @dblclick.native="getOperator();param = 1"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="cancel">取消</el-button>
|
||||
<el-button v-show="title === '增加'" type="primary" @click="submitAdd()">确定</el-button>
|
||||
<el-button v-show="title === '编辑'" type="primary" @click="submitEdit()">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getEquipment, getDepartment, getTablePeople, getTableData, deleteTable, getStaff, addTable, editTable } from '@/api/BasicData/MaintenanceEquipmentPerson'
|
||||
import { SectionToChinese } from '@/utils/tool'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
equipmentNameValue: '',
|
||||
equipmentNameCheck: null,
|
||||
equipmentName: [],
|
||||
operator: '',
|
||||
operatorNum: '',
|
||||
operatorCheck: null,
|
||||
dialogFormVisible: false,
|
||||
tablePeople: [],
|
||||
departmentValue: '',
|
||||
department: [],
|
||||
tableData: [],
|
||||
pageCurrent: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
loading: false,
|
||||
title: '',
|
||||
dialogFormVisible_form: false,
|
||||
param: null,
|
||||
form: {
|
||||
设备名称: '',
|
||||
设备流水号: null,
|
||||
班次: '',
|
||||
班次代码: '',
|
||||
操作者: '',
|
||||
操作者编号: null
|
||||
},
|
||||
rules: {
|
||||
设备名称: [{ required: true, message: '请选择设备名称', trigger: 'blur' }],
|
||||
操作者: [{ required: true, message: '请选择操作者', change: 'blur' }]
|
||||
},
|
||||
staff: [],
|
||||
No: null
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
this.getTableData()
|
||||
},
|
||||
methods: {
|
||||
fetchData() {
|
||||
this.getSelect(getEquipment, ['设备名称', '设备流水号'], 'equipmentName', [0, this.equipmentNameValue]) // 获取设备名称
|
||||
getStaff().then(res => { // 获取班次
|
||||
res.data.map(row => {
|
||||
this.staff.push({
|
||||
label: `${SectionToChinese(row.班次代码)}班`,
|
||||
value: row.班次代码
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
getOperator() {
|
||||
this.dialogFormVisible = true
|
||||
this.getSelect(getDepartment, ['部门', '考核部门编号'], 'department')
|
||||
},
|
||||
getTablePeople() {
|
||||
this.getData(getTablePeople, 'tablePeople', this.departmentValue)
|
||||
},
|
||||
currentPeople(row) {
|
||||
if (this.param === 0) {
|
||||
this.operator = row.姓名
|
||||
this.operatorNum = row.人员编号
|
||||
} else if (this.param === 1) {
|
||||
this.form.操作者 = row.姓名
|
||||
this.form.操作者编号 = row.人员编号
|
||||
} else {
|
||||
console.log(`err`)
|
||||
}
|
||||
},
|
||||
getTableData() {
|
||||
console.log(typeof (this.equipmentName))
|
||||
this.equipmentNameValue ? this.equipmentNameCheck = 1 : this.equipmentNameCheck = 0
|
||||
this.operator ? this.operatorCheck = 1 : this.operatorCheck = 0
|
||||
this.loading = true
|
||||
this.getTable(getTableData, [this.equipmentNameCheck, this.equipmentNameValue, this.operatorCheck, this.operatorNum, this.pageCurrent, this.pageSize], ['tableData', 'total', 'loading'])
|
||||
},
|
||||
handleAdd() {
|
||||
this.addForm('form', [this.dialogFormVisible_form = true, this.title = '增加'])
|
||||
},
|
||||
handleEdit(row) {
|
||||
this.No = row.设备人员关系流水号
|
||||
this.editForm(row, 'form', [this.dialogFormVisible_form = true, this.title = '编辑'])
|
||||
},
|
||||
submitAdd() {
|
||||
for (let i = 0; i < this.equipmentName.length; i++) {
|
||||
if (this.form.设备流水号 === this.equipmentName[i].value) {
|
||||
this.form.设备名称 = this.equipmentName[i].label
|
||||
break
|
||||
}
|
||||
}
|
||||
this.addTable(addTable, [this.form.设备流水号, this.form.设备名称, this.form.班次, this.form.操作者, this.form.操作者编号], 'form', function() { this.getTableData(); this.dialogFormVisible_form = false })
|
||||
},
|
||||
submitEdit() {
|
||||
this.editTable(editTable, [this.form.设备名称, this.form.设备流水号, this.form.班次代码, this.form.操作者, this.form.操作者编号, this.No], 'form', function() { this.getTableData(); this.dialogFormVisible_form = false })
|
||||
},
|
||||
cancel() {
|
||||
this.dialogFormVisible_form = false
|
||||
},
|
||||
handleDelete(row) {
|
||||
this.deleteRow(deleteTable, row.设备人员关系流水号, function() { this.getTableData() })
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.pageSize = val
|
||||
this.pageCurrent = 1
|
||||
this.getTableData()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.getTableData()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
span{
|
||||
margin: 20px;
|
||||
}
|
||||
</style>
|
||||
199
src/views/BasicData/MaterialMaintenance/index.vue
Normal file
199
src/views/BasicData/MaterialMaintenance/index.vue
Normal file
@@ -0,0 +1,199 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<span>材料名称:</span>
|
||||
<el-input v-model="Material" placeholder="请输材料名称" size="small" style="width:200px" clearable/>
|
||||
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 15px" @click="pageCurrent = 1;pageSize = 10;featchMaterial()">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" @click="add()">增加</el-button>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:data="tableData"
|
||||
style="width: 100%"
|
||||
height="580"
|
||||
highlight-current-row
|
||||
border>
|
||||
<el-table-column align="center" label="材料名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.材料 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="变更日期">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.操作日期 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
@click="Edit(scope.row)">编辑</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@click="delMaterial(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="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-dialog :visible.sync="dialogFormVisible" title="新增材料" center style="min-height: 200px" width="400px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="110px">
|
||||
<el-form-item label="材料名称" prop="MaterialName" style="display: inline-block">
|
||||
<el-input v-model="form.MaterialName" clearable size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOff()">取消</el-button>
|
||||
<el-button type="primary" size="small" @click="addMaterial('form')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :visible.sync="dialogFormVisible2" title="编辑材料" center style="min-height: 200px" width="400px">
|
||||
<el-form ref="form2" :model="form2" :rules="rules" label-position="left" label-width="110px">
|
||||
<el-form-item label="材料名称" prop="MaterialName2" style="display: inline-block">
|
||||
<el-input v-model="form2.MaterialName2" size="small" clearable style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOff()">取消</el-button>
|
||||
<el-button type="primary" size="small" @click="editMaterial('form2')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { featchMaterial, addMaterial, delMaterial, editMaterial } from '@/api/BasicData/Materialmaintenance'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
ID: '',
|
||||
dialogFormVisible: false,
|
||||
dialogFormVisible2: false,
|
||||
tableData: [],
|
||||
Material: '', // 材质名称
|
||||
listLoading: false,
|
||||
pageCurrent: 1,
|
||||
pageSize: 10,
|
||||
total: null,
|
||||
form: {
|
||||
MaterialName: ''
|
||||
},
|
||||
form2: {
|
||||
MaterialName2: ''
|
||||
},
|
||||
rules: {
|
||||
MaterialName: [{ required: true, message: '请输入材料名称', trigger: 'blur' }],
|
||||
MaterialName2: [{ required: true, message: '请输入材料名称', trigger: 'blur' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.featchMaterial()
|
||||
},
|
||||
methods: {
|
||||
handleSizeChange(val) {
|
||||
this.pageSize = val
|
||||
this.pageCurrent = 1
|
||||
this.featchMaterial()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.featchMaterial()
|
||||
},
|
||||
featchMaterial() {
|
||||
featchMaterial(this.Material, this.pageCurrent, this.pageSize).then(response => {
|
||||
this.tableData = response.data.rows
|
||||
this.total = response.data.total
|
||||
})
|
||||
},
|
||||
callOff() {
|
||||
this.dialogFormVisible = false
|
||||
this.dialogFormVisible2 = false
|
||||
},
|
||||
add() {
|
||||
if (this.$refs['form'] !== undefined) {
|
||||
this.$refs['form'].resetFields()
|
||||
}
|
||||
this.form.MaterialName = ''
|
||||
this.dialogFormVisible = true
|
||||
},
|
||||
addMaterial(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
addMaterial(this.form.MaterialName).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('添加成功')
|
||||
this.dialogFormVisible = false
|
||||
this.form = {}
|
||||
this.featchMaterial()
|
||||
} else {
|
||||
this.$message.error('添加失败')
|
||||
this.form = {}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
delMaterial(row) {
|
||||
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
delMaterial(row.材料流水号).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.form.MaterialName = ''
|
||||
this.featchMaterial()
|
||||
this.$message.success('删除成功')
|
||||
} else {
|
||||
this.$message.error('删除失败')
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
Edit(row) {
|
||||
if (this.$refs['form2'] !== undefined) {
|
||||
this.$refs['form2'].resetFields()
|
||||
}
|
||||
this.dialogFormVisible2 = true
|
||||
this.form2.MaterialName2 = row.材料
|
||||
this.ID = row.材料流水号
|
||||
},
|
||||
editMaterial(form2) {
|
||||
this.$refs[form2].validate((valid) => {
|
||||
if (valid) {
|
||||
this.dialogFormVisible2 = false
|
||||
editMaterial(this.ID, this.form2.MaterialName2).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.featchMaterial()
|
||||
this.$message.success('编辑成功')
|
||||
this.form = {}
|
||||
} else {
|
||||
this.$message.error('编辑失败')
|
||||
this.form = {}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
@@ -537,13 +537,8 @@ export default {
|
||||
}
|
||||
},
|
||||
addPeople() {
|
||||
this.people_title = '新增人员'
|
||||
this.people_DFV = true
|
||||
this.addForm('people_form')
|
||||
},
|
||||
submitAddPeople() {
|
||||
this.people_DFV = false
|
||||
if (this.id) {
|
||||
<<<<<<< HEAD
|
||||
addPeople(this.id, this.people_form.Sex, this.people_form.Education, this.people_form.Address, this.people_form.Nation, this.people_form.Post, this.people_form.AccountNumber, this.people_form.Password, this.people_form.Name, this.people_form.IDcard, this.people_form.TimeOfEntry, this.people_form.Birthday, this.people_form.ContactInformation).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.i = 1
|
||||
@@ -553,10 +548,27 @@ export default {
|
||||
this.$message.error('添加失败')
|
||||
}
|
||||
})
|
||||
=======
|
||||
this.people_title = '新增人员'
|
||||
this.people_DFV = true
|
||||
this.addForm('people_form')
|
||||
>>>>>>> 7cdb10d153358b72f95165dd7f3a12ad7675f14d
|
||||
} else {
|
||||
this.$message.warning(`请选择部门名称`)
|
||||
}
|
||||
},
|
||||
submitAddPeople() {
|
||||
this.people_DFV = false
|
||||
addPeople(this.id, this.people_form.Sex, this.people_form.Education, this.people_form.Address, this.people_form.Nation, this.people_form.Post, this.people_form.AccountNumber, this.people_form.Password, this.people_form.Name, this.people_form.IDcard, this.people_form.TimeOfEntry, this.people_form.Birthday, this.people_form.ContactInformation).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.i = 1
|
||||
this.handleNodeClick()
|
||||
this.$message.success('添加成功')
|
||||
} else {
|
||||
this.$message.error('添加失败')
|
||||
}
|
||||
})
|
||||
},
|
||||
handleEditPeople(row) {
|
||||
this.people_title = '编辑人员'
|
||||
this.people_DFV = true
|
||||
|
||||
218
src/views/BasicData/SystemRrolemaintenance/index.vue
Normal file
218
src/views/BasicData/SystemRrolemaintenance/index.vue
Normal file
@@ -0,0 +1,218 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
<span>角色功能:</span>
|
||||
<el-input v-model="RoleFunctioning" size="small" clearable style="width:200px"/>
|
||||
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 15px" @click="pageCurrent=1;pageSize = 10;searchData()">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" @click="handleAdd()">增加</el-button>
|
||||
</el-card>
|
||||
<el-card style="margin-top: 15px">
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
highlight-current-row
|
||||
border>
|
||||
<el-table-column align="center" label="角色编号" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.角色编号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="角色功能">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.角色功能 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作日期">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.操作日期 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
@click="handleEdit(scope.row)">编辑</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[10, 20, 30, 40, 50]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :visible.sync="dialogFormVisible1" title="新增角色" center style="min-height: 200px" width="400px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="110px">
|
||||
<el-form-item label="角色名称" prop="角色功能" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form.角色功能"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="角色功能"
|
||||
style="width: 200px;"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="dialogFormVisible1 = false">取消</el-button>
|
||||
<el-button type="primary" size="small" @click="submitAdd1('form')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :visible.sync="dialogFormVisible2" title="编辑角色" center style="min-height: 200px" width="400px">
|
||||
<el-form ref="form2" :model="form2" :rules="rules2" label-position="left" label-width="110px">
|
||||
<el-form-item label="角色名称" prop="角色功能" style="display: inline-block">
|
||||
<el-input
|
||||
v-model="form2.角色功能"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="角色功能"
|
||||
style="width: 200px;"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="dialogFormVisible2 = false">取消</el-button>
|
||||
<el-button type="primary" size="small" @click="submitAdd2('form2')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { InitRolefunction, deleteData, searchTable, addData, addData2 } from '@/api/BasicData/SystemRrolemaintenance'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
RoleFunctioning: '',
|
||||
pageCurrent: 1,
|
||||
pageSize: 10,
|
||||
total: null,
|
||||
loading: false,
|
||||
tableData: [],
|
||||
dialogFormVisible1: false,
|
||||
dialogFormVisible2: false,
|
||||
name: '',
|
||||
num: '', // 角色编号
|
||||
form: {
|
||||
角色功能: ''
|
||||
},
|
||||
form2: {
|
||||
角色功能: ''
|
||||
},
|
||||
rules: {
|
||||
角色功能: [{ required: true, message: '请输入角色名称', trigger: 'blur' }]
|
||||
},
|
||||
rules2: {
|
||||
角色功能: [{ required: true, message: '请输入角色名称', trigger: 'blur' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
fetchData() {
|
||||
InitRolefunction(this.pageCurrent, this.pageSize).then(response => { // 初始化
|
||||
this.tableData = response.data.rows
|
||||
this.total = response.data.total
|
||||
})
|
||||
},
|
||||
searchData() {
|
||||
this.loading = true
|
||||
searchTable(this.RoleFunctioning, this.pageCurrent, this.pageSize).then(response => {
|
||||
this.tableData = response.data.rows
|
||||
this.total = response.data.total
|
||||
this.loading = false
|
||||
console.log(response.data)
|
||||
})
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = val
|
||||
this.fetchData()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.fetchData()
|
||||
},
|
||||
handleEdit(row) {
|
||||
if (this.$refs['form2'] !== undefined) {
|
||||
this.$refs['form2'].resetFields()
|
||||
}
|
||||
this.dialogFormVisible2 = true
|
||||
this.form2.角色功能 = row.角色功能
|
||||
this.num = row.角色编号
|
||||
},
|
||||
submitAdd2(formName) { // 编辑角色功能
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
addData2(this.form2.角色功能, this.num).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('编辑成功')
|
||||
this.fetchData()
|
||||
this.dialogFormVisible2 = false
|
||||
} else { this.$message.error('编辑失败') }
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
submitAdd1(formName) { // 增加角色功能
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
addData(this.form.角色功能).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('增加成功')
|
||||
this.form.角色功能 = ''
|
||||
this.fetchData()
|
||||
this.dialogFormVisible1 = false
|
||||
} else { this.$message.error('增加失败') }
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleAdd() {
|
||||
if (this.$refs['form'] !== undefined) {
|
||||
this.$refs['form'].resetFields()
|
||||
}
|
||||
this.dialogFormVisible1 = true
|
||||
},
|
||||
handleDelete(row) { // 删除
|
||||
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteData(row.角色编号).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('删除成功')
|
||||
} else {
|
||||
this.$message.error('删除失败')
|
||||
}
|
||||
this.fetchData()
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
399
src/views/BasicData/WorkshopPersonnelRoleMana/index.vue
Normal file
399
src/views/BasicData/WorkshopPersonnelRoleMana/index.vue
Normal file
@@ -0,0 +1,399 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<table style="width: 100%">
|
||||
|
||||
<el-card>
|
||||
<span>员工姓名:</span>
|
||||
<el-input v-model="staffName" placeholder="员工姓名" size="small" clearable style="width:200px"/>
|
||||
<span style="margin-left: 15px">角色名称:</span>
|
||||
<el-select v-model="roleName" placeholder="角色名称" clearable size="small" style="width:200px">
|
||||
<el-option
|
||||
v-for="item in roleNames"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 15px" @click="pageCurrent1=1;searchData()">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" @click="handelAdd">增加</el-button>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-table :data="tableData" highlight-current-row>
|
||||
<el-table-column label="员工姓名">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column disabled label="所属部门" >
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.部门名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="岗位名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.岗位名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="角色名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.角色功能 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="考勤编号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.考勤编号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
@click="submitEdit(scope.$index, scope.row)">修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="pageCurrent1"
|
||||
:page-sizes="[10, 20, 30, 40, 50]"
|
||||
:page-size="10"
|
||||
:total="total1"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange1"
|
||||
@current-change="handleCurrentChange1"/>
|
||||
</div>
|
||||
</el-card>
|
||||
</table>
|
||||
|
||||
<el-dialog :visible.sync="dialogFormVisible" title="人员信息" center width="750px">
|
||||
<div style="height: 500px">
|
||||
<div style="float: left;margin-top: 10px;margin-left: 20px;overflow-y: scroll;height: 400px">
|
||||
<el-tree
|
||||
:data="data2"
|
||||
node-key="id"
|
||||
style="width: 150px;float: left"
|
||||
height="400"
|
||||
accordion
|
||||
@node-click="handleNodeClick"
|
||||
/>
|
||||
</div>
|
||||
<el-table :data="List1" highlight-current-row height="400" style="width: 400px;float: left;margin-left: 30px" @row-click="handleCurrentChange">
|
||||
<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>
|
||||
</div>
|
||||
<el-button style="margin-left: 260px" @click="dialogFormVisible = false">取消</el-button>
|
||||
<el-button type="primary" style="margin-top: 20px" @click="getName">确认</el-button>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :visible.sync="dialogFormVisible1" title="增加" center style="min-height: 270px" width="800px">
|
||||
<el-form ref="form1" :model="form1" :rules="rules" label-position="left" label-width="110px" class="demo-ruleForm">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="员工姓名" prop="staffName">
|
||||
<el-input v-model="form1.staffName" placeholder="请双击选择" size="small" clearable style="width:200px" @dblclick.native="dialogTableVisible()"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="角色名称" prop="roleName">
|
||||
<el-select v-model="form1.roleName" placeholder="角色名称" size="small" clearable style="width:200px">
|
||||
<el-option
|
||||
v-for="item in roleNames"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="考勤编号" >
|
||||
<el-input
|
||||
v-model="cjscgy"
|
||||
disabled
|
||||
size="small"
|
||||
style="width:200px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属部门" >
|
||||
<el-input v-model="ssks" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="callOFF">取 消</el-button>
|
||||
<el-button type="primary" @click="submitAdd1()">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :visible.sync="dialogFormVisible2" title="编辑" center style="min-height: 270px" width="800px">
|
||||
<el-form ref="form2" :model="form2" :rules="rules1" label-position="left" label-width="110px" class="demo-ruleForm">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="员工姓名" >
|
||||
<el-input v-model="form2.staffName" disabled size="small" clearable style="width:200px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="角色名称" prop="roleName">
|
||||
<el-select v-model="form2.roleName" placeholder="角色名称" clearable size="small" style="width:200px">
|
||||
<el-option
|
||||
v-for="item in roleNames"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="考勤编号" >
|
||||
<el-input
|
||||
v-model="cjscgy"
|
||||
disabled
|
||||
size="small"
|
||||
style="width:200px"/>
|
||||
</el-form-item>
|
||||
<el-form-item disabled="true" label="所属部门" >
|
||||
<el-input v-model="ssks" disabled size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="callOFF">取消</el-button>
|
||||
<el-button type="primary" @click="submitAdd2()">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { dialogtablevisible, deleteData, getTree, fn, getTable8, initOrderType, addData1, addData2, searchTable } from '@/api/BasicData/WorkshopPersonnelRoleMana'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
number: '',
|
||||
form1: {
|
||||
staffName: '',
|
||||
roleName: ''
|
||||
},
|
||||
form2: {
|
||||
staffName: '',
|
||||
roleName: ''
|
||||
},
|
||||
rules: {
|
||||
staffName: [{ required: true, message: '请选择员工姓名', trigger: 'change' }],
|
||||
roleName: [{ required: true, message: '请选择员工角色', trigger: 'change' }]
|
||||
},
|
||||
rules1: {
|
||||
roleName: [{ required: true, message: '请选择员工角色', trigger: 'change' }]
|
||||
},
|
||||
staffName: '',
|
||||
cjscgy: '',
|
||||
List1: [],
|
||||
ssks: '',
|
||||
data2: [],
|
||||
dialogFormVisible1: false,
|
||||
dialogFormVisible2: false,
|
||||
tableData: [],
|
||||
check1: '',
|
||||
check2: '',
|
||||
name: '', // 中间变量
|
||||
check3: '',
|
||||
check4: '',
|
||||
staffNum: '',
|
||||
personnelNumber: '',
|
||||
personnelStream: '',
|
||||
pageCurrent1: 1,
|
||||
pageSize1: 10,
|
||||
total1: null,
|
||||
roleName: null,
|
||||
roleNames: [],
|
||||
rybh: '',
|
||||
jsbh: '',
|
||||
dialogFormVisible: false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
handelAdd(row) {
|
||||
this.dialogFormVisible1 = true
|
||||
this.ssks = ''
|
||||
this.cjscgy = ''
|
||||
if (this.$refs['form1'] !== undefined) {
|
||||
this.$refs['form1'].resetFields()
|
||||
}
|
||||
},
|
||||
submitEdit(index, row) {
|
||||
if (this.$refs['form2'] !== undefined) {
|
||||
this.$refs['form2'].resetFields()
|
||||
}
|
||||
this.dialogFormVisible2 = true
|
||||
this.personnelStream = row.人员角色流水号
|
||||
this.form2.staffName = row.姓名
|
||||
this.ssks = row.部门名称
|
||||
this.personnelNumber = row.人员编号
|
||||
this.form2.roleName = parseInt(row.角色编号)
|
||||
this.cjscgy = row.考勤编号
|
||||
},
|
||||
callOFF() {
|
||||
this.dialogFormVisible1 = false
|
||||
this.dialogFormVisible2 = false
|
||||
this.ssks = ''
|
||||
this.cjscgy = ''
|
||||
},
|
||||
searchData() {
|
||||
if (this.staffName !== '' && this.staffName !== null) {
|
||||
this.check1 = 1
|
||||
} else {
|
||||
this.check1 = 0
|
||||
}
|
||||
if (this.roleName !== '' && this.roleName !== null) {
|
||||
this.check2 = 1
|
||||
} else {
|
||||
this.check2 = 0
|
||||
}
|
||||
searchTable(this.check1, this.staffName, this.check2, this.roleName, this.pageCurrent1, this.pageSize1).then(response => {
|
||||
this.tableData = response.data.rows
|
||||
this.total1 = response.data.total
|
||||
})
|
||||
},
|
||||
fetchData() {
|
||||
getTree().then(response => { // 获取人员信息树
|
||||
const data = response.data
|
||||
this.data2 = fn(data, 0)
|
||||
})
|
||||
initOrderType().then(response => { // 角色名称
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.roleNames.push({
|
||||
label: response.data[i].角色功能,
|
||||
value: response.data[i].角色编号
|
||||
})
|
||||
}
|
||||
})
|
||||
this.searchData()
|
||||
},
|
||||
handleSizeChange1(val) {
|
||||
this.pageCurrent1 = 1
|
||||
this.pageSize1 = val
|
||||
this.searchData()
|
||||
},
|
||||
handleCurrentChange1(val) {
|
||||
this.pageCurrent1 = val
|
||||
this.searchData()
|
||||
},
|
||||
submitAdd1() {
|
||||
this.$refs['form1'].validate((valid) => {
|
||||
if (valid) {
|
||||
addData1(this.personnelNumber, this.form1.roleName).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('增加成功')
|
||||
this.ssks = ''
|
||||
this.form1.staffName = ''
|
||||
this.form1.roleName = ''
|
||||
this.searchData()
|
||||
this.dialogFormVisible1 = false
|
||||
} else { this.$message.error('增加失败') }
|
||||
})
|
||||
} else {
|
||||
console.log('error submit!!')
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
submitAdd2() {
|
||||
this.$refs['form2'].validate((valid) => {
|
||||
if (valid) {
|
||||
addData2(this.personnelStream, this.personnelNumber, this.form2.roleName).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('修改成功')
|
||||
this.ssks = ''
|
||||
this.searchData()
|
||||
this.dialogFormVisible2 = false
|
||||
} else { this.$message.error('修改失败') }
|
||||
})
|
||||
} else {
|
||||
console.log('error submit!!')
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCurrentChange3(val) {
|
||||
this.searchgroup()
|
||||
},
|
||||
handleNodeClick(data) { // 树节点点击
|
||||
this.ssks = data.label
|
||||
getTable8(data.id).then(response => {
|
||||
this.List1 = response.data
|
||||
})
|
||||
},
|
||||
handleDelete(row) { // 删除
|
||||
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteData(row.人员角色流水号).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('删除成功')
|
||||
} else { this.$message.error('删除失败') }
|
||||
this.searchData()
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
},
|
||||
dialogTableVisible() {
|
||||
this.dialogFormVisible = true
|
||||
dialogtablevisible().then(response => {
|
||||
})
|
||||
},
|
||||
handleCurrentChange(row) { // 获取当前行人员信息
|
||||
this.ssks = row.节点名称
|
||||
this.number = row.考勤编号
|
||||
this.name = row.姓名
|
||||
this.personnelNumber = row.人员编号
|
||||
},
|
||||
getName() { // 提交人员
|
||||
this.cjscgy = this.number
|
||||
this.dialogFormVisible = false
|
||||
this.form1.staffName = this.name
|
||||
this.form2.staffName = this.name
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-card{
|
||||
margin-bottom:15px;
|
||||
margin-left: 15px;
|
||||
margin-right: 15px;
|
||||
}
|
||||
</style>
|
||||
567
src/views/BasicData/WorkshopProcessMaintenance/index.vue
Normal file
567
src/views/BasicData/WorkshopProcessMaintenance/index.vue
Normal file
@@ -0,0 +1,567 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-card>
|
||||
<span>工艺分类:</span>
|
||||
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" @click="addProcessClassification()">新增</el-button>
|
||||
<el-button size="small" type="warning" icon="el-icon-edit" @click="editProcessClassification()">编辑</el-button>
|
||||
<el-button size="small" type="danger" icon="el-icon-delete" @click="delProcessClassification()">删除</el-button>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="18">
|
||||
<el-card>
|
||||
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" @click="addProcess">新增工艺名称</el-button>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-card>
|
||||
<el-table
|
||||
v-loading="loading1"
|
||||
ref="multipleTable"
|
||||
:data="tableData1"
|
||||
stripe
|
||||
tooltip-effect="dark"
|
||||
style="width: 100%"
|
||||
height="700">
|
||||
<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="left" label="工艺分类">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工艺分类名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="18">
|
||||
<el-card >
|
||||
<el-table
|
||||
:data="tableData2"
|
||||
:row-key="getRowKeys"
|
||||
:expand-row-keys="expands"
|
||||
height="700"
|
||||
width="100%"
|
||||
@expand-change="searchTechnologicalRequirementsOfProcessNum">
|
||||
<el-table-column type="expand">
|
||||
<template slot-scope="scope">
|
||||
<el-table :data="tableData3" border>
|
||||
<el-table-column label="工艺要求">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工艺要求 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" width="200px">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="warning"
|
||||
icon="el-icon-edit"
|
||||
@click="editTechnologicalRequirements(scope.row)">编辑</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@click="delTechnologicalRequirements(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工艺名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工艺名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="warning"
|
||||
icon="el-icon-edit"
|
||||
@click="editProcess(scope.row)">编辑工艺</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@click="delProcess(scope.row)">删除工艺</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
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 :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-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 :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 :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 :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>
|
||||
<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 :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 :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>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { searchProcessClassification, searchProcessNameOfProcessClassification, searchTechnologicalRequirementsOfProcessNum, searchProcessClassificationOfProcessClassificationNum, addProcessClassification, editProcessClassification, delProcessClassification, addProcess, delProcess, editProcess, addTechnologicalRequirements, editTechnologicalRequirements, delTechnologicalRequirements } from '@/api/BasicData/WorkshopProcessMaintenance'
|
||||
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: ''
|
||||
},
|
||||
form2: {
|
||||
Process: '',
|
||||
ProcessShort: ''
|
||||
},
|
||||
form3: {
|
||||
TechnologicalRequirements: ''
|
||||
},
|
||||
rules1: {
|
||||
ProcessClassification: [{ required: true, message: '请输入工艺分类名称', trigger: 'blur' }]
|
||||
},
|
||||
rules2: {
|
||||
Process: [{ required: true, message: '请输入工艺名称' }],
|
||||
ProcessShort: [{ required: true, message: '请输入工艺名称简称' }]
|
||||
},
|
||||
rules3: {
|
||||
TechnologicalRequirements: [{ required: true, message: '请输入工艺要求', trigger: 'blur' }]
|
||||
},
|
||||
tableData2: [],
|
||||
tableData3: [],
|
||||
Num: [],
|
||||
maxNum: '',
|
||||
max: [],
|
||||
code: ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.searchProcessClassification()
|
||||
},
|
||||
methods: {
|
||||
searchProcessClassification() {
|
||||
this.loading1 = true
|
||||
searchProcessClassification(this.ProcessClassification).then(response => {
|
||||
this.loading1 = false
|
||||
this.tableData1 = response.data
|
||||
this.total1 = response.data
|
||||
return this.tableData1
|
||||
}).then(data => {
|
||||
this.Num = data
|
||||
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].工艺分类名称
|
||||
})
|
||||
} else {
|
||||
this.$message.warning('请选择工艺分类')
|
||||
}
|
||||
},
|
||||
submitProcessClassification() {
|
||||
editProcessClassification(this.radio, this.form1.ProcessClassification).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('信息更新成功')
|
||||
this.dialogFormVisible2 = false
|
||||
this.searchProcessClassification()
|
||||
} else {
|
||||
this.$message.error('信息更新失败')
|
||||
}
|
||||
})
|
||||
},
|
||||
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('增加失败') }
|
||||
})
|
||||
},
|
||||
submit1(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.temp === 1) {
|
||||
this.submitaddProcessClassification()
|
||||
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: ''
|
||||
}
|
||||
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
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
delProcessClassification() {
|
||||
if (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('请选择工艺分类')
|
||||
}
|
||||
},
|
||||
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 => {
|
||||
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.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).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
|
||||
} else {
|
||||
this.$message.error('信息更新失败')
|
||||
}
|
||||
})
|
||||
},
|
||||
getRowKeys(row) {
|
||||
return row.工艺编号
|
||||
},
|
||||
delProcess(row) {
|
||||
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
|
||||
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() {
|
||||
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('增加失败') }
|
||||
})
|
||||
},
|
||||
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 => {
|
||||
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.dialogFormVisible6 = false
|
||||
} else {
|
||||
this.$message.error('信息更新失败')
|
||||
}
|
||||
})
|
||||
},
|
||||
delTechnologicalRequirements(row) {
|
||||
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
delTechnologicalRequirements(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('删除失败')
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-card {
|
||||
margin-top: 15px;
|
||||
margin-left: 15px;
|
||||
}
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user