Browse Source

物料降级代码开发

hella_online_20240829
chenfang 4 months ago
parent
commit
f744b13a09
  1. 11
      src/api/wms/balance/index.ts
  2. 11
      src/api/wms/productionitemcodeSpareitemcode/index.ts
  3. 60
      src/views/wms/basicDataManage/itemManage/productionitemcodeSpareitemcode/productionitemcodeSpareitemcode.data.ts
  4. 21
      src/views/wms/basicDataManage/itemManage/relegate/relegateRequest/index.vue
  5. 32
      src/views/wms/basicDataManage/itemManage/relegate/relegateRequest/relegateRequestMain.data.ts
  6. 4
      src/views/wms/basicDataManage/labelManage/callmaterials/callmaterials.data.ts

11
src/api/wms/balance/index.ts

@ -190,6 +190,17 @@ export const getBalanceByBusinessTypeByItemType = async (params) => {
return await request.get({ url: `/wms/balance/pageBusinessTypeToBalance`, params }) return await request.get({ url: `/wms/balance/pageBusinessTypeToBalance`, params })
} }
} }
// 查询库存余额列表根据业务类型 根据库存状态及库区类型再根据物料的种类筛选
export const getBalanceByBusinessCategoryByItemType = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/balance/pageBusinessCategoryToBalanceSenior', data })
} else {
return await request.get({ url: `/wms/balance/pageBusinessCategoryToBalance`, params })
}
}
// 根据code获取数据列表 // 根据code获取数据列表
export const getBalanceItemListByCodes = async (data) => { export const getBalanceItemListByCodes = async (data) => {
  return await request.get({ url: `/wms/balance/listByCodes`,data })   return await request.get({ url: `/wms/balance/listByCodes`,data })

11
src/api/wms/productionitemcodeSpareitemcode/index.ts

@ -19,6 +19,17 @@ export const getProductionitemcodeSpareitemcodePage = async (params) => {
} }
} }
// 查询量产件备件关系列表
export const getProductionitemcodeSpareitemcodeRelation = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/productionitemcode-spareitemcode/getRelationSeniorS', data })
} else {
return await request.get({ url: `/wms/productionitemcode-spareitemcode/getRelation`, params })
}
}
// 查询量产件备件关系详情 // 查询量产件备件关系详情
export const getProductionitemcodeSpareitemcode = async (id: number) => { export const getProductionitemcodeSpareitemcode = async (id: number) => {
return await request.get({ url: `/wms/productionitemcode-spareitemcode/get?id=` + id }) return await request.get({ url: `/wms/productionitemcode-spareitemcode/get?id=` + id })

60
src/views/wms/basicDataManage/itemManage/productionitemcodeSpareitemcode/productionitemcodeSpareitemcode.data.ts

@ -1,5 +1,7 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import * as ItembasicApi from '@/api/wms/itembasic'
import { Itembasic } from '../itembasic/itembasic.data'
// 表单校验 // 表单校验
export const ProductionitemcodeSpareitemcodeRules = reactive({ export const ProductionitemcodeSpareitemcodeRules = reactive({
@ -13,12 +15,70 @@ export const ProductionitemcodeSpareitemcode = useCrudSchemas(reactive<CrudSchem
field: 'productionItemCode', field: 'productionItemCode',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true, //可输入回车
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '物料基础信息', // 查询弹窗标题
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类
searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key: 'category',
value: 'LCJ',
isMainValue: false
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: 'true',
isFormModel: true
}], // 失去焦点校验参数
}
}
}, },
{ {
label: '备件', label: '备件',
field: 'spareItemCode', field: 'spareItemCode',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true, //可输入回车
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '物料基础信息', // 查询弹窗标题
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类
searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key: 'category',
value: 'BJ',
isMainValue: false
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: 'true',
isFormModel: true
}], // 失去焦点校验参数
}
}
}, },
{ {
label: '是否可用', label: '是否可用',

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

@ -72,6 +72,7 @@ import download from '@/utils/download'
import { RelegateRequestMain, RelegateRequestMainRules, RelegateRequestDetail, RelegateRequestDetailRules } from './relegateRequestMain.data' import { RelegateRequestMain, RelegateRequestMainRules, RelegateRequestDetail, RelegateRequestDetailRules } from './relegateRequestMain.data'
import * as RelegateRequestMainApi from '@/api/wms/relegateRequestMain' import * as RelegateRequestMainApi from '@/api/wms/relegateRequestMain'
import * as RelegateRequestDetailApi from '@/api/wms/relegateRequestDetail' import * as RelegateRequestDetailApi from '@/api/wms/relegateRequestDetail'
import * as ItembasicApi from '@/api/wms/itembasic'
import * as defaultButtons from '@/utils/disposition/defaultButtons' 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'
@ -109,7 +110,15 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
}) })
} else if (formField == 'downItemCode') { } else if (formField == 'downItemCode') {
row['downItemCode'] = val[0]['code'] row['downItemCode'] = val[0]['spareItemCode']
console.log(row['itemCode']);
// ItembasicApi.getItemListByCodes(row['itemCode'])
// if(){
// row['downItemCode'] = val[0]['productionItemCode']
// }else if(){
// row['downItemCode'] = val[0]['spareItemCode']
// }
} else if (formField == 'toLocationCode') { } else if (formField == 'toLocationCode') {
row['toLocationCode'] = val[0]['code'] row['toLocationCode'] = val[0]['code']
} else { } else {
@ -140,16 +149,6 @@ RelegateRequestDetail.allSchemas.tableFormColumns.map(item => {
if (item.field == 'itemCode') { if (item.field == 'itemCode') {
item.tableForm.searchCondition = [ item.tableForm.searchCondition = [
{ {
key: 'businessType',
value: businessType,
isMainValue: false
}
// ,{
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// }
,{
message: '请选择从仓库代码!', message: '请选择从仓库代码!',
key: 'warehouseCode', key: 'warehouseCode',
value: 'fromWarehouseCode', value: 'fromWarehouseCode',

32
src/views/wms/basicDataManage/itemManage/relegate/relegateRequest/relegateRequestMain.data.ts

@ -17,6 +17,8 @@ import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/l
import * as ItempackageApi from '@/api/wms/itempackage' import * as ItempackageApi from '@/api/wms/itempackage'
import { Itempackaging } from '@/views/wms/basicDataManage/itemManage/itempackage/itempackage.data' import { Itempackaging } from '@/views/wms/basicDataManage/itemManage/itempackage/itempackage.data'
import * as ProductionitemcodeSpareitemcodeApi from '@/api/wms/productionitemcodeSpareitemcode'
import { ProductionitemcodeSpareitemcode } from '@/views/wms/basicDataManage/itemManage/productionitemcodeSpareitemcode/productionitemcodeSpareitemcode.data'
import * as confgiApi from '@/api/infra/config' import * as confgiApi from '@/api/infra/config'
// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值 // 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
const queryParams = { const queryParams = {
@ -322,7 +324,7 @@ export const RelegateRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchField: 'itemCode', searchField: 'itemCode',
searchTitle: '库存余额信息', searchTitle: '库存余额信息',
searchAllSchemas: Balance.allSchemas, searchAllSchemas: Balance.allSchemas,
searchPage: BalanceApi.getBalanceByBusinessTypeByItemType, searchPage: BalanceApi.getBalanceByBusinessCategoryByItemType,
searchCondition: [] searchCondition: []
} }
}, },
@ -334,7 +336,7 @@ export const RelegateRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchField: 'itemCode', // 查询弹窗赋值字段 searchField: 'itemCode', // 查询弹窗赋值字段
searchTitle: '库存余额信息', // 查询弹窗标题 searchTitle: '库存余额信息', // 查询弹窗标题
searchAllSchemas: Balance.allSchemas, // 查询弹窗所需类 searchAllSchemas: Balance.allSchemas, // 查询弹窗所需类
searchPage: BalanceApi.getBalanceByBusinessTypeByItemType, // 查询弹窗所需分页方法 searchPage: BalanceApi.getBalanceByBusinessCategoryByItemType, // 查询弹窗所需分页方法
searchCondition:[ searchCondition:[
// { // {
// key: 'available', // key: 'available',
@ -361,18 +363,19 @@ export const RelegateRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
enterSearch: true, enterSearch: true,
isSearchList: true, isSearchList: true,
searchListPlaceholder: '请选择降级物料代码', searchListPlaceholder: '请选择降级物料代码',
searchField: 'code', searchField: 'productionItemCode',
searchTitle: '物料基础信息', searchTitle: '物料基础信息',
searchAllSchemas: Itembasic.allSchemas, searchAllSchemas: ProductionitemcodeSpareitemcode.allSchemas,
searchPage: ItembasicApi.getItembasicPage, searchPage: ProductionitemcodeSpareitemcodeApi.getProductionitemcodeSpareitemcodeRelation,
searchCondition: [{ searchCondition: [{
key: 'available', key: 'available',
value: 'TRUE', value: 'TRUE',
isMainValue: false isMainValue: false
},{ },{
key: 'type', key: 'itemCode',
value: confgiData.itemType, value: 'itemCode',
isMainValue: false isTableRowValue: true,
isMainValue:false
}], }],
verificationParams: [{ verificationParams: [{
key: 'code', key: 'code',
@ -387,19 +390,20 @@ export const RelegateRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
tableForm:{ tableForm:{
isInpuFocusShow: true, isInpuFocusShow: true,
searchListPlaceholder: '请选择降级物料代码', // 输入框占位文本 searchListPlaceholder: '请选择降级物料代码', // 输入框占位文本
searchField: 'itemCode', // 查询弹窗赋值字段 searchField: 'productionItemCode', // 查询弹窗赋值字段
searchTitle: '物料基础信息', // 查询弹窗标题 searchTitle: '物料基础信息', // 查询弹窗标题
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类 searchAllSchemas: ProductionitemcodeSpareitemcode.allSchemas, // 查询弹窗所需类
searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法 searchPage: ProductionitemcodeSpareitemcodeApi.getProductionitemcodeSpareitemcodeRelation, // 查询弹窗所需分页方法
searchCondition:[ searchCondition:[
{ {
key: 'available', key: 'available',
value: 'TRUE', value: 'TRUE',
isMainValue: false isMainValue: false
},{ },{
key: 'type', key: 'itemCode',
value: confgiData.itemType, value: 'itemCode',
isMainValue: false isTableRowValue: true,
isMainValue:false
}] }]
}, },
table: { table: {

4
src/views/wms/basicDataManage/labelManage/callmaterials/callmaterials.data.ts

@ -38,7 +38,7 @@ export const CallmaterialsRules = reactive({
workStationCode: [required], workStationCode: [required],
uom: [required], uom: [required],
callmaterialQty: [required], callmaterialQty: [required],
project: [{ max: 50, message: '最多50字符', trigger: 'blur'}] project: [{ max: 64, message: '最多50字符', trigger: 'blur'}]
}) })
export const Callmaterials = useCrudSchemas(reactive<CrudSchema[]>([ export const Callmaterials = useCrudSchemas(reactive<CrudSchema[]>([
@ -361,7 +361,7 @@ export const Callmaterials = useCrudSchemas(reactive<CrudSchema[]>([
} , } ,
form: { form: {
componentProps:{ componentProps:{
maxlength: 50, maxlength: 64,
type:'textarea', type:'textarea',
showWordLimit:true showWordLimit:true
} }

Loading…
Cancel
Save