add:合箱管理

This commit is contained in:
2025-08-22 14:12:55 +08:00
parent 0173a6e51e
commit df6ab03d4b
30 changed files with 2274 additions and 22 deletions

View File

@@ -0,0 +1,218 @@
<template>
<el-dialog
title="库存选择"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
width="1000px"
@close="close"
@open="open"
>
<!-- 搜索 -->
<el-form
:inline="true"
class="demo-form-inline"
label-position="right"
label-width="80px"
label-suffix=":"
>
<el-form-item label="库区查询">
<el-cascader
v-model="storId"
placeholder="库区"
style="width: 200px;"
:options="sects"
:props="{ checkStrictly: true }"
@change="sectQueryChange"
/>
</el-form-item>
<el-form-item label="货位编码">
<el-input
v-model="query.struct_code"
clearable
size="mini"
placeholder="货位号模糊查询"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="物料编码">
<el-input
v-model="query.material_code"
disabled
size="mini"
placeholder="物料"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="批次">
<el-input
v-model="query.pcsn"
clearable
size="mini"
placeholder="批次"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<rrOperation />
</el-form>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
style="width: 100%;"
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@current-change="clickChange"
>
<el-table-column label="选择" width="55">
<template slot-scope="scope">
<el-radio v-model="tableRadio" :label="scope.row"><i /></el-radio>
</template>
</el-table-column>
<el-table-column prop="turnout_sect_name" label="库区名称" :min-width="flexWidth('turnout_sect_name',crud.data,'库区名称')" />
<el-table-column prop="turnout_struct_code" label="货位编码" :min-width="flexWidth('turnout_struct_code',crud.data,'货位编码')" />
<el-table-column prop="storagevehicle_code" label="载具编码" :min-width="flexWidth('storagevehicle_code',crud.data,'载具编码')" />
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
<el-table-column prop="pcsn" label="批次" :min-width="flexWidth('pcsn',crud.data,'批次')" />
<el-table-column prop="qty" label="数量" :formatter="crud.formatNum3" :min-width="flexWidth('qty',crud.data,'重量')" />
<el-table-column prop="frozen_qty" label="冻结数量" :formatter="crud.formatNum3" :min-width="flexWidth('frozen_qty',crud.data,'冻结数量')" />
<el-table-column prop="qty_unit_name" label="重量单位" :min-width="flexWidth('qty_unit_name',crud.data,'重量单位')" />
</el-table>
<!--分页组件-->
<pagination />
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</span>
</el-dialog>
</template>
<script>
import CRUD, { crud, header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination'
import crudSectattr from '@/views/wms/basedata/sectattr/sectattr'
export default {
name: 'AddDtl',
components: { crudOperation, rrOperation, pagination },
cruds() {
return CRUD({
title: '库存物料',
optShow: {
add: false,
edit: false,
del: false,
reset: true,
download: false
},
url: '/api/combinedBox/getCanuseIvt',
idField: 'storagevehicleext_id',
sort: 'storagevehicleext_id,desc'
})
},
mixins: [presenter(), header()],
dicts: ['d_lock_type'],
props: {
dialogShow: {
type: Boolean,
default: false
},
materCode: {
type: String
},
hotNum: {
type: String
}
},
data() {
return {
tableRadio: null,
sects: [],
storId: '1582991156504039424',
dialogVisible: false,
sect: {},
rows: []
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
}
},
methods: {
open() {
this.crud.resetQuery(false)
crudSectattr.getSect({ 'stor_id': this.storId }).then(res => {
this.sects = res.content
})
if (this.sect) {
this.query.sect = this.sect
if (this.sect.length === 1) {
this.query.stor_id = this.sect[0]
this.query.sect_id = ''
}
if (this.sect.length === 0) {
this.query.sect_id = ''
this.query.stor_id = ''
}
if (this.sect.length === 2) {
this.query.stor_id = this.sect[0]
this.query.sect_id = this.sect[1]
}
}
this.query.is_used = '1'
this.query.is_delete = '0'
this.query.stor_id = this.storId
this.query.material_code = this.materCode
this.query.bake_num = this.hotNum
this.crud.toQuery()
},
sectQueryChange(val) {
if (val.length === 1) {
this.query.stor_id = val[0]
this.query.sect_id = ''
}
if (val.length === 0) {
this.query.sect_id = ''
this.query.stor_id = ''
}
if (val.length === 2) {
this.query.stor_id = val[0]
this.query.sect_id = val[1]
}
this.crud.toQuery()
},
close() {
this.sects = null
this.tableRadio = null
this.$emit('update:dialogShow', false)
},
clickChange(item) {
this.tableRadio = item
},
submit() {
if (!this.tableRadio) {
this.$message('请先勾选仓位')
return
}
this.$emit('update:dialogShow', false)
this.$emit('tableChanged', this.tableRadio)
this.tableRadio = null
}
}
}
</script>

View File

@@ -0,0 +1,178 @@
<template>
<el-dialog
title="称重信息"
append-to-body
:visible.sync="dialogVisible"
:before-close="handleClose"
width="1100px"
destroy-on-close
@close="close"
>
<el-form ref="form2" :model="formMst" :rules="rules" size="mini" label-width="130px">
<el-row>
<el-col :span="8">
<el-form-item label="物料编码:">
<el-input v-model="formMst.material_code" disabled size="mini" style="width: 200px" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="物料名称:">
<el-input v-model="formMst.material_name" disabled size="mini" style="width: 200px" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="物料规格:">
<el-input v-model="formMst.material_spec" disabled size="mini" style="width: 200px" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="物料批次:">
<el-input v-model="formMst.pcsn" disabled size="mini" style="width: 200px" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="载具编码:">
<el-input v-model="formMst.vehicle_code" disabled size="mini" style="width: 200px" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="烘烤次数:">
<el-input v-model="formMst.hot_num" disabled size="mini" style="width: 200px" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="库存重量:">
<el-input v-model="formMst.ivt_qty" disabled size="mini" style="width: 200px" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="加料重量:">
<el-input v-model="formMst.material_qty" disabled size="mini" style="width: 200px" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="称重重量:">
<el-input-number v-model="formMst.weight_qty" :precision="2" :controls="false" :min="0" @change="changeQty" style="width: 200px" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-row :gutter="18">
<el-col :span="18" style="border: 1px solid white">
<span />
</el-col>
<el-col :span="6">
<span>
<el-button icon="el-icon-check" size="mini" type="success" @click="getWeigh">称重</el-button>
<el-button icon="el-icon-check" size="mini" type="primary" @click="saveWeigh">保存</el-button>
<el-button icon="el-icon-close" size="mini" type="info" @click="close">关闭</el-button>
</span>
</el-col>
</el-row>
<el-row :gutter="18">
<el-col :span="18" style="border: 10px solid white">
<span />
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import CRUD, { crud } from '@crud/crud'
import crudCombinedBox from '@/views/wms/st/combinedBox/combinedBox'
export default {
name: 'WeighDialog',
mixins: [crud()],
props: {
dialogShow: {
type: Boolean,
default: false
},
openParamWeigh: {
type: Object
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
this.formMst = this.openParamWeigh
}
}
},
data() {
return {
formMst: {
},
current: null,
dialogVisible: false
}
},
methods: {
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
done()
})
.catch(_ => {
})
},
close() {
this.formMst.weight_qty = 0
this.formMst.material_qty = 0
this.$refs['form2'].resetFields()
this.$emit('update:dialogShow', false)
},
changeQty(val) {
this.formMst.material_qty = parseFloat(val) - parseFloat(this.formMst.ivt_qty)
},
getWeigh() {
this.formMst.weight_qty = '100'
this.changeQty(this.formMst.weight_qty)
/* crudCombinedBox.getWeigh(this.formMst).then(res => {
this.formMst.weigh_qty = res.weigh_qty
this.changeQty(res.weight_qty)
this.crud.notify('称重成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
})*/
},
saveWeigh() {
// 校验称重信息不能为0或者空
if (this.formMst.weight_qty === 0) {
this.crud.notify('称重重量不能为0', CRUD.NOTIFICATION_TYPE.ERROR)
return
}
crudCombinedBox.saveWeigh(this.formMst).then(res => {
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.close()
this.crud.toQuery()
})
}
}
}
</script>
<style>
.crud-opts2 {
padding: 0 0;
display: -webkit-flex;
display: flex;
align-items: center;
}
.crud-opts2 .crud-opts-right2 {
margin-left: auto;
padding: 4px 4px;
}
.input-with-select {
background-color: #fff;
}
</style>

View File

@@ -0,0 +1,59 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/combinedBox',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/combinedBox/',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/combinedBox',
method: 'put',
data
})
}
export function sendMoveTask(data) {
return request({
url: 'api/combinedBox/sendMoveTask',
method: 'post',
data
})
}
export function getWeigh(data) {
return request({
url: 'api/combinedBox/getWeigh',
method: 'post',
data
})
}
export function saveWeigh(data) {
return request({
url: 'api/combinedBox/saveWeigh',
method: 'post',
data
})
}
export function confirmIn(data) {
return request({
url: 'api/combinedBox/confirmIn',
method: 'post',
data
})
}
export default { add, edit, del, sendMoveTask, getWeigh, saveWeigh, confirmIn }

View File

@@ -0,0 +1,356 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<div v-if="crud.props.searchToggle">
<el-form
:inline="true"
class="demo-form-inline"
label-position="right"
label-width="80px"
label-suffix=":"
>
<el-form-item label="物料编码">
<el-input
v-model="query.material_code"
clearable
size="mini"
placeholder="物料编码"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="载具编码">
<el-input
v-model="query.vehicle_code"
clearable
size="mini"
placeholder="载具编码"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="焊材批次">
<el-input
v-model="query.pcsn"
clearable
size="mini"
placeholder="焊材批次"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="单据状态">
<el-select
v-model="query.status"
clearable
size="mini"
placeholder="全部"
class="filter-item"
@change="crud.toQuery"
>
<el-option
v-for="item in dict.COMBINED_BOX_STATUS"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<rrOperation />
</el-form>
</div>
<rrOperation />
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission">
<el-button
slot="right"
class="filter-item"
type="success"
icon="el-icon-position"
size="mini"
:disabled="crud.selections.length !== 1"
:loading="loadingSendTask"
@click="sendMoveTask"
>
下发移出任务
</el-button>
<el-button
slot="right"
class="filter-item"
type="success"
icon="el-icon-position"
size="mini"
:disabled="crud.selections.length !== 1"
@click="openWeigh"
>
加料称重
</el-button>
<el-button
slot="right"
class="filter-item"
type="success"
icon="el-icon-check"
size="mini"
:disabled="crud.selections.length !== 1"
:loading="loadingSendTask"
@click="confirmIn"
>
入库确认
</el-button>
</crudOperation>
<el-dialog
:close-on-click-modal="false"
:before-close="crud.cancelCU"
:visible.sync="crud.status.cu > 0"
:title="crud.status.title"
width="1100px"
>
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="150px">
<el-row>
<el-col :span="8">
<el-form-item label="物料编码" prop="material_code">
<el-input v-model="form.material_code" style="width: 200px;" @change="queryMater" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="物料名称" prop="material_name">
<el-input v-model="form.material_name" disabled style="width: 200px;" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="物料规格" prop="material_spec">
<el-input v-model="form.material_spec" disabled style="width: 200px;" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="烘干次数" prop="hot_num">
<el-input-number v-model="form.hot_num" :precision="0" :controls="false" :min="0" :max="3" style="width: 200px" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="载具编码" prop="vehicle_code">
<el-input v-model="form.vehicle_code" disabled style="width: 200px;">
<el-button slot="append" icon="el-icon-search" @click="queryIvt()" />
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="库存数量" prop="ivt_qty">
<el-input v-model="form.ivt_qty" disabled style="width: 200px;" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="焊材批次" prop="pcsn">
<el-input v-model="form.pcsn" disabled style="width: 200px;" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">取消</el-button>
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
</div>
</el-dialog>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
size="mini"
style="width: 100%;"
@selection-change="crud.selectionChangeHandler"
>
<el-table-column type="selection" width="55" />
<el-table-column prop="status" label="单据状态" :min-width="flexWidth('status',crud.data,'单据状态')" :formatter="formattStatus" />
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
<el-table-column prop="hot_num" label="烘干次数" :min-width="flexWidth('hot_num',crud.data,'烘干次数')" />
<el-table-column prop="vehicle_code" label="载具编码" :min-width="flexWidth('vehicle_code',crud.data,'载具编码')" />
<el-table-column prop="pcsn" label="半满箱批次" :min-width="flexWidth('pcsn',crud.data,'半满箱批次')" />
<el-table-column prop="ivt_qty" label="半满箱库存重量" :formatter="crud.formatNum3" :min-width="120" />
<el-table-column prop="weight_qty" label="称重重量" :formatter="crud.formatNum3" :min-width="100" />
<el-table-column prop="material_qty" label="加料重量" :formatter="crud.formatNum3" :min-width="100" />
<el-table-column prop="create_name" label="创建人" :min-width="flexWidth('create_name',crud.data,'叫料人')" />
<el-table-column prop="create_time" label="创建时间" :min-width="flexWidth('create_time',crud.data,'叫料时间')" />
<el-table-column
v-permission="['admin','Supplierbase:edit','Supplierbase:del']"
label="操作"
width="150px"
lign="center"
fixed="right"
>
<template slot-scope="scope">
<udOperation
:data="scope.row"
:disabled-dle="scope.row.status !== '1'"
:disabled-edit="scope.row.status !== '1'"
:permission="permission"
/>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<pagination />
</div>
<AddDtl :dialog-show.sync="AddDtlShow" :mater-code="form.material_code" :hot-num="form.hot_num" @tableChanged="tableChanged" />
<WeighDialog :dialog-show.sync="openWeighDialog" :open-param-weigh="openParamWeigh" />
</div>
</template>
<script>
import crudCombinedBox from '@/views/wms/st/combinedBox/combinedBox'
import AddDtl from '@/views/wms/st/combinedBox/AddDtl'
import WeighDialog from '@/views/wms/st/combinedBox/WeighDialog'
import CRUD, { crud, form, header, presenter } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import rrOperation from '@crud/RR.operation'
import crudGroup from '@/views/wms/basedata/group/group'
const defaultForm = {
id: null,
status: null,
material_id: null,
material_code: null,
material_name: null,
material_spec: null,
hot_num: null,
vehicle_code: null,
pcsn: null,
ivt_qty: null,
move_id: null,
weight_qty: null,
material_qty: null,
create_id: null,
create_name: null,
create_time: null
}
export default {
name: 'CombinedBox',
components: { pagination, crudOperation, rrOperation, udOperation, AddDtl, WeighDialog },
mixins: [presenter(), header(), form(defaultForm), crud()],
// 数据字典
dicts: ['COMBINED_BOX_STATUS'],
cruds() {
return CRUD({
title: '合箱记录',
url: 'api/combinedBox',
optShow: {
add: true,
edit: false,
del: false,
download: false,
reset: true
},
idField: 'id',
sort: 'id,desc',
crudMethod: { ...crudCombinedBox }
})
},
data() {
return {
permission: {},
AddDtlShow: false,
openWeighDialog: false,
loadingSendTask: false,
openParamWeigh: null,
rules: {
material_code: [
{ required: true, message: '物料编码不能为空', trigger: 'blur' }
],
device_code: [
{ required: true, message: '设备编码不能为空', trigger: 'blur' }
],
call_qty: [
{ required: true, message: '叫料重量不能为空', trigger: 'blur' }
]
}
}
},
created() {
},
methods: {
// 钩子在获取表格数据之前执行false 则代表不获取数据
[CRUD.HOOK.beforeRefresh]() {
return true
},
queryMater(value) {
crudGroup.queryMater({ 'material_code': value }).then(row => {
this.form.material_spec = row.material_spec
this.form.material_name = row.material_name
this.form.material_id = row.material_id
}).catch(() => {
this.form.material_spec = ''
this.form.material_name = ''
this.form.material_code = ''
this.form.material_id = ''
})
},
formattStatus(row) {
return this.dict.label.COMBINED_BOX_STATUS[row.status]
},
queryIvt() {
if (this.form.material_code === '' || this.form.material_code === null) {
this.crud.notify('物料编码不能为空!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
this.AddDtlShow = true
},
tableChanged(row) {
this.form.vehicle_code = row.storagevehicle_code
this.form.pcsn = row.pcsn
this.form.ivt_qty = row.qty
},
sendMoveTask() {
const data = this.$refs.table.selection[0]
if (data.status !== '1') {
this.crud.notify('不为生成状态不能下发!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
this.loadingSendTask = true
crudCombinedBox.sendMoveTask(data).then(res => {
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.toQuery()
this.loadingSendTask = false
}).catch(() => {
this.loadingSendTask = false
})
},
openWeigh() {
if (this.$refs.table.selection[0].status !== '3') {
this.crud.notify('当前状态不为移库完成!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
this.openParamWeigh = this.$refs.table.selection[0]
this.openWeighDialog = true
},
confirmIn() {
if (this.$refs.table.selection[0].status !== '3') {
this.crud.notify('当前状态不为移库完成!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
this.loadingSendTask = true
const data = this.$refs.table.selection[0]
crudCombinedBox.confirmIn(data).then(res => {
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.toQuery()
this.loadingSendTask = false
}).catch(() => {
this.loadingSendTask = false
})
}
}
}
</script>
<style scoped>
</style>

View File

@@ -185,6 +185,7 @@
<el-table-column prop="input_time" label="创建日期" :min-width="flexWidth('input_time',crud.data,'创建日期')" />
<el-table-column prop="update_optname" label="修改人" :min-width="flexWidth('update_optname',crud.data,'修改人')" />
<el-table-column prop="update_time" label="修改日期" :min-width="flexWidth('update_time',crud.data,'修改日期')" />
<el-table-column prop="remark" label="备注" :min-width="flexWidth('remark',crud.data,'备注')" />
</el-table>
<!--分页组件-->
<pagination />