feat(wms): 添加钢卷吞吐记录功能及优化日志查询
- 新增根据钢卷ID查询操作记录的API接口 - 在钢卷管理页面添加吞吐记录查看功能 - 优化日志表格组件,支持按业务类型和出入库类型筛选 - 增加日志删除功能 - 调整ActualWarehouseSelect组件支持清除输入
This commit is contained in:
@@ -61,3 +61,13 @@ export function getCoilWarehouseOperationLogByWarehouseId(params) {
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
// 根据钢卷ID查询操作记录及钢卷信息、库区信息
|
||||
export function getCoilWarehouseOperationLogByCoilId(params) {
|
||||
return request({
|
||||
timeout: 100000,
|
||||
url: '/wms/coilWarehouseOperationLog/byCoilId',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
@@ -233,6 +233,8 @@
|
||||
@click="handleAbnormal(scope.row)">查看异常</el-button>
|
||||
<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-time" @click="handleLog(scope.row)"
|
||||
v-if="showWareLog">吞吐记录</el-button>
|
||||
<!-- <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
v-if="showControl">删除</el-button> -->
|
||||
<el-button size="mini" type="text" icon="el-icon-search" @click="handleTrace(scope.row)">追溯</el-button>
|
||||
@@ -367,6 +369,11 @@
|
||||
<el-dialog title="异常信息" :visible.sync="abnormalOpen" width="90%" append-to-body>
|
||||
<abnormal-list :coil-id="currentCoilId"></abnormal-list>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 吞吐记录 -->
|
||||
<el-dialog v-if="showWareLog" title="吞吐记录" :visible.sync="logOpen" width="90%" append-to-body>
|
||||
<log-table :coil-id="currentCoilId"></log-table>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -408,6 +415,7 @@ import html2canvas from 'html2canvas';
|
||||
import { PDFDocument } from 'pdf-lib';
|
||||
import { listUser } from "@/api/system/user";
|
||||
import AbnormalList from "./abnormal.vue";
|
||||
import LogTable from "@/views/wms/warehouse/components/LogTable.vue";
|
||||
|
||||
export default {
|
||||
name: "MaterialCoil",
|
||||
@@ -428,6 +436,7 @@ export default {
|
||||
MutiSelect,
|
||||
OuterTagPreview,
|
||||
AbnormalList,
|
||||
LogTable,
|
||||
},
|
||||
dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer', 'coil_quality_status', 'warehouse_sync'],
|
||||
props: {
|
||||
@@ -495,6 +504,10 @@ export default {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
showWareLog: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -661,6 +674,7 @@ export default {
|
||||
abnormalOpen: false,
|
||||
currentCoilId: '',
|
||||
userList: [],
|
||||
logOpen: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -979,6 +993,10 @@ export default {
|
||||
this.title = "修改钢卷物料";
|
||||
});
|
||||
},
|
||||
handleLog(row) {
|
||||
this.logOpen = true;
|
||||
this.currentCoilId = row.coilId;
|
||||
},
|
||||
transferCoil() { },
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
|
||||
@@ -182,7 +182,7 @@
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="真实库区" prop="actualWarehouseId">
|
||||
<ActualWarehouseSelect v-model="updateForm.actualWarehouseId" placeholder="请选择真实库区" block />
|
||||
<ActualWarehouseSelect :clearInput="false" clearable v-model="updateForm.actualWarehouseId" placeholder="请选择真实库区" block />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="备注" prop="remark">
|
||||
|
||||
27
klp-ui/src/views/wms/coil/ware.vue
Normal file
27
klp-ui/src/views/wms/coil/ware.vue
Normal file
@@ -0,0 +1,27 @@
|
||||
<template>
|
||||
<BasePage :qrcode="qrcode" :querys="querys" :labelType="labelType" :hideWarehouseQuery="hideWarehouseQuery"
|
||||
:hideType="hideType" :showControl="showControl" :showWareLog="showWareLog" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import BasePage from './panels/base.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
BasePage
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
qrcode: false,
|
||||
querys: {
|
||||
// dataType: 1,
|
||||
},
|
||||
hideWarehouseQuery: true,
|
||||
showWareLog: true,
|
||||
showControl: false,
|
||||
labelType: '2',
|
||||
hideType: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -3,22 +3,26 @@
|
||||
<!-- 筛选条件 -->
|
||||
<el-form :inline="true" :model="logParams" class="demo-form-inline mb20">
|
||||
<el-form-item label="开始时间">
|
||||
<el-date-picker
|
||||
v-model="logParams.startTime"
|
||||
type="datetime"
|
||||
placeholder="选择开始时间"
|
||||
format="yyyy-MM-dd HH:mm:ss"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
/>
|
||||
<el-date-picker v-model="logParams.startTime" type="datetime" placeholder="选择开始时间" format="yyyy-MM-dd HH:mm:ss"
|
||||
value-format="yyyy-MM-dd HH:mm:ss" />
|
||||
</el-form-item>
|
||||
<el-form-item label="结束时间">
|
||||
<el-date-picker
|
||||
v-model="logParams.endTime"
|
||||
type="datetime"
|
||||
placeholder="选择结束时间"
|
||||
format="yyyy-MM-dd HH:mm:ss"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
/>
|
||||
<el-date-picker v-model="logParams.endTime" type="datetime" placeholder="选择结束时间" format="yyyy-MM-dd HH:mm:ss"
|
||||
value-format="yyyy-MM-dd HH:mm:ss" />
|
||||
</el-form-item>
|
||||
<el-form-item label="业务类型">
|
||||
<el-select v-model="logParams.operationType" clearable placeholder="请选择业务类型">
|
||||
<el-option label="收货" value="1" />
|
||||
<el-option label="加工" value="2" />
|
||||
<el-option label="调拨" value="3" />
|
||||
<el-option label="发货" value="4" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="出入库类型">
|
||||
<el-select v-model="logParams.inOutType" clearable placeholder="请选择出入库类型">
|
||||
<el-option label="入库" value="1" />
|
||||
<el-option label="出库" value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="getLogList">查询</el-button>
|
||||
@@ -26,12 +30,7 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table
|
||||
v-loading="logLoading"
|
||||
:data="logList"
|
||||
style="width: 100%"
|
||||
border
|
||||
>
|
||||
<el-table v-loading="logLoading" :data="logList" style="width: 100%" border stripe>
|
||||
<el-table-column prop="createTime" label="操作时间" width="180">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.createTime }}
|
||||
@@ -39,7 +38,11 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="operationType" label="操作类型" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.operationType === 1 ? '入库' : '出库' }}
|
||||
<span v-if="scope.row.operationType === 1">收货</span>
|
||||
<span v-else-if="scope.row.operationType === 2">加工</span>
|
||||
<span v-else-if="scope.row.operationType === 3">调拨</span>
|
||||
<span v-else-if="scope.row.operationType === 4">发货</span>
|
||||
<!-- {{ scope.row.operationType === 1 ? '入库' : '出库' }} -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="inOutType" label="出入库类型" width="100">
|
||||
@@ -52,19 +55,22 @@
|
||||
{{ scope.row.coil && scope.row.coil.enterCoilNo ? scope.row.coil.enterCoilNo : '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="coil.itemName" label="物料名称" width="120">
|
||||
<el-table-column prop="coil.weight" label="重量" width="120">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.coil && scope.row.coil.itemName ? scope.row.coil.itemName : '-' }}
|
||||
{{ scope.row.coil && scope.row.coil.netWeight ? scope.row.coil.netWeight : '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="coil.specification" label="规格" width="150">
|
||||
<el-table-column prop="coil.specification" label="规格" width="220">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.coil && scope.row.coil.specification ? scope.row.coil.specification : '-' }}
|
||||
<ProductInfo v-if="scope.row.coil.itemType == 'product'" :product="scope.row.coil.product" />
|
||||
<RawMaterialInfo v-else-if="scope.row.coil.itemType === 'raw_material'"
|
||||
:material="scope.row.coil.rawMaterial" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="warehouse.actualWarehouseName" label="库位" width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.warehouse && scope.row.warehouse.actualWarehouseName ? scope.row.warehouse.actualWarehouseName : '-' }}
|
||||
{{ scope.row.warehouse && scope.row.warehouse.actualWarehouseName ? scope.row.warehouse.actualWarehouseName :
|
||||
'-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" min-width="150">
|
||||
@@ -72,82 +78,148 @@
|
||||
{{ scope.row.remark || '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button :loading="buttonLoading" type="danger" size="mini" icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="logParams.pageNum"
|
||||
:limit.sync="logParams.pageSize" @pagination="getLogList" />
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="logParams.pageNum" :limit.sync="logParams.pageSize"
|
||||
@pagination="getLogList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getCoilWarehouseOperationLogByWarehouseId } from "@/api/wms/coilWarehouseOperationLog";
|
||||
import { getCoilWarehouseOperationLogByWarehouseId, delCoilWarehouseOperationLog, getCoilWarehouseOperationLogByCoilId } from "@/api/wms/coilWarehouseOperationLog";
|
||||
import ProductInfo from "@/components/KLPService/Renderer/ProductInfo";
|
||||
import RawMaterialInfo from "@/components/KLPService/Renderer/RawMaterialInfo";
|
||||
|
||||
export default {
|
||||
name: "LogTable",
|
||||
props: {
|
||||
warehouseId: {
|
||||
type: String,
|
||||
default: ""
|
||||
export default {
|
||||
name: "LogTable",
|
||||
props: {
|
||||
warehouseId: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
coilId: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
},
|
||||
components: {
|
||||
ProductInfo,
|
||||
RawMaterialInfo,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
logList: [],
|
||||
total: 0,
|
||||
logParams: {
|
||||
coilId: null,
|
||||
startTime: "",
|
||||
endTime: "",
|
||||
operationType: null,
|
||||
inOutType: null,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
logLoading: false,
|
||||
buttonLoading: false,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
warehouseId: {
|
||||
handler(newVal, oldVal) {
|
||||
if (newVal !== oldVal && newVal !== "") {
|
||||
this.logParams.secondWarehouseId = newVal;
|
||||
this.getLogListByWarehouseId();
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
coilId: {
|
||||
handler(newVal, oldVal) {
|
||||
if (newVal !== oldVal && newVal !== "") {
|
||||
this.logParams.coilId = newVal;
|
||||
this.getLogListByCoilId();
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getLogList() {
|
||||
if (this.coilId) {
|
||||
this.getLogListByCoilId();
|
||||
} else {
|
||||
this.getLogListByWarehouseId();
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
logList: [],
|
||||
total: 0,
|
||||
logParams: {
|
||||
startTime: "",
|
||||
endTime: "",
|
||||
operationType: null,
|
||||
inOutType: null,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
logLoading: false,
|
||||
};
|
||||
// 获取日志列表
|
||||
getLogListByWarehouseId() {
|
||||
this.logLoading = true;
|
||||
getCoilWarehouseOperationLogByWarehouseId(this.logParams)
|
||||
.then((res) => {
|
||||
this.logList = res.data || [];
|
||||
this.total = res.total || 0;
|
||||
})
|
||||
.catch((err) => { this.$message.error("获取日志列表失败:" + err.message); })
|
||||
.finally(() => { this.logLoading = false; });
|
||||
},
|
||||
watch: {
|
||||
warehouseId: {
|
||||
handler(newVal, oldVal) {
|
||||
if (newVal !== oldVal && newVal !== "") {
|
||||
this.logParams.secondWarehouseId = newVal;
|
||||
this.getLogList();
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
// 获取日志列表
|
||||
getLogListByCoilId() {
|
||||
this.logLoading = true;
|
||||
getCoilWarehouseOperationLogByCoilId(this.logParams)
|
||||
.then((res) => {
|
||||
this.logList = res.data || [];
|
||||
this.total = res.total || 0;
|
||||
})
|
||||
.catch((err) => { this.$message.error("获取日志列表失败:" + err.message); })
|
||||
.finally(() => { this.logLoading = false; });
|
||||
},
|
||||
methods: {
|
||||
// 获取日志列表
|
||||
getLogList() {
|
||||
this.logLoading = true;
|
||||
getCoilWarehouseOperationLogByWarehouseId(this.logParams)
|
||||
// 删除日志
|
||||
handleDelete(row) {
|
||||
this.$modal.confirm("确认删除该日志吗?", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
}).then(() => {
|
||||
// 确认删除
|
||||
this.buttonLoading = true;
|
||||
delCoilWarehouseOperationLog(row.logId)
|
||||
.then((res) => {
|
||||
this.logList = res.data || [];
|
||||
this.total = res.total || 0;
|
||||
this.$message.success("删除成功");
|
||||
this.getLogList();
|
||||
})
|
||||
.catch((err) => { this.$message.error("获取日志列表失败:" + err.message); })
|
||||
.finally(() => { this.logLoading = false; });
|
||||
},
|
||||
// 重置筛选条件
|
||||
resetParams() {
|
||||
this.logParams = {
|
||||
startTime: "",
|
||||
endTime: "",
|
||||
operationType: null,
|
||||
inOutType: null,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
secondWarehouseId: this.warehouseId
|
||||
};
|
||||
this.getLogList();
|
||||
},
|
||||
.finally(() => {
|
||||
this.buttonLoading = false;
|
||||
})
|
||||
.catch((err) => { this.$message.error("删除失败:" + err.message); });
|
||||
})
|
||||
},
|
||||
};
|
||||
// 重置筛选条件
|
||||
resetParams() {
|
||||
this.logParams = {
|
||||
startTime: "",
|
||||
endTime: "",
|
||||
operationType: null,
|
||||
inOutType: null,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
secondWarehouseId: this.warehouseId
|
||||
};
|
||||
this.getLogList();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.mb20 {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.mb20 {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user