|
|
<template> <div class="mod-config yzz"> <el-form label-position="top" style="margin-top: 1px; margin-left: 0px;"> <el-form :inline="true" label-position="top" style="margin-top: 0px"> <el-form-item :label="'申请单号'"> <el-input v-model="searchData.notifyNo" style="width: 120px"></el-input> </el-form-item> <el-form-item :label="'申请账号'"> <el-input v-model="searchData.userName" style="width: 120px"></el-input> </el-form-item> <el-form-item :label="'工单号'"> <el-input v-model="searchData.orderNo" style="width: 120px"></el-input> </el-form-item> <el-form-item label="状态" > <el-select v-model="searchData.status" placeholder="请选择" style="width: 120px"> <el-option label="全部" value=""></el-option> <el-option label="ISSUE" value="ISSUE"></el-option> <el-option label="CANCEL" value="CANCEL"></el-option> </el-select> </el-form-item> <el-form-item :label="'申请单日期'"> <el-date-picker style="width: 120px" v-model="searchData.startDate" type="date" value-format="yyyy-MM-dd" placeholder="选择日期"> </el-date-picker> </el-form-item> <el-form-item style="margin-top: 23px;"> <label style="margin-left: 0px;font-size: 19px">➞</label> </el-form-item> <el-form-item :label="' '"> <el-date-picker style="width: 120px" v-model="searchData.endDate" type="date" value-format="yyyy-MM-dd" placeholder="选择日期"> </el-date-picker> </el-form-item> <el-form-item label="推送WCS" > <el-select v-model="searchData.pushWcsFlag" placeholder="请选择" style="width: 120px"> <el-option label="全部" value=""></el-option> <el-option label="未推送" value="未推送"></el-option> <el-option label="部分推送" value="部分推送"></el-option> <el-option label="推送完成" value="推送完成"></el-option> <el-option label="出库完成" value="出库完成"></el-option> </el-select> </el-form-item> <el-form-item :label="' '"> <el-button type="primary" @click="searchTable()">查询</el-button> <!-- <el-button type="primary" @click="createNotifyModal()">新增</el-button> --> <download-excel :fields="fields()" :data="exportData" type="xls" :name="exportName" :header="exportHeader" :footer="exportFooter" :fetch="createExportData" :before-generate="startDownload" :before-finish="finishDownload" worksheet="导出信息" class="el-button el-button--primary el-button--medium"> {{ '导出' }} </download-excel> </el-form-item> </el-form> </el-form> <el-table :data="dataList" @row-click="changeData" :height="height" border highlight-current-row ref="mainTable" v-loading="dataListLoading" style="width: 100%; "> <el-table-column v-for="(item,index) in columnList1" :key="index" :sortable="item.columnSortable" :prop="item.columnProp" :header-align="item.headerAlign" :show-overflow-tooltip="item.showOverflowTooltip" :align="item.align" :fixed="item.fixed==''?false:item.fixed" :min-width="item.columnWidth" :label="item.columnLabel"> <template slot-scope="scope"> <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span> <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span> </template> </el-table-column> <el-table-column header-align="center" align="center" width="300" label="操作"> <template slot-scope="scope"> <a type="text" size="small" v-if="scope.row.status==='ISSUE'" @click="closeNotifyModel(scope.row)">关闭</a> <a type="text" size="small" v-if="scope.row.status==='CLOSED'" @click="openNotify(scope.row)">开启</a> <a type="text" size="small" v-if="scope.row.pushWcsFlag!=='出库完成'&&scope.row.pushWcsFlag!=='推送完成'&&scope.row.status==='ISSUE'" @click="previewInventory(scope.row)" style="margin-left: 10px;">推送WCS</a> <!-- rqrq - 取消下达按钮,只在状态为ISSUE且未推送WCS时显示 --> <a type="text" size="small" v-if="scope.row.status==='ISSUE'&&scope.row.pushWcsFlag==='未推送'" @click="cancelIssueNotifyHandle(scope.row)" style="margin-left: 10px;">取消下达</a> <!-- rqrq - 未推送才允许整单删除,后端会同时删指定物料 --> <a type="text" size="small" v-if="scope.row.pushWcsFlag==='未推送'" :style="{marginLeft: '10px', color: deleteWholeLoading ? '#C0C4CC' : '#F56C6C', cursor: deleteWholeLoading ? 'not-allowed' : 'pointer'}" @click="deleteUnpushedNotify(scope.row)">整单删除</a><!-- <a type="text" size="small" v-if="scope.row.pushWcsFlag!=='Y'" @click="pushToWcs(scope.row)" style="margin-left: 10px;">推送WCS</a>--> </template> </el-table-column> </el-table> <el-pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" :current-page="pageIndex" :page-sizes="[20, 50, 100, 1000]" :page-size="pageSize" :total="totalPage" layout="total, sizes, prev, pager, next, jumper"> </el-pagination>
<el-tabs style="font-size: 12px;min-height: 200px" class="customer-tab" v-model="activeName" type="border-card" @tab-click="tabClick"> <el-tab-pane label="申请单明细" name="detail"> <el-table :data="dataList2" :height="height" border v-loading="dataListLoading" style="width: 100%; "><!-- <el-table-column--><!-- header-align="center"--><!-- align="center"--><!-- width="80"--><!-- label="操作">--><!-- <template slot-scope="scope">--><!-- <a type="text" size="small" v-if="currentRow.status==='ISSUE'" @click="deleteNotifySOSPlus(scope.row)">删除</a>--><!-- </template>--><!-- </el-table-column>--> <el-table-column v-for="(item,index) in columnList2" :key="index" :sortable="item.columnSortable" :prop="item.columnProp" :header-align="item.headerAlign" :show-overflow-tooltip="item.showOverflowTooltip" :align="item.align" :fixed="item.fixed==''?false:item.fixed" :min-width="item.columnWidth" :label="item.columnLabel"> <template slot-scope="scope"> <!-- rqrq - 是否推送WCS特殊显示:Y显示绿色"是",否则显示灰色"否" --> <span v-if="item.columnProp === 'pushWmsFlag'" :style="{color: scope.row.pushWmsFlag === 'Y' ? '#67C23A' : '#909399'}"> {{ scope.row.pushWmsFlag === 'Y' ? '是' : '否' }} </span> <!-- rqrq - 立库取出特殊显示:Y显示绿色"是",否则显示灰色"否" --> <span v-else-if="item.columnProp === 'transportFlag'" :style="{color: scope.row.transportFlag === 'Y' ? '#67C23A' : '#909399'}"> {{ scope.row.transportFlag === 'Y' ? '是' : '否' }} </span> <!-- 普通列显示 --> <span v-else-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span> <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span> </template> </el-table-column> <!-- rqrq - 申请单明细操作列不冻结:弹窗/页签里fixed会额外叠表,表头出现空白格且操作列错位 --> <el-table-column header-align="center" align="center" width="120" label="操作"> <template slot-scope="scope"> <a type="text" size="small" v-if="scope.row.pushWmsFlag !== 'Y' && currentRow && currentRow.pushWcsFlag === '未推送'" @click="enterSOSDetail(scope.row)" style="margin-right: 10px;">修改</a> <a type="text" size="small" v-if="scope.row.pushWmsFlag !== 'Y' && currentRow && currentRow.pushWcsFlag === '未推送'" @click="deleteNotifySOSPlus(scope.row)">删除</a> </template> </el-table-column> </el-table>
</el-tab-pane> <el-tab-pane label="材料明细" name="sub"> <el-table :data="dataList3" :height="height" border :row-class-name="tableRowClassName" v-loading="dataListLoading" @row-dblclick="handleMaterialRowDblClick" style="width: 100%; ">
<!-- <el-table-column--><!-- header-align="center"--><!-- align="center"--><!-- width="80"--><!-- label="操作">--><!-- <template slot-scope="scope">--><!-- <a type="text" size="small" v-if="currentRow.status==='ISSUE'" @click="deleteNotifyMaterial(scope.row)">删除</a>-->
<!-- </template>--><!-- </el-table-column>--> <el-table-column v-for="(item,index) in columnList3" :key="index" :sortable="item.columnSortable" :prop="item.columnProp" :header-align="item.headerAlign" :show-overflow-tooltip="item.showOverflowTooltip" :align="item.align" :fixed="item.fixed==''?false:item.fixed" :min-width="item.columnWidth" :label="item.columnLabel"> <template slot-scope="scope"> <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span> <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span> </template> </el-table-column> <!-- rqrq - 材料明细指定物料:仅已下达申请单可维护标签/批次指定;不冻结,避免页签切换后操作列失真 --> <el-table-column header-align="center" align="center" width="110" label="操作"> <template slot-scope="scope"> <!-- 指定物料跟本行订单是否已推送WCS走,已推送的订单行不能再改分配 - rqrq --> <a type="text" size="small" v-if="canSpecifyMaterial(scope.row)" @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"> <el-table :data="dataList4" :height="height" border v-loading="dataListLoading" style="width: 100%; "> <!-- <el-table-column--> <!-- header-align="center"--> <!-- align="center"--> <!-- width="80"--> <!-- fixed="left"--> <!-- label="操作">--> <!-- <template slot-scope="scope">--> <!-- <a type="text" size="small" @click="printLabel(scope.row)">打印标签</a>--> <!-- </template>--> <!-- </el-table-column>--> <el-table-column v-for="(item,index) in columnList4" :key="index" :sortable="item.columnSortable" :prop="item.columnProp" :header-align="item.headerAlign" :show-overflow-tooltip="item.showOverflowTooltip" :align="item.align" :fixed="item.fixed==''?false:item.fixed" :min-width="item.columnWidth" :label="item.columnLabel"> <template slot-scope="scope"> <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span> <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span> </template> </el-table-column> </el-table> </el-tab-pane> <el-tab-pane label="预定标签清单" name="labelDetail"> <el-table :data="dataList7" :height="height" border v-loading="dataListLoading" style="width: 100%; "> <el-table-column v-for="(item,index) in columnList6" :key="index" :sortable="item.columnSortable" :prop="item.columnProp" :header-align="item.headerAlign" :show-overflow-tooltip="item.showOverflowTooltip" :align="item.align" :fixed="item.fixed==''?false:item.fixed" :min-width="item.columnWidth" :label="item.columnLabel"> <template slot-scope="scope"> <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span> <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span> </template> </el-table-column> </el-table> </el-tab-pane> </el-tabs>
<el-dialog title="关闭原因" :close-on-click-modal="false" v-drag :visible.sync="closeModalFlag" width="450px"> <el-form label-position="top" style="margin-top: 1px; margin-left: 0px;"> <el-row :gutter="20"> <el-col :span="24"> <el-form-item > <el-input type="textarea" v-model="closeData.closeRemark " :rows="3" resize='none' maxlength="200" show-word-limit style="height: 60px" > </el-input> </el-form-item> </el-col> </el-row> </el-form> <el-footer style="height:40px;margin-top: 60px;text-align:center"> <el-button type="primary" @click="closeNotify()">保存</el-button> <el-button type="primary" @click="closeModalFlag=false">关闭</el-button> </el-footer> </el-dialog>
<!-- 物料明细对话框 --> <el-dialog title="申请明细" :close-on-click-modal="false" v-drag :visible.sync="materialModalFlag" width="900px"> <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;"> <el-row :gutter="20"> <el-col :span="6"> <el-form-item :label="'生产订单号'"> <el-input v-model="sobomData.orderNo" disabled></el-input> </el-form-item> </el-col> <el-col :span="6"> <el-form-item :label="'产品编码'"> <el-input v-model="sobomData.partNo" disabled></el-input> </el-form-item> </el-col> </el-row> </el-form> <div class="yzzTable"> <el-table :height="400" :data="sobomList" border v-loading="bomLoadFlag" style="width: 100%;"> <el-table-column prop="componentPartNo" label="物料编码" sortable headerAlign="center" width="120" align="left"> </el-table-column> <el-table-column prop="componentPartDesc" label="物料描述" headerAlign="center" width="200" align="left" show-overflow-tooltip> </el-table-column> <el-table-column prop="qtyRequired" label="需求数量" headerAlign="center" width="100" align="right"> </el-table-column> <!-- rqrq - 新增可用库存列 --> <el-table-column prop="availableQty" label="可用库存" headerAlign="center" width="100" align="right"> <template slot-scope="scope"> <span :style="{fontWeight: 'bold', color: (scope.row.availableQty < scope.row.qtyRequired) ? '#F56C6C' : ''}"> {{ scope.row.availableQty }} </span> </template> </el-table-column> <el-table-column prop="qtyToIssue" label="本次申请数量" headerAlign="center" width="120" align="right"> <template slot-scope="scope"> <el-input v-model="scope.row.qtyToIssue" type="number" style="height: 11px; width: 98%;" :step="0" :min="0"></el-input> </template> </el-table-column> <el-table-column prop="remark" label="备注" headerAlign="center" width="200" align="left"> <template slot-scope="scope"> <el-input v-model="scope.row.remark" style="padding: 0;width: 100%"></el-input> </template> </el-table-column> <el-table-column prop="" header-align="center" align="center" min-width="80" label="操作"> <template slot-scope="scope"> <el-button type="primary" @click="qtyAllForBom(scope.row)" style="width: 100%">全数领料</el-button> </template> </el-table-column> </el-table> </div> <el-footer style="height:40px;margin-top: 10px;text-align:center"> <el-button type="primary" @click="saveMaterialDetail()">保存</el-button> <el-button type="primary" @click="materialModalFlag=false">关闭</el-button> </el-footer> </el-dialog>
<!-- 编辑材料明细对话框 --> <el-dialog title="编辑材料明细" :close-on-click-modal="false" v-drag :visible.sync="editMaterialModalFlag" width="600px"> <el-form :inline="true" label-position="top" label-width="120px" style="margin-top: 20px;"> <el-row> <el-col span="8"> <el-form-item label="申请单序号"> <el-input v-model="editMaterialData.itemNo" disabled></el-input> </el-form-item> </el-col> <el-col span="8"> <el-form-item label="材料编码"> <el-input v-model="editMaterialData.componentPartNo" disabled></el-input> </el-form-item> </el-col> <el-col span="8"> <el-form-item label="生产订单"> <el-input v-model="editMaterialData.soorderNo" disabled></el-input> </el-form-item> </el-col> </el-row> <el-row> <el-col span="8"> <el-form-item label="需求时间"> <el-input v-model="editMaterialData.needDate" disabled></el-input> </el-form-item> </el-col> <el-col span="8"> <el-form-item label="申请数量" required> <el-input v-model="editMaterialData.qtyToIssue" :min="0" style="width: 98%;" @input="value => editMaterialData.qtyToIssue = value .replace(/[^\d.]/g, '') .replace(/\.{2,}/g, '.') .replace(/^\./, '0.') .replace(/(\.\d{4}).*/, '$1') .replace(/^0+(?=\d)/, '0') .replace(/^0+(?=\.)/, '0')" ></el-input> </el-form-item> </el-col> <el-col span="8"> <el-form-item label="类型"> <el-input v-model="editMaterialData.issueType" disabled></el-input> </el-form-item> </el-col>
</el-row> </el-form> <el-footer style="height:40px;margin-top: 20px;text-align:center"> <el-button type="primary" @click="saveEditMaterialDetail()">保存</el-button> <el-button type="primary" @click="editMaterialModalFlag=false">关闭</el-button> </el-footer> </el-dialog>
<!-- 推送WCS预览弹窗只展示物料汇总与指定明细,标签集中在一个单元格内 - rqrq --> <el-dialog title="库存匹配情况预览" :visible.sync="previewDialogVisible" :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="360" :row-class-name="getRowClassName"> <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="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="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="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="specifiedContent" label="指定内容" min-width="180" align="left" show-overflow-tooltip> <template slot-scope="scope"> <span v-if="scope.row.displayRowType === 'SPECIFIED'" class="specified-content"> {{ scope.row.specifiedContent }} </span> </template> </el-table-column> <el-table-column prop="requiredQty" label="需求数量" width="100" align="right"> <template slot-scope="scope"> <span>{{ formatPreviewQty(scope.row.requiredQty) }}</span> </template> </el-table-column> <el-table-column prop="matchedQty" label="匹配数量" width="100" align="right"> <template slot-scope="scope"> <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-column prop="failureMessage" label="不可推送原因" min-width="240" align="left" show-overflow-tooltip> <template slot-scope="scope"> <!-- 服务端返回订单级阻断原因,避免库存数量满足但按钮禁用时现场无法判断处理方向 - rqrq --> <span v-if="scope.row.failureMessage || scope.row.failureCode" class="failure-message"> {{ formatFailureMessage(scope.row.failureMessage, scope.row.failureCode) }} </span> </template> </el-table-column> </el-table> <span slot="footer" class="dialog-footer"> <el-button type="primary" class="yzzButtonAn" @click="pushToWCS" :loading="pushLoading" :disabled="previewLoading || pushLoading || !canPushPreview"> {{ pushLoading ? '推送中...' : '推送至WCS' }} </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> <div class="rq"> <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> <!-- rqrq - 指定物料弹窗操作列不冻结:弹窗内fixed会与输入行高冲突,出现空白列和末行裁切 --> <el-table-column 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> </div> <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="1280px"> <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" show-overflow-tooltip></el-table-column> <el-table-column prop="palletId" label="所在托盘号" min-width="140" align="center" sortable show-overflow-tooltip></el-table-column> <el-table-column prop="position" label="位置号" min-width="90" align="center"></el-table-column> <el-table-column prop="layer" label="层数" width="80" align="center"></el-table-column> <el-table-column prop="qty" label="数量" width="100" align="center" sortable :formatter="formatNoOrderPickQty"></el-table-column> <el-table-column prop="batchNo" label="批次号" min-width="140" align="center" show-overflow-tooltip></el-table-column> <el-table-column prop="receiveDate" label="接收日期" min-width="160" align="center" sortable></el-table-column> <el-table-column prop="expiredDate" label="失效日期" min-width="160" align="center" sortable></el-table-column> <el-table-column prop="wdr" label="WDR" min-width="100" align="center" show-overflow-tooltip></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>
<script>import { haiAnSearchNotifyHeaderNew, haiAnSearchNotifyOrderListNew, haiAnSearchNotifyMaterialListNew, haiAnSearchSumNotifyMaterialListNew, haiAnSearchMaterialListDetail, haiAnSearchNotifyLogNew, haiAnSearchNotifyLogCloseNew, haiAnUpdateNotifyStatusNew, haiAnCheckUserHasUnissueShopOrder, haiAnCancelIssueNotify, haiAnDeleteNotifySOSPlus, haiAnDeleteUnpushedNotify, haiAnUpdateMaterialDetail, haiAnGetSOSBOMForIssureNew, haiAnSaveMaterialDetail, haiAnCheckIssueNotifyInventory, haiAnPushInventoryToWcs, getNoOrderMaterialAllocList, saveNoOrderMaterialAllocList, getNoOrderAvailableInStockLabelList, getNoOrderMaterialAllocListByNotifyNo} from '@/api/haianWarehouse/searchIssureNotify.js'import { showHaianWcsPushResult } from '@/utils/haianWcsPushResult'import { haiAnGetAreaList } from '@/api/haianWarehouse/warehousePallet.js'
export default { name: 'searchIssureNotify54',
data() { return { height:200, activeName: 'detail', dataList: [], dataList2: [], dataList3: [], dataList4: [], dataList5: [], dataList6: [], dataList7: [], // 预定标签清单数据 - rqrq
userBuList:[], createNotifyFlag: false, saveOrderDetailFlag: false, closeData:{ site:'', notifyNo:'', closeRemark:'', username:this.$store.state.user.name, }, closeModalFlag:false, searchData: { page: 1, limit: 100, site:'', userName: '', notifyNo: '', status: '', pushWcsFlag: '', // rqrq - 推送WCS筛选条件
loginUserName: this.$store.state.user.name, startDate: this.dayjs().format("YYYY-MM-DD"), endDate: this.dayjs().format("YYYY-MM-DD"), issueStartDate:this.dayjs().format("YYYY-MM-DD"), issueEndDate: this.dayjs().format("YYYY-MM-DD")+" 23:59:59", sql: "", orderNo: "", orderType: 'shoporder', // rqrq - 默认查询shoporder类型
}, notifyData:{ site: '', bu: '', notifyNo: '', notifyDate: '', enteredDate: '', userName: this.$store.state.user.name, userDisplay: '', remark: '', planIssueDate: '', outWorkOrderFlag: false, }, pageIndex: 1, pageSize: 100, totalPage: 0, //工单分页
co_pageIndex: 1, co_pageSize: 100, co_totalPage: 0, dataListLoading: false, currentRow:'', columnList1:[ { userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table1NotifyNo', tableId: "701002Table1", tableName: "领料申请主表", columnProp: "notifyNo", headerAlign: "center", align: "center", columnLabel: "申请单单号", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 100 },{ userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table1NotifyDate', tableId: "701002Table1", tableName: "领料申请主表", columnProp: "notifyDate", headerAlign: "center", align: "center", columnLabel: "申请日期", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 100 }, { userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table1UserName', tableId: "701002Table1", tableName: "领料申请主表", columnProp: "username", headerAlign: "center", align: "left", columnLabel: "申请账号", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 100 },{ userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table1EnteredDate', tableId: "701002Table1", tableName: "领料申请主表", columnProp: "enteredDate", headerAlign: "center", align: "center", columnLabel: "录入时间", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 120 },{ userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table1Status', tableId: "701002Table1", tableName: "领料申请主表", columnProp: "status", headerAlign: "center", align: "left", columnLabel: "状态", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 80 },{ userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table1ConfirmStatus', tableId: "701002Table1", tableName: "领料申请主表", columnProp: "confirmStatus", headerAlign: "center", align: "center", columnLabel: "确认状态", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 80 },{ userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table1WcsPushFlag', tableId: "701002Table1", tableName: "领料申请主表", columnProp: "pushWcsFlag", headerAlign: "center", align: "left", columnLabel: "推送WCS", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 80 },{ userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table1Remark', tableId: "701002Table1", tableName: "领料申请主表", columnProp: "remark", headerAlign: "center", align: "left", columnLabel: "备注", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 200 }, ], columnList2:[ { userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table2ItemNo', tableId: "701002Table2", tableName: "申请单派工单明细表", columnProp: "itemNo", headerAlign: "center", align: "right", columnLabel: "序号", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 40 }, { userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table2SubSite', tableId: "701002Table2", tableName: "申请单派工单明细表", columnProp: "subSite", headerAlign: "center", align: "center", columnLabel: "工厂编号", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 90 }, { userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table2NeedDate', tableId: "701002Table2", tableName: "领料申请派工单子表", columnProp: 'needDate', headerAlign: "center", align: "left", columnLabel: '要求发料时间', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 80, }, { userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table2PushWcsTime', tableId: "701002Table2", tableName: "领料申请派工单子表", columnProp: 'pushWcsTime', headerAlign: "center", align: "center", columnLabel: '推送WCS时间', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 130, }, { userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table2SOOrderNo', tableId: "701002Table2", tableName: "申请单派工单明细表", columnProp: "soorderNo", headerAlign: "center", align: "left", columnLabel: "生产订单", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 120 }, { userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table2FGPartNo', tableId: "701002Table2", tableName: "申请单派工单明细表", columnProp: "fgPartNo", headerAlign: "center", align: "left", columnLabel: "工单物料", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 80
}, { userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table2ReleaseNo', tableId: "701002Table2", tableName: "申请单派工单明细表", columnProp: "releaseNo", headerAlign: "center", align: "left", columnLabel: "发布号", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 80 }, { userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table2SequenceNo', tableId: "701002Table2", tableName: "申请单派工单明细表", columnProp: "sequenceNo", headerAlign: "center", align: "left", columnLabel: "序号", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 80 }, { userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table2PushWmsFlag', tableId: "701002Table2", tableName: "申请单派工单明细表", columnProp: "pushWmsFlag", headerAlign: "center", align: "center", columnLabel: "是否推送WCS", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 120 }, { userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table2TransportFlag', tableId: "701002Table2", tableName: "申请单派工单明细表", columnProp: "transportFlag", headerAlign: "center", align: "center", columnLabel: "立库取出", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 80 }, { userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table2AreaDesc', tableId: "701002Table2", tableName: "申请单派工单明细表", columnProp: "areaDesc", headerAlign: "center", align: "left", columnLabel: "配送区域", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 100 }
], columnList3:[ { userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table3ItemNo', tableId: "701002Table3", tableName: "申请单材料明细表", columnProp: "itemNo", headerAlign: "center", align: "right", columnLabel: "申请单序号", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 80 },{ userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table3SubSite', tableId: "701002Table3", tableName: "申请单材料明细表", columnProp: "subSite", headerAlign: "center", align: "center", columnLabel: "工厂编号", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 90 },{ userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table3ComponentPartNo', tableId: "701002Table3", tableName: "申请单材料明细表", columnProp: "componentPartNo", headerAlign: "center", align: "center", columnLabel: "材料编码", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 100 },{ userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table3IsInWh', tableId: "701002Table3", tableName: "申请单材料明细表", columnProp: "isInWh", headerAlign: "center", align: "center", columnLabel: "是否进立库", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 80 },{ userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table3NeedDate', tableId: "701002Table3", tableName: "申请单材料明细表", columnProp: "needDate", headerAlign: "center", align: "center", columnLabel: "需求时间", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 110 },{ userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table3QtyToIssue', tableId: "701002Table3", tableName: "申请单材料明细表", columnProp: "qtyToIssue", headerAlign: "center", align: "right", columnLabel: "申请数量", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 80 },/* { userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table3QtyToIssueOriginal', tableId: "701002Table3", tableName: "申请单材料明细表", columnProp: "qtyToIssueOriginal", headerAlign: "center", align: "right", columnLabel: "已发数量", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 80 }, */{ userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table3IssueType', tableId: "701002Table3", tableName: "申请单材料明细表", columnProp: "issueType", headerAlign: "center", align: "right", columnLabel: "类型", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 80 },{ userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table3Remark', tableId: "701002Table3", tableName: "申请单材料明细表", columnProp: "remark", headerAlign: "center", align: "left", columnLabel: "备注", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 160 },{ userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table3SOOrderNo', tableId: "701002Table3", tableName: "申请单材料明细表", columnProp: "soorderNo", headerAlign: "center", align: "left", columnLabel: "生产订单", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 120 },{ userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table3BOMItemNo', tableId: "701002Table3", tableName: "申请单材料明细表", columnProp: "bomitemNo", headerAlign: "center", align: "right", columnLabel: "BOM序号", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 80
}, ], columnList4:[ { userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table4IssueType', tableId: "701002Table4", tableName: "申请单材料明细表", columnProp: "issueType", headerAlign: "center", align: "center", columnLabel: "类型", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 100 }, { userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table4ComponentPartNo', tableId: "701002Table4", tableName: "申请单材料明细表", columnProp: "componentPartNo", headerAlign: "center", align: "center", columnLabel: "材料编码", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 100 },{ userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table4IsInWh', tableId: "701002Table4", tableName: "申请单材料明细表", columnProp: "isInWh", headerAlign: "center", align: "center", columnLabel: "是否进立库", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 80 },{ userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table4PartDesc', tableId: "701002Table4", tableName: "申请单材料明细表", columnProp: "partDesc", headerAlign: "center", align: "left", columnLabel: "材料名称", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 130 },{ userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table4QtyToIssue', tableId: "701002Table4", tableName: "申请单材料明细表", columnProp: "qtyToIssue", headerAlign: "center", align: "right", columnLabel: "合计申请数量", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 80 },{ userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table4QtyToIssueOriginal', tableId: "701002Table4", tableName: "申请单材料明细表", columnProp: "qtyToIssueOriginal", headerAlign: "center", align: "right", columnLabel: "合计已发数量", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 80 }, ], columnList6:[ // 预定标签清单列配置 - rqrq
{ userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table6ItemNo', tableId: "701002Table6", tableName: "预定标签清单表", columnProp: "itemNo", headerAlign: "center", align: "right", columnLabel: "订单序号", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 80 },{ // 预定标签清单按标签料号展示;订单物料行号仅保留在返回数据中供业务关联 - rqrq
userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table6ComponentPartNo', tableId: "701002Table6", tableName: "预定标签清单表", columnProp: "componentPartNo", headerAlign: "center", align: "left", columnLabel: "料号", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 120 },{ userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table6SerialNo', tableId: "701002Table6", tableName: "预定标签清单表", columnProp: "serialNo", headerAlign: "center", align: "left", columnLabel: "标签号", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 120 },{ userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table6TaskRef', tableId: "701002Table6", tableName: "预定标签清单表", columnProp: "taskRef", headerAlign: "center", align: "left", columnLabel: "立库任务号", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 120 },{ userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table6TaskItem', tableId: "701002Table6", tableName: "预定标签清单表", columnProp: "taskItem", headerAlign: "center", align: "right", columnLabel: "立库任务行号", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 100 },{ userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table6OutWcsFlag', tableId: "701002Table6", tableName: "预定标签清单表", columnProp: "outWcsFlag", headerAlign: "center", align: "center", columnLabel: "立库取出", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 80 }, { userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table6OutWcsTime', tableId: "701002Table6", tableName: "预定标签清单表", columnProp: "outWcsTime", headerAlign: "center", align: "center", columnLabel: "取出时间", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 140 } ],
// 导出 start
exportData: [], exportName: '发料申请单'+this.dayjs().format('YYYYMMDDHHmmss'), exportHeader: ["发料申请单"], exportFooter: [], // 导出 end
orderDetailData:{ orderNo:'', seqNo:'', locationNo:'', qtyrequired:'', issureQty:0, partDesc:'', partNo:'', resourceId:'', resourceDesc:'', needDate:'', itemDesc:'', workCenterNo:'', itemNo:0, materialType:'BOM物料', }, chooseSOSModalFlag: false, chooseSOSData: { orderno: '', seqno: '', sResourceid: '', startDate: '', endDate: '', }, chooseOrderModalFlag: false, chooseOrderData: { page: 1, limit: 100, orderNo: '', status: '', date3: '', date4: '', statusList: '', }, chooseOrderList: [], chooseOperationModalFlag: false, chooseOperationData: { orderNo: '', site: '', itemDesc: '' }, chooseOperationList: [], chooseResourceModalFlag: false, chooseResourceData: { site: '', workCenterNo: '', resourceID: '', resourceDesc: '', }, chooseResourceList: [], chooseSOSList: [], choosePartModalFlag: false, choosePartData: { site: '', sourceBu: '', partNo: '', partDesc: '', spec: '', }, choosePartList: [], // 预览相关数据
previewDialogVisible: false, previewLoading: false, pushLoading: false, previewData: [], previewSummary: { totalOrderCount: 0, completeOrderCount: 0, pushableOrderCount: 0, pushableOrderNos: [], completeOrderNos: [] }, currentNotifyRow: null, areaOptions: [], currentProductionArea: '', allocDetailList: [], allocDetailLoading: false, deleteWholeLoading: 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: [], sobomData: { orderNo: '', seqNo: '', partNo: '', }, bomLoadFlag: false, // 编辑材料明细对话框相关数据
editMaterialModalFlag: false, editMaterialData: { itemNo: '', componentPartNo: '', isInWh: '', needDate: '', qtyToIssue: 0, issueType: '', remark: '', soorderNo: '', bomitemNo: '', site: '', notifyNo: '', }, } }, mounted () { this.$nextTick(() => { this.height = (window.innerHeight- 315) / 2 }) },
created () { this.searchTable() // 补充海安标签扩展列,确保预定标签页签能展示海安增强字段 - rqrq
this.haiAnEnsureLabelColumns() // 推送弹窗单据目的地按haian_area名称展示,进入页面先加载区域清单 - rqrq
this.loadHaianAreaOptions(this.$store.state.user.site) }, computed: { /** * 只有服务端本次匹配判定的完整订单才允许确认推送,前端不自行按标签数量推断 - rqrq */ canPushPreview () { return !this.previewLoading && !this.pushLoading && this.previewSummary.pushableOrderCount > 0 } }, methods: { // 每页数
sizeChangeHandle (val) { this.pageSize = val this.searchTable() }, // 当前页
currentChangeHandle (val) { this.pageIndex = val this.searchTable() }, tabClick (tab, event) { // 刷新列表数据
this.refreshCurrentTabTable() }, changeData(row){ this.currentRow = JSON.parse(JSON.stringify(row)); this.refreshCurrentTabTable (); }, refreshCurrentTabTable(){ if(this.currentRow===''||this.currentRow===null){ this.currentRow={site:'',notifyNo:'',orderType:'shoporder'} } // rqrq - 添加orderType参数
let queryData = { ...this.currentRow, orderType: 'shoporder' } if(this.activeName==='detail'){ searchNotifyOrderListNew(queryData).then(({data}) => { //区分请求成功和失败的状况
if (data && data.code == 0) { this.dataList2 = data.rows
} else { this.dataList2 = []; } }); }else if(this.activeName==='sub'){ searchNotifyMaterialListNew(queryData).then(({data}) => { //区分请求成功和失败的状况
if (data && data.code == 0) { this.dataList3 = data.rows
} else { this.dataList3 = []; } }); }else if(this.activeName==='change'){ searchNotifyLogNew(queryData).then(({data}) => { //区分请求成功和失败的状况
if (data && data.code == 0) { this.dataList5 = data.rows
} else { this.dataList5 = []; } }); }else if(this.activeName==='close'){ searchNotifyLogCloseNew(queryData).then(({data}) => { //区分请求成功和失败的状况
if (data && data.code == 0) { this.dataList6 = data.rows
} else { this.dataList6 = []; } }); }else if(this.activeName==='labelDetail'){ // rqrq - 预定标签清单页签 - rqrq
searchMaterialListDetail(queryData).then(({data}) => { //区分请求成功和失败的状况
if (data && data.code == 0) { this.dataList7 = data.rows
} else { this.dataList7 = []; } }); }else { searchSumNotifyMaterialListNew(queryData).then(({data}) => { //区分请求成功和失败的状况
if (data && data.code == 0) { this.dataList4 = data.rows
} else { this.dataList4 = []; } }); } }, searchTable(){ this.searchData.limit = this.pageSize this.searchData.page = this.pageIndex searchNotifyHeaderNew(this.searchData).then(({data}) => { //区分请求成功和失败的状况
if (data && data.code == 0) { this.dataList = data.page.list this.pageIndex = data.page.currPage this.pageSize = data.page.pageSize this.totalPage = data.page.totalCount } else { this.dataList = []; } }); }, closeNotifyModel(row){ this.closeData.site=row.site this.closeData.notifyNo=row.notifyNo this.closeData.closeRemark='' this.closeModalFlag=true }, closeNotify(){ if(this.closeData.closeRemark==null||this.closeData.closeRemark===''){ this.$alert("必须输入关闭原因", '错误', { confirmButtonText: '确定' }) return false; }
let inData={ site:this.closeData.site, notifyNo:this.closeData.notifyNo, closeRemark:this.closeData.closeRemark, username:this.$store.state.user.name, status:'CLOSED', } updateNotifyStatusNew(inData).then(({data}) => { if (data && data.code === 0) { this.closeModalFlag=false this.searchTable() this.$message({ message: '操作成功', type: 'success', duration: 1500, onClose: () => {} }) } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) } })
}, openNotify(row){ this.$confirm('确认打开?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { let inData={ site:row.site, notifyNo:row.notifyNo, status:'ISSUE', } updateNotifyStatusNew(inData).then(({data}) => { if (data && data.code === 0) { this.searchTable() this.$message({ message: '操作成功', type: 'success', duration: 1500, onClose: () => {} }) } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) } }) }) }, // 预览库存匹配情况
previewInventory(row) { this.currentRow = row // 保存当前行数据
this.previewDialogVisible = true this.previewLoading = true this.previewData = []
let inData = { site: row.site, notifyNo: row.notifyNo }
checkIssueNotifyInventory(inData).then(({data}) => { this.previewLoading = false if (data && data.code === 0) { this.previewData = data.rows || [] console.log('库存预览数据:', this.previewData) } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) } }).catch(() => { this.previewLoading = false this.$message.error('获取库存预览失败') }) },
// 根据订单满足状态设置行样式
getRowClassName({row}) { if (row.orderSatisfactionStatus === 1) { return 'success-row' // 绿色:完全立库满足
} else if (row.orderSatisfactionStatus === 2) { return 'warning-row' // 黄色:立库+分切区满足
} else if (row.orderSatisfactionStatus === 3) { return 'danger-row' // 红色:存在不满足
} return '' },
// 从预览对话框推送至WCS
pushToWCS() { // 筛选绿色和黄色的数据(orderSatisfactionStatus = 1 或 2)
// const validData = this.previewData.filter(item =>
// item.orderSatisfactionStatus === 1 || item.orderSatisfactionStatus === 2
// )
//全部推送 后端判断
const validData = this.previewData
if (validData.length === 0) { this.$message.warning('没有可推送的数据(只推送绿色和黄色状态的数据)') return }
this.$confirm(`确认推送 ${validData.length} 条数据至WCS?`, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { // 显示加载状态 - rqrq
this.previewLoading = true
const inData = { site: this.currentRow.site, notifyNo: this.currentRow.notifyNo, inventoryList: validData }
pushInventoryToWcs(inData).then(({data}) => { this.previewLoading = false if (data && data.code === 0) { this.$message({ message: '推送WCS成功', type: 'success', duration: 1500 }) this.previewDialogVisible = false this.searchTable() } else { this.$alert(data.msg || '推送失败', '错误', { confirmButtonText: '确定' }) } }).catch((error) => { this.previewLoading = false this.$message.error(error.message || '推送WCS失败,请重试') }) }).catch(() => { // 用户取消操作 - rqrq
console.log('用户取消推送') }) },
pushToWcs(row){ this.$confirm('确认推送到WCS?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { let inData={ site: row.site, notifyNo: row.notifyNo } pushNotifyToWcs(inData).then(({data}) => { if (data && data.code === 0) { this.searchTable() this.$message({ message: '推送WCS成功', type: 'success', duration: 1500, onClose: () => {} }) } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) } }) }) },
/** * @Description 取消下达处理方法 - rqrq * @param row 当前行数据 */ cancelIssueNotifyHandle(row) { // 先判断发起人是否有未下达的shoporder申请单 - rqrq
let checkData = { site: row.site, username: row.username }
checkUserHasUnissueShopOrder(checkData).then(({ data }) => { if (data && data.code === 0) { // 如果有未下达的申请单 - rqrq
if (data.row != null) { this.$alert('该用户有未下达的申请单,请先处理', '提示', { confirmButtonText: '确定' }) return }
// 没有未下达的申请单,执行取消下达 - rqrq
this.$confirm(`确定取消下达申请单【${row.notifyNo}】吗?`, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { let cancelData = { site: row.site, notifyNo: row.notifyNo }
cancelIssueNotify(cancelData).then(({ data }) => { if (data && data.code === 0) { this.$message.success('取消下达成功') // 重新加载数据 - rqrq
this.searchTable() } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) } }).catch(() => { this.$message.error('取消下达失败') }) }).catch(() => { // 用户取消操作 - rqrq
}) } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) } }).catch(() => { this.$message.error('检查用户申请单失败') }) },
deleteNotifyMaterial(row){ this.$confirm('确认删除?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { deleteNotifyMaterial(row).then(({data}) => { if (data && data.code === 0) { this.refreshCurrentTabTable() this.$message({ message: '操作成功', type: 'success', duration: 1500, onClose: () => {} }) } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) } }) }) }, deleteNotifySOSPlus(row){ this.$confirm('确认删除?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { deleteNotifySOSPlus(row).then(({data}) => { if (data && data.code === 0) { this.refreshCurrentTabTable() this.$message({ message: '操作成功', type: 'success', duration: 1500, onClose: () => {} }) } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) } }) }) }, // 进入工单物料明细
enterSOSDetail(row) { let rows = { site: this.currentRow.site || this.$store.state.user.site, notifyNo: this.currentRow.notifyNo, orderNo: row.soorderNo || row.orderNo, seqNo: row.seqNo || '', partNo: row.fgPartNo || row.partNo, itemNo: row.itemNo, releaseNo: row.releaseNo, sequenceNo: row.sequenceNo, } this.enterSOS(rows) }, // 打开物料明细对话框
enterSOS(row) { this.materialModalFlag = true this.sobomList = [] this.sobomData = { orderNo: row.orderNo, seqNo: row.seqNo, partNo: row.partNo, } this.bomLoadFlag = true let inData = { site: this.currentRow.site || this.$store.state.user.site, notifyNo: this.currentRow.notifyNo, orderNo: row.orderNo, releaseNo: row.releaseNo, sequenceNo: row.sequenceNo, partNo: row.partNo, itemNo: row.itemNo, } getSOSBOMForIssureNew(inData).then(({ data }) => { this.bomLoadFlag = false if (data.code === 0) { this.sobomList = data.rows for (let i = 0; i < this.sobomList.length; i++) { this.sobomList[i].itemNo = inData.itemNo } } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) } }).catch(() => { this.bomLoadFlag = false this.$message.error('获取物料明细失败') }) }, // 全数领料
qtyAllForBom(row) { row.qtyToIssue = row.qtyRequired }, // 保存物料明细
saveMaterialDetail() { for (let i = 0; i < this.sobomList.length; i++) { if ( this.sobomList[i].qtyToIssue === '' || this.sobomList[i].qtyToIssue == null ) { this.sobomList[i].qtyToIssue = 0 } this.sobomList[i].notifyNo = this.currentRow.notifyNo this.sobomList[i].site = this.currentRow.site || this.$store.state.user.site }
let materialList = this.sobomList.filter((item) => item.qtyToIssue > 0) if (materialList.length == 0) { this.$alert('没有需要保存的内容!', '提示', { confirmButtonText: '确定', }) return false } saveMaterialDetail(materialList).then(({ data }) => { if (data.code === 0) { this.materialModalFlag = false this.refreshCurrentTabTable() this.$message.success('操作成功') } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定', }) } }) }, // 处理材料明细行双击事件
handleMaterialRowDblClick(row) {
if(!'未推送'.includes(this.currentRow.pushWcsFlag)){ this.$message.warning('只有未推送状态的申请单才能编辑材料明细') return; } // 保存完整的行数据,以便后续保存时包含所有必要字段
this.editMaterialData = JSON.parse(JSON.stringify(row)) // 确保包含必要的字段
this.editMaterialData.site = this.currentRow.site || this.$store.state.user.site this.editMaterialData.notifyNo = this.currentRow.notifyNo || '' // 确保申请数量有默认值
if (this.editMaterialData.qtyToIssue === null || this.editMaterialData.qtyToIssue === undefined) { this.editMaterialData.qtyToIssue = 0 } this.editMaterialModalFlag = true }, // 保存编辑的材料明细
saveEditMaterialDetail() { if (this.editMaterialData.qtyToIssue === null || this.editMaterialData.qtyToIssue === '') { this.$alert('申请数量不能为空!', '提示', { confirmButtonText: '确定', }) return false } if (this.editMaterialData.qtyToIssue < 0) { this.$alert('申请数量不能小于0!', '提示', { confirmButtonText: '确定', }) return false }
// 使用完整的行数据,只更新申请数量
let materialData = { ...this.editMaterialData, }
// 确保申请数量不为空
if (materialData.qtyToIssue === '' || materialData.qtyToIssue == null) { materialData.qtyToIssue = 0 }
updateMaterialDetail(materialData).then(({ data }) => { if (data.code === 0) { this.editMaterialModalFlag = false this.refreshCurrentTabTable() this.$message.success('保存成功') } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定', }) } }).catch(() => { this.$message.error('保存失败') }) },
//导出excel - rqrq
async createExportData() { const queryParams = { ...this.searchData, limit: 999999, // 设置一个很大的数字来获取全部数据 - rqrq
page: 1 } const {data} = await searchNotifyHeaderNew(queryParams) if (data && data.code === 0) { return data.page.list || [] } return [] }, startDownload() { // this.exportData = this.dataList
}, finishDownload() { }, fields() { let json = "{" this.columnList1.forEach((item, index) => { if (index == this.columnList1.length - 1) { json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" } else { json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + "," } }) json += "}" let s = eval("(" + json + ")")
return s },
tableRowClassName ({row, rowIndex}) {
if (row.qtyToIssueOriginal<row.qtyToIssue&&new Date(row.needDate)<new Date(this.dayjs().format("YYYY-MM-DD HH:mm"))) { return 'error-row' }
return '' }, /** * 统一构建海安查询入参,强制使用登录用户site避免跨站点串单 - rqrq */ haiAnBuildQueryData (row) { const baseRow = row || {} return { ...baseRow, site: this.$store.state.user.site, orderType: 'shoporder' } }, /** * 海安标签页签补充追踪列,领料栈板固定放最后一列便于对账 - rqrq */ haiAnEnsureLabelColumns () { if (!Array.isArray(this.columnList6)) { return } const appendColumn = (columnProp, columnLabel, columnWidth = 100, align = 'left') => { if (this.columnList6.some(col => col.columnProp === columnProp)) { return } this.columnList6.push({ userId: this.$store.state.user.name, functionId: 701002, serialNumber: `701002Table6${columnProp}`, tableId: '701002Table6', tableName: '海安预定标签清单表', columnProp, headerAlign: 'center', align, columnLabel, columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth }) } appendColumn('taskSeq', '立库任务序号', 110, 'right') appendColumn('subSite', '工厂编号', 110, 'left') appendColumn('allocSeq', '分配序号', 100, 'right') // 领料栈板必须在预定标签表最后一格,已存在则改标题并挪到末尾 - rqrq
const palletIndex = this.columnList6.findIndex(col => col.columnProp === 'palletId') let palletColumn = null if (palletIndex >= 0) { palletColumn = this.columnList6.splice(palletIndex, 1)[0] palletColumn.columnLabel = '领料栈板' palletColumn.columnWidth = 120 palletColumn.align = 'left' } else { palletColumn = { userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table6palletId', tableId: '701002Table6', tableName: '海安预定标签清单表', columnProp: 'palletId', headerAlign: 'center', align: 'left', columnLabel: '领料栈板', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 120 } } this.columnList6.push(palletColumn) }, /** * 海安页签刷新逻辑,四个页签均改为海安接口并保留原交互语义 - rqrq */ refreshCurrentTabTable () { if (this.currentRow === '' || this.currentRow === null) { this.currentRow = { site: this.$store.state.user.site, notifyNo: '', orderType: 'shoporder' } } const queryData = this.haiAnBuildQueryData(this.currentRow) if (this.activeName === 'detail') { haiAnSearchNotifyOrderListNew(queryData).then(({ data }) => { this.dataList2 = data && data.code === 0 ? (data.rows || []) : [] }) } else if (this.activeName === 'sub') { // 材料明细指定权限要看本行订单是否已推送,订单行和材料行一起取 - rqrq
this.loadMaterialListWithOrderPushFlag(queryData) } else if (this.activeName === 'change') { haiAnSearchNotifyLogNew(queryData).then(({ data }) => { this.dataList5 = data && data.code === 0 ? (data.rows || []) : [] }) } else if (this.activeName === 'close') { 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 || []) : [] }) } else { haiAnSearchSumNotifyMaterialListNew(queryData).then(({ data }) => { this.dataList4 = data && data.code === 0 ? (data.rows || []) : [] }) } }, /** * 海安主表查询改为海安接口,固定传登录站点并保留分页语义 - rqrq */ searchTable () { this.searchData.limit = this.pageSize this.searchData.page = this.pageIndex this.searchData.site = this.$store.state.user.site this.searchData.orderType = 'shoporder' haiAnSearchNotifyHeaderNew(this.searchData).then(({ data }) => { if (data && data.code === 0) { this.dataList = data.page.list this.pageIndex = data.page.currPage this.pageSize = data.page.pageSize this.totalPage = data.page.totalCount return } this.dataList = [] }) }, /** * 海安关闭申请单,保持旧页面的必填关闭原因校验与提示语义 - rqrq */ closeNotify () { if (this.closeData.closeRemark == null || this.closeData.closeRemark === '') { this.$alert('必须输入关闭原因', '错误', { confirmButtonText: '确定' }) return false } const inData = { site: this.$store.state.user.site, notifyNo: this.closeData.notifyNo, closeRemark: this.closeData.closeRemark, username: this.$store.state.user.name, status: 'CLOSED' } haiAnUpdateNotifyStatusNew(inData).then(({ data }) => { if (data && data.code === 0) { this.closeModalFlag = false this.searchTable() this.$message({ message: '操作成功', type: 'success', duration: 1500 }) return } this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) }) }, /** * 海安开启申请单,状态回写改走海安接口并保持原确认交互 - rqrq */ openNotify (row) { this.$confirm('确认打开?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { const inData = { site: this.$store.state.user.site, notifyNo: row.notifyNo, status: 'ISSUE' } haiAnUpdateNotifyStatusNew(inData).then(({ data }) => { if (data && data.code === 0) { this.searchTable() this.$message({ message: '操作成功', type: 'success', duration: 1500 }) return } this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) }) }) }, /** * 海安查看页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 || '' // 打开推送预览时按单据site再拉一次区域,避免名称映射为空回退成A10编码 - rqrq
this.loadHaianAreaOptions(row.site || this.$store.state.user.site) this.previewData = [] this.previewSummary = { totalOrderCount: 0, completeOrderCount: 0, pushableOrderCount: 0, pushableOrderNos: [], completeOrderNos: [] } this.previewDialogVisible = true this.previewLoading = true const queryData = { site: row.site || this.$store.state.user.site, notifyNo: row.notifyNo } 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: '确定'}) } }) .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: [] } }, /** * 目的地只展示haian_area名称,没有名称时回退编码,避免页面露出A10这类编码 - rqrq */ getAreaDisplayText(areaId) { if (!areaId) return '未设置' const code = String(areaId).trim() const area = (this.areaOptions || []).find(item => String(item.areaId || '').trim() === code) if (area && area.areaDesc) { return area.areaDesc } return code }, /** * 按工厂加载haian_area,下拉和推送目的地展示共用;提交值仍是areaId - rqrq */ loadHaianAreaOptions(site) { const querySite = site || this.$store.state.user.site if (!querySite) { this.areaOptions = [] return } haiAnGetAreaList({ site: querySite }).then(({ data }) => { if (data && data.code === 0) { this.areaOptions = data.rows || [] return } this.areaOptions = [] }).catch(() => { this.areaOptions = [] }) }, /** * 根据物料或指定明细自身的匹配结果设置颜色,失败统一标红 - 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') }, /** * 不可推送原因包含后端拼接的数量文本,展示时去除小数尾部无效0,避免现场误读缺料数量 - rqrq */ formatFailureMessage (message, fallback) { const text = message || fallback || '' return String(text).replace(/(-?\d+\.\d*?[1-9])0+(?!\d)/g, '$1').replace(/(-?\d+)\.0+(?!\d)/g, '$1') }, /** * 海安查看页确认推送:只提交site和notifyNo,实际订单和标签由服务端重新匹配决定 - rqrq */ pushToWCS () { 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.pushLoading = true haiAnPushInventoryToWcs({ site: this.currentNotifyRow.site || this.$store.state.user.site, notifyNo: this.currentNotifyRow.notifyNo }).then(({data}) => { if (data && data.code === 0) { this.closePreviewDialog(true) // WCS按订单部分成功也返回code=0;弹框保留全部失败及跳过原因,等待人工确认。- rqrq
showHaianWcsPushResult(this, data) this.searchTable() this.refreshCurrentTabTable() } else { this.$alert((data && data.msg) || '推送WCS失败', '错误', {confirmButtonText: '确定'}) } }).catch((error) => { 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 }) }, /** * 材料明细和订单行一起查询。按订单序号把本行是否已推送WCS写回材料行,已推送的行不能指定物料。- rqrq * @param queryData 当前申请单查询条件,必须带登录site和申请单号 */ loadMaterialListWithOrderPushFlag (queryData) { const materialRequest = haiAnSearchNotifyMaterialListNew(queryData).then(({ data }) => { return data && data.code === 0 ? (data.rows || []) : [] }).catch(() => []) const orderRequest = haiAnSearchNotifyOrderListNew(queryData).then(({ data }) => { return data && data.code === 0 ? (data.rows || []) : [] }).catch(() => []) Promise.all([materialRequest, orderRequest]).then(([materialRows, orderRows]) => { const pushFlagByItemNo = {} orderRows.forEach(orderRow => { pushFlagByItemNo[this.normalizeNotifyItemNo(orderRow.itemNo)] = orderRow.pushWmsFlag }) materialRows.forEach(materialRow => { const orderPushFlag = pushFlagByItemNo[this.normalizeNotifyItemNo(materialRow.itemNo)] if (orderPushFlag) { materialRow.pushWmsFlag = orderPushFlag } }) this.dataList2 = orderRows this.dataList3 = materialRows }) }, /** * 订单序号统一成可比较文本,避免 1 和 1.0 对不上导致已推送行仍能指定。- rqrq */ normalizeNotifyItemNo (value) { if (value === null || value === undefined || value === '') { return '' } const text = String(value).trim() if (text === '') { return '' } const numberValue = Number(text) return Number.isNaN(numberValue) ? text : String(numberValue) }, /** * 取材料行所属订单的推送标记。同一申请单下按订单序号匹配申请单明细,匹配不到再用材料行自带标记。- rqrq */ resolveMaterialOrderPushFlag (row) { if (!row) { return '' } const itemKey = this.normalizeNotifyItemNo(row.itemNo) const orderRow = (this.dataList2 || []).find(item => this.normalizeNotifyItemNo(item.itemNo) === itemKey) if (orderRow && orderRow.pushWmsFlag) { return orderRow.pushWmsFlag } return row.pushWmsFlag || '' }, /** * 材料行能否指定物料:申请单已下达,且本行订单未推送WCS。- rqrq */ canSpecifyMaterial (row) { return !!(this.currentRow && this.currentRow.status === 'ISSUE' && this.resolveMaterialOrderPushFlag(row) !== 'Y') }, /** * 打开指定物料策略弹窗:以订单行itemNo+BOM行号隔离当前物料;未下达不允许指定 - rqrq * @param row 材料明细页签中的物料行 */ openNoOrderMaterialAllocDialog (row) { if (!this.currentRow || this.currentRow.status !== 'ISSUE') { this.$alert('未下达申请单不允许指定物料', '提示', { confirmButtonText: '确定' }) return } // 本行订单已推送WCS时拒绝打开指定弹框,避免立库已接单后改分配 - rqrq
if (this.resolveMaterialOrderPushFlag(row) === 'Y') { this.$alert('该订单行已推送WCS,不允许指定物料', '提示', { 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() }, /** * 选择标签/批次弹窗数量去尾零,空值按 0 展示,不改原始数据,排序仍按数字 qty - rqrq */ formatNoOrderPickQty (row, column, cellValue) { if (cellValue === null || cellValue === undefined || cellValue === '') { return 0 } const num = Number(cellValue) if (isNaN(num)) { return cellValue } return parseFloat(String(num)) }, 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 */ cancelIssueNotifyHandle (row) { const checkData = { site: this.$store.state.user.site, username: row.username } haiAnCheckUserHasUnissueShopOrder(checkData).then(({ data }) => { if (data && data.code === 0) { if (data.row != null) { this.$alert('该用户有未下达的申请单,请先处理', '提示', { confirmButtonText: '确定' }) return } this.$confirm(`确定取消下达申请单【${row.notifyNo}】吗?`, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { const cancelData = { site: this.$store.state.user.site, notifyNo: row.notifyNo } haiAnCancelIssueNotify(cancelData).then(({ data }) => { if (data && data.code === 0) { this.$message.success('取消下达成功') this.searchTable() return } this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) }).catch(() => { this.$message.error('取消下达失败') }) }) return } this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) }).catch(() => { this.$message.error('检查用户申请单失败') }) }, /** * 未推送领料单整单删除。确认后把订单、物料、标签明细和指定物料一起删掉 - rqrq */ deleteUnpushedNotify (row) { if (this.deleteWholeLoading || !row || !row.notifyNo) { return } this.$confirm(`确定删除领料单【${row.notifyNo}】吗?将同时删除订单、物料和指定物料,删除后不能恢复。`, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { this.deleteWholeLoading = true // 只传站点、申请单号和单据类型,删除范围由后端按未推送校验后执行 - rqrq
haiAnDeleteUnpushedNotify({ site: this.$store.state.user.site, notifyNo: row.notifyNo, orderType: this.searchData.orderType }).then(({ data }) => { if (data && data.code === 0) { this.searchTable() if (this.currentRow && this.currentRow.notifyNo === row.notifyNo) { this.currentRow = { site: this.$store.state.user.site, notifyNo: '', orderType: this.searchData.orderType } this.refreshCurrentTabTable() } this.$message.success('删除成功') return } this.$alert((data && data.msg) || '删除失败', '错误', { confirmButtonText: '确定' }) }).catch(() => { this.$message.error('删除失败') }).finally(() => { this.deleteWholeLoading = false }) }).catch(() => {}) }, /** * 海安删除工单行增强接口,保留未推送状态限制并同步刷新当前页签 - rqrq */ deleteNotifySOSPlus (row) { this.$confirm('确认删除?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { const inData = { ...row, site: this.$store.state.user.site, notifyNo: this.currentRow.notifyNo } haiAnDeleteNotifySOSPlus(inData).then(({ data }) => { if (data && data.code === 0) { this.refreshCurrentTabTable() this.$message({ message: '操作成功', type: 'success', duration: 1500 }) return } this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) }) }) }, /** * 海安查看页物料弹窗查询,按海安接口回显已保存数量并透传subsite - rqrq */ enterSOS (row) { this.materialModalFlag = true this.sobomList = [] this.sobomData = { orderNo: row.orderNo, seqNo: row.seqNo, partNo: row.partNo, subSite: row.subSite } this.bomLoadFlag = true const inData = { site: this.$store.state.user.site, notifyNo: this.currentRow.notifyNo, orderNo: row.orderNo, releaseNo: row.releaseNo, sequenceNo: row.sequenceNo, partNo: row.partNo, itemNo: row.itemNo } haiAnGetSOSBOMForIssureNew(inData).then(({ data }) => { this.bomLoadFlag = false if (data && data.code === 0) { this.sobomList = data.rows || [] for (let i = 0; i < this.sobomList.length; i++) { this.sobomList[i].itemNo = inData.itemNo this.sobomList[i].subSite = row.subSite } return } this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) }).catch(() => { this.bomLoadFlag = false this.$message.error('获取物料明细失败') }) }, /** * 海安保存材料明细走海安先删后存链路,并透传subsite防止跨子站点串单 - rqrq */ saveMaterialDetail () { for (let i = 0; i < this.sobomList.length; i++) { if (this.sobomList[i].qtyToIssue === '' || this.sobomList[i].qtyToIssue == null) { this.sobomList[i].qtyToIssue = 0 } this.sobomList[i].notifyNo = this.currentRow.notifyNo this.sobomList[i].site = this.$store.state.user.site this.sobomList[i].subSite = this.sobomList[i].subSite || this.sobomData.subSite || this.currentRow.subSite } const materialList = this.sobomList.filter((item) => item.qtyToIssue > 0) if (materialList.length === 0) { this.$alert('没有需要保存的内容!', '提示', { confirmButtonText: '确定' }) return false } haiAnSaveMaterialDetail(materialList).then(({ data }) => { if (data && data.code === 0) { this.materialModalFlag = false this.refreshCurrentTabTable() this.$message.success('操作成功') return } this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) }) }, /** * 海安编辑材料数量,沿用未推送限制并改为海安更新接口 - rqrq */ saveEditMaterialDetail () { if (this.editMaterialData.qtyToIssue === null || this.editMaterialData.qtyToIssue === '') { this.$alert('申请数量不能为空!', '提示', { confirmButtonText: '确定' }) return false } if (this.editMaterialData.qtyToIssue < 0) { this.$alert('申请数量不能小于0!', '提示', { confirmButtonText: '确定' }) return false } const materialData = { ...this.editMaterialData, site: this.$store.state.user.site, notifyNo: this.currentRow.notifyNo } if (materialData.qtyToIssue === '' || materialData.qtyToIssue == null) { materialData.qtyToIssue = 0 } haiAnUpdateMaterialDetail(materialData).then(({ data }) => { if (data && data.code === 0) { this.editMaterialModalFlag = false this.refreshCurrentTabTable() this.$message.success('保存成功') return } this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) }).catch(() => { this.$message.error('保存失败') }) }, /** * 海安导出数据改为海安主查询接口,确保导出内容来自海安表链路 - rqrq */ async createExportData () { const queryParams = { ...this.searchData, site: this.$store.state.user.site, orderType: 'shoporder', limit: 999999, page: 1 } const { data } = await haiAnSearchNotifyHeaderNew(queryParams) if (data && data.code === 0) { return data.page.list || [] } return [] } },
}</script>
<style scoped>/deep/ .el-form-item--medium .el-form-item__content { height: auto;}.disabled { cursor: not-allowed !important; color: #C0C4CC !important; pointer-events: none;}
.text-right >>> .el-input__inner { text-align: right !important;}
.text-right >>> .el-input-number__input { text-align: right !important;}
.yzzTable /deep/.el-table .cell { line-height: 20px; font-size: 12px; height: 20px;}
.single-line-multi-select >>> .el-select__tags { display: flex; flex-wrap: nowrap; overflow: hidden; white-space: nowrap; max-width: 100%;}
.single-line-multi-select >>> .el-tag { flex-shrink: 0; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
.single-line-multi-select >>> .el-select__input { flex-shrink: 0; min-width: 30px;}
/* 库存预览表格行颜色 *//deep/ .el-table .success-row { background: #f0f9ff !important; border-left: 3px solid #67C23A;}
/* rqrq - 匹配条码列自动换行显示 *//deep/ .wrap-text-column .cell { white-space: normal !important; word-break: break-all !important; line-height: 1.5 !important;}
/deep/ .el-table .warning-row { background: #fdf6ec !important; border-left: 3px solid #E6A23C;}
/deep/ .el-table .danger-row { background: #fef0f0 !important; border-left: 3px solid #F56C6C;}
/deep/ .el-table .success-row:hover > td { background-color: #ecf5ff !important;}
/deep/ .el-table .warning-row:hover > td { background-color: #faecd8 !important;}
/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>
|