From 066eb8004e608277fe411fc46b07785b6698188f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=99=E5=90=8C=E5=AD=A6?= <2495967527@qq.com> Date: Sun, 17 Nov 2024 18:00:35 +0800 Subject: [PATCH 01/22] =?UTF-8?q?=E5=95=86=E5=93=81=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/modules/mer_admin.js | 20 ++++-- src/views/modules/bank-card/index.vue | 2 +- src/views/modules/product/index.vue | 50 +++++++++++--- .../modules/product/popup/add-or-update.vue | 67 ++++++++++++------- .../product/popup/add-specifications.vue | 21 ++++++ 5 files changed, 121 insertions(+), 39 deletions(-) diff --git a/src/api/modules/mer_admin.js b/src/api/modules/mer_admin.js index ad3bcd0..74ff7d7 100644 --- a/src/api/modules/mer_admin.js +++ b/src/api/modules/mer_admin.js @@ -49,12 +49,12 @@ export const mer_admin = { return $http.post(`/merchant-api/product/page`, data); }, //商户商品分类 - getProductCategory: () => { - return $http.get( - `/merchant-api/product/category/list?shopId=${ - JSON.parse(sessionStorage.getItem("userInfo")).shopId - }` - ); + getProductCategory: (data) => { + return $http.request({ + url: `/merchant-api/product/category/list`, + method: "get", + params: data, + }); }, //上架或下架 putOnShelvesProducts: (data) => { @@ -154,6 +154,14 @@ export const mer_admin = { params: { id }, }); }, + //市场下的店铺列表 + storeList: (data) => { + return $http.request({ + method: "get", + url: `/merchant-api/market/shop_list`, + params: data, + }); + }, //获取品牌信息 getBrandInfo: () => { return $http.request({ diff --git a/src/views/modules/bank-card/index.vue b/src/views/modules/bank-card/index.vue index cb8fa67..80471d5 100644 --- a/src/views/modules/bank-card/index.vue +++ b/src/views/modules/bank-card/index.vue @@ -133,7 +133,7 @@ export default { { title: "银行卡号", align: "center", - field: "cardId", + field: "cardNo", }, { title: "手机号", diff --git a/src/views/modules/product/index.vue b/src/views/modules/product/index.vue index 1bb5a99..f143f17 100644 --- a/src/views/modules/product/index.vue +++ b/src/views/modules/product/index.vue @@ -1,6 +1,6 @@ From e2451fb08720ee67cde684617191e98c1c1f30f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=99=E5=90=8C=E5=AD=A6?= <2495967527@qq.com> Date: Mon, 2 Dec 2024 18:16:01 +0800 Subject: [PATCH 09/22] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A2=84=E5=94=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/modules/pre-sale.js | 9 +- src/views/modules/presale/products/index.vue | 141 ++++++-- .../presale/products/popup/add-or-update.vue | 316 ++++++++++++------ 3 files changed, 340 insertions(+), 126 deletions(-) diff --git a/src/api/modules/pre-sale.js b/src/api/modules/pre-sale.js index df78d69..5886788 100644 --- a/src/api/modules/pre-sale.js +++ b/src/api/modules/pre-sale.js @@ -1,7 +1,7 @@ import $http from "@/utils/httpRequest.js"; export const preSale = { - //优惠券列表 + //预售商品列表 preSaleProducts: (data) => { return $http.request({ url: `/merchant-api/product/advance/sell/page`, @@ -9,4 +9,11 @@ export const preSale = { data, }); }, + addPreSaleProducts: (data) => { + return $http.request({ + url: `/merchant-api/product/batch/save/advance/sell`, + method: "post", + data, + }); + }, }; diff --git a/src/views/modules/presale/products/index.vue b/src/views/modules/presale/products/index.vue index 2f6a350..ea73249 100644 --- a/src/views/modules/presale/products/index.vue +++ b/src/views/modules/presale/products/index.vue @@ -130,6 +130,7 @@ export default { data() { return { activeName: "5", + advanceSellStatus: "", dataList: [], formInline: { name: "", @@ -237,7 +238,7 @@ export default { pageNumber: pageNo, pageSize: pageSize, ...this.formInline, - advanceSellStatus: this.activeName, + advanceSellStatus: this.advanceSellStatus, merchantId: JSON.parse(sessionStorage.getItem("userInfo")).merchantId, productQuerySortParam: [], }) @@ -261,6 +262,12 @@ export default { this.$refs.oTable.reload(); }, handleClick(e) { + console.log(e.name); + if (e.name == "5") { + this.advanceSellStatus = ""; + } else { + this.advanceSellStatus = e.name; + } this.$refs.oTable.reload(); }, addEarlyWarning() { @@ -275,7 +282,7 @@ export default { { title: "商品ID", align: "center", - field: "name", + field: "id", }, { title: "商品图", @@ -301,7 +308,15 @@ export default { { title: "定金支付时间", align: "center", - field: "name", + field: "startTime", + type: "jsx", + render: ({ row }) => { + return ( + + {row.startTime}至{row.endTime} + + ); + }, }, { title: "尾款支付时间", @@ -309,15 +324,11 @@ export default { field: "minSalePrice", type: "jsx", render: ({ row }) => { - if (row.minSalePrice == row.maxSalePrice) { - return ¥{row.minSalePrice}; - } else { - return ( - - ¥{row.minSalePrice}~¥{row.maxSalePrice} - - ); - } + return ( + + {row.balancePaymentStartTime}至{row.balancePaymentEndTime} + + ); }, }, { @@ -334,12 +345,96 @@ export default { { title: "定金", align: "center", - field: "saleNum", + field: "earnestMoney", + type: "jsx", + render: ({ row }) => { + if ( + Math.min.apply( + Math, + row.productSpecificationList.map((item) => item.earnestMoney) + ) == + Math.max.apply( + Math, + row.productSpecificationList.map((item) => item.earnestMoney) + ) + ) { + return ( + + {Math.min.apply( + Math, + row.productSpecificationList.map( + (item) => item.earnestMoney + ) + )} + + ); + } else { + return ( + + {Math.min.apply( + Math, + row.productSpecificationList.map( + (item) => item.earnestMoney + ) + )} + 至 + {Math.max.apply( + Math, + row.productSpecificationList.map( + (item) => item.earnestMoney + ) + )} + + ); + } + }, }, { title: "尾款", align: "center", - field: "stockNum", + field: "balancePayment", + type: "jsx", + render: ({ row }) => { + if ( + Math.min.apply( + Math, + row.productSpecificationList.map((item) => item.balancePayment) + ) == + Math.max.apply( + Math, + row.productSpecificationList.map((item) => item.balancePayment) + ) + ) { + return ( + + {Math.min.apply( + Math, + row.productSpecificationList.map( + (item) => item.balancePayment + ) + )} + + ); + } else { + return ( + + {Math.min.apply( + Math, + row.productSpecificationList.map( + (item) => item.balancePayment + ) + )} + 至 + {Math.max.apply( + Math, + row.productSpecificationList.map( + (item) => item.balancePayment + ) + )} + + ); + } + }, }, { title: "状态", @@ -347,10 +442,14 @@ export default { field: "status", type: "jsx", render: ({ row }) => { - if (row.status == "DOWN") { + if (row.advanceSellStatus == "0") { return 未开始; - } else { - return 上架; + } else if (row.advanceSellStatus == "1") { + return 进行中; + } else if (row.advanceSellStatus == "2") { + return 已结束; + } else if (row.advanceSellStatus == "3") { + return 已关闭; } }, }, @@ -363,7 +462,6 @@ export default { render: ({ row }) => { let edit = () => { console.log(row); - this.$refs.addOrUpdate.toggle(row).update(); }; let priceAdjustment = () => { @@ -386,12 +484,7 @@ export default { > 查看 - + 编辑 diff --git a/src/views/modules/presale/products/popup/add-or-update.vue b/src/views/modules/presale/products/popup/add-or-update.vue index 580e99b..c1c036a 100644 --- a/src/views/modules/presale/products/popup/add-or-update.vue +++ b/src/views/modules/presale/products/popup/add-or-update.vue @@ -17,42 +17,66 @@ > - + - + - + - - + + 选择是,用户可在付尾款前申请退定金(申请后自动退,无需审核),或付尾款时间结束后系统自动退定金 @@ -68,87 +92,120 @@ 已选择商品
-
-
- 商品ID:{{item.id}} - 商品名称:{{item.name}} -
- - - - - - - - - - - - - - - - - - - - - - - - - - +
+
+ 商品ID:{{ item.productId }} + 商品名称:{{ item.name }}
- + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
@@ -183,10 +240,13 @@ export default { }, modalData: {}, ruleForm: { - name: "", - value: "1", - radio: "1", productList: [], + isRefundEarnestMoney: 1, //定金可退 1是 2否 + }, + pickerOptions: { + disabledDate(time) { + return time.getTime() < Date.now(); + }, }, orderTime: [], //订单支付时间 arrears: [], //尾款时间 @@ -235,10 +295,17 @@ export default { this.modalConfig.show = false; } if (e) { - this.init(cloneDeep(e.row)); + this.init(cloneDeep(e)); } return { - add: (data) => { + add: () => { + this.orderTime = []; + this.arrears = []; + this.delivery = []; + this.ruleForm = { + productList: [], + isRefundEarnestMoney: 1, //定金可退 1是 2否 + }; this.modalConfig.title = "新增预售"; this.isAdd = true; }, @@ -249,16 +316,52 @@ export default { }; }, init(row) { - this.modalData = row; + console.log(row.startTime, row.endTime); + this.orderTime = [row.startTime, row.endTime]; + this.arrears = [row.balancePaymentStartTime, row.balancePaymentEndTime]; + this.delivery = []; + this.ruleForm.productList = [ + { + productId: row.id, + name: row.name, + productSpecificationList: row.productSpecificationList, + }, + ]; + console.log(this.orderTime, this.arrears, this.delivery); + + // this.ruleForm = row; }, //订单支付时间 getOrderTime(e) { if (e) { - ruleForm.startTime = e[0]; - ruleForm.endTime = e[1]; + console.log(e); + this.ruleForm.startTime = e[0]; + this.ruleForm.endTime = e[1]; } else { - ruleForm.startTime = ""; - ruleForm.endTime = ""; + this.ruleForm.startTime = ""; + this.ruleForm.endTime = ""; + } + }, + //尾款支付时间 + getArrearsTime(e) { + if (e) { + console.log(e); + this.ruleForm.balancePaymentStartTime = e[0]; + this.ruleForm.balancePaymentEndTime = e[1]; + } else { + this.ruleForm.balancePaymentStartTime = ""; + this.ruleForm.balancePaymentEndTime = ""; + } + }, + //发货时间 + deliveryTime(e) { + if (e) { + console.log(e); + this.ruleForm.estimatedStartDeliveryTime = e[0]; + this.ruleForm.estimatedEndDeliveryTime = e[1]; + } else { + this.ruleForm.estimatedStartDeliveryTime = ""; + this.ruleForm.estimatedEndDeliveryTime = ""; } }, selectProduct() { @@ -274,7 +377,13 @@ export default { console.log(e); }, getProduct(row) { - this.ruleForm.productList = row; + this.ruleForm.productList = row.map((item) => { + return { + productId: item.id, + name: item.name, + productSpecificationList: item.productSpecificationList, + }; + }); console.log(this.ruleForm.productList, this.ruleForm.productList.length); console.log("获取商品"); @@ -294,12 +403,17 @@ export default { type: "primary", // submit: true, handle: () => { - this.$refs.ruleForm.validate((valid) => { - if (valid) { - this.$emit("getAttribute", this.ruleForm); - this.toggle(); - } + this.$api.preSale.addPreSaleProducts(this.ruleForm).then((res) => { + console.log("确认", res); + // this.toggle(); }); + // console.log("确认", this.ruleForm); + // this.$refs.ruleForm.validate((valid) => { + // if (valid) { + // this.$emit("getAttribute", this.ruleForm); + // this.toggle(); + // } + // }); }, }, ]; From 5477a783a80e15062abd7b4d59e29d0da586eaf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=99=E5=90=8C=E5=AD=A6?= <2495967527@qq.com> Date: Tue, 3 Dec 2024 18:47:55 +0800 Subject: [PATCH 10/22] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/full-routers.js | 119 ++++---- .../datacenter/customer-analysis/index.vue | 237 +++++++++++++++ .../datacenter/order-analysis/index.vue | 285 ++++++++++++++++++ .../datacenter/product-analysis/index.vue | 242 +++++++++++++++ src/views/modules/presale/products/index.vue | 44 ++- .../presale/products/popup/add-or-update.vue | 6 +- 6 files changed, 860 insertions(+), 73 deletions(-) create mode 100644 src/views/modules/datacenter/customer-analysis/index.vue create mode 100644 src/views/modules/datacenter/order-analysis/index.vue create mode 100644 src/views/modules/datacenter/product-analysis/index.vue diff --git a/src/router/full-routers.js b/src/router/full-routers.js index d6adfa3..d2603f3 100644 --- a/src/router/full-routers.js +++ b/src/router/full-routers.js @@ -173,72 +173,59 @@ export default { }, ], }, - // { - // "menuId": getUUID(), - // "parentId": 0, - // "parentName": null, - // "name": "教务管理", - // "url": "local-affairs", - // "perms": "", - // "type": 0, - // "elIcon": "el-icon-office-building", - // "orderNum": 0, - // "open": null, - // list: [ - // { - // "menuId": getUUID(), - // "parentId": 2, - // "parentName": null, - // "name": "年级管理", - // "url": "local-affairs/grade", - // "perms": "", - // "type": 1, - // "icon": "log", - // "orderNum": 0, - // "open": null, - // "list": [] - // }, - // { - // "menuId": getUUID(), - // "parentId": 2, - // "parentName": null, - // "name": "班级管理", - // "url": "local-affairs/class", - // "perms": "", - // "type": 1, - // "icon": "log", - // "orderNum": 0, - // "open": null, - // "list": [] - // }, - // { - // "menuId": getUUID(), - // "parentId": 2, - // "parentName": null, - // "name": "教师管理", - // "url": "local-teacher/teacher", - // "perms": "", - // "type": 1, - // "icon": "log", - // "orderNum": 0, - // "open": null, - // "list": [] - // }, - // { - // "menuId": getUUID(), - // "parentId": 0, - // "parentName": null, - // "name": "学校管理", - // "url": "local-school/school", - // "perms": "", - // "type": 1, - // "elIcon": "el-icon-school", - // "orderNum": 0, - // "open": null, - // list: [] - // }, - // ] - // }, + { + menuId: getUUID(), + parentId: 0, + parentName: null, + name: "数据中心", + url: "", + perms: "", + type: 0, + elIcon: "el-icon-tickets", + orderNum: 0, + open: null, + list: [ + { + menuId: getUUID(), + parentId: 0, + parentName: null, + name: "客户分析", + url: "datacenter/customer-analysis/index", + perms: "", + type: 1, + elIcon: "el-icon-user", + orderNum: 0, + open: null, + list: [], + }, + { + menuId: getUUID(), + parentId: 0, + parentName: null, + name: "商品分析", + url: "datacenter/product-analysis/index", + perms: "", + type: 1, + elIcon: "el-icon-data-analysis", + orderNum: 0, + open: null, + list: [], + }, + { + menuId: getUUID(), + parentId: 0, + parentName: null, + name: "订单统计分析", + url: "datacenter/order-analysis/index", + perms: "", + type: 1, + elIcon: "el-icon-shopping-cart-full", + orderNum: 0, + open: null, + list: [], + }, + ], + }, ], code: 0, permissions: [], diff --git a/src/views/modules/datacenter/customer-analysis/index.vue b/src/views/modules/datacenter/customer-analysis/index.vue new file mode 100644 index 0000000..7a20056 --- /dev/null +++ b/src/views/modules/datacenter/customer-analysis/index.vue @@ -0,0 +1,237 @@ + + + + + \ No newline at end of file diff --git a/src/views/modules/datacenter/order-analysis/index.vue b/src/views/modules/datacenter/order-analysis/index.vue new file mode 100644 index 0000000..08d4d97 --- /dev/null +++ b/src/views/modules/datacenter/order-analysis/index.vue @@ -0,0 +1,285 @@ + + + + + \ No newline at end of file diff --git a/src/views/modules/datacenter/product-analysis/index.vue b/src/views/modules/datacenter/product-analysis/index.vue new file mode 100644 index 0000000..6279d4c --- /dev/null +++ b/src/views/modules/datacenter/product-analysis/index.vue @@ -0,0 +1,242 @@ + + + + + \ No newline at end of file diff --git a/src/views/modules/presale/products/index.vue b/src/views/modules/presale/products/index.vue index ea73249..932c183 100644 --- a/src/views/modules/presale/products/index.vue +++ b/src/views/modules/presale/products/index.vue @@ -334,11 +334,47 @@ export default { { title: "预售价", align: "center", - field: "discountActivity", + field: "presalePrice", type: "jsx", - render: ({ row }) => { - if (row.discountActivity) { - return {row.discountActivity.ruleObject.discount}折; + render: ({ row }) => { + if ( + Math.min.apply( + Math, + row.productSpecificationList.map((item) => item.presalePrice) + ) == + Math.max.apply( + Math, + row.productSpecificationList.map((item) => item.presalePrice) + ) + ) { + return ( + + {Math.min.apply( + Math, + row.productSpecificationList.map( + (item) => item.presalePrice + ) + )} + + ); + } else { + return ( + + {Math.min.apply( + Math, + row.productSpecificationList.map( + (item) => item.presalePrice + ) + )} + 至 + {Math.max.apply( + Math, + row.productSpecificationList.map( + (item) => item.presalePrice + ) + )} + + ); } }, }, diff --git a/src/views/modules/presale/products/popup/add-or-update.vue b/src/views/modules/presale/products/popup/add-or-update.vue index c1c036a..ace4b01 100644 --- a/src/views/modules/presale/products/popup/add-or-update.vue +++ b/src/views/modules/presale/products/popup/add-or-update.vue @@ -20,8 +20,8 @@ Date: Wed, 4 Dec 2024 19:08:06 +0800 Subject: [PATCH 11/22] =?UTF-8?q?=E4=BC=9A=E5=91=98=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/modules/marketing.js | 18 + src/api/modules/pre-sale.js | 7 + src/router/full-routers.js | 79 +++ src/views/modules/marketing/level/index.vue | 166 ++++++ .../modules/marketing/points-mall/index.vue | 15 + .../modules/marketing/points-order/index.vue | 15 + .../marketing/points-setting/index.vue | 15 + src/views/modules/marketing/user/index.vue | 322 +++++++++++ src/views/modules/presale/products/index.vue | 23 +- .../presale/products/popup/add-or-update.vue | 501 ++++++++++++------ .../presale/products/popup/commodity.vue | 233 ++++---- 11 files changed, 1105 insertions(+), 289 deletions(-) create mode 100644 src/api/modules/marketing.js create mode 100644 src/views/modules/marketing/level/index.vue create mode 100644 src/views/modules/marketing/points-mall/index.vue create mode 100644 src/views/modules/marketing/points-order/index.vue create mode 100644 src/views/modules/marketing/points-setting/index.vue create mode 100644 src/views/modules/marketing/user/index.vue diff --git a/src/api/modules/marketing.js b/src/api/modules/marketing.js new file mode 100644 index 0000000..a28e6f5 --- /dev/null +++ b/src/api/modules/marketing.js @@ -0,0 +1,18 @@ +import $http from "@/utils/httpRequest.js"; + +export const marketing = { + marketingLevelPage: (data) => { + return $http.request({ + url: `/merchant-api/memberUnitMemberLevel/list`, + method: "post", + data, + }); + }, + marketingUserPage: (data) => { + return $http.request({ + url: `/merchant-api/memberUnitUser/page`, + method: "get", + params: data, + }); + }, +}; diff --git a/src/api/modules/pre-sale.js b/src/api/modules/pre-sale.js index 5886788..2e86144 100644 --- a/src/api/modules/pre-sale.js +++ b/src/api/modules/pre-sale.js @@ -16,4 +16,11 @@ export const preSale = { data, }); }, + updatePreSaleProducts: (data) => { + return $http.request({ + url: `/merchant-api/product/save/advance/sell`, + method: "post", + data, + }); + }, }; diff --git a/src/router/full-routers.js b/src/router/full-routers.js index d2603f3..6e48791 100644 --- a/src/router/full-routers.js +++ b/src/router/full-routers.js @@ -226,6 +226,85 @@ export default { }, ], }, + { + menuId: getUUID(), + parentId: 0, + parentName: null, + name: "营销管理", + url: "", + perms: "", + type: 0, + elIcon: "el-icon-tickets", + orderNum: 0, + open: null, + list: [ + { + menuId: getUUID(), + parentId: 0, + parentName: null, + name: "会员等级管理", + url: "marketing/level/index", + perms: "", + type: 1, + elIcon: "el-icon-user", + orderNum: 0, + open: null, + list: [], + }, + { + menuId: getUUID(), + parentId: 0, + parentName: null, + name: "用户管理", + url: "marketing/user/index", + perms: "", + type: 1, + elIcon: "el-icon-data-analysis", + orderNum: 0, + open: null, + list: [], + }, + { + menuId: getUUID(), + parentId: 0, + parentName: null, + name: "积分设置", + url: "marketing/points-setting/index", + perms: "", + type: 1, + elIcon: "el-icon-shopping-cart-full", + orderNum: 0, + open: null, + list: [], + }, + { + menuId: getUUID(), + parentId: 0, + parentName: null, + name: "积分商城", + url: "marketing/points-mall/index", + perms: "", + type: 1, + elIcon: "el-icon-shopping-cart-full", + orderNum: 0, + open: null, + list: [], + }, + { + menuId: getUUID(), + parentId: 0, + parentName: null, + name: "积分订单", + url: "marketing/points-order/index", + perms: "", + type: 1, + elIcon: "el-icon-shopping-cart-full", + orderNum: 0, + open: null, + list: [], + }, + ], + }, ], code: 0, permissions: [], diff --git a/src/views/modules/marketing/level/index.vue b/src/views/modules/marketing/level/index.vue new file mode 100644 index 0000000..e2e650f --- /dev/null +++ b/src/views/modules/marketing/level/index.vue @@ -0,0 +1,166 @@ + + + + + \ No newline at end of file diff --git a/src/views/modules/marketing/points-mall/index.vue b/src/views/modules/marketing/points-mall/index.vue new file mode 100644 index 0000000..4f13553 --- /dev/null +++ b/src/views/modules/marketing/points-mall/index.vue @@ -0,0 +1,15 @@ + + + + + \ No newline at end of file diff --git a/src/views/modules/marketing/points-order/index.vue b/src/views/modules/marketing/points-order/index.vue new file mode 100644 index 0000000..6a41ab5 --- /dev/null +++ b/src/views/modules/marketing/points-order/index.vue @@ -0,0 +1,15 @@ + + + + + \ No newline at end of file diff --git a/src/views/modules/marketing/points-setting/index.vue b/src/views/modules/marketing/points-setting/index.vue new file mode 100644 index 0000000..df61af2 --- /dev/null +++ b/src/views/modules/marketing/points-setting/index.vue @@ -0,0 +1,15 @@ + + + + + \ No newline at end of file diff --git a/src/views/modules/marketing/user/index.vue b/src/views/modules/marketing/user/index.vue new file mode 100644 index 0000000..2ff124e --- /dev/null +++ b/src/views/modules/marketing/user/index.vue @@ -0,0 +1,322 @@ + + + + + \ No newline at end of file diff --git a/src/views/modules/presale/products/index.vue b/src/views/modules/presale/products/index.vue index 932c183..3d8fae9 100644 --- a/src/views/modules/presale/products/index.vue +++ b/src/views/modules/presale/products/index.vue @@ -336,7 +336,7 @@ export default { align: "center", field: "presalePrice", type: "jsx", - render: ({ row }) => { + render: ({ row }) => { if ( Math.min.apply( Math, @@ -512,29 +512,32 @@ export default { }; return (
- + 查看 - + 编辑 关闭 diff --git a/src/views/modules/presale/products/popup/add-or-update.vue b/src/views/modules/presale/products/popup/add-or-update.vue index ace4b01..392305a 100644 --- a/src/views/modules/presale/products/popup/add-or-update.vue +++ b/src/views/modules/presale/products/popup/add-or-update.vue @@ -70,7 +70,7 @@ > - + @@ -81,132 +81,255 @@ 选择是,用户可在付尾款前申请退定金(申请后自动退,无需审核),或付尾款时间结束后系统自动退定金 - + 点击请选择商品 备注:一次最多添加五个商品 - -
- 已选择商品 -
-
-
-
- 商品ID:{{ item.productId }} - 商品名称:{{ item.name }} -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - + +
+ 已选择商品
- -
+
+
+
+ 商品ID:{{ item.productId }} + 商品名称:{{ item.name }} +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ 商品ID:{{ ruleForm.productId }} + 商品名称:{{ ruleForm.name }} +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
@@ -251,41 +374,56 @@ export default { orderTime: [], //订单支付时间 arrears: [], //尾款时间 delivery: [], //发货时间 - tableData: [ - { - date: "2016-05-03", - name: "王小虎", - address: "红", - isShow: false, - presalePrice: "", - }, - { - date: "2016-05-02", - name: "王小虎", - address: "弄", - isShow: false, - presalePrice: "", - }, - { - date: "2016-05-04", - name: "王小虎", - address: "8 弄", - isShow: true, - presalePrice: "", - }, - ], + tableData: [], rules: { - name: [{ required: true, message: "请输入属性名称", trigger: "blur" }], - value: [ + startTime: [ { required: true, - message: "请输入属性内容", - trigger: "blur", + message: "请选择支付时间", + trigger: ["blur", "change"], + }, + ], + balancePaymentStartTime: [ + { + required: true, + message: "请选择尾款支付时间", + trigger: "change", + }, + ], + estimatedStartDeliveryTime: [ + { + required: true, + message: "请选择预计发货时间", + trigger: "change", + }, + ], + isRefundEarnestMoney: [ + { + required: true, + message: "请选择定金可退", + trigger: "change", + }, + ], + presalePrice: [ + { + required: true, + message: "请输入预售价格", + trigger: ["blur", "change"], }, ], }, }; }, + watch: { + "modalConfig.show"(newVal) { + if (newVal) { + //关闭弹窗清空校验 + setTimeout(() => { + this.$refs.ruleForm.resetFields(); + }); + } + }, + }, methods: { queryTableData(pageNo, pageSize) {}, toggle(e) { @@ -303,6 +441,12 @@ export default { this.arrears = []; this.delivery = []; this.ruleForm = { + startTime: "", + endTime: "", + balancePaymentStartTime: "", + balancePaymentEndTime: "", + estimatedStartDeliveryTime: "", + estimatedEndDeliveryTime: "", productList: [], isRefundEarnestMoney: 1, //定金可退 1是 2否 }; @@ -319,15 +463,24 @@ export default { console.log(row.startTime, row.endTime); this.orderTime = [row.startTime, row.endTime]; this.arrears = [row.balancePaymentStartTime, row.balancePaymentEndTime]; - this.delivery = [row.estimatedStartDeliveryTime, row.estimatedEndDeliveryTime]; - this.ruleForm.productList = [ - { - productId: row.id, - name: row.name, - productSpecificationList: row.productSpecificationList, - }, + this.delivery = [ + row.estimatedStartDeliveryTime, + row.estimatedEndDeliveryTime, ]; - console.log(this.orderTime, this.arrears, this.delivery); + (this.ruleForm = { + productId: row.id, + advanceSellId: row.advanceSellId, + startTime: row.startTime, + name: row.name, + endTime: row.endTime, + balancePaymentStartTime: row.balancePaymentStartTime, + balancePaymentEndTime: row.balancePaymentEndTime, + estimatedStartDeliveryTime: row.estimatedStartDeliveryTime, + estimatedEndDeliveryTime: row.estimatedEndDeliveryTime, + isRefundEarnestMoney: row.isRefundEarnestMoney, + productSpecificationList: row.productSpecificationList, + }), + console.log(this.orderTime, this.arrears, this.delivery); // this.ruleForm = row; }, @@ -403,17 +556,31 @@ export default { type: "primary", // submit: true, handle: () => { - this.$api.preSale.addPreSaleProducts(this.ruleForm).then((res) => { - console.log("确认", res); - // this.toggle(); - }); - // console.log("确认", this.ruleForm); - // this.$refs.ruleForm.validate((valid) => { - // if (valid) { - // this.$emit("getAttribute", this.ruleForm); - // this.toggle(); - // } - // }); + if (this.isAdd) { + this.$refs.ruleForm.validate((valid) => { + if (valid) { + console.log(valid); + this.$api.preSale + .addPreSaleProducts(this.ruleForm) + .then((res) => { + this.$emit("queryList"); + this.toggle(); + }); + } + }); + } else { + this.$refs.ruleForm.validate((valid) => { + if (valid) { + console.log(valid); + this.$api.preSale + .updatePreSaleProducts(this.ruleForm) + .then((res) => { + this.$emit("queryList"); + this.toggle(); + }); + } + }); + } }, }, ]; diff --git a/src/views/modules/presale/products/popup/commodity.vue b/src/views/modules/presale/products/popup/commodity.vue index 616787f..f7d4012 100644 --- a/src/views/modules/presale/products/popup/commodity.vue +++ b/src/views/modules/presale/products/popup/commodity.vue @@ -7,32 +7,59 @@ :modalHandles="modalHandles" > @@ -49,15 +76,13 @@ export default { show: false, width: "1000px", }, + query: { + pageNumber: 1, + pageSize: 10, + }, + total: 0, modalData: {}, dataList: [], //表格数据 - tableProp: { - "auto-resize": true, - border: true, - height: "auto", - "row-id": "id", - "show-overflow": false, - }, selectList: [], formInline: {}, formList: { @@ -66,27 +91,26 @@ export default { }; }, methods: { - queryList(pageNo, pageSize) { + queryList() { this.$api.mer_admin .getProductPage({ p: { - pageNumber: pageNo, - pageSize: pageSize, + pageNumber: this.query.pageNumber, + pageSize: this.query.pageSize, }, ...this.formInline, + ...this.formList, productFilterType: "SALE", merchantId: JSON.parse(sessionStorage.getItem("userInfo")).merchantId, productQuerySortParam: [], }) .then((res) => { console.log(res); - this.$refs.oTable.complete( - res.data.data.data, - Number(res.data.data.total) - ); + this.dataList = res.data.data.data; + this.total = Number(res.data.data.total); }) .catch((err) => { - this.$refs.oTable.complete(false); + this.dataList = []; }); }, toggle(e) { @@ -104,7 +128,7 @@ export default { this.formInline = row; this.isAdd = true; this.$nextTick(() => { - this.$refs.oTable.reload(); + this.queryList(); }); }, update: () => { @@ -113,77 +137,54 @@ export default { }; }, init(row) {}, + toggleSelection(rows) { + if (rows) { + rows.forEach((row) => { + this.$refs.multipleTable.toggleRowSelection(row); + }); + } else { + this.$refs.multipleTable.clearSelection(); + } + }, + select(selection, row) { + if (selection.length > 5) { + this.$message.error("最多选择5个商品"); + this.$refs.multipleTable.toggleRowSelection(row, false); + } else { + this.selectList = selection; + } + }, + selectAll(selection) { + if (selection.length > 5) { + this.$message.error("最多选择5个商品"); + selection.length = 5; + this.selectList = selection; + console.log(selection); + } else { + this.selectList = selection; + } + }, + getSalePrice(row) { + if (row.minSalePrice == row.maxSalePrice) { + return row.minSalePrice; + } else { + return `${row.minSalePrice}~${row.maxSalePrice}`; + } + }, + handleSizeChange(val) { + this.query.pageSize = val; + this.getList(); + }, + handleCurrentChange(val) { + this.query.pageNumber = val; + this.getList(); + }, + Reset() { + this.formList = {}; + this.queryList(); + }, }, computed: { - tableCols() { - return [ - { type: "checkbox", width: "60px", fixed: "left" }, - { - title: "商品图", - field: "productPhotoList", - align: "center", - width: "100px", - type: "jsx", - render: ({ row }) => { - if (row.productPhotoList.length > 0) { - return ( - { - return item.url; - })} - src={row.productPhotoList[0].url} - > - ); - } else { - return 暂无商品图; - } - }, - }, - { - title: "商品名称", - align: "center", - field: "name", - }, - { - title: "商品售价", - align: "center", - field: "minSalePrice", - type: "jsx", - render: ({ row }) => { - if (row.minSalePrice == row.maxSalePrice) { - return ¥{row.minSalePrice}; - } else { - return ( - - ¥{row.minSalePrice}~¥{row.maxSalePrice} - - ); - } - }, - }, - { - title: "折扣", - align: "center", - field: "discountActivity", - type: "jsx", - render: ({ row }) => { - if (row.discountActivity) { - return {row.discountActivity.ruleObject.discount}折; - } - }, - }, - { - title: "销量", - align: "center", - field: "saleNum", - }, - { - title: "库存", - align: "center", - field: "stockNum", - }, - ]; - }, modalHandles() { return [ { @@ -205,10 +206,15 @@ export default { tableEvent() { return { "checkbox-all": ({ records, reserves }) => { + console.log(records, reserves); this.selectList = [...records, ...reserves]; }, "checkbox-change": ({ records, reserves }) => { - console.log(this.selectList, "2"); + console.log(records, reserves); + if (records.length > 5) { + this.$message.error("最多选择5个商品"); + return; + } this.selectList = [...records, ...reserves]; }, }; @@ -217,5 +223,8 @@ export default { }; - \ No newline at end of file From b168ef73b27d1f0a39c6c3c5341af626639a1f81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=99=E5=90=8C=E5=AD=A6?= <2495967527@qq.com> Date: Thu, 5 Dec 2024 11:36:00 +0800 Subject: [PATCH 12/22] =?UTF-8?q?=E5=95=86=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/coupon/index.vue | 8 ++++---- .../modules/logistics-fare/logistics-template/index.vue | 2 +- src/views/modules/presale/products/index.vue | 2 +- src/views/modules/product/index.vue | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/views/modules/coupon/index.vue b/src/views/modules/coupon/index.vue index 4ac5f09..e87e1a7 100644 --- a/src/views/modules/coupon/index.vue +++ b/src/views/modules/coupon/index.vue @@ -11,8 +11,8 @@ :enableAutoQuery="false" >