出库管理

dev
qiuhongwu 5 months ago
parent 1934186b60
commit 32f3dab71f

@ -39,7 +39,7 @@
clearable clearable
style="width: 100%" style="width: 100%"
@change="handleStockType" @change="handleStockType"
v-bind:disabled="ctrView || ctrSave || query.type !== 'create'" v-bind:disabled="ctrView || ctrSave || enableHeadNo || activetypetype !== 'create'"
> >
<el-option <el-option
v-for="dict in getIntDictOptions(DICT_TYPE.BIZ_STORAGE_OUT_TYPE)" v-for="dict in getIntDictOptions(DICT_TYPE.BIZ_STORAGE_OUT_TYPE)"
@ -73,7 +73,7 @@
<!-- <el-input v-model="formData.headerNo" class="!w-400px" @click="handleHeaderNo" v-bind:disabled="ctrView || ctrSave || enableHeadNo" /> --> <!-- <el-input v-model="formData.headerNo" class="!w-400px" @click="handleHeaderNo" v-bind:disabled="ctrView || ctrSave || enableHeadNo" /> -->
<el-input <el-input
class="!w-400px" class="!w-400px"
v-bind:disabled="ctrView || ctrSave || enableHeadNo || query.type !== 'create'" v-bind:disabled="ctrView || ctrSave || enableHeadNo || activetype !== 'create'"
v-model="formData.headerNo" v-model="formData.headerNo"
@click.prevent="handleHeaderNo" @click.prevent="handleHeaderNo"
:readonly="!isEditing" :readonly="!isEditing"
@ -82,7 +82,7 @@
<template #append <template #append
><el-button ><el-button
v-bind:disabled=" v-bind:disabled="
ctrView || ctrSave || enableHeadNo || query.type !== 'create' ctrView || ctrSave || enableHeadNo || activetype !== 'create'
" "
:icon="Search" :icon="Search"
@click="handleHeaderNo" @click="handleHeaderNo"
@ -122,7 +122,7 @@
clearable clearable
class="!w-400px" class="!w-400px"
@change="handleWh" @change="handleWh"
v-bind:disabled="ctrView || ctrSave || query.type !== 'create'" v-bind:disabled="ctrView || ctrSave || activetype !== 'create'"
> >
<el-option <el-option
v-for="dict in whList" v-for="dict in whList"
@ -152,7 +152,7 @@
</el-row> </el-row>
</el-card> </el-card>
<!-- 物料信息 --> <!-- 物料信息 -->
<el-card class="hl-card-info" :style="{ display: query.type == 'create' ? 'none' : '' }"> <el-card class="hl-card-info" :style="{ display: activetype == 'create' ? 'none' : '' }">
<template #header> <template #header>
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">物料信息</span> <div class="hl-card-info-icona"></div><span class="hl-card-info-text">物料信息</span>
</template> </template>
@ -214,7 +214,7 @@
<el-table-column <el-table-column
prop="materialType" prop="materialType"
label="物料类型" label="物料类型"
min-width="150" min-width="170"
align="center" align="center"
> >
<template #default="scope"> <template #default="scope">
@ -365,7 +365,7 @@
<el-table-column <el-table-column
prop="materialType" prop="materialType"
label="物料类型" label="物料类型"
min-width="150" min-width="170"
align="center" align="center"
> >
<template #default="scope"> <template #default="scope">
@ -459,7 +459,7 @@
</el-row> </el-row>
</el-card> </el-card>
<!-- 附件信息 --> <!-- 附件信息 -->
<el-card class="hl-card-info" :style="{ display: query.type == 'create' ? 'none' : '' }"> <el-card class="hl-card-info" :style="{ display: activetype == 'create' ? 'none' : '' }">
<template #header> <template #header>
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">附件信息</span> <div class="hl-card-info-icona"></div><span class="hl-card-info-text">附件信息</span>
</template> </template>
@ -539,7 +539,7 @@
</el-row> </el-row>
</el-card> </el-card>
<!-- 系统信息 --> <!-- 系统信息 -->
<el-card class="hl-card-info" :style="{ display: query.type == 'create' ? 'none' : '' }"> <el-card class="hl-card-info" :style="{ display: activetype == 'create' ? 'none' : '' }">
<template #header> <template #header>
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">系统信息</span> <div class="hl-card-info-icona"></div><span class="hl-card-info-text">系统信息</span>
</template> </template>
@ -590,7 +590,7 @@
<el-button <el-button
@click="saveFormDataSUBMIT('SUBMIT', 2)" @click="saveFormDataSUBMIT('SUBMIT', 2)"
type="primary" type="primary"
v-if="btnSave && query.type !== 'create'" v-if="btnSave && activetype !== 'create'"
size="large" size="large"
> </el-button > </el-button
> >
@ -636,9 +636,13 @@ import materials from './materials.vue'
import materials2 from './materials2.vue' import materials2 from './materials2.vue'
import projects from './subproject.vue' import projects from './subproject.vue'
import taskdispatchselect from './taskdispatchselect.vue' import taskdispatchselect from './taskdispatchselect.vue'
import { useCommonStore } from '@/store/modules/common'
const reload: any = inject('reload') const reload: any = inject('reload')
const commonStore = useCommonStore()
const activetype = toRef(commonStore.getStore('active'))
const activeId = toRef(commonStore.getStore('id'))
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
const { query } = useRoute() const { query } = useRoute()
@ -862,16 +866,19 @@ const saveFormData = async (active, status, type) => {
await formRef.value.validate() await formRef.value.validate()
formData.value.active = active formData.value.active = active
formData.value.status = status formData.value.status = status
await initStatus(formData.value.status)
// //
formLoading.value = true formLoading.value = true
try { try {
const data = formData.value as unknown as StorageApi.StorageVO const data = formData.value as unknown as StorageApi.StorageVO
if (query.type === 'create') { if (activetype.value === 'create') {
// //
formData.value.id = await StorageApi.createStorage(data) formData.value.id = await StorageApi.createStorage(data)
commonResult = 'common.createSuccess' commonStore.setStore('active', 'update')
query.type = 'update' commonStore.setStore('id', formData.value.id)
reload()
} else { } else {
await StorageApi.updateStorage(data) await StorageApi.updateStorage(data)
} }
var repeatItem = [] var repeatItem = []
@ -902,7 +909,7 @@ const saveFormData = async (active, status, type) => {
matUploadData.value.businessId = formData.value.id matUploadData.value.businessId = formData.value.id
await matUploadRef.value!.submit() await matUploadRef.value!.submit()
} }
await initStatus(formData.value.status)
if (type == 'suc') { if (type == 'suc') {
commonResult = 'common.updateSuccess' commonResult = 'common.updateSuccess'
message.success(t(commonResult)) message.success(t(commonResult))
@ -1000,7 +1007,7 @@ const initStatus = async (status) => {
break break
} }
// //
if (query.type === 'review') { if (activetype === 'review') {
ctrView.value = true ctrView.value = true
ctrSave.value = true ctrSave.value = true
ctrCancel.value = true ctrCancel.value = true
@ -1018,7 +1025,7 @@ const matSimpVirtualList = ref([]) // 物料基本信息列表
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
// //
dialogTitle.value = query.type === 'review' ? '查看' : t('action.' + query.type) dialogTitle.value = activetype.value === 'review' ? '查看' : t('action.' + activetype.value)
//- //-
whList.value = await WarehouseApi.getWarehouseSimpList() whList.value = await WarehouseApi.getWarehouseSimpList()
@ -1030,7 +1037,7 @@ onMounted(async () => {
matLastData.value = await StorageMatApi.getStorageMatList(0) matLastData.value = await StorageMatApi.getStorageMatList(0)
// //
if (query.id) { if (activeId.value) {
// //
matSimpList.value = await MaterialApi.getSimpList() matSimpList.value = await MaterialApi.getSimpList()
matSimpVirtualList.value = await MaterialApi.getSimpVirtualList() matSimpVirtualList.value = await MaterialApi.getSimpVirtualList()
@ -1038,7 +1045,7 @@ onMounted(async () => {
matEditList.value = matSimpList.value //matSimpList.value.filter( mat => matLastData.value.filter( row => row.matId == mat.id).length>0) 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) formData.value = await StorageApi.getStorage(activeId.value)
if (formData.value.vmatName) { if (formData.value.vmatName) {
matEditList.value = matSimpVirtualList.value matEditList.value = matSimpVirtualList.value
} }
@ -1050,7 +1057,7 @@ onMounted(async () => {
const queryParamsMat = reactive({ const queryParamsMat = reactive({
pageNo: 1, pageNo: 1,
pageSize: 99, pageSize: 99,
stockId: query.id, stockId: activeId.value,
whId: formData.value.whId whId: formData.value.whId
}) })
const dataMats = await StorageMatApi.getStorageMatPage(queryParamsMat) const dataMats = await StorageMatApi.getStorageMatPage(queryParamsMat)
@ -1060,7 +1067,7 @@ onMounted(async () => {
let attParams = { let attParams = {
pageNo: 1, pageNo: 1,
pageSize: 99, pageSize: 99,
businessId: query.id, businessId: activeId.value,
businessType: 'STORAGE' businessType: 'STORAGE'
} }
formData.value.attachments = (await getFilePage(attParams)).list formData.value.attachments = (await getFilePage(attParams)).list

@ -208,11 +208,11 @@ import * as WarehouseApi from '@/api/biz/warehouse'
import * as UserApi from '@/api/system/user' import * as UserApi from '@/api/system/user'
defineOptions({ name: 'Storage' }) defineOptions({ name: 'Storage' })
import { useCommonStateWithOut } from '@/store/modules/common'
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
const router = useRouter() // const router = useRouter() //
const commonStore = useCommonStateWithOut()
const loading = ref(true) // const loading = ref(true) //
const list = ref([]) // const list = ref([]) //
const total = ref(0) // const total = ref(0) //
@ -276,6 +276,8 @@ const openForm = (type: string, id?: number) => {
} }
/** 详情操作 新增/查看 */ /** 详情操作 新增/查看 */
const openDetail = (active: string, id?: number) => { const openDetail = (active: string, id?: number) => {
commonStore.setStore('active', active)
commonStore.setStore('id', id)
router.push({ path: '/inventory/storageoutdetail', query: { type: active, id: id } }) router.push({ path: '/inventory/storageoutdetail', query: { type: active, id: id } })
} }

Loading…
Cancel
Save