[update] 修改企标制修订流程
This commit is contained in:
@@ -39,7 +39,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {ajaxGetDictItems, getDictItemsFromCache} from '../../api/api'
|
||||
import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api'
|
||||
|
||||
export default {
|
||||
name: 'PickerDictCheckboxField',
|
||||
@@ -71,7 +71,7 @@ export default {
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
data () {
|
||||
return {
|
||||
showPicker: false,
|
||||
showValue: '',
|
||||
@@ -86,37 +86,37 @@ export default {
|
||||
this.initVal()
|
||||
}
|
||||
},
|
||||
dictCode:{
|
||||
immediate:true,
|
||||
handler() {
|
||||
dictCode: {
|
||||
immediate: true,
|
||||
handler () {
|
||||
this.initDictData()
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
//透传给下级组件的事件,需要排除本组件使用的change事件
|
||||
childListeners() {
|
||||
// 透传给下级组件的事件,需要排除本组件使用的change事件
|
||||
childListeners () {
|
||||
// const vm = this
|
||||
let result = Object.assign({},
|
||||
this.$listeners,
|
||||
const result = Object.assign({},
|
||||
this.$listeners
|
||||
)
|
||||
delete result.change
|
||||
return result
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
showPickerFunc() {
|
||||
if(this.readonly) return
|
||||
showPickerFunc () {
|
||||
if (this.readonly) return
|
||||
this.initVal()
|
||||
this.showPicker = true
|
||||
},
|
||||
initVal() {
|
||||
initVal () {
|
||||
if (this.value) {
|
||||
this.checkedArr = this.value.split(',')
|
||||
let showArr = []
|
||||
const showArr = []
|
||||
this.checkedArr.map(item => {
|
||||
let column = this.columnData.find(tt => (tt[this.valueKey] + '') === (item + ''))
|
||||
if(column) {
|
||||
const column = this.columnData.find(tt => (tt[this.valueKey] + '') === (item + ''))
|
||||
if (column) {
|
||||
showArr.push((column || {})[this.showKey])
|
||||
}
|
||||
this.showValue = showArr.join(',')
|
||||
@@ -126,28 +126,28 @@ export default {
|
||||
this.checkedArr = []
|
||||
}
|
||||
},
|
||||
initDictData() {
|
||||
//优先从缓存中读取字典配置
|
||||
if(getDictItemsFromCache(this.dictCode)){
|
||||
initDictData () {
|
||||
// 优先从缓存中读取字典配置
|
||||
if (getDictItemsFromCache(this.dictCode)) {
|
||||
this.columnData = getDictItemsFromCache(this.dictCode)
|
||||
return
|
||||
}
|
||||
//根据字典Code, 初始化字典数组
|
||||
// 根据字典Code, 初始化字典数组
|
||||
ajaxGetDictItems(this.dictCode, null).then((res) => {
|
||||
if (res.success) {
|
||||
this.columnData = res.result
|
||||
}
|
||||
})
|
||||
},
|
||||
onConfirm() {
|
||||
if(this.checkedArr.length === 0) {
|
||||
onConfirm () {
|
||||
if (this.checkedArr.length === 0) {
|
||||
this.$toast('请至少选择一条数据')
|
||||
return
|
||||
}
|
||||
this.showPicker = false
|
||||
this.$emit('change', this.checkedArr.join())
|
||||
},
|
||||
onCancel() {
|
||||
onCancel () {
|
||||
// this.checkedArr = []
|
||||
this.showPicker = false
|
||||
}
|
||||
@@ -163,6 +163,8 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
@import '~@assets/less/common.less';
|
||||
|
||||
/deep/.dict-checkbox-field-popup{
|
||||
height: 308px;
|
||||
font-size: 16px;
|
||||
@@ -183,4 +185,4 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user