feat: 新增多项功能并优化多个页面交互
1. 新增批量修改钢卷合同接口与合同批量转单功能 2. 优化KLPTable多选列默认位置与物料预警查询交互 3. 升级CoilTable支持多选与自定义操作栏 4. 新增菜单导出功能 5. 优化钢卷面板列宽与操作按钮文案
This commit is contained in:
@@ -24,7 +24,15 @@
|
||||
<el-tab-pane label="生产成果" name="product">
|
||||
<div class="order-record" v-if="activeTab === 'product'">
|
||||
<!-- 生产成果内容 -->
|
||||
<CoilTable :data="productList || []" />
|
||||
<CoilTable ref="productCoilTable" :data="productList || []" :showSelection="true"
|
||||
@selection-change="handleProductSelectionChange">
|
||||
<template slot="filter-actions" slot-scope="{ selectedRows }">
|
||||
<el-button type="primary" size="mini" icon="el-icon-refresh"
|
||||
:disabled="!selectedRows.length" @click="handleBatchTransferContract(selectedRows)">
|
||||
批量转单
|
||||
</el-button>
|
||||
</template>
|
||||
</CoilTable>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="发货配卷" name="coil">
|
||||
@@ -63,6 +71,20 @@
|
||||
</div>
|
||||
</el-tab-pane> -->
|
||||
</el-tabs>
|
||||
|
||||
<!-- 批量转单 - 选择目标合同弹窗 -->
|
||||
<el-dialog title="批量转单" :visible.sync="batchTransferDialogVisible" width="500px" append-to-body
|
||||
@closed="batchTargetContractId = ''">
|
||||
<div style="margin-bottom: 12px;">
|
||||
已选择 <strong>{{ (batchTransferCoilIds || []).length }}</strong> 卷钢卷,请选择目标合同:
|
||||
</div>
|
||||
<ContractSelect v-model="batchTargetContractId" mode="all" />
|
||||
<span slot="footer">
|
||||
<el-button @click="batchTransferDialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" :disabled="!batchTargetContractId" :loading="batchTransferLoading"
|
||||
@click="confirmBatchTransfer">确认转单</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<div v-else class="no-selection" style="display: flex; align-items: center; justify-content: center; height: 100%;">
|
||||
<el-empty description="请先选择合同" />
|
||||
@@ -73,6 +95,8 @@
|
||||
<script>
|
||||
// import OrderPage from "@/views/crm/order/index.vue";
|
||||
import CoilTable from "../../components/CoilTable.vue";
|
||||
import ContractSelect from "@/components/KLPService/ContractSelect";
|
||||
import { batchUpdateContractCoil } from "@/api/wms/coil";
|
||||
import FileList from "@/components/FileList";
|
||||
import DeliveryTable from "../../components/DeliveryTable.vue";
|
||||
|
||||
@@ -87,6 +111,7 @@ export default {
|
||||
name: "ContractTabs",
|
||||
components: {
|
||||
CoilTable,
|
||||
ContractSelect,
|
||||
FileList,
|
||||
DeliveryTable,
|
||||
OrderDetail,
|
||||
@@ -142,10 +167,51 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
// 活动tab
|
||||
activeTab: "finance"
|
||||
activeTab: "finance",
|
||||
selectedProductRows: [],
|
||||
batchTransferDialogVisible: false,
|
||||
batchTargetContractId: '',
|
||||
batchTransferCoilIds: [],
|
||||
batchTransferLoading: false
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
handleProductSelectionChange(selection) {
|
||||
this.selectedProductRows = selection;
|
||||
},
|
||||
handleBatchTransferContract(selectedRows) {
|
||||
if (!selectedRows || !selectedRows.length) {
|
||||
this.$message.warning('请先选择需要转单的钢卷');
|
||||
return;
|
||||
}
|
||||
this.batchTransferCoilIds = selectedRows.map(row => row.coilId);
|
||||
this.batchTargetContractId = '';
|
||||
this.batchTransferDialogVisible = true;
|
||||
},
|
||||
confirmBatchTransfer() {
|
||||
const coilIds = this.batchTransferCoilIds;
|
||||
const contractId = this.batchTargetContractId;
|
||||
if (!contractId) {
|
||||
this.$message.warning('请选择目标合同');
|
||||
return;
|
||||
}
|
||||
this.batchTransferLoading = true;
|
||||
batchUpdateContractCoil(contractId, coilIds).then(res => {
|
||||
this.$message.success(`成功将 ${coilIds.length} 卷钢卷转入目标合同`);
|
||||
this.batchTransferDialogVisible = false;
|
||||
// 刷新生产成果列表
|
||||
this.$emit('refresh-product');
|
||||
// 清除选中
|
||||
if (this.$refs.productCoilTable) {
|
||||
this.$refs.productCoilTable.clearSelection();
|
||||
}
|
||||
}).catch(err => {
|
||||
console.error('批量转单失败:', err);
|
||||
this.$message.error('批量转单失败,请重试');
|
||||
}).finally(() => {
|
||||
this.batchTransferLoading = false;
|
||||
});
|
||||
},
|
||||
// 解析时间
|
||||
parseTime(time, pattern) {
|
||||
if (!time) return '';
|
||||
|
||||
Reference in New Issue
Block a user