|
|
<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="180" 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><!-- <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> <!-- 操作列 --> <el-table-column fixed="right" 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> </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>
<!-- 库存预览模态框 --> <el-dialog title="库存匹配预览" :visible.sync="previewDialogVisible" width="80%" :close-on-click-modal="false"> <el-table :data="previewData" border v-loading="previewLoading" style="width: 100%;" height="300" :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> <el-table-column prop="bomLineNo" label="BOM行号" width="100" sortable align="center"> </el-table-column> <el-table-column prop="partNo" label="物料编码" width="100" sortable align="center"> </el-table-column> <el-table-column prop="requiredQty" label="需求数量" width="80" align="center"> </el-table-column> <el-table-column prop="isWarehouseSatisfied" label="立库是否满足" width="100" align="center"> <template slot-scope="scope"> <span :style="{color: scope.row.isWarehouseSatisfied === 'Y' ? '#67C23A' : '#F56C6C'}"> {{ scope.row.isWarehouseSatisfied === 'Y' ? '是' : '否' }} </span> </template> </el-table-column> <el-table-column prop="isOtherWarehouseSatisfied" label="分切仓库是否满足" width="120" align="center"> <template slot-scope="scope"> <span v-if="scope.row.isOtherWarehouseSatisfied" :style="{color: scope.row.isOtherWarehouseSatisfied === 'Y' ? '#67C23A' : '#F56C6C'}"> {{ scope.row.isOtherWarehouseSatisfied === 'Y' ? '是' : '否' }} </span> </template> </el-table-column> <el-table-column prop="matchedBarcodes" label="匹配条码" min-width="300" align="left" class-name="wrap-text-column"> <template slot-scope="scope"> <div style="white-space: normal; word-break: break-all; line-height: 1.5;"> {{ scope.row.matchedBarcodes }} </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> <el-button @click="previewDialogVisible = false" :disabled="previewLoading">关闭</el-button> </span> </el-dialog>
</div></template>
<script>import { haiAnGetPoOrderMaterialForIssure, haiAnSearchNotifyHeaderNew, haiAnCheckUserHasUnissueShopOrder, haiAnCancelIssueNotify} from '@/api/haianWarehouse/poOrderIssueNotify.js'
export default { name: 'searchPoIssureNotify54',
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: '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: '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 },{ userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table6BOMItemNo', tableId: "701002Table6", tableName: "预留标签清单表", columnProp: "bomItemNo", 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: '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, previewData: [], // 物料明细对话框相关数据
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() }, 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 - 预留标签清单页签
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' } }, /** * 海安标签页签增加subsite/allocSeq/palletId/taskSeq列,便于追踪标签流向 - 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') appendColumn('palletId', '栈板号', 120, 'left') }, /** * 海安页签刷新逻辑,四个页签均改为海安接口并保留原交互语义 - 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') { haiAnSearchNotifyMaterialListNew(queryData).then(({ data }) => { this.dataList3 = data && data.code === 0 ? (data.rows || []) : [] }) } 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 === '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: '确定' }) }) }) }, /** * 海安库存预览当前为占位实现,保留入口并给出待开发提示 - rqrq */ previewInventory (row) { this.currentRow = row this.previewDialogVisible = true this.previewLoading = true this.previewData = [] const inData = { 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 || '海安库存预览待开发') } return } this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) }).catch(() => { this.previewLoading = false this.$message.error('获取库存预览失败') }) }, /** * 海安推送WCS当前为占位实现,仅提示待开发并不触发真实推送 - rqrq */ pushToWCS () { const validData = this.previewData || [] this.$confirm(`确认推送 ${validData.length} 条数据至WCS?`, '提示', { 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 if (data && data.code === 0) { this.$message.warning(data.msg || '海安推送WCS待开发') this.previewDialogVisible = false return } this.$alert(data.msg || '推送失败', '错误', { confirmButtonText: '确定' }) }).catch((error) => { this.previewLoading = false this.$message.error(error.message || '推送WCS失败,请重试') }) }) }, /** * 兼容旧入口的海安推送占位方法,避免历史按钮调用空指针 - rqrq */ pushToWcs (row) { this.previewInventory(row) }, /** * 海安取消下达流程:先检查未下达冲突,再执行取消并刷新列表 - 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 */ 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 [] }, /** * 委外发料查看页参数:固定orderType=poorder,保证主子表查询口径一致 - rqrq */ haiAnBuildQueryData (row) { const baseRow = row || {} return { ...baseRow, site: this.$store.state.user.site, orderType: 'poorder' } }, /** * 委外发料主列表查询:仅查询poorder类型海安申请单 - rqrq */ searchTable () { this.searchData.limit = this.pageSize this.searchData.page = this.pageIndex this.searchData.site = this.$store.state.user.site this.searchData.orderType = 'poorder' 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 = [] }) }, /** * 委外发料物料弹窗:调用海安poorder专用IFS聚合接口并透传subsite - rqrq */ enterSOS (row) { this.materialModalFlag = true this.sobomList = [] this.sobomData = { orderNo: row.orderNo || row.soorderNo, seqNo: row.sequenceNo || row.seqNo, partNo: row.partNo || row.fgpartNo, subSite: row.subSite } this.bomLoadFlag = true const inData = { site: this.$store.state.user.site, notifyNo: this.currentRow.notifyNo, orderNo: row.orderNo || row.soorderNo, releaseNo: row.releaseNo, sequenceNo: row.sequenceNo || row.seqNo, itemNo: row.itemNo } haiAnGetPoOrderMaterialForIssure(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 = this.sobomList[i].subSite || row.subSite } return } this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) }).catch(() => { this.bomLoadFlag = false this.$message.error('获取委外发料明细失败') }) }, /** * 委外发料取消下达:按poorder口径检查未下达单据后再执行取消 - rqrq */ cancelIssueNotifyHandle (row) { const checkData = { site: this.$store.state.user.site, username: row.username, orderType: 'poorder' } 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('检查用户申请单失败') }) }, /** * 委外发料导出:固定按poorder维度导出海安主单数据 - rqrq */ async createExportData () { const queryParams = { ...this.searchData, site: this.$store.state.user.site, orderType: 'poorder', limit: 999999, page: 1 } const { data } = await haiAnSearchNotifyHeaderNew(queryParams) if (data && data.code === 0) { 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推送功能暂不启用') } },
}</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;}</style>
|