工艺任务分配
This commit is contained in:
@@ -2,33 +2,6 @@ import request from '@/utils/request'
|
|||||||
import state from '@/store'
|
import state from '@/store'
|
||||||
import router from '@/router'
|
import router from '@/router'
|
||||||
|
|
||||||
// 初始化项目(全部)
|
|
||||||
export function getProject() {
|
|
||||||
return request({
|
|
||||||
url: '',
|
|
||||||
method: 'post',
|
|
||||||
data: {
|
|
||||||
UserID: state.state.user.id,
|
|
||||||
ModularID: router.currentRoute.path,
|
|
||||||
type: '1',
|
|
||||||
name: '车间生产管理工艺_传递后_项目名称_查询数据_工艺定额任务分配',
|
|
||||||
param: '考核状态=3&工艺任务分配状态=1&定额任务分配状态=1'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 初始化项目(当天)
|
|
||||||
export function getProject0() {
|
|
||||||
return request({
|
|
||||||
url: '',
|
|
||||||
method: 'post',
|
|
||||||
data: {
|
|
||||||
UserID: state.state.user.id,
|
|
||||||
ModularID: router.currentRoute.path,
|
|
||||||
type: '1',
|
|
||||||
name: '车间生产管理工艺_零件工艺计划_工艺任务分配_项目查询'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 获取机床图号(全部)
|
// 获取机床图号(全部)
|
||||||
export function getGraphNum() {
|
export function getGraphNum() {
|
||||||
return request({
|
return request({
|
||||||
@@ -43,20 +16,6 @@ export function getGraphNum() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 获取机床图号(当天)//////////////
|
|
||||||
export function getGraphNum0(num) {
|
|
||||||
return request({
|
|
||||||
url: '',
|
|
||||||
method: 'post',
|
|
||||||
data: {
|
|
||||||
UserID: state.state.user.id,
|
|
||||||
ModularID: router.currentRoute.path,
|
|
||||||
type: '1',
|
|
||||||
name: '车间生产管理工艺_零件工艺计划_工艺任务分配_机床查询',
|
|
||||||
param: '项目流水号=' + num
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 获取组号(全部)
|
// 获取组号(全部)
|
||||||
export function getGroupNum(num) {
|
export function getGroupNum(num) {
|
||||||
return request({
|
return request({
|
||||||
@@ -71,22 +30,8 @@ export function getGroupNum(num) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 获取组号(当天)/////////
|
|
||||||
export function getGroupNum0(num) {
|
|
||||||
return request({
|
|
||||||
url: '',
|
|
||||||
method: 'post',
|
|
||||||
data: {
|
|
||||||
UserID: state.state.user.id,
|
|
||||||
ModularID: router.currentRoute.path,
|
|
||||||
type: '1',
|
|
||||||
name: '车间生产管理工艺_零件工艺计划_工艺任务分配_组件查询',
|
|
||||||
param: '机床流水号=' + num
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 获取工艺计划,填充主表
|
// 获取工艺计划,填充主表
|
||||||
export function getTable0(PageCurrent, PageSize, num) {
|
export function getTable(PageCurrent, PageSize, num) {
|
||||||
return request({
|
return request({
|
||||||
url: '',
|
url: '',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
@@ -100,21 +45,6 @@ export function getTable0(PageCurrent, PageSize, num) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 查询主表(当天)////////
|
|
||||||
export function getTable00(PageCurrent, PageSize, num) {
|
|
||||||
return request({
|
|
||||||
url: '',
|
|
||||||
method: 'post',
|
|
||||||
data: {
|
|
||||||
UserID: state.state.user.id,
|
|
||||||
ModularID: router.currentRoute.path,
|
|
||||||
type: '1',
|
|
||||||
name: '车间生产管理工艺_零件工艺计划_工艺任务分配_零件查询',
|
|
||||||
param: '组件流水号=' + num,
|
|
||||||
Pagination: PageCurrent + '&' + PageSize
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 工艺定额人员查询
|
// 工艺定额人员查询
|
||||||
export function initPerson() {
|
export function initPerson() {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-card>
|
<el-card>
|
||||||
<el-radio-group v-show="false" v-model="radio" size="small" style="margin: 10px;" @change="radioChange()">
|
|
||||||
<el-radio :label="1">当天</el-radio>
|
|
||||||
<el-radio :label="2">全部</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
<el-select v-model="graphNumValue" filterable size="small" style="margin:3px 10px;width: 180px" placeholder="机床图号" @change="getGroupNum()">
|
<el-select v-model="graphNumValue" filterable size="small" style="margin:3px 10px;width: 180px" placeholder="机床图号" @change="getGroupNum()">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in graphNum"
|
v-for="item in graphNum"
|
||||||
@@ -27,18 +23,9 @@
|
|||||||
<el-button type="success" size="small" icon="el-icon-upload" style="margin-left: 300px" plain @click="currency">通用件保存</el-button>
|
<el-button type="success" size="small" icon="el-icon-upload" style="margin-left: 300px" plain @click="currency">通用件保存</el-button>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-card>
|
<el-card>
|
||||||
<el-table
|
<el-table ref="multipleTable" :data="tableData" style="width: 1000px;" size="mini" height="750" highlight-current-row border @selection-change="handleSelectionChange" @row-click="rowClick">
|
||||||
ref="multipleTable"
|
|
||||||
:data="tableData"
|
|
||||||
:row-class-name="tableRowClassName"
|
|
||||||
style="width: 1000px;"
|
|
||||||
size="mini"
|
|
||||||
height="750"
|
|
||||||
highlight-current-row
|
|
||||||
border
|
|
||||||
@selection-change="handleSelectionChange">
|
|
||||||
<el-table-column align="center" type="selection"/>
|
<el-table-column align="center" type="selection"/>
|
||||||
<el-table-column align="center" label="零件号" prop="零件号" width="160">
|
<el-table-column align="center" label="零件号" prop="零件号">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.零件号 }}
|
{{ scope.row.零件号 }}
|
||||||
</template>
|
</template>
|
||||||
@@ -60,7 +47,6 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="工艺员" width="180px">
|
<el-table-column align="center" label="工艺员" width="180px">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<!-- <el-input v-model="tableData[scope.$index].工艺员" size="mini" style="width:150px" placeholder="工艺员" @click.native="selectPerson(scope.$index)"/>-->
|
|
||||||
<el-select v-model="tableData[scope.$index].工艺员" filterable clearable size="small" placeholder="工艺员" style="margin:3px 10px;width: 150px">
|
<el-select v-model="tableData[scope.$index].工艺员" filterable clearable size="small" placeholder="工艺员" style="margin:3px 10px;width: 150px">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in Craftsmens"
|
v-for="item in Craftsmens"
|
||||||
@@ -93,47 +79,11 @@
|
|||||||
@current-change="handleCurrentChange"/>
|
@current-change="handleCurrentChange"/>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" title="选择工艺定额人员" center>
|
|
||||||
<el-table
|
|
||||||
:data="tableData2"
|
|
||||||
style="width: 100%;max-height: 200px"
|
|
||||||
size="mini"
|
|
||||||
border
|
|
||||||
stripe
|
|
||||||
height="200px"
|
|
||||||
highlight-current-row
|
|
||||||
@row-click="confirmPerson">
|
|
||||||
<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="tijiao()">提交</el-button>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getProject0, getProject, getGraphNum, getGroupNum, getTable0, getGraphNum0, getGroupNum0, getTable00, save, initPerson, save2 } from '@/api/ManufacturingCenter/ProcessTaskAssignment'
|
import { getGraphNum, getGroupNum, getTable, save, initPerson, save2 } from '@/api/ManufacturingCenter/ProcessTaskAssignment'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
@@ -144,8 +94,6 @@ export default {
|
|||||||
loading0: false,
|
loading0: false,
|
||||||
projectNameValue: '',
|
projectNameValue: '',
|
||||||
projectName: [],
|
projectName: [],
|
||||||
// machineToolNum: '',
|
|
||||||
radio: 2,
|
|
||||||
graphNumValue: '',
|
graphNumValue: '',
|
||||||
graphNum: [],
|
graphNum: [],
|
||||||
GroupNumValue: '',
|
GroupNumValue: '',
|
||||||
@@ -172,17 +120,8 @@ export default {
|
|||||||
this.initPerson()
|
this.initPerson()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
fetchData() {
|
// 初始化工艺员
|
||||||
getProject().then(response => {
|
initPerson() {
|
||||||
for (let i = 0; i < response.data.length; i++) {
|
|
||||||
this.projectName.push({
|
|
||||||
label: response.data[i].项目名称,
|
|
||||||
value: response.data[i].项目流水号
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
initPerson() { // 初始化工艺员
|
|
||||||
initPerson().then(response => {
|
initPerson().then(response => {
|
||||||
this.tableData2 = response.data
|
this.tableData2 = response.data
|
||||||
for (let i = 0; i < response.data.length; i++) {
|
for (let i = 0; i < response.data.length; i++) {
|
||||||
@@ -193,166 +132,76 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
radioChange() { // radio改变
|
// 获取下拉图号
|
||||||
this.loading = true
|
getGraphNum() {
|
||||||
this.projectName = []
|
|
||||||
this.projectNameValue = ''
|
|
||||||
this.graphNumValue = ''
|
|
||||||
this.GroupNumValue = ''
|
|
||||||
this.GroupNum = []
|
|
||||||
this.tableData = []
|
|
||||||
this.total = 0
|
|
||||||
if (this.radio === 1) {
|
|
||||||
getProject0().then(response => {
|
|
||||||
for (let i = 0; i < response.data.length; i++) {
|
|
||||||
this.projectName.push({
|
|
||||||
label: response.data[i].项目名称,
|
|
||||||
value: response.data[i].项目流水号
|
|
||||||
})
|
|
||||||
}
|
|
||||||
this.loading = false
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
getProject().then(response => {
|
|
||||||
for (let i = 0; i < response.data.length; i++) {
|
|
||||||
this.projectName.push({
|
|
||||||
label: response.data[i].项目名称,
|
|
||||||
value: response.data[i].项目流水号
|
|
||||||
})
|
|
||||||
}
|
|
||||||
this.loading = false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getGraphNum() { // 获取下拉图号
|
|
||||||
this.graphNumValue = ''
|
this.graphNumValue = ''
|
||||||
this.graphNum = []
|
this.graphNum = []
|
||||||
this.tableData = []
|
this.tableData = []
|
||||||
this.total = 0
|
this.total = 0
|
||||||
this.GroupNumValue = ''
|
this.GroupNumValue = ''
|
||||||
this.GroupNum = []
|
this.GroupNum = []
|
||||||
if (this.radio === 2) { // 全部
|
getGraphNum().then(response => {
|
||||||
getGraphNum().then(response => {
|
for (let i = 0; i < response.data.length; i++) {
|
||||||
for (let i = 0; i < response.data.length; i++) {
|
this.graphNum.push({
|
||||||
this.graphNum.push({
|
label: response.data[i].机床图号,
|
||||||
label: response.data[i].机床图号,
|
value: response.data[i].机床流水号,
|
||||||
value: response.data[i].机床流水号,
|
value2: response.data[i].项目名称
|
||||||
value2: response.data[i].项目名称
|
})
|
||||||
})
|
}
|
||||||
}
|
})
|
||||||
})
|
|
||||||
} else { // 当天
|
|
||||||
getGraphNum0(this.projectNameValue).then(response => {
|
|
||||||
for (let i = 0; i < response.data.length; i++) {
|
|
||||||
this.graphNum.push({
|
|
||||||
label: response.data[i].机床图号,
|
|
||||||
value: response.data[i].机床流水号
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
getGroupNum() { // 获取下拉组号
|
// 获取下拉组号
|
||||||
|
getGroupNum() {
|
||||||
this.tableData = []
|
this.tableData = []
|
||||||
this.total = 0
|
this.total = 0
|
||||||
this.GroupNum = []
|
this.GroupNum = []
|
||||||
this.GroupNumValue = ''
|
this.GroupNumValue = ''
|
||||||
if (this.radio === 2) { // 全部
|
getGroupNum(this.graphNumValue).then(response => {
|
||||||
getGroupNum(this.graphNumValue).then(response => {
|
for (let i = 0; i < response.data.length; i++) {
|
||||||
for (let i = 0; i < response.data.length; i++) {
|
this.GroupNum.push({
|
||||||
this.GroupNum.push({
|
label: response.data[i].组号,
|
||||||
label: response.data[i].组号,
|
value: response.data[i].组件流水号
|
||||||
value: response.data[i].组件流水号
|
})
|
||||||
})
|
}
|
||||||
}
|
})
|
||||||
})
|
|
||||||
} else { // 当天
|
|
||||||
getGroupNum0(this.graphNumValue).then(response => {
|
|
||||||
for (let i = 0; i < response.data.length; i++) {
|
|
||||||
this.GroupNum.push({
|
|
||||||
label: response.data[i].组号,
|
|
||||||
value: response.data[i].组件流水号
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
getTable() { // 获取主表
|
// 获取主表
|
||||||
|
getTable() {
|
||||||
if (this.GroupNumValue === null) {
|
if (this.GroupNumValue === null) {
|
||||||
this.tableData = []
|
this.tableData = []
|
||||||
} else {
|
} else {
|
||||||
this.loading0 = true
|
this.loading0 = true
|
||||||
this.tableData = []
|
this.tableData = []
|
||||||
if (this.radio === 2) { // 全部
|
getTable(this.PageCurrent, this.PageSize, this.GroupNumValue).then(response => {
|
||||||
getTable0(this.PageCurrent, this.PageSize, this.GroupNumValue).then(response => {
|
this.total = response.data.total
|
||||||
this.total = response.data.total
|
for (let i = 0; i < response.data.rows.length; i++) {
|
||||||
for (let i = 0; i < response.data.rows.length; i++) {
|
response.data.rows[i].工艺计划开始时间 = response.data.rows[i].工艺计划开始时间.split(' ')[0]
|
||||||
response.data.rows[i].工艺计划开始时间 = response.data.rows[i].工艺计划开始时间.split(' ')[0]
|
response.data.rows[i].工艺计划结束时间 = response.data.rows[i].工艺计划结束时间.split(' ')[0]
|
||||||
response.data.rows[i].工艺计划结束时间 = response.data.rows[i].工艺计划结束时间.split(' ')[0]
|
response.data.rows[i].操作时间 = response.data.rows[i].操作时间.split(' ')[0]
|
||||||
response.data.rows[i].操作时间 = response.data.rows[i].操作时间.split(' ')[0]
|
}
|
||||||
}
|
for (let i = 0; i < response.data.rows.length; i++) {
|
||||||
for (let i = 0; i < response.data.rows.length; i++) {
|
this.tableData.push({
|
||||||
this.tableData.push({
|
零件号: response.data.rows[i].零件图号,
|
||||||
零件号: response.data.rows[i].零件图号,
|
零件名称: response.data.rows[i].零件名称,
|
||||||
零件名称: response.data.rows[i].零件名称,
|
工艺开始时间: response.data.rows[i].工艺计划开始时间,
|
||||||
工艺开始时间: response.data.rows[i].工艺计划开始时间,
|
工艺结束时间: response.data.rows[i].工艺计划结束时间,
|
||||||
工艺结束时间: response.data.rows[i].工艺计划结束时间,
|
数量: response.data.rows[i].批次数量,
|
||||||
数量: response.data.rows[i].批次数量,
|
投产时间: response.data.rows[i].操作时间,
|
||||||
投产时间: response.data.rows[i].操作时间,
|
规格: response.data.rows[i].规格,
|
||||||
规格: response.data.rows[i].规格,
|
是否加急: response.data.rows[i].是否加急,
|
||||||
是否加急: response.data.rows[i].是否加急,
|
工艺员: '',
|
||||||
工艺员: '',
|
人员编号: '',
|
||||||
人员编号: '',
|
工艺计划流水号: response.data.rows[i].工艺计划流水号
|
||||||
工艺计划流水号: response.data.rows[i].工艺计划流水号
|
})
|
||||||
})
|
}
|
||||||
}
|
this.loading0 = false
|
||||||
this.loading0 = false
|
})
|
||||||
})
|
|
||||||
} else { // 当天
|
|
||||||
getTable00(this.PageCurrent, this.PageSize, this.GroupNumValue).then(response => {
|
|
||||||
this.total = response.data.total
|
|
||||||
for (let i = 0; i < response.data.rows.length; i++) {
|
|
||||||
this.tableData.push({
|
|
||||||
零件号: response.data.rows[i].零件图号,
|
|
||||||
零件名称: response.data.rows[i].零件名称,
|
|
||||||
工艺开始时间: response.data.rows[i].工艺计划开始时间,
|
|
||||||
工艺结束时间: response.data.rows[i].工艺计划结束时间,
|
|
||||||
数量: response.data.rows[i].批次数量,
|
|
||||||
投产时间: response.data.rows[i].操作时间,
|
|
||||||
规格: response.data.rows[i].规格,
|
|
||||||
是否加急: response.data.rows[i].是否加急,
|
|
||||||
工艺员: '',
|
|
||||||
人员编号: '',
|
|
||||||
工艺计划流水号: response.data.rows[i].工艺计划流水号
|
|
||||||
})
|
|
||||||
}
|
|
||||||
this.loading0 = false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleSizeChange(val) {
|
rowClick(row) {
|
||||||
this.PageCurrent = 1
|
console.log(row.工艺计划流水号)
|
||||||
this.PageSize = val
|
|
||||||
this.getTable()
|
|
||||||
},
|
|
||||||
handleCurrentChange(val) {
|
|
||||||
this.PageCurrent = val
|
|
||||||
this.getTable()
|
|
||||||
},
|
|
||||||
selectPerson(index) { // 点击查询按钮
|
|
||||||
this.index = index
|
|
||||||
this.dialogFormVisible = true
|
|
||||||
},
|
|
||||||
confirmPerson(row) { // 选择一行
|
|
||||||
this.num1 = row.姓名
|
|
||||||
this.num2 = row.人员编号
|
|
||||||
},
|
|
||||||
tijiao() {
|
|
||||||
this.tableData[this.index].工艺员 = this.num1
|
|
||||||
this.tableData[this.index].人员编号 = this.num2
|
|
||||||
this.dialogFormVisible = false
|
|
||||||
},
|
},
|
||||||
|
// 全选
|
||||||
selectAll(rows) {
|
selectAll(rows) {
|
||||||
if (this.tableData[0].工艺员 !== '') {
|
if (this.tableData[0].工艺员 !== '') {
|
||||||
for (let i = 0; i < rows.length; i++) {
|
for (let i = 0; i < rows.length; i++) {
|
||||||
@@ -387,12 +236,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
tableRowClassName({ row }) {
|
|
||||||
console.log(row.是否加急)
|
|
||||||
if (row.是否加急 === '1') {
|
|
||||||
return 'UrgentItem'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 直接保存工艺
|
// 直接保存工艺
|
||||||
currency() {
|
currency() {
|
||||||
if (this.multipleSelection.length === 0) {
|
if (this.multipleSelection.length === 0) {
|
||||||
@@ -432,6 +275,16 @@ export default {
|
|||||||
this.$message.error('请选择工艺员')
|
this.$message.error('请选择工艺员')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
// 分页
|
||||||
|
handleSizeChange(val) {
|
||||||
|
this.PageCurrent = 1
|
||||||
|
this.PageSize = val
|
||||||
|
this.getTable()
|
||||||
|
},
|
||||||
|
handleCurrentChange(val) {
|
||||||
|
this.PageCurrent = val
|
||||||
|
this.getTable()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -442,8 +295,3 @@ export default {
|
|||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<style>
|
|
||||||
.el-table .UrgentItem{
|
|
||||||
background: #ff7575;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|||||||
Reference in New Issue
Block a user