rev: 成品入库修改

This commit is contained in:
2023-06-16 08:49:44 +08:00
parent caa6ce91b2
commit 20ab356de0
11 changed files with 378 additions and 222 deletions

View File

@@ -146,6 +146,7 @@
<span v-show="scope.row.edit">{{ scope.row.material_code }}</span>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="material_spec" label="物料规格" />
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" />
<el-table-column show-overflow-tooltip prop="plan_qty" label="入库数量">
<template slot-scope="scope">
@@ -168,8 +169,33 @@
<el-input v-model="form.tableData[scope.$index].remark" size="small" />
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="source_bill_type" label="源单类型" />
<el-table-column show-overflow-tooltip prop="source_bill_code" label="源单号" />
<el-table-column show-overflow-tooltip prop="base_bill_type" label="源单类型" />
<el-table-column show-overflow-tooltip prop="base_bill_code" label="源单号">
<template slot-scope="scope">
<el-input
v-show="!scope.row.edit"
v-model="form.tableData[scope.$index].base_bill_code"
clearable
:controls="false"
controls-position="right"
size="small"
/>
<span v-show="scope.row.edit">{{ scope.row.base_bill_code }}</span>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="base_bill_table" label="源单行号">
<template slot-scope="scope">
<el-input
v-show="!scope.row.edit"
v-model="form.tableData[scope.$index].base_bill_table"
clearable
:controls="false"
controls-position="right"
size="small"
/>
<span v-show="scope.row.edit">{{ scope.row.base_bill_table }}</span>
</template>
</el-table-column>
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="170" fixed="right">
<template scope="scope">
@@ -308,6 +334,14 @@ export default {
this.crud.notify('数量不能为空', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (!row.base_bill_code) {
this.crud.notify('销售单号不能为空!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (!row.base_bill_table) {
this.crud.notify('销售单号行不能为空!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
}
},
deleteRow(index, rows) {
@@ -329,6 +363,7 @@ export default {
this.nowrow.material_id = row.material_id
this.nowrow.material_code = row.material_code
this.nowrow.material_name = row.material_name
this.nowrow.material_spec = row.material_spec
this.nowrow.plan_qty = '0'
this.nowrow.qty_unit_name = row.unit_name
this.nowrow.qty_unit_id = row.base_unit_id
@@ -348,9 +383,10 @@ export default {
data.plan_qty = row.product_qty
data.qty_unit_name = row.qty_unit_name
data.qty_unit_id = row.qty_unit_id
data.source_billdtl_id = row.sale_id
data.source_bill_type = row.sale_type
data.source_bill_code = row.sale_code
data.base_billdtl_id = row.sale_id
data.base_bill_type = row.sale_type
data.base_bill_code = row.sale_code
data.base_bill_table = row.seq_no
data.edit = true
this.form.tableData.splice(-1, 0, data)
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(data.plan_qty)

View File

@@ -53,6 +53,7 @@
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
<el-table-column show-overflow-tooltip prop="material_spec" label="物料规格" align="center" />
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" 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" />
@@ -66,14 +67,9 @@
<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="vehicle_code">
<el-input
v-model="form.vehicle_code"
style="width: 200px"
size="mini"
clearable
placeholder="载具号"
@blur="vehicleCheck(form.vehicle_code)"
/>
<el-input v-model="form.vehicle_code" style="width: 200px" size="mini" disabled clearable placeholder="载具号">
<el-button slot="append" @click="vehicleCheck" >生成</el-button>
</el-input>
</el-form-item>
<el-form-item label="箱号:" prop="pageBox_code">
@@ -91,6 +87,7 @@
:controls="false"
precision="3"
:min="0"
@change="changeQty"
placeholder="数量"
/>
</el-form-item>
@@ -113,6 +110,23 @@
</el-select>
</el-form-item>
<el-form-item label="载具超限类型:" prop="vehicle_overstruct_type">
<el-select
v-model="form.vehicle_overstruct_type"
size="mini"
placeholder="请选择"
class="filter-item"
style="width: 200px;"
>
<el-option
v-for="item in dict.VEHICLE_OVER_TYPE"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-form>
</el-card>
<div class="crud-opts2">
@@ -123,6 +137,7 @@
<el-cascader
placeholder="请选择"
:options="sects"
v-model="defaultList"
:props="{ checkStrictly: true }"
clearable
@change="sectQueryChange"
@@ -212,6 +227,7 @@
>
<el-table-column show-overflow-tooltip type="index" label="序号" align="center" />
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
<el-table-column show-overflow-tooltip prop="material_spec" label="物料规格" align="center" />
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="托盘号" align="center" />
<el-table-column show-overflow-tooltip prop="bucketunique" label="箱号" align="center" />
@@ -252,7 +268,7 @@ export default {
name: 'DivDialog',
components: { StructDiv, AddBox },
mixins: [crud()],
dicts: ['IO_BILL_STATUS', 'MD_OVERSTRUCT_TYPE'],
dicts: ['IO_BILL_STATUS', 'VEHICLE_OVER_TYPE'],
props: {
dialogShow: {
type: Boolean,
@@ -272,8 +288,8 @@ export default {
data() {
return {
dialogVisible: false,
stor_id: '',
sect_id: '',
stor_id: '1528627995269533696',
sect_id: '1528631043496742912',
sectProp: null,
structShow: false,
bucketObj: null,
@@ -282,6 +298,7 @@ export default {
addBoxShow: false,
bucketuniqueObj: null,
sects: [],
defaultList: ['1528627995269533696', '1528631043496742912'],
dis_row: null,
form: {
dtl_row: null,
@@ -292,6 +309,7 @@ export default {
vehicle_code: '',
bucketunique: '',
checked: true,
vehicle_overstruct_type: '00',
tableMater: []
},
storlist: [],
@@ -309,7 +327,6 @@ export default {
},
methods: {
disabledIos(row) {
debugger
if (row.iostorinvdis_id === undefined) {
return false
} else {
@@ -340,22 +357,34 @@ export default {
},
clcikRow(row, column, event) {
this.form.dtl_row = row
this.form.storage_qty = this.form.dtl_row.plan_qty
crudProductIn.getIosInvDis({ 'iostorinv_id': row.iostorinv_id, 'iostorinvdtl_id': row.iostorinvdtl_id }).then(res => {
this.form.tableMater = res
debugger
if (res.length !== 0) {
this.form.tableMater = res
}
})
},
clcikRowDis(row, column, event) {
this.dis_row = row
},
vehicleCheck(vehicle_code) {
this.form.bucketunique = ''
// 校验载具号是否存在&&是否已被组盘
crudProductIn.vehicleCheck({ 'storagevehicle_code': vehicle_code }).then(res => {
this.crud.notify('查询成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
vehicleCheck() {
// 生成托盘
crudProductIn.vehicleCheck().then(res => {
this.form.tableMater = []
this.form.vehicle_code = res.vehicle_code
this.crud.notify('生成成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
}).catch(() => {
this.form.vehicle_code = ''
})
},
changeQty(val) {
debugger
if (parseFloat(this.form.dtl_row.plan_qty) < parseFloat(val)) {
this.crud.notify('放入数量不能大于明细数量!', CRUD.NOTIFICATION_TYPE.INFO)
this.$set(this.form, 'storage_qty', parseFloat(this.form.dtl_row.plan_qty))
}
},
queryBox() {
// 校验载具是否为空
if (!this.form.vehicle_code) {
@@ -393,6 +422,7 @@ export default {
})
if (fla) {
this.bucketuniqueObj.iostorinvdtl_id = this.form.dtl_row.iostorinvdtl_id
this.form.tableMater.splice(-1, 0, this.bucketuniqueObj)
this.form.bucketunique = ''
}
@@ -404,12 +434,24 @@ export default {
}
const item = {
'storagevehicle_code': this.form.vehicle_code,
'iostorinvdtl_id': this.form.dtl_row.iostorinvdtl_id,
'material_id': this.form.dtl_row.material_id,
'material_code': this.form.dtl_row.material_code,
'material_spec': this.form.dtl_row.material_spec,
'material_name': this.form.dtl_row.material_name,
'qty': this.form.storage_qty
}
this.form.tableMater.splice(-1, 0, item)
let fla2 = true
this.form.tableMater.forEach(res => {
if (res.iostorinvdtl_id === item.iostorinvdtl_id && res.storagevehicle_code === item.storagevehicle_code) {
fla2 = false
}
})
if (fla2) {
this.form.tableMater.splice(-1, 0, item)
}
}
},
deleteRow(index, rows) {
@@ -486,11 +528,11 @@ export default {
})
},
cancelConfirmvehicle() {
if (!this.form.dtl_row) {
this.crud.notify('请选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
if (!this.dis_row) {
this.crud.notify('请选择一条分配明细', CRUD.NOTIFICATION_TYPE.INFO)
return
}
crudProductIn.cancelConfirmvehicle(this.form.dtl_row).then(res => {
crudProductIn.cancelConfirmvehicle(this.dis_row).then(res => {
crudProductIn.getIosInvDtl({ 'iostorinv_id': this.form.dtl_row.iostorinv_id }).then(res => {
this.form.vehicle_code = ''
this.form.bucketunique = ''
@@ -579,6 +621,7 @@ export default {
return
}
this.dis_row.vehicle_overstruct_type = this.form.vehicle_overstruct_type
crudProductIn.unDivStruct(this.dis_row).then(res => {
crudProductIn.getIosInvDtl({ 'iostorinv_id': this.dis_row.iostorinv_id }).then(res => {
this.openParam = res

View File

@@ -40,11 +40,10 @@ export function getIosInvDis(data) {
})
}
export function vehicleCheck(data) {
export function vehicleCheck() {
return request({
url: '/api/productIn/vehicleCheck',
method: 'post',
data
method: 'post'
})
}