优化入库,将自动报工拆分至入库完成处理

This commit is contained in:
zj
2026-01-28 08:45:16 +08:00
parent 55fd40718f
commit 3a8cd0141b
17 changed files with 1369 additions and 20 deletions

View File

@@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询ProductionCallback列表
export function listProductionCallback(query) {
return request({
url: '/erp/productionCallback/list',
method: 'get',
params: query
})
}
// 查询ProductionCallback详细
export function getProductionCallback(trayCode) {
return request({
url: '/erp/productionCallback/' + trayCode,
method: 'get'
})
}
// 新增ProductionCallback
// export function addProductionCallback(data) {
// return request({
// url: '/erp/productionCallback',
// method: 'post',
// data: data
// })
// }
// 修改ProductionCallback
export function updateProductionCallback(data) {
return request({
url: '/erp/productionCallback',
method: 'put',
data: data
})
}
// 删除ProductionCallback
export function delProductionCallback(trayCode) {
return request({
url: '/erp/productionCallback/' + trayCode,
method: 'delete'
})
}

View File

@@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询调拨单回传列表
export function listTransfer(query) {
return request({
url: '/in/transfer/list',
method: 'get',
params: query
})
}
// 查询调拨单回传详细
export function getTransfer(id) {
return request({
url: '/in/transfer/' + id,
method: 'get'
})
}
// 新增调拨单回传
export function addTransfer(data) {
return request({
url: '/in/transfer',
method: 'post',
data: data
})
}
// 修改调拨单回传
export function updateTransfer(data) {
return request({
url: '/in/transfer',
method: 'put',
data: data
})
}
// 删除调拨单回传
export function delTransfer(id) {
return request({
url: '/in/transfer/' + id,
method: 'delete'
})
}

View File

@@ -0,0 +1,314 @@
<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="billNo">
<el-input
v-model="queryParams.billNo"
placeholder="请输入订单号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="品号" prop="productId">
<el-input
v-model="queryParams.productId"
placeholder="请输入品号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="回传状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择回传状态" clearable>
<el-option
v-for="dict in dict.type.callback_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</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="primary"-->
<!-- plain-->
<!-- icon="el-icon-plus"-->
<!-- size="mini"-->
<!-- @click="handleAdd"-->
<!-- v-hasPermi="['ProductionCallback:ProductionCallback:add']"-->
<!-- >新增</el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['ProductionCallback:ProductionCallback:edit']"
>修改</el-button>
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- plain-->
<!-- icon="el-icon-delete"-->
<!-- size="mini"-->
<!-- :disabled="multiple"-->
<!-- @click="handleDelete"-->
<!-- v-hasPermi="['ProductionCallback:ProductionCallback:remove']"-->
<!-- >删除</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- size="mini"-->
<!-- @click="handleExport"-->
<!-- v-hasPermi="['ProductionCallback:ProductionCallback:export']"-->
<!-- >导出</el-button>-->
<!-- </el-col>-->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="ProductionCallbackList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序列号" align="center" prop="trayCode" />
<el-table-column label="订单号" align="center" prop="billNo" />
<el-table-column label="品号" align="center" prop="productId" />
<el-table-column label="品名" align="center" prop="productName" />
<el-table-column label="规格" align="center" prop="spec" />
<el-table-column label="单位" align="center" prop="unit" />
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="dict.type.callback_status" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="返回代码" align="center" prop="returnCode" />
<el-table-column label="返回信息" align="center" prop="returnMsg" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button>
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-delete"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['ProductionCallback:ProductionCallback:remove']"-->
<!-- >删除</el-button>-->
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改ProductionCallback对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="序列号" prop="trayCode">
<el-input v-model="form.trayCode" placeholder="序列号" disabled/>
</el-form-item>
<el-form-item label="订单号" prop="billNo">
<el-input v-model="form.billNo" placeholder="请输入订单号" />
</el-form-item>
<el-form-item label="品号" prop="productId">
<el-input v-model="form.productId" placeholder="请输入品号" />
</el-form-item>
<el-form-item label="品名" prop="productName">
<el-input v-model="form.productName" placeholder="请输入品名" />
</el-form-item>
<el-form-item label="规格" prop="spec">
<el-input v-model="form.spec" placeholder="请输入规格" />
</el-form-item>
<el-form-item label="单位" prop="unit">
<el-input v-model="form.unit" placeholder="请输入单位" />
</el-form-item>
<el-form-item label="回传状态" prop="status">
<el-select v-model="form.status" placeholder="请选择回传状态">
<el-option
v-for="dict in dict.type.callback_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-input v-model="form.createTime" placeholder="请输入创建时间" disabled/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listProductionCallback, getProductionCallback, delProductionCallback, updateProductionCallback } from "@/api/ProductionCallback/ProductionCallback"
export default {
name: "ProductionCallback",
dicts: ['callback_status'],
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// ProductionCallback表格数据
ProductionCallbackList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
billNo: null,
productId: null,
productName: null,
status: null,
returnCode: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
}
}
},
created() {
this.getList()
},
methods: {
/** 查询ProductionCallback列表 */
getList() {
this.loading = true
listProductionCallback(this.queryParams).then(response => {
this.ProductionCallbackList = response.rows
this.total = response.total
this.loading = false
})
},
// 取消按钮
cancel() {
this.open = false
this.reset()
},
// 表单重置
reset() {
this.form = {
trayCode: null,
billNo: null,
productId: null,
productName: null,
spec: null,
unit: null,
status: null,
createTime: null,
returnCode: null,
returnMsg: 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.trayCode)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.open = true
this.title = "添加ProductionCallback"
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const trayCode = row.trayCode || this.ids
getProductionCallback(trayCode).then(response => {
this.form = response.data
this.open = true
this.title = "修改ProductionCallback"
})
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.trayCode != null) {
updateProductionCallback(this.form).then(response => {
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
} else {
addProductionCallback(this.form).then(response => {
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const trayCodes = row.trayCode || this.ids
this.$modal.confirm('是否确认删除ProductionCallback编号为"' + trayCodes + '"的数据项?').then(function() {
return delProductionCallback(trayCodes)
}).then(() => {
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
this.download('erp/ProductionCallback/export', {
...this.queryParams
}, `ProductionCallback_${new Date().getTime()}.xlsx`)
}
}
}
</script>

View File

@@ -0,0 +1,338 @@
<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="erpBill">
<el-input
v-model="queryParams.erpBill"
placeholder="请输入订单号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="品号" prop="spare1">
<el-input
v-model="queryParams.spare1"
placeholder="请输入品号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="任务类型" prop="type">
<el-select v-model="queryParams.type" placeholder="请选择任务类型" clearable>
<el-option
v-for="dict in dict.type.callback_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="回传状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择回传状态" clearable>
<el-option
v-for="dict in dict.type.callback_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</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="primary"-->
<!-- plain-->
<!-- icon="el-icon-plus"-->
<!-- size="mini"-->
<!-- @click="handleAdd"-->
<!-- v-hasPermi="['in:transfer:add']"-->
<!-- >新增</el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['in:transfer:edit']"
>修改</el-button>
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- plain-->
<!-- icon="el-icon-delete"-->
<!-- size="mini"-->
<!-- :disabled="multiple"-->
<!-- @click="handleDelete"-->
<!-- v-hasPermi="['in:transfer:remove']"-->
<!-- >删除</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- size="mini"-->
<!-- @click="handleExport"-->
<!-- v-hasPermi="['in:transfer:export']"-->
<!-- >导出</el-button>-->
<!-- </el-col>-->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="transferList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键" align="center" prop="id" />
<el-table-column label="任务号" align="center" prop="jobId" />
<el-table-column label="订单号" align="center" prop="erpBill" />
<el-table-column label="品号" align="center" prop="spare1" />
<el-table-column label="品名" align="center" prop="spare2" />
<el-table-column label="规格" align="center" prop="spare3" />
<el-table-column label="序列号" align="center" prop="trayCode" />
<el-table-column label="任务类型" align="center" prop="type">
<template slot-scope="scope">
<dict-tag :options="dict.type.callback_type" :value="scope.row.type"/>
</template>
</el-table-column>
<el-table-column label="回传状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="dict.type.callback_status" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['in:transfer:edit']"
>修改</el-button>
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-delete"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['in:transfer:remove']"-->
<!-- >删除</el-button>-->
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改调拨单回传对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="任务号" prop="jobId">
<el-input v-model="form.jobId" placeholder="请输入任务号" disabled/>
</el-form-item>
<el-form-item label="订单号" prop="erpBill">
<el-input v-model="form.erpBill" placeholder="请输入订单号" />
</el-form-item>
<el-form-item label="品号" prop="spare1">
<el-input v-model="form.spare1" placeholder="请输入品号" />
</el-form-item>
<el-form-item label="品名" prop="spare2">
<el-input v-model="form.spare2" placeholder="请输入品名" />
</el-form-item>
<el-form-item label="规格" prop="spare3">
<el-input v-model="form.spare3" placeholder="请输入规格" />
</el-form-item>
<el-form-item label="序列号" prop="trayCode">
<el-input v-model="form.trayCode" placeholder="请输入序列号" />
</el-form-item>
<el-form-item label="任务类型" prop="type">
<el-select v-model="form.type" placeholder="请选择任务类型">
<el-option
v-for="dict in dict.type.callback_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="回传状态" prop="status">
<el-select v-model="form.status" placeholder="请选择回传状态">
<el-option
v-for="dict in dict.type.callback_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-input v-model="form.createTime" placeholder="请输入创建时间" disabled/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listTransfer, getTransfer, delTransfer, addTransfer, updateTransfer } from "@/api/in/transfer"
export default {
name: "Transfer",
dicts: ['callback_status','callback_type'],
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 调拨单回传表格数据
transferList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
erpBill: null,
type: null,
status: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
}
}
},
created() {
this.getList()
},
methods: {
/** 查询调拨单回传列表 */
getList() {
this.loading = true
listTransfer(this.queryParams).then(response => {
this.transferList = response.rows
this.total = response.total
this.loading = false
})
},
// 取消按钮
cancel() {
this.open = false
this.reset()
},
// 表单重置
reset() {
this.form = {
id: null,
jobId: null,
erpBill: null,
type: null,
status: null,
createTime: null,
finishTime: null,
spare1: null,
spare2: null,
spare3: 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
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.open = true
this.title = "添加调拨单回传"
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const id = row.id || this.ids
getTransfer(id).then(response => {
this.form = response.data
this.open = true
this.title = "修改调拨单回传"
})
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateTransfer(this.form).then(response => {
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
} else {
addTransfer(this.form).then(response => {
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids
this.$modal.confirm('是否确认删除调拨单回传编号为"' + ids + '"的数据项?').then(function() {
return delTransfer(ids)
}).then(() => {
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
this.download('in/transfer/export', {
...this.queryParams
}, `transfer_${new Date().getTime()}.xlsx`)
}
}
}
</script>