撤销报废功能
This commit is contained in:
@@ -55,3 +55,16 @@ export function editSpare(CutCode, number, id, Unqualified, remarkGroup, people,
|
||||
}
|
||||
})
|
||||
}
|
||||
export function reSpare(CutCode) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
UserID: state.state.user.id,
|
||||
ModularID: router.currentRoute.path,
|
||||
type: '2',
|
||||
name: '报废补投_撤销报废_循环执行',
|
||||
param: '工艺计划流水号组=' + CutCode
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
style="width:240px;margin-left: 10px"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"/>
|
||||
<!--<span>处理结果:</span>-->
|
||||
<el-select v-model="ProcessingResultValue" filterable placeholder="处理结果" size="small" style="width: 130px;margin-left: 10px" clearable>
|
||||
<el-option
|
||||
v-for="item in ProcessingResult"
|
||||
@@ -31,8 +30,9 @@
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-button type="primary" icon="el-icon-search" size="small" plain style="margin-left: 10px" @click="total=0;pageSize = 20;pageCurrent = 1;searchTable()">查询</el-button>
|
||||
<!--<el-button type="primary" icon="el-icon-search" size="small" plain style="margin-left: 10px" @click="total=0;pageSize = 20;pageCurrent = 1;loginsession()">session</el-button>-->
|
||||
<el-button :disabled="handleEdit_disable || procedureGroup.length === 0" type="distribution" icon="el-icon-top" size="small" plain style="margin-left: 10px" @click="submit()">提交补投</el-button>
|
||||
<el-switch v-model="switchValue" active-color="#13ce66" inactive-color="#ff4949" style="margin-left: 30px" @change="switchValueChange()"/>
|
||||
<el-button v-positive="'loading'" v-show="switchValue" :disabled="procedureGroup.length === 0" type="distribution" icon="el-icon-top" size="small" plain style="margin-left: 10px" @click="submit()">提交补投</el-button>
|
||||
<el-button v-positive="'loading'" v-show="!switchValue" :disabled="procedureGroup.length === 0" type="distribution" icon="el-icon-top" size="small" plain style="margin-left: 10px" @click="reSubmit()">撤销补投</el-button>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</div>
|
||||
@@ -72,7 +72,6 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件图号" prop="零件图号" align="center" width="173px" show-overflow-tooltip>
|
||||
<!--<el-table-column label="零件图号" prop="零件图号" align="center" width="180" show-overflow-tooltip>-->
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件图号 }}
|
||||
</template>
|
||||
@@ -179,11 +178,12 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { searchMachine, searchProcessingResult, searchtable, editSpare } from '@/api/ManufacturingCenter/ScrappedSupplementaryInvestment'
|
||||
import { searchMachine, searchProcessingResult, searchtable, editSpare, reSpare } from '@/api/ManufacturingCenter/ScrappedSupplementaryInvestment'
|
||||
import { mapGetters } from 'vuex'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
switchValue: true, // 报废撤销开关
|
||||
machineNameValue: '', // 机床图号
|
||||
machineName: [],
|
||||
partName: '',
|
||||
@@ -321,13 +321,48 @@ export default {
|
||||
console.log(error)
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
message: '已取消报废'
|
||||
})
|
||||
})
|
||||
},
|
||||
selectable(row) {
|
||||
return (row.报废时间 === null && row.不合格处理文本 === '报废')
|
||||
// 20200509↓
|
||||
switchValueChange() {
|
||||
this.$refs.multipleTable.clearSelection()
|
||||
this.procedureGroup = []
|
||||
},
|
||||
selectable(row) {
|
||||
if (this.switchValue) {
|
||||
return (row.报废时间 === null && row.不合格处理文本 === '报废')
|
||||
} else {
|
||||
return (row.进程 === '已提交')
|
||||
}
|
||||
},
|
||||
reSubmit() {
|
||||
this.$confirm('是否将零件报废信息撤回?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.ProcessPlanNumber = []
|
||||
for (let i = 0; i < this.procedureGroup.length; i++) {
|
||||
this.ProcessPlanNumber.push(this.procedureGroup[i].工艺计划流水号)
|
||||
}
|
||||
reSpare(this.ProcessPlanNumber).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('撤回成功')
|
||||
this.searchTable()
|
||||
} else {
|
||||
this.$message.success('撤回失败')
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消撤回'
|
||||
})
|
||||
})
|
||||
},
|
||||
// 20200509↑
|
||||
handleSelectionChange(val) {
|
||||
this.procedureGroup = val
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user