|
|
@ -75,54 +75,62 @@ |
|
|
<el-dialog |
|
|
<el-dialog |
|
|
title="确认领料数量" |
|
|
title="确认领料数量" |
|
|
:visible.sync="materialDialogVisible" |
|
|
:visible.sync="materialDialogVisible" |
|
|
width="88%" |
|
|
|
|
|
|
|
|
width="70%" |
|
|
:close-on-click-modal="false" |
|
|
:close-on-click-modal="false" |
|
|
v-drag> |
|
|
v-drag> |
|
|
|
|
|
<el-form :inline="true" class="material-form"> |
|
|
|
|
|
<el-form-item label="要求发料时间" class="material-need-date-item"> |
|
|
|
|
|
<el-date-picker |
|
|
|
|
|
v-model="issueNeedDate" |
|
|
|
|
|
type="datetime" |
|
|
|
|
|
value-format="yyyy-MM-dd HH:mm" |
|
|
|
|
|
placeholder="选择日期" |
|
|
|
|
|
style="width: 180px"> |
|
|
|
|
|
</el-date-picker> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-form> |
|
|
<el-table |
|
|
<el-table |
|
|
:data="materialList" |
|
|
:data="materialList" |
|
|
border |
|
|
border |
|
|
class="material-table" |
|
|
class="material-table" |
|
|
max-height="58vh" |
|
|
max-height="58vh" |
|
|
style="width: 100%"> |
|
|
style="width: 100%"> |
|
|
<el-table-column type="index" width="60" label="序号" align="center" header-align="center"></el-table-column> |
|
|
|
|
|
<el-table-column prop="applyNo" label="试验单号" width="130" align="center" header-align="center"></el-table-column> |
|
|
|
|
|
<el-table-column prop="workOrderNo" label="工单号" width="150" align="center" header-align="center" show-overflow-tooltip></el-table-column> |
|
|
|
|
|
<el-table-column prop="processStep" label="工序" width="120" align="center" header-align="center" show-overflow-tooltip></el-table-column> |
|
|
|
|
|
<el-table-column prop="partNo" label="物料编码" width="150" align="center" header-align="center" show-overflow-tooltip> |
|
|
|
|
|
|
|
|
<el-table-column type="index" width="50" label="序号" align="center" header-align="center"></el-table-column> |
|
|
|
|
|
<el-table-column prop="applyNo" label="试验单号" width="110" align="center" header-align="center"></el-table-column> |
|
|
|
|
|
<el-table-column prop="workOrderNo" label="工单号" width="130" align="center" header-align="center" show-overflow-tooltip></el-table-column> |
|
|
|
|
|
<el-table-column prop="processStep" label="工序" width="80" align="center" header-align="center" show-overflow-tooltip></el-table-column> |
|
|
|
|
|
<el-table-column prop="partNo" label="物料编码" width="100" align="center" header-align="center" show-overflow-tooltip> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
{{ scope.row.partNo || '-' }} |
|
|
{{ scope.row.partNo || '-' }} |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column prop="partDesc" label="物料描述" min-width="220" align="left" header-align="center" show-overflow-tooltip></el-table-column> |
|
|
|
|
|
<el-table-column prop="requiredQty" label="原材料数量" width="120" align="center" header-align="center"> |
|
|
|
|
|
|
|
|
<el-table-column prop="partDesc" label="物料描述" width="260" align="left" header-align="center" show-overflow-tooltip></el-table-column> |
|
|
|
|
|
<el-table-column prop="requiredQty" label="原材料数量" width="100" align="center" header-align="center"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
{{ formatQty(scope.row.requiredQty) }} |
|
|
{{ formatQty(scope.row.requiredQty) }} |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column prop="issuedQty" label="已申请数量" width="120" align="center" header-align="center"> |
|
|
|
|
|
|
|
|
<el-table-column prop="stockQty" label="ERP库存" width="100" align="center" header-align="center"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
{{ formatQty(scope.row.stockQty) }} |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column prop="issuedQty" label="已申请数量" width="100" align="center" header-align="center"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
{{ formatQty(scope.row.issuedQty) }} |
|
|
{{ formatQty(scope.row.issuedQty) }} |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column prop="availableQty" label="可申请数量" width="120" align="center" header-align="center"> |
|
|
|
|
|
|
|
|
<el-table-column prop="availableQty" label="可申请数量" width="100" align="center" header-align="center"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
{{ formatQty(scope.row.availableQty) }} |
|
|
{{ formatQty(scope.row.availableQty) }} |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column prop="issueQty" label="本次领料数量" width="160" align="center" header-align="center"> |
|
|
|
|
|
|
|
|
<el-table-column prop="issueQty" label="本次领料数量" width="130" align="center" header-align="center"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<el-input |
|
|
|
|
|
v-model="scope.row.issueQty" |
|
|
|
|
|
:precision="6" |
|
|
|
|
|
:controls="true" |
|
|
|
|
|
:min="0" |
|
|
|
|
|
:max="toNumber(scope.row.availableQty)" |
|
|
|
|
|
size="small" |
|
|
|
|
|
style="width: 135px"> |
|
|
|
|
|
</el-input> |
|
|
|
|
|
|
|
|
<el-input v-model="scope.row.issueQty" style="width: 118px"></el-input> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column prop="umid" label="单位" width="80" align="center" header-align="center"></el-table-column> |
|
|
|
|
|
|
|
|
<el-table-column prop="umid" label="单位" width="60" align="center" header-align="center"></el-table-column> |
|
|
</el-table> |
|
|
</el-table> |
|
|
|
|
|
|
|
|
<div slot="footer" class="dialog-footer" style="margin-top: 20px"> |
|
|
<div slot="footer" class="dialog-footer" style="margin-top: 20px"> |
|
|
@ -165,6 +173,7 @@ export default { |
|
|
tableHeight: (window.innerHeight - 260), |
|
|
tableHeight: (window.innerHeight - 260), |
|
|
materialDialogVisible: false, |
|
|
materialDialogVisible: false, |
|
|
materialList: [], |
|
|
materialList: [], |
|
|
|
|
|
issueNeedDate: '', |
|
|
createLoading: false |
|
|
createLoading: false |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
@ -271,7 +280,9 @@ export default { |
|
|
requiredQty, |
|
|
requiredQty, |
|
|
issuedQty, |
|
|
issuedQty, |
|
|
availableQty, |
|
|
availableQty, |
|
|
issueQty |
|
|
|
|
|
|
|
|
issueQty, |
|
|
|
|
|
stockQty: this.toNumber(item.stockQty), |
|
|
|
|
|
needDate: item.needDate |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
const availableList = normalizedList.filter(item => this.toNumber(item.availableQty) > 0) |
|
|
const availableList = normalizedList.filter(item => this.toNumber(item.availableQty) > 0) |
|
|
@ -280,6 +291,7 @@ export default { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
this.materialList = availableList |
|
|
this.materialList = availableList |
|
|
|
|
|
this.issueNeedDate = availableList[0].needDate |
|
|
this.materialDialogVisible = true |
|
|
this.materialDialogVisible = true |
|
|
} else { |
|
|
} else { |
|
|
this.$message.error(data.msg || '加载领料明细失败') |
|
|
this.$message.error(data.msg || '加载领料明细失败') |
|
|
@ -310,19 +322,27 @@ export default { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!this.issueNeedDate) { |
|
|
|
|
|
this.$message.warning('请先选择要求发料时间') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
const materialList = this.materialList.map(item => ({ |
|
|
const materialList = this.materialList.map(item => ({ |
|
|
rawMaterialId: item.rawMaterialId, |
|
|
rawMaterialId: item.rawMaterialId, |
|
|
applyNo: item.applyNo, |
|
|
applyNo: item.applyNo, |
|
|
issueQty: this.toNumber(item.issueQty) |
|
|
|
|
|
|
|
|
issueQty: this.toNumber(item.issueQty), |
|
|
|
|
|
// 业务要求:本次创建单据统一使用同一个要求发料时间 |
|
|
|
|
|
needDate: this.issueNeedDate |
|
|
})) |
|
|
})) |
|
|
|
|
|
|
|
|
this.createLoading = true |
|
|
this.createLoading = true |
|
|
createIssueOrder({ materialList }).then(({ data }) => { |
|
|
|
|
|
|
|
|
createIssueOrder({ materialList, planIssueDate: this.issueNeedDate }).then(({ data }) => { |
|
|
this.createLoading = false |
|
|
this.createLoading = false |
|
|
if (data && data.code === 0) { |
|
|
if (data && data.code === 0) { |
|
|
this.$message.success(`创建成功,领料单号:${data.issueNo}`) |
|
|
this.$message.success(`创建成功,领料单号:${data.issueNo}`) |
|
|
this.materialDialogVisible = false |
|
|
this.materialDialogVisible = false |
|
|
this.materialList = [] |
|
|
this.materialList = [] |
|
|
|
|
|
this.issueNeedDate = '' |
|
|
this.getDataList() |
|
|
this.getDataList() |
|
|
} else { |
|
|
} else { |
|
|
this.$message.error(data.msg || '创建失败') |
|
|
this.$message.error(data.msg || '创建失败') |
|
|
@ -558,6 +578,31 @@ export default { |
|
|
background-color: #F5F7FA !important; |
|
|
background-color: #F5F7FA !important; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.exp-issue-page .material-form { |
|
|
|
|
|
margin-bottom: 8px; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.exp-issue-page .material-form >>> .material-need-date-item { |
|
|
|
|
|
display: flex; |
|
|
|
|
|
align-items: center; |
|
|
|
|
|
margin-bottom: 8px; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.exp-issue-page .material-form >>> .material-need-date-item .el-form-item__label { |
|
|
|
|
|
float: none; |
|
|
|
|
|
line-height: 32px; |
|
|
|
|
|
padding: 0 8px 0 0; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.exp-issue-page .material-form >>> .material-need-date-item .el-form-item__content { |
|
|
|
|
|
line-height: 32px; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.exp-issue-page .material-form >>> .material-need-date-item .el-input__inner { |
|
|
|
|
|
height: 32px; |
|
|
|
|
|
line-height: 32px; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
.exp-issue-page .material-table { |
|
|
.exp-issue-page .material-table { |
|
|
background-color: #FFFFFF; |
|
|
background-color: #FFFFFF; |
|
|
border-radius: 4px; |
|
|
border-radius: 4px; |
|
|
|