From 22690317b9a327e518c2669abaed530c27d6165b 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, 19 Aug 2024 17:17:41 +0800 Subject: [PATCH 1/2] add --- src/views/modules/product/popup/add-price.vue | 6 +++--- src/views/modules/product/popup/add-specifications.vue | 3 ++- src/views/modules/product/popup/add-stock.vue | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/views/modules/product/popup/add-price.vue b/src/views/modules/product/popup/add-price.vue index 8178a1c..f8802e6 100644 --- a/src/views/modules/product/popup/add-price.vue +++ b/src/views/modules/product/popup/add-price.vue @@ -9,7 +9,7 @@ :modalHandles="modalHandles" > { - if (this.tableData.length == 1) { + if (this.modalData.specType == 0) { this.$api.mer_admin .saveProductBase(this.modalData) .then((res) => { diff --git a/src/views/modules/product/popup/add-specifications.vue b/src/views/modules/product/popup/add-specifications.vue index 15b1c23..45c715a 100644 --- a/src/views/modules/product/popup/add-specifications.vue +++ b/src/views/modules/product/popup/add-specifications.vue @@ -91,7 +91,6 @@ export default { //监控对象数据 tableData: [], //表格属性 - //表格属性 tableProp: { height: "auto", border: true, @@ -399,6 +398,8 @@ export default { disabled: () => this.tableData.length <= 0, // submit: true, handle: () => { + let volume = "" //重量 + let weight = "" //体积 let salePrice = ""; //价格范围 let stockNum = ""; //库存范围 let minSalePrice = Math.min.apply( diff --git a/src/views/modules/product/popup/add-stock.vue b/src/views/modules/product/popup/add-stock.vue index e88c7ae..063216f 100644 --- a/src/views/modules/product/popup/add-stock.vue +++ b/src/views/modules/product/popup/add-stock.vue @@ -9,7 +9,7 @@ :modalHandles="modalHandles" > { - if (this.tableData.length == 1) { + if (this.modalData.specType == 0) { this.$api.mer_admin .saveProductBase(this.modalData) .then((res) => { From 4800553a0f8b2f9a9308321e673165620647071a 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, 20 Aug 2024 18:00:08 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/modules/mer_admin.js | 230 ++++++++++-------- src/views/modules/product/index.vue | 3 +- .../modules/product/popup/add-or-update.vue | 16 +- 3 files changed, 131 insertions(+), 118 deletions(-) diff --git a/src/api/modules/mer_admin.js b/src/api/modules/mer_admin.js index fb683b7..814326f 100644 --- a/src/api/modules/mer_admin.js +++ b/src/api/modules/mer_admin.js @@ -2,108 +2,128 @@ import $http from "@/utils/httpRequest.js"; import city_data from "@/utils/country-level2-data.js"; export const mer_admin = { - /** - * 登录 - * @param {object} params LoginParam - * @param {number} params.type - * @param {string} params.role - * @param {string} params.username - * @param {string} params.password - * @param {string} params.mobile - * @param {string} params.code - * @returns - */ - loginByAccount: (params) => { - return $http.post(`/auth/login`, { - ...params, - type: 1 - }) - }, - loginByMobile: (params) => { - return $http.post(`/merchant-api/auth/sms/login`, { - ...params, - type: 2 - }) - }, - getYZM(mobile) { - return $http.get(`/merchant-api/auth/login/code?mobile=${mobile}`); - }, - getInfo() { - return $http.get(`/merchant-api/auth/info`); - }, - //商品管理 - //保存商品信息 - saveProduct: (data) => { - return $http.post(`/merchant-api/product/save`, data); - }, - //保存商品基本信息 - saveProductBase: (data) => { - return $http.post(`/merchant-api/product/save/basic`, data); - }, - //返回商品分类以及列表(聚合) - getPolyProduct: (data) => { - return $http.post(`/merchant-api/product/polymerization/list`, data); - }, - //商品分页 - getProductPage: (data) => { - return $http.post(`/merchant-api/product/page`, data); - }, - //商户商品分类 - getProductCategory: () => { - return $http.get(`/merchant-api/product/category/list?shopId=${JSON.parse(sessionStorage.getItem('userInfo')).shopId}`); - }, - //获取销售单位 - getSaleUnit: (data) => { - return $http.request({ url: `/merchant-api/product/unit/list`, method: 'get', params: data }); - }, - //文件上传 - uploadFile: () => { - return `${window.SITE_CONFIG['baseUrl']}/merchant-api/file/upload` - }, - //直接获取城市数据 - getCityOptions: () => { - return city_data; - }, - //省市县数据 - getCity: () => { - return $http.get(`/merchant-api/common/pca`); - }, - //添加运费模板 - addShippingTemplate: (data) => { - return $http.post(`/merchant-api/shippingTemplates/add`, data); - }, - //删除模板 - removeShippingTemplate: (id) => { - return $http.post(`/merchant-api/shippingTemplates/delete`, { - id - }) - }, - //更新模板 - updateShippingTemplate: (data) => { - return $http.post(`/merchant-api/shippingTemplates/update`, data); - }, - //获取模板分页 - getShippingTemplatePage: (data) => { - return $http.request({ - method: 'get', - url: '/merchant-api/shippingTemplates/page', - params: data - }) - }, - //获取配送模板列表 - getShippingTemplateList: (data) => { - return $http.request({ - method: 'get', - url: '/merchant-api/shippingTemplates/list', - params: data - }) - }, - //获取模板详情 - getShippingTemplateInfo: (id) => { - return $http.request({ - method: 'get', - url: '/merchant-api/shippingTemplates/list', - params: { id } - }) - } -} \ No newline at end of file + /** + * 登录 + * @param {object} params LoginParam + * @param {number} params.type + * @param {string} params.role + * @param {string} params.username + * @param {string} params.password + * @param {string} params.mobile + * @param {string} params.code + * @returns + */ + loginByAccount: (params) => { + return $http.post(`/auth/login`, { + ...params, + type: 1, + }); + }, + loginByMobile: (params) => { + return $http.post(`/merchant-api/auth/sms/login`, { + ...params, + type: 2, + }); + }, + getYZM(mobile) { + return $http.get(`/merchant-api/auth/login/code?mobile=${mobile}`); + }, + getInfo() { + return $http.get(`/merchant-api/auth/info`); + }, + //商品管理 + //保存商品信息 + saveProduct: (data) => { + return $http.post(`/merchant-api/product/save`, data); + }, + //保存商品基本信息 + saveProductBase: (data) => { + return $http.post(`/merchant-api/product/save/basic`, data); + }, + //返回商品分类以及列表(聚合) + getPolyProduct: (data) => { + return $http.post(`/merchant-api/product/polymerization/list`, data); + }, + //商品分页 + getProductPage: (data) => { + return $http.post(`/merchant-api/product/page`, data); + }, + //商户商品分类 + getProductCategory: () => { + return $http.get( + `/merchant-api/product/category/list?shopId=${ + JSON.parse(sessionStorage.getItem("userInfo")).shopId + }` + ); + }, + //上架或下架 + putOnShelvesProducts: (data) => { + return $http.post(`/merchant-api/product/batch/update/status`, data); + }, + //批量删除商品 + BatchDeleteProducts: (data) => { + return $http.post(`/merchant-api/product/batch/delete`, data); + }, + //打折扣 + setDiscounts: (data) => { + return $http.post(`merchant-api/activity/save`, data); + }, + //获取销售单位 + getSaleUnit: (data) => { + return $http.request({ + url: `/merchant-api/product/unit/list`, + method: "get", + params: data, + }); + }, + //文件上传 + uploadFile: () => { + return `${window.SITE_CONFIG["baseUrl"]}/merchant-api/file/upload`; + }, + //直接获取城市数据 + getCityOptions: () => { + return city_data; + }, + //省市县数据 + getCity: () => { + return $http.get(`/merchant-api/common/pca`); + }, + //添加运费模板 + addShippingTemplate: (data) => { + return $http.post(`/merchant-api/shippingTemplates/add`, data); + }, + //删除模板 + removeShippingTemplate: (id) => { + return $http.post(`/merchant-api/shippingTemplates/delete`, { + id, + }); + }, + //更新模板 + updateShippingTemplate: (data) => { + return $http.post(`/merchant-api/shippingTemplates/update`, data); + }, + //获取模板分页 + getShippingTemplatePage: (data) => { + return $http.request({ + method: "get", + url: "/merchant-api/shippingTemplates/page", + params: data, + }); + }, + //获取配送模板列表 + getShippingTemplateList: (data) => { + return $http.request({ + method: "get", + url: "/merchant-api/shippingTemplates/list", + params: data, + }); + }, + //获取模板详情 + getShippingTemplateInfo: (id) => { + return $http.request({ + method: "get", + url: "/merchant-api/shippingTemplates/list", + params: { id }, + }); + }, +}; diff --git a/src/views/modules/product/index.vue b/src/views/modules/product/index.vue index 6d1af91..195ff10 100644 --- a/src/views/modules/product/index.vue +++ b/src/views/modules/product/index.vue @@ -29,7 +29,6 @@ placeholder="商品搜索" > - 查询 { + console.log("111"); this.$api.mer_admin.BatchDeleteProducts(integers).then((res) => { this.$refs.oTable.reload(); }); diff --git a/src/views/modules/product/popup/add-or-update.vue b/src/views/modules/product/popup/add-or-update.vue index f8fa261..7bc1cac 100644 --- a/src/views/modules/product/popup/add-or-update.vue +++ b/src/views/modules/product/popup/add-or-update.vue @@ -187,16 +187,7 @@ export default { productIntroducePhoto: "", productPhotoList: [], productPlace: "", - productSpecificationList: [ - { - attributeValue: "默认", - costPrice: 20, - salePrice: 30, - stockNum: 10, - weight: 1, - volume: 0.3, - }, - ], + productSpecificationList: [], productUnit: "", productVideo: "", shelfLife: "", @@ -657,9 +648,10 @@ export default { v-model={this.place} onChange={change} options={this.$api.mer_admin.getCityOptions()} - {...{ + props={{ props: { - checkStrictly: true, + label: "name", + value: "name", }, }} clearable