This commit is contained in:
liushuai
2020-01-01 19:21:42 +08:00
parent d30942c89e
commit 15f2cbf774
6 changed files with 1005 additions and 9 deletions

View File

@@ -0,0 +1,135 @@
import request from '@/utils/request'
// 机床名称
export function getMachines() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_传递后_机床名称_根据机床查询',
param: '是否传递=2=int&考核状态=6=int&工艺任务分配状态=2=int&定额任务分配状态=2=int&单件是否外协=1=int'
}
})
}
// 获取组号
export function getGroups(stepNumber) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_传递后_组件名称_查询数据_查询所有组',
param: '机床流水号=' + stepNumber + '=int'
}
})
}
// 获取工艺
export function initProcessNumber() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间管理_工艺_查询数据'
}
})
}
// 获取组号
export function addProcess(NUM, NUM1, NUM2, NUM3) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间管理_自制件插序_增加数据',
param: '工艺计划流水号=' + NUM + '&工序顺序=' + NUM1 + '&工艺编号=' + NUM2 + '&操作工=' + NUM3
}
})
}
export function getTable(checkbox_Machine, Machine, checkbox_Group, Group, checkbox_number, number, k, m, pageCurrent, pageSize) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_零件工序_查询数据_已编制工序的全部零件及工序_横向赋值新建存储过程_新',
param: '项目流水号_check=0=string&机床流水号_check=' + checkbox_Machine + '=string&机床流水号=' + Machine + '=string&组件流水号_check=' + checkbox_Group + '=string&组件流水号=' + Group + '=string&零件图号_check=' + checkbox_number + '=string&零件图号=' + number + '=string&是否查询全部数据=1=string&单件是否外协=1=string&考核状态=6=int&开始时间_check=0&开始时间=' + k + '&结束时间_check=0&结束时间=' + m,
Pagination: pageCurrent + '&' + pageSize
}
})
}
// 获取组号
export function gettabledata1(num) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_加工进度查询_查询_New_加序',
param: '工艺计划流水号=' + num + '=int'
}
})
}
// 补录加工完成日期
export function editdata(processSerialNumber) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间生产管理工艺_加工进度查询_查询_New',
param: '工艺计划流水号=' + processSerialNumber + '=int'
}
})
}
// 初始化人员信息 弹出框
export function getTree() {
return request({
url: '',
method: 'post',
data: {
type: 1,
name: '人事档案管理_部门关系_查询节点',
param: '子节点=0=int'
}
})
}
export function fn(data, pid) {
const result = []
let temp
for (let i = 0; i < data.length; i++) {
if (data[i].父节点 === pid) {
const obj = { label: data[i].节点名称, id: data[i].子节点 }
temp = fn(data, data[i].子节点)
if (temp.length > 0) {
obj.children = temp
}
result.push(obj)
}
}
return result
}
export function getTable8(code) {
return request({
url: '',
method: 'post',
data: {
type: 1,
name: '人事档案管理_人员_部门与人员_查询数据_根据部门编号',
param: '考核部门编号=' + code + '=int'
}
})
}
export function submitEdit(Number1, completetime, processSerialNumber) {
return request({
url: '',
method: 'post',
data: {
type: 2,
name: '车间生产管理工艺_零件工序_修改数据_工作者_根据人员编号和完成日期',
param: '人员编号=' + Number1 + '=string&完成日期=' + completetime + '=string&工序流水号=' + processSerialNumber + '=string'
}
})
}

View File

@@ -0,0 +1,56 @@
import request from '@/utils/request'
export function searchPerson() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间管理_其他数据_查询数据_人员'
}
})
}
export function fetchDate(month) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间管理_其他数据_查询数据',
param: '月份=' + month
}
})
}
export function saveDate(time, num, partNum, partName, procedure, num1, num2, num3, number, time1) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间管理_其他数据_增加数据',
param: '加工日期=' + time + '&操作工流水号=' + num + '&零件图号=' + partNum + '&名称=' + partName + '&工序=' + procedure + '&责任人流水号=' + num1 + '&确认人流水号=' + num2 + '&录入人流水号=' + num3 + '&数量=' + number + '&单件工时=' + time1
}
})
}
export function editDate(ID, time, num, partNum, partName, procedure, num1, num2, num3, number, time1) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间管理_其他数据_编辑数据',
param: 'ID=' + ID + '&加工日期=' + time + '&操作工流水号=' + num + '&零件图号=' + partNum + '&名称=' + partName + '&工序=' + procedure + '&责任人流水号=' + num1 + '&确认人流水号=' + num2 + '&录入人流水号=' + num3 + '&数量=' + number + '&单件工时=' + time1
}
})
}
export function deleteDate(ID) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间管理_其他数据_删除数据',
param: 'ID=' + ID
}
})
}

View File

@@ -0,0 +1,560 @@
<template>
<div class="app-container">
<el-card>
<el-button :disabled="isShow" type="info" size="small" style="margin: 0px 180px;float: right" @click="EditData">补录完成日期</el-button>
<el-select v-model="Machine" filterable clearable size="small" style="margin:0px 10px 0px 10px;width: 185px;" placeholder="机床号" @change="getGroup">
<el-option
v-for="item in Machines"
:key="item.value"
:label="item.label"
:value="item.value">
<div style="float: left">{{ item.label }}</div>
<div style="float: right; color: #8492a6; font-size: 13px">{{ item.value2 }}</div>
</el-option>
</el-select>
<el-select v-model="Group" size="small" clearable placeholder="组号" style="margin:0px 10px;width: 100px;" @change="getTableData">
<el-option
v-for="item in Groups"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-input v-model="number" placeholder="零件号" clearable size="small" style="width: 170px;margin:0px 10px;"/>
<el-button type="success" class="el-icon-search" size="small" style="margin: 0px 10px;" @click="pageCurrent = 1;pageSize = 100;getTableData()">查询</el-button>
<el-button type="primary" class="el-icon-plus" size="small" style="margin: 0px 10px;" @click="addTableData()">加序</el-button>
</el-card>
<el-row>
<el-col style="width: 550px">
<el-card>
<el-table
:data="tableData1"
:row-class-name="tableRowClassName"
loading="loading"
class="table"
style="max-height: 830px"
highlight-current-row
empty-text=" "
border
@current-change="getRow">
<el-table-column align="center" label="序号" width="70">
<template slot-scope="scope">
{{ scope.row.工序顺序 }}
</template>
</el-table-column>
<el-table-column align="center" label="工艺名" show-overflow-tooltip width="70">
<template slot-scope="scope">
{{ scope.row.工艺名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="质检" width="60">
<template slot-scope="scope">
{{ scope.row.序间质检 }}
</template>
</el-table-column>
<el-table-column align="center" label="不合格数" width="80">
<template slot-scope="scope">
{{ scope.row.不合格数量 === 0 ? '' : scope.row.不合格数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="操作者" show-overflow-tooltip width="70">
<template slot-scope="scope">
{{ scope.row.操作者 }}
</template>
</el-table-column>
<el-table-column align="center" label="排产日期" width="95">
<template slot-scope="scope">
{{ scope.row.排产日期 }}
</template>
</el-table-column>
<el-table-column align="center" label="完成日期" width="95">
<template slot-scope="scope">
{{ scope.row.完成日期 === '1900-01-01' ? '' : scope.row.完成日期 }}
</template>
</el-table-column>
</el-table>
</el-card>
</el-col>
<el-col style="width: 810px">
<el-card>
<el-table
:data="tableData"
:row-class-name="tableRowClassName"
loading="loading"
class="table"
highlight-current-row
border
height="630"
@current-change="getCurrentRow">
<el-table-column type="index" align="center" label="序号" width="80">
<template slot-scope="scope">
<el-radio :label="scope.row.序号" v-model="radio"/>
</template>
</el-table-column>
<el-table-column align="center" label="跟单号" width="100">
<template slot-scope="scope">
{{ scope.row.跟单号 }}
</template>
</el-table-column>
<el-table-column align="center" label="零件图号" show-overflow-tooltip width="180">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column align="center" label="零件名称" show-overflow-tooltip width="80">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="加工数" width="70">
<template slot-scope="scope">
{{ scope.row.加工数 }}
</template>
</el-table-column>
<el-table-column align="center" label="计划数" width="70">
<template slot-scope="scope">
{{ scope.row.投产数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="加工完成" width="100">
<template slot-scope="scope">
{{ scope.row.完成日期 }}
</template>
</el-table-column>
<el-table-column align="center" label="计划完成" width="100">
<template slot-scope="scope">
{{ scope.row.计划结束时间 }}
</template>
</el-table-column>
<el-table-column align="center" label="用户名称" show-overflow-tooltip width="110">
<template slot-scope="scope">
{{ scope.row.客户名称 }}
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
:current-page="pageCurrent"
:page-sizes="[100, 200, 300, 400]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-card>
</el-col>
</el-row>
<el-dialog v-el-drag-dialog :title="title" :visible.sync="dialogFormVisible" center style="min-height: 300px" width="400px">
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="90px" class="demo-ruleForm">
<el-row width="200px">
<el-form-item label="操作员" prop="人员" >
<el-input v-model="form.人员" placeholder="操作员" readonly size="small" style="width: 80%" @focus="dialogTableVisible" />
</el-form-item>
<el-form-item label="人员编号" prop="人员编号" >
<el-input v-model="form.人员编号" placeholder="人员编号" disabled size="small" style="width: 80%" />
</el-form-item>
<el-form-item label="完成日期" prop="完成时间">
<el-date-picker
v-model="form.完成时间"
style="width: 80%"
size="small"
type="date"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
placeholder="选择日期"/>
</el-form-item>
</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 v-el-drag-dialog :visible.sync="dialogFormVisible1" 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
default-expand-all="true"
highlight-current="true"
@node-click="handleNodeClick"/>
</div>
<el-table :data="List1" highlight-current-row height="400" style="width: 400px;float: left;margin-left: 30px" @row-click="handleCurrentChange2">
<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="dialogFormVisible1 = false">取消</el-button>
<el-button type="primary" style="margin-top: 20px" @click="getName">确认</el-button>
</el-dialog>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible2" title="加序" center style="min-height: 300px" width="400px">
<el-form ref="form2" :model="form2" :rules="rules2" label-position="left" label-width="90px" class="demo-ruleForm">
<el-row width="200px">
<el-form-item label="序号" prop="工序顺序" >
<el-input v-model="form2.工序顺序" size="small" style="width: 160px;margin:0px 10px" placeholder="序号"/>
</el-form-item>
<el-form-item label="工序名称" prop="工艺编号" >
<el-select v-model="form2.工艺编号" filterable size="small" style="width:160px;margin:0px 10px" placeholder="工艺编号">
<el-option
v-for="item in ProcessNumber"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="操作工" prop="操作工" >
<el-select v-model="form2.操作工" filterable size="small" style="width:160px;margin:0px 10px" placeholder="操作工">
<el-option
v-for="item in People"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="callOffProcess('form2')">取消</el-button>
<el-button type="primary" @click="submitProcess('form2')" >确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { getMachines, getGroups, getTable, gettabledata1, getTree, fn, getTable8, submitEdit, initProcessNumber, addProcess } from '@/api/ManufacturingCenter/AddingOrder'
import Cookie from 'js-cookie'
export default {
data() {
return {
Machine: '', // 机床号
Machines: [],
Group: '', // 组号
Groups: [],
number: '', // 零件图号
process: '', // 工艺计划流水号
tableData: [], // 工序表
loading: '',
checkbox_Machine: '', // 机床
checkbox_Group: '', // 分组
checkbox_number: '',
pageCurrent: 1,
pageSize: 100,
total: 0,
ProcessNumber: [], // 工艺
tableData1: [], // 工序表
radio: '',
completeTime: '', // 完成时间
row1: [],
isShow: true,
processSerialNumber: '', // 工序流水号
startTime: '', // 开始时间
endTime: '',
dateOfProduction: '', // 排产时间
title: '',
People: [],
dialogFormVisible: false,
dialogFormVisible2: false,
form: {
人员: '',
人员编号: '',
完成时间: ''
},
form2: {
操作工: '',
工序顺序: '',
工艺编号: ''
},
rules: {
人员: [{ required: true, message: '请选择操作员', trigger: 'change' }],
人员编号: [{ required: true, message: '人员编号', trigger: 'change' }],
完成时间: [{ required: true, message: '请选择实际完成时间', trigger: 'change' }]
},
rules2: {
操作工: [{ required: true, message: '请选择操作员', trigger: 'change' }],
工序顺序: [{ required: true, message: '请填写工序顺序', trigger: 'change' }],
工艺编号: [{ required: true, message: '请选择工序名称', trigger: 'change' }]
},
dialogFormVisible1: false,
data2: [],
List1: [],
ssks: '',
Number1: '', // 人员编号
row2: [],
khbmbh: ''
}
},
created() {
this.getMachine()
this.getTable9()
},
methods: {
addTableData() {
this.dialogFormVisible2 = true
},
getMachine() {
if (Cookie.get('machineValue') !== undefined) {
this.Machine = ''
this.Machines = []
this.Group = ''
this.Groups = []
getMachines().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Machines.push({
label: response.data[i].机床图号,
value: response.data[i].机床流水号,
value2: response.data[i].项目名称
})
}
if (Cookie.get('group') !== undefined) {
this.Machine = parseInt(Cookie.get('machineValue'))
this.getGroup()
this.getTableData()
this.Group = parseInt(Cookie.get('group'))
// this.getTableData()
Cookie.remove('machineValue')
Cookie.remove('group')
} else {
// this.getTableData()
Cookie.remove('machineValue')
Cookie.remove('group')
}
})
} else {
this.Machine = ''
this.Machines = []
this.Group = ''
this.Groups = []
getMachines().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Machines.push({
label: response.data[i].机床图号,
value: response.data[i].机床流水号,
value2: response.data[i].项目名称
})
}
})
this.getTableData()
}
}, // 获取组号
getGroup() {
this.Group = ''
this.Groups = []
getGroups(this.Machine).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Groups.push({
label: response.data[i].组号,
value: response.data[i].组件流水号
})
}
this.Group = response.data[0].组件流水号
})
this.getTableData()
}, // 按条件查询
getTableData() {
this.tableData = []
this.Loading = true
if (this.Machine === '') {
this.checkbox_Machine = 0
} else {
this.checkbox_Machine = 1
}
if (this.Group === '') {
this.checkbox_Group = 0
} else {
this.checkbox_Group = 1
}
if (this.number === '') {
this.checkbox_number = 0
} else {
this.checkbox_number = 1
}
getTable(this.checkbox_Machine, this.Machine, this.checkbox_Group, this.Group, this.checkbox_number, this.number, this.startTime, this.endTime, this.pageCurrent, this.pageSize).then(response => {
if (response.data.rows.length !== 0) {
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].完成数量, // MES里采集 现在没有
投产数量: response.data.rows[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].客户名称 // 客户名
})
}
}
this.total = response.data.total
this.loading = false
})
}, // 获取工序表
getCurrentRow(row) {
this.completeTime = ''
this.dateOfProduction = ''
this.processSerialNumber = ''
this.radio = true
this.tableData1 = []
this.process = row.工艺计划流水号
this.row2 = row
gettabledata1(row.工艺计划流水号).then(response => {
if (response.data.length !== 0) {
for (let i = 0; i < response.data.length; i++) {
this.tableData1.push({
工序顺序: response.data[i].工序顺序,
工艺名称: response.data[i].工艺名称,
序间质检: response.data[i].质检结果,
排产日期: response.data[i].排产时间 ? response.data[i].排产时间.split(' ')[0] : '',
完成日期: response.data[i].工序完成日期 ? response.data[i].工序完成日期.split(' ')[0] : '',
操作者: response.data[i].操作者,
不合格数量: response.data[i].不合格数量,
质检数量: response.data[i].数量,
工序流水号: response.data[i].工序流水号
})
}
}
})
console.log(this.tableData1, 123)
}, // 补加完成日期
EditData() {
this.dialogFormVisible = true
this.form.人员 = ''
this.form.人员编号 = ''
this.form.完成时间 = ''
},
getRow(row) {
this.completeTime = row.完成日期
this.dateOfProduction = row.排产日期
this.processSerialNumber = row.工序流水号
if (this.completeTime === '' && this.dateOfProduction !== '') {
this.isShow = false
} else {
this.isShow = true
}
},
dialogTableVisible() {
this.dialogFormVisible1 = true
this.fetchData3()
},
fetchData3() {
getTree().then(response => { // 获取人员信息树
const data = response.data
this.data2 = fn(data, 0)
})
},
handleNodeClick(data) { // 树节点点击
this.ssks = data.label
getTable8(data.id).then(response => {
this.List1 = response.data
})
},
getTable9() {
this.khbmbh = 12 // 考核部门编号
getTable8(this.khbmbh).then(response => {
this.List1 = response.data
for (let i = 0; i < response.data.length; i++) {
this.People.push({
value: response.data[i].人员编号,
label: response.data[i].姓名
})
}
})
initProcessNumber().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.ProcessNumber.push({
value: response.data[i].工艺编号,
label: response.data[i].工艺名称
})
}
})
},
handleCurrentChange2(row) { // 获取当前行人员信息
this.ssks = row.节点名称
this.Number1 = row.人员编号
this.Name = row.姓名
},
getName() { // 提交人员
this.dialogFormVisible1 = false
this.form.人员 = this.Name
this.form.人员编号 = this.Number1
},
submitProcess() {
addProcess(this.process, this.form2.工序顺序, this.form2.工艺编号, this.form2.操作工).then(response => {
if (response.data[0].result === '1') {
this.$message.success('加序成功')
this.dialogFormVisible2 = false
} else {
this.$message.error('加序失败')
}
})
},
submit() {
submitEdit(this.Number1, this.form.完成时间, this.processSerialNumber).then(response => {
if (response.data[0].result === '1') {
this.$message.success('补录成功')
} else {
this.$message.error('补录失败')
}
})
this.dialogFormVisible = false
this.getCurrentRow(this.row2)
},
// 完成日期变色
tableRowClassName({ row, rowIndex }) {
row.index = rowIndex
if (row.完成日期 !== '') {
return 'CompleteColor'
}
}, // 重置表单
callOff(formName) {
this.dialogFormVisible = false
this.$refs[formName].resetFields()
},
callOffProcess(formName) {
this.dialogFormVisible2 = false
this.$refs[formName].resetFields()
},
handleSizeChange(val) {
this.pageSize = val
this.getTableData()
},
handleCurrentChange(val) {
this.pageCurrent = val
this.getTableData()
}
}
}
</script>
<style>
.CompleteColor{
background: #9bd7fc !important;
}
</style>

View File

@@ -0,0 +1,245 @@
<template>
<div class="app-container">
<el-card>
<el-row>
<el-date-picker
v-model="time"
size="small"
type="date"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
placeholder="加工日期"
style="width: 140px;margin-top: 10px"
clearable
@change="change"/>
<el-select v-model="Person" style="width:100px" placeholder="操作工" size="small" filterable clearable>
<el-option
v-for="item in Persons"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-input v-model="partNumber" size="small" placeholder="零件图号" style="width: 150px" clearable/>
<el-input v-model="partName" size="small" placeholder="零件名称" style="width: 140px" clearable/>
<el-input v-model="procedureName" size="small" placeholder="工序名称" style="width: 100px" clearable/>
<span>数量</span>
<el-input-number v-model="number" :min="0" :step="1" size="small" placeholder="数量" style="width: 120px" clearable/>
<span>单件工时</span>
<el-input-number v-model="workTime" :min="0" :step="1" size="small" placeholder="单件工时" style="width: 120px" clearable/>
<el-select v-model="PersonLiable" style="width:100px" placeholder="责任人" size="small" filterable clearable>
<el-option
v-for="item in Persons"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select v-model="ConfirmingPerson" style="width:100px" placeholder="确认人" size="small" filterable clearable>
<el-option
v-for="item in Persons"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-row>
<el-row>
<el-button type="primary" size="small" icon="el-icon-plus" style="margin-left: 10px" @click="saveDate">保存</el-button>
<el-button type="success" size="small" icon="el-icon-edit" style="margin-left: 10px" @click="editDate">编辑</el-button>
<el-button type="danger" size="small" icon="el-icon-delete" style="margin-left: 10px" @click="deleteDate">删除</el-button>
<el-date-picker
v-model="monthValue"
type="month"
size="small"
value-format="yyyy-MM"
style="margin-left: 400px; width: 140px"
placeholder="选择月"/>
<el-button type="success" size="small" icon="el-icon-search" style="margin-top: 10px;margin-bottom: 10px" @click="fetchDate">查询</el-button>
</el-row>
</el-card>
<el-table v-loading="" :data="tableData" border stripe style="width: 100%" height="730px" size="mini" highlight-current-row @row-click="searchTable">
<el-table-column label="加工日期" align="center" width="150">
<template slot-scope="scope">
{{ scope.row.加工日期 ? scope.row.加工日期.split(' ')[0] : '-' }}
</template>
</el-table-column>
<el-table-column label="操作工" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.操作工姓名 }}
</template>
</el-table-column>
<el-table-column label="零件图号" align="center" width="150">
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column label="零件名称" align="center" width="150">
<template slot-scope="scope">
{{ scope.row.名称 }}
</template>
</el-table-column>
<el-table-column label="工序名称" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.工序 }}
</template>
</el-table-column>
<el-table-column label="数量" align="center" width="70">
<template slot-scope="scope">
{{ scope.row.数量 }}
</template>
</el-table-column>
<el-table-column label="单件工时" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.单件工时 }}
</template>
</el-table-column>
<el-table-column label="责任人" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.责任人姓名 }}
</template>
</el-table-column>
<el-table-column label="确认人" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.确认人姓名 }}
</template>
</el-table-column>
<el-table-column label="录入人" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.录入人姓名 }}
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import { searchPerson, fetchDate, saveDate, editDate, deleteDate } from '@/api/ManufacturingCenter/Enter0therData.js'
import { mapGetters } from 'vuex'
export default {
data() {
return {
time: '',
Person: '',
Persons: [],
partNumber: '',
partName: '',
procedureName: '',
number: '',
workTime: '',
PersonLiable: '',
ConfirmingPerson: '',
tableData: [],
monthValue: ''
}
},
computed: {
...mapGetters([
'sidebar',
'avatar',
'name',
'userId',
'id' // 人员编号
])
},
created() {
this.searchPerson()
},
methods: {
change() {
console.log(this.time.slice(0, 7))
},
searchPerson() {
searchPerson().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Persons.push({
label: response.data[i].姓名,
value: response.data[i].人员编号
})
}
})
},
fetchDate() {
if (this.monthValue) {
fetchDate(this.monthValue).then(response => {
this.tableData = response.data
})
} else {
this.$message.warning('请选择月份进行查询')
}
},
saveDate() {
if (this.time && this.Person && this.partNumber && this.partName && this.procedureName && this.number && this.workTime) {
saveDate(this.time, this.Person, this.partNumber, this.partName, this.procedureName, this.PersonLiable, this.ConfirmingPerson, this.id, this.number, this.workTime).then(response => {
if (response.data[0].result === '1') {
this.$message.success('增加成功')
this.monthValue = this.time.slice(0, 7)
this.RemoveDate()
this.fetchDate()
} else {
this.$message.success('增加失败')
}
})
} else {
this.$message.warning('请完善信息')
}
},
editDate() {
if (this.time && this.Person && this.partNumber && this.partName && this.procedureName && this.number && this.workTime) {
editDate(this.ID, this.time, this.Person, this.partNumber, this.partName, this.procedureName, this.PersonLiable, this.ConfirmingPerson, this.id, this.number, this.workTime).then(response => {
if (response.data[0].result === '1') {
this.$message.success('编辑成功')
this.monthValue = this.time.slice(0, 7)
this.RemoveDate()
this.fetchDate()
} else {
this.$message.success('编辑失败')
}
})
} else {
this.$message.warning('请完善信息')
}
},
deleteDate() {
this.$confirm('确定删除该数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteDate(this.ID).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.RemoveDate()
this.fetchDate()
} else { this.$message.error('删除失败') }
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
RemoveDate() {
this.time = ''
this.Person = ''
this.partNumber = ''
this.partName = ''
this.number = 0
this.workTime = 0
this.procedureName = ''
this.PersonLiable = ''
this.ConfirmingPerson = ''
},
searchTable(row) {
this.time = row.加工日期
this.Person = row.操作工流水号
this.partNumber = row.零件图号
this.partName = row.名称
this.procedureName = row.工序
this.number = row.数量
this.workTime = row.单件工时
this.PersonLiable = row.责任人流水号
this.ConfirmingPerson = row.确认人流水号
this.ID = row.ID
}
}
}
</script>

View File

@@ -643,12 +643,7 @@ export default {
getOP_state() {
getOP_state().then(response => {
for (let i = 0; i < response.data.length; i++) {
if (response.data[i].状态代码 === '1') {
$('#' + response.data[i].工位号 + '_circle').removeClass('circle3')
$('#' + response.data[i].工位号 + '_circle').removeClass('circle1')
$('#' + response.data[i].工位号 + '_circle').removeClass('circle')
$('#' + response.data[i].工位号 + '_circle').addClass('circle2')
} else if (response.data[i].状态代码 === '2') {
if (response.data[i].状态代码 === '2') {
$('#' + response.data[i].工位号 + '_circle').removeClass('circle')
$('#' + response.data[i].工位号 + '_circle').removeClass('circle3')
$('#' + response.data[i].工位号 + '_circle').removeClass('circle2')
@@ -663,6 +658,11 @@ export default {
$('#' + response.data[i].工位号 + '_circle').removeClass('circle1')
$('#' + response.data[i].工位号 + '_circle').removeClass('circle2')
$('#' + response.data[i].工位号 + '_circle').addClass('circle3')
} else {
$('#' + response.data[i].工位号 + '_circle').removeClass('circle3')
$('#' + response.data[i].工位号 + '_circle').removeClass('circle1')
$('#' + response.data[i].工位号 + '_circle').removeClass('circle')
$('#' + response.data[i].工位号 + '_circle').addClass('circle2')
}
}
})

View File

@@ -144,7 +144,7 @@
</el-table-column>
<el-table-column label="金额" align="center" width="80" prop="到货金额">
<template slot-scope="scope">
{{ scope.row.到货金额 }}
{{ scope.row.到货金额.toFixed(2) }}
</template>
</el-table-column>
<el-table-column min-width="100" align="center" label="操作">
@@ -204,7 +204,7 @@
</el-table-column>
<el-table-column label="金额" align="center">
<template slot-scope="scope">
{{ scope.row.到货金额 }}
{{ scope.row.到货金额.toFixed(2) }}
</template>
</el-table-column>
</el-table>
@@ -232,7 +232,7 @@
</el-table-column>
<el-table-column label="金额" align="center">
<template slot-scope="scope">
{{ scope.row.到货金额 }}
{{ scope.row.到货金额.toFixed(2) }}
</template>
</el-table-column>
</el-table>