|
@@ -14,7 +14,8 @@ export default {
|
|
|
data () {
|
|
|
return {
|
|
|
dataList: [],
|
|
|
- placeholderText: ''
|
|
|
+ placeholderText: '',
|
|
|
+ origDataList: []
|
|
|
}
|
|
|
},
|
|
|
props: Object.assign({}, Select.props, {
|
|
@@ -32,27 +33,20 @@ export default {
|
|
|
},
|
|
|
notIn: {
|
|
|
type: Array,
|
|
|
- default: function(){
|
|
|
+ default: function () {
|
|
|
return []
|
|
|
}
|
|
|
}
|
|
|
}),
|
|
|
created () {
|
|
|
- const _this = this
|
|
|
- // console.log(_this.code, '_this.code')
|
|
|
- getLookUpData({
|
|
|
- pageNo: 1,
|
|
|
- pageSize: 1000,
|
|
|
- lookupCode: _this.code,
|
|
|
- isEnable: _this.isEnable ? 1 : undefined
|
|
|
- }).then(res => {
|
|
|
- if (res.status == 200) {
|
|
|
- _this.dataList = res.data.list.filter(item => _this.notIn.indexOf(item.code)<0)
|
|
|
- }
|
|
|
- })
|
|
|
+ this.getDataList()
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ notIn (newVal, oldVal) {
|
|
|
+ this.getDataList()
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
-
|
|
|
/**
|
|
|
* 获取当前所有的option 数据
|
|
|
* @returns options data
|
|
@@ -60,6 +54,21 @@ export default {
|
|
|
getOptionDatas () {
|
|
|
return _.cloneDeep(this.dataList)
|
|
|
},
|
|
|
+ getDataList () {
|
|
|
+ const _this = this
|
|
|
+ // console.log(_this.code, '_this.code')
|
|
|
+ getLookUpData({
|
|
|
+ pageNo: 1,
|
|
|
+ pageSize: 1000,
|
|
|
+ lookupCode: _this.code,
|
|
|
+ isEnable: _this.isEnable ? 1 : undefined
|
|
|
+ }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ _this.origDataList = res.data.list
|
|
|
+ _this.dataList = res.data.list.filter(item => _this.notIn.indexOf(item.code) < 0)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 根据code 获取名称
|
|
|
getNameByCode (code) {
|
|
|
const a = this.dataList.find(item => {
|
|
@@ -95,7 +104,7 @@ export default {
|
|
|
this.$emit('change', obj.target.value, _.find(this.dataList, ['code', obj.target.value]))
|
|
|
}
|
|
|
}
|
|
|
- if(this.showType === 'radio'){
|
|
|
+ if (this.showType === 'radio') {
|
|
|
return (
|
|
|
<a-radio-group vModel={props.value} {...{ props, on: radioOn }} >
|
|
|
{
|