|
|
<template> <div class="mod-config"> <!-- 条件查询 --> <el-form :inline="true" label-position="top" :model="searchData"> <el-form-item :label="'单据号'"> <el-input v-model="searchData.notifyNo" clearable style="width: 120px"></el-input> </el-form-item> <el-form-item :label="'单据状态'"> <el-select multiple collapse-tags v-model="searchData.orderStatusList" clearable style="width: 160px"> <el-option label="ISSUE" value="ISSUE"></el-option> <el-option label="CLOSED" value="CLOSED"></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;"> <!-- <laber style="margin-left: -9px;font-size: 19px"></laber> --> ~ </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="' '"> <el-button type="primary" :loading="searchLoading" @click="getDataList()">查询</el-button> </el-form-item> </el-form>
<!-- 展示列表 --> <el-table :height="height" :data="dataList" border v-loading="searchLoading" ref="inboundTable" :row-style="rowStyle" @row-click="inboundClickRow" @current-change="changeCurrentRow" style="width: 100%;"> <el-table-column type="selection" header-align="center" align="center" width="50"> </el-table-column> <el-table-column v-for="(item,index) in columnList" :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 fixed="right" header-align="center" align="center" width="250" label="操作"> <template slot-scope="scope"> <!-- <template v-if="!authUpdate"> <el-link v-if="scope.row.orderStatus === '草稿' || scope.row.orderStatus === '待检验' || scope.row.orderStatus === '编辑中'" style="cursor: pointer" @click="updateModal(scope.row)">编辑</el-link> </template> --> <template v-if="!authClose"> <el-link style="cursor: pointer" @click="closeModal(scope.row)">关闭</el-link> </template> <!-- rqrq - 添加推送WCS按钮 --> <a type="text" size="small" v-if="scope.row.pushWcsFlag!=='推送完成'&&scope.row.status==='ISSUE'" @click="previewInventory(scope.row)" style="margin-left: 10px;">推送WCS</a> </template> </el-table-column> </el-table>
<!-- 分页栏 --> <el-pagination style="margin-top: 0px" @size-change="sizeChangeHandle" @current-change="currentChangeHandle" :current-page="pageIndex" :page-sizes="[20, 50, 100, 200, 500]" :page-size="pageSize" :total="totalPage" layout="total, sizes, prev, pager, next, jumper"> </el-pagination>
<!-- 收货入库通知新增/修改 --> <el-dialog title="收货入库通知" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="525px"> <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;"> <el-form-item label="单据类型" prop="orderType"> <el-select v-model="modalData.orderType" :disabled="modalDisableFlag" style="width: 100px"> <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="要求入库日期" prop="requiredInboundDate"> <el-date-picker style="width: 120px" v-model="modalData.requiredInboundDate" type="date" value-format="yyyy-MM-dd"> </el-date-picker> </el-form-item> </el-form> <el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px"> <el-form-item> <!-- <span v-if="modalDisableFlag" slot="label">供应商</span>--> <span style="cursor: pointer" slot="label" @click="getBaseList(506)"><a href="#">供应商</a></span> <el-input v-model="modalData.supplierId" @change="supplierBlur(506)" style="width: 100px"></el-input> <el-input v-model="modalData.supplierName" disabled style="width: 380px"></el-input> </el-form-item> </el-form> <el-form :inline="true" label-position="top" style="margin-left: 7px"> <el-form-item :label="'备注'"> <el-input type="textarea" v-model="modalData.remarks" :rows="3" resize='none' show-word-limit style="width: 485px;height: 20px"></el-input> </el-form-item> </el-form> <el-footer style="height:35px;margin-top: 55px;text-align:center"> <el-button type="primary" :loading="saveLoading" @click="saveData()">保存</el-button> <el-button type="primary" @click="modalFlag = false">关闭</el-button> </el-footer> </el-dialog>
<!-- 页签 --> <el-tabs v-model="activeTable" style="width: 100%" :style="{height: secondHeight + 'px'}" type="border-card" @tab-click="tabClick" class="customer-tab"> <el-tab-pane label="已申请物料" name="inboundDetail"> <!-- <el-form label-position="top" style="margin-left: 2px;"> <el-button type="primary" @click="deleteInboundDetail()" icon="el-icon-delete">删除</el-button> </el-form> --> <el-table :data="detailList" :height="secondHeight - 68" border @selection-change="selectionInboundDetail" v-loading="searchLoading" style="width: 100%;"> <!-- <el-table-column type="selection" header-align="center" align="center" width="50"> </el-table-column> --> <el-table-column v-for="(item,index) in columnDetailList" :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 prop="requiredQty" header-align="center" align="right" min-width="100" label="要求入库数量"> <template slot-scope="scope"> <span v-if="editBatchVisible"> <el-input :controls="false" v-model="scope.row.requiredQty" @input="value => scope.row.requiredQty = value.match(/^(\d+\.?\d*|\.\d+)$/) ? value : ''" style="height: 11px; width: 98%;"> </el-input> </span> <span v-else> <span>{{scope.row[scope.column.property]}}</span> </span> </template> </el-table-column> <el-table-column prop="inWarehouseName" header-align="center" align="center" min-width="180" label="入库仓库"> <template slot-scope="scope"> <span v-if="editBatchVisible"> <el-button type="text" @click="chooseWareHouse(scope.row)" style="width:18%;padding: 3px 7px">选择</el-button> <el-input v-model="scope.row.inWarehouseName" readonly style="width:77%"></el-input> </span> <span v-else> <span>{{scope.row[scope.column.property]}}</span> </span> </template> </el-table-column> <el-table-column prop="actualStockInQty" header-align="center" align="right" min-width="100" label="实际入库数量"> </el-table-column> --> <el-table-column fixed="right" header-align="center" align="center" width="100" label="操作"> <template slot-scope="scope"> <a type="text" size="small" @click="enterSOSDetail(scope.row)">物料</a> <a type="text" size="small" @click="deleteNotifySOS(scope.row)">删除</a> </template> </el-table-column> </el-table> </el-tab-pane> </el-tabs>
<!-- rqrq - 推送WCS预览弹窗 --> <el-dialog title="库存匹配情况预览" :visible.sync="previewDialogVisible" :close-on-click-modal="false" v-drag width="95%"> <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>
<!-- 收获入库单明细新增 --> <el-dialog title="收货入库单明细" :close-on-click-modal="false" v-drag :visible.sync="detailModal" width="900px"> <div style="font-size: 12px"> <el-form :inline="true" label-position="top" :model="detailSearchData"> <el-form-item :label="'物料编码'"> <el-input v-model="detailSearchData.partNo" clearable style="width: 120px"></el-input> </el-form-item> <el-form-item :label="'物料名称'"> <el-input v-model="detailSearchData.partDesc" clearable style="width: 120px"></el-input> </el-form-item> <template v-if="detailSearchData.orderType === '生产入库'"> <el-form-item :label="'生产订单'"> <el-input v-model="detailSearchData.relatedOrderNo" clearable style="width: 120px"></el-input> </el-form-item> <el-form-item :label="'订单状态'"> <el-select v-model="detailSearchData.status" clearable style="width: 100px"> <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-option label="已停工" value="已停工"></el-option> <el-option label="已关闭" value="已关闭"></el-option> </el-select> </el-form-item> </template> <el-form-item label=" "> <el-button type="primary" @click="searchTypeChange">查询</el-button> </el-form-item> </el-form> </div> <el-container v-if="detailSearchData.orderType === '其他入库'"> <el-header style="width: 880px;height: 200px;padding: 0 0 0 0"> <span style="font-size: 12px">可选物料</span> <el-table height="200px" :data="partList1" border ref="partTable1" @selection-change="selectionPart1" highlight-current-row style="width: 100%"> <el-table-column type="selection" header-align="center" align="center" width="50"> </el-table-column> <el-table-column prop="partNo" header-align="center" align="center" min-width="80" label="物料编码"> </el-table-column> <el-table-column prop="partDesc" header-align="center" align="left" min-width="120" label="物料名称"> </el-table-column> <el-table-column prop="unit" header-align="center" align="left" min-width="120" label="物料单位"> </el-table-column> </el-table> <!-- 分页--> <el-pagination style="margin-top: 5px" @size-change="sizeChangeHandle2" @current-change="currentChangeHandle2" :current-page="pageIndex2" :page-sizes="[20, 50, 100, 200, 500]" :page-size="pageSize2" :total="totalPage2" layout="total, sizes, prev, pager, next, jumper"> </el-pagination> </el-header> <el-main style="width: 880px;height: 27px;margin-top: 70px;padding: 0 0 0 0;text-align:center"> <div> <el-button type="primary" @click="addPart">添加>></el-button> <el-button type="primary" @click="deletePart">删除<<</el-button> </div> </el-main> <el-footer style="width: 880px;height: 200px;padding: 0 0 0 0;"> <span style="font-size: 12px">已选物料</span> <div class="rq"> <el-table height="200px" :data="partList2" border ref="partTable2" @selection-change="selectionPart2" highlight-current-row style="width: 100%"> <el-table-column type="selection" header-align="center" align="center" width="50"> </el-table-column> <el-table-column prop="partNo" header-align="center" align="center" min-width="80" label="物料编码"> </el-table-column> <el-table-column prop="partDesc" header-align="center" align="left" min-width="120" label="物料名称"> </el-table-column> <el-table-column prop="" header-align="center" align="center" min-width="100" label="要求入库数量"> <template slot-scope="scope"> <el-input :controls="false" v-model="scope.row.requiredQty" @input="value => scope.row.requiredQty = value.match(/^(\d+\.?\d*|\.\d+)$/) ? value : ''" style="height: 11px; width: 98%;"> </el-input> </template> </el-table-column> </el-table> </div> </el-footer> </el-container> <el-container v-else-if="detailSearchData.orderType === '生产入库'"> <el-header style="width: 880px;height: 200px;padding: 0 0 0 0"> <span style="font-size: 12px">可选物料</span> <el-table height="200px" :data="partList1" border ref="partTable1" @selection-change="selectionPart1" highlight-current-row style="width: 100%"> <el-table-column type="selection" header-align="center" align="center" width="50"> </el-table-column> <el-table-column prop="relatedOrderNo" header-align="center" align="left" min-width="100" label="生产订单"> </el-table-column> <el-table-column prop="partNo" header-align="center" align="left" min-width="100" label="物料编码"> </el-table-column> <el-table-column prop="partDesc" header-align="center" align="left" min-width="200" label="物料名称"> </el-table-column> <el-table-column prop="unit" header-align="center" align="left" min-width="80" label="物料单位"> </el-table-column> <el-table-column prop="orderQty" header-align="center" align="right" min-width="80" label="订单数量"> </el-table-column> <el-table-column prop="requiredQty" header-align="center" align="right" min-width="80" label="可入库数"> </el-table-column> <el-table-column prop="countRollNo" header-align="center" align="right" min-width="80" label="可入库卷数"> </el-table-column> </el-table> <!-- 分页--> <el-pagination style="margin-top: 5px" @size-change="sizeChangeHandle2" @current-change="currentChangeHandle2" :current-page="pageIndex2" :page-sizes="[20, 50, 100, 200, 500]" :page-size="pageSize2" :total="totalPage2" layout="total, sizes, prev, pager, next, jumper"> </el-pagination> </el-header> <el-main style="width: 880px;height: 27px;margin-top: 70px;padding: 0 0 0 0;text-align:center"> <div> <el-button type="primary" @click="addPart">添加>></el-button> <el-button type="primary" @click="deletePart">删除<<</el-button> </div> </el-main> <el-footer style="width: 880px;height: 200px;padding: 0 0 0 0;"> <span style="font-size: 12px">已选物料</span> <div class="rq"> <el-table height="200px" :data="partList2" border ref="partTable2" @selection-change="selectionPart2" highlight-current-row style="width: 100%"> <el-table-column type="selection" header-align="center" align="center" width="50"> </el-table-column> <el-table-column prop="relatedOrderNo" header-align="center" align="center" min-width="80" label="生产订单"> </el-table-column> <el-table-column prop="partNo" header-align="center" align="center" min-width="80" label="物料编码"> </el-table-column> <el-table-column prop="partDesc" header-align="center" align="left" min-width="150" label="物料名称"> </el-table-column> <el-table-column prop="" header-align="center" align="center" min-width="100" label="要求入库数量"> <template slot-scope="scope"> <el-input :controls="false" v-model="scope.row.requiredQty" @input="value => scope.row.requiredQty = value.match(/^(\d+\.?\d*|\.\d+)$/) ? value : ''" style="height: 11px; width: 98%;"> </el-input> </template> </el-table-column> </el-table> </div> </el-footer> </el-container> <el-footer style="height:30px;margin-top: 35px;text-align:center"> <el-button type="primary" :loading="saveLoading" @click="saveInboundDetail">保存</el-button> <el-button type="primary" @click="detailModal = false">关闭</el-button> </el-footer> </el-dialog>
<el-dialog title="选择工单" :close-on-click-modal="false" v-drag :visible.sync="seqNoModalFlag" width="1000px"> <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;"> <el-row :gutter="20"> <el-col :span="4"> <el-form-item :label="'生产订单'"> <el-input v-model="seqNoData.orderno"></el-input> </el-form-item> </el-col> <el-col :span="4"> <el-form-item> <span slot="label" style="" @click="getBaseList(515)"><a herf="#">机台</a></span>
<el-input v-model="seqNoData.sResourceid"></el-input> </el-form-item> </el-col> <el-col :span="4"> <el-form-item> <span slot="label" style="" @click="getBaseList(216)"><a herf="#">加工中心</a></span> <el-input v-model="seqNoData.sWorkcenterno"></el-input> </el-form-item> </el-col> <el-col :span="4"> <el-form-item :label="'派工日期'"> <el-date-picker style="width: 100%" v-model="seqNoData.startDate" type="date" value-format="yyyy-MM-dd" placeholder="选择日期"> </el-date-picker> </el-form-item> </el-col> <el-col :span="4"> <el-form-item :label="'到'"> <el-date-picker style="width: 100%" v-model="seqNoData.endDate" type="date" value-format="yyyy-MM-dd" placeholder="选择日期"> </el-date-picker> </el-form-item> </el-col> </el-row> <el-row :gutter="20"> <el-col :span="6"> <el-form-item> <el-button type="primary" @click="searchSOSRouting()" style="margin-top: 5px" class="">查询</el-button>
</el-form-item> </el-col> </el-row> </el-form> <el-table :height="400" :data="seqNoList" border style="width: 100%;"> <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> <el-table-column fixed="left" header-align="center" align="center" width="60" label="操作"> <template slot-scope="scope"> <a type="text" size="small" @click="chooseSOS(scope.row)">选择</a> </template> </el-table-column> </el-table> <el-footer style="height:40px;margin-top: 10px;text-align:center"> <el-button type="primary" @click="seqNoModalFlag = false">关闭</el-button> </el-footer> </el-dialog> <el-dialog title="保存工单" :close-on-click-modal="false" v-drag :visible.sync="saveSeqNoModalFlag" width="750px"> <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="notifyOrderData.orderNo" disabled></el-input> </el-form-item> </el-col> <el-col :span="6"> <el-form-item :label="'机台'"> <el-input v-model="notifyOrderData.sResourceID" disabled></el-input> </el-form-item> </el-col> <el-col :span="6"> <el-form-item :label="'工单数量'"> <el-input v-model="notifyOrderData.qtyRequired" disabled></el-input> </el-form-item> </el-col> </el-row> <el-row :gutter="20"> <el-col :span="6"> <el-form-item :label="'物料'"> <el-input v-model="notifyOrderData.partNo" disabled></el-input> </el-form-item> </el-col> <el-col :span="12"> <el-form-item :label="'物料名称'"> <el-input v-model="notifyOrderData.partDesc" disabled style="width: 204%"></el-input> </el-form-item> </el-col> </el-row> <el-row :gutter="20"> <el-col :span="6"> <el-form-item :label="'要求发料时间'"> <el-date-picker style="width: 100%" v-model="notifyOrderData.needDate" type="datetime" value-format="yyyy-MM-dd HH:mm" placeholder="选择日期"> </el-date-picker> </el-form-item> </el-col> <el-col :span="6"> <el-form-item label="机台"> <el-input v-model="notifyOrderData.locationNo" disabled></el-input> </el-form-item> </el-col> <el-col :span="6"> <el-form-item :label="'此次领料数量'"> <el-input-number v-model="notifyOrderData.issureQty" style="padding: 0px;width: 100%" :controls="false" :step="0" :min="0" class="text-right"></el-input-number> </el-form-item> </el-col> <el-col :span="6"> <el-form-item :label="' '"> <el-button type="primary" @click="qtyAllForSeqNo()" style="margin-top: 4%;">全数领料</el-button> </el-form-item> </el-col> </el-row> </el-form> <el-footer style="height:40px;margin-top: 10px;text-align:center"> <el-button type="primary" @click="saveSOS()">保存</el-button> <el-button type="primary" @click="saveSeqNoModalFlag=false">关闭</el-button> </el-footer> </el-dialog> <!-- 入库明细 --> <el-dialog title="入库明细" :close-on-click-modal="false" v-drag :visible.sync="detailModal2" width="900px"> <el-table height="400px" :data="detailList2" border style="width: 100%;"> <el-table-column v-for="(item,index) in columnDetailList2" :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"> </el-table-column> </el-table> <el-footer style="height:35px;margin-top: 15px;text-align:center"> <el-button type="primary" @click="detailModal2 = 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-button type="primary" @click="openSelectMaterialModalForDetail()" class="">添加</el-button> </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 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"> <div v-if="item.columnProp === 'qtyToIssue'"> <el-input v-model="scope.row.qtyToIssue" type="number" style="height: 11px; width: 98%;" :step="0" :min="0"></el-input> </div> <div v-else-if="item.columnProp === 'remark'"> <el-input v-model="scope.row.remark" style="padding: 0;width: 100%"></el-input> </div> <div v-else> <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>
</div> </template> </el-table-column> <!-- <el-table-column prop="" header-align="center" align="center" min-width="50" 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="saveNoOrderMaterialDetail()">保存</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="selectMaterialModalFlag" width="1080px"> <el-form :inline="true" label-position="top"> <el-form-item label="物料编号"> <el-input v-model="componentPartNo" style="width: 120px"></el-input> </el-form-item> <el-form-item label=" "> <el-button type="primary" @click="loadAvailableMaterialList()" class="">查询</el-button> </el-form-item> </el-form> <el-container style="margin-top: 0px;"> <!-- 左侧:可选物料 --> <el-main style="width: 470px;padding: 1px"> <span style="font-size: 12px">可选物料:</span> <el-table height="350px" :data="availableMaterialList" border ref="itemTable1" @row-click="itemClickRow1" @selection-change="handleAvailableSelectionChange" highlight-current-row style="width: 100%" v-loading="selectMaterialLoading"> <el-table-column type="selection" header-align="center" align="center" :selectable="selectFlag" width="50"> </el-table-column> <el-table-column prop="partNo" header-align="center" align="center" min-width="170" label="物料号"> </el-table-column> <el-table-column prop="height" header-align="center" align="center" min-width="80" label="高度"> </el-table-column> <el-table-column prop="isInWh" header-align="center" align="center" min-width="80" label="是否在立库"> </el-table-column> </el-table> <el-pagination @size-change="handleAvailableSizeChange" @current-change="handleAvailableCurrentChange" :current-page="availableMaterialPage" :page-sizes="[50, 100]" :page-size="availableMaterialLimit" small layout="total, prev, pager, next" :total="availableMaterialTotal" style="margin-top: 10px; text-align: right;"> </el-pagination> </el-main> <!-- 中间:操作按钮 --> <el-main style="width: 100px;padding: 1px"> <div style="margin-top: 180px;margin-left: 18px"> <el-button type="primary" @click="addToSelected">添加>></el-button> </div> <div style="margin-top: 15px;margin-left: 18px"> <el-button type="primary" @click="removeFromSelected">删除<< </el-button> </div> </el-main> <!-- 右侧:已选物料 --> <el-main style="width: 470px;padding: 1px"> <span style="font-size: 12px">已有物料:</span> <el-table height="400px" :data="selectedMaterialList" border ref="itemTable2" @row-click="itemClickRow2" @selection-change="handleSelectedSelectionChange" highlight-current-row style="width: 100%"> <el-table-column type="selection" header-align="center" align="center" :selectable="selectFlag" width="50"> </el-table-column> <el-table-column prop="partNo" header-align="center" align="center" min-width="170" label="物料号"> </el-table-column> <el-table-column prop="height" header-align="center" align="center" min-width="80" label="高度"> </el-table-column> <el-table-column prop="isInWh" header-align="center" align="center" min-width="80" label="是否在立库"> </el-table-column> </el-table> </el-main> </el-container> <el-footer style="height:40px;margin-top: 20px;text-align:center"> <el-button type="primary" @click="confirmSelectMaterial()">保存</el-button> <el-button @click="selectMaterialModalFlag = false">关闭</el-button> </el-footer> </el-dialog>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div></template>
<script>import { searchNoOrderNotifyHeader, getNotifyNoOrderDetailByType, noOrderList, saveNoOrderMaterialDetail, getNoOrderMaterialList} from '@/api/orderIssure/noOrderIssueNotify.js'// rqrq - 导入推送WCS相关API(使用领料申请的通用API)
import { checkIssueNotifyInventory, pushInventoryToWcs} from '@/api/orderIssure/soIssueNotify.js'import { getSiteAndBuByUserName, createNotify, closeInboundNotification, checkUserHasUnissueShipment, cancelIssueShipment, deleteNotifyUnissue,} from '@/api/shipment/shipmentIssue.js'import Chooselist from '@/views/modules/common/Chooselist_eam'import { getChooselist } from '@/api/chooselist/chooselist.js'import { getTableDefaultListLanguage, getTableUserListLanguage,} from '@/api/table.js'export default { components: { Chooselist, }, data() { return { columnsProp: ['createBy', 'updateBy'], // 导出 start
exportData: [], exportName: '收货入库' + this.dayjs().format('YYYYMMDDHHmmss'), exportHeader: ['收货入库'], exportFooter: [], exportList: [], // 导出 end
tagNo: '', tagType: '', searchData: { site: '', userName: this.$store.state.user.name, orderNo: '', orderType: '', orderStatus: '', orderStatusList: [], startDate: '', endDate: '', page: 1, limit: 10, }, detailSearchData: { site: '', buNo: '', orderNo: '', partNo: '', partDesc: '', partNos: '', orderType: '', relatedOrderNo: '', status: '', page: 1, limit: 10, }, height: 200, secondHeight: 200, pageIndex: 1, pageSize: 20, totalPage: 0, pageIndex2: 1, pageSize2: 20, totalPage2: 0, modalFlag: false, modalDisableFlag: false, notifyOrderData: { partNo: '', orderno: '', itemno: '', seqno: '', partDesc: '', qtyrequired: '', sResourceid: '', issureQty: '', locationNo: '', needDate: '', }, modalData: { site: '', bu: '', buNo: '', flag: '', orderNo: '', orderType: '', orderStatus: '', requiredInboundDate: '', supplierId: '', supplierName: '', remarks: '', createdBy: '', updatedBy: '', }, seqNoData: { site: localStorage.getItem('site'), bu: '', orderno: '', seqno: '', sResourceid: '', sWorkcenterno: '', operatorId: '', sShiftno: '', startDate: '', endDate: '', }, dataList: [], detailList: [], userBuList: [], inboundSelection: [], inboundDetailSelection: [], partSelections1: [], partSelections2: [], partList1: [], partList2: [], dataListLoading: false, // 展示列集
columnList: [ { userId: this.$store.state.user.name, functionId: 610, serialNumber: '610Table1OrderNo', tableId: '610Table1', tableName: '收货入库任务表', columnProp: 'notifyNo', 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: 610, serialNumber: '610Table1OrderType', tableId: '610Table1', tableName: '收货入库任务表', columnProp: 'orderType', 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: 610, serialNumber: '610Table1OrderStatus', tableId: '610Table1', tableName: '收货入库任务表', columnProp: 'status', 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: 610, serialNumber: '610Table1SupplierId', tableId: '610Table1', tableName: '收货入库任务表', columnProp: 'supplierId', 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: 610, serialNumber: '610Table1SupplierName', tableId: '610Table1', tableName: '收货入库任务表', columnProp: 'supplierName', headerAlign: 'center', align: 'left', columnLabel: '供应商名称', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 200, }, */ { userId: this.$store.state.user.name, functionId: 610, serialNumber: '610Table1RequiredInboundDate', tableId: '610Table1', tableName: '收货入库任务表', columnProp: 'notifyDate', headerAlign: 'center', align: 'center', columnLabel: '申请单日期', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 150, }, { userId: this.$store.state.user.name, functionId: 610, serialNumber: '610Table1CreatedDate', tableId: '610Table1', tableName: '收货入库任务表', columnProp: 'enteredDate', headerAlign: 'center', align: 'center', columnLabel: '创建时间', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 170, }, { userId: this.$store.state.user.name, functionId: 610, serialNumber: '610Table1CreatedBy', tableId: '610Table1', tableName: '收货入库任务表', columnProp: 'username', headerAlign: 'center', align: 'center', columnLabel: '创建人', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 100, },
// rqrq - 添加推送WCS字段
{ userId: this.$store.state.user.name, functionId: 610, serialNumber: '610Table1PushWcsFlag', tableId: '610Table1', tableName: '收货入库任务表', columnProp: 'pushWcsFlag', headerAlign: 'center', align: 'center', columnLabel: '推送WCS', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 100, }, /* { userId: this.$store.state.user.name, functionId: 610, serialNumber: '610Table1UpdatedDate', tableId: '610Table1', tableName: '收货入库任务表', columnProp: 'updatedDate', headerAlign: 'center', align: 'center', columnLabel: '更新时间', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 170, }, { userId: this.$store.state.user.name, functionId: 610, serialNumber: '610Table1UpdatedBy', tableId: '610Table1', tableName: '收货入库任务表', columnProp: 'updatedBy', headerAlign: 'center', align: 'center', columnLabel: '更新人', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 100, }, */ ], columnList2: [ { userId: this.$store.state.user.name, functionId: 701001, serialNumber: '701001Table2Orderno', tableId: '701001Table2', tableName: '查询派工单', columnProp: 'orderNo', headerAlign: 'center', align: 'center', columnLabel: 'SHIPMENTID', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 120, }, { userId: this.$store.state.user.name, functionId: 701001, serialNumber: '701001Table2Itemno', tableId: '701001Table2', tableName: '查询派工单', columnProp: 'itemNo', headerAlign: 'center', align: 'right', columnLabel: '工序', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 50, }, { userId: this.$store.state.user.name, functionId: 701001, serialNumber: '701001Table2ItemDesc', tableId: '701001Table2', tableName: '查询派工单', columnProp: 'itemDesc', 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: 701001, serialNumber: '701001Table2PartNo', tableId: '701001Table2', tableName: '查询派工单', columnProp: 'partNo', 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: 701001, serialNumber: '701001Table2Qtyrequired', tableId: '701001Table2', tableName: '查询派工单', columnProp: 'qtyRequired', 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: 701001, serialNumber: '701001Table2Qtyreported', tableId: '701001Table2', tableName: '查询派工单', columnProp: 'qtyReported', 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: 701001, serialNumber: '701001Table2SScheduleddate', tableId: '701001Table2', tableName: '查询工单', columnProp: 'sScheduledDate', 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: 701001, serialNumber: '701001Table2SWorkcenterno', tableId: '701001Table2', tableName: '查询派工单', columnProp: 'sWorkCenterNo', 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: 701001, serialNumber: '701001Table2WorkCenterDesc', tableId: '701001Table2', tableName: '查询工单', columnProp: 'workCenterDesc', 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: 701001, serialNumber: '701001Table2SResourceid', tableId: '701001Table2', tableName: '查询派工单', columnProp: 'sResourceID', headerAlign: 'center', align: 'left', columnLabel: '机台编码', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', columnWidth: 60, }, { userId: this.$store.state.user.name, functionId: 701001, serialNumber: '701001Table2ResourceDesc', tableId: '701001Table2', tableName: '查询派工单', columnProp: 'resourceDesc', 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: 701001, serialNumber: '701001Table2OperatorDesc', tableId: '701001Table2', tableName: '查询派工单', columnProp: 'operatorDesc', 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: 555001, serialNumber: '555001Table3ComponentPartNo', tableId: '555001Table3', tableName: '领料申请BOM子表', columnProp: 'componentPartNo', headerAlign: 'center', align: 'left', columnLabel: '物料编码', columnHidden: false, columnImage: false, columnSortable: true, sortLv: 0, status: true, fixed: false, columnWidth: 80, }, { userId: this.$store.state.user.name, functionId: 555001, serialNumber: '555001Table3QtyRequired', tableId: '555001Table3', tableName: '领料申请BOM子表', columnProp: 'isInWh', headerAlign: 'center', align: 'center', columnLabel: '是否在立库', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: false, columnWidth: 50, }, { userId: this.$store.state.user.name, functionId: 555001, serialNumber: '555001Table3QtyToIssue', tableId: '555001Table3', tableName: '领料申请BOM子表', columnProp: 'qtyToIssue', headerAlign: 'center', align: 'right', columnLabel: '本次申请数量', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: false, columnWidth: 60, }, { userId: this.$store.state.user.name, functionId: 555001, serialNumber: '555001Table3Remark', tableId: '555001Table3', tableName: '领料申请BOM子表', columnProp: 'remark', headerAlign: 'center', align: 'left', columnLabel: '备注', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: false, columnWidth: 150, }, ], columnDetailList: [ { userId: this.$store.state.user.name, functionId: 444002, serialNumber: '555001Table1ItemNo', tableId: '555001Table1', tableName: '领料申请工单子表', columnProp: 'itemNo', headerAlign: 'center', align: 'right', columnLabel: '序号', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: false, columnWidth: 50, }, /* { userId: this.$store.state.user.name, functionId: 444002, serialNumber: '555001Table1SeqNo', tableId: '555001Table1', tableName: '领料申请派工单子表', columnProp: 'seqNo', headerAlign: 'center', align: 'center', columnLabel: '派工单号', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: false, columnWidth: 150, }, */ { userId: this.$store.state.user.name, functionId: 444002, serialNumber: '555001Table1SOOrderNo', tableId: '555001Table1', tableName: '领料申请工单子表', columnProp: 'soorderNo', headerAlign: 'center', align: 'center', columnLabel: '生产订单号', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: false, columnWidth: 120, }, { userId: this.$store.state.user.name, functionId: 444002, serialNumber: '555001Table1ReleaseNo', tableId: '555001Table1', tableName: '领料申请工单子表', columnProp: 'releaseNo', headerAlign: 'center', align: 'center', columnLabel: 'ReleaseNo', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: false, columnWidth: 80, }, { userId: this.$store.state.user.name, functionId: 444002, serialNumber: '555001Table1SequenceNo', tableId: '555001Table1', tableName: '领料申请工单子表', columnProp: 'sequenceNo', headerAlign: 'center', align: 'center', columnLabel: 'SequenceNo', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: false, columnWidth: 80, }, { userId: this.$store.state.user.name, functionId: 444002, serialNumber: '555001Table1NeedDate', tableId: '555001Table1', tableName: '领料申请派工单子表', columnProp: 'needDate', headerAlign: 'center', align: 'left', columnLabel: '要求发料时间', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: false, columnWidth: 80, }, ], rules: { bu: [ { required: true, message: ' ', trigger: ['blur', 'change'], }, ], orderType: [ { required: true, message: ' ', trigger: ['blur', 'change'], }, ], requiredInboundDate: [ { required: true, message: ' ', trigger: ['blur', 'change'], }, ], }, searchLoading: false, saveLoading: false, activeTable: 'inboundDetail', detailModal: false, authSearch: false, authSave: false, authUpdate: false, authDelete: false, authArchive: false, authClose: false, authIssue: false, editBatchVisible: false, menuId: this.$route.meta.menuId, tempWareHouseRow: {}, detailList2: [], detailModal2: false, currentRow: {}, seqNoList: [], seqNoModalFlag: false, saveSeqNoModalFlag: false, bomLoadFlag: false, sobomList: [], itemNo: '', materialModalFlag: false, sobomData: {}, notifyNo: '', // 选择物料弹框相关
selectMaterialModalFlag: false, availableMaterialList: [], // 左侧可选物料列表
selectedMaterialList: [], // 右侧已选物料列表
availableMaterialSelections: [], // 左侧选中的行
selectedMaterialSelections: [], // 右侧选中的行
selectMaterialLoading: false, modelCode: '', // 模板编号
modelName: '', // 模板名称
// 左侧表格分页相关
availableMaterialPage: 1, // 当前页码
availableMaterialLimit: 100, // 每页条数
availableMaterialTotal: 0, // 总条数
componentPartNo: '', // 物料编码搜索
// 申请明细弹框相关
isMaterialDetailModal: false, // 标识是否从申请明细弹框打开选择物料弹框
clickrow: {}, // rqrq - 推送WCS预览相关数据
previewDialogVisible: false, previewLoading: false, previewData: [], currentNotifyRow: null, // 当前要推送WCS的通知单行数据 - rqrq
} },
mounted() { this.$nextTick(() => { this.height = window.innerHeight / 2 - 100 /*第二个表格高度的动态调整*/ this.secondHeight = window.innerHeight - this.height - 170 }) },
created() { // 按钮控制
this.getButtonAuthData() // 获取用户的 site 和 bu
//this.getSiteAndBuByUserName()
// 动态列
//this.getTableUserColumn(this.$route.meta.menuId + 'table1', 1)
//this.getTableUserColumn(this.$route.meta.menuId + 'table2', 2)
if (!this.authSearch) { // 获取数据列表
this.getDataList() } },
methods: { // 获取用户的bu
getSiteAndBuByUserName() { let tempData = { username: this.$store.state.user.name, } getSiteAndBuByUserName(tempData).then(({ data }) => { if (data.code === 0) { this.userBuList = data.rows } }) },
// 获取数据列表
getDataList() { this.searchData.limit = this.pageSize this.searchData.page = this.pageIndex this.searchData.orderStatus = this.searchData.orderStatusList.join(',') console.log('this.', this.searchData)
this.searchLoading = true searchNoOrderNotifyHeader(this.searchData) .then(({ data }) => { if (data.code === 0) { this.dataList = data.page.list this.pageIndex = data.page.currPage this.pageSize = data.page.pageSize this.totalPage = data.page.totalCount console.log('this.dataList', this.dataList)
// 判断是否全部存在数据
if (this.dataList.length > 0) { // 设置选中行并高亮第一行
this.$nextTick(() => { this.$refs.inboundTable.setCurrentRow(this.dataList[0]) this.currentRow = JSON.parse(JSON.stringify(this.dataList[0])) // 调用getNotifyNoDetail方法获取入库明细
this.getNotifyNoOrderDetailByType() }) } else { this.currentRow = {} this.detailList = [] } } }) .finally(() => { this.searchLoading = false }) },
// 每页数
sizeChangeHandle(val) { this.pageSize = val this.pageIndex = 1 this.getDataList() },
// 当前页
currentChangeHandle(val) { this.pageIndex = val this.getDataList() },
// 子明细每页数
sizeChangeHandle2(val) { this.pageSize2 = val this.pageIndex2 = 1 this.searchTypeChange() },
// 子明细当前页
currentChangeHandle2(val) { this.pageIndex2 = val this.searchTypeChange() },
saveModal() { this.modalData = { flag: '1', site: '', orderNo: '', orderType: '', orderStatus: '', requiredInboundDate: '', supplierId: '', supplierName: '', remarks: '', createdBy: this.$store.state.user.name, } this.modalDisableFlag = false this.modalFlag = true },
updateModal(row) { if (this.currentRow.orderType === '采购入库') { this.$message.warning('采购入库单据不能编辑!') return } this.modalData = { flag: '2', site: row.site, bu: row.site + '_' + row.buNo, buNo: row.buNo, orderNo: row.orderNo, orderType: row.orderType, requiredInboundDate: row.requiredInboundDate, supplierId: row.supplierId, supplierName: row.supplierName, remarks: row.remarks, updatedBy: this.$store.state.user.name, } this.modalDisableFlag = true this.modalFlag = true },
saveData() { if (this.modalData.orderType === '' || this.modalData.orderType == null) { this.$message.warning('请选择单据类型!') return } if ( this.modalData.requiredInboundDate === '' || this.modalData.requiredInboundDate == null ) { this.$message.warning('请选择要求入库日期!') return } this.saveLoading = true if (this.modalData.flag === '1') { // 新增
this.modalData.orderType = '退料入库' this.modalData.site = localStorage.getItem('site') createNotify(this.modalData) .then(({ data }) => { if (data && data.code === 0) { this.getDataList() this.modalFlag = false this.$message.success('操作成功') } else { this.$message.error(data.msg) } }) .finally(() => { this.saveLoading = false }) } else { // 修改
updateInboundNotification(this.modalData) .then(({ data }) => { if (data && data.code === 0) { this.getDataList() this.modalFlag = false this.$message.success('操作成功') } else { this.$message.error(data.msg) } }) .finally(() => { this.saveLoading = false }) } },
// 删除
deleteModal() { if (this.currentRow.orderType === '采购入库') { this.$message.warning('采购入库单据不能编辑!') return } if (this.inboundSelection.length === 0) { this.$message.warning('请勾选要删除的单据!') return } this.$confirm( `是否删除该 ` + this.inboundSelection.length + ` 条记录?`, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning', } ).then(() => { let tempData = { submitList: this.inboundSelection, } deleteInboundNotification(tempData).then(({ data }) => { if (data && data.code === 0) { this.getDataList() this.inboundSelection = [] this.$message.success('操作成功') } else { this.$message.error(data.msg) } }) }) },
// 归档
archiveModal() {},
// 关闭
closeModal(row) { this.$confirm(`确认关闭 ` + row.notifyNo + ` 记录?`, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning', }).then(() => { closeInboundNotification(row).then(({ data }) => { if (data && data.code === 0) { this.getDataList() this.$message.success('操作成功') } else { this.$message.error(data.msg) } }) }) },
// 下达
issueModal(row) { if (this.currentRow.orderType === '采购入库') { this.$message.warning('采购入库单据不能编辑!') return } issueInboundNotification(row).then(({ data }) => { if (data && data.code === 0) { this.getDataList() this.$message.success('操作成功') } else { this.$message.error(data.msg) } }) },
// 列表表格选择替换
tabClick(tab, event) { // 刷新列表数据
this.refreshCurrentTabTable() },
// 当前值发生变化的时候修改
changeCurrentRow(row, oldRow) { // 判断是否是获取焦点的事件
if (row) { this.currentRow = JSON.parse(JSON.stringify(row)) //刷新当前页表
this.getNotifyNoOrderDetailByType() } },
// 复选
selectionInbound(val) { this.inboundSelection = val },
// 明细复选
selectionInboundDetail(val) { this.inboundDetailSelection = val },
rowStyle({ row }) { if (this.currentRow.notifyNo === row.notifyNo) { return { 'background-color': '#E8F7F6', cursor: 'pointer' } } },
// 单机选中信息
inboundClickRow(row, column) { console.log('row', row)
this.currentRow = JSON.parse(JSON.stringify(row)) // 点击主表行时,立即刷新并加载入库明细
this.getNotifyNoOrderDetailByType() },
// 刷新页签的table数据
refreshCurrentTabTable() { if (this.activeTable === 'inboundDetail') { this.getInboundDetail() } },
// 查询物料缺陷跟踪
getInboundDetail() { let templateData = { site: this.currentRow.site, buNo: this.currentRow.buNo, orderNo: this.currentRow.orderNo, } /* getInboundDetail(templateData).then(({ data }) => { this.detailList = data.rows }) */ },
// 新增明细
addInboundDetailModal() { if (this.currentRow.orderType === '采购入库') { this.$message.warning('采购入库单据不能编辑!') return } this.detailSearchData = { site: this.currentRow.site, buNo: this.currentRow.buNo, orderNo: this.currentRow.orderNo, orderType: this.currentRow.orderType, relatedOrderNo: '', status: '', partNo: '', partDesc: '', partNos: '', page: 1, limit: 10, } this.partSelections1 = [] this.partSelections2 = [] this.partList1 = [] this.partList2 = [] this.pageIndex2 = 1 this.pageSize2 = 20 this.totalPage2 = 0 if (this.currentRow.orderType === '生产入库') { this.detailSearchData.status = '已开工' } this.handleGetProjectPartList() },
handleGetProjectPartList() { this.detailSearchData.limit = this.pageSize2 this.detailSearchData.page = this.pageIndex2 getInboundPartList(this.detailSearchData).then(({ data }) => { if (data && data.code === 0) { this.partList1 = data.page.list this.pageIndex2 = data.page.currPage this.pageSize2 = data.page.pageSize this.totalPage2 = data.page.totalCount this.detailModal = true } }) },
chooseSOSModal() { this.seqNoData = { site: localStorage.getItem('site'), orderno: '', seqno: '', sResourceid: '', sWorkcenterno: '', operatorId: '', sShiftno: '', startDate: this.dayjs().format('YYYY-MM-DD'), endDate: this.dayjs().format('YYYY-MM-DD'), } this.searchSOSRouting() this.seqNoModalFlag = true }, searchSOSRouting() { getSOScheduledRoutingListForIssure(this.seqNoData).then(({ data }) => { if (data.code === 0) { this.seqNoList = data.rows } }) }, // 可选物料
partClickRow1(row) { this.$refs.partTable1.toggleRowSelection(row) },
// 已有物料
partClickRow2(row) { this.$refs.partTable2.toggleRowSelection(row) },
selectionPart1(val) { this.partSelections1 = val },
selectionPart2(val) { this.partSelections2 = val }, chooseSOS(row) { if (this.dataList.length > 0) { let stop = false for (let i = 0; i < this.dataList.length; i++) { if (this.dataList[i].seqNo == row.seqno) { stop = true } } if (stop) { this.$alert('已经选择过此派工单,请返回点击明细直接操作!!', '提示', { confirmButtonText: '确定', }) return false } }
this.notifyOrderData.partNo = row.partNo this.notifyOrderData.orderNo = row.orderNo this.notifyOrderData.itemNo = row.itemNo this.notifyOrderData.seqNo = row.seqNo this.notifyOrderData.partDesc = row.partDesc this.notifyOrderData.qtyRequired = row.qtyRequired this.notifyOrderData.sResourceID = row.sResourceID this.notifyOrderData.issureQty = '' this.notifyOrderData.needDate = this.dayjs().format('YYYY-MM-DD HH:mm') this.notifyOrderData.locationNo = row.sResourceID this.saveSeqNoModalFlag = true },
qtyAllForSeqNo() { this.notifyOrderData.issureQty = this.notifyOrderData.qtyRequired },
saveSOS() { if ( this.notifyOrderData.needDate == null || this.notifyOrderData.needDate == '' ) { this.$message.warning('请选择时间!') return false } if ( this.notifyOrderData.issureQty == null || this.notifyOrderData.issureQty == '' || this.notifyOrderData.issureQty <= 0 ) { this.$message.warning('请填写领取数量!') return false } let row = this.notifyOrderData if (this.dataList.length > 0) { let stop = false for (let i = 0; i < this.dataList.length; i++) { if (this.dataList[i].seqNo == row.seqno) { stop = true } } if (stop) { this.$alert('已经选择过此工单,请返回点击明细直接操作!!', '提示', { confirmButtonText: '确定', }) return false } } this.$confirm('确定选择工单' + row.seqno + '?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning', }).then(() => { let inData = { site: localStorage.getItem('site'), notifyNo: this.notifyNo, fGPartNo: row.partNo, sOOrderNo: row.orderno, opsItemNo: row.itemno, seqNo: row.seqno, locationNo: row.locationNo, needDate: row.needDate, issureQty: row.issureQty, } saveSOIssueNotifyOrderList(inData).then(({ data }) => { if (data.code === 0) { this.saveSeqNoModalFlag = false this.getNotifyNoOrderDetailByType() this.enterSOS(row) this.itemNo = data.itemNo } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定', }) } }) }) }, getNotifyNoOrderDetailByType() { if (!this.currentRow || !this.currentRow.notifyNo) { this.detailList = [] return }
let inData = { site: this.currentRow.site || localStorage.getItem('site'), notifyNo: this.currentRow.notifyNo, }
getNotifyNoOrderDetailByType(inData) .then(({ data }) => { if (data.code === 0) { this.detailList = data.rows || [] } else { this.detailList = [] } }) .catch(() => { this.detailList = [] }) }, enterSOS(row) { this.seqNoModalFlag = false this.materialModalFlag = true this.sobomList = [] this.sobomData = { orderno: row.orderno, seqno: row.seqno, partNo: row.partNo, } this.bomLoadFlag = true let inData = { site: localStorage.getItem('site'), notifyNo: this.notifyNo, orderno: row.orderno, seqno: row.seqno, partNo: row.partNo, itemno: row.itemno, } getSOSBOMForIssure(inData).then(({ data }) => { this.bomLoadFlag = false if (data.code === 0) { this.sobomList = data.rows } }) }, // 改变事件
searchTypeChange() { // 使用 map 提取 partNo 并加上单引号
let partNos = this.partList2.map((part) => part.partNo) // 使用 join 将 partNo 连接成一个字符串
this.detailSearchData.partNos = partNos.join(',') this.handleGetProjectPartList() },
// 添加物料
addPart() { if (this.partSelections1 == null || this.partSelections1.length === 0) { this.$message.warning('请选择可选物料!') return } this.partSelections1.forEach((item) => { this.partList2.push(item) }) this.searchTypeChange() },
// 删除物料
deletePart() { if (this.partSelections2 == null || this.partSelections2.length === 0) { this.$message.warning('请选择已选物料!') return } this.partSelections2.forEach((item) => { // 使用 filter 过滤掉 partList2 中与 selection.part_no 相同的项
this.partList2 = this.partList2.filter( (part) => part.partNo !== item.partNo ) }) this.searchTypeChange() },
// 新增明细
saveInboundDetail() { let tempData = { orderNo: this.detailSearchData.orderNo, createdBy: this.$store.state.user.name, partList: this.partList2, } this.saveLoading = true saveInboundDetail(tempData) .then(({ data }) => { if (data && data.code === 0) { this.getInboundDetail() this.detailModal = false this.$message.success('操作成功') } else { this.$message.error(data.msg) } }) .finally(() => { this.saveLoading = false }) },
// 删除物料缺陷跟踪
deleteInboundDetail() { if (this.currentRow.orderType === '采购入库') { this.$message.warning('采购入库单据不能编辑!') return } if (this.inboundDetailSelection.length === 0) { this.$message.warning('请勾选要删除的单据!') return } this.$confirm( `是否删除该 ` + this.inboundDetailSelection.length + ` 条记录?`, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning', } ).then(() => { let tempData = { submitList: this.inboundDetailSelection, } deleteInboundDetail(tempData).then(({ data }) => { if (data && data.code === 0) { this.getInboundDetail() this.inboundDetailSelection = [] this.$message.success('操作成功') } else { this.$message.error(data.msg) } }) }) },
// 批量编辑模态框
editBatchModel() { if (this.currentRow.orderType === '采购入库') { this.$message.warning('采购入库单据不能编辑!') return } if (this.editBatchVisible) { this.editBatchVisible = false } else { this.editBatchVisible = true } },
// 批量保存
batchModel() { let params = [] params = this.detailList this.saveLoading = true updateInboundDetail(params) .then(({ data }) => { if (data && data.code === 0) { this.getInboundDetail() this.$message.success(data.msg) this.editBatchVisible = false } else { this.$message.error(data.msg) } }) .finally(() => { this.saveLoading = false }) },
// 入库明细
inboundDetailModal(row) { getInboundDetail2(row).then(({ data }) => { if (data && data.code === 0) { this.detailList2 = data.rows } else { this.detailList2 = [] } }) this.detailModal2 = true },
// 库位输入校验
supplierBlur(tagNo) { let tempData = { tagno: tagNo, conditionSql: " and SupplierID = '" + this.modalData.supplierId + "'" + " and site = '" + this.modalData.site + "'", } getChooselist(tempData).then(({ data }) => { if (data && data.code === 0) { if (data.baseListData.length > 0) { this.modalData.supplierId = data.baseListData[0].SupplierID this.modalData.supplierName = data.baseListData[0].SupplierName } else { this.modalData.supplierName = '' } } }) },
chooseWareHouse(row) { this.tempWareHouseRow = row this.getBaseList(20) }, saveNoOrderMaterialDetail() { for (let i = 0; i < this.sobomList.length; i++) { if ( this.sobomList[i].qtyToIssue === '' || this.sobomList[i].qtyToIssue == null ) { this.$message.warning('第'+(i+1)+'行数量为空,请填写申请数量!') return false } this.sobomList[i].notifyNo = this.currentRow.notifyNo this.sobomList[i].site = this.$store.state.user.site }
let materialList = this.sobomList.filter((item) => item.qtyToIssue > 0) if (materialList.length == 0) { this.$alert('没有需要保存的内容!', '提示', { confirmButtonText: '确定', }) return false } console.log('this.sobomList', materialList) saveNoOrderMaterialDetail(materialList).then(({ data }) => { if (data.code === 0) { this.materialModalFlag = false this.getNotifyNoOrderDetailByType() this.$message.success('操作成功') } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定', }) } }) },
// 获取基础数据列表S
getBaseList(val, type) { this.tagNo = val this.tagType = type this.$nextTick(() => { let strVal = '' if (val === 506) { strVal = this.modalData.supplierId this.$refs.baseList.init(val, strVal) } if (val === 20) { strVal = this.tempWareHouseRow.inWarehouse this.$refs.baseList.init(val, strVal) } }) },
// 列表方法的回调
getBaseData(val) { if (this.tagNo === 506) { this.modalData.supplierId = val.SupplierID this.modalData.supplierName = val.SupplierName } if (this.tagNo === 20) { this.tempWareHouseRow.inWarehouse = val.WareHouseID this.tempWareHouseRow.inWarehouseName = val.WareHouseName console.log(this.tempWareHouseRow) } },
async exportExcel() { this.searchData.limit = -1 this.searchData.page = 1 excel.exportTable({ url: '/inbound/searchInboundNotification', columnMapping: this.columnList, //可以直接用table,不需要的列就剔除
mergeSetting: [], //需要合并的列
params: this.searchData, fileName: this.exportName + '.xlsx', rowFetcher: (res) => res.data, columnFormatter: [], dropColumns: [], }) },
// 动态列开始 获取 用户保存的 格式列
async getTableUserColumn(tableId, columnId) { let queryTableUser = { userId: this.$store.state.user.name, functionId: this.$route.meta.menuId, tableId: tableId, status: true, languageCode: this.$i18n.locale, } await getTableUserListLanguage(queryTableUser).then(({ data }) => { if (data.rows.length > 0) { switch (columnId) { case 1: this.columnList = data.rows break } } else { this.getColumnList(tableId, columnId) } }) },
enterSOSDetail(row) { let rows = { site: this.$store.state.user.site, notifyNo: this.currentRow.notifyNo, soorderNo: row.soorderNo, seqNo: row.seqNo, partNo: row.fgpartNo, itemNo: row.itemNo, } this.clickrow = row this.searchUnissueNotifyMaterialList(rows) }, searchUnissueNotifyMaterialList(row) { this.bomLoadFlag = true this.materialModalFlag = true this.sobomData = { orderNo: row.soorderNo || '', seqNo: row.seqNo || '', partNo: row.partNo || row.fgpartNo || '', } getNoOrderMaterialList(row) .then(({ data }) => { if (data.code === 0) { this.sobomList = data.rows } }) .finally(() => { this.bomLoadFlag = false }) }, // 从申请明细弹框打开选择物料弹框
openSelectMaterialModalForDetail() { this.isMaterialDetailModal = true // 设置模板编号和名称(使用生产订单号)
this.modelCode = this.sobomData.orderNo || '' this.modelName = this.sobomData.partNo || ''
// 将sobomList中的数据转换为选择物料弹框需要的格式,显示在右侧"已有物料"列表中
this.selectedMaterialList = this.sobomList.map(item => { const convertedItem = JSON.parse(JSON.stringify(item)) // 将qtyToIssue转换为applyQty
convertedItem.applyQty = convertedItem.qtyToIssue || 0 // 确保partNo存在(可能使用componentPartNo)
if (!convertedItem.partNo && convertedItem.componentPartNo) { convertedItem.partNo = convertedItem.componentPartNo } return convertedItem })
// 重置分页
this.availableMaterialPage = 1 this.availableMaterialLimit = 100 this.$set( this, 'componentPartNo', '' ) // 清空物料编码搜索条件
// 加载可选物料列表
this.loadAvailableMaterialList()
// 打开弹框
this.selectMaterialModalFlag = true }, // 加载可选物料列表
loadAvailableMaterialList() { this.selectMaterialLoading = true const params = { page: this.availableMaterialPage, limit: this.availableMaterialLimit, componentPartNo: this.componentPartNo, } noOrderList(params) .then(({ data }) => { this.selectMaterialLoading = false if (data && data.code === 0) { if (data.page) { // 过滤掉已选中的物料
const selectedPartNos = this.selectedMaterialList.map( (item) => item.partNo || item.componentPartNo )
// 如果是从申请明细弹框打开的,还需要过滤掉sobomList中已存在的物料
if (this.isMaterialDetailModal && this.sobomList && this.sobomList.length > 0) { const sobomPartNos = this.sobomList.map( (item) => item.partNo || item.componentPartNo ) selectedPartNos.push(...sobomPartNos) }
this.availableMaterialList = data.page.list.filter( (item) => !selectedPartNos.includes(item.partNo) ) } else { this.availableMaterialList = [] } this.availableMaterialPage = data.page.currPage this.availableMaterialLimit = data.page.pageSize this.availableMaterialTotal = data.page.totalCount } else { this.availableMaterialList = [] if (data && data.msg) { this.$message.warning(data.msg) } } }) .catch((e) => { this.selectMaterialLoading = false this.availableMaterialList = [] this.availableMaterialTotal = 0 this.$message.error(e.msg || '加载数据失败') }) }, // 左侧表格分页 - 每页条数改变
handleAvailableSizeChange(val) { this.availableMaterialLimit = val this.availableMaterialPage = 1 this.loadAvailableMaterialList() }, // 左侧表格分页 - 当前页改变
handleAvailableCurrentChange(val) { this.availableMaterialPage = val this.loadAvailableMaterialList() }, // 处理左侧表格选择变化
handleAvailableSelectionChange(selection) { this.availableMaterialSelections = selection }, // 处理右侧表格选择变化
handleSelectedSelectionChange(selection) { this.selectedMaterialSelections = selection }, // 左侧表格行点击
itemClickRow1(row) { // 可以在这里实现行点击逻辑
}, // 右侧表格行点击
itemClickRow2(row) { // 可以在这里实现行点击逻辑
}, // 判断行是否可选
selectFlag(row, index) { return true // 所有行都可选
}, // 添加到已选列表
addToSelected() { if (this.availableMaterialSelections.length === 0) { this.$message.warning('请先选择要添加的物料!') return false }
// 将选中的项添加到已选列表
this.availableMaterialSelections.forEach((item) => { // 检查是否已存在(使用partNo作为唯一标识)
const itemNo = item.partNo const exists = this.selectedMaterialList.some( (row) => row.partNo === itemNo ) if (!exists) { const newItem = JSON.parse(JSON.stringify(item)) this.selectedMaterialList.push(newItem) } })
const addCount = this.availableMaterialSelections.length
// 清空选择
this.availableMaterialSelections = []
// 重新加载左侧数据(因为分页,需要重新获取以过滤掉已选中的)
this.loadAvailableMaterialList()
this.$message.success(`成功添加 ${addCount} 条数据`) }, // 从已选列表移除
removeFromSelected() { if (this.selectedMaterialSelections.length === 0) { this.$message.warning('请先选择要删除的物料!') return false }
// 从已选列表中移除
const selectedItemNos = this.selectedMaterialSelections.map( (item) => item.partNo ) const removeCount = this.selectedMaterialSelections.length this.selectedMaterialList = this.selectedMaterialList.filter( (item) => !selectedItemNos.includes( item.partNo ) )
// 清空选择
this.selectedMaterialSelections = []
// 重新加载左侧数据(因为分页,需要重新获取,移除的项可能会出现在当前页)
this.loadAvailableMaterialList()
this.$message.success(`成功移除 ${removeCount} 条数据`) }, // 确认选择物料
confirmSelectMaterial() { if (this.isMaterialDetailModal) {
// 从申请明细弹框打开的情况,将右侧"已有物料"列表的完整数据更新到sobomList
const selectedItems = JSON.parse(JSON.stringify(this.selectedMaterialList)) // 将选中的物料转换为sobomList需要的格式
selectedItems.forEach(item => { // 将applyQty转换为qtyToIssue
item.qtyToIssue = item.applyQty || 0 // 设置itemNo(使用clickrow中的itemNo)
item.itemNo = this.clickrow.itemNo item.notifyNo = this.clickrow.notifyNo || this.currentRow.notifyNo item.soorderNo = this.clickrow.soorderNo item.site = this.$store.state.user.site // 确保componentPartNo存在
if (!item.componentPartNo) { item.componentPartNo = item.partNo } }) // 将右侧"已有物料"列表的完整数据替换sobomList(包括原有和新增的)
this.sobomList = selectedItems
this.isMaterialDetailModal = false }
// 关闭弹框
this.selectMaterialModalFlag = false
// 清空数据
this.availableMaterialList = [] this.selectedMaterialList = [] this.availableMaterialSelections = [] this.selectedMaterialSelections = []
this.$message.success('操作成功') }, // 删除
deleteNotifySOS(row) { this.$confirm(`是否删除这个工单的申请信息?`, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning', }) .then(() => { deleteNotifyUnissue(row).then(({ data }) => { if (data && data.code === 0) { this.getNotifyNoOrderDetailByType() this.$message({ message: '操作成功', type: 'success', duration: 1500, onClose: () => {}, }) } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定', }) } }) }) .catch(() => {}) },
// 获取 tableDefault 列
async getColumnList(tableId, columnId) { let queryTable = { functionId: this.$route.meta.menuId, tableId: tableId, languageCode: this.$i18n.locale, } await getTableDefaultListLanguage(queryTable).then(({ data }) => { if (data.rows.length !== 0) { switch (columnId) { case 1: this.columnList = data.rows break } } }) },
//获取按钮的权限数据
getButtonAuthData() { if (this.$store.state.user.id === 1) { return } let searchFlag = this.isAuth(this.menuId + ':search') let saveFlag = this.isAuth(this.menuId + ':save') let updateFlag = this.isAuth(this.menuId + ':update') let deleteFlag = this.isAuth(this.menuId + ':delete') let archiveFlag = this.isAuth(this.menuId + ':archive') let closeFlag = this.isAuth(this.menuId + ':close') let issueFlag = this.isAuth(this.menuId + ':issue') //处理页面的权限数据
this.authSearch = !searchFlag this.authSave = !saveFlag this.authUpdate = !updateFlag this.authDelete = !deleteFlag this.authArchive = !archiveFlag this.authClose = !closeFlag this.authIssue = !issueFlag },
/** * @Description 取消下达处理方法 - rqrq * @param row 当前行数据 */ cancelIssueShipmentHandle(row) { // 先判断发起人是否有未下达的shipment申请单 - rqrq
let checkData = { site: row.site, username: row.username, }
checkUserHasUnissueShipment(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, }
cancelIssueShipment(cancelData) .then(({ data }) => { if (data && data.code === 0) { this.$message.success('取消下达成功') // 重新加载数据 - rqrq
this.getDataList() } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定', }) } }) .catch(() => { this.$message.error('取消下达失败') }) }) .catch(() => { // 用户取消操作 - rqrq
}) } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定', }) } }) .catch(() => { this.$message.error('检查用户申请单失败') }) },
/** * @Description 预览库存匹配情况 - rqrq * @param row 当前申请单行数据 */ previewInventory(row) { this.currentNotifyRow = row // 保存当前通知单行数据 - rqrq
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('获取库存预览失败') }) },
/** * @Description 根据订单满足状态设置行样式 - rqrq */ 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 '' },
/** * @Description 从预览对话框推送至WCS - rqrq */ pushToWCS() { // 全部推送 后端判断 - rqrq
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.currentNotifyRow.site, notifyNo: this.currentNotifyRow.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.getDataList() // 刷新列表
} else { this.$alert(data.msg || '推送失败', '错误', { confirmButtonText: '确定' }) } }).catch((error) => { this.previewLoading = false this.$message.error(error.message || '推送WCS失败,请重试') }) }).catch(() => { // 用户取消操作 - rqrq
console.log('用户取消推送') }) }, },}</script><style scoped>/deep/ .customer-tab .el-tabs__content { padding: 5px !important;}
.el-table /deep/ .cell { height: auto; line-height: 1.5;}
/deep/ .wrap-text-column .cell { white-space: normal !important; word-break: break-all !important; line-height: 1.5 !important;}
/* rqrq - 表格行样式:根据满足状态显示不同背景色 *//deep/ .el-table .success-row { background-color: #f0f9ff !important; border-left: 3px solid #67C23A;}
/deep/ .el-table .warning-row { background-color: #fdf6ec !important; border-left: 3px solid #E6A23C;}
/deep/ .el-table .danger-row { background-color: #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>
|