修改入库价格为入库单价

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">

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

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

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

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()