出库信息保存

出库信息保存
pull/1/head
siontion 9 months ago
parent c081840950
commit 84c0d785f2

@ -27,11 +27,13 @@ public class StorageMatValidRespVO {
private String lotNo; private String lotNo;
private String spec; private String matSpec;
private String unit; private String matUnit;
private String storageOkQty; private String storageOkQty;
private String description;
} }

@ -16,13 +16,13 @@
<result property="whId" column="wh_id"/> <result property="whId" column="wh_id"/>
<result property="rgId" column="rg_id"/> <result property="rgId" column="rg_id"/>
<result property="pnId" column="pn_id"/> <result property="pnId" column="pn_id"/>
<result property="spec" column="spec"/> <result property="matSpec" column="mat_spec"/>
<result property="unit" column="unit"/> <result property="matUnit" column="mat_unit"/>
<result property="lotNo" column="lot_no"/> <result property="lotNo" column="lot_no"/>
<result property="matRest" column="mat_rest"/> <result property="matRest" column="mat_rest"/>
<result property="storageOkQty" column="storage_ok_qty"/> <result property="storageOkQty" column="storage_ok_qty"/>
</resultMap> </resultMap>
<select id="selectStorageMatValid" resultType="com.chanko.yunxi.mes.module.heli.controller.admin.storagemat.vo.StorageMatValidRespVO"> <select id="selectStorageMatValid" resultType="com.chanko.yunxi.mes.module.heli.controller.admin.storagemat.vo.StorageMatValidRespVO">
select mat_id,mat_name,mat_code,mat_rest,material_type,wh_id,rg_id,pn_id,spec,unit,lot_no,storage_ok_qty from v_storage_material_amount where mat_rest > 0 select mat_id,mat_name,mat_code,mat_rest,material_type,wh_id,rg_id,pn_id,spec as mat_spec,unit as mat_unit,lot_no,storage_ok_qty from v_storage_material_amount where mat_rest > 0
</select> </select>
</mapper> </mapper>

@ -3,7 +3,8 @@
<template #header> <template #header>
<span v-text="dialogTitle"></span> <span v-text="dialogTitle"></span>
</template> </template>
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="100px" v-loading="formLoading" v-bind:disabled="isShowBtnOther"> <el-form ref="formRef" :model="formData" :rules="formRules" label-width="100px" v-loading="formLoading"
v-bind:disabled="isShowBtnOther">
<!-- 基础信息 --> <!-- 基础信息 -->
<el-card class="hl-card-info"> <el-card class="hl-card-info">
<template #header> <template #header>
@ -62,7 +63,8 @@
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item prop="whId" label="出库仓库" required> <el-form-item prop="whId" label="出库仓库" required>
<el-select v-model="formData.whId" placeholder="下拉选择" clearable class="!w-400px" @change="handleWh" v-bind:disabled="btnWhClickable"> <el-select v-model="formData.whId" placeholder="下拉选择" clearable class="!w-400px" @change="handleWh"
v-bind:disabled="btnWhClickable">
<el-option v-for="dict in warehouseList" :key="dict.id" :label="dict.whName" :value="dict.id" /> <el-option v-for="dict in warehouseList" :key="dict.id" :label="dict.whName" :value="dict.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -95,7 +97,7 @@
v-loading="subFormLoading" label-width="0"> v-loading="subFormLoading" label-width="0">
<el-table :data="formData.matItemDOList" class="hl-table"> <el-table :data="formData.matItemDOList" class="hl-table">
<el-table-column prop="cid" label="序号" :width="80" /> <el-table-column prop="cid" label="序号" :width="80" />
<el-table-column prop="matId" label="物料名称"> <el-table-column prop="matId" label="物料名称" :width="150">
<template #default="scope"> <template #default="scope">
<el-form-item :prop="`${scope.$index}.matId`" :rules="subFormRules.matId" class="mb-0px!"> <el-form-item :prop="`${scope.$index}.matId`" :rules="subFormRules.matId" class="mb-0px!">
<el-select v-model="scope.row.matId" placeholder="物料编码" :remote-method="remoteMatCodeSearch" <el-select v-model="scope.row.matId" placeholder="物料编码" :remote-method="remoteMatCodeSearch"
@ -124,7 +126,7 @@
<el-table-column prop="rgId" width="140" label="出库库区" required> <el-table-column prop="rgId" width="140" label="出库库区" required>
<template #default="scope"> <template #default="scope">
<el-form-item :prop="`${scope.$index}.rgId`" :rules="subFormRules.rgId" class="mb-0px!"> <el-form-item :prop="`${scope.$index}.rgId`" :rules="subFormRules.rgId" class="mb-0px!">
<el-select v-model="scope.row.rgId" placeholder="" style="width: 100%" @change="handleRg(scope)" disabled> <el-select v-model="scope.row.rgId" placeholder="" style="width: 100%" @change="handleRg(scope)">
<el-option v-for="dict in rgList" :key="dict.id" :label="dict.rgName" :value="dict.id" /> <el-option v-for="dict in rgList" :key="dict.id" :label="dict.rgName" :value="dict.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -141,7 +143,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="matRest" label="库存数量" /> <el-table-column prop="matRest" label="库存数量" />
<el-table-column prop="matRest" width="120" label="出库数量" required> <el-table-column prop="storageOkQty" width="120" label="出库数量" required>
<template #default="scope"> <template #default="scope">
<el-input v-model="scope.row.storageOkQty" /> <el-input v-model="scope.row.storageOkQty" />
</template> </template>
@ -163,7 +165,8 @@
</el-button> </el-button>
<el-button link type="primary" @click="handlefuke(scope.$index, scope.row)">复制</el-button> --> <el-button link type="primary" @click="handlefuke(scope.$index, scope.row)">复制</el-button> -->
<el-button link type="danger" size="small" @click.prevent="handleDelete2(scope.$index)" v-bind:disabled="isShowBtnOther"> <el-button link type="danger" size="small" @click.prevent="handleDelete2(scope.$index)"
v-bind:disabled="isShowBtnOther">
删除 删除
</el-button> </el-button>
</template> </template>
@ -465,6 +468,7 @@ const submitForm = async () => {
var matCount = 1 var matCount = 1
const onAddItem = () => { const onAddItem = () => {
if (formData.value.whId) {
const newData = { const newData = {
// //
cid: matCount, cid: matCount,
@ -486,7 +490,9 @@ const onAddItem = () => {
} }
matCount = matCount + 1 matCount = matCount + 1
formData.value.matItemDOList.push(newData) formData.value.matItemDOList.push(newData)
} else {
message.alertWarning('清选择出库仓库')
}
} }
// //
@ -558,20 +564,28 @@ const remoteMatCodeSearch = async (name) => {
const handleMatCode = async (scope, matid) => { const handleMatCode = async (scope, matid) => {
if (matid) { if (matid) {
const matVo = await MaterialApi.getMaterial(scope.row.matId) const matVo = matLastData.value.find((item) => item.matId === matid)
scope.row.matId = matVo.id scope.row.matId = matVo.matId
scope.row.matName = matVo.name scope.row.matName = matVo.matName
scope.row.matCode = matVo.code scope.row.matCode = matVo.matCode
scope.row.matSpec = matVo.spec scope.row.matSpec = matVo.matSpec
scope.row.matType = matVo.materialType scope.row.matType = matVo.materialType
scope.row.matUnit = matVo.unit scope.row.matUnit = matVo.matUnit
scope.row.rgId = matVo.rgId
scope.row.pnId = matVo.pnId
scope.row.matRest = matVo.matRest
scope.row.lotNo = matVo.lotNo
const queryParamsRPn = reactive({
pageNo: 1,
pageSize: 99,
rgId: scope.row.rgId,
pnStatus: 1
})
const dataPn = await PnApi.getPnPage(queryParamsRPn)
scope.row.pnlist = dataPn.list
} else { } else {
scope.row.matId = '' scope.row = matLastData.value.find((item) => item.matId === matid)
scope.row.matCode = ''
scope.row.matName = ''
scope.row.matSpec = ''
scope.row.matType = ''
scope.row.matUnit = ''
} }
} }
@ -579,12 +593,13 @@ const isShowBtnGroup = ref(true)
const isShowBtnCancel = ref(false) const isShowBtnCancel = ref(false)
const isShowBtnOther = ref(false) const isShowBtnOther = ref(false)
const btnWhClickable = ref(false) const btnWhClickable = ref(false)
const matLastData = ref([])
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
btnWhClickable.value = query.type === 'update' ? true : false btnWhClickable.value = query.type === 'update' ? true : false
const matLastData = await StorageMatApi.getStorageMatList() matLastData.value = await StorageMatApi.getStorageMatList()
// //
let matParams = { let matParams = {
@ -671,15 +686,21 @@ onMounted(async () => {
const matVos = await MaterialApi.getMaterialPage(queryParamsMat2) const matVos = await MaterialApi.getMaterialPage(queryParamsMat2)
formData.value.matItemDOList.forEach(item => { formData.value.matItemDOList.forEach(item => {
item.cid = matCount // item.cid = matCount
item.matId = matVos.list.find((record) => record.id === item.matId)?.id // item.matId = matVos.list.find((record) => record.id === item.matId)?.id
//item.matCode = matVos.list.find( (record) => record.id === item.matId)?.id // //item.matCode = matVos.list.find( (record) => record.id === item.matId)?.id
item.matCode = matVos.list.find((record) => record.id === item.matId)?.code // item.matCode = matVos.list.find((record) => record.id === item.matId)?.code
item.matSpec = matVos.list.find((record) => record.id === item.matId)?.spec // item.matSpec = matVos.list.find((record) => record.id === item.matId)?.spec
item.matType = matVos.list.find((record) => record.id === item.matId)?.materialType // item.matType = matVos.list.find((record) => record.id === item.matId)?.materialType
item.matUnit = matVos.list.find((record) => record.id === item.matId)?.unit // item.matUnit = matVos.list.find((record) => record.id === item.matId)?.unit
// item.pnlist = pnList.value.filter((pn) => pn.rgId === item.rgId)
// item.matRest = matLastData.value.find((rest) => rest.rgId === item.rgId && rest.pnId === item.pnId)?.matRest
// matCount = matCount + 1
item = matLastData.value.find((rest) => rest.rgId === item.rgId && rest.pnId === item.pnId)
item.pnlist = pnList.value.filter((pn) => pn.rgId === item.rgId) item.pnlist = pnList.value.filter((pn) => pn.rgId === item.rgId)
item.matRest = matLastData.find((rest) => rest.rgId === item.rgId && rest.pnId === item.pnId)?.matRest item.cid = matCount
matCount = matCount + 1 matCount = matCount + 1
}) })

Loading…
Cancel
Save