|
|
<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> <el-form :inline="true" label-position="top" style="margin-top: 0px"> <el-form-item label="是否领料" > <el-select v-model="searchData.issueFlag" placeholder="请选择" style="width: 120px"> <el-option label="全部" value=""></el-option> <el-option label="Y" value="Y"></el-option> <el-option label="N" value="N"></el-option> </el-select> </el-form-item> <el-form-item label="领料结果" > <el-select v-model="searchData.issueResult" placeholder="请选择" style="width: 120px"> <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.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"> <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> <!-- 是否推送WCS - rqrq --> <el-table-column prop="pushWmsFlag" label="是否推送WCS" width="120" align="center" header-align="center"> <template slot-scope="scope"> <span :style="{color: scope.row.pushWmsFlag === 'Y' ? '#67C23A' : '#909399'}"> {{ scope.row.pushWmsFlag === 'Y' ? '是' : '否' }} </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" 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-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 width="120" align="left"> </el-table-column> <el-table-column prop="componentPartDesc" label="物料描述" width="200" align="left" show-overflow-tooltip> </el-table-column> <el-table-column prop="qtyRequired" label="需求数量" width="100" align="right"> </el-table-column> <el-table-column prop="qtyToIssue" label="本次申请数量" 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="备注" 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="库存匹配预览" :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" align="center"> </el-table-column> <el-table-column prop="bomLineNo" label="BOM行号" width="100" align="center"> </el-table-column> <el-table-column prop="partNo" label="物料编码" width="100" 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 { searchNotifyHeaderNew , searchNotifyOrderListNew , searchNotifyMaterialListNew , searchSumNotifyMaterialListNew , deleteNotifySOSPlus , updateNotifyStatusNew , deleteNotifyMaterial , searchNotifyLogNew , searchNotifyLogCloseNew , pushNotifyToWcs , checkIssueNotifyInventory , pushInventoryToWcs , checkUserHasUnissueShopOrder , cancelIssueNotify , getSOSBOMForIssureNew , saveMaterialDetail
} from "@/api/orderIssure/soIssueNotify.js"
export default {
data() { return { height:200, activeName: 'detail', dataList: [], dataList2: [], dataList3: [], dataList4: [], dataList5: [], dataList6: [], 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: '', issueFlag: '', loginUserName: this.$store.state.user.name, issueResult: '', 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: '701002Table1IssueFlag', tableId: "701002Table1", tableName: "领料申请主表", columnProp: "issueFlag", headerAlign: "center", align: "center", columnLabel: "是否领料", columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 60 },{ userId: this.$store.state.user.name, functionId: 701002, serialNumber: '701002Table1IssueResult', tableId: "701002Table1", tableName: "领料申请主表", columnProp: "issueResult", 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: '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: '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 }
], 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: '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: '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 }, ],
// 导出 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, } }, mounted () { this.$nextTick(() => { this.height = (window.innerHeight- 315) / 2 }) },
created () {
}, 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 { 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: '确定', }) } }) },
//导出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 '' },
},
}</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>
|