diff --git a/src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue b/src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue index 1ba04efcc..8abddc4c0 100644 --- a/src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue +++ b/src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue @@ -151,6 +151,8 @@ import dayjs from 'dayjs' import { getJmreportBaseUrl } from '@/utils/systemParam' import * as BomApi from "@/api/wms/bom"; import { formatDate } from '@/utils/formatTime' +import * as WorkshopApi from '@/api/wms/workshop' + // 制品收货申请 // 预生产收货申请 defineOptions({ name: 'ProductreceiptRequestMain' }) @@ -798,8 +800,23 @@ const searchTableSuccessLabel = async (formField, searchField, val, formRef, typ message.error('创建标签失败') }) } +const getDefaultWorkshopCode = async ()=>{ + let res = await WorkshopApi.getWorkshopPage({ + available: "TRUE" + }) + if(res&&res.list.length>0){ + if(res.list.find(item=>item.code=='PRC')){ + ProductreceiptRequestMain.allSchemas.formSchema.map(itemColumns => { + if(itemColumns.field == 'workshopCode') { + itemColumns.value = 'PRC' + } + }) + } + } +} /** 初始化 **/ onMounted(async () => { + getDefaultWorkshopCode() getList() importTemplateData.templateUrl = await ProductreceiptRequestMainApi.importTemplate() }) diff --git a/src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRequestMain/index.vue b/src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRequestMain/index.vue index db480fd1e..953c73c5f 100644 --- a/src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRequestMain/index.vue +++ b/src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRequestMain/index.vue @@ -151,6 +151,7 @@ import { getAccessToken } from '@/utils/auth' import { getJmreportBaseUrl } from '@/utils/systemParam' import * as BomApi from "@/api/wms/bom"; import { formatDate } from '@/utils/formatTime' +import * as WorkshopApi from '@/api/wms/workshop' // 装配收货申请 defineOptions({ name: 'ProductreceiptRequestMainA' }) @@ -800,9 +801,23 @@ const searchTableSuccess1 = async (formField, searchField, val, formRef, type, r message.error('创建标签失败') }) } - +const getDefaultWorkshopCode = async ()=>{ + let res = await WorkshopApi.getWorkshopPage({ + available: "TRUE" + }) + if(res&&res.list.length>0){ + if(res.list.find(item=>item.code=='PRC')){ + ProductreceiptRequestMain.allSchemas.formSchema.map(itemColumns => { + if(itemColumns.field == 'workshopCode') { + itemColumns.value = 'PRA' + } + }) + } + } +} /** 初始化 **/ onMounted(async () => { + getDefaultWorkshopCode() getList() importTemplateData.templateUrl = await ProductreceiptRequestMainApi.importTemplate() })