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