wms成品生产记录页面

yangwl
mengjiao 4 months ago
parent 3ae5a42a97
commit 60ec9786b4

@ -0,0 +1,12 @@
import request from '@/utils/request'
// 查询成品生记录列表
export function selectProductProductionRecords(query) {
return request({
url: '/wms/put/selectProductProductionRecords',
method: 'get',
params: query
});
}

@ -0,0 +1,320 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="生产工单" prop="workOrder">
<el-input
v-model="queryParams.productOrder"
placeholder="请输入工单"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="批次" prop="batchCode">
<el-input
v-model="queryParams.batchCode"
placeholder="请输入批次"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="产线名称" prop="lineName">
<el-input
v-model="queryParams.lineName"
placeholder="请输入产线名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="产线编码" prop="lineCode">
<el-input
v-model="queryParams.lineCode"
placeholder="请输入产线编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="产品名称" prop="productName">
<el-input
v-model="queryParams.productName"
placeholder="请输入产品名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="产品编码" prop="productCode">
<el-input
v-model="queryParams.productCode"
placeholder="请输入产品编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="数量" prop="quantity">
<el-input
v-model="queryParams.quantity"
placeholder="请输入数量"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="托盘号" prop="sn">
<el-input
v-model="queryParams.sn"
placeholder="请输入托盘号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="日期" prop="productDate">
<el-date-picker
v-model="queryParams.productDate"
type="date"
placeholder="请选择日期"
clearable
@change="handleDateChange"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<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-form-item>
</el-form>
<!-- <el-row :gutter="10" class="mb8">-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- size="mini"-->
<!-- @click="handleExport"-->
<!-- v-hasPermi="['wms:put:export']"-->
<!-- >导出</el-button>-->
<!-- </el-col>-->
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
<!-- </el-row>-->
<el-table v-loading="loading" :data="putList" @selection-change="handleSelectionChange" style="width: 100%">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="ID" align="center" prop="id" v-if="false"/>
<!-- <el-table-column label="工厂编码" align="center" prop="factoryCode" />-->
<el-table-column label="工单号" align="center" prop="productOrder" width="200px"/>
<el-table-column label="批次" align="center" prop="batchCode" width="200px"/>
<el-table-column label="产品名称" align="center" prop="productName" width="200px"/>
<el-table-column label="产品编码" align="center" prop="productCode">
<template slot-scope="scope">
<span>{{ formatProductCode(scope.row.productCode) }}</span>
</template>
</el-table-column>
<el-table-column label="产线编码" align="center" prop="lineCode" width="200px" />
<el-table-column label="产线名称" align="center" prop="lineName" width="200px" />
<el-table-column label="数量" align="center" prop="quantity" />
<el-table-column label="托盘号" align="center" prop="sn" width="200px"/>
<el-table-column label="记录日期" align="center" prop="productDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.productDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作人" align="center" prop="createBy" width="200px"/>
<el-table-column label="记录时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { selectProductProductionRecords} from "@/api/wms/wmsProductProductionRecords";
export default {
name: "Put",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
putList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
workOrder: null,
batchCode:null,
factoryCode: null,
productOrder: null,
whCode: null,
waCode: null,
wlCode: null,
lineName: null,
lineCode: null,
productName: null,
productCode: null,
productSort: null,
specification: null,
unitOfMeasure: null,
quantity: null,
putQuantity: null,
status: null,
sapStatus: null,
sn: null,
productDate: null,
sapMessage: null,
putDate: null,
attr1: null,
attr2: null,
attr3: null,
attr4: null,
attr5: null,
attr6: null,
attr7: null,
attr8: null,
attr9: null,
attr10: null,
},
//
form: {},
//
rules: {
workOrder: [
{ required: true, message: "报工单号不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询成品生产入库列表 */
getList() {
this.loading = true;
selectProductProductionRecords(this.queryParams).then(response => {
this.putList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
workOrder: null,
batchCode:null,
factoryCode: null,
productOrder: null,
whCode: null,
waCode: null,
wlCode: null,
lineCode: null,
lineName: null,
productName: null,
productCode: null,
productSort: null,
specification: null,
unitOfMeasure: null,
quantity: null,
putQuantity: null,
status: null,
sapStatus: null,
sn: null,
productDate: null,
sapMessage: null,
putDate: null,
attr1: null,
attr2: null,
attr3: null,
attr4: null,
attr5: null,
attr6: null,
attr7: null,
attr8: null,
attr9: null,
attr10: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
formatProductCode(code) {
// 7
if (!code) return code; // null undefined
return code.replace(/^0{1,7}/, ''); // 170
},
handleDateChange(date) {
// YYYY-MM-DD
if (date) {
const formattedDate = this.formatDate(date);
this.queryParams.productDate = formattedDate; // productDate
console.log("Selected date:", this.queryParams.productDate); //
} else {
this.queryParams.productDate = null; // null
}
},
formatDate(date) {
// YYYY-MM-DD
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); // 0
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
},
/** 导出按钮操作 */
handleExport() {
this.download('wms/put/export', {
...this.queryParams
}, `put_${new Date().getTime()}.xlsx`)
}
}
};
</script>
Loading…
Cancel
Save