diff --git a/src/api/wms/customerdock/index.ts b/src/api/wms/customerdock/index.ts index 5a5d1dbc4..d93f98c85 100644 --- a/src/api/wms/customerdock/index.ts +++ b/src/api/wms/customerdock/index.ts @@ -62,3 +62,14 @@ export const exportCustomerdock = async (params) => { export const importTemplate = () => { return request.download({ url: '/wms/customerdock/get-import-template' }) } + +// 查询客户月台列表 +export const pageCustomerCodeToCustomerDock = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return request.post({ url: '/wms/customerdock/pageCustomerCodeToCustomerDockSenior', data }) + } else { + return await request.get({ url: `/wms/customerdock/pageCustomerCodeToCustomerDock`, params }) + } +} \ No newline at end of file diff --git a/src/api/wms/purchaseDetail/index.ts b/src/api/wms/purchaseDetail/index.ts index a9d7e622c..23e754226 100644 --- a/src/api/wms/purchaseDetail/index.ts +++ b/src/api/wms/purchaseDetail/index.ts @@ -43,6 +43,11 @@ export const getPurchaseDetailPage = async (params) => { } } +// 校验子表数据 +export const getPurchaseDetailPageCheckData = async (params) => { + return await request.get({ url: `/wms/purchase-detail/pageCheckData`, params }) +} + // 查询采购订单子列表 export const getPurchaseDetailPagePoNumber = async (params) => { if (params.isSearch) { diff --git a/src/api/wms/purchasereceiptRecordDetail/index.ts b/src/api/wms/purchasereceiptRecordDetail/index.ts index b326094dc..569de2b18 100644 --- a/src/api/wms/purchasereceiptRecordDetail/index.ts +++ b/src/api/wms/purchasereceiptRecordDetail/index.ts @@ -58,6 +58,18 @@ export const getPurchasereceiptRecordDetailPage = async (params) => { return await request.get({ url: `/wms/purchasereceipt-record-detail/page`, params }) } } + +// 查询采购收货记录子列表 +export const getPurchasereceiptRecordDetailPageBySupplierCode = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/wms/purchasereceipt-record-detail/seniorBySupplierCode', data }) + } else { + return await request.get({ url: `/wms/purchasereceipt-record-detail/pageBySupplierCode`, params }) + } +} + // 查询采购收货记录子列表 export const getPurchasereceiptRecordDetailList = async (params) => { return await request.get({ url: `/wms/purchasereceipt-record-detail/list`, params }) diff --git a/src/views/wms/basicDataManage/customerManage/customeritem/customeritem.data.ts b/src/views/wms/basicDataManage/customerManage/customeritem/customeritem.data.ts index db261dc08..21b99adbc 100644 --- a/src/views/wms/basicDataManage/customerManage/customeritem/customeritem.data.ts +++ b/src/views/wms/basicDataManage/customerManage/customeritem/customeritem.data.ts @@ -77,7 +77,7 @@ export const Customeritem = useCrudSchemas(reactive([ }, { label: '客户计量单位', - field: 'cusotmerUom', + field: 'customerUom', dictType: DICT_TYPE.UOM, dictClass: 'string', isTable: true, @@ -85,6 +85,11 @@ export const Customeritem = useCrudSchemas(reactive([ table: { width: 150 }, + form: { + componentProps:{ + disabled: true + } + } }, { label: '转换率', @@ -183,7 +188,8 @@ export const Customeritem = useCrudSchemas(reactive([ value: 'TRUE', componentProps: { inactiveValue: 'FALSE', - activeValue: 'TRUE' + activeValue: 'TRUE', + disabled: true } }, isSearch: true diff --git a/src/views/wms/basicDataManage/customerManage/customeritem/index.vue b/src/views/wms/basicDataManage/customerManage/customeritem/index.vue index 7bfe3933f..c49dd9b48 100644 --- a/src/views/wms/basicDataManage/customerManage/customeritem/index.vue +++ b/src/views/wms/basicDataManage/customerManage/customeritem/index.vue @@ -139,6 +139,8 @@ const butttondata = [ const buttonTableClick = async (val, row) => { if (val == 'edit') { // 编辑 // const res = await CustomeritemApi.getItempackaging(row.id) + console.log(1111,row); + openForm('update', row) } else if (val == 'delete') { // 删除 handleDelete(row.id) @@ -179,6 +181,10 @@ const formsSuccess = async (formType,data) => { const searchTableSuccess = (formField, searchField, val, formRef) => { nextTick(() => { const setV = {} + if(formField == 'itemCode'){ + console.log(val); + setV['cusotmerUom'] = val[0]['uom'] + } setV[formField] = val[0][searchField] formRef.setValues(setV) }) diff --git a/src/views/wms/deliversettlementManage/deliver/deliverRequestMain/deliverRequestMain.data.ts b/src/views/wms/deliversettlementManage/deliver/deliverRequestMain/deliverRequestMain.data.ts index 75ab5882c..73324cdb5 100644 --- a/src/views/wms/deliversettlementManage/deliver/deliverRequestMain/deliverRequestMain.data.ts +++ b/src/views/wms/deliversettlementManage/deliver/deliverRequestMain/deliverRequestMain.data.ts @@ -146,7 +146,7 @@ export const DeliverRequestMain = useCrudSchemas(reactive([ searchField: 'code', // 查询弹窗赋值字段 searchTitle: '客户月台信息', // 查询弹窗标题 searchAllSchemas: Customerdock.allSchemas, // 查询弹窗所需类 - searchPage: CustomerdockApi.getCustomerdockPage, // 查询弹窗所需分页方法 + searchPage: CustomerdockApi.pageCustomerCodeToCustomerDock, // 查询弹窗所需分页方法 searchCondition: [{ key: 'available', value: 'TRUE', diff --git a/src/views/wms/deliversettlementManage/deliver/deliverRequestMain/index.vue b/src/views/wms/deliversettlementManage/deliver/deliverRequestMain/index.vue index e26919fd1..5317064fe 100644 --- a/src/views/wms/deliversettlementManage/deliver/deliverRequestMain/index.vue +++ b/src/views/wms/deliversettlementManage/deliver/deliverRequestMain/index.vue @@ -100,6 +100,7 @@ const { t } = useI18n() // 国际化 const route = useRoute() // 路由信息 const routeName = ref() routeName.value = route.name +const customerCode = ref() const tableColumns = ref(DeliverRequestMain.allSchemas.tableColumns) const isShowButton = ref(true) @@ -144,6 +145,31 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => item.tableForm.disabled = true } }) + // 修改 tableform 属性 + if(formField == 'customerCode'){ + console.log(1111,val); + customerCode.value = val[0]['code'] + console.log(11112,customerCode.value); + } + DeliverRequestMain.allSchemas.tableFormColumns.map(item => { + if(item.field == 'customerDockCode') { + item.tableForm.searchCondition = [ + { + key: 'customerCode', + value: customerCode.value , + isMainValue: true + }] + item.form.componentProps.searchCondition = [ + { + key: 'customerCode', + value: customerCode.value , + isMainValue: true + }]} + else { + delete item.tableForm.searchCondition + delete item.form.componentProps.searchCondition + } + }) }).catch(err => { console.log(err) message.error('错误') @@ -330,12 +356,26 @@ const openForm =async (type: string, row?: number) => { item.componentProps.isSearchList = false, item.componentProps.disabled = true } + if (item.field == 'customerCode') { + item.componentProps.isSearchList = false, + item.componentProps.disabled = true + } + if (item.field == 'customerDockCode') { + item.componentProps.isSearchList = false, + item.componentProps.disabled = true + } }) }else { DeliverRequestMain.allSchemas.formSchema.forEach((item) => { if (item.field == 'deliverPlanNumber') { item.componentProps.isSearchList = true } + if (item.field == 'customerCode') { + item.componentProps.isSearchList = true + } + if (item.field == 'customerDockCode') { + item.componentProps.isSearchList = true + } }) } tableData.value = [] // 重置明细数据 diff --git a/src/views/wms/deliversettlementManage/deliverplan/deliverPlanMain/deliverPlanMain.data.ts b/src/views/wms/deliversettlementManage/deliverplan/deliverPlanMain/deliverPlanMain.data.ts index 6adcb194e..577da3ab7 100644 --- a/src/views/wms/deliversettlementManage/deliverplan/deliverPlanMain/deliverPlanMain.data.ts +++ b/src/views/wms/deliversettlementManage/deliverplan/deliverPlanMain/deliverPlanMain.data.ts @@ -10,13 +10,6 @@ import { Customerdock } from '@/views/wms/basicDataManage/customerManage/custome import * as CustomerItemApi from '@/api/wms/customeritem' import { Customeritem } from '@/views/wms/basicDataManage/customerManage/customeritem/customeritem.data' -import * as SaleMainApi from '@/api/wms/saleMain' -import * as SaleDetailApi from '@/api/wms/saleDetail' -import { SaleDetail, SaleMain } from '../saleMain/saleMain.data' - -import * as ItembasicApi from '@/api/wms/itembasic' -import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data' - const { t } = useI18n() // 国际化 /** @@ -328,11 +321,11 @@ export const DeliverPlanDetail = useCrudSchemas(reactive([ }, tableForm:{ isInpuFocusShow: true, // 开启查询弹窗 - searchListPlaceholder: '请选择物料代码', + searchListPlaceholder: '请选择客户月台代码', searchField: 'code', - searchTitle: '物料基础信息', + searchTitle: '客户月台基础信息', searchAllSchemas: Customerdock.allSchemas, - searchPage: CustomerDockApi.getCustomerdockPage, + searchPage: CustomerDockApi.pageCustomerCodeToCustomerDock, searchCondition: [{ key: 'available', value: 'TRUE', @@ -343,7 +336,25 @@ export const DeliverPlanDetail = useCrudSchemas(reactive([ isMainValue: true }] }, - isForm: false, + form: { + componentProps: { + isSearchList: true, + searchListPlaceholder: '请选择客户月台代码', + searchField: 'code', + searchTitle: '客户月台基础信息', + searchAllSchemas: Customerdock.allSchemas, + searchPage: CustomerDockApi.pageCustomerCodeToCustomerDock, + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + },{ + key: 'customerCode', + value: 'customerCode', + isMainValue: true + }] + } + }, }, { label: '项目', diff --git a/src/views/wms/deliversettlementManage/deliverplan/deliverPlanMain/index.vue b/src/views/wms/deliversettlementManage/deliverplan/deliverPlanMain/index.vue index 124aaae33..adee6c55b 100644 --- a/src/views/wms/deliversettlementManage/deliverplan/deliverPlanMain/index.vue +++ b/src/views/wms/deliversettlementManage/deliverplan/deliverPlanMain/index.vue @@ -91,6 +91,7 @@ const { t } = useI18n() // 国际化 const route = useRoute() // 路由信息 const routeName = ref() routeName.value = route.name +const customerCode = ref() const tableColumns = ref(DeliverPlanMain.allSchemas.tableColumns) // 字段设置 更新主列表字段 @@ -101,6 +102,25 @@ const updataTableColumns = (val) => { // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { nextTick(() => { + // 修改 tableform 属性 + if(formField == 'customerCode'){ + customerCode.value = val[0]['code'] + } + DeliverPlanDetail.allSchemas.tableFormColumns.map(item => { + if(item.field == 'customerDockCode') { + item.tableForm.searchCondition = [ + { + key: 'customerCode', + value: customerCode.value , + isMainValue: false + }] + item.form.componentProps.searchCondition = [ + { + key: 'customerCode', + value: customerCode.value , + isMainValue: false + }]} + }) if (type == 'tableForm') { if(formField == 'itemCode') { row['uom'] = val[0]['customerUom'] diff --git a/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue b/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue index 379731c8e..f0e6a6c53 100644 --- a/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue +++ b/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue @@ -77,6 +77,7 @@ :apiDelete="PurchasereturnRequestDetailApi.deletePurchasereturnRequestDetail" :Echo="Echo" @searchTableSuccessDetail="searchTableSuccessDetail" + :detailValidate="detailValidate" /> @@ -167,55 +168,62 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => row['projectCode'] = val[0]['projectCode'] } else { const setV = {} - setV[formField] = val[0][searchField] - setV['purchaseReceiptRecordNumber'] = val[0]['number'] - setV['supplierCode'] = val[0]['supplierCode'] - setV['asnNumber'] = val[0]['asnNumber'] - setV['ppNumber'] = val[0]['ppNumber'] - - // 获取子表数据 getBomDisassemble - PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailList({ - masterId: val[0]['id'] - }) - .then((res) => { - if (res) tableData.value = res - tableData.value.forEach((item) => { - item.batch = item.toBatch - item.packingNumber = item.toPackingNumber - item.containerNumber = item.toContainerNumber - item.containerNumber = item.toContainerNumber - item.toLocationGroupCode = null - item.toWarehouseCode = null - item.toLocationTypes = null - item.toLocationCode = null - // item.fromLocationCode = item.fromLocationCode - // item.fromLocationGroupCode = item.fromLocationGroupCode - }) - isShowButton.value = false - PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => { - if (item.field == 'supplierCode') { - item.componentProps.disabled = true - } - }) - PurchasereturnRequestDetail.allSchemas.tableFormColumns.map((item) => { - item.tableForm.disabled = true - if (item.field == 'remark') { - item.tableForm.disabled = false - } - if (item.field == 'qty') { - item.tableForm.disabled = false - } - if (item.field == 'reason') { - item.tableForm.disabled = false - } - if (item.field == 'itemCode') { - item.tableForm.isInpuFocusShow = false - } - }) - }) - .catch((err) => { + if(formField == 'purchaseReceiptRecordNumber'){ + isShowButton.value = false + setV[formField] = val[0][searchField] + setV['purchaseReceiptRecordNumber'] = val[0]['number'] + setV['supplierCode'] = val[0]['supplierCode'] + setV['asnNumber'] = val[0]['asnNumber'] + setV['ppNumber'] = val[0]['ppNumber'] + + // 获取子表数据 getBomDisassemble + PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailList({ + masterId: val[0]['id'] + }).then((res) => { + if (res) tableData.value = res + tableData.value.forEach((item) => { + item.batch = item.toBatch + item.packingNumber = item.toPackingNumber + item.containerNumber = item.toContainerNumber + item.containerNumber = item.toContainerNumber + item.toLocationGroupCode = null + item.toWarehouseCode = null + item.toLocationTypes = null + item.toLocationCode = null + // item.fromLocationCode = item.fromLocationCode + // item.fromLocationGroupCode = item.fromLocationGroupCode + }) + + PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => { + if (item.field == 'supplierCode') { + item.componentProps.disabled = true + } + }) + PurchasereturnRequestDetail.allSchemas.tableFormColumns.map((item) => { + item.tableForm.disabled = true + if (item.field == 'remark') { + item.tableForm.disabled = false + } + if (item.field == 'qty') { + item.tableForm.disabled = false + } + if (item.field == 'reason') { + item.tableForm.disabled = false + } + if (item.field == 'itemCode') { + item.tableForm.isInpuFocusShow = false + } + }) + }).catch((err) => { console.log(err) }) + } + if(formField == 'supplierCode'){ + isShowButton.value = true + setV['supplierCode'] = val[0]['code'] + setV['purchaseReceiptRecordNumber'] = '' + tableData.value = [] + } formRef.setValues(setV) } }) @@ -224,7 +232,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => const searchTableSuccessDetail = (formField, searchField, val, formRef) => { nextTick(() => { const setV = {} - if(formField == 'poLine'){ + if(formField == 'poLine' || formField == 'itemCode'){ console.log(val) setV['poLine'] = val[0]['poLine'] setV['poNumber'] = val[0]['poNumber'] @@ -397,7 +405,8 @@ const openForm = async (type: string, row?: number) => { if(type == 'create'){ PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => { if (item.field == 'supplierCode') { - item.componentProps.disabled = false + item.componentProps.disabled = true + item.componentProps.isSearchList = true } if(item.field == 'purchaseReceiptRecordNumber'){ item.componentProps.disabled = true @@ -408,7 +417,8 @@ const openForm = async (type: string, row?: number) => { if(type == 'update'){ PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => { if (item.field == 'supplierCode') { - item.componentProps.disabled = false + item.componentProps.disabled = true + item.componentProps.isSearchList = false } if(item.field == 'purchaseReceiptRecordNumber'){ item.componentProps.disabled = true @@ -513,6 +523,7 @@ const tableData = ref([]) // 添加明细 const handleAddTable = () => { tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys))) + let purchaseReceiptRecordNumber = formRef.value.formRef.formModel.purchaseReceiptRecordNumber PurchasereturnRequestDetail.allSchemas.tableFormColumns.map((item) => { item.tableForm.disabled = true if (item.field == 'remark') { @@ -524,8 +535,20 @@ const handleAddTable = () => { if (item.field == 'qty') { item.tableForm.disabled = false } - if (item.field == 'itemCode') { - item.tableForm.isInpuFocusShow = true + if(purchaseReceiptRecordNumber == ''){ + if (item.field == 'itemCode') { + item.tableForm.isInpuFocusShow = true + } + if(item.field == 'poLine'){ + item.tableForm.isInpuFocusShow = false + } + }else{ + if (item.field == 'itemCode') { + item.tableForm.isInpuFocusShow = false + } + if(item.field == 'poLine'){ + item.tableForm.isInpuFocusShow = true + } } }) } @@ -541,7 +564,6 @@ const handleDeleteTable = (item, index, formRef) => { }) nextTick(() => { const setV = {} - setV['purchaseReceiptRecordNumber'] = '' setV['supplierCode'] = '' formRef.setValues(setV) @@ -565,6 +587,18 @@ const submitForm = async (formType, data) => { } try { if (formType === 'create') { + let flag = false; + data.subList.forEach((item) => { + if(item.qty == 0){ + message.warning("数量不能为0") + flag = true; + return; + } + }) + if(flag){ + formRef.value.formLoading = false + return + } await PurchasereturnRequestMainApi.createPurchasereturnRequestMain(data) message.success(t('common.createSuccess')) } else { @@ -579,6 +613,19 @@ const submitForm = async (formType, data) => { } } +// 子表新增/编辑校验 +const detailValidate = (data) => { + let tag = false; + if(data.qty <= 0){ + message.warning('数量必须大于0') + tag = false; + return tag; + }else { + tag = true; + return tag; + } +} + /** 导入 */ const importFormRef = ref() const handleImport = () => { diff --git a/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/purchasereturnRequestMain.data.ts b/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/purchasereturnRequestMain.data.ts index e3e005a0c..8aad77a84 100644 --- a/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/purchasereturnRequestMain.data.ts +++ b/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/purchasereturnRequestMain.data.ts @@ -10,7 +10,8 @@ import { import * as BalanceApi from '@/api/wms/balance' import { Balance } from '@/views/wms/inventoryManage/balance/balance.data' import * as PurchasereceiptRecordDetailApi from '@/api/wms/purchasereceiptRecordDetail' - +import { Supplier } from "@/views/wms/basicDataManage/supplierManage/supplier/supplier.data"; +import * as SupplierApi from "@/api/wms/supplier"; // 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值 @@ -99,7 +100,12 @@ export const PurchasereturnRequestMain = useCrudSchemas(reactive([ isSearch: true, form:{ componentProps:{ - disabled:false + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择供应商代码', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '供应商信息', // 查询弹窗标题 + searchAllSchemas: Supplier.allSchemas, // 查询弹窗所需类 + searchPage: SupplierApi.getSupplierPage // 查询弹窗所需分页方法 } } }, @@ -491,7 +497,18 @@ export const PurchasereturnRequestDetail = useCrudSchemas(reactive width: 150 }, tableForm:{ - disabled:true + isInpuFocusShow: true, // 开启查询弹窗 + searchListPlaceholder: '请选择订单行', + searchField: 'poLine', + searchTitle: '采购收货记录信息', + searchAllSchemas: PurchasereceiptRecordDetail.allSchemas, + searchPage: PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPage, + searchCondition: [{ + key: 'number', + value: 'purchaseReceiptRecordNumber', + message: '请填写采购收货记录号!', + isMainValue: true + }] }, form: { // labelMessage: '信息提示说明!!!', @@ -507,10 +524,6 @@ export const PurchasereturnRequestDetail = useCrudSchemas(reactive value: 'purchaseReceiptRecordNumber', message: '请填写采购收货记录号!', isMainValue: true - },{ - key: 'available', - value: 'TRUE', - isMainValue: false }] } }, @@ -521,13 +534,37 @@ export const PurchasereturnRequestDetail = useCrudSchemas(reactive sort: 'custom', table: { width: 150 - }, + }, tableForm:{ - disabled:true + // labelMessage: '信息提示说明!!!', + isInpuFocusShow: true, // 开启查询弹窗 + searchListPlaceholder: '请选择订单行', + searchField: 'poLine', + searchTitle: '采购收货记录信息', + searchAllSchemas: PurchasereceiptRecordDetail.allSchemas, + searchPage: PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageBySupplierCode, + searchCondition: [{ + key: 'supplierCode', + value: 'supplierCode', + message: '请填写采购收货记录号!', + isMainValue: true + }] }, form: { - componentProps:{ - disabled:true + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, + searchListPlaceholder: '请选择订单行', + searchField: 'poLine', + searchTitle: '采购收货记录信息', + searchAllSchemas: PurchasereceiptRecordDetail.allSchemas, + searchPage: PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageBySupplierCode, + searchCondition: [{ + key: 'supplierCode', + value: 'supplierCode', + message: '请填写采购收货记录号!', + isMainValue: true + }] } } }, @@ -663,14 +700,15 @@ export const PurchasereturnRequestDetail = useCrudSchemas(reactive }, form: { component: 'InputNumber', - componentProps:{ - disabled:true + componentProps: { + min: 0, + precision: 6 } }, tableForm:{ - disabled:true, type:'InputNumber', min:0, + precision: 6 } }, { diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/index.vue index a3b5e9984..4dbdb7846 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/index.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/index.vue @@ -26,17 +26,33 @@ - + - @@ -208,13 +224,44 @@ /** 添加/修改操作 */ const formRef = ref() const openForm = async (type : string, row ?: number) => { + console.log("【purchaseMain】type类型:",type); tableData.value = [] // 重置明细数据 + if(type == 'create'){ + PurchaseMain.allSchemas.formSchema.forEach((item) => { + if (item.field == 'supplierCode') { + item.componentProps.isSearchList = true + item.componentProps.disabled = true + } + }) + } + if(type == 'update'){ + PurchaseMain.allSchemas.formSchema.forEach((item) => { + if (item.field == 'supplierCode') { + item.componentProps.isSearchList = false + item.componentProps.disabled = true + } + }) + } formRef.value.open(type, row) } /** 详情操作 */ const detailRef = ref() const openDetail = (row : any, titleName : any, titleValue : any) => { + console.log("row",row.type); + if(row.type == 'DISCRETE'){ + PurchaseDetail.allSchemas.formSchema.map((item) => { + if (item.field == 'orderQty') { + item.componentProps.disabled = false + } + }) + }else{ + PurchaseDetail.allSchemas.formSchema.map((item) => { + if (item.field == 'orderQty') { + item.componentProps.disabled = true + } + }) + } detailRef.value.openDetail(row, titleName, titleValue,'orderPurchaseMain') } @@ -361,6 +408,23 @@ } getList() // 刷新当前列表 } + const onChangeQty = (field, cur) => { + if(field == 'type' && cur == 'DISCRETE'){ + PurchaseDetail.allSchemas.tableFormColumns.map((item) => { + if (item.field == 'orderQty') { + item.tableForm.disabled = false + } + }) + } + if(field == 'type' && cur == 'SCHEDULE'){ + PurchaseDetail.allSchemas.tableFormColumns.map((item) => { + if (item.field == 'orderQty') { + item.tableForm.disabled = true + } + }) + } + + } /** 初始化 **/ onMounted(async () => { diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/purchaseMain.data.ts b/src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/purchaseMain.data.ts index 8114d84c9..3451a5e4e 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/purchaseMain.data.ts +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/purchaseMain.data.ts @@ -459,11 +459,13 @@ export const PurchaseDetail = useCrudSchemas(reactive([ form: { component: 'InputNumber', componentProps: { + disabled:false, min: 1, precision: 6 } }, tableForm: { + disabled:false, type: 'InputNumber', min: 1, precision: 6 diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue index af1229dee..4f8e575a9 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue @@ -388,14 +388,16 @@ const submitForm = async (formType, data) => { data.subList = [] for (let item of tableData.value) { - await PurchaseDetailApi.getPurchaseDetailPage({ + await PurchaseDetailApi.getPurchaseDetailPageCheckData({ number: item.poNumber, lineNumber: item.poLine, }).then(res => { console.log("【要货计划】-每条数据结果",item) - if (item.planQty > res.list[0].orderQty - res.list[0].plannedQty) { - message.error('要货计划数量不得大于订单数量-已计划数量') - return + if(res.list[0].type == 'DISCRETE'){//只有离散单需要这个校验 + if (item.planQty > res.list[0].orderQty - res.list[0].plannedQty) { + message.error('要货计划数量不得大于订单数量-已计划数量') + return + } } data.subList.push(item) // 拼接子表数据参数 }) @@ -422,14 +424,18 @@ // 子表新增/编辑校验 const detailValidate = async (data) => { let tag = false - await PurchaseDetailApi.getPurchaseDetailPage({ + await PurchaseDetailApi.getPurchaseDetailPageCheckData({ number: data.poNumber, lineNumber: data.poLine }).then(res => { - if (data.planQty > res.list[0].orderQty - res.list[0].plannedQty) { - message.error('要货计划数量不得大于订单数量-已计划数量') - tag = false - } else { + if(res.list[0].type == 'DISCRETE'){//只有离散单需要这个校验 + if (data.planQty > res.list[0].orderQty - res.list[0].plannedQty) { + message.error('要货计划数量不得大于订单数量-已计划数量') + tag = false + } else { + tag = true + } + }else{ tag = true } }).catch(err =>{