add:需求单批量删除,库存查询支持按物料名称模糊查询

This commit is contained in:
zhaoyf
2026-08-29 10:08:19 +08:00
parent aa20f89480
commit 27722d91ed
5 changed files with 35 additions and 3 deletions

View File

@@ -97,7 +97,7 @@
<if test="param.material_code != null and param.material_code != ''">
AND
(mater.material_code LIKE #{param.material_code} or
mater.material_name LIKE #{param.material_code} )
mater.material_name LIKE concat('%', #{param.material_code}, '%') )
</if>
<if test="param.pcsn != null and param.pcsn != ''">

View File

@@ -69,6 +69,7 @@ public class PmDemand extends Model<PmDemand> {
private String inventory_dis;
private String lk_container;
private String max_load;
@Override
protected Serializable pkVal() {

View File

@@ -56,9 +56,11 @@ public class PmDemandParam {
@NotBlank(message = "目标库存地点不能为空")
private String targetHouseCode;
@NotBlank(message = "产线不能为空")
@NotBlank(message = "载具类型为空")
private String carrierType;
private String maxLoad;
private String sn;
}

View File

@@ -122,6 +122,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
demand.setSn(param.getSn());
demand.setIs_deleted(0);
demand.setCreate_at(DateUtil.now());
demand.setMax_load(param.getMaxLoad());
this.save(demand);
}
@@ -159,6 +160,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
demand.setTarget_area(pmDemandParam.getTargetArea());
demand.setProduction_line(pmDemandParam.getProductionLine());
demand.setSn(pmDemandParam.getSn());
demand.setMax_load(pmDemandParam.getMaxLoad());
this.updateById(demand);
}else{
this.create(pmDemandParam);

View File

@@ -21,6 +21,7 @@
</el-form>
</div>
<crudOperation :permission="permission">
<el-button slot="right" v-permission="permission.del" class="filter-item" type="danger" icon="el-icon-delete" size="mini" :loading="batchDeleting" :disabled="!multipleSelection.length || batchDeleting" @click="handleBatchDelete">批量删除</el-button>
<el-button slot="right" v-has-user="['admin']" class="filter-item" type="warning" icon="el-icon-s-promotion" size="mini" :disabled="audit_flag" @click="issueReturnBill">强制回传EAS</el-button>
<el-button slot="right" class="filter-item" type="success" icon="el-icon-s-promotion" size="mini" :disabled="isPushDisabled()" @click="handleBatchPush">下推出库</el-button>
<el-button slot="right" class="filter-item" type="warning" icon="el-icon-house" size="mini" :disabled="isBatchAllocateDisabled()" @click="openBatchAllocateDialog">批量分配</el-button>
@@ -132,7 +133,7 @@
</template>
<script>
import crudDemand, { queryInventory, allocate, batchAllocate, push, batchAllcation } from './demand'
import crudDemand, { del, queryInventory, allocate, batchAllocate, push, batchAllcation } from './demand'
import CRUD, { crud, form, header, presenter } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation.vue'
import udOperation from '@crud/UD.operation.vue'
@@ -175,6 +176,7 @@ export default {
{ code: '6.002', name: '中鼎立库' }
],
audit_flag: true,
batchDeleting: false,
allocateVisible: false,
inventoryLoading: false,
allocateSaving: false,
@@ -249,6 +251,31 @@ export default {
})
}).catch(() => {})
},
handleBatchDelete() {
const ids = this.multipleSelection.map(item => item.id)
if (!ids.length) {
this.$message.warning('请至少选择一条需求单')
return
}
this.$confirm(`确认删除已选择的 ${ids.length} 条需求单吗?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async() => {
this.batchDeleting = true
try {
for (const id of ids) {
await del([id])
}
this.$message.success('批量删除成功')
} catch (error) {
this.$message.error('批量删除失败,已删除的记录不会恢复')
} finally {
this.batchDeleting = false
this.crud.toQuery()
}
}).catch(() => {})
},
openAllocateDialog(row) {
this.currentDemand = { ...row }
this.inventoryList = []