From a7a3f80376785784e36ba904d9b59a9fa2da1fdf Mon Sep 17 00:00:00 2001 From: weiwei Date: Thu, 13 Feb 2025 22:32:36 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=87=E8=B4=AD=E8=AE=A1=E5=88=92=E5=8F=AF?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E8=A1=A8=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 3 +- src/main.ts | 35 +- src/router/route.ts | 84 ++-- .../smErpCgPlan/createCgPlan.vue | 413 ++++++++++++++++++ src/views/supermarketerp/smErpCgPlan/form.vue | 291 ++++++------ .../supermarketerp/smErpCgPlan/index.vue | 269 +++++++----- .../smErpCgPlan/smErpCgPlanItem/index.vue | 159 +++---- 7 files changed, 850 insertions(+), 404 deletions(-) create mode 100644 src/views/supermarketerp/smErpCgPlan/createCgPlan.vue diff --git a/package.json b/package.json index 67917ff..7cdab72 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,8 @@ "vue-router": "^4.1.6", "vue3-tree-org": "^4.2.2", "vue3-video-play": "1.3.1-beta.6", - "vuedraggable": "^4.1.0" + "vuedraggable": "^4.1.0", + "vxe-table": "^4.10.15" }, "devDependencies": { "@types/crypto-js": "^4.2.2", diff --git a/src/main.ts b/src/main.ts index 491e22a..27263a3 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,31 +1,34 @@ -import { createApp } from 'vue'; -import pinia from '/@/stores/index'; -import App from './App.vue'; -import router from './router'; -import { directive } from '/@/directive'; -import Components from '/@/components'; -import { i18n } from '/@/i18n'; -import { properties } from '/@/utils/globalProperties'; -import { initAntiDebug } from '/@/utils/anti-debug'; +import { createApp } from "vue" +import pinia from "/@/stores/index" +import App from "./App.vue" +import router from "./router" +import { directive } from "/@/directive" +import Components from "/@/components" +import { i18n } from "/@/i18n" +import { properties } from "/@/utils/globalProperties" +import { initAntiDebug } from "/@/utils/anti-debug" import "/@/assets/styles/global.scss" +import VxeUITable from "vxe-table" +import "vxe-table/lib/style.css" // Initialize anti-debug protection -initAntiDebug(); +initAntiDebug() // 导入全局样式 -import '/@/theme/tailwind.css'; -import '/@/theme/index.scss'; +import "/@/theme/tailwind.css" +import "/@/theme/index.scss" -const app = createApp(App); +const app = createApp(App) // 全局自定方法挂载 -properties(app); +properties(app) // 全局自定义指令挂载 -directive(app); +directive(app) app .use(pinia) // pinia 存储 .use(router) // 路由 .use(Components) // 全局引入自定义的组件&第三方的组件 .use(i18n) // 国际化 - .mount('#app'); + .use(VxeUITable) + .mount("#app") diff --git a/src/router/route.ts b/src/router/route.ts index bab69c4..0b754ae 100644 --- a/src/router/route.ts +++ b/src/router/route.ts @@ -1,4 +1,4 @@ -import { RouteRecordRaw } from 'vue-router'; +import { RouteRecordRaw } from "vue-router" /** * 建议:路由 path 路径与文件夹名称相同,找文件可浏览器地址找,方便定位文件位置 @@ -18,16 +18,16 @@ import { RouteRecordRaw } from 'vue-router'; */ // 扩展 RouteMeta 接口 -declare module 'vue-router' { +declare module "vue-router" { interface RouteMeta { - isLink?: string; - isHide?: boolean; - isAuth?: boolean; - isKeepAlive?: boolean; - isAffix?: boolean; - isIframe?: boolean; - roles?: string[]; - icon?: string; + isLink?: string + isHide?: boolean + isAuth?: boolean + isKeepAlive?: boolean + isAffix?: boolean + isIframe?: boolean + roles?: string[] + icon?: string } } @@ -37,71 +37,79 @@ declare module 'vue-router' { */ export const dynamicRoutes: Array = [ { - path: '/home', - name: 'router.home', - component: () => import('/@/views/home/index.vue'), + path: "/home", + name: "router.home", + component: () => import("/@/views/home/index.vue"), meta: { - isLink: '', + isLink: "", isHide: false, isKeepAlive: true, isAffix: true, isIframe: false, - icon: 'iconfont icon-shouye', + icon: "iconfont icon-shouye", }, }, { - path: '/personal', - name: 'router.personal', - component: () => import('/@/views/admin/system/user/personal.vue'), + path: "/personal", + name: "router.personal", + component: () => import("/@/views/admin/system/user/personal.vue"), meta: { isHide: true, }, }, -]; + { + path: "/createCgPlan", + name: "创建采购计划", + component: () => import("/@/views/supermarketerp/smErpCgPlan/createCgPlan.vue"), + meta: { + isHide: true, + }, + }, +] /** * 定义静态路由(默认路由) */ export const staticRoutes: Array = [ { - path: '/login', - name: 'staticRoutes.login', - component: () => import('/@/views/login/index.vue'), + path: "/login", + name: "staticRoutes.login", + component: () => import("/@/views/login/index.vue"), meta: { isAuth: false, }, }, { - path: '/authredirect', - name: 'staticRoutes.authredirect', - component: () => import('/@/views/login/component/authredirect.vue'), + path: "/authredirect", + name: "staticRoutes.authredirect", + component: () => import("/@/views/login/component/authredirect.vue"), meta: { isAuth: false, }, }, -]; +] /** * 定义404、401界面 */ export const notFoundAndNoPower = [ { - path: '/:path(.*)*', - name: 'staticRoutes.notFound', - component: () => import('/@/views/error/404.vue'), + path: "/:path(.*)*", + name: "staticRoutes.notFound", + component: () => import("/@/views/error/404.vue"), meta: { isHide: true, }, }, { - path: '/401', - name: 'staticRoutes.noPower', - component: () => import('/@/views/error/401.vue'), + path: "/401", + name: "staticRoutes.noPower", + component: () => import("/@/views/error/401.vue"), meta: { isHide: true, }, }, -]; +] /** * 基础性路由 @@ -110,13 +118,13 @@ export const notFoundAndNoPower = [ */ export const baseRoutes: Array = [ { - path: '/', - name: '/', - component: () => import('/@/layout/index.vue'), - redirect: '/home', + path: "/", + name: "/", + component: () => import("/@/layout/index.vue"), + redirect: "/home", meta: { isKeepAlive: true, }, children: [], }, -]; +] diff --git a/src/views/supermarketerp/smErpCgPlan/createCgPlan.vue b/src/views/supermarketerp/smErpCgPlan/createCgPlan.vue new file mode 100644 index 0000000..98d3699 --- /dev/null +++ b/src/views/supermarketerp/smErpCgPlan/createCgPlan.vue @@ -0,0 +1,413 @@ + + + diff --git a/src/views/supermarketerp/smErpCgPlan/form.vue b/src/views/supermarketerp/smErpCgPlan/form.vue index 7e3b908..a79a479 100644 --- a/src/views/supermarketerp/smErpCgPlan/form.vue +++ b/src/views/supermarketerp/smErpCgPlan/form.vue @@ -1,197 +1,196 @@ diff --git a/src/views/supermarketerp/smErpCgPlan/index.vue b/src/views/supermarketerp/smErpCgPlan/index.vue index 0bb5268..d353b04 100644 --- a/src/views/supermarketerp/smErpCgPlan/index.vue +++ b/src/views/supermarketerp/smErpCgPlan/index.vue @@ -1,94 +1,125 @@ diff --git a/src/views/supermarketerp/smErpCgPlan/smErpCgPlanItem/index.vue b/src/views/supermarketerp/smErpCgPlan/smErpCgPlanItem/index.vue index f3aa83d..83b99b9 100644 --- a/src/views/supermarketerp/smErpCgPlan/smErpCgPlanItem/index.vue +++ b/src/views/supermarketerp/smErpCgPlan/smErpCgPlanItem/index.vue @@ -1,61 +1,54 @@ \ No newline at end of file + try { + await delObjs(ids) + getDataList() + useMessage().success("删除成功") + } catch (err: any) { + useMessage().error(err.msg) + } +} +