Commit f888ba0d by 王琦琳

Merge branch 'dev_v4.20.0' into 'develop'

Dev v4.20.0

See merge request !1
2 parents c14d5bb3 601f7ca6
{
"name": "ordermanage",
"name": "finance",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
......@@ -6510,9 +6510,9 @@
}
},
"glsx-common": {
"version": "2.0.8",
"resolved": "https://registry.npmjs.org/glsx-common/-/glsx-common-2.0.8.tgz",
"integrity": "sha512-hKt/SNFu+NslOHWvDLxmRwUkINBrnATTYIkOj+jmcx5RqfXIbMgEipzFGbCICWMlYYoecwRiJ6341sstPCCHLQ==",
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/glsx-common/-/glsx-common-2.1.0.tgz",
"integrity": "sha512-wlUFgrZkJODh5MNpnVaT2zswkep1BUnvRgyhUABp2mDrt7d8yemnrdDYCfuBSWT7LCn+httSEieOEtm2XSlc0Q==",
"requires": {
"axios": "^0.21.3",
"md5": "^2.3.0",
......
{
"name": "ordermanage",
"name": "finance",
"version": "1.0.0",
"description": "A Vue.js project",
"private": true,
......@@ -13,7 +13,7 @@
"dayjs": "^1.10.7",
"el-tree-transfer": "^2.2.6",
"element-ui": "^2.4.5",
"glsx-common": "^2.0.8",
"glsx-common": "^2.1.0",
"glsx-components": "^1.2.5",
"rfdc": "^1.3.0",
"vue": "^2.6.10",
......
import { http } from '@/main'
const path = 'dj.api.'
const path2 = 'dj.smartcarlife.api.'
// 获取素材详情
const getProductInfo = (params) => {
const path = 'dj.api.smartcarlife.orderDivision.'
const pathServicer = 'dj.api.smartcarlife.sevicerOrderDivision.'
// 获取服务商关联的园区店信息
const getPartnerYqListApi = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}goodsinfo.get.byId`
params.routerMethod = `dj.smartcarlife.api.partnerMerchant.listYq`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
......@@ -14,10 +15,10 @@ const getProductInfo = (params) => {
})
}
// 获取场景下类目
const getProductTypeBySceneId = (params) => {
// 分账-列表
const getListApi = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}goodsCategoryConfiguration.queryGoodsCategoryBySceneId`
params.routerMethod = `${path}page`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
......@@ -26,10 +27,10 @@ const getProductTypeBySceneId = (params) => {
})
}
// 查询产品列表
const getGoodsList = (params) => {
// 分账-统计
const getCountApi = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}goodsinfo.list`
params.routerMethod = `${path}count`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
......@@ -38,4 +39,15 @@ const getGoodsList = (params) => {
})
}
export default { getGoodsList,getProductInfo, getProductTypeBySceneId }
//导出
export function exportExcel(params) {
params.method = `scrm.api.partner.orderdivision.export`
return http({
url: 'rop-scrm-partner/router',
method: 'POST',
data: params,
sign: true
})
}
export default { getPartnerYqListApi, getListApi, getCountApi, exportExcel }
import { http } from '@/main'
const path = 'dj.api.smartcarlife.'
const path2 = 'scrm.api.shopmall.'
// 查询列表
const getList = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}ordermanage.page`
params.routerMethod = `${path}goodsOrderProfitAllocation.page.byOrder`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
......@@ -14,9 +14,10 @@ const getList = params => {
})
}
const getOrderDetail = params => {
// 统计
const getListTotal = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}advanceOrder.detail`
params.routerMethod = `${path}goodsOrderProfitAllocation.page.count`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
......@@ -25,9 +26,10 @@ const getOrderDetail = params => {
})
}
const getOrderCount = params => {
// 财务列表主订单明细
const mainOrderDetail = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}ordermanage.count`
params.routerMethod = `${path}goodsOrderProfitAllocation.mainOrder.detail`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
......@@ -36,10 +38,10 @@ const getOrderCount = params => {
})
}
// 众筹活动订单查询列表
const shopmallOrderList = params => {
// 财务列表子订单明细
export function subOrderDetail(params) {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}shopmallOrder.pageList`
params.routerMethod = `${path}goodsOrderProfitAllocation.subOrder.detail`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
......@@ -48,49 +50,14 @@ const shopmallOrderList = params => {
})
}
// 订单详情
const goodsOrderDetail = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}goodsOrder.detail`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
//根据园区店商户号获取4s列表
const getServiceStore = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.scenemerchantref.query4SRefByYqShop`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
//众筹订单列表
// const getListApi = params => {
// params.method = `${path2}order.noSessionPage`
// params.routerMethod = `${path2}order.noSessionPage`
// return http({
// url: 'rop-scrm-boutiquecoupon/router',
// method: 'POST',
// data: params,
// sign: true
// })
// }
const getListApi = params => {
params.method = `${path2}order.noSessionPage`
export function exportExcel(params) {
params.method = `scrm.api.partner.orderProfitAllocation.export`
return http({
url: 'rop-scrm-shopmall/router',
url: 'rop-scrm-partner/router',
method: 'POST',
data: params,
sign: true
})
}
export default { getList, getOrderDetail, getOrderCount, shopmallOrderList, goodsOrderDetail, getServiceStore, getListApi }
export default { getList, getListTotal, mainOrderDetail, subOrderDetail, exportExcel }
import { http } from '@/main'
// const path = 'dj.api.smartcarlife.'
const path = 'dj.api.smartcarlife.'
const path2 = 'dj.api.'
/** 获取园区店列表 - 园区店 */
......@@ -15,6 +15,18 @@ const getParkStore = params => {
})
}
// 获取当前登录账号可见的园区店列表
const getyqMerchantList = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}permission.yqMerchant.list`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
/** 获取园区店列表 - 流量来源 */
const getServiceStore = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
......@@ -39,4 +51,4 @@ const getChannelType = params => {
})
}
export default { getParkStore, getServiceStore, getChannelType }
export default { getParkStore, getServiceStore, getChannelType, getyqMerchantList }
import { http } from '@/main'
const path = 'dj.api.smarcarlife.'
const path2 = 'dj.api.goodsInfo.'
const path3 = 'dj.api.smartcarlife.'
// 分页查询采购订单
const getPurchaseOrderList = (params) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseOrder.page`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 采购订单取消/审核
const purchaseOrderCancelOrCheck = (params) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseOrder.cancelOrCheck`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 查看采购订单
const purchaseOrderDetail = (params) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseOrder.view`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 分页查询采购商城素材信息
const listWithPagePurchaseInfo = (params) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path2}listWithPage.purchaseInfo`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取当前登录园区店商户收货地址
const addressGet = (params = {}) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}yqMerchantDeliveryAddress.get`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 保存园区店商户收货地址
const addressSave = (params) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}yqMerchantDeliveryAddress.save`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 按商品类目分组获取购物车列表
const listGroupByGoodsType = (params) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseShoppingCar.listGroupByGoodsType`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 更新购物车商品选中标识
const updateSelectedFlag = (params) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseShoppingCar.updateSelectedFlag`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 移除购物车商品
const shoppingCarRemove = (params) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseShoppingCar.remove`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 添加到购物车
const shoppingCarAdd = (params) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseShoppingCar.add`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 修改购物车商品数量
export function shoppingCarUpdateNumber(params) {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseShoppingCar.updateNumber`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params
})
}
// 添加采购订单
export function purchaseOrderAdd(params) {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseOrder.add`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
export function exportExcel(params) {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.smarcarlife.purchaseOrder.export`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 采购订单入库
export function purchaseOrderPutIn(params) {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseOrder.putIn`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取下单/入库门店
export function getMerchantList(params) {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path3}permission.yqMerchant.list`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 确认发货
// export function purchaseOrderConfirmDelivery(data) {
// params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
// data.routerMethod = `${path}purchaseOrder.confirmDelivery`
// return http(data)
// }
export default { getMerchantList,purchaseOrderPutIn, exportExcel, shoppingCarUpdateNumber, purchaseOrderAdd, shoppingCarAdd, shoppingCarRemove, updateSelectedFlag, listGroupByGoodsType, getPurchaseOrderList, purchaseOrderCancelOrCheck, purchaseOrderDetail, listWithPagePurchaseInfo, addressGet, addressSave }
\ No newline at end of file
......@@ -182,7 +182,8 @@ function getExplorer() {
return browserType
}
function exportFn(url) {
export const exportFn = url => {
url = url + '?timestamp=' + new Date().getTime()
let browserType = getExplorer()
if (browserType == 'QQ') {
window.open(url)
......@@ -193,3 +194,116 @@ function exportFn(url) {
iframe.src = url
document.body.appendChild(iframe)
}
// 订单类型
export const orderTypeList = [
{
confId: '1',
confLabel: '正常'
},
{
confId: '2',
confLabel: '异常'
},
{
confId: '3',
confLabel: '正常测试'
},
{
confId: '4',
confLabel: '异常测试'
},
{
confId: '5',
confLabel: '未收款'
},
{
confId: '-1',
confLabel: '无'
}
]
// 分账状态
export const divisionStatusList = [
{
confId: '1',
confLabel: '待分账'
},
{
confId: '2',
confLabel: '分账中'
},
{
confId: '3',
confLabel: '分账成功'
},
{
confId: '4',
confLabel: '分账失败'
},
{
confId: '5',
confLabel: '异常'
}
]
// 分账方式
export const divisionTypeList = [
{
confId: '1',
confLabel: '线下对账'
},
{
confId: '2',
confLabel: '线上分账'
}
]
// 支付方式
export const payTypeList = [
{
confId: '1',
confLabel: '微信支付'
},
{
confId: '2',
confLabel: '4S店支付'
},
{
confId: '3',
confLabel: 'POS机收款'
},
{
confId: '4',
confLabel: '支付宝支付'
}
]
// 园区店模式/经营模式
export const manageTypeList = [
{ confId: 0, confLabel: '园区店' },
{ confId: 1, confLabel: '驻店' }
]
// 所属场景
export const sceneList = {
1: '精品升级',
2: '次新车转化',
3: '售后众筹',
0: '会员权益/升级'
}
export const proportionType = {
1: '(毛利)',
2: '(收入)',
3: '(固定金额)',
4: '(产值-流量成本)',
5: '(产值-流量成本-其他费用不包含产品成本)',
6: '(产值-流量成本-其他费用包含产品成本)'
}
export const targetType = {
1: '流量方',
2: '服务商',
3: '平台方'
}
// import Vue from 'vue'
import { Message, MessageBox, Loading } from "element-ui"
import { Message, MessageBox, Loading } from 'element-ui'
// import moment from 'moment'
import dayjs from "dayjs"
let loadingInstance = ""
import dayjs from 'dayjs'
let loadingInstance = ''
export const Util = {
/**
......@@ -16,20 +16,20 @@ export const Util = {
* confirmButtonColor 确认按钮颜色
* cancelButtonColor 取消按钮颜色
*/
msg: function (options) {
msg: function(options) {
MessageBox({
title: options.title || "",
type: options.type || "error",
message: options.message || "",
className: options.className || "",
title: options.title || '',
type: options.type || 'error',
message: options.message || '',
className: options.className || '',
showCancelButton: options.showCancelButton || false,
confirmButtonText: options.confirmButtonText || "确认",
cancelButtonText: options.cancelButtonText || "取消",
confirmButtonColor: options.confirmButtonColor || "#1989fa",
cancelButtonColor: options.cancelButtonColor || "#000",
confirmButtonText: options.confirmButtonText || '确认',
cancelButtonText: options.cancelButtonText || '取消',
confirmButtonColor: options.confirmButtonColor || '#1989fa',
cancelButtonColor: options.cancelButtonColor || '#000',
dangerouslyUseHTMLString: true,
callback: function (action, done) {
if (action == "confirm") {
callback: function(action, done) {
if (action == 'confirm') {
if (options.success) {
options.success(done)
}
......@@ -55,56 +55,55 @@ export const Util = {
/**
* 提示框
*/
Info: function (options) {
Info: function(options) {
Message({
message: options.message || "提示",
type: options.type || "error",
message: options.message || '提示',
type: options.type || 'error',
duration: options.time || 2000,
onClose: options.onClose || ""
onClose: options.onClose || ''
})
},
/**
* 轻提示
*/
Tips: function (options) {
Tips: function(options) {
Message({
message: options.message || "提示",
message: options.message || '提示',
duration: options.duration || 3000,
type: options.type || "text",
icon: options.icon || ""
type: options.type || 'text',
icon: options.icon || ''
})
},
/**
* loading
*/
loading: function (message) {
loading: function(message) {
loadingInstance = Loading.service({
text: message || "加载中..."
text: message || '加载中...'
})
},
/**
* 关闭loading
*/
closeLoading: function () {
closeLoading: function() {
loadingInstance.close()
},
/**
* 校验手机号码格式
*/
checkPhone: function (mobile) {
const myreg =
/^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/
checkPhone: function(mobile) {
const myreg = /^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/
return myreg.test(mobile)
},
/**
* 校验固定电话
*/
validationTel: function (tel) {
validationTel: function(tel) {
const reg = /^0[\d]{2,3}-[\d]{7,8}$/
return reg.test(tel)
},
......@@ -112,17 +111,15 @@ export const Util = {
/**
* 是否特殊字符
*/
isSpecialLetter: function (str) {
const reg = new RegExp(
"[`~!@#$^&*=|{}':;',\\[\\]<>?~!@#¥……&*——|{}【】‘;:”“'。,、? ]"
)
isSpecialLetter: function(str) {
const reg = new RegExp("[`~!@#$^&*=|{}':;',\\[\\]<>?~!@#¥……&*——|{}【】‘;:”“'。,、? ]")
return reg.test(str)
},
/**
* 只能输入英文字母和数字,不能输入中文
*/
validationInput: function (str) {
validationInput: function(str) {
const reg = /[^\w\.\/]/gi // eslint-disable-line
return reg.test(str)
},
......@@ -130,29 +127,27 @@ export const Util = {
/**
* 获取当前时间
*/
getCurrentDate: function () {
getCurrentDate: function() {
const time = new Date()
const y = time.getFullYear()
const m = time.getMonth() + 1
const d = time.getDate()
return {
date: y + "/" + m + "/" + d
date: y + '/' + m + '/' + d
}
},
/**
* 获取浏览器参数
*/
getUrlParams: function (name) {
getUrlParams: function(name) {
const vars = []
let hash
const oParams = {}
const hashes = window.location.href
.slice(window.location.href.indexOf("?") + 1)
.split("&")
const hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&')
for (let i = 0; i < hashes.length; i++) {
hash = hashes[i].split("=")
hash = hashes[i].split('=')
vars.push(hash[0])
oParams[hash[0]] = hash[1]
}
......@@ -167,7 +162,7 @@ export const Util = {
/**
* 根据当前时间,计算往后30天的日期
*/
getAfterDate: function (day) {
getAfterDate: function(day) {
const date1 = new Date()
const date2 = new Date(date1)
let time = 30
......@@ -176,8 +171,7 @@ export const Util = {
}
date2.setDate(date1.getDate() + time)
const _date =
date2.getFullYear() + "-" + (date2.getMonth() + 1) + "-" + date2.getDate()
const _date = date2.getFullYear() + '-' + (date2.getMonth() + 1) + '-' + date2.getDate()
return {
date: _date,
......@@ -190,8 +184,8 @@ export const Util = {
/**
* 日期格式转换
*/
dateFormate: function (str, type) {
let txt = "YYYY-MM-DD"
dateFormate: function(str, type) {
let txt = 'YYYY-MM-DD'
if (type) {
txt = type
}
......@@ -202,9 +196,9 @@ export const Util = {
/**
* 字段截取
*/
cutStr: function (str, num) {
cutStr: function(str, num) {
if (!str) {
return ""
return ''
}
let m = 10
......@@ -213,7 +207,7 @@ export const Util = {
m = num
}
if (str.length > m) {
n = str.slice(0, m) + "..."
n = str.slice(0, m) + '...'
}
return n
......@@ -225,8 +219,8 @@ export const Util = {
// * console.log(bar===foo) false
// * @param {*} obj
// */
deepClone: function (obj) {
const clone = require("rfdc")({ proto: false, circles: false })
deepClone: function(obj) {
const clone = require('rfdc')({ proto: false, circles: false })
return clone(obj)
},
// deepClone: function (obj) {
......@@ -257,10 +251,10 @@ export const Util = {
* url下载文件
*
*/
downLoadFile: function (url) {
downLoadFile: function(url) {
// console.log(row)
// return
const Temp = document.createElement("a")
const Temp = document.createElement('a')
// Temp.href = process.env.VUE_APP_BASE_URL + '/article/export.do?articleId=' + row.id
Temp.href = url
// console.log(url)
......@@ -275,8 +269,8 @@ export const Util = {
* @param {Object} type: 默认不传 ==>全部小写;传1 ==>全部大写;传2 ==>首字母大写
* 将json的key值进行大小写转换
*/
jsonKeysToCase: function (json, type) {
if (typeof json == "object") {
jsonKeysToCase: function(json, type) {
if (typeof json == 'object') {
var tempJson = JSON.parse(JSON.stringify(json))
toCase(tempJson)
return tempJson
......@@ -285,15 +279,15 @@ export const Util = {
}
function toCase(json) {
if (typeof json == "object") {
if (typeof json == 'object') {
if (Array.isArray(json)) {
json.forEach(function (item) {
json.forEach(function(item) {
toCase(item)
})
} else {
for (var key in json) {
var item = json[key]
if (typeof item == "object") {
if (typeof item == 'object') {
toCase(item)
}
delete json[key]
......@@ -304,10 +298,7 @@ export const Util = {
break
case 2:
// key值首字母大写,其余小写
json[
key.substring(0, 1).toLocaleUpperCase() +
key.substring(1).toLocaleLowerCase()
] = item
json[key.substring(0, 1).toLocaleUpperCase() + key.substring(1).toLocaleLowerCase()] = item
break
default:
// 默认key值全部小写
......@@ -321,21 +312,21 @@ export const Util = {
},
// 判断字段为空时显示
fieldShow: function (field, show) {
fieldShow: function(field, show) {
return field || show
},
// 整数补零显示两位小数
returnFloat: function (num) {
returnFloat: function(num) {
num = num.toString()
if (num.indexOf(".") != -1) {
let newVal = num.split(".")
if (num.indexOf('.') != -1) {
let newVal = num.split('.')
if (newVal[1].length == 1) {
newVal = newVal.join(".")
newVal += "0"
newVal = newVal.join('.')
newVal += '0'
num = newVal
}
} else {
num += ".00"
num += '.00'
}
return num
}
......
......@@ -17,7 +17,7 @@ export const fetchConfig = function(isEnv = true) {
// Object.assign(request, { timeout })
// return Promise.resolve(cfg)
// }
let params = { moduleName: 'ordermanage', mockUrl: 'https://oss-config.glsx.com.cn/mock/64423183e60bb539e414ec67/ordermanage/config', httpOptions: { Headers: { refererurl: location.href }, request: { timeout: 30000 } } }
let params = { moduleName: 'finance', mockUrl: 'https://oss-config.glsx.com.cn/mock/64560af39bfdc8942feaa6f4/finance/config', httpOptions: { Headers: { refererurl: location.href }, request: { timeout: 30000 } } }
return utils.getConfig(params)
// return new Http().get('https://oss-config.test.glsx.com.cn/mock/616d28231072f92988f059fb/home/config')
// return new Http({ Headers: { refererurl: location.href }, request: { timeout: 30000 } }).get('http://config-center-backend.test.glsx.com/glsxAdmin/config?moduleUrl=home').then(res => res)
......
......@@ -9,7 +9,9 @@
*/
import Vue from 'vue'
import apis from './api'
import {optionalChaining} from './utils/chaining'
// 针对template模板中使用可选链操作符
// import chaining from '@/plugins/chaining'
import { optionalChaining } from './utils/chaining'
import './public-path'
import '@/assets/css/public.scss'
import '@/components'
......@@ -19,6 +21,7 @@ import { start } from '@/setup'
Vue.config.productionTip = false
Vue.prototype.$apis = apis
Vue.prototype.$$ = optionalChaining
// Vue.use(chaining)
Vue.prototype.size = 'small'
Vue.prototype.$EventBus = new Vue()
start()
......
// 针对template模板中使用可选链操作符
const chaining = {
install(vue) {
const optionalChaining = (obj, ...rest) => {
let tmp = obj
for (const key in rest) {
const name = rest[key]
tmp = tmp?.[name]
}
return tmp || ""
}
// const test = (obj, ...rest) => {
// let tmp = obj
// for (const key in rest) {
// const name = rest[key]
// tmp = tmp?.[name]
// }
// return tmp || ''
// }
// 添加实例方法
vue.prototype.$$ = optionalChaining
// vue.prototype.$sy = test
}
}
export default chaining
......@@ -3,19 +3,30 @@ const staticRoutes = Object.freeze([
name: 'default',
path: '/'
},
//财务列表
{
name: 'orderManage',
path: '/orderManage/index',
component: resolve => require([`@/views/orderManage/index.vue`], resolve),
name: 'financeManage',
path: '/financeManage/index',
component: resolve => require([`@/views/financeManage/index.vue`], resolve),
meta: {}
},
//精品升级订单详情
//财务-查看明细
{
name: 'orderDetail',
name: 'financeDetail',
path: '/orderManage/orderDetail',
path: '/financeManage/financeDetail',
component: resolve => require([`@/views/orderManage/orderDetail.vue`], resolve),
component: resolve => require([`@/views/financeManage/financeDetail.vue`], resolve),
meta: {}
},
//我的分账
{
name: 'serviceAccount',
path: '/serviceAccount/index',
component: resolve => require([`@/views/serviceAccount/index.vue`], resolve),
meta: {}
}
......
export const optionalChaining = (obj, ...rest) => {
return rest.reduce((newObj, key) => newObj[key], obj)
}
\ No newline at end of file
return rest.reduce((newObj, key) => newObj?.[key], obj) || ''
}
<!-- 专区管理 -->
<template>
<div class="marketing p-t-20">
<div class="m-b-20">
<el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit(1)">新建</el-button>
</div>
<div class="container">
<el-form :inline="true">
<el-form-item label="专区名称">
<el-input style="width: 215px;" :size="size" v-model="searchForm.zoneName"></el-input>
</el-form-item>
<el-form-item class="search-btns">
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" type="default" @click="handleReset">查询</el-button>
</el-form-item>
</el-form>
<!-- 表格区域 开始 -->
<GLTable
ref="zoneRef"
:getListApi="getListApi"
:noDataImg="url"
:searchForm="tableSearchForm"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun"
>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleEdit(2, scope.scope)">编辑</el-button>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
export default {
name: 'zoneList',
data() {
return {
size: 'small',
url: url,
searchForm: {
zoneName: '',
createDate: []
},
tableSearchForm: {},
// 搜索
searchFormData: [
{
label: '专区名称',
name: 'zoneName',
type: 'input',
maxlength: 20
},
{
label: '创建日期',
name: 'createDate',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
}
],
// 表格
getListApi: this.$apis.zoneList.getZoneListApi,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '专区名称',
prop: 'zoneName'
},
{
label: '创建日期',
prop: 'createdDate',
width: '180',
formatter: cellValue => {
return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss')
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' }
}
},
mounted() {},
methods: {
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
params.zoneType = '2' //专区类型(1发现频道,2商城专区)
if (this.searchForm.createDate.length) {
params.startTime = new Date(this.searchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.endTime = new Date(this.searchForm.createDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
delete params.createDate
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
delete this.tableSearchForm.createDate
resolve()
})
},
// 1-新增;2-编辑
handleEdit(addOrEdit, row) {
this.$message({
type: 'success',
message: addOrEdit == '1' ? '新增' : '编辑'
})
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.zoneRef.data.length ? (this.$refs.zoneRef.tableHeightValues = '') : this.$refs.zoneRef.setTableHeightFun()
},
handleSearch() {
this.$refs.zoneRef.refreshTable()
},
handleReset() {
this.searchForm = {
zoneName: ''
}
this.handleSearch()
}
}
}
</script>
<style scoped>
.marketing .search-btns {
float: right;
margin-right: 0;
}
</style>
<template>
<div class="activity">
<GLTabs v-model="activeName"
:tabPaneList="tabPaneList"
@tab-click="handleClick"></GLTabs>
<components :is="tabName"></components>
</div>
</template>
<script>
// import * as dayjs from 'dayjs'
// import url from '@/assets/empty.png'
// import { dateFormat } from '../../utils/index'
import OfflineAccount from "./components/offlineAccountList.vue"
import OnlineAccount from "./components/onlineAccountList.vue"
export default {
components: {
OfflineAccount,
OnlineAccount
},
data() {
return {
activeName: "offline",
tabPaneList: [
{
label: "线下对账",
name: "offline"
},
{
label: "线上分账",
name: "online"
}
],
tabName: "offlineAccount"
}
},
mounted() {
},
computed: {
},
watch: {
},
methods: {
handleClick() {
let arr = {
offline: "offlineAccount",
online: "onlineAccount"
}
this.tabName = arr[this.activeName]
console.log('this.tabName', this.tabName);
},
}
}
</script>
<style scoped lang="scss">
.activity {
/deep/ {
.el-select .el-tag {
max-width: 60% !important;
}
.el-form-item__content {
overflow: inherit !important;
}
}
.container {
margin-top: 16px;
.title {
height: 32px;
line-height: 32px;
margin-bottom: 10px;
.title-text {
font-weight: 600;
font-size: 16px;
color: #333333;
margin-left: 4px;
}
}
}
.empty-btn {
position: absolute;
right: -40px;
top: 0px;
font-size: 14px;
color: #5850ff;
}
.config-pannel {
background: #f9f9f9;
width: 520px;
height: 168px;
display: flex;
.config-item {
padding: 26px 20px;
}
.clear-btn {
cursor: pointer;
background: #f1f1f1;
width: 40px;
height: 100%;
line-height: 20px;
font-size: 14px;
color: #666666;
padding: 60px 13px;
box-sizing: border-box;
}
}
.input-tag-wrapper {
position: relative;
font-size: 14px;
background-color: #fff;
background-image: none;
border-radius: 4px;
border: 1px solid #dcdfe6;
box-sizing: border-box;
color: #666;
display: inline-block;
outline: none;
padding: 5px;
max-height: 68px;
overflow: auto;
flex-wrap: wrap;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 450px;
display: flex;
align-items: center;
margin-top: 6px;
font-size: 14px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
/deep/ .el-tag {
background-color: #fff !important;
margin-bottom: 4px;
}
}
.select-wrap {
.common {
margin: 4px 0;
height: 40px !important;
overflow: hidden;
/deep/ .el-input {
height: 40px !important;
line-height: 40px !important;
}
/deep/ .el-input__suffix {
height: 40px !important;
margin-top: -4px;
.is-reverse {
transform: rotate(180deg);
}
}
}
}
}
.search-groomname {
width: 252px;
margin: 12px 16px 0;
/deep/.el-input {
width: 252px;
}
}
.filter-tree {
padding: 0 16px;
}
.empty {
padding: 10px 0;
margin: 0;
text-align: center;
color: #999;
font-size: 13px;
}
.placeholder {
font-size: 14px;
color: #c0c6ce;
line-height: 20px;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!