From e7434823e77b714cbee4778eda13a034e633e7dd Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Tue, 2 Jan 2024 16:38:13 +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=B7bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SearchHigh/src/SearchHigh.vue | 13 +++- .../jobsetting/jobsetting.data.ts | 3 +- .../labelManage/barcode/barcode.data.ts | 27 +++++++- .../labelManage/labeltype/labeltype.data.ts | 46 +++++++++++-- .../strategy/inspectStrategy/AddForm.vue | 67 ++++++++++++++----- .../purchasereturnRequestMain/index.vue | 15 ++++- 6 files changed, 141 insertions(+), 30 deletions(-) diff --git a/src/components/SearchHigh/src/SearchHigh.vue b/src/components/SearchHigh/src/SearchHigh.vue index 7f5d73ab0..c2c381951 100644 --- a/src/components/SearchHigh/src/SearchHigh.vue +++ b/src/components/SearchHigh/src/SearchHigh.vue @@ -21,7 +21,7 @@ - + (item.field != "action"))) +console.log(searchOption_high.value); const moreListData = ref({ filters:[] }) @@ -148,7 +149,15 @@ const moreListOptions = ref({ } return data } - + // 判断数字输入框小数点位数 + const getInputPrecision = (val) => { + const type = searchOption_high.value.find(item => (item.field == val)) + let precision = 6 + if (type?.form?.component == 'InputNumber') { + precision = type?.form?.componentProps?.precision || type?.form?.componentProps?.precision == 0 ? type.form.componentProps.precision : 6 + } + return precision +} // 根据数据内容约束条件选项 ==,!=,>,<,>=,<=,like,in,notIn,betweeen,isNull,isNotNull const formatMoreListActions = (val) => { if (val) { diff --git a/src/views/wms/basicDataManage/documentSetting/jobsetting/jobsetting.data.ts b/src/views/wms/basicDataManage/documentSetting/jobsetting/jobsetting.data.ts index 30c306b58..16eb4f37b 100644 --- a/src/views/wms/basicDataManage/documentSetting/jobsetting/jobsetting.data.ts +++ b/src/views/wms/basicDataManage/documentSetting/jobsetting/jobsetting.data.ts @@ -31,7 +31,8 @@ export const Jobsetting = useCrudSchemas(reactive([ form: { component: 'InputNumber', componentProps: { - min: 0 + min: 0, + precision:0 } }, }, diff --git a/src/views/wms/basicDataManage/labelManage/barcode/barcode.data.ts b/src/views/wms/basicDataManage/labelManage/barcode/barcode.data.ts index a39fb8bc1..33eec5260 100644 --- a/src/views/wms/basicDataManage/labelManage/barcode/barcode.data.ts +++ b/src/views/wms/basicDataManage/labelManage/barcode/barcode.data.ts @@ -2,12 +2,33 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' // 表单校验 export const BarcodeRules = reactive({ - code: [required], + code: [ + { required: true, message: '请输入代码', trigger: 'blur' }, + { max: 50, message: '不得超过50个字符', trigger: 'blur' } + ], + name: [ + { max: 50, message: '不得超过50个字符', trigger: 'blur' } + ], + description: [ + { max: 50, message: '不得超过50个字符', trigger: 'blur' } + ], order: [required], length: [required], prefixLenght: [required], - entityProperties: [required], - trimEnd: [required], + prefixChar: [ + { max: 50, message: '不得超过50个字符', trigger: 'blur' } + ], + entityProperties: [ + { required: true, message: '请输入实体属性', trigger: 'blur' }, + { max: 50, message: '不得超过50个字符', trigger: 'blur' } + ], + encyptMethod: [ + { max: 50, message: '不得超过50个字符', trigger: 'blur' } + ], + trimEnd: [ + { required: true, message: '请输入截断尾部空格', trigger: 'blur' }, + { max: 50, message: '不得超过50个字符', trigger: 'blur' } + ], isEncypt: [required], }) diff --git a/src/views/wms/basicDataManage/labelManage/labeltype/labeltype.data.ts b/src/views/wms/basicDataManage/labelManage/labeltype/labeltype.data.ts index a6bab3b83..86cae88d4 100644 --- a/src/views/wms/basicDataManage/labelManage/labeltype/labeltype.data.ts +++ b/src/views/wms/basicDataManage/labelManage/labeltype/labeltype.data.ts @@ -2,12 +2,48 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' // 表单校验 export const LabeltypeRules = reactive({ + labelCode: [ + { required: true, message: '请输入标签代码', trigger: 'blur' }, + { max: 50, message: '不得超过50个字符', trigger: 'blur' } + ], labelType: [required], - dataProtocol: [required], - splitMehod: [required], - validateMethod: [required], - templateName: [required], - labelCode: [required], + description: [ + { max: 50, message: '不得超过50个字符', trigger: 'blur' } + ], + dataProtocol: [ + { required: true, message: '请输入数据协议', trigger: 'blur' }, + { max: 50, message: '不得超过50个字符', trigger: 'blur' } + ], + splitMehod: [ + { required: true, message: '请输入拆分方法', trigger: 'blur' }, + { max: 50, message: '不得超过50个字符', trigger: 'blur' } + ], + header: [ + { max: 50, message: '不得超过50个字符', trigger: 'blur' } + ], + version: [ + { max: 50, message: '不得超过50个字符', trigger: 'blur' } + ], + separators: [ + { max: 50, message: '不得超过50个字符', trigger: 'blur' } + ], + validateMethod: [ + { required: true, message: '请输入校验方法', trigger: 'blur' }, + { max: 50, message: '不得超过50个字符', trigger: 'blur' } + ], + encyptEthod: [ + { max: 50, message: '不得超过50个字符', trigger: 'blur' } + ], + compressMethod: [ + { max: 50, message: '不得超过50个字符', trigger: 'blur' } + ], + templateName: [ + { required: true, message: '请输入模板名称', trigger: 'blur' }, + { max: 50, message: '不得超过50个字符', trigger: 'blur' } + ], + templateFile: [ + { max: 50, message: '不得超过50个字符', trigger: 'blur' } + ], isEncypt: [required], isCompress: [required], }) diff --git a/src/views/wms/basicDataManage/strategySetting/strategy/inspectStrategy/AddForm.vue b/src/views/wms/basicDataManage/strategySetting/strategy/inspectStrategy/AddForm.vue index 56fb59ebe..7027f8764 100644 --- a/src/views/wms/basicDataManage/strategySetting/strategy/inspectStrategy/AddForm.vue +++ b/src/views/wms/basicDataManage/strategySetting/strategy/inspectStrategy/AddForm.vue @@ -132,7 +132,12 @@ :key="cur.value" /> - + @@ -146,7 +151,10 @@
- + { } getFormSupplierList() // 改变检验方式的时候 -function changeInspectType(e){ +function changeInspectType(e) { if (e == 'SAMPLING') { - formData.value.configuration.SampleMethod='QTY' - formData.value.configuration.AqlList=[{ - FloorQty: 1, - CeilingQty: 2, - SampleValue: 1 - }] + formData.value.configuration.SampleMethod = 'QTY' + formData.value.configuration.AqlList = [ + { + FloorQty: 1, + CeilingQty: 2, + SampleValue: 1 + } + ] } } // 改变抽检方式的时候 @@ -404,7 +423,7 @@ const open = async (type: string, strategyCode: string, id?: number) => { formData.value.status = data.status == 0 ? true : false if (formData.value.priority == 0) { Butttondata.value = [ - defaultButtons.formSaveBtn({disabled:true}), // 保存 + defaultButtons.formSaveBtn({ disabled: true }), // 保存 defaultButtons.formCloseBtn(null) // 关闭 ] } else { @@ -436,21 +455,35 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗 /** 提交表单 */ const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 +const hasSameData = (array) => { + for (let k = 0; k < array.length; k++) { + for (let n = k + 1; n < array.length; n++) { + if(array[k].FloorQty <= array[n].FloorQty && array[n].FloorQty<=array[k].CeilingQty){ + return true + } + } + } + return false +} const submitForm = async () => { // 校验表单 inputNumberBlur() if (!formRef) return const valid = await formRef.value.validate() if (!valid) return - if(formData.value.priority == 0){ + if (formData.value.priority == 0) { message.error('优先级不可以为0') return } + if (hasSameData(formData.value.configuration.AqlList)) { + message.error('抽检规则数据范围重叠,请重新填写') + return + } // 提交请求 formLoading.value = true - if(formData.value.configuration.InspectType != 'SAMPLING'){ - formData.value.configuration.SampleMethod= '' - formData.value.configuration.AqlList=[] + if (formData.value.configuration.InspectType != 'SAMPLING') { + formData.value.configuration.SampleMethod = '' + formData.value.configuration.AqlList = [] } try { let data = { diff --git a/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue b/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue index f5a867151..1d736d832 100644 --- a/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue +++ b/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue @@ -103,6 +103,7 @@ import * as PurchasereturnRequestMainApi from '@/api/wms/purchasereturnRequestMa import * as PurchasereturnRequestDetailApi from '@/api/wms/purchasereturnRequestDetail' import * as PurchasereceiptRecordDetailApi from '@/api/wms/purchasereceiptRecordDetail' import * as defaultButtons from '@/utils/disposition/defaultButtons' +import { log } from 'console' // 采购退货申请 defineOptions({ name: 'PurchasereturnRequestMain' }) @@ -128,6 +129,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => if (type == 'tableForm') { // 明细查询页赋值 row[formField] = val[0][searchField] + row['supplierCode'] = val[0]['supplierCode'] row['poNumber'] = val[0]['poNumber'] row['poLine'] = val[0]['poLine'] row['itemCode'] = val[0]['itemCode'] @@ -187,7 +189,6 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => // item.fromLocationGroupCode = item.fromLocationGroupCode }) isShowButton.value = false - console.log('formSchema', PurchasereturnRequestMain.allSchemas.formSchema) PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => { if (item.field == 'supplierCode') { @@ -486,8 +487,18 @@ const handleDeleteTable = (item, index, formRef) => { // 主子数据 提交 const submitForm = async (formType, data) => { - console.log(formType) data.subList = tableData.value // 拼接子表数据参数 + let array =[] + data.subList.forEach((item,index) => { + if(item.supplierCode != data.supplierCode){ + array.push(index+1) + } + }) + if (array.length>0) { + formRef.value.formLoading = false + message.error(`第${array.join(',')}行数据的供应商代码与上方填写的供应商代码不一致`) + return + } try { if (formType === 'create') { await PurchasereturnRequestMainApi.createPurchasereturnRequestMain(data)