修补工时录入
This commit is contained in:
@@ -12,6 +12,50 @@ export function searchTechnology(num) {
|
||||
}
|
||||
})
|
||||
}
|
||||
export function getNames() {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '1',
|
||||
name: '车间生产管理工艺_传递后_项目名称_查询数据_加工进度修改'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export function getMachines(gongyi) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '1',
|
||||
name: '车间生产管理工艺_传递后_机床名称_查询数据_查询所有机床',
|
||||
param: '项目流水号=' + gongyi + '=int'
|
||||
}
|
||||
})
|
||||
}
|
||||
export function getGroups(stepNumber) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '1',
|
||||
name: '车间生产管理工艺_传递后_组件名称_查询数据_查询所有组',
|
||||
param: '机床流水号=' + stepNumber + '=int'
|
||||
}
|
||||
})
|
||||
}
|
||||
export function getParts(stepNumber, a, b, c, d, e, f, g) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '1',
|
||||
name: '车间生产管理_基础表_员工月修补工时_查询零件',
|
||||
param: '项目流水号_check=' + stepNumber + '=string&项目流水号=' + a + '=string&机床流水号_check=' + b + '=string&机床流水号=' + c + '=string&组件流水号_check=' + d + '=string&组件流水号=' + e + '=string&零件图号_check=' + f + '=string&零件图号=' + g + '=string&是否查询全部数据=1=string&单件是否外协=0'
|
||||
}
|
||||
})
|
||||
}
|
||||
// 查询人员编号
|
||||
export function searchperson(num) {
|
||||
return request({
|
||||
@@ -31,33 +75,45 @@ export function searchtable(check, num, pageCurrent, pageSize) {
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '1',
|
||||
name: '车间生产管理_基础表_员工月修补工时_查询数据',
|
||||
name: '车间生产管理_基础表_员工月修补工时_查询数据_MESWORK',
|
||||
param: '人员编号_check=' + check + '&人员编号=' + num,
|
||||
Pagination: pageCurrent + '&' + pageSize
|
||||
}
|
||||
})
|
||||
}
|
||||
// 增加
|
||||
export function edittype(ManufacturerNumber, ManufacturerName, ManufacturerAbbreviation, address, roleName) {
|
||||
export function edittype(num1, ManufacturerNumber, ManufacturerAbbreviation, address, roleName, num2) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '2',
|
||||
name: '车间生产管理_基础表_员工月修补工时_增加数据',
|
||||
param: '人员编号=' + ManufacturerNumber + '&工艺编号=' + ManufacturerName + '&年=' + ManufacturerAbbreviation + '&月=' + address + '&修补工时=' + roleName
|
||||
param: '工艺计划流水号=' + num1 + '&人员编号=' + ManufacturerNumber + '&年=' + ManufacturerAbbreviation + '&月=' + address + '&修补工时=' + roleName + '&修补工艺=' + num2
|
||||
}
|
||||
})
|
||||
}
|
||||
// 编辑
|
||||
export function handlechange(CoManufacturerFlowNumber, ManufacturerNumber, ManufacturerName, ManufacturerAbbreviation, address, roleName) {
|
||||
export function handlechange(CoManufacturerFlowNumber, num1, ManufacturerNumber, ManufacturerAbbreviation, address, roleName, num2) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '2',
|
||||
name: '车间生产管理_基础表_员工月修补工时_修改数据',
|
||||
param: '员工月修补工时流水号=' + CoManufacturerFlowNumber + '&人员编号=' + ManufacturerNumber + '&工艺编号=' + ManufacturerName + '&年=' + ManufacturerAbbreviation + '&月=' + address + '&修补工时=' + roleName
|
||||
param: '员工月修补工时流水号=' + CoManufacturerFlowNumber + '&工艺计划流水号=' + num1 + '&人员编号=' + ManufacturerNumber + '&年=' + ManufacturerAbbreviation + '&月=' + address + '&修补工时=' + roleName + '&修补工艺=' + num2
|
||||
}
|
||||
})
|
||||
}
|
||||
// 删除工艺信息
|
||||
export function delList(MaterialCode) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '2',
|
||||
name: '车间生产管理_基础表_员工月修补工时_删除数据',
|
||||
param: '员工月修补工时流水号=' + MaterialCode
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
type="index"
|
||||
align="center"
|
||||
width="50"/>
|
||||
<el-table-column label="工艺名称" align="center" width="280px">
|
||||
<el-table-column label="零件图号" align="center" width="280px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工艺名称 }}
|
||||
{{ scope.row.零件图号_零件工艺计划 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="修补工时" align="center" width="110px">
|
||||
@@ -44,18 +44,23 @@
|
||||
{{ scope.row.姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作时间" align="center">
|
||||
<el-table-column label="修补工艺" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.操作时间 }}
|
||||
{{ scope.row.修补工艺 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="150px" fixed="right">
|
||||
<el-table-column label="操作" align="center" width="250px" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
class="el-icon-edit"
|
||||
@click="handleChange1(scope.$index, scope.row, 'form');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>
|
||||
@@ -72,51 +77,97 @@
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :title="title1" :visible.sync="dialogFormVisible" center>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="110px" class="demo-ruleForm" style="width: 48%;margin: auto">
|
||||
<el-form-item label="工艺" prop="TechnologyValue">
|
||||
<el-select v-model="form.TechnologyValue" filterable size="small">
|
||||
<el-option
|
||||
v-for="item in Technology"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="年" prop="yearNumberValue">
|
||||
<el-select v-model="form.yearNumberValue" size="small">
|
||||
<el-option
|
||||
v-for="item in yearNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="月" prop="monthNumberValue">
|
||||
<el-select v-model="form.monthNumberValue" size="small">
|
||||
<el-option
|
||||
v-for="item in monthNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="修补工时" prop="timeNumber">
|
||||
<el-input v-model="form.timeNumber" placeholder="修补工时" clearable size="small" style="width: 200px"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-dialog :title="title1" :visible.sync="dialogFormVisible" center style="min-height: 300px" width="700px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="90px" class="demo-ruleForm">
|
||||
<el-row>
|
||||
<el-col :span="14"/>
|
||||
<el-form-item >
|
||||
<el-button size="small" @click="callOff('form')">取消</el-button>
|
||||
<el-button size="small" type="primary" @click="submit('form')">确 定</el-button>
|
||||
</el-form-item>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目" prop="project">
|
||||
<el-select v-model="form.project" filterable size="small" @change="getMachine">
|
||||
<el-option
|
||||
v-for="item in projects"
|
||||
: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="Machine">
|
||||
<el-select v-model="form.Machine" filterable size="small" @change="getGroup">
|
||||
<el-option
|
||||
v-for="item in Machines"
|
||||
: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="Group">
|
||||
<el-select v-model="form.Group" filterable size="small" @change="getParts">
|
||||
<el-option
|
||||
v-for="item in Groups"
|
||||
: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">
|
||||
<el-option
|
||||
v-for="item in Parts"
|
||||
: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="yearNumberValue">
|
||||
<el-select v-model="form.yearNumberValue" size="small">
|
||||
<el-option
|
||||
v-for="item in yearNumber"
|
||||
: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="monthNumberValue">
|
||||
<el-select v-model="form.monthNumberValue" size="small">
|
||||
<el-option
|
||||
v-for="item in monthNumber"
|
||||
: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="timeNumber">
|
||||
<el-input v-model="form.timeNumber" placeholder="修补工时" clearable size="small" style="width: 200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="修补工艺" prop="修补工艺">
|
||||
<el-input v-model="form.修补工艺" placeholder="修补工艺" clearable size="small" style="width: 200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="callOff('form')">取消</el-button>
|
||||
<el-button type="primary" @click="submit('form')" >确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :visible.sync="dialogFormVisible1" title="人员信息" center width="750px">
|
||||
@@ -162,8 +213,12 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getTable8, getTree, fn, dialogtablevisible, searchTechnology, searchperson, searchtable, edittype, handlechange } from '@/api/ManufacturingCenter/RepairTimeEntry'
|
||||
import { delList, getTable8, getNames, getMachines, getGroups, getParts, getTree, fn, dialogtablevisible, searchTechnology, searchperson, searchtable, edittype, handlechange } from '@/api/ManufacturingCenter/RepairTimeEntry'
|
||||
import elInput from 'element-ui/packages/input'
|
||||
export default {
|
||||
components: {
|
||||
elInput
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
codes2: '',
|
||||
@@ -179,11 +234,20 @@ export default {
|
||||
liushuihao: '', // 编辑流水号
|
||||
renyuanbianhao: '', // 编辑人员编号
|
||||
personnelNumber: '', // 人员编号
|
||||
projects: [],
|
||||
Machines: [],
|
||||
Groups: [],
|
||||
Parts: [],
|
||||
form: {
|
||||
零件: '',
|
||||
project: '',
|
||||
Machine: '',
|
||||
Group: '',
|
||||
TechnologyValue: '',
|
||||
yearNumberValue: '',
|
||||
monthNumberValue: '',
|
||||
timeNumber: ''
|
||||
timeNumber: '',
|
||||
修补工艺: ''
|
||||
},
|
||||
Technology: [], // 工艺
|
||||
yearNumber: [], // 年
|
||||
@@ -198,8 +262,11 @@ export default {
|
||||
dialogFormVisible: false,
|
||||
title1: '',
|
||||
rules: {
|
||||
TechnologyValue: [{ required: true, message: '请选择工艺', trigger: 'change' }],
|
||||
timeNumber: [{ required: true, message: '请输入修补工时', trigger: 'blur' }]
|
||||
零件: [{ required: true, message: '请选择零件', trigger: 'change' }],
|
||||
timeNumber: [{ required: true, message: '请输入修补工时', trigger: 'blur' }],
|
||||
yearNumberValue: [{ required: true, message: '请选择年份', trigger: 'blur' }],
|
||||
monthNumberValue: [{ required: true, message: '请选择月份', trigger: 'blur' }],
|
||||
修补工艺: [{ required: true, message: '请输入修补工艺', trigger: 'blur' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -207,8 +274,82 @@ export default {
|
||||
this.fetchData()
|
||||
this.fetchData3()
|
||||
this.searchTable()
|
||||
this.fetchData2()
|
||||
this.getParts()
|
||||
},
|
||||
methods: {
|
||||
fetchData2() {
|
||||
this.projects = []
|
||||
getNames().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.projects.push({
|
||||
label: response.data[i].项目名称,
|
||||
value: response.data[i].项目流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getMachine() {
|
||||
this.form.Machine = ''
|
||||
this.Machines = []
|
||||
this.form.Group = ''
|
||||
this.Groups = []
|
||||
if (this.form.project !== '') {
|
||||
getMachines(this.form.project).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.Machines.push({
|
||||
label: response.data[i].机床图号,
|
||||
value: response.data[i].机床流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
getGroup() {
|
||||
this.form.Group = ''
|
||||
this.Groups = []
|
||||
getGroups(this.form.Machine).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.Groups.push({
|
||||
label: response.data[i].组号,
|
||||
value: response.data[i].组件流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getParts() {
|
||||
if (this.project === '') {
|
||||
this.checkbox_project = false
|
||||
} else {
|
||||
this.checkbox_project = true
|
||||
}
|
||||
if (this.Machine === '') {
|
||||
this.checkbox_Machine = false
|
||||
} else {
|
||||
this.checkbox_Machine = true
|
||||
}
|
||||
if (this.Group === '') {
|
||||
this.checkbox_Group = false
|
||||
} else {
|
||||
this.checkbox_Group = true
|
||||
}
|
||||
if (this.number === '') {
|
||||
this.checkbox_number = false
|
||||
} else {
|
||||
this.checkbox_number = true
|
||||
}
|
||||
this.form.零件 = ''
|
||||
this.Parts = []
|
||||
getParts(this.checkbox_project, this.form.project, this.checkbox_Machine, this.form.Machine, this.checkbox_Group, this.form.Group).then(response => {
|
||||
console.log(response.data)
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.Parts.push({
|
||||
label: response.data[i].零件图号,
|
||||
value: response.data[i].工艺计划流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCurrentChange2(row) { // 获取当前行人员信息
|
||||
this.ssks = row.节点名称
|
||||
this.Number1 = row.人员编号
|
||||
@@ -280,24 +421,50 @@ export default {
|
||||
})
|
||||
} else {
|
||||
searchtable(0, this.Number2, this.pageCurrent, this.pageSize).then(response => {
|
||||
console.log(response.data)
|
||||
this.tableData = response.data.rows
|
||||
this.total = response.data.total
|
||||
this.loading0 = false
|
||||
})
|
||||
}
|
||||
},
|
||||
// 删除
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
delList(row.员工月修补工时流水号).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.searchTable()
|
||||
this.$message({
|
||||
message: '已被成功删除',
|
||||
type: 'success'
|
||||
})
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
},
|
||||
// 增加打开
|
||||
editType1(formName) {
|
||||
if (this.personnelNumber === '' || this.personnelNumber === null) {
|
||||
this.$message.error('请输入人员编号')
|
||||
} else {
|
||||
this.form.TechnologyValue = ''
|
||||
this.form.timeNumber = ''
|
||||
this.form.零件 = ''
|
||||
this.form.修补工艺 = ''
|
||||
this.count1 = this.count1 + 1
|
||||
if (this.count1 !== 1) {
|
||||
this.$refs[formName].resetFields()
|
||||
}
|
||||
this.title1 = '增加'
|
||||
this.form.TechnologyValue = ''
|
||||
this.form.timeNumber = ''
|
||||
this.dialogFormVisible = true
|
||||
}
|
||||
},
|
||||
@@ -305,7 +472,7 @@ export default {
|
||||
editType() {
|
||||
searchperson(this.codes2).then(response => {
|
||||
if (response.data.length !== 0) {
|
||||
edittype(response.data[0].人员编号, this.form.TechnologyValue, this.form.yearNumberValue, this.form.monthNumberValue, this.form.timeNumber).then(response => {
|
||||
edittype(this.form.零件, response.data[0].人员编号, this.form.yearNumberValue, this.form.monthNumberValue, this.form.timeNumber, this.form.修补工艺).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('增加成功')
|
||||
this.pageCurrent = 1
|
||||
@@ -331,16 +498,17 @@ export default {
|
||||
}
|
||||
this.renyuanbianhao = row.人员编号
|
||||
this.liushuihao = row.员工月修补工时流水号
|
||||
this.form.TechnologyValue = parseInt(row.工艺编号)
|
||||
this.form.零件 = parseInt(row.工艺计划流水号)
|
||||
this.form.yearNumberValue = row.年
|
||||
this.form.monthNumberValue = row.月
|
||||
this.form.timeNumber = row.修补工时
|
||||
this.form.修补工艺 = row.修补工艺
|
||||
this.dialogFormVisible = true
|
||||
this.title1 = '编辑'
|
||||
},
|
||||
// 编辑确定
|
||||
handleChange() {
|
||||
handlechange(this.liushuihao, this.renyuanbianhao, this.form.TechnologyValue, this.form.yearNumberValue, this.form.monthNumberValue, this.form.timeNumber).then(response => {
|
||||
handlechange(this.liushuihao, this.form.零件, this.renyuanbianhao, this.form.yearNumberValue, this.form.monthNumberValue, this.form.timeNumber, this.form.修补工艺).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('修改成功')
|
||||
this.searchTable()
|
||||
|
||||
Reference in New Issue
Block a user