demo
This commit is contained in:
63
klp-ui/src/components/KLPService/CheckItemSelect/index.vue
Normal file
63
klp-ui/src/components/KLPService/CheckItemSelect/index.vue
Normal file
@@ -0,0 +1,63 @@
|
||||
<template>
|
||||
<el-select
|
||||
v-model="selected"
|
||||
multiple
|
||||
filterable
|
||||
placeholder="请选择检查项"
|
||||
@change="handleChange"
|
||||
style="width: 100%;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in checkItems"
|
||||
:key="item.itemId"
|
||||
:label="item.itemName"
|
||||
:value="item.itemId"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listCheckItem } from '@/api/mes/qc/checkItem'
|
||||
|
||||
export default {
|
||||
name: 'CheckItemSelect',
|
||||
props: {
|
||||
modelValue: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
emits: ['update:modelValue'],
|
||||
data() {
|
||||
return {
|
||||
checkItems: [],
|
||||
selected: this.modelValue.slice()
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
modelValue(val) {
|
||||
this.selected = val.slice()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleChange(val) {
|
||||
this.$emit('input', val)
|
||||
},
|
||||
async fetchCheckItems() {
|
||||
try {
|
||||
const res = await listCheckItem({ pageSize: 1000 })
|
||||
this.checkItems = res.rows
|
||||
} catch (e) {
|
||||
this.checkItems = []
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.fetchCheckItems()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
7
klp-ui/src/components/KLPService/index.js
Normal file
7
klp-ui/src/components/KLPService/index.js
Normal file
@@ -0,0 +1,7 @@
|
||||
export { default as CategorySelect } from './CategorySelect/index.vue';
|
||||
export { default as CheckItemSelect } from './CheckItemSelect/index.vue';
|
||||
export { default as ProductSelect } from './ProductSelect/index.vue';
|
||||
export { default as RawMaterialSelect } from './RawMaterialSelect/index.vue';
|
||||
export { default as CategoryRenderer } from './Renderer/CategoryRenderer.vue';
|
||||
export { default as UserSelect } from './UserSelect/index.vue';
|
||||
export { default as WarehouseSelect } from './WarehouseSelect/index.vue';
|
||||
Reference in New Issue
Block a user