Commit 24f38147 by 前端

Merge branch 'develop' into 'master'

Develop

See merge request !125
2 parents e8f1c1ab 6b70adbb
...@@ -112,5 +112,8 @@ ...@@ -112,5 +112,8 @@
<script src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script> <script src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script>
<% } %> <% } %>
</body> </body>
<script>
</script>
</html> </html>
\ No newline at end of file \ No newline at end of file
...@@ -9,7 +9,11 @@ export default { ...@@ -9,7 +9,11 @@ export default {
name: 'App', name: 'App',
created() { 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: { methods: {
...@@ -19,6 +23,7 @@ export default { ...@@ -19,6 +23,7 @@ export default {
<style lang="scss"> <style lang="scss">
@import "~@/assets/style/public-class.scss"; @import "~@/assets/style/public-class.scss";
.el_table { .el_table {
thead { thead {
th { th {
......
import request from './request' import request from "./request"
const path = 'dj.api.' const path = "dj.api."
const path2 = 'dj.smartcarlife.api.' const path2 = "dj.smartcarlife.api."
export function getList(data) { export function getList(data) {
data.method = `${path}basegoods.page` data.method = `${path}basegoods.page`
...@@ -22,7 +22,7 @@ export function getGoodsInfoById(data) { ...@@ -22,7 +22,7 @@ export function getGoodsInfoById(data) {
// 根据基础商品id获取分配门店列表 - 查看门店 // 根据基础商品id获取分配门店列表 - 查看门店
export function getMerchantList(data) { export function getMerchantList(data) {
data.method = 'dj.basegoodsmerchantref.list.byBaseGoodsId' data.method = "dj.basegoodsmerchantref.list.byBaseGoodsId"
return request(data) return request(data)
} }
...@@ -35,90 +35,90 @@ export function getGoodsList(data) { ...@@ -35,90 +35,90 @@ export function getGoodsList(data) {
// 新增商品 // 新增商品
export function baseGoodsAdd(data) { export function baseGoodsAdd(data) {
data.method = `${path}basegoods.add` data.method = `${path}basegoods.add`
return request(data, 'post') return request(data, "post")
} }
// 修改商品 // 修改商品
export function baseGoodsUpdate(data) { export function baseGoodsUpdate(data) {
data.method = `${path}basegoods.update` data.method = `${path}basegoods.update`
return request(data, 'post') return request(data, "post")
} }
// 下架商品 // 下架商品
export function baseGoodsUpOrDown(data) { export function baseGoodsUpOrDown(data) {
// data.method = `${path2}basegoods.changeShelfStatus` // data.method = `${path2}basegoods.changeShelfStatus`
data.method = `${path2}basegoods.shelfStatus.update` data.method = `${path2}basegoods.shelfStatus.update`
return request(data, 'post') return request(data, "post")
} }
// 删除商品 // 删除商品
export function baseGoodsDelete(data) { export function baseGoodsDelete(data) {
data.method = `${path2}basegoods.delete` data.method = `${path2}basegoods.delete`
return request(data, 'post') return request(data, "post")
} }
// 导出 // 导出
export function exportBaseList(data) { export function exportBaseList(data) {
data.method = `${path}basegoods.export` data.method = `${path}basegoods.export`
return request(data, 'post') return request(data, "post")
} }
// 下架子商品 // 下架子商品
export function baseGoodsUpOrDownForChild(data) { export function baseGoodsUpOrDownForChild(data) {
data.method = `${path2}upgradedGoods.shelfStatus.update` data.method = `${path2}upgradedGoods.shelfStatus.update`
return request(data, 'post') return request(data, "post")
} }
// 提交商品审核结果 // 提交商品审核结果
export function submitReviewResult(data) { export function submitReviewResult(data) {
data.method = `${path2}upgradedGoods.submitReviewResult` data.method = `${path2}upgradedGoods.submitReviewResult`
return request(data, 'post') return request(data, "post")
} }
// 新增编辑商品 // 新增编辑商品
export function addOrEditBaseGoods(data) { export function addOrEditBaseGoods(data) {
data.method = `${path}basegoods.insertOrUpdate` data.method = `${path}basegoods.insertOrUpdate`
return request(data, 'post') return request(data, "post")
} }
// 获取商品列表 // 获取商品列表
export function getBaseGoodsList(data) { export function getBaseGoodsList(data) {
data.method = `${path}basegoods.page` data.method = `${path}basegoods.page`
return request(data, 'post') return request(data, "post")
} }
// 获取按规格分配 门店维度数据转为规格维度展示 // 获取按规格分配 门店维度数据转为规格维度展示
export function getSpecDataByMerchent(data) { export function getSpecDataByMerchent(data) {
data.method = `dj.basegoodsmerchantref.specification.getByBaseGoodsId` data.method = `dj.basegoodsmerchantref.specification.getByBaseGoodsId`
return request(data, 'post') return request(data, "post")
} }
// 按规格分配保存 // 按规格分配保存
export function saveAssignBySpec(data) { export function saveAssignBySpec(data) {
data.method = 'dj.basegoodsmerchantref.specification.insertOrUpdate' data.method = "dj.basegoodsmerchantref.specification.insertOrUpdate"
return request(data, 'post') return request(data, "post")
} }
// 分配门店 统一分配保存 // 分配门店 统一分配保存
export function saveAssignByMerchant(data) { export function saveAssignByMerchant(data) {
data.method = 'dj.basegoodsmerchantref.stores.insertOrUpdate' data.method = "dj.basegoodsmerchantref.stores.insertOrUpdate"
return request(data, 'post') return request(data, "post")
} }
// 获取场景关联门店/园区店列表 // 获取场景关联门店/园区店列表
export function getMerchantListByScene(data) { export function getMerchantListByScene(data) {
data.method = `${path}servicemerchantref.listShopWithScene` data.method = `${path}servicemerchantref.listShopWithScene`
return request(data, 'post') return request(data, "post")
} }
// 获取场景-类目-素材三级数据列表 // 获取场景-类目-素材三级数据列表
export function getThiredMaterialList(data) { export function getThiredMaterialList(data) {
data.method = `${path}goods.type.querySceneCategoryGoods` data.method = `${path}goods.type.querySceneCategoryGoods`
return request(data, 'post') return request(data, "post")
} }
// 保存商品 // 保存商品
export function saveTempGoods(data) { export function saveTempGoods(data) {
data.method = `${path}basegoods.saveTemp` data.method = `${path}basegoods.saveTemp`
return request(data, 'post') return request(data, "post")
} }
...@@ -294,6 +294,12 @@ export function getDiversionMerchantRef(data) { ...@@ -294,6 +294,12 @@ export function getDiversionMerchantRef(data) {
return request(data, "post") return request(data, "post")
} }
// 获取有关联关系的4s店列表
export function listShop4sByRef(data) {
data.method = `${path}scenemerchantref.listShop4sByRef`
return request(data, "post")
}
// 新增或更新商户二级流量方 // 新增或更新商户二级流量方
export function insertOrUpdateDiversionMerchantRef(data) { export function insertOrUpdateDiversionMerchantRef(data) {
data.method = `${path2}diversionMerchant.insertOrUpdateDiversionMerchantRef` data.method = `${path2}diversionMerchant.insertOrUpdateDiversionMerchantRef`
......
import request from "./request2" import request from "./request"
import requestCommon from "./request3" // import requestCommon from "./request3"
const defaultPath = 'scrm.api.shopmall.' const defaultPath = "scrm.api.shopmall."
const getListApi = data => { const getListApi = (data) => {
data.method = `${defaultPath}order.noSessionPage` data.method = `${defaultPath}order.noSessionPage`
return request(data) return request(data)
} }
const getCountApi = data => { const getCountApi = (data) => {
data.method = `${defaultPath}order.noSessionCount` data.method = `${defaultPath}order.noSessionCount`
return request(data) return request(data)
} }
const getOrderDetailApi = data => { const getOrderDetailApi = (data) => {
data.method = `${defaultPath}order.noSessionDetail` data.method = `${defaultPath}order.noSessionDetail`
return request(data) return request(data)
} }
/**营销状态设为已完结 */ /** 营销状态设为已完结 */
const finishOrderStatus = data => { const finishOrderStatus = (data) => {
data.method = 'scrm.api.shopmall.weapp.order.status.finish.nosession' data.method = "scrm.api.shopmall.weapp.order.status.finish.nosession"
return request(data) return request(data)
} }
const orderExportApi = data => { const orderExportApi = (data) => {
data.method = `${defaultPath}order.noSessionExport` data.method = `${defaultPath}order.noSessionExport`
return request(data) return request(data)
} }
const pictureUpload = data => { const pictureUpload = (data) => {
data.method = 'glsx.accounts.biz.common.pictureUpload' data.method = "glsx.accounts.biz.common.pictureUpload"
return requestCommon(data) return request(data, "post", ["file"])
// return request(data)
} }
// 导入对账单 // 导入对账单
const orderEndExportApi = data => { const orderEndExportApi = (data) => {
console.log(data, 'data') console.log(data, "data")
data.method = `${defaultPath}order.orderEndExport` data.method = `${defaultPath}order.orderEndExport`
return request(data) return request(data)
} }
/**获取众筹活动名称&门店 */ /** 获取众筹活动名称&门店 */
const getCrowdfundingParams = data => { const getCrowdfundingParams = (data) => {
data.method = 'scrm.api.shopmall.crowdfunding.activity.parameter.list' data.method = "scrm.api.shopmall.crowdfunding.activity.parameter.list"
/**1秒杀 2直播间活动 3众筹 4膨胀金 */ /** 1秒杀 2直播间活动 3众筹 4膨胀金 */
data.marketingType = 3 data.marketingType = 3
return request(data) return request(data)
} }
export default {
pictureUpload,
getCrowdfundingParams,
orderEndExportApi,
export default { pictureUpload, getCrowdfundingParams, orderEndExportApi, getListApi, getCountApi, getOrderDetailApi, orderExportApi, finishOrderStatus } getListApi,
getCountApi,
getOrderDetailApi,
orderExportApi,
finishOrderStatus
}
...@@ -5,48 +5,77 @@ ...@@ -5,48 +5,77 @@
* @Last Modified time: 2021-06-30 14:30:41 * @Last Modified time: 2021-06-30 14:30:41
*/ */
import axios from '@/plugin/axios' import axios from "@/plugin/axios"
import sign from './sign' import sign from "./sign"
import RequestMethods from './request.methods' import RequestMethods from "./request.methods"
import util from '@/libs/util.js' import util from "@/libs/util.js"
import { baseConfig } from '@/main' import { baseConfig } from "@/main"
const request = ( const request = (
params = {}, params = {},
method = RequestMethods.GET, method = RequestMethods.GET,
noSignAttr = [], noSignAttr = [],
options options
) => { ) => {
// console.log(baseConfig) // 兼容线上dj和scrm appkey和secret不一样的情况
// params.source = 'glsx' let apiName = ""
// params.appKey = 'd7ffc3346fc9a45bccaaa35300d59022' if (params.method.includes("dj")) {
params.appKey = baseConfig?.axios?.appkey apiName = "dj"
// clg } else {
// console.log(params.appKey) apiName = params.method.split(".api")[0]
// params.appKey = window.location.href.includes('dj.glsx.com.cn') }
// ? 'd7ffc3346fc9a45bccaaa35300d59022'
// : '48e5e13229b82c1b4e6e8c96151f0637' 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.timestamp = new Date().getTime()
params.v = '1.0.0' params.v = "1.0.0"
params.format = 'json' params.format = "json"
params.locale = 'zh_CN' params.locale = "zh_CN"
if (params.method !== 'dj.api.user.login') { if (params.method !== "dj.api.user.login") {
params.sessionId = util.cookies.get('token') params.sessionId = util.cookies.get("token")
} }
/** /**
* mock - url = params.method * mock - url = params.method
* 调后端接口 - url = '' * 调后端接口 - url = ''
*/ */
const url = params.method const url = baseConfig[baseApiName].baseURL
// console.log(url)
/** /**
* 调后端接口,请使用以下代码。 * 调后端接口,请使用以下代码。
*/ */
// 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 = var reqData =
// baseURL: process.env.VUE_APP_API + '?method=' + params.method,
method === RequestMethods.POST 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, {}) reqData = reqData = Object.assign(reqData, options, {})
// console.log(method === RequestMethods.POST) // console.log(method === RequestMethods.POST)
// console.log(url) // 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 @@ ...@@ -7,19 +7,10 @@
import sha1 from "sha1" import sha1 from "sha1"
import md5 from "md5" import md5 from "md5"
import qs from "qs" import qs from "qs"
import { baseConfig } from "@/main"
import { deepClone } from "@/common/util" 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") => { const sign = (params, noSignAttr = [], secret, way = "sha1") => {
// console.log(baseConfig) // console.log(way, "way")
// 写里面取值解决一开始导入就被确定值导致后面无法改动
const secret = baseConfig?.axios?.secret
// console.log(secret)
delete params.sign delete params.sign
var objStr = qs.stringify(deepClone(params), { var objStr = qs.stringify(deepClone(params), {
arrayFormat: "indices", arrayFormat: "indices",
...@@ -48,8 +39,9 @@ const sign = (params, noSignAttr = [], way = "sha1") => { ...@@ -48,8 +39,9 @@ const sign = (params, noSignAttr = [], way = "sha1") => {
keys.forEach((e) => { keys.forEach((e) => {
!noSignAttr.includes(e) && str.push(e + realObj[e]) !noSignAttr.includes(e) && str.push(e + realObj[e])
}) })
realObj.sign = sha1(secret + str.join("") + secret).toUpperCase() // realObj.sign = sha1(secret + str.join("") + secret).toUpperCase()
// realObj.sign = {sha1,md5}[way](secret + str.join("") + secret).toUpperCase() const signObj = { sha1, md5 }
realObj.sign = signObj[way](secret + str.join("") + secret).toUpperCase()
return realObj return realObj
} }
export default sign 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( ...@@ -105,7 +105,7 @@ fetch(
if (code == "200") { if (code == "200") {
console.log(data) console.log(data)
baseConfig = data baseConfig = data
console.log("baseConfig", baseConfig) // console.log("baseConfig", baseConfig)
// window.$fetchConfig = data // window.$fetchConfig = data
} else { } else {
baseConfig = response baseConfig = response
......
...@@ -3,9 +3,6 @@ import axios from "axios" ...@@ -3,9 +3,6 @@ import axios from "axios"
import { Message } from "element-ui" import { Message } from "element-ui"
import util from "@/libs/util" import util from "@/libs/util"
import router from "@/router" import router from "@/router"
// import {
// LogExternals
// } from '@/common/constants'
import { baseConfig } from "@/main" import { baseConfig } from "@/main"
import Qs from "qs" import Qs from "qs"
axios.defaults.withCredentials = true axios.defaults.withCredentials = true
...@@ -71,7 +68,7 @@ service.interceptors.request.use( ...@@ -71,7 +68,7 @@ service.interceptors.request.use(
// config.url = baseConfig.axios.baseURL + config.url // config.url = baseConfig.axios.baseURL + config.url
// console.log(config.data.method.includes('dj.api.common.uploadImg')) // 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(Object.prototype.toString.call(config.data))
// console.log(config.data.method) // console.log(config.data.method)
if (process.env.NODE_ENV == "development") { if (process.env.NODE_ENV == "development") {
...@@ -86,23 +83,10 @@ service.interceptors.request.use( ...@@ -86,23 +83,10 @@ service.interceptors.request.use(
type == "[object Object]" && type == "[object Object]" &&
methodList.includes(config.data.method) methodList.includes(config.data.method)
) { ) {
console.log(1)
config.url = "http://dj.test.glsx.com.cn/rop-dj-smartcarlife/router" config.url = "http://dj.test.glsx.com.cn/rop-dj-smartcarlife/router"
return resolve(config) 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) { // if (config.isPoint) {
// config.url = baseConfig.axios2.baseURL // config.url = baseConfig.axios2.baseURL
// } else if (config.isCommon) { // } else if (config.isCommon) {
...@@ -110,23 +94,7 @@ service.interceptors.request.use( ...@@ -110,23 +94,7 @@ service.interceptors.request.use(
// } else { // } else {
// config.url = baseConfig.axios.baseURL // config.url = baseConfig.axios.baseURL
// } // }
// } // 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
}
console.log(config)
// 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) resolve(config)
}) })
}, },
...@@ -163,12 +131,14 @@ service.interceptors.response.use( ...@@ -163,12 +131,14 @@ service.interceptors.response.use(
return Promise.reject(new Error("登录超时,请重新登录")) return Promise.reject(new Error("登录超时,请重新登录"))
// return Promise.reject(new Error(response.message || '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: case ruleResult.code_success_value:
// [ 示例 ] code === 0 代表没有错误 // [ 示例 ] code === 0 代表没有错误
return dataAxios[ruleResult.data_key] return dataAxios[ruleResult.data_key]
default: default:
// 不是正确的 code // 不是正确的 code
console.log(dataAxios)
errorCreate(`${dataAxios[ruleResult.message_key]}`) errorCreate(`${dataAxios[ruleResult.message_key]}`)
break 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 = { ...@@ -174,5 +174,42 @@ export const routerName = {
activePath: "/orderList" activePath: "/orderList"
}, },
component: _import("orderManage/carDamageDetail") 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 @@ ...@@ -32,11 +32,11 @@
v-for="(subItem, subIndex) in goodsInfoData.specificationDetailList" v-for="(subItem, subIndex) in goodsInfoData.specificationDetailList"
:title="subItem.specificationName" :title="subItem.specificationName"
:key="subIndex">{{ subItem.specificationName }}</td> :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 class="color-red">*</span>
<span>部位</span> <span>部位</span>
</td> </td>
<td :style="{ width: specsWidth }" v-if="goodsInfoData.goodsType == 1"> <td :style="{ width: specsWidth }" v-show="goodsInfoData.goodsType == 1">
<el-input <el-input
style="width: 80px;" style="width: 80px;"
size="small" size="small"
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
@blur="handleBatchTypeBlur"> @blur="handleBatchTypeBlur">
</el-input> </el-input>
</td> </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 class="color-red">*</span>
<span>可选择的服务项目(多选)</span> <span>可选择的服务项目(多选)</span>
</td> </td>
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
</el-popover> </el-popover>
</el-input> </el-input>
</td> </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 class="color-red">*</span>
<el-input <el-input
style="width: 80px;" style="width: 80px;"
...@@ -140,7 +140,7 @@ ...@@ -140,7 +140,7 @@
</el-popover> </el-popover>
</el-input> </el-input>
</td> </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 class="color-red">*</span>
<el-input <el-input
style="width: 80px;" style="width: 80px;"
...@@ -162,7 +162,7 @@ ...@@ -162,7 +162,7 @@
</el-popover> </el-popover>
</el-input> </el-input>
</td> </td>
<td :style="{ width: specsWidth }" v-if="goodsInfoData.selectedSceneCode != 0"> <td :style="{ width: specsWidth }" v-show="goodsInfoData.selectedSceneCode != 0">
<el-input <el-input
style="width: 80px;" style="width: 80px;"
size="small" size="small"
...@@ -173,7 +173,7 @@ ...@@ -173,7 +173,7 @@
@blur="handleBatchWarningValueInputBlur"> @blur="handleBatchWarningValueInputBlur">
</el-input> </el-input>
</td> </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 class="color-red">*</span>
<el-input <el-input
style="width: 80px;" style="width: 80px;"
...@@ -210,7 +210,7 @@ ...@@ -210,7 +210,7 @@
v-for="(n, idx) in subItem.specsValueList" v-for="(n, idx) in subItem.specsValueList"
:key="idx" :key="idx"
:title="n">{{ n }}</td> :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="部位" <el-select placeholder="部位"
size="small" size="small"
:class="{ 'w-80-per': true, 'w-100-per': true, 'border-red': filterEmpty(subItem.position) && subItem.positionEmpty }" :class="{ 'w-80-per': true, 'w-100-per': true, 'border-red': filterEmpty(subItem.position) && subItem.positionEmpty }"
...@@ -233,7 +233,7 @@ ...@@ -233,7 +233,7 @@
</el-popover> </el-popover>
</el-select> </el-select>
</td> </td>
<td :style="{ width: specsWidth }" v-if="goodsInfoData.goodsType == 1"> <td :style="{ width: specsWidth }" v-show="goodsInfoData.goodsType == 1">
<el-input placeholder="型号" <el-input placeholder="型号"
size="small" size="small"
:class="{ 'w-80-per': true, 'w-100-per': true, }" :class="{ 'w-80-per': true, 'w-100-per': true, }"
...@@ -243,7 +243,7 @@ ...@@ -243,7 +243,7 @@
@input="handleTypeInput($event, subIndex)"> @input="handleTypeInput($event, subIndex)">
</el-input> </el-input>
</td> </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="服务项目" <el-select placeholder="服务项目"
size="small" size="small"
:class="{ 'w-80-per': true, 'w-100-per': true, 'border-red': filterEmpty(subItem.serviceItemArr) && subItem.serviceItemArrEmpty }" :class="{ 'w-80-per': true, 'w-100-per': true, 'border-red': filterEmpty(subItem.serviceItemArr) && subItem.serviceItemArrEmpty }"
...@@ -288,7 +288,7 @@ ...@@ -288,7 +288,7 @@
</el-popover> </el-popover>
</el-input> </el-input>
</td> </td>
<td :style="{ width: specsWidth }" v-if="goodsInfoData.selectedSceneCode != 0"> <td :style="{ width: specsWidth }" v-show="goodsInfoData.selectedSceneCode != 0">
<el-input placeholder="采购价" <el-input placeholder="采购价"
size="small" size="small"
:class="{ 'w-80-per': true, 'w-100-per': true, 'border-red': (filterEmpty(subItem.purchasePrice) || !subItem.purchasePrice) && subItem.purchasePriceEmpty }" :class="{ 'w-80-per': true, 'w-100-per': true, 'border-red': (filterEmpty(subItem.purchasePrice) || !subItem.purchasePrice) && subItem.purchasePriceEmpty }"
...@@ -345,7 +345,7 @@ ...@@ -345,7 +345,7 @@
</el-popover> </el-popover>
</el-input> </el-input>
</td> </td>
<td :style="{ width: specsWidth }" v-if="goodsInfoData.selectedSceneCode == 0"> <td :style="{ width: specsWidth }" v-show="goodsInfoData.selectedSceneCode == 0">
<div style="transform: translateX(10px);"> <div style="transform: translateX(10px);">
<el-input style="width: 80px;" <el-input style="width: 80px;"
placeholder="服务时间" placeholder="服务时间"
...@@ -367,7 +367,7 @@ ...@@ -367,7 +367,7 @@
<span style="margin-left: 5px;"> 年</span> <span style="margin-left: 5px;"> 年</span>
</div> </div>
</td> </td>
<td :style="{ width: specsWidth }" v-if="goodsInfoData.selectedSceneCode != 0"> <td :style="{ width: specsWidth }" v-show="goodsInfoData.selectedSceneCode != 0">
<el-input placeholder="库存预警" <el-input placeholder="库存预警"
size="small" size="small"
style="transform: translateX(0);" style="transform: translateX(0);"
...@@ -376,7 +376,7 @@ ...@@ -376,7 +376,7 @@
@input="handleWarningValueInput($event, subIndex)"> @input="handleWarningValueInput($event, subIndex)">
</el-input> </el-input>
</td> </td>
<td :style="{ width: specsWidth }" v-if="goodsInfoData.selectedSceneCode != 0"> <td :style="{ width: specsWidth }" v-show="goodsInfoData.selectedSceneCode != 0">
<div style="transform: translateX(10px);"> <div style="transform: translateX(10px);">
<el-input style="width: 80px;" placeholder="质保" <el-input style="width: 80px;" placeholder="质保"
size="small" size="small"
......
...@@ -8,14 +8,14 @@ ...@@ -8,14 +8,14 @@
<td :style="{ width: specsWidth }"> <td :style="{ width: specsWidth }">
<span>商品</span> <span>商品</span>
</td> </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 class="color-red">*</span>
<span>部位</span> <span>部位</span>
</td> </td>
<td :style="{ width: specsWidth }" v-if="goodsInfoData.goodsType == 1"> <td :style="{ width: specsWidth }" v-show="goodsInfoData.goodsType == 1">
<span>型号</span> <span>型号</span>
</td> </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 class="color-red">*</span>
<span>可选择的服务项目(多选)</span> <span>可选择的服务项目(多选)</span>
</td> </td>
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<span class="color-red">*</span> <span class="color-red">*</span>
<span>成本/元</span> <span>成本/元</span>
</td> </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 class="color-red">*</span>
<span>采购价/卷</span> <span>采购价/卷</span>
</td> </td>
...@@ -35,14 +35,14 @@ ...@@ -35,14 +35,14 @@
<span class="color-red">*</span> <span class="color-red">*</span>
<span>最低价/元</span> <span>最低价/元</span>
</td> </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 class="color-red">*</span>
<span>服务时间</span> <span>服务时间</span>
</td> </td>
<td :style="{ width: specsWidth }" v-if="goodsInfoData.selectedSceneCode !== 0"> <td :style="{ width: specsWidth }" v-show="goodsInfoData.selectedSceneCode !== 0">
<span>库存预警</span> <span>库存预警</span>
</td> </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 class="color-red">*</span>
<span>质保/年</span> <span>质保/年</span>
</td> </td>
...@@ -59,8 +59,8 @@ ...@@ -59,8 +59,8 @@
v-for="(subItem, subIndex) in goodsInfoData.goodsSpecificationSingleList" v-for="(subItem, subIndex) in goodsInfoData.goodsSpecificationSingleList"
:key="subIndex"> :key="subIndex">
<td :style="{ width: specsWidth }"> <td :style="{ width: specsWidth }">
<span style="display: flex;align-items: center;justify-content: center;" v-if="!subItem.editGoodNameInput"> <span style="display: flex;align-items: center;justify-content: center;overflow: hidden;" v-if="!subItem.editGoodNameInput">
<span style="max-width: 160px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{ subItem.specificationData }}</span> <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)" /> <img src="@/assets/icon-edit.png" style="cursor: pointer;margin-left: 5px;width: 16px;height: 16px;" @click="editSpecificationData(subIndex)" />
</span> </span>
<el-input v-else placeholder="商品名称" <el-input v-else placeholder="商品名称"
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
</el-popover> </el-popover>
</el-input> </el-input>
</td> </td>
<td :style="{ width: specsWidth}" v-if="goodsInfoData.goodsType == 1"> <td :style="{ width: specsWidth}" v-show="goodsInfoData.goodsType == 1">
<el-select placeholder="部位" <el-select placeholder="部位"
size="small" size="small"
:class="{ 'w-80-per': true, 'w-100-per': true, 'border-red': filterEmpty(subItem.position) && subItem.positionEmpty }" :class="{ 'w-80-per': true, 'w-100-per': true, 'border-red': filterEmpty(subItem.position) && subItem.positionEmpty }"
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
</el-popover> </el-popover>
</el-select> </el-select>
</td> </td>
<td :style="{ width: specsWidth }" v-if="goodsInfoData.goodsType == 1"> <td :style="{ width: specsWidth }" v-show="goodsInfoData.goodsType == 1">
<el-input placeholder="型号" <el-input placeholder="型号"
size="small" size="small"
:class="{ 'w-80-per': true, 'w-100-per': true, }" :class="{ 'w-80-per': true, 'w-100-per': true, }"
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
@input="handleTypeInput($event, subIndex)"> @input="handleTypeInput($event, subIndex)">
</el-input> </el-input>
</td> </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="服务项目" <el-select placeholder="服务项目"
size="small" size="small"
:class="{ 'w-80-per': true, 'w-100-per': true, 'border-red': filterEmpty(subItem.serviceItemArr) && subItem.serviceItemArrEmpty }" :class="{ 'w-80-per': true, 'w-100-per': true, 'border-red': filterEmpty(subItem.serviceItemArr) && subItem.serviceItemArrEmpty }"
...@@ -160,7 +160,7 @@ ...@@ -160,7 +160,7 @@
</el-popover> </el-popover>
</el-input> </el-input>
</td> </td>
<td :style="{ width: specsWidth }" v-if="goodsInfoData.selectedSceneCode !== 0"> <td :style="{ width: specsWidth }" v-show="goodsInfoData.selectedSceneCode !== 0">
<el-input placeholder="采购价" <el-input placeholder="采购价"
size="small" size="small"
:class="{ 'w-80-per': true, 'w-100-per': true, 'border-red': filterEmpty(subItem.purchasePrice) && subItem.purchasePriceEmpty }" :class="{ 'w-80-per': true, 'w-100-per': true, 'border-red': filterEmpty(subItem.purchasePrice) && subItem.purchasePriceEmpty }"
...@@ -217,7 +217,7 @@ ...@@ -217,7 +217,7 @@
</el-popover> </el-popover>
</el-input> </el-input>
</td> </td>
<td :style="{ width: specsWidth }" v-if="goodsInfoData.selectedSceneCode === 0"> <td :style="{ width: specsWidth }" v-show="goodsInfoData.selectedSceneCode === 0">
<div style="transform: translateX(10px);"> <div style="transform: translateX(10px);">
<el-input style="width: 80px;" <el-input style="width: 80px;"
placeholder="服务时间" placeholder="服务时间"
...@@ -239,7 +239,7 @@ ...@@ -239,7 +239,7 @@
<span style="margin-left: 5px;"> 年</span> <span style="margin-left: 5px;"> 年</span>
</div> </div>
</td> </td>
<td :style="{ width: specsWidth }" v-if="goodsInfoData.selectedSceneCode !== 0"> <td :style="{ width: specsWidth }" v-show="goodsInfoData.selectedSceneCode !== 0">
<el-input placeholder="库存预警" <el-input placeholder="库存预警"
size="small" size="small"
style="transform: translateX(0);" style="transform: translateX(0);"
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
@input="handleWarningValueInput($event, subIndex)"> @input="handleWarningValueInput($event, subIndex)">
</el-input> </el-input>
</td> </td>
<td :style="{ width: specsWidth }" v-if="goodsInfoData.selectedSceneCode !== 0"> <td :style="{ width: specsWidth }" v-show="goodsInfoData.selectedSceneCode !== 0">
<div style="transform: translateX(10px);"> <div style="transform: translateX(10px);">
<el-input style="width: 80px;" <el-input style="width: 80px;"
placeholder="质保" placeholder="质保"
......
...@@ -4,26 +4,17 @@ ...@@ -4,26 +4,17 @@
<!-- class="order-detail" --> <!-- class="order-detail" -->
<d2-container> <d2-container>
<!-- <div class="offline-account"> --> <!-- <div class="offline-account"> -->
<div class="header" <div class="header" slot="header" style="padding: 10px 20px;">
slot="header" <d2-search ref="showSearch" class="show-search" :search-form="searchForm" :search-select-obj="searchSelectObj"
style="padding: 10px 20px;">
<d2-search ref="showSearch"
class="show-search"
:search-form="searchForm"
:search-select-obj="searchSelectObj"
:form-data="showFormData" /> :form-data="showFormData" />
<div class="up-btns"> <div class="up-btns">
<el-button @click="handleSearch" <el-button @click="handleSearch" size="small" type="primary">
size="small"
type="primary">
查询 查询
</el-button> </el-button>
<el-button size="small" <el-button size="small" @click="handleReset">
@click="handleReset">
重置 重置
</el-button> </el-button>
<el-button size="small" <el-button size="small" @click="handleRecord">
@click="handleRecord">
返回 返回
</el-button> </el-button>
</div> </div>
...@@ -32,62 +23,41 @@ ...@@ -32,62 +23,41 @@
<d2-container> --> <d2-container> -->
<div class="d2-container-content"> <div class="d2-container-content">
<d2-table-header :left-span="13"> <d2-table-header :left-span="13">
<span slot="left" <span slot="left" class="leftSpan">共<span class="count-txt">{{ countObj.totalCount }}</span>条交易记录,总金额<span
class="leftSpan">共<span class="count-txt">{{ countObj.totalAmount }}</span>元,已补录<span class="count-txt">{{ countObj.inputtedCount
class="count-txt">{{ countObj.totalCount }}</span>条交易记录,总金额<span }}</span>条,未补录<span class="count-txt">{{ countObj.waitInputCount }}</span>条,未关联<span class="count-txt">{{
class="count-txt">{{ countObj.totalAmount }}</span>元,已补录<span countObj.notAssociatedCount }}</span>条,无需补录<span class="count-txt">{{ countObj.needNoSupplementCount
class="count-txt">{{ countObj.inputtedCount }}</span>条,未补录<span }}</span>条,待确认补录<span class="count-txt">{{ countObj.waitConfirmInputCount }}</span>条。</span>
class="count-txt">{{ countObj.waitInputCount }}</span>条,未关联<span <el-button type="primary" @click="batchRecord">
class="count-txt">{{ countObj.notAssociatedCount }}</span>条,无需补录<span
class="count-txt">{{ countObj.needNoSupplementCount }}</span>条,待确认补录<span
class="count-txt">{{ countObj.waitConfirmInputCount }}</span>条。</span>
<el-button type="primary"
@click="batchRecord">
批量确认补录 批量确认补录
</el-button> </el-button>
<el-button type="primary" <el-button type="primary" @click="batchUpdateYqMerchant">
@click="batchUpdateYqMerchant">
<!-- 批量修改所属园区店 --> <!-- 批量修改所属园区店 -->
批量修改所属服务对接 批量修改所属服务对接
</el-button> </el-button>
<el-button type="primary" <el-button type="primary" @click="batchMarkAsNoUse">
@click="batchMarkAsNoUse">
批量标记为无需补录 批量标记为无需补录
</el-button> </el-button>
<el-button type="primary" <el-button type="primary" @click="handleExport">
@click="handleExport">
导出 导出
</el-button> </el-button>
</d2-table-header> </d2-table-header>
<!-- :beforeSearchFn="beforeSearchFn" --> <!-- :beforeSearchFn="beforeSearchFn" -->
<d2-table ref="recordTable" <d2-table ref="recordTable" :get-list-api="getListApi" :search-form="searchFormSearch" :table-params="tableParams"
:get-list-api="getListApi" :before-search-fn="beforeSearchFn" :selectable-fn="selectableFn">
:search-form="searchFormSearch" <template slot="auth-button" slot-scope="scope">
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
:selectable-fn="selectableFn">
<template slot="auth-button"
slot-scope="scope">
<!-- 已分帐无可操作内容 --> <!-- 已分帐无可操作内容 -->
<div v-if="scope.scope.inputStatus !== '6'"> <div v-if="scope.scope.inputStatus !== '6'">
<el-button type="text" <el-button type="text" v-if="scope.scope.inputStatus == '1'" @click="orderDetail(scope.scope)">
v-if="scope.scope.inputStatus == '1'"
@click="orderDetail(scope.scope)">
订单详情 订单详情
</el-button> </el-button>
<el-button type="text" <el-button type="text" v-if="scope.scope.inputStatus == '0'" @click="relatActivityOrder(scope.scope)">
v-if="scope.scope.inputStatus == '0'"
@click="relatActivityOrder(scope.scope)">
关联活动订单 关联活动订单
</el-button> </el-button>
<el-button type="text" <el-button type="text" v-if="scope.scope.inputStatus == '4'" @click="record(scope.scope)">
v-if="scope.scope.inputStatus == '4'"
@click="record(scope.scope)">
确认补录 确认补录
</el-button> </el-button>
<el-button type="text" <el-button type="text" v-if="scope.scope.inputStatus == '4'" @click="cancelRelat(scope.scope)">
v-if="scope.scope.inputStatus == '4'"
@click="cancelRelat(scope.scope)">
取消关联 取消关联
</el-button> </el-button>
<!-- <el-button type="text" <!-- <el-button type="text"
...@@ -106,24 +76,16 @@ ...@@ -106,24 +76,16 @@
</div> </div>
</d2-container> </d2-container>
<!-- 批量修改所属园区店 --> <!-- 批量修改所属园区店 -->
<update-yqMerchant-dialog :merchant-visible="merchantDialogVisible" <update-yqMerchant-dialog :merchant-visible="merchantDialogVisible" :id-list="ids" v-if="merchantDialogVisible"
:id-list="ids"
v-if="merchantDialogVisible"
@dialogClose="dialogClose" /> @dialogClose="dialogClose" />
<!-- 关联活动订单 --> <!-- 关联活动订单 -->
<relat-activity-order-dialog :relat-activity-visible="relatActivityVisible" <relat-activity-order-dialog :relat-activity-visible="relatActivityVisible" :order-id="orderId"
:order-id="orderId" v-if="relatActivityVisible" @dialogClose="relatDialogClose" />
v-if="relatActivityVisible"
@dialogClose="relatDialogClose" />
<!-- 选择分账规则 --> <!-- 选择分账规则 -->
<choose-rule-dialog :rule-visible="ruleVisible" <choose-rule-dialog :rule-visible="ruleVisible" :record-info="recordInfo" v-if="ruleVisible"
:record-info="recordInfo"
v-if="ruleVisible"
@dialogClose="ruleDialogClose" /> @dialogClose="ruleDialogClose" />
<!-- 选择分账规则 --> <!-- 选择分账规则 -->
<rule-info-dialog :rule-info-visible="ruleInfoVisible" <rule-info-dialog :rule-info-visible="ruleInfoVisible" :record-info="recordInfo" v-if="ruleInfoVisible"
:record-info="recordInfo"
v-if="ruleInfoVisible"
@dialogClose="ruleInfoDialogClose" /> @dialogClose="ruleInfoDialogClose" />
</div> </div>
</template> </template>
...@@ -133,6 +95,7 @@ import { Util, deepClone } from '@/common/util' ...@@ -133,6 +95,7 @@ import { Util, deepClone } from '@/common/util'
import { mapActions, mapState } from 'vuex' import { mapActions, mapState } from 'vuex'
import { getServiceStore, getParkStore } from '@api/editCustomer' import { getServiceStore, getParkStore } from '@api/editCustomer'
import { payTypeList } from '@/common/constants.js' import { payTypeList } from '@/common/constants.js'
import { listShop4sByRef } from '@api/merchant'
import { waitinputorderCount, waitinputorderPage, getList, markAsNoUse, batchUpdateToNotInput, batchUpdateConfirmInput } from '@api/order' import { waitinputorderCount, waitinputorderPage, getList, markAsNoUse, batchUpdateToNotInput, batchUpdateConfirmInput } from '@api/order'
import updateYqMerchantDialog from './updateYqMerchantDialog' import updateYqMerchantDialog from './updateYqMerchantDialog'
import relatActivityOrderDialog from './relatActivityOrderDialog' import relatActivityOrderDialog from './relatActivityOrderDialog'
...@@ -222,7 +185,8 @@ export default { ...@@ -222,7 +185,8 @@ export default {
// 获取流量方 // 获取流量方
this.getServiceStore(value) this.getServiceStore(value)
} else { } else {
this.baseData.storeIdList = [] // this.baseData.storeIdList = []
this.getAllServiceStore()
} }
this.searchForm.shopMerchantId = '' this.searchForm.shopMerchantId = ''
this.getOptionsList() this.getOptionsList()
...@@ -235,7 +199,7 @@ export default { ...@@ -235,7 +199,7 @@ export default {
optionList: [], optionList: [],
optionId: 'merchantId', optionId: 'merchantId',
optionLabel: 'merchantName', optionLabel: 'merchantName',
optionsName: 'storeIdList', optionsName: 'storeIdList'
// changeAttr: (value, targetItem) => { // changeAttr: (value, targetItem) => {
// if (value) { // if (value) {
// // // 获取二级流量方 // // // 获取二级流量方
...@@ -383,7 +347,7 @@ export default { ...@@ -383,7 +347,7 @@ export default {
} }
], ],
payTypeList: clonePayTypeList, payTypeList: clonePayTypeList,
storeIdList: [], storeIdList: []
}, },
merchantDialogVisible: false, merchantDialogVisible: false,
...@@ -401,6 +365,7 @@ export default { ...@@ -401,6 +365,7 @@ export default {
}) })
}, },
mounted() { mounted() {
this.getAllServiceStore()
this.userInfo.beSuper && getParkStore({}).then(res => { this.userInfo.beSuper && getParkStore({}).then(res => {
res.forEach(item => { res.forEach(item => {
item.merchantId = item.merchantNo item.merchantId = item.merchantNo
...@@ -417,7 +382,15 @@ export default { ...@@ -417,7 +382,15 @@ export default {
close: 'd2admin/page/close' close: 'd2admin/page/close'
}), }),
...mapActions('d2admin/user', ['actionSetDownloadList']), ...mapActions('d2admin/user', ['actionSetDownloadList']),
getAllServiceStore() {
listShop4sByRef({
scene: 1
}).then(res => {
console.log('this.getAllServiceStore()', res)
this.baseData.storeIdList = res || []
this.getOptionsList()
})
},
beforeSearchFn() { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
this.searchFormSearch = deepClone(this.searchForm) this.searchFormSearch = deepClone(this.searchForm)
...@@ -485,6 +458,7 @@ export default { ...@@ -485,6 +458,7 @@ export default {
} }
this.baseData.storeIdList = [] this.baseData.storeIdList = []
this.$refs.recordTable.refreshTable() this.$refs.recordTable.refreshTable()
this.getAllServiceStore()
this.getCount() this.getCount()
}, },
...@@ -720,7 +694,7 @@ export default { ...@@ -720,7 +694,7 @@ export default {
this.baseData.storeIdList = res || [] this.baseData.storeIdList = res || []
this.getOptionsList() this.getOptionsList()
}) })
}, }
} }
} }
...@@ -731,6 +705,7 @@ export default { ...@@ -731,6 +705,7 @@ export default {
color: #2a58ad; color: #2a58ad;
margin: 0 2px; margin: 0 2px;
} }
.leftSpan { .leftSpan {
display: inline-block; display: inline-block;
box-sizing: border-box; box-sizing: border-box;
......
...@@ -407,7 +407,7 @@ ...@@ -407,7 +407,7 @@
<el-radio :label="2"> 按整单计算 </el-radio> <el-radio :label="2"> 按整单计算 </el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<div> <div style="display: flex;">
<el-form-item <el-form-item
:prop="'platformPublic.' + index + '.expenseCategoryCalculateType'" :prop="'platformPublic.' + index + '.expenseCategoryCalculateType'"
:rules="[ :rules="[
...@@ -430,7 +430,6 @@ ...@@ -430,7 +430,6 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
</div>
<el-form-item <el-form-item
required required
:prop="'platformPublic.' + index + '.expenseCategoryValue'" :prop="'platformPublic.' + index + '.expenseCategoryValue'"
...@@ -476,6 +475,7 @@ ...@@ -476,6 +475,7 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
</div> </div>
</div>
<!-- <p>区别</p> --> <!-- <p>区别</p> -->
</el-form> </el-form>
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<auth-button slot="auth-button" :show-btn-ids="['90603010']" :data="scope.scope" /> <auth-button slot="auth-button" :show-btn-ids="['90603010']" :data="scope.scope" />
</span> </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" /> <auth-button slot="auth-button" :show-btn-ids="['9060305']" :data="scope.scope" />
</div> </div>
......
...@@ -840,7 +840,7 @@ export default { ...@@ -840,7 +840,7 @@ export default {
.map((item) => { .map((item) => {
item.targetMerchantName = item.merchant?.merchantName item.targetMerchantName = item.merchant?.merchantName
item.targetMerchantId = item.merchant?.merchantId item.targetMerchantId = item.merchant?.merchantId
item.merchant = null // item.merchant = null
return item return item
}) })
// console.log('flowServiceCostArr: ', flowServiceCostArr) // console.log('flowServiceCostArr: ', flowServiceCostArr)
......
...@@ -435,6 +435,8 @@ export default { ...@@ -435,6 +435,8 @@ export default {
}, },
// 校验所有form数据 // 校验所有form数据
async verifyFormData() { async verifyFormData() {
// 校验重置数据 防止重复push
this.goodsTypeGroupRulesAll = []
for (var index = 0; index < this.editableTabs.length; index++) { for (var index = 0; index < this.editableTabs.length; index++) {
const node = this.$refs[`classification${this.editableTabs[index].name}`][0] const node = this.$refs[`classification${this.editableTabs[index].name}`][0]
this.errorIndex = index this.errorIndex = index
......
...@@ -33,13 +33,13 @@ export default { ...@@ -33,13 +33,13 @@ export default {
data() { data() {
return { return {
sceneList: [{ sceneList: [{
sceneName: '1.1 精品升级', sceneName: '精品升级',
sceneDesc: '1.1 太阳膜升级转化下单', sceneDesc: '太阳膜升级转化下单',
sceneType: 1, sceneType: 1,
isOpen: 'N' isOpen: 'N'
}, { }, {
sceneName: '2.0 会员权益/升级', sceneName: '会员权益/升级',
sceneDesc: '2.0 新车车损下单', sceneDesc: '新车车损下单',
sceneType: 0, sceneType: 0,
isOpen: 'N' isOpen: 'N'
}] }]
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!