Browse Source

物料降级需求

hella_online_20240829
wangyufei 4 months ago
parent
commit
3252404c91
  1. 34
      src/views/wms/basicDataManage/itemManage/relegate/relegateRequest/index.vue

34
src/views/wms/basicDataManage/itemManage/relegate/relegateRequest/index.vue

@ -93,6 +93,7 @@ import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue' import Detail from '@/components/Detail/src/Detail.vue'
import { ProductreceiptRequestLabel,ProductreceiptRequestLabelRules } from '../../../../productionManage/productreceipt/productreceiptRequestMain/productreceiptRequestMain.data' import { ProductreceiptRequestLabel,ProductreceiptRequestLabelRules } from '../../../../productionManage/productreceipt/productreceiptRequestMain/productreceiptRequestMain.data'
import * as ProductionitemcodeSpareitemcodeApi from '@/api/wms/productionitemcodeSpareitemcode'
defineOptions({ name: 'RelegateRequestMain' }) defineOptions({ name: 'RelegateRequestMain' })
@ -116,6 +117,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
if(val.length==0) return if(val.length==0) return
val.forEach(item=>{ val.forEach(item=>{
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item})) const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item}))
newRow['id'] = item['id']
newRow['itemCode'] = item['itemCode'] newRow['itemCode'] = item['itemCode']
newRow['uom'] = item['uom'] newRow['uom'] = item['uom']
newRow['qty'] = item['qty'] newRow['qty'] = item['qty']
@ -127,6 +129,31 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
newRow['inventoryStatus'] = item['inventoryStatus'] newRow['inventoryStatus'] = item['inventoryStatus']
tableData.value.push(newRow) tableData.value.push(newRow)
}) })
let itemCodes = []
val.forEach(item=>{
if(!itemCodes.find(item1=>item1==item['itemCode'])){
itemCodes.push(item['itemCode'])
}
})
console.log('过滤之后的物料代码',itemCodes)
itemCodes.forEach(async (item)=>{
let res = await ProductionitemcodeSpareitemcodeApi.getProductionitemcodeSpareitemcodeRelation({
code:item,
available: 'TRUE',
pageSize: 20,
pageNo: 1,
by: 'ASC'
})
if(res.list&&res.list.length>0){
tableData.value.forEach(item1=>{
if(item1['itemCode']==item){
item1['downItemCode'] = res.list[0]['code']
}
})
}
console.log(res)
})
} else if (formField == 'downItemCode') { } else if (formField == 'downItemCode') {
// if(row['itemCode'] == val[0]['spareItemCode']){ // if(row['itemCode'] == val[0]['spareItemCode']){
// row['downItemCode'] = val[0]['productionItemCode'] // // row['downItemCode'] = val[0]['productionItemCode'] //
@ -292,9 +319,9 @@ const isShowMainButton = (row, val) => {
} }
// - // -
const butttondata = (row, $index) => { const butttondata = (row,$index) => {
const findIndex = row['masterId'] ? tableObject.tableList.findIndex(item => item['masterId'] == row['masterId']) : -1 const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1
if (findIndex > 0 && findIndex < $index) { if(findIndex>-1&&findIndex<$index){
return [] return []
} }
return [ return [
@ -387,6 +414,7 @@ const buttonTableClick = async (val, row) => {
/** 添加/修改操作 */ /** 添加/修改操作 */
const basicFormRef = ref() const basicFormRef = ref()
const openForm = (type: string, row?: any) => { const openForm = (type: string, row?: any) => {
tableData.value = []
basicFormRef.value.open(type, row) basicFormRef.value.open(type, row)
} }
//true0 //true0

Loading…
Cancel
Save