parent
7dbc5d41f1
commit
4d32578db0
12 changed files with 1207 additions and 174 deletions
@ -0,0 +1,20 @@ |
||||
import request from '@/axios'; |
||||
|
||||
// 工序检验 流程卡号查询 /pdaLoad/loadProTest/{cardNo}
|
||||
export const loadProTest = (params) => { |
||||
return request({ |
||||
url: `/blade-desk/pdaLoad/loadProTest/${params.cardNo}`, |
||||
method: 'get', |
||||
// params:params
|
||||
}); |
||||
}; |
||||
|
||||
// 工序检验提交
|
||||
export const saveProCheck = (data) => { |
||||
return request({ |
||||
url: '/blade-desk/pdaLoad/saveProCheck', |
||||
method: 'post', |
||||
data: data, |
||||
}); |
||||
}; |
||||
|
||||
@ -0,0 +1,32 @@ |
||||
import request from '@/axios'; |
||||
|
||||
// 报工查询
|
||||
export const loadCurrentWp = (params) => { |
||||
return request({ |
||||
url: '/blade-desk/prMakeRec/loadCurrentWp', |
||||
method: 'get', |
||||
params:params |
||||
}); |
||||
}; |
||||
|
||||
// 报工提交
|
||||
export const saveMakeRec = (data) => { |
||||
return request({ |
||||
url: '/blade-desk/prMakeRec/saveMakeRec', |
||||
method: 'post', |
||||
data:data |
||||
}); |
||||
}; |
||||
|
||||
// 报工记录
|
||||
export const queryMakeRec = (current, size, params) => { |
||||
return request({ |
||||
url: '/blade-desk/prMakeRec/queryMakeRec', |
||||
method: 'get', |
||||
params: { |
||||
...params, |
||||
current, |
||||
size, |
||||
}, |
||||
}); |
||||
}; |
||||
@ -0,0 +1,327 @@ |
||||
<template> |
||||
<basic-container> |
||||
<avue-crud |
||||
:option="option" |
||||
:table-loading="loading" |
||||
:data="data" |
||||
v-model="form" |
||||
v-model:page="page" |
||||
ref="crud" |
||||
@search-change="searchChange" |
||||
@search-reset="searchReset" |
||||
@current-change="currentChange" |
||||
@size-change="sizeChange" |
||||
@refresh-change="refreshChange" |
||||
@on-load="onLoad" |
||||
> |
||||
<template #menu-left> </template> |
||||
<template #menu-right> </template> |
||||
<template #menu="{ row }"> </template> |
||||
|
||||
<template #heatTreat="scope"> </template> |
||||
</avue-crud> |
||||
</basic-container> |
||||
</template> |
||||
|
||||
<script> |
||||
import { queryMakeRec } from '@/api/workReport/index.js'; |
||||
|
||||
export default { |
||||
components: {}, |
||||
data() { |
||||
return { |
||||
form: {}, |
||||
selectionList: [], |
||||
query: {}, |
||||
loading: false, |
||||
page: { |
||||
pageSize: 10, |
||||
currentPage: 1, |
||||
total: 0, |
||||
}, |
||||
option: { |
||||
columnSort: true, |
||||
tip: false, |
||||
height: 'auto', |
||||
calcHeight: 32, |
||||
simplePage: false, |
||||
searchShow: true, |
||||
searchMenuSpan: 6, |
||||
searchIcon: true, |
||||
searchIndex: 3, |
||||
tree: false, |
||||
border: true, |
||||
index: true, |
||||
selection: false, |
||||
addBtn: false, |
||||
editBtn: false, |
||||
viewBtn: false, |
||||
delBtn: false, |
||||
editBtnText: '修改', |
||||
labelWidth: 120, |
||||
menuWidth: 80, |
||||
dialogWidth: 900, |
||||
dialogClickModal: false, |
||||
searchEnter: true, |
||||
excelBtn: false, |
||||
filterBtn: true, |
||||
searchShowBtn: false, |
||||
excelBtn: true, |
||||
showOverflowTooltip: true, |
||||
addBtnIcon: ' ', |
||||
viewBtnIcon: ' ', |
||||
delBtnIcon: ' ', |
||||
editBtnIcon: ' ', |
||||
gridBtn: false, |
||||
searchLabelPosition: 'left', |
||||
searchGutter: 24, |
||||
searchSpan: 6, |
||||
menuAlign: 'left', |
||||
gridBtn: false, |
||||
searchMenuPosition: 'right', |
||||
align: 'center', |
||||
menu:false, |
||||
column: [ |
||||
{ |
||||
label: '车间订单号', |
||||
prop: 'woCode', |
||||
search: false, |
||||
sortable: true, |
||||
span: 12, |
||||
width:150, |
||||
}, |
||||
{ |
||||
label: '产品号', |
||||
prop: 'partCode', |
||||
search: false, |
||||
sortable: true, |
||||
span: 12, |
||||
width:150, |
||||
}, |
||||
{ |
||||
label: '流程卡号', |
||||
prop: 'cardNo', |
||||
search: true, |
||||
sortable: true, |
||||
span: 12, |
||||
width:150, |
||||
}, |
||||
{ |
||||
label: '产品型号', |
||||
prop: 'productType', |
||||
search: false, |
||||
sortable: true, |
||||
span: 12, |
||||
width:150, |
||||
}, |
||||
{ |
||||
label: '批次', |
||||
prop: 'batchNo', |
||||
search: true, |
||||
sortable: true, |
||||
span: 12, |
||||
width:150, |
||||
}, |
||||
{ |
||||
label: '产品名称', |
||||
prop: 'partName', |
||||
search: true, |
||||
sortable: true, |
||||
span: 12, |
||||
width:150, |
||||
}, |
||||
|
||||
{ |
||||
label: '镀种信息', |
||||
prop: 'plate', |
||||
search: false, |
||||
sortable: true, |
||||
span: 12, |
||||
width:150, |
||||
}, |
||||
{ |
||||
label: '生产标识', |
||||
prop: 'productIdent', |
||||
search: false, |
||||
sortable: true, |
||||
span: 12, |
||||
width:150, |
||||
}, |
||||
{ |
||||
label: '上序', |
||||
prop: 'frontPpsName', |
||||
search: false, |
||||
sortable: true, |
||||
span: 12, |
||||
width:150, |
||||
}, |
||||
{ |
||||
label: '上一班组', |
||||
prop: 'frontMakeTeamName', |
||||
search: false, |
||||
sortable: true, |
||||
span: 12, |
||||
width:150, |
||||
}, |
||||
{ |
||||
label: '加工工序', |
||||
prop: 'ppsName', |
||||
search: false, |
||||
sortable: true, |
||||
span: 12, |
||||
width:150, |
||||
}, |
||||
{ |
||||
label: '加工班组', |
||||
prop: 'makeTeamName', |
||||
search: false, |
||||
sortable: true, |
||||
span: 12, |
||||
width:150, |
||||
}, |
||||
{ |
||||
label: '下序', |
||||
prop: 'nextPpsName', |
||||
search: false, |
||||
sortable: true, |
||||
span: 12, |
||||
width:150, |
||||
}, |
||||
{ |
||||
label: '下一班组', |
||||
prop: 'nextMakeTeamName', |
||||
search: false, |
||||
sortable: true, |
||||
span: 12, |
||||
width:150, |
||||
}, |
||||
{ |
||||
label: '合格数量', |
||||
prop: 'workQty', |
||||
search: false, |
||||
sortable: true, |
||||
span: 12, |
||||
width:150, |
||||
}, |
||||
{ |
||||
label: '面积(d㎡)', |
||||
prop: 'ypArea', |
||||
search: false, |
||||
sortable: true, |
||||
span: 12, |
||||
width:150, |
||||
}, |
||||
{ |
||||
label: '报废数量', |
||||
prop: 'scrapQty', |
||||
search: false, |
||||
sortable: true, |
||||
span: 12, |
||||
width:150, |
||||
}, |
||||
{ |
||||
label: '报工时间', |
||||
prop: 'makeTime', |
||||
search: false, |
||||
sortable: true, |
||||
span: 12, |
||||
width:150, |
||||
}, |
||||
], |
||||
}, |
||||
|
||||
data: [], |
||||
}; |
||||
}, |
||||
methods: { |
||||
rowSave(row, done, loading) { |
||||
// addPersonAbility(row).then( |
||||
// () => { |
||||
// this.onLoad(this.page); |
||||
// this.$message({ |
||||
// type: 'success', |
||||
// message: '操作成功!', |
||||
// }); |
||||
// done(); |
||||
// }, |
||||
// error => { |
||||
// window.console.log(error); |
||||
// loading(); |
||||
// } |
||||
// ); |
||||
}, |
||||
rowUpdate(row, index, done, loading) { |
||||
// updatePersonAbility(row).then( |
||||
// () => { |
||||
// this.onLoad(this.page); |
||||
// this.$message({ |
||||
// type: 'success', |
||||
// message: '操作成功!', |
||||
// }); |
||||
// done(); |
||||
// }, |
||||
// error => { |
||||
// window.console.log(error); |
||||
// loading(); |
||||
// } |
||||
// ); |
||||
}, |
||||
rowDel(row) { |
||||
this.$confirm('确定将选择数据删除?', { |
||||
confirmButtonText: '确定', |
||||
cancelButtonText: '取消', |
||||
type: 'warning', |
||||
}) |
||||
.then(() => { |
||||
// return removePersonAbility(row.id); |
||||
}) |
||||
.then(() => { |
||||
this.onLoad(this.page); |
||||
this.$message({ |
||||
type: 'success', |
||||
message: '操作成功!', |
||||
}); |
||||
}); |
||||
}, |
||||
|
||||
searchReset() { |
||||
this.query = {}; |
||||
this.onLoad(this.page); |
||||
}, |
||||
searchChange(params, done) { |
||||
this.query = params; |
||||
this.page.currentPage = 1; |
||||
this.onLoad(this.page, params); |
||||
done(); |
||||
}, |
||||
selectionChange(list) { |
||||
this.selectionList = list; |
||||
}, |
||||
selectionClear() { |
||||
this.selectionList = []; |
||||
this.$refs.crud.toggleSelection(); |
||||
}, |
||||
|
||||
currentChange(currentPage) { |
||||
this.page.currentPage = currentPage; |
||||
}, |
||||
sizeChange(pageSize) { |
||||
this.page.pageSize = pageSize; |
||||
}, |
||||
refreshChange() { |
||||
this.onLoad(this.page, this.query); |
||||
}, |
||||
|
||||
onLoad(page, params = {}) { |
||||
this.loading = true; |
||||
queryMakeRec(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
||||
this.data = res.data.data.records; |
||||
this.loading = false; |
||||
this.selectionClear(); |
||||
}); |
||||
}, |
||||
}, |
||||
mounted() {}, |
||||
}; |
||||
</script> |
||||
d |
||||
@ -0,0 +1,265 @@ |
||||
<template> |
||||
<basic-container> |
||||
<el-form ref="form" :model="formData" :rules="rules" inline label-width="80px"> |
||||
<el-row :gutter="24"> |
||||
<el-col :span="12"> |
||||
<el-form-item label="流程卡号" prop="cardNo"> |
||||
<el-input |
||||
ref="codeFocus" |
||||
v-model="formData.cardNo" |
||||
placeholder="请扫描流程卡号" |
||||
@keyup.enter.native="codeKeyUp" |
||||
/> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="24"> |
||||
<el-descriptions |
||||
:column="3" |
||||
label-width="100px" |
||||
:content-style="{ 'min-width': '120px' }" |
||||
class="margin-top" |
||||
border |
||||
> |
||||
<el-descriptions-item> |
||||
<template #label> 流程卡号 </template> |
||||
{{ tableObj.cardNo }} |
||||
</el-descriptions-item> |
||||
<el-descriptions-item> |
||||
<template #label> 车间订单号 </template> |
||||
{{ tableObj.woCode }} |
||||
</el-descriptions-item> |
||||
<el-descriptions-item> |
||||
<template #label> 批次 </template> |
||||
{{ tableObj.batchNo }} |
||||
</el-descriptions-item> |
||||
|
||||
<el-descriptions-item> |
||||
<template #label> 零件号 </template> |
||||
{{ tableObj.partCode }} |
||||
</el-descriptions-item> |
||||
<el-descriptions-item> |
||||
<template #label> 零件名称 </template> |
||||
{{ tableObj.partName }} |
||||
</el-descriptions-item> |
||||
<el-descriptions-item> |
||||
<template #label> 上序号 </template> |
||||
{{ tableObj.frontOrders }} |
||||
</el-descriptions-item> |
||||
|
||||
<el-descriptions-item> |
||||
<template #label> 上序名称 </template> |
||||
{{ tableObj.frontPpsName }} |
||||
</el-descriptions-item> |
||||
<el-descriptions-item> |
||||
<template #label> 工序号 </template> |
||||
{{ tableObj.orders }} |
||||
</el-descriptions-item> |
||||
<el-descriptions-item> |
||||
<template #label> 工序名称 </template> |
||||
{{ tableObj.ppsName }} |
||||
</el-descriptions-item> |
||||
|
||||
<el-descriptions-item> |
||||
<template #label> 加工班组 </template> |
||||
{{ tableObj.makeTeam }} |
||||
</el-descriptions-item> |
||||
<el-descriptions-item> |
||||
<template #label> 检验数量 </template> |
||||
<el-input v-model="tableObj.makeQty" placeholder="请输入" type="number" min="0" /> |
||||
</el-descriptions-item> |
||||
<el-descriptions-item> |
||||
<template #label> 是否合格 </template> |
||||
<div> |
||||
<el-radio |
||||
v-model="fillInObj.checkResult" |
||||
:label="1" |
||||
@input="checkResulInput($event, fillInObj)" |
||||
>合格</el-radio |
||||
> |
||||
<el-radio |
||||
v-model="fillInObj.checkResult" |
||||
:label="2" |
||||
@input="checkResulInput($event, fillInObj)" |
||||
>不合格</el-radio |
||||
> |
||||
<el-radio |
||||
v-model="fillInObj.checkResult" |
||||
:label="-1" |
||||
@input="checkResulInput($event, fillInObj)" |
||||
>NA</el-radio |
||||
> |
||||
</div> |
||||
</el-descriptions-item> |
||||
<el-descriptions-item> |
||||
<template #label> 合格数量 </template> |
||||
<el-input |
||||
v-model="fillInObj.qualifiedQty" |
||||
placeholder="请输入" |
||||
type="number" |
||||
min="0" |
||||
/> |
||||
</el-descriptions-item> |
||||
<el-descriptions-item> |
||||
<template #label> 不合格数量 </template> |
||||
<el-input |
||||
v-model="fillInObj.unqualifiedQty" |
||||
placeholder="请输入" |
||||
type="number" |
||||
min="0" |
||||
@change="unqualifiedQtyChange" |
||||
/> |
||||
</el-descriptions-item> |
||||
<!-- 比例 --> |
||||
<el-descriptions-item> |
||||
<template #label> 比例(%) </template> |
||||
<el-input v-model="fillInObj.scale" placeholder="请输入" type="number" /> |
||||
</el-descriptions-item> |
||||
<el-descriptions-item> |
||||
<template #label> 不良原因 </template> |
||||
<!-- <poor-reason v-model="fillInObj.poorReason" placeholder="请选择" @change="prChange" /> --> |
||||
<el-select v-model="fillInObj.poorReason" placeholder="请选择" @change="prChange"> |
||||
<el-option |
||||
v-for="item in poorReasonList" |
||||
:key="item.id" |
||||
:label="item.name" |
||||
:value="item.id" |
||||
></el-option> |
||||
</el-select> |
||||
</el-descriptions-item> |
||||
<el-descriptions-item> |
||||
<template #label> 不良描述 </template> |
||||
<el-input |
||||
v-model="fillInObj.poorMemo" |
||||
:autosize="{ minRows: 2, maxRows: 5 }" |
||||
type="textarea" |
||||
/> |
||||
</el-descriptions-item> |
||||
</el-descriptions> |
||||
</el-col> |
||||
</el-row> |
||||
</el-form> |
||||
<span style="text-align: center; display: block; margin: 20px 0px 10px 0px"> |
||||
<el-button slot="right" type="primary" :disabled="isDisabled" @click="onSubmit" |
||||
>保存</el-button |
||||
> |
||||
</span> |
||||
</basic-container> |
||||
</template> |
||||
<script> |
||||
import { loadProTest, saveProCheck } from '@/api/workCheck/index.js'; |
||||
export default { |
||||
data() { |
||||
return { |
||||
formData: { |
||||
cardNo: null, |
||||
}, |
||||
rules: { |
||||
cardNo: [{ required: true, message: '请输入', trigger: 'blur' }], |
||||
}, |
||||
tableObj: { |
||||
makeQty: null, |
||||
}, |
||||
fillInObj: { |
||||
checkResult: 1, |
||||
qualifiedQty: null, |
||||
unqualifiedQty: null, |
||||
scale: 0, |
||||
poorReason: '', |
||||
poorMemo: '', |
||||
}, |
||||
isDisabled: false, |
||||
poorReasonList: [], //不良原因 |
||||
}; |
||||
}, |
||||
methods: { |
||||
unqualifiedQtyChange(v) { |
||||
this.fillInObj.unqualifiedQty = v; |
||||
// this.$set(this.qcReviewSheet, 'unqualifiedQty', v); |
||||
const makeQty = this.tableObj.makeQty; |
||||
if (v > makeQty) { |
||||
this.$message.error('不合格数不能大于' + makeQty); |
||||
this.$set(this.fillInObj, 'unqualifiedQty', null); |
||||
this.$set(this.fillInObj, 'scale', null); |
||||
} else { |
||||
this.$set(this.fillInObj, 'scale', Math.round((v / makeQty) * 100)); |
||||
} |
||||
}, |
||||
checkResulInput(v, item) { |
||||
if (v === 2) { |
||||
this.fillInObj.unqualifiedQty = this.tableObj.makeQty; |
||||
this.fillInObj.qualifiedQty = 0; |
||||
} else { |
||||
this.fillInObj.qualifiedQty = this.tableObj.makeQty; |
||||
this.fillInObj.unqualifiedQty = 0; |
||||
} |
||||
}, |
||||
prChange(id, item) { |
||||
this.fillInObj.poorReason = ''; |
||||
if (item) { |
||||
this.fillInObj.poorReason = item.name; |
||||
} else { |
||||
this.fillInObj.poorReason = ''; |
||||
} |
||||
}, |
||||
codeKeyUp() { |
||||
if (this.formData.cardNo) { |
||||
loadProTest({ cardNo: this.formData.cardNo }).then(res => { |
||||
this.tableObj = res.data.data; |
||||
this.fillInObj = { |
||||
checkResult: 1, |
||||
qualifiedQty: this.tableObj.makeQty, |
||||
unqualifiedQty: 0, |
||||
scale: 0, |
||||
poorReason: '', |
||||
poorMemo: '', |
||||
}; |
||||
}); |
||||
} |
||||
}, |
||||
onSubmit() { |
||||
this.isDisabled = true; |
||||
this.$refs.form.validate(valid => { |
||||
if (valid) { |
||||
const num = Number(this.fillInObj.unqualifiedQty) + Number(this.fillInObj.qualifiedQty); |
||||
if (num > this.tableObj.makeQty) { |
||||
this.$message.warning('合格与不合格数量之和不能大于检验数量!!!'); |
||||
return; |
||||
} |
||||
if (this.fillInObj.checkResult === 2) { |
||||
if (this.fillInObj.poorReason === '' || this.fillInObj.poorMemo === '') { |
||||
this.$message.warning('请填写原因或描述!!!'); |
||||
return; |
||||
} |
||||
} |
||||
if (Number(this.fillInObj.scale) > 100 || Number(this.fillInObj.scale) < 0) { |
||||
this.$message.warning('比例所填值的范围在0~100!!!'); |
||||
return; |
||||
} |
||||
this.fillInObj.makeQty = this.tableObj.makeQty; |
||||
this.fillInObj.wpId = this.tableObj.wpId; |
||||
saveProCheck(this.fillInObj) |
||||
.then(res => { |
||||
this.$message.success('检验成功!!!'); |
||||
this.tableObj = { |
||||
makeQty: null, |
||||
}; |
||||
this.fillInObj = { |
||||
checkResult: 1, |
||||
qualifiedQty: null, |
||||
unqualifiedQty: null, |
||||
scale: 0, |
||||
poorReason: '', |
||||
poorMemo: '', |
||||
}; |
||||
this.formData.cardNo = ''; |
||||
this.isDisabled = false; |
||||
}) |
||||
.catch(err => {}); |
||||
} |
||||
}); |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
||||
<style lang="scss" scoped> |
||||
</style> |
||||
@ -0,0 +1,294 @@ |
||||
<template> |
||||
<basic-container> |
||||
<el-form ref="form" :model="formData" :rules="rulesMold" label-width="90px"> |
||||
<el-row :gutter="24"> |
||||
<el-col :span="6" :offset="3"> |
||||
<el-form-item label="流程卡号:" prop="cardNo"> |
||||
<el-input |
||||
ref="codeFocus" |
||||
v-model="formData.cardNo" |
||||
placeholder="请输入" |
||||
@keyup.enter.native="codeKeyUp" |
||||
/> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="6"> |
||||
<el-form-item label="合格数量:" prop="workQty"> |
||||
<el-input-number |
||||
:disabled="workPlanDto.notWorkQty - formData.scrapQty == 0" |
||||
v-model="formData.workQty" |
||||
@change="handleChange" |
||||
:min="0" |
||||
:max="workPlanDto.notWorkQty - formData.scrapQty" |
||||
label="请输入" |
||||
@blur="scrapQtyBlur($event, 'workQty')" |
||||
></el-input-number> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="6"> |
||||
<el-form-item label="报废数量:" prop="scrapQty"> |
||||
<el-input-number |
||||
:disabled="workPlanDto.notWorkQty - formData.workQty == 0" |
||||
v-model="formData.scrapQty" |
||||
:min="0" |
||||
:max="workPlanDto.notWorkQty - formData.workQty" |
||||
@blur="scrapQtyBlur($event, 'scrapQty')" |
||||
></el-input-number> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="20" :offset="2"> |
||||
<el-descriptions |
||||
:column="3" |
||||
label-width="100px" |
||||
:content-style="{ 'min-width': '120px' }" |
||||
class="margin-top" |
||||
border |
||||
> |
||||
<el-descriptions-item> |
||||
<template #label> 车间订单号 </template> |
||||
{{ workPlanDto.woCode }} |
||||
</el-descriptions-item> |
||||
<el-descriptions-item> |
||||
<template #label> 流程卡号 </template> |
||||
{{ workPlanDto.cardNo }} |
||||
</el-descriptions-item> |
||||
<el-descriptions-item> |
||||
<template #label> 批次 </template> |
||||
{{ workPlanDto.batchNo }} |
||||
</el-descriptions-item> |
||||
|
||||
<el-descriptions-item> |
||||
<template #label> 产品号 </template> |
||||
{{ workPlanDto.partCode }} |
||||
</el-descriptions-item> |
||||
<el-descriptions-item> |
||||
<template #label> 产品型号 </template> |
||||
{{ workPlanDto.productType }} |
||||
</el-descriptions-item> |
||||
<el-descriptions-item> |
||||
<template #label> 产品名称 </template> |
||||
{{ workPlanDto.partName }} |
||||
</el-descriptions-item> |
||||
|
||||
<el-descriptions-item> |
||||
<template #label> 镀种信息 </template> |
||||
{{ workPlanDto.plate }} |
||||
</el-descriptions-item> |
||||
<el-descriptions-item> |
||||
<template #label> 当前工序 </template> |
||||
{{ workPlanDto.currentWpTitle }} |
||||
</el-descriptions-item> |
||||
<el-descriptions-item> |
||||
<template #label> 接收数量 </template> |
||||
{{ workPlanDto.makeQty }} |
||||
</el-descriptions-item> |
||||
<el-descriptions-item> |
||||
<template #label> 已合格数量 </template> |
||||
{{ workPlanDto.workQty }} |
||||
</el-descriptions-item> |
||||
<el-descriptions-item> |
||||
<template #label> 报废数量 </template> |
||||
{{ workPlanDto.scrapQty }} |
||||
</el-descriptions-item> |
||||
</el-descriptions> |
||||
</el-col> |
||||
<el-col :span="5" :offset="2"> |
||||
<el-form-item label="色标数量:" prop="flagQty"> |
||||
<el-input-number v-model="formData.flagQty" :min="0" /> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="5"> |
||||
<el-form-item label="颜色1:" prop="flagColourOne"> |
||||
<el-input v-model="formData.flagColourOne" /> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="5"> |
||||
<el-form-item label="颜色2:" prop="flagColourTwo"> |
||||
<el-input v-model="formData.flagColourTwo" /> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="5"> |
||||
<el-form-item label="油墨:" prop="flagInk"> |
||||
<el-input v-model="formData.flagInk" /> |
||||
</el-form-item> |
||||
</el-col> |
||||
|
||||
<el-col :span="5" :offset="2"> |
||||
<el-form-item label="色带数量:" prop="beltQty"> |
||||
<el-input-number v-model="formData.beltQty" :min="0" /> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="5"> |
||||
<el-form-item label="颜色1:" prop="beltColourOne"> |
||||
<el-input v-model="formData.beltColourOne" /> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="5"> |
||||
<el-form-item label="颜色2:" prop="beltColourTwo"> |
||||
<el-input v-model="formData.beltColourTwo" /> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="5"> |
||||
<el-form-item label="油墨:" prop="beltInk"> |
||||
<el-input v-model="formData.beltInk" /> |
||||
</el-form-item> |
||||
</el-col> |
||||
|
||||
<el-col :span="18" :offset="2"> |
||||
<el-form-item label="备注" prop="memo"> |
||||
<el-input v-model="formData.memo" type="textarea" /> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col |
||||
v-if="workPlanDto.currentWpId != null && workPlanDto.frontMakeTeam == null" |
||||
:span="24" |
||||
> |
||||
<el-form-item label="自检是否合格:" label-width="120px" style="line-height: 40px"> |
||||
<el-radio-group v-model="formData.resource"> |
||||
<el-radio :label="true">合格</el-radio> |
||||
<el-radio :label="false">不合格</el-radio> |
||||
</el-radio-group> |
||||
</el-form-item> |
||||
</el-col> |
||||
<!-- 热处理 --> |
||||
<template v-if="heatTreatmentShow"> |
||||
<el-col :span="6" :offset="2"> |
||||
<el-form-item label="试片数量/个:" label-width="120px"> |
||||
<el-radio-group v-model="heatTreatment.resource"> |
||||
<el-radio label="合格">合格</el-radio> |
||||
<el-radio label="不合格">不合格</el-radio> |
||||
</el-radio-group> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="3"> |
||||
<el-form-item label="" label-width="0px"> |
||||
<el-input v-model="heatTreatment.num" /> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="6"> |
||||
<el-form-item label="材料厚度/mm:" label-width="120px"> |
||||
<el-input v-model="heatTreatment.thickness" |
||||
/></el-form-item> |
||||
</el-col> |
||||
<el-col :span="6"> |
||||
<el-form-item label="热处理工装编号:" label-width="120px"> |
||||
<el-input v-model="heatTreatment.code" /> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="6" :offset="2"> |
||||
<el-form-item label="材料检验编号:" label-width="120px"> |
||||
<el-input v-model="heatTreatment.inspectCode" /> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="6"> |
||||
<el-form-item label="材料检验编号:" label-width="120px"> |
||||
<el-input v-model="heatTreatment.status" /> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="6"> |
||||
<el-form-item label="原材料制品形式:" label-width="120px"> |
||||
<el-input v-model="heatTreatment.shape" /> |
||||
</el-form-item> |
||||
</el-col> |
||||
</template> |
||||
</el-row> |
||||
</el-form> |
||||
<span style="text-align: center; display: block; margin-top: 8px"> |
||||
<el-button slot="right" type="primary" :disabled="isDisabled" @click="onSubmit" |
||||
>报工</el-button |
||||
> |
||||
</span> |
||||
</basic-container> |
||||
</template> |
||||
<script> |
||||
import { loadCurrentWp, saveMakeRec } from '@/api/workReport/index'; |
||||
export default { |
||||
components: {}, |
||||
data() { |
||||
return { |
||||
workPlanDto: {}, |
||||
workPlanDto: {}, |
||||
isDisabled: false, |
||||
formData: { |
||||
flagQty: 0, |
||||
beltQty: 0, |
||||
prWorkPlan: {}, |
||||
workQty: 0, |
||||
scrapQty: 0, |
||||
resource: true, |
||||
}, |
||||
rulesMold: { |
||||
cardNo: [{ required: true, message: '请输入', trigger: 'blur' }], |
||||
workQty: [{ required: true, message: '请输入', trigger: 'blur' }], |
||||
scrapQty: [{ required: true, message: '请输入', trigger: 'blur' }], |
||||
}, |
||||
heatTreatment: { resource: '合格' }, |
||||
heatTreatmentShow: false, |
||||
}; |
||||
}, |
||||
methods: { |
||||
codeKeyUp() { |
||||
if (this.formData.cardNo) { |
||||
loadCurrentWp({ cardNo: this.formData.cardNo }) |
||||
.then(res => { |
||||
this.workPlanDto = res.data.data; |
||||
this.formData.prWorkPlan.wpId = this.workPlanDto.currentWpId; |
||||
if ( |
||||
this.workPlanDto != null && |
||||
this.workPlanDto.currentWpTitle != null && |
||||
this.workPlanDto.currentWpTitle.split('|')[1] === '热处理' |
||||
) { |
||||
this.heatTreatmentShow = true; |
||||
} |
||||
this.formData.workQty = this.workPlanDto.notWorkQty; |
||||
this.formData.scrapQty = 0; |
||||
}) |
||||
.catch(err => {}); |
||||
} |
||||
}, |
||||
scrapQtyBlur(e, str) { |
||||
if (!e.target.value) { |
||||
if (str === 'workQty') { |
||||
this.formData.workQty = 0; |
||||
} else { |
||||
this.formData.scrapQty = 0; |
||||
} |
||||
} |
||||
}, |
||||
onSubmit() { |
||||
this.isDisabled = true; |
||||
this.$refs.form.validate(valid => { |
||||
if (valid) { |
||||
if (this.formData.workQty || this.formData.scrapQty) { |
||||
saveMakeRec({ ...this.formData, ...this.heatTreatment,...this.formData.prWorkPlan }).then(res => { |
||||
this.$message.success('保存成功'); |
||||
this.$refs.form.resetFields(); |
||||
this.workPlanDto = {}; |
||||
this.formData = { |
||||
prWorkPlan: {}, |
||||
workQty: 0, |
||||
scrapQty: 0, |
||||
resource: true, |
||||
}; |
||||
this.heatTreatment = { resource: '合格' }; |
||||
this.heatTreatmentShow = false; |
||||
this.isDisabled = false; |
||||
}); |
||||
} else { |
||||
this.$message.error('请填写报工数量'); |
||||
this.isDisabled = false; |
||||
} |
||||
} |
||||
}); |
||||
}, |
||||
}, |
||||
mounted() {}, |
||||
created() {}, |
||||
beforeDestroy() {}, |
||||
}; |
||||
</script> |
||||
<style lang="scss" scoped> |
||||
.margin-top { |
||||
margin-bottom: 15px; |
||||
} |
||||
</style> |
||||
Loading…
Reference in new issue