修改入库价格为入库单价

This commit is contained in:
z 2025-02-25 13:44:40 +08:00
parent 46ee4cbfc9
commit 07d4f77718
9 changed files with 92 additions and 92 deletions

View File

@ -157,7 +157,7 @@ public class StorageController {
if (ObjectUtil.isEmpty(materialDO.getPrice())){ if (ObjectUtil.isEmpty(materialDO.getPrice())){
materialDO.setPrice(BigDecimal.ZERO); materialDO.setPrice(BigDecimal.ZERO);
} }
BigDecimal add = totalStorageOkQty.multiply(materialDO.getPrice()).add(storageMatDO.getPrice()); BigDecimal add = totalStorageOkQty.multiply(materialDO.getPrice()).add(storageMatDO.getPrice().multiply(storageMatDO.getStorageOkQty()));
BigDecimal divide = add.divide(totalStorageOkQty.add(storageMatDO.getStorageOkQty()),2,RoundingMode.HALF_UP); BigDecimal divide = add.divide(totalStorageOkQty.add(storageMatDO.getStorageOkQty()),2,RoundingMode.HALF_UP);
materialDO.setPrice(divide); materialDO.setPrice(divide);
materialMapper.updateById(materialDO); materialMapper.updateById(materialDO);
@ -179,7 +179,7 @@ public class StorageController {
if (ObjectUtil.isEmpty(materialDO.getPrice())){ if (ObjectUtil.isEmpty(materialDO.getPrice())){
materialDO.setPrice(BigDecimal.ZERO); materialDO.setPrice(BigDecimal.ZERO);
} }
BigDecimal add = totalStorageOkQty.multiply(materialDO.getPrice()).subtract(storageMatDO.getPrice()); BigDecimal add = totalStorageOkQty.multiply(materialDO.getPrice()).subtract(storageMatDO.getPrice().multiply(storageMatDO.getStorageOkQty()));
BigDecimal divide = add.divide(totalStorageOkQty.subtract(storageMatDO.getStorageOkQty()),2,RoundingMode.HALF_UP); BigDecimal divide = add.divide(totalStorageOkQty.subtract(storageMatDO.getStorageOkQty()),2,RoundingMode.HALF_UP);
materialDO.setPrice(divide); materialDO.setPrice(divide);
materialMapper.updateById(materialDO); materialMapper.updateById(materialDO);

View File

@ -49,7 +49,8 @@ public class StorageLogNowDO extends BaseDO {
private Long pnId; private Long pnId;
private String pnName; private String pnName;
private BigDecimal sumKcMoney; private BigDecimal sumKcMoney;
@TableField(exist = false)
private BigDecimal sumKcMoneys;
@TableField(exist = false) @TableField(exist = false)
private Long materialTypeId; private Long materialTypeId;

View File

@ -112,7 +112,7 @@ public interface StorageLogNowMapper extends BaseMapperX<StorageLogNowDO> {
MPJLambdaWrapper<StorageLogNowDO> query = new MPJLambdaWrapper<>(); MPJLambdaWrapper<StorageLogNowDO> query = new MPJLambdaWrapper<>();
query.selectAll(StorageLogNowDO.class) query.selectAll(StorageLogNowDO.class)
.select("COALESCE(SUM(storage_ok_qty), 0) as storageOkQtys,a.price as price") .select("COALESCE(SUM(storage_ok_qty), 0) as storageOkQtys,a.price as price,COALESCE(SUM(storage_ok_qty), 0) * a.price as sumKcMoneys")
.leftJoin(MaterialDO.class,"a",MaterialDO::getCode,StorageLogNowDO::getMatCode) .leftJoin(MaterialDO.class,"a",MaterialDO::getCode,StorageLogNowDO::getMatCode)
.groupBy(StorageLogNowDO::getMatCode) .groupBy(StorageLogNowDO::getMatCode)
.orderByDesc(StorageLogNowDO::getId); .orderByDesc(StorageLogNowDO::getId);

View File

@ -94,8 +94,8 @@ v-for="dict in getIntDictOptions(DICT_TYPE.HELI_PURCHASE_ORDER_STATUS).filter(it
<dict-tag :type="DICT_TYPE.HELI_CURRENCY" :value="scope.row.currencyType" /> <dict-tag :type="DICT_TYPE.HELI_CURRENCY" :value="scope.row.currencyType" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="暂估金额(元)" align="center" prop="estimatedPrice" min-width="180"/> <el-table-column label="暂估价(元)" align="center" prop="estimatedPrice" min-width="180"/>
<el-table-column label="实际金额(元)" align="center" prop="actualPrice" min-width="180"/> <el-table-column label="实际价(元)" align="center" prop="actualPrice" min-width="180"/>
<el-table-column label="税率" align="center" prop="taxRatio" min-width="180" /> <el-table-column label="税率" align="center" prop="taxRatio" min-width="180" />
<el-table-column label="备注" align="center" prop="description" min-width="180" /> <el-table-column label="备注" align="center" prop="description" min-width="180" />
<el-table-column label="单据状态" align="center" prop="status" fixed="right" min-width="120"> <el-table-column label="单据状态" align="center" prop="status" fixed="right" min-width="120">
@ -104,8 +104,8 @@ v-for="dict in getIntDictOptions(DICT_TYPE.HELI_PURCHASE_ORDER_STATUS).filter(it
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="right" fixed="right" min-width="200"> <el-table-column label="操作" align="right" fixed="right" min-width="200">
<template #header> <template #header>
<span style="margin-right: 30%">操作</span> <span style="margin-right: 30%">操作</span>
</template> </template>
<template #default="scope"> <template #default="scope">
<el-button link type="primary" @click="openForm('audit', scope.row.id)" v-if="scope.row.status == 2"> <el-button link type="primary" @click="openForm('audit', scope.row.id)" v-if="scope.row.status == 2">
@ -173,12 +173,12 @@ const getList = async () => {
loading.value = true loading.value = true
try { try {
const route = useRoute(); const route = useRoute();
if(route){ if(route){
const idid = route.query.idid; const idid = route.query.idid;
queryParams.purchaseNo=idid queryParams.purchaseNo=idid
} }
const data = await PurchaseOrderApi.getPurchaseOrderPageByStatus(queryParams) const data = await PurchaseOrderApi.getPurchaseOrderPageByStatus(queryParams)
list.value = data.list list.value = data.list
total.value = data.total total.value = data.total

View File

@ -168,21 +168,21 @@
</el-table-column> </el-table-column>
<el-table-column prop="estimatedPrice" min-width="200" align="center"> <el-table-column prop="estimatedPrice" min-width="200" align="center">
<template #header><span class="hl-table_header">*</span>暂估金额</template> <template #header><span class="hl-table_header">*</span>暂估</template>
<template #default="scope"> <template #default="scope">
<el-form-item :prop="`${scope.$index}.estimatedPrice`" :rules="subFormRules.estimatedPrice" class="mb-0px!"> <el-form-item :prop="`${scope.$index}.estimatedPrice`" :rules="subFormRules.estimatedPrice" class="mb-0px!">
<el-input-number style="width: 100%" v-model="scope.row.estimatedPrice" placeholder="暂估金额" @change="handleEstimatedPrice" :min="0" :precision="6" disabled /> <el-input-number style="width: 100%" v-model="scope.row.estimatedPrice" placeholder="暂估价" @change="handleEstimatedPrice" :min="0" :precision="6" disabled />
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="actualPrice" min-width="200" align="center"> <el-table-column prop="actualPrice" min-width="200" align="center">
<template #header>实际金额</template> <template #header>实际</template>
<template #default="scope"> <template #default="scope">
<el-form-item :prop="`${scope.$index}.actualPrice`" class="mb-0px!"> <el-form-item :prop="`${scope.$index}.actualPrice`" class="mb-0px!">
<el-input-number style="width: 100%" v-model="scope.row.actualPrice" placeholder="实际金额" @change="handleActualPrice" :min="0" :precision="6" disabled /> <el-input-number style="width: 100%" v-model="scope.row.actualPrice" placeholder="实际价" @change="handleActualPrice" :min="0" :precision="6" disabled />
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
@ -275,21 +275,21 @@
</el-table-column> </el-table-column>
<el-table-column prop="estimatedPrice" min-width="200" align="center"> <el-table-column prop="estimatedPrice" min-width="200" align="center">
<template #header><span class="hl-table_header">*</span>暂估金额</template> <template #header><span class="hl-table_header">*</span>暂估</template>
<template #default="scope"> <template #default="scope">
<el-form-item :prop="`${scope.$index}.estimatedPrice`" :rules="subMatPlanFormRules.estimatedPrice" class="mb-0px!"> <el-form-item :prop="`${scope.$index}.estimatedPrice`" :rules="subMatPlanFormRules.estimatedPrice" class="mb-0px!">
<el-input-number style="width: 100%" v-model="scope.row.estimatedPrice" placeholder="暂估金额" @change="handleEstimatedPrice" :min="0" :precision="6" disabled /> <el-input-number style="width: 100%" v-model="scope.row.estimatedPrice" placeholder="暂估价" @change="handleEstimatedPrice" :min="0" :precision="6" disabled />
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="actualPrice" min-width="200" align="center"> <el-table-column prop="actualPrice" min-width="200" align="center">
<template #header>实际金额</template> <template #header>实际</template>
<template #default="scope"> <template #default="scope">
<el-form-item :prop="`${scope.$index}.actualPrice`" class="mb-0px!"> <el-form-item :prop="`${scope.$index}.actualPrice`" class="mb-0px!">
<el-input-number style="width: 100%" v-model="scope.row.actualPrice" placeholder="实际金额" @change="handleActualPrice" :min="0" :precision="6" disabled /> <el-input-number style="width: 100%" v-model="scope.row.actualPrice" placeholder="实际价" @change="handleActualPrice" :min="0" :precision="6" disabled />
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
@ -385,21 +385,21 @@
</el-table-column> </el-table-column>
<el-table-column prop="boomEstimatedPrice" min-width="200" align="center"> <el-table-column prop="boomEstimatedPrice" min-width="200" align="center">
<template #header><span class="hl-table_header">*</span>暂估</template> <template #header><span class="hl-table_header">*</span>暂估</template>
<template #default="scope"> <template #default="scope">
<el-form-item :prop="`${scope.$index}.boomEstimatedPrice`" :rules="subFormRules.boomEstimatedPrice" class="mb-0px!"> <el-form-item :prop="`${scope.$index}.boomEstimatedPrice`" :rules="subFormRules.boomEstimatedPrice" class="mb-0px!">
<el-input-number style="width: 100%" v-model="scope.row.boomEstimatedPrice" placeholder="暂估价" @change="handleEstimatedPrice" :min="0" :precision="6" disabled /> <el-input-number style="width: 100%" v-model="scope.row.boomEstimatedPrice" placeholder="暂估价" @change="handleEstimatedPrice" :min="0" :precision="6" disabled />
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="boomActualPrice" min-width="200" align="center"> <el-table-column prop="boomActualPrice" min-width="200" align="center">
<template #header>实际</template> <template #header>实际</template>
<template #default="scope"> <template #default="scope">
<el-form-item :prop="`${scope.$index}.boomActualPrice`" class="mb-0px!"> <el-form-item :prop="`${scope.$index}.boomActualPrice`" class="mb-0px!">
<el-input-number style="width: 100%" v-model="scope.row.boomActualPrice" placeholder="暂估价" @change="handleActualPrice" :min="0" :precision="6" disabled /> <el-input-number style="width: 100%" v-model="scope.row.boomActualPrice" placeholder="实际单价" @change="handleActualPrice" :min="0" :precision="6" disabled />
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
@ -487,18 +487,18 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="estimatedPrice" min-width="200" align="center"> <el-table-column prop="estimatedPrice" min-width="200" align="center">
<template #header><span class="hl-table_header">*</span>暂估金额</template> <template #header><span class="hl-table_header">*</span>暂估</template>
<template #default="scope"> <template #default="scope">
<el-form-item :prop="`${scope.$index}.estimatedPrice`" :rules="subMatPlanFormRules.estimatedPrice" class="mb-0px!"> <el-form-item :prop="`${scope.$index}.estimatedPrice`" :rules="subMatPlanFormRules.estimatedPrice" class="mb-0px!">
<el-input-number style="width: 100%" v-model="scope.row.estimatedPrice" placeholder="暂估金额" @change="handleEstimatedPrice" :min="0" :precision="6" disabled /> <el-input-number style="width: 100%" v-model="scope.row.estimatedPrice" placeholder="暂估价" @change="handleEstimatedPrice" :min="0" :precision="6" disabled />
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="actualPrice" min-width="200" align="center"> <el-table-column prop="actualPrice" min-width="200" align="center">
<template #header>实际金额</template> <template #header>实际</template>
<template #default="scope"> <template #default="scope">
<el-form-item :prop="`${scope.$index}.actualPrice`" class="mb-0px!"> <el-form-item :prop="`${scope.$index}.actualPrice`" class="mb-0px!">
<el-input-number style="width: 100%" v-model="scope.row.actualPrice" placeholder="实际金额" @change="handleEstimatedPrice" :min="0" :precision="6" disabled /> <el-input-number style="width: 100%" v-model="scope.row.actualPrice" placeholder="实际价" @change="handleEstimatedPrice" :min="0" :precision="6" disabled />
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
@ -698,21 +698,21 @@ const formRules = reactive({
}) })
const subFormRules = reactive({ const subFormRules = reactive({
matId: [{ required: true, message: '物料编码不能为空', trigger: 'blur' }], matId: [{ required: true, message: '物料编码不能为空', trigger: 'blur' }],
estimatedPrice: [{ required: true, message: '暂估金额不能为空', trigger: 'blur' }], estimatedPrice: [{ required: true, message: '暂估价不能为空', trigger: 'blur' }],
purchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }] purchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }]
}) })
const subBoomFormRules = reactive({ const subBoomFormRules = reactive({
boomName: [{ required: true, message: '零件名称不能为空', trigger: 'blur' }], boomName: [{ required: true, message: '零件名称不能为空', trigger: 'blur' }],
boomPurchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }], boomPurchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }],
boomEstimatedPrice: [{ required: true, message: '暂估金额不能为空', trigger: 'blur' }] boomEstimatedPrice: [{ required: true, message: '暂估价不能为空', trigger: 'blur' }]
}) })
const subMatPlanFormRules = reactive({ const subMatPlanFormRules = reactive({
purchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }], purchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }],
estimatedPrice: [{ required: true, message: '暂估金额不能为空', trigger: 'blur' }] estimatedPrice: [{ required: true, message: '暂估价不能为空', trigger: 'blur' }]
}) })
const subBoomPlanFormRules = reactive({ const subBoomPlanFormRules = reactive({
boomPurchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }], boomPurchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }],
boomEstimatedPrice: [{ required: true, message: '暂估金额不能为空', trigger: 'blur' }] boomEstimatedPrice: [{ required: true, message: '暂估价不能为空', trigger: 'blur' }]
}) })
const formRef = ref() // Ref const formRef = ref() // Ref
const subFormRef = ref() // Ref const subFormRef = ref() // Ref
@ -1146,7 +1146,7 @@ formData.value.boomItemDOList.forEach((item) => {
item.boomDescription = item.description; item.boomDescription = item.description;
item.materialName = item.boomName; item.materialName = item.boomName;
item.compositionName = item.composition; item.compositionName = item.composition;
// composition // composition
if (Array.isArray(item.composition) && item.composition.length > 0) { if (Array.isArray(item.composition) && item.composition.length > 0) {
item.composition = Number(item.composition); item.composition = Number(item.composition);

View File

@ -178,18 +178,18 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="estimatedPrice" min-width="200" align="center"> <el-table-column prop="estimatedPrice" min-width="200" align="center">
<template #header><span class="hl-table_header">*</span>暂估金额</template> <template #header><span class="hl-table_header">*</span>暂估</template>
<template #default="scope"> <template #default="scope">
<el-form-item :prop="`${scope.$index}.estimatedPrice`" :rules="subFormRules.estimatedPrice" class="mb-0px!"> <el-form-item :prop="`${scope.$index}.estimatedPrice`" :rules="subFormRules.estimatedPrice" class="mb-0px!">
<el-input-number style="width: 100%" v-model="scope.row.estimatedPrice" placeholder="暂估金额" @change="handleEstimatedPrice" :min="0" :precision="6" disabled /> <el-input-number style="width: 100%" v-model="scope.row.estimatedPrice" placeholder="暂估价" @change="handleEstimatedPrice" :min="0" :precision="6" disabled />
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="actualPrice" min-width="200" align="center"> <el-table-column prop="actualPrice" min-width="200" align="center">
<template #header>实际金额</template> <template #header>实际</template>
<template #default="scope"> <template #default="scope">
<el-form-item :prop="`${scope.$index}.actualPrice`" class="mb-0px!"> <el-form-item :prop="`${scope.$index}.actualPrice`" class="mb-0px!">
<el-input-number style="width: 100%" v-model="scope.row.actualPrice" placeholder="实际金额" @change="handleEstimatedPrice" :min="0" :precision="6" disabled /> <el-input-number style="width: 100%" v-model="scope.row.actualPrice" placeholder="实际价" @change="handleEstimatedPrice" :min="0" :precision="6" disabled />
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
@ -281,21 +281,21 @@
</el-table-column> </el-table-column>
<el-table-column prop="estimatedPrice" min-width="200" align="center"> <el-table-column prop="estimatedPrice" min-width="200" align="center">
<template #header><span class="hl-table_header">*</span>暂估金额</template> <template #header><span class="hl-table_header">*</span>暂估</template>
<template #default="scope"> <template #default="scope">
<el-form-item :prop="`${scope.$index}.estimatedPrice`" :rules="subMatPlanFormRules.estimatedPrice" class="mb-0px!"> <el-form-item :prop="`${scope.$index}.estimatedPrice`" :rules="subMatPlanFormRules.estimatedPrice" class="mb-0px!">
<el-input-number style="width: 100%" v-model="scope.row.estimatedPrice" placeholder="暂估金额" @change="handleEstimatedPrice" :min="0" :precision="6" disabled /> <el-input-number style="width: 100%" v-model="scope.row.estimatedPrice" placeholder="暂估价" @change="handleEstimatedPrice" :min="0" :precision="6" disabled />
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="actualPrice" min-width="200" align="center"> <el-table-column prop="actualPrice" min-width="200" align="center">
<template #header>实际金额</template> <template #header>实际</template>
<template #default="scope"> <template #default="scope">
<el-form-item :prop="`${scope.$index}.actualPrice`" class="mb-0px!"> <el-form-item :prop="`${scope.$index}.actualPrice`" class="mb-0px!">
<el-input-number style="width: 100%" v-model="scope.row.actualPrice" placeholder="实际金额" @change="handleEstimatedPrice" :min="0" :precision="6" disabled /> <el-input-number style="width: 100%" v-model="scope.row.actualPrice" placeholder="实际价" @change="handleEstimatedPrice" :min="0" :precision="6" disabled />
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
@ -391,21 +391,21 @@
</el-table-column> </el-table-column>
<el-table-column prop="boomEstimatedPrice" min-width="200" align="center"> <el-table-column prop="boomEstimatedPrice" min-width="200" align="center">
<template #header><span class="hl-table_header">*</span>暂估</template> <template #header><span class="hl-table_header">*</span>暂估</template>
<template #default="scope"> <template #default="scope">
<el-form-item :prop="`${scope.$index}.boomEstimatedPrice`" :rules="subBoomFormRules.boomEstimatedPrice" class="mb-0px!"> <el-form-item :prop="`${scope.$index}.boomEstimatedPrice`" :rules="subBoomFormRules.boomEstimatedPrice" class="mb-0px!">
<el-input-number style="width: 100%" v-model="scope.row.boomEstimatedPrice" placeholder="暂估价" @change="handleEstimatedPrice" :min="0" :precision="6" disabled /> <el-input-number style="width: 100%" v-model="scope.row.boomEstimatedPrice" placeholder="暂估价" @change="handleEstimatedPrice" :min="0" :precision="6" disabled />
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="boomActualPrice" min-width="200" align="center"> <el-table-column prop="boomActualPrice" min-width="200" align="center">
<template #header>实际</template> <template #header>实际</template>
<template #default="scope"> <template #default="scope">
<el-form-item :prop="`${scope.$index}.boomActualPrice`" class="mb-0px!"> <el-form-item :prop="`${scope.$index}.boomActualPrice`" class="mb-0px!">
<el-input-number style="width: 100%" v-model="scope.row.boomActualPrice" placeholder="暂估价" @change="handleEstimatedPrice" :min="0" :precision="6" disabled /> <el-input-number style="width: 100%" v-model="scope.row.boomActualPrice" placeholder="实际单价" @change="handleEstimatedPrice" :min="0" :precision="6" disabled />
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
@ -488,18 +488,18 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="estimatedPrice" min-width="200" align="center"> <el-table-column prop="estimatedPrice" min-width="200" align="center">
<template #header><span class="hl-table_header">*</span>暂估金额</template> <template #header><span class="hl-table_header">*</span>暂估</template>
<template #default="scope"> <template #default="scope">
<el-form-item :prop="`${scope.$index}.estimatedPrice`" :rules="subMatPlanFormRules.estimatedPrice" class="mb-0px!"> <el-form-item :prop="`${scope.$index}.estimatedPrice`" :rules="subMatPlanFormRules.estimatedPrice" class="mb-0px!">
<el-input-number style="width: 100%" v-model="scope.row.estimatedPrice" placeholder="暂估金额" @change="handleEstimatedPrice" :min="0" :precision="6" disabled /> <el-input-number style="width: 100%" v-model="scope.row.estimatedPrice" placeholder="暂估价" @change="handleEstimatedPrice" :min="0" :precision="6" disabled />
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="actualPrice" min-width="200" align="center"> <el-table-column prop="actualPrice" min-width="200" align="center">
<template #header>实际金额</template> <template #header>实际</template>
<template #default="scope"> <template #default="scope">
<el-form-item :prop="`${scope.$index}.actualPrice`" class="mb-0px!"> <el-form-item :prop="`${scope.$index}.actualPrice`" class="mb-0px!">
<el-input-number style="width: 100%" v-model="scope.row.actualPrice" placeholder="实际金额" @change="handleEstimatedPrice" :min="0" :precision="6" disabled /> <el-input-number style="width: 100%" v-model="scope.row.actualPrice" placeholder="实际价" @change="handleEstimatedPrice" :min="0" :precision="6" disabled />
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
@ -711,24 +711,24 @@ const formRules = reactive({
}) })
const subFormRules = reactive({ const subFormRules = reactive({
matId: [{ required: true, message: '物料编码不能为空', trigger: 'blur' }], matId: [{ required: true, message: '物料编码不能为空', trigger: 'blur' }],
estimatedPrice: [{ required: true, message: '暂估金额不能为空', trigger: 'blur' }], estimatedPrice: [{ required: true, message: '暂估价不能为空', trigger: 'blur' }],
purchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }] purchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }]
}) })
const subBoomFormRules = reactive({ const subBoomFormRules = reactive({
boomName: [{ required: true, message: '零件名称不能为空', trigger: 'blur' }], boomName: [{ required: true, message: '零件名称不能为空', trigger: 'blur' }],
composition: [{ required: true, message: '材质不能为空', trigger: 'blur' }], composition: [{ required: true, message: '材质不能为空', trigger: 'blur' }],
boomPurchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }], boomPurchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }],
boomEstimatedPrice: [{ required: true, message: '暂估金额不能为空', trigger: 'blur' }], boomEstimatedPrice: [{ required: true, message: '暂估价不能为空', trigger: 'blur' }],
boomArriveTime: [{ required: true, message: '预计到货时间不能为空', trigger: 'blur' }], boomArriveTime: [{ required: true, message: '预计到货时间不能为空', trigger: 'blur' }],
}) })
const subMatPlanFormRules = reactive({ const subMatPlanFormRules = reactive({
purchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }], purchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }],
estimatedPrice: [{ required: true, message: '暂估金额不能为空', trigger: 'blur' }] estimatedPrice: [{ required: true, message: '暂估价不能为空', trigger: 'blur' }]
}) })
const subBoomPlanFormRules = reactive({ const subBoomPlanFormRules = reactive({
boomName: [{ required: true, message: '零件名称不能为空', trigger: 'blur' }], boomName: [{ required: true, message: '零件名称不能为空', trigger: 'blur' }],
boomPurchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }], boomPurchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }],
boomEstimatedPrice: [{ required: true, message: '暂估金额不能为空', trigger: 'blur' }] boomEstimatedPrice: [{ required: true, message: '暂估价不能为空', trigger: 'blur' }]
}) })
const formRef = ref() // Ref const formRef = ref() // Ref
const subFormRef = ref() // Ref const subFormRef = ref() // Ref
@ -759,12 +759,12 @@ const handleSelectedMaterialPlanMat = (arr) => {
}); });
}; };
const handleSelectedMaterialPlanBoom =async (arrBoom) => { const handleSelectedMaterialPlanBoom =async (arrBoom) => {
//debugger //debugger
const existingBoomDetailIds = new Set(formData.value.boomItemDOList.map(boom => boom.boomDetailId)); const existingBoomDetailIds = new Set(formData.value.boomItemDOList.map(boom => boom.boomDetailId));
arrBoom.forEach((item) => { arrBoom.forEach((item) => {
if (!existingBoomDetailIds.has(item.boomDetailId)) { if (!existingBoomDetailIds.has(item.boomDetailId)) {
item.description = ''; item.description = '';
// formData.value.boomItemDOList.requireTime = item.boomArriveDate // formData.value.boomItemDOList.requireTime = item.boomArriveDate
// formData.value.boomItemDOList.composition = item.compositionName // formData.value.boomItemDOList.composition = item.compositionName
// formData.value.boomItemDOList.boomName = item.materialName // formData.value.boomItemDOList.boomName = item.materialName
@ -812,7 +812,7 @@ const handleEstimatedPrice = () => {
formData.value.actualPrice = allActualPrice formData.value.actualPrice = allActualPrice
} }
const handleActualPrice = () => { const handleActualPrice = () => {
} }
// ==================== ======================================= // ==================== =======================================
@ -981,7 +981,7 @@ const onAddItem = () => {
} }
const getList = async (arrMat) => { const getList = async (arrMat) => {
arrMat.forEach((row) => { arrMat.forEach((row) => {
if ( formData.value.matItemDOList.filter((item) => item.matId == row.matId).length == 0) if ( formData.value.matItemDOList.filter((item) => item.matId == row.matId).length == 0)
{ {
row.id = undefined row.id = undefined
formData.value.matItemDOList.push(row) formData.value.matItemDOList.push(row)
@ -1180,7 +1180,7 @@ const submitForm = async () => {
} catch (e) { } catch (e) {
return return
} }
// //
formData.value.receivingStatus = 2 formData.value.receivingStatus = 2
formData.value.status = 2 formData.value.status = 2
formData.value.submitUserId = useUserStore().getUser.id formData.value.submitUserId = useUserStore().getUser.id
@ -1227,7 +1227,7 @@ onMounted(async () => {
}) })
formData.value.matItemRemoveList = [] formData.value.matItemRemoveList = []
formData.value.boomItemRemoveList = [] formData.value.boomItemRemoveList = []
// //
formData.value.boomItemDOList = ( formData.value.boomItemDOList = (
@ -1245,7 +1245,7 @@ formData.value.boomItemDOList.forEach((item) => {
item.boomDescription = item.description; item.boomDescription = item.description;
item.materialName = item.boomName; item.materialName = item.boomName;
item.compositionName = item.composition; item.compositionName = item.composition;
// composition // composition
if (Array.isArray(item.composition) && item.composition.length > 0) { if (Array.isArray(item.composition) && item.composition.length > 0) {
item.composition = Number(item.composition); item.composition = Number(item.composition);

View File

@ -177,18 +177,18 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="estimatedPrice" min-width="200" align="center"> <el-table-column prop="estimatedPrice" min-width="200" align="center">
<template #header><span class="hl-table_header">*</span>暂估金额</template> <template #header><span class="hl-table_header">*</span>暂估</template>
<template #default="scope"> <template #default="scope">
<el-form-item :prop="`${scope.$index}.estimatedPrice`" :rules="subFormRules.estimatedPrice" class="mb-0px!"> <el-form-item :prop="`${scope.$index}.estimatedPrice`" :rules="subFormRules.estimatedPrice" class="mb-0px!">
<el-input-number style="width: 100%" v-model="scope.row.estimatedPrice" placeholder="暂估金额" @change="handleEstimatedPrice" :min="0" :precision="6" :disabled="formData.status == 2 || formData.status == 3" /> <el-input-number style="width: 100%" v-model="scope.row.estimatedPrice" placeholder="暂估价" @change="handleEstimatedPrice" :min="0" :precision="6" :disabled="formData.status == 2 || formData.status == 3" />
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="actualPrice" min-width="200" align="center"> <el-table-column prop="actualPrice" min-width="200" align="center">
<template #header>实际金额</template> <template #header>实际</template>
<template #default="scope"> <template #default="scope">
<el-form-item :prop="`${scope.$index}.actualPrice`" class="mb-0px!"> <el-form-item :prop="`${scope.$index}.actualPrice`" class="mb-0px!">
<el-input-number style="width: 100%" v-model="scope.row.actualPrice" placeholder="实际金额" @change="handleEstimatedPrice" :min="0" :precision="6" :disabled="formData.status == 2 || formData.status == 3" /> <el-input-number style="width: 100%" v-model="scope.row.actualPrice" placeholder="实际价" @change="handleEstimatedPrice" :min="0" :precision="6" :disabled="formData.status == 2 || formData.status == 3" />
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
@ -281,21 +281,21 @@
<el-table-column prop="estimatedPrice" min-width="200" align="center"> <el-table-column prop="estimatedPrice" min-width="200" align="center">
<template #header><span class="hl-table_header">*</span>暂估金额</template> <template #header><span class="hl-table_header">*</span>暂估</template>
<template #default="scope"> <template #default="scope">
<el-form-item :prop="`${scope.$index}.estimatedPrice`" :rules="subMatPlanFormRules.estimatedPrice" class="mb-0px!"> <el-form-item :prop="`${scope.$index}.estimatedPrice`" :rules="subMatPlanFormRules.estimatedPrice" class="mb-0px!">
<el-input-number style="width: 100%" v-model="scope.row.estimatedPrice" placeholder="暂估金额" @change="handleEstimatedPrice" :min="0" :precision="6" :disabled="formData.status == 2 || formData.status == 3" /> <el-input-number style="width: 100%" v-model="scope.row.estimatedPrice" placeholder="暂估价" @change="handleEstimatedPrice" :min="0" :precision="6" :disabled="formData.status == 2 || formData.status == 3" />
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="actualPrice" min-width="200" align="center"> <el-table-column prop="actualPrice" min-width="200" align="center">
<template #header>实际金额</template> <template #header>实际</template>
<template #default="scope"> <template #default="scope">
<el-form-item :prop="`${scope.$index}.actualPrice`" class="mb-0px!"> <el-form-item :prop="`${scope.$index}.actualPrice`" class="mb-0px!">
<el-input-number style="width: 100%" v-model="scope.row.actualPrice" placeholder="实际金额" @change="handleEstimatedPrice" :min="0" :precision="6" :disabled="formData.status == 2 || formData.status == 3" /> <el-input-number style="width: 100%" v-model="scope.row.actualPrice" placeholder="实际价" @change="handleEstimatedPrice" :min="0" :precision="6" :disabled="formData.status == 2 || formData.status == 3" />
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
@ -391,21 +391,21 @@
</el-table-column> </el-table-column>
<el-table-column prop="boomEstimatedPrice" min-width="200" align="center"> <el-table-column prop="boomEstimatedPrice" min-width="200" align="center">
<template #header><span class="hl-table_header">*</span>暂估</template> <template #header><span class="hl-table_header">*</span>暂估</template>
<template #default="scope"> <template #default="scope">
<el-form-item :prop="`${scope.$index}.boomEstimatedPrice`" :rules="subBoomFormRules.boomEstimatedPrice" class="mb-0px!"> <el-form-item :prop="`${scope.$index}.boomEstimatedPrice`" :rules="subBoomFormRules.boomEstimatedPrice" class="mb-0px!">
<el-input-number style="width: 100%" v-model="scope.row.boomEstimatedPrice" placeholder="暂估价" @change="handleEstimatedPrice" :min="0" :precision="6" :disabled="formData.status == 2 || formData.status == 3" /> <el-input-number style="width: 100%" v-model="scope.row.boomEstimatedPrice" placeholder="暂估价" @change="handleEstimatedPrice" :min="0" :precision="6" :disabled="formData.status == 2 || formData.status == 3" />
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="boomActualPrice" min-width="200" align="center"> <el-table-column prop="boomActualPrice" min-width="200" align="center">
<template #header>实际</template> <template #header>实际</template>
<template #default="scope"> <template #default="scope">
<el-form-item :prop="`${scope.$index}.boomActualPrice`" class="mb-0px!"> <el-form-item :prop="`${scope.$index}.boomActualPrice`" class="mb-0px!">
<el-input-number style="width: 100%" v-model="scope.row.boomActualPrice" placeholder="暂估价" @change="handleEstimatedPrice" :min="0" :precision="6" :disabled="formData.status == 2 || formData.status == 3" /> <el-input-number style="width: 100%" v-model="scope.row.boomActualPrice" placeholder="实际单价" @change="handleEstimatedPrice" :min="0" :precision="6" :disabled="formData.status == 2 || formData.status == 3" />
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
@ -488,18 +488,18 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="estimatedPrice" min-width="200" align="center"> <el-table-column prop="estimatedPrice" min-width="200" align="center">
<template #header><span class="hl-table_header">*</span>暂估金额</template> <template #header><span class="hl-table_header">*</span>暂估</template>
<template #default="scope"> <template #default="scope">
<el-form-item :prop="`${scope.$index}.estimatedPrice`" :rules="subMatPlanFormRules.estimatedPrice" class="mb-0px!"> <el-form-item :prop="`${scope.$index}.estimatedPrice`" :rules="subMatPlanFormRules.estimatedPrice" class="mb-0px!">
<el-input-number style="width: 100%" v-model="scope.row.estimatedPrice" placeholder="暂估金额" @change="handleEstimatedPrice" :min="0" :precision="6" :disabled="formData.status == 2 || formData.status == 3" /> <el-input-number style="width: 100%" v-model="scope.row.estimatedPrice" placeholder="暂估价" @change="handleEstimatedPrice" :min="0" :precision="6" :disabled="formData.status == 2 || formData.status == 3" />
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="actualPrice" min-width="200" align="center"> <el-table-column prop="actualPrice" min-width="200" align="center">
<template #header>实际金额</template> <template #header>实际</template>
<template #default="scope"> <template #default="scope">
<el-form-item :prop="`${scope.$index}.actualPrice`" class="mb-0px!"> <el-form-item :prop="`${scope.$index}.actualPrice`" class="mb-0px!">
<el-input-number style="width: 100%" v-model="scope.row.actualPrice" placeholder="实际金额" @change="handleEstimatedPrice" :min="0" :precision="6" :disabled="formData.status == 2 || formData.status == 3" /> <el-input-number style="width: 100%" v-model="scope.row.actualPrice" placeholder="实际价" @change="handleEstimatedPrice" :min="0" :precision="6" :disabled="formData.status == 2 || formData.status == 3" />
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
@ -719,24 +719,24 @@ const formRules = reactive({
}) })
const subFormRules = reactive({ const subFormRules = reactive({
matId: [{ required: true, message: '物料编码不能为空', trigger: 'blur' }], matId: [{ required: true, message: '物料编码不能为空', trigger: 'blur' }],
estimatedPrice: [{ required: true, message: '暂估金额不能为空', trigger: 'blur' }], estimatedPrice: [{ required: true, message: '暂估价不能为空', trigger: 'blur' }],
purchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }] purchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }]
}) })
const subBoomFormRules = reactive({ const subBoomFormRules = reactive({
boomName: [{ required: true, message: '零件名称不能为空', trigger: 'blur' }], boomName: [{ required: true, message: '零件名称不能为空', trigger: 'blur' }],
composition: [{ required: true, message: '材质不能为空', trigger: 'blur' }], composition: [{ required: true, message: '材质不能为空', trigger: 'blur' }],
boomPurchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }], boomPurchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }],
boomEstimatedPrice: [{ required: true, message: '暂估金额不能为空', trigger: 'blur' }], boomEstimatedPrice: [{ required: true, message: '暂估价不能为空', trigger: 'blur' }],
boomArriveTime: [{ required: true, message: '预计到货时间不能为空', trigger: 'blur' }], boomArriveTime: [{ required: true, message: '预计到货时间不能为空', trigger: 'blur' }],
}) })
const subMatPlanFormRules = reactive({ const subMatPlanFormRules = reactive({
purchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }], purchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }],
estimatedPrice: [{ required: true, message: '暂估金额不能为空', trigger: 'blur' }] estimatedPrice: [{ required: true, message: '暂估价不能为空', trigger: 'blur' }]
}) })
const subBoomPlanFormRules = reactive({ const subBoomPlanFormRules = reactive({
boomName: [{ required: true, message: '零件名称不能为空', trigger: 'blur' }], boomName: [{ required: true, message: '零件名称不能为空', trigger: 'blur' }],
boomPurchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }], boomPurchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }],
boomEstimatedPrice: [{ required: true, message: '暂估金额不能为空', trigger: 'blur' }] boomEstimatedPrice: [{ required: true, message: '暂估价不能为空', trigger: 'blur' }]
}) })
const formRef = ref() // Ref const formRef = ref() // Ref
const subFormRef = ref() // Ref const subFormRef = ref() // Ref
@ -769,12 +769,12 @@ const handleSelectedMaterialPlanMat = (arr) => {
}); });
}; };
const handleSelectedMaterialPlanBoom =async (arrBoom) => { const handleSelectedMaterialPlanBoom =async (arrBoom) => {
//debugger //debugger
const existingBoomDetailIds = new Set(formData.value.boomItemDOList.map(boom => boom.boomDetailId)); const existingBoomDetailIds = new Set(formData.value.boomItemDOList.map(boom => boom.boomDetailId));
arrBoom.forEach((item) => { arrBoom.forEach((item) => {
if (!existingBoomDetailIds.has(item.boomDetailId)) { if (!existingBoomDetailIds.has(item.boomDetailId)) {
item.description = ''; item.description = '';
// formData.value.boomItemDOList.requireTime = item.boomArriveDate // formData.value.boomItemDOList.requireTime = item.boomArriveDate
// formData.value.boomItemDOList.composition = item.compositionName // formData.value.boomItemDOList.composition = item.compositionName
// formData.value.boomItemDOList.boomName = item.materialName // formData.value.boomItemDOList.boomName = item.materialName
@ -822,7 +822,7 @@ const handleEstimatedPrice = () => {
formData.value.actualPrice = allActualPrice formData.value.actualPrice = allActualPrice
} }
const handleActualPrice = () => { const handleActualPrice = () => {
} }
// ==================== ======================================= // ==================== =======================================
@ -991,7 +991,7 @@ const onAddItem = () => {
} }
const getList = async (arrMat) => { const getList = async (arrMat) => {
arrMat.forEach((row) => { arrMat.forEach((row) => {
if ( formData.value.matItemDOList.filter((item) => item.matId == row.matId).length == 0) if ( formData.value.matItemDOList.filter((item) => item.matId == row.matId).length == 0)
{ {
row.id = undefined row.id = undefined
formData.value.matItemDOList.push(row) formData.value.matItemDOList.push(row)
@ -1212,7 +1212,7 @@ const submitForm = async () => {
} catch (e) { } catch (e) {
return return
} }
// //
formData.value.receivingStatus = 2 formData.value.receivingStatus = 2
formData.value.status = 2 formData.value.status = 2
formData.value.submitUserId = useUserStore().getUser.id formData.value.submitUserId = useUserStore().getUser.id
@ -1259,7 +1259,7 @@ onMounted(async () => {
}) })
formData.value.matItemRemoveList = [] formData.value.matItemRemoveList = []
formData.value.boomItemRemoveList = [] formData.value.boomItemRemoveList = []
// //
formData.value.boomItemDOList = ( formData.value.boomItemDOList = (
@ -1277,7 +1277,7 @@ formData.value.boomItemDOList.forEach((item) => {
item.boomDescription = item.description; item.boomDescription = item.description;
item.materialName = item.boomName; item.materialName = item.boomName;
item.compositionName = item.composition; item.compositionName = item.composition;
// composition // composition
if (Array.isArray(item.composition) && item.composition.length > 0) { if (Array.isArray(item.composition) && item.composition.length > 0) {
item.composition = Number(item.composition); item.composition = Number(item.composition);

View File

@ -179,7 +179,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="price" align="center" min-width="120" v-if="formData.stockInType=='1'"> <el-table-column prop="price" align="center" min-width="120" v-if="formData.stockInType=='1'">
<template #header> <span class="hl-table_header">*</span> 入库 </template> <template #header> <span class="hl-table_header">*</span> 入库</template>
<template #default="scope"> <template #default="scope">
<el-form-item :prop="`${scope.$index}.price`" :rules="subFormRules.price" <el-form-item :prop="`${scope.$index}.price`" :rules="subFormRules.price"
@ -190,7 +190,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="price" align="center" min-width="120" v-if="formData.stockInType!='1'"> <el-table-column prop="price" align="center" min-width="120" v-if="formData.stockInType!='1'">
<template #header>入库 </template> <template #header>入库</template>
<template #default="scope"> <template #default="scope">
<el-form-item :prop="`${scope.$index}.price`" <el-form-item :prop="`${scope.$index}.price`"

View File

@ -41,13 +41,12 @@
<el-table-column label="物料类型" align="center" prop="matType" min-width="120"/> <el-table-column label="物料类型" align="center" prop="matType" min-width="120"/>
<el-table-column label="库存数量" align="center" prop="storageOkQtys" min-width="120"/> <el-table-column label="库存数量" align="center" prop="storageOkQtys" min-width="120"/>
<el-table-column label="库存单位" align="center" prop="matUnit" min-width="120"/> <el-table-column label="库存单位" align="center" prop="matUnit" min-width="120"/>
<el-table-column label="库存金额(元)" align="center" prop="price" min-width="120"> <el-table-column label="库存单价(元)" align="center" prop="price" min-width="120">
<template #default="scope"> <template #default="scope">
<el-input-number v-model="scope.row.price" type="number" :precision="2" /> <el-input-number v-model="scope.row.price" type="number" :precision="2" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="库存金额(元)" align="center" prop="sumKcMoneys" min-width="120"/>
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
<template #default="scope"> <template #default="scope">
<el-button <el-button
@ -121,7 +120,7 @@ const handleQuery = () => {
} }
const updatePrice = async (row) => { const updatePrice = async (row) => {
try { try {
await message.confirm("是否修改当前物料"+row.matName+"库存金额") await message.confirm("是否修改当前物料"+row.matName+"库存单价")
await StorageLogApi.updatePrice(row); await StorageLogApi.updatePrice(row);
message.success(t('修改成功')) message.success(t('修改成功'))
await getList() await getList()