Commit 24f38147 by 前端

Merge branch 'develop' into 'master'

Develop

See merge request !125
2 parents e8f1c1ab 6b70adbb
......@@ -112,5 +112,8 @@
<script src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script>
<% } %>
</body>
<script>
</script>
</html>
\ No newline at end of file
......@@ -9,7 +9,11 @@ export default {
name: 'App',
created() {
// console.log(abcd.efg)
const that = this
window.onstorage = function (e) {
// console.log(`The ${e.key} key has been changed from ${e.oldValue} to ${e.newValue} .`)
that.$router.push('/login')
}
},
methods: {
......@@ -19,6 +23,7 @@ export default {
<style lang="scss">
@import "~@/assets/style/public-class.scss";
.el_table {
thead {
th {
......
import request from './request'
import request from "./request"
const path = 'dj.api.'
const path2 = 'dj.smartcarlife.api.'
const path = "dj.api."
const path2 = "dj.smartcarlife.api."
export function getList(data) {
data.method = `${path}basegoods.page`
......@@ -22,7 +22,7 @@ export function getGoodsInfoById(data) {
// 根据基础商品id获取分配门店列表 - 查看门店
export function getMerchantList(data) {
data.method = 'dj.basegoodsmerchantref.list.byBaseGoodsId'
data.method = "dj.basegoodsmerchantref.list.byBaseGoodsId"
return request(data)
}
......@@ -35,90 +35,90 @@ export function getGoodsList(data) {
// 新增商品
export function baseGoodsAdd(data) {
data.method = `${path}basegoods.add`
return request(data, 'post')
return request(data, "post")
}
// 修改商品
export function baseGoodsUpdate(data) {
data.method = `${path}basegoods.update`
return request(data, 'post')
return request(data, "post")
}
// 下架商品
export function baseGoodsUpOrDown(data) {
// data.method = `${path2}basegoods.changeShelfStatus`
data.method = `${path2}basegoods.shelfStatus.update`
return request(data, 'post')
return request(data, "post")
}
// 删除商品
export function baseGoodsDelete(data) {
data.method = `${path2}basegoods.delete`
return request(data, 'post')
return request(data, "post")
}
// 导出
export function exportBaseList(data) {
data.method = `${path}basegoods.export`
return request(data, 'post')
return request(data, "post")
}
// 下架子商品
export function baseGoodsUpOrDownForChild(data) {
data.method = `${path2}upgradedGoods.shelfStatus.update`
return request(data, 'post')
return request(data, "post")
}
// 提交商品审核结果
export function submitReviewResult(data) {
data.method = `${path2}upgradedGoods.submitReviewResult`
return request(data, 'post')
return request(data, "post")
}
// 新增编辑商品
export function addOrEditBaseGoods(data) {
data.method = `${path}basegoods.insertOrUpdate`
return request(data, 'post')
return request(data, "post")
}
// 获取商品列表
export function getBaseGoodsList(data) {
data.method = `${path}basegoods.page`
return request(data, 'post')
return request(data, "post")
}
// 获取按规格分配 门店维度数据转为规格维度展示
export function getSpecDataByMerchent(data) {
data.method = `dj.basegoodsmerchantref.specification.getByBaseGoodsId`
return request(data, 'post')
return request(data, "post")
}
// 按规格分配保存
export function saveAssignBySpec(data) {
data.method = 'dj.basegoodsmerchantref.specification.insertOrUpdate'
return request(data, 'post')
data.method = "dj.basegoodsmerchantref.specification.insertOrUpdate"
return request(data, "post")
}
// 分配门店 统一分配保存
export function saveAssignByMerchant(data) {
data.method = 'dj.basegoodsmerchantref.stores.insertOrUpdate'
return request(data, 'post')
data.method = "dj.basegoodsmerchantref.stores.insertOrUpdate"
return request(data, "post")
}
// 获取场景关联门店/园区店列表
export function getMerchantListByScene(data) {
data.method = `${path}servicemerchantref.listShopWithScene`
return request(data, 'post')
return request(data, "post")
}
// 获取场景-类目-素材三级数据列表
export function getThiredMaterialList(data) {
data.method = `${path}goods.type.querySceneCategoryGoods`
return request(data, 'post')
return request(data, "post")
}
// 保存商品
export function saveTempGoods(data) {
data.method = `${path}basegoods.saveTemp`
return request(data, 'post')
}
\ No newline at end of file
return request(data, "post")
}
......@@ -294,6 +294,12 @@ export function getDiversionMerchantRef(data) {
return request(data, "post")
}
// 获取有关联关系的4s店列表
export function listShop4sByRef(data) {
data.method = `${path}scenemerchantref.listShop4sByRef`
return request(data, "post")
}
// 新增或更新商户二级流量方
export function insertOrUpdateDiversionMerchantRef(data) {
data.method = `${path2}diversionMerchant.insertOrUpdateDiversionMerchantRef`
......
import request from "./request2"
import requestCommon from "./request3"
const defaultPath = 'scrm.api.shopmall.'
const getListApi = data => {
import request from "./request"
// import requestCommon from "./request3"
const defaultPath = "scrm.api.shopmall."
const getListApi = (data) => {
data.method = `${defaultPath}order.noSessionPage`
return request(data)
}
const getCountApi = data => {
const getCountApi = (data) => {
data.method = `${defaultPath}order.noSessionCount`
return request(data)
}
const getOrderDetailApi = data => {
const getOrderDetailApi = (data) => {
data.method = `${defaultPath}order.noSessionDetail`
return request(data)
}
/**营销状态设为已完结 */
const finishOrderStatus = data => {
data.method = 'scrm.api.shopmall.weapp.order.status.finish.nosession'
/** 营销状态设为已完结 */
const finishOrderStatus = (data) => {
data.method = "scrm.api.shopmall.weapp.order.status.finish.nosession"
return request(data)
}
const orderExportApi = data => {
const orderExportApi = (data) => {
data.method = `${defaultPath}order.noSessionExport`
return request(data)
}
const pictureUpload = data => {
data.method = 'glsx.accounts.biz.common.pictureUpload'
return requestCommon(data)
const pictureUpload = (data) => {
data.method = "glsx.accounts.biz.common.pictureUpload"
return request(data, "post", ["file"])
// return request(data)
}
// 导入对账单
const orderEndExportApi = data => {
console.log(data, 'data')
const orderEndExportApi = (data) => {
console.log(data, "data")
data.method = `${defaultPath}order.orderEndExport`
return request(data)
}
/**获取众筹活动名称&门店 */
const getCrowdfundingParams = data => {
data.method = 'scrm.api.shopmall.crowdfunding.activity.parameter.list'
/**1秒杀 2直播间活动 3众筹 4膨胀金 */
/** 获取众筹活动名称&门店 */
const getCrowdfundingParams = (data) => {
data.method = "scrm.api.shopmall.crowdfunding.activity.parameter.list"
/** 1秒杀 2直播间活动 3众筹 4膨胀金 */
data.marketingType = 3
return request(data)
}
export default { pictureUpload, getCrowdfundingParams, orderEndExportApi, getListApi, getCountApi, getOrderDetailApi, orderExportApi, finishOrderStatus }
export default {
pictureUpload,
getCrowdfundingParams,
orderEndExportApi,
getListApi,
getCountApi,
getOrderDetailApi,
orderExportApi,
finishOrderStatus
}
......@@ -5,48 +5,77 @@
* @Last Modified time: 2021-06-30 14:30:41
*/
import axios from '@/plugin/axios'
import sign from './sign'
import RequestMethods from './request.methods'
import util from '@/libs/util.js'
import { baseConfig } from '@/main'
import axios from "@/plugin/axios"
import sign from "./sign"
import RequestMethods from "./request.methods"
import util from "@/libs/util.js"
import { baseConfig } from "@/main"
const request = (
params = {},
method = RequestMethods.GET,
noSignAttr = [],
options
) => {
// console.log(baseConfig)
// params.source = 'glsx'
// params.appKey = 'd7ffc3346fc9a45bccaaa35300d59022'
params.appKey = baseConfig?.axios?.appkey
// clg
// console.log(params.appKey)
// params.appKey = window.location.href.includes('dj.glsx.com.cn')
// ? 'd7ffc3346fc9a45bccaaa35300d59022'
// : '48e5e13229b82c1b4e6e8c96151f0637'
// 兼容线上dj和scrm appkey和secret不一样的情况
let apiName = ""
if (params.method.includes("dj")) {
apiName = "dj"
} else {
apiName = params.method.split(".api")[0]
}
console.log("params.method", params.method)
// console.log("apiName", apiName)
// 为空报错
if (!apiName) {
throw new Error("apiName is null")
}
const mappingName = {
"dj.smartcarlife": "axios",
dj: "axios",
scrm: "axios2",
"glsx.accounts.biz.common.pictureUpload": "common"
}
const baseApiName = mappingName[apiName]
// console.log(baseApiName, "baseApiName")
// params.appKey = baseConfig[baseApiName].appkey
if (baseApiName == "common") {
params.app_key = baseConfig[baseApiName].appkey
} else {
params.appKey = baseConfig[baseApiName].appkey
}
// console.log("params.appKey", params.appKey)
params.timestamp = new Date().getTime()
params.v = '1.0.0'
params.format = 'json'
params.locale = 'zh_CN'
if (params.method !== 'dj.api.user.login') {
params.sessionId = util.cookies.get('token')
params.v = "1.0.0"
params.format = "json"
params.locale = "zh_CN"
if (params.method !== "dj.api.user.login") {
params.sessionId = util.cookies.get("token")
}
/**
* mock - url = params.method
* 调后端接口 - url = ''
*/
const url = params.method
// console.log(url)
const url = baseConfig[baseApiName].baseURL
/**
* 调后端接口,请使用以下代码。
*/
//
const signWay = {
"dj.smartcarlife": "sha1",
dj: "sha1",
scrm: "sha1",
glsx: "md5",
"glsx.accounts.biz.common.pictureUpload": "md5"
}
// console.log(signWay[apiName], "baseApiName")
const secret = baseConfig[baseApiName].secret
var reqData =
// baseURL: process.env.VUE_APP_API + '?method=' + params.method,
method === RequestMethods.POST
? { baseURL: '/', data: sign(params, noSignAttr) }
: { params: sign(params, noSignAttr) }
? {
baseURL: "/",
data: sign(params, noSignAttr, secret, signWay[apiName])
}
: { params: sign(params, noSignAttr, secret, signWay[apiName]) }
reqData = reqData = Object.assign(reqData, options, {})
// console.log(method === RequestMethods.POST)
// console.log(url)
......
/*
* @Author: limin
* @Date: 2019-08-26 18:02:41
* @Last Modified by: chenwq
* @Last Modified time: 2021-06-30 14:30:41
*/
import axios from "@/plugin/axios2"
import sign from "./sign2"
// import sign from "./sign"
import RequestMethods from "./request.methods"
import util from "@/libs/util.js"
import { baseConfig } from "@/main"
const request = (
params = {},
method = RequestMethods.GET,
noSignAttr = [],
options
) => {
// console.log(baseConfig)
// params.source = 'glsx'
// params.appKey = 'd7ffc3346fc9a45bccaaa35300d59022'
params.appKey = baseConfig?.axios2?.appkey
// clg
// console.log(params.appKey)
// params.appKey = window.location.href.includes('dj.glsx.com.cn')
// ? 'd7ffc3346fc9a45bccaaa35300d59022'
// : '48e5e13229b82c1b4e6e8c96151f0637'
params.timestamp = new Date().getTime()
params.v = "1.0.0"
params.format = "json"
params.locale = "zh_CN"
// if (params.method !== 'dj.api.user.login') {
// params.sessionId = util.cookies.get('token')
// }
/**
* mock - url = params.method
* 调后端接口 - url = ''
*/
const url = params.method
// console.log(url)
/**
* 调后端接口,请使用以下代码。
*/
//
var reqData =
// baseURL: process.env.VUE_APP_API + '?method=' + params.method,
method === RequestMethods.POST
? {
baseURL: "/",
data: sign(params, noSignAttr, baseConfig?.axios2?.secret)
}
: { params: sign(params, noSignAttr, baseConfig?.axios2?.secret) }
reqData = reqData = Object.assign(reqData, options, {})
return axios({
url,
method,
...reqData
})
/**
* mock,请使用以下代码。
*/
// return axios({
// url,
// method,
// params: sign(params, noSignAttr)
// })
}
export default request
/*
* @Author: limin
* @Date: 2019-08-26 18:02:41
* @Last Modified by: chenwq
* @Last Modified time: 2021-06-30 14:30:41
*/
import axios from '@/plugin/axios3'
import sign from './sign2'
import RequestMethods from './request.methods'
import util from '@/libs/util.js'
import { baseConfig } from '@/main'
const request = (
params = {},
method = RequestMethods.POST,
noSignAttr = ['file'],
options
) => {
// params.source = 'glsx'
// params.appKey = 'd7ffc3346fc9a45bccaaa35300d59022'
params.app_key = baseConfig?.common?.appkey
const secret =baseConfig?.axios2?.secret
// clg
// console.log(params.appKey)
// params.appKey = window.location.href.includes('dj.glsx.com.cn')
// ? 'd7ffc3346fc9a45bccaaa35300d59022'
// : '48e5e13229b82c1b4e6e8c96151f0637'
params.timestamp = new Date().getTime()
params.v = '1.0.0'
params.format = 'json'
params.locale = 'zh_CN'
// if (params.method !== 'dj.api.user.login') {
// params.sessionId = util.cookies.get('token')
// }
/**
* mock - url = params.method
* 调后端接口 - url = ''
*/
const url = params.method
// console.log(url)
/**
* 调后端接口,请使用以下代码。
*/
//
var reqData =
// baseURL: process.env.VUE_APP_API + '?method=' + params.method,
method === RequestMethods.POST
? { baseURL: '/', data: sign(params ,noSignAttr,secret,'md5') }
: { params: sign(params, noSignAttr,secret,'md5') }
reqData = reqData = Object.assign(reqData, options, {})
return axios({
url,
method,
...reqData
})
/**
* mock,请使用以下代码。
*/
// return axios({
// url,
// method,
// params: sign(params, noSignAttr)
// })
}
export default request
......@@ -7,19 +7,10 @@
import sha1 from "sha1"
import md5 from "md5"
import qs from "qs"
import { baseConfig } from "@/main"
import { deepClone } from "@/common/util"
// // const secret =
// // window.location.href.includes('dj.glsx.com.cn') ||
// // window.location.href.includes('dj.beta.glsx.com.cn')
// // ? '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353'
// // : 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
const sign = (params, noSignAttr = [], way = "sha1") => {
// console.log(baseConfig)
// 写里面取值解决一开始导入就被确定值导致后面无法改动
const secret = baseConfig?.axios?.secret
// console.log(secret)
const sign = (params, noSignAttr = [], secret, way = "sha1") => {
// console.log(way, "way")
delete params.sign
var objStr = qs.stringify(deepClone(params), {
arrayFormat: "indices",
......@@ -48,8 +39,9 @@ const sign = (params, noSignAttr = [], way = "sha1") => {
keys.forEach((e) => {
!noSignAttr.includes(e) && str.push(e + realObj[e])
})
realObj.sign = sha1(secret + str.join("") + secret).toUpperCase()
// realObj.sign = {sha1,md5}[way](secret + str.join("") + secret).toUpperCase()
// realObj.sign = sha1(secret + str.join("") + secret).toUpperCase()
const signObj = { sha1, md5 }
realObj.sign = signObj[way](secret + str.join("") + secret).toUpperCase()
return realObj
}
export default sign
import sha1 from 'sha1'
import qs from 'qs'
import md5 from "md5"
const sign = (params, noSignAttr = [], secret, way = "sha1") => {
delete params.sign
var objStr = qs.stringify(params, { arrayFormat: 'indices', encode: false, allowDots: true })
var objVal = objStr.split('&')
var realObj = {}
objVal.forEach(item => {
if (item.split('=')[0] == 'scene') {
realObj.scene = params.scene
} else {
realObj[item.split('=')[0]] = item.split('=')[1]
}
})
const keys = Object.keys(realObj).sort()
var str = []
var obj = null
for (const key in realObj) {
obj = realObj[key]
if (obj === null) {
obj = ''
} else if (typeof obj === 'object') {
obj = JSON.stringify(obj)
}
realObj[key] = obj
}
keys.forEach(e => {
!noSignAttr.includes(e) && str.push(e + realObj[e])
})
realObj.sign = {sha1,md5}[way](secret + str.join('') + secret).toUpperCase()
return realObj
}
export default sign
......@@ -105,7 +105,7 @@ fetch(
if (code == "200") {
console.log(data)
baseConfig = data
console.log("baseConfig", baseConfig)
// console.log("baseConfig", baseConfig)
// window.$fetchConfig = data
} else {
baseConfig = response
......
......@@ -3,9 +3,6 @@ import axios from "axios"
import { Message } from "element-ui"
import util from "@/libs/util"
import router from "@/router"
// import {
// LogExternals
// } from '@/common/constants'
import { baseConfig } from "@/main"
import Qs from "qs"
axios.defaults.withCredentials = true
......@@ -71,7 +68,7 @@ service.interceptors.request.use(
// config.url = baseConfig.axios.baseURL + config.url
// console.log(config.data.method.includes('dj.api.common.uploadImg'))
console.log(config, "config")
// console.log(config, "config")
// console.log(Object.prototype.toString.call(config.data))
// console.log(config.data.method)
if (process.env.NODE_ENV == "development") {
......@@ -86,47 +83,18 @@ service.interceptors.request.use(
type == "[object Object]" &&
methodList.includes(config.data.method)
) {
console.log(1)
config.url = "http://dj.test.glsx.com.cn/rop-dj-smartcarlife/router"
return resolve(config)
}
// else {
// console.log(config)
// if (config.isPoint) {
// config.url = baseConfig.axios2.baseURL
// } else if (config.isCommon) {
// config.url = baseConfig.common.baseURL
// } else {
// config.url = baseConfig.axios.baseURL
// }
// }
}
// else {
// if (config.isPoint) {
// config.url = baseConfig.axios2.baseURL
// } else if (config.isCommon) {
// config.url = baseConfig.common.baseURL
// } else {
// config.url = baseConfig.axios.baseURL
// }
// }
if (config.isPoint) {
config.url = baseConfig.axios2.baseURL
} else if (config.isCommon) {
config.url = baseConfig.common.baseURL
} else {
config.url = baseConfig.axios.baseURL
}
console.log(config)
// if (config.params && config.params.method.includes('common.uploadImg')) {
// config.url = 'http://dj.test.glsx.com.cn/rop-dj-smartcarlife/router'
// if (config.isPoint) {
// config.url = baseConfig.axios2.baseURL
// } else if (config.isCommon) {
// config.url = baseConfig.common.baseURL
// } else {
// config.url = baseConfig.axios.baseURL
// }
// config.url = baseConfig.axios.baseURL
// config.timeout = baseConfig.axios.timeout
// console.log(config)
resolve(config)
})
},
......@@ -163,12 +131,14 @@ service.interceptors.response.use(
return Promise.reject(new Error("登录超时,请重新登录"))
// return Promise.reject(new Error(response.message || 'Error'))
}
switch (+dataAxios[ruleResult.code_key]) {
const codeValue = dataAxios[ruleResult.code_key] || dataAxios.returnCode
switch (+codeValue) {
case ruleResult.code_success_value:
// [ 示例 ] code === 0 代表没有错误
return dataAxios[ruleResult.data_key]
default:
// 不是正确的 code
console.log(dataAxios)
errorCreate(`${dataAxios[ruleResult.message_key]}`)
break
}
......
import store from "@/store"
import axios from "axios"
import { Message } from "element-ui"
import util from "@/libs/util"
import router from "@/router"
// import {
// LogExternals
// } from '@/common/constants'
import { baseConfig } from "@/main"
import Qs from "qs"
axios.defaults.withCredentials = true
// const expiresMinute = 60 // 过期时间(分钟)
// 创建一个错误
export function errorCreate(msg) {
const error = new Error(msg)
errorLog(error)
throw error
}
// 记录和显示错误
function errorLog(error) {
// 添加到日志
store.dispatch("d2admin/log/push", {
message: "数据请求异常",
type: "danger",
meta: {
error
}
})
// 打印到控制台
if (process.env.NODE_ENV === "development") {
util.log.danger(">>>>>> Error >>>>>>")
}
// 显示提示
Message({
message: error.message,
type: "error",
duration: 5 * 1000
})
}
// 网络请求公用地址 http://192.168.3.171:7300/mock/5d638b3b6fbe9a0ac59d872e/tFIMS
// VUE_APP_API=http://192.168.3.191:8944/router
// 创建一个 axios 实例
const service = axios.create({
// baseURL: baseURL,
timeout: 100000, // 请求超时时间
transformRequest: [
function (data) {
return Qs.stringify(data)
}
]
})
// 请求拦截器
service.interceptors.request.use(
(config) => {
return new Promise(async (resolve) => {
await store.commit("d2admin/loading/set", true)
if (process.env.NODE_ENV == "development") {
// 处理图片开发环境没用的问题
const type = Object.prototype.toString.call(config.data)
const methodList = [
"dj.api.common.uploadImg",
"dj.api.common.ocr.recognition",
"dj.api.smartcarlife.sms.sendSmsCode"
]
if (
type == "[object Object]" &&
methodList.includes(config.data.method)
) {
config.url = "http://dj.test.glsx.com.cn/rop-dj-smartcarlife/router"
} else {
config.url = baseConfig.axios2.baseURL
}
} else {
config.url = baseConfig.axios2.baseURL
}
// if (config.params && config.params.method.includes('common.uploadImg')) {
// config.url = 'http://dj.test.glsx.com.cn/rop-dj-smartcarlife/router'
// } else {
// config.url = baseConfig.axios.baseURL
// }
// config.url = baseConfig.axios.baseURL
// config.timeout = baseConfig.axios.timeout
resolve(config)
})
},
(error) => {
store.commit("d2admin/loading/set", false)
// 发送失败
Promise.reject(error)
}
)
// 响应拦截器
service.interceptors.response.use(
(response) => {
// console.log(response)
store.commit("d2admin/loading/set", false)
// dataAxios 是 axios 返回数据中的 data
// const dataAxios = {
// code: "20",
// message: "缺少sessionId参数",
// solution: "将添加会话ID请求参数",
// subErrors: null
// }
const dataAxios = response.data
const ruleResult = baseConfig.axios.result
// 这个状态码是和后端约定的
// 有 code 代表这是一个后端接口 可以进行进一步的判断
var goBackArr = ["20", "21"]
// console.log(dataAxios[ruleResult.code_key])
if (goBackArr.includes(dataAxios[ruleResult.code_key])) {
// await store.dispatch('d2admin/account/logout')
store.dispatch("d2admin/user/clear")
util.cookies.remove("token")
router.replace("/login")
return Promise.reject(new Error("登录超时,请重新登录"))
// return Promise.reject(new Error(response.message || 'Error'))
}
switch (+dataAxios[ruleResult.code_key]) {
case ruleResult.code_success_value:
// [ 示例 ] code === 0 代表没有错误
return dataAxios[ruleResult.data_key]
default:
// 不是正确的 code
errorCreate(`${dataAxios[ruleResult.message_key]}`)
break
}
},
(error) => {
if (error && error.response) {
switch (error.response.status) {
case 400:
error.message = "请求错误"
break
case 401:
error.message = "未授权,请登录"
break
case 403:
error.message = "拒绝访问"
break
case 404:
error.message = `请求地址出错: ${error.response.config.url}`
break
case 408:
error.message = "请求超时"
break
case 500:
error.message = "服务器内部错误"
break
case 501:
error.message = "服务未实现"
break
case 502:
error.message = "网关错误"
break
case 503:
error.message = "服务不可用"
break
case 504:
error.message = "网关超时"
break
case 505:
error.message = "HTTP版本不受支持"
break
default:
break
}
}
if (error && error.stack.indexOf("timeout") > -1) {
if (error.stack.indexOf("5000ms")) {
error.message = "查询超时,请刷新页面重试!"
}
// console.log('超时')
// console.log(error)
}
store.commit("d2admin/loading/set", false)
errorLog(error)
return Promise.reject(error)
}
)
export default service
import store from "@/store"
import axios from "axios"
import { Message } from "element-ui"
import util from "@/libs/util"
import router from "@/router"
// import {
// LogExternals
// } from '@/common/constants'
import { baseConfig } from "@/main"
import Qs from "qs"
axios.defaults.withCredentials = true
// const expiresMinute = 60 // 过期时间(分钟)
// 创建一个错误
export function errorCreate(msg) {
const error = new Error(msg)
errorLog(error)
throw error
}
// 记录和显示错误
function errorLog(error) {
// 添加到日志
store.dispatch("d2admin/log/push", {
message: "数据请求异常",
type: "danger",
meta: {
error
}
})
// 打印到控制台
if (process.env.NODE_ENV === "development") {
util.log.danger(">>>>>> Error >>>>>>")
}
// 显示提示
Message({
message: error.message,
type: "error",
duration: 5 * 1000
})
}
// 网络请求公用地址 http://192.168.3.171:7300/mock/5d638b3b6fbe9a0ac59d872e/tFIMS
// VUE_APP_API=http://192.168.3.191:8944/router
// 创建一个 axios 实例
const service = axios.create({
// baseURL: baseURL,
timeout: 100000, // 请求超时时间
transformRequest: [
function (data) {
return Qs.stringify(data)
}
]
})
// 请求拦截器
service.interceptors.request.use(
(config) => {
return new Promise(async (resolve) => {
await store.commit("d2admin/loading/set", true)
// const uuid = util.cookies.get('uuid')
// 如果请求链接不在排除列表 (排除列表: 登录 基础数据) 并且cookie 过期(判断是否长时间未操作)
// if (!LogExternals.some(u => u === url || (params && u === params.method)) && !uuid) {
// await store.dispatch('d2admin/account/logout')
// router.replace('/login')
// }
// if (uuid) { // 判断 cookie 是否存在 存在则更新时间 避免登出时 记录空值
// const inExpiresMinutes = new Date(new Date().getTime() + expiresMinute * 60 * 1000)
// util.cookies.set('uuid', uuid, {
// expires: inExpiresMinutes
// })
// }
// config.url = baseConfig.axios.baseURL + config.url
// console.log(config.data.method.includes('dj.api.common.uploadImg'))
// console.log(Object.prototype.toString.call(config.data))
// console.log(config.data.method)
if (process.env.NODE_ENV == "development") {
// 处理图片开发环境没用的问题
const type = Object.prototype.toString.call(config.data)
const methodList = [
"dj.api.common.uploadImg",
"dj.api.common.ocr.recognition",
"dj.api.smartcarlife.sms.sendSmsCode"
]
if (
type == "[object Object]" &&
methodList.includes(config.data.method)
) {
config.url = "http://dj.test.glsx.com.cn/rop-dj-smartcarlife/router"
} else {
config.url = baseConfig.common.baseURL
}
} else {
config.url = baseConfig.common.baseURL
}
// if (config.params && config.params.method.includes('common.uploadImg')) {
// config.url = 'http://dj.test.glsx.com.cn/rop-dj-smartcarlife/router'
// } else {
// config.url = baseConfig.axios.baseURL
// }
// config.url = baseConfig.axios.baseURL
// config.timeout = baseConfig.axios.timeout
resolve(config)
})
},
(error) => {
store.commit("d2admin/loading/set", false)
// 发送失败
console.log(error)
Promise.reject(error)
}
)
// 响应拦截器
service.interceptors.response.use(
(response) => {
// console.log(response)
store.commit("d2admin/loading/set", false)
// dataAxios 是 axios 返回数据中的 data
// const dataAxios = {
// code: "20",
// message: "缺少sessionId参数",
// solution: "将添加会话ID请求参数",
// subErrors: null
// }
const dataAxios = response.data
const ruleResult = baseConfig.axios.result
// 这个状态码是和后端约定的
// 有 code 代表这是一个后端接口 可以进行进一步的判断
var goBackArr = ["20", "21"]
// console.log(dataAxios[ruleResult.code_key])
if (goBackArr.includes(dataAxios[ruleResult.code_key])) {
// await store.dispatch('d2admin/account/logout')
store.dispatch("d2admin/user/clear")
util.cookies.remove("token")
router.replace("/login")
return Promise.reject(new Error("登录超时,请重新登录"))
// return Promise.reject(new Error(response.message || 'Error'))
}
return dataAxios[ruleResult.data_key]
},
(error) => {
if (error && error.response) {
switch (error.response.status) {
case 400:
error.message = "请求错误"
break
case 401:
error.message = "未授权,请登录"
break
case 403:
error.message = "拒绝访问"
break
case 404:
error.message = `请求地址出错: ${error.response.config.url}`
break
case 408:
error.message = "请求超时"
break
case 500:
error.message = "服务器内部错误"
break
case 501:
error.message = "服务未实现"
break
case 502:
error.message = "网关错误"
break
case 503:
error.message = "服务不可用"
break
case 504:
error.message = "网关超时"
break
case 505:
error.message = "HTTP版本不受支持"
break
default:
break
}
}
if (error && error.stack.indexOf("timeout") > -1) {
if (error.stack.indexOf("5000ms")) {
error.message = "查询超时,请刷新页面重试!"
}
// console.log('超时')
// console.log(error)
}
store.commit("d2admin/loading/set", false)
errorLog(error)
return Promise.reject(error)
}
)
export default service
......@@ -174,5 +174,42 @@ export const routerName = {
activePath: "/orderList"
},
component: _import("orderManage/carDamageDetail")
},
90406: {
// 91101: {
path: "/vehicleDamageList",
name: "vehicleDamageList",
meta: {
title: "车损报价单",
authId: "90406",
// authId: "91101",
parentId: "904",
cache: false
},
auth: [
{
authId: "9040601",
// authId: "9110101",
// authId: "9110101",
parentId: "90406",
label: "查看",
handle: "handleDetail"
},
// {
// authId: "9110102",
// parentId: "91101",
// label: "编辑",
// handle: "handleEdit"
// },
{
authId: "9040603",
// authId: "9110103",
parentId: "90406",
// parentId: "91101",
label: "打印",
handle: "handlePrint"
}
],
component: _import("vehicleDamage/vehicleDamageList")
}
}
......@@ -32,11 +32,11 @@
v-for="(subItem, subIndex) in goodsInfoData.specificationDetailList"
:title="subItem.specificationName"
:key="subIndex">{{ subItem.specificationName }}</td>
<td :style="{ width: specsWidth }" v-if="goodsInfoData.goodsType == 1">
<td :style="{ width: specsWidth }" v-show="goodsInfoData.goodsType == 1">
<span class="color-red">*</span>
<span>部位</span>
</td>
<td :style="{ width: specsWidth }" v-if="goodsInfoData.goodsType == 1">
<td :style="{ width: specsWidth }" v-show="goodsInfoData.goodsType == 1">
<el-input
style="width: 80px;"
size="small"
......@@ -48,7 +48,7 @@
@blur="handleBatchTypeBlur">
</el-input>
</td>
<td :style="{ 'width': specsWidth, 'min-width': '280px' }" v-if="goodsInfoData.selectedSceneCode == 0">
<td :style="{ 'width': specsWidth, 'min-width': '280px' }" v-show="goodsInfoData.selectedSceneCode == 0">
<span class="color-red">*</span>
<span>可选择的服务项目(多选)</span>
</td>
......@@ -74,7 +74,7 @@
</el-popover>
</el-input>
</td>
<td :style="{ width: specsWidth }" v-if="goodsInfoData.selectedSceneCode != 0">
<td :style="{ width: specsWidth }" v-show="goodsInfoData.selectedSceneCode != 0">
<span class="color-red">*</span>
<el-input
style="width: 80px;"
......@@ -140,7 +140,7 @@
</el-popover>
</el-input>
</td>
<td :style="{ width: specsWidth }" v-if="goodsInfoData.selectedSceneCode == 0">
<td :style="{ width: specsWidth }" v-show="goodsInfoData.selectedSceneCode == 0">
<span class="color-red">*</span>
<el-input
style="width: 80px;"
......@@ -162,7 +162,7 @@
</el-popover>
</el-input>
</td>
<td :style="{ width: specsWidth }" v-if="goodsInfoData.selectedSceneCode != 0">
<td :style="{ width: specsWidth }" v-show="goodsInfoData.selectedSceneCode != 0">
<el-input
style="width: 80px;"
size="small"
......@@ -173,7 +173,7 @@
@blur="handleBatchWarningValueInputBlur">
</el-input>
</td>
<td :style="{ width: specsWidth }" v-if="goodsInfoData.selectedSceneCode != 0">
<td :style="{ width: specsWidth }" v-show="goodsInfoData.selectedSceneCode != 0">
<span class="color-red">*</span>
<el-input
style="width: 80px;"
......@@ -210,7 +210,7 @@
v-for="(n, idx) in subItem.specsValueList"
:key="idx"
:title="n">{{ n }}</td>
<td :style="{ width: specsWidth}" v-if="goodsInfoData.goodsType == 1">
<td :style="{ width: specsWidth}" v-show="goodsInfoData.goodsType == 1">
<el-select placeholder="部位"
size="small"
:class="{ 'w-80-per': true, 'w-100-per': true, 'border-red': filterEmpty(subItem.position) && subItem.positionEmpty }"
......@@ -233,7 +233,7 @@
</el-popover>
</el-select>
</td>
<td :style="{ width: specsWidth }" v-if="goodsInfoData.goodsType == 1">
<td :style="{ width: specsWidth }" v-show="goodsInfoData.goodsType == 1">
<el-input placeholder="型号"
size="small"
:class="{ 'w-80-per': true, 'w-100-per': true, }"
......@@ -243,7 +243,7 @@
@input="handleTypeInput($event, subIndex)">
</el-input>
</td>
<td :style="{ 'width': specsWidth, 'min-width': '280px' }" v-if="goodsInfoData.selectedSceneCode == 0">
<td :style="{ 'width': specsWidth, 'min-width': '280px' }" v-show="goodsInfoData.selectedSceneCode == 0">
<el-select placeholder="服务项目"
size="small"
:class="{ 'w-80-per': true, 'w-100-per': true, 'border-red': filterEmpty(subItem.serviceItemArr) && subItem.serviceItemArrEmpty }"
......@@ -288,7 +288,7 @@
</el-popover>
</el-input>
</td>
<td :style="{ width: specsWidth }" v-if="goodsInfoData.selectedSceneCode != 0">
<td :style="{ width: specsWidth }" v-show="goodsInfoData.selectedSceneCode != 0">
<el-input placeholder="采购价"
size="small"
:class="{ 'w-80-per': true, 'w-100-per': true, 'border-red': (filterEmpty(subItem.purchasePrice) || !subItem.purchasePrice) && subItem.purchasePriceEmpty }"
......@@ -345,7 +345,7 @@
</el-popover>
</el-input>
</td>
<td :style="{ width: specsWidth }" v-if="goodsInfoData.selectedSceneCode == 0">
<td :style="{ width: specsWidth }" v-show="goodsInfoData.selectedSceneCode == 0">
<div style="transform: translateX(10px);">
<el-input style="width: 80px;"
placeholder="服务时间"
......@@ -367,7 +367,7 @@
<span style="margin-left: 5px;"> 年</span>
</div>
</td>
<td :style="{ width: specsWidth }" v-if="goodsInfoData.selectedSceneCode != 0">
<td :style="{ width: specsWidth }" v-show="goodsInfoData.selectedSceneCode != 0">
<el-input placeholder="库存预警"
size="small"
style="transform: translateX(0);"
......@@ -376,7 +376,7 @@
@input="handleWarningValueInput($event, subIndex)">
</el-input>
</td>
<td :style="{ width: specsWidth }" v-if="goodsInfoData.selectedSceneCode != 0">
<td :style="{ width: specsWidth }" v-show="goodsInfoData.selectedSceneCode != 0">
<div style="transform: translateX(10px);">
<el-input style="width: 80px;" placeholder="质保"
size="small"
......
......@@ -8,14 +8,14 @@
<td :style="{ width: specsWidth }">
<span>商品</span>
</td>
<td :style="{ width: specsWidth }" v-if="goodsInfoData.goodsType == 1">
<td :style="{ width: specsWidth }" v-show="goodsInfoData.goodsType == 1">
<span class="color-red">*</span>
<span>部位</span>
</td>
<td :style="{ width: specsWidth }" v-if="goodsInfoData.goodsType == 1">
<td :style="{ width: specsWidth }" v-show="goodsInfoData.goodsType == 1">
<span>型号</span>
</td>
<td :style="{ 'width': specsWidth, 'min-width': '280px' }" v-if="goodsInfoData.selectedSceneCode === 0">
<td :style="{ 'width': specsWidth, 'min-width': '280px' }" v-show="goodsInfoData.selectedSceneCode === 0">
<span class="color-red">*</span>
<span>可选择的服务项目(多选)</span>
</td>
......@@ -23,7 +23,7 @@
<span class="color-red">*</span>
<span>成本/元</span>
</td>
<td :style="{ width: specsWidth }" v-if="goodsInfoData.selectedSceneCode !== 0">
<td :style="{ width: specsWidth }" v-show="goodsInfoData.selectedSceneCode !== 0">
<span class="color-red">*</span>
<span>采购价/卷</span>
</td>
......@@ -35,14 +35,14 @@
<span class="color-red">*</span>
<span>最低价/元</span>
</td>
<td :style="{ width: specsWidth }" v-if="goodsInfoData.selectedSceneCode === 0">
<td :style="{ width: specsWidth }" v-show="goodsInfoData.selectedSceneCode === 0">
<span class="color-red">*</span>
<span>服务时间</span>
</td>
<td :style="{ width: specsWidth }" v-if="goodsInfoData.selectedSceneCode !== 0">
<td :style="{ width: specsWidth }" v-show="goodsInfoData.selectedSceneCode !== 0">
<span>库存预警</span>
</td>
<td :style="{ width: specsWidth }" v-if="goodsInfoData.selectedSceneCode !== 0">
<td :style="{ width: specsWidth }" v-show="goodsInfoData.selectedSceneCode !== 0">
<span class="color-red">*</span>
<span>质保/年</span>
</td>
......@@ -59,8 +59,8 @@
v-for="(subItem, subIndex) in goodsInfoData.goodsSpecificationSingleList"
:key="subIndex">
<td :style="{ width: specsWidth }">
<span style="display: flex;align-items: center;justify-content: center;" v-if="!subItem.editGoodNameInput">
<span style="max-width: 160px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{ subItem.specificationData }}</span>
<span style="display: flex;align-items: center;justify-content: center;overflow: hidden;" v-if="!subItem.editGoodNameInput">
<span style="max-width: 120px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{ subItem.specificationData }}</span>
<img src="@/assets/icon-edit.png" style="cursor: pointer;margin-left: 5px;width: 16px;height: 16px;" @click="editSpecificationData(subIndex)" />
</span>
<el-input v-else placeholder="商品名称"
......@@ -83,7 +83,7 @@
</el-popover>
</el-input>
</td>
<td :style="{ width: specsWidth}" v-if="goodsInfoData.goodsType == 1">
<td :style="{ width: specsWidth}" v-show="goodsInfoData.goodsType == 1">
<el-select placeholder="部位"
size="small"
:class="{ 'w-80-per': true, 'w-100-per': true, 'border-red': filterEmpty(subItem.position) && subItem.positionEmpty }"
......@@ -106,7 +106,7 @@
</el-popover>
</el-select>
</td>
<td :style="{ width: specsWidth }" v-if="goodsInfoData.goodsType == 1">
<td :style="{ width: specsWidth }" v-show="goodsInfoData.goodsType == 1">
<el-input placeholder="型号"
size="small"
:class="{ 'w-80-per': true, 'w-100-per': true, }"
......@@ -115,7 +115,7 @@
@input="handleTypeInput($event, subIndex)">
</el-input>
</td>
<td :style="{ 'width': specsWidth, 'min-width': '280px' }" v-if="goodsInfoData.selectedSceneCode === 0">
<td :style="{ 'width': specsWidth, 'min-width': '280px' }" v-show="goodsInfoData.selectedSceneCode === 0">
<el-select placeholder="服务项目"
size="small"
:class="{ 'w-80-per': true, 'w-100-per': true, 'border-red': filterEmpty(subItem.serviceItemArr) && subItem.serviceItemArrEmpty }"
......@@ -160,7 +160,7 @@
</el-popover>
</el-input>
</td>
<td :style="{ width: specsWidth }" v-if="goodsInfoData.selectedSceneCode !== 0">
<td :style="{ width: specsWidth }" v-show="goodsInfoData.selectedSceneCode !== 0">
<el-input placeholder="采购价"
size="small"
:class="{ 'w-80-per': true, 'w-100-per': true, 'border-red': filterEmpty(subItem.purchasePrice) && subItem.purchasePriceEmpty }"
......@@ -217,7 +217,7 @@
</el-popover>
</el-input>
</td>
<td :style="{ width: specsWidth }" v-if="goodsInfoData.selectedSceneCode === 0">
<td :style="{ width: specsWidth }" v-show="goodsInfoData.selectedSceneCode === 0">
<div style="transform: translateX(10px);">
<el-input style="width: 80px;"
placeholder="服务时间"
......@@ -239,7 +239,7 @@
<span style="margin-left: 5px;"> 年</span>
</div>
</td>
<td :style="{ width: specsWidth }" v-if="goodsInfoData.selectedSceneCode !== 0">
<td :style="{ width: specsWidth }" v-show="goodsInfoData.selectedSceneCode !== 0">
<el-input placeholder="库存预警"
size="small"
style="transform: translateX(0);"
......@@ -248,7 +248,7 @@
@input="handleWarningValueInput($event, subIndex)">
</el-input>
</td>
<td :style="{ width: specsWidth }" v-if="goodsInfoData.selectedSceneCode !== 0">
<td :style="{ width: specsWidth }" v-show="goodsInfoData.selectedSceneCode !== 0">
<div style="transform: translateX(10px);">
<el-input style="width: 80px;"
placeholder="质保"
......
......@@ -407,7 +407,7 @@
<el-radio :label="2"> 按整单计算 </el-radio>
</el-radio-group>
</el-form-item>
<div>
<div style="display: flex;">
<el-form-item
:prop="'platformPublic.' + index + '.expenseCategoryCalculateType'"
:rules="[
......@@ -430,51 +430,51 @@
/>
</el-select>
</el-form-item>
</div>
<el-form-item
required
:prop="'platformPublic.' + index + '.expenseCategoryValue'"
:rules="[
{
required: true,
message: '请输入分润比例',
trigger: ['change', 'blur']
}
]"
label="分润比例设定"
>
<el-input
v-model="
classificationObj.platformPublic[index].expenseCategoryValue
"
@input="
handleInput(
$event,
'platformPublic',
classificationObj.platformPublic[index]
.expenseCategoryCalculateType,
index
)
"
style="width: 150px"
:placeholder="
classificationObj.platformPublic[index]
.expenseCategoryCalculateType | filerPlaceName
"
<el-form-item
required
:prop="'platformPublic.' + index + '.expenseCategoryValue'"
:rules="[
{
required: true,
message: '请输入分润比例',
trigger: ['change', 'blur']
}
]"
label="分润比例设定"
>
<!-- accountSecondSetForm.marketingCostCalculateType== 1?'请输入固定金额': -->
<!-- v-if="accountSecondSetForm.marketingCostCalculateType== 2" -->
<i
slot="suffix"
v-if="
<el-input
v-model="
classificationObj.platformPublic[index].expenseCategoryValue
"
@input="
handleInput(
$event,
'platformPublic',
classificationObj.platformPublic[index]
.expenseCategoryCalculateType,
index
)
"
style="width: 150px"
:placeholder="
classificationObj.platformPublic[index]
.expenseCategoryCalculateType != 3
.expenseCategoryCalculateType | filerPlaceName
"
class="suffix"
>%</i
>
</el-input>
</el-form-item>
<!-- accountSecondSetForm.marketingCostCalculateType== 1?'请输入固定金额': -->
<!-- v-if="accountSecondSetForm.marketingCostCalculateType== 2" -->
<i
slot="suffix"
v-if="
classificationObj.platformPublic[index]
.expenseCategoryCalculateType != 3
"
class="suffix"
>%</i
>
</el-input>
</el-form-item>
</div>
</div>
<!-- <p>区别</p> -->
......
......@@ -40,7 +40,7 @@
<auth-button slot="auth-button" :show-btn-ids="['90603010']" :data="scope.scope" />
</span>
<!-- 对账 -->
<auth-button slot="auth-button" :show-btn-ids="['9060308']" :data="scope.scope" />
<!-- <auth-button slot="auth-button" :show-btn-ids="['9060308']" :data="scope.scope" /> -->
<!-- 删除 -->
<auth-button slot="auth-button" :show-btn-ids="['9060305']" :data="scope.scope" />
</div>
......
......@@ -840,7 +840,7 @@ export default {
.map((item) => {
item.targetMerchantName = item.merchant?.merchantName
item.targetMerchantId = item.merchant?.merchantId
item.merchant = null
// item.merchant = null
return item
})
// console.log('flowServiceCostArr: ', flowServiceCostArr)
......
......@@ -435,6 +435,8 @@ export default {
},
// 校验所有form数据
async verifyFormData() {
// 校验重置数据 防止重复push
this.goodsTypeGroupRulesAll = []
for (var index = 0; index < this.editableTabs.length; index++) {
const node = this.$refs[`classification${this.editableTabs[index].name}`][0]
this.errorIndex = index
......
......@@ -33,13 +33,13 @@ export default {
data() {
return {
sceneList: [{
sceneName: '1.1 精品升级',
sceneDesc: '1.1 太阳膜升级转化下单',
sceneName: '精品升级',
sceneDesc: '太阳膜升级转化下单',
sceneType: 1,
isOpen: 'N'
}, {
sceneName: '2.0 会员权益/升级',
sceneDesc: '2.0 新车车损下单',
sceneName: '会员权益/升级',
sceneDesc: '新车车损下单',
sceneType: 0,
isOpen: 'N'
}]
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!