rev: 入库组盘
This commit is contained in:
161
mes/qd/src/views/wms/storage_manage/product/productIn/AddBox.vue
Normal file
161
mes/qd/src/views/wms/storage_manage/product/productIn/AddBox.vue
Normal file
@@ -0,0 +1,161 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="选择箱号"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="1200px"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<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.bucketunique"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="箱号"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="箱类型">
|
||||
<el-select
|
||||
v-model="query.storagevehicle_type"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
style="width: 200px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in pointlist"
|
||||
:key="item.point_code"
|
||||
:label="item.point_name"
|
||||
:value="item.point_code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation />
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
@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 show-overflow-tooltip width="150" prop="bucketunique" label="箱号" />
|
||||
<el-table-column show-overflow-tooltip width="150" prop="storagevehicle_type" label="箱类型" />
|
||||
<el-table-column show-overflow-tooltip width="150" prop="status" label="状态" />
|
||||
<el-table-column show-overflow-tooltip width="150" prop="material_code" label="物料编码" />
|
||||
<el-table-column show-overflow-tooltip width="150" prop="material_name" label="物料名称" />
|
||||
<el-table-column show-overflow-tooltip width="150" prop="pcsn" label="批次" />
|
||||
<el-table-column show-overflow-tooltip width="150" prop="storage_qty" label="数量" />
|
||||
<el-table-column show-overflow-tooltip width="150" prop="qty_unit_name" label="单位" />
|
||||
<el-table-column show-overflow-tooltip width="150" prop="create_name" label="创建人" />
|
||||
<el-table-column show-overflow-tooltip width="150" prop="create_time" label="创建时间" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
|
||||
<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 DateRangePicker from '@/components/DateRangePicker/index'
|
||||
import crudProductIn from '@/views/wms/storage_manage/product/productIn/productin'
|
||||
|
||||
const start = new Date()
|
||||
export default {
|
||||
name: 'AddBox',
|
||||
components: { crudOperation, rrOperation, pagination, DateRangePicker },
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '用户',
|
||||
url: '/api/mdPbBucketrecord',
|
||||
crudMethod: {},
|
||||
optShow: {
|
||||
reset: true
|
||||
}
|
||||
})
|
||||
},
|
||||
mixins: [presenter(), header(), crud()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
addBoxParam: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
rows: [],
|
||||
tableRadio: null,
|
||||
tableData: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
open() {
|
||||
this.query.material_id = this.addBoxParam.material_id
|
||||
this.query.pcsn = this.addBoxParam.pcsn
|
||||
this.crud.toQuery()
|
||||
},
|
||||
clickChange(item) {
|
||||
this.tableRadio = item
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
submit() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.rows = this.$refs.multipleTable.selection
|
||||
this.$emit('tableChanged2', this.tableRadio)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -71,12 +71,13 @@
|
||||
style="width: 200px"
|
||||
size="mini"
|
||||
clearable
|
||||
@blur="vehicleCheck(form.vehicle_code)"
|
||||
placeholder="载具号"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="箱号:" prop="pageBox_code">
|
||||
<el-input v-model="form.pageBox_code" size="mini" style="width: 200px" disabled placeholder="箱号" >
|
||||
<el-input v-model="form.bucketunique" size="mini" style="width: 200px" disabled placeholder="箱号" >
|
||||
<el-button slot="append" icon="el-icon-plus" @click="queryBox" />
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
@@ -140,7 +141,7 @@
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="confirmvehicle()"
|
||||
@click="pushVehicle()"
|
||||
>
|
||||
装入托盘
|
||||
</el-button>
|
||||
@@ -211,6 +212,8 @@
|
||||
</el-card>
|
||||
|
||||
<StructDiv ref="child" :stor-id="storId" :dialog-show.sync="structShow" :sect-prop="sectProp" @tableChanged="tableChanged" />
|
||||
<AddBox ref="child" :dialog-show.sync="addBoxShow" :add-box-param="boxParam" @tableChanged2="tableChanged2" />
|
||||
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
@@ -220,10 +223,11 @@ import StructDiv from '@/views/wms/pub/StructDialog'
|
||||
import crudProductIn from '@/views/wms/storage_manage/product/productIn/productin'
|
||||
import crudPoint from '@/api/wms/sch/point'
|
||||
import crudRegion from '@/api/wms/sch/region'
|
||||
import AddBox from '@/views/wms/storage_manage/product/productIn/AddBox'
|
||||
|
||||
export default {
|
||||
name: 'DivDialog',
|
||||
components: { StructDiv },
|
||||
components: { StructDiv, AddBox },
|
||||
mixins: [crud()],
|
||||
dicts: ['IO_BILL_STATUS', 'MD_OVERSTRUCT_TYPE'],
|
||||
props: {
|
||||
@@ -231,19 +235,12 @@ export default {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
bussConfig: {
|
||||
type: Object
|
||||
},
|
||||
openParam: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return []
|
||||
}
|
||||
},
|
||||
billType: {
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
storId: {
|
||||
type: String,
|
||||
default: null
|
||||
@@ -255,13 +252,13 @@ export default {
|
||||
stor_id: '',
|
||||
sect_id: '',
|
||||
sectProp: null,
|
||||
bucketProp: {},
|
||||
structShow: false,
|
||||
bucketObj: null,
|
||||
divBtn: false,
|
||||
bucketShow: false,
|
||||
addBoxShow: false,
|
||||
bucketuniqueObj: null,
|
||||
sects: [],
|
||||
sect_val: null,
|
||||
dis_row: null,
|
||||
form: {
|
||||
dtl_row: null,
|
||||
@@ -270,13 +267,14 @@ export default {
|
||||
stor_id: '',
|
||||
point_code: null,
|
||||
vehicle_code: "",
|
||||
pageBox_code: "",
|
||||
bucketunique: "",
|
||||
checked: true,
|
||||
tableMater: []
|
||||
},
|
||||
storlist: [],
|
||||
pointlist: [],
|
||||
rules: {}
|
||||
rules: {},
|
||||
boxParam: {}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -302,6 +300,7 @@ export default {
|
||||
close() {
|
||||
this.form.tableMater = []
|
||||
this.form.dtl_row = null
|
||||
this.form.bucketunique = null
|
||||
this.sectProp = null
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('AddChanged')
|
||||
@@ -317,21 +316,70 @@ export default {
|
||||
clcikRowDis(row, column, event) {
|
||||
this.dis_row = row
|
||||
},
|
||||
vehicleCheck() {
|
||||
if (!this.form.dtl_row) {
|
||||
this.crud.notify('请选择一条入库明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
this.form.storagevehicle_code = ''
|
||||
vehicleCheck(vehicle_code) {
|
||||
this.form.bucketunique = ''
|
||||
// 校验载具号是否存在&&是否已被组盘
|
||||
crudProductIn.vehicleCheck({ 'storagevehicle_code': vehicle_code }).then(res => {
|
||||
this.crud.notify('查询成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {
|
||||
this.form.vehicle_code = ''
|
||||
})
|
||||
},
|
||||
queryBox() {
|
||||
// 校验载具是否为空
|
||||
if (!this.form.vehicle_code) {
|
||||
this.crud.notify('请先填写载具号!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
crudProductIn.checkVehicle({
|
||||
'storagevehicle_code': this.form.storagevehicle_code,
|
||||
'dis_num': this.form.tableMater.length,
|
||||
'iostorinv_id': this.form.dtl_row.iostorinv_id
|
||||
}).then(res => {
|
||||
if (!this.form.dtl_row) {
|
||||
this.crud.notify('请选择一条明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
this.boxParam = {
|
||||
'material_id': this.form.dtl_row.material_id,
|
||||
'pcsn': this.form.dtl_row.pcsn
|
||||
}
|
||||
this.addBoxShow = true
|
||||
},
|
||||
pushVehicle() {
|
||||
// 校验载具是否为空
|
||||
if (!this.form.vehicle_code) {
|
||||
this.crud.notify('载具号不能为空!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
// 校验明细不能为空
|
||||
if (!this.form.dtl_row) {
|
||||
this.crud.notify('请选择一条明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
// 有箱号
|
||||
if (this.form.bucketunique) {
|
||||
let fla = true
|
||||
this.form.tableMater.forEach(item => {
|
||||
if (item.bucketunique === this.bucketuniqueObj.bucketunique) {
|
||||
fla = false
|
||||
}
|
||||
})
|
||||
|
||||
}).catch(err => {
|
||||
this.form.storagevehicle_code = ''
|
||||
})
|
||||
if (fla) {
|
||||
this.form.tableMater.splice(-1, 0, this.bucketuniqueObj)
|
||||
this.form.bucketunique = ''
|
||||
}
|
||||
} else {
|
||||
// 无箱号
|
||||
if (!this.form.storage_qty) {
|
||||
this.crud.notify('数量不能为0!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
const item = {
|
||||
'storagevehicle_code': this.form.vehicle_code,
|
||||
'material_id': this.form.dtl_row.material_id,
|
||||
'material_code': this.form.dtl_row.material_code,
|
||||
'material_name': this.form.dtl_row.material_name,
|
||||
'qty': this.form.storage_qty
|
||||
}
|
||||
this.form.tableMater.splice(-1, 0, item)
|
||||
}
|
||||
},
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
row.index = rowIndex
|
||||
@@ -384,23 +432,20 @@ export default {
|
||||
}
|
||||
},
|
||||
confirmvehicle() {
|
||||
if (this.dis_row === null) {
|
||||
this.crud.notify('请先选择一条分配明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
if (!this.form.dtl_row) {
|
||||
this.crud.notify('请选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
if (this.dis_row.overstruct_type === '') {
|
||||
this.crud.notify('载具超限不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
if (this.form.tableMater.length === 0) {
|
||||
this.crud.notify('请先装入托盘!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
crudProductIn.confirmvehicle(this.dis_row).then(res => {
|
||||
crudProductIn.getIODtl({ 'iostorinv_id': this.form.dtl_row.iostorinv_id }).then(res => {
|
||||
this.openParam = res
|
||||
})
|
||||
crudProductIn.getDisDtl(this.form.dtl_row).then(res => {
|
||||
this.form.tableMater = res
|
||||
this.crud.notify('组盘成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
crudProductIn.confirmvehicle(this.form).then(res => {
|
||||
this.crud.notify('组盘成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.form.vehicle_code = ''
|
||||
this.form.bucketunique = ''
|
||||
})
|
||||
|
||||
},
|
||||
sectQueryChange(val) {
|
||||
this.sectProp = val
|
||||
@@ -436,6 +481,12 @@ export default {
|
||||
this.form.tableMater = []
|
||||
})
|
||||
},
|
||||
tableChanged2(row) {
|
||||
this.form.bucketunique = row.bucketunique
|
||||
row.storagevehicle_code = this.form.vehicle_code
|
||||
row.qty = row.storage_qty
|
||||
this.bucketuniqueObj = row
|
||||
},
|
||||
divPoint() {
|
||||
if (!this.form.point_code) {
|
||||
this.crud.notify('请选择入库点', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
|
||||
@@ -40,10 +40,28 @@ export function getIosInvDis(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export function vehicleCheck(data) {
|
||||
return request({
|
||||
url: '/api/productIn/vehicleCheck',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function confirmvehicle(data) {
|
||||
return request({
|
||||
url: '/api/productIn/confirmvehicle',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default {
|
||||
add,
|
||||
edit,
|
||||
del,
|
||||
getIosInvDtl,
|
||||
getIosInvDis
|
||||
getIosInvDis,
|
||||
vehicleCheck,
|
||||
confirmvehicle
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user