|
|
|
@ -9,8 +9,7 @@
|
|
|
|
|
<img src="/src/assets/imgs/status/statuszf.png" v-else-if="formData.status == 3" alt="" />
|
|
|
|
|
<span v-else></span>
|
|
|
|
|
</div>
|
|
|
|
|
<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">
|
|
|
|
|
<template #header>
|
|
|
|
@ -29,8 +28,7 @@
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item prop="stockInType" label="出库类型">
|
|
|
|
|
<el-select v-model="formData.stockInType" clearable style="width: 100%" @change="handleStockType" v-bind:disabled="ctrView || ctrSave">
|
|
|
|
|
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.HELI_STORAGE_OUT_TYPE)" :key="dict.value"
|
|
|
|
|
:label="dict.label" :value="dict.value" />
|
|
|
|
|
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.HELI_STORAGE_OUT_TYPE)" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
@ -41,8 +39,7 @@
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item prop="industry" label="单据状态">
|
|
|
|
|
<el-select v-model="formData.status" placeholder="下拉选择" clearable class="!w-700px" disabled>
|
|
|
|
|
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.HELI_STORAGE_STATUS)" :key="dict.value"
|
|
|
|
|
:label="dict.label" :value="dict.value" />
|
|
|
|
|
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.HELI_STORAGE_STATUS)" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
@ -50,7 +47,7 @@
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item prop="headerNo" label="上游单号">
|
|
|
|
|
<el-input v-model="formData.headerNo" class="!w-700px" v-bind:disabled="ctrView || ctrSave || enableHeadNo"/>
|
|
|
|
|
<el-input v-model="formData.headerNo" class="!w-700px" v-bind:disabled="ctrView || ctrSave || enableHeadNo" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
@ -59,16 +56,14 @@
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item label="单据日期" prop="createTime">
|
|
|
|
|
<el-date-picker v-model="formData.createTime" value-format="x" placeholder="单据日期" disabled
|
|
|
|
|
class="!w-400px" />
|
|
|
|
|
<el-date-picker v-model="formData.createTime" value-format="x" placeholder="单据日期" disabled class="!w-400px" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item prop="whId" label="出库仓库" required>
|
|
|
|
|
<el-select v-model="formData.whId" placeholder="下拉选择" clearable class="!w-400px" @change="handleWh"
|
|
|
|
|
v-bind:disabled="ctrView || ctrSave">
|
|
|
|
|
<el-select v-model="formData.whId" placeholder="下拉选择" clearable class="!w-400px" @change="handleWh" v-bind:disabled="ctrView || ctrSave">
|
|
|
|
|
<el-option v-for="dict in whList" :key="dict.id" :label="dict.whName" :value="dict.id" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
@ -79,7 +74,7 @@
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item label="备注" prop="description">
|
|
|
|
|
<el-input type="textarea" v-model="formData.description" show-word-limit maxlength="200" class="!w-2080px" v-bind:disabled="ctrView || ctrSave"/>
|
|
|
|
|
<el-input type="textarea" v-model="formData.description" show-word-limit maxlength="200" class="!w-2080px" v-bind:disabled="ctrView || ctrSave" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
@ -95,17 +90,14 @@
|
|
|
|
|
<el-col>
|
|
|
|
|
<el-button class="hl-addbutton" type="primary" size="large" v-bind:disabled="ctrView || ctrSave" @click="onAddItem">新增</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-form ref="matSubFormRef" :model="formData.matItemDOList" :rules="subFormRules"
|
|
|
|
|
v-loading="subFormLoading" label-width="0">
|
|
|
|
|
<el-form ref="matSubFormRef" :model="formData.matItemDOList" :rules="subFormRules" v-loading="subFormLoading" label-width="0">
|
|
|
|
|
<el-table :data="formData.matItemDOList" class="hl-table">
|
|
|
|
|
<el-table-column prop="cid" label="序号" :width="80" />
|
|
|
|
|
<el-table-column prop="matId" min-width="140" 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!">
|
|
|
|
|
<el-select v-model="scope.row.matId" placeholder="物料名称" :remote-method="remoteMatNameSearch" v-bind:disabled="ctrView || ctrSave"
|
|
|
|
|
remote-show-suffix remote clearable reserve-keyword filterable :loading="matSelectLoading"
|
|
|
|
|
@change="(val) => handleMatName(scope, val)" class="!w-180px">
|
|
|
|
|
<el-select v-model="scope.row.matId" placeholder="物料名称" :remote-method="remoteMatNameSearch" v-bind:disabled="ctrView || ctrSave" remote-show-suffix remote clearable reserve-keyword filterable :loading="matSelectLoading" @change="(val) => handleMatName(scope, val)" class="!w-180px">
|
|
|
|
|
<el-option v-for="item in matList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
@ -114,24 +106,21 @@
|
|
|
|
|
<el-table-column prop="matCode" label="物料编码" min-width="120" 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" />
|
|
|
|
|
<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="matUnit" label="系统单位" min-width="120" align="center">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :type="DICT_TYPE.HELI_MATERIAL_UNIT" :value="scope.row.matUnit"
|
|
|
|
|
v-if="scope.row.matUnit ? true : false" />
|
|
|
|
|
<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="rgId" min-width="120" align="center">
|
|
|
|
|
<template #header> <span class="hl-table_header">*</span>出库库区 </template>
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-form-item :prop="`${scope.$index}.rgId`" :rules="subFormRules.rgId" class="mb-0px!">
|
|
|
|
|
<el-select v-model="scope.row.rgId" placeholder="" style="width: 100%"
|
|
|
|
|
v-bind:disabled="true">
|
|
|
|
|
<el-select v-model="scope.row.rgId" placeholder="" style="width: 100%" v-bind:disabled="true">
|
|
|
|
|
<el-option v-for="dict in rgList" :key="dict.id" :label="dict.rg_name" :value="dict.id" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
@ -142,8 +131,7 @@
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-form-item :prop="`${scope.$index}.pnId`" :rules="subFormRules.pnId" class="mb-0px!">
|
|
|
|
|
<el-select v-model="scope.row.pnId" placeholder="" style="width: 100%" v-bind:disabled="ctrView || ctrSave" @change="handlePn(scope)">
|
|
|
|
|
<el-option v-for="dict in scope.row.pnlist" :key="dict.id" :label="dict.pn_name"
|
|
|
|
|
:value="dict.id" />
|
|
|
|
|
<el-option v-for="dict in scope.row.pnlist" :key="dict.id" :label="dict.pn_name" :value="dict.id" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</template>
|
|
|
|
@ -152,16 +140,15 @@
|
|
|
|
|
<el-table-column prop="storageOkQty" min-width="120" align="center">
|
|
|
|
|
<template #header> <span class="hl-table_header">*</span>出库数量</template>
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-form-item :prop="`${scope.$index}.storageOkQty`" :rules="subFormRules.storageOkQty"
|
|
|
|
|
class="mb-0px!">
|
|
|
|
|
<el-input v-model="scope.row.storageOkQty" v-bind:disabled="ctrView || ctrSave"/>
|
|
|
|
|
<el-form-item :prop="`${scope.$index}.storageOkQty`" :rules="subFormRules.storageOkQty" class="mb-0px!">
|
|
|
|
|
<el-input v-model="scope.row.storageOkQty" v-bind:disabled="ctrView || ctrSave" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="lotNo" min-width="120" label="批次号" align="center" v-if="false" />
|
|
|
|
|
<el-table-column prop="description" min-width="180" label="备注" align="center">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-input v-model="scope.row.description" v-bind:disabled="ctrView || ctrSave"/>
|
|
|
|
|
<el-input v-model="scope.row.description" v-bind:disabled="ctrView || ctrSave" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="操作" align="center" width="240">
|
|
|
|
@ -175,8 +162,7 @@
|
|
|
|
|
</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="ctrView || ctrDelete">
|
|
|
|
|
<el-button link type="danger" size="small" @click.prevent="handleDelete2(scope.$index)" v-bind:disabled="ctrView || ctrDelete">
|
|
|
|
|
删除
|
|
|
|
|
</el-button>
|
|
|
|
|
</template>
|
|
|
|
@ -196,13 +182,10 @@
|
|
|
|
|
<el-col>
|
|
|
|
|
<el-card class="hl-incard">
|
|
|
|
|
<el-col>
|
|
|
|
|
<el-upload ref="matUploadRef" :file-list="matUploadFiles" multiple :limit="10" :action="uploadUrl"
|
|
|
|
|
:headers="{
|
|
|
|
|
<el-upload ref="matUploadRef" :file-list="matUploadFiles" multiple :limit="10" :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="UpError" class="upload-file-uploader" >
|
|
|
|
|
}" name="files" :show-file-list="false" :auto-upload="false" :data="matUploadData" :on-change="matUploadChange" :on-error="UpError" class="upload-file-uploader">
|
|
|
|
|
<el-button type="primary" v-bind:disabled="ctrView || ctrSave">
|
|
|
|
|
<Icon icon="ep:upload-filled" />上传
|
|
|
|
|
</el-button>
|
|
|
|
@ -219,12 +202,10 @@
|
|
|
|
|
|
|
|
|
|
<el-table-column label="操作" align="center">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-button link type="danger" size="small" v-bind:disabled="ctrView || ctrDelete"
|
|
|
|
|
@click="handleDeleteAttachment(scope.$index, scope.row.businessFileType)">
|
|
|
|
|
<el-button link type="danger" size="small" v-bind:disabled="ctrView || ctrDelete" @click="handleDeleteAttachment(scope.$index, scope.row.businessFileType)">
|
|
|
|
|
删除
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button link type="primary" size="small" v-bind:disabled="ctrView || ctrDelete"
|
|
|
|
|
@click="downloadAttachment(scope.row.name, scope.row.url)">
|
|
|
|
|
<el-button link type="primary" size="small" v-bind:disabled="ctrView || ctrDelete" @click="downloadAttachment(scope.row.name, scope.row.url)">
|
|
|
|
|
下载
|
|
|
|
|
</el-button>
|
|
|
|
|
</template>
|
|
|
|
@ -364,16 +345,13 @@ const handleStockType = async (typeid) => {
|
|
|
|
|
if (typeid == 1) {
|
|
|
|
|
enableHeadNo.value = false
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
enableHeadNo.value = true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
const handleStatus = async (num) => {
|
|
|
|
|
formData.value.status = num
|
|
|
|
|
const data = formData.value as unknown as StorageApi.StorageVO
|
|
|
|
|
if(num==2){
|
|
|
|
|
|
|
|
|
|
if (num == 2) {
|
|
|
|
|
// 校验表单
|
|
|
|
|
await formRef.value.validate()
|
|
|
|
|
if (formData.value.matItemDOList.length === 0) {
|
|
|
|
@ -396,7 +374,8 @@ const handleStatus = async (num) => {
|
|
|
|
|
mat.matId == rest.matId &&
|
|
|
|
|
mat.pnId == rest.pnId &&
|
|
|
|
|
mat.matRest < Number(rest.storageOkQty)
|
|
|
|
|
) !== undefined || rest.storageOkQty.length ==0
|
|
|
|
|
) !== undefined ||
|
|
|
|
|
rest.storageOkQty.length == 0
|
|
|
|
|
) {
|
|
|
|
|
hasRestNum = false
|
|
|
|
|
}
|
|
|
|
@ -411,8 +390,7 @@ const handleStatus = async (num) => {
|
|
|
|
|
await saveFormData()
|
|
|
|
|
|
|
|
|
|
data.outbound = useUserStore().getUser.id
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
await StorageApi.updateStorage(data)
|
|
|
|
|
data.cancel = useUserStore().getUser.id
|
|
|
|
|
commonResult = 'common.updateSuccess'
|
|
|
|
@ -427,7 +405,6 @@ const handleStatus = async (num) => {
|
|
|
|
|
reload()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ====================附件信息 开始=======================================
|
|
|
|
|
const uploadUrl = ref(import.meta.env.VITE_UPLOAD_BATCH_URL)
|
|
|
|
|
const matUploadRef = ref()
|
|
|
|
@ -456,21 +433,22 @@ const UpError = (err, file, fileList) => {
|
|
|
|
|
|
|
|
|
|
const openerror = () => {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
if (failedAttachmentsName.value.length > 0) {
|
|
|
|
|
// 弹出错误信息提示框
|
|
|
|
|
ElMessageBox.alert(
|
|
|
|
|
// 使用错误信息作为提示内容
|
|
|
|
|
`文件名为:${failedAttachmentsName.value}的上传失败`,
|
|
|
|
|
`文件名为:${failedAttachmentsName.value.join(' / ')}上传失败`,
|
|
|
|
|
`文件格式不正确或网络问题 请您稍微再试`,
|
|
|
|
|
{
|
|
|
|
|
dangerouslyUseHTMLString: false, // 由于我们不是使用HTML字符串,所以这里设置为false
|
|
|
|
|
dangerouslyUseHTMLString: false,
|
|
|
|
|
confirmButtonText: '知道了',
|
|
|
|
|
center: true
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}, 1000)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const refreshAttachments = (files, type) => {
|
|
|
|
|
formData.value.attachments = formData.value.attachments.filter((value) => value.id)
|
|
|
|
|
|
|
|
|
@ -529,7 +507,6 @@ const saveFormData = async () => {
|
|
|
|
|
formData.value.id = await StorageApi.createStorage(data)
|
|
|
|
|
commonResult = 'common.createSuccess'
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
await StorageApi.updateStorage(data)
|
|
|
|
|
commonResult = 'common.updateSuccess'
|
|
|
|
|
}
|
|
|
|
@ -576,7 +553,8 @@ const submitForm = async () => {
|
|
|
|
|
mat.matId == rest.matId &&
|
|
|
|
|
mat.pnId == rest.pnId &&
|
|
|
|
|
mat.matRest < Number(rest.storageOkQty)
|
|
|
|
|
) !== undefined || rest.storageOkQty.length ==0
|
|
|
|
|
) !== undefined ||
|
|
|
|
|
rest.storageOkQty.length == 0
|
|
|
|
|
) {
|
|
|
|
|
hasRestNum = false
|
|
|
|
|
}
|
|
|
|
@ -601,7 +579,6 @@ const submitForm = async () => {
|
|
|
|
|
|
|
|
|
|
var matCount = 1
|
|
|
|
|
const onAddItem = () => {
|
|
|
|
|
|
|
|
|
|
if (formData.value.whId) {
|
|
|
|
|
const newData = {
|
|
|
|
|
// 新数据的属性
|
|
|
|
@ -621,7 +598,7 @@ const onAddItem = () => {
|
|
|
|
|
lotNo: '',
|
|
|
|
|
description: '',
|
|
|
|
|
productBomItemValueDOList: [],
|
|
|
|
|
matList : matList.value
|
|
|
|
|
matList: matList.value
|
|
|
|
|
}
|
|
|
|
|
matCount = matCount + 1
|
|
|
|
|
|
|
|
|
@ -648,22 +625,21 @@ const handleWh = async (wid) => {
|
|
|
|
|
|
|
|
|
|
formData.value.rgId = ''
|
|
|
|
|
// 获得库区列表
|
|
|
|
|
rgList.value = (await RgApi.getSimpList()).filter( rg => rg.wh_id == wid)
|
|
|
|
|
rgList.value = (await RgApi.getSimpList()).filter((rg) => rg.wh_id == wid)
|
|
|
|
|
|
|
|
|
|
// 获得库位列表
|
|
|
|
|
pnList.value = (await PnApi.getSimpList()).filter( pn => pn.wh_id == wid)
|
|
|
|
|
pnList.value = (await PnApi.getSimpList()).filter((pn) => pn.wh_id == wid)
|
|
|
|
|
|
|
|
|
|
//await getMatList()
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
const getMatList = async (name) =>{
|
|
|
|
|
const getMatList = async (name) => {
|
|
|
|
|
// 获得物料列表
|
|
|
|
|
let matParams = {
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
status: '1'
|
|
|
|
|
}
|
|
|
|
|
if(name.length>0){
|
|
|
|
|
if (name.length > 0) {
|
|
|
|
|
matParams.name = name
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -679,16 +655,32 @@ const getMatList = async (name) =>{
|
|
|
|
|
// )
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const handlePn = async (scope) =>{
|
|
|
|
|
const handlePn = async (scope) => {
|
|
|
|
|
scope.row.matList = matList.value
|
|
|
|
|
var repeatItem = formData.value.matItemDOList.filter( mat => mat.matId==scope.row.matId && mat.pnId == scope.row.pnId)
|
|
|
|
|
if(repeatItem.length>1){
|
|
|
|
|
message.alertWarning('物料编码['+repeatItem[0].matCode+']出库库位存在多行数据,请修改,避免重复出库')
|
|
|
|
|
var repeatItem = formData.value.matItemDOList.filter(
|
|
|
|
|
(mat) => mat.matId == scope.row.matId && mat.pnId == scope.row.pnId
|
|
|
|
|
)
|
|
|
|
|
if (repeatItem.length > 1) {
|
|
|
|
|
message.alertWarning(
|
|
|
|
|
'物料编码[' + repeatItem[0].matCode + ']出库库位存在多行数据,请修改,避免重复出库'
|
|
|
|
|
)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (matLastData.value.find((item) => item.matId === scope.row.matId && item.whId== formData.value.whId && item.pnId == scope.row.pnId)) {
|
|
|
|
|
const matVo = matLastData.value.find((item) => item.matId === scope.row.matId && item.whId== formData.value.whId && item.pnId == scope.row.pnId)
|
|
|
|
|
if (
|
|
|
|
|
matLastData.value.find(
|
|
|
|
|
(item) =>
|
|
|
|
|
item.matId === scope.row.matId &&
|
|
|
|
|
item.whId == formData.value.whId &&
|
|
|
|
|
item.pnId == scope.row.pnId
|
|
|
|
|
)
|
|
|
|
|
) {
|
|
|
|
|
const matVo = matLastData.value.find(
|
|
|
|
|
(item) =>
|
|
|
|
|
item.matId === scope.row.matId &&
|
|
|
|
|
item.whId == formData.value.whId &&
|
|
|
|
|
item.pnId == scope.row.pnId
|
|
|
|
|
)
|
|
|
|
|
// scope.row.matId = matVo.matId
|
|
|
|
|
// scope.row.matName = matVo.matName
|
|
|
|
|
// scope.row.matCode = matVo.matCode
|
|
|
|
@ -701,15 +693,13 @@ const handlePn = async (scope) =>{
|
|
|
|
|
// scope.row.storageOkQty = matVo.storageOkQty
|
|
|
|
|
// scope.row.lotNo = matVo.lotNo
|
|
|
|
|
// scope.row.description = matVo.description
|
|
|
|
|
|
|
|
|
|
} else{
|
|
|
|
|
} else {
|
|
|
|
|
scope.row.rgId = ''
|
|
|
|
|
scope.row.matRest = '0'
|
|
|
|
|
message.alertWarning('当前库位无库存数量可出库')
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const matSelectLoading = ref(false)
|
|
|
|
|
const remoteMatNameSearch = async (name) => {
|
|
|
|
|
matSelectLoading.value = true
|
|
|
|
@ -728,11 +718,14 @@ const handleMatName = async (scope, matid) => {
|
|
|
|
|
|
|
|
|
|
scope.row.rgId = ''
|
|
|
|
|
scope.row.pnId = ''
|
|
|
|
|
if(matid.length==0){
|
|
|
|
|
|
|
|
|
|
if (matid.length == 0) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
scope.row.pnlist = pnList.value.filter(pn => pn.wh_id == formData.value.whId && matLastData.value.filter( mat => mat.matId == matid && mat.pnId == pn.id).length>0)
|
|
|
|
|
scope.row.pnlist = pnList.value.filter(
|
|
|
|
|
(pn) =>
|
|
|
|
|
pn.wh_id == formData.value.whId &&
|
|
|
|
|
matLastData.value.filter((mat) => mat.matId == matid && mat.pnId == pn.id).length > 0
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const matLastData = ref([])
|
|
|
|
@ -746,14 +739,14 @@ const btnCancel = ref(false)
|
|
|
|
|
|
|
|
|
|
// 根据页面动作和数据状态控制按钮输入框信息
|
|
|
|
|
const initStatus = async (status) => {
|
|
|
|
|
switch(status){
|
|
|
|
|
switch (status) {
|
|
|
|
|
case 1:
|
|
|
|
|
ctrView.value = false
|
|
|
|
|
ctrSave.value = false
|
|
|
|
|
ctrCancel.value = true
|
|
|
|
|
ctrDelete.value = false
|
|
|
|
|
|
|
|
|
|
btnSave.value= true
|
|
|
|
|
btnSave.value = true
|
|
|
|
|
btnCancel.value = false
|
|
|
|
|
break
|
|
|
|
|
case 2:
|
|
|
|
@ -761,7 +754,7 @@ const initStatus = async (status) => {
|
|
|
|
|
ctrSave.value = true
|
|
|
|
|
ctrCancel.value = false
|
|
|
|
|
ctrDelete.value = true
|
|
|
|
|
btnSave.value= false
|
|
|
|
|
btnSave.value = false
|
|
|
|
|
btnCancel.value = true
|
|
|
|
|
break
|
|
|
|
|
case 3:
|
|
|
|
@ -769,20 +762,20 @@ const initStatus = async (status) => {
|
|
|
|
|
ctrSave.value = true
|
|
|
|
|
ctrCancel.value = true
|
|
|
|
|
ctrDelete.value = true
|
|
|
|
|
btnSave.value= false
|
|
|
|
|
btnSave.value = false
|
|
|
|
|
btnCancel.value = false
|
|
|
|
|
break
|
|
|
|
|
default:
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
// 查看页面时可操作控件禁用
|
|
|
|
|
if(query.type === 'review'){
|
|
|
|
|
if (query.type === 'review') {
|
|
|
|
|
ctrView.value = true
|
|
|
|
|
ctrSave.value = true
|
|
|
|
|
ctrCancel.value = true
|
|
|
|
|
ctrDelete.value = true
|
|
|
|
|
|
|
|
|
|
btnSave.value= false
|
|
|
|
|
btnSave.value = false
|
|
|
|
|
btnCancel.value = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -793,7 +786,6 @@ const matSimpList = ref([]) // 物料基本信息列表
|
|
|
|
|
const matSimpVirtualList = ref([]) // 物料基本信息列表
|
|
|
|
|
/** 初始化 **/
|
|
|
|
|
onMounted(async () => {
|
|
|
|
|
|
|
|
|
|
// 页面标题展示
|
|
|
|
|
dialogTitle.value = query.type === 'review' ? '查看' : t('action.' + query.type)
|
|
|
|
|
|
|
|
|
@ -808,17 +800,15 @@ onMounted(async () => {
|
|
|
|
|
|
|
|
|
|
// 编辑时获取入库单据信息,包括基础信息、物料信息、附件信息
|
|
|
|
|
if (query.id) {
|
|
|
|
|
|
|
|
|
|
// 获取原始物料信息
|
|
|
|
|
matSimpList.value = await MaterialApi.getSimpList()
|
|
|
|
|
matSimpVirtualList.value = await MaterialApi.getSimpVirtualList()
|
|
|
|
|
|
|
|
|
|
matEditList.value = matSimpList.value //matSimpList.value.filter( mat => matLastData.value.filter( row => row.matId == mat.id).length>0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取库存信息
|
|
|
|
|
formData.value = await StorageApi.getStorage(query.id)
|
|
|
|
|
if(formData.value.vmatName){
|
|
|
|
|
if (formData.value.vmatName) {
|
|
|
|
|
matEditList.value = matSimpVirtualList.value
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -827,11 +817,11 @@ onMounted(async () => {
|
|
|
|
|
|
|
|
|
|
// 获得库区列表
|
|
|
|
|
const dataRgList = await RgApi.getSimpList()
|
|
|
|
|
rgList.value = dataRgList.filter( rg => rg.wh_id == formData.value.whId)
|
|
|
|
|
rgList.value = dataRgList.filter((rg) => rg.wh_id == formData.value.whId)
|
|
|
|
|
|
|
|
|
|
// 获得库区列表
|
|
|
|
|
const dataPnList = await PnApi.getSimpList()
|
|
|
|
|
pnList.value = dataPnList.filter( pn => pn.wh_id == formData.value.whId)
|
|
|
|
|
pnList.value = dataPnList.filter((pn) => pn.wh_id == formData.value.whId)
|
|
|
|
|
|
|
|
|
|
// 获取库存物料列表信息
|
|
|
|
|
const queryParamsMat = reactive({
|
|
|
|
@ -845,13 +835,15 @@ onMounted(async () => {
|
|
|
|
|
formData.value.matItemDOList.forEach((item) => {
|
|
|
|
|
item.cid = matCount
|
|
|
|
|
item.matId = matEditList.value.find((record) => record.id === item.matId)?.id
|
|
|
|
|
item.matCode = matEditList.value.find( (record) => record.id === item.matId)?.code
|
|
|
|
|
item.matCode = matEditList.value.find((record) => record.id === item.matId)?.code
|
|
|
|
|
item.matName = matEditList.value.find((record) => record.id === item.matId)?.name
|
|
|
|
|
item.matSpec = matEditList.value.find((record) => record.id === item.matId)?.spec
|
|
|
|
|
item.matType = matEditList.value.find((record) => record.id === item.matId)?.material_type
|
|
|
|
|
item.matUnit = matEditList.value.find((record) => record.id === item.matId)?.unit
|
|
|
|
|
item.matRest = matLastData.value.find( row => row.matId == item.matId && row.pnId == item.pnId)?.matRest
|
|
|
|
|
item.matRest = (item.matRest==undefined || item.matRest.length==0)?0:item.matRest
|
|
|
|
|
item.matRest = matLastData.value.find(
|
|
|
|
|
(row) => row.matId == item.matId && row.pnId == item.pnId
|
|
|
|
|
)?.matRest
|
|
|
|
|
item.matRest = item.matRest == undefined || item.matRest.length == 0 ? 0 : item.matRest
|
|
|
|
|
item.pnlist = pnList.value.filter((pn) => pn.wh_id === item.whId)
|
|
|
|
|
item.matList = matEditList.value.filter((record) => record.id === item.matId)
|
|
|
|
|
matCount = matCount + 1
|
|
|
|
|