From 5aea3d50ea8703a2be8c1c11de07e413fd0ecb1e Mon Sep 17 00:00:00 2001 From: yufei0306 <13417315+yufei0306@user.noreply.gitee.com> Date: Fri, 26 Apr 2024 13:37:15 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=87=E8=B4=AD=E9=80=80=E8=B4=A7=E7=94=B3?= =?UTF-8?q?=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../purchasereturnRequestMain/index.vue | 18 ++++- .../purchasereturnRequestMain.data.ts | 80 ++++++++++++++----- 2 files changed, 76 insertions(+), 22 deletions(-) diff --git a/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue b/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue index 18cde77ca..8474dc7d1 100644 --- a/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue +++ b/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue @@ -63,6 +63,7 @@ @handleDeleteTable="handleDeleteTable" @searchTableSuccess="searchTableSuccess" @submitForm="submitForm" + @onEnter="onEnter" /> @@ -128,6 +129,14 @@ const isShowButton = ref(true) const updataTableColumns = (val) => { tableColumns.value = val } +const onEnter = async (field,value)=>{ + console.log(field,value) + if('supplierCode'==field){ + //供应商代码 + }else if('purchaseReceiptRecordNumber' == field){ + //采购收货记录 + } +} // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { @@ -195,7 +204,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => // 获取子表数据 getBomDisassemble // PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailList({ PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailListToRepeat({ - masterId: val[0]['id'] + masterId: val[0]['masterId'] }).then((res) => { if (res) tableData.value = res tableData.value.forEach((item) => { @@ -225,6 +234,9 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => if (item.field == 'qty') { item.tableForm.disabled = false } + if (item.field == 'returnedQty') { + item.tableForm.disabled = false + } if (item.field == 'reason') { item.tableForm.disabled = false } @@ -702,6 +714,10 @@ const handleDeleteTable = (item, index, formRef) => { // 主子数据 提交 const submitForm = async (formType, data) => { + if(tableData.value.find(item=>Number(item.returnedQty)>Number(item.receiptQty))){ + message.warning("退货数量不能大于收获数量") + return; + } data.subList = tableData.value // 拼接子表数据参数 try { if (formType === 'create') { diff --git a/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/purchasereturnRequestMain.data.ts b/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/purchasereturnRequestMain.data.ts index 699c00b4a..2f3ff2b4d 100644 --- a/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/purchasereturnRequestMain.data.ts +++ b/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/purchasereturnRequestMain.data.ts @@ -45,6 +45,26 @@ export const PurchasereturnRequestMain = useCrudSchemas(reactive([ isForm: false, isSearch: true, }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.REQUEST_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, + isForm:false, + sort: 'custom', + table: { + width: 150 + }, + sortTableDefault:1, + form: { + value: '1', + componentProps: { + disabled: true + } + } + }, { label: '供应商代码', field: 'supplierCode', @@ -56,6 +76,7 @@ export const PurchasereturnRequestMain = useCrudSchemas(reactive([ isSearch: true, form:{ componentProps:{ + enterSearch: true, isSearchList: true, // 开启查询弹窗 searchListPlaceholder: '请选择供应商代码', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 @@ -79,8 +100,10 @@ export const PurchasereturnRequestMain = useCrudSchemas(reactive([ searchListPlaceholder: '请选择采购收货记录单号', // 输入框占位文本 searchField: 'number', // 查询弹窗赋值字段 searchTitle: '采购收货记录', // 查询弹窗标题 + isConcatDetailSchemas:true, + searchDetailSchemas: PurchasereceiptRecordDetail.allSchemas, searchAllSchemas: PurchasereceiptRecordMain.allSchemas, // 查询弹窗所需类 - searchPage: PurchasereceiptRecordMainApi.getPurchasereceiptRecordMainPage, // 查询弹窗所需分页方法 + searchPage: PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPage, // 查询弹窗所需分页方法 searchCondition: [{ key: 'available', value: 'TRUE', @@ -307,27 +330,9 @@ export const PurchasereturnRequestMain = useCrudSchemas(reactive([ } } }, + { - label: '状态', - field: 'status', - dictType: DICT_TYPE.REQUEST_STATUS, - dictClass: 'string', - isSearch: true, - isTable: false, - isForm:false, - sort: 'custom', - table: { - width: 150 - }, - form: { - value: '1', - componentProps: { - disabled: true - } - } - }, - { - label: '备注', + label: '原因', field: 'remark', sort: 'custom', table: { @@ -762,6 +767,29 @@ export const PurchasereturnRequestDetail = useCrudSchemas(reactive precision: 6 } }, + { + label: '退货数量', + field: 'returnedQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + componentProps: { + min: 0, + precision: 6, + disabled:false + } + }, + isForm:false, + tableForm:{ + type:'InputNumber', + min:0, + precision: 6, + disabled:false + } + }, { label: '数量', field: 'qty', @@ -776,6 +804,7 @@ export const PurchasereturnRequestDetail = useCrudSchemas(reactive precision: 6 } }, + isForm:false, tableForm:{ type:'InputNumber', min:0, @@ -1109,6 +1138,15 @@ export const PurchasereturnRequestDetail = useCrudSchemas(reactive isTableForm:false, isForm:false }, + { + label: '原因', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + isTable: false, + }, { label: '操作', hiddenInMain:true,