出库录入单价以及生产任务单批量录入

This commit is contained in:
z 2025-02-28 14:10:17 +08:00
parent 2128d2572f
commit 848ab26f20
8 changed files with 60 additions and 17 deletions

View File

@ -146,4 +146,6 @@ public class ProcessBomDetailDO extends BaseDO {
private String sortAttr;
@TableField(exist = false)
private String matType;
@TableField(exist = false)
private BigDecimal price;
}

View File

@ -48,9 +48,10 @@ public interface ProcessBomDetailMapper extends BaseMapperX<ProcessBomDetailDO>
// .eq(ProcessBomDetailDO::getBomId,bomId);
// return selectJoinList(ProcessBomDetailDO.class, query);
// }
@Select("SELECT p.*, IFNULL(SUM(s.storage_ok_qty), 0) AS storage_ok_qty " +
@Select("SELECT p.*, IFNULL(SUM(s.storage_ok_qty), 0) AS storage_ok_qty,COALESCE(m.price, 0) as price " +
"FROM pro_process_bom_detail p " +
"LEFT JOIN v_storage_material_now s ON p.material_id = s.id " +
"LEFT JOIN base_material m ON s.id=m.id "+
"WHERE p.bom_id = #{bomId} and p.material_id is not null AND p.deleted IN (0, 1) " +
"GROUP BY p.material_code")
List<ProcessBomDetailDO> selectStandardListByBomId(@Param("bomId") Long bomId);

View File

@ -53,7 +53,7 @@ public interface StorageLogNowMapper extends BaseMapperX<StorageLogNowDO> {
MPJLambdaWrapper<StorageLogNowDO> query = new MPJLambdaWrapper<>();
query.selectAll(StorageLogNowDO.class)
.select("a.material_type as materialTypeId","a.unit as matUnitId")
.select("a.material_type as materialTypeId","a.unit as matUnitId","COALESCE(a.price, 0) as price")
.leftJoin(MaterialDO.class,"a",MaterialDO::getId,StorageLogNowDO::getId)
.orderByDesc(StorageLogNowDO::getId);

View File

@ -349,7 +349,6 @@ public class bdgzsomthingServiceImpl implements bdgzsomthingService {
//去重查询,重复则不加
List<bdgzsomthingDO> selecteqint = bdgzsomthingMapper.selecteqint(BdgzsomthingDO);
System.out.println("生产任务单"+BdgzsomthingDO);
if(selecteqint.size()>0){
}else{

View File

@ -35,7 +35,8 @@
t.updater,
t.deleted,
g.material_type AS materialTypeId,
g.unit AS matUnitId
g.unit AS matUnitId,
COALESCE(g.price, 0) AS price
<!-- materialType unitId lyw加的其他之前的人写的-->
FROM
v_storage_material_now t

View File

@ -144,7 +144,8 @@
<el-col>
<el-card class="hl-incard">
<el-form ref="subFormRef" :model="formData.bomDetails" :rules="subFormRules" v-loading="formLoading" label-width="0" >
<el-table :row-class-name="tableRowClassName" :data="formData.bomDetails" >
<el-table :row-class-name="tableRowClassName" :data="formData.bomDetails" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column label="序号" type="index" min-width="50px" />
<el-table-column label="变更次数" prop="bomEditStatus" max-width="60px" align="center">
<template #default="{ row}">
@ -206,7 +207,7 @@
<el-table-column min-width="80px" align="center" fixed="right">
<template #header><span class="hl-table_header">*</span>负责人</template>
<template #default="{ row}">
<el-select :disabled="getDisable(row.bomEditStatus)" clearable filterable v-model="row.owner" placeholder="请选择负责人" style="width: 170px">
<el-select :disabled="getDisable(row.bomEditStatus)" clearable filterable v-model="row.owner" @change="change(row)" placeholder="请选择负责人" style="width: 170px">
<el-option
v-for="item in ownerList"
:key="item.index"
@ -267,7 +268,7 @@
</el-card>
</template>
<script setup lang="ts">
import { inject } from 'vue'
import {inject, ref} from 'vue'
import { Search, Plus } from '@element-plus/icons-vue'
import { getIntDictOptions, getStrDictOptions, getDictLabel, DICT_TYPE } from '@/utils/dict'
import { betweenDay, formatDate, dateFormatter } from '@/utils/formatTime'
@ -283,7 +284,7 @@ const { t } = useI18n() // 国际化
const message = useMessage() //
const { query } = useRoute()
const router = useRouter()
const chkboxEnable = ref(0)
const formLoading = ref(false) // 12
const formRef = ref() //
const subFormRef = ref() // Ref
@ -337,6 +338,41 @@ const heliBomStatusOptions = ref<bomEditStatusEnum[]>([
{ value: 3, label: '增补' },
{ value: 4, label: '修改' },
]);
const change =(row:any)=>{
var bomDetails = formData.value.bomDetails;
if (row.chkboxEnable==1){
for (let i = 0; i < bomDetails.length; i++) {
if (bomDetails[i].chkboxEnable==1&&bomDetails[i].bomEditStatus!=1){
bomDetails[i].owner=row.owner
}
}
}
}
const handleSelectionChange = (row: any) => {
var bomDetails = formData.value.bomDetails;
if (row.length==0) {
for (let i = 0; i < bomDetails.length; i++) {
bomDetails[i].chkboxEnable=0
}
}else if (row.length==formData.value.bomDetails.length) {
for (let i = 0; i < bomDetails.length; i++) {
bomDetails[i].chkboxEnable=1
}
}else {
for (let i = 0; i < bomDetails.length; i++) {
for (let j = 0; j < row.length; j++) {
if (row[j].id==bomDetails[i].id){
bomDetails[i].chkboxEnable=1
break
}else {
bomDetails[i].chkboxEnable=0
}
}
}
}
}
const submitForm = async (operate) => {
//
await subFormRef.value.validate()
@ -426,6 +462,7 @@ onMounted(async () => {
formData.value.bomDetails.forEach((item) => {
item.amount = formData.value.projectSubNum * item.amount;
item.typeName = item.type == 1 ? '是' : '否'
item.chkboxEnable=0
if(item.owner){
item.owner = Number(item.owner)
}

View File

@ -74,7 +74,7 @@ v-for="dict in getIntDictOptions(DICT_TYPE.HELI_STORAGE_STATUS)" :key="dict.valu
<div class="flex items-center" style="width: 100% !important;">
<el-input
v-model="formData.headerNo"
:disabled="ctrView || ctrSave || enableHeadNo"
/>
<el-button
@ -235,6 +235,7 @@ v-for="dict in scope.row.pnlist" :key="dict.id" :label="dict.pn_name"
</el-form-item>
</template>
</el-table-column>
<el-table-column prop="price" label="库存单价" min-width="120" align="center" />
<el-table-column prop="lotNo" min-width="120" label="批次号" align="center" v-if="false" />
<el-table-column prop="projectSubName" label="子项目名称" align="center" min-width="180">
@ -388,7 +389,7 @@ link type="primary" size="small" :disabled="ctrView || ctrDelete"
<el-button @click="handleStatus(2)" type="primary" v-if="btnSave" size="large">
</el-button>
<el-button @click="handleStatus(3)" type="danger" v-if="btnCancel" size="large">
</el-button>
</el-button>
<!-- <el-button @click="handleStatus(4)" type="success" v-if="btnCancel" size="large">审核</el-button> -->
</div>
</el-card>
@ -490,7 +491,7 @@ const openMatForm = () => {
// return
// }
// formData.value.whId
if(formData.value.pickmode==1){
if(formData.value.pickmode==1){
matOpenFormRef.value.open(formData.value, 'bomfind')
}else{
@ -508,6 +509,7 @@ const openProjectForm = (scope) => {
const getList = async (arrMat) => {
console.log(JSON.stringify(arrMat))
arrMat.forEach((row) => {
if (
formData.value.matItemDOList.filter(
@ -600,7 +602,7 @@ const handleSelectedProjectOrder = (arr: ProjectOrderVO[]) => {
let contractNo = ''
let property = ''
let projectName = ''
for (let i = 0; i < arr.length; i++) {
let order = arr[i]
saleOrderIds += order.id + ','
@ -614,7 +616,7 @@ const handleSelectedProjectOrder = (arr: ProjectOrderVO[]) => {
message.alertWarning('上游单据只允许选择一个!')
}
}
const deleteData = ref<StorageApi.StorageVO>();
const deleteData = ref<StorageApi.StorageVO>();
const deleteStorage = async() =>{
await StorageApi.updateStorage(deleteData.value)
deleteData.value.cancel = useUserStore().getUser.id
@ -872,7 +874,7 @@ const saveFormData = async () => {
//
formData.value.matItemDOList.forEach((item) => {
item.stockId = formData.value.id
item.whId = formData.value.whId
item.whId = formData.value.whId
})
const dataMats = formData.value.matItemDOList as unknown as StorageMatApi.StorageMatVO[]
await StorageMatApi.createStorageMatBatch(dataMats, formData.value.id)
@ -1218,7 +1220,7 @@ onMounted(async () => {
matEditList.value = matSimpVirtualList.value
}
console.log(formData.value)
//
//
await initStatus(formData.value.status)
//

View File

@ -223,6 +223,7 @@ v-for="dict in scope.row.pnlist" :key="dict.id" :label="dict.pn_name"
</el-form-item>
</template>
</el-table-column>
<el-table-column prop="price" label="库存单价" min-width="120" align="center" />
<el-table-column prop="lotNo" min-width="120" label="批次号" align="center" v-if="false" />
<el-table-column prop="projectSubName" label="子项目名称" align="center" min-width="180">
@ -361,7 +362,7 @@ link type="primary" size="small" :disabled="ctrView || ctrDelete"
<el-button @click="submitForm" type="success" v-if="btnSave" size="large">
</el-button>
<el-button @click="handleStatus(2)" type="primary" v-if="btnSave" size="large">
</el-button>
<el-button @click="handleStatus(4)" type="success" v-if="btnok " size="large">审核</el-button>
<el-button @click="handleStatus(3)" type="danger" v-if="btnCancel " size="large">
@ -563,7 +564,7 @@ const handleStockType = async (typeid) => {
enableHeadNo.value = true
}
}
const deleteData = ref<StorageApi.StorageVO>();
const deleteData = ref<StorageApi.StorageVO>();
const deleteStorage = async() =>{
await StorageApi.updateStorage(deleteData.value)
deleteData.value.cancel = useUserStore().getUser.id