From 626c29c0493b1c6bc606bbddd41c409ae4231de6 Mon Sep 17 00:00:00 2001 From: weiwei Date: Mon, 17 Feb 2025 16:18:21 +0800 Subject: [PATCH] 1 --- .env.development | 10 ++++---- src/api/supermarketerp/smErpCgPlan.ts | 8 +++++++ .../smErpCgPlan/cgPlanOption.vue | 24 ++++++++++++------- 3 files changed, 29 insertions(+), 13 deletions(-) diff --git a/.env.development b/.env.development index bcbc94e..6480b17 100644 --- a/.env.development +++ b/.env.development @@ -8,18 +8,18 @@ VITE_OPEN = true ENV = 'development' # ADMIN 服务地址 -# VITE_ADMIN_PROXY_PATH = http://123.156.230.15:8089/api/ # 线上 +VITE_ADMIN_PROXY_PATH = http://123.156.230.15:8089/api/ # 线上 # VITE_ADMIN_PROXY_PATH = http://pjcloud.center.takin.cc/ # VITE_ADMIN_PROXY_PATH = http://localhost:9999/ -VITE_ADMIN_PROXY_PATH = http://192.168.101.50:9999/ # 邓-本地 - +# VITE_ADMIN_PROXY_PATH = http://192.168.101.50:9999/ # 邓-本地 # VITE_ADMIN_PROXY_PATH = http://59.202.170.152:81/api # 正式环境 + # 图片访问基础地址 -# VITE_IMAGE_BASE_PATH = http://123.156.230.15:8089/api # 线上 +VITE_IMAGE_BASE_PATH = http://123.156.230.15:8089/api # 线上 # VITE_IMAGE_BASE_PATH = http://pjcloud.center.takin.cc # VITE_IMAGE_BASE_PATH = http://localhost:9999 -VITE_IMAGE_BASE_PATH = http://192.168.101.50:9999 # 邓-本地 +# VITE_IMAGE_BASE_PATH = http://192.168.101.50:9999 # 邓-本地 # VITE_IMAGE_BASE_PATH = http://59.202.170.152:81/api/ # 正式环境 # 代码生成服务地址 diff --git a/src/api/supermarketerp/smErpCgPlan.ts b/src/api/supermarketerp/smErpCgPlan.ts index 9c2eb15..d8f86ea 100644 --- a/src/api/supermarketerp/smErpCgPlan.ts +++ b/src/api/supermarketerp/smErpCgPlan.ts @@ -55,3 +55,11 @@ export function getCgPlanSpuPage() { method: "get", }) } + +// 获取简要商品列表 +export function getErpSpuSimpleAll() { + return request({ + url: "/supermarket/supermarketSpu/SimpleAll", + method: "get", + }) +} diff --git a/src/views/supermarketerp/smErpCgPlan/cgPlanOption.vue b/src/views/supermarketerp/smErpCgPlan/cgPlanOption.vue index ab584a2..5ee1e0c 100644 --- a/src/views/supermarketerp/smErpCgPlan/cgPlanOption.vue +++ b/src/views/supermarketerp/smErpCgPlan/cgPlanOption.vue @@ -60,7 +60,7 @@ 行新增 删除选中 - 重置数据 + 清空数据 商品选择 @@ -258,13 +258,14 @@ import { storePrice } from "/@/utils/formatMoney" // 基本表单数据类型 interface FormVO { + id?: string planCode: string orderNumber: string planDate: string supplierId: string handlerUserId: string remark: string - [key: string]: string + [key: string]: string | undefined } // 可编辑表格行数据类型 @@ -289,6 +290,7 @@ const supplierTypeDict = ref([]) // 货商下拉选项 // 基本信息表单数据 const baseDataForm = reactive({ + id: undefined, planCode: "", orderNumber: "", planDate: "", @@ -328,6 +330,7 @@ const validRules = ref>({ // 初始化数据 const getInitData = async () => { + baseDataForm.id = undefined const id = route.query.id as string if (id) { // 获取数据 @@ -335,6 +338,7 @@ const getInitData = async () => { getObj(id) .then((res: any) => { Object.assign(baseDataForm, { + id: res.data.id, planCode: res.data.planCode, orderNumber: res.data.orderNumber, planDate: res.data.planDate, @@ -347,6 +351,13 @@ const getInitData = async () => { .finally(() => { loading.value = false }) + + // 获取货商选项 & 获取简要商品列表 + // const [supplierTypeOptions, planCode] = await Promise.allSettled([getSupplierTypeOptions(), getPlanCode()]).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) } // 获取货商选项 & 获取采购计划编号 @@ -541,11 +552,8 @@ const handleSelectDialogConfirm = () => { // 整理数据 const cgPlanSpuItems = computed(() => { - const a = state.editableTableData - return a.map((item: any) => { - console.log("xxxx") - - const unit = item.erpUnitVos.find((unitItem: any) => unitItem.id == item.unitId) + return state.editableTableData.map((item: any) => { + const unit = item.erpUnitVos.find((unitItem: any) => unitItem.id === item.unitId) return { id: "", erpSpuId: item.erpSpuId, @@ -640,7 +648,7 @@ const submitData = async () => { // 清空填写的数据 返回 true const clearData = () => { for (const key in baseDataForm) { - if (key === "planCode") continue + if (key === "planCode" || key === "id") continue baseDataForm[key] = "" } state.insertedRowNumber = 0