feat(钢卷管理): 添加发货单相关功能及统计信息
- 新增发货单数量统计显示,展示已发货和未发货数量 - 添加从发货单移除钢卷的功能 - 移除不再使用的代码注释
This commit is contained in:
@@ -62,12 +62,16 @@
|
||||
<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-form-item>
|
||||
|
||||
<el-form-item style="float: right;" v-if="showWaybill" v-loading="loading">
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="已发货数量">{{ shippedCount }}</el-descriptions-item>
|
||||
<el-descriptions-item label="未发货数量">{{ unshippedCount }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8" v-if="showControl">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
|
||||
</el-col> -->
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single"
|
||||
@click="handleCheck">修正</el-button>
|
||||
@@ -134,11 +138,6 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更新人" v-if="!showExportTime" align="center" prop="updateByName" />
|
||||
<!-- <el-table-column label="二维码">
|
||||
<template slot-scope="scope">
|
||||
<QRCode :content="scope.row.qrcodeRecordId" :size="50" />
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="关联信息" align="center" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.parentCoilNos && scope.row.hasMergeSplit === 1 && scope.row.dataType === 1">
|
||||
@@ -301,6 +300,10 @@
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleCheck(scope.row)"
|
||||
v-if="showControl">修正</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-search" @click="handleTrace(scope.row)">追溯</el-button>
|
||||
<el-button size="mini" v-if="showWaybill" type="text" icon="el-icon-close"
|
||||
@click="handleRemoveFromWaybill(scope.row)">
|
||||
移出发货单
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</KLPTable>
|
||||
@@ -521,6 +524,7 @@ import LogTable from "@/views/wms/warehouse/components/LogTable.vue";
|
||||
import { getCoilTagPrintType } from '@/views/wms/coil/js/coilPrint';
|
||||
import DragResizeBox from '@/components/DragResizeBox/index.vue';
|
||||
import ProcessFlow from '../components/ProcessFlow.vue';
|
||||
import { listDeliveryWaybillDetail, delDeliveryWaybillDetail } from "@/api/wms/deliveryWaybillDetail";
|
||||
|
||||
export default {
|
||||
name: "MaterialCoil",
|
||||
@@ -825,6 +829,9 @@ export default {
|
||||
],
|
||||
},
|
||||
productionTimeFormVisible: false,
|
||||
// 统计数据:已发货的数量和未发货的数量
|
||||
shippedCount: 0,
|
||||
unshippedCount: 0,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -873,6 +880,35 @@ export default {
|
||||
// 初始化时计算一次
|
||||
this.calculateProductionDuration();
|
||||
},
|
||||
async handleRemoveFromWaybill(row) {
|
||||
const coilId = row.coilId;
|
||||
// 根据id查询所在的单据明细
|
||||
const res = await listDeliveryWaybillDetail({ coilId });
|
||||
|
||||
if (res.rows.length != 1) {
|
||||
this.$message({
|
||||
message: '发货单查找失败',
|
||||
type: 'error',
|
||||
});
|
||||
return;
|
||||
}
|
||||
console.log(res.rows)
|
||||
const detailId = res.rows[0].detailId;
|
||||
// 二次确认是否移除
|
||||
this.$modal.confirm('确认要将该钢卷从发货单中移除吗?', {
|
||||
title: '确认移除',
|
||||
type: 'warning',
|
||||
}).then(() => {
|
||||
delDeliveryWaybillDetail(detailId).then(res => {
|
||||
this.$message({
|
||||
message: '移除成功',
|
||||
type: 'success',
|
||||
});
|
||||
this.getList();
|
||||
});
|
||||
})
|
||||
// 打开一个弹窗列出查询到的所有单据明细
|
||||
},
|
||||
// 格式化毫秒值为xx天xx小时xx分钟
|
||||
formatDuration(milliseconds) {
|
||||
if (!milliseconds || milliseconds < 0) return '';
|
||||
@@ -1022,6 +1058,14 @@ export default {
|
||||
this.total = res.total;
|
||||
this.loading = false;
|
||||
})
|
||||
// 获取统计数据:已发货的数量和未发货的数量
|
||||
listBoundCoil({ ...query, status: 0 }).then(res => {
|
||||
this.unshippedCount = res.total;
|
||||
})
|
||||
// 获取统计数据:已发货的数量和未发货的数量
|
||||
listBoundCoil({ ...query, status: 1 }).then(res => {
|
||||
this.shippedCount = res.total;
|
||||
})
|
||||
return;
|
||||
}
|
||||
listMaterialCoil(query).then(response => {
|
||||
@@ -1147,25 +1191,6 @@ export default {
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.isCheck = false;
|
||||
this.reset();
|
||||
|
||||
// 如果父组件传入了 materialType,使用它作为默认值
|
||||
if (this.querys.materialType) {
|
||||
this.form.materialType = this.querys.materialType;
|
||||
// 同时设置对应的 itemType
|
||||
if (this.querys.materialType === '成品') {
|
||||
this.form.itemType = 'product';
|
||||
} else if (this.querys.materialType === '原料') {
|
||||
this.form.itemType = 'raw_material';
|
||||
}
|
||||
}
|
||||
|
||||
this.open = true;
|
||||
this.title = "添加钢卷物料";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.isCheck = false;
|
||||
|
||||
Reference in New Issue
Block a user