bug 78135

This commit is contained in:
赵霄
2023-11-03 09:48:14 +08:00
parent 571c46ca07
commit 8fbe2fbe4e
2 changed files with 31 additions and 4 deletions
@@ -17,7 +17,8 @@
<j-dict-select-tag style="width: 100%" v-model="queryParam.source"
:disabled="disabledSourceSearch"
:placeholder="$t('pleaseSelect')+$t('standardSelect.source')"
:triggerChange="false" dictCode="standard_source"
:triggerChange="false"
:options="sourceOptions"
@change="handleTypeChange" />
</a-form-item>
</a-col>
@@ -65,8 +66,9 @@
</template>
<script>
import { getStandardList } from '@/api/api'
import { ajaxGetDictItems, getStandardList } from '@/api/api'
import JDictSelectTag from '../dict/JDictSelectTag'
import { StandardSource } from '../../enums/commonEnums'
export default {
name: 'StandardSelectionModal',
@@ -76,6 +78,14 @@ export default {
type: [String, Number],
default: '1'
},
// 查询条件可以选择的类型
canSelectedSource: {
type: [String, Array],
required: false,
default: () => {
return [StandardSource.DOMESTIC.value, StandardSource.OVERSEAS.value, StandardSource.ENTERPRISE.value]
}
},
value: {
type: String,
default: ''
@@ -147,18 +157,28 @@ export default {
width: 150
}
],
dataList: []
dataList: [],
sourceOptions: []
}
},
methods: {
open () {
this.visible = true
this.queryParam = {}
this.initDict()
this.$nextTick(() => {
this.source ? this.queryParam.source = this.source : this.queryParam = {}
this.replacePage()
})
},
initDict () {
ajaxGetDictItems('standard_source').then(res => {
if (res.success) {
const canSelectedArr = typeof this.canSelectedSource === 'string' ? this.canSelectedSource.split(',') : this.canSelectedSource
this.sourceOptions = res.result.filter(tt => canSelectedArr.includes(tt.value))
}
})
},
// 获取表格数据
replacePage () {
const query = {