emis-sapp/components/buns-post-edit-templates/bpe-remark-tmp.vue
2024-08-04 22:28:32 +08:00

65 lines
1.1 KiB
Vue

<template>
<tpx-tags :list="dicData.emis_order_remark_list" v-model:value="modelInfo._tips" @onItemClick="handleItemChange"></tpx-tags>
<u-textarea v-model="modelInfo.remark" border="surround" height="160" placeholder="其他说明"
maxlength="300" count></u-textarea>
</template>
<script>
import * as apiService from "@/common/api"
export default {
computed: {
modelInfo: {
get(){
return this.value
}
},
dicData() {
return this.$store.getters.dicData
},
},
watch: {
},
props: {
value: {
default () {
return { }
}
}
},
data() {
return {
}
},
created() {
},
onHide() {
},
unmounted() {
},
methods: {
handleItemChange(item){
setTimeout(()=> {
let remark = this.modelInfo.remark || ''
let val = item.val
if(
this.modelInfo._tips?.indexOf?.(val) == -1
) {
// 取消选中
remark = remark.replace(val, "")
} else {
remark += `,${val}`
}
remark = remark.split(",").filter(v=> !!v).join(",") // 去除多余,
this.modelInfo.remark = remark
}, 300)
},
}
}
</script>
<style scoped lang="scss">
</style>