rev:入库新增全部分配按钮、发送飞书BUG修改、废箔下卷变更为点位+废箔

This commit is contained in:
2023-08-25 15:44:14 +08:00
parent 129c101c65
commit bb6fc64d15
10 changed files with 142 additions and 233 deletions

View File

@@ -14,7 +14,18 @@
<span class="el-dialog__title2">入库分配</span>
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left"/>
<slot name="left">
<el-button
:loading="allDivBtn"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="allDivStruct()"
>
全部分配
</el-button>
</slot>
<el-button slot="left" type="info" @click="dialogVisible = false">关闭</el-button>
</span>
</div>
@@ -51,49 +62,25 @@
</el-select>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="box_no" width="250" label="木箱号" align="center"/>
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" align="center"/>
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center"/>
<el-table-column show-overflow-tooltip prop="pcsn" label="子卷号" align="center"/>
<el-table-column show-overflow-tooltip prop="sap_pcsn" label="SAP批次" align="center"/>
<el-table-column show-overflow-tooltip prop="plan_qty" :formatter="crud.formatNum3" label="重量" align="center"/>
<!-- <el-table-column show-overflow-tooltip prop="assign_qty" :formatter="crud.formatNum3" label="已分配数量"
align="center"/>
<el-table-column show-overflow-tooltip prop="unassign_qty" :formatter="crud.formatNum3" label="未分配数量"
align="center"/>-->
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="单位" align="center"/>
<el-table-column show-overflow-tooltip prop="source_bill_type_name" label="源单类型" align="center"/>
<el-table-column show-overflow-tooltip prop="source_bill_code" label="源单编号" align="center"/>
<el-table-column show-overflow-tooltip prop="box_no" width="250" label="木箱号" align="center" />
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
<el-table-column show-overflow-tooltip prop="pcsn" label="子卷号" align="center" />
<el-table-column show-overflow-tooltip prop="sap_pcsn" label="SAP批次" align="center" />
<el-table-column
show-overflow-tooltip
prop="plan_qty"
:formatter="crud.formatNum3"
label="重量"
align="center"
/>
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="单位" align="center" />
<el-table-column show-overflow-tooltip prop="source_bill_type_name" label="源单类型" align="center" />
<el-table-column show-overflow-tooltip prop="source_bill_code" label="源单编号" align="center" />
</el-table>
</el-card>
<el-card class="box-card" shadow="never" :body-style="{padding:'20px 20px 0 20px'}">
<el-form ref="form2" :inline="true" :model="form" :rules="rules" size="mini">
<!--<el-form-item label="载具号" prop="storagevehicle_code">
<el-input v-model="form.storagevehicle_code" placeholder="载具号" style="width: 200px" @blur="vehicleCheck"/>
</el-form-item>
<el-form-item label="桶号" prop="bucketunique">
<el-input
v-model="form.bucketunique"
placeholder="桶号"
disabled
class="input-with-select"
style="width: 200px"
>
<el-button slot="append" icon="el-icon-search" @click="dialogBucket"/>
</el-input>
</el-form-item>
<el-form-item label="放入重量" prop="storage_qty">
<el-input-number
v-model="form.storage_qty"
style="width: 200px"
disabled
placeholder="放入重量"
controls-position="right"
:controls="false"
:min="0"
:precision="3"
/>
</el-form-item>-->
<el-form-item label="入库点" prop="point_code">
<el-select
v-model="form.point_code"
@@ -132,29 +119,8 @@
</div>
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left"/>
<!--<el-button
slot="left"
class="filter-item"
type="warning"
icon="el-icon-check"
size="mini"
@click="insertvehicle()"
>
装入托盘
</el-button>
<slot name="left" />
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="confirmvehicle()"
>
组盘确认
</el-button>-->
<el-button
slot="left"
:loading="divBtn"
class="filter-item"
type="primary"
@@ -165,7 +131,6 @@
分配货位
</el-button>
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
@@ -175,7 +140,6 @@
取消分配
</el-button>
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-delete"
@@ -196,15 +160,21 @@
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
>
<el-table-column show-overflow-tooltip type="index" label="序号" align="center"/>
<el-table-column show-overflow-tooltip prop="box_no" width="250" label="木箱号" align="center"/>
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" align="center"/>
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center"/>
<el-table-column show-overflow-tooltip prop="pcsn" label="子卷号" align="center"/>
<el-table-column show-overflow-tooltip prop="sap_pcsn" label="SAP批次" align="center"/>
<el-table-column show-overflow-tooltip prop="plan_qty" :formatter="crud.formatNum3" label="重量" align="center"/>
<el-table-column show-overflow-tooltip prop="point_code" label="入库点" align="center"/>
<el-table-column show-overflow-tooltip prop="struct_code" label="货位" align="center"/>
<el-table-column show-overflow-tooltip type="index" label="序号" align="center" />
<el-table-column show-overflow-tooltip prop="box_no" width="250" label="木箱号" align="center" />
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
<el-table-column show-overflow-tooltip prop="pcsn" label="子卷号" align="center" />
<el-table-column show-overflow-tooltip prop="sap_pcsn" label="SAP批次" align="center" />
<el-table-column
show-overflow-tooltip
prop="plan_qty"
:formatter="crud.formatNum3"
label="重量"
align="center"
/>
<el-table-column show-overflow-tooltip prop="point_code" label="入库点" align="center" />
<el-table-column show-overflow-tooltip prop="struct_code" label="货位" align="center" />
<!--<el-table-column align="center" label="操作" width="190" fixed="right">
<template slot-scope="scope">
<el-popover v-model="scope.row.pop" placement="top" width="180" trigger="manual">
@@ -220,8 +190,13 @@
</el-table>
</el-card>
<StructDiv ref="child" :stor-id="storId" :dialog-show.sync="structShow" :sect-prop="sectProp"
@tableChanged="tableChanged"/>
<StructDiv
ref="child"
:stor-id="storId"
:dialog-show.sync="structShow"
:sect-prop="sectProp"
@tableChanged="tableChanged"
/>
</el-dialog>
</template>
@@ -230,7 +205,7 @@
import CRUD, { crud } from '@crud/crud'
import crudSectattr from '@/views/wms/basedata/st/sect/sectattr'
import StructDiv from '@/views/wms/pub/StructDialog'
import crudRawAssist from '@/views/wms/st/inbill/rawassist'
import crudRawAssist, { allDivStruct } from '@/views/wms/st/inbill/rawassist'
import crudPoint from '@/views/wms/sch/point/point'
import crudUserStor, { getSect } from '@/views/wms/basedata/st/userStor/userStor'
@@ -272,15 +247,14 @@ export default {
structShow: false,
bucketObj: null,
divBtn: false,
allDivBtn: false,
bucketShow: false,
sects: [],
sect_val: null,
form: {
dtl_row: null,
bucketunique: '',
storage_qty: '',
point_code: null,
storagevehicle_code: '',
checked: true,
tableMater: []
},
@@ -330,98 +304,9 @@ export default {
this.form.tableMater = res
})
},
vehicleCheck() {
if (!this.form.dtl_row) {
this.crud.notify('请选择一条入库明细', CRUD.NOTIFICATION_TYPE.INFO)
this.form.storagevehicle_code = ''
return
}
crudRawAssist.checkVehicle({
'storagevehicle_code': this.form.storagevehicle_code,
'dis_num': this.form.tableMater.length,
'iostorinv_id': this.form.dtl_row.iostorinv_id
}).then(res => {
}).catch(err => {
this.form.storagevehicle_code = ''
})
},
tableRowClassName({ row, rowIndex }) {
row.index = rowIndex
},
insertvehicle() {
if (!this.form.dtl_row) {
this.crud.notify('请选择一条入库明细', CRUD.NOTIFICATION_TYPE.INFO)
return
}
if (!this.form.storagevehicle_code) {
this.crud.notify('请输入托盘号', CRUD.NOTIFICATION_TYPE.INFO)
return
}
// 判断是否选择了桶号
if (this.bucketObj) {
if (!(this.bucketObj.status === '01')) {
this.crud.notify('请校验桶状态!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
const dis_dtl = JSON.parse(JSON.stringify(this.bucketObj))
// 判断选择的桶是否已经被选过
const flag = this.form.tableMater.some(mater => mater.bucketunique === dis_dtl.bucketunique)
if (!flag) {
const flag = this.form.tableMater.some(mater => mater.storagevehicle_code !== this.form.storagevehicle_code)
if (flag) {
this.crud.notify('存在不同载具号', CRUD.NOTIFICATION_TYPE.INFO)
return
}
dis_dtl.storagevehicle_code = this.form.storagevehicle_code
dis_dtl.pop = false
this.form.tableMater.splice(this.form.tableMater.length, 0, dis_dtl)
if (this.form.dtl_row.assign_qty) {
this.form.dtl_row.assign_qty = parseFloat(this.form.dtl_row.assign_qty) + parseFloat(this.form.storage_qty)
} else {
this.form.dtl_row.assign_qty = parseFloat(this.form.storage_qty)
}
if (parseFloat(this.form.dtl_row.unassign_qty) - parseFloat(this.form.storage_qty) > 0) {
this.form.dtl_row.unassign_qty = parseFloat(this.form.dtl_row.unassign_qty) - parseFloat(this.form.storage_qty)
} else {
this.form.dtl_row.unassign_qty = 0
}
this.openParam.splice(this.form.dtl_row.index, 1, this.form.dtl_row)
}
if (flag) {
this.crud.notify('该桶已被加入明细中', CRUD.NOTIFICATION_TYPE.INFO)
}
} else {
this.crud.notify('请选择桶号', CRUD.NOTIFICATION_TYPE.INFO)
return
}
},
confirmvehicle() {
if (this.form.tableMater.length <= 0) {
this.crud.notify('至少添加一条载具明细', CRUD.NOTIFICATION_TYPE.INFO)
return
}
const carrier_no = this.form.tableMater[0].storagevehicle_code
const flag = this.form.tableMater.every(mater => mater.storagevehicle_code === carrier_no)
if (!flag) {
this.crud.notify('请选择唯一载具进行组盘!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
const flag2 = this.form.tableMater.some(mater => mater.point_code !== this.form.point_code && mater.point_code)
if (flag2) {
this.crud.notify('请选择相同入库点!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
crudRawAssist.confirmvehicle(this.form).then(res => {
crudRawAssist.getIODtl({ 'bill_code': this.form.dtl_row.bill_code }).then(res => {
this.openParam = res
})
crudRawAssist.getDisDtl(this.form.dtl_row).then(res => {
this.form.tableMater = res
this.crud.notify('组盘成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
})
})
},
deleteRow(index, rows) {
// 如果桶状态不是生成调后台逻辑
if (rows[index].status !== '01') {
@@ -476,12 +361,6 @@ export default {
this.form.tableMater = []
})
},
bucketChange(row) {
debugger
this.bucketObj = row
this.form.bucketunique = row.bucketunique
this.form.storage_qty = row.storage_qty
},
divPoint() {
if (!this.form.point_code) {
this.crud.notify('请选择入库点', CRUD.NOTIFICATION_TYPE.INFO)
@@ -502,6 +381,23 @@ export default {
})
})
},
allDivStruct() {
if (!this.sect_id) {
this.crud.notify('请先选择虚拟库区区域!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
this.allDivBtn = true
const data = {}
data.sect_id = this.sect_id
data.iostorinv_id = this.openParam[0].iostorinv_id
crudRawAssist.allDivStruct(data).then(res => {
crudRawAssist.getIODtl({ 'bill_code': this.openParam[0].bill_code, 'open_flag': '1' }).then(res => {
this.openParam = res
})
}).finally(() => {
this.allDivBtn = false
})
},
divStruct() {
if (this.form.tableMater.length === 0) {
this.crud.notify('请先选择一条明细!', CRUD.NOTIFICATION_TYPE.INFO)
@@ -516,7 +412,6 @@ export default {
this.divBtn = true
this.form.sect_id = this.sect_id
this.form.stor_id = this.stor_id
this.form.is_pc = '1'
crudRawAssist.divStruct(this.form).then(res => {
crudRawAssist.getIODtl({ 'bill_code': this.form.dtl_row.bill_code, 'open_flag': '1' }).then(res => {
this.openParam = res
@@ -557,37 +452,6 @@ export default {
this.crud.notify('取消分配成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
})
})
},
dialogBucket() {
if (!this.form.dtl_row) {
this.crud.notify('请选择一条入库明细', CRUD.NOTIFICATION_TYPE.INFO)
return
}
/* const material_dtl_scode = this.form.dtl_row.material_dtl_scode
let type = ''
if (material_dtl_scode.slice(0, 4) === '0903') {
type = '01'
}
if (material_dtl_scode.slice(0, 4) === '0904') {
type = '02'
}
if (material_dtl_scode.slice(0, 6) === '090202') {
type = '04'
}
if (material_dtl_scode.slice(0, 6) === '090201') {
type = '03'
}*/
const bucket = {
'material_code': this.form.dtl_row.material_code,
'pcsn': this.form.dtl_row.pcsn,
'quality_scode': this.form.dtl_row.quality_scode,
'ivt_level': this.form.dtl_row.ivt_level,
'is_active': this.form.dtl_row.is_active,
// 'storagevehicle_type': type,
'bucket_status': '01'
}
this.bucketProp = bucket
this.bucketShow = true
}
}
}

View File

@@ -251,7 +251,6 @@ import DivDialog from '@/views/wms/st/inbill/DivDialog'
import ViewDialog from '@/views/wms/st/inbill/ViewDialog'
import TaskDialog from '@/views/wms/st/inbill/TaskDialog'
import { mapGetters } from 'vuex'
import crudStorattr from '@/views/wms/basedata/st/stor/storattr'
import crudUserStor from '@/views/wms/basedata/st/userStor/userStor'
export default {
@@ -268,7 +267,7 @@ export default {
},
mixins: [presenter(), header(), crud()],
// 数据字典
dicts: ['io_bill_status', 'ST_CREATE_MODE','ST_INV_IN_TYPE'],
dicts: ['io_bill_status', 'ST_CREATE_MODE', 'ST_INV_IN_TYPE'],
data() {
return {
height: document.documentElement.clientHeight - 180 + 'px;',

View File

@@ -24,14 +24,6 @@ export function edit(data) {
})
}
export function getType(params) {
return request({
url: '/api/in/rawAssist/getType',
method: 'get',
params
})
}
export function getBillDtl(params) {
return request({
url: '/api/in/rawAssist/getBillDtl',
@@ -72,14 +64,6 @@ export function checkVehicle(data) {
})
}
export function confirmvehicle(data) {
return request({
url: '/api/in/rawAssist/confirmvehicle',
method: 'post',
data
})
}
export function deleteDisDtl(data) {
return request({
url: '/api/in/rawAssist/deleteDisDtl',
@@ -104,6 +88,14 @@ export function divStruct(data) {
})
}
export function allDivStruct(data) {
return request({
url: '/api/in/rawAssist/allDivStruct',
method: 'post',
data
})
}
export function unDivStruct(data) {
return request({
url: '/api/in/rawAssist/unDivStruct',
@@ -208,6 +200,6 @@ export function queryBoxMater(data) {
})
}
export default { add, edit, del, getType, getBillDtl, insertDtl, getIODtl, commit, checkVehicle,
confirmvehicle, deleteDisDtl, getDisDtl, divStruct, unDivStruct, divPoint, delDis, queryBoxMater,
export default { add, edit, del, insertDtl, getIODtl, commit, checkVehicle,
deleteDisDtl, getDisDtl, divStruct, allDivStruct, unDivStruct, divPoint, delDis, queryBoxMater,
queryTask, bucketDtl, updateTask, delTask, reIssueTask, confirmTask, cancelTask, confirm, backConfirm }