Compare commits

..

3 Commits

Author SHA1 Message Date
余同学 4800553a0f 同步接口 2024-08-20 18:00:08 +08:00
余同学 29a1e65e76 Merge branch 'master' of http://60.204.229.151:20080/chenkangxu/merchant-web 2024-08-19 17:17:47 +08:00
余同学 22690317b9 add 2024-08-19 17:17:41 +08:00
6 changed files with 139 additions and 125 deletions

View File

@ -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 }
})
}
}
/**
* 登录
* @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 },
});
},
};

View File

@ -29,7 +29,6 @@
placeholder="商品搜索"
></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="$refs.oTable.reload()"
>查询</el-button
@ -92,6 +91,7 @@ export default {
border: true,
height: "auto",
"row-id": "id",
"show-overflow": false,
},
productFilterType: "SALE",
selectList: [],
@ -112,6 +112,7 @@ export default {
type: "warning",
})
.then(() => {
console.log("111");
this.$api.mer_admin.BatchDeleteProducts(integers).then((res) => {
this.$refs.oTable.reload();
});

View File

@ -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

View File

@ -9,7 +9,7 @@
:modalHandles="modalHandles"
>
<obj-table-plus
v-show="tableData.length > 1"
v-show="modalData.specType == 1"
style="height: calc(100vh - 120px - 240px)"
slot="dialog__after"
ref="oTable"
@ -86,7 +86,7 @@ export default {
},
computed: {
modalCols() {
if (this.tableData.length == 1) {
if (this.modalData.specType == 0) {
return [
{
label: "价格",
@ -154,7 +154,7 @@ export default {
type: "primary",
submit: true,
handle: debounce(() => {
if (this.tableData.length == 1) {
if (this.modalData.specType == 0) {
this.$api.mer_admin
.saveProductBase(this.modalData)
.then((res) => {

View File

@ -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(

View File

@ -9,7 +9,7 @@
:modalHandles="modalHandles"
>
<obj-table-plus
v-show="tableData.length > 1"
v-show="modalData.specType == 1"
style="height: calc(100vh - 120px - 240px)"
slot="dialog__after"
ref="oTable"
@ -86,7 +86,7 @@ export default {
},
computed: {
modalCols() {
if (this.tableData.length == 1) {
if (this.modalData.specType == 0) {
return [
{
label: "库存",
@ -154,7 +154,7 @@ export default {
type: "primary",
submit: true,
handle: debounce(() => {
if (this.tableData.length == 1) {
if (this.modalData.specType == 0) {
this.$api.mer_admin
.saveProductBase(this.modalData)
.then((res) => {