This commit is contained in:
chenjianan
2019-03-13 18:56:51 +08:00
4 changed files with 47 additions and 20 deletions

View File

@@ -144,3 +144,14 @@ export function getTable8(code) {
} }
}) })
} }
export function isMachining(code) {
return request({
url: '',
method: 'post',
data: {
type: 2,
name: '车间生产管理工艺_零件撤出待加工库',
param: '工艺计划流水号=' + code + '&结果=11111=string=output'
}
})
}

View File

@@ -831,7 +831,6 @@ export default {
if (this.result === this.multipleSelection.length) { if (this.result === this.multipleSelection.length) {
this.$message.success('投产成功') this.$message.success('投产成功')
this.total = 0 this.total = 0
this.pageSize = 10
this.pageList = 1 this.pageList = 1
this.getTable() this.getTable()
this.checked_baitu = false this.checked_baitu = false

View File

@@ -343,12 +343,12 @@ export default {
if (this.multipleSelection[i].人员编号 === '') { if (this.multipleSelection[i].人员编号 === '') {
this.$message.error('请选择工艺员') this.$message.error('请选择工艺员')
} else { } else {
this.result = 0
save(this.multipleSelection[i].工艺计划流水号, this.multipleSelection[i].人员编号, this.multipleSelection[i].零件号).then(response => { save(this.multipleSelection[i].工艺计划流水号, this.multipleSelection[i].人员编号, this.multipleSelection[i].零件号).then(response => {
this.result += parseInt(response.data[0].result) this.result += parseInt(response.data[0].result)
if (this.result === this.multipleSelection.length) { if (this.result === this.multipleSelection.length) {
this.$message.success('保存成功') this.$message.success('保存成功')
this.PageCurrent = 1 this.PageCurrent = 1
this.PageSize = 10
this.getTable() this.getTable()
} else if (i === this.multipleSelection.length - 1 && this.result !== this.multipleSelection.length) { } else if (i === this.multipleSelection.length - 1 && this.result !== this.multipleSelection.length) {
this.$message.error('存在保存失败项') this.$message.error('存在保存失败项')

View File

@@ -367,11 +367,13 @@
</div> </div>
</template> </template>
<script> <script>
import { handlechange3, getTable8, getTree, fn, dialogtablevisible, getNames, getMachines, getGroups, getTable, getTable2, handlechange, handlechange2 } from '@/api/ManufacturingCenter/ProcessingStatusEdit' import { isMachining, handlechange3, getTable8, getTree, fn, dialogtablevisible, getNames, getMachines, getGroups, getTable, getTable2, handlechange, handlechange2 } from '@/api/ManufacturingCenter/ProcessingStatusEdit'
export default { export default {
data() { data() {
return { return {
Num2: '',
gongyijihualiushuihao: [[]],
midd: 0, midd: 0,
ssks: '', ssks: '',
cjscgy: '', cjscgy: '',
@@ -562,6 +564,7 @@ export default {
this.result = [] this.result = []
this.kaoqinbianhao = [[]] this.kaoqinbianhao = [[]]
this.gongxuliushuihao = [[]] this.gongxuliushuihao = [[]]
this.gongyijihualiushuihao = [[]]
this.process = [[]] this.process = [[]]
this.planDate = [[]] this.planDate = [[]]
this.worker = [[]] this.worker = [[]]
@@ -579,6 +582,7 @@ export default {
this.投产数量.push(response.data.rows[i].投产数量) this.投产数量.push(response.data.rows[i].投产数量)
this.kaoqinbianhao[i] = [] this.kaoqinbianhao[i] = []
this.gongxuliushuihao[i] = [] this.gongxuliushuihao[i] = []
this.gongyijihualiushuihao[i] = []
this.process[i] = [] this.process[i] = []
this.planDate[i] = [] this.planDate[i] = []
this.worker[i] = [] this.worker[i] = []
@@ -594,6 +598,7 @@ export default {
if (response.data[k].工艺计划流水号 === this.liushuihao) { if (response.data[k].工艺计划流水号 === this.liushuihao) {
this.kaoqinbianhao[i][k] = response.data[k].工作者考勤编号 this.kaoqinbianhao[i][k] = response.data[k].工作者考勤编号
this.gongxuliushuihao[i][k] = response.data[k].工序流水号 this.gongxuliushuihao[i][k] = response.data[k].工序流水号
this.gongyijihualiushuihao[i][k] = response.data[k].工艺计划流水号
this.process[i][k] = response.data[k].工艺名称简称 this.process[i][k] = response.data[k].工艺名称简称
this.planDate[i][k] = response.data[k].计划日期_短 this.planDate[i][k] = response.data[k].计划日期_短
this.worker[i][k] = response.data[k].员工姓名 this.worker[i][k] = response.data[k].员工姓名
@@ -642,12 +647,17 @@ export default {
} }
this.title = this.process[index][a] this.title = this.process[index][a]
this.Num = this.gongxuliushuihao[index][a] this.Num = this.gongxuliushuihao[index][a]
this.Num2 = this.gongyijihualiushuihao[index][a]
this.dialogFormVisible = true this.dialogFormVisible = true
} }
}, },
// 编辑确定 // 编辑确定
handleChange() { handleChange() {
if (this.midd === 0) { if (this.midd === 0) {
isMachining(this.Num2).then(res => {
if (res.data.output[0].结果 === '0') {
this.$message.error('该零件正在加工,不能手动完成')
} else {
handlechange2(this.Num, this.form.考勤编号).then(response => { handlechange2(this.Num, this.form.考勤编号).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
handlechange(this.Num, this.form.完成时间).then(response => { handlechange(this.Num, this.form.完成时间).then(response => {
@@ -663,13 +673,18 @@ export default {
this.$message.error('信息编辑失败') this.$message.error('信息编辑失败')
} }
}) })
}
})
} else {
isMachining(this.Num2).then(res => {
if (res.data.output[0].结果 === '0') {
this.$message.error('该零件正在加工,不能手动完成')
} else { } else {
handlechange3(this.Num, this.form.考勤编号).then(response => { handlechange3(this.Num, this.form.考勤编号).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
handlechange(this.Num, this.form.完成时间).then(response => { handlechange(this.Num, this.form.完成时间).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.$message.success('信息编辑成功') this.$message.success('信息编辑成功')
this.getTableData()
} else { } else {
this.$message.error('信息编辑失败') this.$message.error('信息编辑失败')
} }
@@ -681,6 +696,8 @@ export default {
} }
}) })
} }
})
}
this.dialogFormVisible = false this.dialogFormVisible = false
}, },
// 提交添加或者修改 // 提交添加或者修改