新增拼团/套餐分享功能
This commit is contained in:
52
pageConsumables/components/select-cons.vue
Normal file
52
pageConsumables/components/select-cons.vue
Normal file
@@ -0,0 +1,52 @@
|
||||
<template>
|
||||
<u-picker
|
||||
title="选择耗材"
|
||||
:show="visable"
|
||||
:columns="columns"
|
||||
keyName="conName"
|
||||
@close="visable = false"
|
||||
closeOnClickOverlay
|
||||
@cancel="visable = false"
|
||||
@confirm="confirmHandle"
|
||||
></u-picker>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { getConsList } from '@/http/api/cons.js';
|
||||
|
||||
const visable = ref(false);
|
||||
|
||||
const columns = ref([]);
|
||||
|
||||
const emits = defineEmits(['success']);
|
||||
|
||||
function confirmHandle(e) {
|
||||
emits('success', e.value);
|
||||
visable.value = false;
|
||||
}
|
||||
|
||||
// 获取耗材列表
|
||||
async function getConsListAjax() {
|
||||
try {
|
||||
const res = await getConsList();
|
||||
columns.value = [res];
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
function show() {
|
||||
visable.value = true;
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
show
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
getConsListAjax();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
Reference in New Issue
Block a user