This commit is contained in:
liushuai
2020-01-03 12:19:10 +08:00
parent cbe64d102b
commit 293aef4215
7 changed files with 160 additions and 17 deletions

View File

@@ -35,7 +35,7 @@ export function initProcessNumber() {
}
})
}
// 获取组号
// 加序
export function addProcess(NUM, NUM1, NUM2, NUM3) {
return request({
url: '',
@@ -47,6 +47,18 @@ export function addProcess(NUM, NUM1, NUM2, NUM3) {
}
})
}
// 删除加序
export function deleteProcess(NUM) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间管理_自制件插序_删除数据',
param: 'ID=' + NUM
}
})
}
export function getTable(checkbox_Machine, Machine, checkbox_Group, Group, checkbox_number, number, k, m, pageCurrent, pageSize) {
return request({
url: '',

View File

@@ -134,6 +134,18 @@ export function editList(num, a, b, c) {
}
})
}
// 编辑
export function EditNumber(num, num1) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '车间生产管理工艺_生产计划下达_修改投产数量',
param: '组件零件基本件流水号=' + num + '=int&数量=' + num1
}
})
}
// 打回档案
export function dele(num, a, b) {
return request({

View File

@@ -1,7 +1,6 @@
<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"
@@ -22,6 +21,7 @@
<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-button type="danger" class="el-icon-delete" size="small" style="margin: 0px 10px;" @click="deleteProcess()">删除加序</el-button>
</el-card>
<el-row>
<el-col style="width: 550px">
@@ -35,7 +35,8 @@
highlight-current-row
empty-text=" "
border
@current-change="getRow">
@current-change="getRow"
@row-click="getID">
<el-table-column align="center" label="序号" width="70">
<template slot-scope="scope">
{{ scope.row.工序顺序 }}
@@ -78,7 +79,7 @@
<el-card>
<el-table
:data="tableData"
:row-class-name="tableRowClassName"
:row-class-name="tableRowClassName1"
loading="loading"
class="table"
highlight-current-row
@@ -247,7 +248,7 @@
</template>
<script>
import { getMachines, getGroups, getTable, gettabledata1, getTree, fn, getTable8, submitEdit, initProcessNumber, addProcess } from '@/api/ManufacturingCenter/AddingOrder'
import { getMachines, getGroups, getTable, gettabledata1, getTree, fn, getTable8, submitEdit, initProcessNumber, addProcess, deleteProcess } from '@/api/ManufacturingCenter/AddingOrder'
import Cookie from 'js-cookie'
export default {
@@ -267,6 +268,7 @@ export default {
pageCurrent: 1,
pageSize: 100,
total: 0,
Id: '',
ProcessNumber: [], // 工艺
tableData1: [], // 工序表
radio: '',
@@ -318,6 +320,47 @@ export default {
addTableData() {
this.dialogFormVisible2 = true
},
deleteProcess() {
this.$confirm('确定删除该合同?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
if (this.Id !== 0) {
deleteProcess(this.Id).then(response => {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.tableData1 = []
gettabledata1(this.process).then(response => {
if (response.data.length !== 0) {
for (let i = 0; i < response.data.length; i++) {
this.tableData1.push({
ID: response.data[i].ID,
工序顺序: 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].工序流水号
})
}
}
})
} else { this.$message.error('删除失败') }
})
} else {
this.$message.error('只能删除加序')
}
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
getMachine() {
if (Cookie.get('machineValue') !== undefined) {
this.Machine = ''
@@ -400,6 +443,7 @@ export default {
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].零件图号,
@@ -415,7 +459,11 @@ export default {
this.total = response.data.total
this.loading = false
})
}, // 获取工序表
},
getID(row) {
this.Id = row.ID
},
// 获取工序表
getCurrentRow(row) {
this.completeTime = ''
this.dateOfProduction = ''
@@ -428,6 +476,7 @@ export default {
if (response.data.length !== 0) {
for (let i = 0; i < response.data.length; i++) {
this.tableData1.push({
ID: response.data[i].ID,
工序顺序: response.data[i].工序顺序,
工艺名称: response.data[i].工艺名称,
序间质检: response.data[i].质检结果,
@@ -450,6 +499,7 @@ export default {
this.form.完成时间 = ''
},
getRow(row) {
this.Id = row.ID
this.completeTime = row.完成日期
this.dateOfProduction = row.排产日期
this.processSerialNumber = row.工序流水号
@@ -510,6 +560,25 @@ export default {
if (response.data[0].result === '1') {
this.$message.success('加序成功')
this.dialogFormVisible2 = false
this.tableData1 = []
gettabledata1(this.process).then(response => {
if (response.data.length !== 0) {
for (let i = 0; i < response.data.length; i++) {
this.tableData1.push({
ID: response.data[i].ID,
工序顺序: 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].工序流水号
})
}
}
})
} else {
this.$message.error('加序失败')
}
@@ -526,6 +595,13 @@ export default {
this.dialogFormVisible = false
this.getCurrentRow(this.row2)
},
// 考核状态变色
tableRowClassName1({ row, rowIndex }) {
row.index = rowIndex
if (parseInt(row.考核状态) > 6) {
return 'CompleteColor'
}
},
// 完成日期变色
tableRowClassName({ row, rowIndex }) {
row.index = rowIndex

View File

@@ -150,6 +150,11 @@
type="primary"
plain
@click="handleEdit(scope.$index, scope.row, 'form')">分批投产</el-button>
<el-button
size="mini"
type="primary"
plain
@click="handleEditNumber(scope.$index, scope.row)">更改数量</el-button>
</template>
</el-table-column>
</el-table>
@@ -255,7 +260,7 @@
</div>
</el-card>
<el-dialog :visible.sync="dialogFormVisible2" title="打回档案" center width="28%">
<el-dialog :visible.sync="dialogFormVisible2" title="打回档案" center width="200px">
<el-form ref="form1" :model="form1" :rules="rules" label-position="left" label-width="110px" class="demo-ruleForm">
<el-form-item label="打回原因" prop="reason">
<el-input v-model="form1.reason" size="small" />
@@ -267,6 +272,18 @@
</div>
</el-dialog>
<el-dialog :visible.sync="dialogFormVisible3" title="更改投产数量" center width="300px">
<el-form ref="form3" :model="form3" :rules="rules3" label-position="left" label-width="110px" class="demo-ruleForm">
<el-form-item label="投产数量" prop="投产数量">
<el-input v-model="form3.投产数量" size="small" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="callOff2('form3')">取消</el-button>
<el-button size="small" type="primary" @click="EditNumber('form3')"> </el-button>
</div>
</el-dialog>
<el-dialog :title="title" :visible.sync="dialogFormVisible1" center width="450px">
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="110px" class="demo-ruleForm">
<el-form-item label="零件图号" prop="PDnumber">
@@ -321,7 +338,7 @@
</template>
<script>
import { getEntryNameValue, getToolNum, getNum, getTable, production, getTable1, revisionBatch, editList, dele, production2, production20, production10, edit } from '@/api/ManufacturingCenter/InitialProduction'
import { getEntryNameValue, getToolNum, getNum, getTable, production, getTable1, revisionBatch, editList, dele, production2, production20, production10, edit, EditNumber } from '@/api/ManufacturingCenter/InitialProduction'
import { mapGetters } from 'vuex'
import Cookie from 'js-cookie'
@@ -374,16 +391,24 @@ export default {
form1: {
reason: ''
},
form3: {
投产数量: ''
},
rules: { // 表单验证规则
batchQuantity: [{ required: true, message: '请输入批次数量', trigger: 'blur' }],
// startDate_F: [{ required: true, message: '请选择加工开始时间', trigger: 'change' }],
endDate_F: [{ required: true, message: '请选择加工结束时间', trigger: 'change' }],
reason: [{ required: true, message: '请输入打回原因', trigger: 'blur' }]
},
rules3: { // 表单验证规则
投产数量: [{ required: true, message: '请输入投产数量', trigger: 'blur' }]
},
// value1: '',
result: 0,
dialogFormVisible1: false,
dialogFormVisible2: false,
dialogFormVisible3: false,
NumberValue: '',
date: '',
a: false,
multipleSelection: [],
@@ -608,6 +633,23 @@ export default {
this.multipleSelection = val
console.log(this.multipleSelection, 1111)
},
handleEditNumber(index, row) {
this.dialogFormVisible3 = true
console.log(row, 123)
this.NumberValue = row.组件零件基本件流水号
this.form3.投产数量 = row.投产总数量
},
EditNumber() {
EditNumber(this.NumberValue, this.form3.投产数量).then(response => {
if (response.data[0].result === '1') {
this.getTable()
this.dialogFormVisible3 = false
this.$message.success('更改成功')
} else {
this.$message.error('更改失败')
}
})
},
// 打开分批投产
handleEdit(index, row, formName) {
this.temp = 1
@@ -1140,6 +1182,10 @@ export default {
this.dialogFormVisible2 = false
this.$refs[formName].resetFields()
},
callOff2(formName) {
this.dialogFormVisible3 = false
this.$refs[formName].resetFields()
},
// 分页
handleSizeChange(val) {
this.pageSize = val

View File

@@ -3390,7 +3390,7 @@ export default {
method: 'post',
data: {
type: '3',
name: `exec 项目计划管理_项目详细计划_查询数据 @机床流水号=${this.machineValue1}, @计划类型=4`
name: `exec 项目计划管理_项目详细计划_查询数据1 @机床流水号=${this.machineValue1}, @计划类型=4`
}
}).then(res => {
this.tableDataDiv10 = res.data

View File

@@ -759,6 +759,7 @@ export default {
if (response.data[0].result === '1') {
this.$message.success('添加成功')
this.dialogFormVisible3 = false
this.getGonghuoshang()
} else {
this.dialogFormVisible3 = false
this.$message.error('添加失败')

View File

@@ -179,8 +179,6 @@ export default {
componentNum,
groupNum,
contractNum,
pageNum,
totalNum,
drawingNum,
name,
type,
@@ -206,12 +204,10 @@ export default {
this.worksheet[j].I1 ? proofread = this.worksheet[j].I1.v : proofread = ''
this.worksheet[j].L1 ? review = this.worksheet[j].L1.v : review = ''
this.worksheet[j].P1 ? date = this.worksheet[j].P1.v : date = ''
this.worksheet[j].Q1 ? pageNum = parseInt(this.worksheet[j].Q1.v.replace(/[^0-9]/ig, '')) : pageNum = ''
this.worksheet[j].C2 ? machineName = this.worksheet[j].C2.v : machineName = ''
this.worksheet[j].F2 ? machineNum = this.worksheet[j].F2.v : machineNum = ''
this.worksheet[j].J2 ? componentName = this.worksheet[j].J2.v : componentName = ''
this.worksheet[j].P2 ? componentNum = this.worksheet[j].P2.v : componentNum = ''
this.worksheet[j].Q2 ? totalNum = parseInt(this.worksheet[j].Q2.v.replace(/[^0-9]/ig, '')) : totalNum = ''
this.worksheet[j].R2 ? contractNum = this.worksheet[j].R2.v : contractNum = ''
this.worksheet[j].M2 ? groupNum = this.worksheet[j].M2.v : groupNum = ''
for (let i = 0; i < 999; i++) {
@@ -230,7 +226,7 @@ export default {
} else {
if (machineNum && groupNum) {
await sleep(50)
await this.insertToSQL(establishment, proofread, review, date, machineName, machineNum, componentName, componentNum, groupNum, contractNum, pageNum, totalNum, drawingNum, name, type, material, spareNum, useNum, manufacturer, remarks, classificationCode)
await this.insertToSQL(establishment, proofread, review, date, machineName, machineNum, componentName, componentNum, groupNum, contractNum, drawingNum, name, type, material, spareNum, useNum, manufacturer, remarks, classificationCode)
} else {
this.loading = false
this.disabled = false
@@ -257,10 +253,10 @@ export default {
console.log(`导入数据错误${e}`)
}
},
async insertToSQL(establishment, proofread, review, date, machineName, machineNum, componentName, componentNum, groupNum, contractNum, pageNum, totalNum, drawingNum, name, type, material, spareNum, useNum, manufacturer, remarks, classificationCode) {
async insertToSQL(establishment, proofread, review, date, machineName, machineNum, componentName, componentNum, groupNum, contractNum, drawingNum, name, type, material, spareNum, useNum, manufacturer, remarks, classificationCode) {
try {
if (groupNum.indexOf('MX') > -1) {
const response = await importBasics(establishment, proofread, review, date, this.projectName, machineNum, machineName, componentName, componentNum, this.group, contractNum, totalNum, pageNum, drawingNum, name, type, material, spareNum, useNum, manufacturer, remarks, classificationCode)
const response = await importBasics(establishment, proofread, review, date, this.projectName, machineNum, machineName, componentName, componentNum, this.group, contractNum, drawingNum, name, type, material, spareNum, useNum, manufacturer, remarks, classificationCode)
const res = response.data
console.log(res)
if (res.hasOwnProperty('output') === false) {
@@ -276,7 +272,7 @@ export default {
}
}
} else {
const response = await importPurcharse(establishment, proofread, review, date, this.projectName, machineNum, machineName, componentName, componentNum, this.group, contractNum, totalNum, pageNum, drawingNum, name, type, material, spareNum, useNum, manufacturer, remarks, classificationCode)
const response = await importPurcharse(establishment, proofread, review, date, this.projectName, machineNum, machineName, componentName, componentNum, this.group, contractNum, drawingNum, name, type, material, spareNum, useNum, manufacturer, remarks, classificationCode)
const res = response.data
if (res.hasOwnProperty('output') === false) {
if (res[0].result === '0') {