|
|
|
@ -212,6 +212,40 @@ |
|
|
|
style="width: 100px; height: 80px"/></span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<!-- rqrq - 材料明细指定物料:仅已下达申请单可维护标签/批次指定 --> |
|
|
|
<el-table-column |
|
|
|
fixed="right" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
width="110" |
|
|
|
label="操作"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<a type="text" size="small" v-if="currentRow && currentRow.status==='ISSUE'" @click="openNoOrderMaterialAllocDialog(scope.row)">指定物料</a> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-tab-pane> |
|
|
|
<!-- rqrq - 指定物料清单页签:展示当前申请单已保存的标签/批次指定,不含备注 --> |
|
|
|
<el-tab-pane label="指定物料清单" name="allocDetail"> |
|
|
|
<el-table |
|
|
|
:data="allocDetailList" |
|
|
|
:height="height" |
|
|
|
border |
|
|
|
v-loading="allocDetailLoading" |
|
|
|
style="width: 100%;"> |
|
|
|
<el-table-column prop="itemNo" label="订单序号" width="90" header-align="center" align="right"></el-table-column> |
|
|
|
<el-table-column prop="soorderNo" label="订单号" min-width="130" header-align="center" align="center"></el-table-column> |
|
|
|
<el-table-column label="bom行号" width="90" header-align="center" align="right"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.bOMItemNo || scope.row.bomItemNo || scope.row.BOMItemNo || scope.row.bomitemNo }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="partNo" label="物料编码" min-width="150" header-align="center" align="center"></el-table-column> |
|
|
|
<el-table-column prop="allocSeq" label="指定序号" width="90" header-align="center" align="right"></el-table-column> |
|
|
|
<el-table-column prop="allocTypeName" label="指定类型" width="90" header-align="center" align="center"></el-table-column> |
|
|
|
<el-table-column prop="serialNo" label="标签号" min-width="160" header-align="center" align="center"></el-table-column> |
|
|
|
<el-table-column prop="batchNo" label="批次号" min-width="140" header-align="center" align="center"></el-table-column> |
|
|
|
<el-table-column prop="allocQty" label="指定数量" width="100" header-align="center" align="right"></el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-tab-pane> |
|
|
|
<el-tab-pane label="材料汇总" name="sum"> |
|
|
|
@ -444,95 +478,179 @@ |
|
|
|
</el-footer> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!-- 库存预览模态框 --> |
|
|
|
<!-- 推送WCS预览弹窗只展示物料汇总与指定明细,标签集中在一个单元格内 - rqrq --> |
|
|
|
<el-dialog |
|
|
|
title="库存匹配预览" |
|
|
|
title="库存匹配情况预览" |
|
|
|
:visible.sync="previewDialogVisible" |
|
|
|
width="80%" |
|
|
|
:close-on-click-modal="false"> |
|
|
|
:close-on-click-modal="false" |
|
|
|
v-drag |
|
|
|
width="70%"> |
|
|
|
<!-- rqrq - 目的地只展示不编辑,口径与海安无订单查看页保持一致 --> |
|
|
|
<el-form :inline="true" label-position="left" style="margin-bottom: 10px;"> |
|
|
|
<el-form-item label="单据目的地:" style="margin-bottom: 0;"> |
|
|
|
<span style="font-weight: bold;"> |
|
|
|
{{ getAreaDisplayText(currentProductionArea) }} |
|
|
|
</span> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-table |
|
|
|
:data="previewData" |
|
|
|
border |
|
|
|
v-loading="previewLoading" |
|
|
|
style="width: 100%;" |
|
|
|
height="300" |
|
|
|
height="360" |
|
|
|
:row-class-name="getRowClassName"> |
|
|
|
<el-table-column |
|
|
|
prop="rowNo" |
|
|
|
label="行号" |
|
|
|
width="80" |
|
|
|
align="center"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="productionOrderNo" |
|
|
|
label="生产订单号" |
|
|
|
width="100" |
|
|
|
sortable |
|
|
|
align="center"> |
|
|
|
<el-table-column prop="soorderNo" label="订单号" width="130" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span v-if="scope.row.displayRowType !== 'SPECIFIED'">{{ scope.row.soorderNo }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="bomLineNo" |
|
|
|
label="BOM行号" |
|
|
|
width="100" |
|
|
|
sortable |
|
|
|
align="center"> |
|
|
|
<el-table-column prop="itemNo" label="订单序号" width="85" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span v-if="scope.row.displayRowType !== 'SPECIFIED'">{{ scope.row.itemNo }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="partNo" |
|
|
|
label="物料编码" |
|
|
|
width="100" |
|
|
|
sortable |
|
|
|
align="center"> |
|
|
|
<el-table-column prop="bomItemNo" label="BOM行号" width="85" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span v-if="scope.row.displayRowType !== 'SPECIFIED'">{{ scope.row.bomItemNo }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="requiredQty" |
|
|
|
label="需求数量" |
|
|
|
width="80" |
|
|
|
align="center"> |
|
|
|
<el-table-column prop="partNo" label="物料编码" min-width="145" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span v-if="scope.row.displayRowType !== 'SPECIFIED'">{{ scope.row.partNo }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="isWarehouseSatisfied" |
|
|
|
label="立库是否满足" |
|
|
|
width="100" |
|
|
|
align="center"> |
|
|
|
<el-table-column prop="specifiedContent" label="指定内容" min-width="180" align="left" show-overflow-tooltip> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span :style="{color: scope.row.isWarehouseSatisfied === 'Y' ? '#67C23A' : '#F56C6C'}"> |
|
|
|
{{ scope.row.isWarehouseSatisfied === 'Y' ? '是' : '否' }} |
|
|
|
<span v-if="scope.row.displayRowType === 'SPECIFIED'" class="specified-content"> |
|
|
|
{{ scope.row.specifiedContent }} |
|
|
|
</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="isOtherWarehouseSatisfied" |
|
|
|
label="分切仓库是否满足" |
|
|
|
width="120" |
|
|
|
align="center"> |
|
|
|
<el-table-column prop="requiredQty" label="需求数量" width="100" align="right"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span v-if="scope.row.isOtherWarehouseSatisfied" :style="{color: scope.row.isOtherWarehouseSatisfied === 'Y' ? '#67C23A' : '#F56C6C'}"> |
|
|
|
{{ scope.row.isOtherWarehouseSatisfied === 'Y' ? '是' : '否' }} |
|
|
|
</span> |
|
|
|
<span>{{ formatPreviewQty(scope.row.requiredQty) }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="matchedBarcodes" |
|
|
|
label="匹配条码" |
|
|
|
min-width="300" |
|
|
|
align="left" |
|
|
|
class-name="wrap-text-column"> |
|
|
|
<el-table-column prop="matchedQty" label="匹配数量" width="100" align="right"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div style="white-space: normal; word-break: break-all; line-height: 1.5;"> |
|
|
|
{{ scope.row.matchedBarcodes }} |
|
|
|
</div> |
|
|
|
<span>{{ formatPreviewQty(scope.row.matchedQty) }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="matchedSerialNos" label="标签号" min-width="360" align="left" class-name="wrap-text-column"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div class="matched-labels">{{ scope.row.matchedSerialNos }}</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<el-button type="primary" class="yzzButtonAn" @click="pushToWCS" :disabled="previewLoading"> |
|
|
|
{{ previewLoading ? '推送中...' : '推送至WCS' }} |
|
|
|
<el-button type="primary" class="yzzButtonAn" @click="pushToWCS" :loading="pushLoading" |
|
|
|
:disabled="previewLoading || pushLoading || !canPushPreview"> |
|
|
|
{{ pushLoading ? '推送中...' : '推送至WCS' }} |
|
|
|
</el-button> |
|
|
|
<el-button @click="previewDialogVisible = false" :disabled="previewLoading">关闭</el-button> |
|
|
|
<el-button @click="closePreviewDialog" :disabled="previewLoading || pushLoading">关闭</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!-- rqrq - 海安指定物料策略弹窗:维护单行物料批次/标签分配优先级 --> |
|
|
|
<el-dialog title="指定物料" :close-on-click-modal="false" v-drag :visible.sync="noOrderAllocDialogVisible" width="1100px"> |
|
|
|
<el-form :inline="true" label-position="top"> |
|
|
|
<el-form-item label="物料号"> |
|
|
|
<el-input v-model="noOrderAllocForm.partNo" disabled style="width: 160px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="物料描述"> |
|
|
|
<el-input v-model="noOrderAllocForm.partDesc" disabled style="width: 320px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="子站点"> |
|
|
|
<el-input v-model="noOrderAllocForm.subSite" disabled style="width: 100px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="申请数量"> |
|
|
|
<el-input v-model="noOrderAllocForm.qtyToIssue" disabled style="width: 120px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<div style="margin-bottom: 10px;"> |
|
|
|
<el-button type="primary" size="small" @click="addNoOrderAllocRow('LABEL')">新增标签指定</el-button> |
|
|
|
<el-button type="primary" size="small" @click="addNoOrderAllocRow('BATCH')">新增批次指定</el-button> |
|
|
|
<span style="margin-left: 10px; color: #909399; font-size: 12px;">保存后按当前列表顺序进行指定匹配</span> |
|
|
|
</div> |
|
|
|
<el-table :data="noOrderAllocForm.allocList" border v-loading="noOrderAllocLoading" height="360px" style="width: 100%;"> |
|
|
|
<el-table-column prop="rowNo" label="序号" width="60" align="center"></el-table-column> |
|
|
|
<el-table-column prop="allocType" label="类型" width="90" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.allocType === 'LABEL' ? '标签' : '批次' }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="标签号" min-width="160" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input |
|
|
|
v-if="scope.row.allocType === 'LABEL'" |
|
|
|
v-model="scope.row.serialNo" |
|
|
|
readonly |
|
|
|
placeholder="点击选择标签" |
|
|
|
@click.native="openNoOrderAvailableLabelDialog(scope.$index, 'LABEL')"> |
|
|
|
</el-input> |
|
|
|
<span v-else>-</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="批次号" min-width="140" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input |
|
|
|
v-if="scope.row.allocType === 'BATCH'" |
|
|
|
v-model="scope.row.batchNo" |
|
|
|
readonly |
|
|
|
placeholder="点击选择批次" |
|
|
|
@click.native="openNoOrderAvailableLabelDialog(scope.$index, 'BATCH')"> |
|
|
|
</el-input> |
|
|
|
<span v-else>-</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="指定数量" width="120" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input v-model="scope.row.allocQty" type="number" :min="0" :disabled="scope.row.allocType === 'LABEL'"></el-input> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column fixed="right" label="操作" width="200" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button type="text" size="small" @click="moveNoOrderAllocRow(scope.$index, -1)">上移</el-button> |
|
|
|
<el-button type="text" size="small" @click="moveNoOrderAllocRow(scope.$index, 1)">下移</el-button> |
|
|
|
<el-button type="text" size="small" @click="removeNoOrderAllocRow(scope.$index)">删除</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
<el-footer style="height:40px;margin-top: 10px;text-align:center"> |
|
|
|
<el-button type="primary" :loading="noOrderAllocSaving" :disabled="noOrderAllocSaving" @click="saveNoOrderMaterialAlloc">保存</el-button> |
|
|
|
<el-button :disabled="noOrderAllocSaving" @click="noOrderAllocDialogVisible = false">关闭</el-button> |
|
|
|
</el-footer> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!-- rqrq - 在库可用标签选择弹窗:双击回填指定行的标签号或批次号 --> |
|
|
|
<el-dialog |
|
|
|
:title="noOrderLabelPickMode === 'BATCH' ? '选择批次' : '选择标签'" |
|
|
|
:close-on-click-modal="false" |
|
|
|
append-to-body |
|
|
|
v-drag |
|
|
|
:visible.sync="noOrderLabelPickDialogVisible" |
|
|
|
width="980px"> |
|
|
|
<el-table |
|
|
|
:data="noOrderLabelPickList" |
|
|
|
border |
|
|
|
highlight-current-row |
|
|
|
height="420px" |
|
|
|
v-loading="noOrderLabelPickLoading" |
|
|
|
@row-dblclick="handleNoOrderAvailableLabelDblClick" |
|
|
|
style="width: 100%;"> |
|
|
|
<el-table-column prop="serialNo" label="标签号" min-width="160" align="center"></el-table-column> |
|
|
|
<el-table-column prop="qty" label="数量" width="90" align="center"></el-table-column> |
|
|
|
<el-table-column prop="batchNo" label="批次号" min-width="140" align="center"></el-table-column> |
|
|
|
<el-table-column prop="receiveDate" label="接收日期" min-width="160" align="center"></el-table-column> |
|
|
|
<el-table-column prop="expiredDate" label="失效日期" min-width="160" align="center"></el-table-column> |
|
|
|
<el-table-column prop="wdr" label="WDR" min-width="100" align="center"></el-table-column> |
|
|
|
</el-table> |
|
|
|
<el-footer style="height:40px;margin-top: 10px;text-align:center"> |
|
|
|
<el-button @click="noOrderLabelPickDialogVisible = false">关闭</el-button> |
|
|
|
</el-footer> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
@ -553,7 +671,11 @@ import { |
|
|
|
haiAnUpdateMaterialDetail, |
|
|
|
haiAnSaveMaterialDetail, |
|
|
|
haiAnCheckIssueNotifyInventory, |
|
|
|
haiAnPushInventoryToWcs |
|
|
|
haiAnPushInventoryToWcs, |
|
|
|
getNoOrderMaterialAllocList, |
|
|
|
saveNoOrderMaterialAllocList, |
|
|
|
getNoOrderAvailableInStockLabelList, |
|
|
|
getNoOrderMaterialAllocListByNotifyNo |
|
|
|
} from '@/api/haianWarehouse/poOrderIssueNotify.js' |
|
|
|
|
|
|
|
export default { |
|
|
|
@ -1408,7 +1530,39 @@ export default { |
|
|
|
// 预览相关数据 |
|
|
|
previewDialogVisible: false, |
|
|
|
previewLoading: false, |
|
|
|
pushLoading: false, |
|
|
|
previewData: [], |
|
|
|
previewSummary: { |
|
|
|
totalOrderCount: 0, |
|
|
|
completeOrderCount: 0, |
|
|
|
pushableOrderCount: 0, |
|
|
|
pushableOrderNos: [], |
|
|
|
completeOrderNos: [] |
|
|
|
}, |
|
|
|
currentNotifyRow: null, |
|
|
|
areaOptions: [], |
|
|
|
currentProductionArea: '', |
|
|
|
allocDetailList: [], |
|
|
|
allocDetailLoading: false, |
|
|
|
noOrderAllocDialogVisible: false, |
|
|
|
noOrderAllocLoading: false, |
|
|
|
noOrderAllocSaving: false, |
|
|
|
noOrderAllocForm: { |
|
|
|
site: this.$store.state.user.site, |
|
|
|
notifyNo: '', |
|
|
|
itemNo: '', |
|
|
|
bOMItemNo: '', |
|
|
|
partNo: '', |
|
|
|
partDesc: '', |
|
|
|
subSite: '', |
|
|
|
qtyToIssue: 0, |
|
|
|
allocList: [] |
|
|
|
}, |
|
|
|
noOrderLabelPickDialogVisible: false, |
|
|
|
noOrderLabelPickLoading: false, |
|
|
|
noOrderLabelPickList: [], |
|
|
|
noOrderLabelPickIndex: -1, |
|
|
|
noOrderLabelPickMode: 'LABEL', |
|
|
|
// 物料明细对话框相关数据 |
|
|
|
materialModalFlag: false, |
|
|
|
sobomList: [], |
|
|
|
@ -1447,6 +1601,14 @@ export default { |
|
|
|
// 补充海安标签扩展列,确保预留标签页签能展示海安增强字段 - rqrq |
|
|
|
this.haiAnEnsureLabelColumns() |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
/** |
|
|
|
* 只有服务端本次匹配判定的完整订单才允许确认推送,前端不自行按标签数量推断 - rqrq |
|
|
|
*/ |
|
|
|
canPushPreview () { |
|
|
|
return !this.previewLoading && !this.pushLoading && this.previewSummary.pushableOrderCount > 0 |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 每页数 |
|
|
|
sizeChangeHandle (val) { |
|
|
|
@ -2132,6 +2294,8 @@ export default { |
|
|
|
haiAnSearchNotifyLogCloseNew(queryData).then(({ data }) => { |
|
|
|
this.dataList6 = data && data.code === 0 ? (data.rows || []) : [] |
|
|
|
}) |
|
|
|
} else if (this.activeName === 'allocDetail') { |
|
|
|
this.searchNoOrderMaterialAllocListByNotifyNo() |
|
|
|
} else if (this.activeName === 'labelDetail') { |
|
|
|
haiAnSearchMaterialListDetail(queryData).then(({ data }) => { |
|
|
|
this.dataList7 = data && data.code === 0 ? (data.rows || []) : [] |
|
|
|
@ -2225,72 +2389,352 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 海安库存预览当前为占位实现,保留入口并给出待开发提示 - rqrq |
|
|
|
* 海安查看页WCS预览:服务端重新执行匹配,前端只展示物料汇总和指定明细 - rqrq |
|
|
|
* @param row 当前申请单主表行 - rqrq |
|
|
|
*/ |
|
|
|
previewInventory (row) { |
|
|
|
if (!row || !row.notifyNo) { |
|
|
|
this.$alert('请选择有效的海安申请单', '提示', {confirmButtonText: '确定'}) |
|
|
|
return |
|
|
|
} |
|
|
|
this.currentRow = row |
|
|
|
this.currentNotifyRow = JSON.parse(JSON.stringify(row)) |
|
|
|
this.currentProductionArea = row.productionArea || '' |
|
|
|
this.previewData = [] |
|
|
|
this.previewSummary = { |
|
|
|
totalOrderCount: 0, |
|
|
|
completeOrderCount: 0, |
|
|
|
pushableOrderCount: 0, |
|
|
|
pushableOrderNos: [], |
|
|
|
completeOrderNos: [] |
|
|
|
} |
|
|
|
this.previewDialogVisible = true |
|
|
|
this.previewLoading = true |
|
|
|
this.previewData = [] |
|
|
|
const inData = { |
|
|
|
site: this.$store.state.user.site, |
|
|
|
const queryData = { |
|
|
|
site: row.site || this.$store.state.user.site, |
|
|
|
notifyNo: row.notifyNo |
|
|
|
} |
|
|
|
haiAnCheckIssueNotifyInventory(inData).then(({ data }) => { |
|
|
|
this.previewLoading = false |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.previewData = data.rows || [] |
|
|
|
if (data.placeholder) { |
|
|
|
this.$message.warning(data.msg || '海安库存预览待开发') |
|
|
|
haiAnCheckIssueNotifyInventory(queryData) |
|
|
|
.then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.previewData = data.rows || [] |
|
|
|
if (!this.currentProductionArea && this.previewData.length) { |
|
|
|
const firstAreaRow = this.previewData.find(item => item.productionArea) |
|
|
|
this.currentProductionArea = firstAreaRow ? firstAreaRow.productionArea : '' |
|
|
|
} |
|
|
|
this.previewSummary = { |
|
|
|
totalOrderCount: data.totalOrderCount || 0, |
|
|
|
completeOrderCount: data.completeOrderCount || 0, |
|
|
|
pushableOrderCount: data.pushableOrderCount || 0, |
|
|
|
pushableOrderNos: data.pushableOrderNos || [], |
|
|
|
completeOrderNos: data.completeOrderNos || [] |
|
|
|
} |
|
|
|
if (data.placeholder) { |
|
|
|
this.$alert(data.msg || '该海安页面暂不执行真实库存匹配', '提示', {confirmButtonText: '确定'}) |
|
|
|
} else if (!this.previewData.length || !this.previewSummary.totalOrderCount) { |
|
|
|
this.$alert('服务端未返回有效匹配结果,本次不能推送', '提示', {confirmButtonText: '确定'}) |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.previewData = [] |
|
|
|
this.$alert((data && data.msg) || '库存匹配失败', '错误', {confirmButtonText: '确定'}) |
|
|
|
} |
|
|
|
return |
|
|
|
} |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
}).catch(() => { |
|
|
|
this.previewLoading = false |
|
|
|
this.$message.error('获取库存预览失败') |
|
|
|
}) |
|
|
|
.catch((error) => { |
|
|
|
this.previewData = [] |
|
|
|
this.$message.error((error && error.message) || '库存匹配请求失败') |
|
|
|
}) |
|
|
|
.finally(() => { |
|
|
|
this.previewLoading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 关闭预览时清理上次匹配结果,避免不同申请单之间误用摘要 - rqrq |
|
|
|
*/ |
|
|
|
closePreviewDialog (force) { |
|
|
|
if (!force && (this.previewLoading || this.pushLoading)) { |
|
|
|
return |
|
|
|
} |
|
|
|
this.previewDialogVisible = false |
|
|
|
this.previewData = [] |
|
|
|
this.previewSummary = { |
|
|
|
totalOrderCount: 0, |
|
|
|
completeOrderCount: 0, |
|
|
|
pushableOrderCount: 0, |
|
|
|
pushableOrderNos: [], |
|
|
|
completeOrderNos: [] |
|
|
|
} |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 目的地展示文本:有区域名称时拼编码+名称,没有则回退编码或未设置 - rqrq |
|
|
|
*/ |
|
|
|
getAreaDisplayText(areaId) { |
|
|
|
if (!areaId) return '未设置' |
|
|
|
const area = (this.areaOptions || []).find(item => item.areaId === areaId) |
|
|
|
if (area) { |
|
|
|
return area.areaId + ' - ' + area.areaDesc |
|
|
|
} |
|
|
|
return areaId |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 根据物料或指定明细自身的匹配结果设置颜色,失败统一标红 - rqrq |
|
|
|
*/ |
|
|
|
getRowClassName ({row}) { |
|
|
|
const classNames = [] |
|
|
|
if (row && row.displayRowType === 'SPECIFIED') classNames.push('specified-preview-row') |
|
|
|
if (row && row.matchStatus === 'FAILED') classNames.push('danger-row') |
|
|
|
if (row && row.matchStatus === 'MATCHED') classNames.push('success-row') |
|
|
|
return classNames.join(' ') |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 数量展示去除无意义尾零,空值统一显示0 - rqrq |
|
|
|
*/ |
|
|
|
formatPreviewQty (value) { |
|
|
|
if (value === null || value === undefined || value === '') return '0' |
|
|
|
return String(value).replace(/(\.\d*?[1-9])0+$|\.0+$/, '$1') |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 海安推送WCS当前为占位实现,仅提示待开发并不触发真实推送 - rqrq |
|
|
|
* 海安查看页确认推送:只提交site和notifyNo,实际订单和标签由服务端重新匹配决定 - rqrq |
|
|
|
*/ |
|
|
|
pushToWCS () { |
|
|
|
const validData = this.previewData || [] |
|
|
|
this.$confirm(`确认推送 ${validData.length} 条数据至WCS?`, '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
if (!this.canPushPreview || !this.currentNotifyRow) { |
|
|
|
this.$message.warning('当前没有可推送的完整订单') |
|
|
|
return |
|
|
|
} |
|
|
|
const orderNos = this.previewSummary.pushableOrderNos || [] |
|
|
|
const total = this.previewSummary.totalOrderCount || 0 |
|
|
|
const message = `共有${total}个订单,其中${orderNos.length}个订单完全匹配,本次只推送单据${orderNos.join('、')}` |
|
|
|
this.$confirm(message, '确认推送', { |
|
|
|
confirmButtonText: '确定推送', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
this.previewLoading = true |
|
|
|
const inData = { |
|
|
|
site: this.$store.state.user.site, |
|
|
|
notifyNo: this.currentRow.notifyNo, |
|
|
|
inventoryList: validData |
|
|
|
} |
|
|
|
haiAnPushInventoryToWcs(inData).then(({ data }) => { |
|
|
|
this.previewLoading = false |
|
|
|
this.pushLoading = true |
|
|
|
haiAnPushInventoryToWcs({ |
|
|
|
site: this.currentNotifyRow.site || this.$store.state.user.site, |
|
|
|
notifyNo: this.currentNotifyRow.notifyNo |
|
|
|
}).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message.warning(data.msg || '海安推送WCS待开发') |
|
|
|
this.previewDialogVisible = false |
|
|
|
return |
|
|
|
const result = data.row || {} |
|
|
|
this.$message.success(result.message || data.msg || '推送WCS成功') |
|
|
|
this.closePreviewDialog(true) |
|
|
|
this.searchTable() |
|
|
|
this.refreshCurrentTabTable() |
|
|
|
} else { |
|
|
|
this.$alert((data && data.msg) || '推送WCS失败', '错误', {confirmButtonText: '确定'}) |
|
|
|
} |
|
|
|
this.$alert(data.msg || '推送失败', '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
}).catch((error) => { |
|
|
|
this.previewLoading = false |
|
|
|
this.$message.error(error.message || '推送WCS失败,请重试') |
|
|
|
this.$message.error((error && error.message) || '推送WCS请求失败') |
|
|
|
}).finally(() => { |
|
|
|
this.pushLoading = false |
|
|
|
}) |
|
|
|
}).catch(() => {}) |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 兼容旧按钮入口,与新确认推送方法保持同一幂等防护 - rqrq |
|
|
|
*/ |
|
|
|
pushToWcs () { |
|
|
|
return this.pushToWCS() |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 查询当前申请单指定物料清单:按site+notifyNo拉取全部指定行,不含备注 - rqrq |
|
|
|
*/ |
|
|
|
searchNoOrderMaterialAllocListByNotifyNo() { |
|
|
|
if (!this.currentRow || !this.currentRow.notifyNo) { |
|
|
|
this.allocDetailList = [] |
|
|
|
return |
|
|
|
} |
|
|
|
this.allocDetailLoading = true |
|
|
|
getNoOrderMaterialAllocListByNotifyNo({ |
|
|
|
site: this.currentRow.site || this.$store.state.user.site, |
|
|
|
notifyNo: this.currentRow.notifyNo, |
|
|
|
page: 1, |
|
|
|
limit: 20 |
|
|
|
}).then(({ data }) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.allocDetailList = data.rows || [] |
|
|
|
} else { |
|
|
|
this.allocDetailList = [] |
|
|
|
if (data && data.msg) { |
|
|
|
this.$alert(data.msg, '提示', { confirmButtonText: '确定' }) |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch((error) => { |
|
|
|
this.allocDetailList = [] |
|
|
|
this.$message.error(error.message || '查询指定物料清单失败') |
|
|
|
}).finally(() => { |
|
|
|
this.allocDetailLoading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 兼容旧入口的海安推送占位方法,避免历史按钮调用空指针 - rqrq |
|
|
|
* 打开指定物料策略弹窗:以订单行itemNo+BOM行号隔离当前物料;未下达不允许指定 - rqrq |
|
|
|
* @param row 材料明细页签中的物料行 |
|
|
|
*/ |
|
|
|
pushToWcs (row) { |
|
|
|
this.previewInventory(row) |
|
|
|
openNoOrderMaterialAllocDialog (row) { |
|
|
|
if (!this.currentRow || this.currentRow.status !== 'ISSUE') { |
|
|
|
this.$alert('未下达申请单不允许指定物料', '提示', { confirmButtonText: '确定' }) |
|
|
|
return |
|
|
|
} |
|
|
|
const parentItemNo = row.itemNo |
|
|
|
const bomItemNo = row.bOMItemNo || row.BOMItemNo || row.bomItemNo || row.bomitemNo |
|
|
|
if (parentItemNo == null || parentItemNo === '') { |
|
|
|
this.$alert('当前材料行缺少订单序号,无法指定物料', '提示', { confirmButtonText: '确定' }) |
|
|
|
return |
|
|
|
} |
|
|
|
if (!bomItemNo) { |
|
|
|
this.$alert('当前材料行缺少BOM行号,无法指定物料', '提示', { confirmButtonText: '确定' }) |
|
|
|
return |
|
|
|
} |
|
|
|
this.noOrderAllocForm = { |
|
|
|
site: this.$store.state.user.site, |
|
|
|
notifyNo: this.currentRow.notifyNo, |
|
|
|
itemNo: parentItemNo, |
|
|
|
bOMItemNo: bomItemNo, |
|
|
|
partNo: row.partNo || row.componentPartNo || '', |
|
|
|
partDesc: row.partDesc || row.componentPartDesc || '', |
|
|
|
subSite: row.subSite || (this.currentRow && this.currentRow.subSite) || this.$store.state.user.site, |
|
|
|
qtyToIssue: row.qtyToIssue == null || row.qtyToIssue === '' ? 0 : row.qtyToIssue, |
|
|
|
allocList: [] |
|
|
|
} |
|
|
|
this.noOrderAllocDialogVisible = true |
|
|
|
this.noOrderAllocLoading = true |
|
|
|
getNoOrderMaterialAllocList(this.noOrderAllocForm).then(({ data }) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.noOrderAllocForm.allocList = (data.rows || []).map((item, index) => ({ |
|
|
|
...item, |
|
|
|
rowNo: index + 1 |
|
|
|
})) |
|
|
|
} else { |
|
|
|
this.noOrderAllocForm.allocList = [] |
|
|
|
if (data && data.msg) { |
|
|
|
this.$alert(data.msg, '提示', { confirmButtonText: '确定' }) |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch((error) => { |
|
|
|
this.$message.error(error.message || '查询指定策略失败') |
|
|
|
this.noOrderAllocForm.allocList = [] |
|
|
|
}).finally(() => { |
|
|
|
this.noOrderAllocLoading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
/** 新增一条指定策略行:LABEL走标签指定,BATCH走批次指定 - rqrq */ |
|
|
|
addNoOrderAllocRow (allocType) { |
|
|
|
this.noOrderAllocForm.allocList.push({ |
|
|
|
allocType, |
|
|
|
serialNo: '', |
|
|
|
batchNo: '', |
|
|
|
allocQty: '', |
|
|
|
subSite: this.noOrderAllocForm.subSite, |
|
|
|
allocStatus: 'NEW', |
|
|
|
remark: '' |
|
|
|
}) |
|
|
|
this.refreshNoOrderAllocRowNo() |
|
|
|
}, |
|
|
|
openNoOrderAvailableLabelDialog (index, pickMode) { |
|
|
|
if (!this.noOrderAllocForm.subSite) { |
|
|
|
this.$alert('缺少子站点,无法查询在库标签', '提示', { confirmButtonText: '确定' }) |
|
|
|
return |
|
|
|
} |
|
|
|
if (!this.noOrderAllocForm.partNo) { |
|
|
|
this.$alert('缺少物料号,无法查询在库标签', '提示', { confirmButtonText: '确定' }) |
|
|
|
return |
|
|
|
} |
|
|
|
this.noOrderLabelPickIndex = index |
|
|
|
this.noOrderLabelPickMode = pickMode |
|
|
|
this.noOrderLabelPickList = [] |
|
|
|
this.noOrderLabelPickDialogVisible = true |
|
|
|
this.noOrderLabelPickLoading = true |
|
|
|
getNoOrderAvailableInStockLabelList({ |
|
|
|
site: this.$store.state.user.site, |
|
|
|
subSite: this.noOrderAllocForm.subSite, |
|
|
|
partNo: this.noOrderAllocForm.partNo, |
|
|
|
page: 1, |
|
|
|
limit: 20 |
|
|
|
}).then(({ data }) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.noOrderLabelPickList = data.rows || [] |
|
|
|
} else { |
|
|
|
this.noOrderLabelPickList = [] |
|
|
|
this.$alert((data && data.msg) || '查询在库可用标签失败', '提示', { confirmButtonText: '确定' }) |
|
|
|
} |
|
|
|
}).catch((error) => { |
|
|
|
this.noOrderLabelPickList = [] |
|
|
|
this.$message.error(error.message || '查询在库可用标签失败') |
|
|
|
}).finally(() => { |
|
|
|
this.noOrderLabelPickLoading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
handleNoOrderAvailableLabelDblClick (row) { |
|
|
|
const target = this.noOrderAllocForm.allocList[this.noOrderLabelPickIndex] |
|
|
|
if (!target) { |
|
|
|
this.$message.warning('未找到待回填的指定行') |
|
|
|
return |
|
|
|
} |
|
|
|
const labelQty = row.qty == null || row.qty === '' ? 0 : row.qty |
|
|
|
if (this.noOrderLabelPickMode === 'LABEL') { |
|
|
|
if (!row.serialNo) { |
|
|
|
this.$alert('所选行缺少标签号,无法指定', '提示', { confirmButtonText: '确定' }) |
|
|
|
return |
|
|
|
} |
|
|
|
target.serialNo = row.serialNo |
|
|
|
target.batchNo = '' |
|
|
|
target.allocQty = labelQty |
|
|
|
} else { |
|
|
|
if (!row.batchNo) { |
|
|
|
this.$alert('所选标签缺少批次号,无法指定批次', '提示', { confirmButtonText: '确定' }) |
|
|
|
return |
|
|
|
} |
|
|
|
target.serialNo = '' |
|
|
|
target.batchNo = row.batchNo |
|
|
|
target.allocQty = labelQty |
|
|
|
} |
|
|
|
this.noOrderLabelPickDialogVisible = false |
|
|
|
}, |
|
|
|
removeNoOrderAllocRow (index) { |
|
|
|
this.noOrderAllocForm.allocList.splice(index, 1) |
|
|
|
this.refreshNoOrderAllocRowNo() |
|
|
|
}, |
|
|
|
moveNoOrderAllocRow (index, step) { |
|
|
|
const targetIndex = index + step |
|
|
|
if (targetIndex < 0 || targetIndex >= this.noOrderAllocForm.allocList.length) { |
|
|
|
return |
|
|
|
} |
|
|
|
const rows = this.noOrderAllocForm.allocList |
|
|
|
const current = rows.splice(index, 1)[0] |
|
|
|
rows.splice(targetIndex, 0, current) |
|
|
|
this.refreshNoOrderAllocRowNo() |
|
|
|
}, |
|
|
|
refreshNoOrderAllocRowNo () { |
|
|
|
;(this.noOrderAllocForm.allocList || []).forEach((row, index) => { |
|
|
|
row.rowNo = index + 1 |
|
|
|
}) |
|
|
|
}, |
|
|
|
saveNoOrderMaterialAlloc () { |
|
|
|
if (!this.currentRow || this.currentRow.status !== 'ISSUE') { |
|
|
|
this.$alert('未下达申请单不允许指定物料', '提示', { confirmButtonText: '确定' }) |
|
|
|
return |
|
|
|
} |
|
|
|
this.refreshNoOrderAllocRowNo() |
|
|
|
const payload = JSON.parse(JSON.stringify(this.noOrderAllocForm)) |
|
|
|
payload.allocList = (payload.allocList || []).map((row) => ({ |
|
|
|
...row, |
|
|
|
allocQty: row.allocQty === '' || row.allocQty == null ? null : Number(row.allocQty) |
|
|
|
})) |
|
|
|
this.noOrderAllocSaving = true |
|
|
|
saveNoOrderMaterialAllocList(payload).then(({ data }) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message.success('指定策略保存成功') |
|
|
|
this.noOrderAllocDialogVisible = false |
|
|
|
this.searchNoOrderMaterialAllocListByNotifyNo() |
|
|
|
} else if (data) { |
|
|
|
this.$alert(data.msg || '保存失败', '提示', { confirmButtonText: '确定' }) |
|
|
|
} |
|
|
|
}).catch((error) => { |
|
|
|
this.$message.error(error.message || '保存指定策略失败') |
|
|
|
}).finally(() => { |
|
|
|
this.noOrderAllocSaving = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 海安取消下达流程:先检查未下达冲突,再执行取消并刷新列表 - rqrq |
|
|
|
*/ |
|
|
|
@ -2627,24 +3071,6 @@ export default { |
|
|
|
return data.page.list || [] |
|
|
|
} |
|
|
|
return [] |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 委外发料WCS预览:按海安复刻约束保持关闭,避免触发真实推送链路 - rqrq |
|
|
|
*/ |
|
|
|
previewInventory () { |
|
|
|
this.$message.warning('海安委外发料WCS推送功能暂不启用') |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 委外发料WCS推送:按复刻要求注掉推送,仅保留提示 - rqrq |
|
|
|
*/ |
|
|
|
pushToWCS () { |
|
|
|
this.$message.warning('海安委外发料WCS推送功能暂不启用') |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 兼容旧按钮入口:统一提示关闭,不触发后端推送接口 - rqrq |
|
|
|
*/ |
|
|
|
pushToWcs () { |
|
|
|
this.$message.warning('海安委外发料WCS推送功能暂不启用') |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
@ -2730,4 +3156,17 @@ export default { |
|
|
|
/deep/ .el-table .danger-row:hover > td { |
|
|
|
background-color: #fde2e2 !important; |
|
|
|
} |
|
|
|
|
|
|
|
/* 指定明细使用缩进和浅色文字形成物料行下展开的视觉关系 - rqrq */ |
|
|
|
/deep/ .el-table .specified-preview-row .specified-content { |
|
|
|
display: inline-block; |
|
|
|
padding-left: 18px; |
|
|
|
color: #606266; |
|
|
|
} |
|
|
|
|
|
|
|
/deep/ .matched-labels { |
|
|
|
white-space: normal; |
|
|
|
word-break: break-all; |
|
|
|
line-height: 1.5; |
|
|
|
} |
|
|
|
</style> |