diff --git a/src/api/gw/baseEntityID/index.ts b/src/api/gw/baseEntityID/index.ts index 6b66ee0..64b9d44 100644 --- a/src/api/gw/baseEntityID/index.ts +++ b/src/api/gw/baseEntityID/index.ts @@ -1,5 +1,14 @@ import request from '@/config/axios' +// 电压等级列表获取 +export const GetPoUnUsedEntityID = async () => { + return await request.post({ url: `/DistributionBoxTesting/GetPoUnUsedEntityID` }) +} + +// 实物ID列表获取 +export const GetBaseEntityIDList = async (data: any) => { + return await request.post({ url: `/DistributionBoxTesting/GetBaseEntityIDList`, data }) +} // 实物ID列表获取 export const getPagingBaseEntityIDList = async (data: any) => { return await request.post({ url: `/DistributionBoxTesting/GetPagingBaseEntityIDList`, data }) diff --git a/src/api/gw/baseVoltage/index.ts b/src/api/gw/baseVoltage/index.ts index ff3b60f..6f48ad3 100644 --- a/src/api/gw/baseVoltage/index.ts +++ b/src/api/gw/baseVoltage/index.ts @@ -1,5 +1,11 @@ import request from '@/config/axios' + +// 电压等级列表获取 +export const GetBaseVoltageList = async (data: any) => { + return await request.post({ url: `/DistributionBoxTesting/GetBaseVoltageList`, data }) +} + // 电压等级列表获取 export const getBaseVoltagePaging = async (data: any) => { return await request.post({ url: `/DistributionBoxTesting/GetPagingBaseVoltageList`, data }) diff --git a/src/views/Gw/productionOrder/ProductionOrderForm.vue b/src/views/Gw/productionOrder/ProductionOrderForm.vue index f19f4c9..31840ee 100644 --- a/src/views/Gw/productionOrder/ProductionOrderForm.vue +++ b/src/views/Gw/productionOrder/ProductionOrderForm.vue @@ -354,6 +354,7 @@ const open = async (type: string, row?: any) => { } baseMats.value =await BaseMaterialApi.GetBaseMaterialList(filterReq) + ipoMats.value = [] baseMats.value.Data.forEach( (item) => { if(ipoMats.value.indexOf(item.MatNo)==-1) ipoMats.value.push({key:item.MatNo,val:item.MatNo}) diff --git a/src/views/Gw/productionWorkOrder/ProductionWorkOrder.vue b/src/views/Gw/productionWorkOrder/ProductionWorkOrder.vue index 1127a7d..c032183 100644 --- a/src/views/Gw/productionWorkOrder/ProductionWorkOrder.vue +++ b/src/views/Gw/productionWorkOrder/ProductionWorkOrder.vue @@ -52,31 +52,26 @@ const xGrid = ref() const gridOptionsA: any = reactive({ columns: [ - { field: 'PurchaserHqCode', title: '采购方总部编码', width: '120px', fixed: 'left' }, - { field: 'IpoNo', title: '供应商生产订单编号', sortable: true, width: '170px', fixed: 'left' }, - { field: 'SupplierCode', title: '供应商编码', sortable: true, width: '160px' }, - { field: 'SupplierName', title: '供应商名称', width: '190px' }, - { field: 'WoNo', title: '生产工单编码', width: '190px' }, - { field: 'CategoryCode', title: '品类编码', sortable: true, width: '160px' }, - { field: 'SubclassCode', title: '种类编码', sortable: true, width: '160px' }, - { field: 'MaterialsCode', title: '厂家物料编码', sortable: true, width: '160px' }, - { field: 'MaterialsDesc', title: '厂家物料描述', sortable: true, width: '160px' }, - { field: 'MaterialsBatch', title: '物料批次', sortable: true, width: '160px' }, - { field: 'Amount', title: '生产数量', sortable: true, width: '160px' }, - { field: 'Unit', title: '计量单位', sortable: true, width: '160px' }, - { field: 'PlanStartDate', title: '计划开始日期', sortable: true, width: '160px' }, - { field: 'PlanFinishDate', title: '计划完成日期', sortable: true, width: '160px' }, - { field: 'ActualStartDate', title: '实际开始日期', sortable: true, width: '160px' }, - { field: 'ActualFinishDate', title: '实际完成日期', sortable: true, width: '160px' }, - { field: 'WoStatus', title: '工单状态', sortable: true, width: '160px' }, - { field: 'EntityCode', title: '实物ID ', sortable: true, width: '160px' }, - { field: 'ProcessRouteNo', title: '工艺路线编码', sortable: true, width: '160px' }, - { field: 'VoltageLevel', title: '电压等级', sortable: true, width: '160px' }, - { field: 'DataSource', title: '数据来源', sortable: true, width: '160px' }, - { field: 'DataSourceCreatetime', title: '来源数据创建时间', sortable: true, width: '160px' }, - { field: 'OwnerId', title: '数据拥有方', sortable: true, width: '160px' }, - { field: 'OpenId', title: '数据可见方', sortable: true, width: '160px' }, - { field: 'ModelSpec', title: '产品型号规格', sortable: true, width: '160px' }, + { field: 'BuyerName', title: '采购方公司名称', fixed: 'left', width: '190px'}, + { field: 'WoNo', title: '生产工单编码',fixed: 'left', width: '190px' }, + { field: 'Amount', title: '生产数量', fixed: 'left', width: '190px'}, + { field: 'PoItemId', title: '采购订单行项目id', width: '190px'}, + { field: 'IpoNo', title: '生产订单号', width: '190px'}, + + { field: 'EntityCode', title: '实物ID ', width: '240px' }, + { field: 'FactoryNo', title: '出厂编号 ', width: '240px' }, + + { field: 'MaterialsCode', title: '厂家物料编码', width: '160px' }, + { field: 'MaterialsDesc', title: '厂家物料描述', width: '160px' }, + { field: 'Unit', title: '计量单位', width: '160px' }, + { field: 'PlanStartDate', title: '计划开始日期', width: '160px',formatter:formatTime }, + { field: 'PlanFinishDate', title: '计划完成日期', width: '160px',formatter:formatTime }, + { field: 'ActualStartDate', title: '实际开始日期', width: '160px' ,formatter:formatTime}, + { field: 'ActualFinishDate', title: '实际完成日期', width: '160px',formatter:formatTime }, + //{ field: 'WoStatus', title: '工单状态', width: '160px' }, + + + { field: 'VoltageLevel', title: '电压等级', width: '160px' }, { title: '操作', width: 160, fixed: 'right', slots: { default: 'operate' } } ], pagerConfig: { @@ -94,10 +89,12 @@ const gridOptionsA: any = reactive({ titleWidth: 160, titleAlign: 'right', items: [ - { field: 'purchaserHaCode', title: '采购方总部编码', span: 8, itemRender: { name: '$input', props: { placeholder: '请输入采购方总部编码' } } }, - { field: 'soNo', title: '销售订单号', span: 8, itemRender: { name: '$input', props: { placeholder: '请输入销售订单号' } } }, - { field: 'buyerCode', title: '采购方公司编码', span: 8, itemRender: { name: '$input', props: { placeholder: '请输入采购方公司编码' } } }, + // { field: 'purchaserHaCode', title: '采购方总部编码', span: 8, itemRender: { name: '$input', props: { placeholder: '请输入采购方总部编码' } } }, + // { field: 'soNo', title: '销售订单号', span: 8, itemRender: { name: '$input', props: { placeholder: '请输入销售订单号' } } }, + // { field: 'buyerCode', title: '采购方公司编码', span: 8, itemRender: { name: '$input', props: { placeholder: '请输入采购方公司编码' } } }, { field: 'buyerName', title: '采购方公司名称', span: 8, itemRender: { name: '$input', props: { placeholder: '请输入采购方公司名称' } } }, + { field: 'WoNo', title: '生产工单编号', span: 8, itemRender: { name: '$input', props: { placeholder: '请输入生产工单编号' } } }, + { field: 'PoItemId', title: '采购订单行项目id', span: 8, itemRender: { name: '$input', props: { placeholder: '请输入采购订单行项目id' } } }, { span: 24, align: 'center', collapseNode: true, itemRender: { name: '$buttons', children: [{ props: { type: 'submit', content: '查询', status: 'primary' } }, { props: { type: 'reset', content: '重置' } }] } } ] }, @@ -182,6 +179,10 @@ const gridOptionsA: any = reactive({ } } }) +function formatTime ({ cellValue, row, column }) { + if(cellValue != undefined) + return dayjs(cellValue).format("YYYY-MM-DD") +} // 代理重新加载 const proxyReload = () => { const $grid = xGrid.value diff --git a/src/views/Gw/productionWorkOrder/ProductionWorkOrderForm.vue b/src/views/Gw/productionWorkOrder/ProductionWorkOrderForm.vue index 280e005..f1b9a10 100644 --- a/src/views/Gw/productionWorkOrder/ProductionWorkOrderForm.vue +++ b/src/views/Gw/productionWorkOrder/ProductionWorkOrderForm.vue @@ -1,56 +1,60 @@ @@ -60,139 +64,126 @@ - - - + --> - + - + --> - + + - + - + --> @@ -207,6 +198,9 @@ import { map as _map } from 'lodash' import * as ProductionWorkOrderApi from '@/api/gw/productionWorkOrder' import { useDictStore } from '@/stores/dict' import { storeToRefs } from 'pinia' +import * as BaseMaterialApi from '@/api/gw/baseMaterial' +import * as BaseEntityIDApi from '@/api/gw/baseEntityID' +import * as BaseVoltageApi from '@/api/gw/baseVoltage' // 字典 const dictStore = useDictStore() const { dictCategoryCode, dictSubClassCode, dictWoStatus } = storeToRefs(dictStore) @@ -277,6 +271,14 @@ const formRulesA: any = ref({ { required: true, message: '请输入工单状态' } ], }) +const baseMats = ref([]) +const ipoMats = ref([]) + +const baseEntityIds = ref([]) +const ipoEntityIds = ref([]) + +const baseVoltages = ref([]) +const ipoVoltages = ref([]) // 挂载 onMounted(() => { }) @@ -284,6 +286,39 @@ onMounted(() => { const open = async (type: string, row?: any) => { console.log(row) formTypeA.value = type + + //基础物料信息 + const filterMatReq = {"filter": {"field": "MatNo","operator": "1","value": null}} + baseMats.value =await BaseMaterialApi.GetBaseMaterialList(filterMatReq) + + ipoMats.value = [] + baseMats.value.Data.forEach( (item) => { + if(ipoMats.value.indexOf(item.MatNo)==-1) + ipoMats.value.push({key:item.MatNo,val:item.MatNo}) + + }) + + //基础实物ID信息 + //const filterEntityReq = {"filter": {"field": "entity_id","operator": "1","value": null}} + baseEntityIds.value =await BaseEntityIDApi.GetPoUnUsedEntityID() + + ipoEntityIds.value = [] + baseEntityIds.value.forEach( (item) => { + if(ipoEntityIds.value.indexOf(item.EntityId)==-1) + ipoEntityIds.value.push({key:item.EntityId,val:item.EntityId}) + + }) + //基础电压信息 + const filterVoltageReq = {"filter": {"field": "voltage","operator": "1","value": null}} + baseVoltages.value =await BaseVoltageApi.GetBaseVoltageList(filterVoltageReq) + + ipoVoltages.value = [] + baseVoltages.value.Data.forEach( (item) => { + if(ipoVoltages.value.indexOf(item.Voltage+item.Level)==-1) + ipoVoltages.value.push({key:item.Voltage+item.Level,val:item.Voltage+item.Level}) + + }) + switch (type) { case 'add': await fnResetA() @@ -332,6 +367,18 @@ const open = async (type: string, row?: any) => { break; } } +const fnMatCodeChange = (params: any) => { + if (params.data.MaterialsCode) { + + baseMats.value.Data.forEach( (item) => { + if(item.MatNo == params.data.MaterialsCode) + { + params.data.Unit = item.MatUnit; + params.data.MaterialsDesc = item.MatDescption; + } + }) + } +} // 提供open方法打开弹窗 defineExpose({ open }) // 改变数据A @@ -363,6 +410,13 @@ const fnDeleteA = async (row: any) => { } // 提交 const fnSubmitA = async () => { + if(formDataA.value.ActualStartDate==undefined || formDataA.value.ActualStartDate==""){ + formDataA.value.ActualStartDate = null + } + if(formDataA.value.ActualFinishDate==undefined || formDataA.value.ActualFinishDate==""){ + formDataA.value.ActualFinishDate = null + } + switch (formTypeA.value) { case 'add': const paramsA = { @@ -427,5 +481,9 @@ const fnResetA = () => { "ModelSpec": "", } } +// 关闭窗体 +const fnEventCancel = () => { + refShow.value = false +} \ No newline at end of file