修改入库价格为入库单价
This commit is contained in:
parent
46ee4cbfc9
commit
07d4f77718
@ -157,7 +157,7 @@ public class StorageController {
|
||||
if (ObjectUtil.isEmpty(materialDO.getPrice())){
|
||||
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);
|
||||
materialDO.setPrice(divide);
|
||||
materialMapper.updateById(materialDO);
|
||||
@ -179,7 +179,7 @@ public class StorageController {
|
||||
if (ObjectUtil.isEmpty(materialDO.getPrice())){
|
||||
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);
|
||||
materialDO.setPrice(divide);
|
||||
materialMapper.updateById(materialDO);
|
||||
|
@ -49,7 +49,8 @@ public class StorageLogNowDO extends BaseDO {
|
||||
private Long pnId;
|
||||
private String pnName;
|
||||
private BigDecimal sumKcMoney;
|
||||
|
||||
@TableField(exist = false)
|
||||
private BigDecimal sumKcMoneys;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Long materialTypeId;
|
||||
|
@ -112,7 +112,7 @@ public interface StorageLogNowMapper extends BaseMapperX<StorageLogNowDO> {
|
||||
MPJLambdaWrapper<StorageLogNowDO> query = new MPJLambdaWrapper<>();
|
||||
|
||||
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)
|
||||
.groupBy(StorageLogNowDO::getMatCode)
|
||||
.orderByDesc(StorageLogNowDO::getId);
|
||||
|
@ -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" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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="estimatedPrice" 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="description" min-width="180" />
|
||||
<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>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="right" fixed="right" min-width="200">
|
||||
<template #header>
|
||||
<span style="margin-right: 30%">操作</span>
|
||||
<template #header>
|
||||
<span style="margin-right: 30%">操作</span>
|
||||
</template>
|
||||
<template #default="scope">
|
||||
<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
|
||||
try {
|
||||
const route = useRoute();
|
||||
|
||||
|
||||
if(route){
|
||||
const idid = route.query.idid;
|
||||
queryParams.purchaseNo=idid
|
||||
queryParams.purchaseNo=idid
|
||||
}
|
||||
|
||||
|
||||
const data = await PurchaseOrderApi.getPurchaseOrderPageByStatus(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
|
@ -168,21 +168,21 @@
|
||||
</el-table-column>
|
||||
<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">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="actualPrice" min-width="200" align="center">
|
||||
|
||||
<template #header>实际价金额</template>
|
||||
<template #header>实际单价</template>
|
||||
|
||||
<template #default="scope">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -275,21 +275,21 @@
|
||||
</el-table-column>
|
||||
<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">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="actualPrice" min-width="200" align="center">
|
||||
|
||||
<template #header>实际价金额</template>
|
||||
<template #header>实际单价</template>
|
||||
|
||||
<template #default="scope">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -385,21 +385,21 @@
|
||||
</el-table-column>
|
||||
<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">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="boomActualPrice" min-width="200" align="center">
|
||||
|
||||
<template #header>实际价</template>
|
||||
<template #header>实际单价</template>
|
||||
|
||||
<template #default="scope">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -487,18 +487,18 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="actualPrice" min-width="200" align="center">
|
||||
<template #header>实际价金额</template>
|
||||
<template #header>实际单价</template>
|
||||
<template #default="scope">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -698,21 +698,21 @@ const formRules = reactive({
|
||||
})
|
||||
const subFormRules = reactive({
|
||||
matId: [{ required: true, message: '物料编码不能为空', trigger: 'blur' }],
|
||||
estimatedPrice: [{ required: true, message: '暂估价金额不能为空', trigger: 'blur' }],
|
||||
estimatedPrice: [{ required: true, message: '暂估单价不能为空', trigger: 'blur' }],
|
||||
purchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const subBoomFormRules = reactive({
|
||||
boomName: [{ 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({
|
||||
purchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }],
|
||||
estimatedPrice: [{ required: true, message: '暂估价金额不能为空', trigger: 'blur' }]
|
||||
estimatedPrice: [{ required: true, message: '暂估单价不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const subBoomPlanFormRules = reactive({
|
||||
boomPurchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }],
|
||||
boomEstimatedPrice: [{ required: true, message: '暂估价金额不能为空', trigger: 'blur' }]
|
||||
boomEstimatedPrice: [{ required: true, message: '暂估单价不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
const subFormRef = ref() // 表单 Ref
|
||||
@ -1146,7 +1146,7 @@ formData.value.boomItemDOList.forEach((item) => {
|
||||
item.boomDescription = item.description;
|
||||
item.materialName = item.boomName;
|
||||
item.compositionName = item.composition;
|
||||
|
||||
|
||||
// 确保 composition 是一个有效的数组
|
||||
if (Array.isArray(item.composition) && item.composition.length > 0) {
|
||||
item.composition = Number(item.composition);
|
||||
|
@ -178,18 +178,18 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="actualPrice" min-width="200" align="center">
|
||||
<template #header>实际价金额</template>
|
||||
<template #header>实际单价</template>
|
||||
<template #default="scope">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -281,21 +281,21 @@
|
||||
</el-table-column>
|
||||
<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">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="actualPrice" min-width="200" align="center">
|
||||
|
||||
<template #header>实际价金额</template>
|
||||
<template #header>实际单价</template>
|
||||
|
||||
<template #default="scope">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -391,21 +391,21 @@
|
||||
</el-table-column>
|
||||
<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">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="boomActualPrice" min-width="200" align="center">
|
||||
|
||||
<template #header>实际价</template>
|
||||
<template #header>实际单价</template>
|
||||
|
||||
<template #default="scope">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -488,18 +488,18 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="actualPrice" min-width="200" align="center">
|
||||
<template #header>实际价金额</template>
|
||||
<template #header>实际单价</template>
|
||||
<template #default="scope">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -711,24 +711,24 @@ const formRules = reactive({
|
||||
})
|
||||
const subFormRules = reactive({
|
||||
matId: [{ required: true, message: '物料编码不能为空', trigger: 'blur' }],
|
||||
estimatedPrice: [{ required: true, message: '暂估价金额不能为空', trigger: 'blur' }],
|
||||
estimatedPrice: [{ required: true, message: '暂估单价不能为空', trigger: 'blur' }],
|
||||
purchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const subBoomFormRules = reactive({
|
||||
boomName: [{ required: true, message: '零件名称不能为空', trigger: 'blur' }],
|
||||
composition: [{ 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' }],
|
||||
})
|
||||
const subMatPlanFormRules = reactive({
|
||||
purchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }],
|
||||
estimatedPrice: [{ required: true, message: '暂估价金额不能为空', trigger: 'blur' }]
|
||||
estimatedPrice: [{ required: true, message: '暂估单价不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const subBoomPlanFormRules = reactive({
|
||||
boomName: [{ 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 subFormRef = ref() // 表单 Ref
|
||||
@ -759,12 +759,12 @@ const handleSelectedMaterialPlanMat = (arr) => {
|
||||
});
|
||||
};
|
||||
const handleSelectedMaterialPlanBoom =async (arrBoom) => {
|
||||
//debugger
|
||||
//debugger
|
||||
const existingBoomDetailIds = new Set(formData.value.boomItemDOList.map(boom => boom.boomDetailId));
|
||||
|
||||
arrBoom.forEach((item) => {
|
||||
if (!existingBoomDetailIds.has(item.boomDetailId)) {
|
||||
item.description = '';
|
||||
item.description = '';
|
||||
// formData.value.boomItemDOList.requireTime = item.boomArriveDate
|
||||
// formData.value.boomItemDOList.composition = item.compositionName
|
||||
// formData.value.boomItemDOList.boomName = item.materialName
|
||||
@ -812,7 +812,7 @@ const handleEstimatedPrice = () => {
|
||||
formData.value.actualPrice = allActualPrice
|
||||
}
|
||||
const handleActualPrice = () => {
|
||||
|
||||
|
||||
}
|
||||
|
||||
// ====================附件信息 开始=======================================
|
||||
@ -981,7 +981,7 @@ const onAddItem = () => {
|
||||
}
|
||||
const getList = async (arrMat) => {
|
||||
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
|
||||
formData.value.matItemDOList.push(row)
|
||||
@ -1180,7 +1180,7 @@ const submitForm = async () => {
|
||||
} catch (e) {
|
||||
return
|
||||
}
|
||||
// 计划状态为已送审
|
||||
// 计划状态为已送审
|
||||
formData.value.receivingStatus = 2
|
||||
formData.value.status = 2
|
||||
formData.value.submitUserId = useUserStore().getUser.id
|
||||
@ -1227,7 +1227,7 @@ onMounted(async () => {
|
||||
})
|
||||
formData.value.matItemRemoveList = []
|
||||
formData.value.boomItemRemoveList = []
|
||||
|
||||
|
||||
|
||||
// 获取采购订单数据
|
||||
formData.value.boomItemDOList = (
|
||||
@ -1245,7 +1245,7 @@ formData.value.boomItemDOList.forEach((item) => {
|
||||
item.boomDescription = item.description;
|
||||
item.materialName = item.boomName;
|
||||
item.compositionName = item.composition;
|
||||
|
||||
|
||||
// 确保 composition 是一个有效的数组
|
||||
if (Array.isArray(item.composition) && item.composition.length > 0) {
|
||||
item.composition = Number(item.composition);
|
||||
|
@ -177,18 +177,18 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="actualPrice" min-width="200" align="center">
|
||||
<template #header>实际价金额</template>
|
||||
<template #header>实际单价</template>
|
||||
<template #default="scope">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -281,21 +281,21 @@
|
||||
|
||||
<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">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="actualPrice" min-width="200" align="center">
|
||||
|
||||
<template #header>实际价金额</template>
|
||||
<template #header>实际单价</template>
|
||||
|
||||
<template #default="scope">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -391,21 +391,21 @@
|
||||
</el-table-column>
|
||||
<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">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="boomActualPrice" min-width="200" align="center">
|
||||
|
||||
<template #header>实际价</template>
|
||||
<template #header>实际单价</template>
|
||||
|
||||
<template #default="scope">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -488,18 +488,18 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="actualPrice" min-width="200" align="center">
|
||||
<template #header>实际价金额</template>
|
||||
<template #header>实际单价</template>
|
||||
<template #default="scope">
|
||||
<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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -719,24 +719,24 @@ const formRules = reactive({
|
||||
})
|
||||
const subFormRules = reactive({
|
||||
matId: [{ required: true, message: '物料编码不能为空', trigger: 'blur' }],
|
||||
estimatedPrice: [{ required: true, message: '暂估价金额不能为空', trigger: 'blur' }],
|
||||
estimatedPrice: [{ required: true, message: '暂估单价不能为空', trigger: 'blur' }],
|
||||
purchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const subBoomFormRules = reactive({
|
||||
boomName: [{ required: true, message: '零件名称不能为空', trigger: 'blur' }],
|
||||
composition: [{ 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' }],
|
||||
})
|
||||
const subMatPlanFormRules = reactive({
|
||||
purchaseAmount: [{ required: true, message: '采购数量不能为空', trigger: 'blur' }],
|
||||
estimatedPrice: [{ required: true, message: '暂估价金额不能为空', trigger: 'blur' }]
|
||||
estimatedPrice: [{ required: true, message: '暂估单价不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const subBoomPlanFormRules = reactive({
|
||||
boomName: [{ 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 subFormRef = ref() // 表单 Ref
|
||||
@ -769,12 +769,12 @@ const handleSelectedMaterialPlanMat = (arr) => {
|
||||
});
|
||||
};
|
||||
const handleSelectedMaterialPlanBoom =async (arrBoom) => {
|
||||
//debugger
|
||||
//debugger
|
||||
const existingBoomDetailIds = new Set(formData.value.boomItemDOList.map(boom => boom.boomDetailId));
|
||||
|
||||
arrBoom.forEach((item) => {
|
||||
if (!existingBoomDetailIds.has(item.boomDetailId)) {
|
||||
item.description = '';
|
||||
item.description = '';
|
||||
// formData.value.boomItemDOList.requireTime = item.boomArriveDate
|
||||
// formData.value.boomItemDOList.composition = item.compositionName
|
||||
// formData.value.boomItemDOList.boomName = item.materialName
|
||||
@ -822,7 +822,7 @@ const handleEstimatedPrice = () => {
|
||||
formData.value.actualPrice = allActualPrice
|
||||
}
|
||||
const handleActualPrice = () => {
|
||||
|
||||
|
||||
}
|
||||
|
||||
// ====================附件信息 开始=======================================
|
||||
@ -991,7 +991,7 @@ const onAddItem = () => {
|
||||
}
|
||||
const getList = async (arrMat) => {
|
||||
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
|
||||
formData.value.matItemDOList.push(row)
|
||||
@ -1212,7 +1212,7 @@ const submitForm = async () => {
|
||||
} catch (e) {
|
||||
return
|
||||
}
|
||||
// 计划状态为已送审
|
||||
// 计划状态为已送审
|
||||
formData.value.receivingStatus = 2
|
||||
formData.value.status = 2
|
||||
formData.value.submitUserId = useUserStore().getUser.id
|
||||
@ -1259,7 +1259,7 @@ onMounted(async () => {
|
||||
})
|
||||
formData.value.matItemRemoveList = []
|
||||
formData.value.boomItemRemoveList = []
|
||||
|
||||
|
||||
|
||||
// 获取采购订单数据
|
||||
formData.value.boomItemDOList = (
|
||||
@ -1277,7 +1277,7 @@ formData.value.boomItemDOList.forEach((item) => {
|
||||
item.boomDescription = item.description;
|
||||
item.materialName = item.boomName;
|
||||
item.compositionName = item.composition;
|
||||
|
||||
|
||||
// 确保 composition 是一个有效的数组
|
||||
if (Array.isArray(item.composition) && item.composition.length > 0) {
|
||||
item.composition = Number(item.composition);
|
||||
|
@ -179,7 +179,7 @@
|
||||
</el-table-column>
|
||||
<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">
|
||||
<el-form-item :prop="`${scope.$index}.price`" :rules="subFormRules.price"
|
||||
@ -190,7 +190,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="price" align="center" min-width="120" v-if="formData.stockInType!='1'">
|
||||
|
||||
<template #header>入库价格 </template>
|
||||
<template #header>入库单价 </template>
|
||||
|
||||
<template #default="scope">
|
||||
<el-form-item :prop="`${scope.$index}.price`"
|
||||
|
@ -41,13 +41,12 @@
|
||||
<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="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">
|
||||
<el-input-number v-model="scope.row.price" type="number" :precision="2" />
|
||||
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="库存金额(元)" align="center" prop="sumKcMoneys" min-width="120"/>
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
@ -121,7 +120,7 @@ const handleQuery = () => {
|
||||
}
|
||||
const updatePrice = async (row) => {
|
||||
try {
|
||||
await message.confirm("是否修改当前物料"+row.matName+"库存金额?")
|
||||
await message.confirm("是否修改当前物料"+row.matName+"库存单价?")
|
||||
await StorageLogApi.updatePrice(row);
|
||||
message.success(t('修改成功'))
|
||||
await getList()
|
||||
|
Loading…
Reference in New Issue
Block a user