5 changed files with 661 additions and 7 deletions
-
19src/api/erf/erf.js
-
623src/views/modules/erf/expIssueList.vue
-
8src/views/modules/orderIssure/soIssueNotify/searchConfirmIssureNotify.vue
-
8src/views/modules/orderIssure/soIssueNotify/searchIssureNotify.vue
-
8src/views/modules/orderIssure/soIssueNotify/searchIssureNotifyForCK.vue
@ -0,0 +1,623 @@ |
|||
<template> |
|||
<div class="mod-config exp-issue-page"> |
|||
<!-- 查询条件 --> |
|||
<el-form :inline="true" label-position="top" class="query-form"> |
|||
<el-form-item label="试验单号"> |
|||
<el-input v-model="searchData.applyNo" placeholder="支持模糊查询" clearable style="width: 160px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="试验名称"> |
|||
<el-input v-model="searchData.title" placeholder="支持模糊查询" clearable style="width: 180px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="项目编号"> |
|||
<el-input v-model="searchData.projectNo" placeholder="支持模糊查询" clearable style="width: 160px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="工单号"> |
|||
<el-input v-model="searchData.workOrderNo" placeholder="支持模糊查询" clearable style="width: 160px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="事业部"> |
|||
<el-select v-model="searchData.buNo" placeholder="请选择" clearable style="width: 120px"> |
|||
<el-option label="全部" value=""></el-option> |
|||
<el-option |
|||
v-for="item in buList" |
|||
:key="item.buNo" |
|||
:label="item.buDesc" |
|||
:value="item.buNo"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label=" " style="margin-top: -11px"> |
|||
<el-button class="search-btn" type="primary" plain @click="getDataList('Y')">查询</el-button> |
|||
<el-button class="reset-btn" plain @click="resetQuery">重置</el-button> |
|||
<el-button |
|||
class="create-btn" |
|||
type="success" |
|||
plain |
|||
:disabled="selectedRows.length === 0" |
|||
@click="openCreateDialog"> |
|||
生成领料单 |
|||
</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
|
|||
<!-- 主表 --> |
|||
<el-table |
|||
ref="dataTable" |
|||
:data="dataList" |
|||
v-loading="dataListLoading" |
|||
border :height="tableHeight" |
|||
class="data-table" |
|||
style="width: 100%;" |
|||
@selection-change="handleSelectionChange"> |
|||
<el-table-column type="selection" width="55" align="center"></el-table-column> |
|||
<el-table-column prop="buDesc" label="事业部" width="90" align="center" header-align="center"></el-table-column> |
|||
<el-table-column prop="applyNo" label="试验单号" width="140" align="center" header-align="center"></el-table-column> |
|||
<el-table-column prop="title" label="试验名称" min-width="180" align="left" header-align="center" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="projectNo" label="项目编号" width="120" align="center" header-align="center"></el-table-column> |
|||
<el-table-column prop="workOrderNo" label="工单号" width="180" align="center" header-align="center" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="scheduledDate" label="排产日期" width="120" align="center" header-align="center"></el-table-column> |
|||
<el-table-column prop="projectLeader" label="试验负责人" width="120" align="center" header-align="center"></el-table-column> |
|||
<el-table-column prop="rawMaterialCount" label="原材料条数" width="100" align="center" header-align="center"></el-table-column> |
|||
<el-table-column prop="status" label="状态" width="100" align="center" header-align="center"></el-table-column> |
|||
</el-table> |
|||
|
|||
<el-pagination |
|||
@size-change="sizeChangeHandle" |
|||
@current-change="currentChangeHandle" |
|||
:current-page="pageIndex" |
|||
:page-sizes="[20, 50, 100]" |
|||
:page-size="pageSize" |
|||
:total="totalPage" |
|||
layout="total, sizes, prev, pager, next, jumper" |
|||
style="margin-top: 10px; text-align: right;"> |
|||
</el-pagination> |
|||
|
|||
<!-- 物料确认弹窗 --> |
|||
<el-dialog |
|||
title="确认领料数量" |
|||
:visible.sync="materialDialogVisible" |
|||
width="88%" |
|||
:close-on-click-modal="false" |
|||
v-drag> |
|||
<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> |
|||
<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"> |
|||
<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"> |
|||
<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"> |
|||
<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"> |
|||
<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> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="umid" label="单位" width="80" align="center" header-align="center"></el-table-column> |
|||
</el-table> |
|||
|
|||
<div slot="footer" class="dialog-footer" style="margin-top: 20px"> |
|||
<el-button @click="materialDialogVisible = false" :disabled="createLoading">取消</el-button> |
|||
<el-button class="create-btn" |
|||
type="success" @click="submitCreateIssue" :loading="createLoading"> |
|||
{{ createLoading ? '创建中...' : '确定创建' }} |
|||
</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { getBuList } from '@/api/factory/site' |
|||
import { searchScheduledApplyList, getIssueMaterialPreview, createIssueOrder } from '@/api/erf/erf' |
|||
|
|||
export default { |
|||
name: 'ExpIssueList', |
|||
|
|||
data() { |
|||
return { |
|||
buList: [], |
|||
searchData: { |
|||
applyNo: '', |
|||
title: '', |
|||
projectNo: '', |
|||
workOrderNo: '', |
|||
buNo: '', |
|||
page: 1, |
|||
limit: 20 |
|||
}, |
|||
dataList: [], |
|||
selectedRows: [], |
|||
pageIndex: 1, |
|||
pageSize: 20, |
|||
totalPage: 0, |
|||
dataListLoading: false, |
|||
// 表格高度 |
|||
tableHeight: (window.innerHeight - 260), |
|||
materialDialogVisible: false, |
|||
materialList: [], |
|||
createLoading: false |
|||
} |
|||
}, |
|||
|
|||
activated() { |
|||
this.loadBuList() |
|||
this.getDataList() |
|||
}, |
|||
|
|||
methods: { |
|||
/** |
|||
* 加载事业部 |
|||
*/ |
|||
loadBuList() { |
|||
const tempData = { site: this.$store.state.user.site } |
|||
getBuList(tempData).then(({ data }) => { |
|||
if (data && data.code === 0) { |
|||
this.buList = data.row1 || [] |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
/** |
|||
* 查询已排产试验单 |
|||
*/ |
|||
getDataList(flag) { |
|||
if (flag === 'Y') { |
|||
this.pageIndex = 1 |
|||
} |
|||
this.searchData.page = this.pageIndex |
|||
this.searchData.limit = this.pageSize |
|||
this.dataListLoading = true |
|||
|
|||
searchScheduledApplyList(this.searchData).then(({ data }) => { |
|||
this.dataListLoading = false |
|||
if (data && data.code === 0) { |
|||
this.dataList = data.page.list || [] |
|||
this.totalPage = data.page.totalCount || 0 |
|||
this.clearSelection() |
|||
} else { |
|||
this.dataList = [] |
|||
this.totalPage = 0 |
|||
this.$message.error(data.msg || '查询失败') |
|||
} |
|||
}).catch(() => { |
|||
this.dataListLoading = false |
|||
this.$message.error('查询异常') |
|||
}) |
|||
}, |
|||
|
|||
/** |
|||
* 重置查询 |
|||
*/ |
|||
resetQuery() { |
|||
this.searchData = { |
|||
applyNo: '', |
|||
title: '', |
|||
projectNo: '', |
|||
workOrderNo: '', |
|||
buNo: '', |
|||
page: 1, |
|||
limit: 20 |
|||
} |
|||
this.getDataList('Y') |
|||
}, |
|||
|
|||
/** |
|||
* 表格勾选变化 |
|||
*/ |
|||
handleSelectionChange(selection) { |
|||
this.selectedRows = selection || [] |
|||
}, |
|||
|
|||
/** |
|||
* 打开领料明细确认弹窗 |
|||
*/ |
|||
openCreateDialog() { |
|||
if (!this.selectedRows || this.selectedRows.length === 0) { |
|||
this.$message.warning('请先勾选试验单') |
|||
return |
|||
} |
|||
const applyNoList = this.selectedRows.map(item => item.applyNo) |
|||
getIssueMaterialPreview({ applyNoList }).then(({ data }) => { |
|||
if (data && data.code === 0) { |
|||
const list = data.list || [] |
|||
if (list.length === 0) { |
|||
this.$message.warning('勾选试验单无可申请数量,无法生成领料单') |
|||
return |
|||
} |
|||
const normalizedList = list.map(item => { |
|||
const requiredQty = this.toNumber(item.requiredQty) |
|||
const issuedQty = this.toNumber(item.issuedQty) |
|||
const availableQty = this.toPositive(requiredQty - issuedQty) |
|||
let issueQty = item.issueQty |
|||
if (issueQty === null || issueQty === undefined || issueQty === '') { |
|||
issueQty = availableQty |
|||
} |
|||
issueQty = this.toNumber(issueQty) |
|||
if (issueQty > availableQty) { |
|||
issueQty = availableQty |
|||
} |
|||
return { |
|||
...item, |
|||
requiredQty, |
|||
issuedQty, |
|||
availableQty, |
|||
issueQty |
|||
} |
|||
}) |
|||
const availableList = normalizedList.filter(item => this.toNumber(item.availableQty) > 0) |
|||
if (availableList.length === 0) { |
|||
this.$message.warning('勾选试验单无可申请数量,无法生成领料单') |
|||
return |
|||
} |
|||
this.materialList = availableList |
|||
this.materialDialogVisible = true |
|||
} else { |
|||
this.$message.error(data.msg || '加载领料明细失败') |
|||
} |
|||
}).catch(() => { |
|||
this.$message.error('加载领料明细异常') |
|||
}) |
|||
}, |
|||
|
|||
/** |
|||
* 创建领料单 |
|||
*/ |
|||
submitCreateIssue() { |
|||
if (!this.materialList || this.materialList.length === 0) { |
|||
this.$message.warning('领料明细不能为空') |
|||
return |
|||
} |
|||
|
|||
const invalidItem = this.materialList.find(item => this.toNumber(item.issueQty) <= 0) |
|||
if (invalidItem) { |
|||
this.$message.warning(`试验单${invalidItem.applyNo}存在本次领料数量小于等于0的记录`) |
|||
return |
|||
} |
|||
|
|||
const overItem = this.materialList.find(item => this.toNumber(item.issueQty) > this.toNumber(item.availableQty)) |
|||
if (overItem) { |
|||
this.$message.warning(`试验单${overItem.applyNo}的本次领料数量不能超过可申请数量`) |
|||
return |
|||
} |
|||
|
|||
const materialList = this.materialList.map(item => ({ |
|||
rawMaterialId: item.rawMaterialId, |
|||
applyNo: item.applyNo, |
|||
issueQty: this.toNumber(item.issueQty) |
|||
})) |
|||
|
|||
this.createLoading = true |
|||
createIssueOrder({ materialList }).then(({ data }) => { |
|||
this.createLoading = false |
|||
if (data && data.code === 0) { |
|||
this.$message.success(`创建成功,领料单号:${data.issueNo}`) |
|||
this.materialDialogVisible = false |
|||
this.materialList = [] |
|||
this.getDataList() |
|||
} else { |
|||
this.$message.error(data.msg || '创建失败') |
|||
} |
|||
}).catch(() => { |
|||
this.createLoading = false |
|||
this.$message.error('创建异常') |
|||
}) |
|||
}, |
|||
|
|||
/** |
|||
* 清空表格勾选 |
|||
*/ |
|||
clearSelection() { |
|||
this.selectedRows = [] |
|||
this.$nextTick(() => { |
|||
if (this.$refs.dataTable && this.$refs.dataTable.clearSelection) { |
|||
this.$refs.dataTable.clearSelection() |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
/** |
|||
* 每页条数变化 |
|||
*/ |
|||
sizeChangeHandle(val) { |
|||
this.pageSize = val |
|||
this.pageIndex = 1 |
|||
this.getDataList() |
|||
}, |
|||
|
|||
/** |
|||
* 页码变化 |
|||
*/ |
|||
currentChangeHandle(val) { |
|||
this.pageIndex = val |
|||
this.getDataList() |
|||
}, |
|||
|
|||
/** |
|||
* 数值格式化显示 |
|||
*/ |
|||
formatQty(value) { |
|||
return this.toNumber(value).toString() |
|||
}, |
|||
|
|||
/** |
|||
* 转数字 |
|||
*/ |
|||
toNumber(value) { |
|||
const num = Number(value) |
|||
return Number.isNaN(num) ? 0 : num |
|||
}, |
|||
|
|||
/** |
|||
* 正数兜底 |
|||
*/ |
|||
toPositive(value) { |
|||
const num = this.toNumber(value) |
|||
return num < 0 ? 0 : num |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.mod-config { |
|||
} |
|||
|
|||
.el-form { |
|||
margin-bottom: 10px; |
|||
} |
|||
|
|||
.dialog-footer { |
|||
text-align: center; |
|||
} |
|||
|
|||
.exp-issue-page .query-form { |
|||
background-color: #FFFFFF; |
|||
padding: 15px 15px 5px 15px; |
|||
border-radius: 4px; |
|||
} |
|||
|
|||
.exp-issue-page .query-form >>> .el-form-item__label { |
|||
color: #333333; |
|||
font-size: 13px; |
|||
padding-bottom: 5px; |
|||
} |
|||
|
|||
.exp-issue-page .query-form >>> .el-input__inner { |
|||
height: 32px; |
|||
line-height: 32px; |
|||
border-radius: 4px; |
|||
border: 1px solid #DCDFE6; |
|||
font-size: 13px; |
|||
} |
|||
|
|||
.exp-issue-page .query-form >>> .el-input__inner::placeholder { |
|||
color: #C0C4CC; |
|||
font-size: 13px; |
|||
} |
|||
|
|||
.exp-issue-page .query-form >>> .el-select .el-input__inner { |
|||
border-radius: 4px; |
|||
} |
|||
|
|||
.exp-issue-page .query-form >>> .el-date-editor .el-input__inner { |
|||
border-radius: 4px; |
|||
} |
|||
|
|||
.exp-issue-page >>> .el-button { |
|||
height: 32px; |
|||
padding: 0 15px; |
|||
font-size: 13px; |
|||
border-radius: 4px; |
|||
} |
|||
|
|||
.exp-issue-page .search-btn { |
|||
background-color: #ECF5FF; |
|||
border-color: #B3D8FF; |
|||
color: #409EFF; |
|||
} |
|||
|
|||
.exp-issue-page .search-btn:hover { |
|||
background-color: #409EFF; |
|||
border-color: #409EFF; |
|||
color: #FFFFFF; |
|||
} |
|||
|
|||
.exp-issue-page .reset-btn { |
|||
background-color: #F5F7FA; |
|||
border-color: #D3D4D6; |
|||
color: #606266; |
|||
} |
|||
|
|||
.exp-issue-page .reset-btn:hover { |
|||
background-color: #909399; |
|||
border-color: #909399; |
|||
color: #FFFFFF; |
|||
} |
|||
|
|||
.exp-issue-page .create-btn { |
|||
background-color: #F0F9FF; |
|||
border-color: #C0E6C7; |
|||
color: #67C23A; |
|||
} |
|||
|
|||
.exp-issue-page .create-btn:hover:not(:disabled) { |
|||
background-color: #67C23A; |
|||
border-color: #67C23A; |
|||
color: #FFFFFF; |
|||
} |
|||
|
|||
.exp-issue-page .el-button:disabled { |
|||
opacity: 0.5; |
|||
cursor: not-allowed; |
|||
} |
|||
|
|||
.exp-issue-page .data-table { |
|||
background-color: #FFFFFF; |
|||
border-radius: 4px; |
|||
} |
|||
|
|||
.exp-issue-page .data-table >>> .el-table__header-wrapper th { |
|||
background-color: #F5F7FA !important; |
|||
color: #333333; |
|||
font-weight: 600; |
|||
font-size: 16px; |
|||
border-color: #EBEEF5; |
|||
padding: 10px 0; |
|||
height: auto; |
|||
} |
|||
|
|||
.exp-issue-page .data-table >>> .el-table__fixed-header-wrapper th { |
|||
background-color: #F5F7FA !important; |
|||
color: #333333; |
|||
font-weight: 600; |
|||
font-size: 16px; |
|||
border-color: #EBEEF5; |
|||
padding: 12px 0; |
|||
height: auto; |
|||
} |
|||
|
|||
.exp-issue-page .data-table >>> .el-table__header-wrapper .cell { |
|||
text-align: center; |
|||
padding: 0 10px; |
|||
overflow: hidden; |
|||
text-overflow: ellipsis; |
|||
white-space: nowrap; |
|||
font-size: 13px !important; |
|||
} |
|||
|
|||
.exp-issue-page .data-table >>> .el-table__fixed-header-wrapper .cell { |
|||
text-align: center; |
|||
padding: 0 10px; |
|||
overflow: hidden; |
|||
text-overflow: ellipsis; |
|||
white-space: nowrap; |
|||
} |
|||
|
|||
.exp-issue-page .data-table >>> .el-table__body-wrapper td { |
|||
border-color: #EBEEF5; |
|||
padding: 12px 0; |
|||
font-size: 16px; |
|||
color: #606266; |
|||
height: auto; |
|||
} |
|||
|
|||
.exp-issue-page .data-table >>> .el-table__fixed-body-wrapper td { |
|||
border-color: #EBEEF5; |
|||
padding: 12px 0; |
|||
font-size: 16px; |
|||
color: #606266; |
|||
height: auto; |
|||
} |
|||
|
|||
.exp-issue-page .data-table >>> .el-table__body-wrapper .cell { |
|||
padding: 0 10px; |
|||
overflow: hidden; |
|||
text-overflow: ellipsis; |
|||
white-space: nowrap; |
|||
font-size: 13px !important; |
|||
} |
|||
|
|||
.exp-issue-page .data-table >>> .el-table__fixed-body-wrapper .cell { |
|||
padding: 0 10px; |
|||
overflow: hidden; |
|||
text-overflow: ellipsis; |
|||
white-space: nowrap; |
|||
} |
|||
|
|||
.exp-issue-page .data-table >>> .el-table__body tr:hover > td { |
|||
background-color: #F5F7FA !important; |
|||
} |
|||
|
|||
.exp-issue-page .material-table { |
|||
background-color: #FFFFFF; |
|||
border-radius: 4px; |
|||
} |
|||
|
|||
.exp-issue-page .material-table >>> .el-table__header-wrapper th { |
|||
background-color: #F5F7FA !important; |
|||
color: #333333; |
|||
font-weight: 600; |
|||
font-size: 16px; |
|||
border-color: #EBEEF5; |
|||
padding: 5px 0; |
|||
height: auto; |
|||
} |
|||
|
|||
.exp-issue-page .material-table >>> .el-table__header-wrapper .cell { |
|||
text-align: center; |
|||
padding: 0 10px; |
|||
overflow: hidden; |
|||
text-overflow: ellipsis; |
|||
white-space: nowrap; |
|||
font-size: 13px !important; |
|||
} |
|||
|
|||
.exp-issue-page .material-table >>> .el-table__body-wrapper td { |
|||
border-color: #EBEEF5; |
|||
padding: 6px 0; |
|||
font-size: 16px; |
|||
color: #606266; |
|||
height: auto; |
|||
} |
|||
|
|||
.exp-issue-page .material-table >>> .el-table__body-wrapper .cell { |
|||
padding: 0 10px; |
|||
overflow: hidden; |
|||
text-overflow: ellipsis; |
|||
white-space: nowrap; |
|||
font-size: 13px; |
|||
height: 20px; |
|||
} |
|||
|
|||
.exp-issue-page .material-table >>> .el-table__body tr:hover > td { |
|||
background-color: #F5F7FA !important; |
|||
} |
|||
|
|||
.exp-issue-page .material-table >>> .el-input-number--small { |
|||
line-height: 30px; |
|||
} |
|||
|
|||
.exp-issue-page .material-table >>> .el-input-number--small .el-input__inner { |
|||
height: 30px; |
|||
line-height: 30px; |
|||
} |
|||
|
|||
.dialog-tip { |
|||
margin-bottom: 10px; |
|||
color: #606266; |
|||
font-size: 13px; |
|||
background: #F5F7FA; |
|||
border-left: 3px solid #409EFF; |
|||
padding: 8px 10px; |
|||
} |
|||
</style> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue