[需求变更] 普通项目、工作组成员新增/编辑收入合同改为下拉(添加选择收入合同组件)
This commit is contained in:
@@ -39,7 +39,11 @@ export default {
|
||||
*/
|
||||
initUserList() {
|
||||
getAllUserList().then(res => {
|
||||
this.userList = res.result
|
||||
if (res.success) {
|
||||
this.userList = res.result
|
||||
} else {
|
||||
this.$message.warn(res.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 下拉框的搜索
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
<template>
|
||||
<a-select
|
||||
:value="value"
|
||||
v-bind="$attrs"
|
||||
v-on="$listeners"
|
||||
show-search
|
||||
allowClear
|
||||
option-filter-prop="children"
|
||||
:filter-option="filterOption">
|
||||
<a-select-option v-for="item in contractList" :key="item.id" :value="item.contractNum">
|
||||
{{ item.contractNum }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getAllRevenueContract } from '../../api/incomePaymentsApi'
|
||||
|
||||
export default {
|
||||
name: 'SelectRevenueContract',
|
||||
props: {
|
||||
// 绑定值--合同号
|
||||
value: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: undefined
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 合同列表
|
||||
contractList: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initRevenueContractList()
|
||||
},
|
||||
methods: {
|
||||
initRevenueContractList() {
|
||||
getAllRevenueContract().then(res => {
|
||||
if (res.success) {
|
||||
this.contractList = res.result.records
|
||||
} else {
|
||||
this.$message.warn(res.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 下拉框的搜索
|
||||
filterOption(input, option) {
|
||||
console.log(option)
|
||||
return (
|
||||
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
||||
)
|
||||
}
|
||||
},
|
||||
model: {
|
||||
prop: 'value',
|
||||
event: 'change'
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user