first commit

This commit is contained in:
wtq
2025-11-12 09:47:04 +08:00
commit f759c3a7c3
1182 changed files with 447658 additions and 0 deletions

80
src/App.vue Normal file
View File

@@ -0,0 +1,80 @@
<template>
<div id="app" v-if="appShow">
<router-view />
</div>
</template>
<script>
import { getCookie } from '@/tools'
import { Hotupdate, updateTip, needUpdate } from '@/utils/updeteServe.js'
export default {
name: 'App',
data() {
return {
appShow: false,
}
},
methods: {
// // 跟新系统
// updateServe() {
// // this.$store.commit('setUpdateServe', false)
// // location.reload()
// },
// nowUpdateServe() {
// // this.$store.commit('setUpdateServe', false)
// },
},
async created() {
Hotupdate(this)
if (getCookie('Token')) {
await this.$store.dispatch('GetUserInfo')
}
if(this.$store.getters['jxStorePick/allCity'].length === 0) this.$store.dispatch('jxStorePick/getCity') // 获取城市信息
this.appShow = true
let loading = document.querySelector('.yz-loading')
let mask = document.querySelector('.yz-mask')
if (loading) {
setTimeout(() => {
loading.style.display = 'none'
mask.style.display = 'none'
}, 200)
}
// 判断页面是否进入后台
document.addEventListener('visibilitychange', async () => {
if (document.hidden === false) {
const willupdate = await needUpdate()
if (willupdate) {
updateTip(this)
}
}
})
},
}
</script>
<style lang="scss">
@import './assets/scss/global.scss';
kbd {
align-items: center;
background: linear-gradient(-225deg, #d5dbe4, #f8f8f8);
border-radius: 2px;
box-shadow: inset 0 -2px 0 0 #cdcde6, inset 0 0 1px 1px #fff,
0 1px 2px 1px rgba(30, 35, 90, 0.4);
display: flex;
height: 18px;
justify-content: center;
margin-right: 0.5em;
margin-left: 0.5em;
padding: 0 0 1px;
border: 0;
width: 20px;
}
.ctrl {
width: 36px;
}
</style>

52
src/apis/APIAuth.js Normal file
View File

@@ -0,0 +1,52 @@
/* eslint-disable */
import api from '@/utils/api.js'
/*
用户注册
/user2/RegisterUser post(formData)
*payload json数据User对象(手机号必填)
*mobileVerifyCode 手机验证码通过auth2.SendVerifyCode获得
authToken 之前通过login得到的认证TOKEN可以为空
----payload
UserID2 str 用户名(英文数字下划线)
Name str 昵称
Mobile str 手机号
Email string `orm:"size(32)" json:"email"`
IDCardNo string `orm:"size(18);column(id_card_no)" json:"idCardNo"` // 身份证号
*/
export const APIRegisterUser = async (string, noLoading = true) => {
try {
let res = await api('v2/user2/RegisterUser', {
method: 'POST',
data: string,
noLoading
})
return res
} catch (e) {
console.error('RegisterUser', e)
throw e
}
}
/*
发送验证码
/auth2/SendVerifyCode post
captchaID str 图片验证码ID
captchaValue str 图片验证码值
authToken str 之前的认证token
*authID str 手机号或邮件
*/
export const APISendVerifyCode = async (string, noLoading = true) => {
try {
let res = api('v2/auth2/SendVerifyCode', {
method: 'POST',
data: string,
noLoading
})
return res
} catch (e) {
console.error('/auth2/SendVerifyCode', e)
throw e
}
}

84
src/apis/APIBrand.js Normal file
View File

@@ -0,0 +1,84 @@
import api from '@/utils/api.js'
export const APIGetBrandSecretNumbers = async (string, noLoading = true) => {
try {
let res = await api('v2/store/GetBrandSecretNumbers', {
method: 'GET',
params: string,
noLoading
})
return res
} catch (e) {
console.error('RegisterUser', e)
throw e
}
}
export const APIGetSecretNumberBind = async (string, noLoading = true) => {
try {
let res = await api('v2/store/GetSecretNumberBind', {
method: 'GET',
params: string,
noLoading
})
return res
} catch (e) {
console.error('RegisterUser', e)
throw e
}
}
export const APIDelSecretBind = async (string, noLoading = true) => {
try {
let res = await api('v2/store/DelSecretBind', {
method: 'POST',
data: string,
noLoading
})
return res
} catch (e) {
console.error('RegisterUser', e)
throw e
}
}
export const APIUpdateSecretBind = async (string, noLoading = true) => {
try {
let res = await api('v2/store/UpdateSecretBind', {
method: 'POST',
data: string,
noLoading
})
return res
} catch (e) {
console.error('RegisterUser', e)
throw e
}
}
export const APIBindSecretNumber = async (string, noLoading = true) => {
try {
let res = await api('v2/store/BindSecretNumber', {
method: 'POST',
data: string,
noLoading
})
return res
} catch (e) {
console.error('RegisterUser', e)
throw e
}
}
export const APIBuySecretNo = async (string, noLoading = true) => {
try {
let res = await api('v2/store/BuySecretNo', {
method: 'POST',
data: string,
noLoading
})
return res
} catch (e) {
console.error('RegisterUser', e)
throw e
}
}

0
src/apis/APICat.js Normal file
View File

33
src/apis/APIConfig.js Normal file
View File

@@ -0,0 +1,33 @@
import api from '@/utils/api.js'
import { mkUrl } from "@/utils/api";
// 根据关键字查询config
export const APIQueryConfig = async (keyword, type, noLoading = true) => {
try {
const res = await api('v2/cms/QueryConfigs', {
params: {
keyword,
type
},
noLoading
})
return res
} catch (e) {
console.error('queryConfig', e)
throw e
}
}
// 更新config
export const APIUpdateConfig = async (json, noLoading = true) => {
try {
let res = await api('v2/cms/UpdateConfig', {
method: 'PUT',
data: json,
noLoading
})
return res
} catch (e) {
console.error(e)
throw e
}
}

192
src/apis/APIOrder.js Normal file
View File

@@ -0,0 +1,192 @@
/* eslint-disable */
import api from '@/utils/api.js'
// 投诉骑手(三方运送)
// token string true "认证token"
// vendorOrderID string true "订单号"
// vendorID int true "订单所属厂商ID"
// waybillVendorID int true "运单所属厂商ID"
// complaintID int true "投诉原因ID"
// waybillID string false "运单ID"
export const APIComplaintRider = async (string) => {
try {
await api('v2/order/ComplaintRider', {
method: 'POST',
data: string
})
} catch (e) {
console.error('order/ComplaintRider', e)
throw e
}
}
// 查询门店订单扣款记录
/*
storeIDs 门店ID列表
vendorOrderID 订单ID
vendorIDs 订单所属厂商ID列表
fromTime 开始日期包含格式2006-01-02 00:00:00如果订单号为空此项必须要求
toTime 结束日期包含格式2006-01-02 23:00:00如果订单号为空此项必须要求
status 账单状态0是未结账1是已结账
type 扣款类型1为差评补贴2为优惠券
offset 结果起始序号以0开始缺省为0
pageSize 结果页大小缺省为50-1表示全部
*/
export const APIGetOrdersSupplement = async (query, noLoading = false) => {
try {
let res = await api('v2/order/GetOrdersSupplement', {
method: 'GET',
params: query,
noLoading
})
return res
} catch (e) {
console.error('APIGetOrdersSupplement', e)
throw e
}
}
// 新增/修改扣款记录
// payload
/*
新增
storeID int
vendorOrderID string
vendorID string
type int //扣款类型1为差评订单补贴2为优惠券
linkID int //作为冲账标志关联某条扣款记录若新增为某一记录的冲账则此字段填那条记录的id
supplementFee int //扣款金额
comment string //备注
----
修改
id int
createdAt time
storeID int
vendorOrderID string
vendorID string
status int //账单状态,若已结账则不允许再修改 ,暂时 0为未结账1为已结账,-1为作废
linkID int //作为冲账标志关联某条扣款记录
type int //扣款类型1为差评订单补贴2为优惠券
supplementFee int //扣款金额
billID string //账单ID后期可能关联账单用
comment string //备注
*/
export const APIAddUpdateOrdersSupplement = async (json, noLoading = false) => {
try {
let res = await api('v2/order/AddUpdateOrdersSupplement', {
method: 'POST',
data: json,
noLoading
})
return res
} catch (e) {
console.error('AddUpdateOrdersSupplement', e)
throw e
}
}
// 得到订单详情
// vendorOrderID
// vendorID
// refresh
export const APIGetOrderInfo = async (query, noLoading = true) => {
try {
let res = await api('v2/order/GetOrderInfo', {
params: query,
noLoading
})
return res
} catch (e) {
console.error('APIGetOrderInfo', e)
throw e
}
}
// 查询订单状态
export const orderStatusList = async (query, noLoading = true) => {
try {
const res = await api('v2/order/GetOrderStatusList', {
params: query,
noLoading
})
return res
} catch (e) {
throw e
}
}
export const APIGetMatterOrderStatus = async (json) => {
try {
const res = api('v2/jxorder/GetMatterOrderStatus?vendorOrderID=' + json.vendorOrderID, {
noLoading: true
})
return res
} catch (e) {
throw e
}
}
// 重发京东物流
export const APISendFailedMatterOrder = async (json, noLoading = true) => {
try {
let res = await api('v2/jxorder/SendFailedMatterOrder', {
method: 'POST',
data: json,
noLoading
})
return res
} catch (e) {
console.error('SendFailedMatterOrder', e)
throw e
}
}
/**
* 获取门店发票申请 美团
* @Param token header string true "认证token"
* @Param storeId formData int false "门店id"
* @Param startTime formData string true "开始时间"
* @Param endTime formData string true "结束时间"
* @Param status formData string false "发票回复状态[1未回复/2回复]"
* @Param offset query int false "结果起始序号以0开始缺省为0"
* @Param pageSize query int false "结果页大小缺省为50-1表示全部"
*/
export const APIGetInvoiceRecord = async (json,page,noLoading=true) => {
try {
let str = ""
// if(page.offset) str = `offset=${page.offset}`
// if(page.pageSize) str = `offset=${page.offset || 0}&pageSize=${page.pageSize || -1}`
let res = await api(`v2/order/GetInvoiceRecord?${str.length > 0 ? str : ''}`, {
method: 'POST',
data: json,
noLoading
})
return res
} catch (e) {
console.error('APIGetInvoiceRecord', e)
throw e
}
}
/**
* 上传订单发票
* @Param token header string true "认证token"
* @Param orderId formData string true "订单ID"
* @Param invoiceUrl formData string true "发票地址[10M内pdf/png/jpeg/jpg]"
* @Param invoiceId formData string true "发票号码"
*/
export const APIUploadOrderInvoice = async (json,noLoading=true) => {
try {
let res = await api('v2/order/UploadOrderInvoice ', {
method: 'POST',
data: json,
noLoading
})
return res
} catch (e) {
console.error('UploadOrderInvoice ', e)
throw e
}
}

162
src/apis/APIPromotion.js Normal file
View File

@@ -0,0 +1,162 @@
import api from '@/utils/api.js'
import { formatDate } from '@/utils/index.js'
/**
* 获取活动列表
* @param {*} json 查询条件
*/
export const APIQueryActs = async (json, noLoading = true) => {
try {
const { data } = await api('v2/act/QueryActs', {
params: {
createdAtFrom: formatDate(new Date() - 30 * 24 * 60 * 60 * 1000, 'YYYY-MM-DD hh:mm:ss'),
createdAtTo: formatDate(new Date(), 'YYYY-MM-DD hh:mm:ss'),
typeList: JSON.stringify([3]),
statusList: JSON.stringify([1]),
...json
},
noLoading
})
if (data) {
return data.map(item => ({
actID: item.id,
...json
}))
} else {
return null
}
} catch (e) {
console.error('APIQueryActs', e)
throw e
}
}
// 删除活动中某些商品
// actID
// actStoreSkuDeleteList [{
// storeID,
// skuID
// }]
// isAsync
export const APIUpdateActStoreSkuBind = async (json, noLoading = true) => {
try {
return await api('v2/act/UpdateActStoreSkuBind', {
method: 'PUT',
data: json,
noLoading
})
} catch (e) {
throw e
}
}
//获取平台流量活动
//vendorID
//storeID
export const APIGetVendorPopActs = async (json, noLoading = true) => {
try {
return await api('v2/act/GetVendorPopActs', {
method: 'GET',
params: json,
noLoading
})
} catch (e) {
throw e
}
}
//活动详情
export const APIGetVendorPopActDetail = async (json, noLoading = true) => {
try {
return await api('v2/act/GetVendorPopActDetail', {
method: 'GET',
params: json,
noLoading
})
} catch (e) {
throw e
}
}
/**
* 获取美团活动(获取本地的数据)
* @Param token header string true "认证token"
*
* @Param storeIDs query string false "门店IDs"
* @Param skuIDs query string false "skuIDs"
* @Param keyword query string false "关键字"
* @Param beginAt query string false "活动开始日期"
* @Param endAt query string false "活动结束日期"
* @Param actType query int false "折扣或者秒杀"
* @Param offset query int false "起始序号以0开始缺省为0"
* @Param pageSize query int false "表页大小(缺省全部)"
*/
export const GetActMtwmVendor = async (json, noLoading = true) => {
try {
return await api('v2/act/GetActMtwmVendor', {
method: 'GET',
params: json,
noLoading
})
} catch (e) {
throw e
}
}
// 刷新美团活动数据
export const RefreshMTActivityList = async (noLoading = true) => {
try {
return await api('v2/act/RefreshMTActivityList', {
method: 'GET',
noLoading
})
} catch (e) {
throw e
}
}
/**
*
* 根据skuId获取没有参加活动的门店id
* @Param token header string true "认证token"
* @Param skuID query int false "skuID"
* @Param offset query int false "起始序号以0开始缺省为0"
* @Param pageSize query int false "表页大小(缺省全部)"
*/
export const GetNotHaveSkuActList = async (json, noLoading = true) => {
try {
return await api('v2/act/GetNotHaveSkuActList', {
method: 'GET',
params: json,
noLoading
})
} catch (e) {
throw e
}
}
/**
* @Title 查询美团平台线上活动(会有不在我们本地创建的)
* @Param token header string true "认证token"
* @Param vendorStoreID query string false "美团门店ID"
* @Param vendorOrgCode query string false "美团appID"
* @Param beginAt query int false "活动开始日期 时间戳"
* @Param endAt query int false "活动结束日期 时间戳"
* @Param actType query int false "折扣或者秒杀 商品满减2 折扣(爆品)3"
*/
export const GetMTOnlineAct = async (json, noLoading = true) => {
try {
let res = await api('/v2/act/GetMTOnlineAct', {
method: 'GET',
params: json,
noLoading
})
return res
} catch (e) {
console.error('', e)
throw (e)
}
}

21
src/apis/APISku.js Normal file
View File

@@ -0,0 +1,21 @@
import api from '@/utils/api.js'
// import {json2query} from '@/utils'
/**
* UPC查询
* @param {*} name 商品名
* @param {*} upcCode UPCCODE
* @param {*} noLoading false
*/
export const APIGetJDUPC = async (params, noLoading = false) => {
try {
let res = await api('v2/sku/GetJdUpcCodeByName', {
method: 'GET',
params,
noLoading
})
return res
} catch (e) {
throw e
}
}

99
src/apis/APISkuNames.js Normal file
View File

@@ -0,0 +1,99 @@
import { formatDate } from '@/utils'
import api from '@/utils/api.js'
export const APIGetSkuNames = async (json, noLoading = false) => {
try {
let res = await api('v2/sku/GetSkuNames', {
method: 'GET',
params: {
...json
},
noLoading
})
return res
} catch (e) {
console.error(e)
throw e
}
}
export const APIGetSkuNamesNew = async (json, noLoading = false) => {
try {
let res = await api('v2/sku/GetSkuNamesNew', {
method: 'GET',
params: {
...json
},
noLoading
})
return res
} catch (e) {
console.error(e)
throw e
}
}
export const APIGetSkuNamesPOST = async (str, noLoading = true) => {
try {
let res = await api('v2/sku/GetSkuNames', {
method: 'POST',
data: str,
noLoading
})
return res
} catch (e) {
console.error(e)
throw e
}
}
export const updateMtCatToJd = async (mtCatID,jdCatID, noLoading = true) => {
let form = new FormData()
form.append('mtCatID', mtCatID)
form.append('jdCatID', jdCatID)
try {
let res = await api('v2/sku/UpdateMtCatToJd', {
method: 'POST',
data: form,
noLoading
})
return res
} catch (e) {
console.error(e)
throw e
}
}
export const getVendorCategoriesWithMap = async (vendorID, noLoading = true) => {
try {
let res = await api('v2/sku/GetVendorCategoriesWithMap', {
method: 'GET',
params: {
vendorID
},
noLoading
})
return res
} catch (e) {
console.error(e)
throw e
}
}
// 根据城市信息查找推荐商品(按销量)
// token string true "认证token"
// cityCode int true "城市id"
// storeID int false "门店id" //不传
// store/sku/GetTopSkusByCityCode [get]
export const APIGetTopSkusByCityCode = async (params, noLoading = true) => {
try {
let res = await api('v2/store/sku/GetTopSkusByCityCode', {
params,
noLoading
})
return res
} catch (e) {
console.error('store/sku/GetTopSkusByCityCode', e)
throw e
}
}

98
src/apis/APIUser.js Normal file
View File

@@ -0,0 +1,98 @@
/* eslint-disable */
import api from '@/utils/api.js'
export const APIGetBrandUser = async (json, noLoading = true) => {
try {
let res = await api('v2/store/GetBrandUser', {
params: json,
noLoading
})
return res
} catch (e) {
console.error('GetUsers', e)
throw e
}
}
/**
* 得到用户列表
* GET
* /user2/GetUsers
* @param {Number} userType* 用户类型0表示全部
* @param {String} keyword 关键字
* ...userIDs
*/
export const APIGetUsers = async (json, noLoading = true) => {
try {
let res = await api('v2/user2/GetUsers', {
params: json,
noLoading
})
return res
} catch (e) {
console.error('GetUsers', e)
throw e
}
}
/**
* 给指定**角色**添加**用户**列表
* POST
* /user2/AddUsers4Role
* formData
* @param {String} roleName* 角色名 (必填)
* @param {Number} storeID 门店ID
* @param {Array<String>} userIDs* 用户ID列表 (必填)
*/
export const APIAddUsers4Role = async (string, noLoading = true) => {
try {
let res = await api('v2/user2/AddUsers4Role', {
method: 'POST',
data: string,
noLoading
})
return res
} catch (e) {
console.error('AddUsers4Role', e)
throw e
}
}
/**
* 更新用户分成比例
* @param {*} string
* @param {*} noLoading
*/
export const APIUpdateUserWxNoAndPercent = async (string, noLoading = true) => {
try {
let res = await api('v2/user2/UpdateUserWxNoAndPercent', {
method: 'PUT',
data: string,
noLoading
})
return res
} catch (e) {
console.error('UpdateUserWxNoAndPercent', e)
throw e
}
}
/**
* 禁用用户
* @param {*} userID
* @param {*} noLoading
*/
export const APIDeleteUserInfo = async (userID, noLoading = true) => {
try {
let res = await api('v2/user2/DeleteUserInfo?userID=' + userID, {
method: 'DELETE',
noLoading
})
return res
} catch (e) {
console.error('APIDeleteUserInfo', e)
throw e
}
}

42
src/apis/APIreport.js Normal file
View File

@@ -0,0 +1,42 @@
import api from '@/utils/api.js'
export const APIReportForOrders = async (json) => {
try {
let res = await api('v2/report/StatisticsReportForOrders', {
method: 'POST',
data: json
})
return res
} catch (e) {
console.error(e)
throw e
}
}
export const APIGetStoreManageState = async (json) => {
try {
let res = await api('v2/report/GetStoreManageState', {
method: 'GET',
params: json,
// noLoading:true
})
return res
} catch (e) {
console.error(e)
throw e
}
}
export const userMemberReport = async (json) => {
try {
let res = await api('v2/report/UserMemberReport', {
method: 'GET',
params: json,
noLoading:true
})
return res
} catch (e) {
console.error(e)
throw e
}
}

116
src/apis/APIshop.js Normal file
View File

@@ -0,0 +1,116 @@
import api from '@/utils/api.js'
export const APIGetStores = async (json, noLoading = false) => {
try {
let res = await api('v2/store/GetStores', {
method: 'POST',
data: json,
noLoading
})
return res
} catch (e) {
console.error(e)
throw e
}
}
/**
* 添加平台门店绑定
* @param {*} storeID
* @param {*} vendorID
* @param {*} vendorOrgCode 选填
* @param {*} payload {"vendorStoreID":"103083","autoPickup":1,"deliveryCompetition":1,"pricePercentage":100,"isSync":1,"pricePercentagePack":"美团调价策略7.18"}
*/
export const APIAddStoreMap = async (json, noLoading = false) => {
try {
let res = await api('v2/store/AddStoreVendorMap', {
method: 'POST',
data: json,
noLoading
})
return res
} catch (e) {
console.error(e)
throw e
}
}
/**
* 修改平台门店绑定
* @param {*} storeID
* @param {*} vendorID
* @param {*} payload {"vendorStoreID":"103083","autoPickup":1,"deliveryCompetition":1,"pricePercentage":100,"isSync":1,"pricePercentagePack":"美团调价策略7.18"}
*/
export const APIUpdateStoreMap = async (json, noLoading = false) => {
try {
let res = await api('v2/store/UpdateStoreVendorMap', {
method: 'PUT',
data: json,
noLoading
})
return res
} catch (e) {
console.error(e)
throw e
}
}
/* 发送消息
storeIDs
title
content
isAsync
isContinueWhenError
*/
export const APISendStoreMessage = async (string, noLoading = true) => {
try {
let res = await api('v2/msg/SendStoreMessage', {
method: 'POST',
data: string,
noLoading
})
return res
} catch (e) {
console.error('APISendStoreMessage', e)
throw e
}
}
/*
更新门店信息
storeID
payload
*/
export const APIUpdateStore = async (json, noLoading = true) => {
try {
let res = await api('v2/store/UpdateStore', {
method: 'PUT',
data: json,
noLoading
})
return res
} catch (e) {
console.error(e)
throw e
}
}
/* 查询远端门店
vendorStoreID
vendorID
vendorOrgCode
*/
export const APIGetVendorStore = async (json) => {
try {
const res = await api('v2/store/GetVendorStore', {
params: {
...json
},
noLoading: true
})
return res
} catch (e) {
console.error(e)
throw e
}
}

146
src/apis/APIstoreSku.js Normal file
View File

@@ -0,0 +1,146 @@
import api from '@/utils/api.js'
/* 修改单门店商品
{
nameID: id,
unitPrice: price,
isFocus: ,
statusSaleBegin
statusSaleEnd
skus: [
{
skuID: id,
isSale:
}
]
}
*/
export const APIUpdateStoreSkus = async (json, noLoading = false) => {
try {
let res = await api('v2/store/sku/UpdateStoresSkus', {
method: 'PUT',
data: json,
noLoading
})
return res
} catch (e) {
console.error(e)
throw e
}
}
/**
* 获取门店商品
* @param {*} json 查询条件
*/
export const APIGetStoresSkus = async (json, noLoading = true) => {
try {
const res = await api('v2/store/sku/GetStoresSkus', {
params: json,
noLoading
})
return res
} catch (e) {
console.error('APIGetStoresSkus', e)
throw e
}
}
/**
* 获取门店商品审核列表
* @param {*} json 数据
* @param {*} noLoading no
*/
export const APIGetStoreSkuAudit = async (json, noLoading = true) => {
try {
const res = await api('v2/store/sku/GetStoreSkuAudit', {
params: json,
noLoading
})
return res
} catch (e) {
console.error('GetStoreSkuAudit', e)
throw e
}
}
//获取门店审核列表
export const APIGetStoreCheckList = async (json, noLoading = true) => {
try {
const res = await api('v2/store/GetStoreAudit', {
params: json,
noLoading
})
return res
} catch (e) {
console.error('GetStoreAudit', e)
throw e
}
}
/**
* 处理门店商品审核
* @param {*} query
* @param {*} noLoading
*/
export const APIStoreSkuPriceAudit = async (query, noLoading = true) => {
try {
return await api('v2/store/sku/StoreSkuPriceAudit', {
method: 'POST',
data: query,
noLoading
})
} catch (e) {
console.error('APIStoreSkuPriceAudit', e)
throw e
}
}
/**
* 处理门店审核
* @param {*} query
* @param {*} noLoading
* paload :userID name
*/
export const APIStoreAudit = async (query, noLoading = true) => {
try {
return await api('v2/store/StoreAudit', {
method: 'POST',
data: query,
noLoading
})
} catch (e) {
console.error('GetStoreAudit', e)
throw e
}
}
/**
* 批量修改门店商品,不同步
* @param {*} json 数据
* @param {*} noLoading 不显示loading
* storeIDs
* payload
* payload=[{nameID, unitPrice, isFocus, isSale}]
* isRefreshHigh
*/
export const APIUpdateStoresSkusWithoutSync = async (json, noLoading = true) => {
try {
return await api('v2/store/sku/UpdateStoresSkusWithoutSync', {
method: 'PUT',
data: json,
noLoading
})
} catch (e) {
throw e
}
}
export const getStoresSkusSaleInfo = async (json, noLoading = true) => {
try {
return await api('v2/store/sku/GetStoresSkusSaleInfo', {
method: 'GET',
params: json,
noLoading
})
} catch (e) {
throw e
}
}

89
src/apis/APIsync.js Normal file
View File

@@ -0,0 +1,89 @@
import api from '@/utils/api.js'
import {json2query} from '@/utils'
// export const APIReportForOrders = async (json) => {
// try {
// let res = await api('v2/report/StatisticsReportForOrders', {
// method: 'POST',
// data: json
// })
// return res
// } catch (e) {
// console.error(e)
// throw e
// }
// }
// 同步商家分类
// vendorID - integer - 平台ID(京东0 美团1 饿百3)
// vendorOrgCode - string - 平台账号
// isForce - boolean - 是否强制(设置修改标志)
// isAsync - boolean - 是否异步
// isContinueWhenError - boolean - 单个同步失败是否继续缺省false
export const APISyncCat = async (json, noLoading = true) => {
try {
let res = await api('v2/sync/SyncCategories', {
method: 'POST',
data: json2query(json),
noLoading
})
return res
} catch (e) {
throw e
}
}
// 重置商品库
// vendorID * - integer - 平台ID(京东0 美团1 饿百3)
// vendorOrgCode * - string - 平台账号
// isAsync - boolean - 是否异步操作
// isContinueWhenError - boolean - 单个同步失败是否继续缺省false
export const APIResetSkuNames = async (json, noLoading = true) => {
try {
let res = await api('v2/sync/FullSyncVendorStuff', {
method: 'POST',
data: json2query(json),
noLoading
})
return res
} catch (e) {
throw e
}
}
// 同步平台门店
// vendorIDs
// vendorOrgCode
// storeIDs
// isForce
// isAsync
// isContinueWhenError
export const APISyncStores = async (json, noLoading = true) => {
try {
let res = await api('v2/sync/SyncStores', {
method: 'POST',
data: json2query(json),
noLoading
})
return res
} catch (e) {
console.error('SyncStores', e)
throw e
}
}
// 同步京狗商品库存
export const APISyncJGStoresSkus = async (json, noLoading = true) => {
try {
let res = await api('v2/sync/SyncJdsStoresSkus', {
method: 'PUT',
data: json2query(json),
noLoading
})
return res
} catch (e) {
console.error('SyncStores', e)
throw e
}
}

104
src/apis/JDCat.js Normal file
View File

@@ -0,0 +1,104 @@
import api from '@/utils/api.js'
import $ajax from 'axios'
import { hideLoad } from '@/tools/loading.js'
import msgWarning from '@/tools/msgwarning.js'
// vendorOrgCode 账号ID
// vendorID 平台ID
async function getVendorCategoryMap (json) {
try {
let res = await api('v2/sku/GetVendorCategoryMap', {
params: json,
})
return res
} catch (e) {
throw e
}
}
//新增平台类别
function addVendorCategory(vendorID,vendorOrgCode,categroyID,level,parentID,vendorCategoryName, vendorCategorySeq,fn) {
let form = new FormData()
form.append('vendorID', vendorID)
form.append('vendorOrgCode',vendorOrgCode)
form.append('categroyID', categroyID)
form.append('level', level)
form.append('parentID', parentID)
form.append('vendorCategoryName', vendorCategoryName)
form.append('vendorCategorySeq', vendorCategorySeq)
$ajax.post('v2/sku/AddVendorCategoryMap', form, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
fn && fn(res.data)
}).catch(res => {
msgWarning(res.data.desc)
hideLoad()
})
}
//修改平台类型
async function updateVendorCategoryMap(ID,vendorCategoryName ,level,categroyID, parentID ,isDelete=false, fn) {
let form = new FormData()
form.append('ID', ID)
form.append('vendorCategoryName', vendorCategoryName)
form.append('level', level)
form.append('categroyID', categroyID)
form.append('parentID', parentID)
form.append('isDelete', isDelete)
try {
let res = await api('v2/sku/UpdateVendorCategoryMap', {
method: 'PUT',
data: form
})
fn && fn({ code: '0' })
return res
} catch (e) {
msgWarning(e)
hideLoad()
throw e
}
}
//加载门店分类到京东
async function loadStoreVendorCategories (vendorID,vendorOrgCode,storeID) {
let form = new FormData()
form.append('vendorID', vendorID)
form.append('vendorOrgCode', vendorOrgCode)
form.append('storeID', storeID)
try {
let res = await api('v2/sku/LoadStoreVendorCategories', {
method: 'POST',
data: form,
noLoading: true,
})
return res
} catch (e) {
hideLoad()
msgWarning(e)
throw e
}
}
function SortCat(categoryID, categoryIDs, vendorID ,vendorOrgCode , fn ) {
let formData = new FormData()
formData.append('categoryID', categoryID)
formData.append('vendorID', vendorID)
formData.append('vendorOrgCode', vendorOrgCode)
formData.append('categoryIDs', JSON.stringify(categoryIDs))
$ajax.put('v2/sku/ReorderVendorCategories', formData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
fn && fn(res.data)
}).catch(res => {
msgWarning(res.data.desc)
hideLoad()
})
}
export { getVendorCategoryMap,addVendorCategory,updateVendorCategoryMap,SortCat,loadStoreVendorCategories}

200
src/apis/cat.js Normal file
View File

@@ -0,0 +1,200 @@
import $ajax from 'axios'
// import {Message} from 'element-ui'
import { hideLoad } from '@/tools/loading.js'
import msgWarning from '@/tools/msgwarning.js'
import api from '@/utils/api.js'
/*
新增商品类别 post /sku/AddCategory
payload json
--------
type 0 skuNameCat
type 1 skuCat
*/
function addCat(json, fn) {
let formData = new FormData()
formData.append('payload', JSON.stringify(json))
$ajax.post('v2/sku/AddCategory', formData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
fn && fn(res.data)
}).catch(res => {
msgWarning(res.data.desc)
hideLoad()
})
}
/*
通过store_id
新增商品类别 post /sku/AddCategory
payload json
--------
type 0 skuNameCat
type 1 skuCat
*/
function storeAddCat(storeID, storeCategroyName, level, parentID, storeCategroySeq,isHidden,categroyID, fn) {
let formData = new FormData()
formData.append('storeID', storeID)
formData.append('level', level)
formData.append('parentID', parentID)
formData.append('storeCategroyName', storeCategroyName)
formData.append('storeCategroySeq', storeCategroySeq)
formData.append('isHidden', isHidden)
if(categroyID!==0){
formData.append('categroyID', categroyID)
}
$ajax.post('v2/store/AddStoreCategoryMap', formData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
fn && fn(res.data)
}).catch(res => {
msgWarning(res.data.desc)
hideLoad()
})
}
/*
删除商品类别 delete /sku/DeleteCategory
categoryID int
*/
function deleteCat(categoryID, fn) {
$ajax.delete('v2/sku/DeleteCategory', {
params: {
categoryID
}
}).then(res => {
hideLoad()
fn && fn(res.data)
}).catch(res => {
msgWarning(res.data.desc)
hideLoad()
})
}
/*
修改分类 put /sku/UpdateCategory
categoryID int 类别ID
payload json
*/
async function updateCat(categoryID, json, fn) {
let formData = new FormData()
formData.append('categoryID', categoryID)
formData.append('payload', JSON.stringify(json))
try {
let res = await api('v2/sku/UpdateCategory', {
method: 'PUT',
data: formData
})
fn && fn({ code: '0' })
return res
} catch (e) {
msgWarning(e)
hideLoad()
throw e
}
}
/*
通过门店 store_id
修改分类 put /sku/UpdateCategory
categoryID int 类别ID
payload json
*/
async function storeUpdateCat(ID, categoryID,level, parentID, storeCategroyName,isDelete,isHidden, fn) {
let formData = new FormData()
formData.append('ID', ID)
formData.append('categoryID', categoryID)
formData.append('level', level)
formData.append('parentID', parentID)
formData.append('storeCategroyName', storeCategroyName)
formData.append('isDelete',isDelete)
formData.append('isHidden',isHidden)
try {
let res = await api('v2/store/UpdateStoreCategoryMap', {
method: 'PUT',
data: formData
})
fn && fn({ code: '0' })
return res
} catch (e) {
msgWarning(e)
hideLoad()
throw e
}
}
/*
商品类别排序 put /sku/ReorderCategories
categoryID int 父ID
categoryIDs str 子类别ID列表 [1,2,3,4]
*/
function sortCat(categoryID, categoryIDs, fn, isExd,onlySort) {
let formData = new FormData()
formData.append('categoryID', categoryID)
formData.append('categoryIDs', JSON.stringify(categoryIDs))
if (isExd) formData.append('isExd', isExd)
// onlySort 1 只修改排序 其余修改排序并同步分类
if(onlySort) formData.append('onlySort', 1)
$ajax.put('v2/sku/ReorderCategories', formData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
fn && fn(res.data)
}).catch(res => {
msgWarning(res.data.desc)
hideLoad()
})
}
/*
通过门店 store_id
商品类别排序 put /sku/ReorderCategories
categoryID int 父ID
categoryIDs str 子类别ID列表 [1,2,3,4]
*/
function storeSortCat(categoryID, categoryIDs, storeID, fn ) {
let formData = new FormData()
formData.append('categoryID', categoryID)
formData.append('storeID', storeID)
formData.append('categoryIDs', JSON.stringify(categoryIDs))
$ajax.put('v2/sku/ReorderStoreCategories', formData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
fn && fn(res.data)
}).catch(res => {
msgWarning(res.data.desc)
hideLoad()
})
}
function copyStoreCat(fromStoreID,toStoreIDs,isAsync,isContinueWhenError,fn) {
let formData = new FormData()
formData.append('fromStoreID', fromStoreID)
formData.append('toStoreIDs', toStoreIDs)
// formData.append('categoryIDs', categoryIDs)
formData.append('isAsync', isAsync)
formData.append('isContinueWhenError', isContinueWhenError)
$ajax.put('v2/sku/CopyStoreCategories', formData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
fn && fn(res.data)
}).catch(res => {
msgWarning(res.desc)
hideLoad()
})
}
export { addCat, deleteCat, updateCat, sortCat, storeSortCat, storeUpdateCat, storeAddCat, copyStoreCat}

377
src/apis/cms.js Normal file
View File

@@ -0,0 +1,377 @@
import $ajax from 'axios'
// import {Message} from 'element-ui'
import { hideLoad } from '@/tools/loading.js'
import msgWarning from '@/tools/msgwarning.js'
import api from '@/utils/api.js'
/*
得到地点 get /cms/GetPlaces
keyword str 关键字
parentCode int 上级地点code 中国为100000北京为110000北京市为110100
level int 地点级别 1省 2市 3区
*/
export function getPlaces(parentCode, fn) {
$ajax.get('v2/cms/GetPlaces', {
params: {
parentCode
}
}).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
//通过经纬度获取城市名
export const getCityName = async (lng, lat) => {
try {
let res = await api(`v2/cms/GetCoordinateCityInfo?lng=${lng}&lat=${lat}`)
return res
} catch (e) {
console.error(e)
}
}
export function getPlaces2(keyword, fn) {
$ajax.get('v2/cms/GetPlaces', {
params: {
keyword
}
}).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
/*
根据坐标得到区码 get /cms/GetCoordinateDistrictCode
lng num 经度
lat num 纬度
该接口使用腾讯的api已经没用了
*/
export function getCoordinateDistrictCode(lng, lat, fn) {
$ajax.get('v2/cms/GetCoordinateDistrictCode', {
params: {
lng,
lat
}
}).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
/*
得到第三方配送等待时间 get /cms/GetConfig
key str
*/
export function getConfig(key, fn) {
$ajax.get('v2/cms/GetConfig', {
params: {
key
}
}).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
/*
设置配置参数 put /cms/SetConfig
key str
value str
*/
export function setConfig(key, value, fn) {
$ajax.put(`v2/cms/SetConfig?key=${key}&value=${value}`).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
/*
从UPC码得到商品信息 get /cms/GetProductInfoByBarCode
barCode str
*/
export function getInfoByBarcode(barCode, fn) {
$ajax.get('v2/cms/GetProductInfoByBarCode', {
params: {
barCode
}
}).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
// export {getPlaces, getCoordinateDistrictCode, getPlaces2, getConfig, setConfig, getInfoByBarcode}
/*
type str 配置类型,当前支持 PricePack, Bank
key str 配置名
keyword str 关键字
*/
export const queryConfigs = async (json = {}) => {
try {
let { noLoading = false, type = 'PricePack', key, keyword } = json
let params = {
type
}
if (key) params.key = key
if (keyword) params.keyword = keyword
let res = await api('v2/cms/QueryConfigs', {
params,
noLoading
})
if (res) {
if (type === 'Bank') {
// 银行
return res
} else {
// 调价包
return res.map(item => ({
...item,
value: JSON.parse(item.value)
}))
}
} else {
return []
}
} catch (e) {
msgWarning(e)
return -1
} finally {
hideLoad()
}
}
// 查询会员配置
export const queryVipConfigs = async () => {
try {
let params = { type: 'DiscountCard', key: '会员折扣卡' }
let noLoading = false
let res = await api('v2/cms/QueryConfigs', {
params,
noLoading
})
if (res) {
return res
} else {
return []
}
} catch (e) {
msgWarning(e)
return -1
} finally {
hideLoad()
}
}
export const updateStoreTemplate = async (json = {}) => {
try {
let { noLoading = false, storeID , content, sound } = json
let form = new FormData()
form.append('storeID', storeID)
form.append('content', content)
form.append('sound', sound)
let res = await api('v2/store/UpdateStoreTemplate', {
method: 'POST',
data: form,
noLoading
})
return res
} catch (e) {
msgWarning(e)
return -1
} finally {
hideLoad()
}
}
/*
## 新增配置 POST(FormData) /cms/NewConfig
type str 配置类型,当前只支持 PricePack
key str 配置名
value str 配置值 []
*/
export const newConfig = async (json = {}) => {
try {
let { noLoading = false, type = 'PricePack', key, value } = json
let form = new FormData()
form.append('type', type)
form.append('key', key)
form.append('value', value)
let res = await api('v2/cms/NewConfig', {
method: 'POST',
data: form,
noLoading
})
return res
} catch (e) {
msgWarning(e)
return -1
} finally {
hideLoad()
}
}
/*
## 删除配置 DELETE(query) /cms/DeleteConfig
type str 配置类型,当前只支持 PricePack
key str 配置名
*/
export const deleteConfig = async (json = {}) => {
try {
let { noLoading, type = 'PricePack', key } = json
let params = {
type,
key
}
let res = await api('v2/cms/DeleteConfig', {
method: 'DELETE',
params,
noLoading
})
return res
} catch (e) {
msgWarning(e)
return -1
} finally {
hideLoad()
}
}
/*
## 修改配置 PUT(formData) /cms/UpdateConfig
type str 配置类型,当前只支持 PricePack
key str 配置名
value str 配置值
*/
export const updateConfig = async (json = {}) => {
try {
let { noLoading, type = 'PricePack', key, value } = json
let form = new FormData()
form.append('type', type)
form.append('key', key)
form.append('value', value)
let res = await api('v2/cms/UpdateConfig', {
method: 'PUT',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
data: form,
noLoading
})
return res
} catch (e) {
msgWarning(e)
return -1
} finally {
hideLoad()
}
}
// 获取平台账号信息
export const getVendorOrgCodeInfo = async () => {
try {
let res = await api('v2/cms/GetVendorOrgCodeInfo')
return res
} catch (e) {
throw e
}
}
// 新接口 获取平台账号信息 vendorType=platform 查平台账号 vendorID 0 京东
export const newCetVendorOrgCodeInfo = async (vendorID=-1,) => {
try {
let res = await api('v2/sys/GetVendorOrgCode',{
params:{
vendorType:'platform',
vendorID,
},
noLoading:true,
})
return res
} catch (e) {
throw e
}
}
// 新接口 修改平台账号信息 vendorType=platform 查平台账号 vendorID 0 京东
export const updateVendorOrgCode = async (id,json) => {
let form = new FormData()
form.append('id', id)
form.append('payload', JSON.stringify(json))
try {
let res = await api('v2/sys/UpdateVendorOrgCode',{
method:'POST',
data:form,
noLoading:true,
})
return res
} catch (e) {
throw e
}
}
export const addVendorOrgCode = async (json) => {
let form = new FormData()
form.append('payload', JSON.stringify(json))
try {
let res = await api('v2/sys/AddVendorOrgCode',{
method:'POST',
data:form,
noLoading:true,
})
return res
} catch (e) {
throw e
}
}
export const getDayVercabulary = async (offset,pageSize,noLoading = true) => {
try {
let res = await api(`v2/know/GetMaterialList?offset=${offset}&pageSize=${pageSize}`, { noLoading })
return res
} catch (e) {
throw e
}
}
export const getDayArticle = async (offset,pageSize,noLoading = true) => {
try {
let res = await api(`v2/know/GetKnowledgeDepot?offset=${offset}&pageSize=${pageSize}`, { noLoading })
return res
} catch (e) {
throw e
}
}

107
src/apis/common.js Normal file
View File

@@ -0,0 +1,107 @@
import $ajax from 'axios'
// import {hideLoad} from '@/tools/loading.js'
import msgWarning from '@/tools/msgwarning.js'
import { hideLoad } from '@/tools/loading.js' // 引入封装的loading方法
import api from '@/utils/api.js'
/**
* 获取城市
* @param {Boolean} includeDisabled 是否包括禁用城市
* @param {Boolean} noLoading 是否需要loading
*/
async function getCity(includeDisabled, noLoading) {
let str = ''
if (includeDisabled) str += '&includeDisabled=true'
// 获取城市数据
let cityData = (await ($ajax.get('v2/cms/GetPlaces?level=2' + str, {
noLoading: !!noLoading
}))).data
// 判断城市是否获取成功
if (cityData.code !== '0') {
msgWarning('[获取城市列表失败] ' + cityData.desc)
} else {
return JSON.parse(cityData.data)
}
}
/**
* 获取城市信息
*/
export const getAllCityInfo = async (noLoading = false) => {
try {
let res = await api('v2/cms/GetPlaces',noLoading)
hideLoad()
return res
} catch (e) {
console.error(e)
}
}
async function getJxCat(noLoading) {
// 获取分类数据
let categories = (await $ajax.get('v2/sku/GetCategories', { noLoading })).data
// 判断分类是否获取成功
if (categories.code !== '0') {
msgWarning('[获取分类列表失败] ' + categories.desc)
} else {
categories = JSON.parse(categories.data)
return {
catLevel1: categories.filter(item => item.level === 1),
catLevel2: categories.filter(item => item.level === 2)
}
}
}
//获取京西商城用户信息
function getJxUser(keyword, offset, pageSize, fromTime, toTime, vendorIDs, fn) {
$ajax.get('v2/user2/GetJxShopUsers', {
params: {
keyword,
offset,
fromTime,
toTime,
vendorIDs,
pageSize
}
}).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
/**
* 模块:获取商城首页菜单列表
* 作者:张树伟
* 日期2022年7月7日
* 邮箱2966211270@qq.com
*/
function getMerchantMenu(storeID,fn) {
if (process.env.NODE_ENV === "development") {
var URL_AJAX = `store/sku/GetTopCategoriesByStoreIDs?storeIDs=%5B${storeID}%5D`
}else {
var URL_AJAX = `http://www.jxc4.com/v2/store/sku/GetTopCategoriesByStoreIDs?storeIDs=%5B${storeID}%5D`
}
$ajax.get(URL_AJAX)
.then(res => {
hideLoad()
if (res.data.code === '0') {
let newData = JSON.parse(res.data.data)
fn && fn(newData)
} else {
msgWarning(res.data.desc)
}
})
.catch(err => {
hideLoad()
})
}
export { getCity, getJxCat, getJxUser, getMerchantMenu }

62
src/apis/controls/auth.js Normal file
View File

@@ -0,0 +1,62 @@
/* eslint-disable */
import {json2query} from '@/utils'
import {APIRegisterUser, APISendVerifyCode} from '@/apis/APIAuth.js'
import {getCookie} from '@/tools/'
/*
用户注册
/user2/RegisterUser post(formData)
*payload json数据User对象(手机号必填)
*mobileVerifyCode 手机验证码通过auth2.SendVerifyCode获得
authToken 之前通过login得到的认证TOKEN可以为空
----payload
UserID2 str 用户名(英文数字下划线)
Name str 昵称
Mobile str 手机号
Email string `orm:"size(32)" json:"email"`
IDCardNo string `orm:"size(18);column(id_card_no)" json:"idCardNo"` // 身份证号
*/
// 通过手机号注册
/**
*
* @param {*} mobile 手机号
* @param {*} mobileVerifyCode 验证码
* @param {*} noLoading
*/
export const registerUser = async (mobile, mobileVerifyCode, noLoading = true) => {
try {
let res = await APIRegisterUser(json2query({
payload: JSON.stringify({
userID2: mobile,
name: mobile,
mobile
})
// mobileVerifyCode
// authToken: getCookie('Token')
}), noLoading)
return res
} catch (e) {
throw e
}
}
/*
发送验证码
/auth2/SendVerifyCode post
captchaID str 图片验证码ID
captchaValue str 图片验证码值
authToken str 之前的认证token
*authID str 手机号或邮件
*/
export const sendCode = async (mobile, noLoading = true) => {
try {
let res = await APISendVerifyCode(json2query({
authID: mobile,
authToken: getCookie('Token')
}), noLoading)
return res
} catch (e) {
throw e
}
}

View File

@@ -0,0 +1,51 @@
import api from '@/utils/api.js'
// 查询品牌
export const getBrands = async (query, noLoading = true) => {
try {
let res = await api('v2/store/GetBrands', {
params: query,
noLoading
})
return res
} catch (e) {
console.error('GetBrands', e)
throw e
}
}
export const addBrand = async (json, noLoading = true) => {
let form = new FormData()
form.append('payload', JSON.stringify(json))
try {
let res = await api('v2/store/AddBrand', {
method: 'POST',
data: form,
noLoading,
})
return res
} catch (e) {
console.error('AddBrand', e)
throw e
}
}
export const updateBrand = async (json, isDel = false, noLoading = true) => {
let form = new FormData()
form.append('payload', JSON.stringify(json))
form.append('isDel', isDel)
try {
let res = await api('v2/store/UpdateBrand', {
method: 'POST',
data: form,
noLoading
})
return res
} catch (e) {
console.error('updateBrand', e)
throw e
}
}

View File

@@ -0,0 +1,28 @@
import {json2query} from '@/utils'
import {APIQueryConfig, APIUpdateConfig, APIUpdateCthrConfig} from '@/apis/APIConfig.js'
// 查询bannerList
export const queryBannerList = async () => {
try {
const res = await APIQueryConfig('shopBanner', 'JxStore')
return JSON.parse(res[0].value)
} catch (e) {
throw e
}
}
// 更新bannerList
export const updateBannerList = async (value) => {
try {
const res = await APIUpdateConfig(json2query({
type: 'JxStore',
key: 'shopBanner',
value
}))
return res
} catch (e) {
throw e
}
}

460
src/apis/controls/order.js Normal file
View File

@@ -0,0 +1,460 @@
/* eslint-disable */
import { APIComplaintRider, APIGetOrdersSupplement, APIAddUpdateOrdersSupplement, APIGetOrderInfo, APIGetMatterOrderStatus, APISendFailedMatterOrder } from '@/apis/APIOrder.js'
import { json2query } from '@/utils'
import api from '@/utils/api.js'
import msgWarning from '@/tools/msgwarning.js'
import { hideLoad } from '@/tools/loading.js'
/**
* 查询订单全能接口 get /order/GetOrders
* keyword str
* fromDate str 2018-07-18
* toDate str
* vendorID int
* storeIDs str 京西门店ID列表 []
* statuss str 订单状态列表 [10, 15, 20, 110, 105, 115, 120]
* cities str 城市列表 []
* offset
* pageSize
*/
export const apiGetOrder = async (json,noLoading = true) => {
try {
let res = await api('v2/order/GetOrders', {
params: json,
noLoading
})
return res
} catch (e) {
throw e
}
}
/**
* 获取售后单信息
*/
export const apiGetAfsOrders = async (query, noLoading = true) => {
try {
let res = await api('v2/order/GetAfsOrders', {
params: query,
noLoading
})
return res
} catch (e) {
console.error('GetOrders', e)
throw e
}
}
/**
* 补充评价订单号
* userName
* appOrgCode 菜市589/5873 果园4123
* fromTime
* toTime
*/
// https://www.jxc4.com/v2/store/GetOrderID4Comment?userName=jxcaishi_cookie&appOrgCode=5873&fromTime=2024-07-25&toTime=2024-08-04
export const apiGetOrderID4Comment = async (query,noLoading = true) => {
try {
let res = await api('v2/store/GetOrderID4Comment', {
params: query,
noLoading
})
return res
} catch (error) {
console.error('GetOrders', e)
throw e
}
}
// 投诉骑手(三方运送)
// token string true "认证token"
// vendorOrderID string true "订单号"
// vendorID int true "订单所属厂商ID"
// waybillVendorID int true "运单所属厂商ID"
// complaintID int true "投诉原因ID"
export const complainRider = async (json) => {
try {
await APIComplaintRider(json2query(json))
} catch (e) {
throw e
}
}
// 重发京东物流
export const sendFailedMatterOrder = async (json) => {
try {
await APISendFailedMatterOrder(json2query(json))
} catch (e) {
throw e
}
}
//修改配送信息
export const updateOrderInfo = async (json = {}) => {
try {
let { vendorOrderID, vendorID, payload } = json
let form = new FormData()
form.append('vendorOrderID', vendorOrderID)
form.append('vendorID', vendorID)
form.append('payload', payload)
let res = await api('v2/order/UpdateOrderInfo', {
method: 'PUT',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
data: form,
})
return res
} catch (e) {
msgWarning(e)
} finally {
hideLoad()
}
}
export const APIdelOrderSkuInfo = async (json = {}) => {
try {
let { vendorOrderID, vendorID, ID } = json
let form = new FormData()
form.append('vendorOrderID', vendorOrderID)
form.append('vendorID', vendorID)
form.append('ID', ID)
let res = await api('v2/order/DelOrderSkuInfo', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
data: form,
})
return res
} catch (e) {
msgWarning(e)
} finally {
hideLoad()
}
}
//刷新报价订单的订单商品
export const refreshOrderSkuInfo = async (json = {}) => {
try {
let { vendorOrderID, vendorID, skuID } = json
let form = new FormData()
form.append('vendorOrderID', vendorOrderID)
form.append('vendorID', vendorID)
form.append('skuID', skuID)
let res = await api('v2/order/RefreshOrderSkuInfo', {
method: 'PUT',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
data: form,
})
return res
} catch (e) {
msgWarning(e)
} finally {
hideLoad()
}
}
// 查询门店订单扣款记录
/*
storeIDs 门店ID列表
vendorOrderID 订单ID
vendorIDs 订单所属厂商ID列表
fromTime 开始日期包含格式2006-01-02如果订单号为空此项必须要求
toTime 结束日期包含格式2006-01-02如果订单号为空此项必须要求
status 账单状态0是未结账1是已结账
type 扣款类型1为差评补贴2为优惠券
offset 结果起始序号以0开始缺省为0
pageSize 结果页大小缺省为50-1表示全部
*/
export const getOrdersSupplement = async (json, noLoading = true) => {
try {
let res = await APIGetOrdersSupplement(json, noLoading)
return res
} catch (e) {
throw e
}
}
// 新增/修改扣款记录
// payload
/*
新增
storeID int
vendorOrderID string
vendorID string
type int //扣款类型1为差评订单补贴2为优惠券
linkID int //作为冲账标志关联某条扣款记录若新增为某一记录的冲账则此字段填那条记录的id
supplementFee int //扣款金额
comment string //备注
----
修改
id int
createdAt time
storeID int
vendorOrderID string
vendorID string
status int //账单状态,若已结账则不允许再修改 ,暂时 0为未结账1为已结账,-1为作废
linkID int //作为冲账标志关联某条扣款记录
type int //扣款类型1为差评订单补贴2为优惠券
supplementFee int //扣款金额
billID string //账单ID后期可能关联账单用
comment string //备注
*/
export const addUpdateOrdersSupplement = async (payload, noLoading = true) => {
try {
let res = await APIAddUpdateOrdersSupplement(json2query({
payload: JSON.stringify(payload)
}), noLoading)
return res
} catch (e) {
throw e
}
}
// 得到订单详情
// vendorOrderID
// vendorID
// refresh
export const getOrderInfo = async (json, noLoading = true) => {
try {
let res = await APIGetOrderInfo({
...json,
refresh: false
}, noLoading)
return res
} catch (e) {
throw e
}
}
export const getMatterOrderStatus = async (vendorOrderID) => {
try {
const res = await APIGetMatterOrderStatus({ vendorOrderID })
return res || []
} catch (e) {
throw e
}
}
/**
* 添加小费
* @param {*} vendorOrderID 订单号
* @param {*} vendorID 厂商ID
* @param {*} tipFee 小费
*/
export const updateOrderWaybillTip = async ({
vendorOrderID,
vendorID,
tipFee
}) => {
try {
const res = await api('v2/order/UpdateOrderWaybillTip', {
method: 'POST',
data: json2query({
vendorOrderID,
vendorID,
tipFee
}),
noLoading: true
})
return res
} catch (e) {
throw e
}
}
export const updateOrderWaybillDesiredFee = async ({
vendorOrderID,
desiredFee,
}) => {
let formData = new FormData()
formData.append('vendorOrderID', vendorOrderID)
formData.append('desiredFee', desiredFee)
try {
const res = await api('v2/order/UpdateWaybillDesiredFee', {
method: 'PUT',
data: formData,
noLoading: true
})
return res
} catch (e) {
throw e
}
}
//刷新京东商城收货人信息
export const refreshReceiveManInfo = async (vendorOrderID) => {
let formData = new FormData()
formData.append('vendorOrderID', vendorOrderID)
try {
const res = await api('v2/order/RefreshJdsOrderConsigneeInfo', {
method: 'PUT',
data: formData,
noLoading: true
})
return res
} catch (e) {
throw e
}
}
//售前删除
export const delBeforeSale = async (skuID, vendorOrderID) => {
let formData = new FormData()
formData.append('vendorOrderID', vendorOrderID)
formData.append('skuID', skuID)
try {
const res = await api('v2/order/AdjustJdsOrderSimple', {
method: 'POST',
data: formData,
noLoading: true
})
return res
} catch (e) {
throw e
}
}
/*
得到订单sku信息 get /order/GetOrderSkuInfo
vendorOrderID str 订单ID
vendorID int 订单所属厂商ID
*/
export const getOrderSkus = async (vendorOrderID,vendorID, noLoading = true) => {
try {
let res = await api('v2/order/GetOrderSkuInfo', {
params: {
vendorOrderID,
vendorID
},
noLoading
})
return res
} catch (e) {
console.error('SendFailedMatterOrder', e)
throw e
}
}
/**
* @description 扫码枪 京西门店订单扫码枪扫码支付 post
* @Param token header string true "认证token"
* @Param vendorOrderID formData string true "订单ID"
* @Param paymentLabel formData string true "支付身份标示"
*
* @Param payType formData string true "扫码方式[tonglian/lakala]"
*
*/
export const pay4OrderByBarCodeScanner =async (vendorOrderID,paymentLabel,noLoading = false) => {
try {
let form = new FormData()
form.append('vendorOrderID', vendorOrderID)
form.append('paymentLabel', paymentLabel)
form.append('payType', 'lakala')
let res = await api('v2/jxorder/Pay4OrderByBarCodeScanner', {
method: 'POST',
data: form,
noLoading
})
if(res.includes('该终端不存在,请进行新增操作')){
throw res
}else {
return res
}
} catch (e) {
console.error('pay4OrderByBarCodeScanner', e)
throw e
}
}
/**
* @description 扫码枪 手动刷新扫码枪扫码支付订单状态 post
* @Param token header string true "认证token"
* @Param vendorOrderID formData string true "订单ID"
* @Param payType formData string true "扫码方式[tonglian/lakala]"
*
*/
export const refreshPayStatus =async (vendorOrderID,paymentLabel,noLoading = false) => {
try {
let form = new FormData()
form.append('vendorOrderID', vendorOrderID)
form.append('payType', 'lakala')
let res = await api('v2/jxorder/RefreshPayStatus', {
method: 'POST',
data: form,
noLoading
})
return res
} catch (e) {
console.error('refreshPayStatus', e)
throw e
}
}
/**
* @description 扫码枪 到店扫码支付订单退款 收获退款 post
* @Param token header string true "认证token"
* @Param vendorOrderID formData string true "订单ID"
* @Param skuIds formData string true "[key:value]退款商品 skuId:count,int"
* @Param Reason formData string true "退单原因"
*
* @Param payType formData string true "扫码方式[tonglian/lakala]"
*
*/
export const refundOnlineOrder = async (vendorOrderID,skuIds,reason,noLoading = false,payType) => {
try {
let form = new FormData()
form.append('vendorOrderID', vendorOrderID)
form.append('skuIds', JSON.stringify(skuIds))
form.append('reason', reason)
if(payType) form.append('payType', 'lakala')
let res = await api('v2/jxorder/RefundOnlineOrder', {
method: 'POST',
data: form,
noLoading
})
return res
} catch (e) {
console.error('refundOnlineOrder', e)
throw e
}
}
/**
* @description 支付宝 扫码枪 注册到通联,每个门店只有一个,要更改,必须先注销
* @router /TerminalRegister [post]
* @Param token header string true "认证token"
* @Param storeId formData int true "京西门店ID"
* @Param operation formData string true "当前操作00-新增,02-注销"
*/
export const terminalRegister = async (storeId,operation) => {
try {
let form = new FormData()
form.append('storeId', storeId)
form.append('operation', operation)
let res = await api('v2/jxorder/TerminalRegister', {
method: 'POST',
data:form
})
return res
} catch (error) {
throw error
}
}
/**
* 扫码订单刷新售后信息
* @Param afsOrderId formData string true 售后订单id
* @Param payType formData string true "扫码方式[tl/lkl]"
*/
export const queryBarCodeRefundStatus = async (afsOrderId,payType = 'lakala') => {
try {
let form = new FormData()
form.append('afsOrderId', afsOrderId)
form.append('payType', payType)
let res = await api('v2/jxorder/QueryBarCodeRefundStatus', {
method: 'POST',
data:form
})
return res
} catch (error) {
throw error
}
}

View File

@@ -0,0 +1,42 @@
import {
APIQueryActs,
APIUpdateActStoreSkuBind
} from '@/apis/APIPromotion.js'
import {getStoreSku} from '@/apis/controls/storeSku.js'
import {json2query} from '@/utils'
// 改价取消直降活动
export const updatePriceCancelType3Promotions = async (nameID, storeID) => {
try {
// 先查询skuIDs
const {skus} = await getStoreSku(storeID, nameID)
const reqPromotions = []
if (skus) {
// skus存在查询活动
skus.forEach(item => {
if (item.actType === 3) {
reqPromotions.push(APIQueryActs({skuID: item.id, storeID}))
}
})
}
const promotions = await Promise.all(reqPromotions)
const reqCancels = []
promotions.forEach(data => {
if (data) {
data.forEach(item => {
reqCancels.push(APIUpdateActStoreSkuBind(json2query({
actID: item.actID,
actStoreSkuDeleteList: JSON.stringify([{
skuID: item.skuID,
storeID: item.storeID
}]),
isAsync: true
})))
})
}
})
await Promise.all(reqCancels)
} catch (e) {
console.error(e)
}
}

View File

@@ -0,0 +1,68 @@
import {APIReportForOrders,APIGetStoreManageState} from '@/apis/APIreport.js'
import {json2query} from '@/utils'
/* token *
string
(header)
认证token
storeIDs *
string
(formData)
京西门店ID列表[1,2,3]
fromDate
string
(formData)
开始日期包含格式2006-01-02 00:00:00)
toDate
string
(formData)
结束日期(包含) */
export const orderReport = async (json) => {
try {
let res = await APIReportForOrders(json2query(json))
return res
} catch (e) {
throw e
}
}
//查询门店经营数据
export const getStoreManageState = async (json) => {
try {
let res = await APIGetStoreManageState(json)
return res
} catch (e) {
throw e
}
}
/* [{}]
storeID: 100113 // 门店ID
name // 门店名称
marketManName // 市场负责人
operatorName // 运营负责人1
operatorName2 // 运营负责人2
orderCounts: 386 // 订单数量
discountMoney: 502664 // 订单优惠
actualPayPrice: 1698830 // 实际支付
earningPrice: 0 // 预计收益
salePrice: 2026184 // 售卖价
shopPrice: 1996349 // 京西价
desiredFee: 1000 // 配送费
waybillTipMoney: 5200 // 京西已加配送小费
distanceFreightMoney: 18400 // 远距离配送费
pmSubsidyMoney: 120759 // 平台补贴
totalShopMoney: 1457947 // 平台结算
totalGrossProfit: 132962 // 总毛利
comGrossProfit: 132962 // 公司毛利
cityManagerGrossProfit: 0 // 城市经理毛利
*/

135
src/apis/controls/shop.js Normal file
View File

@@ -0,0 +1,135 @@
import { APIGetStores, APIAddStoreMap, APIUpdateStoreMap, APISendStoreMessage, APIUpdateStore, APIGetVendorStore } from '@/apis/APIshop.js'
import { json2query } from '@/utils'
// 跳转到门店
export const goStore = (context, storeID) => {
let routeData = context.$router.resolve({
name: 'JxStoreManager',
query: { storeID }
})
window.open(routeData.href, '_blank')
}
// 查询门店
export const getStores = async (json, noLoading) => {
try {
let res = await APIGetStores(json2query(json), noLoading)
return res
} catch (e) {
throw e
}
}
export const proxyGetStores = (function () {
const cacheObj = {}
return function () {
let args = Array.prototype.join.call(arguments, ',')
if (args in cacheObj) {
return cacheObj[args]
}
cacheObj[args] = getStores(...arguments)
return cacheObj[args]
}
})()
// 通过关键字查询所有门店
export const getAllStoresByKeyword = async (marketManPhone, noLoading) => {
try {
let res = await getStores({
marketManPhone,
offset: 0,
pageSize: -1
}, noLoading)
return res
} catch (e) {
throw e
}
}
// 查询单个门店信息
export const getOneStore = async (storeID, noLoading = true) => {
try {
let res = await getStores({
storeIDs: JSON.stringify([storeID]),
offset: 0,
pageSize: -1
}, noLoading)
return res
} catch (e) {
throw e
}
}
/**
* 添加平台门店绑定
* @param {*} storeID
* @param {*} vendorID
* @param {*} vendorOrgCode 选填
* @param {*} payload {"vendorStoreID":"103083","autoPickup":1,"deliveryCompetition":1,"pricePercentage":100,"isSync":1,"pricePercentagePack":"美团调价策略7.18"}
*/
export const addStoreMap = async (json, noLoading = false) => {
try {
await APIAddStoreMap(json2query(json), noLoading)
} catch (e) {
throw e
}
}
/**
* 修改平台门店绑定
* @param {*} storeID
* @param {*} vendorID
* @param {*} payload {"vendorStoreID":"103083","autoPickup":1,"deliveryCompetition":1,"pricePercentage":100,"isSync":1,"pricePercentagePack":"美团调价策略7.18"}
*/
export const updateStoreMap = async (json, noLoading = false) => {
try {
await APIUpdateStoreMap(json2query(json), noLoading)
} catch (e) {
throw e
}
}
/**
* 修改门店
* @param {*} storeID
* @param {*} payload
*/
export const updateStore = async (json, noLoading = false) => {
try {
await APIUpdateStore(json2query(json), noLoading)
} catch (e) {
throw e
}
}
/* 发送消息
storeIDs
title
content
isAsync
isContinueWhenError
*/
export const sendMsg = async (json, noLoading = false) => {
try {
let res = await APISendStoreMessage(json2query(json), noLoading)
return res
} catch (e) {
throw e
}
}
// 更新门店信息
/* 查询远端门店
vendorStoreID
vendorID
vendorOrgCode
*/
export const getVendorStore = async (json) => {
try {
const res = await APIGetVendorStore(json)
return res
} catch (e) {
throw e
}
}

View File

@@ -0,0 +1,64 @@
import {APIGetSkuNames,APIGetSkuNamesNew, APIGetTopSkusByCityCode, APIGetSkuNamesPOST} from '@/apis/APISkuNames'
import {json2query} from '@/utils'
export const getSkuNames = async (json, noLoading) => {
try {
let res = await APIGetSkuNames(json, noLoading)
return res
} catch (e) {
throw e
}
}
export const getSkuNamesNew = async (json, noLoading) => {
try {
let res = await APIGetSkuNamesNew(json, noLoading)
return res
} catch (e) {
throw e
}
}
export const getSkuNamesPOST = async (json, noLoading) => {
try {
let res = await APIGetSkuNamesPOST(json2query(json), noLoading)
return res
} catch (e) {
throw e
}
}
export const getSkuNamesBySkuIDs = async (skuIDs) => {
try {
let res = await getSkuNamesPOST({
skuIDs: JSON.stringify(skuIDs),
offset: 0,
pageSize: -1,
isBySku: true
}, true)
return res
} catch (e) {
throw e
}
}
export const getSkuNamesByNameIDs = async (nameIDs) => {
try {
let {skuNames} = await getSkuNames({
nameIDs: JSON.stringify(nameIDs),
offset: 0,
pageSize: -1,
isBySku: false
}, true)
return skuNames
} catch (e) {
throw e
}
}
export const getTopSkusByCityCode = async (json) => {
try {
let res = APIGetTopSkusByCityCode(json)
return res
} catch (e) {
throw e
}
}

View File

@@ -0,0 +1,111 @@
import {
APIUpdateStoreSkus,
APIGetStoresSkus,
APIStoreSkuPriceAudit,
APIUpdateStoresSkusWithoutSync,
APIStoreAudit
} from '@/apis/APIstoreSku.js'
import { json2query } from '@/utils'
/* 修改单门店商品
storeID
payload
isContinueWhenError
isAsync
----payload
{
nameID: id,
unitPrice: price,
isFocus: ,
statusSaleBegin
statusSaleEnd
skus: [
{
skuID: id,
isSale:
}
]
}
*/
export const updateStoreSkus = async (json, noLoading = false) => {
try {
json.storeIDs = [json.storeID]
let res = await APIUpdateStoreSkus(json2query(json), noLoading)
return res
} catch (e) {
throw e
}
}
export const getStoreSku = async (storeID, skuNameID, isFocus = true) => {
try {
const { skuNames } = await APIGetStoresSkus({
nameIDs: JSON.stringify([skuNameID]),
storeIDs: JSON.stringify([storeID]),
isFocus
})
return skuNames ? skuNames[0] : null
} catch (e) {
throw e
}
}
export const getStoreSkus = async (storeID, skuIDs, isFocus = true) => {
try {
const { skuNames } = await APIGetStoresSkus({
skuIDs: JSON.stringify(skuIDs),
storeIDs: JSON.stringify([storeID]),
isFocus,
fromStatus: 0,
toStatus: 1,
pageSize: -1,
isBySku: true
})
return skuNames || []
} catch (e) {
throw e
}
}
/**
* status 1 批准 -1 拒绝
* isAsync
* isContinueWhenError
* payload: [{}]
StoreID int `orm:"column(store_id)" json:"storeID"`
NameID int `orm:"column(name_id)" json:"nameID"` // 这个根据type不同可能是SKUNAME ID或SKU ID
AuditPrice int `json:"auditPrice"` //运营录入的审核价格
Remark string `orm:"size(255)" json:"remark"`
*/
export const storeSkuPriceAudit = async (json, noLoading) => {
try {
return await APIStoreSkuPriceAudit(json2query(json))
} catch (e) {
throw e
}
}
export const storeAudit = async (json, noLoading) => {
try {
return await APIStoreAudit(json2query(json))
} catch (e) {
throw e
}
}
/**
* 批量修改门店商品,不同步
* @param {*} json 数据
* @param {*} noLoading 不显示loading
* storeIDs
* payload
* payload=[{nameID, unitPrice, isFocus, isSale}]
* isRefreshHigh
*/
export const updateStoresSkusWithoutSync = async (json) => {
try {
return await APIUpdateStoresSkusWithoutSync(json2query(json))
} catch (e) {
throw e
}
}

87
src/apis/controls/user.js Normal file
View File

@@ -0,0 +1,87 @@
import {APIGetUsers, APIAddUsers4Role, APIUpdateUserWxNoAndPercent, APIDeleteUserInfo} from '@/apis/APIUser'
import {json2query} from '@/utils'
/**
* 得到用户列表
* GET
* /user2/GetUsers
* @param {Number} userType* 用户类型0表示全部
* @param {String} keyword 关键字
* ...userIDs
*/
// 得到一个用户
export const getOneUser = async (keyword, noLoading = true) => {
try {
let {totalCount, data} = await APIGetUsers({
userType: 0,
keyword
}, noLoading)
return totalCount ? data[0] : null
} catch (e) {
throw e
}
}
// 得到一个用户
export const getOneUserInfoWithAuth = async (mobile, noLoading = true) => {
try {
let {totalCount, data} = await APIGetUsers({
userType: 0,
mobile
}, noLoading)
return totalCount ? data[0] : null
} catch (e) {
throw e
}
}
/**
* 给指定**角色**添加**用户**列表
* POST
* /user2/AddUsers4Role
* formData
* @param {String} roleName* 角色名 (必填)
* @param {Number} storeID 门店ID
* @param {Array<String>} userIDs* 用户ID列表 (必填)
*/
// 给门店添加用户
export const addUsers4Role = async (json, noLoading = true) => {
try {
let res = await APIAddUsers4Role(json2query(json), noLoading)
return res
} catch (e) {
throw e
}
}
/**
* 更新用户分成比例
* userID
* dividePercentage
* isReceiver
*/
export const updateUserPercent = async (json, noLoading = true) => {
try {
const reqJson = {
...json,
isReceiver: true
}
let res = await APIUpdateUserWxNoAndPercent(json2query(reqJson), noLoading)
return res
} catch (e) {
throw e
}
}
/**
* 禁用用户
* @param {*} userID
* @param {*} noLoading
*/
export const deleteUser = async (userID, noLoading = true) => {
try {
const res = await APIDeleteUserInfo(userID, noLoading)
return res
} catch (e) {
throw e
}
}

30
src/apis/financial.js Normal file
View File

@@ -0,0 +1,30 @@
import $ajax from 'axios'
// import {Message} from 'element-ui'
import {hideLoad} from '@/tools/loading.js' // 引入封装的loading方法
import msgWarning from '@/tools/msgwarning.js'
/*
查询任务进度 get /task/GetTasks
taskID str 任务ID
fromStatus int 起始状态
toStatus int 结束状态
lastHours int 多少小时以内的
*/
function getTasks (params, fn) {
$ajax.get('v2/task/GetTasks', {
params: params
}).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
export {getTasks}

View File

@@ -0,0 +1,21 @@
import $ajax from 'axios'
// import {Message} from 'element-ui'
import {hideLoad} from '@/tools/loading.js'
import msgWarning from '@/tools/msgwarning.js'
/*
得到服务相关的一些基础信息,包括版本,及一些元数据信息 get /cms/GetServiceInfo
*/
function getServiceInfo (fn) {
$ajax.get('v2/cms/GetServiceInfo').then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
export {getServiceInfo}

245
src/apis/goods.js Normal file
View File

@@ -0,0 +1,245 @@
import $ajax from 'axios'
// import {Message} from 'element-ui'
import {hideLoad} from '@/tools/loading.js'
import msgWarning from '@/tools/msgwarning.js'
import api from '@/utils/api.js'
/*
得到商品信息 get /sku/GetSkuNames
keyword str 查询关键字
nameIDs str SkuName IDs列表
skuIDs str Sku ID列表
id int SkuName ID
name str 商品名称
prefix str 商品前缀
placeCode int 可售地点Code
isGlobal boo 是否全国可售
categoryID int 商品所属类别ID
skuCategoryID int sku分类
unit str 商品单位
vendorSkuIDs str 商品平台ID
fromStatus int 查询起始状态0正常 1下架
toStatus int 查询结束状态0正常 1下架
offset int 起始序号
pageSize int 列表页大小 -1表示全部
nameIDs
skuIDs
*/
function getSkuNames (json, fn) {
$ajax.get('v2/sku/GetSkuNames', {
params: json
}).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
function getSkuNamesNew (json, fn) {
$ajax.get('v2/sku/GetSkuNamesNew', {
params: json
}).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
/*
删除整个商品 skuName delete /sku/DeleteSkuName
nameID int 商品名ID
*/
function deleteSkuName (nameID, fn) {
$ajax.delete('v2/sku/DeleteSkuName', {
params: {
nameID
}
}).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
export async function deleteSkuName2 (nameID, fn, noSyncAlert) {
try {
let res = await api('v2/sku/DeleteSkuName', {
method: 'DELETE',
params: {
nameID
},
noSyncAlert
})
if (res.code && res.code === '-105') {
fn && fn(res)
} else {
fn && fn({code: '0'})
}
} catch (e) {
fn && fn(e)
}
}
/*
删除商品规格sku delete /sku/DeleteSku
skuID int 商品ID
*/
async function deleteSku (skuID, fn) {
try {
let res = await api('v2/sku/DeleteSku', {
method: 'DELETE',
params: {
skuID
}
})
if (res.code && res.code === '-105') {
fn && fn(res)
} else {
fn && fn({code: '0'})
}
} catch (e) {
fn && fn(e)
}
}
/*
修改SkuName put /sku/UpdateSkuName
nameID int 商品名ID
payload str json skus, places无效
*/
async function updateSkuName (nameID, json, fn, extraJson) {
try {
let data = `nameID=${nameID}&payload=${encodeURIComponent(JSON.stringify(json))}`
if (extraJson && ('isExd' in extraJson)) {
data += `&isExd=true`
}
let res = await api('v2/sku/UpdateSkuName', {
method: 'PUT',
data
})
if (res.code && res.code === '-105') {
fn && fn(res)
} else {
fn && fn({code: '0'})
}
} catch (e) {
fn && fn(e)
}
}
/*
得到厂商商品类别 get /sku/GetVendorCategories
vendorID int 厂商ID
parentID int -1表示所有缺省为-1
*/
/*
增加商品 post /sku/AddSkuName
payload json
*/
function AddSkuName (json, fn) {
let formData = new FormData()
formData.append('payload', JSON.stringify(json))
$ajax.post('v2/sku/AddSkuName', formData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
fn && fn(res.data)
}).catch(err => {
hideLoad()
})
}
/*
更新sku put /sku/UpdateSku
skuID int 商品名id
payload json
*/
async function updateSku (skuID, json, fn) {
try {
let res = await api('v2/sku/UpdateSku', {
method: 'PUT',
data: `skuID=${skuID}&payload=${encodeURIComponent(JSON.stringify(json))}`
})
if (res.code && res.code === '-105') {
fn && fn(res)
} else {
fn && fn({code: '0'})
}
} catch (e) {
fn && fn(e)
}
}
/*
添加sku post /sku/AddSku
nameID int skuName ID
payload json
*/
async function AddSku (nameID, json, fn) {
try {
let res = await api('v2/sku/AddSku', {
method: 'POST',
data: `nameID=${nameID}&payload=${encodeURIComponent(JSON.stringify(json))}`
})
if (res.code && res.code === '-105') {
fn && fn(res)
} else {
fn && fn({code: '0', data: res})
}
} catch (e) {
fn && fn(e)
}
}
/**
* 获取分类信息
*/
async function getCate(params,noLoading =true) {
try {
let res = await api('v2/sku/GetVendorCategories', {
params,
noLoading
})
return res
} catch (error) {
console.log('error',error)
}
}
/*
添加sku post /sku/AddSku
nameID int skuName ID
payload json
*/
function transformJdSpu2SkuApi (nameIDs, fn) {
let formData = new FormData()
formData.append('nameIDs', nameIDs)
$ajax.post('v2/initdata/TransformJdSpu2Sku', formData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
fn && fn(res.data)
}).catch(err => {
hideLoad()
})
}
export {getSkuNames, getSkuNamesNew,deleteSku, deleteSkuName, updateSkuName, AddSkuName, updateSku, AddSku, transformJdSpu2SkuApi,getCate}

133
src/apis/groupmanager.js Normal file
View File

@@ -0,0 +1,133 @@
import $ajax from 'axios'
// import {Message} from 'element-ui'
import {hideLoad} from '@/tools/loading.js'
import msgWarning from '@/tools/msgwarning.js'
/*
得到门店用户信息 get /user/TmpGetStoreUsers
storeID int jx门店ID
*/
function getStoreUsers (storeID, fn) {
$ajax.get('v2/user/TmpGetStoreUsers', {
params: {
storeID
}
}).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
/*
得到用户门店及成员信息 get /user/TmpGetUserInfo
mobile str 手机号
*/
function getUserInfo (mobile, fn) {
$ajax.get('v2/user/TmpGetUserInfo', {
params: {
mobile
}
}).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
/*
解绑 put /user/TmpUnbindMobile
此操作会将此手机关联的所有门店信息清除(取消组长,取消自己为他组组员),如果此人为组长,取消后组员也相应会取消门店绑定(但组员的成员关系还在)
mobile str 手机号
*/
function unbindMobile (mobile, fn) {
let formData = new FormData()
formData.append('mobile', mobile)
$ajax.put('v2/user/TmpUnbindMobile', formData).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
/*
给店长绑定组员 put
/user/TmpAddMobile2Mobile
parentMobile str 店长手机号
mobile str 要绑定的手机号
*/
function addMobile2Mobile (parentMobile, mobile, fn) {
let formData = new FormData()
formData.append('parentMobile', parentMobile)
formData.append('mobile', mobile)
$ajax.put('v2/user/TmpAddMobile2Mobile', formData).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
/*
绑定店长 put /user/TmpBindMobile2Store
此操作会将此手机设置成为相应门的组长,如果之前有组员关系,则此操作后,组员也会自动与门店绑定
mobile str 手机号
storeID int 门店ID
*/
function bindMobile2Store (mobile, storeID, fn) {
let formData = new FormData()
formData.append('mobile', mobile)
formData.append('storeID', storeID)
$ajax.put('v2/user/TmpBindMobile2Store', formData).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
/*
修改手机号 put /user/TmpChangeMobile
curMobile str 当前手机号
expectedMobile str 手机号
*/
function changeMobile (curMobile, expectedMobile, fn) {
let formData = new FormData()
formData.append('curMobile', curMobile)
formData.append('expectedMobile', expectedMobile)
$ajax.put('v2/user/TmpChangeMobile', formData).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
export {getStoreUsers, getUserInfo, unbindMobile, addMobile2Mobile, bindMobile2Store, changeMobile}

1227
src/apis/lakala/lakala.js Normal file

File diff suppressed because it is too large Load Diff

53
src/apis/login.js Normal file
View File

@@ -0,0 +1,53 @@
import $ajax from 'axios'
// import {Message} from 'element-ui'
import {hideLoad} from '@/tools/loading.js' // 引入封装的loading方法
import {getRoot} from '@/utils/updateCheck.js'
// 登录成功接口 post
// id str
// type str 当前支持[weixinsns,localpass]
// secret str 密码
function reqLogin (id, secret, fn) {
let formData = new FormData()
formData.append('id', id)
formData.append('type', 'localpass')
formData.append('secret', secret)
$ajax.post('/v2/auth/Login', formData).then(res => {
hideLoad()
fn && fn(res.data)
}).catch(err => {
hideLoad()
})
}
function reqLogin2 (loginForm, fn) {
let formData = new FormData()
formData.append('authType', loginForm.authType)
formData.append('authIDType', loginForm.authIDType)
formData.append('authID', loginForm.authID)
formData.append('authSecret', loginForm.authSecret)
$ajax.post('v2/auth2/Login', formData).then(res => {
hideLoad()
fn && fn(res.data)
}).catch(err => {
hideLoad()
})
}
// 获取用户信息 get
// token str
async function getUserInfo (token, fn) {
await getRoot()
$ajax.get('v2/auth2/GetTokenInfo', {}, {
headers: {
token: token
}
}).then(res => {
hideLoad()
fn && fn(res.data)
}).catch(err => {
hideLoad()
})
}
export {reqLogin, reqLogin2, getUserInfo}

352
src/apis/order.js Normal file
View File

@@ -0,0 +1,352 @@
import $ajax from 'axios'
import { Message } from 'element-ui'
import { hideLoad } from '@/tools/loading.js' // 引入封装的loading方法
import msgWarning from '@/tools/msgwarning.js'
import { json2query } from '@/utils'
// import {api} from '@/utils/api'
// 同步方法
// 获取订单数量 get
function getOrderCount(fn) {
$ajax.get('/mock/getOrderCount').then(res => {
hideLoad()
if (res.data.code === 'success') {
fn && fn(res.data.data)
} else {
Message({
message: res.msg
})
}
}).catch(err => {
hideLoad()
})
}
// 今日营业概况 get
function getBusinessInfo(fn) {
$ajax.get('/mock/businessInfo').then(res => {
hideLoad()
if (res.data.code === 'success') {
fn && fn(res.data.data)
} else {
Message({
message: res.msg,
center: true
})
}
}).catch(err => {
hideLoad()
})
}
// 个平台概况 get
function getPlatformInfo(fn) {
$ajax.get('/mock/platformInfo').then(res => {
hideLoad()
if (res.data.code === 'success') {
fn && fn(res.data.data)
} else {
Message({
message: res.msg
})
}
}).catch(err => {
hideLoad()
})
}
/*
创建三方运单 post /order/CreateWaybillOnProviders
vendorOrderID str 订单ID
vendorID int 订单所属厂商ID
*/
function createWaybill(vendorOrderID, vendorID, forceCreate, maxAddFee, maxDiffFee2Mtps, courierVendorIDs, fn) {
let formData = new FormData()
formData.append('vendorOrderID', vendorOrderID)
formData.append('vendorID', vendorID)
formData.append('forceCreate', forceCreate)
if (courierVendorIDs && courierVendorIDs.length > 0) formData.append('courierVendorIDs', JSON.stringify(courierVendorIDs))
if (maxAddFee) formData.append('maxAddFee', maxAddFee)
if (maxDiffFee2Mtps) formData.append('maxDiffFee2Mtps', maxDiffFee2Mtps)
$ajax.post('/v2/order/CreateWaybillOnProviders', formData).then(res => {
hideLoad() // 关闭加载中
if (res.data.code === '0') {
fn && fn(res.data)
} else {
// 弹出提示框
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad() // 关闭加载中
})
}
export function createWaybillForce(vendorOrderID, vendorID, fn) {
let formData = new FormData()
formData.append('vendorOrderID', vendorOrderID)
formData.append('vendorID', vendorID)
formData.append('forceCreate', true)
$ajax.post('/v2/order/CreateWaybillOnProviders', formData).then(res => {
hideLoad() // 关闭加载中
if (res.data.code === '0') {
fn && fn(res.data)
} else {
// 弹出提示框
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad() // 关闭加载中
})
}
/*
取消订单当前所有三方运单 post /order/order/CancelAll3rdWaybills
vendorOrderID str 订单ID
vendorID int 订单所属厂商ID
*/
function cancelAll3rdWaybillsApi(vendorOrderID, vendorID, fn, isStopSchedule) {
let formData = new FormData()
formData.append('vendorOrderID', vendorOrderID)
formData.append('vendorID', vendorID)
if (isStopSchedule) formData.append('isStopSchedule', true)
$ajax.post('/v2/order/CancelAll3rdWaybills', formData).then(res => {
hideLoad() // 关闭加载中
if (res.data.code === '0') {
fn && fn(res.data)
} else {
// 弹出提示框
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad() // 关闭加载中
})
}
/*
取消订单运单 post /order/order/CancelWaybill
// @Param token header string true "认证token"
// @Param vendorWaybillID formData string true "运单ID"
// @Param waybillVendorID formData int true "运单所属的厂商ID"
// @Param reasonID formData int false "原因ID"
// @Param reason formData string false "取消
*/
function cancelWaybillsApi(vendorWaybillID, waybillVendorID, reasonID, reason, fn) {
let formData = new FormData()
formData.append('vendorWaybillID', vendorWaybillID)
formData.append('waybillVendorID', waybillVendorID)
if (reasonID) formData.append('reasonID', reasonID)
if (reason) formData.append('reason', reason)
$ajax.post('/v2/order/CancelWaybill', formData).then(res => {
hideLoad() // 关闭加载中
if (res.data.code === '0') {
fn && fn(res.data)
} else {
// 弹出提示框
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad() // 关闭加载中
})
}
/*
转门店自送 post /order/SelfDelivering
vendorOrderID str 订单ID
vendorID int 订单所属厂商ID
*/
function selfDelivering(vendorOrderID, vendorID, riderName, riderTel, fn) {
let formData = new FormData()
formData.append('vendorOrderID', vendorOrderID)
formData.append('vendorID', vendorID)
if (vendorID === 14 || vendorID === 3 || vendorID === 1 || vendorID === 16 || vendorID === 0) {
formData.append('courierName', riderName)
formData.append('courierMobile', riderTel)
}
$ajax.post('/v2/order/SelfDelivering', formData).then(res => {
hideLoad() // 关闭加载中
if (res.data.code === '0') {
fn && fn(res.data)
} else {
// 弹出提示框
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad() // 关闭加载中
})
}
//售前删除
function delBeforeSale(vendorOrderID, skuID, fn) {
let formData = new FormData()
formData.append('vendorOrderID', vendorOrderID)
formData.append('skuID', skuID)
$ajax.post('/v2/order/AdjustJdsOrderSimple', formData).then(res => {
hideLoad() // 关闭加载中
if (res.data.code === '0') {
fn && fn(res.data)
} else {
// 弹出提示框
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad() // 关闭加载中
})
}
function ExportOrderWithSku(json, fn) {
$ajax.get('v2/order/ExportOrderWithSku', {
params: json,
timeout: 1000 * 300
}).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
export function getOrdersPost(json, fn) {
$ajax.post('v2/order/GetOrders', json2query(json), {
timeout: 1000 * 300
}).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
/*
得到订单运单信息 get /order/GetOrderWaybillInfo
vendorOrderID str 订单ID
vendorID int 订单所属厂商
*/
function getOrderWaybillInfo(vendorOrderID, vendorID, fn) {
$ajax.get('v2/order/GetOrderWaybillInfo', {
params: {
vendorOrderID,
vendorID
}
}).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
// 取消订单
function cancelOrder(vendorOrderID, vendorID, reason, fn) {
let formData = new FormData()
formData.append('vendorOrderID', vendorOrderID)
formData.append('vendorID', vendorID)
if (reason.trim()) formData.append('reason', reason)
$ajax.put('/v2/order/CancelOrder', formData).then(res => {
hideLoad() // 关闭加载中
if (res.data.code === '0') {
fn && fn(res.data)
} else {
// 弹出提示框
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad() // 关闭加载中
})
}
/*
查询订单/运单状态 get /order/GetOrderStatusList
vendorOrderID str 订单ID
vendorID int 订单所属厂商
orderType int 订单1 运单2 订单+运单 -1
id: 56522
orderType: 1
refVendorID: 0 源订单厂商
refVendorOrderID: "817279388000141" 源订单ID
remark: "" 备注
status: 5 状态
statusTime: "2018-07-19T23:49:47+08:00" 时间
vendorID: 0
vendorOrderID: "817279388000141" 可能是订单可能是运单要看orderType
vendorStatus: "32000"
----------------------
orderStatus:
5: "新订单"
8: "调整单"
10: "已接单"
15: "已拣货"
20: "配送中"
105: "送达"
110: "完成"
115: "取消"
120: "失败"
waybillStatus:
5: "新运单"
8: "取消接受"
10: "已接单"
15: "已到店"
20: "配送中"
105: "送达"
115: "取消"
120: "失败"
*/
export { getOrderCount, getBusinessInfo, getPlatformInfo, createWaybill, ExportOrderWithSku, getOrderWaybillInfo, cancelAll3rdWaybillsApi, cancelWaybillsApi, selfDelivering, cancelOrder, delBeforeSale }
/*
order
actualFee: 0
actualPayPrice: 2037
businessType: 1
buyerComment: ""
consigneeAddress: "合肥市蜀山区御湖观邸4#202"
consigneeMobile: "13285650429,2865"
consigneeName: "陈珺"
courierMobile: "18256922755"
courierName: "邢海珍"
currentConsigneeMobile: ""
deliveryFlag: 0
desiredFee: 0
expectedDeliveredTime: "2018-11-14T16:38:00+08:00"
goodsCount: 8
jxStoreID: 100498
lockStatus: 0
orderCreatedAt: "2018-11-14T15:37:00+08:00"
orderFinishedAt: "2018-11-14T15:54:52+08:00"
orderSeq: 11
salePrice: 1587
shopPrice: 5561
skuCount: 8
status: 105
storeID: 100498
storeName: "京西菜市-海恒店(可免邮)"
vendorID: 0
vendorOrderID: "827445005000021"
vendorOrderID2: ""
vendorStoreID: "11749726"
vendorWaybillID: "827445005000021"
waybillCreatedAt: "2018-11-14T15:39:21+08:00"
waybillFinishedAt: "2018-11-14T15:54:52+08:00"
waybillStatus: 105
waybillVendorID: 0
weight: 2500
*/

187
src/apis/permission.js Normal file
View File

@@ -0,0 +1,187 @@
import api from '@/utils/api.js'
import msgWarning from '@/tools/msgwarning.js'
// 权限菜单相关接口 by Master Wan
// 添加功能(菜单)
// payload:
// color: "" //字体颜色
// imgURL: "https://image.jxc4.com/image/432cc6451cd5376dd8f13ca46600d731.tem.png" //图标地址
// level: 1 等级
// name: "首页" 菜单名
// parentID: 0 父级ID
export const addMenu = async (payload, noLoading = true) => {
let form = new FormData()
form.append('payload ', JSON.stringify(payload))
try {
let res = await api('v2/power/AddMenu', {
method: 'POST',
data: form,
noLoading
})
return res
} catch (e) {
console.error('AddMenu', e)
msgWarning(e)
throw e
}
}
//添加角色
// name 角色名
export const addRole = async (name, noLoading = true) => {
let form = new FormData()
form.append('name', name)
try {
let res = await api('v2/power/AddRole', {
method: 'POST',
data: form,
noLoading
})
return res
} catch (e) {
console.error('AddRole', e)
throw e
}
}
//获取菜单
export const getMenu = async (userID='' , noLoading = true) => {
try {
let res = await api(`v2/power/GetMenu?userID=${userID}`, {
noLoading
})
return res
} catch (e) {
console.error('GetMenu', e)
msgWarning(e)
throw e
}
}
//查询用户角色
export const getUserRole = async (userID = '', noLoading = true) => {
try {
let res = await api(`v2/power/GetUserRole?userID=${userID}`, {
noLoading
})
return res
} catch (e) {
console.error('GetUserRole', e)
msgWarning(e)
throw e
}
}
//查询角色的菜单
// roleID 用户ID int
export const getRoleMenu = async (roleID, noLoading = true) => {
try {
let res = await api(`v2/power/GetRoleMenu?roleID=${roleID}`, {
noLoading
})
return res
} catch (e) {
console.error('GetRoleMenu', e)
throw e
}
}
//查询角色
export const getRole = async (name,noLoading = true) => {
try {
let url = name ? `v2/power/GetRole?name=${name}`: 'v2/power/GetRole'
let res = await api(url, { noLoading })
return res
} catch (e) {
console.error('GetRole', e)
throw e
}
}
//修改菜单
export const UpdateMenu = async (json, noLoading = true) => {
let form = new FormData()
form.append('payload', json.payload)
form.append('menuID', json.menuID)
form.append('isDelete', json.isDelete)
try {
let res = await api('v2/power/UpdateMenu', {
method: 'PUT',
data: form,
noLoading
})
return res
} catch (e) {
console.error(e)
throw e
}
}
//修改角色
export const UpdateRole = async (json, noLoading = true) => {
let form = new FormData()
form.append('name', json.name)
form.append('roleID', json.roleID)
if(json.brandID) form.append('brandID', json.brandID)
if(json.cityCodes) form.append('cityCodes', JSON.stringify(json.cityCodes))
if(json.storeIDs) form.append('storeIDs', JSON.stringify(json.storeIDs))
form.append('isDelete', json.isDelete)
try {
let res = await api('v2/power/UpdateRole', {
method: 'PUT',
data: form,
noLoading
})
return res
} catch (e) {
console.error(e)
throw e
}
}
//修改角色菜单
export const UpdateRoleMenu = async (roleIDs, menuIDs, noLoading = true) => {
let form = new FormData()
form.append('roleIDs', JSON.stringify([roleIDs]))
form.append('menuIDs', JSON.stringify(menuIDs))
try {
let res = await api('v2/power/UpdateRoleMenu', {
method: 'PUT',
data: form,
noLoading
})
return res
} catch (e) {
console.error(e)
throw e
}
}
//修改用户角色
export const UpdateUserRole = async (json, noLoading = true) => {
let form = new FormData()
form.append('userIDs', JSON.stringify(json.userIDs))
form.append('roleIDs', JSON.stringify(json.roleIDs))
try {
let res = await api('v2/power/UpdateUserRole', {
method: 'PUT',
data: form,
noLoading
})
return res
} catch (e) {
console.error(e)
throw e
}
}

View File

@@ -0,0 +1,97 @@
import $ajax from 'axios'
import api from '@/utils/api.js'
// import {hideLoad} from '@/tools/loading.js'
import msgWarning from '@/tools/msgwarning.js'
import { hideLoad } from '@/tools/loading.js'
function getJdDaojiaApi(params, fn) {
$ajax.get('jd/client', {
params: params,
timeout: 1000 * 600
}).then(res => {
if (res.data.code === '0') {
fn && fn(res.data)
} else if (res.data.code === '90003') {
msgWarning(params.body.storeId + '-' + res.data.detail)
} else {
msgWarning(res.data.detail)
}
}).catch(err => {
})
}
const getJdDaojiaApi2 = async (params) => {
const res = await $ajax.get('jd/client', {
params: params,
timeout: 1000 * 600
})
if (res.data.code === '0') {
return res.data
} else if (res.data.code === '90003') {
msgWarning(params.body.storeId + '-' + res.data.detail)
} else {
msgWarning(res.data.detail)
}
}
const getJdDaojiaApi3 = async (vendorStoreID) => {
const res = await $ajax.get('v2/store/GetJddjStoreInfo', {
params: {
vendorStoreID
},
timeout: 1000 * 600
})
if (res.data.code === '0') {
return res.data
} else if (res.data.code === '90003') {
msgWarning(params.body.storeId + '-' + res.data.detail)
} else {
msgWarning(res.data.detail)
}
}
//新版店铺分析
export const queryPageStores = async (json, noLoading = true) => {
try {
const res = await api('v2/netspider/QueryPageStores', {
params: json,
noLoading
})
return res
} catch (e) {
hideLoad()
msgWarning(e)
console.error('queryConfig', e)
throw e
}
}
//畅销分析
export const queryPageSkus = async (json, noLoading = true) => {
try {
const res = await api('v2/netspider/QueryPageSkus', {
params: json,
noLoading
})
return res
} catch (e) {
msgWarning(e)
hideLoad()
console.error('queryConfig', e)
throw e
}
}
export const getPageBrands = async (noLoading = true) => {
try {
const res = await api('v2/netspider/GetPageBrands', {
noLoading
})
return res
} catch (e) {
msgWarning(e)
hideLoad()
console.error('queryConfig', e)
throw e
}
}
export { getJdDaojiaApi, getJdDaojiaApi2, getJdDaojiaApi3 }

204
src/apis/promotion.js Normal file
View File

@@ -0,0 +1,204 @@
import $ajax from 'axios'
// import {Message} from 'element-ui'
import {hideLoad} from '@/tools/loading.js' // 引入封装的loading方法
import msgWarning from '@/tools/msgwarning.js'
/*
创建促销 post /promotion/CreatePromotion
*vendorID int 厂商ID当前只支持京东 0
*name str 促销名,必须唯一(最好带日期)
*beginAt str 开始时间
*endAt str 结束时间
*type int 促销类型 3直降 4秒杀
*storeIDs str [1,2]
*skuPrices arr json数组
isAsync boo 是否异步,目前只支持 false
advertising str 广告语
vendorPromotionID str 厂商活动ID
------------
{
SkuID int `json:"skuID"`
PriceType int `json:"priceType"` 1绝对价格 2百分比
Price int `json:"price"` // 分,这个不是单价
LimitSkuCount int `json:"limitSkuCount"` 活动库存
IsLock int8 `json:"isLock"` 0和11表示要锁定
}
const (
PriceTypePrice = 1 // 绝对价格
PriceTypePercentage = 2 // 百分比
)
*/
function createPromotion (json, fn) {
let formData = new FormData()
formData.append('vendorID', Number(json.vendorID))
formData.append('name', json.name)
formData.append('beginAt', json.beginAt)
formData.append('endAt', json.endAt)
formData.append('type', Number(json.type))
formData.append('storeIDs', JSON.stringify(json.storeIDs))
formData.append('skuPrices', JSON.stringify(json.skuPrices))
formData.append('isAsync', json.isAsync)
if (json.isContinueWhenError) formData.append('isContinueWhenError', json.isContinueWhenError)
if (json.advertising) {
formData.append('advertising', json.advertising)
}
if (json.vendorPromotionID) {
formData.append('vendorPromotionID', json.vendorPromotionID)
}
$ajax.post('v2/promotion/CreatePromotion', formData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
// 优化错误信息提示
let errmsg = res.data.desc
// 活动价大于等于原价
if (errmsg.indexOf('活动价大于等于原价') !== -1) {
// 提取数字部分
errmsg = errmsg.match(/\d+/g)
// 商品名称 json.skuInfos 数组中
// 表格模板
let html = `<table class="errmsg-table">
<caption>活动价大于等于原价</caption>
<thead>
<tr>
<th>京东门店ID</th>
<th>京西skuID</th>
<th>商品名称</th>
<th>活动价</th>
<th>建议修改价格</th>
</tr>
</thead>
<tbody>
`
let arr1 = [] // storeID
let arr2 = [] // skuID
errmsg.forEach((item, index) => {
if (index % 2 === 0) {
arr1.push(item)
} else {
arr2.push(item)
}
})
// json.skuPrices
let skuPrices = json.skuPrices
arr1.forEach((item, index) => {
// 找到商品名称
let name = ''
try {
name = json.skuInfos.filter(item => item.SkuID === Number(arr2[index]))[0].name
} catch (e) {
}
// 找到原价
let originPrice = skuPrices.filter(item => item.SkuID === Number(arr2[index]))[0].Price
html += `<tr>
<td>${item}</td>
<td>${arr2[index]}</td>
<td>${name}</td>
<td>${(originPrice / 100).toFixed(2)}</td>
<td>${json.type === 3 ? ((originPrice + 10) / 100).toFixed(2) : ((originPrice / 0.8) / 100).toFixed(2)}</td>
</tr>`
})
html += `</tbody></table>`
msgWarning(html)
} else {
msgWarning(res.data.desc)
}
}
}).catch(err => {
hideLoad()
})
}
function getPromotions (json, fn) {
$ajax.get('v2/promotion/GetPromotions', {
params: json
}).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
/*
取消活动 put /promotion/CancelPromotion
promotionID int 活动ID
*/
function cancelPromotion (promotionID, fn) {
$ajax.put('v2/promotion/CancelPromotion?promotionID=' + promotionID).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
/*
锁定解锁活动 sku put /promotion/LockPromotionSkus
formData
promotionID int 活动ID
isLock int 0不锁定 1锁定
skuIDs str [] 不传缺省全部
*/
function lockPromotionskus (json, fn) {
let formData = new FormData()
formData.append('promotionID', Number(json.promotionID))
formData.append('isLock', Number(json.isLock))
if (json.skuIDs) {
formData.append('skuIDs', JSON.stringify(json.skuIDs))
}
$ajax.put('v2/promotion/LockPromotionSkus', formData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
/*
从远端同步活动状态 put /promotion/RefreshPromotionStatus
promotionID int 活动ID
*/
function syncPromotionStatus (promotionID, fn) {
let formData = new FormData()
formData.append('promotionID', Number(promotionID))
$ajax.put('v2/promotion/RefreshPromotionStatus', formData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
export {createPromotion, getPromotions, cancelPromotion, lockPromotionskus, syncPromotionStatus}

25
src/apis/qiniu.js Normal file
View File

@@ -0,0 +1,25 @@
import $ajax from 'axios'
// import {Message} from 'element-ui'
import {hideLoad} from '@/tools/loading.js'
/*
得到七牛上传服务临时token当前设置为5分钟内有效。正常使用场景为每次上传资源前实时获取而不是保存下来一直使用 get /cms/GetQiniuUploadToken
suffix str 文件后缀
*/
function getQiNiuToken (suffix, hashCode, fn) {
$ajax.get(`v2/cms/GetQiniuUploadToken?suffix=${suffix}&hashCode=${hashCode}`).then(res => {
hideLoad()
if (res.data.code === '0') {
try {
let data = JSON.parse(res.data.data)
fn && fn(data)
} catch (e) {
}
}
}).catch(err => {
hideLoad()
})
}
export {getQiNiuToken}

80
src/apis/sendMessages.js Normal file
View File

@@ -0,0 +1,80 @@
import $ajax from 'axios'
import { hideLoad } from '@/tools/loading.js'
import msgWarning from '@/tools/msgwarning.js'
function sendMessagesApi(json, fn) {
let formData = new FormData()
formData.append('storeIDs', json.storeIDs)
formData.append('title', json.title)
formData.append('content', json.content)
formData.append('isAsync', json.isAsync)
formData.append('isContinueWhenError', json.isContinueWhenError)
formData.append('messageType', json.messageType)
formData.append('imgs', json.imgs)
if(json.actInfo) formData.append('actInfo', json.actInfo)
$ajax.post('v2/msg/SendStoreMessage', formData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
fn && fn(res.data)
}).catch(err => {
msgWarning(err.data.desc)
hideLoad()
})
}
function getStoreMessagesApi(json, fn) {
let arr = []
for (let attr in json) {
arr.push(`${attr}=${json[attr]}`)
}
let str = arr.join('&')
$ajax.get(`v2/msg/GetStoreMessages?${str}`).then(res => {
hideLoad()
fn && fn(res.data)
}).catch(err => {
msgWarning(err.data.desc)
hideLoad()
})
}
function getStoreMessageStatusesApi(json, fn) {
let arr = []
for (let attr in json) {
arr.push(`${attr}=${json[attr]}`)
}
let str = arr.join('&')
$ajax.get(`v2/msg/GetStoreMessageStatuses?${str}`).then(res => {
hideLoad()
fn && fn(res.data)
}).catch(err => {
hideLoad()
})
}
//发送消息给商城用户
function sendMsgToWxUser(json, fn) {
let formData = new FormData()
formData.append('userIDs', json.userIDs)
formData.append('title', json.title)
formData.append('content', json.content)
if (json.isAsync) {
formData.append('isAsync', json.isAsync)
}
if (json.isContinueWhenError) {
formData.append('isContinueWhenError', json.isContinueWhenError)
}
$ajax.post('v2/msg/SendUserMessage ', formData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
fn && fn(res.data)
}).catch(err => {
msgWarning(err.data.desc)
hideLoad()
})
}
export { sendMessagesApi, getStoreMessagesApi, getStoreMessageStatusesApi, sendMsgToWxUser }

1021
src/apis/store.js Normal file

File diff suppressed because it is too large Load Diff

370
src/apis/storeSku.js Normal file
View File

@@ -0,0 +1,370 @@
import $ajax from 'axios'
// import {Message} from 'element-ui'
import { hideLoad } from '@/tools/loading.js' // 引入封装的loading方法
import msgWarning from '@/tools/msgwarning.js'
import api from '@/utils/api.js'
/*
得到商家商品信息,如下条件之间是与的关系。对于没有关注的商品,按城市限制。但对于已经关注的商品就不限制了,因为已经在平台上可售,可以操作(改价等等)
get /store/sku/GetStoresSkus
*storeID int 门店ID
*isFocus boo 是否关注
keyword str 关键字
nameID int SkuName ID
skuID int
name str 商品名称
prefix str 商品前缀
categoryID int 类别ID
unit str 商品单位
jdID int 商品京东ID
fromStatus int 0不可售 1可售
toStatus int 0不可售 1可售
offset int 起始序号默认0
pageSize int 50
stFromTime str 销量统计开始时间
stToTime str 销量统计结束时间
stFromCount int 销量起始(包含)
stToCount int 销量结束(包含)
返回结果中 sku中的 count 是销量
*/
function getStoresSkus(json, fn, errFn) {
$ajax.get('v2/store/sku/GetStoresSkus', {
params: json
}).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
errFn && errFn()
}
}).catch(err => {
hideLoad()
})
}
/*
修改商家商品 put /store/sku/UpdateStoreSku
storeID int
payload json 单对象
*/
/*
skuName
NameID int `json:"nameID"`
UnitPrice int `json:"unitPrice"`
locationCode string `json:"locationCode"` // 物料货架码
IsFocus int `json:"isFocus"` // -1未关注0忽略1关注
SubStoreID int `json:"subStoreID"`
Skus []*StoreSkuBindSkuInfo `json:"skus"`
sku
SkuID int `json:"skuID"`
IsSale int `json:"isSale"` // -1不可售0忽略1可售
ElmID int64 `json:"elmID"`
EbaiID int64 `json:"ebaiID"`
*/
/*
批量修改商品 put /store/sku/UpdateStoreSkus
storeID int
payload json 数组包起来
{
NameID: id,
UnitPrice: price,
IsFocus: ,
Skus: [
{
SkuID: id,
IsSale:
}
]
}
*/
async function updateStoreSkus(storeID, arr, fn, ...arg) {
let formData = new FormData()
// return false
storeID instanceof Array ? formData.append('storeIDs', JSON.stringify(storeID)) : formData.append('storeIDs', JSON.stringify([storeID]))
formData.append('payload', JSON.stringify(arr))
// 额外参数
if (arg.length) {
if (arg[0].causeFlag) formData.append('causeFlag', arg[0].causeFlag)
}
try {
let res = await api('v2/store/sku/UpdateStoresSkus', {
method: 'PUT',
data: formData
})
if (typeof res === 'object' && res.code === '-105') {
fn && fn(res)
} else {
fn && fn({ code: '0' })
}
return res
} catch (e) {
msgWarning(e)
hideLoad()
throw e
}
}
//批量修改 暂时果园用
async function updateStoreSkusArr(storeID, arr, fn, ...arg) {
let formData = new FormData()
// return false
formData.append('storeIDs', JSON.stringify(storeID))
formData.append('payload', JSON.stringify(arr))
// 额外参数
if (arg.length) {
if (arg[0].causeFlag) formData.append('causeFlag', arg[0].causeFlag)
}
try {
let res = await api('v2/store/sku/UpdateStoresSkus', {
method: 'PUT',
data: formData
})
if (typeof res === 'object' && res.code === '-105') {
fn && fn(res)
} else {
fn && fn({ code: '0' })
}
return res
} catch (e) {
msgWarning(e)
hideLoad()
throw e
}
}
/*
京西门店拷贝到京西 post /store/sku/CopyStoreSkus
fromStoreID int 源门店ID
toStoreID int 目标门店ID
copyMode str fresh清除后拷贝 update增量拷贝
pricePercentage int 价格百分比 默认 100
categoryIDs str [1,2,3] skuName的类别
skuIDs str [1,2,3] skuID列表
*/
function copyStoreSkus(json, fn) {
let formData = new FormData()
formData.append('fromStoreID', json.fromStoreID)
// formData.append('toStoreID', json.toStoreID)
formData.append('toStoreIDs', JSON.stringify(json.toStoreIDs))
formData.append('copyMode', json.copyMode)
formData.append('isScale', json.isScale)
formData.append('pricePercentage', JSON.stringify(Number(json.pricePercentage)))
if (json.categoryIDs.length !== 0) {
formData.append('categoryIDs', JSON.stringify(json.categoryIDs))
}
if (json.skuIDs.length !== 0) {
formData.append('skuIDs', JSON.stringify(json.skuIDs))
}
$ajax.post('v2/store/sku/CopyStoreSkus', formData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning('[复制错误] ' + res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
/*
formData
批量修改多门店商品上下架sku可售 put /store/sku/UpdateStoresSkus
storeIDs str 门店ID列表 [12,23]
payload str json,StoreSkuBindInfo对象数组
--------------------
sku
IsSale int `json:"isSale"` // -1不可售0忽略1可售
[{
nameID: skuNameID,
unitPrice: skuNamePrice,
isFocus: , -1未关注0忽略1关注
isSale: -1不可售0忽略1可售
Skus: [
{
SkuID: id,
IsSale: -1不可售0忽略1可售
}
]
}]
*/
function updateStoresSkus(json, fn) {
let formData = new FormData()
formData.append('storeIDs', JSON.stringify(json.storeIDs))
formData.append('payload', JSON.stringify(json.payload))
if (typeof json.isContinueWhenError === 'boolean') formData.append('isContinueWhenError', json.isContinueWhenError)
if (typeof json.isAsync === 'boolean') formData.append('isAsync', json.isAsync)
if (typeof json.isScale === 'boolean') formData.append('isScale', json.isScale)
if (typeof json.isRefreshHigh === 'boolean') formData.append('isRefreshHigh', json.isRefreshHigh)
$ajax.put('v2/store/sku/UpdateStoresSkus', formData, {
timeout: 1000 * 300,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
/*
批量修改多商家商品可售状态 put /store/sku/UpdateStoresSkusSale
storeIDs str [1,2,3]
payload arr
--------------------------------
sku
IsSale int `json:"isSale"` // -1不可售0忽略1可售
{
SkuID: id,
IsSale:
}
storeIDs: [100118]
payload: [{"SkuID":33066,"IsSale":1}]
isContinueWhenError: true
isAsync: false
autoSaleAt: 临时不可售参数
*/
function updateStoresSkusSale(json, fn) {
let formData = new FormData()
formData.append('storeIDs', JSON.stringify(json.storeIDs))
formData.append('payload', JSON.stringify(json.payload))
if (typeof json.isContinueWhenError === 'boolean') formData.append('isContinueWhenError', json.isContinueWhenError)
if (typeof json.isAsync === 'boolean') formData.append('isAsync', json.isAsync)
if (json.autoSaleAt) formData.append('autoSaleAt', json.autoSaleAt)
if (json.ignoreDontSale) formData.append('autoSaleAt', json.ignoreDontSale)
$ajax.put('v2/store/sku/UpdateStoresSkusSale', formData, {
timeout: 1000 * 300,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
/*
获取门店审核商品 get /store/sku/GetStoreOpRequests
*fromTime str 申请开始时间
toTime str 申请结束时间
keyword str 查询关键字
storeIDs str 门店ID列表
itemIDs str skuNameID
types str 类型列表对象 1改价 2关注
statuss str 状态列表对象 0新 1拒绝 2接受
offset int 0
pageSize int -1全部
--------list--------
id: 1
unitPrice: 2000 // 关注为0
intParam1: 3000
intParam2: 0
itemID: 1213
jsonParam: ""
lastOperator: "fakeboss"
remark: ""
skuNameName: "龙须 龙口粉丝"
skuNamePrefix: ""
status: 0
storeID: 11
storeName: "杜城店"
type: 1
*/
function getStoreOpRequests(json, fn) {
$ajax.get('v2/store/sku/GetStoreOpRequests', {
params: json
}).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
/*
formData
处理商家商品价格申请 put /store/sku/HandleStoreOpRequest
reqIDs str 请求ID列表对象
handleType int -1 拒绝, 1批准
rejectReason str 拒绝理由
*/
function handleStoreOpRequests(reqIDs, handleType, rejectReason, fn) {
let formData = new FormData()
formData.append('reqIDs', JSON.stringify(reqIDs))
formData.append('handleType', handleType)
formData.append('rejectReason', rejectReason)
$ajax.put('v2/store/sku/HandleStoreOpRequest', formData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
/**
* @description 美团门店复制到美团
* @param {string } fromStoreID 被复制门店id
* @param {string } toStoreID 复制到门店id
* @param {Function} fn
*/
function copyMtToMt(fromStoreID, toStoreID, fn) {
let formData = new FormData()
formData.append('fromStoreID', fromStoreID)
formData.append('toStoreID', toStoreID)
$ajax.post('v2/router/CopyMtToMt', formData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
export { getStoresSkus, updateStoreSkus, updateStoreSkusArr, copyStoreSkus, updateStoresSkus, updateStoresSkusSale, getStoreOpRequests, handleStoreOpRequests, copyMtToMt }

169
src/apis/sync.js Normal file
View File

@@ -0,0 +1,169 @@
import $ajax from 'axios'
// import {Message} from 'element-ui'
import {hideLoad} from '@/tools/loading.js' // 引入封装的loading方法
import msgWarning from '@/tools/msgwarning.js'
/*
全新初始化商家商品信息(!!!此操作会先清除平台上已有的商品及分类信息),此操作只适用于单门店模式平台 put /sync/FullSyncStoresSkus
storeIDs str 门店ID列表
vendorIDs str 厂商ID列表
isAsync boo 是否异步
isContinueWhenError boo 单个同步失败是否继续默认false
*/
function fullSyncStoresSkus (storeIDs, vendorIDs, isAsync, isContinueWhenError, fn) {
let formData = new FormData()
formData.append('storeIDs', storeIDs)
formData.append('vendorIDs', vendorIDs)
formData.append('isAsync', isAsync)
formData.append('isContinueWhenError', isContinueWhenError)
$ajax.put('v2/sync/FullSyncStoresSkus', formData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
/*
删除远程门店商品信息(!!!此操作会先清除平台上已有的商品及分类信息),此操作只适用于单门店模式平台 put /sync/FullSyncStoresSkus
storeIDs str 门店ID列表
vendorIDs str 厂商ID列表
isAsync boo 是否异步
isContinueWhenError boo 单个同步失败是否继续默认false
*/
function deleteSyncStoresSkus (storeIDs, vendorIDs, isAsync, isContinueWhenError, fn) {
// let formData = new FormData()
// formData.append('storeIDs', storeIDs)
// formData.append('vendorIDs', vendorIDs)
// formData.append('isAsync', isAsync)
// formData.append('isContinueWhenError', isContinueWhenError)
$ajax.delete('v2/sync/DeleteRemoteStoreSkus', {
params: {
storeIDs, vendorIDs, isAsync, isContinueWhenError
}
}).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
/*
同步商家商品信息,单店模式才支持 put /sync/SyncStoresSkus
storeIDs str 门店ID列表
vendorIDs int 厂商ID
isAsync boo 是否同步操作
isForce boo 是否强制同步(防止在平台改了,本地没有脏标志)
skuIDs str []skuID列表,缺省为全部
isContinueWhenError boo 单个失败是否继续
*/
export const syncStoresSkus = (json, fn) => {
let formData = new FormData()
formData.append('storeIDs', JSON.stringify(json.storeIDs))
formData.append('vendorIDs', JSON.stringify(json.vendorIDs))
formData.append('isAsync', json.isAsync)
formData.append('isForce', json.isForce)
if (json.skuIDs.length !== 0) {
formData.append('skuIDs', JSON.stringify(json.skuIDs))
}
if (json.isContinueWhenError) {
formData.append('isContinueWhenError', json.isContinueWhenError)
}
$ajax.put('v2/sync/SyncStoresSkus', formData, {
timeout: 1000 * 300,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
/*
同步京东商品库 put /sync/SyncSkuNames
nameIDs str
isForce boo 是否强制同步(防止在平台改了,本地没有脏标志)
isAsync boo 是否异步
isContinueWhenError boo 单个失败是否继续
*/
export const syncSkuNames = (json, fn) => {
let formData = new FormData()
// formData.append('vendorIDs', JSON.stringify(json.vendorIDs))
formData.append('isAsync', json.isAsync)
formData.append('isForce', json.isForce)
formData.append('vendorOrgCode', json.vendorOrgCode)
formData.append('isContinueWhenError', json.isContinueWhenError)
if (json.nameIDs.length !== 0) {
formData.append('nameIDs', JSON.stringify(json.nameIDs))
}
$ajax.post('v2/sync/SyncSkuNames', formData, {
timeout: 1000 * 300,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
/*
同步美团饿百分类 put /sync/SyncStoresCategory
storeIDs str 门店ID列表
vendorIDs int 厂商ID
isAsync boo 是否同步操作
isForce boo 是否强制同步(防止在平台改了,本地没有脏标志)
isContinueWhenError boo 单个失败是否继续
*/
export const syncCat = (json, fn) => {
let formData = new FormData()
formData.append('vendorIDs', JSON.stringify(json.vendorIDs))
formData.append('storeIDs', JSON.stringify(json.storeIDs))
formData.append('isAsync', json.isAsync)
formData.append('isForce', json.isForce)
formData.append('isContinueWhenError', json.isContinueWhenError)
$ajax.put('v2/sync/SyncStoresCategory', formData, {
timeout: 1000 * 300,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
export {fullSyncStoresSkus, deleteSyncStoresSkus}

82
src/apis/task.js Normal file
View File

@@ -0,0 +1,82 @@
import $ajax from 'axios'
import {hideLoad} from '@/tools/loading.js'
import msgWarning from '@/tools/msgwarning.js'
/*
查询任务进度 get /task/GetTasks
taskID str 任务ID
fromStatus int 起始状态
toStatus int 结束状态
lastHours int 多少小时以内的
TaskStatusBegin = 0
TaskStatusWorking = 0
TaskStatusCanceling = 1
TaskStatusEndBegin = 2
TaskStatusFinished = 2
TaskStatusCanceled = 3
TaskStatusFailed = 4
TaskStatusEnd = 4
CACD8972ECA211E8A27B525400AE46A6
batchSize: 1
children: null
createdAt: "2018-11-19T20:07:41.076305281+08:00"
createdBy: "renyutian"
err: null
failedItemCount: 0
failedJobCount: 0
finishedItemCount: 1
finishedJobCount: 1
// id: "B6C54901EBF311E8A27B525400AE46A6"
isContinueWhenError: true
//name: "SyncStore"
parallelCount: 1
result: Array(0)
status: 2
terminatedAt: "2018-11-19T20:07:41.111749903+08:00"
totalItemCount: 1
totalJobCount: 1
updatedAt: "2018-11-19T20:07:41.111730154+08:00"
*/
function getTasks (params, fn) {
$ajax.get('v2/task/GetTasks', {
params: params
}).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
/*
取消任务 put /task/CancelTask
taskID
*/
function cancelTask (taskID, fn) {
let formData = new FormData()
formData.append('taskID', taskID)
$ajax.put('v2/task/CancelTask', formData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
if (res.data.code === '0') {
fn && fn(res.data)
} else {
msgWarning(res.data.desc)
}
}).catch(err => {
hideLoad()
})
}
export {getTasks, cancelTask}

64
src/apis/temporary.js Normal file
View File

@@ -0,0 +1,64 @@
import $ajax from 'axios'
import {hideLoad} from '@/tools/loading.js'
import msgWarning from '@/tools/msgwarning.js'
function convert2JDSPUApi (json, fn) {
let formData = new FormData()
formData.append('count', json.count)
formData.append('isAsync', json.isAsync)
formData.append('isContinueWhenError', json.isContinueWhenError)
$ajax.post('v2/initdata/Convert2JDSPU', formData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
fn && fn(res.data)
}).catch(err => {
msgWarning(err.data.desc)
hideLoad()
})
}
function Change2JDSPU4StoreApi (json, fn) {
let formData = new FormData()
formData.append('storeIDs', json.storeIDs)
formData.append('isAsync', json.isAsync)
formData.append('step', json.step)
formData.append('isContinueWhenError', json.isContinueWhenError)
$ajax.post('v2/initdata/Change2JDSPU4Store', formData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
fn && fn(res.data)
}).catch(err => {
msgWarning(err.data.desc)
hideLoad()
})
}
/*
添加sku post /sku/AddSku
nameID int skuName ID
payload json
*/
function transformJdSpu2SkuApi (json, fn) {
let formData = new FormData()
formData.append('count', json.count)
formData.append('isAsync', json.isAsync)
formData.append('isContinueWhenError', json.isContinueWhenError)
$ajax.post('v2/initdata/TransformJdSpu2Sku', formData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
fn && fn(res.data)
}).catch(err => {
hideLoad()
})
}
export {convert2JDSPUApi, Change2JDSPU4StoreApi, transformJdSpu2SkuApi}

View File

@@ -0,0 +1,54 @@
import $ajax from 'axios'
import { showLoad, hideLoad } from '@/tools/loading'
import msgWarning from '@/tools/msgwarning.js'
export function UpLoadMTVip(json, fn) {
showLoad
let formData = new FormData()
formData.append('payload', JSON.stringify(json))
$ajax.post('https://www.jxcs.net/v2/job/ImprotMtMembers', formData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
fn && fn(res.data)
}).catch(res => {
msgWarning(res.data.desc)
hideLoad()
})
}
export function getMtMembers(fn) {
showLoad
$ajax.get('https://www.jxcs.net/v2/job/GetMtMembers', {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
fn && fn(res.data)
}).catch(res => {
msgWarning(res.data.desc)
hideLoad()
})
}
export function updateCthrBannerList(value) {
showLoad()
let from = new FormData()
from.append('type', 'Sys')
from.append('key', 'banner')
from.append('value', value)
$ajax.put('https://www.jxcs.net/v2/cms/UpdateConfig', from, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'token': 'rushSkyMonkeyToken_20201203'
}
}).then(res => {
hideLoad()
fn && fn(res.data)
}).catch(res => {
msgWarning(res.data.desc)
hideLoad()
})
}

View File

@@ -0,0 +1,113 @@
import $ajax from 'axios'
import { showLoad, hideLoad } from '@/tools/loading'
import msgWarning from '@/tools/msgwarning.js'
export function queryConfigs(json = {}) {
showLoad
let { noLoading = false, type = 'PricePack', key, keyword } = json
let params = {
type
}
if (key) params.key = key
if (keyword) params.keyword = keyword
return $ajax.get('https://www.jxcs.net/v2/cms/QueryConfigs', {
params,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
if (res.data.data !== 'null') {
if (type === 'Bank') {
// 银行
return res.data.data
} else {
// 调价包
return res.data.data
}
} else {
return []
}
}).catch(res => {
msgWarning(res.data.desc)
hideLoad()
})
}
export function deleteConfig(json = {}, fn) {
showLoad
let { noLoading, type = 'PricePack', key } = json
let params = {
type,
key
}
$ajax.delete('https://www.jxcs.net/v2/cms/DeleteConfig', {
params,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
return res.data.data
}).catch(res => {
msgWarning(res.data.desc)
hideLoad()
})
}
export function updateConfig(json, fn) {
showLoad
let { noLoading, type = 'PricePack', key, value } = json
let form = new FormData()
form.append('type', type)
form.append('key', key)
form.append('value', value)
return $ajax.put('https://www.jxcs.net/v2/cms/UpdateConfig', form, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
return res.data.data
}).catch(res => {
msgWarning(res.data.desc)
hideLoad()
})
}
export function newConfig(json) {
showLoad
let { noLoading = false, type = 'PricePack', key, value } = json
let form = new FormData()
form.append('type', type)
form.append('key', key)
form.append('value', value)
return $ajax.post('https://www.jxcs.net/v2/cms/newConfig', form, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
return res.data.data
}).catch(res => {
msgWarning(res.data.desc)
hideLoad()
})
}
export function queryVipConfigs() {
showLoad
let params = { type: 'MemberCard' }
let noLoading = false
return $ajax.get('https://www.jxcs.net/v2/cms/QueryConfigs', {
params,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
return res.data.data
}).catch(res => {
msgWarning(res.data.desc)
hideLoad()
})
}

View File

@@ -0,0 +1,131 @@
/**
* @description 快递查询模块
* @author zhang shu wei
* @since 2022年7月11日10:48:46
*/
import $ajax from 'axios'
import { showLoad, hideLoad } from '@/tools/loading'
import msgWarning from '@/tools/msgwarning.js'
/**
* 查询快递数据
*/
export function GET_DATA(json) {
showLoad()
// 处理数据
let fromData = new FormData()
fromData.append('expressType', json.expressType)
fromData.append('orderNo', json.orderNo)
fromData.append('orderStatus', json.orderStatus)
fromData.append('pageNum', json.pageNum)
fromData.append('pageSize', json.pageSize)
fromData.append('startTime', json.startTime)
fromData.append('endTime', json.endTime)
return $ajax.post('https://www.jxcs.net/v2/express/GetOrderList', fromData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'token': 'rushSkyMonkeyToken_20201203'
}
}).then(res => {
hideLoad()
return res.data
}).catch(err => {
msgWarning(err.data.desc)
hideLoad()
})
}
/**
* 用户提现列表查询
*/
export function GetWithdrawalList(json) {
showLoad()
let fromData = new FormData()
fromData.append('pageNum', json.pageNum)
fromData.append('pageSize', json.pageSize)
fromData.append('userName', json.userName)
fromData.append('userId', json.userId)
fromData.append('orderId', json.orderId)
fromData.append('phone', json.phone)
fromData.append('orderStatus', json.orderStatus)
fromData.append('startTime', json.startTime)
fromData.append('endTime', json.endTime)
return $ajax.post('https://www.jxcs.net/v2/withdrawal/GetWithdrawalList', fromData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'token': 'rushSkyMonkeyToken_20201203'
}
}).then(res => {
hideLoad()
return res.data
}).catch(err => {
msgWarning(err.data.desc)
hideLoad()
})
}
/**
* 提现审核
*/
export function ExamineWithdrawalOrder(json) {
showLoad()
let fromData = new FormData()
fromData.append('phone', json.phone)
fromData.append('orderId', json.orderId)
fromData.append('examineStatus', json.examineStatus)
fromData.append('remark', json.remark)
fromData.append('userId', json.userId)
return $ajax.post('https://www.jxcs.net/v2/withdrawal/ExamineWithdrawalOrder', fromData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'token': 'rushSkyMonkeyToken_20201203'
}
}).then(res => {
hideLoad()
return res.data
}).catch(err => {
msgWarning(err.data.desc)
hideLoad()
})
}
/**
* 话费记录
*/
export const system_query_recharge_list = params => {
showLoad()
return $ajax.post('https://www.jxcs.net/v2/recharge/SystemQueryRechargeList', params, {
}).then(res => {
hideLoad()
return res.data
}).catch(err => {
msgWarning(err.data.desc)
hideLoad()
})
}
/**
* 石总账户余额
*/
export const query_account_bill = () => {
showLoad()
return $ajax.get('https://www.jxcs.net/v2/recharge/QueryAccountBill').then(res => {
hideLoad()
return res.data
}).catch(err => {
msgWarning(err.data.desc)
hideLoad()
})
}

View File

@@ -0,0 +1,155 @@
import $ajax from 'axios'
import { showLoad, hideLoad } from '@/tools/loading'
import msgWarning from '@/tools/msgwarning.js'
//冲天猴服务器信息
export function getMonkeyServiceInfo(json) {
showLoad
return $ajax.get('https://www.jxcs.net/v2/cms/GetServiceInfo', {
params: json,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
return res.data
}).catch(res => {
msgWarning(res.data.desc)
hideLoad()
})
}
//提现账单列表
export function getCashBillList(json) {
showLoad
return $ajax.get('https://www.jxcs.net/v2/order/GetOrders', {
params: json,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
return res.data
}).catch(res => {
msgWarning(res.data.desc)
hideLoad()
})
}
// 手动点完成提现操作
export function finishedCashOrders(orderIDs) {
let formData = new FormData()
formData.append('orderIDs', JSON.stringify(orderIDs))
showLoad
return $ajax.post('https://www.jxcs.net/v2/order/FinishedCashOrders', formData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
return res.data
}).catch(res => {
msgWarning(res.data.desc)
hideLoad()
})
}
//获取任务
export function getJobs(json) {
showLoad
return $ajax.get('https://www.jxcs.net/v2/job/GetJobs', {
params: json,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
return res.data
}).catch(res => {
msgWarning(res.data.desc)
hideLoad()
})
}
// 置顶or 推荐
export function reloadJobSpan(jobIDs, span) {
let formData = new FormData()
formData.append('jobIDs', JSON.stringify(jobIDs))
formData.append('span', span)
showLoad
return $ajax.post('https://www.jxcs.net/v2/job/ReloadJobSpan', formData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
return res.data
}).catch(res => {
msgWarning(res.data.desc)
hideLoad()
})
}
// 设置任务标签
export function createJobSpan(jobIDs, endAt, span) {
let formData = new FormData()
formData.append('jobIDs', JSON.stringify(jobIDs))
formData.append('endAt', endAt)
formData.append('span', span)
showLoad
return $ajax.post('https://www.jxcs.net/v2/job/CreateJobSpan', formData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
return res.data
}).catch(res => {
msgWarning(res.data.desc)
hideLoad()
})
}
//取消任务
export function cancelJob(jobID) {
let formData = new FormData()
formData.append('jobID', JSON.stringify(jobID))
showLoad
return $ajax.post('https://www.jxcs.net/v2/job/CancelPublishJob', formData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
return res.data
}).catch(res => {
msgWarning(res.data.desc)
hideLoad()
})
}
//
export function getManageStatisticsJob(json) {
showLoad
return $ajax.get('https://www.jxcs.net/v2/order/GetManageStatisticsJob', {
params: json,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
return res.data
}).catch(res => {
msgWarning(res.data.desc)
hideLoad()
})
}
////图表数据
export function getManageStatisticsImg(json) {
showLoad
return $ajax.get('https://www.jxcs.net/v2/order/GetManageStatisticsImg', {
params: json,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
return res.data
}).catch(res => {
msgWarning(res.data.desc)
hideLoad()
})
}

View File

@@ -0,0 +1,19 @@
import $ajax from 'axios'
import { showLoad, hideLoad } from '@/tools/loading'
import msgWarning from '@/tools/msgwarning.js'
//冲天猴服务器信息
export function getPayStatistics(json) {
showLoad
return $ajax.get('https://www.jxcs.net/v2/order/GetPayStatistics', {
params: json,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
return res.data
}).catch(res => {
msgWarning(res.data.desc)
hideLoad()
})
}

View File

@@ -0,0 +1,82 @@
import $ajax from 'axios'
import { showLoad, hideLoad } from '@/tools/loading'
import msgWarning from '@/tools/msgwarning.js'
export function getUnionActList(vendorID ,actType) {
showLoad
let params = {
actType,
vendorID
}
return $ajax.get('https://www.jxcs.net/v2/union/GetUnionActList', {
params,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
if(res.data.data){
return JSON.parse(res.data.data)
}else{
return []
}
}).catch(res => {
msgWarning(res.data.desc)
hideLoad()
})
}
export function publishJob(json = {}) {
showLoad
let form = new FormData()
form.append('payload', JSON.stringify(json))
return $ajax.post('https://www.jxcs.net/v2/job/PublishJob', form, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
return res.data
}).catch(res => {
msgWarning(res.data.desc)
hideLoad()
})
}
export function updateJob(json = {}) {
showLoad
let form = new FormData()
form.append('payload', JSON.stringify(json))
return $ajax.post('https://www.jxcs.net/v2/job/UpdateJob', form, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
return res.data
}).catch(res => {
msgWarning(res.data.desc)
hideLoad()
})
}
export function getUnionOrders(json) {
showLoad
let params =json
return $ajax.get('https://www.jxcs.net/v2/union/GetUnionOrders', {
params,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
if(res.data.data){
return JSON.parse(res.data.data)
}else{
return []
}
}).catch(res => {
msgWarning(res.data.desc)
hideLoad()
})
}

View File

@@ -0,0 +1,139 @@
import $ajax from 'axios'
import { showLoad, hideLoad } from '@/tools/loading'
import msgWarning from '@/tools/msgwarning.js'
import api from '@/utils/api.js'
/**
* 得到用户统计信息
*/
export function getUserStatistics() {
showLoad
return $ajax.get('https://www.jxcs.net/v2/event/GetUserStatistics', {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
return res.data
}).catch(res => {
msgWarning(res.data.desc)
hideLoad()
})
}
/**
* 查询用户列表
*/
export function getUsersList(json) {
showLoad
return $ajax.get('https://www.jxcs.net/v2/user2/GetUsers', {
params: json,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
return res.data
}).catch(res => {
msgWarning(res.data.desc)
hideLoad()
})
}
/**
* 修改用户余额
*/
export function updatUserMoney(json) {
showLoad // 显示加载层
let formData = new FormData()
formData.append('phone', json.phone)
formData.append('userID', json.userID)
formData.append('money', json.money)
return $ajax.post('https://www.jxcs.net/v2/balance/UpdateUserBalance', formData,{
header: {
'content-type': 'application/x-www-form-urlencoded',
'token': 'rushSkyMonkeyToken_20201203'
}
}).then(res => {
hideLoad()
return res.data
}).catch(err => {
msgWarning(res.data.desc)
hideLoad()
})
}
//查询用户角色
export const userRuler = async (userID = '', noLoading = true) => {
try {
let res = await api(`v2/power/GetUserRole?userID=${userID}`, {
noLoading
})
return res
} catch (e) {
console.error('GetUserRole', e)
msgWarning(e)
throw e
}
}
/**
* 未知模块
*/
export function getConfig(key, type) {
showLoad
return $ajax.get('https://www.jxcs.net/v2/cms/QueryConfigs', {
params: {
key,
type
},
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).then(res => {
hideLoad()
return res.data
}).catch(res => {
msgWarning(res.data.desc)
hideLoad()
})
}
/**
* 未知模块
*/
export function updateCatelogies(value) {
showLoad()
let form = new FormData()
form.append('type', 'Sys')
form.append('key', 'IndexCategories')
form.append('value', value)
$ajax.put('https://www.jxcs.net/v2/cms/UpdateConfig', form, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'token': 'rushSkyMonkeyToken_20201203'
}
}).then(res => {
hideLoad()
return res.data
}).catch(res => {
msgWarning(res.data.desc)
hideLoad()
})
}

129
src/apis/user_wx.js Normal file
View File

@@ -0,0 +1,129 @@
import $ajax from 'axios'
import Mint from 'mint-ui' // 引入 mint-ui
// import store from '@/store/index.js' // 引入store
// 获取微信用户信息 get
// openId 用户openId
function reqWeixin (openId, fn) {
$ajax.get('/api/weixin', {
params: {
openId: openId
}
}).then(res => {
Mint.Indicator.close() // 关闭加载中
if (res.data.code === 'success') {
fn && fn(JSON.parse(res.data.data))
} else {
// 弹出提示框
Mint.Toast({
message: res.data.desc,
position: 'center',
duration: 3000
})
}
}).catch(err => {
Mint.Indicator.close() // 关闭加载中
})
}
// 获取短信验证码 post
// mobile
function getTelMsg (mobile, fn) {
let formData = new FormData()
formData.append('mobile', mobile)
$ajax.post('/api_php/capt/createsms2', formData).then(res => {
Mint.Indicator.close() // 关闭加载中
if (res.data.code === 'success') {
fn && fn(res.data)
} else {
// 弹出提示框
Mint.Toast({
message: res.data.desc,
position: 'center',
duration: 3000
})
}
}).catch(err => {
Mint.Indicator.close() // 关闭加载中
})
}
// 用户绑定 post
// nickname
// openid
// smssure
// tels
function userBind (nickname, openid, smssure, tels, fn) {
return $ajax.post('/api_php/capt/getdata2', {
nickname: nickname,
openid: openid,
smssure: smssure,
tels: tels
}).then(res => {
Mint.Indicator.close() // 关闭加载中
if (res.data.code === 'success') {
fn && fn(res.data)
} else {
// 弹出提示框
Mint.Toast({
message: res.data.desc,
position: 'center',
duration: 3000
})
}
}).catch(err => {
Mint.Indicator.close() // 关闭加载中
})
}
// 判断手机号是否已经绑定(发送验证码之前判断) get
// openid
// phone
function telIsBind (openid, phone, fn) {
$ajax.get('/api/telephone/binding', {
params: {
openid: openid,
phone: phone
}
}).then(res => {
Mint.Indicator.close() // 关闭加载中
if (res.data.code === 'success') {
fn && fn(JSON.parse(res.data.data))
} else {
// 弹出提示框
Mint.Toast({
message: res.data.desc,
position: 'center',
duration: 3000
})
}
}).catch(err => {
Mint.Indicator.close() // 关闭加载中
})
}
// 用户解绑 put
// openId
// tel
function userUnbind (openId, tel, fn) {
// let formData = new FormData()
// formData.append('openId', openId)
// formData.append('tel', tel)
$ajax.put('/api/telephone/unbinding', `openId=${encodeURIComponent(openId)}&tel=${encodeURIComponent(tel)}`).then(res => {
Mint.Indicator.close() // 关闭加载中
if (res.data.code === 'success') {
fn && fn(JSON.parse(res.data.data))
} else {
// 弹出提示框
Mint.Toast({
message: res.data.desc,
position: 'center',
duration: 3000
})
}
}).catch(err => {
Mint.Indicator.close() // 关闭加载中
})
}
export {reqWeixin, getTelMsg, userBind, telIsBind, userUnbind}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
src/assets/img/icon-dd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 572 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 692 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 573 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 765 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 930 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
src/assets/img/img_add.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
src/assets/img/loadding.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
src/assets/img/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
src/assets/img/logo200.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
src/assets/img/menulogo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

372
src/assets/scss/_base.scss Normal file
View File

@@ -0,0 +1,372 @@
@import '@/assets/scss/_color.scss';
.baselayout, .baselayout2 {
background: white;
margin: 10px;
box-shadow: 0 0 3px rgba(#ccc, .5);
border-radius: 5px;
min-height: calc(100vh - 180px);
padding: 20px;
padding-bottom: 10px;
min-width: 1050px;
h2 {
font-size: 22px;
color: #303133;
border-bottom: 1px solid #efefef;
padding-bottom: 20px;
margin-top: 20px;
text-align: left;
}
.txthidden{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.cursor{
cursor:pointer;
}
}
.baselayout2 {
min-height: calc(100vh - 150px);
}
// 文字不换行
.textNowrap{
white-space: nowrap;
}
.el-message {
box-shadow: 0 0 5px rgba(#ccc, .8);
}
.elm-cond {
.el-input__inner {
// padding-left: 42px !important;
}
}
.create-good {
.good-name {
.el-form-item__error {
left: 110px;
}
}
}
.cat-manager {
.el-tree-node__children {
// padding: 20px 0;
// margin-bottom: 20px;
// border:1px solid #ccc;
}
.el-tree-node__content {
padding: 10px 0;
// margin: 10px 0;
}
// .el-tree-node__children {
// .el-tree-node__content {
// padding: 0;
// margin: 20px 0;
// }
// }
.custom-tree-node {
// background: #ddd;
}
.highlight {
// background: orange;
margin-top: 50px !important;
}
.el-tree-node {
transition: all .3s;
}
[aria-checked] {
// padding-bottom: 10px;
// padding-bottom: 10px;
// height: 80px;
// margin: 10px 0;
// border-bottom: 1px dashed #ccc;
// padding: 20px 0;
// transition: all .3s;
// transform: translateX(20px);
// transform-origin: left;
}
}
.group-manager {
.el-card__header {
background: #e8f4ff;
color: #303133;
button {
// color: rgb(157, 7, 7);
}
}
}
// 拖拽时的鼠标外形
.cat-manager {
.el-tree.is-dragging.is-drop-not-allow .el-tree-node__content {
// cursor: pointer !important;
}
.el-tree.is-dragging .el-tree-node__content {
// cursor: pointer !important;
}
.is-drop-inner {
// background: orange;
}
.el-tree {
// cursor: move !important;
}
.el-tree-node__content {
position: relative;
}
}
// 门店商品管理月销量
.store-goods-manager {
.isQueryCount {
margin-left: 20px;
.el-checkbox__label {
font-size: 12px;
}
}
.range-input {
width: 50px;
.el-input__inner {
padding: 0 5px;
font-size: 12px;
height: 18px;
height: 18px;
}
}
.tool-bar {
.el-form-item__label {
font-size: 12px;
}
}
.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
background: rgba(#409EFF, .2);
// color: white;
border-radius: 5px;
// transition: all .3s;
}
.el-tree-node__content {
padding: 4px 0;
// margin: 4px 0;
}
.el-tree-node__children {
color: black;
transition: none;
}
.el-checkbox+.el-checkbox {
margin-left: 0;
}
}
// 门店账单推送
.store-excel-send {
.el-upload {
width: 100%;
}
.el-upload-dragger {
width: 100%;
}
.el-upload-list {
display: flex;
flex-flow: row wrap;
max-height: calc(100vh - 392px);
overflow-y: auto;
li {
width: 24%;
margin: .5%;
height: 24px;
line-height: 24px;
border-collapse: collapse;
}
}
}
// 同步消息
.syncMsg {
top: 70px;
}
// 选择门店,高度
.pick-store {
.el-select__tags {
& > span {
max-height: 200px;
overflow-y: auto;
// padding: 10px;
}
}
}
// 物流管理 dialog
.waybill-dialog {
.el-dialog__body {
padding: 10px 20px;
}
}
// 错误提示弹窗
.msgWarning {
width: 50%;
.el-message-box__title {
font-size: 14px;
}
.el-message-box__content {
max-height: 50vh;
overflow-y: auto;
font-size: 12px;
}
}
// 划过可点击
.hover-click {
cursor: pointer;
outline: none;
&:hover {
color: #409EFF;
text-decoration: underline;
}
}
// 快递信息
.cmp-waybillInfo {
.el-step__description {
padding-right: 0 !important;
}
}
// 错误消息提示表格
.errmsg-table {
tbody {
display: block;
height: 40vh;
overflow-y: scroll;
}
thead, tbody tr {
display: table;
width: 100%;
// height: 40px;
table-layout: fixed;
// font-size: 16px;
// text-align:
word-break: break-all;
}
thead {
width: calc(100% - 1rem) !important;
}
width: 100%;
border-collapse: collapse;
caption {
color: #F56C6C;
font-weight: bold;
font-size: 14px;
}
td,th {
border-bottom: 1px solid #DCDFE6;
padding: 0 10px;
}
}
.log-detail {
thead, tbody {
td, th {
&:nth-of-type(1) {
width: 100px !important;
}
&:nth-of-type(2) {
width: 100px !important;
}
&:nth-of-type(3) {
width: 100px !important;
}
}
}
}
.cat-manager {
.el-icon-circle-close {
margin-right: 40px;
}
}
// 运单状态
.cmp-waybillInfo {
.el-step__description.is-wait {
// display: flex;
}
}
.danger {
color: #F56C6C !important;
}
// 营业中
.openStatus1 {
color: #67C23A;
}
// 休息
.openStatus0 {
color: #E6A23C;
}
.openStatus-0 {
color: #E6A23C !important;
}
// 休息
.openStatus-1 {
color: #333;
}
// 禁用
.openStatus-2 {
color: #909399;
}
.fr {
display: flex;
align-items: center;
justify-content: flex-end;
}
.cpt {
cursor: pointer;
}
// 图片预览组件
.img-preview-alert {
width: 600px;
img {
width: 100%;
}
}
.big-warning {
width: 80vw !important;
}
.ft12 {
font-size: 12px;
}
.lh1 {
line-height: 1;
}
.color-main {
color: #409EFF;
}
.color-success {
color: #67C23A;
}
.color-warning {
color: #E6A23C;
}
.color-danger {
color: #F56C6C;
}
.color-info {
color: #909399;
}

View File

@@ -0,0 +1,13 @@
@import '@/assets/scss/_color.scss';
// @import '@/assets/scss/_bundle.scss';
%baseFill {
height: calc(100vh - 140px);
}
%tinyTable {
.el-table td, .el-table th {
padding: 2px;
}
}

View File

@@ -0,0 +1,15 @@
$primary: #409EFF;
$success: #67C23A;
$warning: #E6A23C;
$danger: #F56C6C;
$info: #909399;
$text1: #303133;
$text2: #606266;
$text3: #909399;
$text4: #C0C4CC;
$border1: #DCDFE6;
$border2: #E4E7ED;
$border3: #EBEEF5;
$border4: #F2F6FC;

View File

@@ -0,0 +1,6 @@
.login-error-msg {
background: white;
// color: white !important;
border: 1px solid red;
box-shadow: 0 0 5px rgba(red, .5);
}

View File

@@ -0,0 +1,9 @@
.el-message-box__wrapper{
overflow: scroll;
}
.el-textarea__inner{
height: 500px;
}
@import "login.scss";
@import "base.scss";

113
src/components/Index.vue Normal file
View File

@@ -0,0 +1,113 @@
<template>
<div class="body">
<el-container>
<el-header class="index-header">
<TopBar></TopBar>
</el-header>
<el-container>
<el-aside :class="{'index-aside': true, 'index-aside-fold': fold}">
<el-button size="mini" class="fold" @click="handleFold">{{fold ? '' : ''}}</el-button>
<LeftBar v-if="userInfo"></LeftBar>
</el-aside>
<el-main class="index-main">
<el-scrollbar
wrap-class="content-scroll-area"
:native="false"
>
<transition name="fade">
<router-view v-if="$store.state.isRouterAlive"></router-view>
</transition>
</el-scrollbar>
</el-main>
</el-container>
</el-container>
</div>
</template>
<script>
import LeftBar from './menu/leftbarnew.vue'
import TopBar from './menu/topbar.vue'
import { mapGetters } from 'vuex'
export default {
name: 'Index',
components: {
LeftBar,
TopBar
},
data() {
return {
// isRouterAlive: true
fold: false
}
},
computed: {
...mapGetters({
userInfo: 'userInfo'
})
},
methods: {
// reload () {
// this.isRouterAlive = false
// this.$nextTick(() => (this.isRouterAlive = true))
// }
handleFold() {
this.fold = !this.fold
}
},
}
</script>
<style lang="scss">
.body {
background: #f5f5f5;
.el-header,
.el-main,
.el-aside {
padding: 0;
}
.el-header {
box-shadow: 0 1px 3px rgba(#ccc, 0.5);
}
.el-container {
// height: calc(100vh - 61px);
padding: 0;
margin: 0;
}
.index-header {
margin-bottom: 2px;
}
.index-aside {
width: 231px !important; // 50
height: calc(100vh - 63px);
position: relative;
transition: all 0.3s;
overflow: hidden;
}
.index-aside-fold {
width: 42px !important;
}
.index-main {
height: calc(100vh - 63px);
overflow: hidden;
}
.content-scroll-area {
max-height: calc(100vh - 63px);
}
.fold {
position: absolute;
right: 0;
top: 14px;
z-index: 1;
border-radius: 0;
border: 1px solid #e6e6e6;
border-right: none;
border-top-left-radius: 100px;
border-bottom-left-radius: 100px;
color: #ccc;
}
}
</style>

View File

@@ -0,0 +1,447 @@
<template>
<div class="afsOrder-detail baselayout">
<!-- order.storeName -->
<h2 style="color:#409EFF;">
售后单详情-{{afsOrderStatus || ''}}
<div class="status-155" v-if="afsOrder.status === 155">
<el-button :disabled="(afsOrder.flag & 3) !== 0" size="mini" type="danger" @click="handleAgreeOrRefuse(3, afsOrder)">驳回{{(afsOrder.flag & 3) === 3 ? '(已操作)' : ''}}</el-button>
<el-button :disabled="(afsOrder.flag & 3) !== 0" size="mini" type="primary" @click="handleAgreeOrRefuse(1, afsOrder)">退款{{(afsOrder.flag & 3) === 1 ? '(已操作)' : ''}}</el-button>
</div>
<div v-if="afsOrder.status === 165">
<el-button :disabled="(afsOrder.flag & 4) !== 0" size="mini" type="primary" @click="handleReceiveGoods(afsOrder)">收到退货{{(afsOrder.flag & 4) === 4 ? '(已操作)' : ''}}</el-button>
</div>
</h2>
<div class="wrapper">
<div class="wrapper-left">
<div class="top">
<!-- 门店名称 -->
<div @click="goStore" class="link" style="width: 48%">{{order.storeName}}({{order.deliveryType === 'self' ? order.jxStoreID : afsOrder.jxStoreID}})</div>
<!-- 售后单号 -->
<div style="width: 48%">售后单号: <b>{{afsOrder.afsOrderID}}</b></div>
<!-- 订单号 -->
<div style="width: 48%">
<router-link class="link" :to="'/ordermanager/' + afsOrder.vendorOrderID" target="_blank">
订单号: <b>{{afsOrder.vendorOrderID}}({{vendorName}})</b>
</router-link>
</div>
<!-- 售后方式 -->
<div style="width: 48%">售后方式: <b>{{afsAppealTypeName}}</b></div>
</div>
<div class="top">
<div style="width: 28%">售后状态: <b>{{afsOrderStatus}}</b></div>
<div style="width: 68%">售后描述: <b>{{afsOrder.reasonDesc}}</b></div>
</div>
<div class="img-wrapper">
<div>图片描述: </div>
<div class="img">
<img @click="showImg(url)" v-for="(url, index) in imgList" :src="url" :key="index">
</div>
</div>
<h4>客户信息</h4>
<div class="top">
<!-- 申请时间 -->
<div style="width: 98%;">申请时间<b v-if="afsOrder.afsCreatedAt">{{afsOrder.afsCreatedAt | timeToLLL}}</b></div>
<!-- 申请人 -->
<div style="width: 34%">申请人: <b>{{ order.deliveryType === 'self' ? '' : order.consigneeName}}</b></div>
<!-- 联系方式 -->
<div style="width: 62%;">临时号:<b>{{order.deliveryType === 'self' ? '' : order.consigneeMobile}}</b> &emsp;&emsp;真实号:<b>{{ order.deliveryType === 'self' ? '' : order.consigneeMobile2 || '暂无'}}</b></div>
<div style="width: 98%;">地址: {{ order.deliveryType === 'self' ? '' : order.consigneeAddress}}</div>
<div style="width: 98%;">备注: {{ comment }}</div>
</div>
<h4 v-if="order.deliveryType !== 'self'">快递信息</h4>
<!-- <div class="devider"></div> -->
<div class="top" v-if="order.deliveryType !== 'self'">
<!-- 快递信息 -->
<!-- 物流 -->
<div style="width: 30%">物流:<b>{{$store.state.serverInfo.vendorName[order.waybillVendorID] || '自送'}}</b></div>
<div style="width: 66%">运单号: <b>{{order.vendorWaybillID}}</b></div>
<div style="width: 30%">配送员: <b>{{order.courierName}}</b></div>
<div style="width: 66%">电话: <b>{{order.courierMobile}}</b></div>
</div>
<h4>商品信息</h4>
<!-- 商品信息 -->
<div class="goods-info">
<div class="left">
<div class="title">该单商品( <b>{{order.skuCount}}</b> <b>{{order.goodsCount}}</b> )</div>
<div class="price">
京西:<b>{{(order.shopPrice / 100).toFixed(2)}}</b>&nbsp;
售卖:<b>{{(order.salePrice / 100).toFixed(2)}}</b>&nbsp;
<!-- 平台:<b>{{(order.vendorPrice / 100).toFixed(2)}}</b>&nbsp; -->
实付:<b>{{(order.actualPayPrice / 100).toFixed(2)}}</b>&nbsp;
订单优惠:<b>{{(order.discountMoney / 100).toFixed(2)}}</b>&nbsp;
配送费:<b>{{(order.desiredFee / 100).toFixed(2)}}</b>&nbsp;
</div>
<div class="price">
门店收益:<b>{{computedStoreEarning}}</b>&nbsp;
平台结算(含补贴):<b>{{(order.totalShopMoney / 100).toFixed(2)}}</b>&nbsp;
</div>
<div class="price">
平台补贴:<b>{{(order.pmSubsidyMoney / 100).toFixed(2)}}</b>&nbsp;
预计收益:<b>{{computedJxEarning}}</b>&nbsp;
</div>
<!-- skulist -->
<div class="sku-list" v-loading="!orderSkus">
<div v-for="(item, index) in orderSkus" :key="index" class="sku-item">
<div class="left">
<img :src="item.image.split('?')[0] + '?imageView2/1/w/60/h/60'" class="cpt" @click="imgPreview(item.image.split('?')[0])">
</div>
<div class="center">
<div>(skuID: {{item.skuID}}) {{item.skuName}}</div>
<div style="margin-top: 5px;">
<span>京西:{{(item.shopPrice / 100).toFixed(2)}}</span>
<span style="margin-left: 10px;">售卖:{{(item.salePrice / 100).toFixed(2)}}</span>
<!-- <span style="margin-left: 10px;">平台:{{(item.vendorPrice / 100).toFixed(2)}}</span> -->
</div>
<div v-if="!isNewPriceDisplay && (order.payPercentage > 50 && isGY)">
<span>活动结算:{{item.storeSubID ? (item.earningPrice / 100).toFixed(2) : 0}}</span>
<span>结算:{{(item.earningPrice / 100).toFixed(2)}}</span>
</div>
</div>
<div class="right">
<span>X{{item.count}}</span>
<el-button icon="el-icon-search" type="text" @click="goStoreSku(item.skuID)"></el-button>
</div>
</div>
</div>
</div>
<div class="right">
<div class="title">售后商品</div>
<!-- <div class="price">退换商品金额: <b>{{(afsOrder.skuUserMoney / 100).toFixed(2)}}</b></div> -->
<!-- skulist -->
<div class="sku-list" v-loading="!orderSkus">
<div v-for="(item, index) in afsOrderSkus" :key="index" class="sku-item">
<div class="left">
<img class="cpt" @click="imgPreview(item.image.split('?')[0])" :src="item.image.split('?')[0] + '?imageView2/1/w/60/h/60'">
</div>
<div class="center">
<div>(skuID: {{item.skuID}}) {{item.name}}</div>
<div style="margin-top: 5px;">
<span>{{item.shopPrice / 100}}</span>
</div>
</div>
<div class="right">
<span>X{{item.count}}</span>
<el-button icon="el-icon-search" type="text" @click="goStoreSku(item.skuID)"></el-button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="wrapper-right">
<div class="table-wrapper">
<OrderStatus :orderStatus="orderStatus"></OrderStatus>
</div>
</div>
</div>
</div>
</template>
<script>
/* eslint-disable */
import api from '@/utils/api'
import {
getOrderSkus,
apiGetOrder,
apiGetAfsOrders
} from '@/apis/controls/order'
import {showLoad, hideLoad} from '@/tools/loading'
import moment from 'moment'
moment.locale('zh-cn')
import OrderStatus from './cmp/cmp-order-status'
import {getOneStore} from '@/apis/controls/shop.js'
import imgPreview from '@/tools/imgPreview.js'
import {mapGetters} from 'vuex'
import {isGY} from '@/utils/api'
/* eslint-disable */
export default {
name: 'AfsOrderDetail',
components: {
OrderStatus
},
data () {
return {
afsOrderID: '',
order: {},
afsOrder: {},
orderSkus: [],
afsOrderSkus: [],
storeInfo: {},
orderStatus: []
}
},
computed: {
...mapGetters({
isNewPriceDisplay: 'isNewPriceDisplay'
}),
isGY: () => isGY,
// 售后类型
afsAppealTypeName () {
let serverInfo = this.$store.getters.serverInfo || {}
return serverInfo.afsAppealTypeName ? serverInfo.afsAppealTypeName[this.afsOrder.appealType] : ''
},
// 售后状态
afsOrderStatus () {
let serverInfo = this.$store.getters.serverInfo || {}
let orderStatus = serverInfo.orderStatus || {}
return orderStatus[this.afsOrder.status] || ''
},
imgList () {
return this.afsOrder.reasonImgList ? this.afsOrder.reasonImgList.split(',') : []
},
vendorName () {
let serverInfo = this.$store.getters.serverInfo || {}
return serverInfo.vendorName[this.afsOrder.vendorID] || ''
},
computedStoreEarning () {
const storeInfo = this.storeInfo
const order = this.order
if (storeInfo) {
if (!this.isNewPriceDisplay) {
if (!(storeInfo.payPercentage >= 50 && storeInfo.payPercentage <= 100)) {
// 小于50
return ((order.totalShopMoney - order.desiredFee) * (100 - storeInfo.payPercentage / 2) / 100 / 100).toFixed(2)
} else {
// 大于等于50
return (order.earningPrice / 100).toFixed(2)
}
} else {
return (order.shopPrice / 100).toFixed(2)
}
} else {
return '--'
}
},
computedJxEarning () {
const storeInfo = this.storeInfo
const order = this.order
if (storeInfo) {
if (!this.isNewPriceDisplay) {
if (!(storeInfo.payPercentage >= 50 && storeInfo.payPercentage <= 100)) {
// 小于50
// 预计收益=平台结算*门店结算比例/200
return (order.totalShopMoney * storeInfo.payPercentage / 200 / 100).toFixed(2)
} else {
// 大于50
// 预计收益=平台结算-配送费-预计收益(-远距离配送费-京西已加小费 - order.distanceFreightMoney - order.waybillTipMoney)
return ((order.totalShopMoney - order.desiredFee - order.earningPrice) / 100).toFixed(2)
}
} else {
return ((order.totalShopMoney - order.desiredFee - order.shopPrice - order.distanceFreightMoney) / 100).toFixed(2)
}
} else {
return '--'
}
},
comment(){
if(this.order.buyerComment === '支付方式:扫码枪' || this.order.buyerComment === '支付方式cashPay') return ''
return this.order.buyerComment
}
},
async created () {
const afsOrderID = this.$route.params.id
this.afsOrderID = afsOrderID
try {
// 获取售后单信息
await this.getAfsOrder()
// 获取售后单商品信息
await this.getAfsOrderSkus()
// 获取订单信息
await this.getOrder()
// 订单商品信息
await this.getOrderSkus()
// 获取订单序列
await this.getOrderStatus()
// 获取门店信息
let {stores} = await getOneStore(this.order.jxStoreID ? this.order.jxStoreID : this.order.storeID, true)
this.storeInfo = stores[0]
} catch (e) {
this.$message({
message: '请求出错,请刷新重试',
type: 'error',
center: true
})
} finally {
hideLoad()
}
},
methods: {
// 获取订单信息
async getOrder () {
let res = await apiGetOrder({vendorOrderID:this.afsOrder.vendorOrderID})
if(res.data) this.order = res.data[0]
},
// 获取售后单信息
async getAfsOrder () {
let { data } = await apiGetAfsOrders({ afsOrderID:this.afsOrderID})
this.afsOrder = data[0]
},
// 订单商品信息
async getOrderSkus () {
let data = await getOrderSkus(this.afsOrder.vendorOrderID,this.afsOrder.vendorID)
this.orderSkus = data
},
// 获取售后单商品信息
async getAfsOrderSkus () {
let data = await api(`v2/order/GetAfsOrderSkuInfo?afsOrderID=${this.afsOrderID}&vendorID=${this.afsOrder.vendorID}`)
this.afsOrderSkus = data
},
// 获取门店信息
async getStoreInfo () {
let {data} = await api(`v2/store/GetStores?storeID=${this.afsOrder.jxStoreID}`)
this.storeInfo = data
},
// 获取售后单序列
async getOrderStatus () {
let data = await api(`v2/order/GetOrderStatusList?vendorOrderID=${this.afsOrder.vendorOrderID}&vendorID=${this.afsOrder.vendorID}&orderType=3`)
// 过滤 orderType === 2 运单
// this.orderStatus =this.afsOrder.vendorID !== 16?data.filter(item => item.vendorOrderID === this.afsOrder.afsOrderID) : data // .filter(item => item.orderType !== 2)
this.orderStatus = data.filter(item => item.vendorOrderID === this.afsOrder.afsOrderID) // .filter(item => item.orderType !== 2)
// let arr = data.map(item => `${item.vendorOrderID},${item.orderType}`)
// this.statusList = Array.from(new Set(arr))
},
// 跳转到门店
goStore () {
// this.$router.push('/455555')
let routeData = this.$router.resolve({
name: 'JxStoreManager',
query: {storeID: this.order.jxStoreID ? this.order.jxStoreID : this.order.storeID}
})
window.open(routeData.href, '_blank')
},
// 显示大图
showImg (url) {
this.$msgbox({
title: '',
message: `<div style="padding: 0 20px;"><img class="big-img" src="${url}" width="100%"></div>`,
dangerouslyUseHTMLString: true,
showCancelButton: false,
showConfirmButton: false,
showCancel: true
})
},
// 退款或驳回
async handleAgreeOrRefuse (type, afsOrder) {
if (type === 1) {
// 退款处理
try {
await this.$confirm('是否进行退款处理', '提示', {type: 'warning'})
// 确定
this.apiDealAfs(type, '同意退款', afsOrder)
} catch (e) {
// 取消
}
} else if (type === 3) {
try {
let res = await this.$prompt('请输入驳回理由', '提示', {
inputValidator: (str) => {
if (!str || !str.trim()) return false
return true
},
inputErrorMessage: '理由不能为空'
})
let {value} = res // 理由
// 确定
this.apiDealAfs(type, value, afsOrder)
} catch (e) {
// 取消
}
}
},
// 处理售后订单
async apiDealAfs (type, reason, afsOrder) {
try {
showLoad()
let form = new FormData()
form.append('afsOrderID', afsOrder.afsOrderID)
form.append('vendorID', afsOrder.vendorID)
form.append('approveType', type)
form.append('reason', reason)
if(type === 1 && this.afsOrder.vendorID === 3){
form.append('vendorOrderID', this.afsOrder.vendorOrderID)
form.append('refundSkuList', JSON.stringify(this.afsOrderSkus))
// // 饿百退款处理
// await api('v2/order/PartRefundOrder', {
// method: 'PUT',
// data: form
// })
}
// else {
// await api('v2/order/AgreeOrRefuseRefund', {
// method: 'PUT',
// data: form
// })
// }
await api('v2/order/AgreeOrRefuseRefund', {
method: 'PUT',
data: form
})
// 成功
this.$message({
message: '操作成功',
type: 'success',
center: true
})
afsOrder.flag = type === 1 ? 1 : 3
afsOrder.refuseReason = reason
} catch (e) {
// 失败
this.$message({
message: e,
type: 'error',
center: true
})
} finally {
hideLoad()
}
},
// 收到退货
async handleReceiveGoods (afsOrder) {
try {
await this.$confirm('是否确认收到退货', '提醒')
this.apiReceiveGoods(afsOrder)
} catch (e) {
console.log(e)
}
},
imgPreview (src) {
imgPreview(src)
},
// 收到退款api
async apiReceiveGoods (afsOrder) {
try {
showLoad()
let form = new FormData()
form.append('afsOrderID', afsOrder.afsOrderID)
form.append('vendorID', afsOrder.vendorID)
await api('v2/order/ConfirmReceivedReturnGoods', {
method: 'PUT',
data: form
})
afsOrder.flag = 4
} catch (e) {
this.$message({
message: e,
type: 'error',
center: true
})
} finally {
hideLoad()
}
},
// 跳转到门店商品
goStoreSku (skuID) {
let routeData = this.$router.resolve({
name: 'StoreGoodsManager',
query: {storeID: this.order.jxStoreID, skuID}
})
window.open(routeData.href, '_blank')
}
}
}
</script>
<style lang="sass" scoped>
@import './afs-order-manager';
</style>

View File

@@ -0,0 +1,193 @@
// 售后单管理
.afsOrder-manager {
overflow-x: auto;
min-height: calc(100vh - 130px);
min-width: auto !important;
.scroll-box {
height: calc(100vh - 310px);
@media screen and (max-width: 1830px) {
// height: calc(100vh - 310px);
}
}
.max-width {
width: 1300px;
overflow-x: auto;
// overflow: auto;
}
.page {
text-align: center;
margin-top: 10px;
}
.afs-order-table {
td {
padding: 5px 0;
}
}
.afs-order-id {
display: flex;
align-items: center;
line-height: 1.3;
div:nth-of-type(1) {
margin-right: 10px;
// border-right: 1px solid #ccc;
}
}
.afs-order-id-detail {
a {
cursor: pointer;
text-decoration: none;
color: #606266;
&:hover {
color: #409EFF;
text-decoration: underline;
}
}
}
.focusColor {
color: #E6A23C;
}
.operate-wall {
button {
cursor: pointer;
padding: 5px 0;
}
}
}
// 售后单详情
$width: 1400px;
.afsOrder-detail {
overflow: auto;
min-height: calc(100vh - 130px);
min-width: $width;
h2 {
display: flex;
align-items: center;
div {
margin-left: 40px;
}
}
.wrapper {
min-width: $width;
display: flex;
// background: orange;
.wrapper-left {
width: 800px;
box-sizing: border-box;
// overflow: auto;
}
.wrapper-right {
// flex: 1;
// max-width: $width - 800px;
// height: 300px;
width: 100%;
box-sizing: border-box;
padding: 0 10px;
min-width: 230px;
// width: 600px;
// background: red;
.table-wrapper {
width: 95%;
}
}
}
.top {
display: flex;
flex-flow: row wrap;
justify-content: space-between;
color: #303133;
align-items: center;
div {
// width: 23%;
margin-bottom: 20px;
margin-right: 2%
}
}
.link {
cursor: pointer;
text-decoration: none;
color: #303133;
&:hover {
color: rgba(#409EFF, 1);
text-decoration: underline;
}
}
h4 {
// margin-bottom: 0;
color: rgba(#409EFF, 1);
border-bottom: 1px solid rgba(#409EFF, .5);
}
.img-wrapper {
color: #303133;
display: flex;
align-items: center;
.img {
margin-left: 40px;
}
img {
width: 80px;
height: 80px;
border-radius: 10px;
margin: 0 20px;
cursor: pointer;
transition: all .3s;
&:hover {
box-shadow: 0 0 10px #409EFF;
}
}
}
.goods-info {
display: flex;
.left, .right {
width: 390px;
padding: 10px 10px 10px 0;
}
.price {
font-size: 14px;
b {
color: #F56C6C;
font-weight: bold;
}
}
}
.sku-list {
margin-top: 10px;
min-height: 50px;
.sku-item {
display: flex;
align-items: center;
// padding: 5px 0;
border-radius: 5px;
.left, .center, .right {
margin: 0 5px;
// border: 1px solid #ccc;
}
.left {
// flex: 1;
font-size: 0;
width: 60px;
img {
border-radius: 5px;
border: 1px solid #DCDFE6;
width: 60px;
height: 60px;
}
}
.center {
flex: 5;
font-size: 14px;
}
.right {
flex: 1;
// line-height: 50px;
font-size: 12px;
}
&:nth-of-type(odd) {
background: #f4f1f1;
}
}
.sku-item + .sku-item {
// border-top: 1px solid #efefef;
}
}
}

Some files were not shown because too many files have changed in this diff Show More