diff --git a/src/api/supermarketerp/smErpSupplier.ts b/src/api/supermarketerp/smErpSupplier.ts index 2ac41a3..7471456 100644 --- a/src/api/supermarketerp/smErpSupplier.ts +++ b/src/api/supermarketerp/smErpSupplier.ts @@ -38,3 +38,12 @@ export function putObj(obj?: Object) { data: obj, }) } + +// 获取货商下拉列表 +export function getSupplierSimpleAll(params: any): any { + return request({ + url: "/supermarket/smErpSupplier/selectSimpleAll", + method: "get", + params, + }) +} diff --git a/src/components/Select/SelectSupplier.vue b/src/components/Select/SelectSupplier.vue new file mode 100644 index 0000000..cccedf4 --- /dev/null +++ b/src/components/Select/SelectSupplier.vue @@ -0,0 +1,82 @@ + + e && getOptions()" + > + + + + + + + diff --git a/src/components/index.ts b/src/components/index.ts index 227f315..632d9f0 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -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)) { diff --git a/src/views/supermarketerp/smErpCgBack/smErpCgBackOption.vue b/src/views/supermarketerp/smErpCgBack/smErpCgBackOption.vue index cd5b6f8..0581175 100644 --- a/src/views/supermarketerp/smErpCgBack/smErpCgBackOption.vue +++ b/src/views/supermarketerp/smErpCgBack/smErpCgBackOption.vue @@ -23,9 +23,7 @@ - - - + @@ -177,7 +175,6 @@ import { useMessage } from "/@/hooks/message" import { getObj, addObj, putObj } from "/@/api/supermarketerp/smErpCgBack" import { getPlanCode, getErpSpuSimpleAll } from "/@/api/supermarketerp/common" import { VxeTableEvents, VxeTablePropTypes, type VxeTableInstance } from "vxe-table" -import { getSupplierTypeOptions } from "/@/api/supermarketerp/smErpSupplier" import { formatDate } from "/@/utils/formatTime" import { Search } from "@element-plus/icons-vue" import erpSpuSelectDialog from "/@/views/supermarketerp/components/erpSpuSelectDialog.vue" @@ -192,7 +189,6 @@ const erpSpuSelectDialogRef = ref() // 商品选择对话框ref const linkCgPlanDialogRef = ref() // 关联采购申请单对话框ref const baseDataFormRef = ref() // 基本数据表单ref const editableTableRef = ref>() // 可编辑表格ref -const supplierTypeDict = ref([]) // 货商下拉选项 // 基本信息表单数据 const baseDataForm = reactive({ id: "", @@ -261,14 +257,11 @@ const getInitData = async () => { } } - // 获取货商选项 & 获取采购退货编号 - const [erpSpuSimpleAll, supplierTypeOptions, planCode] = await Promise.allSettled([ - getErpSpuSimpleAll(), - getSupplierTypeOptions(), - getPlanCode({ type: 4 }), - ]).then((results) => results.map((result) => (result.status === "fulfilled" ? result.value : null))) + // 获取采购退货编号 + const [erpSpuSimpleAll, planCode] = await Promise.allSettled([getErpSpuSimpleAll(), getPlanCode({ type: 4 })]).then((results) => + results.map((result) => (result.status === "fulfilled" ? result.value : null)), + ) erpSpuSimpleAll && erpSpuSimpleAll.code === 0 && (state.erpSpuSimpleAll = erpSpuSimpleAll.data) - supplierTypeOptions && supplierTypeOptions.code === 0 && (supplierTypeDict.value = supplierTypeOptions.data) planCode && planCode.code === 0 && (baseDataForm.inventoryCode = planCode.data) } diff --git a/src/views/supermarketerp/smErpCgDd/smErpCgDdOption.vue b/src/views/supermarketerp/smErpCgDd/smErpCgDdOption.vue index 01a3173..efc7f7d 100644 --- a/src/views/supermarketerp/smErpCgDd/smErpCgDdOption.vue +++ b/src/views/supermarketerp/smErpCgDd/smErpCgDdOption.vue @@ -28,9 +28,7 @@ - - - + @@ -182,7 +180,6 @@ import { useMessage } from "/@/hooks/message" import { getObj, addObj, putObj } from "/@/api/supermarketerp/smErpCgDd" import { getPlanCode, getErpSpuSimpleAll } from "/@/api/supermarketerp/common" import { VxeTableEvents, VxeTablePropTypes, type VxeTableInstance } from "vxe-table" -import { getSupplierTypeOptions } from "/@/api/supermarketerp/smErpSupplier" import { formatDate } from "/@/utils/formatTime" import { Search } from "@element-plus/icons-vue" import erpSpuSelectDialog from "/@/views/supermarketerp/components/erpSpuSelectDialog.vue" @@ -198,7 +195,6 @@ const erpSpuSelectDialogRef = ref() // 商品选择对话框ref const linkCgPlanDialogRef = ref() // 关联采购申请单对话框ref const baseDataFormRef = ref() // 基本数据表单ref const editableTableRef = ref>() // 可编辑表格ref -const supplierTypeDict = ref([]) // 货商下拉选项 const { check_status } = useDict("check_status") // 基本信息表单数据 const baseDataForm = reactive({ @@ -268,14 +264,11 @@ const getInitData = async () => { } } - // 获取货商选项 & 获取采购订单编号 - const [erpSpuSimpleAll, supplierTypeOptions, planCode] = await Promise.allSettled([ - getErpSpuSimpleAll(), - getSupplierTypeOptions(), - getPlanCode({ type: 2 }), - ]).then((results) => results.map((result) => (result.status === "fulfilled" ? result.value : null))) + // 获取采购订单编号 + const [erpSpuSimpleAll, planCode] = await Promise.allSettled([getErpSpuSimpleAll(), getPlanCode({ type: 2 })]).then((results) => + results.map((result) => (result.status === "fulfilled" ? result.value : null)), + ) erpSpuSimpleAll && erpSpuSimpleAll.code === 0 && (state.erpSpuSimpleAll = erpSpuSimpleAll.data) - supplierTypeOptions && supplierTypeOptions.code === 0 && (supplierTypeDict.value = supplierTypeOptions.data) planCode && planCode.code === 0 && (baseDataForm.code = planCode.data) } diff --git a/src/views/supermarketerp/smErpCgInventory/smErpCgInventoryOption.vue b/src/views/supermarketerp/smErpCgInventory/smErpCgInventoryOption.vue index 554ec6f..4a11f4a 100644 --- a/src/views/supermarketerp/smErpCgInventory/smErpCgInventoryOption.vue +++ b/src/views/supermarketerp/smErpCgInventory/smErpCgInventoryOption.vue @@ -28,9 +28,7 @@ - - - + @@ -182,7 +180,6 @@ import { useMessage } from "/@/hooks/message" import { getObj, addObj, putObj } from "/@/api/supermarketerp/smErpCgInventory" import { getPlanCode, getErpSpuSimpleAll } from "/@/api/supermarketerp/common" import { VxeTableEvents, VxeTablePropTypes, type VxeTableInstance } from "vxe-table" -import { getSupplierTypeOptions } from "/@/api/supermarketerp/smErpSupplier" import { formatDate } from "/@/utils/formatTime" import { Search } from "@element-plus/icons-vue" import erpSpuSelectDialog from "/@/views/supermarketerp/components/erpSpuSelectDialog.vue" @@ -198,7 +195,6 @@ const erpSpuSelectDialogRef = ref() // 商品选择对话框ref const linkCgPlanDialogRef = ref() // 关联采购申请单对话框ref const baseDataFormRef = ref() // 基本数据表单ref const editableTableRef = ref>() // 可编辑表格ref -const supplierTypeDict = ref([]) // 货商下拉选项 const { check_status } = useDict("check_status") // 基本信息表单数据 const baseDataForm = reactive({ @@ -268,14 +264,11 @@ const getInitData = async () => { } } - // 获取货商选项 & 获取采购入库编号 - const [erpSpuSimpleAll, supplierTypeOptions, planCode] = await Promise.allSettled([ - getErpSpuSimpleAll(), - getSupplierTypeOptions(), - getPlanCode({ type: 3 }), - ]).then((results) => results.map((result) => (result.status === "fulfilled" ? result.value : null))) + // 获取采购入库编号 + const [erpSpuSimpleAll, planCode] = await Promise.allSettled([getErpSpuSimpleAll(), getPlanCode({ type: 3 })]).then((results) => + results.map((result) => (result.status === "fulfilled" ? result.value : null)), + ) erpSpuSimpleAll && erpSpuSimpleAll.code === 0 && (state.erpSpuSimpleAll = erpSpuSimpleAll.data) - supplierTypeOptions && supplierTypeOptions.code === 0 && (supplierTypeDict.value = supplierTypeOptions.data) planCode && planCode.code === 0 && (baseDataForm.inventoryCode = planCode.data) } diff --git a/src/views/supermarketerp/smErpCgPlan/cgPlanOption.vue b/src/views/supermarketerp/smErpCgPlan/cgPlanOption.vue index cf7f5ac..fd08622 100644 --- a/src/views/supermarketerp/smErpCgPlan/cgPlanOption.vue +++ b/src/views/supermarketerp/smErpCgPlan/cgPlanOption.vue @@ -161,7 +161,6 @@ import { ref, reactive, computed, onMounted } from "vue" import { useRouter, useRoute } from "vue-router" import { useMessage } from "/@/hooks/message" import { VxeTableEvents, VxeTablePropTypes, type VxeTableInstance } from "vxe-table" -import { getSupplierTypeOptions } from "/@/api/supermarketerp/smErpSupplier" import { getObj, addObj, putObj } from "/@/api/supermarketerp/smErpCgPlan" import { getPlanCode, getErpSpuSimpleAll } from "/@/api/supermarketerp/common" import erpSpuSelectDialog from "/@/views/supermarketerp/components/erpSpuSelectDialog.vue" @@ -173,7 +172,6 @@ const erpSpuSelectDialogRef = ref() // 商品选择对话框ref const loading = ref(false) // 采购计划加载 const baseDataFormRef = ref() // 基本数据表单ref const editableTableRef = ref>() // 可编辑表格ref -const supplierTypeDict = ref([]) // 货商下拉选项 // 基本信息表单数据 const baseDataForm = reactive({ id: undefined, @@ -230,11 +228,10 @@ const getInitData = async () => { erpSpuSimpleAll && erpSpuSimpleAll.code === 0 && (state.erpSpuSimpleAll = erpSpuSimpleAll.data) } - // 获取货商选项 & 获取采购计划编号 - const [supplierTypeOptions, planCode] = await Promise.allSettled([getSupplierTypeOptions(), getPlanCode({ type: 1 })]).then((results) => + // 获取采购计划编号 + const [planCode] = await Promise.allSettled([getPlanCode({ type: 1 })]).then((results) => results.map((result) => (result.status === "fulfilled" ? result.value : null)), ) - supplierTypeOptions && supplierTypeOptions.code === 0 && (supplierTypeDict.value = supplierTypeOptions.data) planCode && planCode.code === 0 && (baseDataForm.planCode = planCode.data) } diff --git a/src/views/supermarketerp/smErpRetailBack/smErpRetailBackOption.vue b/src/views/supermarketerp/smErpRetailBack/smErpRetailBackOption.vue index 181e58e..a59712e 100644 --- a/src/views/supermarketerp/smErpRetailBack/smErpRetailBackOption.vue +++ b/src/views/supermarketerp/smErpRetailBack/smErpRetailBackOption.vue @@ -28,9 +28,7 @@ - - - + @@ -206,7 +204,6 @@ import { useMessage } from "/@/hooks/message" import { getObj, addObj, putObj } from "../../../api/supermarketerp/smErpCgInventory" import { getPlanCode, getErpSpuSimpleAll } from "/@/api/supermarketerp/common" import { VxeTableEvents, VxeTablePropTypes, type VxeTableInstance } from "vxe-table" -import { getSupplierTypeOptions } from "/@/api/supermarketerp/smErpSupplier" import { formatDate } from "/@/utils/formatTime" import { Search } from "@element-plus/icons-vue" import erpSpuSelectDialog from "/@/views/supermarketerp/components/erpSpuSelectDialog.vue" @@ -222,7 +219,6 @@ const erpSpuSelectDialogRef = ref() // 商品选择对话框ref const linkCgPlanDialogRef = ref() // 关联采购申请单对话框ref const baseDataFormRef = ref() // 基本数据表单ref const editableTableRef = ref>() // 可编辑表格ref -const supplierTypeDict = ref([]) // 货商下拉选项 const { check_status } = useDict("check_status") // 基本信息表单数据 const baseDataForm = reactive({ @@ -305,14 +301,11 @@ const getInitData = async () => { } } - // 获取货商选项 & 获取采购入库编号 - const [erpSpuSimpleAll, supplierTypeOptions, planCode] = await Promise.allSettled([ - getErpSpuSimpleAll(), - getSupplierTypeOptions(), - getPlanCode({ type: 6 }), - ]).then((results) => results.map((result) => (result.status === "fulfilled" ? result.value : null))) + // 获取采购入库编号 + const [erpSpuSimpleAll, planCode] = await Promise.allSettled([getErpSpuSimpleAll(), getPlanCode({ type: 6 })]).then((results) => + results.map((result) => (result.status === "fulfilled" ? result.value : null)), + ) erpSpuSimpleAll && erpSpuSimpleAll.code === 0 && (state.erpSpuSimpleAll = erpSpuSimpleAll.data) - supplierTypeOptions && supplierTypeOptions.code === 0 && (supplierTypeDict.value = supplierTypeOptions.data) planCode && planCode.code === 0 && (baseDataForm.inventoryCode = planCode.data) } diff --git a/src/views/supermarketerp/smErpRetailDelivery/smErpRetailDeliveryOption.vue b/src/views/supermarketerp/smErpRetailDelivery/smErpRetailDeliveryOption.vue index 0ea5b6a..c15dd26 100644 --- a/src/views/supermarketerp/smErpRetailDelivery/smErpRetailDeliveryOption.vue +++ b/src/views/supermarketerp/smErpRetailDelivery/smErpRetailDeliveryOption.vue @@ -28,9 +28,7 @@ - - - + @@ -206,7 +204,6 @@ import { useMessage } from "/@/hooks/message" import { getObj, addObj, putObj } from "../../../api/supermarketerp/smErpCgInventory" import { getPlanCode, getErpSpuSimpleAll } from "/@/api/supermarketerp/common" import { VxeTableEvents, VxeTablePropTypes, type VxeTableInstance } from "vxe-table" -import { getSupplierTypeOptions } from "/@/api/supermarketerp/smErpSupplier" import { formatDate } from "/@/utils/formatTime" import { Search } from "@element-plus/icons-vue" import erpSpuSelectDialog from "/@/views/supermarketerp/components/erpSpuSelectDialog.vue" @@ -222,7 +219,6 @@ const erpSpuSelectDialogRef = ref() // 商品选择对话框ref const linkCgPlanDialogRef = ref() // 关联采购申请单对话框ref const baseDataFormRef = ref() // 基本数据表单ref const editableTableRef = ref>() // 可编辑表格ref -const supplierTypeDict = ref([]) // 货商下拉选项 const { check_status } = useDict("check_status") // 基本信息表单数据 const baseDataForm = reactive({ @@ -305,14 +301,11 @@ const getInitData = async () => { } } - // 获取货商选项 & 获取采购入库编号 - const [erpSpuSimpleAll, supplierTypeOptions, planCode] = await Promise.allSettled([ - getErpSpuSimpleAll(), - getSupplierTypeOptions(), - getPlanCode({ type: 5 }), - ]).then((results) => results.map((result) => (result.status === "fulfilled" ? result.value : null))) + // 获取采购入库编号 + const [erpSpuSimpleAll, planCode] = await Promise.allSettled([getErpSpuSimpleAll(), getPlanCode({ type: 5 })]).then((results) => + results.map((result) => (result.status === "fulfilled" ? result.value : null)), + ) erpSpuSimpleAll && erpSpuSimpleAll.code === 0 && (state.erpSpuSimpleAll = erpSpuSimpleAll.data) - supplierTypeOptions && supplierTypeOptions.code === 0 && (supplierTypeDict.value = supplierTypeOptions.data) planCode && planCode.code === 0 && (baseDataForm.inventoryCode = planCode.data) } diff --git a/src/views/supermarketerp/smErpSupplier/form.vue b/src/views/supermarketerp/smErpSupplier/form.vue index 0c109f6..70025a3 100644 --- a/src/views/supermarketerp/smErpSupplier/form.vue +++ b/src/views/supermarketerp/smErpSupplier/form.vue @@ -95,105 +95,103 @@ diff --git a/src/views/supermarketerp/smErpSupplier/index.vue b/src/views/supermarketerp/smErpSupplier/index.vue index 84c49e1..2a9a113 100644 --- a/src/views/supermarketerp/smErpSupplier/index.vue +++ b/src/views/supermarketerp/smErpSupplier/index.vue @@ -20,7 +20,13 @@ - + 新 增 - - {{ $t("common.importBtn") }} - + + {{ $t("common.importBtn") }} + 编辑 - + 删除 @@ -99,88 +111,86 @@ - - + + diff --git a/src/views/supermarketerp/supermarketSpu/components/supermarketUnit.vue b/src/views/supermarketerp/supermarketSpu/components/supermarketUnit.vue index ba416dc..1f28f04 100644 --- a/src/views/supermarketerp/supermarketSpu/components/supermarketUnit.vue +++ b/src/views/supermarketerp/supermarketSpu/components/supermarketUnit.vue @@ -93,7 +93,7 @@ - + diff --git a/src/views/supermarketerp/supermarketSpu/form.vue b/src/views/supermarketerp/supermarketSpu/form.vue index 8afea27..98bb244 100644 --- a/src/views/supermarketerp/supermarketSpu/form.vue +++ b/src/views/supermarketerp/supermarketSpu/form.vue @@ -4,11 +4,11 @@ - - - - - + + + + + @@ -26,9 +26,7 @@ - - - + @@ -231,7 +229,6 @@ const dataRules = { const { supermarket_nature, status } = useDict("supermarket_nature", "status") const categoryOptions = ref([]) // 商品分类的下拉选项 const brandOptions = ref([]) // 超市品牌的下拉选项 -const supplierTypeOptions = ref([]) // 货商的下拉选项 // 打开弹窗 const openDialog = async (id: string) => { @@ -251,16 +248,13 @@ const openDialog = async (id: string) => { supermarketUnitEntityListRef.value.setRadioRow(form.smErpUnitEntityList.findIndex((item: any) => item.isBase)) } - // 获取分类下拉选项 & 获取品牌下拉选项 & 获取货商类型下拉选项 - const [categoryDict, brandDict, supplierTypeDict] = await Promise.allSettled([ - getSupermarketCategory(), - getSupermarketBrand(), - getSupplierTypeSimpleAll(), - ]).then((results) => results.map((result) => (result.status === "fulfilled" ? result.value : null))) + // 获取分类下拉选项 & 获取品牌下拉选项 + const [categoryDict, brandDict] = await Promise.allSettled([getSupermarketCategory(), getSupermarketBrand()]).then((results) => + results.map((result) => (result.status === "fulfilled" ? result.value : null)), + ) categoryDict && categoryDict.code === 0 && (categoryOptions.value = categoryDict.data) brandDict && brandDict.code === 0 && (brandOptions.value = brandDict.data) - supplierTypeDict && supplierTypeDict.code === 0 && (supplierTypeOptions.value = supplierTypeDict.data) } // 初始化表单数据