This commit is contained in:
赵正易
2024-04-18 10:58:41 +08:00
2 changed files with 274 additions and 116 deletions

View File

@@ -12,6 +12,20 @@ export function listWmFgentryInspect(query) {
})
}
/**
* 成品入库检验分页查询 一级
* @param {查询条件} data
*/
export function listWmFgentryInspect_firstLevel(query) {
return request({
url: '/mes/wm/WmFgentryInspect/first_level_list',
method: 'get',
params: query,
})
}
/**
* 新增成品入库检验
* @param data

View File

@@ -9,39 +9,144 @@
<template>
<div class="app-container">
<!-- :model属性用于表单验证使用 比如下面的el-form-item prop属性用于对表单值进行验证操作 -->
<el-form :model="queryParams" size="small" label-position="right" inline ref="queryForm" :label-width="labelWidth" v-show="showSearch"
@submit.native.prevent>
<el-form
:model="queryParams"
size="small"
label-position="right"
inline
ref="queryForm"
:label-width="labelWidth"
v-show="showSearch"
@submit.native.prevent
>
<el-form-item label="工单号">
<el-input v-model="queryParams.workorder"></el-input>
</el-form-item>
<el-form-item label="零件号">
<el-input v-model="queryParams.partnumber"></el-input>
</el-form-item>
<el-form-item label="外箱标签">
<el-input v-model="queryParams.packcode"></el-input>
</el-form-item>
<el-form-item label="开始日期">
<el-date-picker
:style="{ width: inputWidth }"
v-model="queryParams.starttime"
type="datetime"
placeholder="选择日期时间"
align="right"
:picker-options="pickerOptions"
>
</el-date-picker>
</el-form-item>
<el-form-item label="结束日期">
<el-date-picker
:style="{ width: inputWidth }"
v-model="queryParams.endtime"
type="datetime"
placeholder="选择日期时间"
align="right"
:picker-options="pickerOptions"
>
</el-date-picker>
</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-table
:data="firstLevel_dataList"
v-loading="loading"
ref="table"
border
highlight-current-row
@sort-change="sortChange"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="50" align="center" />
<!-- <el-table-column prop="id" label="主键" align="center" /> -->
<el-table-column prop="workorder" label="工单号" align="center" :show-overflow-tooltip="true" />
<el-table-column prop="productionNum" label="箱子里产品个数" align="center" />
<el-table-column prop="partnumber" label="零件号" align="center" :show-overflow-tooltip="true" />
<el-table-column label="操作" align="center" width="140">
<template slot-scope="scope">
<el-button
size="mini"
v-hasPermi="['wmsManagement:wmfgentryinspect:edit']"
type="success"
icon="el-icon-edit"
title="编辑"
@click="handleUpdate(scope.row)"
></el-button>
<el-button
size="mini"
v-hasPermi="['wmsManagement:wmfgentryinspect:delete']"
type="danger"
icon="el-icon-delete"
title="删除"
@click="handleDelete(scope.row)"
></el-button>
</template>
</el-table-column>
</el-table>
<pagination class="mt10" background :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
<!-- 二级菜单区 -->
<!-- 工具区域 -->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" v-hasPermi="['wmsManagement:wmfgentryinspect:add']" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
<el-button type="primary" v-hasPermi="['wmsManagement:wmfgentryinspect:add']" plain icon="el-icon-plus" size="mini" @click="handleAdd"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button type="success" :disabled="single" v-hasPermi="['wmsManagement:wmfgentryinspect:edit']" plain icon="el-icon-edit" size="mini" @click="handleUpdate">修改</el-button>
<el-button
type="success"
:disabled="single"
v-hasPermi="['wmsManagement:wmfgentryinspect:edit']"
plain
icon="el-icon-edit"
size="mini"
@click="handleUpdate"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button type="danger" :disabled="multiple" v-hasPermi="['wmsManagement:wmfgentryinspect:delete']" plain icon="el-icon-delete" size="mini" @click="handleDelete">删除</el-button>
<el-button
type="danger"
:disabled="multiple"
v-hasPermi="['wmsManagement:wmfgentryinspect:delete']"
plain
icon="el-icon-delete"
size="mini"
@click="handleDelete"
>删除</el-button
>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 数据区域 -->
<el-table :data="dataList" v-loading="loading" ref="table" border highlight-current-row @sort-change="sortChange" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center"/>
<el-table-column prop="id" label="主键" align="center" />
<el-table
:data="dataList"
v-loading="loading"
ref="table"
border
highlight-current-row
@sort-change="sortChange"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="50" align="center" />
<!-- <el-table-column prop="id" label="主键" align="center" /> -->
<el-table-column prop="workorder" label="工单号" align="center" :show-overflow-tooltip="true" />
<el-table-column prop="packcode" label="箱子号" align="center" :show-overflow-tooltip="true" />
<el-table-column prop="packcode" label="外箱标签" align="center" :show-overflow-tooltip="true" />
<el-table-column prop="machine" label="工位" align="center" :show-overflow-tooltip="true" />
<el-table-column prop="productionNum" label="箱子里产品个数" align="center" />
<el-table-column prop="partnumber" label="零件号" align="center" :show-overflow-tooltip="true" />
<el-table-column prop="bfilled" label="是否满箱" align="center" />
<el-table-column prop="result" label="检验结果0未检1合格2不合格" align="center" />
<el-table-column prop="result" label="检验结果" align="center" />
<el-table-column prop="createdBy" label="创建人" align="center" :show-overflow-tooltip="true" />
<el-table-column prop="createdTime" label="创建时间" align="center" :show-overflow-tooltip="true" />
<el-table-column prop="updatedBy" label="更新人" align="center" :show-overflow-tooltip="true" />
@@ -49,22 +154,33 @@
<el-table-column label="操作" align="center" width="140">
<template slot-scope="scope">
<el-button size="mini" v-hasPermi="['business:wmfgentryinspect:edit']" type="success" icon="el-icon-edit" title="编辑"
@click="handleUpdate(scope.row)"></el-button>
<el-button size="mini" v-hasPermi="['business:wmfgentryinspect:delete']" type="danger" icon="el-icon-delete" title="删除"
@click="handleDelete(scope.row)"></el-button>
<el-button
size="mini"
v-hasPermi="['wmsManagement:wmfgentryinspect:edit']"
type="success"
icon="el-icon-edit"
title="编辑"
@click="handleUpdate(scope.row)"
></el-button>
<el-button
size="mini"
v-hasPermi="['wmsManagement:wmfgentryinspect:delete']"
type="danger"
icon="el-icon-delete"
title="删除"
@click="handleDelete(scope.row)"
></el-button>
</template>
</el-table-column>
</el-table>
<pagination class="mt10" background :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
<!-- 添加或修改成品入库检验对话框 -->
<el-dialog :title="title" :lock-scroll="false" :visible.sync="open" >
<el-dialog :title="title" :lock-scroll="false" :visible.sync="open">
<el-form ref="form" :model="form" :rules="rules" :label-width="formLabelWidth">
<el-row :gutter="20">
<el-col :lg="12" v-if="opertype == 2">
<el-form-item label="主键">{{form.id}}</el-form-item>
<el-form-item label="主键">{{ form.id }}</el-form-item>
</el-col>
<el-col :lg="12">
@@ -74,8 +190,13 @@
</el-col>
<el-col :lg="12">
<el-form-item label="箱子号" prop="packcode">
<el-input-number v-model.number="form.packcode" controls-position="right" placeholder="请输入箱子号" :disabled="title=='修改数据'"/>
<el-form-item label="外箱标签" prop="packcode">
<el-input-number
v-model.number="form.packcode"
controls-position="right"
placeholder="请输入箱子号"
:disabled="title == '修改数据'"
/>
</el-form-item>
</el-col>
@@ -84,7 +205,7 @@
<el-input v-model="form.machine" placeholder="请输入工位" />
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item label="箱子里产品个数" prop="productionNum">
<el-input v-model="form.productionNum" placeholder="请输入箱子里产品个数" />
@@ -96,13 +217,13 @@
<el-input v-model="form.partnumber" placeholder="请输入零件号" />
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item label="是否满箱" prop="bfilled">
<el-input v-model="form.bfilled" placeholder="请输入是否满箱" />
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item label="检验结果0未检1合格2不合格" prop="result">
<el-input v-model="form.result" placeholder="请输入检验结果0未检1合格2不合格" />
@@ -132,7 +253,6 @@
<el-date-picker v-model="form.updatedTime" type="datetime" placeholder="选择日期时间"></el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
@@ -140,27 +260,51 @@
<el-button type="primary" @click="submitForm"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
import {
listWmFgentryInspect,
listWmFgentryInspect_firstLevel,
addWmFgentryInspect,
delWmFgentryInspect,
updateWmFgentryInspect,
getWmFgentryInspect,
} from '@/api/wmsManagement/wmFgentryInspect.js';
} from '@/api/wmsManagement/wmFgentryInspect.js'
export default {
name: "wmfgentryinspect",
name: 'wmfgentryinspect',
data() {
return {
labelWidth: "100px",
formLabelWidth:"100px",
pickerOptions: {
shortcuts: [
{
text: '今天',
onClick(picker) {
picker.$emit('pick', new Date())
},
},
{
text: '昨天',
onClick(picker) {
const date = new Date()
date.setTime(date.getTime() - 3600 * 1000 * 24)
picker.$emit('pick', date)
},
},
{
text: '一周前',
onClick(picker) {
const date = new Date()
date.setTime(date.getTime() - 3600 * 1000 * 24 * 7)
picker.$emit('pick', date)
},
},
],
},
inputWidth: '180px',
labelWidth: '100px',
formLabelWidth: '100px',
// 选中id数组
ids: [],
// 非单个禁用
@@ -173,13 +317,16 @@ export default {
showSearch: true,
// 查询参数
queryParams: {
workorder: '',
partnumber: '',
packcode: '',
pageNum: 1,
pageSize: 10,
sort: undefined,
sortType: undefined,
},
// 弹出层标题
title: "",
title: '',
// 操作类型 1、add 2、edit
opertype: 0,
// 是否显示弹出层
@@ -187,56 +334,53 @@ export default {
// 表单参数
form: {},
columns: [
{ index: 0, key: 'id', label: `主键`, checked: true },
{ index: 1, key: 'workorder', label: `工单号`, checked: true },
{ index: 2, key: 'packcode', label: `箱子号`, checked: true },
{ index: 3, key: 'machine', label: `工位`, checked: true },
{ index: 4, key: 'productionNum', label: `箱子里产品个数`, checked: true },
{ index: 5, key: 'partnumber', label: `零件号`, checked: true },
{ index: 6, key: 'bfilled', label: `是否满箱`, checked: true },
{ index: 7, key: 'result', label: `检验结果0未检1合格2不合格`, checked: true },
{ index: 8, key: 'createdBy', label: `创建人`, checked: true },
{ index: 9, key: 'createdTime', label: `创建时间`, checked: false },
{ index: 10, key: 'updatedBy', label: `更新人`, checked: false },
{ index: 11, key: 'updatedTime', label: `更新时间`, checked: false },
{ index: 0, key: 'id', label: `主键`, checked: true },
{ index: 1, key: 'workorder', label: `工单号`, checked: true },
{ index: 2, key: 'packcode', label: `箱子号`, checked: true },
{ index: 3, key: 'machine', label: `工位`, checked: true },
{ index: 4, key: 'productionNum', label: `箱子里产品个数`, checked: true },
{ index: 5, key: 'partnumber', label: `零件号`, checked: true },
{ index: 6, key: 'bfilled', label: `是否满箱`, checked: true },
{ index: 7, key: 'result', label: `检验结果`, checked: true },
{ index: 8, key: 'createdBy', label: `创建人`, checked: true },
{ index: 9, key: 'createdTime', label: `创建时间`, checked: false },
{ index: 10, key: 'updatedBy', label: `更新人`, checked: false },
{ index: 11, key: 'updatedTime', label: `更新时间`, checked: false },
],
// 数据列表
dataList: [],
// 一级 数据列表
firstLevel_dataList: [],
// 总记录数
total: 0,
// 提交按钮是否显示
btnSubmitVisible: true,
// 表单校验
rules: {
packcode: [
{ required: true, message: "箱子号不能为空", trigger: "blur" }
],
packcode: [{ required: true, message: '箱子号不能为空', trigger: 'blur' }],
},
};
}
},
created() {
created() {
// 列表数据查询
this.getList();
this.getList()
var dictParams = [
];
var dictParams = []
},
methods: {
// 查询数据
getList() {
this.loading = true;
listWmFgentryInspect(this.queryParams).then(res => {
if (res.code == 200) {
this.dataList = res.data.result;
this.total = res.data.totalNum;
this.loading = false;
}
})
this.loading = true
listWmFgentryInspect_firstLevel(this.queryParams).then((res) => {
if (res.code == 200) {
this.firstLevel_dataList = res.data.result
this.total = res.data.totalNum
this.loading = false
}
})
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
this.open = false
this.reset()
},
// 重置数据表单
reset() {
@@ -253,106 +397,106 @@ export default {
createdTime: undefined,
updatedBy: undefined,
updatedTime: undefined,
};
this.resetForm("form");
}
this.resetForm('form')
},
// 重置查询操作
resetQuery() {
this.timeRange = [];
this.resetForm("queryForm");
this.handleQuery();
this.timeRange = []
this.resetForm('queryForm')
this.handleQuery()
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.ids = selection.map((item) => item.id)
this.single = selection.length != 1
this.multiple = !selection.length;
this.multiple = !selection.length
},
// 自定义排序
// 自定义排序
sortChange(column) {
if (column.prop == null || column.order == null) {
this.queryParams.sort = undefined;
this.queryParams.sortType = undefined;
this.queryParams.sort = undefined
this.queryParams.sortType = undefined
} else {
this.queryParams.sort = column.prop;
this.queryParams.sortType = column.order;
this.queryParams.sort = column.prop
this.queryParams.sortType = column.order
}
this.handleQuery();
this.handleQuery()
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
this.queryParams.pageNum = 1
this.getList()
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加";
this.opertype = 1;
this.reset()
this.open = true
this.title = '添加'
this.opertype = 1
},
/** 删除按钮操作 */
handleDelete(row) {
const Ids = row.id || this.ids;
const Ids = row.id || this.ids
this.$confirm('是否确认删除参数编号为"' + Ids + '"的数据项?')
.then(function () {
return delWmFgentryInspect(Ids);
return delWmFgentryInspect(Ids)
})
.then(() => {
this.handleQuery();
this.msgSuccess("删除成功");
this.handleQuery()
this.msgSuccess('删除成功')
})
.catch(() => {});
.catch(() => {})
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
this.reset()
const id = row.id || this.ids
getWmFgentryInspect(id).then((res) => {
const { code, data } = res;
const { code, data } = res
if (code == 200) {
this.open = true;
this.title = "修改数据";
this.opertype = 2;
this.open = true
this.title = '修改数据'
this.opertype = 2
this.form = {
...data,
};
}
}
});
})
},
/** 提交按钮 */
submitForm: function () {
this.$refs["form"].validate((valid) => {
this.$refs['form'].validate((valid) => {
if (valid) {
console.log(JSON.stringify(this.form));
console.log(JSON.stringify(this.form))
if (this.form.id != undefined && this.opertype === 2) {
updateWmFgentryInspect(this.form)
.then((res) => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
})
.catch((err) => {
this.msgSuccess('修改成功')
this.open = false
this.getList()
})
.catch((err) => {
//TODO 错误逻辑
});
})
} else {
addWmFgentryInspect(this.form)
.then((res) => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
})
.catch((err) => {
this.msgSuccess('新增成功')
this.open = false
this.getList()
})
.catch((err) => {
//TODO 错误逻辑
});
})
}
}
});
})
},
},
};
</script>
}
</script>