已编制

This commit is contained in:
chenjianan
2019-05-30 18:30:45 +08:00
parent dae8666569
commit d3135dfd11
2 changed files with 88 additions and 47 deletions

View File

@@ -1,6 +1,10 @@
<template>
<div class="app-container">
<el-card>
<el-radio-group v-model="radio" size="small" style="margin: 10px;" @change="checked = false;partNum=[];partNumValue = '';typeValue = '';partName = '';material = '';materialName = '';prepareMateriel = '';spec = '';batchNum = '';searchPartsByMachineGroup();">
<el-radio v-model="radio" :label="1">未编制</el-radio>
<el-radio v-model="radio" :label="2">已编制</el-radio>
</el-radio-group>
<span>工艺员:</span>
<el-select v-model="CraftmenValue" placeholder="工艺员" size="small" style="width:100px" @change="clearDetail();">
<el-option
@@ -29,10 +33,8 @@
</el-option>
</el-select>
<el-checkbox v-model="checked" :disabled="isShow2" size="small" style="margin:10px">是否核准</el-checkbox>
<el-button v-show="isShow2" type="danger" icon="el-icon-edit" size="small" @click="returnEdit">在制零件工艺调整
</el-button>
<el-button v-show="false" plain size="small" style="margin: 10px;float:right" @click="switchEdit()">切换编辑模式
</el-button>
<!--<el-button v-show="isShow2" type="danger" icon="el-icon-edit" size="small" @click="returnEdit">在制零件工艺调整</el-button>-->
<!--<el-button v-show="false" plain size="small" style="margin: 10px;float:right" @click="switchEdit()">切换编辑模式</el-button>-->
<div v-show="isShow">
<span>种类:</span>
<el-input v-model="typeValue" placeholder="种类" size="small" readonly style="width:100px"/>
@@ -168,6 +170,7 @@
<el-button :disabled="disabled" type="primary" size="small" icon="el-icon-tickets" @click="saveApprove">保存
</el-button>
</el-button-group>
<el-button v-if="!isShow1" type="warning" size="small" icon="el-icon-tickets" @click="saveCompiled">记录修改备注</el-button>
</el-row>
<div style="margin-top: 5px;margin-bottom: 10px;display: inline-block"><span>符号</span>
<el-tag type="info"></el-tag>
@@ -211,21 +214,10 @@
@change="handleChange(scope.row)"/>
</template>
</el-table-column>
<el-table-column v-if="false" prop="name" label="工艺名称" width="130" align="center">
<template slot-scope="scope">
<el-input
v-model="scope.row.工艺名称"
:disabled="disabled"
readonly
style="width:100%"
@dblclick.native="tableSearch(scope.$index)"/>
</template>
</el-table-column>
<el-table-column prop="hard" label="难度等级" width="110" align="center">
<template slot-scope="scope">
<el-select
v-model="scope.row.工艺难度等级"
:disabled="disabled"
clearable
placeholder=""
@change="hardEdit(scope.row)">
@@ -235,17 +227,6 @@
</el-select>
</template>
</el-table-column>
<el-table-column v-if="false" prop="request" label="工艺要求" align="center" min-width="350">
<template slot-scope="scope">
<el-input
v-model="scope.row.工艺要求"
:rows="1"
:disabled="disabled"
type="textarea"
@dblclick.native="tableSearch(scope.$index)"
@change="requestEdit(scope.row)"/>
</template>
</el-table-column>
<el-table-column prop="request" label="工艺要求" align="center" min-width="350">
<template slot-scope="scope">
<el-autocomplete
@@ -272,22 +253,18 @@
<template slot-scope="scope">
<div>
<el-button
:disabled="disabled"
icon="el-icon-arrow-up"
type="primary"
@click="upOne(scope.row)"/>
<el-button
:disabled="disabled"
icon="el-icon-arrow-down"
type="primary"
@click="downOne(scope.row)"/>
<el-button
:disabled="disabled"
icon="el-icon-circle-plus-outline"
type="primary"
@click="insertOne(scope.row)"/>
<el-button
:disabled="disabled"
icon="el-icon-delete"
type="danger"
@click="deleteOne(scope.row)"/>
@@ -552,7 +529,9 @@ import {
readyChange,
TableAddLi1,
TableAddLi,
getPartnames3
getPartnames3,
getPartnames4,
modifyRemark
} from '@/api/ManufacturingCenter/ProcessQuotaEstablishment'
import elInput from 'element-ui/packages/input'
import { mapGetters } from 'vuex'
@@ -720,13 +699,33 @@ export default {
'id'
])
},
created() {
mounted() {
this.fetchData()
this.initPerson()
this.getList()
this.openCascader()
},
methods: {
// 保存已编制
saveCompiled() {
if (this.partNumValue) {
this.$prompt('请输入工艺修改备注', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消'
}).then(({ value }) => {
console.log(value, '日期', this.id, this.partNumValue)
modifyRemark(this.id, value, this.partNumValue)
this.$message.success('记录成功')
}).catch(() => {
this.$message({
type: 'info',
message: '取消操作'
})
})
} else {
this.$message.warning('请选择零件')
}
},
blurRequest(row) {
selectRequest(row.工序流水号, row.工艺计划流水号, row.工艺编号, row.工序顺序, row.工艺要求).then(response => {
if (response.data[0].result === '1') {
@@ -1087,20 +1086,38 @@ export default {
searchPartsByMachineGroup() {
this.tableData = []
this.partNum = []
this.disabled = false
this.isShow1 = true
this.isShow2 = false
this.checked1 = true
getPartnames3(this.CraftmenValue, this.machine_Group_part).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.partNum.push({
label: response.data[i].零件图号,
value: response.data[i].工艺计划流水,
machine: response.data[i].机床图,
group: response.data[i].组号
})
}
})
if (this.radio === 1) { // 未编制
this.disabled = false
this.isShow1 = true
this.isShow2 = false
this.checked1 = true
getPartnames3(this.CraftmenValue, this.machine_Group_part).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.partNum.push({
label: response.data[i].零件图,
value: response.data[i].工艺计划流水,
machine: response.data[i].机床图号,
group: response.data[i].组号
})
}
})
} else { // 已编制
this.isShow = true
this.isShow1 = false
this.isShow2 = true
this.disabled = true
this.checked1 = false
getPartnames4(this.CraftmenValue, this.machine_Group_part).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.partNum.push({
label: response.data[i].零件图号,
value: response.data[i].工艺计划流水号,
machine: response.data[i].机床图号,
group: response.data[i].组号
})
}
})
}
},
searchParts() { // 根据条件查零件号
this.tableData = []