This commit is contained in:
zhangyanan 2025-11-13 16:17:06 +08:00
parent f0e8390d3f
commit e94fb7e225
3 changed files with 19 additions and 7 deletions

View File

@ -67,7 +67,9 @@
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
has-feedback has-feedback
> >
<a-input placeholder="请输入部门" v-decorator="['workPlace', {rules: [{required: true, message: '请输入部门'}]}]" /> <a-select style="width: 100%" placeholder="请选择部门" v-decorator="['workPlace', {rules: [{ required: true, message: '请选择部门!' }]}]">
<a-select-option v-for="(item,index) in workPlaceData" :key="index" :value="item.code">{{ item.name }}</a-select-option>
</a-select>
</a-form-item> </a-form-item>
</a-form> </a-form>
</a-spin> </a-spin>
@ -102,7 +104,8 @@
name: '外部' name: '外部'
} }
], ],
typeData:[] typeData:[],
workPlaceData:[]
} }
}, },
methods: { methods: {
@ -112,6 +115,7 @@
this.visible = true this.visible = true
const nameOption = this.$options const nameOption = this.$options
this.typeData = nameOption.filters['dictData']('train_type') this.typeData = nameOption.filters['dictData']('train_type')
this.workPlaceData = nameOption.filters['dictData']('work_place')
}, },
/** /**
* 提交表单 * 提交表单

View File

@ -68,7 +68,9 @@
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
has-feedback has-feedback
> >
<a-input placeholder="请输入部门" v-decorator="['workPlace', {rules: [{required: true, message: '请输入部门'}]}]" /> <a-select style="width: 100%" placeholder="请选择部门" v-decorator="['workPlace', {rules: [{ required: true, message: '请选择部门!' }]}]">
<a-select-option v-for="(item,index) in workPlaceData" :key="index" :value="item.code">{{ item.name }}</a-select-option>
</a-select>
</a-form-item> </a-form-item>
</a-form> </a-form>
</a-spin> </a-spin>
@ -103,7 +105,8 @@
name: '外部' name: '外部'
} }
], ],
typeData:[] typeData:[],
workPlaceData:[]
} }
}, },
methods: { methods: {
@ -113,6 +116,7 @@
this.visible = true this.visible = true
const nameOption = this.$options const nameOption = this.$options
this.typeData = nameOption.filters['dictData']('train_type') this.typeData = nameOption.filters['dictData']('train_type')
this.workPlaceData = nameOption.filters['dictData']('work_place')
setTimeout(() => { setTimeout(() => {
this.form.setFieldsValue( this.form.setFieldsValue(
{ {

View File

@ -20,7 +20,9 @@
<template v-if="advanced"> <template v-if="advanced">
<a-col :md="8" :sm="24"> <a-col :md="8" :sm="24">
<a-form-item label="部门"> <a-form-item label="部门">
<a-input v-model="queryParam.workPlace" allow-clear placeholder="请输入部门"/> <a-select style="width: 100%" placeholder="请选择部门" v-model="queryParam.workPlace">
<a-select-option v-for="(item,index) in workPlaceData" :key="index" :value="item.code">{{ item.name }}</a-select-option>
</a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
</template> </template>
@ -148,7 +150,8 @@
onChange: this.onSelectChange onChange: this.onSelectChange
} }
}, },
typeData: [] typeData: [],
workPlaceData: []
} }
}, },
created () { created () {
@ -159,7 +162,8 @@
scopedSlots: { customRender: 'action' } scopedSlots: { customRender: 'action' }
} ) } )
const nameOption = this.$options const nameOption = this.$options
this.typeData = nameOption.filters['dictData']('train_type') this.typeData = nameOption.filters[ 'dictData' ]( 'train_type' )
this.workPlaceData = nameOption.filters[ 'dictData' ]( 'work_place' )
}, },
methods: { methods: {
moment, moment,