fix:去除校验

This commit is contained in:
2026-09-23 20:59:46 +08:00
parent 01802382d1
commit 18ca6e2e68
6 changed files with 67 additions and 28 deletions

View File

@@ -129,14 +129,14 @@ public class PmDemandPlatingServiceImpl extends ServiceImpl<PmDemandPlatingMappe
final List<String> orders = param.stream() final List<String> orders = param.stream()
.filter(item-> !Objects.equals(item.getStatus(), "1")) .filter(item-> !Objects.equals(item.getStatus(), "1"))
.map(PmDemandParam::getWorkOrder).collect(Collectors.toList()); .map(PmDemandParam::getWorkOrder).collect(Collectors.toList());
if (!orders.isEmpty()){ // if (!orders.isEmpty()){
final int count = this.count(new LambdaQueryWrapper<PmDemandPlating>() // final int count = this.count(new LambdaQueryWrapper<PmDemandPlating>()
.in(PmDemandPlating::getWork_order, orders) // .in(PmDemandPlating::getWork_order, orders)
.eq(PmDemandPlating::getIs_deleted,0)); // .eq(PmDemandPlating::getIs_deleted,0));
if (count>0){ // if (count>0){
throw new BadRequestException("MES推送需求单失败,需求单已存在"); // throw new BadRequestException("MES推送需求单失败,需求单已存在");
} // }
} // }
for (PmDemandParam pmDemandParam : param) { for (PmDemandParam pmDemandParam : param) {
if (StringUtils.isEmpty(pmDemandParam.getTargetHouseCode())){ if (StringUtils.isEmpty(pmDemandParam.getTargetHouseCode())){
throw new BadRequestException("目标库位为空!"); throw new BadRequestException("目标库位为空!");

View File

@@ -131,10 +131,10 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
public void batchCreate(List<PmDemandParam> param) { public void batchCreate(List<PmDemandParam> param) {
final List<String> orders = param.stream() final List<String> orders = param.stream()
.filter(item-> !Objects.equals(item.getStatus(), "1")) .filter(item-> !Objects.equals(item.getStatus(), "1"))
.map(PmDemandParam::getWorkOrder).collect(Collectors.toList()); .map(PmDemandParam::getOrderCode).collect(Collectors.toList());
if (!orders.isEmpty()){ if (!orders.isEmpty()){
final int count = this.count(new LambdaQueryWrapper<PmDemand>() final int count = this.count(new LambdaQueryWrapper<PmDemand>()
.in(PmDemand::getWork_order, orders) .in(PmDemand::getOrder_code, orders)
.eq(PmDemand::getIs_deleted,0)); .eq(PmDemand::getIs_deleted,0));
if (count>0){ if (count>0){
throw new BadRequestException("MES推送需求单失败,需求单已存在"); throw new BadRequestException("MES推送需求单失败,需求单已存在");

View File

@@ -8,6 +8,7 @@
"dev1": "vue-cli-service serve", "dev1": "vue-cli-service serve",
"dev": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve", "dev": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
"dev_mac": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve", "dev_mac": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
"builds": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
"build:prod": "vue-cli-service build", "build:prod": "vue-cli-service build",
"build:stage": "vue-cli-service build --mode staging", "build:stage": "vue-cli-service build --mode staging",
"preview": "node build/index.js --preview", "preview": "node build/index.js --preview",

View File

@@ -117,6 +117,7 @@
<el-form ref="form" :inline="true" :model="form" size="mini"> <el-form ref="form" :inline="true" :model="form" size="mini">
<el-form-item label="库区" prop="gender5"> <el-form-item label="库区" prop="gender5">
<el-cascader <el-cascader
v-model="sectProp"
placeholder="请选择" placeholder="请选择"
:options="sects" :options="sects"
:props="{ checkStrictly: true }" :props="{ checkStrictly: true }"
@@ -274,7 +275,8 @@ export default {
methods: { methods: {
open() { open() {
crudSectattr.getSectCode({ 'stor_code': this.storCode }).then(res => { crudSectattr.getSectCode({ 'stor_code': this.storCode }).then(res => {
this.sects = res.data this.sects = res.data || []
this.initDefaultSect()
}) })
const area_type = 'RKQ' const area_type = 'RKQ'
@@ -283,6 +285,22 @@ export default {
this.pointlist = res.data this.pointlist = res.data
}) })
}, },
// 默认选中第一个库区的第一行:父级选第一个仓库,子级选它的第一个库区
initDefaultSect() {
if (!Array.isArray(this.sects) || this.sects.length === 0) {
return
}
const firstStor = this.sects[0]
if (!firstStor) {
return
}
const firstSect = (firstStor.children && firstStor.children.length) ? firstStor.children[0] : null
// 有子级则选中父子两级,没有子级则只选中父级
const val = firstSect ? [firstStor.value, firstSect.value] : [firstStor.value]
this.sectProp = val
// 同步给查询参数,保证默认选中即生效
this.sectQueryChange(val)
},
toDelete(data) { toDelete(data) {
data.pop = true data.pop = true
}, },
@@ -336,17 +354,17 @@ export default {
}, },
sectQueryChange(val) { sectQueryChange(val) {
this.sectProp = val this.sectProp = val
if (val.length === 1) { // clearable 清空时 val 为 null,直接用 val.length 会抛错
this.stor_code = val[0] if (!val || val.length === 0) {
this.sect_code = ''
}
if (val.length === 0) {
this.sect_code = '' this.sect_code = ''
this.stor_code = '' this.stor_code = ''
return
} }
if (val.length === 2) {
this.stor_code = val[0] this.stor_code = val[0]
if (val.length === 2) {
this.sect_code = val[1] this.sect_code = val[1]
} else {
this.sect_code = ''
} }
}, },
tableChanged(row) { tableChanged(row) {

View File

@@ -1,7 +1,7 @@
<template> <template>
<el-dialog append-to-body :visible.sync="dialogVisible" destroy-on-close :show-close="false" fullscreen @close="close" @open="open"> <el-dialog append-to-body :visible.sync="dialogVisible" destroy-on-close :show-close="false" fullscreen @close="close" @open="open">
<span slot="title" class="dialog-footer"><div class="crud-opts2"><span class="el-dialog__title2">调拨分配</span><span class="crud-opts-right2"><el-button slot="left" type="info" @click="dialogVisible = false">关闭</el-button></span></div></span> <span slot="title" class="dialog-footer"><div class="crud-opts2"><span class="el-dialog__title2">调拨分配</span><span class="crud-opts-right2"><el-button slot="left" type="info" @click="dialogVisible = false">关闭</el-button></span></div></span>
<div class="crud-opts2"><span class="role-span">调拨明细</span><div class="crud-opts-form"><el-form ref="form" :inline="true" :model="form" size="mini"><el-form-item label="调出库区"><el-cascader placeholder="请选择" :options="sects" :props="{ checkStrictly: true }" clearable @change="sectQueryChange" /></el-form-item></el-form></div><span class="crud-opts-right2"><el-button class="filter-item" :loading="loadingAlldiv" type="primary" size="mini" @click="allDiv">全部分配</el-button><el-button class="filter-item" :loading="loadingAlldiv" type="primary" size="mini" @click="allCancel">全部取消</el-button><el-button class="filter-item" :loading="loadingAlldiv" type="primary" size="mini" :disabled="button1" @click="oneDiv">按行分配</el-button><el-button class="filter-item" type="primary" :loading="loadingAlldiv" size="mini" :disabled="button2" @click="oneCancel">按行取消</el-button><el-button class="filter-item" type="primary" size="mini" :loading="loadingAlldiv" :disabled="button3" @click="openStructIvt">手工分配</el-button><el-button class="filter-item" type="warning" :loading="loadingSetAllPoint" size="mini" @click="allSetPointAllDtl">一键下发</el-button></span></div> <div class="crud-opts2"><span class="role-span">调拨明细</span><div class="crud-opts-form"><el-form ref="form" :inline="true" :model="form" size="mini"><el-form-item label="调出库区"><el-cascader v-model="sourceSectValue" placeholder="请选择" :options="sects" :props="{ checkStrictly: true }" clearable @change="sectQueryChange" /></el-form-item></el-form></div><span class="crud-opts-right2"><el-button class="filter-item" :loading="loadingAlldiv" type="primary" size="mini" @click="allDiv">全部分配</el-button><el-button class="filter-item" :loading="loadingAlldiv" type="primary" size="mini" @click="allCancel">全部取消</el-button><el-button class="filter-item" :loading="loadingAlldiv" type="primary" size="mini" :disabled="button1" @click="oneDiv">按行分配</el-button><el-button class="filter-item" type="primary" :loading="loadingAlldiv" size="mini" :disabled="button2" @click="oneCancel">按行取消</el-button><el-button class="filter-item" type="primary" size="mini" :loading="loadingAlldiv" :disabled="button3" @click="openStructIvt">手工分配</el-button><el-button class="filter-item" type="warning" :loading="loadingSetAllPoint" size="mini" @click="allSetPointAllDtl">一键下发</el-button></span></div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}"><el-table ref="table" :data="tableDtl" style="width: 100%;" max-height="300" border :cell-style="cellStyle" :highlight-current-row="true" :header-cell-style="{background:'#f5f7fa',color:'#606266'}" @current-change="handleDtlCurrentChange"><el-table-column prop="bill_status" label="状态" align="center" width="110px" :formatter="bill_statusFormat" /><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" width="140px" /><el-table-column show-overflow-tooltip prop="plan_qty" label="调拨数量" :formatter="crud.formatNum3" align="center" /><el-table-column show-overflow-tooltip prop="assign_qty" label="已分配数量" :formatter="crud.formatNum3" align="center" /><el-table-column show-overflow-tooltip label="未分配数量" :formatter="unassignFormat" align="center" /></el-table></el-card> <el-card class="box-card" shadow="never" :body-style="{padding:'0'}"><el-table ref="table" :data="tableDtl" style="width: 100%;" max-height="300" border :cell-style="cellStyle" :highlight-current-row="true" :header-cell-style="{background:'#f5f7fa',color:'#606266'}" @current-change="handleDtlCurrentChange"><el-table-column prop="bill_status" label="状态" align="center" width="110px" :formatter="bill_statusFormat" /><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" width="140px" /><el-table-column show-overflow-tooltip prop="plan_qty" label="调拨数量" :formatter="crud.formatNum3" align="center" /><el-table-column show-overflow-tooltip prop="assign_qty" label="已分配数量" :formatter="crud.formatNum3" align="center" /><el-table-column show-overflow-tooltip label="未分配数量" :formatter="unassignFormat" align="center" /></el-table></el-card>
<div class="crud-opts2"><span class="role-span">分配明细</span></div> <div class="crud-opts2"><span class="role-span">分配明细</span></div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}"><el-table ref="table2" :data="tabledis" style="width: 100%;" max-height="400" size="mini" border :highlight-current-row="true" :header-cell-style="{background:'#f5f7fa',color:'#606266'}"><el-table-column type="index" label="序号" width="50" align="center" /><el-table-column prop="bill_status" label="状态" align="center" width="110px"><template slot-scope="scope"><el-select v-model="scope.row.bill_status" :disabled="true"><el-option v-for="item in dict.work_status" :key="item.value" :label="item.label" :value="item.value" /></el-select></template></el-table-column><el-table-column prop="material_code" label="物料编码" width="150px" /><el-table-column prop="material_name" label="物料名称" width="170px" /><el-table-column prop="storagevehicle_code" label="载具号" width="150px" /><el-table-column prop="pcsn" label="批次号" width="150px" /><el-table-column prop="plan_qty" label="调拨数量" :formatter="crud.formatNum3" align="center" width="120px" /><el-table-column prop="source_sect_code" width="120px" label="调出库区" align="center" /><el-table-column prop="source_struct_code" width="150px" label="调出仓位" align="center" /><el-table-column prop="target_sect_code" width="120px" label="调入库区" align="center" /><el-table-column prop="target_struct_code" width="150px" label="调入仓位" align="center" /><el-table-column prop="task_code" width="150px" label="任务号" align="center" /><el-table-column align="center" label="操作" width="120" fixed="right"><template slot-scope="scope"><el-button :disabled="tabledisabled(scope.row)" type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="deleteRow(scope.row)" /></template></el-table-column></el-table></el-card> <el-card class="box-card" shadow="never" :body-style="{padding:'0'}"><el-table ref="table2" :data="tabledis" style="width: 100%;" max-height="400" size="mini" border :highlight-current-row="true" :header-cell-style="{background:'#f5f7fa',color:'#606266'}"><el-table-column type="index" label="序号" width="50" align="center" /><el-table-column prop="bill_status" label="状态" align="center" width="110px"><template slot-scope="scope"><el-select v-model="scope.row.bill_status" :disabled="true"><el-option v-for="item in dict.work_status" :key="item.value" :label="item.label" :value="item.value" /></el-select></template></el-table-column><el-table-column prop="material_code" label="物料编码" width="150px" /><el-table-column prop="material_name" label="物料名称" width="170px" /><el-table-column prop="storagevehicle_code" label="载具号" width="150px" /><el-table-column prop="pcsn" label="批次号" width="150px" /><el-table-column prop="plan_qty" label="调拨数量" :formatter="crud.formatNum3" align="center" width="120px" /><el-table-column prop="source_sect_code" width="120px" label="调出库区" align="center" /><el-table-column prop="source_struct_code" width="150px" label="调出仓位" align="center" /><el-table-column prop="target_sect_code" width="120px" label="调入库区" align="center" /><el-table-column prop="target_struct_code" width="150px" label="调入仓位" align="center" /><el-table-column prop="task_code" width="150px" label="任务号" align="center" /><el-table-column align="center" label="操作" width="120" fixed="right"><template slot-scope="scope"><el-button :disabled="tabledisabled(scope.row)" type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="deleteRow(scope.row)" /></template></el-table-column></el-table></el-card>
@@ -22,15 +22,17 @@ export default {
mixins: [crud()], mixins: [crud()],
dicts: ['io_bill_status', 'work_status'], dicts: ['io_bill_status', 'work_status'],
props: { dialogShow: { type: Boolean, default: false }, rowmst: { type: Object }, openArray: { type: Array, default: () => [] } }, props: { dialogShow: { type: Boolean, default: false }, rowmst: { type: Object }, openArray: { type: Array, default: () => [] } },
data() { return { dialogVisible: false, loadingAlldiv: false, loadingSetAllPoint: false, structshow: false, button1: true, button2: true, button3: true, tableDtl: [], openParam: [], mstrow: {}, openRow: {}, tabledis: [], currentRow: {}, form: { }, sects: [], sourceStorCode: null } }, data() { return { dialogVisible: false, loadingAlldiv: false, loadingSetAllPoint: false, structshow: false, button1: true, button2: true, button3: true, tableDtl: [], openParam: [], mstrow: {}, openRow: {}, tabledis: [], currentRow: {}, form: { }, sects: [], sourceStorCode: null, sourceSectValue: null } },
watch: { dialogShow: { handler(newValue) { this.dialogVisible = newValue } }, openArray: { handler(newValue) { this.tableDtl = newValue } }, rowmst: { handler(newValue) { this.mstrow = { ...newValue } } } }, watch: { dialogShow: { handler(newValue) { this.dialogVisible = newValue } }, openArray: { handler(newValue) { this.tableDtl = newValue } }, rowmst: { handler(newValue) { this.mstrow = { ...newValue } } } },
methods: { methods: {
open() { crudBsrealstorattr.getStor().then(res => { const stor = res.data.find(item => item.stor_code === this.mstrow.source_stor_code); this.sourceStorCode = stor ? stor.stor_code : null; if (this.sourceStorCode) { crudSectattr.getSectCode({ stor_code: this.sourceStorCode }).then(resp => { this.sects = resp.data }) } }) }, open() { crudBsrealstorattr.getStor().then(res => { const stor = res.data.find(item => item.stor_code === this.mstrow.source_stor_code); this.sourceStorCode = stor ? stor.stor_code : null; if (this.sourceStorCode) { crudSectattr.getSectCode({ stor_code: this.sourceStorCode }).then(resp => { this.sects = resp.data || []; this.initDefaultSect() }) } }) },
// 默认选中第一个库区的第一行:父级选第一个仓库,子级选它的第一个库区
initDefaultSect() { if (!Array.isArray(this.sects) || this.sects.length === 0) { return } const firstStor = this.sects[0]; if (!firstStor) { return } const firstSect = (firstStor.children && firstStor.children.length) ? firstStor.children[0] : null; const val = firstSect ? [firstStor.value, firstSect.value] : [firstStor.value]; this.sourceSectValue = val; this.sectQueryChange(val) },
close() { this.tabledis = []; this.$emit('DivChanged'); this.$emit('update:dialogShow', false) }, close() { this.tabledis = []; this.$emit('DivChanged'); this.$emit('update:dialogShow', false) },
bill_statusFormat(row) { return this.dict.label.io_bill_status[row.bill_status] }, bill_statusFormat(row) { return this.dict.label.io_bill_status[row.bill_status] },
unassignFormat(row) { return (parseFloat(row.plan_qty || 0) - parseFloat(row.assign_qty || 0)).toFixed(3) }, unassignFormat(row) { return (parseFloat(row.plan_qty || 0) - parseFloat(row.assign_qty || 0)).toFixed(3) },
openStructIvt() { this.loadingAlldiv = true; const query = { ...this.currentRow, source_sect_code: this.mstrow.source_sect_code, target_sect_code: this.mstrow.target_sect_code }; invtransfer.getStructIvt(query).then(res => { this.openParam = res.data; this.structshow = true; this.openRow = query; this.loadingAlldiv = false }).catch(() => { this.loadingAlldiv = false }) }, openStructIvt() { this.loadingAlldiv = true; const query = { ...this.currentRow, source_sect_code: this.mstrow.source_sect_code, target_sect_code: this.mstrow.target_sect_code }; invtransfer.getStructIvt(query).then(res => { this.openParam = res.data; this.structshow = true; this.openRow = query; this.loadingAlldiv = false }).catch(() => { this.loadingAlldiv = false }) },
sectQueryChange(val) { this.mstrow.source_sect_code = val.length ? val[val.length - 1] : '' }, sectQueryChange(val) { this.sourceSectValue = val; this.mstrow.source_sect_code = (val && val.length) ? val[val.length - 1] : '' },
tabledisabled(row) { return !((row.bill_status === '00' || row.bill_status === '01') && row.is_issued === '0') }, tabledisabled(row) { return !((row.bill_status === '00' || row.bill_status === '01') && row.is_issued === '0') },
deleteRow(row) { invtransfer.autoCancel({ transfer_id: row.transfer_id, itransferdtl_id: row.itransferdtl_id }).then(() => { this.queryTableDtl() }) }, deleteRow(row) { invtransfer.autoCancel({ transfer_id: row.transfer_id, itransferdtl_id: row.itransferdtl_id }).then(() => { this.queryTableDtl() }) },
handleDtlCurrentChange(current) { if (current !== null) { this.currentRow = current; if (current.bill_status === '10') { this.button1 = false; this.button2 = true; this.button3 = false } else if (current.bill_status === '30' || current.bill_status === '40') { this.button1 = true; this.button2 = false; this.button3 = true } this.queryTableDdis(current.itransferdtl_id) } else { this.button1 = true; this.button2 = true; this.button3 = true; this.currentRow = {}; this.tabledis = [] } }, handleDtlCurrentChange(current) { if (current !== null) { this.currentRow = current; if (current.bill_status === '10') { this.button1 = false; this.button2 = true; this.button3 = false } else if (current.bill_status === '30' || current.bill_status === '40') { this.button1 = true; this.button2 = false; this.button3 = true } this.queryTableDdis(current.itransferdtl_id) } else { this.button1 = true; this.button2 = true; this.button3 = true; this.currentRow = {}; this.tabledis = [] } },

View File

@@ -25,6 +25,7 @@
<el-form ref="form" :inline="true" :model="form" size="mini"> <el-form ref="form" :inline="true" :model="form" size="mini">
<el-form-item label="库区" prop="gender2"> <el-form-item label="库区" prop="gender2">
<el-cascader <el-cascader
v-model="form.gender2"
placeholder="请选择" placeholder="请选择"
:options="sects" :options="sects"
:props="{ checkStrictly: true }" :props="{ checkStrictly: true }"
@@ -320,13 +321,30 @@ export default {
methods: { methods: {
open() { open() {
crudSectattr.getSectCode({ 'stor_code': this.storCode }).then(res => { crudSectattr.getSectCode({ 'stor_code': this.storCode }).then(res => {
this.sects = res.data this.sects = res.data || []
this.initDefaultSect()
}) })
crudPoint.getRegionPoints({ 'regionCode': 'CKQ' }).then(res => { crudPoint.getRegionPoints({ 'regionCode': 'CKQ' }).then(res => {
this.outBoundRegion = res.data this.outBoundRegion = res.data
this.outBoundPoint = res.data this.outBoundPoint = res.data
}) })
}, },
// 默认选中第一个库区的第一行:父级选第一个仓库,子级选它的第一个库区
initDefaultSect() {
if (!Array.isArray(this.sects) || this.sects.length === 0) {
return
}
const firstStor = this.sects[0]
if (!firstStor) {
return
}
const firstSect = (firstStor.children && firstStor.children.length) ? firstStor.children[0] : null
// 有子级则选中父子两级,没有子级则只选中父级
const val = firstSect ? [firstStor.value, firstSect.value] : [firstStor.value]
this.form.gender2 = val
// 同步给查询参数,保证默认选中即生效
this.sectQueryChange(val)
},
close() { close() {
this.$refs['form2'].resetFields() this.$refs['form2'].resetFields()
this.tabledis = [] this.tabledis = []
@@ -354,17 +372,17 @@ export default {
}) })
}, },
sectQueryChange(val) { sectQueryChange(val) {
if (val.length === 1) { // clearable 清空时 val 为 null,直接用 val.length 会抛错
this.mstrow.stor_code = val[0] if (!val || val.length === 0) {
this.mstrow.sect_code = ''
}
if (val.length === 0) {
this.mstrow.sect_code = '' this.mstrow.sect_code = ''
this.mstrow.stor_code = '' this.mstrow.stor_code = ''
return
} }
if (val.length === 2) {
this.mstrow.stor_code = val[0] this.mstrow.stor_code = val[0]
if (val.length === 2) {
this.mstrow.sect_code = val[1] this.mstrow.sect_code = val[1]
} else {
this.mstrow.sect_code = ''
} }
}, },
outBoundChange(val) { outBoundChange(val) {