20200415文档V4

This commit is contained in:
liulujia1
2020-04-15 18:05:31 +08:00
parent 7d98b7edd0
commit efb66d18c9
2 changed files with 178 additions and 22 deletions

View File

@@ -133,7 +133,20 @@ export function submitTable(...param) {
ModularID: router.currentRoute.path,
type: '2',
name: '车间生产管理_质检管理_不合格处理',
param: `零部件流水号=${param[0]}&质检类型代码=${param[1]}&数量=${param[2]}&是否合格=${param[3]}&人员编号=${param[4]}&不合格数量=${param[5]}&不合格原因=${param[6]}&不合格处理=${param[7]}&备注=${param[8]}&操作工=${param[9]}`
param: `零部件流水号=${param[0]}&质检类型代码=${param[1]}&数量=${param[2]}&是否合格=${param[3]}&人员编号=${param[4]}&不合格数量=${param[5]}&不合格原因=${param[6]}&不合格处理=${param[7]}&备注=${param[8]}&操作工=${param[9]}&编辑人员编号=${param[10]}`
}
})
}
export function confirmEdit(...param) {
return request({
url: '',
method: 'post',
data: {
UserID: state.state.user.id,
ModularID: router.currentRoute.path,
type: '2',
name: '车间生产管理_质检管理_编辑处理',
param: `质检流水号=${param[0]}&质检类型代码=${param[1]}&零部件流水号=${param[2]}&是否合格=${param[3]}&数量=${param[4]}&不合格数量=${param[5]}&不合格原因=${param[6]}&不合格处理=${param[7]}&备注=${param[8]}&编辑人员编号=${param[9]}`
}
})
}

View File

@@ -74,12 +74,12 @@
<el-tag v-if="parseInt(scope.row.是否禁用)===1" type="error" size="small">已禁用</el-tag>
</template>
</el-table-column>
<el-table-column label="机床图号" align="center" width="110px">
<el-table-column label="机床图号" align="center" width="90px">
<template slot-scope="scope">
{{ scope.row.机床图号 }}
</template>
</el-table-column>
<el-table-column label="机床名称" align="center" min-width="200px">
<el-table-column label="机床名称" align="center" min-width="180px" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.机床名称 }}
</template>
@@ -124,24 +124,81 @@
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column label="质检数量" align="center">
<el-table-column label="质检数量" align="center" width="120px">
<template slot-scope="scope">
{{ scope.row.数量 }}
<template v-if="scope.row.edit">
<el-input-number v-model="scope.row.数量" :min="0" :step="1" style="width: 90%" size="mini"/>
</template>
<template v-else>
{{ scope.row.数量 }}
</template>
</template>
</el-table-column>
<el-table-column label="合格" align="center" width="90px">
<el-table-column label="是否合格" align="center" width="120px">
<template slot-scope="scope">
{{ scope.row.不合格数量 }}
<template v-if="scope.row.edit">
<el-select v-model="scope.row.是否合格" placeholder="请选择" filterable size="small" style="width: 100%">
<el-option
v-for="item in qualityInspection"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</template>
<template v-else>
{{ scope.row.是否合格 ===1 ? '合格' : '不合格' }}
</template>
</template>
</el-table-column>
<el-table-column label="不合格原因" align="center" width="90px">
<el-table-column label="不合格" align="center" width="120px">
<template slot-scope="scope">
{{ scope.row.不合格原因文本 }}
<template v-if="scope.row.edit && scope.row.是否合格 === 2">
<el-input-number v-model="scope.row.不合格数量" :min="0" :step="1" style="width: 90%" size="mini"/>
</template>
<template v-else-if="scope.row.是否合格 === 1">
{{ scope.row.不合格数量 =0 }}
</template>
<template v-else>
{{ scope.row.不合格数量 }}
</template>
</template>
</el-table-column>
<el-table-column label="处理结果" align="center">
<el-table-column label="不合格原因" align="center" width="140px">
<template slot-scope="scope">
{{ scope.row.不合格处理文本 }}
<template v-if="scope.row.edit && scope.row.是否合格 === 2">
<el-select v-model="scope.row.不合格原因" placeholder="请选择" filterable size="small" style="width: 100%">
<el-option
v-for="item in reasonsForNonconformity"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</template>
<template v-else-if="scope.row.是否合格 === 1">
{{ scope.row.不合格原因 = null }}
</template>
<template v-else>
{{ scope.row.不合格原因文本 }}
</template>
</template>
</el-table-column>
<el-table-column label="处理结果" align="center" width="140px" show-overflow-tooltip>
<template slot-scope="scope">
<template v-if="scope.row.edit && scope.row.是否合格 === 2">
<el-select v-model="scope.row.处理结果" placeholder="请选择" filterable size="small" style="width: 100%">
<el-option
v-for="item in disqualificationTreatment"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</template>
<template v-else-if="scope.row.是否合格 === 1">
{{ scope.row.处理结果 = null }}
</template>
<template v-else>
{{ scope.row.不合格处理文本 }}
</template>
</template>
</el-table-column>
<el-table-column label="质检时间" align="center" width="100px">
@@ -149,9 +206,24 @@
{{ scope.row.操作时间 ? scope.row.操作时间.split(' ')[0] : '' }}
</template>
</el-table-column>
<el-table-column label="备注" align="center">
<el-table-column label="备注" align="center" width="140px" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.备注 }}
<template v-if="scope.row.edit">
<el-input v-model="scope.row.备注" size="mini" style="width: 100%"/>
</template>
<template v-else>
{{ scope.row.备注 }}
</template>
</template>
</el-table-column>
<el-table-column label="编辑人" align="center" width="90px" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.编辑人 }}
</template>
</el-table-column>
<el-table-column label="编辑时间" align="center" width="90px" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.编辑时间 ? scope.row.编辑时间.split(' ')[0] : scope.row.编辑时间 }}
</template>
</el-table-column>
<el-table-column label="形位" fixed="right" align="center" width="70">
@@ -229,14 +301,27 @@
</el-popover>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" min-width="90">
<el-table-column label="操作" fixed="right" align="center" min-width="150">
<template slot-scope="scope">
<el-button
v-if="!scope.row.edit"
size="mini"
type="text"
plain
icon="el-icon-search"
@click="viewPicture(scope.row)">查看图片</el-button>
<el-tooltip :open-delay="1200" effect="dark" content="编辑" placement="top">
<div style="display: inline-block;margin-right: 10px">
<el-button v-if="!scope.row.edit" type="text" size="mini" icon="el-icon-edit" @click="scope.row.edit=!scope.row.edit"/>
<el-button v-if="scope.row.edit" type="text" plain size="small" @click="confirmEdit(scope.row)">确定</el-button>
<el-button v-if="scope.row.edit" type="text" plain size="small" @click="cancel(scope.row)">取消</el-button>
</div>
</el-tooltip>
<el-tooltip :open-delay="1200" effect="dark" content="删除" placement="top">
<div style="display: inline-block">
<el-button v-if="!scope.row.edit" type="text" size="mini" icon="el-icon-delete" @click="deleterow(scope.row)"/>
</div>
</el-tooltip>
</template>
</el-table-column>
</el-table>
@@ -456,7 +541,7 @@
<img v-for="url in urls" :key="url" :src="url" lazy style="width: 700px;height: 700px">
</viewer>
</el-dialog>
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible10" title="新增质检数据" center style="min-height: 300px" width="700px">
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible10" :title="dialogmethod ? '编辑质检数据' : '新增质检数据'" center style="min-height: 300px" width="700px">
<el-form ref="form2" :model="form2" :rules="rules2" label-position="right" label-width="120px">
<el-row>
<el-col :span="12">
@@ -472,7 +557,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="机床图号" prop="机床图号">
<el-select v-model="form2.机床图号" filterable placeholder="选择机床图号" size="small" style="width: 150px" clearable @change="machineChange1()">
<el-select v-model="form2.机床图号" :disabled="dialogmethod" filterable placeholder="选择机床图号" size="small" style="width: 150px" clearable @change="machineChange1()">
<el-option
v-for="item in machineNumber"
:key="item.value"
@@ -488,7 +573,7 @@
<el-row>
<el-col :span="12">
<el-form-item label="组号" prop="组号">
<el-select v-model="form2.组号" filterable placeholder="选择组号" size="small" style="width:150px" clearable @change="groupChange()">
<el-select v-model="form2.组号" :disabled="dialogmethod" filterable placeholder="选择组号" size="small" style="width:150px" clearable @change="groupChange()">
<el-option
v-for="item in groupNumber1"
:key="item.value"
@@ -499,7 +584,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="零件图号" prop="零件图号">
<el-select v-model="form2.零件图号" filterable placeholder="选择零件图号" style="width:150px" size="small" clearable @change="partChange">
<el-select v-model="form2.零件图号" :disabled="dialogmethod" filterable placeholder="选择零件图号" style="width:150px" size="small" clearable @change="partChange">
<el-option
v-for="item in partNum"
:key="item.value"
@@ -512,7 +597,7 @@
<el-row>
<el-col :span="12">
<el-form-item label="工序" prop="工序">
<el-select v-model="form2.工序" filterable placeholder="选择工序" style="width:150px" size="small" clearable @change="procedureChange">
<el-select v-model="form2.工序" :disabled="dialogmethod" filterable placeholder="选择工序" style="width:150px" size="small" clearable @change="procedureChange">
<el-option
v-for="item in procedureNum"
:key="item.value"
@@ -596,7 +681,7 @@
</template>
<script>
import { initProject, searchgroup, selecttable, QualityType, searchPic, searchTableDetail, searchData, searchData1, processingStatus, initPerson, Prohibit, initDisqualificationTreatment, initReasonsForNonconformity, searchparts, searchprocedure, searchoperators, submitTable } from '@/api/Assembly/QualityInspectionInformationInquiry'
import { initProject, searchgroup, selecttable, QualityType, searchPic, searchTableDetail, searchData, searchData1, processingStatus, initPerson, Prohibit, initDisqualificationTreatment, initReasonsForNonconformity, searchparts, searchprocedure, searchoperators, submitTable, confirmEdit } from '@/api/Assembly/QualityInspectionInformationInquiry'
import { readFile } from '@/utils/request'
import { mapGetters } from 'vuex'
// import { mapGetters } from 'vuex'
@@ -662,10 +747,12 @@ export default {
dialogFormVisible: false,
dialogFormVisible4: false,
dialogFormVisible10: false,
AddTableData_disable: false,
loading: false,
total: 0, // 总条数
pageSize: 20, // 每页显示条数
pageCurrent: 1 // 后台获取页
pageCurrent: 1, // 后台获取页
dialogmethod: false // false新增 true 编辑
// total1: 0, // 总条数
// pageSize1: 10, // 每页显示条数
// pageCurrent1: 1, // 后台获取页
@@ -691,6 +778,36 @@ export default {
this.fetchData1()
},
methods: {
// 表内编辑取消
cancel(row) {
row.edit = !row.edit
console.log(row, 8888)
row.备注 = row.备注_原
row.不合格数量 = row.不合格数量_原
row.是否合格 = row.是否合格_原
row.数量 = row.数量_原
row.不合格原因文本 = row.不合格原因文本_原
row.不合格处理文本 = row.不合格处理文本_原
},
// 表内编辑确定
confirmEdit(row) {
console.log(row, 676767)
confirmEdit(row.质检流水号, row.质检类型代码, row.零部件流水号, row.是否合格, row.数量, row.不合格数量, row.不合格原因, row.处理结果, row.备注, this.$store.state.user.id).then(response => {
if (response.data[0].result === '1') {
this.dialogFormVisible10 = false
this.$message.success('编辑成功')
this.selecttable()
} else {
this.$message.error('编辑失败')
}
})
this.selecttable()
row.edit = false
},
deleterow(row) {
// this.plan = row.计划流水号
},
initProject() {
initProject().then(response => {
for (let i = 0; i < response.data.length; i++) {
@@ -758,6 +875,21 @@ export default {
})
})
},
// 删除
handleEdit(row) {
if (this.$refs['form2'] !== undefined) {
this.$refs['form2'].resetFields()
}
console.log(row, 8989)
this.partNum = []
this.groupNumber = []
this.procedureNum = []
this.operators = []
this.AddTableData_disable = false
this.dialogmethod = true // 编辑置为true
this.dialogFormVisible10 = true
},
// 新增
AddTableData() {
if (this.$refs['form2'] !== undefined) {
this.$refs['form2'].resetFields()
@@ -767,6 +899,7 @@ export default {
this.procedureNum = []
this.operators = []
this.AddTableData_disable = false
this.dialogmethod = false // 新增置为false
this.dialogFormVisible10 = true
},
formatJson(filterVal, jsonData) {
@@ -903,7 +1036,7 @@ export default {
this.$refs['form2'].validate((valid) => {
if (valid) {
this.AddTableData_disable = true
submitTable(this.form2.工序, this.form2.质检类型, this.form2.检测数, this.form2.质检情况, this.id, this.form2.不合格数量, this.form2.不合格原因, this.form2.不合格处理, this.form2.备注, this.form2.操作工).then(response => {
submitTable(this.form2.工序, this.form2.质检类型, this.form2.检测数, this.form2.质检情况, this.id, this.form2.不合格数量, this.form2.不合格原因, this.form2.不合格处理, this.form2.备注, this.form2.操作工, this.$store.state.user.id).then(response => {
if (response.data[0].result === '1') {
this.dialogFormVisible10 = false
this.$message.success('新增成功')
@@ -936,6 +1069,16 @@ export default {
if (this.personNum !== '' && this.personNum !== null) { this.check8 = 1 } else { this.check8 = 0 }
selecttable(this.check1, this.machineNumberValue, this.check2, this.groupNumberValue, this.check3, this.SpareParts, this.check4, this.QualityTypeValue, this.check5, this.startTime, this.check6, this.endTime, this.check7, this.qualityInspectionValue, this.check8, this.personNum, this.pageCurrent, this.pageSize).then(response => {
this.tableData1 = response.data.result
this.tableData1.map(v => {
this.$set(v, 'edit', false)
this.$set(v, '备注_原', v.备注)
this.$set(v, '不合格数量_原', v.不合格数量)
this.$set(v, '是否合格_原', v.是否合格)
this.$set(v, '数量_原', v.数量)
this.$set(v, '不合格原因文本_原', v.不合格原因文本)
this.$set(v, '不合格处理文本_原', v.不合格处理文本)
})
console.log(this.tableData1, 8979)
this.loading = false
this.total = parseInt(response.data.output[0].ItemCount)
})