|
|
@ -39,8 +39,8 @@
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
|
<el-row>
|
|
|
|
<el-row>
|
|
|
|
<el-col :span="24">
|
|
|
|
<el-col :span="24">
|
|
|
|
<el-form-item prop="code" label="上游单号">
|
|
|
|
<el-form-item prop="headerNo" label="上游单号">
|
|
|
|
<el-input v-model="formData.code" />
|
|
|
|
<el-input v-model="formData.headerNo" />
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
@ -91,7 +91,7 @@
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-table :data="formData.productBomItemDOList" class="hl-table" @cell-click="handleCellClick"
|
|
|
|
<el-table :data="formData.productBomItemDOList" class="hl-table" @cell-click="handleCellClick"
|
|
|
|
@cell-blur="handleCellBlur">
|
|
|
|
@cell-blur="handleCellBlur">
|
|
|
|
<el-table-column prop="id" label="序号" :width="80" />
|
|
|
|
<el-table-column prop="cid" label="序号" :width="80" />
|
|
|
|
<el-table-column prop="matCode" label="物料编码" required>
|
|
|
|
<el-table-column prop="matCode" label="物料编码" required>
|
|
|
|
<template #default="scope">
|
|
|
|
<template #default="scope">
|
|
|
|
<el-select v-model="scope.row.matCode" placeholder="物料编码" :remote-method="remoteMatCodeSearch"
|
|
|
|
<el-select v-model="scope.row.matCode" placeholder="物料编码" :remote-method="remoteMatCodeSearch"
|
|
|
@ -116,26 +116,26 @@
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column prop="matType" label="物料类型">
|
|
|
|
<el-table-column prop="matType" label="物料类型">
|
|
|
|
<template #default="scope">
|
|
|
|
<template #default="scope">
|
|
|
|
<dict-tag :type="DICT_TYPE.HELI_MATERIAL_TYPE" :value="scope.row.matType" />
|
|
|
|
<dict-tag :type="DICT_TYPE.HELI_MATERIAL_TYPE" :value="scope.row.matType" v-if="scope.row.matType?true:false"/>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column prop="matSpec" label="规格/型号" />
|
|
|
|
<el-table-column prop="matSpec" label="规格/型号" />
|
|
|
|
|
|
|
|
|
|
|
|
<el-table-column prop="matUnit" label="系统单位">
|
|
|
|
<el-table-column prop="matUnit" label="系统单位">
|
|
|
|
<template #default="scope">
|
|
|
|
<template #default="scope">
|
|
|
|
<dict-tag :type="DICT_TYPE.HELI_MATERIAL_UNIT" :value="scope.row.matUnit" />
|
|
|
|
<dict-tag :type="DICT_TYPE.HELI_MATERIAL_UNIT" :value="scope.row.matUnit" v-if="scope.row.matUnit?true:false" />
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
<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-select v-model="scope.row.rgid" placeholder="" style="width: 100%" @change="handleRg(scope)">
|
|
|
|
<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>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column prop="pnid" width="140" label="入库库位" required>
|
|
|
|
<el-table-column prop="pnId" width="140" label="入库库位" required>
|
|
|
|
<template #default="scope">
|
|
|
|
<template #default="scope">
|
|
|
|
<el-select v-model="scope.row.pnid" placeholder="" style="width: 100%">
|
|
|
|
<el-select v-model="scope.row.pnId" placeholder="" style="width: 100%">
|
|
|
|
<el-option v-for="dict in scope.row.pnlist" :key="dict.id" :label="dict.pnName" :value="dict.id" />
|
|
|
|
<el-option v-for="dict in scope.row.pnlist" :key="dict.id" :label="dict.pnName" :value="dict.id" />
|
|
|
|
</el-select>
|
|
|
|
</el-select>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
@ -272,7 +272,8 @@ import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
|
|
|
|
|
|
|
|
|
import type { UploadProps, UploadUserFile } from 'element-plus'
|
|
|
|
import type { UploadProps, UploadUserFile } from 'element-plus'
|
|
|
|
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
|
|
|
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
|
|
|
import * as MouldTypeApi from '@/api/heli/mouldtype'
|
|
|
|
import * as StorageApi from '@/api/heli/storage'
|
|
|
|
|
|
|
|
import * as StorageMatApi from '@/api/heli/storagemat'
|
|
|
|
|
|
|
|
|
|
|
|
import * as MaterialApi from '@/api/heli/material'
|
|
|
|
import * as MaterialApi from '@/api/heli/material'
|
|
|
|
import * as WarehouseApi from '@/api/heli/warehouse'
|
|
|
|
import * as WarehouseApi from '@/api/heli/warehouse'
|
|
|
@ -283,6 +284,7 @@ import download from "@/utils/download";
|
|
|
|
|
|
|
|
|
|
|
|
const { t } = useI18n() // 国际化
|
|
|
|
const { t } = useI18n() // 国际化
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
|
|
|
|
|
const router = useRoute();
|
|
|
|
|
|
|
|
|
|
|
|
const isShow = ref(false)
|
|
|
|
const isShow = ref(false)
|
|
|
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
|
|
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
|
|
@ -291,13 +293,13 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
|
|
|
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
|
|
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
|
|
|
const formData = ref({
|
|
|
|
const formData = ref({
|
|
|
|
id: undefined,
|
|
|
|
id: undefined,
|
|
|
|
stockType: undefined,
|
|
|
|
stockType: 1,
|
|
|
|
stockInType: undefined,
|
|
|
|
stockInType: undefined,
|
|
|
|
stockOutType: undefined,
|
|
|
|
stockOutType: undefined,
|
|
|
|
stockNo: undefined,
|
|
|
|
stockNo: undefined,
|
|
|
|
headerNo: undefined,
|
|
|
|
headerNo: undefined,
|
|
|
|
description: undefined,
|
|
|
|
description: undefined,
|
|
|
|
status: undefined,
|
|
|
|
status: 1,
|
|
|
|
whId: undefined,
|
|
|
|
whId: undefined,
|
|
|
|
creator: undefined,
|
|
|
|
creator: undefined,
|
|
|
|
createTime: undefined,
|
|
|
|
createTime: undefined,
|
|
|
@ -328,13 +330,14 @@ const open = async (type: string, id?: number) => {
|
|
|
|
if (id) {
|
|
|
|
if (id) {
|
|
|
|
formLoading.value = true
|
|
|
|
formLoading.value = true
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
formData.value = await MouldTypeApi.getMouldType(id)
|
|
|
|
formData.value = await StorageApi.getStorage(id)
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
formLoading.value = false
|
|
|
|
formLoading.value = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
|
|
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
|
|
|
|
|
|
|
const storageid = ref()
|
|
|
|
|
|
|
|
|
|
|
|
/** 提交表单 */
|
|
|
|
/** 提交表单 */
|
|
|
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
|
|
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
|
|
@ -344,12 +347,22 @@ const submitForm = async () => {
|
|
|
|
// 提交请求
|
|
|
|
// 提交请求
|
|
|
|
formLoading.value = true
|
|
|
|
formLoading.value = true
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
const data = formData.value as unknown as MouldTypeApi.MouldTypeVO
|
|
|
|
const data = formData.value as unknown as StorageApi.StorageVO
|
|
|
|
if (formType.value === 'create') {
|
|
|
|
if (router.query.type === 'create') {
|
|
|
|
await MouldTypeApi.createMouldType(data)
|
|
|
|
storageid.value = await StorageApi.createStorage(data)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
formData.value.productBomItemDOList.forEach( item=>{
|
|
|
|
|
|
|
|
item.stockId = storageid.value
|
|
|
|
|
|
|
|
item.whId = formData.value.whId
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const dataMats = formData.value.productBomItemDOList as unknown as StorageMatApi.StorageMatVO[]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var aa = await StorageMatApi.createStorageMatBatch(dataMats)
|
|
|
|
|
|
|
|
|
|
|
|
message.success(t('common.createSuccess'))
|
|
|
|
message.success(t('common.createSuccess'))
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
await MouldTypeApi.updateMouldType(data)
|
|
|
|
await StorageApi.updateStorage(data)
|
|
|
|
message.success(t('common.updateSuccess'))
|
|
|
|
message.success(t('common.updateSuccess'))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 发送操作成功的事件
|
|
|
|
// 发送操作成功的事件
|
|
|
@ -377,16 +390,17 @@ var matCount = 1
|
|
|
|
const onAddItem = () => {
|
|
|
|
const onAddItem = () => {
|
|
|
|
const newData = {
|
|
|
|
const newData = {
|
|
|
|
// 新数据的属性
|
|
|
|
// 新数据的属性
|
|
|
|
id : matCount,
|
|
|
|
cid : matCount,
|
|
|
|
|
|
|
|
stockId : 0,
|
|
|
|
matId: '',
|
|
|
|
matId: '',
|
|
|
|
matName: '',
|
|
|
|
matName: '',
|
|
|
|
matCode: '',
|
|
|
|
matCode: '',
|
|
|
|
matType : '',
|
|
|
|
matType : '',
|
|
|
|
matSpec: '',
|
|
|
|
matSpec: '',
|
|
|
|
matUnit: '',
|
|
|
|
matUnit: '',
|
|
|
|
whid: '',
|
|
|
|
whId: '',
|
|
|
|
rgid: '',
|
|
|
|
rgId: '',
|
|
|
|
pnid: '',
|
|
|
|
pnId: '',
|
|
|
|
pnlist : ref([]),
|
|
|
|
pnlist : ref([]),
|
|
|
|
storageOkQty: '',
|
|
|
|
storageOkQty: '',
|
|
|
|
lotNo: '',
|
|
|
|
lotNo: '',
|
|
|
@ -405,16 +419,17 @@ const handlefuke = (index, item) => {
|
|
|
|
// 复制数据
|
|
|
|
// 复制数据
|
|
|
|
const newData: any = {
|
|
|
|
const newData: any = {
|
|
|
|
...data,
|
|
|
|
...data,
|
|
|
|
id : matCount,
|
|
|
|
cid : matCount,
|
|
|
|
|
|
|
|
stockId : item.stockId,
|
|
|
|
matId: item.matId,
|
|
|
|
matId: item.matId,
|
|
|
|
matName: item.matName,
|
|
|
|
matName: item.matName,
|
|
|
|
matCode: item.matCode,
|
|
|
|
matCode: item.matCode,
|
|
|
|
matType : item.matType,
|
|
|
|
matType : item.matType,
|
|
|
|
matSpec: item.matSpec,
|
|
|
|
matSpec: item.matSpec,
|
|
|
|
matUnit: item.matUnit,
|
|
|
|
matUnit: item.matUnit,
|
|
|
|
whid: item.whid,
|
|
|
|
whId: item.whId,
|
|
|
|
rgid: item.rgid,
|
|
|
|
rgId: item.rgId,
|
|
|
|
pnid: item.pnid,
|
|
|
|
pnId: item.pnId,
|
|
|
|
pnlist : item.pnlist,
|
|
|
|
pnlist : item.pnlist,
|
|
|
|
storageOkQty: item.storageOkQty,
|
|
|
|
storageOkQty: item.storageOkQty,
|
|
|
|
lotNo: item.lotNo,
|
|
|
|
lotNo: item.lotNo,
|
|
|
@ -539,8 +554,8 @@ const handleWh = (async (wid) => {
|
|
|
|
rgList.value = dataRg.list
|
|
|
|
rgList.value = dataRg.list
|
|
|
|
|
|
|
|
|
|
|
|
formData.value.productBomItemDOList.forEach( item =>{
|
|
|
|
formData.value.productBomItemDOList.forEach( item =>{
|
|
|
|
item.rgid = ''
|
|
|
|
item.rgId = ''
|
|
|
|
item.pnid = ''
|
|
|
|
item.pnId = ''
|
|
|
|
item.pnlist.value = []
|
|
|
|
item.pnlist.value = []
|
|
|
|
})
|
|
|
|
})
|
|
|
|
//-------------------
|
|
|
|
//-------------------
|
|
|
@ -550,7 +565,7 @@ const handleRg = (async (scope) => {
|
|
|
|
const queryParamsRPn = reactive({
|
|
|
|
const queryParamsRPn = reactive({
|
|
|
|
pageNo: 1,
|
|
|
|
pageNo: 1,
|
|
|
|
pageSize: 99,
|
|
|
|
pageSize: 99,
|
|
|
|
rgId: scope.row.rgid,
|
|
|
|
rgId: scope.row.rgId,
|
|
|
|
pnStatus: 1
|
|
|
|
pnStatus: 1
|
|
|
|
})
|
|
|
|
})
|
|
|
|
const dataPn = await PnApi.getPnPage(queryParamsRPn)
|
|
|
|
const dataPn = await PnApi.getPnPage(queryParamsRPn)
|
|
|
@ -615,7 +630,7 @@ const handleMatCode = async (scope,matid) =>{
|
|
|
|
/** 初始化 **/
|
|
|
|
/** 初始化 **/
|
|
|
|
onMounted(async () => {
|
|
|
|
onMounted(async () => {
|
|
|
|
|
|
|
|
|
|
|
|
const router = useRoute();
|
|
|
|
|
|
|
|
dialogTitle.value = t('action.' + router.query.type)
|
|
|
|
dialogTitle.value = t('action.' + router.query.type)
|
|
|
|
|
|
|
|
|
|
|
|
isShow.value = router.query.type == "create" ? false : true
|
|
|
|
isShow.value = router.query.type == "create" ? false : true
|
|
|
|