Browse Source

备货申请 物料代码搜索框根据情况展示/隐藏

master_hella_20240701
chenfang 6 months ago
parent
commit
a03fda7834
  1. 2
      src/views/wms/deliversettlementManage/deliver/deliverJobMain/index.vue
  2. 36
      src/views/wms/deliversettlementManage/stockup/stockupMainRequest/index.vue
  3. 33
      src/views/wms/deliversettlementManage/stockup/stockupMainRequest/stockupMainRequest.data.ts

2
src/views/wms/deliversettlementManage/deliver/deliverJobMain/index.vue

@ -302,7 +302,7 @@ const { wsCache } = useCache()
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => { const openDetail = (row: any, titleName: any, titleValue: any) => {
const departmentCode = wsCache.get(CACHE_KEY.DEPT).find((account) => account.id == row.departmentCode)?.name const departmentCode = wsCache.get(CACHE_KEY.DEPT).find((account) => account.id == row.departmentCode)?.name
if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode)) if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode))
detailRef.value.openDetail(row, titleName, titleValue,'jobDeliverMain') detailRef.value.openDetail(row, titleName, titleValue,'jobDeliverMain')
} }

36
src/views/wms/deliversettlementManage/stockup/stockupMainRequest/index.vue

@ -149,7 +149,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
}) })
if (res) tableData.value = res if (res) tableData.value = res
// tableform // tableform
DeliverRequestDetail.allSchemas.tableFormColumns.map(item => { StockupDetailRequest.allSchemas.tableFormColumns.map(item => {
if(item.field == 'itemCode') { if(item.field == 'itemCode') {
item.isInpuFocusShow = false item.isInpuFocusShow = false
item.tableForm.isInpuFocusShow = false item.tableForm.isInpuFocusShow = false
@ -423,24 +423,24 @@ const submitForm = async (formType, data) => {
data.subList = tableData.value // data.subList = tableData.value //
let isExist = false let isExist = false
tableData.value.forEach(item => { tableData.value.forEach(item => {
// let rs = tableData.value.filter(filterItem => (filterItem.itemCode == item.itemCode)) let rs = tableData.value.filter(filterItem => (filterItem.itemCode == item.itemCode))
// if(rs.length > 1) isExist = true if(rs.length > 1) isExist = true
// })
// if (isExist) {
// formRef.value.formLoading = false
// return message.warning('')
// }
// data.subList.forEach(obj => {
// if(obj.qty == 0){
// message.warning(`0!`)
// flag.value = true
// return;
// }
}) })
// if(flag.value){ if (isExist) {
// formRef.value.formLoading = false formRef.value.formLoading = false
// return return message.warning('物料代码重复')
// } }
data.subList.forEach(obj => {
if(obj.qty == 0){
message.warning(`数量不能为0!`)
flag.value = true
return;
}
})
if(flag.value){
formRef.value.formLoading = false
return
}
try { try {
if (formType === 'create') { if (formType === 'create') {
if(tableData.value.length <= 0){ if(tableData.value.length <= 0){

33
src/views/wms/deliversettlementManage/stockup/stockupMainRequest/stockupMainRequest.data.ts

@ -4,15 +4,15 @@ import { TableColumn } from '@/types/table'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import * as getRequestsettingApi from '@/api/wms/requestsetting/index' import * as getRequestsettingApi from '@/api/wms/requestsetting/index'
import * as BalanceApi from '@/api/wms/balance'
import { Balance } from '@/views/wms/inventoryManage/balance/balance.data'
import * as DeliverPlanMainApi from '@/api/wms/deliverPlanMain' import * as DeliverPlanMainApi from '@/api/wms/deliverPlanMain'
import { DeliverPlanMain } from '../../deliverplan/deliverPlanMain/deliverPlanMain.data' import { DeliverPlanMain } from '../../deliverplan/deliverPlanMain/deliverPlanMain.data'
import * as locationApi from '@/api/wms/location' import * as locationApi from '@/api/wms/location'
import { Location } from '../../../basicDataManage/factoryModeling/location/location.data' import { Location } from '../../../basicDataManage/factoryModeling/location/location.data'
import * as ItemBasicApi from '@/api/wms/itembasic'
import { Itembasic } from '../../../basicDataManage/itemManage/itembasic/itembasic.data'
const { t } = useI18n() // 国际化 const { t } = useI18n() // 国际化
// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值 // 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
@ -26,6 +26,7 @@ const queryParams = {
// 获取当前操作人的部门 // 获取当前操作人的部门
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
import { ItemBasic } from '@/utils/disposition/formFields'
const userStore = useUserStore() const userStore = useUserStore()
const userDept = userStore.userSelfInfo.dept const userDept = userStore.userSelfInfo.dept
// id 转str 否则form回显匹配不到 // id 转str 否则form回显匹配不到
@ -569,12 +570,32 @@ export const StockupDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: 150 width: 150
}, },
tableForm: { tableForm:{
disabled: true isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择物料代码',
searchField: 'itemCode',
searchTitle: '物料基础信息',
searchAllSchemas: Itembasic.allSchemas,
searchPage: ItemBasicApi.getItembasicPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}, },
form: { form: {
componentProps: { componentProps: {
disabled: true isSearchList: true,
searchListPlaceholder: '请选择物料代码',
searchField: 'itemCode',
searchTitle: '物料基础信息',
searchAllSchemas: Itembasic.allSchemas,
searchPage: ItemBasicApi.getItembasicPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
} }
} }
}, },

Loading…
Cancel
Save