From 73057865da975a7ee1686e33fbea4f7b66f42993 Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Fri, 7 Mar 2025 11:07:00 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E8=AE=A2=E5=8D=95=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E9=A1=B5=E9=9D=A2=E8=AF=A6=E6=83=85=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E6=97=B6=E5=88=B7=E6=96=B0=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/order/index/components/detail.vue | 3 ++- src/views/order/index/index.vue | 7 ++++++- src/views/tool/Instead/index.vue | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/views/order/index/components/detail.vue b/src/views/order/index/components/detail.vue index 042af74..43fac24 100644 --- a/src/views/order/index/components/detail.vue +++ b/src/views/order/index/components/detail.vue @@ -296,6 +296,7 @@ export default { reset() { this.user = ""; this.allSelected = false; + this.$emit("close"); }, returnPayType(payType) { if (!payType) { @@ -375,7 +376,7 @@ export default { if (item === "all") { for (let i in this.detail.detailMap) { this.detail.detailMap[i].map((v) => { - if (v.checked) { + if (v.checked && v.selNumber) { arr.push(v); } }); diff --git a/src/views/order/index/index.vue b/src/views/order/index/index.vue index 886238d..daa2d56 100644 --- a/src/views/order/index/index.vue +++ b/src/views/order/index/index.vue @@ -105,7 +105,7 @@ - + @@ -135,6 +135,11 @@ const { handleFilterChange, } = usePage(); +function refresh() { + console.log("refresh"); + contentRef.value?.fetchPageData(); +} + //计算订单原金额 function returnOriginAmount(order: OrderInfoVo) { let amount = 0; diff --git a/src/views/tool/Instead/index.vue b/src/views/tool/Instead/index.vue index 792f3ed..14bb156 100644 --- a/src/views/tool/Instead/index.vue +++ b/src/views/tool/Instead/index.vue @@ -757,7 +757,7 @@ $pl: 30px; display: flex; max-height: calc(100vh - 256px); .left { - width: 1; + flex: 1; padding-right: 14px; box-sizing: border-box; display: flex; @@ -770,7 +770,7 @@ $pl: 30px; } } .right { - flex: 3; + flex: 4; overflow-x: hidden; overflow-y: scroll; &::-webkit-scrollbar { From 739f4a106209c793c8723d502aff818b500d8c90 Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Fri, 7 Mar 2025 18:53:31 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E9=87=8D=E5=86=99=E8=80=97=E6=9D=90?= =?UTF-8?q?=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/api/coup/index.js | 258 +++---- src/api/product/cons-group.ts | 58 ++ src/api/product/cons.ts | 70 ++ src/api/product/stock.ts | 51 ++ src/api/product/vendor.ts | 53 ++ src/router/index.ts | 30 +- src/store/modules/carts.ts | 14 +- src/store/modules/permission.ts | 2 - src/utils/limits.js | 163 +++++ src/utils/request-php.js | 2 +- .../admim/system/version/config/content.ts | 3 + src/views/inventory/PaymentRecord.vue | 16 - src/views/inventory/classification.vue | 10 - .../inventory/classification/Content.vue | 157 ---- src/views/inventory/classification/api.ts | 73 -- .../classification/component/AddButton.vue | 11 - .../classification/component/Paging.vue | 24 - .../classification/component/Table.vue | 42 -- .../inventory/classification/config/add.ts | 53 ++ .../inventory/classification/config/config.ts | 48 ++ .../classification/config/content.ts | 57 ++ .../inventory/classification/config/edit.ts | 53 ++ .../inventory/classification/config/search.ts | 21 + src/views/inventory/classification/index.vue | 115 +++ src/views/inventory/consumables.vue | 16 - .../components/add-haocai copy.vue | 197 +++++ .../consumables/components/add-haocai.vue | 177 +++++ .../consumables/components/addConsTakin.vue | 240 ++++++ src/views/inventory/consumables/config/add.ts | 88 +++ .../inventory/consumables/config/config.ts | 43 ++ .../inventory/consumables/config/content.ts | 94 +++ .../inventory/consumables/config/edit.ts | 51 ++ .../inventory/consumables/config/search.ts | 64 ++ src/views/inventory/consumables/index.vue | 186 +++++ .../inventory/consumablesconfig/Content.vue | 24 - .../consumablesconfig/DataStatistics.vue | 103 --- .../inventory/consumablesconfig/Search.vue | 61 -- .../consumablesconfig/component/AddButton.vue | 14 - .../consumablesconfig/component/Paging.vue | 22 - .../consumablesconfig/component/Table.vue | 34 - .../components/consumableList.vue | 207 ++++++ .../operation_in/components/shopList.vue | 250 +++++++ src/views/inventory/operation_in/index.vue | 687 ++++++++++++++++++ src/views/inventory/payment-record.vue | 6 + .../inventory/paymentRecordconfig/Content.vue | 146 ---- .../paymentRecordconfig/DataStatistics.vue | 103 --- .../inventory/paymentRecordconfig/Search.vue | 66 -- .../inventory/paymentRecordconfig/api.ts | 60 -- .../component/AddButton.vue | 15 - .../paymentRecordconfig/component/Paging.vue | 24 - .../paymentRecordconfig/component/Table.vue | 34 - src/views/inventory/supplier.vue | 14 - src/views/inventory/supplier/config/add.ts | 77 ++ src/views/inventory/supplier/config/config.ts | 48 ++ .../inventory/supplier/config/content.ts | 79 ++ src/views/inventory/supplier/config/edit.ts | 77 ++ src/views/inventory/supplier/config/search.ts | 21 + src/views/inventory/supplier/index.vue | 115 +++ .../inventory/supplierconfig/Content.vue | 147 ---- src/views/inventory/supplierconfig/Search.vue | 52 -- src/views/inventory/supplierconfig/api.ts | 60 -- .../supplierconfig/component/AddButton.vue | 9 - .../supplierconfig/component/Paging.vue | 24 - .../supplierconfig/component/Table.vue | 48 -- src/views/login/index.vue | 1 + .../shop/list/components/detailModal.vue | 4 +- 67 files changed, 3610 insertions(+), 1563 deletions(-) create mode 100644 src/api/product/cons-group.ts create mode 100644 src/api/product/cons.ts create mode 100644 src/api/product/stock.ts create mode 100644 src/api/product/vendor.ts create mode 100644 src/utils/limits.js delete mode 100644 src/views/inventory/PaymentRecord.vue delete mode 100644 src/views/inventory/classification.vue delete mode 100644 src/views/inventory/classification/Content.vue delete mode 100644 src/views/inventory/classification/api.ts delete mode 100644 src/views/inventory/classification/component/AddButton.vue delete mode 100644 src/views/inventory/classification/component/Paging.vue delete mode 100644 src/views/inventory/classification/component/Table.vue create mode 100644 src/views/inventory/classification/config/add.ts create mode 100644 src/views/inventory/classification/config/config.ts create mode 100644 src/views/inventory/classification/config/content.ts create mode 100644 src/views/inventory/classification/config/edit.ts create mode 100644 src/views/inventory/classification/config/search.ts create mode 100644 src/views/inventory/classification/index.vue delete mode 100644 src/views/inventory/consumables.vue create mode 100644 src/views/inventory/consumables/components/add-haocai copy.vue create mode 100644 src/views/inventory/consumables/components/add-haocai.vue create mode 100644 src/views/inventory/consumables/components/addConsTakin.vue create mode 100644 src/views/inventory/consumables/config/add.ts create mode 100644 src/views/inventory/consumables/config/config.ts create mode 100644 src/views/inventory/consumables/config/content.ts create mode 100644 src/views/inventory/consumables/config/edit.ts create mode 100644 src/views/inventory/consumables/config/search.ts create mode 100644 src/views/inventory/consumables/index.vue delete mode 100644 src/views/inventory/consumablesconfig/Content.vue delete mode 100644 src/views/inventory/consumablesconfig/DataStatistics.vue delete mode 100644 src/views/inventory/consumablesconfig/Search.vue delete mode 100644 src/views/inventory/consumablesconfig/component/AddButton.vue delete mode 100644 src/views/inventory/consumablesconfig/component/Paging.vue delete mode 100644 src/views/inventory/consumablesconfig/component/Table.vue create mode 100644 src/views/inventory/operation_in/components/consumableList.vue create mode 100644 src/views/inventory/operation_in/components/shopList.vue create mode 100644 src/views/inventory/operation_in/index.vue create mode 100644 src/views/inventory/payment-record.vue delete mode 100644 src/views/inventory/paymentRecordconfig/Content.vue delete mode 100644 src/views/inventory/paymentRecordconfig/DataStatistics.vue delete mode 100644 src/views/inventory/paymentRecordconfig/Search.vue delete mode 100644 src/views/inventory/paymentRecordconfig/api.ts delete mode 100644 src/views/inventory/paymentRecordconfig/component/AddButton.vue delete mode 100644 src/views/inventory/paymentRecordconfig/component/Paging.vue delete mode 100644 src/views/inventory/paymentRecordconfig/component/Table.vue delete mode 100644 src/views/inventory/supplier.vue create mode 100644 src/views/inventory/supplier/config/add.ts create mode 100644 src/views/inventory/supplier/config/config.ts create mode 100644 src/views/inventory/supplier/config/content.ts create mode 100644 src/views/inventory/supplier/config/edit.ts create mode 100644 src/views/inventory/supplier/config/search.ts create mode 100644 src/views/inventory/supplier/index.vue delete mode 100644 src/views/inventory/supplierconfig/Content.vue delete mode 100644 src/views/inventory/supplierconfig/Search.vue delete mode 100644 src/views/inventory/supplierconfig/api.ts delete mode 100644 src/views/inventory/supplierconfig/component/AddButton.vue delete mode 100644 src/views/inventory/supplierconfig/component/Paging.vue delete mode 100644 src/views/inventory/supplierconfig/component/Table.vue diff --git a/package.json b/package.json index 5391db6..a42b265 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,7 @@ "exceljs": "^4.4.0", "js-cookie": "^3.0.5", "jsencrypt": "^3.3.2", + "lodash": "^4.17.21", "lodash-es": "^4.17.21", "mitt": "^3.0.1", "nprogress": "^0.2.0", diff --git a/src/api/coup/index.js b/src/api/coup/index.js index 246fff7..a2e900b 100644 --- a/src/api/coup/index.js +++ b/src/api/coup/index.js @@ -1,104 +1,99 @@ // 代客下单 import request from "@/utils/request-php"; -import { getToken } from '@/utils/auth' +import { getToken } from "@/utils/auth"; +import { useUserStore } from "@/store"; + +const userStore = useUserStore(); + function getLoginName() { - const obj = localStorage.getItem("userInfo") || ''; - const { username } = obj ? JSON.parse(obj) : {}; - return username + return userStore.userInfo.phone; } // 抖音团购核销准备 export function $douyin_fulfilmentcertificateprepare(data) { - return request({ - url: 'douyin/fulfilmentcertificateprepare', - method: "post", - data: { - ...data - } - }); + return request({ + url: "douyin/fulfilmentcertificateprepare", + method: "post", + data: { + ...data, + }, + }); } // 抖音团购核销 export function $douyin_certificateprepare(data) { - return request({ - url: 'douyin/certificateprepare', - method: "post", - data: { - - ...data - } - }); + return request({ + url: "douyin/certificateprepare", + method: "post", + data: { + ...data, + }, + }); } // 抖音团购核销撤销 export function $douyin_fulfilmentcertificatecancel(data) { - return request({ - url: 'douyin/fulfilmentcertificatecancel', - method: "post", - data: { - ...data - } - }); + return request({ + url: "douyin/fulfilmentcertificatecancel", + method: "post", + data: { + ...data, + }, + }); } // 抖音团购核销记录 export function $douyin_orderlist(data) { - return request({ - url: 'douyin/orderlist', - method: "post", - data: { - - ...data - } - }); + return request({ + url: "douyin/orderlist", + method: "post", + data: { + ...data, + }, + }); } - // 抖音门店列表 export function $douyin_storelist(data) { - return request({ - url: 'douyin/storelist', - method: "post", - data: { - - ...data - } - }); + return request({ + url: "douyin/storelist", + method: "post", + data: { + ...data, + }, + }); } // 抖音绑定门店 export function $douyin_bindstore(data) { - return request({ - url: 'douyin/bindstore', - method: "post", - data: { - - ...data - } - }); + return request({ + url: "douyin/bindstore", + method: "post", + data: { + ...data, + }, + }); } // 抖音订单查询 export function $douyin_orderquery(data) { - return request({ - url: 'douyin/orderquery', - method: "post", - data: { - - ...data - } - }); + return request({ + url: "douyin/orderquery", + method: "post", + data: { + ...data, + }, + }); } //会员签入 export function $douyin_checkIn(data) { - return request({ - url: 'douyin/checkIn', - method: "post", - data: { - clientType: 'ADMIN', - token: getToken(), - loginName: getLoginName(), - - ...data - } - }); + return request({ + url: "douyin/checkIn", + method: "post", + data: { + clientType: "ADMIN", + token: getToken(), + loginName: getLoginName(), + ...data, + }, + }); } //美团 @@ -106,100 +101,89 @@ export function $douyin_checkIn(data) { // 美团获取uisdk 绑定 链接 export function $meituan_getuisdkurl(data) { - return request({ - url: 'meituan/getuisdkurl', - method: "post", - data: { - - ...data - } - }); + return request({ + url: "meituan/getuisdkurl", + method: "post", + data: { + ...data, + }, + }); } // 美团获取uisdk 解绑 链接 export function $meituan_getuisdkuniurl(data) { - return request({ - url: 'meituan/getuisdkuniurl', - method: "post", - data: { - - ...data - } - }); + return request({ + url: "meituan/getuisdkuniurl", + method: "post", + data: { + ...data, + }, + }); } // 美团团购核销准备 export function $meituan_fulfilmentcertificateprepare(data) { - return request({ - url: 'meituan/fulfilmentcertificateprepare', - method: "post", - data: { - - ...data - } - }); + return request({ + url: "meituan/fulfilmentcertificateprepare", + method: "post", + data: { + ...data, + }, + }); } // 美团执行核销 export function $meituan_certificateprepare(data) { - return request({ - url: 'meituan/certificateprepare', - method: "post", - data: { - - ...data - } - }); + return request({ + url: "meituan/certificateprepare", + method: "post", + data: { + ...data, + }, + }); } // 美团团购核销记录 - export function $meituan_orderlist(data) { - return request({ - url: 'meituan/orderlist', - method: "post", - data: { - - ...data - } - }); + return request({ + url: "meituan/orderlist", + method: "post", + data: { + ...data, + }, + }); } // 美团团购撤销 - export function $meituan_fulfilmentcertificatecancel(data) { - return request({ - url: 'meituan/fulfilmentcertificatecancel', - method: "post", - data: { - - ...data - } - }); + return request({ + url: "meituan/fulfilmentcertificatecancel", + method: "post", + data: { + ...data, + }, + }); } // 美团查询绑定状态 export function $meituan_searchstorestatus(data) { - return request({ - url: 'meituan/searchstorestatus', - method: "post", - data: { - - ...data - } - }); + return request({ + url: "meituan/searchstorestatus", + method: "post", + data: { + ...data, + }, + }); } // 登出 export function $logout(data) { - return request({ - url: 'user/logout', - method: "post", - data: { - - ...data - } - }); + return request({ + url: "user/logout", + method: "post", + data: { + ...data, + }, + }); } - diff --git a/src/api/product/cons-group.ts b/src/api/product/cons-group.ts new file mode 100644 index 0000000..808f5f0 --- /dev/null +++ b/src/api/product/cons-group.ts @@ -0,0 +1,58 @@ +import request from "@/utils/request"; +import { Product_BaseUrl } from "@/api/config"; +const baseURL = Product_BaseUrl + "/admin/product/cons-group"; + +const Api = { + /** 分页*/ + getList(params: any) { + return request({ + url: `${baseURL}/page`, + method: "get", + params, + }); + }, + /** 全部*/ + getAllList(params: any) { + return request({ + url: `${baseURL}/list`, + method: "get", + params, + }); + }, + get(id: string | number) { + return request({ + url: `${baseURL}/` + id, + method: "get", + }); + }, + add(data: any) { + return request({ + url: `${baseURL}`, + method: "post", + data + }); + }, + edit(data: any) { + return request({ + url: `${baseURL}`, + method: "put", + data + }); + }, + disable(id: number | string) { + return request({ + url: `${baseURL}/disable/` + id, + method: "post", + }); + }, + enable(id: number | string) { + return request({ + url: `${baseURL}/enable/` + id, + method: "post", + }); + }, +}; + + + +export default Api; diff --git a/src/api/product/cons.ts b/src/api/product/cons.ts new file mode 100644 index 0000000..0bad598 --- /dev/null +++ b/src/api/product/cons.ts @@ -0,0 +1,70 @@ +import request from "@/utils/request"; +import { Product_BaseUrl } from "@/api/config"; +const baseURL = Product_BaseUrl + "/admin/product/cons"; + +const Api = { + /** 分页*/ + getList(params: any) { + return request({ + url: `${baseURL}/page`, + method: "get", + params, + }); + }, + /** 全部*/ + getAllList(params: any) { + return request({ + url: `${baseURL}/list`, + method: "get", + params, + }); + }, + get(id: string | number) { + return request({ + url: `${baseURL}/` + id, + method: "get", + }); + }, + add(data: any) { + return request({ + url: `${baseURL}`, + method: "post", + data + }); + }, + edit(data: any) { + return request({ + url: `${baseURL}`, + method: "put", + data + }); + }, + disable(id: number | string) { + return request({ + url: `${baseURL}/disable/` + id, + method: "post", + }); + }, + enable(id: number | string) { + return request({ + url: `${baseURL}/enable/` + id, + method: "post", + }); + }, + onOff(id: number | string) { + return request({ + url: `${baseURL}/on-off/`, + method: "post", + }); + }, + modifySubUnit(id: number | string) { + return request({ + url: `${baseURL}/modifySubUnit`, + method: "post", + }); + }, +}; + + + +export default Api; diff --git a/src/api/product/stock.ts b/src/api/product/stock.ts new file mode 100644 index 0000000..0836af5 --- /dev/null +++ b/src/api/product/stock.ts @@ -0,0 +1,51 @@ +import request from "@/utils/request"; +import { Product_BaseUrl } from "@/api/config"; +const baseURL = Product_BaseUrl + "/admin/product/stock"; +// 耗材 +const Api = { + /** 耗材入库*/ + in(data: any) { + return request({ + url: `${baseURL}/in`, + method: "post", + data + }); + }, + //出库 + out(data: any) { + return request({ + url: `${baseURL}/out`, + method: "post", + data + }); + }, + // 库存盘点记录 + checkRecord(params: any) { + return request({ + url: `${baseURL}/check-record`, + method: "get", + params + }); + }, + //库存盘点 + check(data: any) { + return request({ + url: `${baseURL}/check`, + method: "post", + data + }); + }, + //耗材报损 + + reportDamage(data: any) { + return request({ + url: `${baseURL}/reportDamage`, + method: "post", + data + }); + }, +}; + + + +export default Api; diff --git a/src/api/product/vendor.ts b/src/api/product/vendor.ts new file mode 100644 index 0000000..75ade6c --- /dev/null +++ b/src/api/product/vendor.ts @@ -0,0 +1,53 @@ +import request from "@/utils/request"; +import { Product_BaseUrl } from "@/api/config"; +const baseURL = Product_BaseUrl + "/admin/product/vendor"; +// 供应商 +const Api = { + /** 分页*/ + getList(params: any) { + return request({ + url: `${baseURL}/page`, + method: "get", + params, + }); + }, + /** 全部*/ + getAllList(params: any) { + return request({ + url: `${baseURL}/list`, + method: "get", + params, + }); + }, + get(id: string | number) { + return request({ + url: `${baseURL}/` + id, + method: "get", + }); + }, + add(data: any) { + return request({ + url: `${baseURL}`, + method: "post", + data + }); + }, + edit(data: any) { + return request({ + url: `${baseURL}`, + method: "put", + data + }); + }, + + delete(id: string | number) { + return request({ + url: `${baseURL}/` + id, + method: "delete", + }); + }, +}; + + + +export default Api; diff --git a/src/router/index.ts b/src/router/index.ts index f392696..f662e19 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -545,17 +545,17 @@ export const constantRoutes: RouteRecordRaw[] = [ children: [ { path: "consumables", - component: () => import("@/views/inventory/consumables.vue"), + component: () => import("@/views/inventory/consumables/index.vue"), name: "consumables", meta: { title: "耗材列表", affix: false, - keepAlive: true, + }, }, { path: "supplier", - component: () => import("@/views/inventory/supplier.vue"), + component: () => import("@/views/inventory/supplier/index.vue"), name: "supplier", meta: { title: "供应商管理", @@ -564,23 +564,35 @@ export const constantRoutes: RouteRecordRaw[] = [ }, }, { - path: "paymentRecord", - component: () => import("@/views/inventory/paymentRecord.vue"), - name: "paymentRecord", + path: "operation_in", + component: () => import("@/views/inventory/operation_in/index.vue"), + name: "operation_in", meta: { - title: "结款记录", + title: "入库", affix: false, hidden: true }, }, + { + path: "paymentRecord", + component: () => import("@/views/inventory/payment-record.vue"), + name: "paymentRecord", + meta: { + title: "结款记录", + affix: false, + hidden: true, + + }, + }, { path: "classification", - component: () => import("@/views/inventory/classification.vue"), + component: () => import("@/views/inventory/classification/index.vue"), name: "classification", meta: { title: "分类管理", affix: false, - hidden: true + hidden: true, + }, }, diff --git a/src/store/modules/carts.ts b/src/store/modules/carts.ts index d788f61..23139c6 100644 --- a/src/store/modules/carts.ts +++ b/src/store/modules/carts.ts @@ -412,6 +412,7 @@ export const useCartsStore = defineStore("carts", () => { detailMap: returnDetailMap(data.detailMap) } } + /** * * @param initParams 购物车初始化参数 @@ -428,9 +429,12 @@ export const useCartsStore = defineStore("carts", () => { setOldOrder($oldOrder) } - console.log('oldOrder.detailMap', oldOrder.value.detailMap) - - table_code.value = initParams && initParams.table_code ? initParams.table_code : ''; + // console.log('oldOrder.detailMap', oldOrder.value.detailMap) + // const cache_table_code = localStorage.getItem('cache_table_code'); + // const randomTableCode = cache_table_code ? cache_table_code : ('APC' + (1000 + Math.floor(Math.random() * 9000))) + initParams.table_code = initParams.table_code ? initParams.table_code : '' + table_code.value = initParams.table_code + // localStorage.setItem('cache_table_code', table_code.value); WebSocketManager.subscribeToTopic(initParams, (msg) => { console.log("收到消息:", msg); @@ -444,6 +448,10 @@ export const useCartsStore = defineStore("carts", () => { if (msg.data.table_code) { table_code.value = table_code.value ? table_code.value : msg.data.table_code } + if (msg.table_code) { + table_code.value = table_code.value ? table_code.value : msg.table_code + + } } diff --git a/src/store/modules/permission.ts b/src/store/modules/permission.ts index d3a9d6e..2e5e62e 100644 --- a/src/store/modules/permission.ts +++ b/src/store/modules/permission.ts @@ -34,11 +34,9 @@ export const usePermissionStore = defineStore("permission", () => { if (!isTest) { const dynamicRoutes = parseDynamicRoutes(data.filter(v => v.type == 0)); routes.value = [...constantRoutes, ...dynamicRoutes]; - console.log(routes.value); isRoutesLoaded.value = true; resolve(dynamicRoutes); } else { - isRoutesLoaded.value = true; resolve(constantRoutes); } diff --git a/src/utils/limits.js b/src/utils/limits.js new file mode 100644 index 0000000..891e2f1 --- /dev/null +++ b/src/utils/limits.js @@ -0,0 +1,163 @@ +import { ElMessage } from "element-plus"; +function getHasPermission() { + return true; +} +const userInfo = JSON.parse(localStorage.getItem("userInfo")); +const $PermissionObj = { + data: [ + { + key: "yun_xu_cha_kan_jing_ying_shu_ju", + text: "允许查看经营数据", + }, + { + key: "yun_xu_cha_kan_suo_you_jiao_ban_ji_lu", + text: "允许查看所有交班记录", + }, + ], + default: [ + { + key: "yun_xu_xia_dan", + text: "允许下单", + }, + { + key: "yun_xu_shou_kuan", + text: "允许收款", + }, + { + key: "yun_xu_tui_kuan", + text: "允许退款", + }, + { + key: "yun_xu_jiao_ban", + text: "允许交班", + }, + ], + goods: [ + { + key: "yun_xu_xiu_gai_shang_pin", + text: "允许修改商品", + }, + { + key: "yun_xu_shang_xia_jia_shang_pin", + text: "允许上下架商品", + }, + { + key: "yun_xu_xiu_gai_fen_lei", + text: "允许修改分类", + }, + { + key: "yun_xu_xiu_gai_fen_zu", + text: "允许修改分组", + }, + ], + discount: [ + { + key: "yun_xu_da_zhe", + text: "允许打折", + }, + ], + vip: [ + { + key: "yun_xu_guan_li_hui_yuan_xin_xi", + text: "允许管理会员信息", + }, + { + key: "yun_xu_xiu_gai_hui_yuan_yu_e", + text: "允许修改会员余额", + }, + ], + stock: [ + { + text: "允许提交报损", + key: "yun_xu_ti_jiao_bao_sun", + }, + { + text: "允许沽清", + key: "yun_xu_gu_qing", + }, + { + text: "允许售罄商品", + key: "yun_xu_shou_qing_shang_pin", + }, + { + text: "允许修改商品库存", + key: "yun_xu_xiu_gai_shang_pin_ku_cun", + }, + { + text: "允许耗材入库", + key: "yun_xu_hao_cai_ru_ku", + }, + { + text: "允许耗材出库", + key: "yun_xu_hao_cai_chu_ku", + }, + { + text: "允许耗材盘点", + key: "yun_xu_hao_cai_pan_dian", + }, + ], +}; + +export async function hasPermission(params) { + //如果是商户默认拥有全部权限 + const loginType = localStorage.getItem("loginType"); + if (loginType == "merchant") { + return true; + } + params = returnFormatParams(params); + if (!params) { + return ElMessage.error( + "未找到相关权限,请检查代码或在权限配置文件commons/utils/hasPermission.js文件进行修改或增加" + ); + } + const option = Object.assign( + { + tips: true, + key: "", + text: "", + }, + params + ); + const res = await getHasPermission({ + userId: userInfo.id, + + code: params.key, + }); + if (!res && option.tips) { + ElMessage.error({ + title: "您没有" + params.text + "权限!", + duration: 5000, + }); + } + return res; +} + +export function isObjectButNotArray(value) { + return typeof value === "object" && Array.isArray(value) === false; +} + +export function findPermissionObj(str) { + for (let i in $PermissionObj) { + const obj = $PermissionObj[i].find((v) => v.key == str || v.text == str); + if (obj) { + return obj; + } + } + console.error( + "未找到相关权限配置,请检查权限配置文件commons/utils/hasPermission.js文件进行修改或增加" + ); + return false; +} + +export function returnFormatParams(params) { + if (typeof params === "string") { + return findPermissionObj(params); + } else { + if (isObjectButNotArray(params)) { + const obj = findPermissionObj(params.key || params.text); + return { ...params, ...obj }; + } else { + console.error("参数只能是字符串或者对象,不能是数组"); + } + } +} diff --git a/src/utils/request-php.js b/src/utils/request-php.js index 669dcf4..d3928f5 100644 --- a/src/utils/request-php.js +++ b/src/utils/request-php.js @@ -4,7 +4,7 @@ import { getToken } from "@/utils/auth"; // 创建axios实例 const service = axios.create({ - baseURL: "https://czgdoumei.sxczgkj.com/index.php/api/", // api 的 base_url + baseURL: "https://newblockwlx.sxczgkj.cn/index.php/api/", // api 的 base_url timeout: 1000 * 20, // 请求超时时间 }); diff --git a/src/views/admim/system/version/config/content.ts b/src/views/admim/system/version/config/content.ts index 1590471..99805e5 100644 --- a/src/views/admim/system/version/config/content.ts +++ b/src/views/admim/system/version/config/content.ts @@ -17,6 +17,9 @@ const contentConfig: IContentConfig = { indexAction: function (params) { return VersionApi.getList(); }, + modifyAction: function (data: any) { + return VersionApi.edit(data); + }, deleteAction: VersionApi.delete, // modifyAction: function (data) { // // return VersionApi.edit(data); diff --git a/src/views/inventory/PaymentRecord.vue b/src/views/inventory/PaymentRecord.vue deleted file mode 100644 index e772bc0..0000000 --- a/src/views/inventory/PaymentRecord.vue +++ /dev/null @@ -1,16 +0,0 @@ - - \ No newline at end of file diff --git a/src/views/inventory/classification.vue b/src/views/inventory/classification.vue deleted file mode 100644 index 2257ff5..0000000 --- a/src/views/inventory/classification.vue +++ /dev/null @@ -1,10 +0,0 @@ - - \ No newline at end of file diff --git a/src/views/inventory/classification/Content.vue b/src/views/inventory/classification/Content.vue deleted file mode 100644 index 713a5db..0000000 --- a/src/views/inventory/classification/Content.vue +++ /dev/null @@ -1,157 +0,0 @@ - - - \ No newline at end of file diff --git a/src/views/inventory/classification/api.ts b/src/views/inventory/classification/api.ts deleted file mode 100644 index 1f8cb7b..0000000 --- a/src/views/inventory/classification/api.ts +++ /dev/null @@ -1,73 +0,0 @@ -import request from "@/utils/request"; -const baseURL = "/product/admin/product/cons-group"; -// 耗材-配置 -const AuthAPI = { - // 列表 - getList(params: any) { - return request({ - url: `${baseURL}/list`, - method: "get", - params, - }); - }, - /** 分页*/ - getPage(params: any) { - return request({ - url: `${baseURL}/page`, - method: "get", - params, - }); - }, - // 新增 - add(data: any) { - return request({ - url: `${baseURL}`, - method: "post", - data: { ...data }, - }); - }, - // 详情 - getinfo(id: number) { - return request({ - url: `${baseURL}/${id}`, - method: "get", - }); - }, - // 编辑 - update(data: Object) { - return request({ - url: `${baseURL}`, - method: "put", - data, - }); - }, - // 删除 - deleteByIds(id: number | String) { - return request({ - url: `${baseURL}/${id}`, - method: "delete", - }); - }, - // 修改状态-启用 - onOff(id: number | String) { - return request({ - url: `${baseURL}/enable/${id}`, - method: "post", - }); - }, - // 修改状态-禁用 - onOff2(id: number | String) { - return request({ - url: `${baseURL}/disable/${id}`, - method: "post", - }); - } -}; -export interface Responseres { - code?: number | null; - data?: any; - msg?: null | string; - [property: string]: any; -} - -export default AuthAPI; \ No newline at end of file diff --git a/src/views/inventory/classification/component/AddButton.vue b/src/views/inventory/classification/component/AddButton.vue deleted file mode 100644 index 2d6df97..0000000 --- a/src/views/inventory/classification/component/AddButton.vue +++ /dev/null @@ -1,11 +0,0 @@ - - \ No newline at end of file diff --git a/src/views/inventory/classification/component/Paging.vue b/src/views/inventory/classification/component/Paging.vue deleted file mode 100644 index ee9b056..0000000 --- a/src/views/inventory/classification/component/Paging.vue +++ /dev/null @@ -1,24 +0,0 @@ - - \ No newline at end of file diff --git a/src/views/inventory/classification/component/Table.vue b/src/views/inventory/classification/component/Table.vue deleted file mode 100644 index 607bccd..0000000 --- a/src/views/inventory/classification/component/Table.vue +++ /dev/null @@ -1,42 +0,0 @@ - - - diff --git a/src/views/inventory/classification/config/add.ts b/src/views/inventory/classification/config/add.ts new file mode 100644 index 0000000..4e5169b --- /dev/null +++ b/src/views/inventory/classification/config/add.ts @@ -0,0 +1,53 @@ +import Api from "@/api/product/cons-group"; + + +import { returnOptions, switchAttr } from "./config"; +import type { IModalConfig } from "@/components/CURD/types"; + +const modalConfig: IModalConfig = { + pageName: "sys:user", + dialog: { + title: "添加耗材分类", + width: 800, + draggable: true, + }, + form: { + labelWidth: 140, + }, + formAction: function (data) { + return Api.add({ ...data }); + }, + beforeSubmit(data) { + console.log("提交之前处理", data); + }, + formItems: [ + + { + label: "耗材类型名称", + prop: "name", + rules: [{ required: true, message: "请输入耗材类型名称", trigger: "blur" }], + attrs: { + placeholder: "请输入耗材类型名称", + }, + }, + { + type: "switch", + label: "是否启用", + prop: "status", + attrs: { + activeValue: 1, + inactiveValue: 0 + }, + col: { + xs: 24, + sm: 12, + }, + initialValue: 0 + + }, + + ], +}; + +// 如果有异步数据会修改配置的,推荐用reactive包裹,而纯静态配置的可以直接导出 +export default reactive(modalConfig); diff --git a/src/views/inventory/classification/config/config.ts b/src/views/inventory/classification/config/config.ts new file mode 100644 index 0000000..b788d68 --- /dev/null +++ b/src/views/inventory/classification/config/config.ts @@ -0,0 +1,48 @@ +export interface options { + label: string; + value: string | number; + [property: string]: any; +} +export interface optionObject { + [property: string]: options[]; +} +const options: optionObject = { + payType: [ + { label: "现金", value: "cash" }, + { label: "微信", value: "weixin" }, + { label: "银行卡", value: "bank" }, + { label: "会员支付", value: "member-account" }, + { label: "支付宝", value: "alipay" }, + { label: "刷卡", value: "deposit" }, + { label: "挂单", value: "arrears" }, + { label: "刷卡", value: "deposit" }, + { label: "储值", value: "member-account" }, + { label: "自定义", value: "virtual" }, + ], + isIdeal: [ + { label: "否", value: 0 }, + { label: "是", value: 1 }, + ] +}; + +export const switchAttr = { + "active-value": 1, + "inactive-value": 0, +} + + +export type optionsType = string; + +export function returnOptions(type: optionsType) { + return options[type]; +} + +export function returnOptionsLabel(optionsType: optionsType, value: string | number) { + const options = returnOptions(optionsType); + if (!options) { + return ""; + } + const option = options.find((item) => item.value === value); + return option ? option.label : ""; +} + diff --git a/src/views/inventory/classification/config/content.ts b/src/views/inventory/classification/config/content.ts new file mode 100644 index 0000000..f1a4aed --- /dev/null +++ b/src/views/inventory/classification/config/content.ts @@ -0,0 +1,57 @@ +import Api from "@/api/product/cons-group"; +import type { IContentConfig } from "@/components/CURD/types"; + +const contentConfig: IContentConfig = { + pageName: "sys:user", + table: { + border: true, + highlightCurrentRow: true, + }, + pagination: { + background: true, + layout: "prev,pager,next,jumper,total,sizes", + pageSize: 20, + pageSizes: [10, 20, 30, 50], + }, + indexAction: function (params) { + return Api.getList({}); + }, + modifyAction: function (data) { + return Api.edit(data); + }, + pk: "id", + toolbar: ["add"], + defaultToolbar: ["refresh", "filter", "search"], + cols: [ + // { type: "selection", width: 50, align: "center" }, + { + label: "ID", + align: "center", + prop: "id", + }, + { + label: "耗材类型名称", + align: "center", + prop: "name", + }, + + { + label: "状态", + align: "center", + prop: "status", + templet: 'custom', + slotName: 'switch' + }, + + { + label: "操作", + align: "center", + fixed: "right", + width: 280, + templet: "tool", + operat: ["edit"], + }, + ], +}; + +export default contentConfig; diff --git a/src/views/inventory/classification/config/edit.ts b/src/views/inventory/classification/config/edit.ts new file mode 100644 index 0000000..e7115c0 --- /dev/null +++ b/src/views/inventory/classification/config/edit.ts @@ -0,0 +1,53 @@ +import Api from "@/api/product/cons-group"; + + +import { returnOptions, switchAttr } from "./config"; +import type { IModalConfig } from "@/components/CURD/types"; + +const modalConfig: IModalConfig = { + pageName: "sys:user", + dialog: { + title: "编辑耗材分类", + width: 800, + draggable: true, + }, + form: { + labelWidth: 140, + }, + formAction: function (data) { + return Api.edit({ ...data, }); + }, + beforeSubmit(data) { + console.log("提交之前处理", data); + }, + formItems: [ + + { + label: "耗材类型名称", + prop: "name", + rules: [{ required: true, message: "请输入耗材类型名称", trigger: "blur" }], + attrs: { + placeholder: "请输入耗材类型名称", + }, + }, + { + type: "switch", + label: "是否启用", + prop: "status", + attrs: { + activeValue: 1, + inactiveValue: 0 + }, + col: { + xs: 24, + sm: 12, + }, + initialValue: 0 + + }, + + ], +}; + +// 如果有异步数据会修改配置的,推荐用reactive包裹,而纯静态配置的可以直接导出 +export default reactive(modalConfig); diff --git a/src/views/inventory/classification/config/search.ts b/src/views/inventory/classification/config/search.ts new file mode 100644 index 0000000..29cbdd9 --- /dev/null +++ b/src/views/inventory/classification/config/search.ts @@ -0,0 +1,21 @@ +import type { ISearchConfig } from "@/components/CURD/types"; + +const searchConfig: ISearchConfig = { + pageName: "sys:user", + formItems: [ + { + type: "input", + label: "版本号", + prop: "keywords", + attrs: { + placeholder: "请输入版本号", + clearable: true, + style: { + width: "200px", + }, + }, + }, + ], +}; + +export default searchConfig; diff --git a/src/views/inventory/classification/index.vue b/src/views/inventory/classification/index.vue new file mode 100644 index 0000000..565a1ea --- /dev/null +++ b/src/views/inventory/classification/index.vue @@ -0,0 +1,115 @@ + + + diff --git a/src/views/inventory/consumables.vue b/src/views/inventory/consumables.vue deleted file mode 100644 index abe5038..0000000 --- a/src/views/inventory/consumables.vue +++ /dev/null @@ -1,16 +0,0 @@ - - \ No newline at end of file diff --git a/src/views/inventory/consumables/components/add-haocai copy.vue b/src/views/inventory/consumables/components/add-haocai copy.vue new file mode 100644 index 0000000..f4a6d8c --- /dev/null +++ b/src/views/inventory/consumables/components/add-haocai copy.vue @@ -0,0 +1,197 @@ + + + + \ No newline at end of file diff --git a/src/views/inventory/consumables/components/add-haocai.vue b/src/views/inventory/consumables/components/add-haocai.vue new file mode 100644 index 0000000..f3b3dbc --- /dev/null +++ b/src/views/inventory/consumables/components/add-haocai.vue @@ -0,0 +1,177 @@ + + + + \ No newline at end of file diff --git a/src/views/inventory/consumables/components/addConsTakin.vue b/src/views/inventory/consumables/components/addConsTakin.vue new file mode 100644 index 0000000..e223665 --- /dev/null +++ b/src/views/inventory/consumables/components/addConsTakin.vue @@ -0,0 +1,240 @@ + + + + + + \ No newline at end of file diff --git a/src/views/inventory/consumables/config/add.ts b/src/views/inventory/consumables/config/add.ts new file mode 100644 index 0000000..3cd763c --- /dev/null +++ b/src/views/inventory/consumables/config/add.ts @@ -0,0 +1,88 @@ +import Api from "@/api/product/vendor"; +import type { IModalConfig } from "@/components/CURD/types"; + +const modalConfig: IModalConfig = { + pageName: "sys:user", + dialog: { + title: "新增耗材", + width: 800, + draggable: true, + }, + form: { + labelWidth: 140, + }, + formAction: function (data) { + return Api.add({ ...data }); + }, + beforeSubmit(data) { + console.log("提交之前处理", data); + }, + formItems: [ + { + label: "渠道", + prop: "source", + rules: [{ required: true, message: "请选择渠道", trigger: "blur" }], + type: "select", + attrs: { + placeholder: "请选择渠道", + }, + options: [], + }, + { + label: "类型", + prop: "type", + rules: [{ required: true, message: "请选择类型", trigger: "blur" }], + type: "select", + attrs: { + placeholder: "请选择类型", + }, + col: { + xs: 24, + sm: 12, + }, + options: [], + }, + { + type: "input", + label: "版本号", + prop: "version", + rules: [{ required: true, message: "请输入版本号", trigger: "blur" }], + attrs: { + placeholder: "请输入版本号", + }, + }, + { + type: "radio", + label: "是否强制更新", + prop: "isForce", + rules: [{ required: true, message: "请输入版本号", trigger: "blur" }], + attrs: { + placeholder: "请输入版本号", + }, + initialValue: 0, + options: [], + }, + { + type: "textarea", + label: "更新提示内容", + prop: "message", + rules: [{ required: true, message: "请输入更新提示内容", trigger: "blur" }], + attrs: { + placeholder: "请输入更新提示内容", + }, + }, + { + type: "custom", + label: "版本文件", + prop: "url", + rules: [{ required: true, message: "请上传版本文件", trigger: "blur" }], + attrs: { + placeholder: "请上传版本文件", + }, + initialValue: [], + }, + ], +}; + +// 如果有异步数据会修改配置的,推荐用reactive包裹,而纯静态配置的可以直接导出 +export default reactive(modalConfig); diff --git a/src/views/inventory/consumables/config/config.ts b/src/views/inventory/consumables/config/config.ts new file mode 100644 index 0000000..62ce8b8 --- /dev/null +++ b/src/views/inventory/consumables/config/config.ts @@ -0,0 +1,43 @@ +import type { statusType } from "@/api/order/order"; +export const options: { [key in optionsType]: options[] } = { + +} +export type optionsType = string; + +export function returnOptions(type: optionsType) { + return options[type]; +} + +export function returnOptionsLabel(optionsType: optionsType, value: string | number) { + const options = returnOptions(optionsType); + if (!options) { + return ""; + } + const option = options.find((item) => item.value === value); + return option ? option.label : ""; +} + + +export interface options { + label: string; + value: string | number; + [property: string]: any; +} +export interface statusOptions extends options { + value: statusType; +} + +export type payTypeValue = + | "" + | "cash" + | "bank" + | "scanCode" + | "deposit" + | "vipPay" + | "arrears" + | "virtual" + | "arrears"; + +export interface payTypeOptions extends options { + value: payTypeValue; +} diff --git a/src/views/inventory/consumables/config/content.ts b/src/views/inventory/consumables/config/content.ts new file mode 100644 index 0000000..dffe55f --- /dev/null +++ b/src/views/inventory/consumables/config/content.ts @@ -0,0 +1,94 @@ +import Api from "@/api/product/cons"; +import type { IContentConfig } from "@/components/CURD/types"; +const contentConfig: IContentConfig = { + pageName: "sys:user", + table: { + border: true, + highlightCurrentRow: true, + }, + pagination: { + background: true, + layout: "prev,pager,next,jumper,total,sizes", + pageSize: 10, + pageSizes: [10, 20, 30, 50], + }, + indexAction: function (params) { + return Api.getList(params); + }, + // deleteAction: Api.delete, + // modifyAction: function (data) { + // // return Api.edit(data); + // }, + pk: "id", + toolbar: [ + "add", + { + text: "入库", + name: 'ruku', + auth: 'ruku' + }, + { + text: "出库", + name: 'chuku', + auth: '' + }, + { + text: "分类管理", + name: 'category', + auth: '' + }, + { + text: "供应商管理", + name: 'gongyinsahng', + auth: '' + }, + ], + defaultToolbar: ["refresh", "filter", "search"], + cols: [ + { type: "selection", width: 50, align: "center" }, + // { label: "id", align: "center", prop: "id", width: 100, show: true }, + { + label: "耗材名称", + align: "center", + prop: "conName", + }, + { + label: "单位", + align: "center", + prop: "conUnit", + }, + { + label: "所属商品", + align: "center", + templet: 'custom', + slotName: 'goods' + }, + { + label: "库存数量", + align: "center", + prop: "stockNumber", + }, + { + label: "预警值", + align: "center", + prop: "conWarning", + }, + { + label: "是否启用", + align: "center", + prop: "status", + templet: "custom", + slotName: "status", + }, + { + label: "操作", + align: "center", + fixed: "right", + width: 150, + templet: "custom", + slotName: 'operate' + }, + ], +}; + +export default contentConfig; diff --git a/src/views/inventory/consumables/config/edit.ts b/src/views/inventory/consumables/config/edit.ts new file mode 100644 index 0000000..799d8a4 --- /dev/null +++ b/src/views/inventory/consumables/config/edit.ts @@ -0,0 +1,51 @@ +import VersionApi, { type editRequest } from "@/api/system/version"; +import type { IModalConfig } from "@/components/CURD/types"; + +const modalConfig: IModalConfig = { + pageName: "sys:user", + dialog: { + title: "编辑版本", + width: 800, + draggable: true, + }, + pk: "id", + formAction: function (data) { + return VersionApi.edit({ ...data, url: typeof data.url === "string" ? data.url : data.url[0] }); + }, + beforeSubmit(data) { + console.log("提交之前处理", data); + }, + formItems: [ + { + type: "input", + label: "版本号", + prop: "version", + rules: [{ required: true, message: "请输入版本号", trigger: "blur" }], + attrs: { + placeholder: "请输入版本号", + }, + }, + + { + type: "textarea", + label: "更新提示内容", + prop: "message", + rules: [{ required: true, message: "请输入更新提示内容", trigger: "blur" }], + attrs: { + placeholder: "请输入更新提示内容", + }, + }, + { + type: "custom", + label: "版本文件", + prop: "url", + rules: [{ required: true, message: "请上传版本文件", trigger: "blur" }], + attrs: { + placeholder: "请上传版本文件", + }, + initialValue: [], + }, + ], +}; + +export default reactive(modalConfig); diff --git a/src/views/inventory/consumables/config/search.ts b/src/views/inventory/consumables/config/search.ts new file mode 100644 index 0000000..358c721 --- /dev/null +++ b/src/views/inventory/consumables/config/search.ts @@ -0,0 +1,64 @@ +import type { ISearchConfig } from "@/components/CURD/types"; +import consGroupApi from '@/api/product/cons-group' +import { statusOptions, payTypeOptions } from "./config"; +const searchConfig: ISearchConfig = { + pageName: "sys:user", + inline: true, + isExpandable: false, + formItems: [ + { + type: "select", + label: "耗材分类", + prop: "consGroupId", + attrs: { + placeholder: "请选择耗材分类", + clearable: true, + style: { + width: "200px", + }, + }, + initialValue: "", + initFn(formItem) { + console.log(formItem); + consGroupApi.getAllList({}).then(res => { + formItem.options = res.map((item: { name: any; id: any; }) => { + return { + label: item?.name, + value: item?.id + } + }) + }) + }, + }, + + { + type: "input", + label: "耗材名称", + prop: "conName", + attrs: { + placeholder: "请输入耗材名称", + clearable: true, + style: { + width: "200px", + }, + }, + }, + { + type: "date-picker", + label: "创建时间", + prop: "createAt", + attrs: { + type: "daterange", + "range-separator": "~", + "start-placeholder": "开始时间", + "end-placeholder": "截止时间", + "value-format": "YYYY-MM-DD", + style: { + width: "240px", + }, + }, + }, + ], +}; + +export default searchConfig; diff --git a/src/views/inventory/consumables/index.vue b/src/views/inventory/consumables/index.vue new file mode 100644 index 0000000..14e4cc7 --- /dev/null +++ b/src/views/inventory/consumables/index.vue @@ -0,0 +1,186 @@ + + + + + diff --git a/src/views/inventory/consumablesconfig/Content.vue b/src/views/inventory/consumablesconfig/Content.vue deleted file mode 100644 index c1b88ca..0000000 --- a/src/views/inventory/consumablesconfig/Content.vue +++ /dev/null @@ -1,24 +0,0 @@ - - - \ No newline at end of file diff --git a/src/views/inventory/consumablesconfig/DataStatistics.vue b/src/views/inventory/consumablesconfig/DataStatistics.vue deleted file mode 100644 index cf1cb3a..0000000 --- a/src/views/inventory/consumablesconfig/DataStatistics.vue +++ /dev/null @@ -1,103 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/views/inventory/consumablesconfig/Search.vue b/src/views/inventory/consumablesconfig/Search.vue deleted file mode 100644 index aaaa1f6..0000000 --- a/src/views/inventory/consumablesconfig/Search.vue +++ /dev/null @@ -1,61 +0,0 @@ - - - - - diff --git a/src/views/inventory/consumablesconfig/component/AddButton.vue b/src/views/inventory/consumablesconfig/component/AddButton.vue deleted file mode 100644 index 1f5e426..0000000 --- a/src/views/inventory/consumablesconfig/component/AddButton.vue +++ /dev/null @@ -1,14 +0,0 @@ - - \ No newline at end of file diff --git a/src/views/inventory/consumablesconfig/component/Paging.vue b/src/views/inventory/consumablesconfig/component/Paging.vue deleted file mode 100644 index e04fbf6..0000000 --- a/src/views/inventory/consumablesconfig/component/Paging.vue +++ /dev/null @@ -1,22 +0,0 @@ - - \ No newline at end of file diff --git a/src/views/inventory/consumablesconfig/component/Table.vue b/src/views/inventory/consumablesconfig/component/Table.vue deleted file mode 100644 index bb10f57..0000000 --- a/src/views/inventory/consumablesconfig/component/Table.vue +++ /dev/null @@ -1,34 +0,0 @@ - - - diff --git a/src/views/inventory/operation_in/components/consumableList.vue b/src/views/inventory/operation_in/components/consumableList.vue new file mode 100644 index 0000000..f35d6a4 --- /dev/null +++ b/src/views/inventory/operation_in/components/consumableList.vue @@ -0,0 +1,207 @@ + + + + + + \ No newline at end of file diff --git a/src/views/inventory/operation_in/components/shopList.vue b/src/views/inventory/operation_in/components/shopList.vue new file mode 100644 index 0000000..642e344 --- /dev/null +++ b/src/views/inventory/operation_in/components/shopList.vue @@ -0,0 +1,250 @@ + + + + + \ No newline at end of file diff --git a/src/views/inventory/operation_in/index.vue b/src/views/inventory/operation_in/index.vue new file mode 100644 index 0000000..a50b74c --- /dev/null +++ b/src/views/inventory/operation_in/index.vue @@ -0,0 +1,687 @@ + + + + + \ No newline at end of file diff --git a/src/views/inventory/payment-record.vue b/src/views/inventory/payment-record.vue new file mode 100644 index 0000000..97212be --- /dev/null +++ b/src/views/inventory/payment-record.vue @@ -0,0 +1,6 @@ + + \ No newline at end of file diff --git a/src/views/inventory/paymentRecordconfig/Content.vue b/src/views/inventory/paymentRecordconfig/Content.vue deleted file mode 100644 index 4bb8947..0000000 --- a/src/views/inventory/paymentRecordconfig/Content.vue +++ /dev/null @@ -1,146 +0,0 @@ - - - \ No newline at end of file diff --git a/src/views/inventory/paymentRecordconfig/DataStatistics.vue b/src/views/inventory/paymentRecordconfig/DataStatistics.vue deleted file mode 100644 index cf1cb3a..0000000 --- a/src/views/inventory/paymentRecordconfig/DataStatistics.vue +++ /dev/null @@ -1,103 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/views/inventory/paymentRecordconfig/Search.vue b/src/views/inventory/paymentRecordconfig/Search.vue deleted file mode 100644 index ad584fa..0000000 --- a/src/views/inventory/paymentRecordconfig/Search.vue +++ /dev/null @@ -1,66 +0,0 @@ - - - - - diff --git a/src/views/inventory/paymentRecordconfig/api.ts b/src/views/inventory/paymentRecordconfig/api.ts deleted file mode 100644 index c6da4ee..0000000 --- a/src/views/inventory/paymentRecordconfig/api.ts +++ /dev/null @@ -1,60 +0,0 @@ -import request from "@/utils/request"; -const baseURL = "/product/admin/prod/group"; -// XXX-配置 -const AuthAPI = { - // 列表 - getList(params: any) { - return request({ - url: `${baseURL}/list`, - method: "get", - params, - }); - }, - /** 分页*/ - getPage(params: any) { - return request({ - url: `${baseURL}/page`, - method: "get", - params, - }); - }, - // 新增 - add(data: any) { - return request({ - url: `${baseURL}`, - method: "post", - data: { ...data }, - }); - }, - // 详情 - getinfo(id: number) { - return request({ - url: `${baseURL}/${id}`, - method: "get", - }); - }, - // 编辑 - update(data: Object) { - return request({ - url: `${baseURL}`, - method: "put", - data, - }); - }, - // 删除 - deleteByIds(id: number | String) { - return request({ - url: `${baseURL}/${id}`, - method: "delete", - }); - }, - -}; -export interface Responseres { - code?: number | null; - data?: any; - msg?: null | string; - [property: string]: any; -} - -export default AuthAPI; \ No newline at end of file diff --git a/src/views/inventory/paymentRecordconfig/component/AddButton.vue b/src/views/inventory/paymentRecordconfig/component/AddButton.vue deleted file mode 100644 index 7205c9d..0000000 --- a/src/views/inventory/paymentRecordconfig/component/AddButton.vue +++ /dev/null @@ -1,15 +0,0 @@ - - \ No newline at end of file diff --git a/src/views/inventory/paymentRecordconfig/component/Paging.vue b/src/views/inventory/paymentRecordconfig/component/Paging.vue deleted file mode 100644 index ee9b056..0000000 --- a/src/views/inventory/paymentRecordconfig/component/Paging.vue +++ /dev/null @@ -1,24 +0,0 @@ - - \ No newline at end of file diff --git a/src/views/inventory/paymentRecordconfig/component/Table.vue b/src/views/inventory/paymentRecordconfig/component/Table.vue deleted file mode 100644 index fa748e0..0000000 --- a/src/views/inventory/paymentRecordconfig/component/Table.vue +++ /dev/null @@ -1,34 +0,0 @@ - - - diff --git a/src/views/inventory/supplier.vue b/src/views/inventory/supplier.vue deleted file mode 100644 index 90a0056..0000000 --- a/src/views/inventory/supplier.vue +++ /dev/null @@ -1,14 +0,0 @@ - - \ No newline at end of file diff --git a/src/views/inventory/supplier/config/add.ts b/src/views/inventory/supplier/config/add.ts new file mode 100644 index 0000000..0f42129 --- /dev/null +++ b/src/views/inventory/supplier/config/add.ts @@ -0,0 +1,77 @@ +import Api from "@/api/product/vendor"; +import { returnOptions, switchAttr } from "./config"; +import type { IModalConfig } from "@/components/CURD/types"; + +const modalConfig: IModalConfig = { + pageName: "sys:user", + dialog: { + title: "添加供应商", + width: 800, + draggable: true, + }, + form: { + labelWidth: 140, + }, + formAction: function (data) { + return Api.add({ ...data }); + }, + beforeSubmit(data) { + console.log("提交之前处理", data); + }, + formItems: [ + + { + label: "名称", + prop: "name", + rules: [{ required: true, message: "请输入名称", trigger: "blur" }], + attrs: { + placeholder: "请输入名称", + }, + }, + { + label: "联系人名字", + prop: "contactName", + rules: [{ required: false, message: "请输入联系人名字", trigger: "blur" }], + attrs: { + placeholder: "请输入联系人名字", + }, + }, + { + label: "联系人电话", + prop: "telephone", + rules: [{ required: false, message: "请输入联系人名字", trigger: "blur" }], + attrs: { + placeholder: "请输入联系人名字", + }, + }, + { + label: "供应商地址", + prop: "address", + rules: [{ required: false, message: "请输入供应商地址", trigger: "blur" }], + attrs: { + placeholder: "请输入供应商地址", + }, + }, + { + label: "备注", + prop: "remark", + rules: [{ required: false, message: "请输入备注", trigger: "blur" }], + attrs: { + placeholder: "请输入备注", + }, + }, + { + label: "排序", + prop: "sort", + rules: [{ required: true, message: "请输入排序", trigger: "blur" }], + type: "input-number", + attrs: { + placeholder: "请输入排序", + }, + }, + + ], +}; + +// 如果有异步数据会修改配置的,推荐用reactive包裹,而纯静态配置的可以直接导出 +export default reactive(modalConfig); diff --git a/src/views/inventory/supplier/config/config.ts b/src/views/inventory/supplier/config/config.ts new file mode 100644 index 0000000..b788d68 --- /dev/null +++ b/src/views/inventory/supplier/config/config.ts @@ -0,0 +1,48 @@ +export interface options { + label: string; + value: string | number; + [property: string]: any; +} +export interface optionObject { + [property: string]: options[]; +} +const options: optionObject = { + payType: [ + { label: "现金", value: "cash" }, + { label: "微信", value: "weixin" }, + { label: "银行卡", value: "bank" }, + { label: "会员支付", value: "member-account" }, + { label: "支付宝", value: "alipay" }, + { label: "刷卡", value: "deposit" }, + { label: "挂单", value: "arrears" }, + { label: "刷卡", value: "deposit" }, + { label: "储值", value: "member-account" }, + { label: "自定义", value: "virtual" }, + ], + isIdeal: [ + { label: "否", value: 0 }, + { label: "是", value: 1 }, + ] +}; + +export const switchAttr = { + "active-value": 1, + "inactive-value": 0, +} + + +export type optionsType = string; + +export function returnOptions(type: optionsType) { + return options[type]; +} + +export function returnOptionsLabel(optionsType: optionsType, value: string | number) { + const options = returnOptions(optionsType); + if (!options) { + return ""; + } + const option = options.find((item) => item.value === value); + return option ? option.label : ""; +} + diff --git a/src/views/inventory/supplier/config/content.ts b/src/views/inventory/supplier/config/content.ts new file mode 100644 index 0000000..a7549b0 --- /dev/null +++ b/src/views/inventory/supplier/config/content.ts @@ -0,0 +1,79 @@ +import Api from "@/api/product/vendor"; +import type { IContentConfig } from "@/components/CURD/types"; + +const contentConfig: IContentConfig = { + pageName: "sys:user", + table: { + border: true, + highlightCurrentRow: true, + }, + pagination: { + background: true, + layout: "prev,pager,next,jumper,total,sizes", + pageSize: 20, + pageSizes: [10, 20, 30, 50], + }, + indexAction: function (params) { + return Api.getList({}); + }, + deleteAction: function (id) { + return Api.delete(id); + }, + modifyAction: function (data) { + return Api.edit(data); + }, + pk: "id", + toolbar: ["add"], + defaultToolbar: ["refresh", "filter", "search"], + cols: [ + // { type: "selection", width: 50, align: "center" }, + { + label: "供应商", + align: "center", + prop: "name", + }, + { + label: "联系人", + align: "center", + prop: "contactName", + }, + { + label: "联系人电话", + align: "center", + prop: "telephone", + }, + { + label: "地址", + align: "center", + prop: "address", + }, + { + label: "备注", + align: "center", + prop: "remark", + }, + { + label: "创建时间", + align: "center", + prop: "createTime", + }, + { + label: "状态", + align: "center", + prop: "status", + templet: 'custom', + slotName: 'switch' + }, + + { + label: "操作", + align: "center", + fixed: "right", + width: 280, + templet: "tool", + operat: ["edit", 'delete'], + }, + ], +}; + +export default contentConfig; diff --git a/src/views/inventory/supplier/config/edit.ts b/src/views/inventory/supplier/config/edit.ts new file mode 100644 index 0000000..77ec8fd --- /dev/null +++ b/src/views/inventory/supplier/config/edit.ts @@ -0,0 +1,77 @@ +import Api from "@/api/product/vendor"; +import { returnOptions, switchAttr } from "./config"; +import type { IModalConfig } from "@/components/CURD/types"; + +const modalConfig: IModalConfig = { + pageName: "sys:user", + dialog: { + title: "编辑供应商", + width: 800, + draggable: true, + }, + form: { + labelWidth: 140, + }, + formAction: function (data) { + return Api.edit({ ...data }); + }, + beforeSubmit(data) { + console.log("提交之前处理", data); + }, + formItems: [ + + { + label: "名称", + prop: "name", + rules: [{ required: true, message: "请输入名称", trigger: "blur" }], + attrs: { + placeholder: "请输入名称", + }, + }, + { + label: "联系人名字", + prop: "contactName", + rules: [{ required: false, message: "请输入联系人名字", trigger: "blur" }], + attrs: { + placeholder: "请输入联系人名字", + }, + }, + { + label: "联系人电话", + prop: "telephone", + rules: [{ required: false, message: "请输入联系人名字", trigger: "blur" }], + attrs: { + placeholder: "请输入联系人名字", + }, + }, + { + label: "供应商地址", + prop: "address", + rules: [{ required: false, message: "请输入供应商地址", trigger: "blur" }], + attrs: { + placeholder: "请输入供应商地址", + }, + }, + { + label: "备注", + prop: "remark", + rules: [{ required: false, message: "请输入备注", trigger: "blur" }], + attrs: { + placeholder: "请输入备注", + }, + }, + { + label: "排序", + prop: "sort", + rules: [{ required: true, message: "请输入排序", trigger: "blur" }], + type: "input-number", + attrs: { + placeholder: "请输入排序", + }, + }, + + ], +}; + +// 如果有异步数据会修改配置的,推荐用reactive包裹,而纯静态配置的可以直接导出 +export default reactive(modalConfig); diff --git a/src/views/inventory/supplier/config/search.ts b/src/views/inventory/supplier/config/search.ts new file mode 100644 index 0000000..29cbdd9 --- /dev/null +++ b/src/views/inventory/supplier/config/search.ts @@ -0,0 +1,21 @@ +import type { ISearchConfig } from "@/components/CURD/types"; + +const searchConfig: ISearchConfig = { + pageName: "sys:user", + formItems: [ + { + type: "input", + label: "版本号", + prop: "keywords", + attrs: { + placeholder: "请输入版本号", + clearable: true, + style: { + width: "200px", + }, + }, + }, + ], +}; + +export default searchConfig; diff --git a/src/views/inventory/supplier/index.vue b/src/views/inventory/supplier/index.vue new file mode 100644 index 0000000..565a1ea --- /dev/null +++ b/src/views/inventory/supplier/index.vue @@ -0,0 +1,115 @@ + + + diff --git a/src/views/inventory/supplierconfig/Content.vue b/src/views/inventory/supplierconfig/Content.vue deleted file mode 100644 index 481865f..0000000 --- a/src/views/inventory/supplierconfig/Content.vue +++ /dev/null @@ -1,147 +0,0 @@ - - - \ No newline at end of file diff --git a/src/views/inventory/supplierconfig/Search.vue b/src/views/inventory/supplierconfig/Search.vue deleted file mode 100644 index ba031df..0000000 --- a/src/views/inventory/supplierconfig/Search.vue +++ /dev/null @@ -1,52 +0,0 @@ - - - - - diff --git a/src/views/inventory/supplierconfig/api.ts b/src/views/inventory/supplierconfig/api.ts deleted file mode 100644 index 6e9207d..0000000 --- a/src/views/inventory/supplierconfig/api.ts +++ /dev/null @@ -1,60 +0,0 @@ -import request from "@/utils/request"; -const baseURL = "/product/admin/product/vendor"; -// 供应商管理 -const AuthAPI = { - // 列表 - getList(params: any) { - return request({ - url: `${baseURL}/list`, - method: "get", - params, - }); - }, - /** 分页*/ - getPage(params: any) { - return request({ - url: `${baseURL}/page`, - method: "get", - params, - }); - }, - // 新增 - add(data: any) { - return request({ - url: `${baseURL}`, - method: "post", - data: { ...data }, - }); - }, - // 详情 - getinfo(id: number) { - return request({ - url: `${baseURL}/${id}`, - method: "get", - }); - }, - // 编辑 - update(data: Object) { - return request({ - url: `${baseURL}`, - method: "put", - data, - }); - }, - // 删除 - deleteByIds(id: number | String) { - return request({ - url: `${baseURL}/${id}`, - method: "delete", - }); - }, - -}; -export interface Responseres { - code?: number | null; - data?: any; - msg?: null | string; - [property: string]: any; -} - -export default AuthAPI; \ No newline at end of file diff --git a/src/views/inventory/supplierconfig/component/AddButton.vue b/src/views/inventory/supplierconfig/component/AddButton.vue deleted file mode 100644 index 4a9bbc4..0000000 --- a/src/views/inventory/supplierconfig/component/AddButton.vue +++ /dev/null @@ -1,9 +0,0 @@ - - \ No newline at end of file diff --git a/src/views/inventory/supplierconfig/component/Paging.vue b/src/views/inventory/supplierconfig/component/Paging.vue deleted file mode 100644 index ee9b056..0000000 --- a/src/views/inventory/supplierconfig/component/Paging.vue +++ /dev/null @@ -1,24 +0,0 @@ - - \ No newline at end of file diff --git a/src/views/inventory/supplierconfig/component/Table.vue b/src/views/inventory/supplierconfig/component/Table.vue deleted file mode 100644 index 55e14ab..0000000 --- a/src/views/inventory/supplierconfig/component/Table.vue +++ /dev/null @@ -1,48 +0,0 @@ - - - diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 676a293..0e86cc5 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -192,6 +192,7 @@ function handleLogin() { .login(user) .then(async (res) => { await userStore.getUserInfo(); + await $douyin_checkIn(); const { path, queryParams } = parseRedirect(); console.log(res, "Denglv返回"); diff --git a/src/views/shop/list/components/detailModal.vue b/src/views/shop/list/components/detailModal.vue index c7011aa..ef2ee1d 100644 --- a/src/views/shop/list/components/detailModal.vue +++ b/src/views/shop/list/components/detailModal.vue @@ -38,12 +38,12 @@ --> - +