出库管理

dev
qiuhongwu 5 months ago
parent 1934186b60
commit 32f3dab71f

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

Loading…
Cancel
Save