Browse Source

Merge branch 'hella_online_20240829' of http://dev.ccwin-in.com:3000/sfms3.0/sfms3.0-ui into hella_online_20240829

hella_online_20240829
songguoqiang 3 months ago
parent
commit
e2ce05e846
  1. 170
      src/views/wms/moveManage/inventorymove/inventorymoveRequestMainOKHOLD/index.vue
  2. 48
      src/views/wms/moveManage/inventorymove/inventorymoveRequestMainOKHOLD/inventorymoveRequestMain.data.ts

170
src/views/wms/moveManage/inventorymove/inventorymoveRequestMainOKHOLD/index.vue

@ -94,7 +94,8 @@ import { formatDate } from '@/utils/formatTime'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { usePageLoading } from '@/hooks/web/usePageLoading' import { usePageLoading } from '@/hooks/web/usePageLoading'
const { loadStart, loadDone } = usePageLoading() const { loadStart, loadDone } = usePageLoading()
// //
// 使
defineOptions({ name: 'InventorymoveRequestMain' }) defineOptions({ name: 'InventorymoveRequestMain' })
const message = useMessage() // const message = useMessage() //
@ -115,81 +116,15 @@ const { tableObject, tableMethods } = useTable({
getListApi: InventorymoveRequestDetailApi.getInventorymoveRequestDetailPage // getListApi: InventorymoveRequestDetailApi.getInventorymoveRequestDetailPage //
}) })
// tableObject.params = {
/** // fromInventoryStatus: 'OK',
* OktoholdRequestMain 合格转隔离 // toInventoryStatus:'HOLD',
*/ businessType :'OkToHold'
if ( routeName.value == 'OktoholdRequestMain') {
tableObject.params = {
// fromInventoryStatus: 'OK',
// toInventoryStatus:'HOLD',
businessType :'OkToHold'
}
// fromInventoryStatus.value = 'OK'
// toInventoryStatus.value = "HOLD"
businessType.value = 'OkToHold'
importFileName.value = '物料转隔离申请'
}
else if ( routeName.value == 'NoktoholdRequestMain') {
tableObject.params = {
// fromInventoryStatus: 'NOK',
// toInventoryStatus:'HOLD',
businessType :'NokToHold'
}
// fromInventoryStatus.value = 'NOK'
// toInventoryStatus.value = "HOLD"
businessType.value = 'NokToHold'
importFileName.value = '不合格转隔离申请'
}
else if ( routeName.value == 'HoldtookRequestMain') {
tableObject.params = {
// fromInventoryStatus: 'HOLD',
// toInventoryStatus:'OK',
businessType :'HoldToOk'
}
// fromInventoryStatus.value = 'HOLD'
// toInventoryStatus.value = "OK"
businessType.value = 'HoldToOk'
importFileName.value = '隔离转合格申请'
} else if ( routeName.value == 'HoldtoscrapRequestMain') {
tableObject.params = {
// fromInventoryStatus: 'HOLD',
// toInventoryStatus:'SCRAP',
businessType:'HoldToScrap'
}
// fromInventoryStatus.value = 'HOLD'
// toInventoryStatus.value = "SCRAP"
businessType.value = 'HoldToScrap'
importFileName.value = '隔离转报废申请'
} else if ( routeName.value == 'OktoscrapRequestMain') {
tableObject.params = {
// fromInventoryStatus: 'OK',
// toInventoryStatus:'SCRAP',
businessType :'OkToScrap'
}
// fromInventoryStatus.value = 'OK'
// toInventoryStatus.value = "SCRAP"
businessType.value = 'OkToScrap'
importFileName.value = '合格转报废申请'
} }
else if ( routeName.value == 'ScraptoholdRequestMain') { // fromInventoryStatus.value = 'OK'
tableObject.params = { // toInventoryStatus.value = "HOLD"
// fromInventoryStatus: 'SCRAP', businessType.value = 'OkToHold'
// toInventoryStatus:'HOLD', importFileName.value = '物料转隔离申请'
businessType :'ScrapToHold'
}
// fromInventoryStatus.value = 'SCRAP'
// toInventoryStatus.value = "HOLD"
businessType.value = 'ScrapToHold'
importFileName.value = '报废转隔离申请'
} else {
tableObject.params = {
businessType :'Move'
}
businessType.value = 'Move'
importFileName.value = '库存移动申请'
}
console.log(99 , businessType.value)
InventorymoveRequestMain.allSchemas.tableFormColumns.map(item =>{ InventorymoveRequestMain.allSchemas.tableFormColumns.map(item =>{
if(item.field == 'fromWarehouseCode') { if(item.field == 'fromWarehouseCode') {
@ -349,27 +284,20 @@ const updataTableColumns = (val) => {
// - // -
const getDefaultToLocationCode = async ()=>{ const getDefaultToLocationCode = async ()=>{
let searchCondition = [] let searchCondition = []
InventorymoveRequestDetail.allSchemas.tableFormColumns.map(item => { InventorymoveRequestMain.allSchemas.formSchema.map(item => {
if(item.field == "toLocationCode"){ if(item.field == "toLocationCode"){
searchCondition = item.tableForm.searchCondition searchCondition = item.componentProps.searchCondition
} }
}) })
let params = {} let params = {}
searchCondition.forEach(item=>{ searchCondition.forEach(item=>{
if(item['isMainValue']){ params[item['key']] = item['value']
params[item['key']] = formRef.value.formRef.formModel[item['value']]
}else{
params[item['key']] = item['value']
}
}) })
console.log('params',params)
let res = await LocationApi.selectBusinessTypeToLocation(params) let res = await LocationApi.selectBusinessTypeToLocation(params)
console.log('res',res) console.log('获取到库位默认值',res)
if(res&&res.list.length>0){ if(res&&res.list.length>0){
tableData.value.forEach(item=>{ formRef.value.formRef.formModel["toLocationCode"] = res.list[0]['code']
if(!item['toLocationCode']){
item['toLocationCode'] = res.list[0]['code']
}
})
} }
} }
// //
@ -389,26 +317,9 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
newRow['fromLocationCode'] = item['locationCode'] newRow['fromLocationCode'] = item['locationCode']
newRow['uom'] = item['uom'] newRow['uom'] = item['uom']
newRow['qty'] = item['qty'] newRow['qty'] = item['qty']
if(routeName.value == 'OktoholdRequestMain'){ newRow['toInventoryStatus'] = "HOLD" //
newRow['toInventoryStatus'] = "HOLD"
}else if(routeName.value == 'NoktoholdRequestMain'){
newRow['toInventoryStatus'] = "HOLD"
}else if ( routeName.value == 'HoldtookRequestMain') {
newRow['toInventoryStatus'] = "OK"
}else if ( routeName.value == 'HoldtoscrapRequestMain') {
newRow['toInventoryStatus'] = "SCRAP"
}else if ( routeName.value == 'OktoscrapRequestMain') {
newRow['toInventoryStatus'] = "SCRAP"
}else if ( routeName.value == 'ScraptoholdRequestMain') {
newRow['toInventoryStatus'] = "HOLD"
}else{
newRow['toInventoryStatus'] = item['inventoryStatus']
}
tableData.value.push(newRow) tableData.value.push(newRow)
}) })
if(routeName.value == 'OktoholdRequestMain'){
getDefaultToLocationCode()
}
} else { } else {
row[formField] = val[0][searchField] row[formField] = val[0][searchField]
} }
@ -446,21 +357,8 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
setV['fromInventoryStatus'] = val[0]['inventoryStatus'] setV['fromInventoryStatus'] = val[0]['inventoryStatus']
setV['fromLocationCode'] = val[0]['locationCode'] setV['fromLocationCode'] = val[0]['locationCode']
setV['uom'] = val[0]['uom'] setV['uom'] = val[0]['uom']
if(routeName.value == 'OktoholdRequestMain'){ setV['toInventoryStatus'] = "HOLD"
setV['toInventoryStatus'] = "HOLD"
}else if(routeName.value == 'NoktoholdRequestMain'){
setV['toInventoryStatus'] = "HOLD"
}else if ( routeName.value == 'HoldtookRequestMain') {
setV['toInventoryStatus'] = "OK"
}else if ( routeName.value == 'HoldtoscrapRequestMain') {
setV['toInventoryStatus'] = "SCRAP"
}else if ( routeName.value == 'OktoscrapRequestMain') {
setV['toInventoryStatus'] = "SCRAP"
}else if ( routeName.value == 'ScraptoholdRequestMain') {
setV['toInventoryStatus'] = "HOLD"
}else{
setV['toInventoryStatus'] = val[0]['inventoryStatus']
}
} else { } else {
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
} }
@ -638,6 +536,8 @@ const openForm =async (type: string, row?: number) => {
} }
tableData.value = [] // tableData.value = [] //
formRef.value.open(type, row) formRef.value.open(type, row)
getDefaultToLocationCode()
} }
/** /**
@ -695,27 +595,9 @@ const handleExport = async () => {
// //
loadStart() loadStart()
const excelTitle = ref(route.meta.title) const excelTitle = ref(route.meta.title)
if(routeName.value == 'OktoholdRequestMain'){ const data = await InventorymoveRequestMainApi.exportOkToHoldRequestMain(tableObject.params)
const data = await InventorymoveRequestMainApi.exportOkToHoldRequestMain(tableObject.params) download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
}else if ( routeName.value == 'HoldtookRequestMain') {
const data = await InventorymoveRequestMainApi.exportHoldToOkRequestMain(tableObject.params)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
}else if ( routeName.value == 'HoldtoscrapRequestMain') {
const data = await InventorymoveRequestMainApi.exportHoldToScrapRequestMain(tableObject.params)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
}else if ( routeName.value == 'OktoscrapRequestMain') {
const data = await InventorymoveRequestMainApi.exportOkToScrapRequestMain(tableObject.params)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
}
// else if ( routeName.value == 'ScraptoholdRequestMain') {
// const data = await InventorymoveRequestMainApi.exportScrapToHoldRequestMain(tableObject.params)
// download.excel(data, '.xlsx')
// }
else{
const data = await InventorymoveRequestMainApi.exportInventorymoveRequestMain(tableObject.params)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
}
} catch { } catch {
} finally { } finally {
loadDone() loadDone()
@ -754,7 +636,8 @@ const submitForm = async (formType, submitData) => {
if(data.masterId){ if(data.masterId){
data.id = data.masterId data.id = data.masterId
} }
let findLocation = tableData.value.find(item=>item.fromLocationCode&&item.toLocationCode&&item.fromLocationCode==item.toLocationCode) let toLocationCode = data['toLocationCode'] //
let findLocation = tableData.value.find(item=>item.fromLocationCode&&toLocationCode&&item.fromLocationCode==toLocationCode)
if(findLocation){ if(findLocation){
message.warning('从库位和到库位不能相同') message.warning('从库位和到库位不能相同')
return return
@ -762,6 +645,7 @@ const submitForm = async (formType, submitData) => {
data.subList = tableData.value // data.subList = tableData.value //
let isExist = false let isExist = false
tableData.value.forEach(item => { tableData.value.forEach(item => {
item['toLocationCode'] = toLocationCode
let rs = tableData.value.filter(filterItem => (filterItem.fromPackingNumber&&filterItem.fromPackingNumber == item.fromPackingNumber) ) let rs = tableData.value.filter(filterItem => (filterItem.fromPackingNumber&&filterItem.fromPackingNumber == item.fromPackingNumber) )
console.log(rs,5666); console.log(rs,5666);
if(rs.length > 1) isExist = true if(rs.length > 1) isExist = true

48
src/views/wms/moveManage/inventorymove/inventorymoveRequestMainOKHOLD/inventorymoveRequestMain.data.ts

@ -152,6 +152,44 @@ export const InventorymoveRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
}, },
isForm: false, isForm: false,
}, },
{
label: '到库位代码', // 子表数据--新增在form上展示
field: 'toLocationCode',
sort: 'custom',
isForm:true,
isTable:false,
isDetail:false,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择到库位代码',
searchField: 'code',
searchTitle: '库位信息',
searchAllSchemas: Location.allSchemas,
searchPage: LocationApi.selectBusinessTypeToLocation,
searchCondition: [
{
key: 'businessType',
value: 'OkToHold',
isMainValue: false
},{
key: 'isIn',
value: 'in',
isMainValue: false
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
}
}
},
{ {
label: '截止时间', label: '截止时间',
field: 'dueTime', field: 'dueTime',
@ -464,6 +502,9 @@ export const InventorymoveRequestMainRules = reactive({
fromWarehouseCode: [ fromWarehouseCode: [
{ required: true, message: '请选择从仓库代码', trigger: 'blur' } { required: true, message: '请选择从仓库代码', trigger: 'blur' }
], ],
toLocationCode: [
{ required: true, message: '请选择到库位代码', trigger: 'change' }
],
status: [ status: [
{ required: true, message: '请选择状态', trigger: 'change' } { required: true, message: '请选择状态', trigger: 'change' }
], ],
@ -703,7 +744,7 @@ export const InventorymoveRequestDetail = useCrudSchemas(reactive<CrudSchema[]>(
table: { table: {
width: 150 width: 150
}, },
isTableForm:true, isTableForm:false, //放在主表展示了--喜婷
tableForm: { tableForm: {
enterSearch: true, enterSearch: true,
isInpuFocusShow: true, // 开启查询弹窗 isInpuFocusShow: true, // 开启查询弹窗
@ -751,7 +792,7 @@ export const InventorymoveRequestDetail = useCrudSchemas(reactive<CrudSchema[]>(
key: 'isIn', key: 'isIn',
value: 'in', value: 'in',
isMainValue: false isMainValue: false
}], }],
verificationParams: [{ verificationParams: [{
key: 'code', key: 'code',
action: '==', action: '==',
@ -940,9 +981,6 @@ export const InventorymoveRequestDetailRules = reactive({
fromInventoryStatus: [ fromInventoryStatus: [
{ required: true, message: '请选择从库存状态', trigger: 'change' } { required: true, message: '请选择从库存状态', trigger: 'change' }
], ],
toLocationCode: [
{ required: true, message: '请选择到库位代码', trigger: 'change' }
],
remark: [ remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } { max: 50, message: '不得超过50个字符', trigger: 'blur' }
], ],

Loading…
Cancel
Save