Browse Source

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

master_hella_20240701
yufei0306 5 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),
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 }) {
// element form
const elFormRef = ref<ComponentRef<typeof ElForm>>()
@ -204,6 +204,9 @@ export default defineComponent({
const onBlur = (field, e) => {
emit('onBlur', field, e)
}
const onInput = (field,value) => {
emit('onInput', field,value)
}
// formItem
const renderFormItem = (item: FormSchema) => {
// options
@ -382,6 +385,7 @@ export default defineComponent({
style={item.componentProps?.style}
onChange={(e)=>{onChange(item.field, e)}}
onBlur={(e)=>{onBlur(item.field, e)}}
onInput={(value)=>{onInput(item.field,value)}}
{...(notRenderOptions.includes(item?.component as string) &&
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)
@ -88,6 +88,14 @@ const { register, elFormRef, methods } = useForm({
model: props.model || {}
})
const onInput = (field,value) => {
emit('onInput', field,value)
}
const formRef = ref()
const setFormValues = (formData)=>{
formRef.value.setValues(formData)
}
const search = async () => {
await unref(elFormRef)?.validate(async (isValid) => {
if (isValid) {
@ -118,12 +126,14 @@ const setVisible = () => {
}
const Search = ref()
onMounted(() => {})
defineExpose({setFormValues}) // open
</script>
<template>
<!-- update by 芋艿class="-mb-15px" 用于降低和 ContentWrap 组件的底部距离避免空隙过大 -->
<div ref="Search">
<Form
<Form ref="formRef"
:inline="inline"
:is-col="isCol"
:is-custom="false"
@ -132,6 +142,7 @@ onMounted(() => {})
class="-mb-15px search"
hide-required-asterisk
@register="register"
@onInput="onInput"
>
<template #action>
<div v-if="layout === 'inline'">

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

@ -1,7 +1,7 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="SupplierUser.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search ref="seachRef" :schema="SupplierUser.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" @onInput="onInput"/>
</ContentWrap>
<!-- 列表头部 -->
@ -89,6 +89,17 @@ const tableColumns = ref(SupplierUser.allSchemas.tableColumns)
const updataTableColumns = (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([

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

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

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

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

Loading…
Cancel
Save