|
|
|
@ -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}/, ''); // 替换前1到7个0
|
|
|
|
|
},
|
|
|
|
|
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>
|