入库问题修改
This commit is contained in:
parent
37c3d0e4d3
commit
a418613ecd
@ -47,9 +47,7 @@ public interface StorageMaterialMapper extends BaseMapperX<StorageMaterialDO> {
|
||||
|
||||
query.selectAll(StorageMaterialDO.class)
|
||||
.select("ifnull(sum(t.storage_ok_qty),0) mat_rest")
|
||||
.select("count(t.id) num")
|
||||
|
||||
.orderByDesc(StorageMaterialDO::getId);
|
||||
.select("count(t.id) num");
|
||||
|
||||
query.like(!StringUtils.isEmpty(reqVO.getMatType()),StorageMaterialDO::getMatType, reqVO.getMatType())
|
||||
.like(!StringUtils.isEmpty(reqVO.getMatSpec()),StorageMaterialDO::getMatSpec, reqVO.getMatSpec())
|
||||
@ -57,7 +55,11 @@ public interface StorageMaterialMapper extends BaseMapperX<StorageMaterialDO> {
|
||||
.like(!StringUtils.isEmpty(reqVO.getMatCode()), StorageMaterialDO::getMatCode, reqVO.getMatCode())
|
||||
.like(!StringUtils.isEmpty(reqVO.getLotNo()),StorageMaterialDO::getLotNo, reqVO.getLotNo())
|
||||
.eq(reqVO.getWhId()!=null,StorageMaterialDO::getWhId,reqVO.getWhId())
|
||||
.groupBy(StorageMaterialDO::getId).orderByDesc(StorageMaterialDO::getId);
|
||||
.groupBy(StorageMaterialDO::getMatCode)
|
||||
.groupBy(StorageMaterialDO::getWhId)
|
||||
.groupBy(StorageMaterialDO::getPnId)
|
||||
.groupBy(StorageMaterialDO::getRgId)
|
||||
.orderByDesc(StorageMaterialDO::getId);
|
||||
|
||||
return selectPage(reqVO,query);
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<el-card class="hl-card" style="position: relative">
|
||||
<template #header>
|
||||
<span>详情页</span>
|
||||
<span>编辑页</span>
|
||||
</template>
|
||||
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="160px" v-loading="formLoading">
|
||||
<!-- 基础信息 -->
|
||||
@ -44,7 +44,7 @@
|
||||
<el-row>
|
||||
<el-col :span="80">
|
||||
<el-form-item label="备注" prop="description">
|
||||
<el-input class="!w-713px" type="textarea" v-model="formData.description" show-word-limit disabled maxlength="200" />
|
||||
<el-input class="!w-713px" type="textarea" v-model="formData.description" show-word-limit :disabled="formData.status == 2 || formData.status == 3" maxlength="200" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -116,7 +116,7 @@
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="采购合同号" prop="contractNo">
|
||||
<el-input class="!w-265px" v-model="formData.contractNo" placeholder="采购合同号" disabled />
|
||||
<el-input class="!w-265px" v-model="formData.contractNo" placeholder="采购合同号" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -135,7 +135,7 @@
|
||||
</el-card>
|
||||
|
||||
<!-- 物料信息-非计划 -->
|
||||
<el-card class="hl-card-info" v-if="formData.purchaseType == 2 && formData.goodsType == 1">
|
||||
<el-card class="hl-card-info" v-if="(formData.purchaseType == 2||formData.purchaseType == 3) && formData.goodsType == 1">
|
||||
|
||||
<template #header>
|
||||
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">物料信息</span>
|
||||
@ -155,20 +155,19 @@
|
||||
|
||||
<template #default="scope">
|
||||
<el-form-item :prop="`${scope.$index}.matId`" :rules="subFormRules.matId" class="mb-0px!">
|
||||
<MaterialSelect :key="scope.row.matId" v-model="scope.row.matId" v-binddisabled @update:newValue="handleSelectedMaterial(scope.$index, $event)" />
|
||||
<MaterialSelect :key="scope.row.matId" v-model="scope.row.matId" v-bind:disabled="formData.status == 2 || formData.status == 3" @update:newValue="handleSelectedMaterial(scope.$index, $event)" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<!-- <el-table-column prop="matName" label="物料名称" min-width="120" align="center" /> -->
|
||||
|
||||
<el-table-column prop="matName" label="物料名称" min-width="200" align="center" />
|
||||
<el-table-column prop="matType" label="物料类型" min-width="120" align="center">
|
||||
<!-- <template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.HELI_MATERIAL_TYPE" :value="scope.row.matType" v-if="scope.row.matType ? true : false" />
|
||||
</template> -->
|
||||
<!-- <template #default="scope">-->
|
||||
<!-- <dict-tag :type="DICT_TYPE.HELI_MATERIAL_TYPE" :value="scope.row.matType" v-if="scope.row.matType ? true : false" />-->
|
||||
<!-- </template>-->
|
||||
</el-table-column>
|
||||
<el-table-column prop="matSpec" label="规格型号" min-width="120" align="center" />
|
||||
<el-table-column prop="matRest" label="库存数量" min-width="180" align="center" />
|
||||
<el-table-column prop="matRest" label="库存数量" min-width="100" align="center" />
|
||||
<el-table-column prop="purchaseAmount" min-width="180" align="center">
|
||||
<template #header><span class="hl-table_header">*</span>采购数量</template>
|
||||
<template #default="scope">
|
||||
@ -181,7 +180,7 @@
|
||||
<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>
|
||||
@ -201,7 +200,7 @@
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="matId" min-width="200" align="center" fixed>
|
||||
<el-table-column prop="matId" min-width="220" align="center" >
|
||||
<template #header> <span class="hl-table_header">*</span> 物料编码</template>
|
||||
<template #default="scope">
|
||||
<el-form-item :prop="`${scope.$index}.matId`" :rules="subFormRules.matId" class="mb-0px!">
|
||||
@ -215,9 +214,9 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="matUnit" label="系统单位" min-width="100" align="center">
|
||||
<!-- <template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.HELI_MATERIAL_UNIT" :value="scope.row.matUnit" v-if="scope.row.matUnit ? true : false" />
|
||||
</template> -->
|
||||
<!-- <template #default="scope">-->
|
||||
<!-- <dict-tag :type="DICT_TYPE.HELI_MATERIAL_UNIT" :value="scope.row.matUnit" v-if="scope.row.matUnit ? true : false" />-->
|
||||
<!-- </template>-->
|
||||
</el-table-column>
|
||||
<el-table-column prop="description" min-width="180" label="备注" align="center">
|
||||
<template #default="scope">
|
||||
@ -264,11 +263,11 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="matType" label="物料类型" min-width="120" align="center">
|
||||
|
||||
<!-- <template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.HELI_MATERIAL_TYPE" :value="scope.row.matType" v-if="scope.row.matType ? true : false" />
|
||||
</template> -->
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.HELI_MATERIAL_TYPE" :value="scope.row.matType" v-if="typeof scope.row.matUnit === 'number'"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="matSpec" label="规格型号" min-width="120" align="center" />
|
||||
<el-table-column prop="matSpec" label="规格/型号" min-width="120" align="center" />
|
||||
<el-table-column prop="requireAmount" label="需求数量" min-width="100" align="center" />
|
||||
<el-table-column prop="matRest" label="库存数量" min-width="100" align="center" />
|
||||
<el-table-column prop="purchaseAmount" min-width="180" align="center">
|
||||
@ -279,6 +278,7 @@
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="estimatedPrice" min-width="200" align="center">
|
||||
|
||||
<template #header><span class="hl-table_header">*</span>暂估单价</template>
|
||||
@ -309,7 +309,7 @@
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="requireArriveTime" label="需求到货日期(最早)" min-width="180" align="center">
|
||||
<el-table-column prop="requireArriveTime" label="需求到货日期(最早)" min-width="200" align="center">
|
||||
<template #default="scope">
|
||||
{{
|
||||
formatDate(scope.row.requireArriveTime, 'YYYY-MM-DD')
|
||||
@ -317,9 +317,9 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="matUnit" label="系统单位" min-width="100" align="center">
|
||||
<!-- <template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.HELI_MATERIAL_UNIT" :value="scope.row.matUnit" v-if="scope.row.matUnit ? true : false" />
|
||||
</template> -->
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.HELI_MATERIAL_UNIT" :value="scope.row.matUnit" v-if="typeof scope.row.matUnit === 'number'"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="description" min-width="180" label="备注" align="center">
|
||||
|
||||
@ -427,7 +427,7 @@
|
||||
<el-table-column prop="boomDescription" min-width="180" label="备注" align="center">
|
||||
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.boomDescription" disabled />
|
||||
<el-input v-model="scope.row.boomDescription" disabled/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" min-width="100">
|
||||
@ -478,7 +478,7 @@
|
||||
</el-form-item>
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<el-table-column prop="boomAmount" label="需求数量" min-width="180" align="center" />
|
||||
<el-table-column prop="boomAmount" label="需求数量" min-width="100" align="center" />
|
||||
<el-table-column prop="purchaseAmount" min-width="180" align="center">
|
||||
<template #header><span class="hl-table_header">*</span>采购数量</template>
|
||||
<template #default="scope">
|
||||
@ -491,7 +491,7 @@
|
||||
<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>
|
||||
@ -503,26 +503,28 @@
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="boomArriveDate" label="需求到货日期(最早)" min-width="180" align="center">
|
||||
<template #default="scope">
|
||||
{{
|
||||
formatDate(scope.row.boomArriveDate, 'YYYY-MM-DD')
|
||||
}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column min-width="180" prop="arriveTime" align="center">
|
||||
<template #header> <span class="hl-table_header">*</span>预计到货日期 </template>
|
||||
<el-table-column min-width="200" prop="arriveTime" align="center">
|
||||
<template #header> <span class="hl-table_header">*</span>预计到货日期</template>
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.arriveTime`" class="mb-0px!">
|
||||
<el-date-picker v-model="row.arriveTime" type="date" value-format="x" placeholder="预计到货日期" disabled />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="boomArriveDate" label="需求到货日期(最早)" min-width="200" align="center">
|
||||
<template #default="scope">
|
||||
{{
|
||||
formatDate(scope.row.boomArriveDate, 'YYYY-MM-DD')
|
||||
}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="boomUnit" label="系统单位" min-width="100" align="center">
|
||||
<template #default="scope">
|
||||
<el-select v-model="scope.row.boomUnit" placeholder="下拉选择" clearable disabled>
|
||||
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.HELI_MATERIAL_UNIT)" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
<!-- <el-select v-model="scope.row.boomUnit" placeholder="下拉选择" clearable :disabled="formData.status == 2 || formData.status == 3">-->
|
||||
<!-- <el-option v-for="dict in getIntDictOptions(DICT_TYPE.HELI_MATERIAL_UNIT)" :key="dict.value" :label="dict.label" :value="dict.value" />-->
|
||||
<!-- </el-select>-->
|
||||
<dict-tag :type="DICT_TYPE.HELI_MATERIAL_UNIT" :value="scope.row.boomUnit" v-if="scope.row.boomUnit ? true : false" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="description" min-width="180" label="备注" align="center">
|
||||
@ -555,7 +557,7 @@
|
||||
<el-card class="hl-incard">
|
||||
<el-col>
|
||||
<el-upload
|
||||
ref="matUploadRef" :file-list="matUploadFiles" multiple :action="uploadUrl" :headers="{
|
||||
ref="matUploadRef" :file-list="matUploadFiles" multiple :action="uploadUrl" :headers="{
|
||||
Authorization: 'Bearer ' + getAccessToken(),
|
||||
'tenant-id': getTenantId()
|
||||
}" name="files" :show-file-list="false" :auto-upload="false" :data="matUploadData" :on-change="matUploadChange" :on-error="handleError" :on-success="handleSuccess" :before-upload="before" class="upload-file-uploader">
|
||||
@ -636,19 +638,11 @@ ref="matUploadRef" :file-list="matUploadFiles" multiple :action="uploadUrl" :hea
|
||||
|
||||
</el-form>
|
||||
<div class="hl-footer text-center">
|
||||
<!-- <el-button @click="closeForm" size="large">取 消</el-button> -->
|
||||
<!-- <el-button @click="deleteForm" type="danger" size="large" v-if="formData.status == 1 || formData.status == 4">删
|
||||
除</el-button>
|
||||
<el-button @click="saveForm" type="primary" size="large" v-if="formData.status !== 2 && formData.status !== 3">保
|
||||
存</el-button>
|
||||
<el-button @click="submitForm" type="success" size="large" v-if="formData.status !== 2 && formData.status !== 3">送
|
||||
审</el-button> -->
|
||||
<el-button @click="closeForm" size="large">取 消</el-button>
|
||||
|
||||
</div>
|
||||
</el-card>
|
||||
<!-- 表单弹窗:物料列表 -->
|
||||
<materials ref="matOpenFormRef" @success="getList" />
|
||||
<MaterialDialog ref="materialDialog" @success="handleSelectedMaterialPlanMat" />
|
||||
<BoomDialog ref="boomDialog" @success="handleSelectedMaterialPlanBoom" />
|
||||
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@ -673,6 +667,7 @@ import materials from '@/views/heli/storage/materials.vue'
|
||||
import MaterialDialog from '@/views/heli/purchaseorder/materialDialog.vue'
|
||||
import BoomDialog from '@/views/heli/purchaseorder/boomDialog.vue'
|
||||
import SupplierSelect from '@/views/heli/hlvuestyle/supplierSelect.vue'
|
||||
import {setFlagsFromString} from "node:v8";
|
||||
|
||||
const reload: any = inject('reload')
|
||||
const { t } = useI18n() // 国际化
|
||||
@ -704,7 +699,12 @@ const formData = ref({
|
||||
matItemRemoveList: [],
|
||||
boomItemDOList: [],
|
||||
boomItemRemoveList: [],
|
||||
attachments: []
|
||||
attachments: [],
|
||||
creator:undefined,
|
||||
submitUserId:undefined,
|
||||
submitTime:undefined,
|
||||
auditor:undefined,
|
||||
auditTime:undefined,
|
||||
})
|
||||
const formRules = reactive({
|
||||
currencyType: [{ required: true, message: '结算币种不能为空', trigger: 'blur' }]
|
||||
@ -753,6 +753,8 @@ const handleSelectedMaterialPlanMat = (arr) => {
|
||||
arr.forEach((item) => {
|
||||
if (!existingMatIds.has(item.matId)) {
|
||||
item.description = '';
|
||||
item.matType=Number(item.matType)
|
||||
item.matUnit=Number(item.matUnit)
|
||||
formData.value.matItemDOList.push(item);
|
||||
existingMatIds.add(item.matId); // 将新添加的 matId 加入 Set
|
||||
}
|
||||
@ -795,7 +797,7 @@ const handleEstimatedPrice = () => {
|
||||
})
|
||||
|
||||
formData.value.boomItemDOList.forEach((item) => {
|
||||
allEstimatePrice += ((item.boomPurchaseAmount==null || item.boomPurchaseAmount==undefined)?0:item.boomPurchaseAmount)*((item.boomEstimatedPrice==null || item.boomEstimatedPrice==undefined)?0:item.boomEstimatedPrice)
|
||||
allEstimatePrice += ((item.purchaseAmount==null || item.purchaseAmount==undefined)?0:item.purchaseAmount)*((item.estimatedPrice==null || item.estimatedPrice==undefined)?0:item.estimatedPrice)
|
||||
})
|
||||
|
||||
formData.value.estimatedPrice = allEstimatePrice
|
||||
@ -806,7 +808,7 @@ const handleEstimatedPrice = () => {
|
||||
})
|
||||
|
||||
formData.value.boomItemDOList.forEach((item) => {
|
||||
allActualPrice += ((item.boomPurchaseAmount==null || item.boomPurchaseAmount==undefined)?0:item.boomPurchaseAmount)*((item.boomActualPrice==null || item.boomActualPrice==undefined)?0:item.boomActualPrice)
|
||||
allActualPrice += ((item.purchaseAmount==null || item.purchaseAmount==undefined)?0:item.purchaseAmount)*((item.actualPrice==null || item.actualPrice==undefined)?0:item.actualPrice)
|
||||
})
|
||||
|
||||
formData.value.actualPrice = allActualPrice
|
||||
@ -1115,6 +1117,28 @@ const saveForm = async () => {
|
||||
} catch (e) {
|
||||
return
|
||||
}
|
||||
let flag=false
|
||||
if (formData.value.purchaseType==1&&formData.value.goodsType==1){
|
||||
for (var i=0;i<formData.value.matItemDOList.length;i++){
|
||||
const requireAmount = formData.value.matItemDOList[i].requireAmount;
|
||||
const purchaseAmount = formData.value.matItemDOList[i].purchaseAmount;
|
||||
if (requireAmount!=purchaseAmount){
|
||||
flag=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (formData.value.purchaseType==1&&formData.value.goodsType==2){
|
||||
for (var i=0;i<formData.value.boomItemDOList.length;i++){
|
||||
const requireAmount = formData.value.boomItemDOList[i].boomAmount;
|
||||
const purchaseAmount = formData.value.boomItemDOList[i].purchaseAmount;
|
||||
if (requireAmount!=purchaseAmount){
|
||||
flag=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flag){
|
||||
await message.confirm('需求数量和采购数量不一致,是否继续?')
|
||||
}
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
@ -1230,12 +1254,12 @@ onMounted(async () => {
|
||||
|
||||
|
||||
// 获取采购订单数据
|
||||
formData.value.boomItemDOList = (
|
||||
formData.value.boomItemDOList = (
|
||||
await PurchaseOrderBoomApi.getPurchaseOrderBoomPage(queryParams)
|
||||
).list;
|
||||
).list;
|
||||
|
||||
// 遍历每个 item,进行属性赋值
|
||||
formData.value.boomItemDOList.forEach((item) => {
|
||||
formData.value.boomItemDOList.forEach((item) => {
|
||||
if (item) { // 确保 item 存在
|
||||
item.boomPurchaseAmount = item.purchaseAmount;
|
||||
item.boomEstimatedPrice = item.estimatedPrice;
|
||||
@ -1251,7 +1275,7 @@ formData.value.boomItemDOList.forEach((item) => {
|
||||
item.composition = Number(item.composition);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
// 获取加工件列表
|
||||
// formData.value.boomItemDOList = (
|
||||
// await PurchaseOrderBoomApi.getPurchaseOrderBoomPage(queryParams)
|
||||
|
Loading…
Reference in New Issue
Block a user