From 626c29c0493b1c6bc606bbddd41c409ae4231de6 Mon Sep 17 00:00:00 2001 From: weiwei Date: Mon, 17 Feb 2025 16:18:21 +0800 Subject: [PATCH 1/3] 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 From 327c661329f25878c9612a273e10cee5203d076d Mon Sep 17 00:00:00 2001 From: weiwei Date: Mon, 17 Feb 2025 16:26:56 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../smErpInventoryRecordsItem.ts | 41 +++ .../smErpInventoryRecordsItem/form.vue | 285 +++++++++--------- 2 files changed, 183 insertions(+), 143 deletions(-) create mode 100644 src/api/supermarketerp/smErpInventoryRecordsItem.ts diff --git a/src/api/supermarketerp/smErpInventoryRecordsItem.ts b/src/api/supermarketerp/smErpInventoryRecordsItem.ts new file mode 100644 index 0000000..2ff6071 --- /dev/null +++ b/src/api/supermarketerp/smErpInventoryRecordsItem.ts @@ -0,0 +1,41 @@ +import request from "/@/utils/request" + +export function fetchList(query?: Object) { + return request({ + url: '/supermarket/smErpInventoryRecordsItem/page', + method: 'get', + params: query + }) +} + +export function addObj(obj?: Object) { + return request({ + url: '/supermarket/smErpInventoryRecordsItem', + method: 'post', + data: obj + }) +} + +export function getObj(id?: string) { + return request({ + url: '/supermarket/smErpInventoryRecordsItem/' + id, + method: 'get' + }) +} + +export function delObjs(ids?: Object) { + return request({ + url: '/supermarket/smErpInventoryRecordsItem', + method: 'delete', + data: ids + }) +} + +export function putObj(obj?: Object) { + return request({ + url: '/supermarket/smErpInventoryRecordsItem', + method: 'put', + data: obj + }) +} + diff --git a/src/views/supermarketerp/smErpInventoryRecords/smErpInventoryRecordsItem/form.vue b/src/views/supermarketerp/smErpInventoryRecords/smErpInventoryRecordsItem/form.vue index b10bebb..1365033 100644 --- a/src/views/supermarketerp/smErpInventoryRecords/smErpInventoryRecordsItem/form.vue +++ b/src/views/supermarketerp/smErpInventoryRecords/smErpInventoryRecordsItem/form.vue @@ -1,192 +1,191 @@ \ No newline at end of file + openDialog, +}) + From f0105c032566dae325eca6a45cf56c7e0e716edb Mon Sep 17 00:00:00 2001 From: weiwei Date: Mon, 17 Feb 2025 16:33:33 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/hard/hard-order/index.vue | 32 +-- .../smErpCgPlan/smErpCgPlanItem/form.vue | 156 ------------ .../smErpCgPlan/smErpCgPlanItem/index.vue | 104 -------- .../smErpInventoryRecordsItem/index.vue | 224 ++++++++++-------- 4 files changed, 143 insertions(+), 373 deletions(-) delete mode 100644 src/views/supermarketerp/smErpCgPlan/smErpCgPlanItem/form.vue delete mode 100644 src/views/supermarketerp/smErpCgPlan/smErpCgPlanItem/index.vue diff --git a/src/views/hard/hard-order/index.vue b/src/views/hard/hard-order/index.vue index d5d8ab7..767c816 100644 --- a/src/views/hard/hard-order/index.vue +++ b/src/views/hard/hard-order/index.vue @@ -314,22 +314,22 @@ const print = async (row: any) => { } } -const adminRefund = async (row: any) => { - let loading: any = null - try { - await useMessage().delConfirm("是否同意退款?") - loading = ElLoading.service({ - lock: true, - text: "提交中", - background: "rgba(0, 0, 0, 0.7)", - }) - await hardInvoice.adminRefund({ id: row.id }) - useMessage().success("操作成功") - getDataList() - } finally { - setTimeout(() => loading.close(), 500) - } -} +// const adminRefund = async (row: any) => { +// let loading: any = null +// try { +// await useMessage().delConfirm("是否同意退款?") +// loading = ElLoading.service({ +// lock: true, +// text: "提交中", +// background: "rgba(0, 0, 0, 0.7)", +// }) +// await hardInvoice.adminRefund({ id: row.id }) +// useMessage().success("操作成功") +// getDataList() +// } finally { +// setTimeout(() => loading.close(), 500) +// } +// } // 导出excel const exportExcel = () => { diff --git a/src/views/supermarketerp/smErpCgPlan/smErpCgPlanItem/form.vue b/src/views/supermarketerp/smErpCgPlan/smErpCgPlanItem/form.vue deleted file mode 100644 index 0fb19a4..0000000 --- a/src/views/supermarketerp/smErpCgPlan/smErpCgPlanItem/form.vue +++ /dev/null @@ -1,156 +0,0 @@ - - - \ No newline at end of file diff --git a/src/views/supermarketerp/smErpCgPlan/smErpCgPlanItem/index.vue b/src/views/supermarketerp/smErpCgPlan/smErpCgPlanItem/index.vue deleted file mode 100644 index 83b99b9..0000000 --- a/src/views/supermarketerp/smErpCgPlan/smErpCgPlanItem/index.vue +++ /dev/null @@ -1,104 +0,0 @@ - - - diff --git a/src/views/supermarketerp/smErpInventoryRecords/smErpInventoryRecordsItem/index.vue b/src/views/supermarketerp/smErpInventoryRecords/smErpInventoryRecordsItem/index.vue index 2880359..5adfc7b 100644 --- a/src/views/supermarketerp/smErpInventoryRecords/smErpInventoryRecordsItem/index.vue +++ b/src/views/supermarketerp/smErpInventoryRecords/smErpInventoryRecordsItem/index.vue @@ -1,77 +1,110 @@ \ No newline at end of file + try { + await delObjs(ids) + getDataList() + useMessage().success("删除成功") + } catch (err: any) { + useMessage().error(err.msg) + } +} +