diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/StorageForm.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/StorageForm.vue
index 0ad19f5d..23d980ba 100644
--- a/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/StorageForm.vue
+++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/StorageForm.vue
@@ -667,7 +667,7 @@ const saveFormData = async () => {
const dataMats = formData.value.matItemDOList as unknown as StorageMatApi.StorageMatVO[]
await StorageMatApi.createStorageMatBatch(dataMats, storageid.value)
- if (formData.value.matItemDOList.length > 0) {
+ if (formData.value.attachments!=undefined && formData.value.attachments.length > 0) {
//附件信息保存
matUploadData.value.businessId = storageid
matUploadRef.value!.submit()
diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/StorageOut.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/StorageOut.vue
index 3b8340de..faa083a6 100644
--- a/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/StorageOut.vue
+++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/StorageOut.vue
@@ -662,7 +662,7 @@ const saveFormData = async () => {
const dataMats = formData.value.matItemDOList as unknown as StorageMatApi.StorageMatVO[]
await StorageMatApi.createStorageMatBatch(dataMats, storageid.value)
- if (formData.value.matItemDOList.length > 0) {
+ if (formData.value.attachments!=undefined && formData.value.attachments.length > 0) {
//附件信息保存
matUploadData.value.businessId = storageid
matUploadRef.value!.submit()
diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/storagecheck/checkdetail.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/storagecheck/checkdetail.vue
index 130951bb..a97e04c6 100644
--- a/mes-ui/mes-ui-admin-vue3/src/views/heli/storagecheck/checkdetail.vue
+++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/storagecheck/checkdetail.vue
@@ -30,7 +30,7 @@
-
+
@@ -62,7 +62,7 @@
-
+
{{ dict.label }}
@@ -74,7 +74,8 @@
-
+
@@ -83,7 +84,7 @@
-
+
@@ -103,46 +104,24 @@
v-loading="subFormLoading" label-width="0">
-
- 物料名称
-
-
- handleMatCode(scope, val)" class="!w-180px">
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
+
- 出库库区
+ 库区
-
+
- 出库库位
+ 库位
@@ -152,9 +131,10 @@
+
- 出库数量
+ 盘点数量
@@ -162,27 +142,14 @@
-
-
-
-
-
-
+
-
删除
+ 复制
@@ -283,11 +250,11 @@
@@ -305,7 +272,6 @@ import * as CheckApi from '@/api/heli/storagecheck'
import * as CheckMatApi from '@/api/heli/storagecheckmat'
import * as UserApi from '@/api/system/user'
-import * as MatApi from '@/api/heli/material'
import * as WhApi from '@/api/heli/warehouse'
import * as RgApi from '@/api/heli/rg'
import * as PnApi from '@/api/heli/pn'
@@ -328,7 +294,7 @@ const formData = ref({
stockNo: undefined,
checkType: undefined,
checkTime: undefined,
- status:undefined,
+ status: undefined,
noZero: undefined,
whId: undefined,
description: undefined,
@@ -373,52 +339,6 @@ const handleStatus = async (num) => {
} catch (e) {
return
}
- //保存表单数据
- await saveFormData()
-
- formData.value.status = num
-
- const dataUpdate = formData.value as unknown as CheckApi.StorageVO
- if (num == 2) {
- dataUpdate.outbound = useUserStore().getUser.id
- } else {
- dataUpdate.cancel = useUserStore().getUser.id
- }
- await CheckApi.updateStorageStatus(dataUpdate)
-
- message.success(t('common.updateSuccess'))
-
- switch (num) {
- case 1:
- isShowBtnGroup.value = true
- isShowBtnCancel.value = false
- isShowBtnOther.value = true
- isShowBtnDelete.value = true
- break
- case 2:
- isShowBtnGroup.value = false
- isShowBtnCancel.value = true
- isShowBtnOther.value = false
- isShowBtnDelete.value = false
- break
- case 3:
- isShowBtnGroup.value = false
- isShowBtnCancel.value = false
- isShowBtnOther.value = false
- isShowBtnDelete.value = false
- break
- default:
- break
- }
- //查看页面不可以编辑
- if (query.type === 'review') {
- isShowBtnGroup.value = false
- isShowBtnCancel.value = false
- isShowBtnOther.value = false
- isShowBtnDelete.value = false
- }
- query.id = storageid.value
- query.type = 'update'
reload()
}
const userList = ref([]) // 用户列表
@@ -476,7 +396,6 @@ const downloadAttachment = async (name, url) => {
}
// ====================附件信息 结束=======================================
-const storageid = ref()
var commonResult = ''
/** 提交表单 */
@@ -487,17 +406,28 @@ const saveFormData = async () => {
// 提交请求
formLoading.value = true
try {
+
+ const data = formData.value as unknown as CheckApi.StorageCheckVO
+ await CheckApi.updateStorageCheck(data)
//物料信息保存
- formData.value.matItemDOList.forEach((item) => {
- item.stockId = storageid.value
- item.whId = formData.value.whId
- })
+ if( formData.value.matItemDOList){
+ formData.value.matItemDOList.forEach((item) => {
+ item.stockId = formData.value.id
+ item.whId = formData.value.whId
+ })
+ }
const dataMats = formData.value.matItemDOList as unknown as CheckMatApi.StorageCheckMatVO[]
- await CheckMatApi.createStorageMatBatch(dataMats, storageid.value)
+ //await CheckMatApi.createStorageMatBatch(dataMats, formData.value.id)
+
+ if (formData.value.matItemDOList !=undefined &&formData.value.matItemDOList.length > 0) {
+ //附件信息保存
+ matUploadData.value.businessId = formData.value.id
+ matUploadRef.value!.submit()
+ }
- if (formData.value.matItemDOList.length > 0) {
+ if (formData.value.attachments!=undefined && formData.value.attachments.length > 0) {
//附件信息保存
- matUploadData.value.businessId = storageid
+ matUploadData.value.businessId = formData.value.id
matUploadRef.value!.submit()
}
message.success(t(commonResult))
@@ -508,10 +438,10 @@ const saveFormData = async () => {
const submitForm = async () => {
// 校验表单
await formRef.value.validate()
- if (formData.value.matItemDOList.length === 0) {
- message.alertWarning('请添加物料信息!')
- return
- }
+ // if (formData.value.matItemDOList ==undefined || formData.value.matItemDOList.length === 0) {
+ // message.alertWarning('请添加物料信息!')
+ // return
+ // }
// 校验子表单
try {
await matSubFormRef.value.validate()
@@ -521,87 +451,54 @@ const submitForm = async () => {
//保存表单数据
await saveFormData()
// 成功后刷新
- query.id = storageid.value
- query.type = 'update'
reload()
}
var matCount = 1
const onAddItem = () => {
- if (formData.value.whId) {
- const newData = {
- // 新数据的属性
- cid: matCount,
- stockId: 0,
- matId: '',
- matName: '',
- matCode: '',
- matType: '',
- matSpec: '',
- matUnit: '',
- whId: '',
- rgId: '',
- pnId: '',
- pnlist: ref([]),
- storageOkQty: '',
- lotNo: '',
- description: '',
- productBomItemValueDOList: []
- }
- matCount = matCount + 1
-
- formData.value.matItemDOList.push(newData)
- } else {
- message.alertWarning('请选择出库仓库')
+ const newData = {
+ // 新数据的属性
+ cid: matCount,
+ isCopy: 0,
+ stockId: 0,
+ matId: '',
+ matName: '',
+ matCode: '',
+ matType: '',
+ matSpec: '',
+ matUnit: '',
+ matRest: '',
+ whId: '',
+ rgId: '',
+ pnId: '',
+ pnlist: ref([]),
+ storageOkQty: '',
+ lotNo: '',
+ description: '',
+ productBomItemValueDOList: []
}
+ matCount = matCount + 1
+
+ formData.value.matItemDOList.push(newData)
}
//删除新增物料信息
const handleDelete2 = (index: number) => {
- formData.value.matItemDOList.splice(index, 1)
+ var itemDelteing = formData.value.matItemDOList[index]
+ if (itemDelteing.isCopy == 0) {
+ message.alertWarning("原始物料不能删除")
+ } else {
+ formData.value.matItemDOList.splice(index, 1)
+ }
}
//仓库全数据
-const warehouseList = ref([])
+const whList = ref([])
//库区全数据
var rgList = ref([])
//库位全数据
var pnList = ref([])
-const handleWh = async (wid) => {
- //-------------------库区全数据
- const queryParamsRg = reactive({
- pageNo: 1,
- pageSize: 99,
- whId: wid
- })
- const dataRg = await RgApi.getRgPage(queryParamsRg)
-
- rgList.value = []
- pnList.value = []
- rgList.value = dataRg.list
-
- const matLastRemoteData = await CheckMatApi.getStorageMatList()
-
- let matParams = {
- pageNo: 1,
- pageSize: 99,
- status: '1'
- }
- const dataMat = await MatApi.getMaterialPage(matParams)
- matList.value = []
- matList.value = dataMat.list.filter(
- (item) =>
- matLastRemoteData.find((fish) => fish.matId === item.id && fish.whId == wid) !== undefined
- )
- formData.value.matItemDOList = []
- // formData.value.matItemDOList.forEach(item => {
- // item.rgId = ''
- // item.pnId = ''
- // item.pnlist.value = []
- // })
- //-------------------
-}
const handleRg = async (scope) => {
//-------------------库位全数据
const queryParamsRPn = reactive({
@@ -616,203 +513,32 @@ const handleRg = async (scope) => {
//-------------------
}
-const matList = ref([]) // 物料列表
-const matSelectLoading = ref(false)
-const remoteMatCodeSearch = async (name) => {
- matSelectLoading.value = true
- // 获得用户列表
- let matParams = {
- pageNo: 1,
- pageSize: 10,
- name: name,
- status: '1'
- }
-
- const matLastRemoteData = await CheckMatApi.getStorageMatList()
-
- const dataMat = await MatApi.getMaterialPage(matParams)
- matList.value = []
- matList.value = dataMat.list.filter(
- (item) =>
- matLastRemoteData.find(
- (fish) => fish.matId === item.id && fish.whId == formData.value.whId
- ) !== undefined
- )
- matSelectLoading.value = false
-}
-
-const handleMatCode = async (scope, matid) => {
- if (matid && matLastData.value.find((item) => item.matId === matid)) {
- const matVo = matLastData.value.find((item) => item.matId === matid)
- scope.row.matId = matVo.matId
- scope.row.matName = matVo.matName
- scope.row.matCode = matVo.matCode
- scope.row.matSpec = matVo.matSpec
- scope.row.matType = matVo.materialType
- scope.row.matUnit = matVo.matUnit
- scope.row.rgId = matVo.rgId
- scope.row.pnId = matVo.pnId
- scope.row.matRest = matVo.matRest
- scope.row.storageOkQty = matVo.storageOkQty
- scope.row.lotNo = matVo.lotNo
- scope.row.description = matVo.description
-
- 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 {
- scope.row.matId = ''
- scope.row.matName = ''
- scope.row.matCode = ''
- scope.row.matSpec = ''
- scope.row.matType = ''
- scope.row.matUnit = ''
- scope.row.rgId = ''
- scope.row.pnId = ''
- scope.row.matRest = ''
- scope.row.storageOkQty = ''
- scope.row.lotNo = ''
- scope.row.description = ''
- scope.row.pnlist = []
- }
-}
-
-const isShowBtnGroup = ref(true)
-const isShowBtnCancel = ref(false)
const isShowBtnOther = ref(false)
const isShowBtnDelete = ref(true)
-const btnWhClickable = ref(false)
-const matLastData = ref([])
+
+//仓库列表
+const init_page_wh = (async ()=>{
+ whList.value = await WhApi.getSimpList()
+})
+//库区列表
+const init_page_rg = (async ()=>{
+ rgList.value = await RgApi.getSimpList()
+})
/** 初始化 **/
onMounted(async () => {
- btnWhClickable.value = query.type === 'update' ? true : false
- matLastData.value = await CheckMatApi.getStorageMatList()
+ await init_page_wh()
+ await init_page_rg()
+ formData.value = await CheckApi.getStorageCheck(query.id)
- // 获得物料列表
- let matParams = {
+ // 附件信息
+ let attParams = {
pageNo: 1,
pageSize: 99,
- status: '1'
+ businessId: query.id,
+ businessType: 'STORAGECHECK'
}
- const dataMat = await MatApi.getMaterialPage(matParams)
- matList.value = []
- matList.value = dataMat.list
-
- dialogTitle.value = t('action.' + query.type)
- dialogTitle.value = query.type === 'review' ? '查看' : dialogTitle.value
-
- //-------------------仓库全数据
- const data = await WhApi.getWarehouseSimpList()
- warehouseList.value = data
- //-------------------
- if (query.id) {
- //获取库存信息
- formData.value = await CheckApi.getStorage(query.id)
-
- switch (formData.value.status) {
- case 1:
- isShowBtnGroup.value = true
- isShowBtnCancel.value = false
- isShowBtnDelete.value = true
- break
- case 2:
- isShowBtnGroup.value = false
- isShowBtnCancel.value = true
- isShowBtnOther.value = false
- isShowBtnDelete.value = false
- break
- case 3:
- isShowBtnGroup.value = false
- isShowBtnCancel.value = false
- isShowBtnOther.value = false
- isShowBtnDelete.value = false
- break
- default:
- break
- }
- //查看页面不可以编辑
- if (query.type === 'review') {
- isShowBtnGroup.value = false
- isShowBtnCancel.value = false
- isShowBtnOther.value = false
- isShowBtnDelete.value = false
- }
-
- //获得库区列表
- const queryParamsRg = reactive({
- pageNo: 1,
- pageSize: 99,
- status: 1,
- whId: formData.value.whId
- })
- const dataRg = await RgApi.getRgPage(queryParamsRg)
-
- rgList.value = []
- rgList.value = dataRg.list
- //获得库区列表
- const queryParamsPn = reactive({
- pageNo: 1,
- pageSize: 99
- })
- const dataPn = await PnApi.getPnPage(queryParamsPn)
-
- pnList.value = []
- pnList.value = dataPn.list
-
- //获取库存物料列表信息
- const queryParamsMat = reactive({
- pageNo: 1,
- pageSize: 99,
- stockId: query.id
- })
- const dataMats = await CheckMatApi.getStorageMatPage(queryParamsMat)
- formData.value.matItemDOList = dataMats.list
-
- //获取原始物料信息
- const queryParamsMat2 = reactive({
- pageNo: 1,
- pageSize: 99,
- status: 1
- })
- const matVos = await MatApi.getMaterialPage(queryParamsMat2)
-
- formData.value.matItemDOList.forEach((item) => {
- item.cid = matCount
- 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)?.code
- item.matSpec = matVos.list.find((record) => record.id == item.matId)?.spec
- item.matType = matVos.list.find((record) => record.id == item.matId)?.materialType
- 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
- item.matRest = item.matRest == undefined ? 0 : item.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.cid = matCount
- // matCount = matCount + 1
- })
-
- // 附件信息
- let attParams = {
- pageNo: 1,
- pageSize: 99,
- businessId: query.id,
- businessType: 'STORAGE'
- }
- formData.value.attachments = (await getFilePage(attParams)).list
- }
-
+ formData.value.attachments = (await getFilePage(attParams)).list
//用户信息
userList.value = await UserApi.getSimpleUserList()
})
diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/storagecheck/index.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/storagecheck/index.vue
index 4b3d4786..f6d39306 100644
--- a/mes-ui/mes-ui-admin-vue3/src/views/heli/storagecheck/index.vue
+++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/storagecheck/index.vue
@@ -59,9 +59,17 @@
-
+
+
+ {{ userList.find((user) => user.id == scope.row.creator)?.nickname }}
+
+
-
+
+
+ {{ userList.find((user) => user.id == scope.row.keeper)?.nickname }}
+
+
@@ -95,6 +103,7 @@ import download from '@/utils/download'
import * as StorageCheckApi from '@/api/heli/storagecheck'
import StorageCheckForm from './StorageCheckForm.vue'
import * as WarehouseApi from '@/api/heli/warehouse'
+import * as UserApi from '@/api/system/user'
defineOptions({ name: 'StorageCheck' })
@@ -128,6 +137,7 @@ const queryParams = reactive({
})
const queryFormRef = ref() // 搜索的表单
const exportLoading = ref(false) // 导出的加载中
+const userList = ref([]) // 用户列表
const whList = ref([])
//仓库列表
const init_page_wh = (async () => {
@@ -137,6 +147,8 @@ const init_page_wh = (async () => {
const getList = async () => {
loading.value = true
try {
+ //用户信息
+ userList.value = await UserApi.getSimpleUserList()
const data = await StorageCheckApi.getStorageCheckPage(queryParams)
list.value = data.list
total.value = data.total
@@ -198,6 +210,7 @@ const handleExport = async () => {
/** 初始化 **/
onMounted(async () => {
+
await init_page_wh()
await getList()
})