Browse Source

要求发料时间

master
han\hanst 2 weeks ago
parent
commit
491d0221fc
  1. 93
      src/views/modules/erf/expIssueList.vue

93
src/views/modules/erf/expIssueList.vue

@ -75,54 +75,62 @@
<el-dialog
title="确认领料数量"
:visible.sync="materialDialogVisible"
width="88%"
width="70%"
:close-on-click-modal="false"
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
:data="materialList"
border
class="material-table"
max-height="58vh"
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">
{{ scope.row.partNo || '-' }}
</template>
</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">
{{ formatQty(scope.row.requiredQty) }}
</template>
</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">
{{ formatQty(scope.row.issuedQty) }}
</template>
</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">
{{ formatQty(scope.row.availableQty) }}
</template>
</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">
<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>
</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>
<div slot="footer" class="dialog-footer" style="margin-top: 20px">
@ -165,6 +173,7 @@ export default {
tableHeight: (window.innerHeight - 260),
materialDialogVisible: false,
materialList: [],
issueNeedDate: '',
createLoading: false
}
},
@ -271,7 +280,9 @@ export default {
requiredQty,
issuedQty,
availableQty,
issueQty
issueQty,
stockQty: this.toNumber(item.stockQty),
needDate: item.needDate
}
})
const availableList = normalizedList.filter(item => this.toNumber(item.availableQty) > 0)
@ -280,6 +291,7 @@ export default {
return
}
this.materialList = availableList
this.issueNeedDate = availableList[0].needDate
this.materialDialogVisible = true
} else {
this.$message.error(data.msg || '加载领料明细失败')
@ -310,19 +322,27 @@ export default {
return
}
if (!this.issueNeedDate) {
this.$message.warning('请先选择要求发料时间')
return
}
const materialList = this.materialList.map(item => ({
rawMaterialId: item.rawMaterialId,
applyNo: item.applyNo,
issueQty: this.toNumber(item.issueQty)
issueQty: this.toNumber(item.issueQty),
// 使
needDate: this.issueNeedDate
}))
this.createLoading = true
createIssueOrder({ materialList }).then(({ data }) => {
createIssueOrder({ materialList, planIssueDate: this.issueNeedDate }).then(({ data }) => {
this.createLoading = false
if (data && data.code === 0) {
this.$message.success(`创建成功,领料单号:${data.issueNo}`)
this.materialDialogVisible = false
this.materialList = []
this.issueNeedDate = ''
this.getDataList()
} else {
this.$message.error(data.msg || '创建失败')
@ -558,6 +578,31 @@ export default {
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 {
background-color: #FFFFFF;
border-radius: 4px;

Loading…
Cancel
Save