Browse Source

工序报产修改HL-3797

hella_online_20240829
zhaoxuebing 4 months ago
parent
commit
b8b4a256a8
  1. 12
      src/api/wms/processproductionRequestMain/index.ts
  2. 36
      src/views/wms/productionManage/processproduction/processproductionRequest/index.vue
  3. 229
      src/views/wms/productionManage/processproduction/processproductionRequest/processproductionRequestMain.data.ts

12
src/api/wms/processproductionRequestMain/index.ts

@ -26,6 +26,18 @@ export const getProcessproductionRequestMainPage = async (params) => {
} }
} }
// 查询工序报产子物料
export const getProcessproductionChildBomPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/processproduction-request-main/queryChildItemByParentCodeSenior', data })
} else {
return await request.get({ url: `/wms/processproduction-request-main/queryChildItemByParentCodePage`, params })
}
}
// 查询工序报产申请主详情 // 查询工序报产申请主详情
export const getProcessproductionRequestMain = async (id: number) => { export const getProcessproductionRequestMain = async (id: number) => {
return await request.get({ url: `/wms/processproduction-request-main/get?id=` + id }) return await request.get({ url: `/wms/processproduction-request-main/get?id=` + id })

36
src/views/wms/productionManage/processproduction/processproductionRequest/index.vue

@ -98,7 +98,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' 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 * as BomApi from "@/api/wms/bom";
defineOptions({ name: 'ProcessproductionRequestMain' }) defineOptions({ name: 'ProcessproductionRequestMain' })
@ -119,20 +119,20 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
// if(tableData.value.find(item1=>item1['productionLine'] == item['productionLineCode'])) return // if(tableData.value.find(item1=>item1['productionLine'] == item['productionLineCode'])) return
const newRow = JSON.parse(JSON.stringify(tableFormKeys)) const newRow = JSON.parse(JSON.stringify(tableFormKeys))
newRow['productionLine'] = item['productionLineCode'] newRow['productionLine'] = item['productionLineCode']
const param1 = { // const param1 = {
productItemCode: formRef.formModel['itemCode'], // productItemCode: formRef.formModel['itemCode'],
available: 'TRUE', // available: 'TRUE',
pageSize: 20, // pageSize: 20,
pageNo: 1, // pageNo: 1,
sort: '', // sort: '',
by: 'ASC', // by: 'ASC',
} // }
await BomApi.getBomPage(param1).then(res => { // await BomApi.getBomPage(param1).then(res => {
console.log(res) // console.log(res)
if(res?.list?.length>0){ // if(res?.list?.length>0){
newRow['componentItemCode'] = res.list[0].componentItemCode // newRow['componentItemCode'] = res.list[0].componentItemCode
} // }
}) // })
tableData.value.push(newRow) tableData.value.push(newRow)
}) })
}else if(formField === 'processCode'){ }else if(formField === 'processCode'){
@ -140,7 +140,11 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
}else if(formField === 'locationCode'){ }else if(formField === 'locationCode'){
row['locationCode']=val[0]['code'] row['locationCode']=val[0]['code']
}else if(formField === 'componentItemCode'){ }else if(formField === 'componentItemCode'){
row['componentItemCode']=val[0]['componentItemCode'] row['componentItemCode']=val[0]['itemCode']
row['locationCode']=val[0]['locationCode']
row['batch']=val[0]['batch']
row['componentItemcodeQty']=val[0]['qty']
row['effectiveDate']=val[0]['produceDate']
} else { } else {
row[formField] = val[0][searchField] row[formField] = val[0][searchField]
} }

229
src/views/wms/productionManage/processproduction/processproductionRequest/processproductionRequestMain.data.ts

@ -10,6 +10,10 @@ import * as LocationApi from '@/api/wms/location'
import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data' import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data'
import {Bom} from "@/views/wms/basicDataManage/itemManage/bom/bom.data"; import {Bom} from "@/views/wms/basicDataManage/itemManage/bom/bom.data";
import * as BomApi from "@/api/wms/bom"; import * as BomApi from "@/api/wms/bom";
import * as BalanceApi from '@/api/wms/balance'
import * as ProcessproductionRequestMainApi from '@/api/wms/processproductionRequestMain'
import { Balance } from '@/views/wms/inventoryManage/balance/balance.data'
import { fa } from 'element-plus/es/locale' import { fa } from 'element-plus/es/locale'
export const ProcessproductionRequestMain = useCrudSchemas(reactive<CrudSchema[]>([ export const ProcessproductionRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
@ -447,63 +451,6 @@ export const ProcessproductionRequestDetail = useCrudSchemas(reactive<CrudSchema
} }
} }
}, },
{
label: '库位代码',
field: 'locationCode',
sort: 'custom',
table: {
width: 150
},
tableForm: {
enterSearch: true,
multiple:true,//多选
isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择库位代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '库位基础信息', // 查询弹窗标题
searchAllSchemas: Location.allSchemas, // 查询弹窗所需类
searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
multiple:true,//多选
searchListPlaceholder: '请选择库位代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '库位基础信息', // 查询弹窗标题
searchAllSchemas: Location.allSchemas, // 查询弹窗所需类
searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
}
}
},
{ {
label: '子物料代码', label: '子物料代码',
field: 'componentItemCode', field: 'componentItemCode',
@ -512,14 +459,14 @@ export const ProcessproductionRequestDetail = useCrudSchemas(reactive<CrudSchema
table: { table: {
width: 150 width: 150
}, },
tableForm: { tableForm:{
enterSearch: true, // enterSearch: true,
isInpuFocusShow: true, isInpuFocusShow: true,
searchListPlaceholder: '请选择子物料代码版本', // 输入框占位文本 searchListPlaceholder: '请选择子物料代码',
searchField: 'componentItemCode', // 查询弹窗赋值字段 searchField: 'componentItemCode',
searchTitle: '物料清单信息', // 查询弹窗标题 searchTitle: '库存余额物料清单信息',
searchAllSchemas: Bom.allSchemas, // 查询弹窗所需类 searchAllSchemas: Balance.allSchemas,
searchPage: BomApi.getBomPage, // 查询弹窗所需分页方法 searchPage: ProcessproductionRequestMainApi.getProcessproductionChildBomPage,
searchCondition: [{ searchCondition: [{
key:'productItemCode', key:'productItemCode',
value:'itemCode', value:'itemCode',
@ -544,11 +491,11 @@ export const ProcessproductionRequestDetail = useCrudSchemas(reactive<CrudSchema
componentProps: { componentProps: {
enterSearch: true, enterSearch: true,
isSearchList: true, // 开启查询弹窗 isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择Bom版本', // 输入框占位文本 searchListPlaceholder: '请选择子物料代码',
searchField: 'componentItemCode', // 查询弹窗赋值字段 searchField: 'componentItemCode',
searchTitle: '物料清单信息', // 查询弹窗标题 searchTitle: '库存余额物料清单信息',
searchAllSchemas: Bom.allSchemas, // 查询弹窗所需类 searchAllSchemas: Balance.allSchemas,
searchPage: BomApi.getBomPage, // 查询弹窗所需分页方法 searchPage: ProcessproductionRequestMainApi.getProcessproductionChildBomPage,
searchCondition: [{ searchCondition: [{
key:'productItemCode', key:'productItemCode',
value:'itemCode', value:'itemCode',
@ -568,7 +515,129 @@ export const ProcessproductionRequestDetail = useCrudSchemas(reactive<CrudSchema
isFormModel: true, isFormModel: true,
}], // 失去焦点校验参数 }], // 失去焦点校验参数
} }
}
// tableForm: {
// enterSearch: true,
// isInpuFocusShow: true,
// searchListPlaceholder: '请选择子物料代码版本', // 输入框占位文本
// searchField: 'componentItemCode', // 查询弹窗赋值字段
// searchTitle: '物料清单信息', // 查询弹窗标题
// searchAllSchemas: Bom.allSchemas, // 查询弹窗所需类
// searchPage: BomApi.getBomPage, // 查询弹窗所需分页方法
// searchCondition: [{
// key:'productItemCode',
// value:'itemCode',
// message: '请填写物料代码!',
// isMainValue: true
// },{
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// }],
// verificationParams: [{
// key: 'componentItemCode',
// action: '==',
// value: '',
// isMainValue: false,
// isSearch: true,
// isFormModel: true,
// }], // 失去焦点校验参数
// },
// form: {
// // labelMessage: '信息提示说明!!!',
// componentProps: {
// enterSearch: true,
// isSearchList: true, // 开启查询弹窗
// searchListPlaceholder: '请选择Bom版本', // 输入框占位文本
// searchField: 'componentItemCode', // 查询弹窗赋值字段
// searchTitle: '物料清单信息', // 查询弹窗标题
// searchAllSchemas: Bom.allSchemas, // 查询弹窗所需类
// searchPage: BomApi.getBomPage, // 查询弹窗所需分页方法
// searchCondition: [{
// key:'productItemCode',
// value:'itemCode',
// message: '请填写物料代码!',
// isMainValue: true
// },{
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// }],
// verificationParams: [{
// key: 'componentItemCode',
// action: '==',
// value: '',
// isMainValue: false,
// isSearch: true,
// isFormModel: true,
// }], // 失去焦点校验参数
// }
// },
}, },
{
label: '库位代码',
field: 'locationCode',
sort: 'custom',
table: {
width: 150
},
tableForm:{
disabled:true,
},
form: {
componentProps: {
disabled:true,
}
}
// tableForm: {
// enterSearch: true,
// multiple:true,//多选
// isInpuFocusShow: true, // 开启查询弹窗
// searchListPlaceholder: '请选择库位代码', // 输入框占位文本
// searchField: 'code', // 查询弹窗赋值字段
// searchTitle: '库位基础信息', // 查询弹窗标题
// searchAllSchemas: Location.allSchemas, // 查询弹窗所需类
// searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法
// searchCondition: [{
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// }],
// verificationParams: [{
// key: 'code',
// action: '==',
// value: '',
// isMainValue: false,
// isSearch: true,
// isFormModel: true,
// }], // 失去焦点校验参数
// },
// form: {
// // labelMessage: '信息提示说明!!!',
// componentProps: {
// enterSearch: true,
// isSearchList: true, // 开启查询弹窗
// multiple:true,//多选
// searchListPlaceholder: '请选择库位代码', // 输入框占位文本
// searchField: 'code', // 查询弹窗赋值字段
// searchTitle: '库位基础信息', // 查询弹窗标题
// searchAllSchemas: Location.allSchemas, // 查询弹窗所需类
// searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法
// searchCondition: [{
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// }],
// verificationParams: [{
// key: 'code',
// action: '==',
// value: '',
// isMainValue: false,
// isSearch: true,
// isFormModel: true,
// }], // 失去焦点校验参数
// }
// }
}, },
{ {
label: '批次', label: '批次',
@ -577,6 +646,14 @@ export const ProcessproductionRequestDetail = useCrudSchemas(reactive<CrudSchema
table: { table: {
width: 150 width: 150
}, },
tableForm:{
disabled:true,
},
form: {
componentProps: {
disabled:true,
}
}
}, },
{ {
label: '子物料数量', label: '子物料数量',
@ -610,6 +687,7 @@ export const ProcessproductionRequestDetail = useCrudSchemas(reactive<CrudSchema
width: 150 width: 150
}, },
form: { form: {
disabled:true,
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
style: {width: '100%'}, style: {width: '100%'},
@ -619,10 +697,11 @@ export const ProcessproductionRequestDetail = useCrudSchemas(reactive<CrudSchema
} }
}, },
tableForm:{ tableForm:{
disabled:true,
type:'FormDate', type:'FormDate',
placeholder: '请选择生产日期', placeholder: '请选择生产日期',
valueFormat: 'x', valueFormat: 'x',
}, }
}, },
{ {
label: '是否可用', label: '是否可用',
@ -669,8 +748,10 @@ export const ProcessproductionRequestDetail = useCrudSchemas(reactive<CrudSchema
table: { table: {
width: 130 width: 130
}, },
isSearch: false,
isForm: false, isForm: false,
isTable: true isTable: false,
isTableForm: false,
}, },
{ {
label: '删除时间', label: '删除时间',
@ -775,9 +856,9 @@ export const ProcessproductionRequestDetailRules = reactive({
productionLine: [ productionLine: [
{ required: true, message: '请选择生产线代码', trigger: 'change' } { required: true, message: '请选择生产线代码', trigger: 'change' }
], ],
processCode: [ // processCode: [
{ required: true, message: '请选择工序代码', trigger: 'change' } // { required: true, message: '请选择工序代码', trigger: 'change' }
], // ],
locationCode: [ locationCode: [
{ required: true, message: '请选择库位代码', trigger: 'change' } { required: true, message: '请选择库位代码', trigger: 'change' }
], ],

Loading…
Cancel
Save