Browse Source

从配置获取参数

master_hella_20240701
zhaoxuebing 8 months ago
parent
commit
d7ed368eb9
  1. 8
      src/api/infra/config/index.ts
  2. 18
      src/views/wms/basicDataManage/factoryModeling/workstation/workstation.data.ts
  3. 13
      src/views/wms/basicDataManage/itemManage/productionlineitem/productionlineitem.data.ts

8
src/api/infra/config/index.ts

@ -6,6 +6,9 @@ export interface ConfigVO {
name: string
key: string
value: string
itemType: string
areaType: string
inventoryStatus: string
type: number
visible: boolean
remark: string
@ -27,6 +30,11 @@ export const getConfigKey = (configKey: string) => {
return request.get({ url: '/infra/config/get-value-by-key?key=' + configKey })
}
// 根据参数键名查询参数值
export const queryByKey = (configKey: string) => {
return request.get({ url: '/infra/config/queryByKey?key=' + configKey })
}
// 新增参数
export const createConfig = (data: ConfigVO) => {
return request.post({ url: '/infra/config/create', data })

18
src/views/wms/basicDataManage/factoryModeling/workstation/workstation.data.ts

@ -1,7 +1,6 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as LocationApi from '@/api/wms/location'
import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data'
import * as ProductionlineApi from '@/api/wms/productionline'
@ -10,20 +9,17 @@ import { Productionline } from '@/views/wms/basicDataManage/factoryModeling/prod
import * as WorkshopApi from '@/api/wms/workshop'
import { Workshop } from '@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data'
import * as getBusinesstypeApi from '@/api/wms/businesstype/index'
import * as confgiApi from '@/api/infra/config'
import * as WorkstationApi from '@/api/wms/workstation'
import { validateYS } from '@/utils/validator'
const queryParams = {
pageSize:10,
pageNo:1,
code:'WorkStation'
}
const { t } = useI18n() // 国际化
const data = await getBusinesstypeApi.getBusinesstypePage(queryParams)
const businesstypeData =data?.list[0]||{}
const confgiDataOne = await confgiApi.queryByKey("WorkStation-IN")
const confgiDataTwo = await confgiApi.queryByKey("WorkStation-OUT")
/**
* @returns {Array}
*/
@ -137,7 +133,7 @@ export const Workstation = useCrudSchemas(reactive<CrudSchema[]>([
},
{
key: 'areaType',
value: businesstypeData.outAreaTypes,
value: confgiDataOne.areaType,
isMainValue: false
}]
}
@ -166,7 +162,7 @@ export const Workstation = useCrudSchemas(reactive<CrudSchema[]>([
},
{
key: 'areaType',
value: businesstypeData.outAreaTypes,
value: confgiDataTwo.areaType,
isMainValue: false
}]
}

13
src/views/wms/basicDataManage/itemManage/productionlineitem/productionlineitem.data.ts

@ -5,16 +5,11 @@ import { Productionline } from './../../factoryModeling/productionline/productio
import * as ItembasicApi from '@/api/wms/itembasic'
import { Itembasic } from './../itembasic/itembasic.data'
import * as getBusinesstypeApi from '@/api/wms/businesstype/index'
import * as confgiApi from '@/api/infra/config'
const { t } = useI18n() // 国际化
const queryParams = {
pageSize:10,
pageNo:1,
code:'Productionlineitem'
}
const data = await getBusinesstypeApi.getBusinesstypePage(queryParams)
const businesstypeData =data?.list[0]||{}
const confgiData = await confgiApi.queryByKey("Productionlineitem")
/**
* @returns {Array} 线
@ -115,7 +110,7 @@ export const Productionlineitem = useCrudSchemas(reactive<CrudSchema[]>([
},
{
key:'type',
value:businesstypeData.itemTypes,
value:confgiData.itemType,
action: 'notin',
isSearch: true,
isMainValue: false

Loading…
Cancel
Save