Browse Source

供应商用户关联管理,用户ID只能输入数字

master_hella_20240701
yufei0306 6 months ago
parent
commit
af160167f0
  1. 6
      src/components/Form/src/Form.vue
  2. 15
      src/components/Search/src/Search.vue
  3. 13
      src/views/wms/basicDataManage/systemSetting/supplierUser/index.vue
  4. 1
      src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/productionMainAssembleSparePart.data.ts
  5. 1
      src/views/wms/productionManage/productionplan/productionMainPredictSparePart/productionMainPredictSparePart.data.ts

6
src/components/Form/src/Form.vue

@ -55,7 +55,7 @@ export default defineComponent({
vLoading: propTypes.bool.def(false), vLoading: propTypes.bool.def(false),
labelPosition: propTypes.string.def('left'), labelPosition: propTypes.string.def('left'),
}, },
emits: ['register','opensearchTable','clearSearchInput', 'onChange', 'onBlur','onEnter','hiddenFilterButton','changeDialogWidth'], emits: ['register','opensearchTable','clearSearchInput', 'onChange', 'onBlur','onEnter','hiddenFilterButton','changeDialogWidth','onInput'],
setup(props, { slots, expose, emit }) { setup(props, { slots, expose, emit }) {
// element form // element form
const elFormRef = ref<ComponentRef<typeof ElForm>>() const elFormRef = ref<ComponentRef<typeof ElForm>>()
@ -204,6 +204,9 @@ export default defineComponent({
const onBlur = (field, e) => { const onBlur = (field, e) => {
emit('onBlur', field, e) emit('onBlur', field, e)
} }
const onInput = (field,value) => {
emit('onInput', field,value)
}
// formItem // formItem
const renderFormItem = (item: FormSchema) => { const renderFormItem = (item: FormSchema) => {
// options // options
@ -382,6 +385,7 @@ export default defineComponent({
style={item.componentProps?.style} style={item.componentProps?.style}
onChange={(e)=>{onChange(item.field, e)}} onChange={(e)=>{onChange(item.field, e)}}
onBlur={(e)=>{onBlur(item.field, e)}} onBlur={(e)=>{onBlur(item.field, e)}}
onInput={(value)=>{onInput(item.field,value)}}
{...(notRenderOptions.includes(item?.component as string) && {...(notRenderOptions.includes(item?.component as string) &&
item?.componentProps?.options item?.componentProps?.options
? { options: item?.componentProps?.options || [] } ? { options: item?.componentProps?.options || [] }

15
src/components/Search/src/Search.vue

@ -43,7 +43,7 @@ const props = defineProps({
} }
}) })
const emit = defineEmits(['search', 'reset']) const emit = defineEmits(['search', 'reset','onInput'])
const visible = ref(true) const visible = ref(true)
@ -88,6 +88,14 @@ const { register, elFormRef, methods } = useForm({
model: props.model || {} model: props.model || {}
}) })
const onInput = (field,value) => {
emit('onInput', field,value)
}
const formRef = ref()
const setFormValues = (formData)=>{
formRef.value.setValues(formData)
}
const search = async () => { const search = async () => {
await unref(elFormRef)?.validate(async (isValid) => { await unref(elFormRef)?.validate(async (isValid) => {
if (isValid) { if (isValid) {
@ -118,12 +126,14 @@ const setVisible = () => {
} }
const Search = ref() const Search = ref()
onMounted(() => {}) onMounted(() => {})
defineExpose({setFormValues}) // open
</script> </script>
<template> <template>
<!-- update by 芋艿class="-mb-15px" 用于降低和 ContentWrap 组件的底部距离避免空隙过大 --> <!-- update by 芋艿class="-mb-15px" 用于降低和 ContentWrap 组件的底部距离避免空隙过大 -->
<div ref="Search"> <div ref="Search">
<Form <Form ref="formRef"
:inline="inline" :inline="inline"
:is-col="isCol" :is-col="isCol"
:is-custom="false" :is-custom="false"
@ -132,6 +142,7 @@ onMounted(() => {})
class="-mb-15px search" class="-mb-15px search"
hide-required-asterisk hide-required-asterisk
@register="register" @register="register"
@onInput="onInput"
> >
<template #action> <template #action>
<div v-if="layout === 'inline'"> <div v-if="layout === 'inline'">

13
src/views/wms/basicDataManage/systemSetting/supplierUser/index.vue

@ -1,7 +1,7 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="SupplierUser.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search ref="seachRef" :schema="SupplierUser.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" @onInput="onInput"/>
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
@ -89,6 +89,17 @@ const tableColumns = ref(SupplierUser.allSchemas.tableColumns)
const updataTableColumns = (val) => { const updataTableColumns = (val) => {
tableColumns.value = val tableColumns.value = val
} }
const seachRef = ref()
const onInput = (field,value) => {
if('userId'==field){
value = value.replace(/[^\d]/g,'')
seachRef.value.setFormValues({
userId:value
})
}
}
// //
const searchTableParams = ref([ const searchTableParams = ref([

1
src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/productionMainAssembleSparePart.data.ts

@ -731,6 +731,7 @@ export const ProductionDetail = useCrudSchemas(reactive<CrudSchema[]>([
width: 150 width: 150
}, },
tableForm:{ tableForm:{
disabled:true,
type: 'Select' type: 'Select'
} }
}, },

1
src/views/wms/productionManage/productionplan/productionMainPredictSparePart/productionMainPredictSparePart.data.ts

@ -732,6 +732,7 @@ export const ProductionDetail = useCrudSchemas(reactive<CrudSchema[]>([
width: 150 width: 150
}, },
tableForm:{ tableForm:{
disabled:true,
type: 'Select' type: 'Select'
} }
}, },

Loading…
Cancel
Save