Merge remote-tracking branch 'origin/0.8.X' into 0.8.X
This commit is contained in:
@@ -61,6 +61,14 @@ export function listBoundCoil(query) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getBoundCoilStatisticsList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/deliveryWaybillDetail/statistics',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 按销售员查询订单明细的卷
|
// 按销售员查询订单明细的卷
|
||||||
export function listDeliveryWaybillDetailBySaleman(principal) {
|
export function listDeliveryWaybillDetailBySaleman(principal) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@@ -63,7 +63,6 @@
|
|||||||
<el-button type="primary" size="mini" @click="showAddDetail=true">+ 明细列</el-button>
|
<el-button type="primary" size="mini" @click="showAddDetail=true">+ 明细列</el-button>
|
||||||
<el-button size="mini" type="success" @click="openMetricPicker">+ 指标列</el-button>
|
<el-button size="mini" type="success" @click="openMetricPicker">+ 指标列</el-button>
|
||||||
<el-button size="mini" plain @click="openMetricMgr">指标管理</el-button>
|
<el-button size="mini" plain @click="openMetricMgr">指标管理</el-button>
|
||||||
<el-button size="mini" plain @click="openCopyCfg">复制配置</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-table :data="allCols" border stripe size="mini" highlight-current-row @dragover.native.prevent @drop.native="onNativeDrop" @current-change="curIdx = allCols.indexOf($event)" @selection-change="selCol=$event">
|
<el-table :data="allCols" border stripe size="mini" highlight-current-row @dragover.native.prevent @drop.native="onNativeDrop" @current-change="curIdx = allCols.indexOf($event)" @selection-change="selCol=$event">
|
||||||
|
|||||||
@@ -2,12 +2,12 @@
|
|||||||
<div class="contract-tabs">
|
<div class="contract-tabs">
|
||||||
<div v-if="orderId" class="tabs-content">
|
<div v-if="orderId" class="tabs-content">
|
||||||
<el-tabs v-model="activeTab" type="border-card">
|
<el-tabs v-model="activeTab" type="border-card">
|
||||||
<el-tab-pane label="订单编辑" name="edit" v-hasPermi="['crm:order:edit']">
|
<!-- <el-tab-pane label="订单编辑" name="edit" v-hasPermi="['crm:order:edit']">
|
||||||
<div class="order-detail" v-if="activeTab === 'edit'">
|
<div class="order-detail" v-if="activeTab === 'edit'">
|
||||||
<el-descriptions title="订单明细" />
|
<el-descriptions title="订单明细" />
|
||||||
<OrderDetail :orderId="currentOrder.orderId" />
|
<OrderDetail :orderId="currentOrder.orderId" />
|
||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane> -->
|
||||||
<el-tab-pane label="财务状态" name="finance" v-hasPermi="['crm:order:finance']">
|
<el-tab-pane label="财务状态" name="finance" v-hasPermi="['crm:order:finance']">
|
||||||
<div class="order-finance" v-if="activeTab === 'finance'">
|
<div class="order-finance" v-if="activeTab === 'finance'">
|
||||||
<!-- 财务状态内容 -->
|
<!-- 财务状态内容 -->
|
||||||
|
|||||||
@@ -1,6 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
|
||||||
|
<el-form-item label="发货计划" prop="planId" v-if="showWaybill">
|
||||||
|
<el-select v-model="queryParams.planId" placeholder="请输入发货计划名称搜索" filterable remote clearable
|
||||||
|
:remote-method="remoteSearchWaybill" :loading="waybillLoading" style="width: 220px" @change="handleQuery">
|
||||||
|
<el-option v-for="item in waybillOptions" :key="item.planId" :label="item.planName" :value="item.planId" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="入场卷号" prop="enterCoilNo">
|
<el-form-item label="入场卷号" prop="enterCoilNo">
|
||||||
<el-input v-model="queryParams.enterCoilNo" placeholder="请输入入场钢卷号" clearable
|
<el-input v-model="queryParams.enterCoilNo" placeholder="请输入入场钢卷号" clearable
|
||||||
@keyup.enter.native="handleQuery" />
|
@keyup.enter.native="handleQuery" />
|
||||||
@@ -10,8 +16,8 @@
|
|||||||
@keyup.enter.native="handleQuery" />
|
@keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="逻辑库位" prop="warehouseId" v-if="useWarehouseIds">
|
<el-form-item label="逻辑库位" prop="warehouseId" v-if="useWarehouseIds">
|
||||||
<muti-select v-model="warehouseIds" placeholder="请选择逻辑库位"
|
<muti-select v-model="warehouseIds" placeholder="请选择逻辑库位" style="width: 100%; display: inline-block;" clearable
|
||||||
style="width: 100%; display: inline-block;" clearable :options="warehouseOptions">
|
:options="warehouseOptions">
|
||||||
</muti-select>
|
</muti-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="逻辑库位" prop="warehouseId" v-else-if="!hideWarehouseQuery && !leftWarehouseQuery">
|
<el-form-item label="逻辑库位" prop="warehouseId" v-else-if="!hideWarehouseQuery && !leftWarehouseQuery">
|
||||||
@@ -51,26 +57,26 @@
|
|||||||
clearable @keyup.enter.native="handleQuery" />
|
clearable @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="表面处理">
|
<el-form-item label="表面处理">
|
||||||
<el-input v-model="queryParams.itemSurfaceTreatmentDesc" placeholder="请输入表面处理" clearable size="small" />
|
<el-input v-model="queryParams.itemSurfaceTreatmentDesc" placeholder="请输入表面处理" clearable size="small" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="切边" prop="trimmingRequirement">
|
<el-form-item label="切边" prop="trimmingRequirement">
|
||||||
<el-select v-model="queryParams.trimmingRequirement" placeholder="请选择切边" clearable style="width: 100%">
|
<el-select v-model="queryParams.trimmingRequirement" placeholder="请选择切边" clearable style="width: 100%">
|
||||||
<el-option label="净边" value="净边" />
|
<el-option label="净边" value="净边" />
|
||||||
<el-option label="毛边" value="毛边" />
|
<el-option label="毛边" value="毛边" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="包装" prop="packagingRequirement">
|
<el-form-item label="包装" prop="packagingRequirement">
|
||||||
<el-select v-model="queryParams.packagingRequirement" placeholder="请选择包装" clearable style="width: 100%">
|
<el-select v-model="queryParams.packagingRequirement" placeholder="请选择包装" clearable style="width: 100%">
|
||||||
<el-option label="裸包" value="裸包" />
|
<el-option label="裸包" value="裸包" />
|
||||||
<el-option label="普包" value="普包" />
|
<el-option label="普包" value="普包" />
|
||||||
<el-option label="简包" value="简包" />
|
<el-option label="简包" value="简包" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="品质">
|
<el-form-item label="品质">
|
||||||
<muti-select v-model="queryParams.qualityStatusCsv" :options="dict.type.coil_quality_status"
|
<muti-select v-model="queryParams.qualityStatusCsv" :options="dict.type.coil_quality_status" placeholder="请选择品质"
|
||||||
placeholder="请选择品质" clearable />
|
clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item v-if="showWaybill" label="发货状态">
|
<el-form-item v-if="showWaybill" label="发货状态">
|
||||||
<el-radio-group v-model="queryParams.status" @change="handleQuery">
|
<el-radio-group v-model="queryParams.status" @change="handleQuery">
|
||||||
@@ -97,6 +103,8 @@
|
|||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
<el-button icon="el-icon-download" size="mini" @click="handleNewExport" v-if="showNewExport">导出</el-button>
|
<el-button icon="el-icon-download" size="mini" @click="handleNewExport" v-if="showNewExport">导出</el-button>
|
||||||
|
<el-button type="danger" plain icon="el-icon-close" size="mini" :disabled="multiple" :loading="buttonLoading"
|
||||||
|
@click="handleBatchRemoveFromWaybill">批量移出发货单</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<!-- <el-form-item style="float: right;" v-if="showWaybill" v-loading="loading">
|
<!-- <el-form-item style="float: right;" v-if="showWaybill" v-loading="loading">
|
||||||
@@ -123,6 +131,9 @@
|
|||||||
<el-button type="info" plain icon="el-icon-printer" size="mini" :disabled="multiple"
|
<el-button type="info" plain icon="el-icon-printer" size="mini" :disabled="multiple"
|
||||||
@click="handleBatchPrintLabel">批量打印标签</el-button>
|
@click="handleBatchPrintLabel">批量打印标签</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<!-- <el-col :span="2" v-if="showWaybill">
|
||||||
|
|
||||||
|
</el-col> -->
|
||||||
<el-col :span="1.5" v-if="showOrderBy">
|
<el-col :span="1.5" v-if="showOrderBy">
|
||||||
<el-checkbox v-model="queryParams.orderBy" v-loading="loading" @change="getList"
|
<el-checkbox v-model="queryParams.orderBy" v-loading="loading" @change="getList"
|
||||||
label="orderBy">按实际库区排序</el-checkbox>
|
label="orderBy">按实际库区排序</el-checkbox>
|
||||||
@@ -132,20 +143,20 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<div style="display: flex; align-items: flex-start;">
|
<div style="display: flex; align-items: flex-start;">
|
||||||
<div v-if="leftWarehouseQuery"
|
<div v-if="leftWarehouseQuery" :style="{
|
||||||
:style="{
|
width: '220px',
|
||||||
width: '220px',
|
height: showAbnormal ? 'calc(100vh - 400px)' : 'calc(100vh - 300px)',
|
||||||
height: showAbnormal ? 'calc(100vh - 400px)' : 'calc(100vh - 300px)',
|
backgroundColor: '#ffffff',
|
||||||
backgroundColor: '#ffffff',
|
overflowY: 'auto',
|
||||||
overflowY: 'auto',
|
overflowX: 'hidden'
|
||||||
overflowX: 'hidden' }">
|
}">
|
||||||
<warehouse-tree warehouseType="logic" @node-click="handleWarehouseNodeClick" />
|
<warehouse-tree warehouseType="logic" @node-click="handleWarehouseNodeClick" />
|
||||||
</div>
|
</div>
|
||||||
<div style="flex: 1; width: 100%; overflow: hidden;">
|
<div style="flex: 1; width: 100%; overflow: hidden;">
|
||||||
<KLPTable v-loading="loading" :data="materialCoilList" @selection-change="handleSelectionChange"
|
<KLPTable v-loading="loading" :data="materialCoilList" @selection-change="handleSelectionChange"
|
||||||
:floatLayer="true" :floatLayerConfig="floatLayerConfig" @row-click="handleRowClick"
|
:floatLayer="true" :floatLayerConfig="floatLayerConfig" @row-click="handleRowClick"
|
||||||
:height="showAbnormal ? 'calc(100vh - 400px)' : 'calc(100vh - 300px)'" border>
|
:height="showAbnormal ? 'calc(100vh - 400px)' : 'calc(100vh - 300px)'" border>
|
||||||
<!-- <el-table-column type="selection" width="55" align="center" /> -->
|
<el-table-column v-if="showWaybill" type="selection" width="55" align="center" />
|
||||||
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo">
|
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<coil-no :coil-no="scope.row.enterCoilNo"></coil-no>
|
<coil-no :coil-no="scope.row.enterCoilNo"></coil-no>
|
||||||
@@ -194,11 +205,11 @@
|
|||||||
placeholder="请选择仓库/库区/库位" style="width: 100%;" clearable />
|
placeholder="请选择仓库/库区/库位" style="width: 100%;" clearable />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<el-table-column v-if="hasTransferType" label="实际库区" align="center" prop="actualWarehouseName" />
|
<el-table-column v-if="hasTransferType" label="实际库区" align="center" prop="actualWarehouseName" />
|
||||||
|
|
||||||
<el-table-column v-if="moreColumn" label="规格" prop="specification"></el-table-column>
|
<el-table-column v-if="moreColumn" label="规格" prop="specification"></el-table-column>
|
||||||
<el-table-column v-if="moreColumn" label="物料" prop="itemName"></el-table-column>
|
<el-table-column v-if="moreColumn" label="物料" prop="itemName"></el-table-column>
|
||||||
<el-table-column v-if="moreColumn" label="材质" prop="material"></el-table-column>
|
<el-table-column v-if="moreColumn" label="材质" prop="material"></el-table-column>
|
||||||
@@ -319,9 +330,10 @@
|
|||||||
{{ formatDuration(scope.row.productionDuration * 60 * 1000) }}
|
{{ formatDuration(scope.row.productionDuration * 60 * 1000) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
<el-table-column prop="action" label="操作" align="center" class-name="small-padding fixed-width" v-if="!moreColumn">
|
|
||||||
|
<el-table-column prop="action" label="操作" align="center" class-name="small-padding fixed-width"
|
||||||
|
v-if="!moreColumn">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button size="mini" type="text" icon="el-icon-view" @click="handlePreviewLabel(scope.row)">
|
<el-button size="mini" type="text" icon="el-icon-view" @click="handlePreviewLabel(scope.row)">
|
||||||
预览标签
|
预览标签
|
||||||
@@ -561,13 +573,14 @@
|
|||||||
|
|
||||||
<!-- 钢卷改判弹窗 -->
|
<!-- 钢卷改判弹窗 -->
|
||||||
<el-dialog title="钢卷改判" :visible.sync="judgeDialogVisible" width="800px" append-to-body>
|
<el-dialog title="钢卷改判" :visible.sync="judgeDialogVisible" width="800px" append-to-body>
|
||||||
<CoilInfoRender :column="3" :coilInfo="judgeForm" border/>
|
<CoilInfoRender :column="3" :coilInfo="judgeForm" border />
|
||||||
|
|
||||||
<div style="margin-top: 20px; padding: 15px; background-color: #f5f7fa; border-radius: 4px;">
|
<div style="margin-top: 20px; padding: 15px; background-color: #f5f7fa; border-radius: 4px;">
|
||||||
<el-form :model="judgeForm" label-width="120px">
|
<el-form :model="judgeForm" label-width="120px">
|
||||||
<el-form-item label="修改质量状态">
|
<el-form-item label="修改质量状态">
|
||||||
<el-select v-model="judgeForm.qualityStatus" placeholder="请选择质量状态" style="width: 200px">
|
<el-select v-model="judgeForm.qualityStatus" placeholder="请选择质量状态" style="width: 200px">
|
||||||
<el-option v-for="item in dict.type.coil_quality_status" :key="item.value" :value="item.value" :label="item.label" />
|
<el-option v-for="item in dict.type.coil_quality_status" :key="item.value" :value="item.value"
|
||||||
|
:label="item.label" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="改判原因">
|
<el-form-item label="改判原因">
|
||||||
@@ -578,7 +591,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button @click="judgeDialogVisible = false">取消</el-button>
|
<el-button @click="judgeDialogVisible = false">取消</el-button>
|
||||||
<el-button :loading="buttonLoading" type="primary" @click="submitJudgeForm">确认</el-button>
|
<el-button :loading="buttonLoading" type="primary" @click="submitJudgeForm">确认</el-button>
|
||||||
@@ -614,7 +627,7 @@
|
|||||||
<span>钢卷暂存单据管理</span>
|
<span>钢卷暂存单据管理</span>
|
||||||
<el-button style="float: right; padding: 3px 0" type="text" @click="createTempOrder">创建暂存单据</el-button>
|
<el-button style="float: right; padding: 3px 0" type="text" @click="createTempOrder">创建暂存单据</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 暂存单据列表 -->
|
<!-- 暂存单据列表 -->
|
||||||
<el-table :data="tempOrderList" style="width: 100%" :height="'calc(100vh - 500px)'">
|
<el-table :data="tempOrderList" style="width: 100%" :height="'calc(100vh - 500px)'">
|
||||||
<el-table-column prop="orderName" label="单据名称">
|
<el-table-column prop="orderName" label="单据名称">
|
||||||
@@ -639,13 +652,15 @@
|
|||||||
<el-table-column label="操作">
|
<el-table-column label="操作">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button size="mini" type="text" @click="openCoilSelection(scope.row)">选择钢卷</el-button>
|
<el-button size="mini" type="text" @click="openCoilSelection(scope.row)">选择钢卷</el-button>
|
||||||
<el-button size="mini" type="text" style="color: #f56c6c;" @click="deleteTempOrder(scope.row)">删除</el-button>
|
<el-button size="mini" type="text" style="color: #f56c6c;"
|
||||||
|
@click="deleteTempOrder(scope.row)">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<!-- 当没有数据时显示提示 -->
|
<!-- 当没有数据时显示提示 -->
|
||||||
<div v-if="!tempOrderList || tempOrderList.length === 0" style="text-align: center; padding: 50px; color: #909399;">
|
<div v-if="!tempOrderList || tempOrderList.length === 0"
|
||||||
|
style="text-align: center; padding: 50px; color: #909399;">
|
||||||
<i class="el-icon-document" style="font-size: 48px; margin-bottom: 10px;"></i>
|
<i class="el-icon-document" style="font-size: 48px; margin-bottom: 10px;"></i>
|
||||||
<div>暂无暂存单据</div>
|
<div>暂无暂存单据</div>
|
||||||
<div style="font-size: 12px; margin-top: 5px;">点击右上角"创建暂存单据"开始使用</div>
|
<div style="font-size: 12px; margin-top: 5px;">点击右上角"创建暂存单据"开始使用</div>
|
||||||
@@ -678,10 +693,11 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<!-- 下方:钢卷列表 -->
|
<!-- 下方:钢卷列表 -->
|
||||||
<div style="height: 500px;">
|
<div style="height: 500px;">
|
||||||
<el-table v-loading="coilLoading" :data="availableCoils" @selection-change="handleCoilSelection" border height="450">
|
<el-table v-loading="coilLoading" :data="availableCoils" @selection-change="handleCoilSelection" border
|
||||||
|
height="450">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo">
|
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@@ -718,20 +734,15 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<div style="margin-top: 10px; text-align: center;">
|
<div style="margin-top: 10px; text-align: center;">
|
||||||
<el-pagination
|
<el-pagination @size-change="handleCoilSizeChange" @current-change="handleCoilCurrentChange"
|
||||||
@size-change="handleCoilSizeChange"
|
:current-page="coilQueryParams.pageNum" :page-sizes="[10, 20, 50, 100]"
|
||||||
@current-change="handleCoilCurrentChange"
|
:page-size="coilQueryParams.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="coilTotal">
|
||||||
:current-page="coilQueryParams.pageNum"
|
|
||||||
:page-sizes="[10, 20, 50, 100]"
|
|
||||||
:page-size="coilQueryParams.pageSize"
|
|
||||||
layout="total, sizes, prev, pager, next, jumper"
|
|
||||||
:total="coilTotal">
|
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<div style="margin-bottom: 10px;">
|
<div style="margin-bottom: 10px;">
|
||||||
<span>已选择 {{ selectedCoils.length }} 个钢卷,总重量:{{ calculateSelectedWeight().toFixed(3) }}t</span>
|
<span>已选择 {{ selectedCoils.length }} 个钢卷,总重量:{{ calculateSelectedWeight().toFixed(3) }}t</span>
|
||||||
@@ -774,7 +785,8 @@
|
|||||||
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
||||||
<el-table-column label="操作" align="center" width="100">
|
<el-table-column label="操作" align="center" width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button size="mini" type="text" style="color: #f56c6c;" @click="removeCoilFromOrder(scope.$index)">移除</el-button>
|
<el-button size="mini" type="text" style="color: #f56c6c;"
|
||||||
|
@click="removeCoilFromOrder(scope.$index)">移除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -797,7 +809,7 @@ import {
|
|||||||
getCoilStatisticsList,
|
getCoilStatisticsList,
|
||||||
listWithAdjustRecordCoil
|
listWithAdjustRecordCoil
|
||||||
} from "@/api/wms/coil";
|
} from "@/api/wms/coil";
|
||||||
import { listBoundCoil } from "@/api/wms/deliveryWaybillDetail";
|
import { listBoundCoil, getBoundCoilStatisticsList } from "@/api/wms/deliveryWaybillDetail";
|
||||||
import { addPendingAction } from "@/api/wms/pendingAction";
|
import { addPendingAction } from "@/api/wms/pendingAction";
|
||||||
import { listTransferOrderItem } from "@/api/wms/transferOrderItem";
|
import { listTransferOrderItem } from "@/api/wms/transferOrderItem";
|
||||||
import { listCoilQualityRejudge } from "@/api/wms/coilQualityRejudge";
|
import { listCoilQualityRejudge } from "@/api/wms/coilQualityRejudge";
|
||||||
@@ -829,6 +841,7 @@ import DragResizeBox from '@/components/DragResizeBox/index.vue';
|
|||||||
import ProcessFlow from '../components/ProcessFlow.vue';
|
import ProcessFlow from '../components/ProcessFlow.vue';
|
||||||
import WarehouseTree from '@/components/KLPService/WarehouseTree/index.vue';
|
import WarehouseTree from '@/components/KLPService/WarehouseTree/index.vue';
|
||||||
import { listDeliveryWaybillDetail, delDeliveryWaybillDetail } from "@/api/wms/deliveryWaybillDetail";
|
import { listDeliveryWaybillDetail, delDeliveryWaybillDetail } from "@/api/wms/deliveryWaybillDetail";
|
||||||
|
import { listDeliveryPlan } from "@/api/wms/deliveryPlan";
|
||||||
import { addCoilQualityRejudge } from "@/api/wms/coilQualityRejudge";
|
import { addCoilQualityRejudge } from "@/api/wms/coilQualityRejudge";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -978,6 +991,8 @@ export default {
|
|||||||
showProcessFlow: false,
|
showProcessFlow: false,
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
|
waybillLoading: false,
|
||||||
|
waybillOptions: [],
|
||||||
// 追溯加载中
|
// 追溯加载中
|
||||||
traceLoading: false,
|
traceLoading: false,
|
||||||
// 选中数组
|
// 选中数组
|
||||||
@@ -1019,6 +1034,7 @@ export default {
|
|||||||
status: '',
|
status: '',
|
||||||
updateTime: undefined,
|
updateTime: undefined,
|
||||||
orderBy: false,
|
orderBy: false,
|
||||||
|
planId: undefined,
|
||||||
...this.querys,
|
...this.querys,
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
@@ -1217,6 +1233,9 @@ export default {
|
|||||||
if (this.useWarehouseIds) {
|
if (this.useWarehouseIds) {
|
||||||
this.warehouseIds = this.warehouseOptions.map(item => item.value).join(',');
|
this.warehouseIds = this.warehouseOptions.map(item => item.value).join(',');
|
||||||
}
|
}
|
||||||
|
if (this.showWaybill) {
|
||||||
|
this.remoteSearchWaybill();
|
||||||
|
}
|
||||||
this.getList();
|
this.getList();
|
||||||
// 初始化暂存单据列表
|
// 初始化暂存单据列表
|
||||||
this.loadTempOrderList();
|
this.loadTempOrderList();
|
||||||
@@ -1232,12 +1251,12 @@ export default {
|
|||||||
this.tempOrderList = [];
|
this.tempOrderList = [];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 保存暂存单据列表到本地存储
|
// 保存暂存单据列表到本地存储
|
||||||
saveTempOrderList() {
|
saveTempOrderList() {
|
||||||
localStorage.setItem('tempCoilOrders', JSON.stringify(this.tempOrderList));
|
localStorage.setItem('tempCoilOrders', JSON.stringify(this.tempOrderList));
|
||||||
},
|
},
|
||||||
|
|
||||||
// 创建暂存单据
|
// 创建暂存单据
|
||||||
createTempOrder() {
|
createTempOrder() {
|
||||||
const orderName = `暂存单据_${new Date().toLocaleString().replace(/[/:]/g, '-')}`;
|
const orderName = `暂存单据_${new Date().toLocaleString().replace(/[/:]/g, '-')}`;
|
||||||
@@ -1247,13 +1266,13 @@ export default {
|
|||||||
createTime: new Date().toLocaleString(),
|
createTime: new Date().toLocaleString(),
|
||||||
coils: []
|
coils: []
|
||||||
};
|
};
|
||||||
|
|
||||||
this.tempOrderList.unshift(newOrder);
|
this.tempOrderList.unshift(newOrder);
|
||||||
this.saveTempOrderList();
|
this.saveTempOrderList();
|
||||||
|
|
||||||
this.$message.success('暂存单据创建成功');
|
this.$message.success('暂存单据创建成功');
|
||||||
},
|
},
|
||||||
|
|
||||||
// 删除暂存单据
|
// 删除暂存单据
|
||||||
deleteTempOrder(order) {
|
deleteTempOrder(order) {
|
||||||
this.$confirm(`确认删除暂存单据"${order.orderName}"吗?`, '提示', {
|
this.$confirm(`确认删除暂存单据"${order.orderName}"吗?`, '提示', {
|
||||||
@@ -1271,13 +1290,13 @@ export default {
|
|||||||
this.$message.info('已取消删除');
|
this.$message.info('已取消删除');
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// 查看已选钢卷列表
|
// 查看已选钢卷列表
|
||||||
viewSelectedCoils(order) {
|
viewSelectedCoils(order) {
|
||||||
this.currentTempOrder = order;
|
this.currentTempOrder = order;
|
||||||
this.selectedCoilsVisible = true;
|
this.selectedCoilsVisible = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
// 编辑单据名称
|
// 编辑单据名称
|
||||||
editOrderName(order) {
|
editOrderName(order) {
|
||||||
this.$prompt('请输入新的单据名称', '编辑单据名称', {
|
this.$prompt('请输入新的单据名称', '编辑单据名称', {
|
||||||
@@ -1293,15 +1312,15 @@ export default {
|
|||||||
}).then(({ value }) => {
|
}).then(({ value }) => {
|
||||||
const newName = value.trim();
|
const newName = value.trim();
|
||||||
// 检查名称是否重复
|
// 检查名称是否重复
|
||||||
const duplicateOrder = this.tempOrderList.find(item =>
|
const duplicateOrder = this.tempOrderList.find(item =>
|
||||||
item.orderId !== order.orderId && item.orderName === newName
|
item.orderId !== order.orderId && item.orderName === newName
|
||||||
);
|
);
|
||||||
|
|
||||||
if (duplicateOrder) {
|
if (duplicateOrder) {
|
||||||
this.$message.warning('单据名称已存在,请使用其他名称');
|
this.$message.warning('单据名称已存在,请使用其他名称');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新单据名称
|
// 更新单据名称
|
||||||
order.orderName = newName;
|
order.orderName = newName;
|
||||||
this.saveTempOrderList();
|
this.saveTempOrderList();
|
||||||
@@ -1310,14 +1329,14 @@ export default {
|
|||||||
this.$message.info('已取消编辑');
|
this.$message.info('已取消编辑');
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// 打开钢卷选择对话框
|
// 打开钢卷选择对话框
|
||||||
openCoilSelection(order) {
|
openCoilSelection(order) {
|
||||||
this.currentTempOrder = order;
|
this.currentTempOrder = order;
|
||||||
this.coilSelectionVisible = true;
|
this.coilSelectionVisible = true;
|
||||||
this.searchCoils();
|
this.searchCoils();
|
||||||
},
|
},
|
||||||
|
|
||||||
// 计算总重量
|
// 计算总重量
|
||||||
calculateTotalWeight(coils) {
|
calculateTotalWeight(coils) {
|
||||||
if (!coils || coils.length === 0) return 0;
|
if (!coils || coils.length === 0) return 0;
|
||||||
@@ -1325,31 +1344,31 @@ export default {
|
|||||||
return total + (parseFloat(coil.netWeight) || 0);
|
return total + (parseFloat(coil.netWeight) || 0);
|
||||||
}, 0);
|
}, 0);
|
||||||
},
|
},
|
||||||
|
|
||||||
// 计算选中钢卷的总重量
|
// 计算选中钢卷的总重量
|
||||||
calculateSelectedWeight() {
|
calculateSelectedWeight() {
|
||||||
return this.calculateTotalWeight(this.selectedCoils);
|
return this.calculateTotalWeight(this.selectedCoils);
|
||||||
},
|
},
|
||||||
|
|
||||||
// 查询钢卷
|
// 查询钢卷
|
||||||
async searchCoils() {
|
async searchCoils() {
|
||||||
this.coilLoading = true;
|
this.coilLoading = true;
|
||||||
try {
|
try {
|
||||||
// 构建查询参数
|
// 构建查询参数
|
||||||
const params = { ...this.coilQueryParams };
|
const params = { ...this.coilQueryParams };
|
||||||
|
|
||||||
// 移除空值参数
|
// 移除空值参数
|
||||||
Object.keys(params).forEach(key => {
|
Object.keys(params).forEach(key => {
|
||||||
if (params[key] === '' || params[key] === null || params[key] === undefined) {
|
if (params[key] === '' || params[key] === null || params[key] === undefined) {
|
||||||
delete params[key];
|
delete params[key];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// 调用接口查询钢卷
|
// 调用接口查询钢卷
|
||||||
const response = await listMaterialCoil(params);
|
const response = await listMaterialCoil(params);
|
||||||
this.availableCoils = response.rows || [];
|
this.availableCoils = response.rows || [];
|
||||||
this.coilTotal = response.total || 0;
|
this.coilTotal = response.total || 0;
|
||||||
|
|
||||||
// 过滤掉所有单据中已选择的钢卷,确保钢卷在所有单据中唯一
|
// 过滤掉所有单据中已选择的钢卷,确保钢卷在所有单据中唯一
|
||||||
const allExistingCoilIds = [];
|
const allExistingCoilIds = [];
|
||||||
this.tempOrderList.forEach(order => {
|
this.tempOrderList.forEach(order => {
|
||||||
@@ -1361,11 +1380,11 @@ export default {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// 如果是当前正在编辑的单据,排除当前单据中的钢卷(因为它们已经在allExistingCoilIds中了)
|
// 如果是当前正在编辑的单据,排除当前单据中的钢卷(因为它们已经在allExistingCoilIds中了)
|
||||||
// 这样可以确保其他单据不能选择当前单据已选的钢卷
|
// 这样可以确保其他单据不能选择当前单据已选的钢卷
|
||||||
this.availableCoils = this.availableCoils.filter(coil => !allExistingCoilIds.includes(coil.coilId));
|
this.availableCoils = this.availableCoils.filter(coil => !allExistingCoilIds.includes(coil.coilId));
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('查询钢卷失败:', error);
|
console.error('查询钢卷失败:', error);
|
||||||
this.$message.error('查询钢卷失败');
|
this.$message.error('查询钢卷失败');
|
||||||
@@ -1373,7 +1392,7 @@ export default {
|
|||||||
this.coilLoading = false;
|
this.coilLoading = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 重置钢卷查询条件
|
// 重置钢卷查询条件
|
||||||
resetCoilQuery() {
|
resetCoilQuery() {
|
||||||
this.coilQueryParams = {
|
this.coilQueryParams = {
|
||||||
@@ -1394,56 +1413,56 @@ export default {
|
|||||||
};
|
};
|
||||||
this.searchCoils();
|
this.searchCoils();
|
||||||
},
|
},
|
||||||
|
|
||||||
// 处理钢卷选择变化
|
// 处理钢卷选择变化
|
||||||
handleCoilSelection(selection) {
|
handleCoilSelection(selection) {
|
||||||
this.selectedCoils = selection;
|
this.selectedCoils = selection;
|
||||||
},
|
},
|
||||||
|
|
||||||
// 保存选中的钢卷
|
// 保存选中的钢卷
|
||||||
saveSelectedCoils() {
|
saveSelectedCoils() {
|
||||||
if (!this.currentTempOrder) {
|
if (!this.currentTempOrder) {
|
||||||
this.$message.error('请先选择暂存单据');
|
this.$message.error('请先选择暂存单据');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.selectedCoils.length === 0) {
|
if (this.selectedCoils.length === 0) {
|
||||||
this.$message.warning('请选择要添加的钢卷');
|
this.$message.warning('请选择要添加的钢卷');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 确保coils数组存在
|
// 确保coils数组存在
|
||||||
if (!this.currentTempOrder.coils) {
|
if (!this.currentTempOrder.coils) {
|
||||||
this.currentTempOrder.coils = [];
|
this.currentTempOrder.coils = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 由于在查询阶段已经过滤了所有重复的钢卷,这里不需要再次检查
|
// 由于在查询阶段已经过滤了所有重复的钢卷,这里不需要再次检查
|
||||||
// 但为了安全起见,保留基本的检查逻辑
|
// 但为了安全起见,保留基本的检查逻辑
|
||||||
if (this.currentTempOrder.coils && this.currentTempOrder.coils.length > 0) {
|
if (this.currentTempOrder.coils && this.currentTempOrder.coils.length > 0) {
|
||||||
const existingCoilIds = this.currentTempOrder.coils.map(coil => coil.coilId);
|
const existingCoilIds = this.currentTempOrder.coils.map(coil => coil.coilId);
|
||||||
const duplicateCoils = this.selectedCoils.filter(coil => existingCoilIds.includes(coil.coilId));
|
const duplicateCoils = this.selectedCoils.filter(coil => existingCoilIds.includes(coil.coilId));
|
||||||
|
|
||||||
if (duplicateCoils.length > 0) {
|
if (duplicateCoils.length > 0) {
|
||||||
this.$message.warning(`钢卷 ${duplicateCoils.map(coil => coil.enterCoilNo).join(', ')} 已存在,不能重复添加`);
|
this.$message.warning(`钢卷 ${duplicateCoils.map(coil => coil.enterCoilNo).join(', ')} 已存在,不能重复添加`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加钢卷到当前单据
|
// 添加钢卷到当前单据
|
||||||
this.currentTempOrder.coils.push(...this.selectedCoils);
|
this.currentTempOrder.coils.push(...this.selectedCoils);
|
||||||
this.saveTempOrderList();
|
this.saveTempOrderList();
|
||||||
|
|
||||||
this.$message.success(`成功添加 ${this.selectedCoils.length} 个钢卷`);
|
this.$message.success(`成功添加 ${this.selectedCoils.length} 个钢卷`);
|
||||||
|
|
||||||
// 关闭对话框并重置选择
|
// 关闭对话框并重置选择
|
||||||
this.coilSelectionVisible = false;
|
this.coilSelectionVisible = false;
|
||||||
this.selectedCoils = [];
|
this.selectedCoils = [];
|
||||||
},
|
},
|
||||||
|
|
||||||
// 从单据中移除钢卷
|
// 从单据中移除钢卷
|
||||||
removeCoilFromOrder(index) {
|
removeCoilFromOrder(index) {
|
||||||
if (!this.currentTempOrder || !this.currentTempOrder.coils || !this.currentTempOrder.coils[index]) return;
|
if (!this.currentTempOrder || !this.currentTempOrder.coils || !this.currentTempOrder.coils[index]) return;
|
||||||
|
|
||||||
this.$confirm('确认移除该钢卷吗?', '提示', {
|
this.$confirm('确认移除该钢卷吗?', '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
@@ -1456,19 +1475,19 @@ export default {
|
|||||||
this.$message.info('已取消移除');
|
this.$message.info('已取消移除');
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// 钢卷分页相关方法
|
// 钢卷分页相关方法
|
||||||
handleCoilSizeChange(val) {
|
handleCoilSizeChange(val) {
|
||||||
this.coilQueryParams.pageSize = val;
|
this.coilQueryParams.pageSize = val;
|
||||||
this.coilQueryParams.pageNum = 1;
|
this.coilQueryParams.pageNum = 1;
|
||||||
this.searchCoils();
|
this.searchCoils();
|
||||||
},
|
},
|
||||||
|
|
||||||
handleCoilCurrentChange(val) {
|
handleCoilCurrentChange(val) {
|
||||||
this.coilQueryParams.pageNum = val;
|
this.coilQueryParams.pageNum = val;
|
||||||
this.searchCoils();
|
this.searchCoils();
|
||||||
},
|
},
|
||||||
|
|
||||||
// 进入数字钢卷页面
|
// 进入数字钢卷页面
|
||||||
handleNumberCoilClick(row) {
|
handleNumberCoilClick(row) {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
@@ -1531,6 +1550,50 @@ export default {
|
|||||||
})
|
})
|
||||||
// 打开一个弹窗列出查询到的所有单据明细
|
// 打开一个弹窗列出查询到的所有单据明细
|
||||||
},
|
},
|
||||||
|
async handleBatchRemoveFromWaybill() {
|
||||||
|
const selectedRows = this.materialCoilList.filter(item => this.ids.includes(item.coilId));
|
||||||
|
if (selectedRows.length === 0) {
|
||||||
|
this.$message.warning('请先勾选要移除的钢卷');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$modal.confirm(`确认要将选中的 ${selectedRows.length} 个钢卷从发货单中移除吗?`, {
|
||||||
|
title: '批量移除',
|
||||||
|
type: 'warning',
|
||||||
|
}).then(async () => {
|
||||||
|
this.buttonLoading = true;
|
||||||
|
const detailIds = [];
|
||||||
|
const failCoils = [];
|
||||||
|
for (const row of selectedRows) {
|
||||||
|
try {
|
||||||
|
const res = await listDeliveryWaybillDetail({ coilId: row.coilId });
|
||||||
|
if (res.rows.length === 1) {
|
||||||
|
detailIds.push(res.rows[0].detailId);
|
||||||
|
} else {
|
||||||
|
failCoils.push(row.currentCoilNo);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
failCoils.push(row.currentCoilNo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (detailIds.length === 0) {
|
||||||
|
this.$message.error('未找到任何可移除的发货单明细');
|
||||||
|
this.buttonLoading = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
await delDeliveryWaybillDetail(detailIds.join(','));
|
||||||
|
if (failCoils.length > 0) {
|
||||||
|
this.$message.warning(`移除完成:成功 ${detailIds.length} 个,失败 ${failCoils.length} 个(${failCoils.join('、')})`);
|
||||||
|
} else {
|
||||||
|
this.$message.success(`成功移除 ${detailIds.length} 个钢卷`);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
this.$message.error('批量移除失败');
|
||||||
|
}
|
||||||
|
this.buttonLoading = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
},
|
||||||
// 处理重贴标签
|
// 处理重贴标签
|
||||||
handleReplaceLabel(row) {
|
handleReplaceLabel(row) {
|
||||||
updateMaterialCoilSimple({
|
updateMaterialCoilSimple({
|
||||||
@@ -1756,15 +1819,15 @@ export default {
|
|||||||
this.loading = false;
|
this.loading = false;
|
||||||
})
|
})
|
||||||
// 获取统计数据:已发货的数量和未发货的数量
|
// 获取统计数据:已发货的数量和未发货的数量
|
||||||
listBoundCoil({ ...query, status: 0 }).then(res => {
|
listBoundCoil({ ...query, status: 0, pageNum: 1, pageSize: 1 }).then(res => {
|
||||||
this.unshippedCount = res.total;
|
this.unshippedCount = res.total;
|
||||||
})
|
})
|
||||||
// 获取统计数据:已发货的数量和未发货的数量
|
// 获取统计数据:已发货的数量和未发货的数量
|
||||||
listBoundCoil({ ...query, status: 1 }).then(res => {
|
listBoundCoil({ ...query, status: 1, pageNum: 1, pageSize: 1 }).then(res => {
|
||||||
this.shippedCount = res.total;
|
this.shippedCount = res.total;
|
||||||
})
|
})
|
||||||
|
|
||||||
getCoilStatisticsList(query).then(res => {
|
getBoundCoilStatisticsList(query).then(res => {
|
||||||
this.statistics = res.data || [];
|
this.statistics = res.data || [];
|
||||||
})
|
})
|
||||||
return;
|
return;
|
||||||
@@ -1892,6 +1955,14 @@ export default {
|
|||||||
};
|
};
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
|
remoteSearchWaybill(query) {
|
||||||
|
this.waybillLoading = true;
|
||||||
|
listDeliveryPlan({ planName: query, pageNum: 1, pageSize: 20, planType: 0 }).then(res => {
|
||||||
|
this.waybillOptions = res.rows || [];
|
||||||
|
}).finally(() => {
|
||||||
|
this.waybillLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.queryParams.pageNum = 1;
|
this.queryParams.pageNum = 1;
|
||||||
@@ -2061,7 +2132,7 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
this.buttonLoading = true;
|
this.buttonLoading = true;
|
||||||
if (this.form.coilId != null) {
|
if (this.form.coilId != null) {
|
||||||
const { status, exclusiveStatus, dataType, ...payload} = {
|
const { status, exclusiveStatus, dataType, ...payload } = {
|
||||||
...this.form,
|
...this.form,
|
||||||
}
|
}
|
||||||
updateMaterialCoilSimple(payload).then(_ => {
|
updateMaterialCoilSimple(payload).then(_ => {
|
||||||
|
|||||||
@@ -56,6 +56,11 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="queryParams.remark" placeholder="请输入备注" clearable
|
||||||
|
@keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
@@ -178,7 +183,25 @@
|
|||||||
<!-- 如果没有绑定订单,这里是使用手机号字段来存储手填的订单编号 -->
|
<!-- 如果没有绑定订单,这里是使用手机号字段来存储手填的订单编号 -->
|
||||||
<el-form-item label="订单编号" prop="principalPhone" v-if="!form.orderId">
|
<el-form-item label="订单编号" prop="principalPhone" v-if="!form.orderId">
|
||||||
<div style="display: flex; gap: 10px; align-items: center;">
|
<div style="display: flex; gap: 10px; align-items: center;">
|
||||||
<el-input v-model="form.principalPhone" placeholder="请输入订单编号" style="flex: 1;" />
|
<el-autocomplete
|
||||||
|
v-model="form.principalPhone"
|
||||||
|
:fetch-suggestions="queryOrderSuggestions"
|
||||||
|
placeholder="请输入订单编号"
|
||||||
|
style="flex: 1;"
|
||||||
|
value-key="orderCode"
|
||||||
|
@select="onOrderAutoSelect"
|
||||||
|
clearable
|
||||||
|
:highlight-first-item="true"
|
||||||
|
popper-class="order-autocomplete-popper"
|
||||||
|
>
|
||||||
|
<template slot-scope="{ item }">
|
||||||
|
<div class="order-suggestion-item">
|
||||||
|
<span class="suggestion-code">{{ item.orderCode }}</span>
|
||||||
|
<span class="suggestion-company">{{ item.companyName }}</span>
|
||||||
|
<span class="suggestion-salesman">{{ item.salesman }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-autocomplete>
|
||||||
<el-button type="primary" size="small" @click="bindOrder">绑定订单</el-button>
|
<el-button type="primary" size="small" @click="bindOrder">绑定订单</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -344,6 +367,8 @@ export default {
|
|||||||
// 订单搜索关键词
|
// 订单搜索关键词
|
||||||
orderQuery: '',
|
orderQuery: '',
|
||||||
orderId: '',
|
orderId: '',
|
||||||
|
// 订单自动补全
|
||||||
|
orderSuggestLoading: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -645,6 +670,52 @@ export default {
|
|||||||
this.form.principal = row.salesman;
|
this.form.principal = row.salesman;
|
||||||
this.orderDialogVisible = false;
|
this.orderDialogVisible = false;
|
||||||
},
|
},
|
||||||
|
/** 订单编号自动补全 */
|
||||||
|
queryOrderSuggestions(queryString, callback) {
|
||||||
|
if (!queryString || queryString.trim() === '') {
|
||||||
|
callback([]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.orderSuggestLoading = true;
|
||||||
|
listOrder({ pageNum: 1, pageSize: 10, keyword: queryString }).then(response => {
|
||||||
|
const suggestions = (response.rows || []).map(item => ({
|
||||||
|
...item,
|
||||||
|
value: item.orderCode
|
||||||
|
}));
|
||||||
|
this.orderSuggestLoading = false;
|
||||||
|
callback(suggestions);
|
||||||
|
}).catch(() => {
|
||||||
|
this.orderSuggestLoading = false;
|
||||||
|
callback([]);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 自动补全选择订单 */
|
||||||
|
onOrderAutoSelect(item) {
|
||||||
|
const existing = this.deliveryWaybillList.find(
|
||||||
|
d => d.orderId === item.orderId || d.orderCode === item.orderCode
|
||||||
|
);
|
||||||
|
if (existing) {
|
||||||
|
this.$confirm(
|
||||||
|
`订单"${item.orderCode}"已绑定在发货单"${existing.waybillName}"中,确定继续绑定?`,
|
||||||
|
'提示',
|
||||||
|
{ confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }
|
||||||
|
).then(() => {
|
||||||
|
this.doBindOrder(item);
|
||||||
|
}).catch(() => {
|
||||||
|
this.form.principalPhone = item.orderCode;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.doBindOrder(item);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/** 执行订单绑定并填写信息 */
|
||||||
|
doBindOrder(item) {
|
||||||
|
this.form.orderId = item.orderId;
|
||||||
|
this.form.orderCode = item.orderCode;
|
||||||
|
this.form.consigneeUnit = item.companyName;
|
||||||
|
this.form.principal = item.salesman;
|
||||||
|
this.form.principalPhone = item.orderCode;
|
||||||
|
},
|
||||||
/** 打印发货单 */
|
/** 打印发货单 */
|
||||||
handlePrint(row, printType) {
|
handlePrint(row, printType) {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
@@ -856,4 +927,58 @@ export default {
|
|||||||
::v-deep .el-pagination {
|
::v-deep .el-pagination {
|
||||||
margin-top: 6px !important;
|
margin-top: 6px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.order-suggestion-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 12px;
|
||||||
|
padding: 4px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.suggestion-code {
|
||||||
|
font-weight: 500;
|
||||||
|
color: #303133;
|
||||||
|
min-width: 120px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.suggestion-company {
|
||||||
|
color: #909399;
|
||||||
|
font-size: 12px;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.suggestion-salesman {
|
||||||
|
color: #409eff;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.order-autocomplete-popper {
|
||||||
|
min-width: 380px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-autocomplete-popper .order-suggestion-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 12px;
|
||||||
|
padding: 4px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-autocomplete-popper .suggestion-code {
|
||||||
|
font-weight: 500;
|
||||||
|
color: #303133;
|
||||||
|
min-width: 120px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-autocomplete-popper .suggestion-company {
|
||||||
|
color: #909399;
|
||||||
|
font-size: 12px;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-autocomplete-popper .suggestion-salesman {
|
||||||
|
color: #409eff;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user