|
|
|
@ -29,11 +29,12 @@ |
|
|
|
@selection-change="selectionChangeProject" |
|
|
|
@selection-change="selectionChangeProject" |
|
|
|
@select="selectChange" |
|
|
|
@select="selectChange" |
|
|
|
v-loading="tableLoading" |
|
|
|
v-loading="tableLoading" |
|
|
|
|
|
|
|
:height="tableHeight" |
|
|
|
> |
|
|
|
> |
|
|
|
<el-table-column type="selection" fixed></el-table-column> |
|
|
|
<el-table-column type="selection" fixed></el-table-column> |
|
|
|
<el-table-column label="单号" prop="paCode" align="center"></el-table-column> |
|
|
|
<el-table-column label="单号" prop="paCode" align="center" width="200"></el-table-column> |
|
|
|
<el-table-column label="车间订单" prop="woCode" align="center"> |
|
|
|
<el-table-column label="车间订单" align="center" width="200"> |
|
|
|
<template #header> |
|
|
|
<!-- prop="woCode"<template #header> |
|
|
|
<span><i style="color: red">*</i>车间订单</span> |
|
|
|
<span><i style="color: red">*</i>车间订单</span> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<template #default="scope"> |
|
|
|
<template #default="scope"> |
|
|
|
@ -43,20 +44,26 @@ |
|
|
|
> |
|
|
|
> |
|
|
|
<el-input v-model="scope.row.woCode" placeholder="请输入车间订单"></el-input> |
|
|
|
<el-input v-model="scope.row.woCode" placeholder="请输入车间订单"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</template> |
|
|
|
</template> --> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="批单号" prop="batchNo" align="center"></el-table-column> |
|
|
|
<el-table-column label="批次号" prop="batchNo" align="center" width="200"></el-table-column> |
|
|
|
<el-table-column label="流程卡号" prop="cardNo" align="center"></el-table-column> |
|
|
|
<el-table-column |
|
|
|
|
|
|
|
label="流程卡号" |
|
|
|
|
|
|
|
prop="cardNo" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
width="200" |
|
|
|
|
|
|
|
></el-table-column> |
|
|
|
<el-table-column label="入库班组/供应商" prop="tsName" width="200" align="center"> |
|
|
|
<el-table-column label="入库班组/供应商" prop="tsName" width="200" align="center"> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="入库工序号" prop="orders" align="center"> </el-table-column> |
|
|
|
<el-table-column label="入库工序号" prop="orders" align="center"> </el-table-column> |
|
|
|
<el-table-column label="入库工序名称" prop="ppsName" align="center"> </el-table-column> |
|
|
|
<el-table-column label="入库工序名称" prop="ppsName" align="center" width="200"> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="下序号" prop="nextOrders" align="center"> </el-table-column> |
|
|
|
<el-table-column label="下序号" prop="nextOrders" align="center"> </el-table-column> |
|
|
|
<el-table-column label="下序名称" prop="nextPpsName" align="center"> </el-table-column> |
|
|
|
<el-table-column label="下序名称" prop="nextPpsName" align="center"> </el-table-column> |
|
|
|
<el-table-column label="下序班组/供应商" prop="nextTsName" width="200" align="center"> |
|
|
|
<el-table-column label="下序班组/供应商" prop="nextTsName" width="200" align="center"> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="入库数量" prop="quantity" align="center"> </el-table-column> |
|
|
|
<el-table-column label="入库数量" prop="quantity" align="center"> </el-table-column> |
|
|
|
<el-table-column label="入库人员" prop="userName" align="center"> |
|
|
|
<el-table-column label="入库人员" prop="userName" align="center" width="200"> |
|
|
|
<template #header> |
|
|
|
<template #header> |
|
|
|
<span><i style="color: red">*</i>入库人员</span> |
|
|
|
<span><i style="color: red">*</i>入库人员</span> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
@ -65,11 +72,24 @@ |
|
|
|
:prop="`beforePlatingEntryData[${scope.$index}].userName`" |
|
|
|
:prop="`beforePlatingEntryData[${scope.$index}].userName`" |
|
|
|
:rules="formRules.userName" |
|
|
|
:rules="formRules.userName" |
|
|
|
> |
|
|
|
> |
|
|
|
<el-input v-model="scope.row.userName"></el-input> |
|
|
|
<!-- <el-input v-model="scope.row.userName"></el-input> --> |
|
|
|
|
|
|
|
<el-select |
|
|
|
|
|
|
|
filterable |
|
|
|
|
|
|
|
clearable |
|
|
|
|
|
|
|
v-model="scope.row.userId" |
|
|
|
|
|
|
|
placeholder="请选择入库人员" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<el-option |
|
|
|
|
|
|
|
v-for="item in userList" |
|
|
|
|
|
|
|
:key="item.id" |
|
|
|
|
|
|
|
:label="item.realName" |
|
|
|
|
|
|
|
:value="item.id" |
|
|
|
|
|
|
|
></el-option> |
|
|
|
|
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="入库时间" prop="createTime" align="center"> |
|
|
|
<el-table-column label="入库时间" prop="createTime" align="center" width="200"> |
|
|
|
<template #header> |
|
|
|
<template #header> |
|
|
|
<span><i style="color: red">*</i>入库时间</span> |
|
|
|
<span><i style="color: red">*</i>入库时间</span> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
@ -78,7 +98,14 @@ |
|
|
|
:prop="`beforePlatingEntryData[${scope.$index}].createTime`" |
|
|
|
:prop="`beforePlatingEntryData[${scope.$index}].createTime`" |
|
|
|
:rules="formRules.createTime" |
|
|
|
:rules="formRules.createTime" |
|
|
|
> |
|
|
|
> |
|
|
|
<el-input v-model="scope.row.createTime"></el-input> |
|
|
|
<!-- <el-input v-model="scope.row.createTime"></el-input> --> |
|
|
|
|
|
|
|
<el-date-picker |
|
|
|
|
|
|
|
v-model="scope.row.createTime" |
|
|
|
|
|
|
|
type="datetime" |
|
|
|
|
|
|
|
placeholder="选择日期时间" |
|
|
|
|
|
|
|
value-format="yyyy-MM-dd HH:mm:ss" |
|
|
|
|
|
|
|
style="width: 100%" |
|
|
|
|
|
|
|
></el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
@ -87,8 +114,8 @@ |
|
|
|
|
|
|
|
|
|
|
|
<template #footer> |
|
|
|
<template #footer> |
|
|
|
<span class="dialog-footer"> |
|
|
|
<span class="dialog-footer"> |
|
|
|
<el-button @click="closeDialog">取 消</el-button> |
|
|
|
<el-button @click="closeDialog" :loading="sunmitLoading">取 消</el-button> |
|
|
|
<el-button type="primary" @click="handleSave">保 存</el-button> |
|
|
|
<el-button type="primary" @click="handleSave" :loading="sunmitLoading">保 存</el-button> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
@ -100,6 +127,7 @@ import { |
|
|
|
getBeforePlatInCardNo, |
|
|
|
getBeforePlatInCardNo, |
|
|
|
savePlateAroundPlateFrontEnter, |
|
|
|
savePlateAroundPlateFrontEnter, |
|
|
|
} from '@/api/productionManagement/beforeAndAfterPlating'; |
|
|
|
} from '@/api/productionManagement/beforeAndAfterPlating'; |
|
|
|
|
|
|
|
import { getUserList } from '@/api/workLicense/workLicense'; |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
props: { |
|
|
|
props: { |
|
|
|
showDialog: { |
|
|
|
showDialog: { |
|
|
|
@ -109,6 +137,9 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
|
|
|
|
sunmitLoading: false, |
|
|
|
|
|
|
|
userList: [], //用户列表 |
|
|
|
|
|
|
|
tableHeight: 400, |
|
|
|
tableLoading: false, |
|
|
|
tableLoading: false, |
|
|
|
formError: '', |
|
|
|
formError: '', |
|
|
|
cardNo: '', |
|
|
|
cardNo: '', |
|
|
|
@ -134,17 +165,11 @@ export default { |
|
|
|
trigger: 'submit', |
|
|
|
trigger: 'submit', |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
], |
|
|
|
woCode: [ |
|
|
|
|
|
|
|
{ |
|
|
|
userId: [ |
|
|
|
required: true, |
|
|
|
|
|
|
|
message: '请输入', |
|
|
|
|
|
|
|
trigger: 'blur', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
userName: [ |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
required: true, |
|
|
|
message: '请输入', |
|
|
|
message: '请选择', |
|
|
|
trigger: 'blur', |
|
|
|
trigger: 'blur', |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
], |
|
|
|
@ -158,8 +183,40 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() {}, |
|
|
|
mounted() { |
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
|
|
this.calculateTableHeight(); |
|
|
|
|
|
|
|
this.getUserInfo(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
|
|
|
|
// 获取用户信息 |
|
|
|
|
|
|
|
getUserInfo() { |
|
|
|
|
|
|
|
getUserList({ size: 999999, current: 1 }).then(res => { |
|
|
|
|
|
|
|
this.userList = res.data.data.records; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 计算表格高度 |
|
|
|
|
|
|
|
calculateTableHeight() { |
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
|
|
const dialogContainer = document.querySelector('.el-dialog__body'); |
|
|
|
|
|
|
|
if (!dialogContainer) return; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const containerHeight = dialogContainer.clientHeight; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 减去其他元素高度 |
|
|
|
|
|
|
|
const inputAreaHeight = 50; |
|
|
|
|
|
|
|
const errorHeight = 30; |
|
|
|
|
|
|
|
const formPadding = 40; |
|
|
|
|
|
|
|
const footerHeight = 10; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const calculatedHeight = |
|
|
|
|
|
|
|
containerHeight - inputAreaHeight - errorHeight - formPadding - footerHeight; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.tableHeight = Math.max(300, Math.min(calculatedHeight, 800)); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
open() { |
|
|
|
open() { |
|
|
|
this.cardNo = ''; |
|
|
|
this.cardNo = ''; |
|
|
|
this.form.beforePlatingEntryData = []; |
|
|
|
this.form.beforePlatingEntryData = []; |
|
|
|
@ -168,7 +225,11 @@ export default { |
|
|
|
this.tableLoading = true; |
|
|
|
this.tableLoading = true; |
|
|
|
getBeforePlatInCardNo({ cardNo: this.cardNo }) |
|
|
|
getBeforePlatInCardNo({ cardNo: this.cardNo }) |
|
|
|
.then(res => { |
|
|
|
.then(res => { |
|
|
|
this.form.beforePlatingEntryData = res.data; |
|
|
|
this.form.beforePlatingEntryData.push(res.data.data); |
|
|
|
|
|
|
|
this.tableLoading = false; |
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
|
|
this.calculateTableHeight(); |
|
|
|
|
|
|
|
}); |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
.catch(err => { |
|
|
|
this.tableLoading = false; |
|
|
|
this.tableLoading = false; |
|
|
|
@ -197,26 +258,28 @@ export default { |
|
|
|
}); |
|
|
|
}); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this.sunmitLoading = true; |
|
|
|
|
|
|
|
|
|
|
|
// 校验通过:准备提交数据(过滤无用字段) |
|
|
|
// 校验通过:准备提交数据(过滤无用字段) |
|
|
|
const submitData = this.form.tableData.map(row => { |
|
|
|
const submitData = this.form.beforePlatingEntryData.map(row => { |
|
|
|
const { _select, ...validData } = row; // 剔除选择状态字段 |
|
|
|
const { _select, ...validData } = row; // 剔除选择状态字段 |
|
|
|
return validData; |
|
|
|
return validData; |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// 调用接口提交(实际项目替换) |
|
|
|
// 调用接口提交(实际项目替换)hrTypeBool: 0-转工 1-入库 |
|
|
|
try { |
|
|
|
try { |
|
|
|
savePlateAroundPlateFrontEnter({...this.form.beforePlatingEntryData, paType: 1 }).then( |
|
|
|
savePlateAroundPlateFrontEnter(this.form.beforePlatingEntryData) |
|
|
|
res => { |
|
|
|
.then(res => { |
|
|
|
|
|
|
|
this.sunmitLoading = false; |
|
|
|
this.$message.success('提交成功'); |
|
|
|
this.$message.success('提交成功'); |
|
|
|
this.closeDialog(); |
|
|
|
this.closeDialog(); |
|
|
|
this.$emit('submitSuccess', submitData); |
|
|
|
this.$emit('submitSuccess', submitData); |
|
|
|
} |
|
|
|
}) |
|
|
|
); |
|
|
|
.catch(err => { |
|
|
|
|
|
|
|
this.sunmitLoading = false; |
|
|
|
// 演示用 |
|
|
|
}); |
|
|
|
} catch (err) { |
|
|
|
} catch (err) { |
|
|
|
this.$message.error('网络错误,请稍后重试'); |
|
|
|
this.sunmitLoading = false; |
|
|
|
console.error('提交失败:', err); |
|
|
|
console.error('提交失败:', err); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
@ -230,4 +293,20 @@ export default { |
|
|
|
}; |
|
|
|
}; |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<style></style> |
|
|
|
<style lang="scss" scoped> |
|
|
|
|
|
|
|
// 优化表单字段样式 |
|
|
|
|
|
|
|
:deep(.el-table .el-form-item) { |
|
|
|
|
|
|
|
margin-bottom: 0; // 去掉默认边距 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 错误提示样式优化 |
|
|
|
|
|
|
|
:deep(.el-form-item__error) { |
|
|
|
|
|
|
|
font-size: 12px; |
|
|
|
|
|
|
|
white-space: nowrap; |
|
|
|
|
|
|
|
z-index: 10; |
|
|
|
|
|
|
|
background: #fff; |
|
|
|
|
|
|
|
padding: 2px 4px; |
|
|
|
|
|
|
|
border: 1px solid #f56c6c; |
|
|
|
|
|
|
|
border-radius: 4px; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
</style> |
|
|
|
|