diff --git a/src/views/wms/issueManage/productionscrap/productionscrapRequestMain/productionscrapRequestMain.data.ts b/src/views/wms/issueManage/productionscrap/productionscrapRequestMain/productionscrapRequestMain.data.ts index 01e14deae..026650dba 100644 --- a/src/views/wms/issueManage/productionscrap/productionscrapRequestMain/productionscrapRequestMain.data.ts +++ b/src/views/wms/issueManage/productionscrap/productionscrapRequestMain/productionscrapRequestMain.data.ts @@ -9,7 +9,6 @@ import * as ProductionlineApi from '@/api/wms/productionline' import { Productionline } from '@/views/wms/basicDataManage/factoryModeling/productionline/productionline.data' import * as WorkstationApi from '@/api/wms/workstation' -import { Workstation } from '@/views/wms/basicDataManage/factoryModeling/workstation/workstation.data' import * as BalanceApi from '@/api/wms/balance' import { Balance } from '@/views/wms/inventoryManage/balance/balance.data' @@ -35,6 +34,10 @@ import * as QadProjectApi from '@/api/wms/qadProject' import * as SubjectAccountApi from '@/api/wms/subjectAccount' import { SubjectAccount } from '@/views/wms/basicDataManage/subject/subjectAccount/subjectAccount.data' +import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data' + +import * as confgiApi from '@/api/infra/config' + // import * as LocationApi from '@/api/wms/location' // import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data' @@ -56,6 +59,342 @@ const userDept = userStore.userSelfInfo.dept userDept.id = userDept.id.toString() const userDeptArray: any = [userDept] +const confgiDataOne = await confgiApi.queryByKey("WorkStation-IN") +const confgiDataTwo = await confgiApi.queryByKey("WorkStation-OUT") + + +/** + * @returns {Array} 工位 + */ +export const Workstation = useCrudSchemas(reactive([ + { + label: '代码', + field: 'code', + sort: 'custom', + table: { + width: 150, + fixed: 'left' + }, + isSearch: true + }, + { + label: '名称', + field: 'name', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true + }, + { + label: '原料库位', + field: 'rawLocationCode', + sort: 'custom', + table: { + width: 150 + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + enterSearch: true, + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择库位代码', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '库位信息', // 查询弹窗标题 + searchAllSchemas: Location.allSchemas, // 查询弹窗所需类 + searchPage: WorkstationApi.selectAreaTypeToLocation, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }, + { + key: 'areaType', + value: confgiDataOne.areaType, + isMainValue: false + }], + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 + } + } + }, + { + label: '成品库位', + field: 'fgLocationCode', + sort: 'custom', + table: { + width: 150 + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + enterSearch: true, + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择库位代码', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '库位信息', // 查询弹窗标题 + searchAllSchemas: Location.allSchemas, // 查询弹窗所需类 + searchPage: WorkstationApi.selectAreaTypeToLocation, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }, + { + key: 'areaType', + value: confgiDataTwo.areaType, + isMainValue: false + }], + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 + } + } + }, + // { + // label: '类型', + // field: 'type', + // dictType: DICT_TYPE.WORK_STATION_TYPE, + // dictClass: 'string', + // isTable: true, + // sort: 'custom', + // table: { + // width: 150 + // }, + // }, + { + label: '车间代码', + field: 'workshopCode', + sort: 'custom', + isSearch: true, + table: { + width: 150 + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + enterSearch: true, + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择车间代码', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '车间信息', // 查询弹窗标题 + searchAllSchemas: Workshop.allSchemas, // 查询弹窗所需类 + searchPage: WorkshopApi.getWorkshopPage, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }], + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 + } + } + }, + { + label: '生产线代码', + field: 'productionLineCode', + sort: 'custom', + isSearch: true, + table: { + width: 150 + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + enterSearch: true, + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择生产线代码', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '生产线信息', // 查询弹窗标题 + searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类 + searchPage: ProductionlineApi.getProductionlinePage, // 查询弹窗所需分页方法 + searchCondition: [{ + key:'workshopCode', + value:'workshopCode', + message: '请填写车间代码!', + isMainValue: true + },{ + key: 'available', + value: 'TRUE', + isMainValue: false + }], + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 + } + } + }, + + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + }, + { + label: '生效时间', + field: 'activeTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + style: {width:'100%'}, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '失效时间', + field: 'expireTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + form: { + component: 'DatePicker', + componentProps: { + style: {width:'100%'}, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + sort: 'custom', + table: { + width: 180 + }, + }, + { + label: '创建时间', + field: 'createTime', + isForm: false, + table: { + width: 180 + }, + formatter: dateFormatter, + detail: { + dateFormat : 'YYYY-MM-DD HH:mm:ss' + }, + form: { + component: 'DatePicker', + componentProps: { + style: {width:'100%'}, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + } + }, + { + label: '创建者', + field: 'creator', + table: { + width: 130 + }, + isForm: false, + isTable: true + }, + { + label: '最后更新时间', + field: 'updateTime', + sort: 'custom', + isDetail: true, + isForm: false, + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + style: {width:'100%'}, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + } + }, + { + label: '最后更新者', + field: 'updater', + isDetail: true, + isForm: false, + isTable: true, + table: { + width: 150 + } + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150, + fixed: 'right' + } + } +])) + + /** * @returns {Array} 生产退料申请主表 */