diff --git a/src/views/wms/issueManage/preparetoissueplan/preparetoissueMain/index.vue b/src/views/wms/issueManage/preparetoissueplan/preparetoissueMain/index.vue index 016899420..4d4fa5b9e 100644 --- a/src/views/wms/issueManage/preparetoissueplan/preparetoissueMain/index.vue +++ b/src/views/wms/issueManage/preparetoissueplan/preparetoissueMain/index.vue @@ -44,7 +44,6 @@ @success="getList" :rules="PreparetoissueMainRules" :formAllSchemas="PreparetoissueMain.allSchemas" - :searchTableParams="searchTableParams" :tableAllSchemas="PreparetoissueDetail.allSchemas" :tableFormRules="PreparetoissueDetailRules" :tableData="tableData" @@ -64,12 +63,11 @@ :allSchemas="PreparetoissueMain.allSchemas" :detailAllSchemas="PreparetoissueDetail.allSchemas" :detailAllSchemasRules="PreparetoissueDetailRules" - :searchTableParams="searchTableParams" :apiCreate="PreparetoissueDetailApi.createPreparetoissueDetail" :apiUpdate="PreparetoissueDetailApi.updatePreparetoissueDetail" :apiPage="PreparetoissueDetailApi.getPreparetoissueDetailPage" :apiDelete="PreparetoissueDetailApi.deletePreparetoissueDetail" - :Echo="Echo" + @searchTableSuccessDetail="searchTableSuccessDetail" /> @@ -99,44 +97,35 @@ const updataTableColumns = (val) => { tableColumns.value = val } -// 查询列表页面参数设置 -const searchTableParams = ref([ -//{ -// formField: 'productItemCode', -// searchTableTitle: '物料信息', -// searchTableAllSchemas: Itembasic.allSchemas, -// searchTablePage: ItembasicApi.getItembasicPage -//} -]) - // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { nextTick(() => { if (type == 'tableForm') { // 明细查询页赋值 - //row[formField] = val[0][searchField] - //row['poLine'] = val[0]['poLine'] - //row['batch'] = val[0]['toBatch'] - //row['altBatch'] = val[0]['altBatch'] - //row['itemCode'] = val[0]['itemCode'] - //row['itemName'] = val[0]['itemName'] - //row['itemDesc1'] = val[0]['itemDesc1'] - //row['itemDesc2'] = val[0]['itemDesc2'] - //row['projectCode'] = val[0]['projectCode'] - //row['qty'] = val[0]['qty'] - //row['uom'] = val[0]['uom'] + row[formField] = val[0][searchField] + row['toLocationCode'] = val[0]['rawLocationCode'] } else { const setV = {} setV[formField] = val[0][searchField] - //setV['ppNumber'] = val[0]['ppNumber'] - //setV['supplierCode'] = val[0]['supplierCode'] + if (formField == 'productionPlanNumber') { + setV['workshop'] = val[0]['workshop'] + setV['prodLine'] = val[0]['production_line'] + setV['shift'] = val[0]['shift'] + setV['team'] = val[0]['team'] + } formRef.setValues(setV) } }) } -// 子表新增的时候选择表格之后需要会显得字段 -// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom'] -const Echo = [] +// 查询页面返回——详情 +const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { + nextTick(() => { + const setV = {} + setV[formField] = val[0][searchField] + setV['toLocationCode'] = val[0]['rawLocationCode'] + formRef.setValues(setV) + }) +} const { tableObject, tableMethods } = useTable({ getListApi: PreparetoissueMainApi.getPreparetoissueMainPage // 分页接口 diff --git a/src/views/wms/issueManage/preparetoissueplan/preparetoissueMain/preparetoissueMain.data.ts b/src/views/wms/issueManage/preparetoissueplan/preparetoissueMain/preparetoissueMain.data.ts index 7d5249b53..6dddfdfb9 100644 --- a/src/views/wms/issueManage/preparetoissueplan/preparetoissueMain/preparetoissueMain.data.ts +++ b/src/views/wms/issueManage/preparetoissueplan/preparetoissueMain/preparetoissueMain.data.ts @@ -1,5 +1,33 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' + +import * as ProductionMainApi from '@/api/wms/productionMain' +import { ProductionMain } from '@/views/wms/productionManage/productionplan/productionMain/productionMain.data' + +import * as WorkshopApi from '@/api/wms/workshop' +import { Workshop } from '@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data' + +import * as ProductionlineApi from '@/api/wms/productionline' +import { Productionline } from '@/views/wms/basicDataManage/factoryModeling/productionline/productionline.data' + +import * as ShiftApi from '@/api/wms/shift' +import { Shift } from '@/views/wms/basicDataManage/orderManage/shift/shift.data' + +import * as TeamApi from '@/api/wms/team' +import { Team } from '@/views/wms/basicDataManage/orderManage/team/team.data' + +import * as ProductionlineitemApi from '@/api/wms/productionlineitem' +import { Productionlineitem } from '@/views/wms/basicDataManage/itemManage/productionlineitem/productionlineitem.data' + +import * as LocationApi from '@/api/wms/location' +import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data' + +import * as WorkStationApi from '@/api/wms/workstation' +import { Workstation } from '@/views/wms/basicDataManage/factoryModeling/workstation/workstation.data' + + + + const { t } = useI18n() // 国际化 /** @@ -13,6 +41,17 @@ export const PreparetoissueMain = useCrudSchemas(reactive([ table: { width: 150 }, + form: { + labelMessage: '同时影响车间 生产线 班组 班次', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择生产计划', // 输入框占位文本 + searchField: 'number', // 查询弹窗赋值字段 + searchTitle: '生产计划信息', // 查询弹窗标题 + searchAllSchemas: ProductionMain.allSchemas, // 查询弹窗所需类 + searchPage: ProductionMainApi.getProductionMainPage // 查询弹窗所需分页方法 + } + } }, { label: '车间', @@ -21,6 +60,17 @@ export const PreparetoissueMain = useCrudSchemas(reactive([ table: { width: 150 }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择车间代码', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '车间信息', // 查询弹窗标题 + searchAllSchemas: Workshop.allSchemas, // 查询弹窗所需类 + searchPage: WorkshopApi.getWorkshopPage // 查询弹窗所需分页方法 + } + } }, { label: '生产线', @@ -29,6 +79,17 @@ export const PreparetoissueMain = useCrudSchemas(reactive([ table: { width: 150 }, + form: { + labelMessage: '该生产线会影响明细中的物品代码,需在基础管理生产线物品关系中维护', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择生产线', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '生产线信息', // 查询弹窗标题 + searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类 + searchPage: ProductionlineApi.getProductionlinePage // 查询弹窗所需分页方法 + } + } }, { label: '班次', @@ -37,6 +98,17 @@ export const PreparetoissueMain = useCrudSchemas(reactive([ table: { width: 150 }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选班次', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '班次信息', // 查询弹窗标题 + searchAllSchemas: Shift.allSchemas, // 查询弹窗所需类 + searchPage: ShiftApi.getShiftPage // 查询弹窗所需分页方法 + } + } }, { label: '班组', @@ -45,6 +117,17 @@ export const PreparetoissueMain = useCrudSchemas(reactive([ table: { width: 150 }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选班组', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '班组信息', // 查询弹窗标题 + searchAllSchemas: Team.allSchemas, // 查询弹窗所需类 + searchPage: TeamApi.getTeamPage // 查询弹窗所需分页方法 + } + } }, { label: '计划日期', @@ -60,6 +143,7 @@ export const PreparetoissueMain = useCrudSchemas(reactive([ form: { component: 'DatePicker', componentProps: { + style: {width:'100%'}, type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', @@ -89,7 +173,8 @@ export const PreparetoissueMain = useCrudSchemas(reactive([ componentProps: { disabled: true } - } + }, + isForm: false, }, { label: '开始时间', @@ -105,6 +190,7 @@ export const PreparetoissueMain = useCrudSchemas(reactive([ form: { component: 'DatePicker', componentProps: { + style: {width:'100%'}, type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', @@ -125,6 +211,7 @@ export const PreparetoissueMain = useCrudSchemas(reactive([ form: { component: 'DatePicker', componentProps: { + style: {width:'100%'}, type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', @@ -154,6 +241,7 @@ export const PreparetoissueMain = useCrudSchemas(reactive([ form: { component: 'DatePicker', componentProps: { + style: {width:'100%'}, type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', @@ -184,6 +272,7 @@ export const PreparetoissueMain = useCrudSchemas(reactive([ form: { component: 'DatePicker', componentProps: { + style: {width:'100%'}, type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', @@ -281,6 +370,64 @@ export const PreparetoissueMainRules = reactive({ * @returns {Array} 备料计划子表 */ export const PreparetoissueDetail = useCrudSchemas(reactive([ + { + label: '物品代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择物品代码', // 输入框占位文本 + searchField: 'itemCode', // 查询弹窗赋值字段 + searchTitle: '生产线物品关系信息', // 查询弹窗标题 + searchAllSchemas: Productionlineitem.allSchemas, // 查询弹窗所需类 + searchPage: ProductionlineitemApi.getProductionlineitemPage // 查询弹窗所需分页方法 + } + }, + tableForm:{ + isInpuFocusShow: true, + searchListPlaceholder: '请选择物品代码', // 输入框占位文本 + searchField: 'itemCode', // 查询弹窗赋值字段 + searchTitle: '生产线物品关系信息', // 查询弹窗标题 + searchAllSchemas: Productionlineitem.allSchemas, // 查询弹窗所需类 + searchPage: ProductionlineitemApi.getProductionlineitemPage // 查询弹窗所需分页方法 + }, + }, + { + label: '计划数量', + field: 'planQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + }, + tableForm:{ + type: 'InputNumber', + min: 1, + precision: 6 + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isSearch: true, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + tableForm:{ + type: 'Select' + }, + }, { label: '目标库位', field: 'toLocationCode', @@ -288,6 +435,15 @@ export const PreparetoissueDetail = useCrudSchemas(reactive([ table: { width: 150 }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + disabled: true + } + }, + tableForm:{ + disabled: true + }, }, { label: '工位', @@ -296,6 +452,25 @@ export const PreparetoissueDetail = useCrudSchemas(reactive([ table: { width: 150 }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择工位', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '工位信息', // 查询弹窗标题 + searchAllSchemas: Workstation.allSchemas, // 查询弹窗所需类 + searchPage: WorkStationApi.getWorkstationPage // 查询弹窗所需分页方法 + } + }, + tableForm:{ + isInpuFocusShow: true, + searchListPlaceholder: '请选择工位', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '工位信息', // 查询弹窗标题 + searchAllSchemas: Workstation.allSchemas, // 查询弹窗所需类 + searchPage: WorkStationApi.getWorkstationPage // 查询弹窗所需分页方法 + }, }, { label: '截止时间', @@ -311,6 +486,7 @@ export const PreparetoissueDetail = useCrudSchemas(reactive([ form: { component: 'DatePicker', componentProps: { + style: {width:'100%'}, type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', @@ -331,14 +507,6 @@ export const PreparetoissueDetail = useCrudSchemas(reactive([ }, isTableForm: false, }, - { - label: '物品代码', - field: 'itemCode', - sort: 'custom', - table: { - width: 150 - }, - }, { label: '备注', field: 'remark', @@ -361,6 +529,7 @@ export const PreparetoissueDetail = useCrudSchemas(reactive([ form: { component: 'DatePicker', componentProps: { + style: {width:'100%'}, type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', @@ -379,29 +548,6 @@ export const PreparetoissueDetail = useCrudSchemas(reactive([ isTableForm: false, isForm: false, }, - { - label: '计划数量', - field: 'planQty', - sort: 'custom', - table: { - width: 150 - }, - form: { - component: 'InputNumber', - } - }, - { - label: '计量单位', - field: 'uom', - dictType: DICT_TYPE.UOM, - dictClass: 'string', - isSearch: true, - isTable: true, - sort: 'custom', - table: { - width: 150 - }, - }, { label: '最后更新者', field: 'updater', @@ -426,6 +572,7 @@ export const PreparetoissueDetail = useCrudSchemas(reactive([ form: { component: 'DatePicker', componentProps: { + style: {width:'100%'}, type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', @@ -445,6 +592,9 @@ export const PreparetoissueDetail = useCrudSchemas(reactive([ table: { width: 150 }, + tableForm:{ + type: 'Select', + }, form: { component: 'Switch', value: 'TRUE', @@ -470,7 +620,7 @@ export const PreparetoissueDetail = useCrudSchemas(reactive([ //表单校验 export const PreparetoissueDetailRules = reactive({ available: [ - { required: true, message: '请选择是否可用', trigger: 'change' } + { required: true, message: '请选择是否可用', trigger: 'blur' } ], uom: [ { required: true, message: '请选择计量单位', trigger: 'change' }