货商与货商类别相关调整

This commit is contained in:
weiwei committed 2025-03-03 16:42:11 +08:00
1 parent 469e0584f4
commit 8d3629e66e
13 files changed
+245 -188

No files matched your search

+82
View File
@@ -0,0 +1,82 @@
<template>
<el-select
style="width: 100%"
v-model="state.selectId"
:placeholder="props.placeholder"
clearable
remote-show-suffix
filterable
remote
:remote-method="remoteSearch"
:loading="state.loading"
@visible-change="(e: boolean) => e && getOptions()"
>
<el-option v-for="v in state.options" :key="v.id" :label="`${v.typeName}`" :value="v.id">
<!-- <div class="flex items-center">
<div class="color-primary">{{ v.name }}</div>
<div class="flex items-center just ml5">
<el-tag size="small">
{{ v.deptName }}
</el-tag>
</div>
</div> -->
</el-option>
</el-select>
</template>
<script setup lang="ts" name="SelectSupplier">
import { reactive } from "vue"
import { getSupplierSimpleAll } from "/@/api/supermarketerp/smErpSupplier"
const selectId = defineModel()
export type Props = {
placeholder?: string
}
const props = withDefaults(defineProps<Props>(), {
placeholder: "请选择",
})
const queryForm = reactive<any>({})
const state = reactive<any>({
loading: true,
selectId: selectId,
options: [],
})
watch(
selectId,
(newVal, oldValue) => {
if (newVal == oldValue) return
state.selectId = newVal
getOptions()
},
{ immediate: true },
)
async function getOptions() {
try {
state.loading = true
const _pa = {
...queryForm,
}
const { data } = await getSupplierSimpleAll(_pa)
state.options = data ? data.filter((item: any) => item.id) : []
} finally {
setTimeout(() => (state.loading = false), 500)
}
}
function remoteSearch(params: string) {
if (params != queryForm.name) {
queryForm.name = params
getOptions()
}
}
function clear() {
state.selectId = null
getOptions()
}
</script>
+2
View File
@@ -23,6 +23,7 @@ import SelectCtcg from "/@/components/Select/SelectCtcg.vue"
import SelectCtcgol from "/@/components/Select/SelectCtcgol.vue"
import SelectHardGroup from "/@/components/Select/selectHardGroup.vue"
import SelectHandlerUser from "/@/components/Select/SelectHandlerUser.vue"
import SelectSupplier from "/@/components/Select/SelectSupplier.vue"
// 第三方组件
import ElementPlus from "element-plus"
@@ -68,6 +69,7 @@ export default {
app.component("SelectCtcgol", SelectCtcgol)
app.component("SelectHardGroup", SelectHardGroup)
app.component("SelectHandlerUser", SelectHandlerUser)
app.component("SelectSupplier", SelectSupplier)
// 导入全部的elmenet-plus的图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {